@reddb-io/ui 0.3.0 → 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/assets/AnalyticsView.BLAJezw4.css +1 -0
- package/build/_app/immutable/assets/{Workspace.CvP5De7i.css → Workspace.DM2E1WiF.css} +1 -1
- package/build/_app/immutable/chunks/{C9rXzYLu.js → B-yl15ta.js} +1 -1
- package/build/_app/immutable/chunks/B5euRbKa.js +1 -0
- package/build/_app/immutable/chunks/BRIMmWzq.js +1 -0
- package/build/_app/immutable/chunks/BgOTHNR5.js +1 -0
- package/build/_app/immutable/chunks/Bgb6fHGb.js +18 -0
- package/build/_app/immutable/chunks/Btd6PFkC.js +1 -0
- package/build/_app/immutable/chunks/C-kqMbRi.js +1 -0
- package/build/_app/immutable/chunks/C3SGj6Qd.js +2 -0
- package/build/_app/immutable/chunks/{C278awGv.js → C7kf23SQ.js} +1 -1
- package/build/_app/immutable/chunks/CGFL56WJ.js +1 -0
- 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/DCJ0QyYH.js +1 -0
- package/build/_app/immutable/chunks/DN7v3Tar.js +2 -0
- package/build/_app/immutable/chunks/DRlh90Cv.js +1 -0
- package/build/_app/immutable/entry/app.BeX4Tmu5.js +2 -0
- 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.DeFqKRR2.js +96 -0
- package/build/_app/immutable/nodes/12.CzMvqoYS.js +3 -0
- package/build/_app/immutable/nodes/14.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/15.CRDBqbiH.js +60 -0
- package/build/_app/immutable/nodes/8.CAG5_cGP.js +1 -0
- package/build/_app/version.json +1 -1
- package/build/index.html +18 -15
- package/dist/embed/AnalyticsView-SKyGxeAx.js +23337 -0
- package/dist/embed/AnalyticsView-SKyGxeAx.js.map +1 -0
- package/dist/embed/RedUiEmbedRoot-BzVzGAFK.js +31960 -0
- 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-0hA141D2.js +85 -0
- package/dist/embed/index-0hA141D2.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-BHUUkI8H.js +3304 -0
- package/dist/embed/index-client-BHUUkI8H.js.map +1 -0
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-D5yoExsH.js → sigma.esm-BawyGZ3s.js} +2 -2
- package/dist/embed/{sigma.esm-D5yoExsH.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 +7 -3
- package/src/app.css +86 -20
- package/src/lib/AnalyticsView.svelte +209 -0
- package/src/lib/AskView.svelte +255 -0
- package/src/lib/ClusterView.svelte +415 -95
- package/src/lib/CommandPalette.svelte +2 -0
- 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/GlobalProgressBar.svelte +9 -0
- package/src/lib/LoadingOverlay.svelte +109 -0
- package/src/lib/MetricChart.svelte +85 -0
- package/src/lib/QueryEditor.svelte +48 -7
- package/src/lib/ResultsPane.svelte +76 -8
- package/src/lib/SchemaTree.svelte +25 -1
- package/src/lib/SecurityView.svelte +176 -65
- package/src/lib/SettingsView.svelte +1111 -254
- package/src/lib/StatusBar.svelte +19 -1
- package/src/lib/Topbar.svelte +29 -1
- package/src/lib/Workspace.svelte +136 -5
- package/src/lib/activity.svelte.ts +44 -35
- package/src/lib/collection-preview.ts +14 -0
- package/src/lib/connections.svelte.ts +167 -4
- package/src/lib/embed/RedUiEmbedRoot.svelte +13 -8
- package/src/lib/embed/index.ts +34 -1
- package/src/lib/index.ts +10 -0
- package/src/lib/loading.svelte.ts +142 -0
- package/src/lib/permission-gate.ts +120 -0
- package/src/lib/policies.ts +136 -0
- package/src/lib/query-tabs.svelte.ts +132 -53
- package/src/lib/reddb/analytics.ts +208 -0
- package/src/lib/reddb/ask.ts +123 -0
- package/src/lib/reddb/client.ts +292 -73
- package/src/lib/reddb/cluster-status.ts +306 -0
- package/src/lib/reddb/desktop-error.ts +89 -0
- package/src/lib/reddb/dev-console.ts +186 -0
- package/src/lib/reddb/index.ts +5 -0
- package/src/lib/reddb/local-url-provider.ts +28 -1
- package/src/lib/reddb/redwire-ws-spike.ts +590 -0
- package/src/lib/reddb/tauri-encrypted-store.ts +4 -9
- package/src/lib/router.svelte.ts +12 -0
- package/src/lib/settings-authoring-client.ts +336 -0
- package/src/lib/settings-sections.ts +292 -196
- package/src/lib/tabs.svelte.ts +5 -0
- package/src/lib/workspace-session.ts +81 -0
- package/build/_app/immutable/assets/0.DQDLkSdR.css +0 -1
- package/build/_app/immutable/chunks/65XjEwaF.js +0 -367
- package/build/_app/immutable/chunks/BGcIe2ep.js +0 -2
- package/build/_app/immutable/chunks/BjFADNkA.js +0 -992
- package/build/_app/immutable/chunks/BrvvOVaJ.js +0 -1
- package/build/_app/immutable/chunks/D9CTkMjK.js +0 -1
- package/build/_app/immutable/chunks/oiO4RLqp.js +0 -1
- package/build/_app/immutable/chunks/pDJnDxXM.js +0 -1
- package/build/_app/immutable/entry/app.DdaMXHAv.js +0 -2
- package/build/_app/immutable/entry/start.-MLBtQXB.js +0 -1
- package/build/_app/immutable/nodes/0.Ysoz3Y3h.js +0 -1
- package/build/_app/immutable/nodes/1.C2jbGTOJ.js +0 -1
- package/build/_app/immutable/nodes/12.DQG5zpEx.js +0 -60
- package/build/_app/immutable/nodes/8.CrHI4F9p.js +0 -134
- package/dist/embed/RedUiEmbedRoot-BwFUA5X-.js +0 -28624
- package/dist/embed/RedUiEmbedRoot-BwFUA5X-.js.map +0 -1
- package/dist/embed/index-DGhgtnaK.js +0 -577
- package/dist/embed/index-DGhgtnaK.js.map +0 -1
- package/dist/embed/index-client-ItCEU64C.js +0 -3087
- package/dist/embed/index-client-ItCEU64C.js.map +0 -1
- /package/build/_app/immutable/assets/{12.Dblyk0Kr.css → 15.Dblyk0Kr.css} +0 -0
- /package/build/_app/immutable/nodes/{10.CAG5_cGP.js → 13.CAG5_cGP.js} +0 -0
|
@@ -1,992 +0,0 @@
|
|
|
1
|
-
var vd=Object.defineProperty;var Wi=t=>{throw TypeError(t)};var gd=(t,e,n)=>e in t?vd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wt=(t,e,n)=>gd(t,typeof e!="symbol"?e+"":e,n),ha=(t,e,n)=>e.has(t)||Wi("Cannot "+n);var ce=(t,e,n)=>(ha(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(t,e,n)=>e.has(t)?Wi("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Er=(t,e,n,o)=>(ha(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),Yi=(t,e,n)=>(ha(t,e,"access private method"),n);import"./Bzak7iHL.js";import{aG as pd,at as hd,aS as xd,bp as j,ay as go,be as Xi,ar as Mr,aw as Gi,Q as bd,b0 as md,ax as $i,e as _d,as as yd,aA as wd,p as kd,a4 as Sd,w as Cd,v as Nd,ae as pi,bs as Cn,b2 as Ed,a7 as Md,b7 as zd,aZ as $e,aU as Rn,b9 as T,aj as ve,am as r,aW as Ze,bl as xe,a0 as d,aR as Gt,b3 as c,bi as g,bv as E,bq as Td,aY as kt,aQ as Ee,ba as hi,ao as na,bw as It,br as on,b1 as dl,aT as ra,av as Pd,bx as Id,af as ul,ai as Yt,a as Jt,ah as Ad}from"./oiO4RLqp.js";import{b as xa,d as Ve,a as h,j as k,g as Nt,s as P,h as be,i as zn,t as pt,k as Vt,e as Ld,q as Ka}from"./BGcIe2ep.js";import{i as X,_ as Od,p as qe,b as tn,l as nt,s as et,c as Gn,r as er}from"./D9CTkMjK.js";import{M as Oe,O as $t,V as St,l as We,J as Se,I as rt,U as ot,p as Ue,z as Dt,k as Kt,b as mn,r as Je,X as Zt,v as Ft,y as Rd,g as Mt,n as Dd,N as fl,e as un,D as Ot,f as Vd,q as Ar,x as xi,K as vl,F as bi,c as oa,d as Hd,G as qd,u as Fd,j as Ba,T as Kd,i as Bd,Q as gl,a as ba,W as jd,L as Ud,h as Dn,C as mi,S as aa,w as Wd,P as Yd,R as Xd,E as Rr,H as Gd,B as $d}from"./65XjEwaF.js";import"./69_IOA4Y.js";const Zd=[];function pl(t,e=!1,n=!1){return Eo(t,new Map,"",Zd,null,n)}function Eo(t,e,n,o,a=null,s=!1){if(typeof t=="object"&&t!==null){var i=e.get(t);if(i!==void 0)return i;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(pd(t)){var l=Array(t.length);e.set(t,l),a!==null&&e.set(a,l);for(var u=0;u<t.length;u+=1){var f=t[u];u in t&&(l[u]=Eo(f,e,n,o,null,s))}return l}if(hd(t)===xd){l={},e.set(t,l),a!==null&&e.set(a,l);for(var v of Object.keys(t))l[v]=Eo(t[v],e,n,o,null,s);return l}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!s)return Eo(t.toJSON(),e,n,o,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}function Qd(t,e,n=!1,o=!1,a=!1,s=!1){var i=t,l="";if(n){var u=t;go&&(i=Xi(Mr(u)))}j(()=>{var f=bd;if(l===(l=e()??"")){go&&Gi();return}if(n&&!go){f.nodes=null,u.innerHTML=l,l!==""&&xa(Mr(u),u.lastChild);return}if(f.nodes!==null&&(md(f.nodes.start,f.nodes.end),f.nodes=null),l!==""){if(go){$i.data;for(var v=Gi(),x=v;v!==null&&(v.nodeType!==_d||v.data!=="");)x=v,v=yd(v);if(v===null)throw wd(),kd;xa($i,x),i=Xi(v);return}var p=o?Cd:a?Nd:void 0,w=Sd(o?"svg":a?"math":"template",p);w.innerHTML=l;var _=o||a?w:w.content;if(xa(Mr(_),_.lastChild),o||a)for(;Mr(_);)i.before(Mr(_));else i.before(_)}})}function Xt(t,e,n){pi(()=>{var o=Cn(()=>e(t,n==null?void 0:n())||{});if(n&&(o!=null&&o.update)){var a=!1,s={};Ed(()=>{var i=n();Md(i),a&&zd(s,i)&&(s=i,o.update(i))}),a=!0}if(o!=null&&o.destroy)return()=>o.destroy()})}var On,hr,Ur,ea,hl;const ta=class ta{constructor(e){He(this,ea);He(this,On,new WeakMap);He(this,hr);He(this,Ur);Er(this,Ur,e)}observe(e,n){var o=ce(this,On).get(e)||new Set;return o.add(n),ce(this,On).set(e,o),Yi(this,ea,hl).call(this).observe(e,ce(this,Ur)),()=>{var a=ce(this,On).get(e);a.delete(n),a.size===0&&(ce(this,On).delete(e),ce(this,hr).unobserve(e))}}};On=new WeakMap,hr=new WeakMap,Ur=new WeakMap,ea=new WeakSet,hl=function(){return ce(this,hr)??Er(this,hr,new ResizeObserver(e=>{for(var n of e){ta.entries.set(n.target,n);for(var o of ce(this,On).get(n.target)||[])o(n)}}))},wt(ta,"entries",new WeakMap);let ja=ta;var Jd=new ja({box:"border-box"});function Zi(t,e,n){var o=Jd.observe(t,()=>n(t[e]));pi(()=>(Cn(()=>n(t[e])),o))}var eu=k('<div><div class="flex items-center gap-2 svelte-1js76h4"><div class="w-2 h-2 rounded-full bg-accent shadow-[0_0_12px_var(--color-accent-glow)] svelte-1js76h4"></div> <span class="font-mono font-semibold text-fg-0 text-[15px] tracking-tight">red<span class="text-accent mx-px">·</span>ui</span></div></div>');function tu(t,e){$e(e,!0);let n=xe(!0),o=xe(0);Rn(()=>{const l=setTimeout(()=>T(o,1),20),u=setTimeout(()=>T(o,2),800),f=setTimeout(()=>{var v;T(n,!1),(v=e.onDone)==null||v.call(e)},1e3);return()=>{clearTimeout(l),clearTimeout(u),clearTimeout(f)}});var a=Ve(),s=ve(a);{var i=l=>{var u=eu();let f,v;j(()=>{f=Oe(u,1,"fixed inset-0 z-[9999] grid place-items-center bg-bg-0 transition-opacity duration-200 ease-out svelte-1js76h4",null,f,{"opacity-0":r(o)===2,"opacity-100":r(o)===1,"pointer-events-none":r(o)===2}),v=$t(u,"",v,{opacity:r(o)===0?0:void 0})}),h(l,u)};X(s,l=>{r(n)&&l(i)})}h(t,a),Ze()}var nu=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Qi=t=>t===!1?"false":t===!0?"true":t===0?"0":t,Wt=t=>{if(!t||typeof t!="object")return!0;for(let e in t)return!1;return!0},ru=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;let n=Object.keys(t),o=Object.keys(e);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++){let s=n[a];if(!o.includes(s)||t[s]!==e[s])return!1}return!0};function xl(t,e){for(let n=0;n<t.length;n++){let o=t[n];Array.isArray(o)?xl(o,e):e.push(o)}}var bl=(...t)=>{let e=[];xl(t,e);let n=[];for(let o=0;o<e.length;o++)e[o]&&n.push(e[o]);return n},ml=(t,e)=>{let n={};for(let o in t){let a=t[o];if(o in e){let s=e[o];Array.isArray(a)||Array.isArray(s)?n[o]=bl(s,a):typeof a=="object"&&typeof s=="object"&&a&&s?n[o]=ml(a,s):n[o]=s+" "+a}else n[o]=a}for(let o in e)o in t||(n[o]=e[o]);return n},ou=/\s+/g,Ji=t=>!t||typeof t!="string"?t:t.replace(ou," ").trim(),cr=null,Mo=null,au=async()=>cr||Mo||(Mo=Od(()=>import("./3j4cZ58b.js"),[],import.meta.url).then(t=>(cr=t,t)).catch(()=>null),Mo),iu=t=>e=>{if(Mo&&!cr)return e;if(cr){let{twMerge:n,extendTailwindMerge:o}=cr;return(Wt(t)?n:o({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(e)}try{let{twMerge:n,extendTailwindMerge:o}=nu("tailwind-merge");return cr={twMerge:n,extendTailwindMerge:o},(Wt(t)?n:o({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(e)}catch{return au(),e}},su={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Vo=(...t)=>{let e=[];_l(t,e);let n="";for(let o=0;o<e.length;o++)e[o]&&(n&&(n+=" "),n+=e[o]);return n||void 0};function _l(t,e){for(let n=0;n<t.length;n++){let o=t[n];Array.isArray(o)?_l(o,e):o&&e.push(o)}}var ma=null,Ua={},Wa=!1,po=(...t)=>e=>{let n=Vo(t);return!n||!e.twMerge?n:((!ma||Wa)&&(Wa=!1,ma=iu(Ua)),ma(n)||void 0)},es=(t,e)=>{for(let n in e)n in t?t[n]=Vo(t[n],e[n]):t[n]=e[n];return t},_i=(t,e)=>{let{extend:n=null,slots:o={},variants:a={},compoundVariants:s=[],compoundSlots:i=[],defaultVariants:l={}}=t,u={...su,...e},f=n!=null&&n.base?Vo(n.base,t==null?void 0:t.base):t==null?void 0:t.base,v=n!=null&&n.variants&&!Wt(n.variants)?ml(a,n.variants):a,x=n!=null&&n.defaultVariants&&!Wt(n.defaultVariants)?{...n.defaultVariants,...l}:l;!Wt(u.twMergeConfig)&&!ru(u.twMergeConfig,Ua)&&(Wa=!0,Ua=u.twMergeConfig);let p=Wt(n==null?void 0:n.slots),w=Wt(o)?{}:{base:Vo(t==null?void 0:t.base,p&&(n==null?void 0:n.base)),...o},_=p?w:es({...n==null?void 0:n.slots},Wt(w)?{base:t==null?void 0:t.base}:w),I=Wt(n==null?void 0:n.compoundVariants)?s:bl(n==null?void 0:n.compoundVariants,s),H=L=>{if(Wt(v)&&Wt(o)&&p)return po(f,L==null?void 0:L.class,L==null?void 0:L.className)(u);if(I&&!Array.isArray(I))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof I}`);if(i&&!Array.isArray(i))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof i}`);let V=(b,M,m=[],N)=>{let C=m;if(typeof M=="string"){let R=Ji(M).split(" ");for(let F=0;F<R.length;F++)C.push(`${b}:${R[F]}`)}else if(Array.isArray(M))for(let R=0;R<M.length;R++)C.push(`${b}:${M[R]}`);else if(typeof M=="object"&&typeof N=="string"&&N in M){let R=M[N];if(R&&typeof R=="string"){let F=Ji(R).split(" "),J=[];for(let A=0;A<F.length;A++)J.push(`${b}:${F[A]}`);C[N]=C[N]?C[N].concat(J):J}else if(Array.isArray(R)&&R.length>0){let F=[];for(let J=0;J<R.length;J++)F.push(`${b}:${R[J]}`);C[N]=F}}return C},q=(b,M=v,m=null,N=null)=>{let C=M[b];if(!C||Wt(C))return null;let R=(N==null?void 0:N[b])??(L==null?void 0:L[b]);if(R===null)return null;let F=Qi(R),J=Array.isArray(u.responsiveVariants)&&u.responsiveVariants.length>0||u.responsiveVariants===!0,A=x==null?void 0:x[b],y=[];if(typeof F=="object"&&J)for(let[W,oe]of Object.entries(F)){let Z=C[oe];if(W==="initial"){A=oe;continue}Array.isArray(u.responsiveVariants)&&!u.responsiveVariants.includes(W)||(y=V(W,Z,y,m))}let S=F!=null&&typeof F!="object"?F:Qi(A),z=C[S||"false"];return typeof y=="object"&&typeof m=="string"&&y[m]?es(y,z):y.length>0?(y.push(z),m==="base"?y.join(" "):y):z},U=()=>{if(!v)return null;let b=Object.keys(v),M=[];for(let m=0;m<b.length;m++){let N=q(b[m],v);N&&M.push(N)}return M},ie=(b,M)=>{if(!v||typeof v!="object")return null;let m=[];for(let N in v){let C=q(N,v,b,M),R=b==="base"&&typeof C=="string"?C:C&&C[b];R&&m.push(R)}return m},de={};for(let b in L){let M=L[b];M!==void 0&&(de[b]=M)}let ae=(b,M)=>{var N;let m=typeof(L==null?void 0:L[b])=="object"?{[b]:(N=L[b])==null?void 0:N.initial}:{};return{...x,...de,...m,...M}},$=(b=[],M)=>{let m=[],N=b.length;for(let C=0;C<N;C++){let{class:R,className:F,...J}=b[C],A=!0,y=ae(null,M);for(let S in J){let z=J[S],W=y[S];if(Array.isArray(z)){if(!z.includes(W)){A=!1;break}}else{if((z==null||z===!1)&&(W==null||W===!1))continue;if(W!==z){A=!1;break}}}A&&(R&&m.push(R),F&&m.push(F))}return m},fe=b=>{let M=$(I,b);if(!Array.isArray(M))return M;let m={},N=po;for(let C=0;C<M.length;C++){let R=M[C];if(typeof R=="string")m.base=N(m.base,R)(u);else if(typeof R=="object")for(let F in R)m[F]=N(m[F],R[F])(u)}return m},O=b=>{if(i.length<1)return null;let M={},m=ae(null,b);for(let N=0;N<i.length;N++){let{slots:C=[],class:R,className:F,...J}=i[N];if(!Wt(J)){let A=!0;for(let y in J){let S=m[y],z=J[y];if(S===void 0||(Array.isArray(z)?!z.includes(S):z!==S)){A=!1;break}}if(!A)continue}for(let A=0;A<C.length;A++){let y=C[A];M[y]||(M[y]=[]),M[y].push([R,F])}}return M};if(!Wt(o)||!p){let b={};if(typeof _=="object"&&!Wt(_)){let M=po;for(let m in _)b[m]=N=>{let C=fe(N),R=O(N);return M(_[m],ie(m,N),C?C[m]:void 0,R?R[m]:void 0,N==null?void 0:N.class,N==null?void 0:N.className)(u)}}return b}return po(f,U(),$(I),L==null?void 0:L.class,L==null?void 0:L.className)(u)},D=()=>{if(!(!v||typeof v!="object"))return Object.keys(v)};return H.variantKeys=D(),H.extend=n,H.base=f,H.slots=_,H.variants=v,H.defaultVariants=x,H.compoundSlots=i,H.compoundVariants=I,H};_i({base:"inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium tracking-tight border border-transparent cursor-pointer transition-[background,border-color,color,box-shadow] duration-150 active:scale-[0.98] disabled:opacity-40 disabled:cursor-not-allowed disabled:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40",variants:{variant:{primary:"bg-accent text-white shadow-[0_0_0_1px_var(--color-accent),0_4px_14px_-4px_var(--color-accent-glow)] hover:bg-[#ff3868] hover:shadow-[0_0_0_1px_#ff3868,0_6px_18px_-4px_var(--color-accent-glow)]",ghost:"bg-bg-2 text-fg-1 border-line-2 hover:bg-bg-3 hover:text-fg-0 hover:border-line-3",danger:"bg-danger text-white hover:bg-[#ff6f88]"},size:{sm:"h-6 px-2.5 text-[11px]",md:"h-7 px-3 text-[12px]",lg:"h-8 px-4 text-[13px]"}},defaultVariants:{variant:"ghost",size:"md"}});Nt(["click"]);const lu=_i({base:"inline-flex items-center px-1.5 py-px rounded-full text-[10px] font-medium font-mono uppercase tracking-[0.06em] border",variants:{tone:{neutral:"bg-bg-2 text-fg-2 border-line-2",ok:"bg-ok/15 text-ok border-ok/30",warn:"bg-warn/15 text-warn border-warn/30",danger:"bg-danger/15 text-danger border-danger/30",info:"bg-info/15 text-info border-info/30",accent:"bg-accent/15 text-accent border-accent/30"}},defaultVariants:{tone:"neutral"}});var cu=k("<span><!></span>");function Sn(t,e){$e(e,!0);let n=qe(e,"tone",3,"neutral"),o=qe(e,"class",3,"");var a=cu(),s=d(a);St(s,()=>e.children??Gt),c(a),j(i=>Oe(a,1,i),[()=>We(lu({tone:n(),class:o()}))]),h(t,a),Ze()}var du=k('<header class="px-4 h-9 flex items-center font-mono text-[10px] uppercase tracking-[0.1em] text-fg-2 border-b border-line-1 bg-bg-1"> </header>'),uu=k('<section><!> <div class="p-4"><!></div></section>');function Un(t,e){let n=qe(e,"floating",3,!1),o=qe(e,"class",3,"");const a=E(()=>n()?"bg-bg-1/[0.92] border-line-2 shadow-[0_16px_48px_rgba(0,0,0,0.6)]":"bg-bg-1 border-line-1");var s=uu(),i=d(s);{var l=v=>{var x=du(),p=d(x,!0);c(x),j(()=>P(p,e.title)),h(v,x)};X(i,v=>{e.title&&v(l)})}var u=g(i,2),f=d(u);St(f,()=>e.children??Gt),c(u),c(s),j(()=>Oe(s,1,`rounded-lg border overflow-hidden backdrop-blur-md ${r(a)??""} ${o()??""}`)),h(t,s)}var fu=k('<span class="inline-flex items-center gap-1.5 font-mono text-[11px] text-fg-1 uppercase tracking-[0.06em]"><span></span> <span> </span></span>');function vu(t,e){$e(e,!0);const n=E(()=>({primary:"bg-role-primary text-role-primary",replica:"bg-role-replica text-role-replica",embedded:"bg-role-embedded text-role-embedded"})[e.role]);var o=fu(),a=d(o),s=g(a,2),i=d(s,!0);c(s),c(o),j(()=>{Oe(a,1,`w-1.5 h-1.5 rounded-full ${r(n)??""} shadow-[0_0_0_3px_currentColor]/20`),P(i,e.label??e.role)}),h(t,o),Ze()}var gu=k('<kbd class="inline-flex items-center justify-center min-w-[18px] h-[18px] px-1.5 font-mono text-[10px] text-fg-1 bg-bg-2 border border-line-2 border-b-2 rounded-sm"><!></kbd>');function en(t,e){var n=gu(),o=d(n);St(o,()=>e.children??Gt),c(n),h(t,n)}function pu(t){return t===!0?"grid-cols-1":t===!1?"grid-cols-[13rem_minmax(0,1fr)]":"grid-cols-1 @min-[52rem]:grid-cols-[13rem_minmax(0,1fr)]"}function hu(t){return!!(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key.toLowerCase()==="k"}var xu=k("<div><!></div>"),bu=k("<div><!></div>"),mu=k('<div class="absolute inset-0 z-40 bg-black/50 backdrop-blur-sm" role="presentation"></div> <div role="dialog" aria-modal="true"><!></div>',1),_u=k('<div><div><aside><!> <div class="min-h-0 flex-1 overflow-y-auto"><!></div> <!></aside> <section><!></section></div> <!></div>');function yu(t,e){$e(e,!0);let n=qe(e,"searchOverlay",3,!1),o=qe(e,"searchOpen",15,!1),a=qe(e,"searchShortcut",3,hu),s=qe(e,"class",3,""),i=qe(e,"navClass",3,""),l=qe(e,"contentClass",3,""),u=qe(e,"footerClass",3,""),f=qe(e,"searchClass",3,"");const v=E(()=>pu(e.collapsed));let x=xe(void 0),p=xe(void 0);function w(b){const M=b==null?void 0:b.querySelector('input, textarea, select, button, [href], [tabindex]:not([tabindex="-1"])');M==null||M.focus()}async function _(){n()?(o(!0),await Td(),w(r(p))):w(r(x))}Rn(()=>{const b=M=>{if(a()&&a()(M)){M.preventDefault(),_();return}n()&&o()&&M.key==="Escape"&&(M.preventDefault(),o(!1))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)});var I=_u(),H=d(I),D=d(H),L=d(D);{var V=b=>{var M=xu(),m=d(M);St(m,()=>e.search),c(M),tn(M,N=>T(x,N),()=>r(x)),j(()=>Oe(M,1,`shrink-0 border-b border-line-1 p-2 ${f()??""}`)),h(b,M)};X(L,b=>{e.search&&!n()&&b(V)})}var q=g(L,2),U=d(q);St(U,()=>e.nav??Gt),c(q);var ie=g(q,2);{var de=b=>{var M=bu(),m=d(M);St(m,()=>e.footer),c(M),j(()=>Oe(M,1,`mt-auto shrink-0 border-t border-line-1 ${u()??""}`)),h(b,M)};X(ie,b=>{e.footer&&b(de)})}c(D);var ae=g(D,2),$=d(ae);St($,()=>e.content??Gt),c(ae),c(H);var fe=g(H,2);{var O=b=>{var M=mu(),m=ve(M),N=g(m,2),C=d(N);St(C,()=>e.search),c(N),tn(N,R=>T(p,R),()=>r(p)),j(()=>Oe(N,1,`absolute left-1/2 top-[15%] z-50 w-[min(36rem,92%)] -translate-x-1/2 rounded-lg border border-line-2 bg-bg-1 shadow-[var(--shadow-lg)] ${f()??""}`)),be("click",m,()=>o(!1)),h(b,M)};X(fe,b=>{e.search&&n()&&o()&&b(O)})}c(I),j(()=>{Oe(I,1,`@container relative h-full min-h-0 w-full ${s()??""}`),Oe(H,1,`grid h-full min-h-0 ${r(v)??""}`),Oe(D,1,`flex min-h-0 flex-col border-line-1 bg-bg-1 border-b @min-[52rem]:border-b-0 @min-[52rem]:border-r ${i()??""}`),Oe(ae,1,`min-h-0 min-w-0 overflow-auto bg-bg-0 ${l()??""}`)}),h(t,I),Ze()}Nt(["click"]);var wu=k('<span class="shrink-0 font-mono text-[11px] text-fg-2"> </span>'),ku=k('<p class="mt-0.5 text-[12px] leading-snug text-fg-2"> </p>'),Su=k("<div><!></div>"),Cu=k('<div class="w-full"><!></div>'),Nu=k('<div><div><div class="min-w-0"><div class="flex items-baseline gap-2"><span class="truncate text-[13px] text-fg-0"> </span> <!></div> <!></div></div> <!> <!></div>');function ts(t,e){$e(e,!0);let n=qe(e,"wide",3,!1),o=qe(e,"class",3,"");var a=Nu(),s=d(a),i=d(s),l=d(i),u=d(l),f=d(u,!0);c(u);var v=g(u,2);{var x=L=>{var V=wu(),q=d(V,!0);c(V),j(()=>P(q,e.hint)),h(L,V)};X(v,L=>{e.hint&&L(x)})}c(l);var p=g(l,2);{var w=L=>{var V=ku(),q=d(V,!0);c(V),j(()=>P(q,e.description)),h(L,V)};X(p,L=>{e.description&&L(w)})}c(i),c(s);var _=g(s,2);{var I=L=>{var V=Su(),q=d(V);St(q,()=>e.action),c(V),j(U=>Oe(V,1,U),[()=>We(["flex items-center gap-2",n()?"w-full":"shrink-0"].join(" "))]),h(L,V)};X(_,L=>{e.action&&L(I)})}var H=g(_,2);{var D=L=>{var V=Cu(),q=d(V);St(q,()=>e.below),c(V),h(L,V)};X(H,L=>{e.below&&L(D)})}c(a),j((L,V)=>{Se(a,"data-wide",n()?"":void 0),Oe(a,1,L),Oe(s,1,V),P(f,e.title)},[()=>We(["px-3 py-2.5",n()?"flex flex-col gap-2":"flex items-center gap-3",o()].join(" ")),()=>We(["flex min-w-0 items-baseline gap-2",n()?"":"flex-1"].join(" "))]),h(t,a),Ze()}var Eu=k('<span class="flex size-4 shrink-0 items-center justify-center text-fg-2"><!></span>'),Mu=k('<span class="ml-0.5"><!></span>'),zu=k('<div><!> <h2 class="text-[11px] font-mono uppercase tracking-[0.1em] text-fg-2"> </h2> <!></div>');function Tu(t,e){let n=qe(e,"class",3,"");var o=zu(),a=d(o);{var s=v=>{var x=Eu(),p=d(x);St(p,()=>e.icon),c(x),h(v,x)};X(a,v=>{e.icon&&v(s)})}var i=g(a,2),l=d(i,!0);c(i);var u=g(i,2);{var f=v=>{var x=Mu(),p=d(x);St(p,()=>e.meta),c(x),h(v,x)};X(u,v=>{e.meta&&v(f)})}c(o),j(()=>{Oe(o,1,`flex items-center gap-2 ${n()??""}`),P(l,e.title)}),h(t,o)}const Pu=_i({base:"inline-flex items-center gap-1 px-1.5 h-[18px] rounded-full text-[11px] font-mono leading-none border",variants:{tone:{muted:"bg-bg-2 text-fg-2 border-line-2",accent:"bg-accent/15 text-accent border-accent/30"}},defaultVariants:{tone:"muted"}});var Iu=k("<span><!></span>");function ns(t,e){$e(e,!0);let n=qe(e,"tone",3,"muted"),o=qe(e,"class",3,"");var a=Iu(),s=d(a);St(s,()=>e.children??Gt),c(a),j(i=>Oe(a,1,i),[()=>We(Pu({tone:n(),class:o()}))]),h(t,a),Ze()}var Au=k('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),Lu=k('<span class="shrink-0"><!></span>'),Ou=k('<a><!> <span class="flex-1 truncate"> </span> <!></a>'),Ru=k('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),Du=k('<span class="shrink-0"><!></span>'),Vu=k('<button type="button"><!> <span class="flex-1 truncate"> </span> <!></button>');function Hu(t,e){$e(e,!0);let n=qe(e,"active",3,!1),o=qe(e,"class",3,"");const a=E(()=>["inline-flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] transition-colors",n()?"bg-bg-2 text-fg-0":"text-fg-2 hover:bg-bg-2 hover:text-fg-0",o()].join(" "));var s=Ve(),i=ve(s);{var l=f=>{var v=Ou(),x=d(v);{var p=D=>{var L=Au(),V=d(L);St(V,()=>e.icon),c(L),h(D,L)};X(x,D=>{e.icon&&D(p)})}var w=g(x,2),_=d(w,!0);c(w);var I=g(w,2);{var H=D=>{var L=Lu(),V=d(L);St(V,()=>e.trailing),c(L),h(D,L)};X(I,D=>{e.trailing&&D(H)})}c(v),j(()=>{Se(v,"href",e.href),Se(v,"aria-current",n()?"page":void 0),Oe(v,1,We(r(a))),P(_,e.label)}),be("click",v,function(...D){var L;(L=e.onclick)==null||L.apply(this,D)}),h(f,v)},u=f=>{var v=Vu(),x=d(v);{var p=D=>{var L=Ru(),V=d(L);St(V,()=>e.icon),c(L),h(D,L)};X(x,D=>{e.icon&&D(p)})}var w=g(x,2),_=d(w,!0);c(w);var I=g(w,2);{var H=D=>{var L=Du(),V=d(L);St(V,()=>e.trailing),c(L),h(D,L)};X(I,D=>{e.trailing&&D(H)})}c(v),j(()=>{Se(v,"aria-current",n()?"page":void 0),Oe(v,1,We(r(a))),P(_,e.label)}),be("click",v,function(...D){var L;(L=e.onclick)==null||L.apply(this,D)}),h(f,v)};X(i,f=>{e.href?f(l):f(u,-1)})}h(t,s),Ze()}Nt(["click"]);const qu=[1e3,2e3,4e3,8e3,3e4];class Fu{constructor(e){this.opts=e}subscribe(e={}){return new Ku(this,e)}buildSseUrl(e,n){const o=this.opts.client.baseUrl??"",a=new URLSearchParams;n>0&&a.set("since",String(n)),e&&a.set("collection",e);const s=a.toString();return`${o}/changes/stream${s?`?${s}`:""}`}}class Ku{constructor(e,n){wt(this,"events");wt(this,"controller");wt(this,"closed",!1);wt(this,"lastSeenLsn");wt(this,"currentSse",null);wt(this,"pollTimer",null);wt(this,"reconnectTimer",null);wt(this,"backoffIdx",0);wt(this,"transport",null);this.parent=e,this.opts=n,this.lastSeenLsn=n.sinceLsn??0,this.events=new ReadableStream({start:o=>{this.controller=o},cancel:()=>this.close()}),this.connect()}timers(){return this.parent.opts.timers??{setTimeout:(e,n)=>globalThis.setTimeout(e,n),clearTimeout:e=>globalThis.clearTimeout(e)}}async connect(){if(!this.closed){if(this.transport===null){const e=this.parent.opts.sseFactory;if(e==null)this.transport="rest";else{const n=this.parent.opts.sseProbe??(async()=>!0);let o=!1;try{o=await n()}catch{o=!1}if(this.closed)return;this.transport=o?"sse":"rest"}}this.transport==="sse"?this.startSse():this.startRest()}}startSse(){const e=this.parent.opts.sseFactory;if(!e){this.transport="rest",this.startRest();return}const n=this.parent.buildSseUrl(this.opts.collection,this.lastSeenLsn);let o;try{o=e(n)}catch{this.scheduleReconnect();return}this.currentSse=o,o.onopen=()=>{this.backoffIdx=0},o.onmessage=a=>{try{const s=JSON.parse(a.data);this.emit(s)}catch{}},o.onerror=()=>{if(!this.closed){try{o.close()}catch{}this.currentSse===o&&(this.currentSse=null),this.scheduleReconnect()}}}startRest(){const e=async()=>{if(!this.closed)try{const n=this.opts.collection?await this.parent.opts.client.changes(this.lastSeenLsn,{collection:this.opts.collection}):await this.parent.opts.client.changes(this.lastSeenLsn);if(this.closed)return;for(const a of n)this.emit(a);this.backoffIdx=0;const o=this.parent.opts.pollIntervalMs??1e3;this.pollTimer=this.timers().setTimeout(()=>{this.pollTimer=null,e()},o)}catch{if(this.closed)return;this.scheduleReconnect()}};e()}emit(e){if(!this.closed&&!(e.lsn<=this.lastSeenLsn)){this.lastSeenLsn=e.lsn;try{this.controller.enqueue(e)}catch{this.close()}}}scheduleReconnect(){if(this.closed)return;const e=this.parent.opts.backoffMs??qu,n=e[Math.min(this.backoffIdx,e.length-1)];this.backoffIdx++,this.reconnectTimer=this.timers().setTimeout(()=>{this.reconnectTimer=null,this.transport==="sse"?this.startSse():this.startRest()},n)}close(){if(this.closed)return;if(this.closed=!0,this.currentSse){try{this.currentSse.close()}catch{}this.currentSse=null}const{clearTimeout:e}=this.timers();this.pollTimer&&(e(this.pollTimer),this.pollTimer=null),this.reconnectTimer&&(e(this.reconnectTimer),this.reconnectTimer=null);try{this.controller.close()}catch{}}}function Dr(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
2
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* 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.
|
|
7
|
-
*
|
|
8
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
10
|
-
* copyright notice and this permission notice appear in all copies.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
13
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
14
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
15
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
16
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
17
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
18
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
-
*
|
|
20
|
-
*/const o=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}]];rt(t,et({name:"activity"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Bu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
21
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
22
|
-
*
|
|
23
|
-
* ISC License
|
|
24
|
-
*
|
|
25
|
-
* 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.
|
|
26
|
-
*
|
|
27
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
28
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
29
|
-
* copyright notice and this permission notice appear in all copies.
|
|
30
|
-
*
|
|
31
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
32
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
33
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
34
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
35
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
36
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
37
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
38
|
-
*
|
|
39
|
-
*/const o=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]];rt(t,et({name:"arrow-right"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function xr(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
40
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
41
|
-
*
|
|
42
|
-
* ISC License
|
|
43
|
-
*
|
|
44
|
-
* 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.
|
|
45
|
-
*
|
|
46
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
47
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
48
|
-
* copyright notice and this permission notice appear in all copies.
|
|
49
|
-
*
|
|
50
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
51
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
52
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
53
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
54
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
55
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
56
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
57
|
-
*
|
|
58
|
-
*/const o=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]];rt(t,et({name:"braces"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ju(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
59
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
60
|
-
*
|
|
61
|
-
* ISC License
|
|
62
|
-
*
|
|
63
|
-
* 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.
|
|
64
|
-
*
|
|
65
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
66
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
67
|
-
* copyright notice and this permission notice appear in all copies.
|
|
68
|
-
*
|
|
69
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
70
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
71
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
72
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
73
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
74
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
75
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
76
|
-
*
|
|
77
|
-
*/const o=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2"}],["path",{d:"M10 6h4"}],["path",{d:"M10 10h4"}],["path",{d:"M10 14h4"}],["path",{d:"M10 18h4"}]];rt(t,et({name:"building-2"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Uu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
78
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* ISC License
|
|
81
|
-
*
|
|
82
|
-
* 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.
|
|
83
|
-
*
|
|
84
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
85
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
86
|
-
* copyright notice and this permission notice appear in all copies.
|
|
87
|
-
*
|
|
88
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
89
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
90
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
91
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
92
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
93
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
94
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
95
|
-
*
|
|
96
|
-
*/const o=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]];rt(t,et({name:"chart-column"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Wu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
97
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* ISC License
|
|
100
|
-
*
|
|
101
|
-
* 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.
|
|
102
|
-
*
|
|
103
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
104
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
105
|
-
* copyright notice and this permission notice appear in all copies.
|
|
106
|
-
*
|
|
107
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
108
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
109
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
110
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
111
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
112
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
113
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
114
|
-
*
|
|
115
|
-
*/const o=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"m19 9-5 5-4-4-3 3"}]];rt(t,et({name:"chart-line"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Yu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
116
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* ISC License
|
|
119
|
-
*
|
|
120
|
-
* 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.
|
|
121
|
-
*
|
|
122
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
123
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
124
|
-
* copyright notice and this permission notice appear in all copies.
|
|
125
|
-
*
|
|
126
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
127
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
128
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
129
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
130
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
131
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
132
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
133
|
-
*
|
|
134
|
-
*/const o=[["path",{d:"M20 6 9 17l-5-5"}]];rt(t,et({name:"check"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Xu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
135
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* ISC License
|
|
138
|
-
*
|
|
139
|
-
* 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.
|
|
140
|
-
*
|
|
141
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
142
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
143
|
-
* copyright notice and this permission notice appear in all copies.
|
|
144
|
-
*
|
|
145
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
146
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
147
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
148
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
149
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
150
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
151
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
152
|
-
*
|
|
153
|
-
*/const o=[["path",{d:"m6 9 6 6 6-6"}]];rt(t,et({name:"chevron-down"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function yi(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
154
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
155
|
-
*
|
|
156
|
-
* ISC License
|
|
157
|
-
*
|
|
158
|
-
* 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.
|
|
159
|
-
*
|
|
160
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
161
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
162
|
-
* copyright notice and this permission notice appear in all copies.
|
|
163
|
-
*
|
|
164
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
165
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
166
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
167
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
168
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
169
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
170
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
171
|
-
*
|
|
172
|
-
*/const o=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];rt(t,et({name:"circle-alert"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function yl(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
173
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* ISC License
|
|
176
|
-
*
|
|
177
|
-
* 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.
|
|
178
|
-
*
|
|
179
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
180
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
181
|
-
* copyright notice and this permission notice appear in all copies.
|
|
182
|
-
*
|
|
183
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
184
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
185
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
186
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
187
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
188
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
189
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
190
|
-
*
|
|
191
|
-
*/const o=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];rt(t,et({name:"circle-check"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Gu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
192
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* ISC License
|
|
195
|
-
*
|
|
196
|
-
* 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.
|
|
197
|
-
*
|
|
198
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
199
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
200
|
-
* copyright notice and this permission notice appear in all copies.
|
|
201
|
-
*
|
|
202
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
203
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
204
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
205
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
206
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
207
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
208
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
209
|
-
*
|
|
210
|
-
*/const o=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}],["path",{d:"M12 11h4"}],["path",{d:"M12 16h4"}],["path",{d:"M8 11h.01"}],["path",{d:"M8 16h.01"}]];rt(t,et({name:"clipboard-list"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function $u(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
211
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* ISC License
|
|
214
|
-
*
|
|
215
|
-
* 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.
|
|
216
|
-
*
|
|
217
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
218
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
219
|
-
* copyright notice and this permission notice appear in all copies.
|
|
220
|
-
*
|
|
221
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
222
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
223
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
224
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
225
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
226
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
227
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
228
|
-
*
|
|
229
|
-
*/const o=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];rt(t,et({name:"clock"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Zu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
230
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* ISC License
|
|
233
|
-
*
|
|
234
|
-
* 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.
|
|
235
|
-
*
|
|
236
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
237
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
238
|
-
* copyright notice and this permission notice appear in all copies.
|
|
239
|
-
*
|
|
240
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
241
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
242
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
243
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
244
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
245
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
246
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
247
|
-
*
|
|
248
|
-
*/const o=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];rt(t,et({name:"columns-3"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Vr(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
249
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
250
|
-
*
|
|
251
|
-
* ISC License
|
|
252
|
-
*
|
|
253
|
-
* 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.
|
|
254
|
-
*
|
|
255
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
256
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
257
|
-
* copyright notice and this permission notice appear in all copies.
|
|
258
|
-
*
|
|
259
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
260
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
261
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
262
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
263
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
264
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
265
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
266
|
-
*
|
|
267
|
-
*/const o=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]];rt(t,et({name:"database"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Qu(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
268
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* ISC License
|
|
271
|
-
*
|
|
272
|
-
* 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.
|
|
273
|
-
*
|
|
274
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
275
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
276
|
-
* copyright notice and this permission notice appear in all copies.
|
|
277
|
-
*
|
|
278
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
279
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
280
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
281
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
282
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
283
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
284
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
285
|
-
*
|
|
286
|
-
*/const o=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]];rt(t,et({name:"download"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Ju(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
287
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* ISC License
|
|
290
|
-
*
|
|
291
|
-
* 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.
|
|
292
|
-
*
|
|
293
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
294
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
295
|
-
* copyright notice and this permission notice appear in all copies.
|
|
296
|
-
*
|
|
297
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
298
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
299
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
300
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
301
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
302
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
303
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
304
|
-
*
|
|
305
|
-
*/const o=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];rt(t,et({name:"eye-off"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ef(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
306
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* ISC License
|
|
309
|
-
*
|
|
310
|
-
* 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.
|
|
311
|
-
*
|
|
312
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
313
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
314
|
-
* copyright notice and this permission notice appear in all copies.
|
|
315
|
-
*
|
|
316
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
317
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
318
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
319
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
320
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
321
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
322
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
323
|
-
*
|
|
324
|
-
*/const o=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];rt(t,et({name:"eye"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function wl(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
325
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* ISC License
|
|
328
|
-
*
|
|
329
|
-
* 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.
|
|
330
|
-
*
|
|
331
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
332
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
333
|
-
* copyright notice and this permission notice appear in all copies.
|
|
334
|
-
*
|
|
335
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
336
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
337
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
338
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
339
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
340
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
341
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
342
|
-
*
|
|
343
|
-
*/const o=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"m5 12-3 3 3 3"}],["path",{d:"m9 18 3-3-3-3"}]];rt(t,et({name:"file-code-2"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function tf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
344
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
345
|
-
*
|
|
346
|
-
* ISC License
|
|
347
|
-
*
|
|
348
|
-
* 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.
|
|
349
|
-
*
|
|
350
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
351
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
352
|
-
* copyright notice and this permission notice appear in all copies.
|
|
353
|
-
*
|
|
354
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
355
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
356
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
357
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
358
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
359
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
360
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
361
|
-
*
|
|
362
|
-
*/const o=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}],["path",{d:"M8 18h1"}]];rt(t,et({name:"file-pen-line"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function nf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
363
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
364
|
-
*
|
|
365
|
-
* ISC License
|
|
366
|
-
*
|
|
367
|
-
* 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.
|
|
368
|
-
*
|
|
369
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
370
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
371
|
-
* copyright notice and this permission notice appear in all copies.
|
|
372
|
-
*
|
|
373
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
374
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
375
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
376
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
377
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
378
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
379
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
380
|
-
*
|
|
381
|
-
*/const o=[["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 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];rt(t,et({name:"file-text"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function kl(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
382
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* ISC License
|
|
385
|
-
*
|
|
386
|
-
* 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.
|
|
387
|
-
*
|
|
388
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
389
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
390
|
-
* copyright notice and this permission notice appear in all copies.
|
|
391
|
-
*
|
|
392
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
393
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
394
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
395
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
396
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
397
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
398
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
399
|
-
*
|
|
400
|
-
*/const o=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"}]];rt(t,et({name:"filter"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Sl(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
401
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* ISC License
|
|
404
|
-
*
|
|
405
|
-
* 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.
|
|
406
|
-
*
|
|
407
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
408
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
409
|
-
* copyright notice and this permission notice appear in all copies.
|
|
410
|
-
*
|
|
411
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
412
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
413
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
414
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
415
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
416
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
417
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
418
|
-
*
|
|
419
|
-
*/const o=[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]];rt(t,et({name:"gauge"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function rf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
420
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
421
|
-
*
|
|
422
|
-
* ISC License
|
|
423
|
-
*
|
|
424
|
-
* 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.
|
|
425
|
-
*
|
|
426
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
427
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
428
|
-
* copyright notice and this permission notice appear in all copies.
|
|
429
|
-
*
|
|
430
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
431
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
432
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
433
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
434
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
435
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
436
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
437
|
-
*
|
|
438
|
-
*/const o=[["line",{x1:"6",x2:"6",y1:"3",y2:"15"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}],["path",{d:"M18 9a9 9 0 0 1-9 9"}]];rt(t,et({name:"git-branch"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function of(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
439
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
440
|
-
*
|
|
441
|
-
* ISC License
|
|
442
|
-
*
|
|
443
|
-
* 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.
|
|
444
|
-
*
|
|
445
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
446
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
447
|
-
* copyright notice and this permission notice appear in all copies.
|
|
448
|
-
*
|
|
449
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
450
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
451
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
452
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
453
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
454
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
455
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
456
|
-
*
|
|
457
|
-
*/const o=[["circle",{cx:"12",cy:"12",r:"3"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12"}]];rt(t,et({name:"git-commit-horizontal"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Ya(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
458
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
459
|
-
*
|
|
460
|
-
* ISC License
|
|
461
|
-
*
|
|
462
|
-
* 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.
|
|
463
|
-
*
|
|
464
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
465
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
466
|
-
* copyright notice and this permission notice appear in all copies.
|
|
467
|
-
*
|
|
468
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
469
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
470
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
471
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
472
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
473
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
474
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
475
|
-
*
|
|
476
|
-
*/const o=[["circle",{cx:"5",cy:"6",r:"3"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7"}],["path",{d:"m15 9-3-3 3-3"}],["circle",{cx:"19",cy:"18",r:"3"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9"}],["path",{d:"m9 15 3 3-3 3"}]];rt(t,et({name:"git-compare-arrows"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function af(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
477
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
478
|
-
*
|
|
479
|
-
* ISC License
|
|
480
|
-
*
|
|
481
|
-
* 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.
|
|
482
|
-
*
|
|
483
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
484
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
485
|
-
* copyright notice and this permission notice appear in all copies.
|
|
486
|
-
*
|
|
487
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
488
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
489
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
490
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
491
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
492
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
493
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
494
|
-
*
|
|
495
|
-
*/const o=[["line",{x1:"22",x2:"2",y1:"12",y2:"12"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16"}]];rt(t,et({name:"hard-drive"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function sf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
496
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
497
|
-
*
|
|
498
|
-
* ISC License
|
|
499
|
-
*
|
|
500
|
-
* 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.
|
|
501
|
-
*
|
|
502
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
503
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
504
|
-
* copyright notice and this permission notice appear in all copies.
|
|
505
|
-
*
|
|
506
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
507
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
508
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
509
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
510
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
511
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
512
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
513
|
-
*
|
|
514
|
-
*/const o=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]];rt(t,et({name:"key-round"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function lf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
515
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
516
|
-
*
|
|
517
|
-
* ISC License
|
|
518
|
-
*
|
|
519
|
-
* 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.
|
|
520
|
-
*
|
|
521
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
522
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
523
|
-
* copyright notice and this permission notice appear in all copies.
|
|
524
|
-
*
|
|
525
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
526
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
527
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
528
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
529
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
530
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
531
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
532
|
-
*
|
|
533
|
-
*/const o=[["path",{d:"M3 6h18"}],["path",{d:"M7 12h10"}],["path",{d:"M10 18h4"}]];rt(t,et({name:"list-filter"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function cf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
534
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
535
|
-
*
|
|
536
|
-
* ISC License
|
|
537
|
-
*
|
|
538
|
-
* 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.
|
|
539
|
-
*
|
|
540
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
541
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
542
|
-
* copyright notice and this permission notice appear in all copies.
|
|
543
|
-
*
|
|
544
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
545
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
546
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
547
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
548
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
549
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
550
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
551
|
-
*
|
|
552
|
-
*/const o=[["path",{d:"M21 12h-8"}],["path",{d:"M21 6H8"}],["path",{d:"M21 18h-8"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3"}]];rt(t,et({name:"list-tree"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function df(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
553
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
554
|
-
*
|
|
555
|
-
* ISC License
|
|
556
|
-
*
|
|
557
|
-
* 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.
|
|
558
|
-
*
|
|
559
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
560
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
561
|
-
* copyright notice and this permission notice appear in all copies.
|
|
562
|
-
*
|
|
563
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
564
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
565
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
566
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
567
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
568
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
569
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
570
|
-
*
|
|
571
|
-
*/const o=[["path",{d:"M3 12h.01"}],["path",{d:"M3 18h.01"}],["path",{d:"M3 6h.01"}],["path",{d:"M8 12h13"}],["path",{d:"M8 18h13"}],["path",{d:"M8 6h13"}]];rt(t,et({name:"list"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function tr(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
572
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
573
|
-
*
|
|
574
|
-
* ISC License
|
|
575
|
-
*
|
|
576
|
-
* 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.
|
|
577
|
-
*
|
|
578
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
579
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
580
|
-
* copyright notice and this permission notice appear in all copies.
|
|
581
|
-
*
|
|
582
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
583
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
584
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
585
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
586
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
587
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
588
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
589
|
-
*
|
|
590
|
-
*/const o=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];rt(t,et({name:"lock"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function uf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
591
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
592
|
-
*
|
|
593
|
-
* ISC License
|
|
594
|
-
*
|
|
595
|
-
* 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.
|
|
596
|
-
*
|
|
597
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
598
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
599
|
-
* copyright notice and this permission notice appear in all copies.
|
|
600
|
-
*
|
|
601
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
602
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
603
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
604
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
605
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
606
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
607
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
608
|
-
*
|
|
609
|
-
*/const o=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}]];rt(t,et({name:"moon"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ff(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
610
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
611
|
-
*
|
|
612
|
-
* ISC License
|
|
613
|
-
*
|
|
614
|
-
* 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.
|
|
615
|
-
*
|
|
616
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
617
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
618
|
-
* copyright notice and this permission notice appear in all copies.
|
|
619
|
-
*
|
|
620
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
621
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
622
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
623
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
624
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
625
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
626
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
627
|
-
*
|
|
628
|
-
*/const o=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}]];rt(t,et({name:"pause"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function wi(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
629
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
630
|
-
*
|
|
631
|
-
* ISC License
|
|
632
|
-
*
|
|
633
|
-
* 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.
|
|
634
|
-
*
|
|
635
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
636
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
637
|
-
* copyright notice and this permission notice appear in all copies.
|
|
638
|
-
*
|
|
639
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
640
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
641
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
642
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
643
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
644
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
645
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
646
|
-
*
|
|
647
|
-
*/const o=[["path",{d:"M12 22v-5"}],["path",{d:"M9 8V2"}],["path",{d:"M15 8V2"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z"}]];rt(t,et({name:"plug"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Cl(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
648
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
649
|
-
*
|
|
650
|
-
* ISC License
|
|
651
|
-
*
|
|
652
|
-
* 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.
|
|
653
|
-
*
|
|
654
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
655
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
656
|
-
* copyright notice and this permission notice appear in all copies.
|
|
657
|
-
*
|
|
658
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
659
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
660
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
661
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
662
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
663
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
664
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
665
|
-
*
|
|
666
|
-
*/const o=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];rt(t,et({name:"plus"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function vf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
667
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
668
|
-
*
|
|
669
|
-
* ISC License
|
|
670
|
-
*
|
|
671
|
-
* 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.
|
|
672
|
-
*
|
|
673
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
674
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
675
|
-
* copyright notice and this permission notice appear in all copies.
|
|
676
|
-
*
|
|
677
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
678
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
679
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
680
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
681
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
682
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
683
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
684
|
-
*
|
|
685
|
-
*/const o=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5"}],["circle",{cx:"12",cy:"9",r:"2"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1"}],["path",{d:"M9.5 18h5"}],["path",{d:"m8 22 4-11 4 11"}]];rt(t,et({name:"radio-tower"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function gf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
686
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
687
|
-
*
|
|
688
|
-
* ISC License
|
|
689
|
-
*
|
|
690
|
-
* 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.
|
|
691
|
-
*
|
|
692
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
693
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
694
|
-
* copyright notice and this permission notice appear in all copies.
|
|
695
|
-
*
|
|
696
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
697
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
698
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
699
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
700
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
701
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
702
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
703
|
-
*
|
|
704
|
-
*/const o=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"}],["circle",{cx:"12",cy:"12",r:"2"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19"}]];rt(t,et({name:"radio"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ki(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
705
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
706
|
-
*
|
|
707
|
-
* ISC License
|
|
708
|
-
*
|
|
709
|
-
* 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.
|
|
710
|
-
*
|
|
711
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
712
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
713
|
-
* copyright notice and this permission notice appear in all copies.
|
|
714
|
-
*
|
|
715
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
716
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
717
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
718
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
719
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
720
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
721
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
722
|
-
*
|
|
723
|
-
*/const o=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];rt(t,et({name:"refresh-cw"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Xa(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
724
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
725
|
-
*
|
|
726
|
-
* ISC License
|
|
727
|
-
*
|
|
728
|
-
* 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.
|
|
729
|
-
*
|
|
730
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
731
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
732
|
-
* copyright notice and this permission notice appear in all copies.
|
|
733
|
-
*
|
|
734
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
735
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
736
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
737
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
738
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
739
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
740
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
741
|
-
*
|
|
742
|
-
*/const o=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M21 9H3"}],["path",{d:"M21 15H3"}]];rt(t,et({name:"rows-3"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function pf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
743
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
744
|
-
*
|
|
745
|
-
* ISC License
|
|
746
|
-
*
|
|
747
|
-
* 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.
|
|
748
|
-
*
|
|
749
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
750
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
751
|
-
* copyright notice and this permission notice appear in all copies.
|
|
752
|
-
*
|
|
753
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
754
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
755
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
756
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
757
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
758
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
759
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
760
|
-
*
|
|
761
|
-
*/const o=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"}],["path",{d:"M7 12h10"}]];rt(t,et({name:"scan-line"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function hf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
762
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
763
|
-
*
|
|
764
|
-
* ISC License
|
|
765
|
-
*
|
|
766
|
-
* 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.
|
|
767
|
-
*
|
|
768
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
769
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
770
|
-
* copyright notice and this permission notice appear in all copies.
|
|
771
|
-
*
|
|
772
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
773
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
774
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
775
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
776
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
777
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
778
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
779
|
-
*
|
|
780
|
-
*/const o=[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]];rt(t,et({name:"scroll-text"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function rs(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
781
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
782
|
-
*
|
|
783
|
-
* ISC License
|
|
784
|
-
*
|
|
785
|
-
* 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.
|
|
786
|
-
*
|
|
787
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
788
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
789
|
-
* copyright notice and this permission notice appear in all copies.
|
|
790
|
-
*
|
|
791
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
792
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
793
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
794
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
795
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
796
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
797
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
798
|
-
*
|
|
799
|
-
*/const o=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}],["path",{d:"m21.854 2.147-10.94 10.939"}]];rt(t,et({name:"send"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function xf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
800
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
801
|
-
*
|
|
802
|
-
* ISC License
|
|
803
|
-
*
|
|
804
|
-
* 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.
|
|
805
|
-
*
|
|
806
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
807
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
808
|
-
* copyright notice and this permission notice appear in all copies.
|
|
809
|
-
*
|
|
810
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
811
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
812
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
813
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
814
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
815
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
816
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
817
|
-
*
|
|
818
|
-
*/const o=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2"}],["path",{d:"M6 6h.01"}],["path",{d:"M6 18h.01"}],["path",{d:"m13 6-4 6h6l-4 6"}]];rt(t,et({name:"server-crash"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function zo(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
819
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
820
|
-
*
|
|
821
|
-
* ISC License
|
|
822
|
-
*
|
|
823
|
-
* 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.
|
|
824
|
-
*
|
|
825
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
826
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
827
|
-
* copyright notice and this permission notice appear in all copies.
|
|
828
|
-
*
|
|
829
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
830
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
831
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
832
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
833
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
834
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
835
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
836
|
-
*
|
|
837
|
-
*/const o=[["path",{d:"M20 7h-9"}],["path",{d:"M14 17H5"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];rt(t,et({name:"settings-2"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ho(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
838
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
839
|
-
*
|
|
840
|
-
* ISC License
|
|
841
|
-
*
|
|
842
|
-
* 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.
|
|
843
|
-
*
|
|
844
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
845
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
846
|
-
* copyright notice and this permission notice appear in all copies.
|
|
847
|
-
*
|
|
848
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
849
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
850
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
851
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
852
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
853
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
854
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
855
|
-
*
|
|
856
|
-
*/const o=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"M12 8v4"}],["path",{d:"M12 16h.01"}]];rt(t,et({name:"shield-alert"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function bf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
857
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
858
|
-
*
|
|
859
|
-
* ISC License
|
|
860
|
-
*
|
|
861
|
-
* 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.
|
|
862
|
-
*
|
|
863
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
864
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
865
|
-
* copyright notice and this permission notice appear in all copies.
|
|
866
|
-
*
|
|
867
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
868
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
869
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
870
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
871
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
872
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
873
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
874
|
-
*
|
|
875
|
-
*/const o=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]];rt(t,et({name:"shield-check"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Nl(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
876
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
877
|
-
*
|
|
878
|
-
* ISC License
|
|
879
|
-
*
|
|
880
|
-
* 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.
|
|
881
|
-
*
|
|
882
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
883
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
884
|
-
* copyright notice and this permission notice appear in all copies.
|
|
885
|
-
*
|
|
886
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
887
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
888
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
889
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
890
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
891
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
892
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
893
|
-
*
|
|
894
|
-
*/const o=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}]];rt(t,et({name:"shield"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function mf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
895
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
896
|
-
*
|
|
897
|
-
* ISC License
|
|
898
|
-
*
|
|
899
|
-
* 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.
|
|
900
|
-
*
|
|
901
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
902
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
903
|
-
* copyright notice and this permission notice appear in all copies.
|
|
904
|
-
*
|
|
905
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
906
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
907
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
908
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
909
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
910
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
911
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
912
|
-
*
|
|
913
|
-
*/const o=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];rt(t,et({name:"sun"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function os(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
914
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
915
|
-
*
|
|
916
|
-
* ISC License
|
|
917
|
-
*
|
|
918
|
-
* 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.
|
|
919
|
-
*
|
|
920
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
921
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
922
|
-
* copyright notice and this permission notice appear in all copies.
|
|
923
|
-
*
|
|
924
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
925
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
926
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
927
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
928
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
929
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
930
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
931
|
-
*
|
|
932
|
-
*/const o=[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17"}]];rt(t,et({name:"trash-2"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function _f(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
933
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
934
|
-
*
|
|
935
|
-
* ISC License
|
|
936
|
-
*
|
|
937
|
-
* 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.
|
|
938
|
-
*
|
|
939
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
940
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
941
|
-
* copyright notice and this permission notice appear in all copies.
|
|
942
|
-
*
|
|
943
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
944
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
945
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
946
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
947
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
948
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
949
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
950
|
-
*
|
|
951
|
-
*/const o=[["path",{d:"m19 5 3-3"}],["path",{d:"m2 22 3-3"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}],["path",{d:"M7.5 13.5 10 11"}],["path",{d:"M10.5 16.5 13 14"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z"}]];rt(t,et({name:"unplug"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function yf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
952
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
953
|
-
*
|
|
954
|
-
* ISC License
|
|
955
|
-
*
|
|
956
|
-
* 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.
|
|
957
|
-
*
|
|
958
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
959
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
960
|
-
* copyright notice and this permission notice appear in all copies.
|
|
961
|
-
*
|
|
962
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
963
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
964
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
965
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
966
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
967
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
968
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
969
|
-
*
|
|
970
|
-
*/const o=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}],["circle",{cx:"9",cy:"7",r:"4"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}]];rt(t,et({name:"users"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function wf(t,e){const n=nt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
971
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
972
|
-
*
|
|
973
|
-
* ISC License
|
|
974
|
-
*
|
|
975
|
-
* 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.
|
|
976
|
-
*
|
|
977
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
978
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
979
|
-
* copyright notice and this permission notice appear in all copies.
|
|
980
|
-
*
|
|
981
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
982
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
983
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
984
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
985
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
986
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
987
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
988
|
-
*
|
|
989
|
-
*/const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];rt(t,et({name:"zap"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=Ve(),l=ve(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}var kf=k("<!> Connecting…",1),Sf=k("<!> Connect",1),Cf=k('<!> <span class="text-ok"> </span>',1),Nf=k('<!> <span class="text-danger truncate"> </span>',1),Ef=k("<span> </span>"),Mf=k('<div class="group flex items-center gap-1 rounded hover:bg-bg-2 transition-colors"><button type="button" class="flex-1 flex items-center justify-between gap-3 px-2 py-1.5 text-left cursor-pointer bg-transparent border-0 disabled:cursor-not-allowed disabled:opacity-50 min-w-0"><code class="font-mono text-[11px] text-fg-1 truncate"> </code> <span class="font-mono text-[10px] text-fg-3 shrink-0 flex items-center gap-1.5"><!> <span> </span></span></button> <button type="button" title="Remove from history" class="opacity-0 group-hover:opacity-100 p-1 mr-0.5 text-fg-3 hover:text-danger transition-all cursor-pointer bg-transparent border-0"><!></button></div>'),zf=k('<div class="mt-3 pt-3 border-t border-line-1"><div class="flex items-center gap-1.5 mb-2"><!> <span class="type-label">Recent</span></div> <div class="grid gap-0.5 max-h-[180px] overflow-y-auto"></div></div>'),Tf=k('<div class="fixed inset-0 z-40" role="presentation"></div> <div class="absolute top-[calc(100%+6px)] left-0 z-50 w-[380px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl p-4" role="dialog" aria-label="Connect to reddb"><form><label for="connect-url" class="type-label block mb-1.5">Instance URL</label> <input id="connect-url" spellcheck="false" placeholder="red://localhost" class="w-full h-9 px-3 mb-1 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent placeholder:text-fg-3"/> <div class="mb-2 text-[10px] font-mono text-fg-3"> </div> <button type="submit" class="w-full h-9 bg-accent text-white font-medium rounded-md cursor-pointer transition-colors hover:bg-[#ff3868] disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"><!></button> <div class="h-5 mt-2 flex items-center gap-1.5 text-[11px] font-mono"><!></div></form> <!></div>',1),Pf=k('<div class="relative"><button type="button" aria-haspopup="dialog" class="inline-flex items-center gap-2 h-7 pl-2 pr-1.5 bg-bg-2 border border-line-2 rounded-md text-fg-1 cursor-pointer text-xs transition-colors hover:border-line-3 hover:text-fg-0"><span></span> <!> <span class="font-mono"> </span> <span class="font-mono text-[10px] text-fg-3"> </span> <!></button> <!></div>');function If(t,e){$e(e,!0);const n="red://localhost";function o(){var R,F;return(R=Ue.history[0])!=null&&R.url?Ue.history[0].url:(F=Ue.history[0])!=null&&F.label?Ue.history[0].label:Ue.active.url?Ue.active.url:n}let a=xe(!1),s=xe(kt(o())),i=xe("idle"),l=xe(null),u=xe(null),f=xe(void 0),v=xe(void 0);async function x(R){const F=R.trim().replace(/\/$/,"");if(!F)return;if(T(s,F,!0),!Ue.canReach(F)){T(i,"error"),T(l,`This app can't reach that transport here — supported: ${r(V)}`);return}T(i,"probing"),T(l,null),T(u,null),await Ue.tryConnect(Rd(F))?(T(i,"ok"),T(u,Ue.probe.rtt_ms??null,!0),setTimeout(()=>T(a,!1),350)):(T(i,"error"),T(l,Ue.probe.error??"unreachable",!0))}function p(R){R.preventDefault(),x(r(s))}function w(R){const F=Date.now()-R;return F<6e4?"just now":F<36e5?`${Math.round(F/6e4)}m ago`:F<864e5?`${Math.round(F/36e5)}h ago`:`${Math.round(F/864e5)}d ago`}function _(R,F){R.stopPropagation(),Ue.forgetById(F)}function I(){T(a,!r(a)),r(a)&&setTimeout(()=>{var R;return(R=r(v))==null?void 0:R.focus()},0)}Rn(()=>{const R=()=>{T(a,!0),setTimeout(()=>{var F;return(F=r(v))==null?void 0:F.focus()},0)};return window.addEventListener("red:open-connect",R),()=>window.removeEventListener("red:open-connect",R)});const H=E(()=>Ue.connected?"bg-ok":r(i)==="error"?"bg-danger":"bg-fg-3"),D=E(()=>Ue.connected?Ue.active.label:"Connect"),L=E(()=>Ue.connected&&Ue.probe.rtt_ms!==void 0?`${Ue.probe.rtt_ms}ms`:Ue.connected?"live":"no connection"),V=E(()=>{const R=Ue.supportedTransports,F=[];return(R.includes("http")||R.includes("https"))&&F.push("http(s)://"),R.includes("unix")&&F.push("file://"),F.join(" · ")}),q=E(()=>Ue.history.filter(R=>!R.url||Ue.canReach(R.url)));var U=Pf(),ie=d(U),de=d(ie),ae=g(de,2);{var $=R=>{wi(R,{class:"size-3 text-fg-3"})};X(ae,R=>{Ue.connected||R($)})}var fe=g(ae,2),O=d(fe,!0);c(fe);var b=g(fe,2),M=d(b,!0);c(b);var m=g(b,2);Xu(m,{class:"size-3 text-fg-3"}),c(ie);var N=g(ie,2);{var C=R=>{var F=Tf(),J=ve(F),A=g(J,2),y=d(A),S=g(d(y),2);Dt(S),tn(S,te=>T(v,te),()=>r(v));var z=g(S,2),W=d(z);c(z);var oe=g(z,2),Z=d(oe);{var Y=te=>{var pe=kf(),me=ve(pe);mn(me,{class:"size-3.5 animate-spin"}),Ee(),h(te,pe)},Q=te=>{var pe=Sf(),me=ve(pe);wf(me,{class:"size-3.5"}),Ee(),h(te,pe)};X(Z,te=>{r(i)==="probing"?te(Y):te(Q,-1)})}c(oe);var ee=g(oe,2),se=d(ee);{var B=te=>{var pe=Cf(),me=ve(pe);yl(me,{class:"size-3 text-ok"});var _e=g(me,2),ke=d(_e);c(_e),j(()=>P(ke,`Connected${r(u)!==null?` · ${r(u)}ms`:""}`)),h(te,pe)},K=te=>{var pe=Nf(),me=ve(pe);yi(me,{class:"size-3 text-danger"});var _e=g(me,2),ke=d(_e,!0);c(_e),j(()=>P(ke,r(l))),h(te,pe)};X(se,te=>{r(i)==="ok"?te(B):r(i)==="error"&&te(K,1)})}c(ee),c(y);var ne=g(y,2);{var re=te=>{var pe=zf(),me=d(pe),_e=d(me);$u(_e,{class:"size-3 text-fg-3"}),Ee(2),c(me);var ke=g(me,2);Je(ke,21,()=>r(q),Ft,(he,ge)=>{var Ce=Mf(),Pe=d(Ce),ue=d(Pe),le=d(ue,!0);c(ue);var we=g(ue,2),Me=d(we);{var Ne=Ke=>{var at=Ef(),Be=d(at);c(at),j(()=>P(Be,`${r(ge).rtt_ms??""}ms`)),h(Ke,at)};X(Me,Ke=>{r(ge).rtt_ms!==void 0&&Ke(Ne)})}var Te=g(Me,2),ye=d(Te,!0);c(Te),c(we),c(Pe);var ze=g(Pe,2),Ae=d(ze);Zt(Ae,{class:"size-3"}),c(ze),c(Ce),j(Ke=>{Pe.disabled=r(i)==="probing",Se(Pe,"title",r(ge).url?void 0:"Enter credentials to reconnect"),P(le,r(ge).url??r(ge).label),P(ye,Ke)},[()=>w(r(ge).last_used)]),be("click",Pe,()=>{r(ge).url?x(r(ge).url):(T(s,r(ge).label,!0),setTimeout(()=>{var Ke;return(Ke=r(v))==null?void 0:Ke.focus()},0))}),be("click",ze,Ke=>_(Ke,r(ge).id)),h(he,Ce)}),c(ke),c(pe),h(te,pe)};X(ne,te=>{r(q).length>0&&te(re)})}c(A),tn(A,te=>T(f,te),()=>r(f)),j(te=>{P(W,`reachable here: ${r(V)??""}`),oe.disabled=te},[()=>r(i)==="probing"||!r(s).trim()]),be("click",J,()=>T(a,!1)),zn("submit",y,p),Kt(S,()=>r(s),te=>T(s,te)),h(R,F)};X(N,R=>{r(a)&&R(C)})}c(U),j(R=>{Se(ie,"aria-expanded",r(a)),Se(ie,"title",Ue.connected?"Switch connection":"Connect to reddb"),Oe(de,1,R),P(O,r(D)),P(M,r(L))},[()=>We(["w-1.5 h-1.5 rounded-full shrink-0",r(H)].join(" "))]),be("click",ie,I),h(t,U),Ze()}Nt(["click"]);var Af=k("<!> <span> </span>",1),Lf=k('<!> <span class="text-fg-3">idle</span>',1),Of=k('<button type="button" title="Force-clear the in-flight counter (use when a request hangs)" class="px-1.5 py-0.5 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer text-[10px]">reset</button>'),Rf=k('<div class="px-3 py-3 text-fg-3">No activity yet.</div>'),Df=k('<div class="text-danger text-[10px] truncate"> </div>'),Vf=k('<div class="px-3 py-1.5 border-b border-line-1/50 last:border-0 grid grid-cols-[16px_1fr_auto] items-center gap-2"><span aria-hidden="true"><!></span> <div class="min-w-0"><div class="text-fg-1 truncate"> </div> <!></div> <div class="text-fg-3 text-[10px] tabular-nums whitespace-nowrap"><!></div></div>'),Hf=k('<div class="fixed inset-0 z-40" role="presentation"></div> <div role="dialog" aria-label="Activity log" class="absolute top-[calc(100%+6px)] right-0 z-50 w-[360px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl text-[11px] font-mono"><header class="flex items-center justify-between px-3 py-2 border-b border-line-1"><span class="type-label">Recent reddb requests</span> <div class="flex items-center gap-2"><span class="text-fg-3"> </span> <!></div></header> <div class="max-h-[320px] overflow-y-auto py-1"><!></div></div>',1),qf=k('<div class="relative"><button type="button" title="reddb activity"><!></button> <!></div>');function Ff(t,e){$e(e,!0);let n=xe(!1);function o(p){return p===null?"…":p<1e3?`${p}ms`:`${(p/1e3).toFixed(1)}s`}function a(p){const w=Date.now()-p;return w<1e3?"just now":w<6e4?`${Math.round(w/1e3)}s ago`:`${Math.round(w/6e4)}m ago`}var s=qf(),i=d(s),l=d(i);{var u=p=>{var w=Af(),_=ve(w);mn(_,{class:"size-3.5 animate-spin"});var I=g(_,2),H=d(I,!0);c(I),j(()=>P(H,Mt.inflight)),h(p,w)},f=p=>{var w=Lf(),_=ve(w);Dr(_,{class:"size-3.5"}),Ee(2),h(p,w)};X(l,p=>{Mt.inflight>0?p(u):p(f,-1)})}c(i);var v=g(i,2);{var x=p=>{var w=Hf(),_=ve(w),I=g(_,2),H=d(I),D=g(d(H),2),L=d(D),V=d(L);c(L);var q=g(L,2);{var U=fe=>{var O=Of();be("click",O,()=>Mt.reset()),h(fe,O)};X(q,fe=>{Mt.inflight>0&&fe(U)})}c(D),c(H);var ie=g(H,2),de=d(ie);{var ae=fe=>{var O=Rf();h(fe,O)},$=fe=>{var O=Ve(),b=ve(O);Je(b,17,()=>Mt.log,M=>M.id,(M,m)=>{var N=Vf(),C=d(N),R=d(C);{var F=se=>{mn(se,{class:"size-3 animate-spin text-accent"})},J=se=>{yl(se,{class:"size-3 text-ok"})},A=se=>{yi(se,{class:"size-3 text-danger"})};X(R,se=>{r(m).status==="pending"?se(F):r(m).status==="ok"?se(J,1):se(A,-1)})}c(C);var y=g(C,2),S=d(y),z=d(S,!0);c(S);var W=g(S,2);{var oe=se=>{var B=Df(),K=d(B,!0);c(B),j(()=>P(K,r(m).error)),h(se,B)};X(W,se=>{r(m).status==="error"&&r(m).error&&se(oe)})}c(y);var Z=g(y,2),Y=d(Z);{var Q=se=>{var B=pt();j(K=>P(B,K),[()=>a(r(m).startedAt)]),h(se,B)},ee=se=>{var B=pt();j(K=>P(B,K),[()=>o(r(m).durationMs)]),h(se,B)};X(Y,se=>{r(m).status==="pending"?se(Q):se(ee,-1)})}c(Z),c(N),j(()=>P(z,r(m).label)),h(M,N)}),h(fe,O)};X(de,fe=>{Mt.log.length===0?fe(ae):fe($,-1)})}c(ie),c(I),j(()=>P(V,`${Mt.inflight??""} active`)),be("click",_,()=>T(n,!1)),h(p,w)};X(v,p=>{r(n)&&p(x)})}c(s),j(p=>{Se(i,"aria-pressed",r(n)),Oe(i,1,p)},[()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md border text-xs font-mono transition-colors cursor-pointer",Mt.inflight>0?"border-accent/40 bg-accent/10 text-accent":"border-line-2 bg-bg-2 text-fg-3 hover:text-fg-1"].join(" "))]),be("click",i,()=>T(n,!r(n))),h(t,s),Ze()}Nt(["click"]);const El="red-ui-theme",To="light";function Kf(t,e,n){const o=t==null?void 0:t.dataset.theme;if(o==="dark"||o==="light")return o;if(!e||typeof localStorage>"u")return n??To;const a=localStorage.getItem(El);return a==="dark"||a==="light"?a:n??To}function as(t,e){if(e){e.dataset.theme=t;return}typeof document<"u"&&(document.documentElement.dataset.theme=t)}function Bf(t,e){e&&(typeof localStorage>"u"||localStorage.setItem(El,t))}var Wr;class jf{constructor(){He(this,Wr,xe(To));wt(this,"target",null);wt(this,"persistTheme",!0)}get current(){return r(ce(this,Wr))}set current(e){T(ce(this,Wr),e,!0)}init(e={}){this.target=e.target??null,this.persistTheme=e.persist??!0,this.current=Kf(this.target,this.persistTheme,e.initial),as(this.current,this.target)}set(e){this.current=e,as(e,this.target),Bf(e,this.persistTheme)}toggle(){this.set(this.current==="dark"?"light":"dark")}}Wr=new WeakMap;const Wn=new jf;function is(t){switch(t.view){case"query":return"/query";case"collections":return"/collections";case"cluster":return"/cluster";case"security":return"/security";case"settings":return"/settings";case"appearance":return"/appearance";case"collection":return Dd(t.collection,t.subpage)}}function Uf(t){return t.view==="collection"?{view:"collections",collection:t.collection,subpage:t.subpage}:{view:t.view,collection:null,subpage:null}}function Wf(t){if(t.startsWith("/query"))return{view:"query",collection:null,subpage:null};if(t.startsWith("/cluster"))return{view:"cluster",collection:null,subpage:null};if(t.startsWith("/security"))return{view:"security",collection:null,subpage:null};if(t.startsWith("/settings"))return{view:"settings",collection:null,subpage:null};if(t.startsWith("/appearance"))return{view:"appearance",collection:null,subpage:null};const e=t.match(/^\/c\/([^/]+)(?:\/p\/([^/]+))?/);return e?{view:"collections",collection:decodeURIComponent(e[1]),subpage:e[2]?decodeURIComponent(e[2]):null}:{view:"collections",collection:null,subpage:null}}function Ml(t){let e=xe(kt({view:"collections",collection:null,subpage:null}));return{get view(){return r(e).view},get collection(){return r(e).collection},get subpage(){return r(e).subpage},get path(){return is(r(e).collection?{view:"collection",collection:r(e).collection,subpage:r(e).subpage??"table"}:{view:r(e).view})},href:n=>is(n),go:(n,o)=>{o==null||o.preventDefault(),T(e,Uf(n),!0)}}}const zl=Symbol("red-ui-router");let _a=null;function Yf(t){return hi(zl,t),t}function no(){const t=na(zl);return t||(_a||(_a=Ml()),_a)}var Xf=k('<div class="w-px h-[18px] bg-line-2"></div> <!> <div class="w-px h-[18px] bg-line-2 ml-1"></div>',1),Gf=k('<div class="w-px h-[18px] bg-line-2"></div>'),$f=k('<header class="h-11 flex items-center justify-between px-3.5 bg-bg-1/80 backdrop-blur-md border-b border-line-1 relative z-10"><div class="flex items-center gap-2.5"><a class="font-mono font-semibold text-[13px] tracking-tight text-fg-0 no-underline hover:text-accent transition-colors">red<span class="text-accent mx-px">·</span>ui</a> <!> <nav class="flex items-center gap-0.5"><a title="Query"><!> <span>Query</span></a> <a title="Collections"><!> <span>Collections</span></a> <a title="Cluster topology"><!> <span>Cluster</span></a> <a title="Security"><!> <span>Security</span></a> <a title="Settings"><!> <span>Settings</span></a></nav></div> <div class="flex items-center gap-2.5"><!> <button type="button" class="inline-flex items-center justify-center size-7 bg-bg-2 border border-line-2 rounded-md text-fg-2 cursor-pointer transition-colors hover:border-line-3 hover:text-fg-0"><!></button> <button class="inline-flex items-center gap-2 h-7 pl-2.5 pr-2 bg-bg-2 border border-line-2 rounded-md text-fg-2 cursor-pointer text-xs transition-colors hover:border-line-3 hover:text-fg-1"><!> <span>Search or run</span> <span class="inline-flex gap-0.5 ml-1"><!><!></span></button></div></header>');function Zf(t,e){$e(e,!0);let n=qe(e,"showConnect",3,!0);const o=no();function a(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0,bubbles:!0}))}const s=E(()=>o.view==="query"),i=E(()=>o.view==="collections"),l=E(()=>o.view==="cluster"),u=E(()=>o.view==="security"),f=E(()=>o.view==="settings");var v=$f(),x=d(v),p=d(x),w=g(p,2);{var _=S=>{var z=Xf(),W=g(ve(z),2);If(W,{}),Ee(2),h(S,z)},I=S=>{var z=Gf();h(S,z)};X(w,S=>{n()?S(_):S(I,-1)})}var H=g(w,2),D=d(H),L=d(D);wl(L,{class:"size-3.5"}),Ee(2),c(D);var V=g(D,2),q=d(V);Vr(q,{class:"size-3.5"}),Ee(2),c(V);var U=g(V,2),ie=d(U);fl(ie,{class:"size-3.5"}),Ee(2),c(U);var de=g(U,2),ae=d(de);Nl(ae,{class:"size-3.5"}),Ee(2),c(de);var $=g(de,2),fe=d($);zo(fe,{class:"size-3.5"}),Ee(2),c($),c(H),c(x);var O=g(x,2),b=d(O);Ff(b,{});var M=g(b,2),m=d(M);{var N=S=>{mf(S,{class:"size-3.5"})},C=S=>{uf(S,{class:"size-3.5"})};X(m,S=>{Wn.current==="dark"?S(N):S(C,-1)})}c(M);var R=g(M,2),F=d(R);un(F,{class:"size-3.5 text-fg-3"});var J=g(F,4),A=d(J);en(A,{children:(S,z)=>{Ee();var W=pt("⌘");h(S,W)}});var y=g(A);en(y,{children:(S,z)=>{Ee();var W=pt("K");h(S,W)}}),c(J),c(R),c(O),c(v),j((S,z,W,oe,Z,Y,Q,ee,se,B,K)=>{Se(p,"href",S),Se(D,"href",z),Se(D,"aria-current",r(s)?"page":void 0),Oe(D,1,W),Se(V,"href",oe),Se(V,"aria-current",r(i)?"page":void 0),Oe(V,1,Z),Se(U,"href",Y),Se(U,"aria-current",r(l)?"page":void 0),Oe(U,1,Q),Se(de,"href",ee),Se(de,"aria-current",r(u)?"page":void 0),Oe(de,1,se),Se($,"href",B),Se($,"aria-current",r(f)?"page":void 0),Oe($,1,K),Se(M,"title",Wn.current==="dark"?"Switch to light theme":"Switch to dark theme"),Se(M,"aria-label",Wn.current==="dark"?"Switch to light theme":"Switch to dark theme")},[()=>o.href({view:"collections"}),()=>o.href({view:"query"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(s)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>o.href({view:"collections"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(i)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>o.href({view:"cluster"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(l)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>o.href({view:"security"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(u)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>o.href({view:"settings"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(f)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" "))]),be("click",p,S=>o.go({view:"collections"},S)),be("click",D,S=>o.go({view:"query"},S)),be("click",V,S=>o.go({view:"collections"},S)),be("click",U,S=>o.go({view:"cluster"},S)),be("click",de,S=>o.go({view:"security"},S)),be("click",$,S=>o.go({view:"settings"},S)),be("click",M,()=>Wn.toggle()),be("click",R,a),h(t,v),Ze()}Nt(["click"]);function Qf(t){return`'${t.replace(/'/g,"''")}'`}function Jf(){return Math.random().toString(36).slice(2,10)}function Si(t){return`UPDATE ${t.table} SET ${t.col} = ${Qf(t.newValue)} WHERE rid = ${t.row};`}var Yr,Xr;class ev{constructor(){He(this,Yr,xe(kt([])));He(this,Xr,E(()=>this.changes.length));wt(this,"executor",null)}get changes(){return r(ce(this,Yr))}set changes(e){T(ce(this,Yr),e,!0)}get count(){return r(ce(this,Xr))}set count(e){T(ce(this,Xr),e)}setExecutor(e){this.executor=e}stage(e,n,o,a,s){const i=this.changes.findIndex(u=>u.table===e&&u.row===n&&u.col===o);if(i>=0){const u=this.changes[i],f={...u,oldValue:u.oldValue,newValue:s,error:void 0},v=this.changes.slice();return v[i]=f,this.changes=v,u.id}const l=Jf();return this.changes=[...this.changes,{id:l,table:e,row:n,col:o,oldValue:a,newValue:s}],l}unstage(e){this.changes=this.changes.filter(n=>n.id!==e)}find(e,n,o){return this.changes.find(a=>a.table===e&&a.row===n&&a.col===o)}previewSql(){return this.changes.map(Si)}async commitAll(){if(this.changes.length===0)return{applied:0,failed:[]};if(!this.executor)throw new Error("PendingChanges: no commit executor configured");const e=this.changes.slice(),n=await this.executor(e),o=new Map(n.map(f=>[f.id,f])),a=[];let s=0;for(const f of e){const v=o.get(f.id);v!=null&&v.ok?s+=1:a.push({...f,error:(v==null?void 0:v.error)??"commit failed"})}const i=new Set(a.map(f=>f.id)),l=this.changes.filter(f=>!e.some(v=>v.id===f.id)),u=new Map(a.map(f=>[f.id,f]));return this.changes=[...this.changes.filter(f=>i.has(f.id)).map(f=>u.get(f.id)??f),...l],{applied:s,failed:a}}discardAll(){this.changes=[]}clear(){this.changes=[]}}Yr=new WeakMap,Xr=new WeakMap;const jt=new ev;function ya(t){try{const e=t();return typeof e=="string"&&e.length>0?e:void 0}catch{return}}function tv(t){return t.startsWith("v")?t.slice(1):t}function Tl(){return{version:tv(ya(()=>"0.3.0")??"0.0.0-dev"),gitSha:ya(()=>"unknown")??"unknown",buildTime:ya(()=>"unknown")??"unknown"}}Tl().version;var nv=k('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">rtt</span> <span class="text-fg-1 tabular-nums"> </span><span class="text-fg-3">ms</span></span>',1),rv=k('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lag</span> <span> </span></span>',1),ov=k('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lsn</span> <span class="text-fg-1 tabular-nums"> </span></span>',1),av=k('<span class="text-fg-3">·</span> <span class="inline-flex items-center gap-1 shrink-0 text-warn"><!> <span class="uppercase tracking-wider text-[10px]">read-only — file in use</span></span>',1),iv=k('<span class="inline-flex items-center gap-1.5 shrink-0"><span class="w-1.5 h-1.5 rounded-full"></span> <span class="text-fg-1 uppercase tracking-wider text-[10px]"> </span></span> <span class="text-fg-3">·</span> <span class="text-fg-1 truncate"> </span> <!> <!> <!> <!>',1),sv=k('<span class="inline-flex items-center gap-1.5 shrink-0"><span class="w-1.5 h-1.5 rounded-full bg-fg-3"></span> <span class="text-fg-3">Not connected</span></span>'),lv=k('<button type="button" data-no-nav="" class="inline-flex items-center gap-1.5 px-3 text-accent hover:bg-bg-2/60 transition-colors cursor-pointer bg-transparent border-0 border-l border-line-1"><!> <span class="tabular-nums"> </span></button>'),cv=k('<button type="button" data-no-nav="" class="inline-flex items-center gap-1 px-3 text-fg-2 hover:text-fg-0 hover:bg-bg-2/60 transition-colors cursor-pointer bg-transparent border-0 border-l border-line-1"><span>Connect</span> <!></button>'),dv=k('<div class="h-8 flex items-stretch border-b border-line-1 bg-bg-1/60 text-[11px] font-mono select-none" role="status" aria-label="Connection status"><div role="button" tabindex="0" title="Open cluster overview" class="flex-1 flex items-center gap-3 px-3 cursor-pointer hover:bg-bg-2/40 transition-colors min-w-0"><!></div> <!> <!> <span class="inline-flex items-center px-3 shrink-0 font-mono text-fg-3 border-l border-line-1 select-none"> </span></div>');function uv(t,e){$e(e,!0);const n=Tl(),o=no(),a=E(()=>jt.count),s=E(()=>Ue.readOnly),i=E(()=>Ue.readOnlyReason);function l(){window.dispatchEvent(new CustomEvent("red:open-pending-changes"))}const u=E(()=>Ue.connected),f=E(()=>{var O,b;return((O=Ue.probe.replication)==null?void 0:O.role)??((b=Ue.active)==null?void 0:b.role)??"standalone"}),v=E(()=>r(f)==="primary"?"var(--color-role-primary)":r(f)==="replica"?"var(--color-role-replica)":r(f)==="embedded"?"var(--color-role-embedded)":"var(--color-fg-3)"),x=E(()=>{var O,b;return((O=Ue.probe.replication)==null?void 0:O.wal_lsn)??((b=Ue.probe.replication)==null?void 0:b.last_applied_lsn)}),p=E(()=>{const O=Ue.probe.replication;if(!(!O||r(f)!=="replica")&&!(O.last_seen_primary_lsn===void 0||O.last_applied_lsn===void 0))return Math.max(0,O.last_seen_primary_lsn-O.last_applied_lsn)});function w(){window.dispatchEvent(new CustomEvent("red:open-connect"))}function _(O){const b=O.target;b!=null&&b.closest("button, a, [data-no-nav]")||o.go({view:"cluster"})}function I(O){(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),o.go({view:"cluster"}))}var H=dv(),D=d(H),L=d(D);{var V=O=>{var b=iv(),M=ve(b),m=d(M);let N;var C=g(m,2),R=d(C,!0);c(C),c(M);var F=g(M,4),J=d(F,!0);c(F);var A=g(F,2);{var y=Q=>{var ee=nv(),se=g(ve(ee),2),B=g(d(se),2),K=d(B,!0);c(B),Ee(),c(se),j(()=>P(K,Ue.probe.rtt_ms)),h(Q,ee)};X(A,Q=>{Ue.probe.rtt_ms!==void 0&&Q(y)})}var S=g(A,2);{var z=Q=>{var ee=rv(),se=g(ve(ee),2),B=g(d(se),2);let K;var ne=d(B,!0);c(B),c(se),j(()=>{K=Oe(B,1,"text-fg-1 tabular-nums",null,K,{"text-warn":(r(p)??0)>0}),P(ne,r(p))}),h(Q,ee)};X(S,Q=>{r(f)==="replica"&&r(p)!==void 0&&Q(z)})}var W=g(S,2);{var oe=Q=>{var ee=ov(),se=g(ve(ee),2),B=g(d(se),2),K=d(B,!0);c(B),c(se),j(()=>P(K,r(x))),h(Q,ee)};X(W,Q=>{r(x)!==void 0&&Q(oe)})}var Z=g(W,2);{var Y=Q=>{var ee=av(),se=g(ve(ee),2),B=d(se);tr(B,{class:"size-3"}),Ee(2),c(se),j(()=>Se(se,"title",r(i)??"The server is open read-only — mutations are disabled.")),h(Q,ee)};X(Z,Q=>{r(s)&&Q(Y)})}j(()=>{N=$t(m,"",N,{"background-color":r(v)}),P(R,r(f)),P(J,Ue.active.label)}),h(O,b)},q=O=>{var b=sv();h(O,b)};X(L,O=>{r(u)?O(V):O(q,-1)})}c(D);var U=g(D,2);{var ie=O=>{var b=lv(),M=d(b);tf(M,{class:"size-3"});var m=g(M,2),N=d(m);c(m),c(b),j(()=>{Se(b,"aria-label",`${r(a)} pending changes`),P(N,`Pending changes (${r(a)??""})`)}),be("click",b,l),h(O,b)};X(U,O=>{r(a)>0&&O(ie)})}var de=g(U,2);{var ae=O=>{var b=cv(),M=g(d(b),2);Bu(M,{class:"size-3"}),c(b),be("click",b,w),h(O,b)};X(de,O=>{r(u)||O(ae)})}var $=g(de,2),fe=d($);c($),c(H),j(()=>{Se($,"title",`red-ui ${n.version} · ${n.gitSha} · built ${n.buildTime}`),P(fe,`v${n.version??""}`)}),be("click",D,_),be("keydown",D,I),h(t,H),Ze()}Nt(["click","keydown"]);var fv=k('<span class="hint svelte-1yq04zr"> </span>'),vv=k('<button><span class="label svelte-1yq04zr"> </span> <!> <!></button>'),gv=k('<div class="group-label svelte-1yq04zr"> </div> <!>',1),pv=k('<div class="empty svelte-1yq04zr"> </div>'),hv=k('<div class="scrim svelte-1yq04zr" role="presentation"></div> <div class="palette svelte-1yq04zr" role="dialog" aria-modal="true"><div class="input-wrap svelte-1yq04zr"><span class="search-icon svelte-1yq04zr">⌕</span> <input placeholder="Search or run a command…" spellcheck="false" class="svelte-1yq04zr"/> <!></div> <div class="list svelte-1yq04zr"><!> <!></div> <footer class="svelte-1yq04zr"><span><!> <!> navigate</span> <span><!> run</span> <span><!><!> toggle</span></footer></div>',1);function xv(t,e){$e(e,!0);const n=no();let o=xe(!1),a=xe(""),s=xe(0),i=xe(void 0);function l(V){window.dispatchEvent(new CustomEvent(V))}const u=[{id:"query",group:"navigate",label:"Open query",hint:"/query",run:()=>v({view:"query"})},{id:"collections",group:"navigate",label:"Open collections",hint:"/collections",run:()=>v({view:"collections"})},{id:"topology",group:"navigate",label:"Open cluster",hint:"/cluster",run:()=>v({view:"cluster"})},{id:"security",group:"navigate",label:"Open security",hint:"/security",run:()=>v({view:"security"})},{id:"settings",group:"navigate",label:"Open settings",hint:"/settings",run:()=>v({view:"settings"})},{id:"appearance",group:"navigate",label:"Open appearance",hint:"/appearance",run:()=>v({view:"appearance"})},{id:"new-query",group:"data",label:"New query",shortcut:"⌘T",run:()=>{l("red:new-query"),x()}},{id:"open-connect",group:"actions",label:"Open Connect dropdown",shortcut:"⌘⇧C",run:()=>{l("red:open-connect"),x()}},{id:"apply-pending",group:"actions",label:"Apply pending changes",run:()=>{l("red:apply-pending"),x()}},{id:"discard-pending",group:"actions",label:"Discard pending changes",run:()=>{l("red:discard-pending"),x()}},{id:"toggle-theme",group:"view",label:"Toggle theme (light / dark)",hint:"theme",run:()=>{Wn.toggle(),x()}},{id:"show-shortcuts",group:"view",label:"Show keyboard shortcuts",shortcut:"?",run:()=>{x(),l("red:open-shortcuts")}}],f=E(()=>r(a).trim()===""?u:u.filter(V=>V.label.toLowerCase().includes(r(a).toLowerCase())));function v(V){n.go(V),x()}function x(){T(o,!1),T(a,""),T(s,0)}function p(V){if(!(V instanceof HTMLElement))return!1;if(V.isContentEditable)return!0;const q=V.tagName;return q==="INPUT"||q==="TEXTAREA"||q==="SELECT"}function w(V){var ie;const q=V.metaKey||V.ctrlKey,U=V.key.toLowerCase();if(q&&U==="k"){V.preventDefault(),T(o,!r(o)),r(o)&&setTimeout(()=>{var de;return(de=r(i))==null?void 0:de.focus()},0);return}if(q&&V.shiftKey&&U==="c"){V.preventDefault(),l("red:open-connect");return}if(q&&!V.shiftKey&&U==="t"&&!p(V.target)){V.preventDefault(),l("red:new-query");return}if(r(o)){if(V.key==="Escape"){x();return}V.key==="ArrowDown"&&(V.preventDefault(),T(s,Math.min(r(s)+1,r(f).length-1),!0)),V.key==="ArrowUp"&&(V.preventDefault(),T(s,Math.max(r(s)-1,0),!0)),V.key==="Enter"&&(V.preventDefault(),(ie=r(f)[r(s)])==null||ie.run())}}Rn(()=>{window.addEventListener("keydown",w);const V=()=>{T(o,!0),setTimeout(()=>{var q;return(q=r(i))==null?void 0:q.focus()},0)};return window.addEventListener("red:open-palette",V),()=>{window.removeEventListener("keydown",w),window.removeEventListener("red:open-palette",V)}});const _=["navigate","data","actions","view"],I={navigate:"Navigate",data:"Data",actions:"Actions",view:"View"};var H=Ve(),D=ve(H);{var L=V=>{var q=hv(),U=ve(q),ie=g(U,2),de=d(ie),ae=g(d(de),2);Dt(ae),tn(ae,z=>T(i,z),()=>r(i));var $=g(ae,2);en($,{children:(z,W)=>{Ee();var oe=pt("esc");h(z,oe)}}),c(de);var fe=g(de,2),O=d(fe);Je(O,17,()=>_,Ft,(z,W)=>{const oe=E(()=>r(f).filter(ee=>ee.group===r(W)));var Z=Ve(),Y=ve(Z);{var Q=ee=>{var se=gv(),B=ve(se),K=d(B,!0);c(B);var ne=g(B,2);Je(ne,17,()=>r(oe),Ft,(re,te)=>{const pe=E(()=>r(f).indexOf(r(te)));var me=vv();let _e;var ke=d(me),he=d(ke,!0);c(ke);var ge=g(ke,2);{var Ce=le=>{var we=fv(),Me=d(we,!0);c(we),j(()=>P(Me,r(te).hint)),h(le,we)};X(ge,le=>{r(te).hint&&le(Ce)})}var Pe=g(ge,2);{var ue=le=>{en(le,{children:(we,Me)=>{Ee();var Ne=pt();j(()=>P(Ne,r(te).shortcut)),h(we,Ne)}})};X(Pe,le=>{r(te).shortcut&&le(ue)})}c(me),j(()=>{_e=Oe(me,1,"row svelte-1yq04zr",null,_e,{active:r(pe)===r(s)}),P(he,r(te).label)}),zn("mouseenter",me,()=>T(s,r(pe),!0)),be("click",me,()=>r(te).run()),h(re,me)}),j(()=>P(K,I[r(W)])),h(ee,se)};X(Y,ee=>{r(oe).length&&ee(Q)})}h(z,Z)});var b=g(O,2);{var M=z=>{var W=pv(),oe=d(W);c(W),j(()=>P(oe,`No commands match "${r(a)??""}"`)),h(z,W)};X(b,z=>{r(f).length===0&&z(M)})}c(fe);var m=g(fe,2),N=d(m),C=d(N);en(C,{children:(z,W)=>{Ee();var oe=pt("↑");h(z,oe)}});var R=g(C,2);en(R,{children:(z,W)=>{Ee();var oe=pt("↓");h(z,oe)}}),Ee(),c(N);var F=g(N,2),J=d(F);en(J,{children:(z,W)=>{Ee();var oe=pt("↵");h(z,oe)}}),Ee(),c(F);var A=g(F,2),y=d(A);en(y,{children:(z,W)=>{Ee();var oe=pt("⌘");h(z,oe)}});var S=g(y);en(S,{children:(z,W)=>{Ee();var oe=pt("K");h(z,oe)}}),Ee(),c(A),c(m),c(ie),be("click",U,x),be("keydown",U,function(...z){}),be("input",ae,()=>T(s,0)),Kt(ae,()=>r(a),z=>T(a,z)),h(V,q)};X(D,V=>{r(o)&&V(L)})}h(t,H),Ze()}Nt(["click","keydown","input"]);const bv=[{id:"palette",context:"Global",keys:["⌘","K"],label:"Open command palette"},{id:"shortcuts",context:"Global",keys:["?"],label:"Show keyboard shortcuts"},{id:"new-query",context:"Global",keys:["⌘","T"],label:"New query"},{id:"open-connect",context:"Connection",keys:["⌘","⇧","C"],label:"Open Connect dropdown"},{id:"dismiss",context:"Editing",keys:["Esc"],label:"Cancel / dismiss overlay or palette"}],mv=["Global","Connection","Workspace","Editing"];var _v=k('<li class="flex items-center justify-between gap-3 px-2 py-1.5 rounded hover:bg-bg-2"><span class="text-fg-1 text-[13px]"> </span> <span class="inline-flex gap-1 shrink-0"></span></li>'),yv=k('<section><div class="flex items-baseline justify-between mb-2"><h3 class="type-label m-0"> </h3> <span class="text-fg-3 text-[11px]"> </span></div> <ul class="grid gap-1 m-0 p-0 list-none"></ul></section>'),wv=k('<div class="fixed inset-0 z-[200] bg-bg-0/70 backdrop-blur-md flex items-center justify-center p-6" role="presentation"><div class="w-full max-w-[640px] max-h-[80vh] overflow-y-auto bg-bg-1 border border-line-2 rounded-lg shadow-2xl" role="dialog" aria-modal="true" aria-label="Keyboard shortcuts" tabindex="-1"><header class="flex items-center justify-between px-5 py-3 border-b border-line-1"><div class="flex items-center gap-2"><span class="type-label">Keyboard shortcuts</span></div> <div class="flex items-center gap-1.5 text-fg-3 text-[11px]"><!> close</div></header> <div class="p-5 grid gap-5"></div></div></div>');function kv(t,e){$e(e,!0);let n=xe(!1);function o(){T(n,!1)}function a(x){if(!(x instanceof HTMLElement))return!1;if(x.isContentEditable)return!0;const p=x.tagName;return p==="INPUT"||p==="TEXTAREA"||p==="SELECT"}function s(x){if(x.key==="Escape"&&r(n)){x.preventDefault(),o();return}if(x.key==="?"&&!x.metaKey&&!x.ctrlKey&&!x.altKey){if(a(x.target))return;x.preventDefault(),T(n,!r(n))}}Rn(()=>{window.addEventListener("keydown",s);const x=()=>{T(n,!0)};return window.addEventListener("red:open-shortcuts",x),()=>{window.removeEventListener("keydown",s),window.removeEventListener("red:open-shortcuts",x)}});const i=E(()=>mv.map(x=>({ctx:x,items:bv.filter(p=>p.context===x)})).filter(x=>x.items.length>0)),l={Global:"Available anywhere in the app",Connection:"Manage which reddb you talk to",Workspace:"Move between tabs and panes",Editing:"While editing data or running queries"};var u=Ve(),f=ve(u);{var v=x=>{var p=wv(),w=d(p),_=d(w),I=g(d(_),2),H=d(I);en(H,{children:(L,V)=>{Ee();var q=pt("Esc");h(L,q)}}),Ee(),c(I),c(_);var D=g(_,2);Je(D,21,()=>r(i),Ft,(L,V)=>{var q=yv(),U=d(q),ie=d(U),de=d(ie,!0);c(ie);var ae=g(ie,2),$=d(ae,!0);c(ae),c(U);var fe=g(U,2);Je(fe,21,()=>r(V).items,Ft,(O,b)=>{var M=_v(),m=d(M),N=d(m,!0);c(m);var C=g(m,2);Je(C,21,()=>r(b).keys,Ft,(R,F)=>{en(R,{children:(J,A)=>{Ee();var y=pt();j(()=>P(y,r(F))),h(J,y)}})}),c(C),c(M),j(()=>P(N,r(b).label)),h(O,M)}),c(fe),c(q),j(()=>{P(de,r(V).ctx),P($,l[r(V).ctx])}),h(L,q)}),c(D),c(w),c(p),be("click",p,o),be("click",w,L=>L.stopPropagation()),be("keydown",w,function(...L){}),h(x,p)};X(f,x=>{r(n)&&x(v)})}h(t,u),Ze()}Nt(["click","keydown"]);var Sv=k('<label for="mp-confirm" class="type-label block mb-1">Confirm</label> <input id="mp-confirm" type="password" autocomplete="new-password" spellcheck="false" class="w-full h-9 px-3 mb-2 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent"/>',1),Cv=k("<!> ",1),Nv=k('<!> <span class="text-danger truncate"> </span>',1),Ev=k('<button type="button" class="inline-flex items-center gap-1.5 text-fg-3 hover:text-danger transition-colors cursor-pointer bg-transparent border-0 p-0"><!> <span>Start fresh — wipe this browser</span></button>'),Mv=k('<div class="flex items-center justify-between gap-2"><span class="text-danger">Erase the encrypted store and all saved connections?</span></div> <div class="flex items-center gap-2 mt-1.5"><button type="button" class="inline-flex items-center gap-1.5 px-2 py-1 rounded border border-danger/40 bg-danger/10 text-danger hover:bg-danger/20 cursor-pointer"><!> Yes, wipe</button> <button type="button" class="px-2 py-1 rounded border border-line-2 text-fg-2 hover:text-fg-0 cursor-pointer">Cancel</button></div>',1),zv=k('<div class="fixed inset-0 z-[100] flex items-center justify-center bg-bg-0/70 backdrop-blur-sm motion-reduce:backdrop-blur-none" role="dialog" aria-modal="true" aria-labelledby="mp-title"><form class="w-[380px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl p-5"><div class="flex items-center gap-2 mb-1.5 text-fg-0"><!> <h2 id="mp-title" class="type-h2 m-0"> </h2></div> <p class="text-fg-3 text-[12px] leading-relaxed m-0 mb-3"> </p> <label for="mp-pwd" class="type-label block mb-1">Master password</label> <input id="mp-pwd" type="password" spellcheck="false" class="w-full h-9 px-3 mb-2 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent"/> <!> <button type="submit" class="w-full h-9 mt-1 bg-accent text-white font-medium rounded-md cursor-pointer transition-colors hover:bg-[#ff3868] disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"><!></button> <div class="h-5 mt-2 flex items-center gap-1.5 text-[11px] font-mono"><!></div> <div class="mt-3 pt-3 border-t border-line-1 text-[11px] font-mono"><!></div></form></div>');function Tv(t,e){$e(e,!0);let n=xe(""),o=xe(""),a=xe(!1),s=xe(!1),i=xe(void 0);function l(){Ot.error=null,T(s,!0)}function u(){T(s,!1)}function f(){Ot.wipe(),T(n,""),T(o,""),T(s,!1),setTimeout(()=>{var L;return(L=r(i))==null?void 0:L.focus()},0)}const v=E(()=>Ot.needsSetup),x=E(()=>Ot.error),p=E(()=>r(v)?"Set a master password":"Unlock credentials"),w=E(()=>r(v)?"Picks a key that encrypts your connection history at rest. The password lives in this browser session only — there is no recovery.":"Enter the master password used to encrypt your saved connections.");It(()=>{Ot.locked&&setTimeout(()=>{var L;return(L=r(i))==null?void 0:L.focus()},0)});async function _(L){if(L.preventDefault(),r(a)||!r(n))return;if(r(v)&&r(n)!==r(o)){Ot.error="Passwords don't match";return}T(a,!0);const V=await Ot.unlock(r(n));T(a,!1),V&&(T(n,""),T(o,""),Ue.refresh())}var I=Ve(),H=ve(I);{var D=L=>{var V=zv(),q=d(V),U=d(q),ie=d(U);{var de=Y=>{sf(Y,{class:"size-4 text-accent"})},ae=Y=>{tr(Y,{class:"size-4 text-accent"})};X(ie,Y=>{r(v)?Y(de):Y(ae,-1)})}var $=g(ie,2),fe=d($,!0);c($),c(U);var O=g(U,2),b=d(O,!0);c(O);var M=g(O,4);Dt(M),tn(M,Y=>T(i,Y),()=>r(i));var m=g(M,2);{var N=Y=>{var Q=Sv(),ee=g(ve(Q),2);Dt(ee),Kt(ee,()=>r(o),se=>T(o,se)),h(Y,Q)};X(m,Y=>{r(v)&&Y(N)})}var C=g(m,2),R=d(C);{var F=Y=>{var Q=Cv(),ee=ve(Q);mn(ee,{class:"size-3.5 animate-spin"});var se=g(ee);j(()=>P(se,` ${r(v)?"Setting up…":"Unlocking…"}`)),h(Y,Q)},J=Y=>{var Q=pt();j(()=>P(Q,r(v)?"Set password":"Unlock")),h(Y,Q)};X(R,Y=>{r(a)?Y(F):Y(J,-1)})}c(C);var A=g(C,2),y=d(A);{var S=Y=>{var Q=Nv(),ee=ve(Q);yi(ee,{class:"size-3 text-danger"});var se=g(ee,2),B=d(se,!0);c(se),j(()=>P(B,r(x))),h(Y,Q)};X(y,Y=>{r(x)&&Y(S)})}c(A);var z=g(A,2),W=d(z);{var oe=Y=>{var Q=Ev(),ee=d(Q);os(ee,{class:"size-3"}),Ee(2),c(Q),be("click",Q,l),h(Y,Q)},Z=Y=>{var Q=Mv(),ee=g(ve(Q),2),se=d(ee),B=d(se);os(B,{class:"size-3"}),Ee(),c(se);var K=g(se,2);c(ee),be("click",se,f),be("click",K,u),h(Y,Q)};X(W,Y=>{r(s)?Y(Z,-1):Y(oe)})}c(z),c(q),c(V),j(()=>{P(fe,r(p)),P(b,r(w)),Se(M,"autocomplete",r(v)?"new-password":"current-password"),C.disabled=r(a)||!r(n)||r(v)&&!r(o)}),zn("submit",q,_),Kt(M,()=>r(n),Y=>T(n,Y)),h(L,V)};X(H,L=>{Ot.backend==="web"&&Ot.locked&&L(D)})}h(t,I),Ze()}Nt(["click"]);var Pv=k('<div class="text-fg-3 text-[12px] font-mono py-6 text-center">No staged changes.</div>'),Iv=k('<div class="text-warn text-[11px] mt-1 inline-flex items-center gap-1"><!> </div>'),Av=k('<li class="border border-line-1 rounded px-2 py-1.5 bg-bg-2/30"><div class="flex items-center justify-between gap-2 mb-1"><span class="text-fg-2"><span class="text-fg-1"> </span> <span class="text-fg-3">· rid</span> <span class="text-fg-1 tabular-nums"> </span> <span class="text-fg-3">·</span> <span class="text-fg-1"> </span></span> <button type="button" class="text-fg-3 hover:text-fg-1 text-[11px]">Unstage</button></div> <div class="text-[11px] grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5"><span class="text-fg-3">old</span> <span class="text-fg-2 truncate"> </span> <span class="text-fg-3">new</span> <span class="text-accent truncate"> </span></div> <div class="text-fg-3 text-[10.5px] mt-1 truncate"> </div> <!></li>'),Lv=k('<ul class="space-y-2 text-[12px] font-mono"></ul>'),Ov=k('<div class="text-warn text-[11px] font-mono mt-2"> </div>'),Rv=k('<div class="flex items-center gap-1.5 px-4 py-2 text-warn text-[11px] font-mono border-t border-line-1 bg-warn/5"><!> <span> </span></div>'),Dv=k('<div class="fixed inset-0 z-50 grid place-items-center bg-bg-0/70 backdrop-blur-sm motion-reduce:backdrop-blur-none" role="dialog" aria-modal="true" aria-label="Pending changes"><div class="w-full max-w-2xl mx-4 bg-bg-1 border border-line-1 rounded-md shadow-lg overflow-hidden"><div class="flex items-center justify-between px-4 py-3 border-b border-line-1"><div><h2 class="type-h3 m-0">Pending changes</h2> <p class="text-fg-3 text-[11px] font-mono m-0 mt-0.5"> </p></div> <button type="button" class="p-1 text-fg-3 hover:text-fg-1" aria-label="Close"><!></button></div> <div class="max-h-[50vh] overflow-auto px-4 py-3"><!> <!></div> <!> <div class="flex items-center justify-end gap-2 px-4 py-3 border-t border-line-1 bg-bg-1/60"><button type="button" class="text-[12px] font-mono px-3 py-1 text-fg-3 hover:text-fg-1">Cancel</button> <button type="button" class="text-[12px] font-mono px-3 py-1 text-fg-1 border border-line-1 rounded hover:bg-bg-2">Discard all</button> <button type="button" class="text-[12px] font-mono px-3 py-1 bg-accent text-white rounded disabled:opacity-50"> </button></div></div></div>');function Vv(t,e){$e(e,!0);const n=E(()=>Ue.readOnly),o=E(()=>Ue.readOnlyReason);let a=xe(!1),s=xe(null);async function i(){if(!r(a)){T(a,!0),T(s,null);try{(await jt.commitAll()).failed.length===0&&e.onClose()}catch(x){T(s,x.message,!0)}finally{T(a,!1)}}}function l(){jt.discardAll(),e.onClose()}var u=Ve(),f=ve(u);{var v=x=>{var p=Dv(),w=d(p),_=d(w),I=d(_),H=g(d(I),2),D=d(H);c(H),c(I);var L=g(I,2),V=d(L);Zt(V,{class:"size-4"}),c(L),c(_);var q=g(_,2),U=d(q);{var ie=R=>{var F=Pv();h(R,F)},de=R=>{var F=Lv();Je(F,21,()=>jt.changes,J=>J.id,(J,A)=>{var y=Av(),S=d(y),z=d(S),W=d(z),oe=d(W,!0);c(W);var Z=g(W,4),Y=d(Z,!0);c(Z);var Q=g(Z,4),ee=d(Q,!0);c(Q),c(z);var se=g(z,2);c(S);var B=g(S,2),K=g(d(B),2),ne=d(K,!0);c(K);var re=g(K,4),te=d(re,!0);c(re),c(B);var pe=g(B,2),me=d(pe,!0);c(pe);var _e=g(pe,2);{var ke=he=>{var ge=Iv(),Ce=d(ge);Vd(Ce,{class:"size-3"});var Pe=g(Ce);c(ge),j(()=>P(Pe,` ${r(A).error??""}`)),h(he,ge)};X(_e,he=>{r(A).error&&he(ke)})}c(y),j((he,ge)=>{P(oe,r(A).table),P(Y,r(A).row),P(ee,r(A).col),P(ne,he),P(te,r(A).newValue),P(me,ge)},[()=>String(r(A).oldValue??"NULL"),()=>Si(r(A))]),be("click",se,()=>jt.unstage(r(A).id)),h(J,y)}),c(F),h(R,F)};X(U,R=>{jt.count===0?R(ie):R(de,-1)})}var ae=g(U,2);{var $=R=>{var F=Ov(),J=d(F,!0);c(F),j(()=>P(J,r(s))),h(R,F)};X(ae,R=>{r(s)&&R($)})}c(q);var fe=g(q,2);{var O=R=>{var F=Rv(),J=d(F);tr(J,{class:"size-3 shrink-0"});var A=g(J,2),y=d(A,!0);c(A),c(F),j(()=>P(y,r(o)??"Server is read-only (file in use) — changes can’t be applied.")),h(R,F)};X(fe,R=>{r(n)&&R(O)})}var b=g(fe,2),M=d(b),m=g(M,2),N=g(m,2),C=d(N,!0);c(N),c(b),c(w),c(p),j(()=>{P(D,`${jt.count??""} staged · review before applying`),m.disabled=jt.count===0,N.disabled=jt.count===0||r(a)||r(n),Se(N,"title",r(n)?r(o)??"Server is read-only — mutations are disabled.":void 0),P(C,r(a)?"Applying…":"Apply all")}),be("click",L,function(...R){var F;(F=e.onClose)==null||F.apply(this,R)}),be("click",M,function(...R){var F;(F=e.onClose)==null||F.apply(this,R)}),be("click",m,l),be("click",N,i),h(x,p)};X(f,x=>{e.open&&x(v)})}h(t,u),Ze()}Nt(["click"]);const Hv=["vector","queue","stats","diff","hypertable","graph","kv","document","table"],Pl={table:"table",structured:"table",graph:"graph",node:"graph",edge:"graph",hypertable:"hypertable",timeseries:"hypertable","time-series":"hypertable",kv:"kv","key-value":"kv",vector:"vector",embedding:"vector",queue:"queue",stream:"queue",message:"queue",stats:"stats",statistic:"stats",statistics:"stats",metric:"stats",metrics:"stats",document:"document",doc:"document",time_series:"hypertable",key_value:"kv",mixed:"table",hll:"stats",sketch:"stats",filter:"stats",cuckoo_filter:"stats",diff:"diff",vcs_diff:"diff"};function qv(t){return`'${t.replace(/'/g,"''")}'`}function ss(t){if(!t||t.length===0)return"table";const e=new Set;for(const n of t){const o=String(n).toLowerCase(),a=Pl[o];a&&e.add(a)}for(const n of Hv)if(e.has(n))return n;return"table"}function Fv(t){var a,s;const e=[];if(t.kind&&e.push(t.kind),t.capability&&e.push(t.capability),Array.isArray(t.capabilities))for(const i of t.capabilities)typeof i=="string"&&e.push(i);const n=(a=t.schema)==null?void 0:a.kind;typeof n=="string"&&e.push(n);const o=(s=t.schema)==null?void 0:s.capability;return typeof o=="string"&&e.push(o),e}function Kv(t){return typeof t!="string"?null:Pl[t.toLowerCase()]??null}async function ls(t,e){const n=e.replace(/[^A-Za-z0-9_./-]/g,"");for(const o of[`HLL INFO ${n}`,`SKETCH INFO ${n}`,`FILTER INFO ${n}`])try{if((await t.query(o)).ok)return"stats"}catch{}return null}function Bv(t){var o,a,s,i;const e=new Set((((o=t.result)==null?void 0:o.columns)??[]).map(l=>l.toLowerCase())),n=(i=(s=(a=t.result)==null?void 0:a.records)==null?void 0:s[0])==null?void 0:i.values;if(n)for(const l of Object.keys(n))e.add(l.toLowerCase());return[...e]}function jv(t){var i,l,u;const e=Bv(t),n=f=>e.includes(f),o=f=>f.some(n),a=(u=(l=(i=t.result)==null?void 0:i.records)==null?void 0:l[0])==null?void 0:u.values,s=(a==null?void 0:a.kind)??(a==null?void 0:a.red_kind)??(a==null?void 0:a.red_entity_type);return s==="node"||s==="edge"||s==="graph"?"graph":s==="document"?"document":s==="kv"||n("key")&&n("value")?"kv":o(["message","payload","body"])&&o(["message_id","state","status","consumer","delivery_state"])?"queue":o(["timestamp","time","ts","event_time","bucket"])&&o(["value","count","metric"])?"hypertable":o(["metric","stat","name","table"])&&o(["value","count","total","avg","rate","row_count","page_count","cardinality","memory_bytes"])?"stats":null}async function Il(t,e,n={}){var o,a,s,i,l,u,f;if(n.useMetadata)try{const v=await t.collection(e),x=Fv(v);if(x.length>0)return ss(x)}catch{}try{const x=(i=(s=(a=(o=(await t.query(`SELECT model FROM red.collections WHERE name = ${qv(e)} LIMIT 1`)).result)==null?void 0:o.records)==null?void 0:a[0])==null?void 0:s.values)==null?void 0:i.model,p=Kv(x);if(p&&p!=="table")return p;if(typeof x=="string"&&x.toLowerCase()==="mixed"){const w=await ls(t,e);if(w)return w}}catch{}try{const v=e.replace(/[^A-Za-z0-9_./-]/g,""),x=await t.query(`SELECT * FROM ${v} LIMIT 1`),p=[];x.capability&&p.push(x.capability);const w=(f=(u=(l=x.result)==null?void 0:l.records)==null?void 0:u[0])==null?void 0:f.values,_=w?w.red_capabilities:void 0;if(Array.isArray(_))for(const H of _)typeof H=="string"&&p.push(H);else if(typeof _=="string")for(const H of _.split(/[,\s]+/))H&&p.push(H);const I=ss(p);return I!=="table"?I:jv(x)??"table"}catch{return await ls(t,e)??"table"}}const wa={table:{glyph:"▦",label:"Table"},graph:{glyph:"◇",label:"Graph"},hypertable:{glyph:"⊞",label:"Hypertable"},kv:{glyph:"⋮",label:"Key-value"},vector:{glyph:"→",label:"Vector"},queue:{glyph:"≡",label:"Queue"},stats:{glyph:"◔",label:"Stats"},diff:{glyph:"⇄",label:"Diff"},document:{glyph:"¶",label:"Document"}},Uv=/^red[._]/i;function Wv(t){return Uv.test(t)}var Yv=k('<span class="font-mono text-[10px] text-fg-3"> </span>'),Xv=k('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><!> <span class="text-fg-1">Locked.</span> <span>Enter your master password to load the schema.</span></div>'),Gv=k('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><!> <span>No schema to show.</span> <span>Connect to a reddb instance to inspect collections.</span></div>'),$v=k(`<div class="p-3 text-[12px] text-fg-3 font-mono leading-relaxed"><div class="text-fg-2">Couldn't load collections.</div> <div class="mt-1 break-words"> </div></div>`),Zv=k('<div class="p-3 text-[12px] text-fg-3 font-mono">Loading…</div>'),Qv=k('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><span class="text-fg-2">No user collections.</span> <span>Seed the instance to populate the schema.</span> <code class="px-2 py-1 bg-bg-2 border border-line-1 rounded text-[11px]"> </code></div>'),Jv=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear collection search"><!></button>'),eg=k('<button type="button"> </button>'),tg=k('<li class="px-3 py-2 font-mono text-[12px] text-fg-3">No matching collections.</li>'),ng=k('<li><a><span class="inline-block w-4 text-center text-fg-3" aria-hidden="true"> </span> <span class="truncate"> </span> <span class="sr-only"> </span></a></li>'),rg=k('<div class="p-2 border-b border-line-1 grid gap-2"><div class="flex items-center gap-1.5 h-7 rounded border border-line-1 bg-bg-0 px-2 text-[11px] font-mono"><!> <input type="text" placeholder="search collections…" class="min-w-0 flex-1 bg-transparent text-fg-1 outline-none placeholder:text-fg-3"/> <!></div> <div class="flex flex-wrap gap-1"><button type="button"> </button> <!></div></div> <ul class="py-1" role="list"><!> <!></ul>',1),og=k('<div class="px-3 py-2 border-b border-line-1 flex items-center justify-between text-fg-3"><div class="flex items-center gap-2"><!> <span class="type-label">Schema</span></div> <!></div> <!>',1);function ag(t,e){$e(e,!0);const n=no(),o=E(()=>n.collection);let a=xe(kt([])),s=xe(!1),i=xe(null),l=xe(""),u=xe("all");const f=E(()=>Ue.connected),v=E(()=>Ue.active.url),x=E(()=>{const O=new Map;for(const b of r(a))O.set(b.capability,(O.get(b.capability)??0)+1);return[...O.entries()].sort((b,M)=>b[0].localeCompare(M[0]))}),p=E(()=>{const O=r(l).trim().toLowerCase();return r(a).filter(b=>{if(r(u)!=="all"&&b.capability!==r(u))return!1;if(!O)return!0;const M=wa[b.capability];return b.name.toLowerCase().includes(O)||M.label.toLowerCase().includes(O)})});async function w(){const O=Ue.client;if(!O||!r(f)){T(a,[],!0);return}T(s,!0),T(i,null);const b=r(v);try{const m=(await Mt.track("schema · list collections",()=>O.collections())).filter(C=>!Wv(C)).sort();T(a,m.map(C=>({name:C,capability:"table"})),!0);const N=m.map(C=>Mt.track(`schema · probe ${C}`,async()=>{const R=await Il(O,C);b===r(v)&&T(a,r(a).map(F=>F.name===C?{...F,capability:R}:F),!0)}));await Promise.all(N)}catch(M){T(i,M.message,!0),T(a,[],!0)}finally{T(s,!1)}}It(()=>{Ot.locked||(r(f),r(v),w())});var _=og(),I=ve(_),H=d(I),D=d(H);Vr(D,{class:"size-3.5"}),Ee(2),c(H);var L=g(H,2);{var V=O=>{var b=Yv(),M=d(b,!0);c(b),j(()=>P(M,r(a).length)),h(O,b)};X(L,O=>{r(f)&&r(a).length>0&&O(V)})}c(I);var q=g(I,2);{var U=O=>{var b=Xv(),M=d(b);tr(M,{class:"size-4 text-accent"}),Ee(4),c(b),h(O,b)},ie=O=>{var b=Gv(),M=d(b);wi(M,{class:"size-4 text-fg-3"}),Ee(4),c(b),h(O,b)},de=O=>{var b=$v(),M=g(d(b),2),m=d(M,!0);c(M),c(b),j(()=>P(m,r(i))),h(O,b)},ae=O=>{var b=Zv();h(O,b)},$=O=>{var b=Qv(),M=g(d(b),4),m=d(M);c(M),c(b),j(()=>P(m,`./scripts/seed.sh ${r(v)??""}`)),h(O,b)},fe=O=>{var b=rg(),M=ve(b),m=d(M),N=d(m);un(N,{class:"size-3 text-fg-3"});var C=g(N,2);Dt(C);var R=g(C,2);{var F=Y=>{var Q=Jv(),ee=d(Q);Zt(ee,{class:"size-3"}),c(Q),be("click",Q,()=>T(l,"")),h(Y,Q)};X(R,Y=>{r(l)&&Y(F)})}c(m);var J=g(m,2),A=d(J),y=d(A);c(A);var S=g(A,2);Je(S,17,()=>r(x),([Y,Q])=>Y,(Y,Q)=>{var ee=E(()=>on(r(Q),2));let se=()=>r(ee)[0],B=()=>r(ee)[1];const K=E(()=>wa[se()]);var ne=eg(),re=d(ne);c(ne),j(te=>{Se(ne,"title",r(K).label),Oe(ne,1,te),P(re,`${r(K).glyph??""} ${B()??""}`)},[()=>We(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",r(u)===se()?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),be("click",ne,()=>T(u,se(),!0)),h(Y,ne)}),c(J),c(M);var z=g(M,2),W=d(z);{var oe=Y=>{var Q=tg();h(Y,Q)};X(W,Y=>{r(p).length===0&&Y(oe)})}var Z=g(W,2);Je(Z,17,()=>r(p),Y=>Y.name,(Y,Q)=>{const ee=E(()=>wa[r(Q).capability]),se=E(()=>r(Q).name===r(o)),B=E(()=>({view:"collection",collection:r(Q).name,subpage:Ar(r(Q).capability)}));var K=ng(),ne=d(K),re=d(ne),te=d(re,!0);c(re);var pe=g(re,2),me=d(pe,!0);c(pe);var _e=g(pe,2),ke=d(_e,!0);c(_e),c(ne),c(K),j((he,ge)=>{Se(ne,"href",he),Se(ne,"aria-current",r(se)?"page":void 0),Se(ne,"title",`${r(ee).label} · ${r(Q).name}`),Oe(ne,1,ge),P(te,r(ee).glyph),P(me,r(Q).name),P(ke,r(ee).label)},[()=>n.href(r(B)),()=>We(["w-full flex items-center gap-2 px-3 py-1 font-mono text-[12px] no-underline transition-colors",r(se)?"bg-bg-1 text-fg-0":"text-fg-2 hover:bg-bg-1 hover:text-fg-0"].join(" "))]),be("click",ne,he=>n.go(r(B),he)),h(Y,K)}),c(z),j(Y=>{Oe(A,1,Y),P(y,`all ${r(a).length??""}`)},[()=>We(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",r(u)==="all"?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),Kt(C,()=>r(l),Y=>T(l,Y)),be("click",A,()=>T(u,"all")),h(O,b)};X(q,O=>{Ot.locked?O(U):r(f)?r(i)?O(de,2):r(s)&&r(a).length===0?O(ae,3):r(a).length===0?O($,4):O(fe,-1):O(ie,1)})}h(t,_),Ze()}Nt(["click"]);function ig(){return Math.random().toString(36).slice(2,10)}var Gr,$r,Zr;class sg{constructor(){He(this,Gr,xe(kt([])));He(this,$r,xe(null));He(this,Zr,E(()=>this.tabs.find(e=>e.id===this.activeId)??null))}get tabs(){return r(ce(this,Gr))}set tabs(e){T(ce(this,Gr),e,!0)}get activeId(){return r(ce(this,$r))}set activeId(e){T(ce(this,$r),e,!0)}get active(){return r(ce(this,Zr))}set active(e){T(ce(this,Zr),e)}open(e,n=!1){if(!n){const a=this.tabs.find(s=>s.kind===e.kind&&s.key===e.key);if(a){const s={...a,...e,id:a.id};return this.tabs=this.tabs.map(i=>i===a?s:i),this.activeId=a.id,s}}const o={...e,id:ig()};return this.tabs=[...this.tabs,o],this.activeId=o.id,o}focus(e){this.tabs.some(n=>n.id===e)&&(this.activeId=e)}close(e,n){const o=this.tabs.findIndex(s=>s.id===e);if(o<0)return;const a=this.activeId===e;if(this.tabs=this.tabs.filter(s=>s.id!==e),a)if(n&&this.tabs.some(s=>s.id===n))this.activeId=n;else if(this.tabs.length===0)this.activeId=null;else{const s=this.tabs[Math.max(0,o-1)];this.activeId=(s==null?void 0:s.id)??null}}rename(e,n){this.tabs=this.tabs.map(o=>o.id===e?{...o,label:n}:o)}setOverride(e,n){this.tabs=this.tabs.map(o=>o.id===e?{...o,overrideCapability:n}:o)}setShowSystem(e,n){this.tabs=this.tabs.map(o=>o.id===e?{...o,showSystemColumns:n}:o)}clear(){this.tabs=[],this.activeId=null}}Gr=new WeakMap,$r=new WeakMap,Zr=new WeakMap;const _t=new sg;function lg(){return{sql:"",result:null,error:null,running:!1}}var Qr;class cg{constructor(){He(this,Qr,xe(kt({})));wt(this,"counter",0);wt(this,"executor",null)}get states(){return r(ce(this,Qr))}set states(e){T(ce(this,Qr),e,!0)}setExecutor(e){this.executor=e}nextLabel(){return this.counter+=1,`Query ${this.counter}`}ensure(e){return this.states[e]||(this.states[e]=lg()),this.states[e]}setSql(e,n){const o=this.ensure(e);o.sql=n}get(e){return this.states[e]}has(e){return this.states[e]!==void 0}remove(e){delete this.states[e]}isDirty(e){const n=this.states[e];return n?n.sql.trim().length>0:!1}async run(e){const n=this.ensure(e);if(n.running)return;if(!this.executor){n.error="No connection — connect to a reddb instance first.",n.result=null;return}const o=n.sql.trim();if(!o){n.error="Empty query.",n.result=null;return}n.running=!0,n.error=null;try{const a=await this.executor(o);n.result=a,n.error=a.ok?null:a.error??"Query failed."}catch(a){n.error=a.message,n.result=null}finally{n.running=!1}}clear(){this.states={},this.counter=0,this.executor=null}}Qr=new WeakMap;const rn=new cg;function dg(t,e,n=24){const o=t.trim();if(!o)return e;const a=o.match(/^\s*select\s+([\s\S]+?)\s+from\b/i);if(!a)return e;const s=a[1].replace(/\s+/g," ").trim();return!s||s==="*"?e:s.length<=n?s:s.slice(0,n-1).trimEnd()+"…"}function ug(t){return`'${t.replace(/'/g,"''")}'`}function fg(t){return["SELECT name, model, schema_mode, entities, segments, indices,","in_memory_bytes, on_disk_bytes, internal, tenant_id, queue_mode,","dimension, metric, session_key, session_gap_ms","FROM red.collections",`WHERE name = ${ug(t)}`,"LIMIT 1"].join(" ")}function Bn(t){return typeof t=="string"&&t.length>0?t:void 0}function jn(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){const e=Number(t);if(Number.isFinite(e))return e}}function vg(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t.toLowerCase()==="true")return!0;if(t.toLowerCase()==="false")return!1}}function gg(t){if(!t)return null;const e=t.values,n=Bn(e.name);return n?{name:n,model:Bn(e.model),schemaMode:Bn(e.schema_mode),entities:jn(e.entities),segments:jn(e.segments),indices:jn(e.indices),inMemoryBytes:jn(e.in_memory_bytes),onDiskBytes:jn(e.on_disk_bytes),internal:vg(e.internal),tenantId:Bn(e.tenant_id),queueMode:Bn(e.queue_mode),dimension:jn(e.dimension),metric:Bn(e.metric),sessionKey:Bn(e.session_key),sessionGapMs:jn(e.session_gap_ms)}:null}function Po(t){return t===void 0?"n/a":new Intl.NumberFormat("en-US").format(t)}function cs(t){if(t===void 0)return"n/a";if(t===0)return"0 B";const e=["B","KiB","MiB","GiB","TiB"],n=Math.min(Math.floor(Math.log(t)/Math.log(1024)),e.length-1),o=t/1024**n,a=o>=100||n===0?0:1;return`${o.toFixed(a)} ${e[n]}`}function pg(t){return t===void 0?null:t<1e3?`${t} ms`:t<6e4?`${(t/1e3).toFixed(t>=1e4?0:1)} s`:t<36e5?`${(t/6e4).toFixed(t>=6e5?0:1)} min`:`${(t/36e5).toFixed(t>=36e6?0:1)} h`}function ds(t){const e=[];t.schemaMode&&e.push(t.schemaMode),t.dimension!==void 0&&e.push(`${Po(t.dimension)}d`),t.metric&&e.push(t.metric),t.queueMode&&e.push(t.queueMode),t.sessionKey&&e.push(`session: ${t.sessionKey}`);const n=pg(t.sessionGapMs);return n&&e.push(`gap ${n}`),t.internal&&e.push("internal"),e}class hg{constructor(){wt(this,"renderers",[])}register(e){const n=this.renderers.findIndex(o=>o.capability===e.capability);n>=0?this.renderers[n]=e:this.renderers.push(e)}unregister(e){this.renderers=this.renderers.filter(n=>n.capability!==e)}list(){return this.renderers}has(e){return this.renderers.some(n=>n.capability===e)}pick(e,n,o){if(o){const i=this.renderers.find(l=>l.capability===o);if(i)return i}if(e){const i=this.renderers.find(l=>l.capability===e);if(i&&i.renders(n))return i}const a=this.renderers.find(i=>i.renders(n));if(a)return a;const s=this.renderers.find(i=>i.capability==="table");if(!s)throw new Error("No renderer matched and no table fallback is registered");return s}}const an=new hg,xg=80,Al=["rid","collection","kind","tenant","created_at","updated_at"],bg=new Set(Al);function Ga(t){return bg.has(t.toLowerCase())}function mg(t,e={}){const n=t.result.columns,o=n.filter(f=>!f.startsWith("red_")&&f!=="body"),a=o.filter(f=>!Ga(f)),s=a.find(f=>f.toLowerCase()==="id"),i=a.filter(f=>f!==s),l=[s,...i].filter(f=>!!f);return e.showSystem?[...Al.filter(f=>o.includes(f)),...l]:l.length>0?l:n}function us(t){const e=t.toLowerCase();return e==="rid"?"rid":e==="id"?"id":null}function _g(t){return t.find(e=>e.toLowerCase()==="rid")??t.find(e=>e.toLowerCase()==="id")??t.find(e=>e.toLowerCase().endsWith("_id"))??t[0]??null}function yg(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function wg(t){return t==null}function kg(t,e=xg){return t.result.records.slice(0,e).map(n=>n.values)}var Sg=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6"> </div>'),Cg=k('<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 hover:border-line-2 cursor-pointer" title="Return to the original result"><!> reset</button>'),Ng=k('<button type="button" title="Build a SELECT for this collection"><!> <span>select</span></button> <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 hover:border-line-2 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed" title="Run the current SELECT against reddb"><!> run</button> <!> <div class="h-4 w-px bg-line-1"></div>',1),Eg=k('<span class="text-[9px] px-1 rounded bg-accent text-white"> </span>'),Mg=k('<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 hover:border-line-2 cursor-pointer" title="Clear all filters"><!> clear</button>'),zg=k('<label><input type="checkbox" class="sr-only"/> </label>'),Tg=k('<span class="text-warn"> </span>'),Pg=k('<div class="border-b border-line-1 bg-bg-1/20 px-3 py-2 text-[11px] font-mono"><div class="mb-2 flex items-center gap-2"><span class="text-fg-3">columns:</span> <button type="button" class="rounded border border-line-1 px-1.5 py-0.5 text-fg-3 hover:text-fg-1 hover:border-line-2">all</button> <button type="button" class="rounded border border-line-1 px-1.5 py-0.5 text-fg-3 hover:text-fg-1 hover:border-line-2">none</button> <label class="ml-auto inline-flex items-center gap-1.5 text-fg-3">limit <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5"><option>50</option><option>100</option><option>200</option><option>500</option><option>1k</option></select></label></div> <div class="flex flex-wrap gap-1"></div> <div class="mt-2 flex items-center gap-2 text-fg-3"><code class="min-w-0 flex-1 truncate rounded border border-line-1 bg-bg-0 px-2 py-1 text-fg-1"> </code> <!></div></div>'),Ig=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">Empty result.</div>'),Ag=k(`<span class="ml-1 text-[9px] px-1 py-0.5 rounded bg-accent text-white uppercase tracking-wider font-semibold" title="System-assigned row id — reddb's canonical address">sys</span>`),Lg=k('<span class="ml-1 text-[9px] px-1 py-0.5 rounded border border-line-2 text-fg-3 uppercase tracking-wider" title="Reserved system field — written by reddb">sys</span>'),Og=k('<span class="ml-1 text-[9px] px-1 py-0.5 rounded border border-line-2 text-fg-2 uppercase tracking-wider" title="User-defined identifier">pk</span>'),Rg=k('<span class="ml-1 text-[10px] text-fg-3 uppercase tracking-wide" title="Inferred primary key">pk</span>'),Dg=k("<th><span> </span> <!></th>"),Vg=k('<button type="button" class="absolute right-1 top-1/2 -translate-y-1/2 text-fg-3 hover:text-fg-1 cursor-pointer"><!></button>'),Hg=k('<th class="px-1 py-1"><div class="relative"><input type="text" class="w-full h-6 pl-2 pr-5 bg-bg-1 text-fg-1 border border-line-1 rounded text-[11px] font-mono outline-none focus:border-accent placeholder:text-fg-3"/> <!></div></th>'),qg=k('<tr class="border-b border-line-1 bg-bg-0"><th class="px-2 py-1"></th><!></tr>'),Fg=k('<input class="w-full bg-bg-2 text-fg-1 border border-accent/60 rounded px-1 py-0.5 outline-none"/>'),Kg=k('<span class="text-fg-3 italic">NULL</span>'),Bg=k('<span class="block truncate"> </span>'),jg=k("<td><!></td>"),Ug=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-right text-fg-3 select-none"></td><!></tr>'),Wg=k('· <span class="text-fg-2"> </span>',1),Yg=k('<span>· pk <code class="text-fg-2"> </code></span>'),Xg=k('<div class="flex-1 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-right w-10 font-normal">#</th><!></tr><!></thead><tbody></tbody></table></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3 flex items-center gap-3"><span> <!> <!></span> <span>· double-click a cell to stage edit</span> <!></div>',1),Gg=k('<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"><!> <button type="button"><!> <span>filters</span> <!></button> <!> <div class="ml-auto text-fg-3"> <!> rows</div></div> <!> <!>',1),$g=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function Zg(t,e){$e(e,!0);let n=qe(e,"showSystem",3,!1),o=xe(null);const a=E(()=>r(o)??e.result),s=E(()=>kg(r(a))),i=E(()=>mg(r(a),{showSystem:n()})),l=E(()=>_g(r(i))),u=E(()=>r(i).filter(y=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(y)));let f=xe(!1),v=xe(kt({})),x=xe(200),p=xe(!1),w=xe(null);It(()=>{const y={...r(v)};let S=!1;for(const z of r(u))y[z]===void 0&&(y[z]=!0,S=!0);for(const z of Object.keys(y))r(u).includes(z)||(delete y[z],S=!0);S&&T(v,y,!0)});let _=xe(kt({})),I=xe(!1);const H=E(()=>{const y=Object.entries(r(_)).filter(([,S])=>S.trim().length>0);return y.length===0?r(s):r(s).filter(S=>y.every(([z,W])=>{const oe=S[z];return oe==null?!1:String(oe).toLowerCase().includes(W.toLowerCase())}))}),D=E(()=>r(H)),L=E(()=>Object.values(r(_)).filter(y=>y.trim().length>0).length);function V(y){const S={...r(_)};delete S[y],T(_,S,!0)}function q(){T(_,{},!0)}function U(){if(!e.collection)return null;const y=e.collection.replace(/[^A-Za-z0-9_./-]/g,"");return y.length>0?y:null}function ie(){const y=r(u).filter(S=>r(v)[S]);return y.length===0||y.length===r(u).length?"*":y.join(", ")}function de(){const y=U();return y?`SELECT ${ie()} FROM ${y} LIMIT ${r(x)}`:null}async function ae(){const y=Ue.client,S=de();if(!(!y||!S)){T(p,!0),T(w,null);try{const z=await Mt.track(`${e.collection} · ${S}`,()=>y.query(S));if(!z.ok){T(w,z.error??"query failed",!0);return}T(o,z,!0),T(_,{},!0),T(fe,null)}catch(z){T(w,z.message,!0)}finally{T(p,!1)}}}function $(){T(o,null),T(_,{},!0),T(w,null)}let fe=xe(null),O=xe("");function b(y,S,z){if(r(fe)||!e.collection||Ue.readOnly)return;T(fe,{row:y,col:S},!0);const W=jt.find(e.collection,y,S);T(O,W?W.newValue:String(z??""),!0)}function M(){var oe;if(!r(fe)||!e.collection)return;const{row:y,col:S}=r(fe),z=(oe=r(D)[y])==null?void 0:oe[S],W=r(O);if(String(z??"")!==W)jt.stage(e.collection,y,S,z,W);else{const Z=jt.find(e.collection,y,S);Z&&jt.unstage(Z.id)}T(fe,null)}function m(){T(fe,null)}function N(y){y.focus(),y.select()}function C(y,S,z){if(!e.collection)return{value:z,staged:!1};const W=jt.find(e.collection,y,S);return W?{value:W.newValue,staged:!0}:{value:z,staged:!1}}var R=$g(),F=d(R);{var J=y=>{var S=Sg(),z=d(S,!0);c(S),j(()=>P(z,r(a).error??"Query failed.")),h(y,S)},A=y=>{var S=Gg(),z=ve(S),W=d(z);{var oe=ge=>{var Ce=Ng(),Pe=ve(Ce),ue=d(Pe);Zu(ue,{class:"size-3"}),Ee(2),c(Pe);var le=g(Pe,2),we=d(le);{var Me=ze=>{mn(ze,{class:"size-3 animate-spin"})},Ne=ze=>{oa(ze,{class:"size-3"})};X(we,ze=>{r(p)?ze(Me):ze(Ne,-1)})}Ee(),c(le);var Te=g(le,2);{var ye=ze=>{var Ae=Cg(),Ke=d(Ae);Hd(Ke,{class:"size-3"}),Ee(),c(Ae),be("click",Ae,$),h(ze,Ae)};X(Te,ze=>{r(o)&&ze(ye)})}Ee(2),j(ze=>{Se(Pe,"aria-pressed",r(f)),Oe(Pe,1,ze),le.disabled=r(p)||!Ue.connected},[()=>We(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",r(f)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),be("click",Pe,()=>T(f,!r(f))),be("click",le,ae),h(ge,Ce)};X(W,ge=>{e.collection&&ge(oe)})}var Z=g(W,2),Y=d(Z);kl(Y,{class:"size-3"});var Q=g(Y,4);{var ee=ge=>{var Ce=Eg(),Pe=d(Ce,!0);c(Ce),j(()=>P(Pe,r(L))),h(ge,Ce)};X(Q,ge=>{r(L)>0&&ge(ee)})}c(Z);var se=g(Z,2);{var B=ge=>{var Ce=Mg(),Pe=d(Ce);Zt(Pe,{class:"size-3"}),Ee(),c(Ce),be("click",Ce,q),h(ge,Ce)};X(se,ge=>{r(L)>0&&ge(B)})}var K=g(se,2),ne=d(K,!0),re=g(ne);{var te=ge=>{var Ce=pt();j(Pe=>P(Ce,`of ${Pe??""}`),[()=>r(s).length.toLocaleString()]),h(ge,Ce)};X(re,ge=>{r(L)>0&&ge(te)})}Ee(),c(K),c(z);var pe=g(z,2);{var me=ge=>{var Ce=Pg(),Pe=d(Ce),ue=g(d(Pe),2),le=g(ue,2),we=g(le,2),Me=g(d(we)),Ne=d(Me);Ne.value=Ne.__value=50;var Te=g(Ne);Te.value=Te.__value=100;var ye=g(Te);ye.value=ye.__value=200;var ze=g(ye);ze.value=ze.__value=500;var Ae=g(ze);Ae.value=Ae.__value=1e3,c(Me);var Ke;xi(Me),c(we),c(Pe);var at=g(Pe,2);Je(at,20,()=>r(u),Re=>Re,(Re,Ie)=>{var Fe=zg(),G=d(Fe);Dt(G);var De=g(G);c(Fe),j(Le=>{Oe(Fe,1,Le),vl(G,r(v)[Ie]??!1),P(De,` ${Ie??""}`)},[()=>We(["inline-flex h-5 items-center gap-1 rounded border px-1.5 cursor-pointer",r(v)[Ie]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1"].join(" "))]),be("change",G,Le=>T(v,{...r(v),[Ie]:Le.currentTarget.checked},!0)),h(Re,Fe)}),c(at);var Be=g(at,2),Qe=d(Be),dt=d(Qe,!0);c(Qe);var vt=g(Qe,2);{var Ge=Re=>{var Ie=Tg(),Fe=d(Ie,!0);c(Ie),j(()=>P(Fe,r(w))),h(Re,Ie)};X(vt,Re=>{r(w)&&Re(Ge)})}c(Be),c(Ce),j(Re=>{Ke!==(Ke=r(x))&&(Me.value=(Me.__value=r(x))??"",bi(Me,r(x))),P(dt,Re)},[()=>de()??"No collection selected"]),be("click",ue,()=>{const Re={};for(const Ie of r(u))Re[Ie]=!0;T(v,Re,!0)}),be("click",le,()=>T(v,{},!0)),be("change",Me,Re=>T(x,Number(Re.currentTarget.value),!0)),h(ge,Ce)};X(pe,ge=>{r(f)&&e.collection&&ge(me)})}var _e=g(pe,2);{var ke=ge=>{var Ce=Ig();h(ge,Ce)},he=ge=>{var Ce=Xg(),Pe=ve(Ce),ue=d(Pe),le=d(ue),we=d(le),Me=g(d(we));Je(Me,17,()=>r(i),Ft,(Re,Ie)=>{const Fe=E(()=>us(r(Ie))),G=E(()=>Ga(r(Ie)));var De=Dg(),Le=d(De),je=d(Le,!0);c(Le);var Ye=g(Le,2);{var lt=Xe=>{var tt=Ag();h(Xe,tt)},ct=Xe=>{var tt=Lg();h(Xe,tt)},gt=Xe=>{var tt=Og();h(Xe,tt)},it=Xe=>{var tt=Rg();h(Xe,tt)};X(Ye,Xe=>{r(Fe)==="rid"?Xe(lt):r(G)?Xe(ct,1):r(Fe)==="id"?Xe(gt,2):r(Ie)===r(l)&&Xe(it,3)})}c(De),j(Xe=>{Oe(De,1,Xe),Oe(Le,1,We(r(Fe)||r(G)?"font-semibold":"")),P(je,r(Ie))},[()=>We(["px-2 py-1.5 text-left font-normal whitespace-nowrap",r(Fe)==="rid"?"bg-accent/5 text-fg-0":r(G)?"bg-bg-1 text-fg-2":r(Fe)==="id"?"text-fg-1":""].join(" "))]),h(Re,De)}),c(we);var Ne=g(we);{var Te=Re=>{var Ie=qg(),Fe=g(d(Ie));Je(Fe,17,()=>r(i),Ft,(G,De)=>{var Le=Hg(),je=d(Le),Ye=d(je);Dt(Ye);var lt=g(Ye,2);{var ct=gt=>{var it=Vg(),Xe=d(it);Zt(Xe,{class:"size-3"}),c(it),j(()=>Se(it,"aria-label",`Clear filter for ${r(De)??""}`)),be("click",it,()=>V(r(De))),h(gt,it)};X(lt,gt=>{var it;(it=r(_)[r(De)])!=null&&it.length&>(ct)})}c(je),c(Le),j(()=>Se(Ye,"placeholder",`filter ${r(De)??""}…`)),Kt(Ye,()=>r(_)[r(De)],gt=>r(_)[r(De)]=gt),h(G,Le)}),c(Ie),h(Re,Ie)};X(Ne,Re=>{r(I)&&Re(Te)})}c(le);var ye=g(le);Je(ye,21,()=>r(D),Ft,(Re,Ie,Fe)=>{var G=Ug(),De=d(G);De.textContent=Fe+1;var Le=g(De);Je(Le,17,()=>r(i),Ft,(je,Ye)=>{const lt=E(()=>r(Ie)[r(Ye)]),ct=E(()=>C(Fe,r(Ye),r(lt))),gt=E(()=>{var bt;return((bt=r(fe))==null?void 0:bt.row)===Fe&&r(fe).col===r(Ye)}),it=E(()=>us(r(Ye))),Xe=E(()=>Ga(r(Ye)));var tt=jg(),st=d(tt);{var ut=bt=>{var mt=Fg();Dt(mt),pi(()=>Kt(mt,()=>r(O),Et=>T(O,Et))),Xt(mt,Et=>N==null?void 0:N(Et)),zn("blur",mt,M),be("keydown",mt,Et=>{Et.key==="Enter"?M():Et.key==="Escape"&&m()}),h(bt,mt)},ht=bt=>{var mt=Kg();h(bt,mt)},xt=E(()=>wg(r(ct).value)),Tt=bt=>{var mt=Bg(),Et=d(mt,!0);c(mt),j(Pt=>P(Et,Pt),[()=>yg(r(ct).value)]),h(bt,mt)};X(st,bt=>{r(gt)?bt(ut):r(xt)?bt(ht,1):bt(Tt,-1)})}c(tt),j(bt=>{Oe(tt,1,bt),Se(tt,"title",r(ct).staged?"Staged change — open Pending Changes to commit":void 0)},[()=>We(["px-2 py-1 max-w-[260px] truncate align-top",r(it)==="rid"?"bg-accent/5 text-accent font-semibold":r(Xe)?"bg-bg-1 text-fg-2 font-mono":r(it)==="id"?"text-fg-0":"",r(ct).staged&&!r(gt)?"bg-warn/15 text-fg-1":""].join(" "))]),be("dblclick",tt,()=>b(Fe,r(Ye),r(lt))),h(je,tt)}),c(G),h(Re,G)}),c(ye),c(ue),c(Pe);var ze=g(Pe,2),Ae=d(ze),Ke=d(Ae),at=g(Ke);{var Be=Re=>{var Ie=pt("· filtered");h(Re,Ie)};X(at,Re=>{r(L)>0&&Re(Be)})}var Qe=g(at,2);{var dt=Re=>{var Ie=Wg(),Fe=g(ve(Ie)),G=d(Fe,!0);c(Fe),j(()=>P(G,e.collection)),h(Re,Ie)};X(Qe,Re=>{e.collection&&Re(dt)})}c(Ae);var vt=g(Ae,4);{var Ge=Re=>{var Ie=Yg(),Fe=g(d(Ie)),G=d(Fe,!0);c(Fe),c(Ie),j(()=>P(G,r(l))),h(Re,Ie)};X(vt,Re=>{r(l)&&Re(Ge)})}c(ze),j(()=>P(Ke,`${r(D).length??""} of ${r(a).record_count??""} rows `)),h(ge,Ce)};X(_e,ge=>{r(a).result.records.length?ge(he,-1):ge(ke)})}j((ge,Ce)=>{Se(Z,"aria-pressed",r(I)),Se(Z,"title",r(I)?"Hide column filters":"Show column filters"),Oe(Z,1,ge),P(ne,Ce)},[()=>We(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",r(I)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>r(D).length.toLocaleString()]),be("click",Z,()=>T(I,!r(I))),h(y,S)};X(F,y=>{r(a).ok?y(A,-1):y(J)})}c(R),h(t,R),Ze()}Nt(["click","change","dblclick","keydown"]);const Qg={capability:"table",renders:t=>!!(t!=null&&t.result)&&Array.isArray(t.result.columns),component:Zg},Jg={capability:"graph",renders:t=>Fd(t),component:qd};function Ll(t){return t.find(e=>e.toLowerCase()==="key")??t.find(e=>e.toLowerCase()==="k")??t.find(e=>/(^|_)key$/i.test(e))??null}function Ol(t){return t.find(e=>e.toLowerCase()==="value")??t.find(e=>e.toLowerCase()==="v")??t.find(e=>/(^|_)value$/i.test(e))??null}function ep(t){const e=t.result.columns,n=Ll(e),o=Ol(e);return!n||!o?[]:t.result.records.map(a=>({key:String(a.values[n]??""),value:a.values[o]}))}function tp(t){var n;const e=((n=t.result)==null?void 0:n.columns)??[];return Ll(e)!==null&&Ol(e)!==null}function np(t,e){const n={};for(const o of t){if(!o.key.startsWith(e))continue;const s=o.key.slice(e.length).replace(/^\/+/,"").split("/").filter(Boolean);if(s.length===0){n.$value=o.value;continue}let i=n;for(let l=0;l<s.length;l+=1){const u=s[l];if(l===s.length-1){const v=i[u];v&&typeof v=="object"&&!Array.isArray(v)?v.$value=o.value:i[u]=o.value;continue}const f=i[u];if(!f||typeof f!="object"||Array.isArray(f)){const v={};f!==void 0&&(v.$value=f),i[u]=v,i=v}else i=f}}return n}function rp(t){const e={name:"",fullKey:null,value:void 0,children:[]};for(const n of t){const o=n.key.split("/").filter(s=>s.length>0);if(o.length===0)continue;let a=e;o.forEach((s,i)=>{let l=a.children.find(u=>u.name===s);if(!l){l={name:s,fullKey:null,value:void 0,children:[]};const u=a.children.findIndex(f=>f.name>s);u<0?a.children.push(l):a.children.splice(u,0,l)}i===o.length-1&&(l.fullKey=n.key,l.value=n.value),a=l})}return e}function fs(t){return t==null?"null":typeof t=="object"?JSON.stringify(t):String(t)}var op=k('<span class="text-fg-3 ml-2"> </span>'),ap=k("<ul></ul>"),ip=k('<li><button type="button"><span class="text-fg-1"> </span> <!></button> <!></li>'),sp=k(`<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No KV shape — expected <code>key</code> and <code>value</code> columns
|
|
990
|
-
(also accepts <code>*_key</code>/<code>*_value</code>).</div>`),lp=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear prefix"><!></button>'),cp=k('· <span class="text-fg-2"> </span>',1),dp=k('<li class="px-3 py-2 text-fg-3">No keys match prefix.</li>'),up=k('<div class="text-fg-3 mb-2"> </div> <pre class="text-fg-1 whitespace-pre-wrap break-all"> </pre>',1),fp=k('<div class="text-fg-3">Click a key to inspect.</div>'),vp=k('<div class="flex-1 grid grid-cols-[280px_1fr] min-h-0"><ul class="overflow-auto border-r border-line-1 text-[12px] font-mono py-1"><!></ul> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),gp=k('<div class="text-fg-3">No keys match prefix.</div>'),pp=k('<pre class="whitespace-pre text-fg-1"> </pre>'),hp=k('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><!></div>'),xp=k('<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"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> Tree</button> <button type="button"><!> JSON</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="key prefix…" class="bg-transparent text-fg-1 outline-none w-[220px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto text-fg-3"> <!> keys <!></div></div> <!>',1),bp=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function mp(t,e){$e(e,!0);const n=(I,H=Gt,D=Gt)=>{var L=ip(),V=d(L);let q,U;var ie=d(V),de=d(ie,!0);c(ie);var ae=g(ie,2);{var $=b=>{var M=op(),m=d(M,!0);c(M),j(N=>P(m,N),[()=>v(H().value)]),h(b,M)};X(ae,b=>{H().fullKey!==null&&b($)})}c(V);var fe=g(V,2);{var O=b=>{var M=ap();Je(M,21,()=>H().children,m=>m.name,(m,N)=>{n(m,()=>r(N),()=>D()+1)}),c(M),h(b,M)};X(fe,b=>{H().children.length>0&&b(O)})}c(L),j(()=>{q=Oe(V,1,"w-full text-left px-2 py-0.5 hover:bg-bg-1/60",null,q,{"text-accent":r(s)===H()}),U=$t(V,"",U,{"padding-left":`${8+D()*12}px`}),P(de,H().name)}),be("click",V,()=>T(s,H(),!0)),h(I,L)};let o=xe(""),a=xe("tree"),s=xe(null);const i=E(()=>ep(e.result)),l=E(()=>r(o).trim()?r(i).filter(I=>I.key.startsWith(r(o).trim())):r(i)),u=E(()=>rp(r(l))),f=E(()=>np(r(i),r(o).trim()));function v(I){const H=fs(I);return H.length>60?H.slice(0,59)+"…":H}var x=bp(),p=d(x);{var w=I=>{var H=sp();h(I,H)},_=I=>{var H=xp(),D=ve(H),L=d(D),V=d(L),q=d(V);cf(q,{class:"size-3"}),Ee(),c(V);var U=g(V,2),ie=d(U);xr(ie,{class:"size-3"}),Ee(),c(U),c(L);var de=g(L,2),ae=d(de);un(ae,{class:"size-3 text-fg-3"});var $=g(ae,2);Dt($);var fe=g($,2);{var O=y=>{var S=lp(),z=d(S);Zt(z,{class:"size-3"}),c(S),be("click",S,()=>T(o,"")),h(y,S)};X(fe,y=>{r(o)&&y(O)})}c(de);var b=g(de,2),M=d(b,!0),m=g(M);{var N=y=>{var S=pt();j(z=>P(S,`of ${z??""}`),[()=>r(i).length.toLocaleString()]),h(y,S)};X(m,y=>{r(o)&&y(N)})}var C=g(m,2);{var R=y=>{var S=cp(),z=g(ve(S)),W=d(z,!0);c(z),j(()=>P(W,e.collection)),h(y,S)};X(C,y=>{e.collection&&y(R)})}c(b),c(D);var F=g(D,2);{var J=y=>{var S=vp(),z=d(S),W=d(z);{var oe=B=>{var K=dp();h(B,K)},Z=B=>{var K=Ve(),ne=ve(K);Je(ne,17,()=>r(u).children,re=>re.name,(re,te)=>{n(re,()=>r(te),()=>0)}),h(B,K)};X(W,B=>{r(u).children.length===0?B(oe):B(Z,-1)})}c(z);var Y=g(z,2),Q=d(Y);{var ee=B=>{var K=up(),ne=ve(K),re=d(ne,!0);c(ne);var te=g(ne,2),pe=d(te,!0);c(te),j(me=>{P(re,r(s).fullKey??r(s).name),P(pe,me)},[()=>fs(r(s).value)]),h(B,K)},se=B=>{var K=fp();h(B,K)};X(Q,B=>{r(s)?B(ee):B(se,-1)})}c(Y),c(S),h(y,S)},A=y=>{var S=hp(),z=d(S);{var W=Y=>{var Q=gp();h(Y,Q)},oe=E(()=>Object.keys(r(f)).length===0),Z=Y=>{var Q=pp(),ee=d(Q,!0);c(Q),j(se=>P(ee,se),[()=>JSON.stringify(r(f),null,2)]),h(Y,Q)};X(z,Y=>{r(oe)?Y(W):Y(Z,-1)})}c(S),h(y,S)};X(F,y=>{r(a)==="tree"?y(J):y(A,-1)})}j((y,S,z)=>{Oe(V,1,y),Se(V,"aria-pressed",r(a)==="tree"),Oe(U,1,S),Se(U,"aria-pressed",r(a)==="json"),P(M,z)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(a)==="tree"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(a)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(l).length.toLocaleString()]),be("click",V,()=>T(a,"tree")),be("click",U,()=>T(a,"json")),Kt($,()=>r(o),y=>T(o,y)),h(I,H)};X(p,I=>{r(i).length===0?I(w):I(_,-1)})}c(x),h(t,x),Ze()}Nt(["click"]);const _p={capability:"kv",renders:t=>tp(t),component:mp},ur="__all__",yp=["time","timestamp","ts","event_time","bucket","created_at"],wp=new Set(["created_at","updated_at","time","timestamp","timestamp_ns","rid","tenant"]),Rl=640,Dl=180,Vl=16;function Lr(t){if(typeof t=="number")return Number.isFinite(t);if(typeof t=="string"&&t.trim()!==""){const e=Number(t);return Number.isFinite(e)}return!1}function ka(t){return typeof t=="number"?t:Number(t)}function Io(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;if(t instanceof Date)return t.getTime();if(typeof t=="string"){const e=Number(t);if(Number.isFinite(e))return e;const n=Date.parse(t);return Number.isNaN(n)?null:n}return null}function Hl(t){var o,a;const e=((o=t.result)==null?void 0:o.columns)??[];for(const s of yp){const i=e.find(l=>l.toLowerCase()===s);if(i)return i}const n=((a=t.result)==null?void 0:a.records)??[];if(n.length===0)return null;for(const s of e){const i=n.find(l=>l.values[s]!==null&&l.values[s]!==void 0);if(i&&Io(i.values[s])!==null&&!Lr(i.values[s]))return s}return null}function ql(t,e){var s,i;const n=((s=t.result)==null?void 0:s.columns)??[],o=((i=t.result)==null?void 0:i.records)??[];if(o.length===0)return[];const a=[];for(const l of n){if(l===e||l.startsWith("red_")||wp.has(l.toLowerCase()))continue;const u=o.find(f=>f.values[l]!==null&&f.values[l]!==void 0);u&&Lr(u.values[l])&&a.push(l)}return a}function kp(t){const e=Hl(t);return e?ql(t,e).length>0:!1}function Sp(t,e){const n=Hl(t);if(!n)return null;const o=t.result.columns.find(u=>u.toLowerCase()==="metric")??null,a=t.result.columns.find(u=>u.toLowerCase()==="value")??null;if(o&&a){const u=new Set,f=[];for(const x of t.result.records){const p=x.values[o],w=x.values[a];if((typeof p=="string"||typeof p=="number")&&Lr(w)){u.add(String(p));const _=Io(x.values[n]);_!==null&&f.push({t:_,v:ka(w),raw:x.values})}}const v=[...u].sort();if(v.length>0){if(!e||e===ur)return f.sort((w,_)=>w.t-_.t),{timeColumn:n,metricColumn:a,metrics:[ur,...v],points:f,metricNameColumn:o};const x=v.includes(e)?e:v[0],p=[];for(const w of t.result.records){if(String(w.values[o])!==x)continue;const _=Io(w.values[n]);if(_===null)continue;const I=w.values[a];Lr(I)&&p.push({t:_,v:ka(I),raw:w.values})}return p.sort((w,_)=>w.t-_.t),{timeColumn:n,metricColumn:a,metrics:[ur,...v],points:p,metricNameColumn:o}}}const s=ql(t,n);if(s.length===0)return null;const i=e&&s.includes(e)?e:s[0],l=[];for(const u of t.result.records){const f=u.values[n],v=u.values[i],x=Io(f);x!==null&&Lr(v)&&l.push({t:x,v:ka(v),raw:u.values})}return l.sort((u,f)=>u.t-f.t),{timeColumn:n,metricColumn:i,metrics:s,points:l,metricNameColumn:null}}function Cp(t,e=Rl,n=Dl,o=Vl){const a=t.points;if(a.length===0)return null;const s=a[0].t,i=a[a.length-1].t;let l=1/0,u=-1/0;for(const _ of a)_.v<l&&(l=_.v),_.v>u&&(u=_.v);if(!Number.isFinite(l)||!Number.isFinite(u))return null;const f=i-s||1,v=u-l||1,x=e-o*2,p=n-o*2,w=[];return a.forEach((_,I)=>{const H=o+(_.t-s)/f*x,D=o+p-(_.v-l)/v*p;w.push(`${I===0?"M":"L"}${H.toFixed(2)},${D.toFixed(2)}`)}),{width:e,height:n,padding:o,path:w.join(" "),minT:s,maxT:i,minV:l,maxV:u}}function Np(t,e=6e4){if(t.points.length===0)return[];const n=t.points[0].t,o=t.points[t.points.length-1].t,a=Math.floor(n/e)*e,s=Math.floor(o/e)*e,i=new Map;for(let l=a;l<=s;l+=e)i.set(l,{t:l,count:0,sum:0});for(const l of t.points){const u=Math.floor(l.t/e)*e,f=i.get(u);f&&(f.count+=1,f.sum+=l.v)}return[...i.values()].sort((l,u)=>l.t-u.t)}function Ep(t,e=Rl,n=Dl,o=Vl){if(t.length===0)return null;const a=t.reduce((v,x)=>Math.max(v,x.count),0);if(a===0)return null;const s=e-o*2,i=n-o*2,l=s/t.length,u=Math.max(1,l-1),f=t.map((v,x)=>{const w=v.count/a*i;return{x:o+x*l,y:o+i-w,w:u,h:w,bucket:v}});return{width:e,height:n,padding:o,bars:f,maxCount:a}}var Mp=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No timeseries shape (need a time column and a numeric metric).</div>'),zp=k("<option> </option>"),Tp=k('<label class="inline-flex items-center gap-1.5 text-fg-3">bucket: <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1.5 py-0.5"><option>1s</option><option>10s</option><option>1min</option><option>5min</option><option>10min</option><option>1hr</option></select></label>'),Pp=k('<button type="button" class="inline-flex items-center gap-1 px-2 py-1 rounded border border-line-1 text-fg-3 hover:text-fg-1 cursor-pointer" title="Show all rows again"><!> clear bucket</button>'),Ip=k('· <span class="text-fg-2"> </span>',1),Ap=Vt('<rect class="cursor-pointer transition-opacity" fill="var(--color-accent)" role="button" tabindex="0"><title> </title></rect>'),Lp=Vt('<svg class="block w-full h-[180px]" aria-label="Writes per bucket"><!><text class="text-[9px] fill-fg-3 font-mono"> </text><text text-anchor="end" class="text-[9px] fill-fg-3 font-mono"> </text></svg>'),Op=Vt('<svg class="block w-full h-[180px] text-accent" aria-label="Timeseries chart"><path fill="none" stroke="currentColor" stroke-width="1.5"></path></svg>'),Rp=k('<th class="px-2 py-1.5 text-left font-normal">metric</th>'),Dp=k('<td class="px-2 py-1 text-fg-2"> </td>'),Vp=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1"> </td><!><td class="px-2 py-1 text-right text-accent"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),Hp=k('<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"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> </button> <button type="button"><!> Value</button></div> <label class="inline-flex items-center gap-1.5 text-fg-3"><!> metric: <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1.5 py-0.5"></select></label> <!> <!> <div class="ml-auto text-fg-3"><span class="text-fg-2"> </span> <!> inserts <!></div></div> <div class="px-3 pt-2"><!></div> <div class="flex-1 min-h-0 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">time</th><!><th class="px-2 py-1.5 text-right font-normal">value</th><th class="px-2 py-1.5 text-left font-normal">log</th></tr></thead><tbody></tbody></table></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3"> <!></div>',1),qp=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function Fp(t,e){$e(e,!0);let n=xe(kt(ur)),o=xe("rate"),a=xe(6e4),s=xe(null);const i=E(()=>Sp(e.result,r(n))),l=E(()=>r(i)&&r(o)==="line"?Cp(r(i)):null),u=E(()=>r(i)?Np(r(i),r(a)):[]),f=E(()=>r(i)&&r(o)==="rate"?Ep(r(u)):null),v=E(()=>{if(!r(i))return[];if(!r(s))return r(i).points;const U=r(s).t,ie=U+r(a);return r(i).points.filter(de=>de.t>=U&&de.t<ie)});function x(U){try{return new Date(U).toISOString().replace("T"," ").slice(0,19)}catch{return String(U)}}function p(U){return U==null?"":typeof U=="object"?JSON.stringify(U):String(U)}function w(U){var fe;const ie=[],de=(fe=r(i))!=null&&fe.metricNameColumn?U.raw[r(i).metricNameColumn]:void 0;de!==void 0&&ie.push(String(de));const ae=U.raw.tags;if(ae&&typeof ae=="object"){const O=Object.entries(ae).map(([b,M])=>`${b}=${p(M)}`).join(" ");O&&ie.push(O)}const $=U.raw.event??U.raw.action??U.raw.message??U.raw.payload;return $!==void 0&&ie.push(p($)),ie.join(" · ")}function _(U){return U===1e3?"1s":U===1e4?"10s":U===6e4?"1min":U===3e5?"5min":U===6e5?"10min":U===36e5?"1hr":`${U}ms`}function I(U){return U===ur?"all writes":U}function H(){return r(i)?!r(n)||r(n)===ur?"all writes":r(n):""}var D=qp(),L=d(D);{var V=U=>{var ie=Mp();h(U,ie)},q=U=>{var ie=Hp(),de=ve(ie),ae=d(de),$=d(ae),fe=d($);Uu(fe,{class:"size-3"});var O=g(fe);c($);var b=g($,2),M=d(b);Wu(M,{class:"size-3"}),Ee(),c(b),c(ae);var m=g(ae,2),N=d(m);Dr(N,{class:"size-3"});var C=g(N,2);Je(C,20,()=>r(i).metrics,ue=>ue,(ue,le)=>{var we=zp(),Me=d(we,!0);c(we);var Ne={};j(Te=>{P(Me,Te),Ne!==(Ne=le)&&(we.value=(we.__value=le)??"")},[()=>I(le)]),h(ue,we)}),c(C),c(m);var R=g(m,2);{var F=ue=>{var le=Tp(),we=g(d(le)),Me=d(we);Me.value=Me.__value=1e3;var Ne=g(Me);Ne.value=Ne.__value=1e4;var Te=g(Ne);Te.value=Te.__value=6e4;var ye=g(Te);ye.value=ye.__value=3e5;var ze=g(ye);ze.value=ze.__value=6e5;var Ae=g(ze);Ae.value=Ae.__value=36e5,c(we);var Ke;xi(we),c(le),j(()=>{Ke!==(Ke=r(a))&&(we.value=(we.__value=r(a))??"",bi(we,r(a)))}),be("change",we,at=>{T(a,Number(at.currentTarget.value),!0),T(s,null)}),h(ue,le)};X(R,ue=>{r(o)==="rate"&&ue(F)})}var J=g(R,2);{var A=ue=>{var le=Pp(),we=d(le);Zt(we,{class:"size-3"}),Ee(),c(le),be("click",le,()=>T(s,null)),h(ue,le)};X(J,ue=>{r(s)&&ue(A)})}var y=g(J,2),S=d(y),z=d(S,!0);c(S);var W=g(S),oe=g(W);{var Z=ue=>{var le=pt();j(we=>P(le,`of ${we??""}`),[()=>r(i).points.length.toLocaleString()]),h(ue,le)};X(oe,ue=>{r(s)&&ue(Z)})}var Y=g(oe,2);{var Q=ue=>{var le=Ip(),we=g(ve(le)),Me=d(we,!0);c(we),j(()=>P(Me,e.collection)),h(ue,le)};X(Y,ue=>{e.collection&&ue(Q)})}c(y),c(de);var ee=g(de,2),se=d(ee);{var B=ue=>{var le=Lp(),we=d(le);Je(we,17,()=>r(f).bars,ze=>ze.bucket.t,(ze,Ae)=>{var Ke=Ap(),at=d(Ke),Be=d(at);c(at),c(Ke),j((Qe,dt,vt)=>{Se(Ke,"x",r(Ae).x),Se(Ke,"y",r(Ae).y),Se(Ke,"width",r(Ae).w),Se(Ke,"height",r(Ae).h),Se(Ke,"opacity",!r(s)||r(s).t===r(Ae).bucket.t?.9:.3),Se(Ke,"aria-label",`Bucket starting at ${Qe??""} with ${r(Ae).bucket.count??""} writes`),P(Be,`${dt??""} — ${r(Ae).bucket.count??""} writes (sum ${vt??""})`)},[()=>x(r(Ae).bucket.t),()=>x(r(Ae).bucket.t),()=>r(Ae).bucket.sum.toFixed(2)]),be("click",Ke,()=>{var Qe;return T(s,((Qe=r(s))==null?void 0:Qe.t)===r(Ae).bucket.t?null:r(Ae).bucket,!0)}),be("keydown",Ke,Qe=>{var dt;(Qe.key==="Enter"||Qe.key===" ")&&(Qe.preventDefault(),T(s,((dt=r(s))==null?void 0:dt.t)===r(Ae).bucket.t?null:r(Ae).bucket,!0))}),h(ze,Ke)});var Me=g(we),Ne=d(Me,!0);c(Me);var Te=g(Me),ye=d(Te);c(Te),c(le),j((ze,Ae)=>{Se(le,"viewBox",`0 0 ${r(f).width} ${r(f).height}`),Se(Me,"x",r(f).padding),Se(Me,"y",r(f).height-2),P(Ne,ze),Se(Te,"x",r(f).width-r(f).padding),Se(Te,"y",r(f).height-2),P(ye,`peak ${r(f).maxCount??""}/${Ae??""}`)},[()=>{var ze;return x(((ze=r(f).bars[0])==null?void 0:ze.bucket.t)??0)},()=>_(r(a))]),h(ue,le)},K=ue=>{var le=Op(),we=d(le);c(le),j(()=>{Se(le,"viewBox",`0 0 ${r(l).width} ${r(l).height}`),Se(we,"d",r(l).path)}),h(ue,le)};X(se,ue=>{r(o)==="rate"&&r(f)?ue(B):r(l)&&ue(K,1)})}c(ee);var ne=g(ee,2),re=d(ne),te=d(re),pe=d(te),me=g(d(pe));{var _e=ue=>{var le=Rp();h(ue,le)};X(me,ue=>{r(i).metricNameColumn&&ue(_e)})}Ee(2),c(pe),c(te);var ke=g(te);Je(ke,21,()=>r(v),Ft,(ue,le)=>{var we=Vp(),Me=d(we),Ne=d(Me,!0);c(Me);var Te=g(Me);{var ye=Be=>{var Qe=Dp(),dt=d(Qe,!0);c(Qe),j(vt=>P(dt,vt),[()=>String(r(le).raw[r(i).metricNameColumn]??"")]),h(Be,Qe)};X(Te,Be=>{r(i).metricNameColumn&&Be(ye)})}var ze=g(Te),Ae=d(ze,!0);c(ze);var Ke=g(ze),at=d(Ke,!0);c(Ke),c(we),j((Be,Qe)=>{P(Ne,Be),P(Ae,r(le).v),P(at,Qe)},[()=>x(r(le).t),()=>w(r(le))]),h(ue,we)}),c(ke),c(re),c(ne);var he=g(ne,2),ge=d(he),Ce=g(ge);{var Pe=ue=>{var le=pt();j((we,Me)=>P(le,`· bucket ${we??""} (+${Me??""})`),[()=>x(r(s).t),()=>_(r(a))]),h(ue,le)};X(Ce,ue=>{r(s)&&ue(Pe)})}c(he),j((ue,le,we,Me,Ne)=>{Oe($,1,ue),Se($,"aria-pressed",r(o)==="rate"),P(O,` Writes/${le??""}`),Oe(b,1,we),Se(b,"aria-pressed",r(o)==="line"),P(z,Me),P(W,` · ${Ne??""}`),P(ge,`${r(v).length??""} inserts${e.collection?" · ":""}${e.collection??""??""} `)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(o)==="rate"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>_(r(a)),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(o)==="line"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>H(),()=>r(v).length.toLocaleString()]),be("click",$,()=>T(o,"rate")),be("click",b,()=>T(o,"line")),Ba(C,()=>r(n),ue=>T(n,ue)),h(U,ie)};X(L,U=>{r(i)?U(q,-1):U(V)})}c(D),h(t,D),Ze()}Nt(["click","change","keydown"]);const Kp={capability:"hypertable",renders:t=>kp(t),component:Fp};function Bp(t){return{query:t.query,capability:t.capability,record_count:t.record_count,records:t.result.records}}function jp(t){return JSON.stringify(t,null,2)}function Up(t){let e="",n=0;const o=t.length;for(;n<o;){const a=t[n];if(a==='"'){let s=n+1;for(;s<o;){if(t[s]==="\\"){s+=2;continue}if(t[s]==='"')break;s+=1}const i=t.slice(n,s+1);let l=s+1;for(;l<o&&(t[l]===" "||t[l]===" ");)l+=1;const u=t[l]===":";e+=`<span class="${u?"k":"s"}">${Sa(i)}</span>`,n=s+1;continue}if(a>="0"&&a<="9"||a==="-"&&t[n+1]>="0"&&t[n+1]<="9"){let s=n+1;for(;s<o&&/[0-9eE+\-.]/.test(t[s]);)s+=1;e+=`<span class="n">${Sa(t.slice(n,s))}</span>`,n=s;continue}if(t.startsWith("true",n)||t.startsWith("false",n)){const s=t[n]==="t"?4:5;e+=`<span class="b">${t.slice(n,n+s)}</span>`,n+=s;continue}if(t.startsWith("null",n)){e+='<span class="z">null</span>',n+=4;continue}e+=Sa(a),n+=1}return e}function Sa(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var Wp=k('<div class="flex h-full flex-col text-fg-1"><div class="flex-1 min-h-0 overflow-auto"><pre class="json text-[12px] font-mono p-3 leading-relaxed svelte-1h2o46f"></pre></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3"> </div></div>');function Yp(t,e){$e(e,!0);const n=E(()=>jp(Bp(e.result))),o=E(()=>Up(r(n)));var a=Wp(),s=d(a),i=d(s);Qd(i,()=>r(o),!0),c(i),c(s);var l=g(s,2),u=d(l);c(l),c(a),j(()=>P(u,`${e.result.record_count??""} records · raw shape${e.collection?" · ":""}${e.collection??""??""}`)),h(t,a),Ze()}const Xp={capability:"json",renders:()=>!1,component:Yp},Gp=/(^|_)(vector|embedding|embeddings|turbovec)($|_)/i,$p=/(^|_)(scalar|score|distance|similarity|magnitude|norm)($|_)/i,Zp=new Set(["rid","entity_id","red_entity_id","red_entity_type","red_kind","red_collection","red_sequence_id","collection","kind","tenant","created_at","updated_at","dimension"]);function $a(t){return Array.isArray(t)&&t.length>0&&t.every(e=>typeof e=="number"&&Number.isFinite(e))}function Qp(t){const e=Object.entries(t).find(([o,a])=>Gp.test(o)&&$a(a));if(e)return e;const n=Object.entries(t).find(([,o])=>$a(o));return n||null}function Jp(t,e){const n=Object.entries(t).find(([o,a])=>o!==e&&$p.test(o)&&typeof a=="number"&&Number.isFinite(a));return n||null}function vs(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?Math.floor(t):null}function Za(t){return t.result.records.map((e,n)=>{var f;const o=e.values??{},a=((f=e.vector_results)==null?void 0:f.find(v=>$a(v.vector)))??null,s=a!=null&&a.vector?["vector_results.vector",a.vector]:Qp(o),i=Jp(o,(s==null?void 0:s[0])??null),l=(s==null?void 0:s[1].length)??vs(o.dimension)??vs(o.vector_dimension)??0,u={};for(const[v,x]of Object.entries(o))v===(s==null?void 0:s[0])||v===(i==null?void 0:i[0])||Zp.has(v)||(u[v]=x);return{index:n,id:String(o.id??o.entity_id??o.red_entity_id??o.rid??n+1),vectorColumn:(s==null?void 0:s[0])??null,vector:(s==null?void 0:s[1])??[],dimension:l,scalarColumn:(i==null?void 0:i[0])??null,scalar:(i==null?void 0:i[1])??null,metadata:u}})}function eh(t){return t.capability==="vector"||t.result.records.some(e=>{var n;return(((n=e.vector_results)==null?void 0:n.length)??0)>0})?!0:Za(t).some(e=>e.vector.length>0||e.dimension>0||e.scalar!==null)}function xo(t){return Math.sqrt(t.reduce((e,n)=>e+n*n,0))}function Ca(t){return t.scalarColumn?/distance/i.test(t.scalarColumn)?`search distance · ${t.scalarColumn}`:/similarity/i.test(t.scalarColumn)?`similarity score · ${t.scalarColumn}`:/score/i.test(t.scalarColumn)?`score · ${t.scalarColumn}`:/turbovec|scalar/i.test(t.scalarColumn)?`scalar projection · ${t.scalarColumn}`:/magnitude|norm/i.test(t.scalarColumn)?`vector magnitude · ${t.scalarColumn}`:`ranking metric · ${t.scalarColumn}`:"ranking metric"}function Na(t){return t==null?"NULL":typeof t=="object"?JSON.stringify(t):String(t)}function th(t){return/^VECTOR\s+SEARCH\s+\S+\s+SIMILAR\s+TO\s+\[1(?:\.0)?,\s*0(?:\.0)?/i.test(t.query.trim())}function nh(t){return/^VECTOR\s+SEARCH\s+/i.test(t.query.trim())}function rh(t){const e=t.replace(/[\[\]]/g," ").split(/[,\s]+/).map(o=>o.trim()).filter(Boolean).map(Number);if(e.length===0)throw new Error("Paste a numeric vector first.");if(e.find(o=>!Number.isFinite(o))!==void 0)throw new Error("Vector contains a non-numeric value.");return e}function oh(t){return`[${t.map(e=>Number(e.toPrecision(8))).join(", ")}]`}function ah(t){return`'${t.replace(/'/g,"''")}'`}function ih(t){return t.replace(/[^A-Za-z0-9_./-]/g,"")}function gs(t,e,n){const o=Math.max(1,Math.min(200,Math.floor(Number(n)||20))),a=e.kind==="text"?ah(e.text):oh(e.vector);return`VECTOR SEARCH ${ih(t)} SIMILAR TO ${a} INCLUDE VECTORS LIMIT ${o}`}var sh=k('<input type="text" placeholder="text query…" class="h-7 w-full rounded border border-line-1 bg-bg-0 px-2 text-fg-1 outline-none placeholder:text-fg-3 focus:border-line-3"/>'),lh=k('<input type="text" placeholder="[0.12, -0.04, 0.91, …]" class="h-7 w-full rounded border border-line-1 bg-bg-0 px-2 text-fg-1 outline-none placeholder:text-fg-3 focus:border-line-3"/>'),ch=k('<div class="inline-flex shrink-0 overflow-hidden rounded border border-line-2"><button type="button">text</button> <button type="button">vector</button></div> <div class="min-w-[260px] flex-1"><!></div> <label class="inline-flex h-7 items-center gap-1 rounded border border-line-1 bg-bg-0 px-2 text-fg-3"><span>limit</span> <input type="number" min="1" max="200" class="w-12 bg-transparent text-right text-fg-1 outline-none"/></label> <button type="button"><!> search</button>',1),dh=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector row filter"><!></button>'),uh=k('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="filter rows…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div>'),fh=k("<span> </span>"),vh=k('<div class="mt-1.5 text-warn"> </div>'),gh=k('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-1.5 text-[11px] font-mono text-fg-3">Preview search: distances and scores are computed against the synthetic basis vector <span class="text-fg-1">[1, 0, 0, …]</span>.</div>'),ph=k('<div class="flex-1 grid place-items-center p-6 text-center font-mono text-[12px] text-fg-3"><div><!> <div class="text-fg-1"> </div> <div class="mt-1">Text queries are embedded by RedDB.</div></div></div>'),hh=k('<div class="flex-1 grid place-items-center p-6 text-center font-mono text-[12px] text-fg-3"><div><!> <div class="text-fg-1">No vector rows returned.</div></div></div>'),xh=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector result filter"><!></button>'),bh=k('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="filter results…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div>'),mh=k('<span class="ml-auto text-fg-1"> </span>'),_h=k('<div class="mt-0.5 truncate text-fg-3"> </div>'),yh=k('<button type="button"><div class="flex items-baseline gap-2"><span class="text-accent"> </span> <span class="text-fg-3"> </span> <!></div> <!></button>'),wh=k('<div class="text-fg-3">No vector selected.</div>'),kh=k('<div class="text-fg-3">vector column</div> <div class="text-fg-0"> </div>',1),Sh=k('<div class="text-fg-3">ranking metric</div> <div class="text-fg-0"> </div>',1),Ch=k('<div class="text-fg-3 truncate"> </div> <div class="text-fg-1 break-words"> </div>',1),Nh=k('<div class="grid grid-cols-[160px_1fr] gap-x-3 gap-y-1.5"><div class="text-fg-3">id</div> <div class="text-fg-0"> </div> <div class="text-fg-3">dimension</div> <div class="text-fg-0"> </div> <div class="text-fg-3">magnitude</div> <div class="text-fg-0"> </div> <div class="text-fg-3">coordinates</div> <div class="text-fg-0"> </div> <!> <!> <!></div>'),Eh=k('<div class="border border-line-1 bg-bg-1/40 px-3 py-2 text-fg-3"> </div>'),Mh=k('<div class="grid grid-cols-[52px_1fr_90px] items-center gap-2"><span class="text-fg-3 text-right"></span> <div class="h-2 bg-bg-2 rounded overflow-hidden"><div class="h-full bg-accent/80"></div></div> <span> </span></div>'),zh=k('<div class="mt-2 text-fg-3">Showing first 256 dimensions.</div>'),Th=k('<div class="mb-2 flex items-center justify-between text-fg-3"><span> </span> <span> </span></div> <div class="grid gap-1"></div> <!>',1),Ph=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer"><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1 text-right"> </td><td class="px-2 py-1 text-right"> </td></tr>'),Ih=k('<table class="w-full border-collapse"><thead class="sticky top-0 bg-bg-0"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">id</th><th class="px-2 py-1.5 text-right font-normal">ranking metric</th><th class="px-2 py-1.5 text-right font-normal">magnitude</th></tr></thead><tbody></tbody></table>'),Ah=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-0"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> metadata</button> <button type="button"><!> vector</button> <button type="button"><!> scores</button></div> <!> <div class="ml-auto text-fg-3"> <!> </div></div> <div class="flex-1 min-h-0 grid grid-cols-[320px_1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>',1),Lh=k('<div class="flex h-full flex-col text-fg-1"><div class="border-b border-line-1 bg-bg-1/40 px-3 py-2 font-mono text-[11px]"><div class="flex flex-wrap items-center gap-2"><div class="inline-flex shrink-0 overflow-hidden rounded border border-line-2"><button type="button"><!> browse</button> <button type="button"><!> search</button></div> <!> <div class="ml-auto flex items-center gap-2 text-fg-3"><span> </span> <!></div></div> <!></div> <!> <!></div>');function Oh(t,e){$e(e,!0);let n=xe("browse"),o=xe("metadata"),a=xe("text"),s=xe(""),i=xe(""),l=xe(20),u=xe(""),f=xe(null),v=xe(null),x=xe(!1),p=xe(null);const w=E(()=>Za(e.result)),_=E(()=>{var re;return((re=r(w).find(te=>te.dimension>0))==null?void 0:re.dimension)??null}),I=E(()=>r(v)??(nh(e.result)?e.result:null)),H=E(()=>r(I)?Za(r(I)):[]),D=E(()=>r(n)==="search"?r(H):r(w)),L=E(()=>r(I)?th(r(I)):!1),V=E(()=>{const re=r(u).trim().toLowerCase();return re?r(D).filter(te=>te.id.toLowerCase().includes(re)||Object.values(te.metadata).some(pe=>Na(pe).toLowerCase().includes(re))):r(D)}),q=E(()=>r(f)??r(V)[0]??null),U=E(()=>Math.max(1,...r(V).map(re=>xo(re.vector)))),ie=E(()=>r(I)!==null);function de(re){const te=Object.entries(re.metadata).slice(0,3);return te.length===0?"":te.map(([pe,me])=>`${pe}=${Na(me)}`).join(" · ")}function ae(re,te){const pe=Math.max(1,...te.map(me=>Math.abs(me)));return Math.max(2,Math.abs(re)/pe*100)}async function $(){if(!e.client||!e.collection){T(p,"No active RedDB connection for vector search.");return}T(p,null),T(x,!0);try{const re=r(s).trim();if(r(a)==="text"&&re.length===0)throw new Error("Enter text for RedDB to embed.");const te=r(a)==="text"?gs(e.collection,{kind:"text",text:re},r(l)):gs(e.collection,{kind:"vector",vector:rh(r(i))},r(l)),pe=await e.client.query(te);T(v,pe,!0),T(f,null),T(n,"search"),T(o,"metadata")}catch(re){T(p,re.message,!0)}finally{T(x,!1)}}var fe=Lh(),O=d(fe),b=d(O),M=d(b),m=d(M),N=d(m);Xa(N,{class:"size-3"}),Ee(),c(m);var C=g(m,2),R=d(C);un(R,{class:"size-3"}),Ee(),c(C),c(M);var F=g(M,2);{var J=re=>{var te=ch(),pe=ve(te),me=d(pe),_e=g(me,2);c(pe);var ke=g(pe,2),he=d(ke);{var ge=Te=>{var ye=sh();Dt(ye),be("keydown",ye,ze=>{ze.key==="Enter"&&$()}),Kt(ye,()=>r(s),ze=>T(s,ze)),h(Te,ye)},Ce=Te=>{var ye=lh();Dt(ye),be("keydown",ye,ze=>{ze.key==="Enter"&&$()}),Kt(ye,()=>r(i),ze=>T(i,ze)),h(Te,ye)};X(he,Te=>{r(a)==="text"?Te(ge):Te(Ce,-1)})}c(ke);var Pe=g(ke,2),ue=g(d(Pe),2);Dt(ue),c(Pe);var le=g(Pe,2),we=d(le);{var Me=Te=>{mn(Te,{class:"size-3 animate-spin"})},Ne=Te=>{oa(Te,{class:"size-3"})};X(we,Te=>{r(x)?Te(Me):Te(Ne,-1)})}Ee(),c(le),j((Te,ye,ze)=>{Oe(me,1,Te),Se(me,"aria-pressed",r(a)==="text"),Oe(_e,1,ye),Se(_e,"aria-pressed",r(a)==="vector"),Oe(le,1,ze),le.disabled=r(x)},[()=>We(["inline-flex h-7 items-center gap-1 px-2 transition-colors",r(a)==="text"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",r(a)==="vector"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 rounded border px-2 transition-colors",r(x)?"border-line-1 bg-bg-2 text-fg-3":"border-accent/40 bg-accent text-white hover:bg-accent/90"].join(" "))]),be("click",me,()=>T(a,"text")),be("click",_e,()=>T(a,"vector")),Kt(ue,()=>r(l),Te=>T(l,Te)),be("click",le,()=>void $()),h(re,te)},A=re=>{var te=uh(),pe=d(te);un(pe,{class:"size-3 text-fg-3"});var me=g(pe,2);Dt(me);var _e=g(me,2);{var ke=he=>{var ge=dh(),Ce=d(ge);Zt(Ce,{class:"size-3"}),c(ge),be("click",ge,()=>T(u,"")),h(he,ge)};X(_e,he=>{r(u)&&he(ke)})}c(te),Kt(me,()=>r(u),he=>T(u,he)),h(re,te)};X(F,re=>{r(n)==="search"?re(J):re(A,-1)})}var y=g(F,2),S=d(y),z=d(S,!0);c(S);var W=g(S,2);{var oe=re=>{var te=fh(),pe=d(te,!0);c(te),j(()=>P(pe,e.collection)),h(re,te)};X(W,re=>{e.collection&&re(oe)})}c(y),c(b);var Z=g(b,2);{var Y=re=>{var te=vh(),pe=d(te,!0);c(te),j(()=>P(pe,r(p))),h(re,te)};X(Z,re=>{r(p)&&re(Y)})}c(O);var Q=g(O,2);{var ee=re=>{var te=gh();h(re,te)};X(Q,re=>{r(n)==="search"&&r(L)&&re(ee)})}var se=g(Q,2);{var B=re=>{var te=ph(),pe=d(te),me=d(pe);un(me,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4});var _e=g(me,2),ke=d(_e,!0);c(_e),Ee(2),c(pe),c(te),j(()=>P(ke,r(ie)?"No search results.":"No vector search has been run.")),h(re,te)},K=re=>{var te=hh(),pe=d(te),me=d(pe);Xa(me,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4}),Ee(2),c(pe),c(te),h(re,te)},ne=re=>{var te=Ah(),pe=ve(te),me=d(pe),_e=d(me),ke=d(_e);xr(ke,{class:"size-3"}),Ee(),c(_e);var he=g(_e,2),ge=d(he);lf(ge,{class:"size-3"}),Ee(),c(he);var Ce=g(he,2),Pe=d(Ce);Sl(Pe,{class:"size-3"}),Ee(),c(Ce),c(me);var ue=g(me,2);{var le=Ge=>{var Re=bh(),Ie=d(Re);un(Ie,{class:"size-3 text-fg-3"});var Fe=g(Ie,2);Dt(Fe);var G=g(Fe,2);{var De=Le=>{var je=xh(),Ye=d(je);Zt(Ye,{class:"size-3"}),c(je),be("click",je,()=>T(u,"")),h(Le,je)};X(G,Le=>{r(u)&&Le(De)})}c(Re),Kt(Fe,()=>r(u),Le=>T(u,Le)),h(Ge,Re)};X(ue,Ge=>{r(n)==="search"&&Ge(le)})}var we=g(ue,2),Me=d(we,!0),Ne=g(Me);{var Te=Ge=>{var Re=pt();j(Ie=>P(Re,`of ${Ie??""}`),[()=>r(D).length.toLocaleString()]),h(Ge,Re)};X(Ne,Ge=>{r(u)&&Ge(Te)})}var ye=g(Ne);c(we),c(pe);var ze=g(pe,2),Ae=d(ze);Je(Ae,21,()=>r(V),Ge=>Ge.id,(Ge,Re)=>{var Ie=yh(),Fe=d(Ie),G=d(Fe),De=d(G,!0);c(G);var Le=g(G,2),je=d(Le);c(Le);var Ye=g(Le,2);{var lt=Xe=>{var tt=mh(),st=d(tt,!0);c(tt),j((ut,ht)=>{Se(tt,"title",ut),P(st,ht)},[()=>Ca(r(Re)),()=>r(Re).scalar.toFixed(4)]),h(Xe,tt)};X(Ye,Xe=>{r(n)==="search"&&r(Re).scalar!==null&&Xe(lt)})}c(Fe);var ct=g(Fe,2);{var gt=Xe=>{var tt=_h(),st=d(tt,!0);c(tt),j(ut=>P(st,ut),[()=>de(r(Re))]),h(Xe,tt)},it=E(()=>de(r(Re)));X(ct,Xe=>{r(it)&&Xe(gt)})}c(Ie),j(Xe=>{Oe(Ie,1,Xe),P(De,r(Re).id),P(je,`${r(Re).dimension??""}d`)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(q)===r(Re)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),be("click",Ie,()=>T(f,r(Re),!0)),h(Ge,Ie)}),c(Ae);var Ke=g(Ae,2),at=d(Ke);{var Be=Ge=>{var Re=wh();h(Ge,Re)},Qe=Ge=>{var Re=Nh(),Ie=g(d(Re),2),Fe=d(Ie,!0);c(Ie);var G=g(Ie,4),De=d(G,!0);c(G);var Le=g(G,4),je=d(Le,!0);c(Le);var Ye=g(Le,4),lt=d(Ye,!0);c(Ye);var ct=g(Ye,2);{var gt=st=>{var ut=kh(),ht=g(ve(ut),2),xt=d(ht,!0);c(ht),j(()=>P(xt,r(q).vectorColumn)),h(st,ut)};X(ct,st=>{r(q).vectorColumn&&st(gt)})}var it=g(ct,2);{var Xe=st=>{var ut=Sh(),ht=g(ve(ut),2),xt=d(ht,!0);c(ht),j(Tt=>P(xt,Tt),[()=>Ca(r(q))]),h(st,ut)};X(it,st=>{r(n)==="search"&&r(q).scalarColumn&&st(Xe)})}var tt=g(it,2);Je(tt,17,()=>Object.entries(r(q).metadata),Ft,(st,ut)=>{var ht=E(()=>on(r(ut),2));let xt=()=>r(ht)[0],Tt=()=>r(ht)[1];var bt=Ch(),mt=ve(bt),Et=d(mt,!0);c(mt);var Pt=g(mt,2),Rt=d(Pt,!0);c(Pt),j(Ht=>{P(Et,xt()),P(Rt,Ht)},[()=>Na(Tt())]),h(st,bt)}),c(Re),j(st=>{P(Fe,r(q).id),P(De,r(q).dimension),P(je,st),P(lt,r(q).vector.length>0?"returned":"not returned")},[()=>r(q).vector.length>0?xo(r(q).vector).toFixed(6):"n/a"]),h(Ge,Re)},dt=Ge=>{var Re=Ve(),Ie=ve(Re);{var Fe=De=>{var Le=Eh(),je=d(Le);c(Le),j(()=>P(je,`This result reports a ${r(q).dimension??""}d vector, but the coordinate array was not returned by RedDB.`)),h(De,Le)},G=De=>{var Le=Th(),je=ve(Le),Ye=d(je),lt=d(Ye);c(Ye);var ct=g(Ye,2),gt=d(ct);c(ct),c(je);var it=g(je,2);Je(it,21,()=>r(q).vector.slice(0,256),Ft,(st,ut,ht)=>{var xt=Mh(),Tt=d(xt);Tt.textContent=ht;var bt=g(Tt,2),mt=d(bt);let Et;c(bt);var Pt=g(bt,2),Rt=d(Pt,!0);c(Pt),c(xt),j((Ht,Bt)=>{Et=$t(mt,"",Et,Ht),Oe(Pt,1,We(r(ut)<0?"text-warn text-right":"text-fg-1 text-right")),P(Rt,Bt)},[()=>({width:`${ae(r(ut),r(q).vector)}%`}),()=>r(ut).toFixed(5)]),h(st,xt)}),c(it);var Xe=g(it,2);{var tt=st=>{var ut=zh();h(st,ut)};X(Xe,st=>{r(q).vector.length>256&&st(tt)})}j((st,ut)=>{P(lt,`${r(q).vector.length??""} dimensions`),P(gt,`|v| ${st??""} / max visible ${ut??""}`)},[()=>xo(r(q).vector).toFixed(6),()=>r(U).toFixed(2)]),h(De,Le)};X(Ie,De=>{r(q).vector.length===0?De(Fe):De(G,-1)})}h(Ge,Re)},vt=Ge=>{var Re=Ih(),Ie=g(d(Re));Je(Ie,21,()=>r(V),Fe=>Fe.id,(Fe,G)=>{var De=Ph(),Le=d(De),je=d(Le,!0);c(Le);var Ye=g(Le),lt=d(Ye,!0);c(Ye);var ct=g(Ye),gt=d(ct,!0);c(ct),c(De),j((it,Xe,tt)=>{P(je,r(G).id),Se(Ye,"title",it),P(lt,Xe),P(gt,tt)},[()=>Ca(r(G)),()=>r(G).scalar===null?"n/a":r(G).scalar.toFixed(6),()=>xo(r(G).vector).toFixed(6)]),be("click",De,()=>T(f,r(G),!0)),h(Fe,De)}),c(Ie),c(Re),h(Ge,Re)};X(at,Ge=>{r(q)?r(o)==="metadata"?Ge(Qe,1):r(o)==="vector"?Ge(dt,2):Ge(vt,-1):Ge(Be)})}c(Ke),c(ze),j((Ge,Re,Ie,Fe)=>{Oe(_e,1,Ge),Se(_e,"aria-pressed",r(o)==="metadata"),Oe(he,1,Re),Se(he,"aria-pressed",r(o)==="vector"),Oe(Ce,1,Ie),Se(Ce,"aria-pressed",r(o)==="scalar"),P(Me,Fe),P(ye,` ${r(n)==="search"?" results":" rows"}`)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(o)==="metadata"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(o)==="vector"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(o)==="scalar"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(V).length.toLocaleString()]),be("click",_e,()=>T(o,"metadata")),be("click",he,()=>T(o,"vector")),be("click",Ce,()=>T(o,"scalar")),h(re,te)};X(se,re=>{r(n)==="search"&&r(H).length===0?re(B):r(D).length===0?re(K,1):re(ne,-1)})}c(fe),j((re,te)=>{Oe(m,1,re),Se(m,"aria-pressed",r(n)==="browse"),Oe(C,1,te),Se(C,"aria-pressed",r(n)==="search"),P(z,r(_)?`${r(_)}d`:"dimension n/a")},[()=>We(["inline-flex h-7 items-center gap-1 px-2 transition-colors",r(n)==="browse"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",r(n)==="search"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),be("click",m,()=>{T(n,"browse"),T(f,null)}),be("click",C,()=>{T(n,"search"),T(f,null)}),h(t,fe),Ze()}Nt(["click","keydown"]);const Rh={capability:"vector",renders:t=>eh(t),component:Oh},Qa=["message","payload","body","value","data"],Fl=["state","status","delivery_state"],Kl=["consumer","consumer_id","worker","lease_owner"],Bl=["dlc","dlq","dead_letter_collection","dead_letter_queue"];function bo(t,e){for(const o of e)if(o in t)return[o,t[o]];return Object.entries(t).find(([o])=>e.includes(o.toLowerCase()))??null}function Dh(t){return t.result.records.map((e,n)=>{const o=e.values??{},a=bo(o,Qa),s=bo(o,Fl),i=bo(o,Kl),l=bo(o,Bl);return{index:n,id:String(o.message_id??o.id??o.rid??n+1),messageColumn:(a==null?void 0:a[0])??null,message:(a==null?void 0:a[1])??o,state:String((s==null?void 0:s[1])??"ready"),consumer:(i==null?void 0:i[1])===void 0||(i==null?void 0:i[1])===null?null:String(i[1]),dlc:(l==null?void 0:l[1])===void 0||(l==null?void 0:l[1])===null?null:String(l[1]),values:o}})}function Vh(t){return t.capability==="queue"?!0:t.result.records.some(e=>{const n=Object.keys(e.values??{}).map(o=>o.toLowerCase());return n.includes("message_id")&&Qa.some(o=>n.includes(o))?!0:Qa.some(o=>n.includes(o))&&(Fl.some(o=>n.includes(o))||Kl.some(o=>n.includes(o))||Bl.some(o=>n.includes(o)))})}function Hh(t){const e=new Set,n=new Map,o=new Set,a=new Map,s=new Set;for(const i of t)if(n.set(i.state,(n.get(i.state)??0)+1),i.consumer&&/active|leased|processing|running/i.test(i.state)&&e.add(i.consumer),i.dlc&&o.add(i.dlc),i.message&&typeof i.message=="object"&&!Array.isArray(i.message)){const l=i.message,u=l.op,f=l.collection;typeof u=="string"&&a.set(u,(a.get(u)??0)+1),typeof f=="string"&&s.add(f)}return{activeConsumers:e.size,states:[...n.entries()],dlcs:[...o],operations:[...a.entries()].sort((i,l)=>i[0].localeCompare(l[0])),sources:[...s].sort()}}function ps(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const e=Number(t);if(Number.isFinite(e))return e}return null}function qh(t){const e=[];for(const n of t){if(!n.message||typeof n.message!="object"||Array.isArray(n.message))continue;const o=n.message,a=o.collection,s=o.op;if(typeof a!="string"||typeof s!="string")continue;const i=o.id??(o.after&&typeof o.after=="object"&&!Array.isArray(o.after)?o.after.id:void 0);e.push({messageId:n.id,collection:a,op:s,entityId:i==null?String(o.rid??n.id):String(i),lsn:ps(o.lsn),ts:ps(o.ts),before:o.before,after:o.after,payload:o})}return e}function Fh(t){const e=t.replace(/[^A-Za-z0-9_./-]/g,""),n="red-ui-preview",o="showcase";return[{label:"Backlog depth",query:`QUEUE LEN ${e}`,mutates:!1,note:"Read-only count of messages currently stored in the queue."},{label:"Peek messages",query:`QUEUE PEEK ${e} 25`,mutates:!1,note:"Read-only inspection. Does not lease, ack, or remove messages."},{label:"Read as fanout consumer",query:`QUEUE READ ${e} CONSUMER ${n} COUNT 5`,mutates:!0,note:"Leases messages for this consumer. ACK/NACK decides what happens next."},{label:"Read through explicit group",query:`QUEUE READ ${e} GROUP ${o} CONSUMER worker-a COUNT 5`,mutates:!0,note:"Creates/uses consumer group delivery state for an application tier."},{label:"Inspect pending group messages",query:`QUEUE PENDING ${e} GROUP ${o}`,mutates:!1,note:"Shows leased-but-unacked messages for a group."},{label:"Ack a delivered message",query:`QUEUE ACK ${e} GROUP ${o} 'message-id'`,mutates:!0,note:"Removes a successfully processed message for that group."},{label:"Nack a delivered message",query:`QUEUE NACK ${e} GROUP ${o} 'message-id'`,mutates:!0,note:"Returns or retries a failed message according to queue policy."}]}function Kh(t,e){const n=t.replace(/[^A-Za-z0-9_./-]/g,""),o=typeof e=="string"?`'${e.replace(/'/g,"''")}'`:JSON.stringify(e??null);return`QUEUE PUSH ${n} ${o}`}var Bh=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear queue filter"><!></button>'),jh=k("<span> </span>"),Uh=k('<span>from <span class="text-fg-2"> </span></span>'),Wh=k('<span>dlc <span class="text-fg-2"> </span></span>'),Yh=k('<span class="text-fg-2"> </span>'),Xh=k('<div class="mt-1.5 text-warn"> </div>'),Gh=k('<div class="mt-1.5 text-ok"> </div>'),$h=k('<div class="border-b border-line-1 bg-bg-1/20 px-3 py-2 text-[11px] font-mono"><div class="flex gap-2"><textarea rows="3" class="flex-1 resize-none rounded border border-line-1 bg-bg-0 px-2 py-1 text-[12px] text-fg-1 outline-none placeholder:text-fg-3 focus:border-accent"></textarea> <button type="button" class="inline-flex h-7 items-center gap-1.5 rounded bg-accent px-3 text-white disabled:opacity-40 disabled:cursor-not-allowed"><!> insert</button></div> <!></div>'),Zh=k('<div class="p-3 text-[12px] font-mono text-fg-3">No WITH EVENTS envelopes detected in this queue result.</div>'),Qh=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-2"> </td><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1"><span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span></td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-right text-fg-3"> </td><td class="px-2 py-1 text-fg-2 truncate max-w-[520px]"> </td></tr>'),Jh=k('<table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">time</th><th class="px-2 py-1.5 text-left font-normal">source</th><th class="px-2 py-1.5 text-left font-normal">op</th><th class="px-2 py-1.5 text-left font-normal">entity</th><th class="px-2 py-1.5 text-right font-normal">lsn</th><th class="px-2 py-1.5 text-left font-normal">after</th></tr></thead><tbody></tbody></table>'),e1=k('<div class="flex-1 min-h-0 overflow-auto"><!></div>'),t1=k('<div class="rounded border border-line-1 bg-bg-1 px-3 py-2"><div class="mb-1 flex items-center gap-2"><span class="text-fg-0"> </span> <span> </span></div> <pre class="m-0 overflow-x-auto rounded bg-bg-0 px-2 py-1 text-fg-1"> </pre> <div class="mt-1 text-fg-3"> </div></div>'),n1=k('<div class="flex-1 min-h-0 overflow-auto p-3 text-[12px] font-mono"><div class="grid gap-2"></div></div>'),r1=k('<div class="p-3 text-fg-3">No queue messages in this result.</div>'),o1=k('<span class="ml-auto text-fg-3"> </span>'),a1=k('<button type="button"><div class="flex items-center gap-2"><span class="text-accent"> </span> <span class="rounded border border-line-1 px-1 py-0.5 text-[10px] text-fg-3"> </span> <!></div> <div class="mt-1 truncate text-fg-1"> </div></button>'),i1=k('<pre class="whitespace-pre-wrap text-fg-1"> </pre>'),s1=k('<div class="grid grid-cols-[120px_1fr] gap-x-3 gap-y-1.5"><span class="text-fg-3">id</span><span class="text-fg-0"> </span> <span class="text-fg-3">state</span><span class="text-fg-0"> </span> <span class="text-fg-3">consumer</span><span class="text-fg-0"> </span> <span class="text-fg-3">dlc</span><span class="text-fg-0"> </span> <span class="text-fg-3">message</span><pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre></div>'),l1=k('<div class="text-fg-3">Select a message to inspect payload, delivery state, consumer, and DLC link.</div>'),c1=k('<div class="flex-1 min-h-0 grid grid-cols-[minmax(360px,0.9fr)_1.1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"><!></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),d1=k('<span><span class="text-fg-2"> </span> </span>'),u1=k('<span><span class="text-fg-2"> </span> </span>'),f1=k('<div class="flex h-full flex-col text-fg-1"><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"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> events</button> <button type="button"><!> messages</button> <button type="button"><!> commands</button> <button type="button"><!> json</button></div> <button type="button"><!> insert</button> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="message/state…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto flex items-center gap-3 text-fg-3"><span> </span> <!> <span> </span> <!> <!> <!></div></div> <!> <!> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3 flex items-center gap-3"><!> <!></div></div>');function v1(t,e){$e(e,!0);let n=xe("events"),o=xe(""),a=xe(null),s=xe(!1),i=xe(""),l=xe(!1),u=xe(null),f=xe(0);const v='{"type":"email","to":"ops@example.com"}',x=E(()=>Dh(e.result)),p=E(()=>Hh(r(x))),w=E(()=>qh(r(x))),_=E(()=>e.collection?Fh(e.collection):[]),I=E(()=>{const ue=r(o).trim().toLowerCase();return ue?r(x).filter(le=>le.id.toLowerCase().includes(ue)||le.state.toLowerCase().includes(ue)||JSON.stringify(le.message).toLowerCase().includes(ue)):r(x)});function H(ue){return typeof ue=="string"?ue:JSON.stringify(ue)}function D(ue){if(ue===null)return"-";try{return new Date(ue).toISOString().replace("T"," ").slice(0,19)}catch{return String(ue)}}function L(){const ue=r(i).trim();if(!ue)return"";try{return JSON.parse(ue)}catch{return ue}}async function V(){const ue=Ue.client;if(!(!ue||!e.collection||!r(i).trim())){T(l,!0),T(u,null);try{await Mt.track(`${e.collection} · enqueue message`,()=>ue.query(Kh(e.collection,L()))),T(i,""),T(f,r(f)+1)}catch(le){T(u,le.message,!0)}finally{T(l,!1)}}}var q=f1(),U=d(q),ie=d(U),de=d(ie),ae=d(de);gf(ae,{class:"size-3"}),Ee(),c(de);var $=g(de,2),fe=d($);rs(fe,{class:"size-3"}),Ee(),c($);var O=g($,2),b=d(O);Gu(b,{class:"size-3"}),Ee(),c(O);var M=g(O,2),m=d(M);xr(m,{class:"size-3"}),Ee(),c(M),c(ie);var N=g(ie,2),C=d(N);Cl(C,{class:"size-3"}),Ee(),c(N);var R=g(N,2),F=d(R);un(F,{class:"size-3 text-fg-3"});var J=g(F,2);Dt(J);var A=g(J,2);{var y=ue=>{var le=Bh(),we=d(le);Zt(we,{class:"size-3"}),c(le),be("click",le,()=>T(o,"")),h(ue,le)};X(A,ue=>{r(o)&&ue(y)})}c(R);var S=g(R,2),z=d(S),W=d(z);c(z);var oe=g(z,2);{var Z=ue=>{var le=jh(),we=d(le);c(le),j(Me=>P(we,`${Me??""} events`),[()=>r(w).length.toLocaleString()]),h(ue,le)};X(oe,ue=>{r(w).length&&ue(Z)})}var Y=g(oe,2),Q=d(Y);c(Y);var ee=g(Y,2);{var se=ue=>{var le=Uh(),we=g(d(le)),Me=d(we,!0);c(we),c(le),j(Ne=>P(Me,Ne),[()=>r(p).sources.join(", ")]),h(ue,le)};X(ee,ue=>{r(p).sources.length&&ue(se)})}var B=g(ee,2);{var K=ue=>{var le=Wh(),we=g(d(le)),Me=d(we,!0);c(we),c(le),j(Ne=>P(Me,Ne),[()=>r(p).dlcs.join(", ")]),h(ue,le)};X(B,ue=>{r(p).dlcs.length&&ue(K)})}var ne=g(B,2);{var re=ue=>{var le=Yh(),we=d(le,!0);c(le),j(()=>P(we,e.collection)),h(ue,le)};X(ne,ue=>{e.collection&&ue(re)})}c(S),c(U);var te=g(U,2);{var pe=ue=>{var le=$h(),we=d(le),Me=d(we);dl(Me),Se(Me,"placeholder",v);var Ne=g(Me,2),Te=d(Ne);{var ye=Be=>{mn(Be,{class:"size-3 animate-spin"})},ze=Be=>{rs(Be,{class:"size-3"})};X(Te,Be=>{r(l)?Be(ye):Be(ze,-1)})}Ee(),c(Ne),c(we);var Ae=g(we,2);{var Ke=Be=>{var Qe=Xh(),dt=d(Qe,!0);c(Qe),j(()=>P(dt,r(u))),h(Be,Qe)},at=Be=>{var Qe=Gh(),dt=d(Qe);c(Qe),j(()=>P(dt,`${r(f)??""} inserted. Refresh the collection to reload from reddb.`)),h(Be,Qe)};X(Ae,Be=>{r(u)?Be(Ke):r(f)>0&&Be(at,1)})}c(le),j(Be=>Ne.disabled=Be,[()=>r(l)||!r(i).trim()||!e.collection]),Kt(Me,()=>r(i),Be=>T(i,Be)),be("click",Ne,V),h(ue,le)};X(te,ue=>{r(s)&&ue(pe)})}var me=g(te,2);{var _e=ue=>{var le=e1(),we=d(le);{var Me=Te=>{var ye=Zh();h(Te,ye)},Ne=Te=>{var ye=Jh(),ze=g(d(ye));Je(ze,21,()=>r(w),Ae=>`${Ae.messageId}-${Ae.lsn??Ae.entityId}`,(Ae,Ke)=>{var at=Qh(),Be=d(at),Qe=d(Be,!0);c(Be);var dt=g(Be),vt=d(dt,!0);c(dt);var Ge=g(dt),Re=d(Ge),Ie=d(Re,!0);c(Re),c(Ge);var Fe=g(Ge),G=d(Fe,!0);c(Fe);var De=g(Fe),Le=d(De,!0);c(De);var je=g(De),Ye=d(je,!0);c(je),c(at),j((lt,ct)=>{P(Qe,lt),P(vt,r(Ke).collection),P(Ie,r(Ke).op),P(G,r(Ke).entityId),P(Le,r(Ke).lsn??"-"),P(Ye,ct)},[()=>D(r(Ke).ts),()=>H(r(Ke).after)]),h(Ae,at)}),c(ze),c(ye),h(Te,ye)};X(we,Te=>{r(w).length===0?Te(Me):Te(Ne,-1)})}c(le),h(ue,le)},ke=ue=>{var le=n1(),we=d(le);Je(we,21,()=>r(_),Me=>Me.query,(Me,Ne)=>{var Te=t1(),ye=d(Te),ze=d(ye),Ae=d(ze,!0);c(ze);var Ke=g(ze,2),at=d(Ke,!0);c(Ke),c(ye);var Be=g(ye,2),Qe=d(Be,!0);c(Be);var dt=g(Be,2),vt=d(dt,!0);c(dt),c(Te),j(Ge=>{P(Ae,r(Ne).label),Oe(Ke,1,Ge),P(at,r(Ne).mutates?"mutates":"read-only"),P(Qe,r(Ne).query),P(vt,r(Ne).note)},[()=>We(["rounded border px-1.5 py-0.5 text-[10px]",r(Ne).mutates?"border-warn/30 bg-warn/10 text-warn":"border-ok/30 bg-ok/10 text-ok"].join(" "))]),h(Me,Te)}),c(we),c(le),h(ue,le)},he=ue=>{var le=c1(),we=d(le),Me=d(we);{var Ne=Be=>{var Qe=r1();h(Be,Qe)},Te=Be=>{var Qe=Ve(),dt=ve(Qe);Je(dt,17,()=>r(I),vt=>vt.id,(vt,Ge)=>{var Re=a1(),Ie=d(Re),Fe=d(Ie),G=d(Fe,!0);c(Fe);var De=g(Fe,2),Le=d(De,!0);c(De);var je=g(De,2);{var Ye=gt=>{var it=o1(),Xe=d(it,!0);c(it),j(()=>P(Xe,r(Ge).consumer)),h(gt,it)};X(je,gt=>{r(Ge).consumer&>(Ye)})}c(Ie);var lt=g(Ie,2),ct=d(lt,!0);c(lt),c(Re),j((gt,it)=>{Oe(Re,1,gt),P(G,r(Ge).id),P(Le,r(Ge).state),P(ct,it)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(a)===r(Ge)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" ")),()=>H(r(Ge).message)]),be("click",Re,()=>T(a,r(Ge),!0)),h(vt,Re)}),h(Be,Qe)};X(Me,Be=>{r(I).length===0?Be(Ne):Be(Te,-1)})}c(we);var ye=g(we,2),ze=d(ye);{var Ae=Be=>{var Qe=i1(),dt=d(Qe,!0);c(Qe),j(vt=>P(dt,vt),[()=>JSON.stringify(r(I).map(vt=>vt.values),null,2)]),h(Be,Qe)},Ke=Be=>{var Qe=s1(),dt=g(d(Qe)),vt=d(dt,!0);c(dt);var Ge=g(dt,3),Re=d(Ge,!0);c(Ge);var Ie=g(Ge,3),Fe=d(Ie,!0);c(Ie);var G=g(Ie,3),De=d(G,!0);c(G);var Le=g(G,3),je=d(Le,!0);c(Le),c(Qe),j(Ye=>{P(vt,r(a).id),P(Re,r(a).state),P(Fe,r(a).consumer??"none"),P(De,r(a).dlc??"none"),P(je,Ye)},[()=>H(r(a).message)]),h(Be,Qe)},at=Be=>{var Qe=l1();h(Be,Qe)};X(ze,Be=>{r(n)==="json"?Be(Ae):r(a)?Be(Ke,1):Be(at,-1)})}c(ye),c(le),h(ue,le)};X(me,ue=>{r(n)==="events"?ue(_e):r(n)==="commands"?ue(ke,1):ue(he,-1)})}var ge=g(me,2),Ce=d(ge);Je(Ce,17,()=>r(p).states,([ue,le])=>ue,(ue,le)=>{var we=E(()=>on(r(le),2));let Me=()=>r(we)[0],Ne=()=>r(we)[1];var Te=d1(),ye=d(Te),ze=d(ye,!0);c(ye);var Ae=g(ye);c(Te),j(Ke=>{P(ze,Me()),P(Ae,` ${Ke??""}`)},[()=>Ne().toLocaleString()]),h(ue,Te)});var Pe=g(Ce,2);Je(Pe,17,()=>r(p).operations,([ue,le])=>ue,(ue,le)=>{var we=E(()=>on(r(le),2));let Me=()=>r(we)[0],Ne=()=>r(we)[1];var Te=u1(),ye=d(Te),ze=d(ye,!0);c(ye);var Ae=g(ye);c(Te),j(Ke=>{P(ze,Me()),P(Ae,` ${Ke??""}`)},[()=>Ne().toLocaleString()]),h(ue,Te)}),c(ge),c(q),j((ue,le,we,Me,Ne,Te)=>{Oe(de,1,ue),Se(de,"aria-pressed",r(n)==="events"),Oe($,1,le),Se($,"aria-pressed",r(n)==="messages"),Oe(O,1,we),Se(O,"aria-pressed",r(n)==="commands"),Oe(M,1,Me),Se(M,"aria-pressed",r(n)==="json"),N.disabled=!e.collection,Oe(N,1,Ne),Se(N,"aria-pressed",r(s)),Se(N,"title",e.collection?"Insert a queue message":"Open this as a collection to insert messages"),P(W,`${Te??""} messages`),P(Q,`${r(p).activeConsumers??""} active consumers`)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="events"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="messages"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="commands"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",r(s)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>r(I).length.toLocaleString()]),be("click",de,()=>T(n,"events")),be("click",$,()=>T(n,"messages")),be("click",O,()=>T(n,"commands")),be("click",M,()=>T(n,"json")),be("click",N,()=>T(s,!r(s))),Kt(J,()=>r(o),ue=>T(o,ue)),h(t,q),Ze()}Nt(["click"]);const g1={capability:"queue",renders:t=>Vh(t),component:v1},p1=["metric","stat","name","key"],h1=["value","count","total","avg","rate","p50","p95","p99"],hs=["unit","units"];function xs(t){return/bytes?|memory|storage|wal/i.test(t)?"bytes":/rps|rate|requests?_per_second|writes?_per_second|reads?_per_second/i.test(t)?"/s":/ms|latency|response/i.test(t)?"ms":/percent|ratio|usage/i.test(t)?"%":""}function x1(t){for(const n of hs){const o=t[n];if(typeof o=="string"&&o.trim())return o.trim()}const e=Object.entries(t).find(([n,o])=>hs.includes(n.toLowerCase())&&typeof o=="string"&&o.trim());return e?String(e[1]).trim():null}function jl(t){const e=[];for(const n of t.result.records){const o=n.values??{},a=Object.entries(o).find(([i,l])=>p1.includes(i.toLowerCase())&&(typeof l=="string"||typeof l=="number")),s=Object.entries(o).find(([i,l])=>h1.includes(i.toLowerCase())&&typeof l=="number"&&Number.isFinite(l));if(a&&s){const i=String(a[1]);e.push({key:i,label:i,value:s[1],unit:x1(o)??xs(i),source:o});continue}for(const[i,l]of Object.entries(o))typeof l!="number"||!Number.isFinite(l)||e.push({key:i,label:i,value:l,unit:xs(i),source:o})}return e}function b1(t){if(t.capability==="stats")return!0;const e=jl(t);return e.length>0&&e.length>=t.result.records.length}function bs(t,e){if(e==="bytes"){const n=Math.abs(t);return n>=1024**3?`${(t/1024**3).toFixed(1)} GiB`:n>=1024**2?`${(t/1024**2).toFixed(1)} MiB`:n>=1024?`${(t/1024).toFixed(1)} KiB`:`${t} B`}return e==="%"||e==="ms"||e==="/s"?`${t.toLocaleString()}${e}`:t.toLocaleString()}var m1=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No numeric statistics in this result.</div>'),_1=k('· <span class="text-fg-2"> </span>',1),y1=k('<div class="rounded border border-line-1 bg-bg-1 px-3 py-2"><div class="type-label truncate"> </div> <div class="mt-1 font-mono text-[20px] font-semibold text-fg-0"> </div></div>'),w1=k('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2"></div></div>'),k1=k('<div class="rounded border border-line-1 bg-bg-1 px-3 py-3 text-center"><svg viewBox="0 0 120 70" class="mx-auto h-[82px] w-[150px]"><path d="M 15 60 A 45 45 0 0 1 105 60" fill="none" stroke="var(--color-line-2)" stroke-width="10" stroke-linecap="round"></path><path d="M 15 60 A 45 45 0 0 1 105 60" fill="none" stroke="var(--color-accent)" stroke-width="10" stroke-linecap="round" pathLength="100"></path><text x="60" y="58" text-anchor="middle" class="fill-fg-0 font-mono text-[13px] font-semibold"> </text></svg> <div class="mt-1 truncate font-mono text-[11px] text-fg-2"> </div></div>'),S1=k('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2"></div></div>'),C1=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1 text-right text-accent"> </td><td class="px-2 py-1 text-fg-3"> </td></tr>'),N1=k('<div class="flex-1 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">metric</th><th class="px-2 py-1.5 text-right font-normal">value</th><th class="px-2 py-1.5 text-left font-normal">unit</th></tr></thead><tbody></tbody></table></div>'),E1=k('<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"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> kpis</button> <button type="button"><!> gauges</button> <button type="button"><!> table</button></div> <div class="ml-auto text-fg-3"> <!></div></div> <!>',1),M1=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function z1(t,e){$e(e,!0);let n=xe("kpi");const o=E(()=>jl(e.result)),a=E(()=>Math.max(1,...r(o).map(v=>Math.abs(v.value))));function s(v){return v>=0&&v<=100?v:Math.min(100,Math.abs(v)/r(a)*100)}var i=M1(),l=d(i);{var u=v=>{var x=m1();h(v,x)},f=v=>{var x=E1(),p=ve(x),w=d(p),_=d(w),I=d(_);df(I,{class:"size-3"}),Ee(),c(_);var H=g(_,2),D=d(H);Sl(D,{class:"size-3"}),Ee(),c(H);var L=g(H,2),V=d(L);Kd(V,{class:"size-3"}),Ee(),c(L),c(w);var q=g(w,2),U=d(q),ie=g(U);{var de=b=>{var M=_1(),m=g(ve(M)),N=d(m,!0);c(m),j(()=>P(N,e.collection)),h(b,M)};X(ie,b=>{e.collection&&b(de)})}c(q),c(p);var ae=g(p,2);{var $=b=>{var M=w1(),m=d(M);Je(m,23,()=>r(o),(N,C)=>`${N.key}-${C}`,(N,C)=>{var R=y1(),F=d(R),J=d(F,!0);c(F);var A=g(F,2),y=d(A,!0);c(A),c(R),j(S=>{P(J,r(C).label),P(y,S)},[()=>bs(r(C).value,r(C).unit)]),h(N,R)}),c(m),c(M),h(b,M)},fe=b=>{var M=S1(),m=d(M);Je(m,23,()=>r(o),(N,C)=>`${N.key}-${C}`,(N,C)=>{const R=E(()=>s(r(C).value));var F=k1(),J=d(F),A=g(d(J)),y=g(A),S=d(y,!0);c(y),c(J);var z=g(J,2),W=d(z,!0);c(z),c(F),j(oe=>{Se(J,"aria-label",`${r(C).label??""} gauge`),Se(A,"stroke-dasharray",`${r(R)} 100`),P(S,oe),P(W,r(C).label)},[()=>bs(r(C).value,r(C).unit)]),h(N,F)}),c(m),c(M),h(b,M)},O=b=>{var M=N1(),m=d(M),N=g(d(m));Je(N,23,()=>r(o),(C,R)=>`${C.key}-${R}`,(C,R)=>{var F=C1(),J=d(F),A=d(J,!0);c(J);var y=g(J),S=d(y,!0);c(y);var z=g(y),W=d(z,!0);c(z),c(F),j(oe=>{P(A,r(R).label),P(S,oe),P(W,r(R).unit||"-")},[()=>r(R).value.toLocaleString()]),h(C,F)}),c(N),c(m),c(M),h(b,M)};X(ae,b=>{r(n)==="kpi"?b($):r(n)==="gauge"?b(fe,1):b(O,-1)})}j((b,M,m,N)=>{Oe(_,1,b),Se(_,"aria-pressed",r(n)==="kpi"),Oe(H,1,M),Se(H,"aria-pressed",r(n)==="gauge"),Oe(L,1,m),Se(L,"aria-pressed",r(n)==="table"),P(U,`${N??""} metrics `)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="kpi"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="gauge"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="table"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(o).length.toLocaleString()]),be("click",_,()=>T(n,"kpi")),be("click",H,()=>T(n,"gauge")),be("click",L,()=>T(n,"table")),h(v,x)};X(l,v=>{r(o).length===0?v(u):v(f,-1)})}c(i),h(t,i),Ze()}Nt(["click"]);const T1={capability:"stats",renders:t=>b1(t),component:z1},Ul=["change","change_type","operation","op"],P1=["target_collection","collection_name","diff_collection"],I1=["entity_id","row_id","rid","id"],Wl=["before_state","before_row","before"],Yl=["after_state","after_row","after"],A1=["note","summary","message"];function ir(t,e){for(const n of e)if(n in t)return[n,t[n]];return Object.entries(t).find(([n])=>e.includes(n.toLowerCase()))??null}function ms(t){if(typeof t!="string")return t;const e=t.trim();if(!e||!/^[{[]/.test(e))return t;try{return JSON.parse(e)}catch{return t}}function L1(t){return t.result.records.map((e,n)=>{const o=e.values??{},a=ir(o,Ul),s=ir(o,P1),i=ir(o,I1),l=ir(o,Wl),u=ir(o,Yl),f=ir(o,A1);return{index:n,id:String(o.id??o.diff_id??(i==null?void 0:i[1])??n+1),change:String((a==null?void 0:a[1])??"modified"),collection:(s==null?void 0:s[1])===void 0||(s==null?void 0:s[1])===null?null:String(s[1]),entityId:(i==null?void 0:i[1])===void 0||(i==null?void 0:i[1])===null?null:String(i[1]),before:ms((l==null?void 0:l[1])??null),after:ms((u==null?void 0:u[1])??null),note:(f==null?void 0:f[1])===void 0||(f==null?void 0:f[1])===null?null:String(f[1]),values:o}})}function O1(t){return t.capability==="diff"?!0:t.result.records.some(e=>{const n=Object.keys(e.values??{}).map(o=>o.toLowerCase());return Ul.some(o=>n.includes(o))&&(Wl.some(o=>n.includes(o))||Yl.some(o=>n.includes(o)))})}function R1(t){const e=new Map;for(const n of t)e.set(n.change,(e.get(n.change)??0)+1);return[...e.entries()].sort(([n],[o])=>n.localeCompare(o))}function Ja(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function _s(t){return t===void 0?"__red_ui_undefined__":Ja(t)?JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))):JSON.stringify(t)}function D1(t){const e=Ja(t.before)?t.before:{},n=Ja(t.after)?t.after:{};return[...new Set([...Object.keys(e),...Object.keys(n)])].sort((a,s)=>a.localeCompare(s)).map(a=>{const s=Object.prototype.hasOwnProperty.call(e,a),i=Object.prototype.hasOwnProperty.call(n,a),l=e[a],u=n[a],f=!s&&i?"added":s&&!i?"removed":_s(l)===_s(u)?"unchanged":"modified";return{field:a,before:l,after:u,status:f}})}function sr(t){return t==null||t===""?"-":typeof t=="object"?JSON.stringify(t,null,2):String(t)}var V1=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No diff shape in this result.</div>'),H1=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear diff filter"><!></button>'),q1=k('<span><span class="text-fg-2"> </span> </span>'),F1=k('<span class="text-fg-2"> </span>'),K1=k('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><pre class="whitespace-pre-wrap text-fg-1"> </pre></div>'),B1=k('<span class="ml-auto text-fg-3"> </span>'),j1=k('<div class="mt-1 truncate text-fg-1"> </div>'),U1=k('<button type="button"><div class="flex items-center gap-2"><span class="text-accent"> </span> <span class="text-fg-3 truncate"> </span> <!></div> <!></button>'),W1=k('<span class="text-fg-3">note</span><span class="text-fg-1"> </span>',1),Y1=k('<div class="px-2 py-2 text-fg-3">No changed fields in this row.</div>'),X1=k('<tr class="border-b border-line-1/60 last:border-b-0"><td> </td><td class="px-2 py-1 align-top text-fg-0"> </td><td class="max-w-[260px] px-2 py-1 align-top text-fg-2"><pre class="whitespace-pre-wrap break-words"> </pre></td><td class="max-w-[260px] px-2 py-1 align-top text-fg-2"><pre class="whitespace-pre-wrap break-words"> </pre></td></tr>'),G1=k('<table class="w-full border-collapse"><thead class="bg-bg-0 text-fg-3"><tr class="border-b border-line-1"><th class="w-[110px] px-2 py-1 text-left font-normal">status</th><th class="w-[150px] px-2 py-1 text-left font-normal">field</th><th class="px-2 py-1 text-left font-normal">before</th><th class="px-2 py-1 text-left font-normal">after</th></tr></thead><tbody></tbody></table>'),$1=k('<div class="mb-3 border border-line-1"><div class="flex items-center gap-2 border-b border-line-1 bg-bg-1 px-2 py-1.5"><span class="text-fg-0">field diff</span> <span class="text-fg-3"> </span> <label class="ml-auto inline-flex items-center gap-1 text-fg-3"><input type="checkbox" class="size-3 accent-current"/> unchanged</label></div> <!></div>'),Z1=k('<div class="mb-3 grid grid-cols-[100px_1fr] gap-x-3 gap-y-1"><span class="text-fg-3">change</span><span class="text-accent"> </span> <span class="text-fg-3">entity</span><span class="text-fg-0"> </span> <span class="text-fg-3">collection</span><span class="text-fg-0"> </span> <!></div> <!> <div class="grid grid-cols-2 gap-3"><section class="min-w-0"><div class="type-label mb-1">full before</div> <pre class="min-h-[160px] whitespace-pre-wrap break-words rounded border border-line-1 bg-bg-1 p-2 text-fg-1"> </pre></section> <section class="min-w-0"><div class="type-label mb-1">full after</div> <pre class="min-h-[160px] whitespace-pre-wrap break-words rounded border border-line-1 bg-bg-1 p-2 text-fg-1"> </pre></section></div>',1),Q1=k('<div class="text-fg-3">No diff entry selected.</div>'),J1=k('<div class="flex-1 min-h-0 grid grid-cols-[minmax(320px,0.9fr)_1.1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),ex=k('<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"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> diff</button> <button type="button"><!> raw</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="change, id, value…" class="bg-transparent text-fg-1 outline-none w-[190px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto flex items-center gap-3 text-fg-3"><!> <!></div></div> <!>',1),tx=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function Xl(t,e){$e(e,!0);let n=xe("summary"),o=xe(""),a=xe(null),s=xe(!1);const i=E(()=>L1(e.result)),l=E(()=>R1(r(i))),u=E(()=>{const D=r(o).trim().toLowerCase();return D?r(i).filter(L=>L.id.toLowerCase().includes(D)||L.change.toLowerCase().includes(D)||(L.collection??"").toLowerCase().includes(D)||(L.entityId??"").toLowerCase().includes(D)||sr(L.before).toLowerCase().includes(D)||sr(L.after).toLowerCase().includes(D)):r(i)}),f=E(()=>r(a)??r(u)[0]??null),v=E(()=>r(f)?D1(r(f)):[]),x=E(()=>r(s)?r(v):r(v).filter(D=>D.status!=="unchanged"));function p(D){return D==="added"?"text-ok":D==="removed"?"text-danger":D==="modified"?"text-accent":"text-fg-3"}var w=tx(),_=d(w);{var I=D=>{var L=V1();h(D,L)},H=D=>{var L=ex(),V=ve(L),q=d(V),U=d(q),ie=d(U);Ya(ie,{class:"size-3"}),Ee(),c(U);var de=g(U,2),ae=d(de);xr(ae,{class:"size-3"}),Ee(),c(de),c(q);var $=g(q,2),fe=d($);un(fe,{class:"size-3 text-fg-3"});var O=g(fe,2);Dt(O);var b=g(O,2);{var M=y=>{var S=H1(),z=d(S);Zt(z,{class:"size-3"}),c(S),be("click",S,()=>T(o,"")),h(y,S)};X(b,y=>{r(o)&&y(M)})}c($);var m=g($,2),N=d(m);Je(N,17,()=>r(l),([y,S])=>y,(y,S)=>{var z=E(()=>on(r(S),2));let W=()=>r(z)[0],oe=()=>r(z)[1];var Z=q1(),Y=d(Z),Q=d(Y,!0);c(Y);var ee=g(Y);c(Z),j(()=>{P(Q,W()),P(ee,` ${oe()??""}`)}),h(y,Z)});var C=g(N,2);{var R=y=>{var S=F1(),z=d(S,!0);c(S),j(()=>P(z,e.collection)),h(y,S)};X(C,y=>{e.collection&&y(R)})}c(m),c(V);var F=g(V,2);{var J=y=>{var S=K1(),z=d(S),W=d(z,!0);c(z),c(S),j(oe=>P(W,oe),[()=>JSON.stringify(r(u).map(oe=>oe.values),null,2)]),h(y,S)},A=y=>{var S=J1(),z=d(S);Je(z,21,()=>r(u),Q=>Q.id,(Q,ee)=>{var se=U1(),B=d(se),K=d(B),ne=d(K,!0);c(K);var re=g(K,2),te=d(re,!0);c(re);var pe=g(re,2);{var me=he=>{var ge=B1(),Ce=d(ge,!0);c(ge),j(()=>P(Ce,r(ee).collection)),h(he,ge)};X(pe,he=>{r(ee).collection&&he(me)})}c(B);var _e=g(B,2);{var ke=he=>{var ge=j1(),Ce=d(ge,!0);c(ge),j(()=>P(Ce,r(ee).note)),h(he,ge)};X(_e,he=>{r(ee).note&&he(ke)})}c(se),j(he=>{Oe(se,1,he),P(ne,r(ee).change),P(te,r(ee).entityId??r(ee).id)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(f)===r(ee)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),be("click",se,()=>T(a,r(ee),!0)),h(Q,se)}),c(z);var W=g(z,2),oe=d(W);{var Z=Q=>{var ee=Z1(),se=ve(ee),B=g(d(se)),K=d(B,!0);c(B);var ne=g(B,3),re=d(ne,!0);c(ne);var te=g(ne,3),pe=d(te,!0);c(te);var me=g(te,2);{var _e=Ne=>{var Te=W1(),ye=g(ve(Te)),ze=d(ye,!0);c(ye),j(()=>P(ze,r(f).note)),h(Ne,Te)};X(me,Ne=>{r(f).note&&Ne(_e)})}c(se);var ke=g(se,2);{var he=Ne=>{var Te=$1(),ye=d(Te),ze=g(d(ye),2),Ae=d(ze);c(ze);var Ke=g(ze,2),at=d(Ke);Dt(at),Ee(),c(Ke),c(ye);var Be=g(ye,2);{var Qe=vt=>{var Ge=Y1();h(vt,Ge)},dt=vt=>{var Ge=G1(),Re=g(d(Ge));Je(Re,21,()=>r(x),Ie=>Ie.field,(Ie,Fe)=>{var G=X1(),De=d(G),Le=d(De,!0);c(De);var je=g(De),Ye=d(je,!0);c(je);var lt=g(je),ct=d(lt),gt=d(ct,!0);c(ct),c(lt);var it=g(lt),Xe=d(it),tt=d(Xe,!0);c(Xe),c(it),c(G),j((st,ut,ht)=>{Oe(De,1,st),P(Le,r(Fe).status),P(Ye,r(Fe).field),P(gt,ut),P(tt,ht)},[()=>We(["px-2 py-1 align-top",p(r(Fe).status)].join(" ")),()=>sr(r(Fe).before),()=>sr(r(Fe).after)]),h(Ie,G)}),c(Re),c(Ge),h(vt,Ge)};X(Be,vt=>{r(x).length===0?vt(Qe):vt(dt,-1)})}c(Te),j(()=>P(Ae,`${r(x).length??""}/${r(v).length??""} fields`)),Bd(at,()=>r(s),vt=>T(s,vt)),h(Ne,Te)};X(ke,Ne=>{r(v).length>0&&Ne(he)})}var ge=g(ke,2),Ce=d(ge),Pe=g(d(Ce),2),ue=d(Pe,!0);c(Pe),c(Ce);var le=g(Ce,2),we=g(d(le),2),Me=d(we,!0);c(we),c(le),c(ge),j((Ne,Te)=>{P(K,r(f).change),P(re,r(f).entityId??r(f).id),P(pe,r(f).collection??"-"),P(ue,Ne),P(Me,Te)},[()=>sr(r(f).before),()=>sr(r(f).after)]),h(Q,ee)},Y=Q=>{var ee=Q1();h(Q,ee)};X(oe,Q=>{r(f)?Q(Z):Q(Y,-1)})}c(W),c(S),h(y,S)};X(F,y=>{r(n)==="raw"?y(J):y(A,-1)})}j((y,S)=>{Oe(U,1,y),Se(U,"aria-pressed",r(n)==="summary"),Oe(de,1,S),Se(de,"aria-pressed",r(n)==="raw")},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="summary"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),be("click",U,()=>T(n,"summary")),be("click",de,()=>T(n,"raw")),Kt(O,()=>r(o),y=>T(o,y)),h(D,L)};X(_,D=>{r(i).length===0?D(I):D(H,-1)})}c(w),h(t,w),Ze()}Nt(["click"]);const nx={capability:"diff",renders:O1,component:Xl},rx=new Set(["rid","collection","kind","tenant","created_at","updated_at","body"]);function ox(t,e,n){const o=e&&typeof e=="object"&&!Array.isArray(e)?e:{};for(const s of["title","name","slug","id","event_type","type"]){const i=t[s]??o[s];if(typeof i=="string"&&i.trim())return i;if(typeof i=="number")return String(i)}const a=t.rid;return typeof a=="string"||typeof a=="number"?`document ${a}`:`document ${n+1}`}function ax(t,e){const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{},o=[];for(const s of["category","source","status","collection"]){const i=t[s]??n[s];typeof i=="string"&&i.trim()&&o.push(i)}const a=t.updated_at??t.created_at;return(typeof a=="string"||typeof a=="number")&&o.push(String(a)),o.join(" · ")}function Gl(t){const e=[];for(const[n,o]of t.result.records.entries()){const a=o.values??{},s=a.body;if(a.kind!=="document"&&(s===null||typeof s!="object"))continue;const i={};for(const[l,u]of Object.entries(a))rx.has(l.toLowerCase())||(i[l]=u);e.push({rid:String(a.rid??n+1),title:ox(a,s,n),subtitle:ax(a,s),body:s,fields:i,values:a})}return e}function ix(t){return t.capability==="document"?!0:Gl(t).length>0}var sx=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No document shape in this result.</div>'),lx=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear document filter"><!></button>'),cx=k('· <span class="text-fg-2"> </span>',1),dx=k('<div class="mt-1 truncate text-fg-3"> </div>'),ux=k('<button type="button"><div class="flex items-center gap-2"><span class="text-accent truncate"> </span> <span class="ml-auto text-fg-3"> </span></div> <!></button>'),fx=k('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),vx=k('<tr class="border-b border-line-1/60"><td class="w-[180px] px-2 py-1 text-fg-3 align-top"> </td><td class="px-2 py-1 text-fg-1 align-top"><pre class="m-0 whitespace-pre-wrap"> </pre></td></tr>'),gx=k('<table class="w-full border-collapse"><tbody></tbody></table>'),px=k('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),hx=k('<div class="text-fg-3">No documents match the current filter.</div>'),xx=k('<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"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> body</button> <button type="button"><!> fields</button> <button type="button"><!> raw</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="document search…" class="bg-transparent text-fg-1 outline-none w-[200px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto text-fg-3"> <!> documents <!></div></div> <div class="flex-1 min-h-0 grid grid-cols-[minmax(280px,0.75fr)_1.25fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="min-h-0 overflow-auto p-3 text-[12px] font-mono"><!></div></div> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3"> </div>',1),bx=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function mx(t,e){$e(e,!0);let n=xe("body"),o=xe(""),a=xe(null);const s=E(()=>Gl(e.result)),i=E(()=>{const w=r(o).trim().toLowerCase();return w?r(s).filter(_=>_.title.toLowerCase().includes(w)||_.subtitle.toLowerCase().includes(w)||JSON.stringify(_.body).toLowerCase().includes(w)):r(s)}),l=E(()=>r(a)&&r(i).includes(r(a))?r(a):r(i)[0]??null);function u(w){return JSON.stringify(w??null,null,2)}var f=bx(),v=d(f);{var x=w=>{var _=sx();h(w,_)},p=w=>{var _=xx(),I=ve(_),H=d(I),D=d(H),L=d(D);xr(L,{class:"size-3"}),Ee(),c(D);var V=g(D,2),q=d(V);nf(q,{class:"size-3"}),Ee(),c(V);var U=g(V,2),ie=d(U);xr(ie,{class:"size-3"}),Ee(),c(U),c(H);var de=g(H,2),ae=d(de);un(ae,{class:"size-3 text-fg-3"});var $=g(ae,2);Dt($);var fe=g($,2);{var O=Z=>{var Y=lx(),Q=d(Y);Zt(Q,{class:"size-3"}),c(Y),be("click",Y,()=>T(o,"")),h(Z,Y)};X(fe,Z=>{r(o)&&Z(O)})}c(de);var b=g(de,2),M=d(b,!0),m=g(M);{var N=Z=>{var Y=pt();j(Q=>P(Y,`of ${Q??""}`),[()=>r(s).length.toLocaleString()]),h(Z,Y)};X(m,Z=>{r(o)&&Z(N)})}var C=g(m,2);{var R=Z=>{var Y=cx(),Q=g(ve(Y)),ee=d(Q,!0);c(Q),j(()=>P(ee,e.collection)),h(Z,Y)};X(C,Z=>{e.collection&&Z(R)})}c(b),c(I);var F=g(I,2),J=d(F);Je(J,21,()=>r(i),Z=>Z.rid,(Z,Y)=>{var Q=ux(),ee=d(Q),se=d(ee),B=d(se,!0);c(se);var K=g(se,2),ne=d(K);c(K),c(ee);var re=g(ee,2);{var te=pe=>{var me=dx(),_e=d(me,!0);c(me),j(()=>P(_e,r(Y).subtitle)),h(pe,me)};X(re,pe=>{r(Y).subtitle&&pe(te)})}c(Q),j(pe=>{Oe(Q,1,pe),P(B,r(Y).title),P(ne,`#${r(Y).rid??""}`)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(l)===r(Y)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),be("click",Q,()=>T(a,r(Y),!0)),h(Z,Q)}),c(J);var A=g(J,2),y=d(A);{var S=Z=>{var Y=Ve(),Q=ve(Y);{var ee=K=>{var ne=fx(),re=d(ne,!0);c(ne),j(te=>P(re,te),[()=>u(r(l).body)]),h(K,ne)},se=K=>{var ne=gx(),re=d(ne);Je(re,21,()=>Object.entries(r(l).fields),([te,pe])=>te,(te,pe)=>{var me=E(()=>on(r(pe),2));let _e=()=>r(me)[0],ke=()=>r(me)[1];var he=vx(),ge=d(he),Ce=d(ge,!0);c(ge);var Pe=g(ge),ue=d(Pe),le=d(ue,!0);c(ue),c(Pe),c(he),j(we=>{P(Ce,_e()),P(le,we)},[()=>u(ke())]),h(te,he)}),c(re),c(ne),h(K,ne)},B=K=>{var ne=px(),re=d(ne,!0);c(ne),j(te=>P(re,te),[()=>u(r(l).values)]),h(K,ne)};X(Q,K=>{r(n)==="body"?K(ee):r(n)==="fields"?K(se,1):K(B,-1)})}h(Z,Y)},z=Z=>{var Y=hx();h(Z,Y)};X(y,Z=>{r(l)?Z(S):Z(z,-1)})}c(A),c(F);var W=g(F,2),oe=d(W);c(W),j((Z,Y,Q,ee)=>{Oe(D,1,Z),Se(D,"aria-pressed",r(n)==="body"),Oe(V,1,Y),Se(V,"aria-pressed",r(n)==="fields"),Oe(U,1,Q),Se(U,"aria-pressed",r(n)==="raw"),P(M,ee),P(oe,`${r(s).length??""} documents${e.collection?" · ":""}${e.collection??""??""}`)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="body"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="fields"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(i).length.toLocaleString()]),be("click",D,()=>T(n,"body")),be("click",V,()=>T(n,"fields")),be("click",U,()=>T(n,"raw")),Kt($,()=>r(o),Z=>T(o,Z)),h(w,_)};X(v,w=>{r(s).length===0?w(x):w(p,-1)})}c(f),h(t,f),Ze()}Nt(["click"]);const _x={capability:"document",renders:ix,component:mx};an.register(Qg);an.register(Jg);an.register(_p);an.register(Kp);an.register(Rh);an.register(g1);an.register(T1);an.register(nx);an.register(_x);an.register(Xp);var yx=k("<!> resume",1),wx=k("<!> pause",1),kx=k('<label class="inline-flex items-center gap-1 cursor-pointer"><input type="checkbox" class="accent-accent size-3"/> <span> </span></label>'),Sx=k('<button type="button" class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 hover:bg-bg-2 text-fg-3" title="Clear buffer"><!> clear</button>'),Cx=k('<div class="p-6 text-[12px] font-mono text-fg-3"><span class="text-accent">error:</span> </div>'),Nx=k('<div class="p-6 text-[12px] font-mono text-fg-3">Not connected. Use the topbar Connect button to open a stream.</div>'),Ex=k('<div class="p-6 text-[12px] font-mono text-fg-3"> </div>'),Mx=k('<span class="text-fg-3 ml-auto"> </span>'),zx=k('<li class="px-3 py-1.5 flex items-center gap-3 hover:bg-bg-1"><span class="text-fg-3 w-16 shrink-0"> </span> <span class="text-fg-3 w-16 shrink-0"> </span> <span> </span> <span class="text-fg-2 truncate"> </span> <span class="text-fg-3">·</span> <span class="text-fg-3 truncate"> </span> <!></li>'),Tx=k('<ul class="divide-y divide-line-1 font-mono text-[12px]"></ul>'),Px=k('<div class="h-full flex flex-col bg-bg-0"><header class="px-3 py-2 border-b border-line-1 flex items-center gap-3 text-fg-3"><!> <span class="type-label">Live changes</span> <span class="text-[11px] font-mono text-fg-3"> </span> <div class="ml-auto flex items-center gap-1"><button type="button" class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 hover:bg-bg-2 text-fg-2"><!></button> <div class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 text-fg-3"><!> <!></div> <!></div></header> <div class="flex-1 overflow-auto"><!></div></div>');function $l(t,e){$e(e,!0);const n=["insert","update","delete"];let o=xe(kt([])),a=xe(!1),s=xe(kt({insert:!0,update:!0,delete:!0})),i=xe(null),l=null,u=null;const f=500;function v(){p(),T(i,null),T(o,[],!0);const S=Ue.client;if(!S){T(i,"No active connection.");return}l=new Fu({client:S,sseFactory:null}).subscribe({collection:e.collection}),u=l.events.getReader(),x()}async function x(){if(u)try{for(;;){const{value:S,done:z}=await u.read();if(z)return;r(a)||S&&T(o,[S,...r(o)].slice(0,f),!0)}}catch(S){T(i,S.message,!0)}}function p(){if(u){try{u.cancel()}catch{}u=null}l&&(l.close(),l=null)}It(()=>{Ue.connected,e.collection,Ue.connected?v():p()}),ra(p);function w(S){const z=Date.now()-S;return z<1e3?"now":z<6e4?`${Math.floor(z/1e3)}s ago`:z<36e5?`${Math.floor(z/6e4)}m ago`:`${Math.floor(z/36e5)}h ago`}function _(S){return new Date(S).toISOString().replace("T"," ").replace("Z","")}const I=E(()=>r(o).filter(S=>r(s)[S.operation]??!0)),H=E(()=>e.collection?`collection: ${e.collection}`:"global");var D=Px(),L=d(D),V=d(L);Dr(V,{class:"size-3.5"});var q=g(V,4),U=d(q);c(q);var ie=g(q,2),de=d(ie),ae=d(de);{var $=S=>{var z=yx(),W=ve(z);oa(W,{class:"size-3"}),Ee(),h(S,z)},fe=S=>{var z=wx(),W=ve(z);ff(W,{class:"size-3"}),Ee(),h(S,z)};X(ae,S=>{r(a)?S($):S(fe,-1)})}c(de);var O=g(de,2),b=d(O);kl(b,{class:"size-3"});var M=g(b,2);Je(M,16,()=>n,S=>S,(S,z)=>{var W=kx(),oe=d(W);Dt(oe);var Z=g(oe,2),Y=d(Z,!0);c(Z),c(W),j(()=>{vl(oe,r(s)[z]),Oe(Z,1,We(r(s)[z]?"text-fg-1":"text-fg-3")),P(Y,z)}),be("change",oe,Q=>T(s,{...r(s),[z]:Q.currentTarget.checked},!0)),h(S,W)}),c(O);var m=g(O,2);{var N=S=>{var z=Sx(),W=d(z);Zt(W,{class:"size-3"}),Ee(),c(z),be("click",z,()=>T(o,[],!0)),h(S,z)};X(m,S=>{r(o).length>0&&S(N)})}c(ie),c(L);var C=g(L,2),R=d(C);{var F=S=>{var z=Cx(),W=g(d(z));c(z),j(()=>P(W,` ${r(i)??""}`)),h(S,z)},J=S=>{var z=Nx();h(S,z)},A=S=>{var z=Ex(),W=d(z,!0);c(z),j(()=>P(W,r(a)?"Paused — no events captured.":"Listening for changes…")),h(S,z)},y=S=>{var z=Tx();Je(z,21,()=>r(I),W=>W.lsn,(W,oe)=>{var Z=zx(),Y=d(Z),Q=d(Y,!0);c(Y);var ee=g(Y,2),se=d(ee);c(ee);var B=g(ee,2),K=d(B,!0);c(B);var ne=g(B,2),re=d(ne,!0);c(ne);var te=g(ne,4),pe=d(te,!0);c(te);var me=g(te,2);{var _e=ke=>{var he=Mx(),ge=d(he);c(he),j(()=>P(ge,`rid ${r(oe).rid??""}`)),h(ke,he)};X(me,ke=>{r(oe).rid!==void 0&&ke(_e)})}c(Z),j((ke,he,ge)=>{Se(Y,"title",ke),P(Q,he),P(se,`lsn ${r(oe).lsn??""}`),Oe(B,1,ge),P(K,r(oe).operation),P(re,r(oe).collection),P(pe,r(oe).kind)},[()=>_(r(oe).timestamp),()=>w(r(oe).timestamp),()=>We(["inline-block w-14 text-center text-[10px] uppercase rounded px-1 py-0.5 shrink-0 border",r(oe).operation==="insert"&&"border-ok/40 text-ok",r(oe).operation==="update"&&"border-warn/40 text-warn",r(oe).operation==="delete"&&"border-accent/40 text-accent"].filter(Boolean).join(" "))]),h(W,Z)}),c(z),h(S,z)};X(R,S=>{r(i)?S(F):Ue.connected?r(I).length===0?S(A,2):S(y,-1):S(J,1)})}c(C),c(D),j(()=>{P(U,`· ${r(H)??""}`),Se(de,"title",r(a)?"Resume stream":"Pause stream")}),be("click",de,()=>T(a,!r(a))),h(t,D),Ze()}Nt(["click","change"]);var Ix=k('<div class="border-b border-line-1 px-3 py-1.5 font-mono text-[11px] text-warn"> </div>'),Ax=k('<div class="p-4 font-mono text-[12px] text-fg-3">No active RedDB connection.</div>'),Lx=k('<div class="p-4 font-mono text-[12px] text-fg-3">Loading version history…</div>'),Ox=k('<div class="p-4 font-mono text-[12px] text-fg-3"><div class="mb-2 text-fg-1">This collection is a normal collection with versioning disabled.</div> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-accent/40 bg-accent px-2 text-white hover:bg-accent/90"><!> enable versioning</button></div>'),Rx=k('<div class="flex-1 min-h-0"><!></div>'),Dx=k("<option> </option>"),Vx=k("<option> </option>"),Hx=k('<span class="ml-auto text-fg-3"> </span>'),qx=k('<div class="p-4 font-mono text-[12px] text-fg-3">Choose two commits to compare this collection.</div>'),Fx=k('<div class="border-b border-line-1 px-3 py-1.5 flex flex-wrap items-center gap-2 font-mono text-[11px]"><label class="inline-flex items-center gap-1 text-fg-3"><span>from</span> <select class="h-7 rounded border border-line-1 bg-bg-0 px-2 text-fg-1"><option>select commit</option><!></select></label> <label class="inline-flex items-center gap-1 text-fg-3"><span>to</span> <select class="h-7 rounded border border-line-1 bg-bg-0 px-2 text-fg-1"><option>select commit</option><!></select></label> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-line-1 px-2 text-fg-2 hover:bg-bg-2 disabled:text-fg-3"><!> run diff</button> <!></div> <div class="flex-1 min-h-0"><!></div>',1),Kx=k('<div class="p-4 font-mono text-[12px] text-fg-3">No commits yet.</div>'),Bx=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/50"><td class="px-3 py-1.5 text-accent"> </td><td class="px-3 py-1.5 text-fg-1"> </td><td class="px-3 py-1.5 text-fg-3"> </td><td class="px-3 py-1.5 text-fg-3"> </td></tr>'),jx=k('<table class="w-full border-collapse font-mono text-[12px]"><thead class="sticky top-0 bg-bg-0 text-fg-3"><tr class="border-b border-line-1"><th class="px-3 py-1.5 text-left font-normal">commit</th><th class="px-3 py-1.5 text-left font-normal">message</th><th class="px-3 py-1.5 text-left font-normal">author</th><th class="px-3 py-1.5 text-left font-normal">time</th></tr></thead><tbody></tbody></table>'),Ux=k('<div class="flex-1 overflow-auto"><!></div>'),Wx=k('<div class="h-full min-h-0 flex flex-col bg-bg-0"><div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 font-mono text-[11px]"><div class="inline-flex overflow-hidden rounded border border-line-2"><button type="button"><!> commits</button> <button type="button"><!> diff</button> <button type="button"><!> live</button></div> <span> </span> <span class="text-fg-3"> </span> <button type="button" class="ml-auto inline-flex h-7 items-center gap-1 rounded border border-line-1 px-2 text-fg-3 hover:bg-bg-2 hover:text-fg-1"><!> refresh</button></div> <!> <!></div>');function Yx(t,e){$e(e,!0);let n=xe("commits"),o=xe(null),a=xe(kt([])),s=xe(""),i=xe(""),l=xe(null),u=xe(!1),f=xe(!1),v=xe(null),x="";const p=E(()=>r(s).length>0&&r(i).length>0&&r(s)!==r(i));function w(ee){return ee.slice(0,10)}function _(ee){return ee?new Date(ee).toISOString().replace("T"," ").replace("Z",""):"-"}function I(ee){return{ok:!0,query:`/repo/commits/${ee.from}/diff/${ee.to}?collection=${e.collection}`,capability:"diff",record_count:ee.entries.length,result:{columns:["collection","entity_id","change","before","after"],records:ee.entries.map((se,B)=>({values:{id:`${se.collection}:${se.entity_id}:${B}`,collection:se.collection,entity_id:se.entity_id,change:se.change,before:se.before??null,after:se.after??null}}))}}}async function H(){if(e.client){T(u,!0),T(v,null),T(l,null);try{const[ee,se]=await Promise.all([e.client.collectionVcs(e.collection),e.client.commits({limit:40})]);T(o,ee,!0),T(a,se,!0),se.length>=2?(T(i,se[0].hash,!0),T(s,se[1].hash,!0)):se.length===1?(T(i,se[0].hash,!0),T(s,"")):(T(i,""),T(s,""))}catch(ee){T(v,ee.message,!0)}finally{T(u,!1)}}}async function D(){if(e.client){T(u,!0),T(v,null);try{T(o,await e.client.setCollectionVcs(e.collection,!0),!0),T(a,await e.client.commits({limit:40}),!0)}catch(ee){T(v,ee.message,!0)}finally{T(u,!1)}}}async function L(){if(!(!e.client||!r(p))){T(f,!0),T(v,null);try{T(l,await e.client.commitDiff(r(s),r(i),{collection:e.collection}),!0),T(n,"diff")}catch(ee){T(v,ee.message,!0)}finally{T(f,!1)}}}It(()=>{var se;const ee=`${((se=e.client)==null?void 0:se.baseUrl)??"none"}:${e.collection}`;ee!==x&&(x=ee,H())});var V=Wx(),q=d(V),U=d(q),ie=d(U),de=d(ie);of(de,{class:"size-3"}),Ee(),c(ie);var ae=g(ie,2),$=d(ae);Ya($,{class:"size-3"}),Ee(),c(ae);var fe=g(ae,2),O=d(fe);vf(O,{class:"size-3"}),Ee(),c(fe),c(U);var b=g(U,2),M=d(b,!0);c(b);var m=g(b,2),N=d(m,!0);c(m);var C=g(m,2),R=d(C);{var F=ee=>{mn(ee,{class:"size-3 animate-spin"})},J=ee=>{ki(ee,{class:"size-3"})};X(R,ee=>{r(u)?ee(F):ee(J,-1)})}Ee(),c(C),c(q);var A=g(q,2);{var y=ee=>{var se=Ix(),B=d(se,!0);c(se),j(()=>P(B,r(v))),h(ee,se)};X(A,ee=>{r(v)&&ee(y)})}var S=g(A,2);{var z=ee=>{var se=Ax();h(ee,se)},W=ee=>{var se=Lx();h(ee,se)},oe=ee=>{var se=Ox(),B=g(d(se),2),K=d(B);bf(K,{class:"size-3"}),Ee(),c(B),c(se),be("click",B,()=>void D()),h(ee,se)},Z=ee=>{var se=Rx(),B=d(se);$l(B,{get collection(){return e.collection}}),c(se),h(ee,se)},Y=ee=>{var se=Fx(),B=ve(se),K=d(B),ne=g(d(K),2),re=d(ne);re.value=re.__value="";var te=g(re);Je(te,17,()=>r(a),ye=>ye.hash,(ye,ze)=>{var Ae=Dx(),Ke=d(Ae);c(Ae);var at={};j(Be=>{P(Ke,`${Be??""} · ${r(ze).message??""}`),at!==(at=r(ze).hash)&&(Ae.value=(Ae.__value=r(ze).hash)??"")},[()=>w(r(ze).hash)]),h(ye,Ae)}),c(ne),c(K);var pe=g(K,2),me=g(d(pe),2),_e=d(me);_e.value=_e.__value="";var ke=g(_e);Je(ke,17,()=>r(a),ye=>ye.hash,(ye,ze)=>{var Ae=Vx(),Ke=d(Ae);c(Ae);var at={};j(Be=>{P(Ke,`${Be??""} · ${r(ze).message??""}`),at!==(at=r(ze).hash)&&(Ae.value=(Ae.__value=r(ze).hash)??"")},[()=>w(r(ze).hash)]),h(ye,Ae)}),c(me),c(pe);var he=g(pe,2),ge=d(he);{var Ce=ye=>{mn(ye,{class:"size-3 animate-spin"})},Pe=ye=>{Ya(ye,{class:"size-3"})};X(ge,ye=>{r(f)?ye(Ce):ye(Pe,-1)})}Ee(),c(he);var ue=g(he,2);{var le=ye=>{var ze=Hx(),Ae=d(ze);c(ze),j(()=>P(Ae,`+${r(l).added??""} -${r(l).removed??""} ~${r(l).modified??""}`)),h(ye,ze)};X(ue,ye=>{r(l)&&ye(le)})}c(B);var we=g(B,2),Me=d(we);{var Ne=ye=>{{let ze=E(()=>I(r(l)));Xl(ye,{get result(){return r(ze)},get collection(){return e.collection}})}},Te=ye=>{var ze=qx();h(ye,ze)};X(Me,ye=>{r(l)?ye(Ne):ye(Te,-1)})}c(we),j(()=>he.disabled=!r(p)||r(f)),Ba(ne,()=>r(s),ye=>T(s,ye)),Ba(me,()=>r(i),ye=>T(i,ye)),be("click",he,()=>void L()),h(ee,se)},Q=ee=>{var se=Ux(),B=d(se);{var K=re=>{var te=Kx();h(re,te)},ne=re=>{var te=jx(),pe=g(d(te));Je(pe,21,()=>r(a),me=>me.hash,(me,_e)=>{var ke=Bx(),he=d(ke),ge=d(he,!0);c(he);var Ce=g(he),Pe=d(Ce,!0);c(Ce);var ue=g(Ce),le=d(ue,!0);c(ue);var we=g(ue),Me=d(we,!0);c(we),c(ke),j((Ne,Te)=>{var ye;P(ge,Ne),P(Pe,r(_e).message),P(le,((ye=r(_e).author)==null?void 0:ye.name)??"-"),P(Me,Te)},[()=>w(r(_e).hash),()=>_(r(_e).timestamp_ms)]),h(me,ke)}),c(pe),c(te),h(re,te)};X(B,re=>{r(a).length===0?re(K):re(ne,-1)})}c(se),h(ee,se)};X(S,ee=>{e.client?r(u)&&!r(o)?ee(W,1):r(o)&&!r(o).versioned?ee(oe,2):r(n)==="live"?ee(Z,3):r(n)==="diff"?ee(Y,4):ee(Q,-1):ee(z)})}c(V),j((ee,se,B)=>{var K,ne;Oe(ie,1,ee),Oe(ae,1,se),Oe(fe,1,B),Oe(b,1,We((K=r(o))!=null&&K.versioned?"text-ok":"text-fg-3")),P(M,(ne=r(o))!=null&&ne.versioned?"versioned":"not versioned"),P(N,e.collection),C.disabled=r(u)},[()=>We(["inline-flex h-7 items-center gap-1 px-2",r(n)==="commits"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",r(n)==="diff"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",r(n)==="live"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),be("click",ie,()=>T(n,"commits")),be("click",ae,()=>T(n,"diff")),be("click",fe,()=>T(n,"live")),be("click",C,()=>void H()),h(t,V),Ze()}Nt(["click"]);var Xx=k('<span class="text-fg-3">·</span> <span class="text-fg-2 font-mono text-[11px] truncate max-w-[280px]"> </span>',1),Gx=k('<span class="text-warn font-mono text-[11px]">disconnected</span>'),$x=k("<!> <span>Running…</span>",1),Zx=k("<!> <span>Run</span>",1),Qx=k('<div class="p-4 text-[12px] font-mono text-warn"><div class="font-semibold mb-1">Query failed</div> <pre class="whitespace-pre-wrap"> </pre></div>'),Jx=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Running…</div>'),eb=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Run a query to see results here.</div>'),tb=k('<div class="px-3 py-1.5 border-b border-line-1 bg-bg-1 text-[11px] font-mono text-fg-3"> <span class="text-fg-2">LIMIT</span> to narrow.</div>'),nb=k("<!> <!>",1),rb=k('<div class="flex h-full flex-col"><div class="flex flex-col border-b border-line-1 bg-bg-0" style="height: 40%;"><div class="flex items-center justify-between px-3 py-1.5 border-b border-line-1"><div class="flex items-center gap-2 text-fg-3 type-label"><span>SQL</span> <!></div> <div class="flex items-center gap-2"><span class="text-fg-3 font-mono text-[11px] hidden sm:inline">Run with <!><!></span> <button type="button" class="inline-flex items-center gap-1 rounded border border-accent/60 bg-accent/10 px-2 py-1 text-[12px] font-mono text-accent hover:bg-accent/20 disabled:opacity-50 disabled:cursor-not-allowed" aria-label="Run query"><!></button></div></div> <textarea class="flex-1 resize-none bg-bg-0 px-3 py-2 font-mono text-[13px] text-fg-1 outline-none placeholder:text-fg-3" spellcheck="false" autocapitalize="off"></textarea></div> <div class="flex-1 overflow-hidden bg-bg-0"><!></div></div>');function ob(t,e){$e(e,!0),It(()=>{rn.ensure(e.tabId)});const n=E(()=>rn.states[e.tabId]),o=E(()=>_t.tabs.find(N=>N.id===e.tabId));let a=xe(void 0);function s(N){rn.setSql(e.tabId,N);const C=dg(N,e.fallbackLabel),R=_t.tabs.find(F=>F.id===e.tabId);R&&R.label!==C&&_t.rename(e.tabId,C)}async function i(){await rn.run(e.tabId)}function l(N){(N.metaKey||N.ctrlKey)&&N.key==="Enter"&&(N.preventDefault(),i())}function u(){var N,C;return(N=r(n))!=null&&N.result?an.pick(r(n).result.capability,r(n).result,(C=r(o))==null?void 0:C.overrideCapability):null}var f=rb(),v=d(f),x=d(v),p=d(x),w=g(d(p),2);{var _=N=>{var C=Xx(),R=g(ve(C),2),F=d(R,!0);c(R),j(()=>P(F,Ue.active.url)),h(N,C)},I=N=>{var C=Gx();h(N,C)};X(w,N=>{Ue.connected?N(_):N(I,-1)})}c(p);var H=g(p,2),D=d(H),L=g(d(D));en(L,{children:(N,C)=>{Ee();var R=pt("⌘");h(N,R)}});var V=g(L);en(V,{children:(N,C)=>{Ee();var R=pt("↵");h(N,R)}}),c(D);var q=g(D,2),U=d(q);{var ie=N=>{var C=$x(),R=ve(C);mn(R,{class:"size-3.5 animate-spin"}),Ee(2),h(N,C)},de=N=>{var C=Zx(),R=ve(C);oa(R,{class:"size-3.5"}),Ee(2),h(N,C)};X(U,N=>{var C;(C=r(n))!=null&&C.running?N(ie):N(de,-1)})}c(q),c(H),c(x);var ae=g(x,2);dl(ae),Se(ae,"placeholder","SELECT * FROM users LIMIT 100"),tn(ae,N=>T(a,N),()=>r(a)),c(v);var $=g(v,2),fe=d($);{var O=N=>{var C=Qx(),R=g(d(C),2),F=d(R,!0);c(R),c(C),j(()=>P(F,r(n).error)),h(N,C)},b=N=>{var C=Jx();h(N,C)},M=N=>{var C=eb();h(N,C)},m=N=>{const C=E(u);var R=nb(),F=ve(R);{var J=S=>{var z=tb(),W=d(z);Ee(2),c(z),j(oe=>P(W,`Streamed first ${oe??""} rows — more remain on the server. Add a `),[()=>r(n).result.record_count.toLocaleString()]),h(S,z)};X(F,S=>{r(n).result.truncated&&S(J)})}var A=g(F,2);{var y=S=>{const z=E(()=>r(C).component);var W=Ve(),oe=ve(W);{let Z=E(()=>{var Y;return((Y=r(o))==null?void 0:Y.showSystemColumns)??!1});Gn(oe,()=>r(z),(Y,Q)=>{Q(Y,{get result(){return r(n).result},get showSystem(){return r(Z)}})})}h(S,W)};X(A,S=>{r(C)&&S(y)})}h(N,R)};X(fe,N=>{var C,R,F;(C=r(n))!=null&&C.error?N(O):(R=r(n))!=null&&R.running&&!r(n).result?N(b,1):(F=r(n))!=null&&F.result?N(m,-1):N(M,2)})}c($),c(f),j(()=>{var N,C;q.disabled=((N=r(n))==null?void 0:N.running)||!Ue.connected,gl(ae,((C=r(n))==null?void 0:C.sql)??"")}),be("click",q,i),be("input",ae,N=>s(N.currentTarget.value)),be("keydown",ae,l),h(t,f),Ze()}Nt(["click","input","keydown"]);var ab=k('<div class="px-3 py-2 flex items-center gap-2 text-fg-3"><!> <span class="type-label">Results</span></div>'),ib=k('<a><span class="truncate max-w-[180px]"> </span> <span class="opacity-60 group-hover:opacity-100 hover:bg-bg-2 rounded p-0.5" role="button" tabindex="-1" aria-label="Close tab"><!></span></a>'),sb=k('<button type="button"><span class="truncate max-w-[180px]"> </span> <span class="opacity-60 group-hover:opacity-100 hover:bg-bg-2 rounded p-0.5" role="button" tabindex="-1" aria-label="Close tab"><!></span></button>'),lb=k('<div class="flex items-stretch overflow-x-auto"></div>'),cb=k('<button type="button"><!> <span>history</span></button>'),db=k('<button type="button"><!> <span>meta</span></button> <!>',1),ub=k("<option> </option>"),fb=k('<div class="ml-auto flex items-center gap-2 px-2 text-[11px] font-mono text-fg-3"><!> <button type="button"><!> <span>sys</span></button> <span> </span> <span class="text-fg-3">· override:</span> <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5" aria-label="Renderer override"></select></div>'),vb=k('<div role="menu" class="absolute right-0 top-full mt-1 z-10 min-w-[220px] rounded border border-line-1 bg-bg-1 shadow-lg p-1 text-[12px] font-mono"><button type="button" class="w-full text-left px-2 py-1 rounded hover:bg-bg-2 text-fg-1 flex items-center gap-2"><!> <span class="flex-1">New query</span> <span class="text-fg-3 text-[10px]">⌘T</span></button> <button type="button" class="w-full text-left px-2 py-1 rounded hover:bg-bg-2 text-fg-1">Live changes (global)</button></div>'),gb=k('<div class="text-center text-fg-3 text-[12px] font-mono">Connected to <span class="text-fg-1"> </span>. <br/> Pick a collection from the left to open a tab.</div>'),pb=k(`<div class="text-center max-w-md"><!> <h2 class="type-h2 m-0 mb-2">Workspace</h2> <p class="text-fg-2 text-[13px] m-0">Connect to a reddb instance from the topbar to start browsing
|
|
991
|
-
collections and running queries.</p></div>`),hb=k('<div class="h-full grid place-items-center p-6"><!></div>'),xb=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Workspace</div>'),bb=k('<div class="p-4 text-[12px] font-mono text-warn"><div class="font-semibold mb-1">Query failed</div> <pre class="whitespace-pre-wrap"> </pre></div>'),mb=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono"> </div>'),_b=k('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Catalog metadata unavailable.</span> <span class="truncate"> </span></div>'),yb=k('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Loading collection catalog…</span></div>'),wb=k('<span class="rounded border border-line-1 bg-bg-0/70 px-1.5 py-0.5 font-mono text-[10px] text-fg-2"> </span>'),kb=k('<span class="font-mono text-[10px] text-fg-3">No type-specific catalog fields.</span>'),Sb=k('<div class="flex flex-wrap items-center gap-x-4 gap-y-2"><div class="min-w-[180px] flex-1"><div class="flex items-center gap-2"><span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-[0.08em] text-accent"> </span> <span class="truncate font-mono text-[12px] text-fg-0"> </span></div> <div class="mt-1 flex flex-wrap gap-1"><!> <!></div></div> <div class="flex flex-wrap items-center gap-2 font-mono text-[11px]"><div class="inline-flex min-w-[94px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">entities</span></div> <div class="inline-flex min-w-[92px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">disk</span></div> <div class="inline-flex min-w-[92px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">mem</span></div> <div class="inline-flex min-w-[78px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">seg</span></div> <div class="inline-flex min-w-[78px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">idx</span></div></div></div>'),Cb=k('<div class="flex items-start gap-2 text-fg-3"><!> <div><div class="text-warn">Collection metadata unavailable.</div> <div class="mt-0.5 break-words"> </div></div></div>'),Nb=k('<div class="text-fg-3">Loading metadata…</div>'),Eb=k('<span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span>'),Mb=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),zb=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),Tb=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2">retention</span>'),Pb=k("<span> </span>"),Ib=k('<div class="mt-1 flex flex-wrap gap-1"></div>'),Ab=k('<div class="mt-1 text-fg-3">Action grants not exposed.</div>'),Lb=k('<div class="grid grid-cols-[minmax(160px,0.8fr)_1.2fr] gap-3"><div class="grid grid-cols-[78px_1fr] gap-x-2 gap-y-1"><span class="text-fg-3">name</span> <span class="text-fg-0 truncate"> </span> <span class="text-fg-3">kind</span> <span class="text-accent"> </span> <span class="text-fg-3">tenant</span> <span class="text-fg-1"> </span> <span class="text-fg-3">indexes</span> <span class="text-fg-1"> </span></div> <div class="grid gap-1"><div class="flex flex-wrap gap-1"><!> <!> <!> <!></div> <!></div></div>'),Ob=k('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-2 text-[11px] font-mono"><!></div>'),Rb=k('<div class="h-[320px] min-h-[240px] border-b border-line-1"><!></div>'),Db=k('<div class="h-full flex flex-col"><div class="border-b border-line-1 bg-bg-1/35 px-3 py-2"><!></div> <!> <!> <div class="flex-1 min-h-0"><!></div></div>'),Vb=k('<div class="h-full flex flex-col"><div class="border-b border-line-1 flex items-stretch min-h-[36px] bg-bg-0"><!> <!> <div><button type="button" class="px-2 inline-flex items-center text-fg-3 hover:text-fg-1" aria-label="Open tab menu"><!></button> <!></div></div> <div class="flex-1 overflow-hidden bg-bg-0"><!></div></div>');function Hb(t,e){$e(e,!0);const n=no(),o=[{value:"",label:"Auto"},{value:"table",label:"Table"},{value:"graph",label:"Graph"},{value:"hypertable",label:"Chart"},{value:"kv",label:"KV"},{value:"vector",label:"Vector"},{value:"queue",label:"Queue"},{value:"stats",label:"Stats"},{value:"diff",label:"Diff"},{value:"document",label:"Document"},{value:"json",label:"JSON"}];let a=kt({}),s=kt({}),i=kt({}),l=kt({}),u=kt({}),f=kt({}),v=kt({}),x=xe(kt({})),p=xe(null),w=null,_=xe(!1),I=xe(!1);It(()=>{const B=_t.activeId;B!==w&&(T(p,w,!0),w=B)});async function H(B,K){const[me,_e]=await Promise.all([Mt.track(`${K} · edges (LIMIT 50000)`,()=>B.query(`SELECT * FROM ${K} WHERE from_rid IS NOT NULL LIMIT 50000`)),Mt.track(`${K} · centrality (LIMIT 100)`,()=>B.query("GRAPH CENTRALITY LIMIT 100")).catch(()=>null)]),ke=new Map;_e!=null&&_e.ok&&_e.result.records.forEach((Ne,Te)=>{const ye=Ne.values.node_id??Ne.values.rid??Ne.values.id,ze=Ne.values.score??Ne.values.centrality_score??Ne.values.centrality,Ae=typeof ye=="number"?ye:typeof ye=="string"?Number(ye):NaN,Ke=typeof ze=="number"?ze:typeof ze=="string"?Number(ze):NaN;!Number.isFinite(Ae)||!Number.isFinite(Ke)||ke.set(Ae,{score:Ke,rank:Te+1,label:typeof Ne.values.label=="string"?Ne.values.label:void 0})});const he=new Set;for(const Ne of me.result.records){const Te=Ne.values.from_rid,ye=Ne.values.to_rid;typeof Te=="number"&&he.add(Te),typeof ye=="number"&&he.add(ye)}for(const Ne of ke.keys())he.add(Ne);const ge=[...he],Ce=Math.ceil(ge.length/5),Pe=[];for(let Ne=0;Ne<ge.length;Ne+=5)Pe.push({idx:Math.floor(Ne/5)+1,ids:ge.slice(Ne,Ne+5).join(",")});const ue=[];let le=me,we=0;async function Me(){for(;we<Pe.length;){const Ne=Pe[we++],Te=await Mt.track(`${K} · nodes ${Ne.idx}/${Ce}`,()=>B.query(`SELECT * FROM ${K} WHERE rid IN (${Ne.ids})`));ue.push(...Te.result.records.map(ye=>{const ze=ye.values.rid,Ae=typeof ze=="number"?ke.get(ze):void 0;return Ae?{...ye,values:{...ye.values,centrality_score:Ae.score,centrality_rank:Ae.rank,centrality_label:Ae.label}}:ye})),le=Te}}return await Promise.all(Array.from({length:8},Me)),{...le,record_count:ue.length+me.result.records.length,result:{...le.result,records:[...ue,...me.result.records]}}}function D(B){return B.replace(/[^A-Za-z0-9_./-]/g,"")}function L(B){return`'${B.replace(/'/g,"''")}'`}async function V(B,K){const ne=await B.query(fg(K)),re=gg(ne.result.records[0]);if(!re)throw new Error(`${K} was not found in red.collections`);return re}async function q(B,K){var ne;try{const te=(ne=(await B.query(`SELECT model FROM red.collections WHERE name = ${L(K)} LIMIT 1`)).result.records[0])==null?void 0:ne.values.model;return typeof te=="string"?te:null}catch{return null}}async function U(B,K){const ne=D(K),re=await q(B,K);if(re==="hll")return B.query(`HLL INFO ${ne}`);if(re==="sketch")return B.query(`SKETCH INFO ${ne}`);if(re==="filter")return B.query(`FILTER INFO ${ne}`);if(re==="mixed")for(const te of[`HLL INFO ${ne}`,`SKETCH INFO ${ne}`,`FILTER INFO ${ne}`])try{return await B.query(te)}catch{}try{return await B.query(`SELECT * FROM ${ne} LIMIT 200`)}catch{for(const te of[`HLL INFO ${ne}`,`SKETCH INFO ${ne}`,`FILTER INFO ${ne}`])try{return await B.query(te)}catch{}throw new Error(`No stats read form worked for ${K}`)}}async function ie(B,K){const ne=D(K),re=await B.query(`SELECT * FROM ${ne} LIMIT 200`);return{...re,capability:re.capability??"vector"}}It(()=>{if(Ot.locked)return;const B=Ue.client;if(B)for(const K of _t.tabs){if(K.kind!=="collection")continue;const ne=K.subpage??Ar(K.capability),re=ne==="graph"||ne==="svg",te=ne==="queue"||K.capability==="queue",pe=ne==="vector"||K.capability==="vector",me=ne==="stats"||K.capability==="stats",_e=re?"graph-subgraph":te?"queue-peek":pe?"vector-inspector":me?"stats-info":K.capability??"unknown",ke=`${K.key}:${ne}:${_e}`;if(i[K.id]&&i[K.id]!==ke&&(delete a[K.id],delete s[K.id]),a[K.id]!==void 0||s[K.id])continue;a[K.id]=null,i[K.id]=ke;const he=K.key;(re?H(B,he):te?Mt.track(`${he} · QUEUE PEEK (LIMIT 200)`,()=>B.query(`QUEUE PEEK ${he} 200`)):pe?Mt.track(`${he} · vector inspector seed`,()=>ie(B,he)):me?Mt.track(`${he} · stats preview`,()=>U(B,he)):Mt.track(`${he} · SELECT * (LIMIT 200)`,()=>B.query(`SELECT * FROM ${he} LIMIT 200`))).then(Ce=>{a[K.id]=Ce}).catch(Ce=>{s[K.id]=Ce.message})}}),It(()=>{if(Ot.locked)return;const B=Ue.client;if(B)for(const K of _t.tabs)K.kind==="collection"&&(l[K.id]!==void 0||u[K.id]||(l[K.id]=null,Mt.track(`catalog · ${K.key}`,()=>V(B,K.key)).then(ne=>{l[K.id]=ne}).catch(ne=>{u[K.id]=ne.message})))}),It(()=>{if(!r(I)||Ot.locked)return;const B=Ue.client;if(B)for(const K of _t.tabs)K.kind==="collection"&&(f[K.id]!==void 0||v[K.id]||(f[K.id]=null,Mt.track(`metadata · ${K.key}`,()=>B.collection(K.key)).then(ne=>{f[K.id]=ne}).catch(ne=>{v[K.id]=ne.message})))});function de(B,K){B.stopPropagation();const ne=_t.tabs.find(te=>te.id===K);if((ne==null?void 0:ne.kind)==="query"&&rn.isDirty(K)&&!(typeof window<"u"?window.confirm("Discard unsaved query in this tab?"):!0))return;const re=(ne==null?void 0:ne.kind)==="collection"&&ne.key===n.collection;if(_t.close(K,r(p)),rn.remove(K),delete a[K],delete s[K],delete i[K],delete l[K],delete u[K],delete f[K],delete v[K],delete r(x)[K],re){const te=_t.tabs.find(pe=>pe.kind==="collection");n.go(te?{view:"collection",collection:te.key,subpage:te.subpage??Ar(te.capability)}:{view:"collections"},void 0,!0)}}function ae(){const B=rn.nextLabel(),K=_t.open({kind:"query",label:B,key:B},!0);rn.ensure(K.id),T(_,!1)}Rn(()=>{const B=()=>ae();return window.addEventListener("red:new-query",B),()=>window.removeEventListener("red:new-query",B)});function $(B,K){const ne=jd(B.subpage,B.capability??K.capability);return an.pick(ne,K,B.overrideCapability)}function fe(){_t.open({kind:"live-changes",label:"live · global",key:"global"}),T(_,!1)}function O(B,K){const ne=K.currentTarget.value;_t.setOverride(B.id,ne===""?void 0:ne)}function b(B,K){return B.subpage?B.subpage:B.capability?B.capability:K!=null&&K.capability?K.capability:"auto"}function M(B){return typeof B=="boolean"?{allowed:B}:{allowed:B.allowed,reason:B.reason}}function m(B){return B&&typeof B=="object"&&!Array.isArray(B)?Object.keys(B):[]}var N=Vb(),C=d(N),R=d(C);{var F=B=>{var K=ab(),ne=d(K);Dr(ne,{class:"size-3.5"}),Ee(2),c(K),h(B,K)},J=B=>{var K=lb();Je(K,21,()=>_t.tabs,ne=>ne.id,(ne,re)=>{const te=E(()=>r(re).id===_t.activeId),pe=E(()=>["group flex items-center gap-2 px-3 py-1.5 text-[12px] font-mono border-r border-line-1 whitespace-nowrap no-underline",r(te)?"bg-bg-1 text-fg-1 border-b-2 border-b-accent -mb-px":"text-fg-3 hover:text-fg-1 hover:bg-bg-1/40"].join(" "));var me=Ve(),_e=ve(me);{var ke=ge=>{const Ce=E(()=>({view:"collection",collection:r(re).key,subpage:r(re).subpage??Ar(r(re).capability)}));var Pe=ib(),ue=d(Pe),le=d(ue,!0);c(ue);var we=g(ue,2),Me=d(we);Zt(Me,{class:"size-3"}),c(we),c(Pe),j(Ne=>{Se(Pe,"href",Ne),Oe(Pe,1,We(r(pe))),Se(Pe,"title",r(re).label),P(le,r(re).label)},[()=>n.href(r(Ce))]),be("click",Pe,Ne=>n.go(r(Ce),Ne)),be("click",we,Ne=>de(Ne,r(re).id)),be("keydown",we,Ne=>{Ne.key==="Enter"&&de(Ne,r(re).id)}),h(ge,Pe)},he=ge=>{var Ce=sb(),Pe=d(Ce),ue=d(Pe,!0);c(Pe);var le=g(Pe,2),we=d(le);Zt(we,{class:"size-3"}),c(le),c(Ce),j(()=>{Oe(Ce,1,We(r(pe))),Se(Ce,"title",r(re).label),P(ue,r(re).label)}),be("click",Ce,()=>_t.focus(r(re).id)),be("click",le,Me=>de(Me,r(re).id)),be("keydown",le,Me=>{Me.key==="Enter"&&de(Me,r(re).id)}),h(ge,Ce)};X(_e,ge=>{r(re).kind==="collection"?ge(ke):ge(he,-1)})}h(ne,me)}),c(K),h(B,K)};X(R,B=>{_t.tabs.length===0?B(F):B(J,-1)})}var A=g(R,2);{var y=B=>{const K=E(()=>_t.active),ne=E(()=>a[r(K).id]);var re=fb(),te=d(re);{var pe=le=>{var we=db(),Me=ve(we),Ne=d(Me);ba(Ne,{class:"size-3"}),Ee(2),c(Me);var Te=g(Me,2);{var ye=ze=>{var Ae=cb(),Ke=d(Ae);rf(Ke,{class:"size-3"}),Ee(2),c(Ae),j(at=>{Se(Ae,"title",r(x)[r(K).id]?"Hide version history":"Show version history and diffs"),Se(Ae,"aria-pressed",r(x)[r(K).id]??!1),Oe(Ae,1,at)},[()=>We(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(x)[r(K).id]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),be("click",Ae,()=>T(x,{...r(x),[r(K).id]:!(r(x)[r(K).id]??!1)},!0)),h(ze,Ae)};X(Te,ze=>{Ue.capabilities.vcs&&ze(ye)})}j(ze=>{Se(Me,"title",r(I)?"Hide collection metadata":"Show collection metadata"),Se(Me,"aria-pressed",r(I)),Oe(Me,1,ze)},[()=>We(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(I)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),be("click",Me,()=>T(I,!r(I))),h(le,we)};X(te,le=>{r(K).kind==="collection"&&le(pe)})}var me=g(te,2),_e=d(me);{var ke=le=>{ef(le,{class:"size-3"})},he=le=>{Ju(le,{class:"size-3"})};X(_e,le=>{r(K).showSystemColumns?le(ke):le(he,-1)})}Ee(2),c(me);var ge=g(me,2),Ce=d(ge,!0);c(ge);var Pe=g(ge,4);Je(Pe,21,()=>o,le=>le.value,(le,we)=>{var Me=ub(),Ne=d(Me,!0);c(Me);var Te={};j(()=>{P(Ne,r(we).label),Te!==(Te=r(we).value)&&(Me.value=(Me.__value=r(we).value)??"")}),h(le,Me)}),c(Pe);var ue;xi(Pe),c(re),j((le,we)=>{Se(me,"title",r(K).showSystemColumns?"Hide reddb system columns (rid, collection, kind, tenant, created_at, updated_at)":"Show reddb system columns"),Se(me,"aria-pressed",r(K).showSystemColumns??!1),Oe(me,1,le),P(Ce,we),ue!==(ue=r(K).overrideCapability??"")&&(Pe.value=(Pe.__value=r(K).overrideCapability??"")??"",bi(Pe,r(K).overrideCapability??""))},[()=>We(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(K).showSystemColumns?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>b(r(K),r(ne))]),be("click",me,()=>_t.setShowSystem(r(K).id,!r(K).showSystemColumns)),be("change",Pe,le=>O(r(K),le)),h(B,re)};X(A,B=>{_t.active&&(_t.active.kind==="collection"||_t.active.kind==="query")&&B(y)})}var S=g(A,2),z=d(S),W=d(z);Cl(W,{class:"size-3.5"}),c(z);var oe=g(z,2);{var Z=B=>{var K=vb(),ne=d(K),re=d(ne);wl(re,{class:"size-3.5 text-fg-3"}),Ee(4),c(ne);var te=g(ne,2);c(K),be("click",ne,ae),be("click",te,fe),h(B,K)};X(oe,B=>{r(_)&&B(Z)})}c(S),c(C);var Y=g(C,2),Q=d(Y);{var ee=B=>{var K=hb(),ne=d(K);{var re=pe=>{var me=gb(),_e=g(d(me)),ke=d(_e,!0);c(_e),Ee(3),c(me),j(()=>P(ke,Ue.active.url)),h(pe,me)},te=pe=>{var me=pb(),_e=d(me);Vr(_e,{class:"size-8 text-fg-3 mx-auto mb-3",strokeWidth:1.4}),Ee(4),c(me),h(pe,me)};X(ne,pe=>{Ue.connected?pe(re):pe(te,-1)})}c(K),h(B,K)},se=B=>{const K=E(()=>_t.active);var ne=Ve(),re=ve(ne);{var te=ke=>{$l(ke,{collection:void 0})},pe=ke=>{ob(ke,{get tabId(){return r(K).id},get fallbackLabel(){return r(K).key}})},me=ke=>{var he=xb();h(ke,he)},_e=ke=>{const he=E(()=>a[r(K).id]),ge=E(()=>s[r(K).id]);var Ce=Ve(),Pe=ve(Ce);{var ue=Me=>{var Ne=bb(),Te=g(d(Ne),2),ye=d(Te,!0);c(Te),c(Ne),j(()=>P(ye,r(ge))),h(Me,Ne)},le=Me=>{var Ne=mb(),Te=d(Ne);c(Ne),j(()=>P(Te,`Loading ${r(K).label??""}…`)),h(Me,Ne)},we=Me=>{const Ne=E(()=>$(r(K),r(he))),Te=E(()=>r(Ne).component),ye=E(()=>l[r(K).id]),ze=E(()=>u[r(K).id]);var Ae=Db(),Ke=d(Ae),at=d(Ke);{var Be=De=>{var Le=_b(),je=d(Le);ba(je,{class:"size-3.5 text-warn"});var Ye=g(je,4),lt=d(Ye,!0);c(Ye),c(Le),j(()=>P(lt,r(ze))),h(De,Le)},Qe=De=>{var Le=yb(),je=d(Le);Vr(je,{class:"size-3.5"}),Ee(2),c(Le),h(De,Le)},dt=De=>{var Le=Sb(),je=d(Le),Ye=d(je),lt=d(Ye),ct=d(lt,!0);c(lt);var gt=g(lt,2),it=d(gt,!0);c(gt),c(Ye);var Xe=g(Ye,2),tt=d(Xe);Je(tt,17,()=>ds(r(ye)),Ft,(yt,zt)=>{var qt=wb(),ln=d(qt,!0);c(qt),j(()=>P(ln,r(zt))),h(yt,qt)});var st=g(tt,2);{var ut=yt=>{var zt=kb();h(yt,zt)},ht=E(()=>ds(r(ye)).length===0);X(st,yt=>{r(ht)&&yt(ut)})}c(Xe),c(je);var xt=g(je,2),Tt=d(xt),bt=d(Tt);Xa(bt,{class:"size-3.5 text-fg-3"});var mt=g(bt,2),Et=d(mt,!0);c(mt),Ee(2),c(Tt);var Pt=g(Tt,2),Rt=d(Pt);af(Rt,{class:"size-3.5 text-fg-3"});var Ht=g(Rt,2),Bt=d(Ht,!0);c(Ht),Ee(2),c(Pt);var Ut=g(Pt,2),sn=d(Ut);Dr(sn,{class:"size-3.5 text-fg-3"});var gn=g(sn,2),pn=d(gn,!0);c(gn),Ee(2),c(Ut);var Pn=g(Ut,2),Vn=d(Pn);Ud(Vn,{class:"size-3.5 text-fg-3"});var Hn=g(Vn,2),Cr=d(Hn,!0);c(Hn),Ee(2),c(Pn);var In=g(Pn,2),qn=d(In);pf(qn,{class:"size-3.5 text-fg-3"});var Fn=g(qn,2),or=d(Fn,!0);c(Fn),Ee(2),c(In),c(xt),c(Le),j((yt,zt,qt,ln,An)=>{P(ct,r(ye).model??"collection"),P(it,r(ye).name),P(Et,yt),P(Bt,zt),P(pn,qt),P(Cr,ln),P(or,An)},[()=>Po(r(ye).entities),()=>cs(r(ye).onDiskBytes),()=>cs(r(ye).inMemoryBytes),()=>Po(r(ye).segments),()=>Po(r(ye).indices)]),h(De,Le)};X(at,De=>{r(ze)?De(Be):r(ye)?De(dt,-1):De(Qe,1)})}c(Ke);var vt=g(Ke,2);{var Ge=De=>{const Le=E(()=>f[r(K).id]),je=E(()=>v[r(K).id]);var Ye=Ob(),lt=d(Ye);{var ct=Xe=>{var tt=Cb(),st=d(tt);ba(st,{class:"mt-0.5 size-3.5 text-warn"});var ut=g(st,2),ht=g(d(ut),2),xt=d(ht,!0);c(ht),c(ut),c(tt),j(()=>P(xt,r(je))),h(Xe,tt)},gt=Xe=>{var tt=Nb();h(Xe,tt)},it=Xe=>{var tt=Lb(),st=d(tt),ut=g(d(st),2),ht=d(ut,!0);c(ut);var xt=g(ut,4),Tt=d(xt,!0);c(xt);var bt=g(xt,4),mt=d(bt,!0);c(bt);var Et=g(bt,4),Pt=d(Et,!0);c(Et),c(st);var Rt=g(st,2),Ht=d(Rt),Bt=d(Ht);{var Ut=yt=>{var zt=Eb(),qt=d(zt,!0);c(zt),j(()=>P(qt,r(Le).capability)),h(yt,zt)};X(Bt,yt=>{r(Le).capability&&yt(Ut)})}var sn=g(Bt,2);Je(sn,17,()=>r(Le).capabilities??[],Ft,(yt,zt)=>{var qt=Mb(),ln=d(qt,!0);c(qt),j(()=>P(ln,r(zt))),h(yt,qt)});var gn=g(sn,2);{var pn=yt=>{var zt=zb(),qt=d(zt);c(zt),j(ln=>P(qt,`schema ${ln??""}`),[()=>m(r(Le).schema).length]),h(yt,zt)},Pn=E(()=>m(r(Le).schema).length>0);X(gn,yt=>{r(Pn)&&yt(pn)})}var Vn=g(gn,2);{var Hn=yt=>{var zt=Tb();h(yt,zt)},Cr=E(()=>m(r(Le).retention).length>0);X(Vn,yt=>{r(Cr)&&yt(Hn)})}c(Ht);var In=g(Ht,2);{var qn=yt=>{var zt=Ib();Je(zt,21,()=>Object.entries(r(Le).actions),Ft,(qt,ln)=>{var An=E(()=>on(r(ln),2));let lo=()=>r(An)[0],co=()=>r(An)[1];const ar=E(()=>M(co()));var Kn=Pb(),Nr=d(Kn);c(Kn),j(uo=>{Oe(Kn,1,uo),Se(Kn,"title",r(ar).reason),P(Nr,`${lo()??""}: ${r(ar).allowed?"allow":"deny"}`)},[()=>We(["rounded border px-1.5 py-0.5",r(ar).allowed?"border-ok/30 bg-ok/10 text-ok":"border-danger/30 bg-danger/10 text-danger"].join(" "))]),h(qt,Kn)}),c(zt),h(yt,zt)},Fn=E(()=>r(Le).actions&&m(r(Le).actions).length>0),or=yt=>{var zt=Ab();h(yt,zt)};X(In,yt=>{r(Fn)?yt(qn):yt(or,-1)})}c(Rt),c(tt),j(()=>{var yt;P(ht,r(Le).name??r(K).key),P(Tt,r(Le).kind??r(Le).capability??r(K).capability??"unknown"),P(mt,r(Le).tenant??"not exposed"),P(Pt,((yt=r(Le).indexes)==null?void 0:yt.length)??0)}),h(Xe,tt)};X(lt,Xe=>{r(je)?Xe(ct):r(Le)?Xe(it,-1):Xe(gt,1)})}c(Ye),h(De,Ye)};X(vt,De=>{r(I)&&De(Ge)})}var Re=g(vt,2);{var Ie=De=>{var Le=Rb(),je=d(Le);{let Ye=E(()=>Ue.client??void 0);Yx(je,{get client(){return r(Ye)},get collection(){return r(K).key}})}c(Le),h(De,Le)};X(Re,De=>{r(x)[r(K).id]&&De(Ie)})}var Fe=g(Re,2),G=d(Fe);{let De=E(()=>r(K).kind==="collection"?r(K).key:void 0),Le=E(()=>Ue.client??void 0),je=E(()=>r(K).kind==="collection"?r(K).subpage:void 0),Ye=E(()=>r(K).showSystemColumns??!1);Gn(G,()=>r(Te),(lt,ct)=>{ct(lt,{get result(){return r(he)},get collection(){return r(De)},get client(){return r(Le)},get subpage(){return r(je)},get showSystem(){return r(Ye)}})})}c(Fe),c(Ae),h(Me,Ae)};X(Pe,Me=>{r(ge)?Me(ue):r(he)?Me(we,-1):Me(le,1)})}h(ke,Ce)};X(re,ke=>{r(K).kind==="live-changes"?ke(te):r(K).kind==="query"?ke(pe,1):r(K).kind==="welcome"?ke(me,2):ke(_e,-1)})}h(B,ne)};X(Q,B=>{_t.active?B(se,-1):B(ee)})}c(Y),c(N),j(()=>Oe(S,1,`relative ${_t.active&&(_t.active.kind==="collection"||_t.active.kind==="query")?"":"ml-auto"} flex items-stretch`)),be("click",z,()=>T(_,!r(_))),h(t,N),Ze()}Nt(["click","keydown","change"]);var qb=k('<div class="h-full grid grid-cols-[260px_1fr] bg-bg-0 text-fg-1"><aside class="row-start-1 col-start-1 border-r border-line-1 bg-bg-0 overflow-y-auto"><!></aside> <section class="row-start-1 col-start-2 bg-bg-0 overflow-hidden"><!></section></div>');function Fb(t){var e=qb(),n=d(e),o=d(n);ag(o,{}),c(n);var a=g(n,2),s=d(a);Hb(s,{}),c(a),c(e),h(t,e)}var Kb={value:()=>{}};function ia(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ao(n)}function Ao(t){this._=t}function Bb(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",a=n.indexOf(".");if(a>=0&&(o=n.slice(a+1),n=n.slice(0,a)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ao.prototype=ia.prototype={constructor:Ao,on:function(t,e){var n=this._,o=Bb(t+"",n),a,s=-1,i=o.length;if(arguments.length<2){for(;++s<i;)if((a=(t=o[s]).type)&&(a=jb(n[a],t.name)))return a;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<i;)if(a=(t=o[s]).type)n[a]=ys(n[a],t.name,e);else if(e==null)for(a in n)n[a]=ys(n[a],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ao(t)},call:function(t,e){if((a=arguments.length-2)>0)for(var n=new Array(a),o=0,a,s;o<a;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],o=0,a=s.length;o<a;++o)s[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],a=0,s=o.length;a<s;++a)o[a].value.apply(e,n)}};function jb(t,e){for(var n=0,o=t.length,a;n<o;++n)if((a=t[n]).name===e)return a.value}function ys(t,e,n){for(var o=0,a=t.length;o<a;++o)if(t[o].name===e){t[o]=Kb,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var ei="http://www.w3.org/1999/xhtml";const ws={svg:"http://www.w3.org/2000/svg",xhtml:ei,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function sa(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),ws.hasOwnProperty(e)?{space:ws[e],local:t}:t}function Ub(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ei&&e.documentElement.namespaceURI===ei?e.createElement(t):e.createElementNS(n,t)}}function Wb(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Zl(t){var e=sa(t);return(e.local?Wb:Ub)(e)}function Yb(){}function Ci(t){return t==null?Yb:function(){return this.querySelector(t)}}function Xb(t){typeof t!="function"&&(t=Ci(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var s=e[a],i=s.length,l=o[a]=new Array(i),u,f,v=0;v<i;++v)(u=s[v])&&(f=t.call(u,u.__data__,v,s))&&("__data__"in u&&(f.__data__=u.__data__),l[v]=f);return new nn(o,this._parents)}function Gb(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function $b(){return[]}function Ql(t){return t==null?$b:function(){return this.querySelectorAll(t)}}function Zb(t){return function(){return Gb(t.apply(this,arguments))}}function Qb(t){typeof t=="function"?t=Zb(t):t=Ql(t);for(var e=this._groups,n=e.length,o=[],a=[],s=0;s<n;++s)for(var i=e[s],l=i.length,u,f=0;f<l;++f)(u=i[f])&&(o.push(t.call(u,u.__data__,f,i)),a.push(u));return new nn(o,a)}function Jl(t){return function(){return this.matches(t)}}function ec(t){return function(e){return e.matches(t)}}var Jb=Array.prototype.find;function em(t){return function(){return Jb.call(this.children,t)}}function tm(){return this.firstElementChild}function nm(t){return this.select(t==null?tm:em(typeof t=="function"?t:ec(t)))}var rm=Array.prototype.filter;function om(){return Array.from(this.children)}function am(t){return function(){return rm.call(this.children,t)}}function im(t){return this.selectAll(t==null?om:am(typeof t=="function"?t:ec(t)))}function sm(t){typeof t!="function"&&(t=Jl(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var s=e[a],i=s.length,l=o[a]=[],u,f=0;f<i;++f)(u=s[f])&&t.call(u,u.__data__,f,s)&&l.push(u);return new nn(o,this._parents)}function tc(t){return new Array(t.length)}function lm(){return new nn(this._enter||this._groups.map(tc),this._parents)}function Ho(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ho.prototype={constructor:Ho,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function cm(t){return function(){return t}}function dm(t,e,n,o,a,s){for(var i=0,l,u=e.length,f=s.length;i<f;++i)(l=e[i])?(l.__data__=s[i],o[i]=l):n[i]=new Ho(t,s[i]);for(;i<u;++i)(l=e[i])&&(a[i]=l)}function um(t,e,n,o,a,s,i){var l,u,f=new Map,v=e.length,x=s.length,p=new Array(v),w;for(l=0;l<v;++l)(u=e[l])&&(p[l]=w=i.call(u,u.__data__,l,e)+"",f.has(w)?a[l]=u:f.set(w,u));for(l=0;l<x;++l)w=i.call(t,s[l],l,s)+"",(u=f.get(w))?(o[l]=u,u.__data__=s[l],f.delete(w)):n[l]=new Ho(t,s[l]);for(l=0;l<v;++l)(u=e[l])&&f.get(p[l])===u&&(a[l]=u)}function fm(t){return t.__data__}function vm(t,e){if(!arguments.length)return Array.from(this,fm);var n=e?um:dm,o=this._parents,a=this._groups;typeof t!="function"&&(t=cm(t));for(var s=a.length,i=new Array(s),l=new Array(s),u=new Array(s),f=0;f<s;++f){var v=o[f],x=a[f],p=x.length,w=gm(t.call(v,v&&v.__data__,f,o)),_=w.length,I=l[f]=new Array(_),H=i[f]=new Array(_),D=u[f]=new Array(p);n(v,x,I,H,D,w,e);for(var L=0,V=0,q,U;L<_;++L)if(q=I[L]){for(L>=V&&(V=L+1);!(U=H[V])&&++V<_;);q._next=U||null}}return i=new nn(i,o),i._enter=l,i._exit=u,i}function gm(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function pm(){return new nn(this._exit||this._groups.map(tc),this._parents)}function hm(t,e,n){var o=this.enter(),a=this,s=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(a=e(a),a&&(a=a.selection())),n==null?s.remove():n(s),o&&a?o.merge(a).order():a}function xm(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,a=n.length,s=o.length,i=Math.min(a,s),l=new Array(a),u=0;u<i;++u)for(var f=n[u],v=o[u],x=f.length,p=l[u]=new Array(x),w,_=0;_<x;++_)(w=f[_]||v[_])&&(p[_]=w);for(;u<a;++u)l[u]=n[u];return new nn(l,this._parents)}function bm(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],a=o.length-1,s=o[a],i;--a>=0;)(i=o[a])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function mm(t){t||(t=_m);function e(x,p){return x&&p?t(x.__data__,p.__data__):!x-!p}for(var n=this._groups,o=n.length,a=new Array(o),s=0;s<o;++s){for(var i=n[s],l=i.length,u=a[s]=new Array(l),f,v=0;v<l;++v)(f=i[v])&&(u[v]=f);u.sort(e)}return new nn(a,this._parents).order()}function _m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ym(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function wm(){return Array.from(this)}function km(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],a=0,s=o.length;a<s;++a){var i=o[a];if(i)return i}return null}function Sm(){let t=0;for(const e of this)++t;return t}function Cm(){return!this.node()}function Nm(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var a=e[n],s=0,i=a.length,l;s<i;++s)(l=a[s])&&t.call(l,l.__data__,s,a);return this}function Em(t){return function(){this.removeAttribute(t)}}function Mm(t){return function(){this.removeAttributeNS(t.space,t.local)}}function zm(t,e){return function(){this.setAttribute(t,e)}}function Tm(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Pm(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Im(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Am(t,e){var n=sa(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?Mm:Em:typeof e=="function"?n.local?Im:Pm:n.local?Tm:zm)(n,e))}function nc(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Lm(t){return function(){this.style.removeProperty(t)}}function Om(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Rm(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Dm(t,e,n){return arguments.length>1?this.each((e==null?Lm:typeof e=="function"?Rm:Om)(t,e,n??"")):br(this.node(),t)}function br(t,e){return t.style.getPropertyValue(e)||nc(t).getComputedStyle(t,null).getPropertyValue(e)}function Vm(t){return function(){delete this[t]}}function Hm(t,e){return function(){this[t]=e}}function qm(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Fm(t,e){return arguments.length>1?this.each((e==null?Vm:typeof e=="function"?qm:Hm)(t,e)):this.node()[t]}function rc(t){return t.trim().split(/^|\s+/)}function Ni(t){return t.classList||new oc(t)}function oc(t){this._node=t,this._names=rc(t.getAttribute("class")||"")}oc.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ac(t,e){for(var n=Ni(t),o=-1,a=e.length;++o<a;)n.add(e[o])}function ic(t,e){for(var n=Ni(t),o=-1,a=e.length;++o<a;)n.remove(e[o])}function Km(t){return function(){ac(this,t)}}function Bm(t){return function(){ic(this,t)}}function jm(t,e){return function(){(e.apply(this,arguments)?ac:ic)(this,t)}}function Um(t,e){var n=rc(t+"");if(arguments.length<2){for(var o=Ni(this.node()),a=-1,s=n.length;++a<s;)if(!o.contains(n[a]))return!1;return!0}return this.each((typeof e=="function"?jm:e?Km:Bm)(n,e))}function Wm(){this.textContent=""}function Ym(t){return function(){this.textContent=t}}function Xm(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Gm(t){return arguments.length?this.each(t==null?Wm:(typeof t=="function"?Xm:Ym)(t)):this.node().textContent}function $m(){this.innerHTML=""}function Zm(t){return function(){this.innerHTML=t}}function Qm(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Jm(t){return arguments.length?this.each(t==null?$m:(typeof t=="function"?Qm:Zm)(t)):this.node().innerHTML}function e0(){this.nextSibling&&this.parentNode.appendChild(this)}function t0(){return this.each(e0)}function n0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function r0(){return this.each(n0)}function o0(t){var e=typeof t=="function"?t:Zl(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function a0(){return null}function i0(t,e){var n=typeof t=="function"?t:Zl(t),o=e==null?a0:typeof e=="function"?e:Ci(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function s0(){var t=this.parentNode;t&&t.removeChild(this)}function l0(){return this.each(s0)}function c0(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function d0(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function u0(t){return this.select(t?d0:c0)}function f0(t){return arguments.length?this.property("__data__",t):this.node().__data__}function v0(t){return function(e){t.call(this,e,this.__data__)}}function g0(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function p0(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,a=e.length,s;n<a;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++o]=s;++o?e.length=o:delete this.__on}}}function h0(t,e,n){return function(){var o=this.__on,a,s=v0(e);if(o){for(var i=0,l=o.length;i<l;++i)if((a=o[i]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=s,a.options=n),a.value=e;return}}this.addEventListener(t.type,s,n),a={type:t.type,name:t.name,value:e,listener:s,options:n},o?o.push(a):this.__on=[a]}}function x0(t,e,n){var o=g0(t+""),a,s=o.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,f=l.length,v;u<f;++u)for(a=0,v=l[u];a<s;++a)if((i=o[a]).type===v.type&&i.name===v.name)return v.value}return}for(l=e?h0:p0,a=0;a<s;++a)this.each(l(o[a],e,n));return this}function sc(t,e,n){var o=nc(t),a=o.CustomEvent;typeof a=="function"?a=new a(e,n):(a=o.document.createEvent("Event"),n?(a.initEvent(e,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(e,!1,!1)),t.dispatchEvent(a)}function b0(t,e){return function(){return sc(this,t,e)}}function m0(t,e){return function(){return sc(this,t,e.apply(this,arguments))}}function _0(t,e){return this.each((typeof e=="function"?m0:b0)(t,e))}function*y0(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],a=0,s=o.length,i;a<s;++a)(i=o[a])&&(yield i)}var lc=[null];function nn(t,e){this._groups=t,this._parents=e}function ro(){return new nn([[document.documentElement]],lc)}function w0(){return this}nn.prototype=ro.prototype={constructor:nn,select:Xb,selectAll:Qb,selectChild:nm,selectChildren:im,filter:sm,data:vm,enter:lm,exit:pm,join:hm,merge:xm,selection:w0,order:bm,sort:mm,call:ym,nodes:wm,node:km,size:Sm,empty:Cm,each:Nm,attr:Am,style:Dm,property:Fm,classed:Um,text:Gm,html:Jm,raise:t0,lower:r0,append:o0,insert:i0,remove:l0,clone:u0,datum:f0,on:x0,dispatch:_0,[Symbol.iterator]:y0};function cn(t){return typeof t=="string"?new nn([[document.querySelector(t)]],[document.documentElement]):new nn([[t]],lc)}function k0(t){let e;for(;e=t.sourceEvent;)t=e;return t}function hn(t,e){if(t=k0(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var a=e.getBoundingClientRect();return[t.clientX-a.left-e.clientLeft,t.clientY-a.top-e.clientTop]}}return[t.pageX,t.pageY]}const S0={passive:!1},Hr={capture:!0,passive:!1};function Ea(t){t.stopImmediatePropagation()}function fr(t){t.preventDefault(),t.stopImmediatePropagation()}function cc(t){var e=t.document.documentElement,n=cn(t).on("dragstart.drag",fr,Hr);"onselectstart"in e?n.on("selectstart.drag",fr,Hr):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function dc(t,e){var n=t.document.documentElement,o=cn(t).on("dragstart.drag",null);e&&(o.on("click.drag",fr,Hr),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const mo=t=>()=>t;function ti(t,{sourceEvent:e,subject:n,target:o,identifier:a,active:s,x:i,y:l,dx:u,dy:f,dispatch:v}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:v}})}ti.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function C0(t){return!t.ctrlKey&&!t.button}function N0(){return this.parentNode}function E0(t,e){return e??{x:t.x,y:t.y}}function M0(){return navigator.maxTouchPoints||"ontouchstart"in this}function z0(){var t=C0,e=N0,n=E0,o=M0,a={},s=ia("start","drag","end"),i=0,l,u,f,v,x=0;function p(q){q.on("mousedown.drag",w).filter(o).on("touchstart.drag",H).on("touchmove.drag",D,S0).on("touchend.drag touchcancel.drag",L).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(q,U){if(!(v||!t.call(this,q,U))){var ie=V(this,e.call(this,q,U),q,U,"mouse");ie&&(cn(q.view).on("mousemove.drag",_,Hr).on("mouseup.drag",I,Hr),cc(q.view),Ea(q),f=!1,l=q.clientX,u=q.clientY,ie("start",q))}}function _(q){if(fr(q),!f){var U=q.clientX-l,ie=q.clientY-u;f=U*U+ie*ie>x}a.mouse("drag",q)}function I(q){cn(q.view).on("mousemove.drag mouseup.drag",null),dc(q.view,f),fr(q),a.mouse("end",q)}function H(q,U){if(t.call(this,q,U)){var ie=q.changedTouches,de=e.call(this,q,U),ae=ie.length,$,fe;for($=0;$<ae;++$)(fe=V(this,de,q,U,ie[$].identifier,ie[$]))&&(Ea(q),fe("start",q,ie[$]))}}function D(q){var U=q.changedTouches,ie=U.length,de,ae;for(de=0;de<ie;++de)(ae=a[U[de].identifier])&&(fr(q),ae("drag",q,U[de]))}function L(q){var U=q.changedTouches,ie=U.length,de,ae;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),de=0;de<ie;++de)(ae=a[U[de].identifier])&&(Ea(q),ae("end",q,U[de]))}function V(q,U,ie,de,ae,$){var fe=s.copy(),O=hn($||ie,U),b,M,m;if((m=n.call(q,new ti("beforestart",{sourceEvent:ie,target:p,identifier:ae,active:i,x:O[0],y:O[1],dx:0,dy:0,dispatch:fe}),de))!=null)return b=m.x-O[0]||0,M=m.y-O[1]||0,function N(C,R,F){var J=O,A;switch(C){case"start":a[ae]=N,A=i++;break;case"end":delete a[ae],--i;case"drag":O=hn(F||R,U),A=i;break}fe.call(C,q,new ti(C,{sourceEvent:R,subject:m,target:p,identifier:ae,active:A,x:O[0]+b,y:O[1]+M,dx:O[0]-J[0],dy:O[1]-J[1],dispatch:fe}),de)}}return p.filter=function(q){return arguments.length?(t=typeof q=="function"?q:mo(!!q),p):t},p.container=function(q){return arguments.length?(e=typeof q=="function"?q:mo(q),p):e},p.subject=function(q){return arguments.length?(n=typeof q=="function"?q:mo(q),p):n},p.touchable=function(q){return arguments.length?(o=typeof q=="function"?q:mo(!!q),p):o},p.on=function(){var q=s.on.apply(s,arguments);return q===s?p:q},p.clickDistance=function(q){return arguments.length?(x=(q=+q)*q,p):Math.sqrt(x)},p}function Ei(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function uc(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function oo(){}var qr=.7,qo=1/qr,vr="\\s*([+-]?\\d+)\\s*",Fr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",T0=/^#([0-9a-f]{3,8})$/,P0=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),I0=new RegExp(`^rgb\\(${bn},${bn},${bn}\\)$`),A0=new RegExp(`^rgba\\(${vr},${vr},${vr},${Fr}\\)$`),L0=new RegExp(`^rgba\\(${bn},${bn},${bn},${Fr}\\)$`),O0=new RegExp(`^hsl\\(${Fr},${bn},${bn}\\)$`),R0=new RegExp(`^hsla\\(${Fr},${bn},${bn},${Fr}\\)$`),ks={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ei(oo,$n,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ss,formatHex:Ss,formatHex8:D0,formatHsl:V0,formatRgb:Cs,toString:Cs});function Ss(){return this.rgb().formatHex()}function D0(){return this.rgb().formatHex8()}function V0(){return fc(this).formatHsl()}function Cs(){return this.rgb().formatRgb()}function $n(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=T0.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ns(e):n===3?new Qt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?_o(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?_o(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=P0.exec(t))?new Qt(e[1],e[2],e[3],1):(e=I0.exec(t))?new Qt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=A0.exec(t))?_o(e[1],e[2],e[3],e[4]):(e=L0.exec(t))?_o(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=O0.exec(t))?zs(e[1],e[2]/100,e[3]/100,1):(e=R0.exec(t))?zs(e[1],e[2]/100,e[3]/100,e[4]):ks.hasOwnProperty(t)?Ns(ks[t]):t==="transparent"?new Qt(NaN,NaN,NaN,0):null}function Ns(t){return new Qt(t>>16&255,t>>8&255,t&255,1)}function _o(t,e,n,o){return o<=0&&(t=e=n=NaN),new Qt(t,e,n,o)}function H0(t){return t instanceof oo||(t=$n(t)),t?(t=t.rgb(),new Qt(t.r,t.g,t.b,t.opacity)):new Qt}function ni(t,e,n,o){return arguments.length===1?H0(t):new Qt(t,e,n,o??1)}function Qt(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}Ei(Qt,ni,uc(oo,{brighter(t){return t=t==null?qo:Math.pow(qo,t),new Qt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?qr:Math.pow(qr,t),new Qt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Qt(Xn(this.r),Xn(this.g),Xn(this.b),Fo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Es,formatHex:Es,formatHex8:q0,formatRgb:Ms,toString:Ms}));function Es(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}`}function q0(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}${Yn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ms(){const t=Fo(this.opacity);return`${t===1?"rgb(":"rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${t===1?")":`, ${t})`}`}function Fo(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Xn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Yn(t){return t=Xn(t),(t<16?"0":"")+t.toString(16)}function zs(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new dn(t,e,n,o)}function fc(t){if(t instanceof dn)return new dn(t.h,t.s,t.l,t.opacity);if(t instanceof oo||(t=$n(t)),!t)return new dn;if(t instanceof dn)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,a=Math.min(e,n,o),s=Math.max(e,n,o),i=NaN,l=s-a,u=(s+a)/2;return l?(e===s?i=(n-o)/l+(n<o)*6:n===s?i=(o-e)/l+2:i=(e-n)/l+4,l/=u<.5?s+a:2-s-a,i*=60):l=u>0&&u<1?0:i,new dn(i,l,u,t.opacity)}function F0(t,e,n,o){return arguments.length===1?fc(t):new dn(t,e,n,o??1)}function dn(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}Ei(dn,F0,uc(oo,{brighter(t){return t=t==null?qo:Math.pow(qo,t),new dn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?qr:Math.pow(qr,t),new dn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,a=2*n-o;return new Qt(Ma(t>=240?t-240:t+120,a,o),Ma(t,a,o),Ma(t<120?t+240:t-120,a,o),this.opacity)},clamp(){return new dn(Ts(this.h),yo(this.s),yo(this.l),Fo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Fo(this.opacity);return`${t===1?"hsl(":"hsla("}${Ts(this.h)}, ${yo(this.s)*100}%, ${yo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ts(t){return t=(t||0)%360,t<0?t+360:t}function yo(t){return Math.max(0,Math.min(1,t||0))}function Ma(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Mi=t=>()=>t;function K0(t,e){return function(n){return t+n*e}}function B0(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function j0(t){return(t=+t)==1?vc:function(e,n){return n-e?B0(e,n,t):Mi(isNaN(e)?n:e)}}function vc(t,e){var n=e-t;return n?K0(t,n):Mi(isNaN(t)?e:t)}const Ko=(function t(e){var n=j0(e);function o(a,s){var i=n((a=ni(a)).r,(s=ni(s)).r),l=n(a.g,s.g),u=n(a.b,s.b),f=vc(a.opacity,s.opacity);return function(v){return a.r=i(v),a.g=l(v),a.b=u(v),a.opacity=f(v),a+""}}return o.gamma=t,o})(1);function U0(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),a;return function(s){for(a=0;a<n;++a)o[a]=t[a]*(1-s)+e[a]*s;return o}}function W0(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Y0(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,a=new Array(o),s=new Array(n),i;for(i=0;i<o;++i)a[i]=Or(t[i],e[i]);for(;i<n;++i)s[i]=e[i];return function(l){for(i=0;i<o;++i)s[i]=a[i](l);return s}}function X0(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function xn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function G0(t,e){var n={},o={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?n[a]=Or(t[a],e[a]):o[a]=e[a];return function(s){for(a in n)o[a]=n[a](s);return o}}var ri=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,za=new RegExp(ri.source,"g");function $0(t){return function(){return t}}function Z0(t){return function(e){return t(e)+""}}function gc(t,e){var n=ri.lastIndex=za.lastIndex=0,o,a,s,i=-1,l=[],u=[];for(t=t+"",e=e+"";(o=ri.exec(t))&&(a=za.exec(e));)(s=a.index)>n&&(s=e.slice(n,s),l[i]?l[i]+=s:l[++i]=s),(o=o[0])===(a=a[0])?l[i]?l[i]+=a:l[++i]=a:(l[++i]=null,u.push({i,x:xn(o,a)})),n=za.lastIndex;return n<e.length&&(s=e.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?u[0]?Z0(u[0].x):$0(e):(e=u.length,function(f){for(var v=0,x;v<e;++v)l[(x=u[v]).i]=x.x(f);return l.join("")})}function Or(t,e){var n=typeof e,o;return e==null||n==="boolean"?Mi(e):(n==="number"?xn:n==="string"?(o=$n(e))?(e=o,Ko):gc:e instanceof $n?Ko:e instanceof Date?X0:W0(e)?U0:Array.isArray(e)?Y0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?G0:xn)(t,e)}var Ps=180/Math.PI,oi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pc(t,e,n,o,a,s){var i,l,u;return(i=Math.sqrt(t*t+e*e))&&(t/=i,e/=i),(u=t*n+e*o)&&(n-=t*u,o-=e*u),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,u/=l),t*o<e*n&&(t=-t,e=-e,u=-u,i=-i),{translateX:a,translateY:s,rotate:Math.atan2(e,t)*Ps,skewX:Math.atan(u)*Ps,scaleX:i,scaleY:l}}var wo;function Q0(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?oi:pc(e.a,e.b,e.c,e.d,e.e,e.f)}function J0(t){return t==null||(wo||(wo=document.createElementNS("http://www.w3.org/2000/svg","g")),wo.setAttribute("transform",t),!(t=wo.transform.baseVal.consolidate()))?oi:(t=t.matrix,pc(t.a,t.b,t.c,t.d,t.e,t.f))}function hc(t,e,n,o){function a(f){return f.length?f.pop()+" ":""}function s(f,v,x,p,w,_){if(f!==x||v!==p){var I=w.push("translate(",null,e,null,n);_.push({i:I-4,x:xn(f,x)},{i:I-2,x:xn(v,p)})}else(x||p)&&w.push("translate("+x+e+p+n)}function i(f,v,x,p){f!==v?(f-v>180?v+=360:v-f>180&&(f+=360),p.push({i:x.push(a(x)+"rotate(",null,o)-2,x:xn(f,v)})):v&&x.push(a(x)+"rotate("+v+o)}function l(f,v,x,p){f!==v?p.push({i:x.push(a(x)+"skewX(",null,o)-2,x:xn(f,v)}):v&&x.push(a(x)+"skewX("+v+o)}function u(f,v,x,p,w,_){if(f!==x||v!==p){var I=w.push(a(w)+"scale(",null,",",null,")");_.push({i:I-4,x:xn(f,x)},{i:I-2,x:xn(v,p)})}else(x!==1||p!==1)&&w.push(a(w)+"scale("+x+","+p+")")}return function(f,v){var x=[],p=[];return f=t(f),v=t(v),s(f.translateX,f.translateY,v.translateX,v.translateY,x,p),i(f.rotate,v.rotate,x,p),l(f.skewX,v.skewX,x,p),u(f.scaleX,f.scaleY,v.scaleX,v.scaleY,x,p),f=v=null,function(w){for(var _=-1,I=p.length,H;++_<I;)x[(H=p[_]).i]=H.x(w);return x.join("")}}}var e_=hc(Q0,"px, ","px)","deg)"),t_=hc(J0,", ",")",")"),n_=1e-12;function Is(t){return((t=Math.exp(t))+1/t)/2}function r_(t){return((t=Math.exp(t))-1/t)/2}function o_(t){return((t=Math.exp(2*t))-1)/(t+1)}const Lo=(function t(e,n,o){function a(s,i){var l=s[0],u=s[1],f=s[2],v=i[0],x=i[1],p=i[2],w=v-l,_=x-u,I=w*w+_*_,H,D;if(I<n_)D=Math.log(p/f)/e,H=function(de){return[l+de*w,u+de*_,f*Math.exp(e*de*D)]};else{var L=Math.sqrt(I),V=(p*p-f*f+o*I)/(2*f*n*L),q=(p*p-f*f-o*I)/(2*p*n*L),U=Math.log(Math.sqrt(V*V+1)-V),ie=Math.log(Math.sqrt(q*q+1)-q);D=(ie-U)/e,H=function(de){var ae=de*D,$=Is(U),fe=f/(n*L)*($*o_(e*ae+U)-r_(U));return[l+fe*w,u+fe*_,f*$/Is(e*ae+U)]}}return H.duration=D*1e3*e/Math.SQRT2,H}return a.rho=function(s){var i=Math.max(.001,+s),l=i*i,u=l*l;return t(i,l,u)},a})(Math.SQRT2,2,4);var mr=0,Pr=0,zr=0,xc=1e3,Bo,Ir,jo=0,Zn=0,la=0,Kr=typeof performance=="object"&&performance.now?performance:Date,bc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function zi(){return Zn||(bc(a_),Zn=Kr.now()+la)}function a_(){Zn=0}function Uo(){this._call=this._time=this._next=null}Uo.prototype=mc.prototype={constructor:Uo,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?zi():+n)+(e==null?0:+e),!this._next&&Ir!==this&&(Ir?Ir._next=this:Bo=this,Ir=this),this._call=t,this._time=n,ai()},stop:function(){this._call&&(this._call=null,this._time=1/0,ai())}};function mc(t,e,n){var o=new Uo;return o.restart(t,e,n),o}function i_(){zi(),++mr;for(var t=Bo,e;t;)(e=Zn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--mr}function As(){Zn=(jo=Kr.now())+la,mr=Pr=0;try{i_()}finally{mr=0,l_(),Zn=0}}function s_(){var t=Kr.now(),e=t-jo;e>xc&&(la-=e,jo=t)}function l_(){for(var t,e=Bo,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Bo=n);Ir=t,ai(o)}function ai(t){if(!mr){Pr&&(Pr=clearTimeout(Pr));var e=t-Zn;e>24?(t<1/0&&(Pr=setTimeout(As,t-Kr.now()-la)),zr&&(zr=clearInterval(zr))):(zr||(jo=Kr.now(),zr=setInterval(s_,xc)),mr=1,bc(As))}}function Ls(t,e,n){var o=new Uo;return e=e==null?0:+e,o.restart(a=>{o.stop(),t(a+e)},e,n),o}var c_=ia("start","end","cancel","interrupt"),d_=[],_c=0,Os=1,ii=2,Oo=3,Rs=4,si=5,Ro=6;function ca(t,e,n,o,a,s){var i=t.__transition;if(!i)t.__transition={};else if(n in i)return;u_(t,n,{name:e,index:o,group:a,on:c_,tween:d_,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:_c})}function Ti(t,e){var n=vn(t,e);if(n.state>_c)throw new Error("too late; already scheduled");return n}function yn(t,e){var n=vn(t,e);if(n.state>Oo)throw new Error("too late; already running");return n}function vn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function u_(t,e,n){var o=t.__transition,a;o[e]=n,n.timer=mc(s,0,n.time);function s(f){n.state=Os,n.timer.restart(i,n.delay,n.time),n.delay<=f&&i(f-n.delay)}function i(f){var v,x,p,w;if(n.state!==Os)return u();for(v in o)if(w=o[v],w.name===n.name){if(w.state===Oo)return Ls(i);w.state===Rs?(w.state=Ro,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete o[v]):+v<e&&(w.state=Ro,w.timer.stop(),w.on.call("cancel",t,t.__data__,w.index,w.group),delete o[v])}if(Ls(function(){n.state===Oo&&(n.state=Rs,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=ii,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ii){for(n.state=Oo,a=new Array(p=n.tween.length),v=0,x=-1;v<p;++v)(w=n.tween[v].value.call(t,t.__data__,n.index,n.group))&&(a[++x]=w);a.length=x+1}}function l(f){for(var v=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=si,1),x=-1,p=a.length;++x<p;)a[x].call(t,v);n.state===si&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=Ro,n.timer.stop(),delete o[e];for(var f in o)return;delete t.__transition}}function Do(t,e){var n=t.__transition,o,a,s=!0,i;if(n){e=e==null?null:e+"";for(i in n){if((o=n[i]).name!==e){s=!1;continue}a=o.state>ii&&o.state<si,o.state=Ro,o.timer.stop(),o.on.call(a?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[i]}s&&delete t.__transition}}function f_(t){return this.each(function(){Do(this,t)})}function v_(t,e){var n,o;return function(){var a=yn(this,t),s=a.tween;if(s!==n){o=n=s;for(var i=0,l=o.length;i<l;++i)if(o[i].name===e){o=o.slice(),o.splice(i,1);break}}a.tween=o}}function g_(t,e,n){var o,a;if(typeof n!="function")throw new Error;return function(){var s=yn(this,t),i=s.tween;if(i!==o){a=(o=i).slice();for(var l={name:e,value:n},u=0,f=a.length;u<f;++u)if(a[u].name===e){a[u]=l;break}u===f&&a.push(l)}s.tween=a}}function p_(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=vn(this.node(),n).tween,a=0,s=o.length,i;a<s;++a)if((i=o[a]).name===t)return i.value;return null}return this.each((e==null?v_:g_)(n,t,e))}function Pi(t,e,n){var o=t._id;return t.each(function(){var a=yn(this,o);(a.value||(a.value={}))[e]=n.apply(this,arguments)}),function(a){return vn(a,o).value[e]}}function yc(t,e){var n;return(typeof e=="number"?xn:e instanceof $n?Ko:(n=$n(e))?(e=n,Ko):gc)(t,e)}function h_(t){return function(){this.removeAttribute(t)}}function x_(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b_(t,e,n){var o,a=n+"",s;return function(){var i=this.getAttribute(t);return i===a?null:i===o?s:s=e(o=i,n)}}function m_(t,e,n){var o,a=n+"",s;return function(){var i=this.getAttributeNS(t.space,t.local);return i===a?null:i===o?s:s=e(o=i,n)}}function __(t,e,n){var o,a,s;return function(){var i,l=n(this),u;return l==null?void this.removeAttribute(t):(i=this.getAttribute(t),u=l+"",i===u?null:i===o&&u===a?s:(a=u,s=e(o=i,l)))}}function y_(t,e,n){var o,a,s;return function(){var i,l=n(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(i=this.getAttributeNS(t.space,t.local),u=l+"",i===u?null:i===o&&u===a?s:(a=u,s=e(o=i,l)))}}function w_(t,e){var n=sa(t),o=n==="transform"?t_:yc;return this.attrTween(t,typeof e=="function"?(n.local?y_:__)(n,o,Pi(this,"attr."+t,e)):e==null?(n.local?x_:h_)(n):(n.local?m_:b_)(n,o,e))}function k_(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function S_(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function C_(t,e){var n,o;function a(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&S_(t,s)),n}return a._value=e,a}function N_(t,e){var n,o;function a(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&k_(t,s)),n}return a._value=e,a}function E_(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=sa(t);return this.tween(n,(o.local?C_:N_)(o,e))}function M_(t,e){return function(){Ti(this,t).delay=+e.apply(this,arguments)}}function z_(t,e){return e=+e,function(){Ti(this,t).delay=e}}function T_(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?M_:z_)(e,t)):vn(this.node(),e).delay}function P_(t,e){return function(){yn(this,t).duration=+e.apply(this,arguments)}}function I_(t,e){return e=+e,function(){yn(this,t).duration=e}}function A_(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?P_:I_)(e,t)):vn(this.node(),e).duration}function L_(t,e){if(typeof e!="function")throw new Error;return function(){yn(this,t).ease=e}}function O_(t){var e=this._id;return arguments.length?this.each(L_(e,t)):vn(this.node(),e).ease}function R_(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;yn(this,t).ease=n}}function D_(t){if(typeof t!="function")throw new Error;return this.each(R_(this._id,t))}function V_(t){typeof t!="function"&&(t=Jl(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var s=e[a],i=s.length,l=o[a]=[],u,f=0;f<i;++f)(u=s[f])&&t.call(u,u.__data__,f,s)&&l.push(u);return new Tn(o,this._parents,this._name,this._id)}function H_(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,a=n.length,s=Math.min(o,a),i=new Array(o),l=0;l<s;++l)for(var u=e[l],f=n[l],v=u.length,x=i[l]=new Array(v),p,w=0;w<v;++w)(p=u[w]||f[w])&&(x[w]=p);for(;l<o;++l)i[l]=e[l];return new Tn(i,this._parents,this._name,this._id)}function q_(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function F_(t,e,n){var o,a,s=q_(e)?Ti:yn;return function(){var i=s(this,t),l=i.on;l!==o&&(a=(o=l).copy()).on(e,n),i.on=a}}function K_(t,e){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(t):this.each(F_(n,t,e))}function B_(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function j_(){return this.on("end.remove",B_(this._id))}function U_(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ci(t));for(var o=this._groups,a=o.length,s=new Array(a),i=0;i<a;++i)for(var l=o[i],u=l.length,f=s[i]=new Array(u),v,x,p=0;p<u;++p)(v=l[p])&&(x=t.call(v,v.__data__,p,l))&&("__data__"in v&&(x.__data__=v.__data__),f[p]=x,ca(f[p],e,n,p,f,vn(v,n)));return new Tn(s,this._parents,e,n)}function W_(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ql(t));for(var o=this._groups,a=o.length,s=[],i=[],l=0;l<a;++l)for(var u=o[l],f=u.length,v,x=0;x<f;++x)if(v=u[x]){for(var p=t.call(v,v.__data__,x,u),w,_=vn(v,n),I=0,H=p.length;I<H;++I)(w=p[I])&&ca(w,e,n,I,p,_);s.push(p),i.push(v)}return new Tn(s,i,e,n)}var Y_=ro.prototype.constructor;function X_(){return new Y_(this._groups,this._parents)}function G_(t,e){var n,o,a;return function(){var s=br(this,t),i=(this.style.removeProperty(t),br(this,t));return s===i?null:s===n&&i===o?a:a=e(n=s,o=i)}}function wc(t){return function(){this.style.removeProperty(t)}}function $_(t,e,n){var o,a=n+"",s;return function(){var i=br(this,t);return i===a?null:i===o?s:s=e(o=i,n)}}function Z_(t,e,n){var o,a,s;return function(){var i=br(this,t),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),br(this,t))),i===u?null:i===o&&u===a?s:(a=u,s=e(o=i,l))}}function Q_(t,e){var n,o,a,s="style."+e,i="end."+s,l;return function(){var u=yn(this,t),f=u.on,v=u.value[s]==null?l||(l=wc(e)):void 0;(f!==n||a!==v)&&(o=(n=f).copy()).on(i,a=v),u.on=o}}function J_(t,e,n){var o=(t+="")=="transform"?e_:yc;return e==null?this.styleTween(t,G_(t,o)).on("end.style."+t,wc(t)):typeof e=="function"?this.styleTween(t,Z_(t,o,Pi(this,"style."+t,e))).each(Q_(this._id,t)):this.styleTween(t,$_(t,o,e),n).on("end.style."+t,null)}function ey(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function ty(t,e,n){var o,a;function s(){var i=e.apply(this,arguments);return i!==a&&(o=(a=i)&&ey(t,i,n)),o}return s._value=e,s}function ny(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,ty(t,e,n??""))}function ry(t){return function(){this.textContent=t}}function oy(t){return function(){var e=t(this);this.textContent=e??""}}function ay(t){return this.tween("text",typeof t=="function"?oy(Pi(this,"text",t)):ry(t==null?"":t+""))}function iy(t){return function(e){this.textContent=t.call(this,e)}}function sy(t){var e,n;function o(){var a=t.apply(this,arguments);return a!==n&&(e=(n=a)&&iy(a)),e}return o._value=t,o}function ly(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,sy(t))}function cy(){for(var t=this._name,e=this._id,n=kc(),o=this._groups,a=o.length,s=0;s<a;++s)for(var i=o[s],l=i.length,u,f=0;f<l;++f)if(u=i[f]){var v=vn(u,e);ca(u,t,n,f,i,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Tn(o,this._parents,t,n)}function dy(){var t,e,n=this,o=n._id,a=n.size();return new Promise(function(s,i){var l={value:i},u={value:function(){--a===0&&s()}};n.each(function(){var f=yn(this,o),v=f.on;v!==t&&(e=(t=v).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),f.on=e}),a===0&&s()})}var uy=0;function Tn(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function kc(){return++uy}var wn=ro.prototype;Tn.prototype={constructor:Tn,select:U_,selectAll:W_,selectChild:wn.selectChild,selectChildren:wn.selectChildren,filter:V_,merge:H_,selection:X_,transition:cy,call:wn.call,nodes:wn.nodes,node:wn.node,size:wn.size,empty:wn.empty,each:wn.each,on:K_,attr:w_,attrTween:E_,style:J_,styleTween:ny,text:ay,textTween:ly,remove:j_,tween:p_,delay:T_,duration:A_,ease:O_,easeVarying:D_,end:dy,[Symbol.iterator]:wn[Symbol.iterator]};function fy(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vy={time:null,delay:0,duration:250,ease:fy};function gy(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function py(t){var e,n;t instanceof Tn?(e=t._id,t=t._name):(e=kc(),(n=vy).time=zi(),t=t==null?null:t+"");for(var o=this._groups,a=o.length,s=0;s<a;++s)for(var i=o[s],l=i.length,u,f=0;f<l;++f)(u=i[f])&&ca(u,t,e,f,i,n||gy(u,e));return new Tn(o,this._parents,t,e)}ro.prototype.interrupt=f_;ro.prototype.transition=py;const ko=t=>()=>t;function hy(t,{sourceEvent:e,target:n,transform:o,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function Nn(t,e,n){this.k=t,this.x=e,this.y=n}Nn.prototype={constructor:Nn,scale:function(t){return t===1?this:new Nn(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Nn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var da=new Nn(1,0,0);Sc.prototype=Nn.prototype;function Sc(t){for(;!t.__zoom;)if(!(t=t.parentNode))return da;return t.__zoom}function Ta(t){t.stopImmediatePropagation()}function Tr(t){t.preventDefault(),t.stopImmediatePropagation()}function xy(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function by(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Ds(){return this.__zoom||da}function my(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function _y(){return navigator.maxTouchPoints||"ontouchstart"in this}function yy(t,e,n){var o=t.invertX(e[0][0])-n[0][0],a=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],i=t.invertY(e[1][1])-n[1][1];return t.translate(a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function wy(){var t=xy,e=by,n=yy,o=my,a=_y,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Lo,f=ia("start","zoom","end"),v,x,p,w=500,_=150,I=0,H=10;function D(m){m.property("__zoom",Ds).on("wheel.zoom",ae,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",fe).filter(a).on("touchstart.zoom",O).on("touchmove.zoom",b).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}D.transform=function(m,N,C,R){var F=m.selection?m.selection():m;F.property("__zoom",Ds),m!==F?U(m,N,C,R):F.interrupt().each(function(){ie(this,arguments).event(R).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},D.scaleBy=function(m,N,C,R){D.scaleTo(m,function(){var F=this.__zoom.k,J=typeof N=="function"?N.apply(this,arguments):N;return F*J},C,R)},D.scaleTo=function(m,N,C,R){D.transform(m,function(){var F=e.apply(this,arguments),J=this.__zoom,A=C==null?q(F):typeof C=="function"?C.apply(this,arguments):C,y=J.invert(A),S=typeof N=="function"?N.apply(this,arguments):N;return n(V(L(J,S),A,y),F,i)},C,R)},D.translateBy=function(m,N,C,R){D.transform(m,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof C=="function"?C.apply(this,arguments):C),e.apply(this,arguments),i)},null,R)},D.translateTo=function(m,N,C,R,F){D.transform(m,function(){var J=e.apply(this,arguments),A=this.__zoom,y=R==null?q(J):typeof R=="function"?R.apply(this,arguments):R;return n(da.translate(y[0],y[1]).scale(A.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof C=="function"?-C.apply(this,arguments):-C),J,i)},R,F)};function L(m,N){return N=Math.max(s[0],Math.min(s[1],N)),N===m.k?m:new Nn(N,m.x,m.y)}function V(m,N,C){var R=N[0]-C[0]*m.k,F=N[1]-C[1]*m.k;return R===m.x&&F===m.y?m:new Nn(m.k,R,F)}function q(m){return[(+m[0][0]+ +m[1][0])/2,(+m[0][1]+ +m[1][1])/2]}function U(m,N,C,R){m.on("start.zoom",function(){ie(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){ie(this,arguments).event(R).end()}).tween("zoom",function(){var F=this,J=arguments,A=ie(F,J).event(R),y=e.apply(F,J),S=C==null?q(y):typeof C=="function"?C.apply(F,J):C,z=Math.max(y[1][0]-y[0][0],y[1][1]-y[0][1]),W=F.__zoom,oe=typeof N=="function"?N.apply(F,J):N,Z=u(W.invert(S).concat(z/W.k),oe.invert(S).concat(z/oe.k));return function(Y){if(Y===1)Y=oe;else{var Q=Z(Y),ee=z/Q[2];Y=new Nn(ee,S[0]-Q[0]*ee,S[1]-Q[1]*ee)}A.zoom(null,Y)}})}function ie(m,N,C){return!C&&m.__zooming||new de(m,N)}function de(m,N){this.that=m,this.args=N,this.active=0,this.sourceEvent=null,this.extent=e.apply(m,N),this.taps=0}de.prototype={event:function(m){return m&&(this.sourceEvent=m),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(m,N){return this.mouse&&m!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var N=cn(this.that).datum();f.call(m,this.that,new hy(m,{sourceEvent:this.sourceEvent,target:D,transform:this.that.__zoom,dispatch:f}),N)}};function ae(m,...N){if(!t.apply(this,arguments))return;var C=ie(this,N).event(m),R=this.__zoom,F=Math.max(s[0],Math.min(s[1],R.k*Math.pow(2,o.apply(this,arguments)))),J=hn(m);if(C.wheel)(C.mouse[0][0]!==J[0]||C.mouse[0][1]!==J[1])&&(C.mouse[1]=R.invert(C.mouse[0]=J)),clearTimeout(C.wheel);else{if(R.k===F)return;C.mouse=[J,R.invert(J)],Do(this),C.start()}Tr(m),C.wheel=setTimeout(A,_),C.zoom("mouse",n(V(L(R,F),C.mouse[0],C.mouse[1]),C.extent,i));function A(){C.wheel=null,C.end()}}function $(m,...N){if(p||!t.apply(this,arguments))return;var C=m.currentTarget,R=ie(this,N,!0).event(m),F=cn(m.view).on("mousemove.zoom",S,!0).on("mouseup.zoom",z,!0),J=hn(m,C),A=m.clientX,y=m.clientY;cc(m.view),Ta(m),R.mouse=[J,this.__zoom.invert(J)],Do(this),R.start();function S(W){if(Tr(W),!R.moved){var oe=W.clientX-A,Z=W.clientY-y;R.moved=oe*oe+Z*Z>I}R.event(W).zoom("mouse",n(V(R.that.__zoom,R.mouse[0]=hn(W,C),R.mouse[1]),R.extent,i))}function z(W){F.on("mousemove.zoom mouseup.zoom",null),dc(W.view,R.moved),Tr(W),R.event(W).end()}}function fe(m,...N){if(t.apply(this,arguments)){var C=this.__zoom,R=hn(m.changedTouches?m.changedTouches[0]:m,this),F=C.invert(R),J=C.k*(m.shiftKey?.5:2),A=n(V(L(C,J),R,F),e.apply(this,N),i);Tr(m),l>0?cn(this).transition().duration(l).call(U,A,R,m):cn(this).call(D.transform,A,R,m)}}function O(m,...N){if(t.apply(this,arguments)){var C=m.touches,R=C.length,F=ie(this,N,m.changedTouches.length===R).event(m),J,A,y,S;for(Ta(m),A=0;A<R;++A)y=C[A],S=hn(y,this),S=[S,this.__zoom.invert(S),y.identifier],F.touch0?!F.touch1&&F.touch0[2]!==S[2]&&(F.touch1=S,F.taps=0):(F.touch0=S,J=!0,F.taps=1+!!v);v&&(v=clearTimeout(v)),J&&(F.taps<2&&(x=S[0],v=setTimeout(function(){v=null},w)),Do(this),F.start())}}function b(m,...N){if(this.__zooming){var C=ie(this,N).event(m),R=m.changedTouches,F=R.length,J,A,y,S;for(Tr(m),J=0;J<F;++J)A=R[J],y=hn(A,this),C.touch0&&C.touch0[2]===A.identifier?C.touch0[0]=y:C.touch1&&C.touch1[2]===A.identifier&&(C.touch1[0]=y);if(A=C.that.__zoom,C.touch1){var z=C.touch0[0],W=C.touch0[1],oe=C.touch1[0],Z=C.touch1[1],Y=(Y=oe[0]-z[0])*Y+(Y=oe[1]-z[1])*Y,Q=(Q=Z[0]-W[0])*Q+(Q=Z[1]-W[1])*Q;A=L(A,Math.sqrt(Y/Q)),y=[(z[0]+oe[0])/2,(z[1]+oe[1])/2],S=[(W[0]+Z[0])/2,(W[1]+Z[1])/2]}else if(C.touch0)y=C.touch0[0],S=C.touch0[1];else return;C.zoom("touch",n(V(A,y,S),C.extent,i))}}function M(m,...N){if(this.__zooming){var C=ie(this,N).event(m),R=m.changedTouches,F=R.length,J,A;for(Ta(m),p&&clearTimeout(p),p=setTimeout(function(){p=null},w),J=0;J<F;++J)A=R[J],C.touch0&&C.touch0[2]===A.identifier?delete C.touch0:C.touch1&&C.touch1[2]===A.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(A=hn(A,this),Math.hypot(x[0]-A[0],x[1]-A[1])<H)){var y=cn(this).on("dblclick.zoom");y&&y.apply(this,arguments)}}}return D.wheelDelta=function(m){return arguments.length?(o=typeof m=="function"?m:ko(+m),D):o},D.filter=function(m){return arguments.length?(t=typeof m=="function"?m:ko(!!m),D):t},D.touchable=function(m){return arguments.length?(a=typeof m=="function"?m:ko(!!m),D):a},D.extent=function(m){return arguments.length?(e=typeof m=="function"?m:ko([[+m[0][0],+m[0][1]],[+m[1][0],+m[1][1]]]),D):e},D.scaleExtent=function(m){return arguments.length?(s[0]=+m[0],s[1]=+m[1],D):[s[0],s[1]]},D.translateExtent=function(m){return arguments.length?(i[0][0]=+m[0][0],i[1][0]=+m[1][0],i[0][1]=+m[0][1],i[1][1]=+m[1][1],D):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},D.constrain=function(m){return arguments.length?(n=m,D):n},D.duration=function(m){return arguments.length?(l=+m,D):l},D.interpolate=function(m){return arguments.length?(u=m,D):u},D.on=function(){var m=f.on.apply(f,arguments);return m===f?D:m},D.clickDistance=function(m){return arguments.length?(I=(m=+m)*m,D):Math.sqrt(I)},D.tapDistance=function(m){return arguments.length?(H=+m,D):H},D}const Br={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:o}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},li=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Cc=["Enter"," ","Escape"],ky={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var _r;(function(t){t.Strict="strict",t.Loose="loose"})(_r||(_r={}));var gr;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(gr||(gr={}));var Wo;(function(t){t.Partial="partial",t.Full="full"})(Wo||(Wo={}));const ci={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ln;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Ln||(Ln={}));var Yo;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Yo||(Yo={}));var ft;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(ft||(ft={}));const Vs={[ft.Left]:ft.Right,[ft.Right]:ft.Left,[ft.Top]:ft.Bottom,[ft.Bottom]:ft.Top};function Sy(t,e){if(!t&&!e)return!0;if(!t||!e||t.size!==e.size)return!1;if(!t.size&&!e.size)return!0;for(const n of t.keys())if(!e.has(n))return!1;return!0}function Hs(t,e,n){if(!n)return;const o=[];t.forEach((a,s)=>{e!=null&&e.has(s)||o.push(a)}),o.length&&n(o)}function Cy(t){return t===null?null:t?"valid":"invalid"}const Nc=t=>"id"in t&&"source"in t&&"target"in t,Ny=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Ii=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),ao=(t,e=[0,0])=>{const{width:n,height:o}=nr(t),a=t.origin??e,s=n*a[0],i=o*a[1];return{x:t.position.x-s,y:t.position.y-i}},Ey=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,a)=>{const s=typeof a=="string";let i=!e.nodeLookup&&!s?a:void 0;e.nodeLookup&&(i=s?e.nodeLookup.get(a):Ii(a)?a:e.nodeLookup.get(a.id));const l=i?Xo(i,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return fa(o,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return va(n)},ua=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(a=>{(e.filter===void 0||e.filter(a))&&(n=fa(n,Xo(a)),o=!0)}),o?va(n):{x:0,y:0,width:0,height:0}},Ai=(t,e,[n,o,a]=[0,0,1],s=!1,i=!1)=>{const l={...so(e,[n,o,a]),width:e.width/a,height:e.height/a},u=[];for(const f of t.values()){const{measured:v,selectable:x=!0,hidden:p=!1}=f;if(i&&!x||p)continue;const w=v.width??f.width??f.initialWidth??null,_=v.height??f.height??f.initialHeight??null,I=jr(l,wr(f)),H=(w??0)*(_??0),D=s&&I>0;(!f.internals.handleBounds||D||I>=H||f.dragging)&&u.push(f)}return u},My=(t,e)=>{const n=new Set;return t.forEach(o=>{n.add(o.id)}),e.filter(o=>n.has(o.source)||n.has(o.target))};function zy(t,e){const n=new Map,o=e!=null&&e.nodes?new Set(e.nodes.map(a=>a.id)):null;return t.forEach(a=>{a.measured.width&&a.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!a.hidden)&&(!o||o.has(a.id))&&n.set(a.id,a)}),n}async function Ty({nodes:t,width:e,height:n,panZoom:o,minZoom:a,maxZoom:s},i){if(t.size===0)return Promise.resolve(!0);const l=zy(t,i),u=ua(l),f=Li(u,e,n,(i==null?void 0:i.minZoom)??a,(i==null?void 0:i.maxZoom)??s,(i==null?void 0:i.padding)??.1);return await o.setViewport(f,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function Ec({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:a,onError:s}){const i=n.get(t),l=i.parentId?n.get(i.parentId):void 0,{x:u,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},v=i.origin??o;let x=i.extent||a;if(i.extent==="parent"&&!i.expandParent)if(!l)s==null||s("005",Br.error005());else{const w=l.measured.width,_=l.measured.height;w&&_&&(x=[[u,f],[u+w,f+_]])}else l&&kr(i.extent)&&(x=[[i.extent[0][0]+u,i.extent[0][1]+f],[i.extent[1][0]+u,i.extent[1][1]+f]]);const p=kr(x)?Qn(e,x,i.measured):e;return(i.measured.width===void 0||i.measured.height===void 0)&&(s==null||s("015",Br.error015())),{position:{x:p.x-u+(i.measured.width??0)*v[0],y:p.y-f+(i.measured.height??0)*v[1]},positionAbsolute:p}}async function Py({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:a}){const s=new Set(t.map(p=>p.id)),i=[];for(const p of n){if(p.deletable===!1)continue;const w=s.has(p.id),_=!w&&p.parentId&&i.find(I=>I.id===p.parentId);(w||_)&&i.push(p)}const l=new Set(e.map(p=>p.id)),u=o.filter(p=>p.deletable!==!1),v=My(i,u);for(const p of u)l.has(p.id)&&!v.find(_=>_.id===p.id)&&v.push(p);if(!a)return{edges:v,nodes:i};const x=await a({nodes:i,edges:v});return typeof x=="boolean"?x?{edges:v,nodes:i}:{edges:[],nodes:[]}:x}const yr=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Qn=(t={x:0,y:0},e,n)=>({x:yr(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:yr(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function Mc(t,e,n){const{width:o,height:a}=nr(n),{x:s,y:i}=n.internals.positionAbsolute;return Qn(t,[[s,i],[s+o,i+a]],e)}const qs=(t,e,n)=>t<e?yr(Math.abs(t-e),1,e)/e:t>n?-yr(Math.abs(t-n),1,e)/e:0,zc=(t,e,n=15,o=40)=>{const a=qs(t.x,o,e.width-o)*n,s=qs(t.y,o,e.height-o)*n;return[a,s]},fa=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),di=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),va=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),wr=(t,e=[0,0])=>{var a,s;const{x:n,y:o}=Ii(t)?t.internals.positionAbsolute:ao(t,e);return{x:n,y:o,width:((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},Xo=(t,e=[0,0])=>{var a,s;const{x:n,y:o}=Ii(t)?t.internals.positionAbsolute:ao(t,e);return{x:n,y:o,x2:n+(((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0),y2:o+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},Iy=(t,e)=>va(fa(di(t),di(e))),jr=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},Fs=t=>En(t.width)&&En(t.height)&&En(t.x)&&En(t.y),En=t=>!isNaN(t)&&isFinite(t),Ay=(t,e)=>{},io=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),so=({x:t,y:e},[n,o,a],s=!1,i=[1,1])=>{const l={x:(t-n)/a,y:(e-o)/a};return s?io(l,i):l},Go=({x:t,y:e},[n,o,a])=>({x:t*a+n,y:e*a+o});function lr(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ly(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=lr(t,n),a=lr(t,e);return{top:o,right:a,bottom:o,left:a,x:a*2,y:o*2}}if(typeof t=="object"){const o=lr(t.top??t.y??0,n),a=lr(t.bottom??t.y??0,n),s=lr(t.left??t.x??0,e),i=lr(t.right??t.x??0,e);return{top:o,right:i,bottom:a,left:s,x:s+i,y:o+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Oy(t,e,n,o,a,s){const{x:i,y:l}=Go(t,[e,n,o]),{x:u,y:f}=Go({x:t.x+t.width,y:t.y+t.height},[e,n,o]),v=a-u,x=s-f;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(v),bottom:Math.floor(x)}}const Li=(t,e,n,o,a,s)=>{const i=Ly(s,e,n),l=(e-i.x)/t.width,u=(n-i.y)/t.height,f=Math.min(l,u),v=yr(f,o,a),x=t.x+t.width/2,p=t.y+t.height/2,w=e/2-x*v,_=n/2-p*v,I=Oy(t,w,_,v,e,n),H={left:Math.min(I.left-i.left,0),top:Math.min(I.top-i.top,0),right:Math.min(I.right-i.right,0),bottom:Math.min(I.bottom-i.bottom,0)};return{x:w-H.left+H.right,y:_-H.top+H.bottom,zoom:v}},$o=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function kr(t){return t!=null&&t!=="parent"}function nr(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function Ry(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function Dy(t,e={width:0,height:0},n,o,a){const s={...t},i=o.get(n);if(i){const l=i.origin||a;s.x+=i.internals.positionAbsolute.x-(e.width??0)*l[0],s.y+=i.internals.positionAbsolute.y-(e.height??0)*l[1]}return s}function Vy(t){return{...ky,...t||{}}}function Pa(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:a}){const{x:s,y:i}=fn(t),l=so({x:s-((a==null?void 0:a.left)??0),y:i-((a==null?void 0:a.top)??0)},o),{x:u,y:f}=n?io(l,e):l;return{xSnapped:u,ySnapped:f,...l}}const Tc=t=>({width:t.offsetWidth,height:t.offsetHeight}),Pc=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Hy=["INPUT","SELECT","TEXTAREA"];function Ic(t){var o,a;const e=((a=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:a[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:Hy.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Ac=t=>"clientX"in t,fn=(t,e)=>{var s,i;const n=Ac(t),o=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,a=n?t.clientY:(i=t.touches)==null?void 0:i[0].clientY;return{x:o-((e==null?void 0:e.left)??0),y:a-((e==null?void 0:e.top)??0)}},Ks=(t,e,n,o,a)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:t,nodeId:a,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...Tc(i)}})};function qy({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:a,sourceControlY:s,targetControlX:i,targetControlY:l}){const u=t*.125+a*.375+i*.375+n*.125,f=e*.125+s*.375+l*.375+o*.125,v=Math.abs(u-t),x=Math.abs(f-e);return[u,f,v,x]}function So(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function Bs({pos:t,x1:e,y1:n,x2:o,y2:a,c:s}){switch(t){case ft.Left:return[e-So(e-o,s),n];case ft.Right:return[e+So(o-e,s),n];case ft.Top:return[e,n-So(n-a,s)];case ft.Bottom:return[e,n+So(a-n,s)]}}function Lc({sourceX:t,sourceY:e,sourcePosition:n=ft.Bottom,targetX:o,targetY:a,targetPosition:s=ft.Top,curvature:i=.25}){const[l,u]=Bs({pos:n,x1:t,y1:e,x2:o,y2:a,c:i}),[f,v]=Bs({pos:s,x1:o,y1:a,x2:t,y2:e,c:i}),[x,p,w,_]=qy({sourceX:t,sourceY:e,targetX:o,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:f,targetControlY:v});return[`M${t},${e} C${l},${u} ${f},${v} ${o},${a}`,x,p,w,_]}function Oc({sourceX:t,sourceY:e,targetX:n,targetY:o}){const a=Math.abs(n-t)/2,s=n<t?n+a:n-a,i=Math.abs(o-e)/2,l=o<e?o+i:o-i;return[s,l,a,i]}function Fy({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:a=!1,zIndexMode:s="basic"}){if(s==="manual")return o;const i=a&&n?o+1e3:o,l=Math.max(t.parentId||a&&t.selected?t.internals.z:0,e.parentId||a&&e.selected?e.internals.z:0);return i+l}function Ky({sourceNode:t,targetNode:e,width:n,height:o,transform:a}){const s=fa(Xo(t),Xo(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const i={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:o/a[2]};return jr(i,va(s))>0}const By=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,jy=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),Uy=(t,e,n={})=>{if(!t.source||!t.target)return e;const o=n.getEdgeId||By;let a;return Nc(t)?a={...t}:a={...t,id:o(t)},jy(a,e)?e:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,e.concat(a))};function Rc({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[a,s,i,l]=Oc({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,a,s,i,l]}const js={[ft.Left]:{x:-1,y:0},[ft.Right]:{x:1,y:0},[ft.Top]:{x:0,y:-1},[ft.Bottom]:{x:0,y:1}},Wy=({source:t,sourcePosition:e=ft.Bottom,target:n})=>e===ft.Left||e===ft.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},Us=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function Yy({source:t,sourcePosition:e=ft.Bottom,target:n,targetPosition:o=ft.Top,center:a,offset:s,stepPosition:i}){const l=js[e],u=js[o],f={x:t.x+l.x*s,y:t.y+l.y*s},v={x:n.x+u.x*s,y:n.y+u.y*s},x=Wy({source:f,sourcePosition:e,target:v}),p=x.x!==0?"x":"y",w=x[p];let _=[],I,H;const D={x:0,y:0},L={x:0,y:0},[,,V,q]=Oc({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(l[p]*u[p]===-1){p==="x"?(I=a.x??f.x+(v.x-f.x)*i,H=a.y??(f.y+v.y)/2):(I=a.x??(f.x+v.x)/2,H=a.y??f.y+(v.y-f.y)*i);const ae=[{x:I,y:f.y},{x:I,y:v.y}],$=[{x:f.x,y:H},{x:v.x,y:H}];l[p]===w?_=p==="x"?ae:$:_=p==="x"?$:ae}else{const ae=[{x:f.x,y:v.y}],$=[{x:v.x,y:f.y}];if(p==="x"?_=l.x===w?$:ae:_=l.y===w?ae:$,e===o){const m=Math.abs(t[p]-n[p]);if(m<=s){const N=Math.min(s-1,s-m);l[p]===w?D[p]=(f[p]>t[p]?-1:1)*N:L[p]=(v[p]>n[p]?-1:1)*N}}if(e!==o){const m=p==="x"?"y":"x",N=l[p]===u[m],C=f[m]>v[m],R=f[m]<v[m];(l[p]===1&&(!N&&C||N&&R)||l[p]!==1&&(!N&&R||N&&C))&&(_=p==="x"?ae:$)}const fe={x:f.x+D.x,y:f.y+D.y},O={x:v.x+L.x,y:v.y+L.y},b=Math.max(Math.abs(fe.x-_[0].x),Math.abs(O.x-_[0].x)),M=Math.max(Math.abs(fe.y-_[0].y),Math.abs(O.y-_[0].y));b>=M?(I=(fe.x+O.x)/2,H=_[0].y):(I=_[0].x,H=(fe.y+O.y)/2)}const U={x:f.x+D.x,y:f.y+D.y},ie={x:v.x+L.x,y:v.y+L.y};return[[t,...U.x!==_[0].x||U.y!==_[0].y?[U]:[],..._,...ie.x!==_[_.length-1].x||ie.y!==_[_.length-1].y?[ie]:[],n],I,H,V,q]}function Xy(t,e,n,o){const a=Math.min(Us(t,e)/2,Us(e,n)/2,o),{x:s,y:i}=e;if(t.x===s&&s===n.x||t.y===i&&i===n.y)return`L${s} ${i}`;if(t.y===i){const f=t.x<n.x?-1:1,v=t.y<n.y?1:-1;return`L ${s+a*f},${i}Q ${s},${i} ${s},${i+a*v}`}const l=t.x<n.x?1:-1,u=t.y<n.y?-1:1;return`L ${s},${i+a*u}Q ${s},${i} ${s+a*l},${i}`}function Oi({sourceX:t,sourceY:e,sourcePosition:n=ft.Bottom,targetX:o,targetY:a,targetPosition:s=ft.Top,borderRadius:i=5,centerX:l,centerY:u,offset:f=20,stepPosition:v=.5}){const[x,p,w,_,I]=Yy({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:a},targetPosition:s,center:{x:l,y:u},offset:f,stepPosition:v});let H=`M${x[0].x} ${x[0].y}`;for(let D=1;D<x.length-1;D++)H+=Xy(x[D-1],x[D],x[D+1],i);return H+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[H,p,w,_,I]}function Ws(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Gy(t){var x;const{sourceNode:e,targetNode:n}=t;if(!Ws(e)||!Ws(n))return null;const o=e.internals.handleBounds||Ys(e.handles),a=n.internals.handleBounds||Ys(n.handles),s=Xs((o==null?void 0:o.source)??[],t.sourceHandle),i=Xs(t.connectionMode===_r.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),t.targetHandle);if(!s||!i)return(x=t.onError)==null||x.call(t,"008",Br.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const l=(s==null?void 0:s.position)||ft.Bottom,u=(i==null?void 0:i.position)||ft.Top,f=Jn(e,s,l),v=Jn(n,i,u);return{sourceX:f.x,sourceY:f.y,targetX:v.x,targetY:v.y,sourcePosition:l,targetPosition:u}}function Ys(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,o.type==="source"?e.push(o):o.type==="target"&&n.push(o);return{source:e,target:n}}function Jn(t,e,n=ft.Left,o=!1){const a=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:i,height:l}=e??nr(t);if(o)return{x:a+i/2,y:s+l/2};switch((e==null?void 0:e.position)??n){case ft.Top:return{x:a+i/2,y:s};case ft.Right:return{x:a+i,y:s+l/2};case ft.Bottom:return{x:a+i/2,y:s+l};case ft.Left:return{x:a,y:s+l/2}}}function Xs(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function ui(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function $y(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:a}){const s=new Set;return t.reduce((i,l)=>([l.markerStart||o,l.markerEnd||a].forEach(u=>{if(u&&typeof u=="object"){const f=ui(u,e);s.has(f)||(i.push({id:f,color:u.color||n,...u}),s.add(f))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const Dc=1e3,Zy=10,Ri={nodeOrigin:[0,0],nodeExtent:li,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Qy={...Ri,checkEquality:!0};function Di(t,e){const n={...t};for(const o in e)e[o]!==void 0&&(n[o]=e[o]);return n}function Jy(t,e,n){const o=Di(Ri,n);for(const a of t.values())if(a.parentId)Hi(a,t,e,o);else{const s=ao(a,o.nodeOrigin),i=kr(a.extent)?a.extent:o.nodeExtent,l=Qn(s,i,nr(a));a.internals.positionAbsolute=l}}function e2(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],o=[];for(const a of t.handles){const s={id:a.id,width:a.width??1,height:a.height??1,nodeId:t.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(s):a.type==="target"&&o.push(s)}return{source:n,target:o}}function Vi(t){return t==="manual"}function t2(t,e,n,o={}){var v,x;const a=Di(Qy,o),s={i:0},i=new Map(e),l=a!=null&&a.elevateNodesOnSelect&&!Vi(a.zIndexMode)?Dc:0;let u=t.length>0,f=!1;e.clear(),n.clear();for(const p of t){let w=i.get(p.id);if(a.checkEquality&&p===(w==null?void 0:w.internals.userNode))e.set(p.id,w);else{const _=ao(p,a.nodeOrigin),I=kr(p.extent)?p.extent:a.nodeExtent,H=Qn(_,I,nr(p));w={...a.defaults,...p,measured:{width:(v=p.measured)==null?void 0:v.width,height:(x=p.measured)==null?void 0:x.height},internals:{positionAbsolute:H,handleBounds:e2(p,w),z:Vc(p,l,a.zIndexMode),userNode:p}},e.set(p.id,w)}(w.measured===void 0||w.measured.width===void 0||w.measured.height===void 0)&&!w.hidden&&(u=!1),p.parentId&&Hi(w,e,n,o,s),f||(f=p.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:f}}function n2(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Hi(t,e,n,o,a){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:l,zIndexMode:u}=Di(Ri,o),f=t.parentId,v=e.get(f);if(!v){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}n2(t,n),a&&!v.parentId&&v.internals.rootParentIndex===void 0&&u==="auto"&&(v.internals.rootParentIndex=++a.i,v.internals.z=v.internals.z+a.i*Zy),a&&v.internals.rootParentIndex!==void 0&&(a.i=v.internals.rootParentIndex);const x=s&&!Vi(u)?Dc:0,{x:p,y:w,z:_}=r2(t,v,i,l,x,u),{positionAbsolute:I}=t.internals,H=p!==I.x||w!==I.y;(H||_!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:H?{x:p,y:w}:I,z:_}})}function Vc(t,e,n){const o=En(t.zIndex)?t.zIndex:0;return Vi(n)?o:o+(t.selected?e:0)}function r2(t,e,n,o,a,s){const{x:i,y:l}=e.internals.positionAbsolute,u=nr(t),f=ao(t,n),v=kr(t.extent)?Qn(f,t.extent,u):f;let x=Qn({x:i+v.x,y:l+v.y},o,u);t.extent==="parent"&&(x=Mc(x,u,e));const p=Vc(t,a,s),w=e.internals.z??0;return{x:x.x,y:x.y,z:w>=p?w+1:p}}function o2(t,e,n,o=[0,0]){var i;const a=[],s=new Map;for(const l of t){const u=e.get(l.parentId);if(!u)continue;const f=((i=s.get(l.parentId))==null?void 0:i.expandedRect)??wr(u),v=Iy(f,l.rect);s.set(l.parentId,{expandedRect:v,parent:u})}return s.size>0&&s.forEach(({expandedRect:l,parent:u},f)=>{var V;const v=u.internals.positionAbsolute,x=nr(u),p=u.origin??o,w=l.x<v.x?Math.round(Math.abs(v.x-l.x)):0,_=l.y<v.y?Math.round(Math.abs(v.y-l.y)):0,I=Math.max(x.width,Math.round(l.width)),H=Math.max(x.height,Math.round(l.height)),D=(I-x.width)*p[0],L=(H-x.height)*p[1];(w>0||_>0||D||L)&&(a.push({id:f,type:"position",position:{x:u.position.x-w+D,y:u.position.y-_+L}}),(V=n.get(f))==null||V.forEach(q=>{t.some(U=>U.id===q.id)||a.push({id:q.id,type:"position",position:{x:q.position.x+w,y:q.position.y+_}})})),(x.width<l.width||x.height<l.height||w||_)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:I+(w?p[0]*w-D:0),height:H+(_?p[1]*_-L:0)}})}),a}function a2(t,e,n,o,a,s,i){const l=o==null?void 0:o.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const f=[],v=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(v.transform),p=[];for(const w of t.values()){const _=e.get(w.id);if(!_)continue;if(_.hidden){e.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),u=!0;continue}const I=Tc(w.nodeElement),H=_.measured.width!==I.width||_.measured.height!==I.height;if(!!(I.width&&I.height&&(H||!_.internals.handleBounds||w.force))){const L=w.nodeElement.getBoundingClientRect(),V=kr(_.extent)?_.extent:s;let{positionAbsolute:q}=_.internals;_.parentId&&_.extent==="parent"?q=Mc(q,I,e.get(_.parentId)):V&&(q=Qn(q,V,I));const U={..._,measured:I,internals:{..._.internals,positionAbsolute:q,handleBounds:{source:Ks("source",w.nodeElement,L,x,_.id),target:Ks("target",w.nodeElement,L,x,_.id)}}};e.set(_.id,U),_.parentId&&Hi(U,e,n,{nodeOrigin:a,zIndexMode:i}),u=!0,H&&(f.push({id:_.id,type:"dimensions",dimensions:I}),_.expandParent&&_.parentId&&p.push({id:_.id,parentId:_.parentId,rect:wr(U,a)}))}}if(p.length>0){const w=o2(p,e,n,a);f.push(...w)}return{changes:f,updatedInternals:u}}async function i2({delta:t,panZoom:e,transform:n,translateExtent:o,width:a,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const i=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[a,s]],o),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function Gs(t,e,n,o,a,s){let i=a;const l=o.get(i)||new Map;o.set(i,l.set(n,e)),i=`${a}-${t}`;const u=o.get(i)||new Map;if(o.set(i,u.set(n,e)),s){i=`${a}-${t}-${s}`;const f=o.get(i)||new Map;o.set(i,f.set(n,e))}}function s2(t,e,n){t.clear(),e.clear();for(const o of n){const{source:a,target:s,sourceHandle:i=null,targetHandle:l=null}=o,u={edgeId:o.id,source:a,target:s,sourceHandle:i,targetHandle:l},f=`${a}-${i}--${s}-${l}`,v=`${s}-${l}--${a}-${i}`;Gs("source",u,v,t,a,i),Gs("target",u,f,t,s,l),e.set(o.id,o)}}function Hc(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:Hc(n,e):!1}function $s(t,e,n){var a;let o=t;do{if((a=o==null?void 0:o.matches)!=null&&a.call(o,e))return!0;if(o===n)return!1;o=o==null?void 0:o.parentElement}while(o);return!1}function l2(t,e,n,o){const a=new Map;for(const[s,i]of t)if((i.selected||i.id===o)&&(!i.parentId||!Hc(i,t))&&(i.draggable||e&&typeof i.draggable>"u")){const l=t.get(s);l&&a.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return a}function Ia({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){var i,l,u;const a=[];for(const[f,v]of e){const x=(i=n.get(f))==null?void 0:i.internals.userNode;x&&a.push({...x,position:v.position,dragging:o})}if(!t)return[a[0],a];const s=(l=n.get(t))==null?void 0:l.internals.userNode;return[s?{...s,position:((u=e.get(t))==null?void 0:u.position)||s.position,dragging:o}:a[0],a]}function c2({dragItems:t,snapGrid:e,x:n,y:o}){const a=t.values().next().value;if(!a)return null;const s={x:n-a.distance.x,y:o-a.distance.y},i=io(s,e);return{x:i.x-s.x,y:i.y-s.y}}function d2({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:a}){let s={x:null,y:null},i=0,l=new Map,u=!1,f={x:0,y:0},v=null,x=!1,p=null,w=!1,_=!1,I=null;function H({noDragClassName:L,handleSelector:V,domNode:q,isSelectable:U,nodeId:ie,nodeClickDistance:de=0}){p=cn(q);function ae({x:b,y:M}){const{nodeLookup:m,nodeExtent:N,snapGrid:C,snapToGrid:R,nodeOrigin:F,onNodeDrag:J,onSelectionDrag:A,onError:y,updateNodePositions:S}=e();s={x:b,y:M};let z=!1;const W=l.size>1,oe=W&&N?di(ua(l)):null,Z=W&&R?c2({dragItems:l,snapGrid:C,x:b,y:M}):null;for(const[Y,Q]of l){if(!m.has(Y))continue;let ee={x:b-Q.distance.x,y:M-Q.distance.y};R&&(ee=Z?{x:Math.round(ee.x+Z.x),y:Math.round(ee.y+Z.y)}:io(ee,C));let se=null;if(W&&N&&!Q.extent&&oe){const{positionAbsolute:ne}=Q.internals,re=ne.x-oe.x+N[0][0],te=ne.x+Q.measured.width-oe.x2+N[1][0],pe=ne.y-oe.y+N[0][1],me=ne.y+Q.measured.height-oe.y2+N[1][1];se=[[re,pe],[te,me]]}const{position:B,positionAbsolute:K}=Ec({nodeId:Y,nextPosition:ee,nodeLookup:m,nodeExtent:se||N,nodeOrigin:F,onError:y});z=z||Q.position.x!==B.x||Q.position.y!==B.y,Q.position=B,Q.internals.positionAbsolute=K}if(_=_||z,!!z&&(S(l,!0),I&&(o||J||!ie&&A))){const[Y,Q]=Ia({nodeId:ie,dragItems:l,nodeLookup:m});o==null||o(I,l,Y,Q),J==null||J(I,Y,Q),ie||A==null||A(I,Q)}}async function $(){if(!v)return;const{transform:b,panBy:M,autoPanSpeed:m,autoPanOnNodeDrag:N}=e();if(!N){u=!1,cancelAnimationFrame(i);return}const[C,R]=zc(f,v,m);(C!==0||R!==0)&&(s.x=(s.x??0)-C/b[2],s.y=(s.y??0)-R/b[2],await M({x:C,y:R})&&ae(s)),i=requestAnimationFrame($)}function fe(b){var W;const{nodeLookup:M,multiSelectionActive:m,nodesDraggable:N,transform:C,snapGrid:R,snapToGrid:F,selectNodesOnDrag:J,onNodeDragStart:A,onSelectionDragStart:y,unselectNodesAndEdges:S}=e();x=!0,(!J||!U)&&!m&&ie&&((W=M.get(ie))!=null&&W.selected||S()),U&&J&&ie&&(t==null||t(ie));const z=Pa(b.sourceEvent,{transform:C,snapGrid:R,snapToGrid:F,containerBounds:v});if(s=z,l=l2(M,N,z,ie),l.size>0&&(n||A||!ie&&y)){const[oe,Z]=Ia({nodeId:ie,dragItems:l,nodeLookup:M});n==null||n(b.sourceEvent,l,oe,Z),A==null||A(b.sourceEvent,oe,Z),ie||y==null||y(b.sourceEvent,Z)}}const O=z0().clickDistance(de).on("start",b=>{const{domNode:M,nodeDragThreshold:m,transform:N,snapGrid:C,snapToGrid:R}=e();v=(M==null?void 0:M.getBoundingClientRect())||null,w=!1,_=!1,I=b.sourceEvent,m===0&&fe(b),s=Pa(b.sourceEvent,{transform:N,snapGrid:C,snapToGrid:R,containerBounds:v}),f=fn(b.sourceEvent,v)}).on("drag",b=>{const{autoPanOnNodeDrag:M,transform:m,snapGrid:N,snapToGrid:C,nodeDragThreshold:R,nodeLookup:F}=e(),J=Pa(b.sourceEvent,{transform:m,snapGrid:N,snapToGrid:C,containerBounds:v});if(I=b.sourceEvent,(b.sourceEvent.type==="touchmove"&&b.sourceEvent.touches.length>1||ie&&!F.has(ie))&&(w=!0),!w){if(!u&&M&&x&&(u=!0,$()),!x){const A=fn(b.sourceEvent,v),y=A.x-f.x,S=A.y-f.y;Math.sqrt(y*y+S*S)>R&&fe(b)}(s.x!==J.xSnapped||s.y!==J.ySnapped)&&l&&x&&(f=fn(b.sourceEvent,v),ae(J))}}).on("end",b=>{if(!(!x||w)&&(u=!1,x=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:M,updateNodePositions:m,onNodeDragStop:N,onSelectionDragStop:C}=e();if(_&&(m(l,!1),_=!1),a||N||!ie&&C){const[R,F]=Ia({nodeId:ie,dragItems:l,nodeLookup:M,dragging:!1});a==null||a(b.sourceEvent,l,R,F),N==null||N(b.sourceEvent,R,F),ie||C==null||C(b.sourceEvent,F)}}}).filter(b=>{const M=b.target;return!b.button&&(!L||!$s(M,`.${L}`,q))&&(!V||$s(M,V,q))});p.call(O)}function D(){p==null||p.on(".drag",null)}return{update:H,destroy:D}}function u2(t,e,n){const o=[],a={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())jr(a,wr(s))>0&&o.push(s);return o}const f2=250;function v2(t,e,n,o){var l,u;let a=[],s=1/0;const i=u2(t,n,e+f2);for(const f of i){const v=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((u=f.internals.handleBounds)==null?void 0:u.target)??[]];for(const x of v){if(o.nodeId===x.nodeId&&o.type===x.type&&o.id===x.id)continue;const{x:p,y:w}=Jn(f,x,x.position,!0),_=Math.sqrt(Math.pow(p-t.x,2)+Math.pow(w-t.y,2));_>e||(_<s?(a=[{...x,x:p,y:w}],s=_):_===s&&a.push({...x,x:p,y:w}))}}if(!a.length)return null;if(a.length>1){const f=o.type==="source"?"target":"source";return a.find(v=>v.type===f)??a[0]}return a[0]}function qc(t,e,n,o,a,s=!1){var f,v,x;const i=o.get(t);if(!i)return null;const l=a==="strict"?(f=i.internals.handleBounds)==null?void 0:f[e]:[...((v=i.internals.handleBounds)==null?void 0:v.source)??[],...((x=i.internals.handleBounds)==null?void 0:x.target)??[]],u=(n?l==null?void 0:l.find(p=>p.id===n):l==null?void 0:l[0])??null;return u&&s?{...u,...Jn(i,u,u.position,!0)}:u}function Fc(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function g2(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const Kc=()=>!0;function p2(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:a,edgeUpdaterType:s,isTarget:i,domNode:l,nodeLookup:u,lib:f,autoPanOnConnect:v,flowId:x,panBy:p,cancelConnection:w,onConnectStart:_,onConnect:I,onConnectEnd:H,isValidConnection:D=Kc,onReconnectEnd:L,updateConnection:V,getTransform:q,getFromHandle:U,autoPanSpeed:ie,dragThreshold:de=1,handleDomNode:ae}){const $=Pc(t.target);let fe=0,O;const{x:b,y:M}=fn(t),m=Fc(s,ae),N=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!N||!m)return;const R=qc(a,m,o,u,e);if(!R)return;let F=fn(t,N),J=!1,A=null,y=!1,S=null;function z(){if(!v||!N)return;const[B,K]=zc(F,N,ie);p({x:B,y:K}),fe=requestAnimationFrame(z)}const W={...R,nodeId:a,type:m,position:R.position},oe=u.get(a);let Y={inProgress:!0,isValid:null,from:Jn(oe,W,ft.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:oe,to:F,toHandle:null,toPosition:Vs[W.position],toNode:null,pointer:F};function Q(){C=!0,V(Y),_==null||_(t,{nodeId:a,handleId:o,handleType:m})}de===0&&Q();function ee(B){if(!C){const{x:me,y:_e}=fn(B),ke=me-b,he=_e-M;if(!(ke*ke+he*he>de*de))return;Q()}if(!U()||!W){se(B);return}const K=q();F=fn(B,N),O=v2(so(F,K,!1,[1,1]),n,u,W),J||(z(),J=!0);const ne=Bc(B,{handle:O,connectionMode:e,fromNodeId:a,fromHandleId:o,fromType:i?"target":"source",isValidConnection:D,doc:$,lib:f,flowId:x,nodeLookup:u});S=ne.handleDomNode,A=ne.connection,y=g2(!!O,ne.isValid);const re=u.get(a),te=re?Jn(re,W,ft.Left,!0):Y.from,pe={...Y,from:te,isValid:y,to:ne.toHandle&&y?Go({x:ne.toHandle.x,y:ne.toHandle.y},K):F,toHandle:ne.toHandle,toPosition:y&&ne.toHandle?ne.toHandle.position:Vs[W.position],toNode:ne.toHandle?u.get(ne.toHandle.nodeId):null,pointer:F};V(pe),Y=pe}function se(B){if(!("touches"in B&&B.touches.length>0)){if(C){(O||S)&&A&&y&&(I==null||I(A));const{inProgress:K,...ne}=Y,re={...ne,toPosition:Y.toHandle?Y.toPosition:null};H==null||H(B,re),s&&(L==null||L(B,re))}w(),cancelAnimationFrame(fe),J=!1,y=!1,A=null,S=null,$.removeEventListener("mousemove",ee),$.removeEventListener("mouseup",se),$.removeEventListener("touchmove",ee),$.removeEventListener("touchend",se)}}$.addEventListener("mousemove",ee),$.addEventListener("mouseup",se),$.addEventListener("touchmove",ee),$.addEventListener("touchend",se)}function Bc(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:s,doc:i,lib:l,flowId:u,isValidConnection:f=Kc,nodeLookup:v}){const x=s==="target",p=e?i.querySelector(`.${l}-flow__handle[data-id="${u}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:w,y:_}=fn(t),I=i.elementFromPoint(w,_),H=I!=null&&I.classList.contains(`${l}-flow__handle`)?I:p,D={handleDomNode:H,isValid:!1,connection:null,toHandle:null};if(H){const L=Fc(void 0,H),V=H.getAttribute("data-nodeid"),q=H.getAttribute("data-handleid"),U=H.classList.contains("connectable"),ie=H.classList.contains("connectableend");if(!V||!L)return D;const de={source:x?V:o,sourceHandle:x?q:a,target:x?o:V,targetHandle:x?a:q};D.connection=de;const $=U&&ie&&(n===_r.Strict?x&&L==="source"||!x&&L==="target":V!==o||q!==a);D.isValid=$&&f(de),D.toHandle=qc(V,L,q,v,n,!0)}return D}const Zs={onPointerDown:p2,isValid:Bc},ga=t=>({x:t.x,y:t.y,zoom:t.k}),Aa=({x:t,y:e,zoom:n})=>da.translate(t,e).scale(n),dr=(t,e)=>t.target.closest(`.${e}`),jc=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),h2=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,La=(t,e=0,n=h2,o=()=>{})=>{const a=typeof e=="number"&&e>0;return a||o(),a?t.transition().duration(e).ease(n).on("end",o):t},Uc=t=>{const e=t.ctrlKey&&$o()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function x2({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:a,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:f}){return v=>{if(dr(v,e))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(v.ctrlKey&&i){const H=hn(v),D=Uc(v),L=x*Math.pow(2,D);o.scaleTo(n,L,H,v);return}const p=v.deltaMode===1?20:1;let w=a===gr.Vertical?0:v.deltaX*p,_=a===gr.Horizontal?0:v.deltaY*p;!$o()&&v.shiftKey&&a!==gr.Vertical&&(w=v.deltaY*p,_=0),o.translateBy(n,-(w/x)*s,-(_/x)*s,{internal:!0});const I=ga(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(u==null||u(v,I),t.panScrollTimeout=setTimeout(()=>{f==null||f(v,I),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,l==null||l(v,I))}}function b2({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,a){const s=o.type==="wheel",i=!e&&s&&!o.ctrlKey,l=dr(o,t);if(o.ctrlKey&&s&&l&&o.preventDefault(),i||l)return null;o.preventDefault(),n.call(this,o,a)}}function m2({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{var s,i,l;if((s=o.sourceEvent)!=null&&s.internal)return;const a=ga(o.transform);t.mouseButton=((i=o.sourceEvent)==null?void 0:i.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=a,((l=o.sourceEvent)==null?void 0:l.type)==="mousedown"&&e(!0),n&&(n==null||n(o.sourceEvent,a))}}function _2({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:a}){return s=>{var i,l;t.usedRightMouseButton=!!(n&&jc(e,t.mouseButton??0)),(i=s.sourceEvent)!=null&&i.sync||o([s.transform.x,s.transform.y,s.transform.k]),a&&!((l=s.sourceEvent)!=null&&l.internal)&&(a==null||a(s.sourceEvent,ga(s.transform)))}}function y2({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:a,onPaneContextMenu:s}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(t.isZoomingOrPanning=!1,s&&jc(e,t.mouseButton??0)&&!t.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),t.usedRightMouseButton=!1,o(!1),a)){const u=ga(i.transform);t.prevViewport=u,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a==null||a(i.sourceEvent,u)},n?150:0)}}}function w2({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:a,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:l,noPanClassName:u,lib:f,connectionInProgress:v}){return x=>{var H;const p=t||e,w=n&&x.ctrlKey,_=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(dr(x,`${f}-flow__node`)||dr(x,`${f}-flow__edge`)))return!0;if(!o&&!p&&!a&&!s&&!n||i||v&&!_||dr(x,l)&&_||dr(x,u)&&(!_||a&&_&&!t)||!n&&x.ctrlKey&&_)return!1;if(!n&&x.type==="touchstart"&&((H=x.touches)==null?void 0:H.length)>1)return x.preventDefault(),!1;if(!p&&!a&&!w&&_||!o&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(o)&&!o.includes(x.button)&&x.type==="mousedown")return!1;const I=Array.isArray(o)&&o.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||_)&&I}}function k2({domNode:t,minZoom:e,maxZoom:n,translateExtent:o,viewport:a,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=t.getBoundingClientRect(),x=wy().scaleExtent([e,n]).translateExtent(o),p=cn(t).call(x);L({x:a.x,y:a.y,zoom:yr(a.zoom,e,n)},[[0,0],[v.width,v.height]],o);const w=p.on("wheel.zoom"),_=p.on("dblclick.zoom");x.wheelDelta(Uc);function I(O,b){return p?new Promise(M=>{x==null||x.interpolate((b==null?void 0:b.interpolate)==="linear"?Or:Lo).transform(La(p,b==null?void 0:b.duration,b==null?void 0:b.ease,()=>M(!0)),O)}):Promise.resolve(!1)}function H({noWheelClassName:O,noPanClassName:b,onPaneContextMenu:M,userSelectionActive:m,panOnScroll:N,panOnDrag:C,panOnScrollMode:R,panOnScrollSpeed:F,preventScrolling:J,zoomOnPinch:A,zoomOnScroll:y,zoomOnDoubleClick:S,zoomActivationKeyPressed:z,lib:W,onTransformChange:oe,connectionInProgress:Z,paneClickDistance:Y,selectionOnDrag:Q}){m&&!f.isZoomingOrPanning&&D();const ee=N&&!z&&!m;x.clickDistance(Q?1/0:!En(Y)||Y<0?0:Y);const se=ee?x2({zoomPanValues:f,noWheelClassName:O,d3Selection:p,d3Zoom:x,panOnScrollMode:R,panOnScrollSpeed:F,zoomOnPinch:A,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:l}):b2({noWheelClassName:O,preventScrolling:J,d3ZoomHandler:w});if(p.on("wheel.zoom",se,{passive:!1}),!m){const K=m2({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:i});x.on("start",K);const ne=_2({zoomPanValues:f,panOnDrag:C,onPaneContextMenu:!!M,onPanZoom:s,onTransformChange:oe});x.on("zoom",ne);const re=y2({zoomPanValues:f,panOnDrag:C,panOnScroll:N,onPaneContextMenu:M,onPanZoomEnd:l,onDraggingChange:u});x.on("end",re)}const B=w2({zoomActivationKeyPressed:z,panOnDrag:C,zoomOnScroll:y,panOnScroll:N,zoomOnDoubleClick:S,zoomOnPinch:A,userSelectionActive:m,noPanClassName:b,noWheelClassName:O,lib:W,connectionInProgress:Z});x.filter(B),S?p.on("dblclick.zoom",_):p.on("dblclick.zoom",null)}function D(){x.on("zoom",null)}async function L(O,b,M){const m=Aa(O),N=x==null?void 0:x.constrain()(m,b,M);return N&&await I(N),new Promise(C=>C(N))}async function V(O,b){const M=Aa(O);return await I(M,b),new Promise(m=>m(M))}function q(O){if(p){const b=Aa(O),M=p.property("__zoom");(M.k!==O.zoom||M.x!==O.x||M.y!==O.y)&&(x==null||x.transform(p,b,null,{sync:!0}))}}function U(){const O=p?Sc(p.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}function ie(O,b){return p?new Promise(M=>{x==null||x.interpolate((b==null?void 0:b.interpolate)==="linear"?Or:Lo).scaleTo(La(p,b==null?void 0:b.duration,b==null?void 0:b.ease,()=>M(!0)),O)}):Promise.resolve(!1)}function de(O,b){return p?new Promise(M=>{x==null||x.interpolate((b==null?void 0:b.interpolate)==="linear"?Or:Lo).scaleBy(La(p,b==null?void 0:b.duration,b==null?void 0:b.ease,()=>M(!0)),O)}):Promise.resolve(!1)}function ae(O){x==null||x.scaleExtent(O)}function $(O){x==null||x.translateExtent(O)}function fe(O){const b=!En(O)||O<0?0:O;x==null||x.clickDistance(b)}return{update:H,destroy:D,setViewport:V,setViewportConstrained:L,getViewport:U,scaleTo:ie,scaleBy:de,setScaleExtent:ae,setTranslateExtent:$,syncViewport:q,setClickDistance:fe}}var Qs;(function(t){t.Line="line",t.Handle="handle"})(Qs||(Qs={}));function qi(){const t={};return[e=>{if(e&&!Pd(t))throw new Error(e);return na(t)},e=>hi(t,e)]}const[S2,C2]=qi(),[N2,E2]=qi(),[M2,z2]=qi();var T2=k("<div><!></div>");function Sr(t,e){$e(e,!0);let n=qe(e,"id",3,null),o=qe(e,"type",3,"source"),a=qe(e,"position",19,()=>ft.Top),s=qe(e,"isConnectableStart",3,!0),i=qe(e,"isConnectableEnd",3,!0),l=er(e,["$$slots","$$events","$$legacy","id","type","position","style","class","isConnectable","isConnectableStart","isConnectableEnd","isValidConnection","onconnect","ondisconnect","children"]);const u=S2("Handle must be used within a Custom Node component"),f=N2("Handle must be used within a Custom Node component");let v=E(()=>o()==="target"),x=E(()=>e.isConnectable!==void 0?e.isConnectable:f.value),p=rr(),w=E(()=>p.ariaLabelConfig),_=null;Id(()=>{if(e.onconnect||e.ondisconnect){p.edges;let b=p.connectionLookup.get(`${u}-${o()}${n()?`-${n()}`:""}`);if(_&&!Sy(b,_)){const M=b??new Map;Hs(_,M,e.ondisconnect),Hs(M,_,e.onconnect)}_=new Map(b)}});let I=E(()=>{if(!p.connection.inProgress)return[!1,!1,!1,!1,null];const{fromHandle:b,toHandle:M,isValid:m}=p.connection,N=b&&b.nodeId===u&&b.type===o()&&b.id===n(),C=M&&M.nodeId===u&&M.type===o()&&M.id===n(),R=p.connectionMode===_r.Strict?(b==null?void 0:b.type)!==o():u!==(b==null?void 0:b.nodeId)||n()!==(b==null?void 0:b.id);return[!0,N,C,R,C&&m]}),H=E(()=>on(r(I),5)),D=E(()=>r(H)[0]),L=E(()=>r(H)[1]),V=E(()=>r(H)[2]),q=E(()=>r(H)[3]),U=E(()=>r(H)[4]);function ie(b){var m;const M=p.onbeforeconnect?p.onbeforeconnect(b):b;M&&(p.addEdge(M),(m=p.onconnect)==null||m.call(p,b))}function de(b){const M=Ac(b);b.currentTarget&&(M&&b.button===0||!M)&&Zs.onPointerDown(b,{handleId:n(),nodeId:u,isTarget:r(v),connectionRadius:p.connectionRadius,domNode:p.domNode,nodeLookup:p.nodeLookup,connectionMode:p.connectionMode,lib:"svelte",autoPanOnConnect:p.autoPanOnConnect,autoPanSpeed:p.autoPanSpeed,flowId:p.flowId,isValidConnection:e.isValidConnection||((...m)=>{var N;return((N=p.isValidConnection)==null?void 0:N.call(p,...m))??!0}),updateConnection:p.updateConnection,cancelConnection:p.cancelConnection,panBy:p.panBy,onConnect:ie,onConnectStart:p.onconnectstart,onConnectEnd:(...m)=>{var N;return(N=p.onconnectend)==null?void 0:N.call(p,...m)},getTransform:()=>[p.viewport.x,p.viewport.y,p.viewport.zoom],getFromHandle:()=>p.connection.fromHandle,dragThreshold:p.connectionDragThreshold,handleDomNode:b.currentTarget})}function ae(b){var S,z;if(!u||!p.clickConnectStartHandle&&!s())return;if(!p.clickConnectStartHandle){(S=p.onclickconnectstart)==null||S.call(p,b,{nodeId:u,handleId:n(),handleType:o()}),p.clickConnectStartHandle={nodeId:u,type:o(),id:n()};return}const M=Pc(b.target),m=e.isValidConnection??p.isValidConnection,{connectionMode:N,clickConnectStartHandle:C,flowId:R,nodeLookup:F}=p,{connection:J,isValid:A}=Zs.isValid(b,{handle:{nodeId:u,id:n(),type:o()},connectionMode:N,fromNodeId:C.nodeId,fromHandleId:C.id??null,fromType:C.type,isValidConnection:m,flowId:R,doc:M,lib:"svelte",nodeLookup:F});A&&J&&ie(J);const y=structuredClone(pl(p.connection));delete y.inProgress,y.toPosition=y.toHandle?y.toHandle.position:null,(z=p.onclickconnectend)==null||z.call(p,b,y),p.clickConnectStartHandle=null}var $=T2(),fe=()=>{};Dn($,()=>({"data-handleid":n(),"data-nodeid":u,"data-handlepos":a(),"data-id":`${p.flowId??""}-${u??""}-${n()??"null"??""}-${o()??""}`,class:["svelte-flow__handle",`svelte-flow__handle-${a()}`,p.noDragClass,p.noPanClass,a(),e.class],onmousedown:de,ontouchstart:de,onclick:p.clickConnect?ae:void 0,onkeypress:fe,style:e.style,role:"button","aria-label":r(w)["handle.ariaLabel"],tabindex:"-1",...l,[mi]:{valid:r(U),connectingto:r(V),connectingfrom:r(L),source:!r(v),target:r(v),connectablestart:s(),connectableend:i(),connectable:r(x),connectionindicator:r(x)&&(!r(D)||r(q))&&(r(D)||p.clickConnectStartHandle?i():s())}}));var O=d($);St(O,()=>e.children??Gt),c($),h(t,$),Ze()}var P2=k("<!> <!>",1);function Wc(t,e){$e(e,!0);let n=qe(e,"targetPosition",19,()=>ft.Top),o=qe(e,"sourcePosition",19,()=>ft.Bottom);var a=P2(),s=ve(a);Sr(s,{type:"target",get position(){return n()}});var i=g(s),l=g(i);Sr(l,{type:"source",get position(){return o()}}),j(()=>{var u;return P(i,` ${((u=e.data)==null?void 0:u.label)??""} `)}),h(t,a),Ze()}var I2=k(" <!>",1);function A2(t,e){$e(e,!0);let n=qe(e,"data",19,()=>({label:"Node"})),o=qe(e,"sourcePosition",19,()=>ft.Bottom);Ee();var a=I2(),s=ve(a),i=g(s);Sr(i,{type:"source",get position(){return o()}}),j(()=>{var l;return P(s,`${((l=n())==null?void 0:l.label)??""} `)}),h(t,a),Ze()}var L2=k(" <!>",1);function O2(t,e){$e(e,!0);let n=qe(e,"data",19,()=>({label:"Node"})),o=qe(e,"targetPosition",19,()=>ft.Top);Ee();var a=L2(),s=ve(a),i=g(s);Sr(i,{type:"target",get position(){return o()}}),j(()=>{var l;return P(s,`${((l=n())==null?void 0:l.label)??""} `)}),h(t,a),Ze()}function R2(t,e){}function Oa(t,e,n){if(!n||!e)return;const o=n==="root"?e:e.querySelector(`.svelte-flow__${n}`);o&&o.appendChild(t)}function Ra(t,e){const n=E(rr),o=E(()=>r(n).domNode);let a;return r(o)?Oa(t,r(o),e):a=ul(()=>{It(()=>{Oa(t,r(o),e),a==null||a()})}),{async update(s){Oa(t,r(o),s)},destroy(){t.parentNode&&t.parentNode.removeChild(t),a==null||a()}}}function D2(){let t=xe(typeof window>"u");if(r(t)){const e=ul(()=>{It(()=>{T(t,!1),e==null||e()})})}return{get value(){return r(t)}}}const Js=t=>Ny(t),V2=t=>Nc(t);function _n(t){return t===void 0?void 0:`${t}px`}const Zo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var H2=k("<div><!></div>");function q2(t,e){$e(e,!0);let n=qe(e,"x",3,0),o=qe(e,"y",3,0),a=qe(e,"selectEdgeOnClick",3,!1),s=qe(e,"transparent",3,!1),i=er(e,["$$slots","$$events","$$legacy","x","y","width","height","selectEdgeOnClick","transparent","class","children"]);const l=rr(),u=M2("EdgeLabel must be used within a Custom Edge component");let f=E(()=>{var w;return(w=l.visible.edges.get(u))==null?void 0:w.zIndex});var v=H2(),x=()=>{a()&&u&&l.handleEdgeSelection(u)};Dn(v,w=>({class:["svelte-flow__edge-label",{transparent:s()},e.class],tabindex:"-1",onclick:x,...i,[aa]:w}),[()=>({display:D2().value?"none":void 0,cursor:a()?"pointer":void 0,transform:`translate(-50%, -50%) translate(${n()??""}px,${o()??""}px)`,"pointer-events":"all",width:_n(e.width),height:_n(e.height),"z-index":r(f)})],void 0,void 0,"svelte-168dld1");var p=d(v);St(p,()=>e.children??Gt),c(v),Xt(v,(w,_)=>Ra==null?void 0:Ra(w,_),()=>"edge-labels"),h(t,v),Ze()}var F2=Vt("<path></path>"),K2=Vt('<path fill="none"></path><!><!>',1);function pa(t,e){let n=qe(e,"interactionWidth",3,20),o=er(e,["$$slots","$$events","$$legacy","id","path","label","labelX","labelY","labelStyle","markerStart","markerEnd","style","interactionWidth","class"]);var a=K2(),s=ve(a),i=g(s);{var l=v=>{var x=F2();Dn(x,()=>({d:e.path,"stroke-opacity":0,"stroke-width":n(),fill:"none",class:"svelte-flow__edge-interaction",...o})),h(v,x)};X(i,v=>{n()>0&&v(l)})}var u=g(i);{var f=v=>{q2(v,{get x(){return e.labelX},get y(){return e.labelY},get style(){return e.labelStyle},selectEdgeOnClick:!0,children:(x,p)=>{Ee();var w=pt();j(()=>P(w,e.label)),h(x,w)},$$slots:{default:!0}})};X(u,v=>{e.label&&v(f)})}j(()=>{Se(s,"id",e.id),Se(s,"d",e.path),Oe(s,0,We(["svelte-flow__edge-path",e.class])),Se(s,"marker-start",e.markerStart),Se(s,"marker-end",e.markerEnd),$t(s,e.style)}),h(t,a)}function Yc(t,e){$e(e,!0);let n=E(()=>{var l;return Lc({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,curvature:(l=e.pathOptions)==null?void 0:l.curvature})}),o=E(()=>on(r(n),3)),a=E(()=>r(o)[0]),s=E(()=>r(o)[1]),i=E(()=>r(o)[2]);pa(t,{get id(){return e.id},get path(){return r(a)},get labelX(){return r(s)},get labelY(){return r(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),Ze()}function B2(t,e){$e(e,!0);let n=E(()=>Oi({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition})),o=E(()=>on(r(n),3)),a=E(()=>r(o)[0]),s=E(()=>r(o)[1]),i=E(()=>r(o)[2]);pa(t,{get path(){return r(a)},get labelX(){return r(s)},get labelY(){return r(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),Ze()}function j2(t,e){$e(e,!0);let n=E(()=>Rc({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY})),o=E(()=>on(r(n),3)),a=E(()=>r(o)[0]),s=E(()=>r(o)[1]),i=E(()=>r(o)[2]);pa(t,{get path(){return r(a)},get labelX(){return r(s)},get labelY(){return r(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),Ze()}function U2(t,e){$e(e,!0);let n=E(()=>Oi({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,borderRadius:0})),o=E(()=>on(r(n),3)),a=E(()=>r(o)[0]),s=E(()=>r(o)[1]),i=E(()=>r(o)[2]);pa(t,{get path(){return r(a)},get labelX(){return r(s)},get labelY(){return r(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),Ze()}var Jr,eo;class W2{constructor(e,n){He(this,Jr);He(this,eo);Er(this,Jr,e),Er(this,eo,Ld(n))}get current(){return ce(this,eo).call(this),ce(this,Jr).call(this)}}Jr=new WeakMap,eo=new WeakMap;const Y2=/\(.+\)/,X2=new Set(["all","print","screen","and","or","not","only"]);class G2 extends W2{constructor(e,n){let o=Y2.test(e)||e.split(/[\s,]+/).some(s=>X2.has(s.trim()))?e:`(${e})`;const a=window.matchMedia(o);super(()=>a.matches,s=>Ka(a,"change",s))}}function $2(t,e,n,o){const a=new Map;return Ai(t,{x:0,y:0,width:n,height:o},e,!0).forEach(s=>{a.set(s.id,s)}),a}function el(t){const{edges:e,defaultEdgeOptions:n,nodeLookup:o,previousEdges:a,connectionMode:s,onerror:i,onlyRenderVisible:l,elevateEdgesOnSelect:u,zIndexMode:f}=t,v=new Map;for(const x of e){const p=o.get(x.source),w=o.get(x.target);if(!p||!w)continue;if(l){const{visibleNodes:H,transform:D,width:L,height:V}=t;if(Ky({sourceNode:p,targetNode:w,width:L,height:V,transform:D}))H.set(p.id,p),H.set(w.id,w);else continue}const _=a.get(x.id);if(_&&x===_.edge&&p==_.sourceNode&&w==_.targetNode){v.set(x.id,_);continue}const I=Gy({id:x.id,sourceNode:p,targetNode:w,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:s,onError:i});I&&v.set(x.id,{...n,...x,...I,zIndex:Fy({selected:x.selected,zIndex:x.zIndex??n.zIndex,sourceNode:p,targetNode:w,elevateOnSelect:u,zIndexMode:f}),sourceNode:p,targetNode:w,edge:x})}return v}const Xc={input:A2,output:O2,default:Wc,group:R2},Gc={straight:j2,smoothstep:B2,default:Yc,step:U2};function Z2(t,e,n,o,a,s){if(e&&!n&&o&&a){const i=ua(s,{filter:l=>!!((l.width||l.initialWidth)&&(l.height||l.initialHeight))});return Li(i,o,a,.5,2,.1)}else return n??{x:0,y:0,zoom:1}}function Q2(t){var n,o,a,s,i,l,u,f,v,x,p,w,_,I,H,D,L,V,q,U,ie,de,ae,$,fe,O,b,M,m,N,C,R,F,J,A,y,S,z,W,oe,Z,Y,Q,ee,se,B,K,ne,re,te,pe,me,_e,ke,he,ge,Ce,Pe,ue,le,we,Me,Ne,Te,ye,ze,Ae,Ke,at,Be,Qe,dt,vt,Ge,Re,Ie;class e{constructor(){He(this,n,E(()=>t.props.id??"1"));He(this,o,xe(null));He(this,a,xe(null));He(this,s,xe(t.width??0));He(this,i,xe(t.height??0));He(this,l,xe(t.props.zIndexMode??"basic"));He(this,u,E(()=>{var De;const{nodesInitialized:G}=t2(t.nodes,this.nodeLookup,this.parentLookup,{nodeExtent:this.nodeExtent,nodeOrigin:this.nodeOrigin,elevateNodesOnSelect:t.props.elevateNodesOnSelect??!0,checkEquality:!0,zIndexMode:this.zIndexMode});return this.fitViewQueued&&G&&((De=this.fitViewOptions)!=null&&De.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),G}));He(this,f,E(()=>this.panZoom!==null));He(this,v,E(()=>(s2(this.connectionLookup,this.edgeLookup,t.edges),t.edges)));wt(this,"_prevSelectedNodes",[]);wt(this,"_prevSelectedNodeIds",new Set);He(this,x,E(()=>{const G=this._prevSelectedNodeIds.size,De=new Set,Le=this.nodes.filter(je=>(je.selected&&(De.add(je.id),this._prevSelectedNodeIds.delete(je.id)),je.selected));return(G!==De.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=Le),this._prevSelectedNodeIds=De,this._prevSelectedNodes}));wt(this,"_prevSelectedEdges",[]);wt(this,"_prevSelectedEdgeIds",new Set);He(this,p,E(()=>{const G=this._prevSelectedEdgeIds.size,De=new Set,Le=this.edges.filter(je=>(je.selected&&(De.add(je.id),this._prevSelectedEdgeIds.delete(je.id)),je.selected));return(G!==De.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=Le),this._prevSelectedEdgeIds=De,this._prevSelectedEdges}));wt(this,"selectionChangeHandlers",new Map);wt(this,"nodeLookup",new Map);wt(this,"parentLookup",new Map);wt(this,"connectionLookup",new Map);wt(this,"edgeLookup",new Map);wt(this,"_prevVisibleEdges",new Map);He(this,w,E(()=>{const{nodes:G,_edges:De,_prevVisibleEdges:Le,nodeLookup:je,connectionMode:Ye,onerror:lt,onlyRenderVisibleElements:ct,defaultEdgeOptions:gt,zIndexMode:it}=this;let Xe,tt;const st={edges:De,defaultEdgeOptions:gt,previousEdges:Le,nodeLookup:je,connectionMode:Ye,elevateEdgesOnSelect:t.props.elevateEdgesOnSelect??!0,zIndexMode:it,onerror:lt};if(ct){const{viewport:ut,width:ht,height:xt}=this,Tt=[ut.x,ut.y,ut.zoom];Xe=$2(je,Tt,ht,xt),tt=el({...st,onlyRenderVisible:!0,visibleNodes:Xe,transform:Tt,width:ht,height:xt})}else Xe=this.nodeLookup,tt=el(st);return{nodes:Xe,edges:tt}}));He(this,_,E(()=>t.props.nodesDraggable??!0));He(this,I,E(()=>t.props.nodesConnectable??!0));He(this,H,E(()=>t.props.elementsSelectable??!0));He(this,D,E(()=>t.props.nodesFocusable??!0));He(this,L,E(()=>t.props.edgesFocusable??!0));He(this,V,E(()=>t.props.disableKeyboardA11y??!1));He(this,q,E(()=>t.props.minZoom??.5));He(this,U,E(()=>t.props.maxZoom??2));He(this,ie,E(()=>t.props.nodeOrigin??[0,0]));He(this,de,E(()=>t.props.nodeExtent??li));He(this,ae,E(()=>t.props.translateExtent??li));He(this,$,E(()=>t.props.defaultEdgeOptions??{}));He(this,fe,E(()=>t.props.nodeDragThreshold??1));He(this,O,E(()=>t.props.autoPanOnNodeDrag??!0));He(this,b,E(()=>t.props.autoPanOnConnect??!0));He(this,M,E(()=>t.props.autoPanOnNodeFocus??!0));He(this,m,E(()=>t.props.autoPanSpeed??15));He(this,N,E(()=>t.props.connectionDragThreshold??1));wt(this,"fitViewQueued",t.props.fitView??!1);wt(this,"fitViewOptions",t.props.fitViewOptions);wt(this,"fitViewResolver",null);He(this,C,E(()=>t.props.snapGrid??null));He(this,R,xe(!1));He(this,F,xe(null));He(this,J,xe(!1));He(this,A,xe(!1));He(this,y,xe(!1));He(this,S,xe(!1));He(this,z,xe(!1));He(this,W,xe(null));He(this,oe,xe(""));He(this,Z,E(()=>t.props.selectionMode??Wo.Partial));He(this,Y,E(()=>({...Xc,...t.props.nodeTypes})));He(this,Q,E(()=>({...Gc,...t.props.edgeTypes})));He(this,ee,E(()=>t.props.noPanClass??"nopan"));He(this,se,E(()=>t.props.noDragClass??"nodrag"));He(this,B,E(()=>t.props.noWheelClass??"nowheel"));He(this,K,E(()=>Vy(t.props.ariaLabelConfig)));He(this,ne,xe(Z2(this.nodesInitialized,t.props.fitView,t.props.initialViewport,this.width,this.height,this.nodeLookup)));He(this,re,xe(ci));He(this,te,E(()=>this._connection.inProgress?{...this._connection,to:so(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection));He(this,pe,E(()=>t.props.connectionMode??_r.Strict));He(this,me,E(()=>t.props.connectionRadius??20));He(this,_e,E(()=>t.props.isValidConnection??(()=>!0)));He(this,ke,E(()=>t.props.selectNodesOnDrag??!0));He(this,he,E(()=>t.props.defaultMarkerColor===void 0?"#b1b1b7":t.props.defaultMarkerColor));He(this,ge,E(()=>$y(t.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd})));He(this,Ce,E(()=>t.props.onlyRenderVisibleElements??!1));He(this,Pe,E(()=>t.props.onflowerror??Ay));He(this,ue,E(()=>t.props.ondelete));He(this,le,E(()=>t.props.onbeforedelete));He(this,we,E(()=>t.props.onbeforeconnect));He(this,Me,E(()=>t.props.onconnect));He(this,Ne,E(()=>t.props.onconnectstart));He(this,Te,E(()=>t.props.onconnectend));He(this,ye,E(()=>t.props.onbeforereconnect));He(this,ze,E(()=>t.props.onreconnect));He(this,Ae,E(()=>t.props.onreconnectstart));He(this,Ke,E(()=>t.props.onreconnectend));He(this,at,E(()=>t.props.clickConnect??!0));He(this,Be,E(()=>t.props.onclickconnectstart));He(this,Qe,E(()=>t.props.onclickconnectend));He(this,dt,xe(null));He(this,vt,E(()=>t.props.onselectiondrag));He(this,Ge,E(()=>t.props.onselectiondragstart));He(this,Re,E(()=>t.props.onselectiondragstop));wt(this,"resolveFitView",async()=>{var G;this.panZoom&&(await Ty({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),(G=this.fitViewResolver)==null||G.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)});wt(this,"_prefersDark",new G2("(prefers-color-scheme: dark)",t.props.colorModeSSR==="dark"));He(this,Ie,E(()=>t.props.colorMode==="system"?this._prefersDark.current?"dark":"light":t.props.colorMode??"light"))}get flowId(){return r(ce(this,n))}set flowId(G){T(ce(this,n),G)}get domNode(){return r(ce(this,o))}set domNode(G){T(ce(this,o),G)}get panZoom(){return r(ce(this,a))}set panZoom(G){T(ce(this,a),G)}get width(){return r(ce(this,s))}set width(G){T(ce(this,s),G)}get height(){return r(ce(this,i))}set height(G){T(ce(this,i),G)}get zIndexMode(){return r(ce(this,l))}set zIndexMode(G){T(ce(this,l),G)}get nodesInitialized(){return r(ce(this,u))}set nodesInitialized(G){T(ce(this,u),G)}get viewportInitialized(){return r(ce(this,f))}set viewportInitialized(G){T(ce(this,f),G)}get _edges(){return r(ce(this,v))}set _edges(G){T(ce(this,v),G)}get nodes(){return this.nodesInitialized,t.nodes}set nodes(G){t.nodes=G}get edges(){return this._edges}set edges(G){t.edges=G}get selectedNodes(){return r(ce(this,x))}set selectedNodes(G){T(ce(this,x),G)}get selectedEdges(){return r(ce(this,p))}set selectedEdges(G){T(ce(this,p),G)}get visible(){return r(ce(this,w))}set visible(G){T(ce(this,w),G)}get nodesDraggable(){return r(ce(this,_))}set nodesDraggable(G){T(ce(this,_),G)}get nodesConnectable(){return r(ce(this,I))}set nodesConnectable(G){T(ce(this,I),G)}get elementsSelectable(){return r(ce(this,H))}set elementsSelectable(G){T(ce(this,H),G)}get nodesFocusable(){return r(ce(this,D))}set nodesFocusable(G){T(ce(this,D),G)}get edgesFocusable(){return r(ce(this,L))}set edgesFocusable(G){T(ce(this,L),G)}get disableKeyboardA11y(){return r(ce(this,V))}set disableKeyboardA11y(G){T(ce(this,V),G)}get minZoom(){return r(ce(this,q))}set minZoom(G){T(ce(this,q),G)}get maxZoom(){return r(ce(this,U))}set maxZoom(G){T(ce(this,U),G)}get nodeOrigin(){return r(ce(this,ie))}set nodeOrigin(G){T(ce(this,ie),G)}get nodeExtent(){return r(ce(this,de))}set nodeExtent(G){T(ce(this,de),G)}get translateExtent(){return r(ce(this,ae))}set translateExtent(G){T(ce(this,ae),G)}get defaultEdgeOptions(){return r(ce(this,$))}set defaultEdgeOptions(G){T(ce(this,$),G)}get nodeDragThreshold(){return r(ce(this,fe))}set nodeDragThreshold(G){T(ce(this,fe),G)}get autoPanOnNodeDrag(){return r(ce(this,O))}set autoPanOnNodeDrag(G){T(ce(this,O),G)}get autoPanOnConnect(){return r(ce(this,b))}set autoPanOnConnect(G){T(ce(this,b),G)}get autoPanOnNodeFocus(){return r(ce(this,M))}set autoPanOnNodeFocus(G){T(ce(this,M),G)}get autoPanSpeed(){return r(ce(this,m))}set autoPanSpeed(G){T(ce(this,m),G)}get connectionDragThreshold(){return r(ce(this,N))}set connectionDragThreshold(G){T(ce(this,N),G)}get snapGrid(){return r(ce(this,C))}set snapGrid(G){T(ce(this,C),G)}get dragging(){return r(ce(this,R))}set dragging(G){T(ce(this,R),G)}get selectionRect(){return r(ce(this,F))}set selectionRect(G){T(ce(this,F),G)}get selectionKeyPressed(){return r(ce(this,J))}set selectionKeyPressed(G){T(ce(this,J),G)}get multiselectionKeyPressed(){return r(ce(this,A))}set multiselectionKeyPressed(G){T(ce(this,A),G)}get deleteKeyPressed(){return r(ce(this,y))}set deleteKeyPressed(G){T(ce(this,y),G)}get panActivationKeyPressed(){return r(ce(this,S))}set panActivationKeyPressed(G){T(ce(this,S),G)}get zoomActivationKeyPressed(){return r(ce(this,z))}set zoomActivationKeyPressed(G){T(ce(this,z),G)}get selectionRectMode(){return r(ce(this,W))}set selectionRectMode(G){T(ce(this,W),G)}get ariaLiveMessage(){return r(ce(this,oe))}set ariaLiveMessage(G){T(ce(this,oe),G)}get selectionMode(){return r(ce(this,Z))}set selectionMode(G){T(ce(this,Z),G)}get nodeTypes(){return r(ce(this,Y))}set nodeTypes(G){T(ce(this,Y),G)}get edgeTypes(){return r(ce(this,Q))}set edgeTypes(G){T(ce(this,Q),G)}get noPanClass(){return r(ce(this,ee))}set noPanClass(G){T(ce(this,ee),G)}get noDragClass(){return r(ce(this,se))}set noDragClass(G){T(ce(this,se),G)}get noWheelClass(){return r(ce(this,B))}set noWheelClass(G){T(ce(this,B),G)}get ariaLabelConfig(){return r(ce(this,K))}set ariaLabelConfig(G){T(ce(this,K),G)}get _viewport(){return r(ce(this,ne))}set _viewport(G){T(ce(this,ne),G)}get viewport(){return t.viewport??this._viewport}set viewport(G){t.viewport&&(t.viewport=G),this._viewport=G}get _connection(){return r(ce(this,re))}set _connection(G){T(ce(this,re),G)}get connection(){return r(ce(this,te))}set connection(G){T(ce(this,te),G)}get connectionMode(){return r(ce(this,pe))}set connectionMode(G){T(ce(this,pe),G)}get connectionRadius(){return r(ce(this,me))}set connectionRadius(G){T(ce(this,me),G)}get isValidConnection(){return r(ce(this,_e))}set isValidConnection(G){T(ce(this,_e),G)}get selectNodesOnDrag(){return r(ce(this,ke))}set selectNodesOnDrag(G){T(ce(this,ke),G)}get defaultMarkerColor(){return r(ce(this,he))}set defaultMarkerColor(G){T(ce(this,he),G)}get markers(){return r(ce(this,ge))}set markers(G){T(ce(this,ge),G)}get onlyRenderVisibleElements(){return r(ce(this,Ce))}set onlyRenderVisibleElements(G){T(ce(this,Ce),G)}get onerror(){return r(ce(this,Pe))}set onerror(G){T(ce(this,Pe),G)}get ondelete(){return r(ce(this,ue))}set ondelete(G){T(ce(this,ue),G)}get onbeforedelete(){return r(ce(this,le))}set onbeforedelete(G){T(ce(this,le),G)}get onbeforeconnect(){return r(ce(this,we))}set onbeforeconnect(G){T(ce(this,we),G)}get onconnect(){return r(ce(this,Me))}set onconnect(G){T(ce(this,Me),G)}get onconnectstart(){return r(ce(this,Ne))}set onconnectstart(G){T(ce(this,Ne),G)}get onconnectend(){return r(ce(this,Te))}set onconnectend(G){T(ce(this,Te),G)}get onbeforereconnect(){return r(ce(this,ye))}set onbeforereconnect(G){T(ce(this,ye),G)}get onreconnect(){return r(ce(this,ze))}set onreconnect(G){T(ce(this,ze),G)}get onreconnectstart(){return r(ce(this,Ae))}set onreconnectstart(G){T(ce(this,Ae),G)}get onreconnectend(){return r(ce(this,Ke))}set onreconnectend(G){T(ce(this,Ke),G)}get clickConnect(){return r(ce(this,at))}set clickConnect(G){T(ce(this,at),G)}get onclickconnectstart(){return r(ce(this,Be))}set onclickconnectstart(G){T(ce(this,Be),G)}get onclickconnectend(){return r(ce(this,Qe))}set onclickconnectend(G){T(ce(this,Qe),G)}get clickConnectStartHandle(){return r(ce(this,dt))}set clickConnectStartHandle(G){T(ce(this,dt),G)}get onselectiondrag(){return r(ce(this,vt))}set onselectiondrag(G){T(ce(this,vt),G)}get onselectiondragstart(){return r(ce(this,Ge))}set onselectiondragstart(G){T(ce(this,Ge),G)}get onselectiondragstop(){return r(ce(this,Re))}set onselectiondragstop(G){T(ce(this,Re),G)}get colorMode(){return r(ce(this,Ie))}set colorMode(G){T(ce(this,Ie),G)}resetStoreValues(){this.dragging=!1,this.selectionRect=null,this.selectionRectMode=null,this.selectionKeyPressed=!1,this.multiselectionKeyPressed=!1,this.deleteKeyPressed=!1,this.panActivationKeyPressed=!1,this.zoomActivationKeyPressed=!1,this._connection=ci,this.clickConnectStartHandle=null,this.viewport=t.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=""}}return n=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,u=new WeakMap,f=new WeakMap,v=new WeakMap,x=new WeakMap,p=new WeakMap,w=new WeakMap,_=new WeakMap,I=new WeakMap,H=new WeakMap,D=new WeakMap,L=new WeakMap,V=new WeakMap,q=new WeakMap,U=new WeakMap,ie=new WeakMap,de=new WeakMap,ae=new WeakMap,$=new WeakMap,fe=new WeakMap,O=new WeakMap,b=new WeakMap,M=new WeakMap,m=new WeakMap,N=new WeakMap,C=new WeakMap,R=new WeakMap,F=new WeakMap,J=new WeakMap,A=new WeakMap,y=new WeakMap,S=new WeakMap,z=new WeakMap,W=new WeakMap,oe=new WeakMap,Z=new WeakMap,Y=new WeakMap,Q=new WeakMap,ee=new WeakMap,se=new WeakMap,B=new WeakMap,K=new WeakMap,ne=new WeakMap,re=new WeakMap,te=new WeakMap,pe=new WeakMap,me=new WeakMap,_e=new WeakMap,ke=new WeakMap,he=new WeakMap,ge=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,ue=new WeakMap,le=new WeakMap,we=new WeakMap,Me=new WeakMap,Ne=new WeakMap,Te=new WeakMap,ye=new WeakMap,ze=new WeakMap,Ae=new WeakMap,Ke=new WeakMap,at=new WeakMap,Be=new WeakMap,Qe=new WeakMap,dt=new WeakMap,vt=new WeakMap,Ge=new WeakMap,Re=new WeakMap,Ie=new WeakMap,new e}function rr(){const t=na(fi);if(!t)throw new Error("To call useStore outside of <SvelteFlow /> you need to wrap your component in a <SvelteFlowProvider />");return t.getStore()}const fi=Symbol();function J2(t){const e=Q2(t);function n(O){e.nodeTypes={...Xc,...O}}function o(O){e.edgeTypes={...Gc,...O}}function a(O){e.edges=Uy(O,e.edges)}const s=(O,b=!1)=>{e.nodes=e.nodes.map(M=>{if(e.connection.inProgress&&e.connection.fromNode.id===M.id){const N=e.nodeLookup.get(M.id);N&&(e.connection={...e.connection,from:Jn(N,e.connection.fromHandle,ft.Left,!0)})}const m=O.get(M.id);return m?{...M,position:m.position,dragging:b}:M})};function i(O){var N,C,R;const{changes:b,updatedInternals:M}=a2(O,e.nodeLookup,e.parentLookup,e.domNode,e.nodeOrigin,e.nodeExtent,e.zIndexMode);if(!M)return;Jy(e.nodeLookup,e.parentLookup,{nodeOrigin:e.nodeOrigin,nodeExtent:e.nodeExtent,zIndexMode:e.zIndexMode}),e.fitViewQueued&&e.resolveFitView();const m=new Map;for(const F of b){const J=(N=e.nodeLookup.get(F.id))==null?void 0:N.internals.userNode;if(!J)continue;const A={...J};switch(F.type){case"dimensions":{const y={...A.measured,...F.dimensions};F.setAttributes&&(A.width=((C=F.dimensions)==null?void 0:C.width)??A.width,A.height=((R=F.dimensions)==null?void 0:R.height)??A.height),A.measured=y;break}case"position":A.position=F.position??A.position;break}m.set(F.id,A)}e.nodes=e.nodes.map(F=>m.get(F.id)??F)}function l(O){const b=e.fitViewResolver??Promise.withResolvers();return e.fitViewQueued=!0,e.fitViewOptions=O,e.fitViewResolver=b,e.nodes=[...e.nodes],b.promise}async function u(O,b,M){const m=typeof(M==null?void 0:M.zoom)<"u"?M.zoom:e.maxZoom,N=e.panZoom;return N?(await N.setViewport({x:e.width/2-O*m,y:e.height/2-b*m,zoom:m},{duration:M==null?void 0:M.duration,ease:M==null?void 0:M.ease,interpolate:M==null?void 0:M.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)}function f(O,b){const M=e.panZoom;return M?M.scaleBy(O,b):Promise.resolve(!1)}function v(O){return f(1.2,O)}function x(O){return f(1/1.2,O)}function p(O){const b=e.panZoom;b&&(b.setScaleExtent([O,e.maxZoom]),e.minZoom=O)}function w(O){const b=e.panZoom;b&&(b.setScaleExtent([e.minZoom,O]),e.maxZoom=O)}function _(O){const b=e.panZoom;b&&(b.setTranslateExtent(O),e.translateExtent=O)}function I(O,b=null){let M=!1;const m=O.map(N=>(b?b.has(N.id):!0)&&N.selected?(M=!0,{...N,selected:!1}):N);return[M,m]}function H(O){const b=O!=null&&O.nodes?new Set(O.nodes.map(F=>F.id)):null,[M,m]=I(e.nodes,b);M&&(e.nodes=m);const N=O!=null&&O.edges?new Set(O.edges.map(F=>F.id)):null,[C,R]=I(e.edges,N);C&&(e.edges=R)}function D(O){const b=e.multiselectionKeyPressed;e.nodes=e.nodes.map(M=>{const m=O.includes(M.id),N=b&&M.selected||m;return!!M.selected!==N?{...M,selected:N}:M}),b||H({nodes:[]})}function L(O){const b=e.multiselectionKeyPressed;e.edges=e.edges.map(M=>{const m=O.includes(M.id),N=b&&M.selected||m;return!!M.selected!==N?{...M,selected:N}:M}),b||H({edges:[]})}function V(O,b,M){const m=e.nodeLookup.get(O);if(!m){console.warn("012",Br.error012(O));return}e.selectionRect=null,e.selectionRectMode=null,m.selected?(b||m.selected&&e.multiselectionKeyPressed)&&(H({nodes:[m],edges:[]}),requestAnimationFrame(()=>M==null?void 0:M.blur())):D([O])}function q(O){const b=e.edgeLookup.get(O);if(!b){console.warn("012",Br.error012(O));return}(b.selectable||e.elementsSelectable&&typeof b.selectable>"u")&&(e.selectionRect=null,e.selectionRectMode=null,b.selected?b.selected&&e.multiselectionKeyPressed&&H({nodes:[],edges:[b]}):L([O]))}function U(O,b){const{nodeExtent:M,snapGrid:m,nodeOrigin:N,nodeLookup:C,nodesDraggable:R,onerror:F}=e,J=new Map,A=(m==null?void 0:m[0])??5,y=(m==null?void 0:m[1])??5,S=O.x*A*b,z=O.y*y*b;for(const W of C.values()){if(!(W.selected&&(W.draggable||R&&typeof W.draggable>"u")))continue;let Z={x:W.internals.positionAbsolute.x+S,y:W.internals.positionAbsolute.y+z};m&&(Z=io(Z,m));const{position:Y,positionAbsolute:Q}=Ec({nodeId:W.id,nextPosition:Z,nodeLookup:C,nodeExtent:M,nodeOrigin:N,onError:F});W.position=Y,W.internals.positionAbsolute=Q,J.set(W.id,W)}s(J)}function ie(O){return i2({delta:O,panZoom:e.panZoom,transform:[e.viewport.x,e.viewport.y,e.viewport.zoom],translateExtent:e.translateExtent,width:e.width,height:e.height})}const de=O=>{e._connection={...O}};function ae(){e._connection=ci}function $(){e.resetStoreValues(),H()}return Object.assign(e,{setNodeTypes:n,setEdgeTypes:o,addEdge:a,updateNodePositions:s,updateNodeInternals:i,zoomIn:v,zoomOut:x,fitView:l,setCenter:u,setMinZoom:p,setMaxZoom:w,setTranslateExtent:_,unselectNodesAndEdges:H,addSelectedNodes:D,addSelectedEdges:L,handleNodeSelection:V,handleEdgeSelection:q,moveSelectedNodes:U,panBy:ie,updateConnection:de,cancelConnection:ae,reset:$})}function Da(t,e){const{minZoom:n,maxZoom:o,initialViewport:a,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l,translateExtent:u,setPanZoomInstance:f,onDraggingChange:v,onTransformChange:x}=e,p=k2({domNode:t,minZoom:n,maxZoom:o,translateExtent:u,viewport:a,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:v}),w=p.getViewport();return(a.x!==w.x||a.y!==w.y||a.zoom!==w.zoom)&&x([w.x,w.y,w.zoom]),f(p),p.update(e),{update(_){p.update(_)}}}var ew=k('<div class="svelte-flow__zoom svelte-flow__container"><!></div>');function tw(t,e){$e(e,!0);let n=qe(e,"store",15),o=E(()=>n().panActivationKeyPressed||e.panOnDrag),a=E(()=>n().panActivationKeyPressed||e.panOnScroll);const{viewport:s}=n();let i=!1;It(()=>{var f;!i&&n().viewportInitialized&&((f=e.oninit)==null||f.call(e),i=!0)});var l=ew(),u=d(l);St(u,()=>e.children),c(l),Xt(l,(f,v)=>Da==null?void 0:Da(f,v),()=>({viewport:n().viewport,minZoom:n().minZoom,maxZoom:n().maxZoom,initialViewport:s,onDraggingChange:f=>{n(n().dragging=f,!0)},setPanZoomInstance:f=>{n(n().panZoom=f,!0)},onPanZoomStart:e.onmovestart,onPanZoom:e.onmove,onPanZoomEnd:e.onmoveend,zoomOnScroll:e.zoomOnScroll,zoomOnDoubleClick:e.zoomOnDoubleClick,zoomOnPinch:e.zoomOnPinch,panOnScroll:r(a),panOnDrag:r(o),panOnScrollSpeed:e.panOnScrollSpeed,panOnScrollMode:e.panOnScrollMode,zoomActivationKeyPressed:n().zoomActivationKeyPressed,preventScrolling:typeof e.preventScrolling=="boolean"?e.preventScrolling:!0,noPanClassName:n().noPanClass,noWheelClassName:n().noWheelClass,userSelectionActive:!!n().selectionRect,translateExtent:n().translateExtent,lib:"svelte",paneClickDistance:e.paneClickDistance,selectionOnDrag:e.selectionOnDrag,onTransformChange:f=>{n(n().viewport={x:f[0],y:f[1],zoom:f[2]},!0)},connectionInProgress:n().connection.inProgress})),h(t,l),Ze()}function tl(t,e){return n=>{n.target===e&&(t==null||t(n))}}function nl(t){return e=>{const n=t.has(e.id);return!!e.selected!==n?{...e,selected:n}:e}}function rl(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}var nw=k("<div><!></div>");function rw(t,e){$e(e,!0);let n=qe(e,"store",15),o=qe(e,"panOnDrag",3,!0),a=qe(e,"paneClickDistance",3,1),s,i=null,l=new Set,u=new Set,f=E(()=>n().panActivationKeyPressed||o()),v=E(()=>n().selectionKeyPressed||!!n().selectionRect||e.selectionOnDrag&&r(f)!==!0),x=E(()=>n().elementsSelectable&&(r(v)||n().selectionRectMode==="user")),p=!1;function w(ae){var m,N;if(i=s==null?void 0:s.getBoundingClientRect(),!i)return;const $=ae.target===s,fe=!$&&!!ae.target.closest(".nokey"),O=e.selectionOnDrag&&$||n().selectionKeyPressed;if(fe||!r(v)||!O||ae.button!==0||!ae.isPrimary)return;(N=(m=ae.target)==null?void 0:m.setPointerCapture)==null||N.call(m,ae.pointerId),p=!1;const{x:b,y:M}=fn(ae,i);n(n().selectionRect={width:0,height:0,startX:b,startY:M,x:b,y:M},!0),$||(ae.stopPropagation(),ae.preventDefault())}function _(ae){var C;if(!r(v)||!i||!n().selectionRect)return;const $=fn(ae,i),{startX:fe=0,startY:O=0}=n().selectionRect;if(!p){const R=n().selectionKeyPressed?0:a();if(Math.hypot($.x-fe,$.y-O)<=R)return;n().unselectNodesAndEdges(),(C=e.onselectionstart)==null||C.call(e,ae)}p=!0;const b={...n().selectionRect,x:$.x<fe?$.x:fe,y:$.y<O?$.y:O,width:Math.abs($.x-fe),height:Math.abs($.y-O)},M=l,m=u;l=new Set(Ai(n().nodeLookup,b,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===Wo.Partial,!0).map(R=>R.id));const N=n().defaultEdgeOptions.selectable??!0;u=new Set;for(const R of l){const F=n().connectionLookup.get(R);if(F)for(const{edgeId:J}of F.values()){const A=n().edgeLookup.get(J);A&&(A.selectable??N)&&u.add(J)}}rl(M,l)||n(n().nodes=n().nodes.map(nl(l)),!0),rl(m,u)||n(n().edges=n().edges.map(nl(u)),!0),n(n().selectionRectMode="user",!0),n(n().selectionRect=b,!0)}function I(ae){var $,fe,O;ae.button===0&&((fe=($=ae.target)==null?void 0:$.releasePointerCapture)==null||fe.call($,ae.pointerId),!p&&ae.target===s&&(L==null||L(ae)),n(n().selectionRect=null,!0),p&&n(n().selectionRectMode=l.size>0?"nodes":null,!0),p&&((O=e.onselectionend)==null||O.call(e,ae)))}const H=ae=>{var $;if(Array.isArray(r(f))&&r(f).includes(2)){ae.preventDefault();return}($=e.onpanecontextmenu)==null||$.call(e,{event:ae})},D=ae=>{p&&(ae.stopPropagation(),p=!1)};function L(ae){var $;if(p||n().connection.inProgress){p=!1;return}($=e.onpaneclick)==null||$.call(e,{event:ae}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var V=nw();let q;var U=E(()=>r(x)?void 0:tl(L,s)),ie=E(()=>tl(H,s)),de=d(V);St(de,()=>e.children),c(V),tn(V,ae=>s=ae,()=>s),j(ae=>q=Oe(V,1,"svelte-flow__pane svelte-flow__container",null,q,ae),[()=>({draggable:o()===!0||Array.isArray(o())&&o().includes(0),dragging:n().dragging,selection:r(v)})]),be("click",V,function(...ae){var $;($=r(U))==null||$.apply(this,ae)}),zn("pointerdown",V,function(...ae){var $;($=r(x)?w:void 0)==null||$.apply(this,ae)},!0),be("pointermove",V,function(...ae){var $;($=r(x)?_:void 0)==null||$.apply(this,ae)}),be("pointerup",V,function(...ae){var $;($=r(x)?I:void 0)==null||$.apply(this,ae)}),be("contextmenu",V,function(...ae){var $;($=r(ie))==null||$.apply(this,ae)}),zn("click",V,function(...ae){var $;($=r(x)?D:void 0)==null||$.apply(this,ae)},!0),h(t,V),Ze()}Nt(["click","pointermove","pointerup","contextmenu"]);var ow=k('<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>');function aw(t,e){$e(e,!0);var n=ow();let o;var a=d(n);St(a,()=>e.children),c(n),j(()=>o=$t(n,"",o,{transform:`translate(${e.store.viewport.x??""}px, ${e.store.viewport.y??""}px) scale(${e.store.viewport.zoom??""})`})),h(t,n),Ze()}function pr(t,e){const{store:n,onDrag:o,onDragStart:a,onDragStop:s,onNodeMouseDown:i}=e,l=d2({onDrag:o,onDragStart:a,onDragStop:s,onNodeMouseDown:i,getStoreItems:()=>{const{snapGrid:f,viewport:v}=n;return{nodes:n.nodes,nodeLookup:n.nodeLookup,edges:n.edges,nodeExtent:n.nodeExtent,snapGrid:f||[0,0],snapToGrid:!!f,nodeOrigin:n.nodeOrigin,multiSelectionActive:n.multiselectionKeyPressed,domNode:n.domNode,transform:[v.x,v.y,v.zoom],autoPanOnNodeDrag:n.autoPanOnNodeDrag,nodesDraggable:n.nodesDraggable,selectNodesOnDrag:n.selectNodesOnDrag,nodeDragThreshold:n.nodeDragThreshold,unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,onSelectionDrag:n.onselectiondrag,onSelectionDragStart:n.onselectiondragstart,onSelectionDragStop:n.onselectiondragstop,panBy:n.panBy}}});function u(f,v){if(v.disabled){l.destroy();return}l.update({domNode:f,noDragClassName:v.noDragClass,handleSelector:v.handleSelector,nodeId:v.nodeId,isSelectable:v.isSelectable,nodeClickDistance:v.nodeClickDistance})}return u(t,e),{update(f){u(t,f)},destroy(){l.destroy()}}}var iw=k('<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-1r7ybe1"> </div>'),sw=k('<div class="a11y-hidden svelte-1r7ybe1"> </div> <div class="a11y-hidden svelte-1r7ybe1"> </div> <!>',1);function lw(t,e){$e(e,!0);var n=sw(),o=ve(n),a=d(o,!0);c(o);var s=g(o,2),i=d(s,!0);c(s);var l=g(s,2);{var u=f=>{var v=iw(),x=d(v,!0);c(v),j(()=>{Se(v,"id",`${cw}-${e.store.flowId}`),P(x,e.store.ariaLiveMessage)}),h(f,v)};X(l,f=>{e.store.disableKeyboardA11y||f(u)})}j(()=>{Se(o,"id",`${$c}-${e.store.flowId}`),P(a,e.store.disableKeyboardA11y?e.store.ariaLabelConfig["node.a11yDescription.default"]:e.store.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]),Se(s,"id",`${Zc}-${e.store.flowId}`),P(i,e.store.ariaLabelConfig["edge.a11yDescription.default"])}),h(t,n),Ze()}const $c="svelte-flow__node-desc",Zc="svelte-flow__edge-desc",cw="svelte-flow__aria-live";var dw=k("<div><!></div>");function uw(t,e){$e(e,!0);let n=qe(e,"store",15),o=E(()=>Yt(e.node.data,()=>({}),!0)),a=E(()=>Yt(e.node.selected,!1)),s=E(()=>e.node.draggable),i=E(()=>e.node.selectable),l=E(()=>Yt(e.node.deletable,!0)),u=E(()=>e.node.connectable),f=E(()=>e.node.focusable),v=E(()=>Yt(e.node.hidden,!1)),x=E(()=>Yt(e.node.dragging,!1)),p=E(()=>Yt(e.node.style,"")),w=E(()=>e.node.class),_=E(()=>Yt(e.node.type,"default")),I=E(()=>e.node.parentId),H=E(()=>e.node.sourcePosition),D=E(()=>e.node.targetPosition),L=E(()=>Yt(e.node.measured,()=>({width:0,height:0}),!0).width),V=E(()=>Yt(e.node.measured,()=>({width:0,height:0}),!0).height),q=E(()=>e.node.initialWidth),U=E(()=>e.node.initialHeight),ie=E(()=>e.node.width),de=E(()=>e.node.height),ae=E(()=>e.node.dragHandle),$=E(()=>Yt(e.node.internals.z,0)),fe=E(()=>e.node.internals.positionAbsolute.x),O=E(()=>e.node.internals.positionAbsolute.y),b=E(()=>e.node.internals.userNode),{id:M}=e.node,m=E(()=>r(s)??n().nodesDraggable),N=E(()=>r(i)??n().elementsSelectable),C=E(()=>r(u)??n().nodesConnectable),R=E(()=>Ry(e.node)),F=E(()=>!!e.node.internals.handleBounds),J=E(()=>r(R)&&r(F)),A=E(()=>r(f)??n().nodesFocusable);function y(_e){return n().parentLookup.has(_e)}let S=E(()=>y(M)),z=xe(null),W=null,oe=r(_),Z=r(H),Y=r(D),Q=E(()=>n().nodeTypes[r(_)]??Wc),ee=E(()=>n().ariaLabelConfig),se={get value(){return r(C)}};C2(M),E2(se);let B=E(()=>{const _e=r(L)===void 0?r(ie)??r(q):r(ie),ke=r(V)===void 0?r(de)??r(U):r(de);if(!(_e===void 0&&ke===void 0&&r(p)===void 0))return`${r(p)};${_e?`width:${_n(_e)};`:""}${ke?`height:${_n(ke)};`:""}`});It(()=>{(r(_)!==oe||r(H)!==Z||r(D)!==Y)&&r(z)!==null&&requestAnimationFrame(()=>{r(z)!==null&&n().updateNodeInternals(new Map([[M,{id:M,nodeElement:r(z),force:!0}]]))}),oe=r(_),Z=r(H),Y=r(D)}),It(()=>{e.resizeObserver&&(!r(J)||r(z)!==W)&&(W&&e.resizeObserver.unobserve(W),r(z)&&e.resizeObserver.observe(r(z)),W=r(z))}),ra(()=>{var _e;W&&((_e=e.resizeObserver)==null||_e.unobserve(W))});function K(_e){var ke;r(N)&&(!n().selectNodesOnDrag||!r(m)||n().nodeDragThreshold>0)&&n().handleNodeSelection(M),(ke=e.onnodeclick)==null||ke.call(e,{node:r(b),event:_e})}function ne(_e){if(!(Ic(_e)||n().disableKeyboardA11y))if(Cc.includes(_e.key)&&r(N)){const ke=_e.key==="Escape";n().handleNodeSelection(M,ke,r(z))}else r(m)&&e.node.selected&&Object.prototype.hasOwnProperty.call(Zo,_e.key)&&(_e.preventDefault(),n(n().ariaLiveMessage=r(ee)["node.a11yDescription.ariaLiveMessage"]({direction:_e.key.replace("Arrow","").toLowerCase(),x:~~e.node.internals.positionAbsolute.x,y:~~e.node.internals.positionAbsolute.y}),!0),n().moveSelectedNodes(Zo[_e.key],_e.shiftKey?4:1))}const re=()=>{var Ce;if(n().disableKeyboardA11y||!n().autoPanOnNodeFocus||!((Ce=r(z))!=null&&Ce.matches(":focus-visible")))return;const{width:_e,height:ke,viewport:he}=n();Ai(new Map([[M,e.node]]),{x:0,y:0,width:_e,height:ke},[he.x,he.y,he.zoom],!0).length>0||n().setCenter(e.node.position.x+(e.node.measured.width??0)/2,e.node.position.y+(e.node.measured.height??0)/2,{zoom:he.zoom})};var te=Ve(),pe=ve(te);{var me=_e=>{var ke=dw();Dn(ke,()=>({"data-id":M,class:["svelte-flow__node",`svelte-flow__node-${r(_)}`,r(w)],style:r(B),onclick:K,onpointerenter:e.onnodepointerenter?ge=>e.onnodepointerenter({node:r(b),event:ge}):void 0,onpointerleave:e.onnodepointerleave?ge=>e.onnodepointerleave({node:r(b),event:ge}):void 0,onpointermove:e.onnodepointermove?ge=>e.onnodepointermove({node:r(b),event:ge}):void 0,oncontextmenu:e.onnodecontextmenu?ge=>e.onnodecontextmenu({node:r(b),event:ge}):void 0,onkeydown:r(A)?ne:void 0,onfocus:r(A)?re:void 0,tabIndex:r(A)?0:void 0,role:e.node.ariaRole??(r(A)?"group":void 0),"aria-roledescription":"node","aria-describedby":n().disableKeyboardA11y?void 0:`${$c}-${n().flowId}`,...e.node.domAttributes,[mi]:{dragging:r(x),selected:r(a),draggable:r(m),connectable:r(C),selectable:r(N),nopan:r(m),parent:r(S)},[aa]:{"z-index":r($),transform:`translate(${r(fe)??""}px, ${r(O)??""}px)`,visibility:r(R)?"visible":"hidden"}}));var he=d(ke);Gn(he,()=>r(Q),(ge,Ce)=>{Ce(ge,{get data(){return r(o)},get id(){return M},get selected(){return r(a)},get selectable(){return r(N)},get deletable(){return r(l)},get sourcePosition(){return r(H)},get targetPosition(){return r(D)},get zIndex(){return r($)},get dragging(){return r(x)},get draggable(){return r(m)},get dragHandle(){return r(ae)},get parentId(){return r(I)},get type(){return r(_)},get isConnectable(){return r(C)},get positionAbsoluteX(){return r(fe)},get positionAbsoluteY(){return r(O)},get width(){return r(ie)},get height(){return r(de)}})}),c(ke),Xt(ke,(ge,Ce)=>pr==null?void 0:pr(ge,Ce),()=>({nodeId:M,isSelectable:r(N),disabled:!r(m),handleSelector:r(ae),noDragClass:n().noDragClass,nodeClickDistance:e.nodeClickDistance,onNodeMouseDown:n().handleNodeSelection,onDrag:(ge,Ce,Pe,ue)=>{var le;(le=e.onnodedrag)==null||le.call(e,{event:ge,targetNode:Pe,nodes:ue})},onDragStart:(ge,Ce,Pe,ue)=>{var le;(le=e.onnodedragstart)==null||le.call(e,{event:ge,targetNode:Pe,nodes:ue})},onDragStop:(ge,Ce,Pe,ue)=>{var le;(le=e.onnodedragstop)==null||le.call(e,{event:ge,targetNode:Pe,nodes:ue})},store:n()})),tn(ke,ge=>T(z,ge),()=>r(z)),h(_e,ke)};X(pe,_e=>{r(v)||_e(me)})}h(t,te),Ze()}var fw=k('<div class="svelte-flow__nodes"></div>');function vw(t,e){$e(e,!0);let n=qe(e,"store",15);const o=typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const i=new Map;s.forEach(l=>{const u=l.target.getAttribute("data-id");i.set(u,{id:u,nodeElement:l.target,force:!0})}),n().updateNodeInternals(i)});ra(()=>{o==null||o.disconnect()});var a=fw();Je(a,21,()=>n().visible.nodes.values(),s=>s.id,(s,i)=>{uw(s,{get node(){return r(i)},get resizeObserver(){return o},get nodeClickDistance(){return e.nodeClickDistance},get onnodeclick(){return e.onnodeclick},get onnodepointerenter(){return e.onnodepointerenter},get onnodepointermove(){return e.onnodepointermove},get onnodepointerleave(){return e.onnodepointerleave},get onnodedrag(){return e.onnodedrag},get onnodedragstart(){return e.onnodedragstart},get onnodedragstop(){return e.onnodedragstop},get onnodecontextmenu(){return e.onnodecontextmenu},get store(){return n()},set store(l){n(l)}})}),c(a),h(t,a),Ze()}var gw=Vt('<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>');function pw(t,e){$e(e,!0);let n=E(()=>e.edge.id),o=E(()=>e.edge.source),a=E(()=>e.edge.target),s=E(()=>e.edge.sourceX),i=E(()=>e.edge.sourceY),l=E(()=>e.edge.targetX),u=E(()=>e.edge.targetY),f=E(()=>e.edge.sourcePosition),v=E(()=>e.edge.targetPosition),x=E(()=>Yt(e.edge.animated,!1)),p=E(()=>Yt(e.edge.selected,!1)),w=E(()=>e.edge.label),_=E(()=>e.edge.labelStyle),I=E(()=>Yt(e.edge.data,()=>({}),!0)),H=E(()=>e.edge.style),D=E(()=>e.edge.interactionWidth),L=E(()=>Yt(e.edge.type,"default")),V=E(()=>e.edge.sourceHandle),q=E(()=>e.edge.targetHandle),U=E(()=>e.edge.markerStart),ie=E(()=>e.edge.markerEnd),de=E(()=>e.edge.selectable),ae=E(()=>e.edge.focusable),$=E(()=>Yt(e.edge.deletable,!0)),fe=E(()=>e.edge.hidden),O=E(()=>e.edge.zIndex),b=E(()=>e.edge.class),M=E(()=>e.edge.ariaLabel);z2(r(n));let m=null,N=E(()=>r(de)??e.store.elementsSelectable),C=E(()=>r(ae)??e.store.edgesFocusable),R=E(()=>e.store.edgeTypes[r(L)]??Yc),F=E(()=>r(U)?`url('#${ui(r(U),e.store.flowId)}')`:void 0),J=E(()=>r(ie)?`url('#${ui(r(ie),e.store.flowId)}')`:void 0);function A(Z){var Q;const Y=e.store.edgeLookup.get(r(n));Y&&(r(N)&&e.store.handleEdgeSelection(r(n)),(Q=e.onedgeclick)==null||Q.call(e,{event:Z,edge:Y}))}function y(Z,Y){const Q=e.store.edgeLookup.get(r(n));Q&&Y({event:Z,edge:Q})}function S(Z){if(!e.store.disableKeyboardA11y&&Cc.includes(Z.key)&&r(N)){const{unselectNodesAndEdges:Y,addSelectedEdges:Q}=e.store;Z.key==="Escape"?(m==null||m.blur(),Y({edges:[e.edge]})):Q([r(n)])}}var z=Ve(),W=ve(z);{var oe=Z=>{var Y=gw();let Q;var ee=d(Y);Dn(ee,()=>({class:["svelte-flow__edge",r(b)],"data-id":r(n),onclick:A,oncontextmenu:e.onedgecontextmenu?B=>{y(B,e.onedgecontextmenu)}:void 0,onpointerenter:e.onedgepointerenter?B=>{y(B,e.onedgepointerenter)}:void 0,onpointerleave:e.onedgepointerleave?B=>{y(B,e.onedgepointerleave)}:void 0,"aria-label":r(M)===null?void 0:r(M)?r(M):`Edge from ${r(o)} to ${r(a)}`,"aria-describedby":r(C)?`${Zc}-${e.store.flowId}`:void 0,role:e.edge.ariaRole??(r(C)?"group":"img"),"aria-roledescription":"edge",onkeydown:r(C)?S:void 0,tabindex:r(C)?0:void 0,...e.edge.domAttributes,[mi]:{animated:r(x),selected:r(p),selectable:r(N)}}));var se=d(ee);Gn(se,()=>r(R),(B,K)=>{K(B,{get id(){return r(n)},get source(){return r(o)},get target(){return r(a)},get sourceX(){return r(s)},get sourceY(){return r(i)},get targetX(){return r(l)},get targetY(){return r(u)},get sourcePosition(){return r(f)},get targetPosition(){return r(v)},get animated(){return r(x)},get selected(){return r(p)},get label(){return r(w)},get labelStyle(){return r(_)},get data(){return r(I)},get style(){return r(H)},get interactionWidth(){return r(D)},get selectable(){return r(N)},get deletable(){return r($)},get type(){return r(L)},get sourceHandleId(){return r(V)},get targetHandleId(){return r(q)},get markerStart(){return r(F)},get markerEnd(){return r(J)}})}),c(ee),tn(ee,B=>m=B,()=>m),c(Y),j(()=>Q=$t(Y,"",Q,{"z-index":r(O)})),h(Z,Y)};X(W,Z=>{r(fe)||Z(oe)})}h(t,z),Ze()}var hw=Vt("<defs></defs>");function xw(t,e){$e(e,!1);const n=rr();Wd();var o=hw();Je(o,5,()=>n.markers,a=>a.id,(a,s)=>{yw(a,et(()=>r(s)))}),c(o),h(t,o),Ze()}var bw=Vt('<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>'),mw=Vt('<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),_w=Vt('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function yw(t,e){$e(e,!0);let n=qe(e,"width",3,12.5),o=qe(e,"height",3,12.5),a=qe(e,"markerUnits",3,"strokeWidth"),s=qe(e,"orient",3,"auto-start-reverse"),i=qe(e,"color",3,"none");var l=_w(),u=d(l);{var f=x=>{var p=bw();let w;j(()=>{Se(p,"stroke-width",e.strokeWidth),w=$t(p,"",w,{stroke:i()})}),h(x,p)},v=x=>{var p=mw();let w;j(()=>{Se(p,"stroke-width",e.strokeWidth),w=$t(p,"",w,{stroke:i(),fill:i()})}),h(x,p)};X(u,x=>{e.type===Yo.Arrow?x(f):e.type===Yo.ArrowClosed&&x(v,1)})}c(l),j(()=>{Se(l,"id",e.id),Se(l,"markerWidth",`${n()}`),Se(l,"markerHeight",`${o()}`),Se(l,"markerUnits",a()),Se(l,"orient",s())}),h(t,l),Ze()}var ww=k('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>');function kw(t,e){$e(e,!0);let n=qe(e,"store",15);var o=ww(),a=d(o),s=d(a);xw(s,{}),c(a);var i=g(a,2);Je(i,17,()=>n().visible.edges.values(),l=>l.id,(l,u)=>{pw(l,{get edge(){return r(u)},get onedgeclick(){return e.onedgeclick},get onedgecontextmenu(){return e.onedgecontextmenu},get onedgepointerenter(){return e.onedgepointerenter},get onedgepointerleave(){return e.onedgepointerleave},get store(){return n()},set store(f){n(f)}})}),c(o),h(t,o),Ze()}var Sw=k('<div class="svelte-flow__selection svelte-3lfgml"></div>');function Qc(t,e){$e(e,!0);let n=qe(e,"x",3,0),o=qe(e,"y",3,0),a=qe(e,"width",3,0),s=qe(e,"height",3,0),i=qe(e,"isVisible",3,!0);var l=Ve(),u=ve(l);{var f=v=>{var x=Sw();let p;j(w=>p=$t(x,"",p,w),[()=>({width:typeof a()=="string"?a():_n(a()),height:typeof s()=="string"?s():_n(s()),transform:`translate(${n()}px, ${o()}px)`})]),h(v,x)};X(u,v=>{i()&&v(f)})}h(t,l),Ze()}var Cw=k("<div><!></div>");function Nw(t,e){$e(e,!0);let n=xe(void 0);It(()=>{var x;e.store.disableKeyboardA11y||(x=r(n))==null||x.focus({preventScroll:!0})});let o=E(()=>{if(e.store.selectionRectMode==="nodes"){e.store.nodes;const x=ua(e.store.nodeLookup,{filter:p=>!!p.selected});if(x.width>0&&x.height>0)return x}return null});function a(x){var w;const p=e.store.nodes.filter(_=>_.selected);(w=e.onselectioncontextmenu)==null||w.call(e,{nodes:p,event:x})}function s(x){var w;const p=e.store.nodes.filter(_=>_.selected);(w=e.onselectionclick)==null||w.call(e,{nodes:p,event:x})}function i(x){Object.prototype.hasOwnProperty.call(Zo,x.key)&&(x.preventDefault(),e.store.moveSelectedNodes(Zo[x.key],x.shiftKey?4:1))}var l=Ve(),u=ve(l);{var f=x=>{var p=Cw();let w;var _=d(p);Qc(_,{width:"100%",height:"100%",x:0,y:0}),c(p),Xt(p,(I,H)=>pr==null?void 0:pr(I,H),()=>({disabled:!1,store:e.store,onDrag:(I,H,D,L)=>{var V;(V=e.onnodedrag)==null||V.call(e,{event:I,targetNode:null,nodes:L})},onDragStart:(I,H,D,L)=>{var V;(V=e.onnodedragstart)==null||V.call(e,{event:I,targetNode:null,nodes:L})},onDragStop:(I,H,D,L)=>{var V;(V=e.onnodedragstop)==null||V.call(e,{event:I,targetNode:null,nodes:L})}})),tn(p,I=>T(n,I),()=>r(n)),j(I=>{Oe(p,1,We(["svelte-flow__selection-wrapper",e.store.noPanClass]),"svelte-148ck9l"),Se(p,"role",e.store.disableKeyboardA11y?void 0:"button"),Se(p,"tabindex",e.store.disableKeyboardA11y?void 0:-1),w=$t(p,"",w,I)},[()=>({width:_n(r(o).width),height:_n(r(o).height),transform:`translate(${r(o).x??""}px, ${r(o).y??""}px)`})]),be("contextmenu",p,a),be("click",p,s),be("keydown",p,function(...I){var H;(H=e.store.disableKeyboardA11y?void 0:i)==null||H.apply(this,I)}),h(x,p)},v=E(()=>e.store.selectionRectMode==="nodes"&&r(o)&&En(r(o).x)&&En(r(o).y));X(u,x=>{r(v)&&x(f)})}h(t,l),Ze()}Nt(["contextmenu","click","keydown"]);function Ew(t){switch(t){case"ctrl":return 8;case"shift":return 4;case"alt":return 2;case"meta":return 1}}function Ct(t,e){let{enabled:n=!0,trigger:o,type:a="keydown"}=e;function s(l){var v;const u=Array.isArray(o)?o:[o],f=[l.metaKey,l.altKey,l.shiftKey,l.ctrlKey].reduce((x,p,w)=>p?x|1<<w:x,0);for(const x of u){const p={preventDefault:!1,enabled:!0,...x},{modifier:w,key:_,callback:I,preventDefault:H,enabled:D}=p;if(D){if(l.key!==_)continue;if(w===null||w===!1){if(f!==0)continue}else if(w!==void 0&&((v=w==null?void 0:w[0])==null?void 0:v.length)>0){const V=Array.isArray(w)?w:[w];let q=!1;for(const U of V)if((Array.isArray(U)?U:[U]).reduce((de,ae)=>de|Ew(ae),0)===f){q=!0;break}if(!q)continue}H&&l.preventDefault();const L={node:t,trigger:p,originalEvent:l};t.dispatchEvent(new CustomEvent("shortcut",{detail:L})),I==null||I(L)}}}let i;return n&&(i=Ka(t,a,s)),{update:l=>{const{enabled:u=!0,type:f="keydown"}=l;n&&(!u||a!==f)?i==null||i():!n&&u&&(i=Ka(t,f,s)),n=u,a=f,o=l.trigger},destroy:()=>{i==null||i()}}}function Mw(){const t=E(rr),e=s=>{var f,v;const i=Js(s)?s:r(t).nodeLookup.get(s.id),l=i.parentId?Dy(i.position,i.measured,i.parentId,r(t).nodeLookup,r(t).nodeOrigin):i.position,u={...i,position:l,width:((f=i.measured)==null?void 0:f.width)??i.width,height:((v=i.measured)==null?void 0:v.height)??i.height};return wr(u)};function n(s,i,l={replace:!1}){r(t).nodes=Cn(()=>r(t).nodes).map(u=>{if(u.id===s){const f=typeof i=="function"?i(u):i;return l!=null&&l.replace&&Js(f)?f:{...u,...f}}return u})}function o(s,i,l={replace:!1}){r(t).edges=Cn(()=>r(t).edges).map(u=>{if(u.id===s){const f=typeof i=="function"?i(u):i;return l.replace&&V2(f)?f:{...u,...f}}return u})}const a=s=>r(t).nodeLookup.get(s);return{zoomIn:r(t).zoomIn,zoomOut:r(t).zoomOut,getInternalNode:a,getNode:s=>{var i;return(i=a(s))==null?void 0:i.internals.userNode},getNodes:s=>s===void 0?r(t).nodes:ol(r(t).nodeLookup,s),getEdge:s=>r(t).edgeLookup.get(s),getEdges:s=>s===void 0?r(t).edges:ol(r(t).edgeLookup,s),setZoom:(s,i)=>{const l=r(t).panZoom;return l?l.scaleTo(s,i):Promise.resolve(!1)},getZoom:()=>r(t).viewport.zoom,setViewport:async(s,i)=>{const l=r(t).viewport;return r(t).panZoom?(await r(t).panZoom.setViewport({x:s.x??l.x,y:s.y??l.y,zoom:s.zoom??l.zoom},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>pl(r(t).viewport),setCenter:async(s,i,l)=>r(t).setCenter(s,i,l),fitView:s=>r(t).fitView(s),fitBounds:async(s,i)=>{if(!r(t).panZoom)return Promise.resolve(!1);const l=Li(s,r(t).width,r(t).height,r(t).minZoom,r(t).maxZoom,(i==null?void 0:i.padding)??.1);return await r(t).panZoom.setViewport(l,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)},getIntersectingNodes:(s,i=!0,l)=>{const u=Fs(s),f=u?s:e(s);return f?(l||r(t).nodes).filter(v=>{const x=r(t).nodeLookup.get(v.id);if(!x||!u&&v.id===s.id)return!1;const p=wr(x),w=jr(p,f);return i&&w>0||w>=p.width*p.height||w>=f.width*f.height}):[]},isNodeIntersecting:(s,i,l=!0)=>{const f=Fs(s)?s:e(s);if(!f)return!1;const v=jr(f,i);return l&&v>0||v>=i.width*i.height||v>=f.width*f.height},deleteElements:async({nodes:s=[],edges:i=[]})=>{var f,v;const{nodes:l,edges:u}=await Py({nodesToRemove:s,edgesToRemove:i,nodes:r(t).nodes,edges:r(t).edges,onBeforeDelete:r(t).onbeforedelete});return l&&(r(t).nodes=Cn(()=>r(t).nodes).filter(x=>!l.some(({id:p})=>p===x.id))),u&&(r(t).edges=Cn(()=>r(t).edges).filter(x=>!u.some(({id:p})=>p===x.id))),(l.length>0||u.length>0)&&((v=(f=r(t)).ondelete)==null||v.call(f,{nodes:l,edges:u})),{deletedNodes:l,deletedEdges:u}},screenToFlowPosition:(s,i={snapToGrid:!0})=>{if(!r(t).domNode)return s;const l=i.snapToGrid?r(t).snapGrid:!1,{x:u,y:f,zoom:v}=r(t).viewport,{x,y:p}=r(t).domNode.getBoundingClientRect(),w={x:s.x-x,y:s.y-p};return so(w,[u,f,v],l!==null,l||[1,1])},flowToScreenPosition:s=>{if(!r(t).domNode)return s;const{x:i,y:l,zoom:u}=r(t).viewport,{x:f,y:v}=r(t).domNode.getBoundingClientRect(),x=Go(s,[i,l,u]);return{x:x.x+f,y:x.y+v}},toObject:()=>structuredClone({nodes:[...r(t).nodes],edges:[...r(t).edges],viewport:{...r(t).viewport}}),updateNode:n,updateNodeData:(s,i,l)=>{var v;const u=(v=r(t).nodeLookup.get(s))==null?void 0:v.internals.userNode;if(!u)return;const f=typeof i=="function"?i(u):i;n(s,x=>({...x,data:l!=null&&l.replace?f:{...x.data,...f}}))},updateEdge:o,getNodesBounds:s=>Ey(s,{nodeLookup:r(t).nodeLookup,nodeOrigin:r(t).nodeOrigin}),getHandleConnections:({type:s,id:i,nodeId:l})=>{var u;return Array.from(((u=r(t).connectionLookup.get(`${l}-${s}-${i??null}`))==null?void 0:u.values())??[])}}}function ol(t,e){var o;const n=[];for(const a of e){const s=t.get(a);if(s){const i="internals"in s?(o=s.internals)==null?void 0:o.userNode:s;n.push(i)}}return n}function zw(t,e){$e(e,!0);let n=qe(e,"store",15),o=qe(e,"selectionKey",3,"Shift"),a=qe(e,"multiSelectionKey",19,()=>$o()?"Meta":"Control"),s=qe(e,"deleteKey",3,"Backspace"),i=qe(e,"panActivationKey",3," "),l=qe(e,"zoomActivationKey",19,()=>$o()?"Meta":"Control"),{deleteElements:u}=Mw();function f(I){return I!==null&&typeof I=="object"}function v(I){return f(I)?I.modifier||[]:[]}function x(I){return I==null?"":f(I)?I.key:I}function p(I,H){return(Array.isArray(I)?I:[I]).map(L=>{const V=x(L);return{key:V,modifier:v(L),enabled:V!==null,callback:H}})}function w(){n(n().selectionRect=null,!0),n(n().selectionKeyPressed=!1,!0),n(n().multiselectionKeyPressed=!1,!0),n(n().deleteKeyPressed=!1,!0),n(n().panActivationKeyPressed=!1,!0),n(n().zoomActivationKeyPressed=!1,!0)}function _(){const I=n().nodes.filter(D=>D.selected),H=n().edges.filter(D=>D.selected);u({nodes:I,edges:H})}zn("blur",Jt,w),zn("contextmenu",Jt,w),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(o(),()=>n(n().selectionKeyPressed=!0,!0)),type:"keydown"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(o(),()=>n(n().selectionKeyPressed=!1,!0)),type:"keyup"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(a(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:"keydown"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(a(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:"keyup"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(s(),I=>{!(I.originalEvent.ctrlKey||I.originalEvent.metaKey||I.originalEvent.shiftKey)&&!Ic(I.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),_())}),type:"keydown"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(s(),()=>n(n().deleteKeyPressed=!1,!0)),type:"keyup"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(i(),()=>n(n().panActivationKeyPressed=!0,!0)),type:"keydown"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(i(),()=>n(n().panActivationKeyPressed=!1,!0)),type:"keyup"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(l(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:"keydown"})),Xt(Jt,(I,H)=>Ct==null?void 0:Ct(I,H),()=>({trigger:p(l(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:"keyup"})),Ze()}var Tw=Vt('<path fill="none" class="svelte-flow__connection-path"></path>'),Pw=Vt('<svg class="svelte-flow__connectionline"><g><!></g></svg>');function Iw(t,e){$e(e,!0);let n=E(()=>{if(!e.store.connection.inProgress)return"";const i={sourceX:e.store.connection.from.x,sourceY:e.store.connection.from.y,sourcePosition:e.store.connection.fromPosition,targetX:e.store.connection.to.x,targetY:e.store.connection.to.y,targetPosition:e.store.connection.toPosition};switch(e.type){case Ln.Bezier:{const[l]=Lc(i);return l}case Ln.Straight:{const[l]=Rc(i);return l}case Ln.Step:case Ln.SmoothStep:{const[l]=Oi({...i,borderRadius:e.type===Ln.Step?0:void 0});return l}}});var o=Ve(),a=ve(o);{var s=i=>{var l=Pw(),u=d(l),f=d(u);{var v=p=>{var w=Ve(),_=ve(w);Gn(_,()=>e.LineComponent,(I,H)=>{H(I,{})}),h(p,w)},x=p=>{var w=Tw();j(()=>{Se(w,"d",r(n)),$t(w,e.style)}),h(p,w)};X(f,p=>{e.LineComponent?p(v):p(x,-1)})}c(u),c(l),j(p=>{Se(l,"width",e.store.width),Se(l,"height",e.store.height),$t(l,e.containerStyle),Oe(u,0,p)},[()=>We(["svelte-flow__connection",Cy(e.store.connection.isValid)])]),h(i,l)};X(a,i=>{e.store.connection.inProgress&&i(s)})}h(t,o),Ze()}var Aw=k("<div><!></div>");function Jc(t,e){$e(e,!0);let n=qe(e,"position",3,"top-right"),o=er(e,["$$slots","$$events","$$legacy","position","style","class","children"]),a=E(()=>`${n()}`.split("-"));var s=Aw();Dn(s,l=>({class:l,style:e.style,...o}),[()=>["svelte-flow__panel",e.class,...r(a)]]);var i=d(s);St(i,()=>e.children??Gt),c(s),h(t,s),Ze()}var Lw=k('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function Ow(t,e){$e(e,!0);let n=qe(e,"position",3,"bottom-right");var o=Ve(),a=ve(o);{var s=i=>{Jc(i,{get position(){return n()},class:"svelte-flow__attribution","data-message":"Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us",children:(l,u)=>{var f=Lw();h(l,f)},$$slots:{default:!0}})};X(a,i=>{var l;(l=e.proOptions)!=null&&l.hideAttribution||i(s)})}h(t,o),Ze()}var Rw=k("<div><!></div>");function Dw(t,e){$e(e,!0);let n=qe(e,"domNode",15),o=qe(e,"clientWidth",15),a=qe(e,"clientHeight",15),s=E(()=>e.rest.class),i=E(()=>Ad(e.rest,["id","class","nodeTypes","edgeTypes","colorMode","isValidConnection","onmove","onmovestart","onmoveend","onflowerror","ondelete","onbeforedelete","onbeforeconnect","onconnect","onconnectstart","onconnectend","onbeforereconnect","onreconnect","onreconnectstart","onreconnectend","onclickconnectstart","onclickconnectend","oninit","onselectionchange","onselectiondragstart","onselectiondrag","onselectiondragstop","onselectionstart","onselectionend","clickConnect","fitView","fitViewOptions","nodeOrigin","nodeDragThreshold","connectionDragThreshold","minZoom","maxZoom","initialViewport","connectionRadius","connectionMode","selectionMode","selectNodesOnDrag","snapGrid","defaultMarkerColor","translateExtent","nodeExtent","onlyRenderVisibleElements","autoPanOnConnect","autoPanOnNodeDrag","colorModeSSR","defaultEdgeOptions","elevateNodesOnSelect","elevateEdgesOnSelect","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","elementsSelectable","nodesFocusable","edgesFocusable","disableKeyboardA11y","noDragClass","noPanClass","noWheelClass","ariaLabelConfig","autoPanSpeed","panOnScrollSpeed","zIndexMode"]));function l(v){v.currentTarget.scrollTo({top:0,left:0,behavior:"auto"}),e.rest.onscroll&&e.rest.onscroll(v)}var u=Rw();Dn(u,v=>({class:["svelte-flow","svelte-flow__container",r(s),e.colorMode],"data-testid":"svelte-flow__wrapper",role:"application",onscroll:l,...r(i),[aa]:v}),[()=>({width:_n(e.width),height:_n(e.height)})],void 0,void 0,"svelte-1ywk9tc");var f=d(u);St(f,()=>e.children??Gt),c(u),tn(u,v=>n(v),()=>n()),Zi(u,"clientHeight",a),Zi(u,"clientWidth",o),h(t,u),Ze()}var Vw=k('<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>',1),Hw=k("<!> <!>",1),qw=k("<!> <!> <!> <!> <!>",1);function Fw(t,e){$e(e,!0);let n=qe(e,"paneClickDistance",3,1),o=qe(e,"nodeClickDistance",3,1),a=qe(e,"panOnScrollMode",19,()=>gr.Free),s=qe(e,"preventScrolling",3,!0),i=qe(e,"zoomOnScroll",3,!0),l=qe(e,"zoomOnDoubleClick",3,!0),u=qe(e,"zoomOnPinch",3,!0),f=qe(e,"panOnScroll",3,!1),v=qe(e,"panOnScrollSpeed",3,.5),x=qe(e,"panOnDrag",3,!0),p=qe(e,"selectionOnDrag",3,!1),w=qe(e,"connectionLineType",19,()=>Ln.Bezier),_=qe(e,"nodes",31,()=>kt([])),I=qe(e,"edges",31,()=>kt([])),H=qe(e,"viewport",15,void 0),D=er(e,["$$slots","$$events","$$legacy","width","height","proOptions","selectionKey","deleteKey","panActivationKey","multiSelectionKey","zoomActivationKey","paneClickDistance","nodeClickDistance","onmovestart","onmoveend","onmove","oninit","onnodeclick","onnodecontextmenu","onnodedrag","onnodedragstart","onnodedragstop","onnodepointerenter","onnodepointermove","onnodepointerleave","onselectionclick","onselectioncontextmenu","onselectionstart","onselectionend","onedgeclick","onedgecontextmenu","onedgepointerenter","onedgepointerleave","onpaneclick","onpanecontextmenu","panOnScrollMode","preventScrolling","zoomOnScroll","zoomOnDoubleClick","zoomOnPinch","panOnScroll","panOnScrollSpeed","panOnDrag","selectionOnDrag","connectionLineComponent","connectionLineStyle","connectionLineContainerStyle","connectionLineType","attributionPosition","children","nodes","edges","viewport"]),L=J2({props:D,width:e.width,height:e.height,get nodes(){return _()},set nodes(q){_(q)},get edges(){return I()},set edges(q){I(q)},get viewport(){return H()},set viewport(q){H(q)}});const V=na(fi);V&&V.setStore&&V.setStore(L),hi(fi,{provider:!1,getStore(){return L}}),It(()=>{var U;const q={nodes:L.selectedNodes,edges:L.selectedEdges};(U=Cn(()=>e.onselectionchange))==null||U(q);for(const ie of L.selectionChangeHandlers.values())ie(q)}),ra(()=>{L.reset()}),Dw(t,{get colorMode(){return L.colorMode},get width(){return e.width},get height(){return e.height},get rest(){return D},get domNode(){return L.domNode},set domNode(q){L.domNode=q},get clientWidth(){return L.width},set clientWidth(q){L.width=q},get clientHeight(){return L.height},set clientHeight(q){L.height=q},children:(q,U)=>{var ie=qw(),de=ve(ie);zw(de,{get selectionKey(){return e.selectionKey},get deleteKey(){return e.deleteKey},get panActivationKey(){return e.panActivationKey},get multiSelectionKey(){return e.multiSelectionKey},get zoomActivationKey(){return e.zoomActivationKey},get store(){return L},set store(b){L=b}});var ae=g(de,2);tw(ae,{get panOnScrollMode(){return a()},get preventScrolling(){return s()},get zoomOnScroll(){return i()},get zoomOnDoubleClick(){return l()},get zoomOnPinch(){return u()},get panOnScroll(){return f()},get panOnScrollSpeed(){return v()},get panOnDrag(){return x()},get paneClickDistance(){return n()},get selectionOnDrag(){return p()},get onmovestart(){return e.onmovestart},get onmove(){return e.onmove},get onmoveend(){return e.onmoveend},get oninit(){return e.oninit},get store(){return L},set store(b){L=b},children:(b,M)=>{rw(b,{get onpaneclick(){return e.onpaneclick},get onpanecontextmenu(){return e.onpanecontextmenu},get onselectionstart(){return e.onselectionstart},get onselectionend(){return e.onselectionend},get panOnDrag(){return x()},get paneClickDistance(){return n()},get selectionOnDrag(){return p()},get store(){return L},set store(m){L=m},children:(m,N)=>{var C=Hw(),R=ve(C);aw(R,{get store(){return L},set store(J){L=J},children:(J,A)=>{var y=Vw(),S=g(ve(y),2);kw(S,{get onedgeclick(){return e.onedgeclick},get onedgecontextmenu(){return e.onedgecontextmenu},get onedgepointerenter(){return e.onedgepointerenter},get onedgepointerleave(){return e.onedgepointerleave},get store(){return L},set store(Z){L=Z}});var z=g(S,4);Iw(z,{get type(){return w()},get LineComponent(){return e.connectionLineComponent},get containerStyle(){return e.connectionLineContainerStyle},get style(){return e.connectionLineStyle},get store(){return L},set store(Z){L=Z}});var W=g(z,2);vw(W,{get nodeClickDistance(){return o()},get onnodeclick(){return e.onnodeclick},get onnodecontextmenu(){return e.onnodecontextmenu},get onnodepointerenter(){return e.onnodepointerenter},get onnodepointermove(){return e.onnodepointermove},get onnodepointerleave(){return e.onnodepointerleave},get onnodedrag(){return e.onnodedrag},get onnodedragstart(){return e.onnodedragstart},get onnodedragstop(){return e.onnodedragstop},get store(){return L},set store(Z){L=Z}});var oe=g(W,2);Nw(oe,{get onselectionclick(){return e.onselectionclick},get onselectioncontextmenu(){return e.onselectioncontextmenu},get onnodedrag(){return e.onnodedrag},get onnodedragstart(){return e.onnodedragstart},get onnodedragstop(){return e.onnodedragstop},get store(){return L},set store(Z){L=Z}}),Ee(2),h(J,y)},$$slots:{default:!0}});var F=g(R,2);{let J=E(()=>!!(L.selectionRect&&L.selectionRectMode==="user")),A=E(()=>{var W;return(W=L.selectionRect)==null?void 0:W.width}),y=E(()=>{var W;return(W=L.selectionRect)==null?void 0:W.height}),S=E(()=>{var W;return(W=L.selectionRect)==null?void 0:W.x}),z=E(()=>{var W;return(W=L.selectionRect)==null?void 0:W.y});Qc(F,{get isVisible(){return r(J)},get width(){return r(A)},get height(){return r(y)},get x(){return r(S)},get y(){return r(z)}})}h(m,C)},$$slots:{default:!0}})},$$slots:{default:!0}});var $=g(ae,2);Ow($,{get proOptions(){return e.proOptions},get position(){return e.attributionPosition}});var fe=g($,2);lw(fe,{get store(){return L}});var O=g(fe,2);St(O,()=>e.children??Gt),h(q,ie)},$$slots:{default:!0}}),Ze()}var Kw=k("<button><!></button>");function Co(t,e){let n=er(e,["$$slots","$$events","$$legacy","class","bgColor","bgColorHover","color","colorHover","borderColor","onclick","children"]);var o=Kw();Dn(o,()=>({type:"button",onclick:e.onclick,class:["svelte-flow__controls-button",e.class],...n,[aa]:{"--xy-controls-button-background-color-props":e.bgColor,"--xy-controls-button-background-color-hover-props":e.bgColorHover,"--xy-controls-button-color-props":e.color,"--xy-controls-button-color-hover-props":e.colorHover,"--xy-controls-button-border-color-props":e.borderColor}}));var a=d(o);St(a,()=>e.children??Gt),c(o),h(t,o)}var Bw=Vt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>');function jw(t){var e=Bw();h(t,e)}var Uw=Vt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function Ww(t){var e=Uw();h(t,e)}var Yw=Vt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg>');function Xw(t){var e=Yw();h(t,e)}var Gw=Vt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"></path></svg>');function $w(t){var e=Gw();h(t,e)}var Zw=Vt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg>');function Qw(t){var e=Zw();h(t,e)}var Jw=k("<!> <!>",1),e3=k("<!> <!> <!> <!> <!> <!>",1);function t3(t,e){$e(e,!0);let n=qe(e,"position",3,"bottom-left"),o=qe(e,"orientation",3,"vertical"),a=qe(e,"showZoom",3,!0),s=qe(e,"showFitView",3,!0),i=qe(e,"showLock",3,!0),l=er(e,["$$slots","$$events","$$legacy","position","orientation","showZoom","showFitView","showLock","style","class","buttonBgColor","buttonBgColorHover","buttonColor","buttonColorHover","buttonBorderColor","fitViewOptions","children","before","after"]),u=E(rr);const f={bgColor:e.buttonBgColor,bgColorHover:e.buttonBgColorHover,color:e.buttonColor,colorHover:e.buttonColorHover,borderColor:e.buttonBorderColor};let v=E(()=>r(u).nodesDraggable||r(u).nodesConnectable||r(u).elementsSelectable),x=E(()=>r(u).viewport.zoom<=r(u).minZoom),p=E(()=>r(u).viewport.zoom>=r(u).maxZoom),w=E(()=>r(u).ariaLabelConfig),_=E(()=>o()==="horizontal"?"horizontal":"vertical");const I=()=>{r(u).zoomIn()},H=()=>{r(u).zoomOut()},D=()=>{r(u).fitView(e.fitViewOptions)},L=()=>{let V=!r(v);r(u).nodesDraggable=V,r(u).nodesConnectable=V,r(u).elementsSelectable=V};{let V=E(()=>["svelte-flow__controls",r(_),e.class]);Jc(t,et({get class(){return r(V)},get position(){return n()},"data-testid":"svelte-flow__controls",get"aria-label"(){return r(w)["controls.ariaLabel"]},get style(){return e.style}},()=>l,{children:(q,U)=>{var ie=e3(),de=ve(ie);{var ae=J=>{var A=Ve(),y=ve(A);St(y,()=>e.before),h(J,A)};X(de,J=>{e.before&&J(ae)})}var $=g(de,2);{var fe=J=>{var A=Jw(),y=ve(A);Co(y,et({onclick:I,class:"svelte-flow__controls-zoomin",get title(){return r(w)["controls.zoomIn.ariaLabel"]},get"aria-label"(){return r(w)["controls.zoomIn.ariaLabel"]},get disabled(){return r(p)}},()=>f,{children:(z,W)=>{jw(z)},$$slots:{default:!0}}));var S=g(y,2);Co(S,et({onclick:H,class:"svelte-flow__controls-zoomout",get title(){return r(w)["controls.zoomOut.ariaLabel"]},get"aria-label"(){return r(w)["controls.zoomOut.ariaLabel"]},get disabled(){return r(x)}},()=>f,{children:(z,W)=>{Ww(z)},$$slots:{default:!0}})),h(J,A)};X($,J=>{a()&&J(fe)})}var O=g($,2);{var b=J=>{Co(J,et({class:"svelte-flow__controls-fitview",onclick:D,get title(){return r(w)["controls.fitView.ariaLabel"]},get"aria-label"(){return r(w)["controls.fitView.ariaLabel"]}},()=>f,{children:(A,y)=>{Xw(A)},$$slots:{default:!0}}))};X(O,J=>{s()&&J(b)})}var M=g(O,2);{var m=J=>{Co(J,et({class:"svelte-flow__controls-interactive",onclick:L,get title(){return r(w)["controls.interactive.ariaLabel"]},get"aria-label"(){return r(w)["controls.interactive.ariaLabel"]}},()=>f,{children:(A,y)=>{var S=Ve(),z=ve(S);{var W=Z=>{Qw(Z)},oe=Z=>{$w(Z)};X(z,Z=>{r(v)?Z(W):Z(oe,-1)})}h(A,S)},$$slots:{default:!0}}))};X(M,J=>{i()&&J(m)})}var N=g(M,2);{var C=J=>{var A=Ve(),y=ve(A);St(y,()=>e.children),h(J,A)};X(N,J=>{e.children&&J(C)})}var R=g(N,2);{var F=J=>{var A=Ve(),y=ve(A);St(y,()=>e.after),h(J,A)};X(R,J=>{e.after&&J(F)})}h(q,ie)},$$slots:{default:!0}}))}Ze()}var Mn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Mn||(Mn={}));var n3=Vt("<circle></circle>");function r3(t,e){var n=n3();j(()=>{Se(n,"cx",e.radius),Se(n,"cy",e.radius),Se(n,"r",e.radius),Oe(n,0,We(["svelte-flow__background-pattern","dots",e.class]))}),h(t,n)}var o3=Vt("<path></path>");function a3(t,e){$e(e,!0);var n=o3();j(()=>{Se(n,"stroke-width",e.lineWidth),Se(n,"d",`M${e.dimensions[0]/2} 0 V${e.dimensions[1]} M0 ${e.dimensions[1]/2} H${e.dimensions[0]}`),Oe(n,0,We(["svelte-flow__background-pattern",e.variant,e.class]))}),h(t,n),Ze()}const i3={[Mn.Dots]:1,[Mn.Lines]:1,[Mn.Cross]:6};var s3=Vt('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');function l3(t,e){$e(e,!0);let n=qe(e,"variant",19,()=>Mn.Dots),o=qe(e,"gap",3,20),a=qe(e,"lineWidth",3,1),s=E(rr),i=E(()=>n()===Mn.Dots),l=E(()=>n()===Mn.Cross),u=E(()=>Array.isArray(o())?o():[o(),o()]),f=E(()=>`background-pattern-${r(s).flowId}-${e.id??""}`),v=E(()=>[r(u)[0]*r(s).viewport.zoom||1,r(u)[1]*r(s).viewport.zoom||1]),x=E(()=>(e.size??i3[n()])*r(s).viewport.zoom),p=E(()=>r(l)?[r(x),r(x)]:r(v)),w=E(()=>r(i)?[r(x)/2,r(x)/2]:[r(p)[0]/2,r(p)[1]/2]);var _=s3();let I;var H=d(_),D=d(H);{var L=U=>{{let ie=E(()=>r(x)/2);r3(U,{get radius(){return r(ie)},get class(){return e.patternClass}})}},V=U=>{a3(U,{get dimensions(){return r(p)},get variant(){return n()},get lineWidth(){return a()},get class(){return e.patternClass}})};X(D,U=>{r(i)?U(L):U(V,-1)})}c(H);var q=g(H);c(_),j(()=>{Oe(_,0,We(["svelte-flow__background","svelte-flow__container",e.class])),I=$t(_,"",I,{"--xy-background-color-props":e.bgColor,"--xy-background-pattern-color-props":e.patternColor}),Se(H,"id",r(f)),Se(H,"x",r(s).viewport.x%r(v)[0]),Se(H,"y",r(s).viewport.y%r(v)[1]),Se(H,"width",r(v)[0]),Se(H,"height",r(v)[1]),Se(H,"patternTransform",`translate(-${r(w)[0]},-${r(w)[1]})`),Se(q,"fill",`url(#${r(f)})`)}),h(t,_),Ze()}var c3=k('<!> <!> <div><div class="stripe svelte-hw5n61"></div> <div class="body svelte-hw5n61"><div class="head svelte-hw5n61"><span class="role svelte-hw5n61"> </span> <span class="dot svelte-hw5n61"></span></div> <div class="label svelte-hw5n61"> </div> <div class="meta svelte-hw5n61"><span class="metric svelte-hw5n61"><span class="n svelte-hw5n61"> </span><span class="u svelte-hw5n61">colls</span></span> <span class="sep svelte-hw5n61">·</span> <span class="metric svelte-hw5n61"><span class="n svelte-hw5n61"> </span><span class="u svelte-hw5n61">entities</span></span></div></div></div>',1);function d3(t,e){$e(e,!0);const n=E(()=>e.data.role==="primary"?"role-primary":e.data.role==="replica"?"role-replica":"role-embedded");var o=c3(),a=ve(o);Sr(a,{type:"target",get position(){return ft.Left},style:"opacity:0;pointer-events:none"});var s=g(a,2);Sr(s,{type:"source",get position(){return ft.Right},style:"opacity:0;pointer-events:none"});var i=g(s,2);let l;var u=g(d(i),2),f=d(u),v=d(f),x=d(v,!0);c(v),Ee(2),c(f);var p=g(f,2),w=d(p,!0);c(p);var _=g(p,2),I=d(_),H=d(I),D=d(H,!0);c(H),Ee(),c(I);var L=g(I,4),V=d(L),q=d(V,!0);c(V),Ee(),c(L),c(_),c(u),c(i),j(U=>{l=Oe(i,1,`card ${r(n)??""}`,"svelte-hw5n61",l,{selected:e.selected}),P(x,e.data.role),P(w,e.data.label),P(D,e.data.collections),P(q,U)},[()=>e.data.entities.toLocaleString()]),h(t,o),Ze()}var u3=k('<div class="absolute inset-0 grid place-items-center text-fg-3 font-mono text-[12px]">Probing reachable nodes…</div>'),f3=k('<div class="p-6"><!></div>'),v3=k('<div class="p-6"><!></div>'),g3=k("<!> <!>",1),p3=k('<button><span></span> <span class="font-mono text-[11px] text-fg-1 flex-1 truncate"> </span> <span class="font-mono text-[10px] text-fg-3"> </span></button>'),h3=k('<div class="grid grid-cols-2 gap-3 mb-3 pb-3 border-b border-line-1"><div><div class="type-label">reachable</div> <div class="font-mono text-fg-0 text-[18px] font-semibold mt-0.5"> <span class="text-fg-3 text-[11px] font-normal ml-1"> </span></div></div> <div><div class="type-label">entities</div> <div class="font-mono text-accent text-[18px] font-semibold mt-0.5"> </div></div></div> <div class="grid gap-1"></div>',1),x3=k('<div class="pt-2 mt-1 border-t border-line-1"></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">host</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">process</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">connections</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">collections</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">entities</span> <span class="text-accent"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">cross refs</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">store memory</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">storage</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">ram</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">cpu</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">requests/sec</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">read/write</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">avg response</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">uptime</span> <span class="text-fg-0"> </span></div>',1),b3=k('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">wal lsn</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">wal size</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">oldest lsn</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">replicas</span> <span class="text-fg-0"> </span></div>',1),m3=k('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">lag</span> <span><!></span></div>'),_3=k('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">applied</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <!>',1),y3=k('<div class="pt-2 mt-1 border-t border-line-1"></div> <!>',1),w3=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-3"> </span>'),k3=k('<div class="grid gap-2 font-mono text-[11px]"><div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">label</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">url</span> <code class="text-fg-0 break-all"> </code></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">deployment</span> <span><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">evidence</span> <span class="text-fg-1"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">role</span> <span><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">replicas</span> <span class="text-fg-0"><!></span></div> <!> <!> <div class="pt-2 mt-1 border-t border-line-1"></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-start"><span class="text-fg-3">not exposed</span> <span class="flex flex-wrap gap-1"></span></div></div>'),S3=k('<div class="absolute top-4 right-4 z-10 w-[420px] max-h-[calc(100vh-96px)] overflow-auto"><!></div>'),C3=k('<div class="absolute inset-0"><!></div> <div class="absolute top-4 left-4 z-10 w-64"><!></div> <!>',1);function N3(t,e){$e(e,!0);let n=xe(kt([])),o=xe(!0),a=xe(null);const s=new Map,i=new Map,l=6e4,u={cluster:d3},f=E(()=>{const A=Wn.current==="dark";return{ok:A?"#4ade80":"#16a34a",warn:A?"#fbbf24":"#b45309",pattern:A?"#1c2027":"#d4d4d8",labelBg:A?"#0d0f13":"#fafafa",labelStroke:A?"#2a2e36":"#d4d4d8"}});async function v(){const A=Date.now(),y=await Promise.all(Yd.map(async S=>{const z=s.get(S.id)??0,W=i.get(S.id)??0;if(z>=2&&A-W<l)return r(n).find(Z=>Z.id===S.id)??{id:S.id,preset:S,reachable:!1,role:"standalone"};i.set(S.id,A);const oe=new Xd(S.url);try{const[Z,Y,Q]=await Promise.all([Mt.track(`cluster · ${S.label} stats`,()=>oe.stats()),Mt.track(`cluster · ${S.label} replication`,()=>oe.replication()).catch(()=>{}),Mt.track(`cluster · ${S.label} status`,()=>oe.clusterStatus()).catch(()=>{})]);return s.set(S.id,0),{id:S.id,preset:S,reachable:!0,role:(Y==null?void 0:Y.role)??"standalone",stats:Z,replication:Y,cluster:Q}}catch{return s.set(S.id,z+1),{id:S.id,preset:S,reachable:!1,role:"standalone"}}}));T(n,y,!0),T(o,!1)}It(()=>{if(Ot.locked){T(o,!1);return}T(o,!0),v();const A=setInterval(v,5e3);return()=>clearInterval(A)});const x=E(()=>r(n).filter(A=>A.reachable)),p=E(()=>r(x).map(A=>{var S,z;const y=A.role==="primary"?0:A.role==="replica"?1:-1;return{id:A.id,type:"cluster",position:{x:320+y*320,y:200},data:{label:A.preset.label,role:A.role,collections:((S=A.stats)==null?void 0:S.store.collection_count)??0,entities:((z=A.stats)==null?void 0:z.store.total_entities)??0,url:A.preset.url}}})),w=E(()=>r(x).filter(A=>A.role==="replica").map(A=>{var oe,Z;const y=r(x).find(Y=>Y.role==="primary");if(!y)return null;const S=((oe=A.replication)==null?void 0:oe.last_applied_lsn)!==void 0&&((Z=A.replication)==null?void 0:Z.last_seen_primary_lsn)!==void 0?A.replication.last_seen_primary_lsn-A.replication.last_applied_lsn:null,z=S===0,W=z?r(f).ok:r(f).warn;return{id:`${y.id}-${A.id}`,source:y.id,target:A.id,type:"smoothstep",animated:!0,style:`stroke:${W};stroke-width:1.5;opacity:0.7`,label:S===null?"":z?"✓ in sync":`lag ${S}`,labelStyle:`fill:${W};font-family:JetBrains Mono Variable;font-size:10px;font-weight:500`,labelBgStyle:`fill:${r(f).labelBg};stroke:${r(f).labelStroke};stroke-width:1`,labelBgPadding:[6,4],labelBgBorderRadius:4}}).filter(A=>A!==null)),_=E(()=>r(n).find(A=>A.id===r(a))),I=E(()=>r(x).reduce((A,y)=>{var S;return A+(((S=y.stats)==null?void 0:S.store.total_entities)??0)},0));function H(A){var S,z;const y=(z=(S=A.cluster)==null?void 0:S.deployment)==null?void 0:z.mode;return y||(A.preset.id==="embedded"?"embedded file endpoint":A.preset.id.startsWith("docker-")?"server · docker preset":"server endpoint")}function D(A){var S;const y=(S=A.cluster)==null?void 0:S.deployment;return y!=null&&y.file_path?y.file_path:y!=null&&y.container_id||y!=null&&y.image?[y.container_id,y.image].filter(Boolean).join(" · "):y!=null&&y.configured_by||y!=null&&y.process_kind?[y.configured_by,y.process_kind].filter(Boolean).join(" · "):A.preset.id==="embedded"||A.preset.id.startsWith("docker-")?A.preset.description:"reddb has not exposed process/container metadata yet"}function L(A){var S,z;const y=(z=(S=A.cluster)==null?void 0:S.deployment)==null?void 0:z.mode;return y==="docker"?"info":y==="embedded"?"ok":y==="replicated"?"accent":A.preset.id.startsWith("docker-")?"info":A.preset.id==="embedded"?"ok":"neutral"}function V(A){return A===void 0||!Number.isFinite(A)?"not exposed":A>=1024**3?`${(A/1024**3).toFixed(1)} GiB`:A>=1024**2?`${(A/1024**2).toFixed(1)} MiB`:A>=1024?`${(A/1024).toFixed(1)} KiB`:`${A} B`}function q(A,y){return y<=0?"n/a":`${Math.round(A/y*100)}%`}function U(A){const y=Math.max(0,Math.round((Date.now()-A)/1e3));return y>=86400?`${Math.floor(y/86400)}d ${Math.floor(y%86400/3600)}h`:y>=3600?`${Math.floor(y/3600)}h ${Math.floor(y%3600/60)}m`:y>=60?`${Math.floor(y/60)}m ${y%60}s`:`${y}s`}function ie(A){const y=A.replication;return(y==null?void 0:y.last_applied_lsn)===void 0||y.last_seen_primary_lsn===void 0?null:y.last_seen_primary_lsn-y.last_applied_lsn}function de(A){return A.system.total_memory_bytes-A.system.available_memory_bytes}function ae(...A){return A.find(y=>y!==void 0&&Number.isFinite(y))}function $(A){return A===void 0||!Number.isFinite(A)?"not exposed":`${A.toLocaleString(void 0,{maximumFractionDigits:1})}/s`}function fe(A){return A===void 0||!Number.isFinite(A)?"not exposed":`${A.toLocaleString(void 0,{maximumFractionDigits:1})} ms`}function O(A){var W,oe,Z,Y,Q,ee;const y=(oe=(W=A.cluster)==null?void 0:W.storage)==null?void 0:oe.used_bytes,S=(Y=(Z=A.cluster)==null?void 0:Z.storage)==null?void 0:Y.capacity_bytes,z=(ee=(Q=A.cluster)==null?void 0:Q.storage)==null?void 0:ee.free_bytes;return y===void 0&&S===void 0&&z===void 0?"not exposed":y!==void 0&&S!==void 0?`${V(y)} / ${V(S)} (${q(y,S)})`:y!==void 0&&z!==void 0?`${V(y)} used · ${V(z)} free`:S!==void 0&&z!==void 0?`${V(z)} free / ${V(S)}`:V(y??S??z)}function b(A,y){var S,z,W,oe,Z,Y,Q,ee,se;return y==="storage capacity"?(S=A.cluster)==null?void 0:S.storage:y==="wal size bytes"?((W=(z=A.cluster)==null?void 0:z.wal)==null?void 0:W.size_bytes)!==void 0:y==="throughput"?(oe=A.cluster)==null?void 0:oe.throughput:y==="avg response time"?((Y=(Z=A.cluster)==null?void 0:Z.throughput)==null?void 0:Y.avg_response_ms)!==void 0:y==="cpu usage"?((ee=(Q=A.cluster)==null?void 0:Q.system)==null?void 0:ee.cpu_usage_percent)!==void 0:y==="deployment metadata"?(se=A.cluster)==null?void 0:se.deployment:!1}const M=["storage capacity","wal size bytes","throughput","avg response time","cpu usage","deployment metadata"];var m=Ve(),N=ve(m);{var C=A=>{var y=u3();h(A,y)},R=A=>{var y=f3(),S=d(y);Rr(S,{get icon(){return tr},title:"Locked",message:"Unlock the secure store to probe configured nodes. Automatic probes are paused until you authenticate this session."}),c(y),h(A,y)},F=A=>{var y=v3(),S=d(y);Rr(S,{get icon(){return xf},title:"No reachable nodes",message:"None of the configured reddb endpoints responded. Start one and the topology will populate automatically.",hint:"docker compose -f docker/compose.yml up -d"}),c(y),h(A,y)},J=A=>{var y=C3(),S=ve(y),z=d(S);Fw(z,{get nodes(){return r(p)},get edges(){return r(w)},get nodeTypes(){return u},fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,onnodeclick:Q=>T(a,Q.node.id,!0),children:(Q,ee)=>{var se=g3(),B=ve(se);l3(B,{get variant(){return Mn.Dots},bgColor:"transparent",get patternColor(){return r(f).pattern},gap:32,size:1});var K=g(B,2);t3(K,{position:"bottom-right"}),h(Q,se)},$$slots:{default:!0}}),c(S);var W=g(S,2),oe=d(W);Un(oe,{title:"cluster",children:(Q,ee)=>{var se=h3(),B=ve(se),K=d(B),ne=g(d(K),2),re=d(ne,!0),te=g(re),pe=d(te);c(te),c(ne),c(K);var me=g(K,2),_e=g(d(me),2),ke=d(_e,!0);c(_e),c(me),c(B);var he=g(B,2);Je(he,21,()=>r(x),Ft,(ge,Ce)=>{var Pe=p3(),ue=d(Pe),le=g(ue,2),we=d(le,!0);c(le);var Me=g(le,2),Ne=d(Me,!0);c(Me),c(Pe),j((Te,ye,ze)=>{Oe(Pe,1,Te),Oe(ue,1,ye),P(we,r(Ce).preset.label),P(Ne,ze)},[()=>We(["flex items-center gap-2.5 px-2 py-1.5 rounded text-left bg-transparent border-0 cursor-pointer transition-colors",r(a)===r(Ce).id?"bg-bg-2":"hover:bg-bg-2"].join(" ")),()=>We(["w-1.5 h-1.5 rounded-full shrink-0",r(Ce).role==="primary"?"bg-role-primary":r(Ce).role==="replica"?"bg-role-replica":"bg-role-embedded"].join(" ")),()=>{var Te;return((Te=r(Ce).stats)==null?void 0:Te.store.total_entities.toLocaleString())??0}]),be("click",Pe,()=>T(a,r(Ce).id,!0)),h(ge,Pe)}),c(he),j(ge=>{P(re,r(x).length),P(pe,`of ${r(n).length??""}`),P(ke,ge)},[()=>r(I).toLocaleString()]),h(Q,se)},$$slots:{default:!0}}),c(W);var Z=g(W,2);{var Y=Q=>{var ee=S3(),se=d(ee);Un(se,{get title(){return`node · ${r(_).id??""}`},floating:!0,children:(B,K)=>{var ne=k3(),re=d(ne),te=g(d(re),2),pe=d(te,!0);c(te),c(re);var me=g(re,2),_e=g(d(me),2),ke=d(_e,!0);c(_e),c(me);var he=g(me,2),ge=g(d(he),2),Ce=d(ge);{let Ie=E(()=>L(r(_)));Sn(Ce,{get tone(){return r(Ie)},children:(Fe,G)=>{Ee();var De=pt();j(Le=>P(De,Le),[()=>H(r(_))]),h(Fe,De)},$$slots:{default:!0}})}c(ge),c(he);var Pe=g(he,2),ue=g(d(Pe),2),le=d(ue,!0);c(ue),c(Pe);var we=g(Pe,2),Me=g(d(we),2),Ne=d(Me);{let Ie=E(()=>r(_).role==="primary"?"primary":r(_).role==="replica"?"replica":"embedded");vu(Ne,{get role(){return r(Ie)},get label(){return r(_).role}})}c(Me),c(we);var Te=g(we,2),ye=g(d(Te),2),ze=d(ye);{var Ae=Ie=>{var Fe=pt();j(()=>P(Fe,r(_).replication.replica_count??0)),h(Ie,Fe)},Ke=Ie=>{var Fe=pt();j(()=>P(Fe,`connected to ${r(_).replication.primary_addr??"primary"??""}`)),h(Ie,Fe)},at=Ie=>{var Fe=pt("none exposed");h(Ie,Fe)};X(ze,Ie=>{var Fe,G;((Fe=r(_).replication)==null?void 0:Fe.role)==="primary"?Ie(Ae):((G=r(_).replication)==null?void 0:G.role)==="replica"?Ie(Ke,1):Ie(at,-1)})}c(ye),c(Te);var Be=g(Te,2);{var Qe=Ie=>{var Fe=x3(),G=g(ve(Fe),2),De=g(d(G),2),Le=d(De);c(De),c(G);var je=g(G,2),Ye=g(d(je),2),lt=d(Ye);c(Ye),c(je);var ct=g(je,2),gt=g(d(ct),2),it=d(gt),Xe=g(it),tt=d(Xe);c(Xe),c(gt),c(ct);var st=g(ct,2),ut=g(d(st),2),ht=d(ut,!0);c(ut),c(st);var xt=g(st,2),Tt=g(d(xt),2),bt=d(Tt,!0);c(Tt),c(xt);var mt=g(xt,2),Et=g(d(mt),2),Pt=d(Et,!0);c(Et),c(mt);var Rt=g(mt,2),Ht=g(d(Rt),2),Bt=d(Ht,!0);c(Ht),c(Rt);var Ut=g(Rt,2),sn=g(d(Ut),2),gn=d(sn,!0);c(sn),c(Ut);var pn=g(Ut,2),Pn=g(d(pn),2),Vn=d(Pn),Hn=g(Vn),Cr=d(Hn);c(Hn),c(Pn),c(pn);var In=g(pn,2),qn=g(d(In),2),Fn=d(qn),or=g(Fn),yt=d(or);c(or),c(qn),c(In);var zt=g(In,2),qt=g(d(zt),2),ln=d(qt,!0);c(qt),c(zt);var An=g(zt,2),lo=g(d(An),2),co=d(lo),ar=g(co),Kn=d(ar);c(ar),c(lo),c(An);var Nr=g(An,2),uo=g(d(Nr),2),rd=d(uo,!0);c(uo),c(Nr);var Ki=g(Nr,2),Bi=g(d(Ki),2),od=d(Bi,!0);c(Bi),c(Ki),j((At,Lt,fo,vo,ad,id,sd,ld,cd,dd,ud,fd)=>{var ji,Ui;P(Le,`${r(_).stats.system.hostname??""} · ${r(_).stats.system.os??""}/${r(_).stats.system.arch??""}`),P(lt,`pid ${r(_).stats.system.pid??""}`),P(it,`${r(_).stats.active_connections??""} active `),P(tt,`/ ${r(_).stats.idle_connections??""} idle`),P(ht,r(_).stats.store.collection_count),P(bt,At),P(Pt,Lt),P(Bt,fo),P(gn,vo),P(Vn,`${ad??""} used `),P(Cr,`/ ${id??""}
|
|
992
|
-
(${sd??""})`),P(Fn,`${r(_).stats.system.cpu_cores??""} cores `),P(yt,`· ${((Ui=(ji=r(_).cluster)==null?void 0:ji.system)==null?void 0:Ui.cpu_usage_percent)===void 0?"usage not exposed":`${r(_).cluster.system.cpu_usage_percent}%`}`),P(ln,ld),P(co,`${cd??""} `),P(Kn,`/ ${dd??""}`),P(rd,ud),P(od,fd)},[()=>r(_).stats.store.total_entities.toLocaleString(),()=>r(_).stats.store.cross_ref_count.toLocaleString(),()=>V(r(_).stats.store.total_memory_bytes),()=>O(r(_)),()=>{var At,Lt;return V(ae((Lt=(At=r(_).cluster)==null?void 0:At.system)==null?void 0:Lt.memory_used_bytes,de(r(_).stats)))},()=>{var At,Lt;return V(ae((Lt=(At=r(_).cluster)==null?void 0:At.system)==null?void 0:Lt.memory_total_bytes,r(_).stats.system.total_memory_bytes))},()=>{var At,Lt,fo,vo;return q(ae((Lt=(At=r(_).cluster)==null?void 0:At.system)==null?void 0:Lt.memory_used_bytes,de(r(_).stats))??0,ae((vo=(fo=r(_).cluster)==null?void 0:fo.system)==null?void 0:vo.memory_total_bytes,r(_).stats.system.total_memory_bytes)??0)},()=>{var At,Lt;return $((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.requests_per_second)},()=>{var At,Lt;return $((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.reads_per_second)},()=>{var At,Lt;return $((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.writes_per_second)},()=>{var At,Lt;return fe((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.avg_response_ms)},()=>U(r(_).stats.started_at_unix_ms)]),h(Ie,Fe)};X(Be,Ie=>{r(_).stats&&Ie(Qe)})}var dt=g(Be,2);{var vt=Ie=>{var Fe=y3(),G=g(ve(Fe),2);{var De=je=>{var Ye=b3(),lt=ve(Ye),ct=g(d(lt),2),gt=d(ct,!0);c(ct),c(lt);var it=g(lt,2),Xe=g(d(it),2),tt=d(Xe,!0);c(Xe),c(it);var st=g(it,2),ut=g(d(st),2),ht=d(ut,!0);c(ut),c(st);var xt=g(st,2),Tt=g(d(xt),2),bt=d(Tt,!0);c(Tt),c(xt),j(mt=>{var Et,Pt,Rt,Ht,Bt,Ut;P(gt,((Pt=(Et=r(_).cluster)==null?void 0:Et.wal)==null?void 0:Pt.lsn)??r(_).replication.wal_lsn),P(tt,mt),P(ht,((Ht=(Rt=r(_).cluster)==null?void 0:Rt.wal)==null?void 0:Ht.oldest_lsn)??r(_).replication.oldest_lsn??"not exposed"),P(bt,((Ut=(Bt=r(_).cluster)==null?void 0:Bt.replication)==null?void 0:Ut.replica_count)??r(_).replication.replica_count??0)},[()=>{var mt,Et;return V((Et=(mt=r(_).cluster)==null?void 0:mt.wal)==null?void 0:Et.size_bytes)}]),h(je,Ye)},Le=je=>{const Ye=E(()=>ie(r(_)));var lt=_3(),ct=ve(lt),gt=g(d(ct),2),it=d(gt),Xe=g(it),tt=d(Xe);c(Xe),c(gt),c(ct);var st=g(ct,2);{var ut=ht=>{var xt=m3(),Tt=g(d(xt),2),bt=d(Tt);{var mt=Pt=>{Sn(Pt,{tone:"ok",children:(Rt,Ht)=>{Ee();var Bt=pt("in sync");h(Rt,Bt)},$$slots:{default:!0}})},Et=Pt=>{Sn(Pt,{tone:"warn",children:(Rt,Ht)=>{Ee();var Bt=pt();j(()=>{var Ut,sn,gn,pn;return P(Bt,(sn=(Ut=r(_).cluster)==null?void 0:Ut.replication)!=null&&sn.lag_ms?`${r(_).cluster.replication.lag_ms} ms`:`${((pn=(gn=r(_).cluster)==null?void 0:gn.replication)==null?void 0:pn.lag_lsn)??r(Ye)} lsn`)}),h(Rt,Bt)},$$slots:{default:!0}})};X(bt,Pt=>{r(Ye)===0?Pt(mt):Pt(Et,-1)})}c(Tt),c(xt),h(ht,xt)};X(st,ht=>{r(Ye)!==null&&ht(ut)})}j(()=>{P(it,`${r(_).replication.last_applied_lsn??""} `),P(tt,`/ ${r(_).replication.last_seen_primary_lsn??""}`)}),h(je,lt)};X(G,je=>{r(_).replication.role==="primary"?je(De):r(_).replication.role==="replica"&&je(Le,1)})}h(Ie,Fe)};X(dt,Ie=>{r(_).replication&&Ie(vt)})}var Ge=g(dt,4),Re=g(d(Ge),2);Je(Re,21,()=>M,Ft,(Ie,Fe)=>{var G=Ve(),De=ve(G);{var Le=Ye=>{var lt=w3(),ct=d(lt,!0);c(lt),j(()=>P(ct,r(Fe))),h(Ye,lt)},je=E(()=>!b(r(_),r(Fe)));X(De,Ye=>{r(je)&&Ye(Le)})}h(Ie,G)}),c(Re),c(Ge),c(ne),j(Ie=>{P(pe,r(_).preset.label),P(ke,r(_).preset.url),P(le,Ie)},[()=>D(r(_))]),h(B,ne)},$$slots:{default:!0}}),c(ee),h(Q,ee)};X(Z,Q=>{r(_)&&Q(Y)})}h(A,y)};X(N,A=>{r(o)?A(C):Ot.locked?A(R,1):r(x).length===0?A(F,2):A(J,-1)})}h(t,m),Ze()}Nt(["click"]);var E3=k('<div class="type-label mb-1.5"> </div>'),M3=k('<p class="type-caption m-0 mt-1.5"> </p>'),z3=k('<div class="flex items-center gap-2 shrink-0"><!></div>'),T3=k('<header class="flex items-end justify-between gap-4 pb-4 mb-4 border-b border-line-1"><div class="min-w-0"><!> <div class="flex items-baseline gap-3 flex-wrap"><h1 class="type-h1 m-0"> </h1> <!></div> <!></div> <!></header>');function Qo(t,e){var n=T3(),o=d(n),a=d(o);{var s=_=>{var I=E3(),H=d(I,!0);c(I),j(()=>P(H,e.eyebrow)),h(_,I)};X(a,_=>{e.eyebrow&&_(s)})}var i=g(a,2),l=d(i),u=d(l,!0);c(l);var f=g(l,2);St(f,()=>e.children??Gt),c(i);var v=g(i,2);{var x=_=>{var I=M3(),H=d(I,!0);c(I),j(()=>P(H,e.subtitle)),h(_,I)};X(v,_=>{e.subtitle&&_(x)})}c(o);var p=g(o,2);{var w=_=>{var I=z3(),H=d(I);St(H,()=>e.actions),c(I),h(_,I)};X(p,_=>{e.actions&&_(w)})}c(n),j(()=>P(u,e.title)),h(t,n)}var P3=k('<button type="button" class="inline-flex h-7 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> refresh</button>'),I3=k('<div class="text-[12px] font-mono text-warn break-words"> </div>'),A3=k('<span class="text-fg-3">note</span> <span class="text-fg-1"> </span>',1),L3=k('<div class="grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-[12px] font-mono"><span class="text-fg-3">authenticated</span> <span><!></span> <span class="text-fg-3">username</span> <span class="text-fg-0"> </span> <span class="text-fg-3">role</span> <span class="text-accent"> </span> <!></div>'),O3=k('<div class="text-[12px] font-mono text-fg-3">Loading session…</div>'),R3=k('<div class="mb-2 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> tenants endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),D3=k('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No tenants returned for this principal.</span></div>'),V3=k('<div class="rounded border border-line-1 bg-bg-0 px-2 py-1.5"><div class="flex items-center gap-2"><span class="text-fg-0"> </span> <!></div> <div class="mt-1 text-fg-3"> <!></div></div>'),H3=k('<div class="grid gap-1 text-[12px] font-mono"></div>'),q3=k('<div class="mb-2 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> policies endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),F3=k('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No policies returned for this principal.</span></div>'),K3=k('<div class="rounded border border-line-1 bg-bg-0 px-2 py-1.5"><div class="flex items-center gap-2"><span class="text-fg-0"> </span> <!></div> <div class="mt-1 text-fg-3"> <!></div></div>'),B3=k('<div class="text-[11px] text-fg-3"> </div>'),j3=k('<div class="grid gap-1 text-[12px] font-mono"><!> <!></div>'),U3=k('<div class="mb-3 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> users endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),W3=k('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No users returned for this principal.</span></div>'),Y3=k('<span class="text-fg-3">-</span>'),X3=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1"><!></td><td class="px-2 py-1 text-fg-2"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),G3=k('<div class="overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">user</th><th class="px-2 py-1.5 text-left font-normal">role</th><th class="px-2 py-1.5 text-left font-normal">mfa</th><th class="px-2 py-1.5 text-left font-normal">created</th><th class="px-2 py-1.5 text-left font-normal">last active</th></tr></thead><tbody></tbody></table></div>'),$3=k('<div class="text-[12px] font-mono text-fg-3">Policy table unavailable for this principal.</div>'),Z3=k('<div class="text-[12px] font-mono text-fg-3">No policies to tabulate.</div>'),Q3=k('<span class="text-fg-3">-</span>'),J3=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1"><!></td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),ek=k('<div class="overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">effect</th><th class="px-2 py-1.5 text-left font-normal">principal</th><th class="px-2 py-1.5 text-left font-normal">action</th><th class="px-2 py-1.5 text-left font-normal">resource</th><th class="px-2 py-1.5 text-left font-normal">tenant</th></tr></thead><tbody></tbody></table></div>'),tk=k('<div class="grid grid-cols-[minmax(280px,0.75fr)_1.25fr] gap-3"><div class="grid gap-3 content-start"><!> <!> <!></div> <div class="grid gap-3 content-start"><!> <!></div></div>'),nk=k('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <!></div>');function rk(t,e){$e(e,!0);let n=xe(null),o=xe(kt([])),a=xe(kt([])),s=xe(kt([])),i=xe(!1),l=xe(null),u=xe(null),f=xe(null),v=xe(null);const x=E(()=>Ue.active.url),p=E(()=>Ue.connected);function w(U){if(!U)return"-";const ie=U>1e10?U:U*1e3;return new Date(ie).toISOString().replace("T"," ").slice(0,19)}async function _(){const U=Ue.client;if(!U||Ot.locked||!r(p)){T(n,null),T(o,[],!0),T(a,[],!0),T(s,[],!0);return}T(i,!0),T(l,null),T(u,null),T(f,null),T(v,null);try{T(n,await Mt.track("security · whoami",()=>U.whoami()),!0)}catch(ie){T(l,ie.message,!0),T(n,null)}try{T(a,await Mt.track("security · users",()=>U.users()),!0)}catch(ie){T(f,ie.message,!0),T(a,[],!0)}finally{T(i,!1)}}It(()=>{Ot.locked||(r(x),r(p),_())});var I=nk(),H=d(I);Qo(H,{eyebrow:"Admin",title:"Security",subtitle:"Tenants, users, and policy surfaces are permission-aware. Controls only appear when reddb exposes the grant.",actions:ie=>{var de=P3(),ae=d(de);{let $=E(()=>r(i)?"size-3.5 animate-spin":"size-3.5");ki(ae,{get class(){return r($)}})}Ee(),c(de),j(()=>de.disabled=r(i)||Ot.locked||!r(p)),be("click",de,_),h(ie,de)}});var D=g(H,2);{var L=U=>{Rr(U,{get icon(){return tr},title:"Security locked",message:"Enter the master password before red-ui loads auth data."})},V=U=>{Rr(U,{get icon(){return ho},title:"No active connection",message:"Connect to a reddb instance to inspect security posture."})},q=U=>{var ie=tk(),de=d(ie),ae=d(de);Un(ae,{title:"session",children:(m,N)=>{var C=Ve(),R=ve(C);{var F=y=>{var S=I3(),z=d(S,!0);c(S),j(()=>P(z,r(l))),h(y,S)},J=y=>{var S=L3(),z=g(d(S),2),W=d(z);{var oe=ne=>{Sn(ne,{tone:"ok",children:(re,te)=>{Ee();var pe=pt("yes");h(re,pe)},$$slots:{default:!0}})},Z=ne=>{Sn(ne,{tone:"warn",children:(re,te)=>{Ee();var pe=pt("no");h(re,pe)},$$slots:{default:!0}})};X(W,ne=>{r(n).authenticated?ne(oe):ne(Z,-1)})}c(z);var Y=g(z,4),Q=d(Y,!0);c(Y);var ee=g(Y,4),se=d(ee,!0);c(ee);var B=g(ee,2);{var K=ne=>{var re=A3(),te=g(ve(re),2),pe=d(te,!0);c(te),j(()=>P(pe,r(n).note)),h(ne,re)};X(B,ne=>{r(n).note&&ne(K)})}c(S),j(()=>{P(Q,r(n).username),P(se,r(n).role)}),h(y,S)},A=y=>{var S=O3();h(y,S)};X(R,y=>{r(l)?y(F):r(n)?y(J,1):y(A,-1)})}h(m,C)},$$slots:{default:!0}});var $=g(ae,2);Un($,{title:"tenants",children:(m,N)=>{var C=Ve(),R=ve(C);{var F=y=>{var S=R3(),z=ve(S),W=d(z);ho(W,{class:"size-3.5"}),Ee(),c(z);var oe=g(z,2),Z=d(oe,!0);c(oe),j(()=>P(Z,r(u))),h(y,S)},J=y=>{var S=D3(),z=d(S);ju(z,{class:"size-4"}),Ee(2),c(S),h(y,S)},A=y=>{var S=H3();Je(S,23,()=>r(o),(z,W)=>`${z.id??z.slug??z.name??W}`,(z,W)=>{var oe=V3(),Z=d(oe),Y=d(Z),Q=d(Y,!0);c(Y);var ee=g(Y,2);{var se=te=>{Sn(te,{tone:"accent",children:(pe,me)=>{Ee();var _e=pt();j(()=>P(_e,r(W).role)),h(pe,_e)},$$slots:{default:!0}})};X(ee,te=>{r(W).role&&te(se)})}c(Z);var B=g(Z,2),K=d(B),ne=g(K);{var re=te=>{var pe=pt();j(me=>P(pe,`· ${me??""}`),[()=>r(W).grants.join(", ")]),h(te,pe)};X(ne,te=>{var pe;(pe=r(W).grants)!=null&&pe.length&&te(re)})}c(B),c(oe),j(()=>{P(Q,r(W).name??r(W).slug??r(W).id??"tenant"),P(K,`${r(W).id??r(W).slug??"-"??""} `)}),h(z,oe)}),c(S),h(y,S)};X(R,y=>{r(u)?y(F):r(o).length===0?y(J,1):y(A,-1)})}h(m,C)},$$slots:{default:!0}});var fe=g($,2);Un(fe,{title:"policies",children:(m,N)=>{var C=Ve(),R=ve(C);{var F=y=>{var S=q3(),z=ve(S),W=d(z);ho(W,{class:"size-3.5"}),Ee(),c(z);var oe=g(z,2),Z=d(oe,!0);c(oe),j(()=>P(Z,r(v))),h(y,S)},J=y=>{var S=F3(),z=d(S);hf(z,{class:"size-4"}),Ee(2),c(S),h(y,S)},A=y=>{var S=j3(),z=d(S);Je(z,19,()=>r(s).slice(0,6),(Z,Y)=>`${Z.id??Z.name??Y}`,(Z,Y)=>{var Q=K3(),ee=d(Q),se=d(ee),B=d(se,!0);c(se);var K=g(se,2);{var ne=_e=>{{let ke=E(()=>r(Y).effect==="deny"?"danger":"ok");Sn(_e,{get tone(){return r(ke)},children:(he,ge)=>{Ee();var Ce=pt();j(()=>P(Ce,r(Y).effect)),h(he,Ce)},$$slots:{default:!0}})}};X(K,_e=>{r(Y).effect&&_e(ne)})}c(ee);var re=g(ee,2),te=d(re),pe=g(te);{var me=_e=>{var ke=pt();j(()=>P(ke,`· tenant ${r(Y).tenant??""}`)),h(_e,ke)};X(pe,_e=>{r(Y).tenant&&_e(me)})}c(re),c(Q),j(()=>{P(B,r(Y).name??r(Y).id??"policy"),P(te,`${r(Y).action??"*"??""} · ${r(Y).resource??"*"??""} `)}),h(Z,Q)});var W=g(z,2);{var oe=Z=>{var Y=B3(),Q=d(Y);c(Y),j(()=>P(Q,`${r(s).length-6} more policies in the table.`)),h(Z,Y)};X(W,Z=>{r(s).length>6&&Z(oe)})}c(S),h(y,S)};X(R,y=>{r(v)?y(F):r(s).length===0?y(J,1):y(A,-1)})}h(m,C)},$$slots:{default:!0}}),c(de);var O=g(de,2),b=d(O);Un(b,{title:"users",children:(m,N)=>{var C=Ve(),R=ve(C);{var F=y=>{var S=U3(),z=ve(S),W=d(z);ho(W,{class:"size-3.5"}),Ee(),c(z);var oe=g(z,2),Z=d(oe,!0);c(oe),j(()=>P(Z,r(f))),h(y,S)},J=y=>{var S=W3(),z=d(S);yf(z,{class:"size-4"}),Ee(2),c(S),h(y,S)},A=y=>{var S=G3(),z=d(S),W=g(d(z));Je(W,21,()=>r(a),oe=>oe.username,(oe,Z)=>{var Y=X3(),Q=d(Y),ee=d(Q,!0);c(Q);var se=g(Q),B=d(se,!0);c(se);var K=g(se),ne=d(K);{var re=he=>{Sn(he,{tone:"ok",children:(ge,Ce)=>{Ee();var Pe=pt("on");h(ge,Pe)},$$slots:{default:!0}})},te=he=>{var ge=Y3();h(he,ge)};X(ne,he=>{r(Z).mfa?he(re):he(te,-1)})}c(K);var pe=g(K),me=d(pe,!0);c(pe);var _e=g(pe),ke=d(_e,!0);c(_e),c(Y),j((he,ge)=>{P(ee,r(Z).username),P(B,r(Z).role??"-"),P(me,he),P(ke,ge)},[()=>w(r(Z).created_at),()=>w(r(Z).last_active)]),h(oe,Y)}),c(W),c(z),c(S),h(y,S)};X(R,y=>{r(f)?y(F):r(a).length===0?y(J,1):y(A,-1)})}h(m,C)},$$slots:{default:!0}});var M=g(b,2);Un(M,{title:"policy table",children:(m,N)=>{var C=Ve(),R=ve(C);{var F=y=>{var S=$3();h(y,S)},J=y=>{var S=Z3();h(y,S)},A=y=>{var S=ek(),z=d(S),W=g(d(z));Je(W,23,()=>r(s),(oe,Z)=>`${oe.id??oe.name??Z}`,(oe,Z)=>{var Y=J3(),Q=d(Y),ee=d(Q);{var se=he=>{{let ge=E(()=>r(Z).effect==="deny"?"danger":"ok");Sn(he,{get tone(){return r(ge)},children:(Ce,Pe)=>{Ee();var ue=pt();j(()=>P(ue,r(Z).effect)),h(Ce,ue)},$$slots:{default:!0}})}},B=he=>{var ge=Q3();h(he,ge)};X(ee,he=>{r(Z).effect?he(se):he(B,-1)})}c(Q);var K=g(Q),ne=d(K,!0);c(K);var re=g(K),te=d(re,!0);c(re);var pe=g(re),me=d(pe,!0);c(pe);var _e=g(pe),ke=d(_e,!0);c(_e),c(Y),j(()=>{P(ne,r(Z).principal??"-"),P(te,r(Z).action??"*"),P(me,r(Z).resource??"*"),P(ke,r(Z).tenant??"-")}),h(oe,Y)}),c(W),c(z),c(S),h(y,S)};X(R,y=>{r(v)?y(F):r(s).length===0?y(J,1):y(A,-1)})}h(m,C)},$$slots:{default:!0}}),c(O),c(ie),h(U,ie)};X(D,U=>{Ot.locked?U(L):r(p)?U(q,-1):U(V,1)})}c(I),h(t,I),Ze()}Nt(["click"]);const Jo=[{id:"overview",label:"Overview",blurb:"What this reddb instance is and where it runs.",icon:"settings",keys:["deployment.mode","read_only","system.os","system.arch","system.hostname","system.cpu_cores"]},{id:"storage",label:"Storage",blurb:"Live store footprint for the active connection.",icon:"database",keys:["store.collection_count","store.total_entities","store.cross_ref_count","store.total_memory_bytes"]},{id:"cluster",label:"Cluster",blurb:"Deployment and replication topology.",icon:"network",keys:["deployment.mode","deployment.file_path","replication.replica_count","replication.lag_ms"]},{id:"capabilities",label:"Capabilities",blurb:"Endpoints negotiated for this server version.",icon:"plug",keys:["capabilities.vcs","capabilities.clusterStatus","capabilities.collectionMetadata","capabilities.cdcStream"]},{id:"session",label:"Session",blurb:"Who red-ui is authenticated as on this connection.",icon:"shield",keys:["session.username","session.role","session.authenticated"]}],ok={"deployment.mode":"Deployment mode","deployment.file_path":"Backing file",read_only:"Read-only","system.os":"Operating system","system.arch":"Architecture","system.hostname":"Hostname","system.cpu_cores":"CPU cores","store.collection_count":"Collections","store.total_entities":"Entities","store.cross_ref_count":"Cross-references","store.total_memory_bytes":"Memory in use","replication.replica_count":"Replicas","replication.lag_ms":"Replication lag","capabilities.vcs":"Version control","capabilities.clusterStatus":"Cluster status","capabilities.collectionMetadata":"Collection metadata","capabilities.cdcStream":"Change stream","session.username":"Username","session.role":"Role","session.authenticated":"Authenticated"},ak={"deployment.mode":"How this reddb instance is running.","deployment.file_path":"On-disk store path for an embedded or local server.",read_only:"Whether the store rejects writes (a lock or a replica role).","store.total_memory_bytes":"Resident memory the store currently holds.","replication.lag_ms":"How far this replica trails the primary, in ms.","capabilities.vcs":"Commit and diff endpoints — gated when unsupported.","capabilities.cdcStream":"Server-sent change stream over /changes/stream.","session.role":"The role granted to this principal on the active target."},ik={"deployment.mode":["embedded","server","docker","replicated"]};function sk(t){const n=(t.split(".").pop()??t).replace(/[_-]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):t}function vi(t,e){const n=ik[t],o=n?"enum":typeof e=="boolean"?"boolean":typeof e=="number"?"number":"text",a={key:t,label:ok[t]??sk(t),kind:o},s=ak[t];return s&&(a.description=s),n&&(a.options=n),a}function lk(t){return t.startsWith("capabilities.")?"capabilities":t.startsWith("session.")?"session":t.startsWith("deployment.")||t.startsWith("storage.")||t.startsWith("wal.")||t.startsWith("throughput.")||t.startsWith("replication.")?"cluster":"stats"}function No(t){const e={},n=(o,a)=>{for(const[s,i]of Object.entries(o)){const l=a?`${a}.${s}`:s;i!=null&&(typeof i=="object"&&!Array.isArray(i)?n(i,l):e[l]=i)}};return n(t,""),e}function ck(t){return Jo.find(e=>e.id===t)??Jo[0]}function dk(t,e){const n=e.trim().toLowerCase();return n?t.filter(o=>o.toLowerCase().includes(n)||vi(o).label.toLowerCase().includes(n)):[...t]}var uk=k('<div class="h-full overflow-auto bg-bg-0 p-6"><!> <!></div>'),fk=k('<div class="relative"><!> <input type="text" placeholder="Search this section ⌘K" class="h-7 w-full rounded-md border border-line-2 bg-bg-2 pl-8 pr-2.5 text-xs text-fg-1 placeholder:text-fg-3 outline-none transition-colors focus:border-line-3"/></div>'),vk=k('<nav class="grid gap-0.5 p-2"></nav>'),gk=k('<div class="grid gap-2 px-3 py-2.5"><button type="button" class="inline-flex h-7 items-center justify-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 transition-colors hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> export config</button> <div class="text-[11px] text-fg-3">Live from <span class="font-mono text-fg-2"> </span>.</div></div>'),pk=k('<button type="button" class="inline-flex h-7 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> refresh</button>'),hk=k('<div class="rounded-lg border border-dashed border-line-1 bg-bg-1 px-3 py-6 text-center text-[12px] text-fg-3">This server reports nothing for these keys.</div>'),xk=k('<span class="inline-flex items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2 py-1 text-[11px] font-mono text-fg-3"><!> </span>'),bk=k('<span class="font-mono text-[12px] text-accent"> </span>'),mk=k('<span class="font-mono text-[12px] text-fg-1"> </span>'),_k=k('<div class="divide-y divide-line-1 overflow-hidden rounded-lg border border-line-1 bg-bg-1"></div>'),yk=k('<div class="p-6"><!> <section class="mb-6"><!> <!></section></div>');function wk(t,e){$e(e,!0);const n={settings:zo,database:Vr,network:fl,plug:wi,shield:Nl},o={stats:"stats:read",cluster:"cluster:status",capabilities:"capabilities",session:"auth:whoami"};let a=xe(kt(Jo[0].id));const s=E(()=>ck(r(a)));let i=xe(kt({})),l=xe(null);const u=E(()=>r(i)[r(a)]??"");function f($){T(i,{...r(i),[r(a)]:$},!0)}function v($){var fe,O;($.metaKey||$.ctrlKey)&&$.key.toLowerCase()==="k"&&($.preventDefault(),(fe=r(l))==null||fe.focus(),(O=r(l))==null||O.select())}let x=xe(kt({})),p=xe(kt({stats:null,cluster:null,capabilities:null,session:null})),w=xe(!1);const _=E(()=>Ue.connected),I=E(()=>Ue.active.url);async function H(){const $=Ue.client;if(!$||!r(_)){T(x,{},!0);return}T(w,!0);const fe={},O={stats:null,cluster:null,capabilities:null,session:null};Object.assign(fe,No({capabilities:Ue.capabilities}));try{const b=await Mt.track("settings · stats",()=>$.stats());Object.assign(fe,No(b))}catch(b){O.stats=b.message}if(!Ue.capabilities.clusterStatus)O.cluster="Server does not expose /cluster/status.";else try{const b=await Mt.track("settings · cluster",()=>$.clusterStatus());Object.assign(fe,No(b))}catch(b){O.cluster=b.message}try{const b=await Mt.track("settings · whoami",()=>$.whoami());Object.assign(fe,No({session:b}))}catch(b){O.session=b.message}T(x,fe,!0),T(p,O,!0),T(w,!1)}It(()=>{r(I),r(_),H()});const D=E(()=>{const $=[];for(const fe of dk(r(s).keys,r(u))){const O=lk(fe),b=r(p)[O],M=vi(fe).label;b?$.push({type:"denied",key:fe,label:M,reason:b,grant:o[O]}):fe in r(x)&&$.push({type:"value",key:fe,label:M,control:vi(fe,r(x)[fe]),value:r(x)[fe]})}return $});function L($){if(!Number.isFinite($))return String($);const fe=["B","KB","MB","GB","TB"];let O=$,b=0;for(;O>=1024&&b<fe.length-1;)O/=1024,b++;return`${b===0?O:O.toFixed(1)} ${fe[b]}`}function V($,fe){return $.kind==="number"&&$.key.endsWith("_bytes")?L(Number(fe)):String(fe)}function q(){const $={url:r(I),exportedAt:new Date().toISOString(),config:r(x)},fe=new Blob([JSON.stringify($,null,2)],{type:"application/json"}),O=URL.createObjectURL(fe),b=document.createElement("a");b.href=O,b.download=`reddb-config-${new Date().toISOString().slice(0,10)}.json`,b.click(),URL.revokeObjectURL(O)}var U=Ve();zn("keydown",Jt,v);var ie=ve(U);{var de=$=>{var fe=uk(),O=d(fe);Qo(O,{eyebrow:"Settings",title:"Settings",subtitle:"Live configuration for the active reddb connection."});var b=g(O,2);Rr(b,{get icon(){return _f},title:"No active connection",message:"Connect to a reddb instance to inspect its live configuration.",hint:"red serve"}),c(fe),h($,fe)},ae=$=>{yu($,{searchShortcut:null,search:m=>{var N=fk(),C=d(N);un(C,{class:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-fg-3"});var R=g(C,2);Dt(R),tn(R,F=>T(l,F),()=>r(l)),c(N),j(()=>gl(R,r(u))),be("input",R,F=>f(F.currentTarget.value)),be("keydown",R,F=>{F.key==="Escape"&&(f(""),F.currentTarget.blur())}),h(m,N)},nav:m=>{var N=vk();Je(N,21,()=>Jo,C=>C.id,(C,R)=>{const F=E(()=>n[r(R).icon]??zo);{const J=y=>{var S=Ve(),z=ve(S);Gn(z,()=>r(F),(W,oe)=>{oe(W,{class:"size-3.5"})}),h(y,S)};let A=E(()=>r(R).id===r(s).id);Hu(C,{get label(){return r(R).label},get active(){return r(A)},onclick:()=>T(a,r(R).id,!0),icon:J,$$slots:{icon:!0}})}}),c(N),h(m,N)},footer:m=>{var N=gk(),C=d(N),R=d(C);Qu(R,{class:"size-3.5"}),Ee(),c(C);var F=g(C,2),J=g(d(F)),A=d(J,!0);c(J),Ee(),c(F),c(N),j(()=>{C.disabled=r(w),P(A,r(I))}),be("click",C,q),h(m,N)},content:m=>{const N=E(()=>n[r(s).icon]??zo);var C=yk(),R=d(C);Qo(R,{eyebrow:"Settings",get title(){return r(s).label},get subtitle(){return r(s).blurb},actions:W=>{var oe=pk(),Z=d(oe);{let Y=E(()=>r(w)?"size-3.5 animate-spin":"size-3.5");ki(Z,{get class(){return r(Y)}})}Ee(),c(oe),j(()=>oe.disabled=r(w)),be("click",oe,H),h(W,oe)}});var F=g(R,2),J=d(F);Tu(J,{get title(){return r(s).label},class:"mb-2",icon:oe=>{var Z=Ve(),Y=ve(Z);Gn(Y,()=>r(N),(Q,ee)=>{ee(Q,{class:"size-3.5"})}),h(oe,Z)},meta:oe=>{ns(oe,{children:(Z,Y)=>{Ee();var Q=pt();j(()=>P(Q,r(D).length)),h(Z,Q)},$$slots:{default:!0}})},$$slots:{icon:!0,meta:!0}});var A=g(J,2);{var y=z=>{var W=hk();h(z,W)},S=z=>{var W=_k();Je(W,21,()=>r(D),oe=>oe.key,(oe,Z)=>{var Y=Ve(),Q=ve(Y);{var ee=B=>{ts(B,{get title(){return r(Z).label},get hint(){return r(Z).key},action:ne=>{var re=xk(),te=d(re);tr(te,{class:"size-3"});var pe=g(te);c(re),j(()=>{Se(re,"title",r(Z).reason),P(pe,` requires ${r(Z).grant??""}`)}),h(ne,re)},$$slots:{action:!0}})},se=B=>{ts(B,{get title(){return r(Z).label},get description(){return r(Z).control.description},get hint(){return r(Z).key},action:ne=>{var re=Ve(),te=ve(re);{var pe=ke=>{{let he=E(()=>r(Z).value?"accent":"muted");ns(ke,{get tone(){return r(he)},children:(ge,Ce)=>{Ee();var Pe=pt();j(()=>P(Pe,r(Z).value?"on":"off")),h(ge,Pe)},$$slots:{default:!0}})}},me=ke=>{var he=bk(),ge=d(he,!0);c(he),j(Ce=>{Se(he,"title",Ce),P(ge,r(Z).value)},[()=>{var Ce;return`Options: ${(Ce=r(Z).control.options)==null?void 0:Ce.join(", ")}`}]),h(ke,he)},_e=ke=>{var he=mk(),ge=d(he,!0);c(he),j(Ce=>P(ge,Ce),[()=>V(r(Z).control,r(Z).value)]),h(ke,he)};X(te,ke=>{r(Z).control.kind==="boolean"?ke(pe):r(Z).control.kind==="enum"?ke(me,1):ke(_e,-1)})}h(ne,re)},$$slots:{action:!0}})};X(Q,B=>{r(Z).type==="denied"?B(ee):B(se,-1)})}h(oe,Y)}),c(W),h(z,W)};X(A,z=>{r(D).length===0?z(y):z(S,-1)})}c(F),c(C),h(m,C)},$$slots:{search:!0,nav:!0,footer:!0,content:!0}})};X(ie,$=>{r(_)?$(ae,-1):$(de)})}h(t,U),Ze()}Nt(["input","keydown","click"]);const al="'Inter Variable', 'Inter', system-ui, -apple-system, sans-serif",il="'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, 'SF Mono', 'Menlo', monospace",Fi=[{name:"reddb",label:"Reddb",description:"The signature near-black with a surgical rose accent.",colors:{bg:"#050607",accent:"#ff2056",fg:"#f7f8fa"},typography:{sans:al,mono:il}},{name:"nocturne",label:"Nocturne",description:"Indigo-tinted midnight with a violet accent.",colors:{bg:"#0a0b14",accent:"#7c5cff",fg:"#f5f6fb"},typography:{sans:al,mono:il}}],ed=Fi[0],td="red-ui-skin";function sl(t){return Fi.find(e=>e.name===t)??ed}function kn(t,e,n){return`color-mix(in srgb, ${t} ${e}%, ${n})`}function Va(t,e){return`color-mix(in srgb, ${t} ${e}%, transparent)`}const Ha=[0,4,9,15],qa=[6,13,22],Fa=[100,78,58,45];function nd(t){const{bg:e,accent:n,fg:o}=t.colors,a="#ffffff";return{"--color-bg-0":e,"--color-bg-1":kn(a,Ha[1],e),"--color-bg-2":kn(a,Ha[2],e),"--color-bg-3":kn(a,Ha[3],e),"--color-fg-0":o,"--color-fg-1":kn(o,Fa[1],e),"--color-fg-2":kn(o,Fa[2],e),"--color-fg-3":kn(o,Fa[3],e),"--color-line-1":kn(a,qa[0],e),"--color-line-2":kn(a,qa[1],e),"--color-line-3":kn(a,qa[2],e),"--color-accent":n,"--color-accent-soft":Va(n,12),"--color-accent-glow":Va(n,45),"--color-ambient-glow":Va(n,6),"--color-role-primary":n,"--color-role-replica":"#60a5fa","--color-role-embedded":"#4ade80","--color-ok":"#4ade80","--color-warn":"#fbbf24","--color-danger":"#ff5470","--color-info":"#60a5fa","--font-sans":t.typography.sans,"--font-mono":t.typography.mono}}function ll(t,e){const n=nd(t);for(const[o,a]of Object.entries(n))e.style.setProperty(o,a);e.dataset.theme="dark"}function kk(){return typeof localStorage>"u"?null:localStorage.getItem(td)}function Sk(t){typeof localStorage>"u"||localStorage.setItem(td,t)}function cl(t){return t??(typeof document<"u"?document.documentElement:null)}var to;class Ck{constructor(){He(this,to,xe(kt(ed)));wt(this,"target",null)}get current(){return r(ce(this,to))}set current(e){T(ce(this,to),e,!0)}init(e){this.target=cl(e);const n=kk();n&&(this.current=sl(n),this.target&&ll(this.current,this.target))}select(e){const n=sl(e);this.current=n;const o=cl(this.target);o&&(this.target=o,ll(n,o)),Sk(n.name)}}to=new WeakMap;const gi=new Ck;var Nk=k('<span class="inline-flex items-center gap-1 rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-accent"><!> Active</span>'),Ek=k('<button type="button"><div class="rounded-md overflow-hidden border border-line-1"><div class="bg-bg-0 p-3"><div class="flex items-center gap-1.5 mb-2.5"><span class="size-2 rounded-full" style="background: var(--color-accent)"></span> <span class="h-1.5 w-12 rounded-full bg-bg-3"></span> <span class="ml-auto h-1.5 w-6 rounded-full bg-bg-2"></span></div> <div class="rounded-md bg-bg-1 border border-line-2 p-2.5"><div class="h-1.5 w-2/3 rounded-full bg-fg-2 mb-2"></div> <div class="h-1.5 w-full rounded-full bg-bg-3 mb-1.5"></div> <div class="h-1.5 w-4/5 rounded-full bg-bg-3 mb-2.5"></div> <div class="flex items-center gap-1.5"><span class="h-4 w-12 rounded" style="background: var(--color-accent)"></span> <span class="h-4 w-8 rounded bg-bg-2 border border-line-2"></span></div></div></div> <div class="flex h-2.5"><span class="flex-1 bg-bg-0"></span> <span class="flex-1 bg-bg-1"></span> <span class="flex-1 bg-bg-2"></span> <span class="flex-1 bg-bg-3"></span></div></div> <div class="flex items-center gap-2 mt-3"><span class="type-h2 text-fg-0"> </span> <!></div> <p class="type-caption m-0 mt-1"> </p></button>'),Mk=k('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <div class="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4 max-w-4xl"></div></div>');function zk(t,e){$e(e,!0);function n(l){return Object.entries(nd(l)).map(([u,f])=>`${u}: ${f}`).join("; ")}const o=E(()=>gi.current.name);var a=Mk(),s=d(a);Qo(s,{eyebrow:"Settings",title:"Appearance",subtitle:"Pick a skin. Surfaces are derived from a single seed; the accent stays surgical. Dark only."});var i=g(s,2);Je(i,21,()=>Fi,l=>l.name,(l,u)=>{const f=E(()=>r(u).name===r(o));var v=Ek(),x=d(v),p=g(x,2),w=d(p),_=d(w,!0);c(w);var I=g(w,2);{var H=V=>{var q=Nk(),U=d(q);Yu(U,{class:"size-3"}),Ee(),c(q),h(V,q)};X(I,V=>{r(f)&&V(H)})}c(p);var D=g(p,2),L=d(D,!0);c(D),c(v),j(V=>{Se(v,"aria-pressed",r(f)),Oe(v,1,`group text-left rounded-lg border bg-bg-1 p-3 transition-colors ${r(f)?"border-accent":"border-line-2 hover:border-line-3"}`),$t(x,V),P(_,r(u).label),P(L,r(u).description)},[()=>n(r(u))]),be("click",v,()=>gi.select(r(u).name)),h(l,v)}),c(i),c(a),h(t,a),Ze()}Nt(["click"]);var Tk=k('<div class="app grid grid-rows-[44px_32px_1fr] h-screen"><!> <!> <main class="relative overflow-hidden z-[1]"><!></main> <!> <!> <!> <!></div>');function Vk(t,e){$e(e,!0);let n=qe(e,"showConnect",3,!0),o=qe(e,"persistTheme",3,!0);const a=Yf(e.router??Ml());e.connectionProvider&&Gd(e.connectionProvider);function s(D){const L=D;if(L==="query"||L==="collections"||L==="cluster"||L==="security"||L==="settings"||L==="appearance"){a.go({view:L},void 0,!0);return}const V=Wf(D.startsWith("/")?D:`/${D}`);V.collection?a.go({view:"collection",collection:V.collection,subpage:V.subpage??"table"},void 0,!0):a.go({view:V.view},void 0,!0)}Rn(()=>{e.connectionProvider?Ue.adoptInjected().then(()=>{e.initialRoute&&s(e.initialRoute)}):Ue.bootstrap().then(D=>{D&&s(D)})});let i=xe(!1),l=xe(!1);Rn(()=>{const D=()=>T(l,!0);return window.addEventListener("red:open-pending-changes",D),()=>window.removeEventListener("red:open-pending-changes",D)}),It(()=>{const D=Ue.client;if(!D){jt.setExecutor(null),rn.setExecutor(null);return}rn.setExecutor(L=>$d(D,L)),jt.setExecutor(async L=>Promise.all(L.map(async V=>{try{const q=await D.query(Si(V));return q.ok?{id:V.id,ok:!0}:{id:V.id,ok:!1,error:q.error??"query failed"}}catch(q){return{id:V.id,ok:!1,error:q.message}}})))});const u=5e3;Wn.init({target:e.themeTarget??null,persist:o(),initial:e.initialTheme}),gi.init(e.themeTarget??null),It(()=>{if(Ot.locked||!Ue.targetResolved)return;Ue.refresh();const D=setInterval(()=>Ue.refresh(),u);return()=>clearInterval(D)}),It(()=>{Ot.store&&Ue.hydrateUrls()});function f(){const D=rn.nextLabel(),L=_t.open({kind:"query",label:D,key:D},!0);rn.ensure(L.id)}async function v(D,L){const V=_t.tabs.find(U=>U.kind==="collection"&&U.key===D);V?_t.open({kind:"collection",label:D,key:D,capability:V.capability,overrideCapability:V.overrideCapability,showSystemColumns:V.showSystemColumns,subpage:L??V.subpage}):_t.open({kind:"collection",label:D,key:D,capability:"table",subpage:L??void 0});const q=Ue.client;if(!q){L||a.go({view:"collection",collection:D,subpage:"table"},void 0,!0);return}try{const U=await Il(q,D),ie=_t.tabs.find(ae=>ae.kind==="collection"&&ae.key===D),de=L??Ar(U);ie&&(_t.tabs=_t.tabs.map(ae=>ae===ie?{...ae,capability:U,subpage:de}:ae)),L||a.go({view:"collection",collection:D,subpage:de},void 0,!0)}catch{L||a.go({view:"collection",collection:D,subpage:"table"},void 0,!0)}}let x=null,p=null;It(()=>{const D=a.view,L=a.collection,V=a.subpage;if(D==="collections"&&L){const q=`${L}::${V??""}`;q!==p&&(p=q,Cn(()=>void v(L,V)))}else p=null;D==="query"&&x!=="query"&&Cn(()=>f()),x=D});var w=Ve(),_=ve(w);{var I=D=>{tu(D,{onDone:()=>T(i,!0)})},H=D=>{var L=Tk(),V=d(L);Zf(V,{get showConnect(){return n()}});var q=g(V,2);uv(q,{});var U=g(q,2),ie=d(U);{var de=C=>{N3(C,{})},ae=C=>{rk(C,{})},$=C=>{wk(C,{})},fe=C=>{zk(C,{})},O=C=>{Fb(C)};X(ie,C=>{a.view==="cluster"?C(de):a.view==="security"?C(ae,1):a.view==="settings"?C($,2):a.view==="appearance"?C(fe,3):C(O,-1)})}c(U);var b=g(U,2);xv(b,{});var M=g(b,2);kv(M,{});var m=g(M,2);Tv(m,{});var N=g(m,2);Vv(N,{get open(){return r(l)},onClose:()=>T(l,!1)}),c(L),h(D,L)};X(_,D=>{r(i)?D(H,-1):D(I)})}h(t,w),Ze()}export{Vk as W,Wf as p,is as t};
|