@reddb-io/ui 0.2.0 → 0.3.1
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.DgbuWrJy.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/85-Fh5Zp.js +404 -0
- package/build/_app/immutable/chunks/{BHBXmd1Y.js → 8zg2gJwV.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/Bq4DTWK2.js +2 -0
- package/build/_app/immutable/chunks/Btd6PFkC.js +1 -0
- package/build/_app/immutable/chunks/CGFL56WJ.js +1 -0
- package/build/_app/immutable/chunks/CJFJ501n.js +18 -0
- package/build/_app/immutable/chunks/CLBx21Hz.js +2 -0
- package/build/_app/immutable/chunks/CnD4hwxC.js +1106 -0
- package/build/_app/immutable/chunks/DCJ0QyYH.js +1 -0
- package/build/_app/immutable/chunks/DQCYUNtS.js +1 -0
- package/build/_app/immutable/chunks/DRlh90Cv.js +1 -0
- package/build/_app/immutable/chunks/{C278awGv.js → DV9PDoM3.js} +1 -1
- package/build/_app/immutable/entry/app.BDog2y0J.js +2 -0
- package/build/_app/immutable/entry/start.D1J45dq5.js +1 -0
- package/build/_app/immutable/nodes/0.BTrC4th2.js +1 -0
- package/build/_app/immutable/nodes/1.Ds1Tbjsm.js +1 -0
- package/build/_app/immutable/nodes/10.D_FCLs0Z.js +96 -0
- package/build/_app/immutable/nodes/12.DPE6v6Zf.js +3 -0
- package/build/_app/immutable/nodes/14.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/15.CcJlZGxa.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-D8z1Nsed.js +23337 -0
- package/dist/embed/AnalyticsView-D8z1Nsed.js.map +1 -0
- package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js +31302 -0
- package/dist/embed/RedUiEmbedRoot-CtqTd_FG.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-client-BeiP-va5.js +3303 -0
- package/dist/embed/index-client-BeiP-va5.js.map +1 -0
- package/dist/embed/index-w1Qo_uW0.js +677 -0
- package/dist/embed/index-w1Qo_uW0.js.map +1 -0
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-C2pqg5JH.js → sigma.esm-qqKBpvin.js} +2 -2
- package/dist/embed/{sigma.esm-C2pqg5JH.js.map → sigma.esm-qqKBpvin.js.map} +1 -1
- package/package.json +5 -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/GlobalProgressBar.svelte +9 -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 +1137 -226
- package/src/lib/Topbar.svelte +29 -1
- package/src/lib/Workspace.svelte +18 -3
- package/src/lib/activity.svelte.ts +44 -35
- package/src/lib/collection-preview.ts +14 -0
- package/src/lib/connections.svelte.ts +73 -4
- package/src/lib/index.ts +3 -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 +159 -58
- package/src/lib/reddb/cluster-status.ts +306 -0
- package/src/lib/reddb/index.ts +3 -0
- package/src/lib/reddb/local-url-provider.ts +32 -1
- package/src/lib/reddb/redwire-ws-spike.ts +590 -0
- package/src/lib/router.svelte.ts +12 -0
- package/src/lib/settings-authoring-client.ts +336 -0
- package/src/lib/settings-sections.ts +294 -180
- 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/BMc_qoms.js +0 -973
- package/build/_app/immutable/chunks/BrvvOVaJ.js +0 -1
- package/build/_app/immutable/chunks/CwxFwvow.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/entry/app.CGfmRH-N.js +0 -2
- package/build/_app/immutable/entry/start._LhFJimm.js +0 -1
- package/build/_app/immutable/nodes/0.BYhY6O5-.js +0 -1
- package/build/_app/immutable/nodes/1.4XYGRMul.js +0 -1
- package/build/_app/immutable/nodes/12.DXZfNPNK.js +0 -60
- package/build/_app/immutable/nodes/8.C7OOsMOJ.js +0 -134
- package/dist/embed/RedUiEmbedRoot-Dia9lxfb.js +0 -28570
- package/dist/embed/RedUiEmbedRoot-Dia9lxfb.js.map +0 -1
- package/dist/embed/index-Bq0TT7Ao.js +0 -577
- package/dist/embed/index-Bq0TT7Ao.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,973 +0,0 @@
|
|
|
1
|
-
var fd=Object.defineProperty;var Wi=t=>{throw TypeError(t)};var vd=(t,e,n)=>e in t?fd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wt=(t,e,n)=>vd(t,typeof e!="symbol"?e+"":e,n),ha=(t,e,n)=>e.has(t)||Wi("Cannot "+n);var de=(t,e,n)=>(ha(t,e,"read from private field"),n?n.call(t):e.get(t)),Ve=(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),Ui=(t,e,n)=>(ha(t,e,"access private method"),n);import"./Bzak7iHL.js";import{aG as gd,at as pd,aS as hd,bp as j,ay as go,be as Yi,ar as Mr,aw as Xi,Q as xd,b0 as bd,ax as Gi,e as md,as as _d,aA as yd,p as wd,a4 as kd,w as Sd,v as Cd,ae as gi,bs as Cn,b2 as Nd,a7 as Ed,b7 as Md,aZ as Ze,aU as On,b9 as P,aj as fe,am as r,aW as $e,bl as xe,a0 as d,aR as Zt,b3 as c,bi as g,bv as C,bq as zd,aY as Ct,aQ as Ce,ba as pi,ao as na,bw as It,br as rn,b1 as dl,aT as ra,av as Td,bx as Pd,af as ul,ai as Yt,a as tn,ah as Id}from"./oiO4RLqp.js";import{b as xa,d as He,a as h,j as S,g as Nt,s as T,h as _e,i as Rn,t as gt,k as Dt,e as Ad,q as Ka}from"./BGcIe2ep.js";import{i as X,_ as Ld,p as Fe,b as on,l as nt,s as et,c as Gn,r as er}from"./D9CTkMjK.js";import{M as Oe,O as $t,V as kt,l as Ue,J as ke,I as rt,U as ot,p as We,z as Vt,k as Kt,b as mn,r as Je,X as Qt,v as qt,y as Od,g as Mt,n as Rd,N as fl,e as un,D as Ot,f as Dd,q as Ar,x as hi,K as vl,F as xi,c as oa,d as Vd,G as Hd,u as Fd,j as Ba,T as qd,i as Kd,Q as Bd,a as ba,W as jd,L as Wd,h as Dn,C as bi,S as aa,w as Ud,P as Yd,R as Xd,E as Rr,H as Gd,B as Zd}from"./65XjEwaF.js";import"./69_IOA4Y.js";const $d=[];function gl(t,e=!1,n=!1){return Eo(t,new Map,"",$d,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(gd(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(pd(t)===hd){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=Yi(Mr(u)))}j(()=>{var f=xd;if(l===(l=e()??"")){go&&Xi();return}if(n&&!go){f.nodes=null,u.innerHTML=l,l!==""&&xa(Mr(u),u.lastChild);return}if(f.nodes!==null&&(bd(f.nodes.start,f.nodes.end),f.nodes=null),l!==""){if(go){Gi.data;for(var v=Xi(),x=v;v!==null&&(v.nodeType!==md||v.data!=="");)x=v,v=_d(v);if(v===null)throw yd(),wd;xa(Gi,x),i=Yi(v);return}var p=o?Sd:a?Cd:void 0,w=kd(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){gi(()=>{var o=Cn(()=>e(t,n==null?void 0:n())||{});if(n&&(o!=null&&o.update)){var a=!1,s={};Nd(()=>{var i=n();Ed(i),a&&Md(s,i)&&(s=i,o.update(i))}),a=!0}if(o!=null&&o.destroy)return()=>o.destroy()})}var Ln,hr,Wr,ea,pl;const ta=class ta{constructor(e){Ve(this,ea);Ve(this,Ln,new WeakMap);Ve(this,hr);Ve(this,Wr);Er(this,Wr,e)}observe(e,n){var o=de(this,Ln).get(e)||new Set;return o.add(n),de(this,Ln).set(e,o),Ui(this,ea,pl).call(this).observe(e,de(this,Wr)),()=>{var a=de(this,Ln).get(e);a.delete(n),a.size===0&&(de(this,Ln).delete(e),de(this,hr).unobserve(e))}}};Ln=new WeakMap,hr=new WeakMap,Wr=new WeakMap,ea=new WeakSet,pl=function(){return de(this,hr)??Er(this,hr,new ResizeObserver(e=>{for(var n of e){ta.entries.set(n.target,n);for(var o of de(this,Ln).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]));gi(()=>(Cn(()=>n(t[e])),o))}var eu=S('<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){Ze(e,!0);let n=xe(!0),o=xe(0);On(()=>{const l=setTimeout(()=>P(o,1),20),u=setTimeout(()=>P(o,2),800),f=setTimeout(()=>{var v;P(n,!1),(v=e.onDone)==null||v.call(e)},1e3);return()=>{clearTimeout(l),clearTimeout(u),clearTimeout(f)}});var a=He(),s=fe(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),$e()}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')}),$i=t=>t===!1?"false":t===!0?"true":t===0?"0":t,Ut=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 hl(t,e){for(let n=0;n<t.length;n++){let o=t[n];Array.isArray(o)?hl(o,e):e.push(o)}}var xl=(...t)=>{let e=[];hl(t,e);let n=[];for(let o=0;o<e.length;o++)e[o]&&n.push(e[o]);return n},bl=(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]=xl(s,a):typeof a=="object"&&typeof s=="object"&&a&&s?n[o]=bl(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,Qi=t=>!t||typeof t!="string"?t:t.replace(ou," ").trim(),cr=null,Mo=null,au=async()=>cr||Mo||(Mo=Ld(()=>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(Ut(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},(Ut(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=[];ml(t,e);let n="";for(let o=0;o<e.length;o++)e[o]&&(n&&(n+=" "),n+=e[o]);return n||void 0};function ml(t,e){for(let n=0;n<t.length;n++){let o=t[n];Array.isArray(o)?ml(o,e):o&&e.push(o)}}var ma=null,Wa={},Ua=!1,po=(...t)=>e=>{let n=Vo(t);return!n||!e.twMerge?n:((!ma||Ua)&&(Ua=!1,ma=iu(Wa)),ma(n)||void 0)},Ji=(t,e)=>{for(let n in e)n in t?t[n]=Vo(t[n],e[n]):t[n]=e[n];return t},mi=(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&&!Ut(n.variants)?bl(a,n.variants):a,x=n!=null&&n.defaultVariants&&!Ut(n.defaultVariants)?{...n.defaultVariants,...l}:l;!Ut(u.twMergeConfig)&&!ru(u.twMergeConfig,Wa)&&(Ua=!0,Wa=u.twMergeConfig);let p=Ut(n==null?void 0:n.slots),w=Ut(o)?{}:{base:Vo(t==null?void 0:t.base,p&&(n==null?void 0:n.base)),...o},_=p?w:Ji({...n==null?void 0:n.slots},Ut(w)?{base:t==null?void 0:t.base}:w),A=Ut(n==null?void 0:n.compoundVariants)?s:xl(n==null?void 0:n.compoundVariants,s),F=L=>{if(Ut(v)&&Ut(o)&&p)return po(f,L==null?void 0:L.class,L==null?void 0:L.className)(u);if(A&&!Array.isArray(A))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof A}`);if(i&&!Array.isArray(i))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof i}`);let H=(y,M,m=[],E)=>{let N=m;if(typeof M=="string"){let O=Qi(M).split(" ");for(let K=0;K<O.length;K++)N.push(`${y}:${O[K]}`)}else if(Array.isArray(M))for(let O=0;O<M.length;O++)N.push(`${y}:${M[O]}`);else if(typeof M=="object"&&typeof E=="string"&&E in M){let O=M[E];if(O&&typeof O=="string"){let K=Qi(O).split(" "),Z=[];for(let z=0;z<K.length;z++)Z.push(`${y}:${K[z]}`);N[E]=N[E]?N[E].concat(Z):Z}else if(Array.isArray(O)&&O.length>0){let K=[];for(let Z=0;Z<O.length;Z++)K.push(`${y}:${O[Z]}`);N[E]=K}}return N},V=(y,M=v,m=null,E=null)=>{let N=M[y];if(!N||Ut(N))return null;let O=(E==null?void 0:E[y])??(L==null?void 0:L[y]);if(O===null)return null;let K=$i(O),Z=Array.isArray(u.responsiveVariants)&&u.responsiveVariants.length>0||u.responsiveVariants===!0,z=x==null?void 0:x[y],b=[];if(typeof K=="object"&&Z)for(let[U,ce]of Object.entries(K)){let J=N[ce];if(U==="initial"){z=ce;continue}Array.isArray(u.responsiveVariants)&&!u.responsiveVariants.includes(U)||(b=H(U,J,b,m))}let k=K!=null&&typeof K!="object"?K:$i(z),I=N[k||"false"];return typeof b=="object"&&typeof m=="string"&&b[m]?Ji(b,I):b.length>0?(b.push(I),m==="base"?b.join(" "):b):I},q=()=>{if(!v)return null;let y=Object.keys(v),M=[];for(let m=0;m<y.length;m++){let E=V(y[m],v);E&&M.push(E)}return M},ee=(y,M)=>{if(!v||typeof v!="object")return null;let m=[];for(let E in v){let N=V(E,v,y,M),O=y==="base"&&typeof N=="string"?N:N&&N[y];O&&m.push(O)}return m},oe={};for(let y in L){let M=L[y];M!==void 0&&(oe[y]=M)}let ae=(y,M)=>{var E;let m=typeof(L==null?void 0:L[y])=="object"?{[y]:(E=L[y])==null?void 0:E.initial}:{};return{...x,...oe,...m,...M}},ne=(y=[],M)=>{let m=[],E=y.length;for(let N=0;N<E;N++){let{class:O,className:K,...Z}=y[N],z=!0,b=ae(null,M);for(let k in Z){let I=Z[k],U=b[k];if(Array.isArray(I)){if(!I.includes(U)){z=!1;break}}else{if((I==null||I===!1)&&(U==null||U===!1))continue;if(U!==I){z=!1;break}}}z&&(O&&m.push(O),K&&m.push(K))}return m},ve=y=>{let M=ne(A,y);if(!Array.isArray(M))return M;let m={},E=po;for(let N=0;N<M.length;N++){let O=M[N];if(typeof O=="string")m.base=E(m.base,O)(u);else if(typeof O=="object")for(let K in O)m[K]=E(m[K],O[K])(u)}return m},R=y=>{if(i.length<1)return null;let M={},m=ae(null,y);for(let E=0;E<i.length;E++){let{slots:N=[],class:O,className:K,...Z}=i[E];if(!Ut(Z)){let z=!0;for(let b in Z){let k=m[b],I=Z[b];if(k===void 0||(Array.isArray(I)?!I.includes(k):I!==k)){z=!1;break}}if(!z)continue}for(let z=0;z<N.length;z++){let b=N[z];M[b]||(M[b]=[]),M[b].push([O,K])}}return M};if(!Ut(o)||!p){let y={};if(typeof _=="object"&&!Ut(_)){let M=po;for(let m in _)y[m]=E=>{let N=ve(E),O=R(E);return M(_[m],ee(m,E),N?N[m]:void 0,O?O[m]:void 0,E==null?void 0:E.class,E==null?void 0:E.className)(u)}}return y}return po(f,q(),ne(A),L==null?void 0:L.class,L==null?void 0:L.className)(u)},D=()=>{if(!(!v||typeof v!="object"))return Object.keys(v)};return F.variantKeys=D(),F.extend=n,F.base=f,F.slots=_,F.variants=v,F.defaultVariants=x,F.compoundSlots=i,F.compoundVariants=A,F};mi({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=mi({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=S("<span><!></span>");function Sn(t,e){Ze(e,!0);let n=Fe(e,"tone",3,"neutral"),o=Fe(e,"class",3,"");var a=cu(),s=d(a);kt(s,()=>e.children??Zt),c(a),j(i=>Oe(a,1,i),[()=>Ue(lu({tone:n(),class:o()}))]),h(t,a),$e()}var du=S('<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=S('<section><!> <div class="p-4"><!></div></section>');function Wn(t,e){let n=Fe(e,"floating",3,!1),o=Fe(e,"class",3,"");const a=C(()=>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(()=>T(p,e.title)),h(v,x)};X(i,v=>{e.title&&v(l)})}var u=g(i,2),f=d(u);kt(f,()=>e.children??Zt),c(u),c(s),j(()=>Oe(s,1,`rounded-lg border overflow-hidden backdrop-blur-md ${r(a)??""} ${o()??""}`)),h(t,s)}var fu=S('<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){Ze(e,!0);const n=C(()=>({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`),T(i,e.label??e.role)}),h(t,o),$e()}var gu=S('<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 Gt(t,e){var n=gu(),o=d(n);kt(o,()=>e.children??Zt),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=S("<div><!></div>"),bu=S("<div><!></div>"),mu=S('<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=S('<div><div><aside><!> <div class="min-h-0 flex-1 overflow-y-auto"><!></div> <!></aside> <section><!></section></div> <!></div>');function yu(t,e){Ze(e,!0);let n=Fe(e,"searchOverlay",3,!1),o=Fe(e,"searchOpen",15,!1),a=Fe(e,"searchShortcut",3,hu),s=Fe(e,"class",3,""),i=Fe(e,"navClass",3,""),l=Fe(e,"contentClass",3,""),u=Fe(e,"footerClass",3,""),f=Fe(e,"searchClass",3,"");const v=C(()=>pu(e.collapsed));let x=xe(void 0),p=xe(void 0);function w(y){const M=y==null?void 0:y.querySelector('input, textarea, select, button, [href], [tabindex]:not([tabindex="-1"])');M==null||M.focus()}async function _(){n()?(o(!0),await zd(),w(r(p))):w(r(x))}On(()=>{const y=M=>{if(a()&&a()(M)){M.preventDefault(),_();return}n()&&o()&&M.key==="Escape"&&(M.preventDefault(),o(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)});var A=_u(),F=d(A),D=d(F),L=d(D);{var H=y=>{var M=xu(),m=d(M);kt(m,()=>e.search),c(M),on(M,E=>P(x,E),()=>r(x)),j(()=>Oe(M,1,`shrink-0 border-b border-line-1 p-2 ${f()??""}`)),h(y,M)};X(L,y=>{e.search&&!n()&&y(H)})}var V=g(L,2),q=d(V);kt(q,()=>e.nav??Zt),c(V);var ee=g(V,2);{var oe=y=>{var M=bu(),m=d(M);kt(m,()=>e.footer),c(M),j(()=>Oe(M,1,`mt-auto shrink-0 border-t border-line-1 ${u()??""}`)),h(y,M)};X(ee,y=>{e.footer&&y(oe)})}c(D);var ae=g(D,2),ne=d(ae);kt(ne,()=>e.content??Zt),c(ae),c(F);var ve=g(F,2);{var R=y=>{var M=mu(),m=fe(M),E=g(m,2),N=d(E);kt(N,()=>e.search),c(E),on(E,O=>P(p,O),()=>r(p)),j(()=>Oe(E,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()??""}`)),_e("click",m,()=>o(!1)),h(y,M)};X(ve,y=>{e.search&&n()&&o()&&y(R)})}c(A),j(()=>{Oe(A,1,`@container relative h-full min-h-0 w-full ${s()??""}`),Oe(F,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,A),$e()}Nt(["click"]);var wu=S('<span class="shrink-0 font-mono text-[11px] text-fg-2"> </span>'),ku=S('<p class="mt-0.5 text-[12px] leading-snug text-fg-2"> </p>'),Su=S("<div><!></div>"),Cu=S('<div class="w-full"><!></div>'),Nu=S('<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 es(t,e){Ze(e,!0);let n=Fe(e,"wide",3,!1),o=Fe(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 H=wu(),V=d(H,!0);c(H),j(()=>T(V,e.hint)),h(L,H)};X(v,L=>{e.hint&&L(x)})}c(l);var p=g(l,2);{var w=L=>{var H=ku(),V=d(H,!0);c(H),j(()=>T(V,e.description)),h(L,H)};X(p,L=>{e.description&&L(w)})}c(i),c(s);var _=g(s,2);{var A=L=>{var H=Su(),V=d(H);kt(V,()=>e.action),c(H),j(q=>Oe(H,1,q),[()=>Ue(["flex items-center gap-2",n()?"w-full":"shrink-0"].join(" "))]),h(L,H)};X(_,L=>{e.action&&L(A)})}var F=g(_,2);{var D=L=>{var H=Cu(),V=d(H);kt(V,()=>e.below),c(H),h(L,H)};X(F,L=>{e.below&&L(D)})}c(a),j((L,H)=>{ke(a,"data-wide",n()?"":void 0),Oe(a,1,L),Oe(s,1,H),T(f,e.title)},[()=>Ue(["px-3 py-2.5",n()?"flex flex-col gap-2":"flex items-center gap-3",o()].join(" ")),()=>Ue(["flex min-w-0 items-baseline gap-2",n()?"":"flex-1"].join(" "))]),h(t,a),$e()}var Eu=S('<span class="flex size-4 shrink-0 items-center justify-center text-fg-2"><!></span>'),Mu=S('<span class="ml-0.5"><!></span>'),zu=S('<div><!> <h2 class="text-[11px] font-mono uppercase tracking-[0.1em] text-fg-2"> </h2> <!></div>');function Tu(t,e){let n=Fe(e,"class",3,"");var o=zu(),a=d(o);{var s=v=>{var x=Eu(),p=d(x);kt(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);kt(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()??""}`),T(l,e.title)}),h(t,o)}const Pu=mi({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=S("<span><!></span>");function ts(t,e){Ze(e,!0);let n=Fe(e,"tone",3,"muted"),o=Fe(e,"class",3,"");var a=Iu(),s=d(a);kt(s,()=>e.children??Zt),c(a),j(i=>Oe(a,1,i),[()=>Ue(Pu({tone:n(),class:o()}))]),h(t,a),$e()}var Au=S('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),Lu=S('<span class="shrink-0"><!></span>'),Ou=S('<a><!> <span class="flex-1 truncate"> </span> <!></a>'),Ru=S('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),Du=S('<span class="shrink-0"><!></span>'),Vu=S('<button type="button"><!> <span class="flex-1 truncate"> </span> <!></button>');function Hu(t,e){Ze(e,!0);let n=Fe(e,"active",3,!1),o=Fe(e,"class",3,"");const a=C(()=>["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=He(),i=fe(s);{var l=f=>{var v=Ou(),x=d(v);{var p=D=>{var L=Au(),H=d(L);kt(H,()=>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 A=g(w,2);{var F=D=>{var L=Lu(),H=d(L);kt(H,()=>e.trailing),c(L),h(D,L)};X(A,D=>{e.trailing&&D(F)})}c(v),j(()=>{ke(v,"href",e.href),ke(v,"aria-current",n()?"page":void 0),Oe(v,1,Ue(r(a))),T(_,e.label)}),_e("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(),H=d(L);kt(H,()=>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 A=g(w,2);{var F=D=>{var L=Du(),H=d(L);kt(H,()=>e.trailing),c(L),h(D,L)};X(A,D=>{e.trailing&&D(F)})}c(v),j(()=>{ke(v,"aria-current",n()?"page":void 0),Oe(v,1,Ue(r(a))),T(_,e.label)}),_e("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),$e()}Nt(["click"]);const Fu=[1e3,2e3,4e3,8e3,3e4];class qu{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??Fu,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=He(),l=fe(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=He(),l=fe(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=He(),l=fe(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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Wu(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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Uu(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=He(),l=fe(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=He(),l=fe(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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function _i(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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function _l(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=He(),l=fe(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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Zu(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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function $u(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=He(),l=fe(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=He(),l=fe(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:"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=He(),l=fe(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function yl(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ef(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:"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=He(),l=fe(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function wl(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=[["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=He(),l=fe(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function nf(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=[["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=He(),l=fe(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Ya(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function of(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=[["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=He(),l=fe(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=[["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=He(),l=fe(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:"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=He(),l=fe(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:"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=He(),l=fe(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function tr(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function df(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=[["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=He(),l=fe(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function yi(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Sl(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:"M5 12h14"}],["path",{d:"M12 5v14"}]];rt(t,et({name:"plus"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ff(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:"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=He(),l=fe(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 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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function wi(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Xa(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function gf(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=[["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=He(),l=fe(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ns(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function hf(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function zo(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function ho(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 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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function xf(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:"m9 12 2 2 4-4"}]];rt(t,et({name:"shield-check"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function Cl(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"}]];rt(t,et({name:"shield"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function bf(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function rs(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=[["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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}function mf(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:"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=He(),l=fe(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:"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=He(),l=fe(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:"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=He(),l=fe(i);ot(l,e,"default",{}),h(a,i)},$$slots:{default:!0}}))}var wf=S("<!> Connecting…",1),kf=S("<!> Connect",1),Sf=S('<!> <span class="text-ok"> </span>',1),Cf=S('<!> <span class="text-danger truncate"> </span>',1),Nf=S("<span> </span>"),Ef=S('<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>'),Mf=S('<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>'),zf=S('<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),Tf=S('<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 Pf(t,e){Ze(e,!0);const n="red://localhost";function o(){var O,K;return(O=We.history[0])!=null&&O.url?We.history[0].url:(K=We.history[0])!=null&&K.label?We.history[0].label:We.active.url?We.active.url:n}let a=xe(!1),s=xe(Ct(o())),i=xe("idle"),l=xe(null),u=xe(null),f=xe(void 0),v=xe(void 0);async function x(O){const K=O.trim().replace(/\/$/,"");if(!K)return;if(P(s,K,!0),!We.canReach(K)){P(i,"error"),P(l,`This app can't reach that transport here — supported: ${r(H)}`);return}P(i,"probing"),P(l,null),P(u,null),await We.tryConnect(Od(K))?(P(i,"ok"),P(u,We.probe.rtt_ms??null,!0),setTimeout(()=>P(a,!1),350)):(P(i,"error"),P(l,We.probe.error??"unreachable",!0))}function p(O){O.preventDefault(),x(r(s))}function w(O){const K=Date.now()-O;return K<6e4?"just now":K<36e5?`${Math.round(K/6e4)}m ago`:K<864e5?`${Math.round(K/36e5)}h ago`:`${Math.round(K/864e5)}d ago`}function _(O,K){O.stopPropagation(),We.forgetById(K)}function A(){P(a,!r(a)),r(a)&&setTimeout(()=>{var O;return(O=r(v))==null?void 0:O.focus()},0)}On(()=>{const O=()=>{P(a,!0),setTimeout(()=>{var K;return(K=r(v))==null?void 0:K.focus()},0)};return window.addEventListener("red:open-connect",O),()=>window.removeEventListener("red:open-connect",O)});const F=C(()=>We.connected?"bg-ok":r(i)==="error"?"bg-danger":"bg-fg-3"),D=C(()=>We.connected?We.active.label:"Connect"),L=C(()=>We.connected&&We.probe.rtt_ms!==void 0?`${We.probe.rtt_ms}ms`:We.connected?"live":"no connection"),H=C(()=>{const O=We.supportedTransports,K=[];return(O.includes("http")||O.includes("https"))&&K.push("http(s)://"),O.includes("unix")&&K.push("file://"),K.join(" · ")}),V=C(()=>We.history.filter(O=>!O.url||We.canReach(O.url)));var q=Tf(),ee=d(q),oe=d(ee),ae=g(oe,2);{var ne=O=>{yi(O,{class:"size-3 text-fg-3"})};X(ae,O=>{We.connected||O(ne)})}var ve=g(ae,2),R=d(ve,!0);c(ve);var y=g(ve,2),M=d(y,!0);c(y);var m=g(y,2);Xu(m,{class:"size-3 text-fg-3"}),c(ee);var E=g(ee,2);{var N=O=>{var K=zf(),Z=fe(K),z=g(Z,2),b=d(z),k=g(d(b),2);Vt(k),on(k,te=>P(v,te),()=>r(v));var I=g(k,2),U=d(I);c(I);var ce=g(I,2),J=d(ce);{var Y=te=>{var ge=wf(),he=fe(ge);mn(he,{class:"size-3.5 animate-spin"}),Ce(),h(te,ge)},Q=te=>{var ge=kf(),he=fe(ge);yf(he,{class:"size-3.5"}),Ce(),h(te,ge)};X(J,te=>{r(i)==="probing"?te(Y):te(Q,-1)})}c(ce);var $=g(ce,2),se=d($);{var W=te=>{var ge=Sf(),he=fe(ge);_l(he,{class:"size-3 text-ok"});var be=g(he,2),Te=d(be);c(be),j(()=>T(Te,`Connected${r(u)!==null?` · ${r(u)}ms`:""}`)),h(te,ge)},B=te=>{var ge=Cf(),he=fe(ge);_i(he,{class:"size-3 text-danger"});var be=g(he,2),Te=d(be,!0);c(be),j(()=>T(Te,r(l))),h(te,ge)};X(se,te=>{r(i)==="ok"?te(W):r(i)==="error"&&te(B,1)})}c($),c(b);var ie=g(b,2);{var re=te=>{var ge=Mf(),he=d(ge),be=d(he);Zu(be,{class:"size-3 text-fg-3"}),Ce(2),c(he);var Te=g(he,2);Je(Te,21,()=>r(V),qt,(ye,pe)=>{var Me=Ef(),Pe=d(Me),ue=d(Pe),le=d(ue,!0);c(ue);var we=g(ue,2),Ne=d(we);{var Se=Ke=>{var at=Nf(),Be=d(at);c(at),j(()=>T(Be,`${r(pe).rtt_ms??""}ms`)),h(Ke,at)};X(Ne,Ke=>{r(pe).rtt_ms!==void 0&&Ke(Se)})}var ze=g(Ne,2),me=d(ze,!0);c(ze),c(we),c(Pe);var Ee=g(Pe,2),Ae=d(Ee);Qt(Ae,{class:"size-3"}),c(Ee),c(Me),j(Ke=>{Pe.disabled=r(i)==="probing",ke(Pe,"title",r(pe).url?void 0:"Enter credentials to reconnect"),T(le,r(pe).url??r(pe).label),T(me,Ke)},[()=>w(r(pe).last_used)]),_e("click",Pe,()=>{r(pe).url?x(r(pe).url):(P(s,r(pe).label,!0),setTimeout(()=>{var Ke;return(Ke=r(v))==null?void 0:Ke.focus()},0))}),_e("click",Ee,Ke=>_(Ke,r(pe).id)),h(ye,Me)}),c(Te),c(ge),h(te,ge)};X(ie,te=>{r(V).length>0&&te(re)})}c(z),on(z,te=>P(f,te),()=>r(f)),j(te=>{T(U,`reachable here: ${r(H)??""}`),ce.disabled=te},[()=>r(i)==="probing"||!r(s).trim()]),_e("click",Z,()=>P(a,!1)),Rn("submit",b,p),Kt(k,()=>r(s),te=>P(s,te)),h(O,K)};X(E,O=>{r(a)&&O(N)})}c(q),j(O=>{ke(ee,"aria-expanded",r(a)),ke(ee,"title",We.connected?"Switch connection":"Connect to reddb"),Oe(oe,1,O),T(R,r(D)),T(M,r(L))},[()=>Ue(["w-1.5 h-1.5 rounded-full shrink-0",r(F)].join(" "))]),_e("click",ee,A),h(t,q),$e()}Nt(["click"]);var If=S("<!> <span> </span>",1),Af=S('<!> <span class="text-fg-3">idle</span>',1),Lf=S('<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>'),Of=S('<div class="px-3 py-3 text-fg-3">No activity yet.</div>'),Rf=S('<div class="text-danger text-[10px] truncate"> </div>'),Df=S('<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>'),Vf=S('<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),Hf=S('<div class="relative"><button type="button" title="reddb activity"><!></button> <!></div>');function Ff(t,e){Ze(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=Hf(),i=d(s),l=d(i);{var u=p=>{var w=If(),_=fe(w);mn(_,{class:"size-3.5 animate-spin"});var A=g(_,2),F=d(A,!0);c(A),j(()=>T(F,Mt.inflight)),h(p,w)},f=p=>{var w=Af(),_=fe(w);Dr(_,{class:"size-3.5"}),Ce(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=Vf(),_=fe(w),A=g(_,2),F=d(A),D=g(d(F),2),L=d(D),H=d(L);c(L);var V=g(L,2);{var q=ve=>{var R=Lf();_e("click",R,()=>Mt.reset()),h(ve,R)};X(V,ve=>{Mt.inflight>0&&ve(q)})}c(D),c(F);var ee=g(F,2),oe=d(ee);{var ae=ve=>{var R=Of();h(ve,R)},ne=ve=>{var R=He(),y=fe(R);Je(y,17,()=>Mt.log,M=>M.id,(M,m)=>{var E=Df(),N=d(E),O=d(N);{var K=se=>{mn(se,{class:"size-3 animate-spin text-accent"})},Z=se=>{_l(se,{class:"size-3 text-ok"})},z=se=>{_i(se,{class:"size-3 text-danger"})};X(O,se=>{r(m).status==="pending"?se(K):r(m).status==="ok"?se(Z,1):se(z,-1)})}c(N);var b=g(N,2),k=d(b),I=d(k,!0);c(k);var U=g(k,2);{var ce=se=>{var W=Rf(),B=d(W,!0);c(W),j(()=>T(B,r(m).error)),h(se,W)};X(U,se=>{r(m).status==="error"&&r(m).error&&se(ce)})}c(b);var J=g(b,2),Y=d(J);{var Q=se=>{var W=gt();j(B=>T(W,B),[()=>a(r(m).startedAt)]),h(se,W)},$=se=>{var W=gt();j(B=>T(W,B),[()=>o(r(m).durationMs)]),h(se,W)};X(Y,se=>{r(m).status==="pending"?se(Q):se($,-1)})}c(J),c(E),j(()=>T(I,r(m).label)),h(M,E)}),h(ve,R)};X(oe,ve=>{Mt.log.length===0?ve(ae):ve(ne,-1)})}c(ee),c(A),j(()=>T(H,`${Mt.inflight??""} active`)),_e("click",_,()=>P(n,!1)),h(p,w)};X(v,p=>{r(n)&&p(x)})}c(s),j(p=>{ke(i,"aria-pressed",r(n)),Oe(i,1,p)},[()=>Ue(["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(" "))]),_e("click",i,()=>P(n,!r(n))),h(t,s),$e()}Nt(["click"]);const Nl="red-ui-theme",To="light";function qf(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(Nl);return a==="dark"||a==="light"?a:n??To}function os(t,e){if(e){e.dataset.theme=t;return}typeof document<"u"&&(document.documentElement.dataset.theme=t)}function Kf(t,e){e&&(typeof localStorage>"u"||localStorage.setItem(Nl,t))}var Ur;class Bf{constructor(){Ve(this,Ur,xe(To));wt(this,"target",null);wt(this,"persistTheme",!0)}get current(){return r(de(this,Ur))}set current(e){P(de(this,Ur),e,!0)}init(e={}){this.target=e.target??null,this.persistTheme=e.persist??!0,this.current=qf(this.target,this.persistTheme,e.initial),os(this.current,this.target)}set(e){this.current=e,os(e,this.target),Kf(e,this.persistTheme)}toggle(){this.set(this.current==="dark"?"light":"dark")}}Ur=new WeakMap;const Un=new Bf;function as(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 Rd(t.collection,t.subpage)}}function jf(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 El(t){let e=xe(Ct({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 as(r(e).collection?{view:"collection",collection:r(e).collection,subpage:r(e).subpage??"table"}:{view:r(e).view})},href:n=>as(n),go:(n,o)=>{o==null||o.preventDefault(),P(e,jf(n),!0)}}}const Ml=Symbol("red-ui-router");let _a=null;function Uf(t){return pi(Ml,t),t}function no(){const t=na(Ml);return t||(_a||(_a=El()),_a)}var Yf=S('<div class="w-px h-[18px] bg-line-2"></div> <!> <div class="w-px h-[18px] bg-line-2 ml-1"></div>',1),Xf=S('<div class="w-px h-[18px] bg-line-2"></div>'),Gf=S('<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){Ze(e,!0);let n=Fe(e,"showConnect",3,!0);const o=no();function a(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0,bubbles:!0}))}const s=C(()=>o.view==="query"),i=C(()=>o.view==="collections"),l=C(()=>o.view==="cluster"),u=C(()=>o.view==="security"),f=C(()=>o.view==="settings");var v=Gf(),x=d(v),p=d(x),w=g(p,2);{var _=k=>{var I=Yf(),U=g(fe(I),2);Pf(U,{}),Ce(2),h(k,I)},A=k=>{var I=Xf();h(k,I)};X(w,k=>{n()?k(_):k(A,-1)})}var F=g(w,2),D=d(F),L=d(D);yl(L,{class:"size-3.5"}),Ce(2),c(D);var H=g(D,2),V=d(H);Vr(V,{class:"size-3.5"}),Ce(2),c(H);var q=g(H,2),ee=d(q);fl(ee,{class:"size-3.5"}),Ce(2),c(q);var oe=g(q,2),ae=d(oe);Cl(ae,{class:"size-3.5"}),Ce(2),c(oe);var ne=g(oe,2),ve=d(ne);zo(ve,{class:"size-3.5"}),Ce(2),c(ne),c(F),c(x);var R=g(x,2),y=d(R);Ff(y,{});var M=g(y,2),m=d(M);{var E=k=>{bf(k,{class:"size-3.5"})},N=k=>{df(k,{class:"size-3.5"})};X(m,k=>{Un.current==="dark"?k(E):k(N,-1)})}c(M);var O=g(M,2),K=d(O);un(K,{class:"size-3.5 text-fg-3"});var Z=g(K,4),z=d(Z);Gt(z,{children:(k,I)=>{Ce();var U=gt("⌘");h(k,U)}});var b=g(z);Gt(b,{children:(k,I)=>{Ce();var U=gt("K");h(k,U)}}),c(Z),c(O),c(R),c(v),j((k,I,U,ce,J,Y,Q,$,se,W,B)=>{ke(p,"href",k),ke(D,"href",I),ke(D,"aria-current",r(s)?"page":void 0),Oe(D,1,U),ke(H,"href",ce),ke(H,"aria-current",r(i)?"page":void 0),Oe(H,1,J),ke(q,"href",Y),ke(q,"aria-current",r(l)?"page":void 0),Oe(q,1,Q),ke(oe,"href",$),ke(oe,"aria-current",r(u)?"page":void 0),Oe(oe,1,se),ke(ne,"href",W),ke(ne,"aria-current",r(f)?"page":void 0),Oe(ne,1,B),ke(M,"title",Un.current==="dark"?"Switch to light theme":"Switch to dark theme"),ke(M,"aria-label",Un.current==="dark"?"Switch to light theme":"Switch to dark theme")},[()=>o.href({view:"collections"}),()=>o.href({view:"query"}),()=>Ue(["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"}),()=>Ue(["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"}),()=>Ue(["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"}),()=>Ue(["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"}),()=>Ue(["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(" "))]),_e("click",p,k=>o.go({view:"collections"},k)),_e("click",D,k=>o.go({view:"query"},k)),_e("click",H,k=>o.go({view:"collections"},k)),_e("click",q,k=>o.go({view:"cluster"},k)),_e("click",oe,k=>o.go({view:"security"},k)),_e("click",ne,k=>o.go({view:"settings"},k)),_e("click",M,()=>Un.toggle()),_e("click",O,a),h(t,v),$e()}Nt(["click"]);function $f(t){return`'${t.replace(/'/g,"''")}'`}function Qf(){return Math.random().toString(36).slice(2,10)}function ki(t){return`UPDATE ${t.table} SET ${t.col} = ${$f(t.newValue)} WHERE rid = ${t.row};`}var Yr,Xr;class Jf{constructor(){Ve(this,Yr,xe(Ct([])));Ve(this,Xr,C(()=>this.changes.length));wt(this,"executor",null)}get changes(){return r(de(this,Yr))}set changes(e){P(de(this,Yr),e,!0)}get count(){return r(de(this,Xr))}set count(e){P(de(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=Qf();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(ki)}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 Jf;function ya(t){try{const e=t();return typeof e=="string"&&e.length>0?e:void 0}catch{return}}function ev(t){return t.startsWith("v")?t.slice(1):t}function zl(){return{version:ev(ya(()=>"0.2.0")??"0.0.0-dev"),gitSha:ya(()=>"b01e562ce7d5aacd06df36a7544435509bb5e50c")??"unknown",buildTime:ya(()=>"unknown")??"unknown"}}zl().version;var tv=S('<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),nv=S('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lag</span> <span> </span></span>',1),rv=S('<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),ov=S('<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),av=S('<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),iv=S('<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>'),sv=S('<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>'),lv=S('<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>'),cv=S('<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 dv(t,e){Ze(e,!0);const n=zl(),o=no(),a=C(()=>jt.count),s=C(()=>We.readOnly),i=C(()=>We.readOnlyReason);function l(){window.dispatchEvent(new CustomEvent("red:open-pending-changes"))}const u=C(()=>We.connected),f=C(()=>{var R,y;return((R=We.probe.replication)==null?void 0:R.role)??((y=We.active)==null?void 0:y.role)??"standalone"}),v=C(()=>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=C(()=>{var R,y;return((R=We.probe.replication)==null?void 0:R.wal_lsn)??((y=We.probe.replication)==null?void 0:y.last_applied_lsn)}),p=C(()=>{const R=We.probe.replication;if(!(!R||r(f)!=="replica")&&!(R.last_seen_primary_lsn===void 0||R.last_applied_lsn===void 0))return Math.max(0,R.last_seen_primary_lsn-R.last_applied_lsn)});function w(){window.dispatchEvent(new CustomEvent("red:open-connect"))}function _(R){const y=R.target;y!=null&&y.closest("button, a, [data-no-nav]")||o.go({view:"cluster"})}function A(R){(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),o.go({view:"cluster"}))}var F=cv(),D=d(F),L=d(D);{var H=R=>{var y=av(),M=fe(y),m=d(M);let E;var N=g(m,2),O=d(N,!0);c(N),c(M);var K=g(M,4),Z=d(K,!0);c(K);var z=g(K,2);{var b=Q=>{var $=tv(),se=g(fe($),2),W=g(d(se),2),B=d(W,!0);c(W),Ce(),c(se),j(()=>T(B,We.probe.rtt_ms)),h(Q,$)};X(z,Q=>{We.probe.rtt_ms!==void 0&&Q(b)})}var k=g(z,2);{var I=Q=>{var $=nv(),se=g(fe($),2),W=g(d(se),2);let B;var ie=d(W,!0);c(W),c(se),j(()=>{B=Oe(W,1,"text-fg-1 tabular-nums",null,B,{"text-warn":(r(p)??0)>0}),T(ie,r(p))}),h(Q,$)};X(k,Q=>{r(f)==="replica"&&r(p)!==void 0&&Q(I)})}var U=g(k,2);{var ce=Q=>{var $=rv(),se=g(fe($),2),W=g(d(se),2),B=d(W,!0);c(W),c(se),j(()=>T(B,r(x))),h(Q,$)};X(U,Q=>{r(x)!==void 0&&Q(ce)})}var J=g(U,2);{var Y=Q=>{var $=ov(),se=g(fe($),2),W=d(se);tr(W,{class:"size-3"}),Ce(2),c(se),j(()=>ke(se,"title",r(i)??"The server is open read-only — mutations are disabled.")),h(Q,$)};X(J,Q=>{r(s)&&Q(Y)})}j(()=>{E=$t(m,"",E,{"background-color":r(v)}),T(O,r(f)),T(Z,We.active.label)}),h(R,y)},V=R=>{var y=iv();h(R,y)};X(L,R=>{r(u)?R(H):R(V,-1)})}c(D);var q=g(D,2);{var ee=R=>{var y=sv(),M=d(y);ef(M,{class:"size-3"});var m=g(M,2),E=d(m);c(m),c(y),j(()=>{ke(y,"aria-label",`${r(a)} pending changes`),T(E,`Pending changes (${r(a)??""})`)}),_e("click",y,l),h(R,y)};X(q,R=>{r(a)>0&&R(ee)})}var oe=g(q,2);{var ae=R=>{var y=lv(),M=g(d(y),2);Bu(M,{class:"size-3"}),c(y),_e("click",y,w),h(R,y)};X(oe,R=>{r(u)||R(ae)})}var ne=g(oe,2),ve=d(ne);c(ne),c(F),j(()=>{ke(ne,"title",`red-ui ${n.version} · ${n.gitSha} · built ${n.buildTime}`),T(ve,`v${n.version??""}`)}),_e("click",D,_),_e("keydown",D,A),h(t,F),$e()}Nt(["click","keydown"]);var uv=S('<span class="hint svelte-1yq04zr"> </span>'),fv=S('<button><span class="label svelte-1yq04zr"> </span> <!> <!></button>'),vv=S('<div class="group-label svelte-1yq04zr"> </div> <!>',1),gv=S('<div class="empty svelte-1yq04zr"> </div>'),pv=S('<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 hv(t,e){Ze(e,!0);const n=no();let o=xe(!1),a=xe(""),s=xe(0),i=xe(void 0);function l(H){window.dispatchEvent(new CustomEvent(H))}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:()=>{Un.toggle(),x()}},{id:"show-shortcuts",group:"view",label:"Show keyboard shortcuts",shortcut:"?",run:()=>{x(),l("red:open-shortcuts")}}],f=C(()=>r(a).trim()===""?u:u.filter(H=>H.label.toLowerCase().includes(r(a).toLowerCase())));function v(H){n.go(H),x()}function x(){P(o,!1),P(a,""),P(s,0)}function p(H){if(!(H instanceof HTMLElement))return!1;if(H.isContentEditable)return!0;const V=H.tagName;return V==="INPUT"||V==="TEXTAREA"||V==="SELECT"}function w(H){var ee;const V=H.metaKey||H.ctrlKey,q=H.key.toLowerCase();if(V&&q==="k"){H.preventDefault(),P(o,!r(o)),r(o)&&setTimeout(()=>{var oe;return(oe=r(i))==null?void 0:oe.focus()},0);return}if(V&&H.shiftKey&&q==="c"){H.preventDefault(),l("red:open-connect");return}if(V&&!H.shiftKey&&q==="t"&&!p(H.target)){H.preventDefault(),l("red:new-query");return}if(r(o)){if(H.key==="Escape"){x();return}H.key==="ArrowDown"&&(H.preventDefault(),P(s,Math.min(r(s)+1,r(f).length-1),!0)),H.key==="ArrowUp"&&(H.preventDefault(),P(s,Math.max(r(s)-1,0),!0)),H.key==="Enter"&&(H.preventDefault(),(ee=r(f)[r(s)])==null||ee.run())}}On(()=>{window.addEventListener("keydown",w);const H=()=>{P(o,!0),setTimeout(()=>{var V;return(V=r(i))==null?void 0:V.focus()},0)};return window.addEventListener("red:open-palette",H),()=>{window.removeEventListener("keydown",w),window.removeEventListener("red:open-palette",H)}});const _=["navigate","data","actions","view"],A={navigate:"Navigate",data:"Data",actions:"Actions",view:"View"};var F=He(),D=fe(F);{var L=H=>{var V=pv(),q=fe(V),ee=g(q,2),oe=d(ee),ae=g(d(oe),2);Vt(ae),on(ae,I=>P(i,I),()=>r(i));var ne=g(ae,2);Gt(ne,{children:(I,U)=>{Ce();var ce=gt("esc");h(I,ce)}}),c(oe);var ve=g(oe,2),R=d(ve);Je(R,17,()=>_,qt,(I,U)=>{const ce=C(()=>r(f).filter($=>$.group===r(U)));var J=He(),Y=fe(J);{var Q=$=>{var se=vv(),W=fe(se),B=d(W,!0);c(W);var ie=g(W,2);Je(ie,17,()=>r(ce),qt,(re,te)=>{const ge=C(()=>r(f).indexOf(r(te)));var he=fv();let be;var Te=d(he),ye=d(Te,!0);c(Te);var pe=g(Te,2);{var Me=le=>{var we=uv(),Ne=d(we,!0);c(we),j(()=>T(Ne,r(te).hint)),h(le,we)};X(pe,le=>{r(te).hint&&le(Me)})}var Pe=g(pe,2);{var ue=le=>{Gt(le,{children:(we,Ne)=>{Ce();var Se=gt();j(()=>T(Se,r(te).shortcut)),h(we,Se)}})};X(Pe,le=>{r(te).shortcut&&le(ue)})}c(he),j(()=>{be=Oe(he,1,"row svelte-1yq04zr",null,be,{active:r(ge)===r(s)}),T(ye,r(te).label)}),Rn("mouseenter",he,()=>P(s,r(ge),!0)),_e("click",he,()=>r(te).run()),h(re,he)}),j(()=>T(B,A[r(U)])),h($,se)};X(Y,$=>{r(ce).length&&$(Q)})}h(I,J)});var y=g(R,2);{var M=I=>{var U=gv(),ce=d(U);c(U),j(()=>T(ce,`No commands match "${r(a)??""}"`)),h(I,U)};X(y,I=>{r(f).length===0&&I(M)})}c(ve);var m=g(ve,2),E=d(m),N=d(E);Gt(N,{children:(I,U)=>{Ce();var ce=gt("↑");h(I,ce)}});var O=g(N,2);Gt(O,{children:(I,U)=>{Ce();var ce=gt("↓");h(I,ce)}}),Ce(),c(E);var K=g(E,2),Z=d(K);Gt(Z,{children:(I,U)=>{Ce();var ce=gt("↵");h(I,ce)}}),Ce(),c(K);var z=g(K,2),b=d(z);Gt(b,{children:(I,U)=>{Ce();var ce=gt("⌘");h(I,ce)}});var k=g(b);Gt(k,{children:(I,U)=>{Ce();var ce=gt("K");h(I,ce)}}),Ce(),c(z),c(m),c(ee),_e("click",q,x),_e("keydown",q,function(...I){}),_e("input",ae,()=>P(s,0)),Kt(ae,()=>r(a),I=>P(a,I)),h(H,V)};X(D,H=>{r(o)&&H(L)})}h(t,F),$e()}Nt(["click","keydown","input"]);const xv=[{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"}],bv=["Global","Connection","Workspace","Editing"];var mv=S('<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>'),_v=S('<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>'),yv=S('<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 wv(t,e){Ze(e,!0);let n=xe(!1);function o(){P(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(),P(n,!r(n))}}On(()=>{window.addEventListener("keydown",s);const x=()=>{P(n,!0)};return window.addEventListener("red:open-shortcuts",x),()=>{window.removeEventListener("keydown",s),window.removeEventListener("red:open-shortcuts",x)}});const i=C(()=>bv.map(x=>({ctx:x,items:xv.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=He(),f=fe(u);{var v=x=>{var p=yv(),w=d(p),_=d(w),A=g(d(_),2),F=d(A);Gt(F,{children:(L,H)=>{Ce();var V=gt("Esc");h(L,V)}}),Ce(),c(A),c(_);var D=g(_,2);Je(D,21,()=>r(i),qt,(L,H)=>{var V=_v(),q=d(V),ee=d(q),oe=d(ee,!0);c(ee);var ae=g(ee,2),ne=d(ae,!0);c(ae),c(q);var ve=g(q,2);Je(ve,21,()=>r(H).items,qt,(R,y)=>{var M=mv(),m=d(M),E=d(m,!0);c(m);var N=g(m,2);Je(N,21,()=>r(y).keys,qt,(O,K)=>{Gt(O,{children:(Z,z)=>{Ce();var b=gt();j(()=>T(b,r(K))),h(Z,b)}})}),c(N),c(M),j(()=>T(E,r(y).label)),h(R,M)}),c(ve),c(V),j(()=>{T(oe,r(H).ctx),T(ne,l[r(H).ctx])}),h(L,V)}),c(D),c(w),c(p),_e("click",p,o),_e("click",w,L=>L.stopPropagation()),_e("keydown",w,function(...L){}),h(x,p)};X(f,x=>{r(n)&&x(v)})}h(t,u),$e()}Nt(["click","keydown"]);var kv=S('<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),Sv=S("<!> ",1),Cv=S('<!> <span class="text-danger truncate"> </span>',1),Nv=S('<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>'),Ev=S('<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),Mv=S('<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 zv(t,e){Ze(e,!0);let n=xe(""),o=xe(""),a=xe(!1),s=xe(!1),i=xe(void 0);function l(){Ot.error=null,P(s,!0)}function u(){P(s,!1)}function f(){Ot.wipe(),P(n,""),P(o,""),P(s,!1),setTimeout(()=>{var L;return(L=r(i))==null?void 0:L.focus()},0)}const v=C(()=>Ot.needsSetup),x=C(()=>Ot.error),p=C(()=>r(v)?"Set a master password":"Unlock credentials"),w=C(()=>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}P(a,!0);const H=await Ot.unlock(r(n));P(a,!1),H&&(P(n,""),P(o,""),We.refresh())}var A=He(),F=fe(A);{var D=L=>{var H=Mv(),V=d(H),q=d(V),ee=d(q);{var oe=Y=>{af(Y,{class:"size-4 text-accent"})},ae=Y=>{tr(Y,{class:"size-4 text-accent"})};X(ee,Y=>{r(v)?Y(oe):Y(ae,-1)})}var ne=g(ee,2),ve=d(ne,!0);c(ne),c(q);var R=g(q,2),y=d(R,!0);c(R);var M=g(R,4);Vt(M),on(M,Y=>P(i,Y),()=>r(i));var m=g(M,2);{var E=Y=>{var Q=kv(),$=g(fe(Q),2);Vt($),Kt($,()=>r(o),se=>P(o,se)),h(Y,Q)};X(m,Y=>{r(v)&&Y(E)})}var N=g(m,2),O=d(N);{var K=Y=>{var Q=Sv(),$=fe(Q);mn($,{class:"size-3.5 animate-spin"});var se=g($);j(()=>T(se,` ${r(v)?"Setting up…":"Unlocking…"}`)),h(Y,Q)},Z=Y=>{var Q=gt();j(()=>T(Q,r(v)?"Set password":"Unlock")),h(Y,Q)};X(O,Y=>{r(a)?Y(K):Y(Z,-1)})}c(N);var z=g(N,2),b=d(z);{var k=Y=>{var Q=Cv(),$=fe(Q);_i($,{class:"size-3 text-danger"});var se=g($,2),W=d(se,!0);c(se),j(()=>T(W,r(x))),h(Y,Q)};X(b,Y=>{r(x)&&Y(k)})}c(z);var I=g(z,2),U=d(I);{var ce=Y=>{var Q=Nv(),$=d(Q);rs($,{class:"size-3"}),Ce(2),c(Q),_e("click",Q,l),h(Y,Q)},J=Y=>{var Q=Ev(),$=g(fe(Q),2),se=d($),W=d(se);rs(W,{class:"size-3"}),Ce(),c(se);var B=g(se,2);c($),_e("click",se,f),_e("click",B,u),h(Y,Q)};X(U,Y=>{r(s)?Y(J,-1):Y(ce)})}c(I),c(V),c(H),j(()=>{T(ve,r(p)),T(y,r(w)),ke(M,"autocomplete",r(v)?"new-password":"current-password"),N.disabled=r(a)||!r(n)||r(v)&&!r(o)}),Rn("submit",V,_),Kt(M,()=>r(n),Y=>P(n,Y)),h(L,H)};X(F,L=>{Ot.backend==="web"&&Ot.locked&&L(D)})}h(t,A),$e()}Nt(["click"]);var Tv=S('<div class="text-fg-3 text-[12px] font-mono py-6 text-center">No staged changes.</div>'),Pv=S('<div class="text-warn text-[11px] mt-1 inline-flex items-center gap-1"><!> </div>'),Iv=S('<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>'),Av=S('<ul class="space-y-2 text-[12px] font-mono"></ul>'),Lv=S('<div class="text-warn text-[11px] font-mono mt-2"> </div>'),Ov=S('<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>'),Rv=S('<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 Dv(t,e){Ze(e,!0);const n=C(()=>We.readOnly),o=C(()=>We.readOnlyReason);let a=xe(!1),s=xe(null);async function i(){if(!r(a)){P(a,!0),P(s,null);try{(await jt.commitAll()).failed.length===0&&e.onClose()}catch(x){P(s,x.message,!0)}finally{P(a,!1)}}}function l(){jt.discardAll(),e.onClose()}var u=He(),f=fe(u);{var v=x=>{var p=Rv(),w=d(p),_=d(w),A=d(_),F=g(d(A),2),D=d(F);c(F),c(A);var L=g(A,2),H=d(L);Qt(H,{class:"size-4"}),c(L),c(_);var V=g(_,2),q=d(V);{var ee=O=>{var K=Tv();h(O,K)},oe=O=>{var K=Av();Je(K,21,()=>jt.changes,Z=>Z.id,(Z,z)=>{var b=Iv(),k=d(b),I=d(k),U=d(I),ce=d(U,!0);c(U);var J=g(U,4),Y=d(J,!0);c(J);var Q=g(J,4),$=d(Q,!0);c(Q),c(I);var se=g(I,2);c(k);var W=g(k,2),B=g(d(W),2),ie=d(B,!0);c(B);var re=g(B,4),te=d(re,!0);c(re),c(W);var ge=g(W,2),he=d(ge,!0);c(ge);var be=g(ge,2);{var Te=ye=>{var pe=Pv(),Me=d(pe);Dd(Me,{class:"size-3"});var Pe=g(Me);c(pe),j(()=>T(Pe,` ${r(z).error??""}`)),h(ye,pe)};X(be,ye=>{r(z).error&&ye(Te)})}c(b),j((ye,pe)=>{T(ce,r(z).table),T(Y,r(z).row),T($,r(z).col),T(ie,ye),T(te,r(z).newValue),T(he,pe)},[()=>String(r(z).oldValue??"NULL"),()=>ki(r(z))]),_e("click",se,()=>jt.unstage(r(z).id)),h(Z,b)}),c(K),h(O,K)};X(q,O=>{jt.count===0?O(ee):O(oe,-1)})}var ae=g(q,2);{var ne=O=>{var K=Lv(),Z=d(K,!0);c(K),j(()=>T(Z,r(s))),h(O,K)};X(ae,O=>{r(s)&&O(ne)})}c(V);var ve=g(V,2);{var R=O=>{var K=Ov(),Z=d(K);tr(Z,{class:"size-3 shrink-0"});var z=g(Z,2),b=d(z,!0);c(z),c(K),j(()=>T(b,r(o)??"Server is read-only (file in use) — changes can’t be applied.")),h(O,K)};X(ve,O=>{r(n)&&O(R)})}var y=g(ve,2),M=d(y),m=g(M,2),E=g(m,2),N=d(E,!0);c(E),c(y),c(w),c(p),j(()=>{T(D,`${jt.count??""} staged · review before applying`),m.disabled=jt.count===0,E.disabled=jt.count===0||r(a)||r(n),ke(E,"title",r(n)?r(o)??"Server is read-only — mutations are disabled.":void 0),T(N,r(a)?"Applying…":"Apply all")}),_e("click",L,function(...O){var K;(K=e.onClose)==null||K.apply(this,O)}),_e("click",M,function(...O){var K;(K=e.onClose)==null||K.apply(this,O)}),_e("click",m,l),_e("click",E,i),h(x,p)};X(f,x=>{e.open&&x(v)})}h(t,u),$e()}Nt(["click"]);const Vv=["vector","queue","stats","diff","hypertable","graph","kv","document","table"],Tl={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 Hv(t){return`'${t.replace(/'/g,"''")}'`}function is(t){if(!t||t.length===0)return"table";const e=new Set;for(const n of t){const o=String(n).toLowerCase(),a=Tl[o];a&&e.add(a)}for(const n of Vv)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 qv(t){return typeof t!="string"?null:Tl[t.toLowerCase()]??null}async function ss(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 Kv(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 Bv(t){var i,l,u;const e=Kv(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 Pl(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 is(x)}catch{}try{const x=(i=(s=(a=(o=(await t.query(`SELECT model FROM red.collections WHERE name = ${Hv(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=qv(x);if(p&&p!=="table")return p;if(typeof x=="string"&&x.toLowerCase()==="mixed"){const w=await ss(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 F of _)typeof F=="string"&&p.push(F);else if(typeof _=="string")for(const F of _.split(/[,\s]+/))F&&p.push(F);const A=is(p);return A!=="table"?A:Bv(x)??"table"}catch{return await ss(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"}},jv=/^red[._]/i;function Wv(t){return jv.test(t)}var Uv=S('<span class="font-mono text-[10px] text-fg-3"> </span>'),Yv=S('<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>'),Xv=S('<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>'),Gv=S(`<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=S('<div class="p-3 text-[12px] text-fg-3 font-mono">Loading…</div>'),$v=S('<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>'),Qv=S('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear collection search"><!></button>'),Jv=S('<button type="button"> </button>'),eg=S('<li class="px-3 py-2 font-mono text-[12px] text-fg-3">No matching collections.</li>'),tg=S('<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>'),ng=S('<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),rg=S('<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 og(t,e){Ze(e,!0);const n=no(),o=C(()=>n.collection);let a=xe(Ct([])),s=xe(!1),i=xe(null),l=xe(""),u=xe("all");const f=C(()=>We.connected),v=C(()=>We.active.url),x=C(()=>{const R=new Map;for(const y of r(a))R.set(y.capability,(R.get(y.capability)??0)+1);return[...R.entries()].sort((y,M)=>y[0].localeCompare(M[0]))}),p=C(()=>{const R=r(l).trim().toLowerCase();return r(a).filter(y=>{if(r(u)!=="all"&&y.capability!==r(u))return!1;if(!R)return!0;const M=wa[y.capability];return y.name.toLowerCase().includes(R)||M.label.toLowerCase().includes(R)})});async function w(){const R=We.client;if(!R||!r(f)){P(a,[],!0);return}P(s,!0),P(i,null);const y=r(v);try{const m=(await Mt.track("schema · list collections",()=>R.collections())).filter(N=>!Wv(N)).sort();P(a,m.map(N=>({name:N,capability:"table"})),!0);const E=m.map(N=>Mt.track(`schema · probe ${N}`,async()=>{const O=await Pl(R,N);y===r(v)&&P(a,r(a).map(K=>K.name===N?{...K,capability:O}:K),!0)}));await Promise.all(E)}catch(M){P(i,M.message,!0),P(a,[],!0)}finally{P(s,!1)}}It(()=>{Ot.locked||(r(f),r(v),w())});var _=rg(),A=fe(_),F=d(A),D=d(F);Vr(D,{class:"size-3.5"}),Ce(2),c(F);var L=g(F,2);{var H=R=>{var y=Uv(),M=d(y,!0);c(y),j(()=>T(M,r(a).length)),h(R,y)};X(L,R=>{r(f)&&r(a).length>0&&R(H)})}c(A);var V=g(A,2);{var q=R=>{var y=Yv(),M=d(y);tr(M,{class:"size-4 text-accent"}),Ce(4),c(y),h(R,y)},ee=R=>{var y=Xv(),M=d(y);yi(M,{class:"size-4 text-fg-3"}),Ce(4),c(y),h(R,y)},oe=R=>{var y=Gv(),M=g(d(y),2),m=d(M,!0);c(M),c(y),j(()=>T(m,r(i))),h(R,y)},ae=R=>{var y=Zv();h(R,y)},ne=R=>{var y=$v(),M=g(d(y),4),m=d(M);c(M),c(y),j(()=>T(m,`./scripts/seed.sh ${r(v)??""}`)),h(R,y)},ve=R=>{var y=ng(),M=fe(y),m=d(M),E=d(m);un(E,{class:"size-3 text-fg-3"});var N=g(E,2);Vt(N);var O=g(N,2);{var K=Y=>{var Q=Qv(),$=d(Q);Qt($,{class:"size-3"}),c(Q),_e("click",Q,()=>P(l,"")),h(Y,Q)};X(O,Y=>{r(l)&&Y(K)})}c(m);var Z=g(m,2),z=d(Z),b=d(z);c(z);var k=g(z,2);Je(k,17,()=>r(x),([Y,Q])=>Y,(Y,Q)=>{var $=C(()=>rn(r(Q),2));let se=()=>r($)[0],W=()=>r($)[1];const B=C(()=>wa[se()]);var ie=Jv(),re=d(ie);c(ie),j(te=>{ke(ie,"title",r(B).label),Oe(ie,1,te),T(re,`${r(B).glyph??""} ${W()??""}`)},[()=>Ue(["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(" "))]),_e("click",ie,()=>P(u,se(),!0)),h(Y,ie)}),c(Z),c(M);var I=g(M,2),U=d(I);{var ce=Y=>{var Q=eg();h(Y,Q)};X(U,Y=>{r(p).length===0&&Y(ce)})}var J=g(U,2);Je(J,17,()=>r(p),Y=>Y.name,(Y,Q)=>{const $=C(()=>wa[r(Q).capability]),se=C(()=>r(Q).name===r(o)),W=C(()=>({view:"collection",collection:r(Q).name,subpage:Ar(r(Q).capability)}));var B=tg(),ie=d(B),re=d(ie),te=d(re,!0);c(re);var ge=g(re,2),he=d(ge,!0);c(ge);var be=g(ge,2),Te=d(be,!0);c(be),c(ie),c(B),j((ye,pe)=>{ke(ie,"href",ye),ke(ie,"aria-current",r(se)?"page":void 0),ke(ie,"title",`${r($).label} · ${r(Q).name}`),Oe(ie,1,pe),T(te,r($).glyph),T(he,r(Q).name),T(Te,r($).label)},[()=>n.href(r(W)),()=>Ue(["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(" "))]),_e("click",ie,ye=>n.go(r(W),ye)),h(Y,B)}),c(I),j(Y=>{Oe(z,1,Y),T(b,`all ${r(a).length??""}`)},[()=>Ue(["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(N,()=>r(l),Y=>P(l,Y)),_e("click",z,()=>P(u,"all")),h(R,y)};X(V,R=>{Ot.locked?R(q):r(f)?r(i)?R(oe,2):r(s)&&r(a).length===0?R(ae,3):r(a).length===0?R(ne,4):R(ve,-1):R(ee,1)})}h(t,_),$e()}Nt(["click"]);function ag(){return Math.random().toString(36).slice(2,10)}var Gr,Zr,$r;class ig{constructor(){Ve(this,Gr,xe(Ct([])));Ve(this,Zr,xe(null));Ve(this,$r,C(()=>this.tabs.find(e=>e.id===this.activeId)??null))}get tabs(){return r(de(this,Gr))}set tabs(e){P(de(this,Gr),e,!0)}get activeId(){return r(de(this,Zr))}set activeId(e){P(de(this,Zr),e,!0)}get active(){return r(de(this,$r))}set active(e){P(de(this,$r),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:ag()};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,Zr=new WeakMap,$r=new WeakMap;const _t=new ig;function sg(){return{sql:"",result:null,error:null,running:!1}}var Qr;class lg{constructor(){Ve(this,Qr,xe(Ct({})));wt(this,"counter",0);wt(this,"executor",null)}get states(){return r(de(this,Qr))}set states(e){P(de(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]=sg()),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 nn=new lg;function cg(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 dg(t){return`'${t.replace(/'/g,"''")}'`}function ug(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 = ${dg(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 fg(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t.toLowerCase()==="true")return!0;if(t.toLowerCase()==="false")return!1}}function vg(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:fg(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 ls(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 gg(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 cs(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=gg(t.sessionGapMs);return n&&e.push(`gap ${n}`),t.internal&&e.push("internal"),e}class pg{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 pg,hg=80,Il=["rid","collection","kind","tenant","created_at","updated_at"],xg=new Set(Il);function Ga(t){return xg.has(t.toLowerCase())}function bg(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?[...Il.filter(f=>o.includes(f)),...l]:l.length>0?l:n}function ds(t){const e=t.toLowerCase();return e==="rid"?"rid":e==="id"?"id":null}function mg(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 _g(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function yg(t){return t==null}function wg(t,e=hg){return t.result.records.slice(0,e).map(n=>n.values)}var kg=S('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6"> </div>'),Sg=S('<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>'),Cg=S('<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),Ng=S('<span class="text-[9px] px-1 rounded bg-accent text-white"> </span>'),Eg=S('<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>'),Mg=S('<label><input type="checkbox" class="sr-only"/> </label>'),zg=S('<span class="text-warn"> </span>'),Tg=S('<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>'),Pg=S('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">Empty result.</div>'),Ig=S(`<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>`),Ag=S('<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>'),Lg=S('<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>'),Og=S('<span class="ml-1 text-[10px] text-fg-3 uppercase tracking-wide" title="Inferred primary key">pk</span>'),Rg=S("<th><span> </span> <!></th>"),Dg=S('<button type="button" class="absolute right-1 top-1/2 -translate-y-1/2 text-fg-3 hover:text-fg-1 cursor-pointer"><!></button>'),Vg=S('<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>'),Hg=S('<tr class="border-b border-line-1 bg-bg-0"><th class="px-2 py-1"></th><!></tr>'),Fg=S('<input class="w-full bg-bg-2 text-fg-1 border border-accent/60 rounded px-1 py-0.5 outline-none"/>'),qg=S('<span class="text-fg-3 italic">NULL</span>'),Kg=S('<span class="block truncate"> </span>'),Bg=S("<td><!></td>"),jg=S('<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=S('· <span class="text-fg-2"> </span>',1),Ug=S('<span>· pk <code class="text-fg-2"> </code></span>'),Yg=S('<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),Xg=S('<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),Gg=S('<div class="flex h-full flex-col text-fg-1"><!></div>');function Zg(t,e){Ze(e,!0);let n=Fe(e,"showSystem",3,!1),o=xe(null);const a=C(()=>r(o)??e.result),s=C(()=>wg(r(a))),i=C(()=>bg(r(a),{showSystem:n()})),l=C(()=>mg(r(i))),u=C(()=>r(i).filter(b=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(b)));let f=xe(!1),v=xe(Ct({})),x=xe(200),p=xe(!1),w=xe(null);It(()=>{const b={...r(v)};let k=!1;for(const I of r(u))b[I]===void 0&&(b[I]=!0,k=!0);for(const I of Object.keys(b))r(u).includes(I)||(delete b[I],k=!0);k&&P(v,b,!0)});let _=xe(Ct({})),A=xe(!1);const F=C(()=>{const b=Object.entries(r(_)).filter(([,k])=>k.trim().length>0);return b.length===0?r(s):r(s).filter(k=>b.every(([I,U])=>{const ce=k[I];return ce==null?!1:String(ce).toLowerCase().includes(U.toLowerCase())}))}),D=C(()=>r(F)),L=C(()=>Object.values(r(_)).filter(b=>b.trim().length>0).length);function H(b){const k={...r(_)};delete k[b],P(_,k,!0)}function V(){P(_,{},!0)}function q(){if(!e.collection)return null;const b=e.collection.replace(/[^A-Za-z0-9_./-]/g,"");return b.length>0?b:null}function ee(){const b=r(u).filter(k=>r(v)[k]);return b.length===0||b.length===r(u).length?"*":b.join(", ")}function oe(){const b=q();return b?`SELECT ${ee()} FROM ${b} LIMIT ${r(x)}`:null}async function ae(){const b=We.client,k=oe();if(!(!b||!k)){P(p,!0),P(w,null);try{const I=await Mt.track(`${e.collection} · ${k}`,()=>b.query(k));if(!I.ok){P(w,I.error??"query failed",!0);return}P(o,I,!0),P(_,{},!0),P(ve,null)}catch(I){P(w,I.message,!0)}finally{P(p,!1)}}}function ne(){P(o,null),P(_,{},!0),P(w,null)}let ve=xe(null),R=xe("");function y(b,k,I){if(r(ve)||!e.collection||We.readOnly)return;P(ve,{row:b,col:k},!0);const U=jt.find(e.collection,b,k);P(R,U?U.newValue:String(I??""),!0)}function M(){var ce;if(!r(ve)||!e.collection)return;const{row:b,col:k}=r(ve),I=(ce=r(D)[b])==null?void 0:ce[k],U=r(R);if(String(I??"")!==U)jt.stage(e.collection,b,k,I,U);else{const J=jt.find(e.collection,b,k);J&&jt.unstage(J.id)}P(ve,null)}function m(){P(ve,null)}function E(b){b.focus(),b.select()}function N(b,k,I){if(!e.collection)return{value:I,staged:!1};const U=jt.find(e.collection,b,k);return U?{value:U.newValue,staged:!0}:{value:I,staged:!1}}var O=Gg(),K=d(O);{var Z=b=>{var k=kg(),I=d(k,!0);c(k),j(()=>T(I,r(a).error??"Query failed.")),h(b,k)},z=b=>{var k=Xg(),I=fe(k),U=d(I);{var ce=pe=>{var Me=Cg(),Pe=fe(Me),ue=d(Pe);$u(ue,{class:"size-3"}),Ce(2),c(Pe);var le=g(Pe,2),we=d(le);{var Ne=Ee=>{mn(Ee,{class:"size-3 animate-spin"})},Se=Ee=>{oa(Ee,{class:"size-3"})};X(we,Ee=>{r(p)?Ee(Ne):Ee(Se,-1)})}Ce(),c(le);var ze=g(le,2);{var me=Ee=>{var Ae=Sg(),Ke=d(Ae);Vd(Ke,{class:"size-3"}),Ce(),c(Ae),_e("click",Ae,ne),h(Ee,Ae)};X(ze,Ee=>{r(o)&&Ee(me)})}Ce(2),j(Ee=>{ke(Pe,"aria-pressed",r(f)),Oe(Pe,1,Ee),le.disabled=r(p)||!We.connected},[()=>Ue(["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(" "))]),_e("click",Pe,()=>P(f,!r(f))),_e("click",le,ae),h(pe,Me)};X(U,pe=>{e.collection&&pe(ce)})}var J=g(U,2),Y=d(J);wl(Y,{class:"size-3"});var Q=g(Y,4);{var $=pe=>{var Me=Ng(),Pe=d(Me,!0);c(Me),j(()=>T(Pe,r(L))),h(pe,Me)};X(Q,pe=>{r(L)>0&&pe($)})}c(J);var se=g(J,2);{var W=pe=>{var Me=Eg(),Pe=d(Me);Qt(Pe,{class:"size-3"}),Ce(),c(Me),_e("click",Me,V),h(pe,Me)};X(se,pe=>{r(L)>0&&pe(W)})}var B=g(se,2),ie=d(B,!0),re=g(ie);{var te=pe=>{var Me=gt();j(Pe=>T(Me,`of ${Pe??""}`),[()=>r(s).length.toLocaleString()]),h(pe,Me)};X(re,pe=>{r(L)>0&&pe(te)})}Ce(),c(B),c(I);var ge=g(I,2);{var he=pe=>{var Me=Tg(),Pe=d(Me),ue=g(d(Pe),2),le=g(ue,2),we=g(le,2),Ne=g(d(we)),Se=d(Ne);Se.value=Se.__value=50;var ze=g(Se);ze.value=ze.__value=100;var me=g(ze);me.value=me.__value=200;var Ee=g(me);Ee.value=Ee.__value=500;var Ae=g(Ee);Ae.value=Ae.__value=1e3,c(Ne);var Ke;hi(Ne),c(we),c(Pe);var at=g(Pe,2);Je(at,20,()=>r(u),Re=>Re,(Re,Ie)=>{var qe=Mg(),G=d(qe);Vt(G);var De=g(G);c(qe),j(Le=>{Oe(qe,1,Le),vl(G,r(v)[Ie]??!1),T(De,` ${Ie??""}`)},[()=>Ue(["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(" "))]),_e("change",G,Le=>P(v,{...r(v),[Ie]:Le.currentTarget.checked},!0)),h(Re,qe)}),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=zg(),qe=d(Ie,!0);c(Ie),j(()=>T(qe,r(w))),h(Re,Ie)};X(vt,Re=>{r(w)&&Re(Ge)})}c(Be),c(Me),j(Re=>{Ke!==(Ke=r(x))&&(Ne.value=(Ne.__value=r(x))??"",xi(Ne,r(x))),T(dt,Re)},[()=>oe()??"No collection selected"]),_e("click",ue,()=>{const Re={};for(const Ie of r(u))Re[Ie]=!0;P(v,Re,!0)}),_e("click",le,()=>P(v,{},!0)),_e("change",Ne,Re=>P(x,Number(Re.currentTarget.value),!0)),h(pe,Me)};X(ge,pe=>{r(f)&&e.collection&&pe(he)})}var be=g(ge,2);{var Te=pe=>{var Me=Pg();h(pe,Me)},ye=pe=>{var Me=Yg(),Pe=fe(Me),ue=d(Pe),le=d(ue),we=d(le),Ne=g(d(we));Je(Ne,17,()=>r(i),qt,(Re,Ie)=>{const qe=C(()=>ds(r(Ie))),G=C(()=>Ga(r(Ie)));var De=Rg(),Le=d(De),je=d(Le,!0);c(Le);var Ye=g(Le,2);{var lt=Xe=>{var tt=Ig();h(Xe,tt)},ct=Xe=>{var tt=Ag();h(Xe,tt)},pt=Xe=>{var tt=Lg();h(Xe,tt)},it=Xe=>{var tt=Og();h(Xe,tt)};X(Ye,Xe=>{r(qe)==="rid"?Xe(lt):r(G)?Xe(ct,1):r(qe)==="id"?Xe(pt,2):r(Ie)===r(l)&&Xe(it,3)})}c(De),j(Xe=>{Oe(De,1,Xe),Oe(Le,1,Ue(r(qe)||r(G)?"font-semibold":"")),T(je,r(Ie))},[()=>Ue(["px-2 py-1.5 text-left font-normal whitespace-nowrap",r(qe)==="rid"?"bg-accent/5 text-fg-0":r(G)?"bg-bg-1 text-fg-2":r(qe)==="id"?"text-fg-1":""].join(" "))]),h(Re,De)}),c(we);var Se=g(we);{var ze=Re=>{var Ie=Hg(),qe=g(d(Ie));Je(qe,17,()=>r(i),qt,(G,De)=>{var Le=Vg(),je=d(Le),Ye=d(je);Vt(Ye);var lt=g(Ye,2);{var ct=pt=>{var it=Dg(),Xe=d(it);Qt(Xe,{class:"size-3"}),c(it),j(()=>ke(it,"aria-label",`Clear filter for ${r(De)??""}`)),_e("click",it,()=>H(r(De))),h(pt,it)};X(lt,pt=>{var it;(it=r(_)[r(De)])!=null&&it.length&&pt(ct)})}c(je),c(Le),j(()=>ke(Ye,"placeholder",`filter ${r(De)??""}…`)),Kt(Ye,()=>r(_)[r(De)],pt=>r(_)[r(De)]=pt),h(G,Le)}),c(Ie),h(Re,Ie)};X(Se,Re=>{r(A)&&Re(ze)})}c(le);var me=g(le);Je(me,21,()=>r(D),qt,(Re,Ie,qe)=>{var G=jg(),De=d(G);De.textContent=qe+1;var Le=g(De);Je(Le,17,()=>r(i),qt,(je,Ye)=>{const lt=C(()=>r(Ie)[r(Ye)]),ct=C(()=>N(qe,r(Ye),r(lt))),pt=C(()=>{var bt;return((bt=r(ve))==null?void 0:bt.row)===qe&&r(ve).col===r(Ye)}),it=C(()=>ds(r(Ye))),Xe=C(()=>Ga(r(Ye)));var tt=Bg(),st=d(tt);{var ut=bt=>{var mt=Fg();Vt(mt),gi(()=>Kt(mt,()=>r(R),Et=>P(R,Et))),Xt(mt,Et=>E==null?void 0:E(Et)),Rn("blur",mt,M),_e("keydown",mt,Et=>{Et.key==="Enter"?M():Et.key==="Escape"&&m()}),h(bt,mt)},ht=bt=>{var mt=qg();h(bt,mt)},xt=C(()=>yg(r(ct).value)),Tt=bt=>{var mt=Kg(),Et=d(mt,!0);c(mt),j(Pt=>T(Et,Pt),[()=>_g(r(ct).value)]),h(bt,mt)};X(st,bt=>{r(pt)?bt(ut):r(xt)?bt(ht,1):bt(Tt,-1)})}c(tt),j(bt=>{Oe(tt,1,bt),ke(tt,"title",r(ct).staged?"Staged change — open Pending Changes to commit":void 0)},[()=>Ue(["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(pt)?"bg-warn/15 text-fg-1":""].join(" "))]),_e("dblclick",tt,()=>y(qe,r(Ye),r(lt))),h(je,tt)}),c(G),h(Re,G)}),c(me),c(ue),c(Pe);var Ee=g(Pe,2),Ae=d(Ee),Ke=d(Ae),at=g(Ke);{var Be=Re=>{var Ie=gt("· filtered");h(Re,Ie)};X(at,Re=>{r(L)>0&&Re(Be)})}var Qe=g(at,2);{var dt=Re=>{var Ie=Wg(),qe=g(fe(Ie)),G=d(qe,!0);c(qe),j(()=>T(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=Ug(),qe=g(d(Ie)),G=d(qe,!0);c(qe),c(Ie),j(()=>T(G,r(l))),h(Re,Ie)};X(vt,Re=>{r(l)&&Re(Ge)})}c(Ee),j(()=>T(Ke,`${r(D).length??""} of ${r(a).record_count??""} rows `)),h(pe,Me)};X(be,pe=>{r(a).result.records.length?pe(ye,-1):pe(Te)})}j((pe,Me)=>{ke(J,"aria-pressed",r(A)),ke(J,"title",r(A)?"Hide column filters":"Show column filters"),Oe(J,1,pe),T(ie,Me)},[()=>Ue(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",r(A)?"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()]),_e("click",J,()=>P(A,!r(A))),h(b,k)};X(K,b=>{r(a).ok?b(z,-1):b(Z)})}c(O),h(t,O),$e()}Nt(["click","change","dblclick","keydown"]);const $g={capability:"table",renders:t=>!!(t!=null&&t.result)&&Array.isArray(t.result.columns),component:Zg},Qg={capability:"graph",renders:t=>Fd(t),component:Hd};function Al(t){return t.find(e=>e.toLowerCase()==="key")??t.find(e=>e.toLowerCase()==="k")??t.find(e=>/(^|_)key$/i.test(e))??null}function Ll(t){return t.find(e=>e.toLowerCase()==="value")??t.find(e=>e.toLowerCase()==="v")??t.find(e=>/(^|_)value$/i.test(e))??null}function Jg(t){const e=t.result.columns,n=Al(e),o=Ll(e);return!n||!o?[]:t.result.records.map(a=>({key:String(a.values[n]??""),value:a.values[o]}))}function ep(t){var n;const e=((n=t.result)==null?void 0:n.columns)??[];return Al(e)!==null&&Ll(e)!==null}function tp(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 np(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 us(t){return t==null?"null":typeof t=="object"?JSON.stringify(t):String(t)}var rp=S('<span class="text-fg-3 ml-2"> </span>'),op=S("<ul></ul>"),ap=S('<li><button type="button"><span class="text-fg-1"> </span> <!></button> <!></li>'),ip=S(`<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
|
|
971
|
-
(also accepts <code>*_key</code>/<code>*_value</code>).</div>`),sp=S('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear prefix"><!></button>'),lp=S('· <span class="text-fg-2"> </span>',1),cp=S('<li class="px-3 py-2 text-fg-3">No keys match prefix.</li>'),dp=S('<div class="text-fg-3 mb-2"> </div> <pre class="text-fg-1 whitespace-pre-wrap break-all"> </pre>',1),up=S('<div class="text-fg-3">Click a key to inspect.</div>'),fp=S('<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>'),vp=S('<div class="text-fg-3">No keys match prefix.</div>'),gp=S('<pre class="whitespace-pre text-fg-1"> </pre>'),pp=S('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><!></div>'),hp=S('<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),xp=S('<div class="flex h-full flex-col text-fg-1"><!></div>');function bp(t,e){Ze(e,!0);const n=(A,F=Zt,D=Zt)=>{var L=ap(),H=d(L);let V,q;var ee=d(H),oe=d(ee,!0);c(ee);var ae=g(ee,2);{var ne=y=>{var M=rp(),m=d(M,!0);c(M),j(E=>T(m,E),[()=>v(F().value)]),h(y,M)};X(ae,y=>{F().fullKey!==null&&y(ne)})}c(H);var ve=g(H,2);{var R=y=>{var M=op();Je(M,21,()=>F().children,m=>m.name,(m,E)=>{n(m,()=>r(E),()=>D()+1)}),c(M),h(y,M)};X(ve,y=>{F().children.length>0&&y(R)})}c(L),j(()=>{V=Oe(H,1,"w-full text-left px-2 py-0.5 hover:bg-bg-1/60",null,V,{"text-accent":r(s)===F()}),q=$t(H,"",q,{"padding-left":`${8+D()*12}px`}),T(oe,F().name)}),_e("click",H,()=>P(s,F(),!0)),h(A,L)};let o=xe(""),a=xe("tree"),s=xe(null);const i=C(()=>Jg(e.result)),l=C(()=>r(o).trim()?r(i).filter(A=>A.key.startsWith(r(o).trim())):r(i)),u=C(()=>np(r(l))),f=C(()=>tp(r(i),r(o).trim()));function v(A){const F=us(A);return F.length>60?F.slice(0,59)+"…":F}var x=xp(),p=d(x);{var w=A=>{var F=ip();h(A,F)},_=A=>{var F=hp(),D=fe(F),L=d(D),H=d(L),V=d(H);lf(V,{class:"size-3"}),Ce(),c(H);var q=g(H,2),ee=d(q);xr(ee,{class:"size-3"}),Ce(),c(q),c(L);var oe=g(L,2),ae=d(oe);un(ae,{class:"size-3 text-fg-3"});var ne=g(ae,2);Vt(ne);var ve=g(ne,2);{var R=b=>{var k=sp(),I=d(k);Qt(I,{class:"size-3"}),c(k),_e("click",k,()=>P(o,"")),h(b,k)};X(ve,b=>{r(o)&&b(R)})}c(oe);var y=g(oe,2),M=d(y,!0),m=g(M);{var E=b=>{var k=gt();j(I=>T(k,`of ${I??""}`),[()=>r(i).length.toLocaleString()]),h(b,k)};X(m,b=>{r(o)&&b(E)})}var N=g(m,2);{var O=b=>{var k=lp(),I=g(fe(k)),U=d(I,!0);c(I),j(()=>T(U,e.collection)),h(b,k)};X(N,b=>{e.collection&&b(O)})}c(y),c(D);var K=g(D,2);{var Z=b=>{var k=fp(),I=d(k),U=d(I);{var ce=W=>{var B=cp();h(W,B)},J=W=>{var B=He(),ie=fe(B);Je(ie,17,()=>r(u).children,re=>re.name,(re,te)=>{n(re,()=>r(te),()=>0)}),h(W,B)};X(U,W=>{r(u).children.length===0?W(ce):W(J,-1)})}c(I);var Y=g(I,2),Q=d(Y);{var $=W=>{var B=dp(),ie=fe(B),re=d(ie,!0);c(ie);var te=g(ie,2),ge=d(te,!0);c(te),j(he=>{T(re,r(s).fullKey??r(s).name),T(ge,he)},[()=>us(r(s).value)]),h(W,B)},se=W=>{var B=up();h(W,B)};X(Q,W=>{r(s)?W($):W(se,-1)})}c(Y),c(k),h(b,k)},z=b=>{var k=pp(),I=d(k);{var U=Y=>{var Q=vp();h(Y,Q)},ce=C(()=>Object.keys(r(f)).length===0),J=Y=>{var Q=gp(),$=d(Q,!0);c(Q),j(se=>T($,se),[()=>JSON.stringify(r(f),null,2)]),h(Y,Q)};X(I,Y=>{r(ce)?Y(U):Y(J,-1)})}c(k),h(b,k)};X(K,b=>{r(a)==="tree"?b(Z):b(z,-1)})}j((b,k,I)=>{Oe(H,1,b),ke(H,"aria-pressed",r(a)==="tree"),Oe(q,1,k),ke(q,"aria-pressed",r(a)==="json"),T(M,I)},[()=>Ue(["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(" ")),()=>Ue(["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()]),_e("click",H,()=>P(a,"tree")),_e("click",q,()=>P(a,"json")),Kt(ne,()=>r(o),b=>P(o,b)),h(A,F)};X(p,A=>{r(i).length===0?A(w):A(_,-1)})}c(x),h(t,x),$e()}Nt(["click"]);const mp={capability:"kv",renders:t=>ep(t),component:bp},ur="__all__",_p=["time","timestamp","ts","event_time","bucket","created_at"],yp=new Set(["created_at","updated_at","time","timestamp","timestamp_ns","rid","tenant"]),Ol=640,Rl=180,Dl=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 Vl(t){var o,a;const e=((o=t.result)==null?void 0:o.columns)??[];for(const s of _p){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 Hl(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_")||yp.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 wp(t){const e=Vl(t);return e?Hl(t,e).length>0:!1}function kp(t,e){const n=Vl(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 A=w.values[a];Lr(A)&&p.push({t:_,v:ka(A),raw:w.values})}return p.sort((w,_)=>w.t-_.t),{timeColumn:n,metricColumn:a,metrics:[ur,...v],points:p,metricNameColumn:o}}}const s=Hl(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 Sp(t,e=Ol,n=Rl,o=Dl){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((_,A)=>{const F=o+(_.t-s)/f*x,D=o+p-(_.v-l)/v*p;w.push(`${A===0?"M":"L"}${F.toFixed(2)},${D.toFixed(2)}`)}),{width:e,height:n,padding:o,path:w.join(" "),minT:s,maxT:i,minV:l,maxV:u}}function Cp(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 Np(t,e=Ol,n=Rl,o=Dl){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 Ep=S('<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>'),Mp=S("<option> </option>"),zp=S('<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>'),Tp=S('<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>'),Pp=S('· <span class="text-fg-2"> </span>',1),Ip=Dt('<rect class="cursor-pointer transition-opacity" fill="var(--color-accent)" role="button" tabindex="0"><title> </title></rect>'),Ap=Dt('<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>'),Lp=Dt('<svg class="block w-full h-[180px] text-accent" aria-label="Timeseries chart"><path fill="none" stroke="currentColor" stroke-width="1.5"></path></svg>'),Op=S('<th class="px-2 py-1.5 text-left font-normal">metric</th>'),Rp=S('<td class="px-2 py-1 text-fg-2"> </td>'),Dp=S('<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>'),Vp=S('<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),Hp=S('<div class="flex h-full flex-col text-fg-1"><!></div>');function Fp(t,e){Ze(e,!0);let n=xe(Ct(ur)),o=xe("rate"),a=xe(6e4),s=xe(null);const i=C(()=>kp(e.result,r(n))),l=C(()=>r(i)&&r(o)==="line"?Sp(r(i)):null),u=C(()=>r(i)?Cp(r(i),r(a)):[]),f=C(()=>r(i)&&r(o)==="rate"?Np(r(u)):null),v=C(()=>{if(!r(i))return[];if(!r(s))return r(i).points;const q=r(s).t,ee=q+r(a);return r(i).points.filter(oe=>oe.t>=q&&oe.t<ee)});function x(q){try{return new Date(q).toISOString().replace("T"," ").slice(0,19)}catch{return String(q)}}function p(q){return q==null?"":typeof q=="object"?JSON.stringify(q):String(q)}function w(q){var ve;const ee=[],oe=(ve=r(i))!=null&&ve.metricNameColumn?q.raw[r(i).metricNameColumn]:void 0;oe!==void 0&&ee.push(String(oe));const ae=q.raw.tags;if(ae&&typeof ae=="object"){const R=Object.entries(ae).map(([y,M])=>`${y}=${p(M)}`).join(" ");R&&ee.push(R)}const ne=q.raw.event??q.raw.action??q.raw.message??q.raw.payload;return ne!==void 0&&ee.push(p(ne)),ee.join(" · ")}function _(q){return q===1e3?"1s":q===1e4?"10s":q===6e4?"1min":q===3e5?"5min":q===6e5?"10min":q===36e5?"1hr":`${q}ms`}function A(q){return q===ur?"all writes":q}function F(){return r(i)?!r(n)||r(n)===ur?"all writes":r(n):""}var D=Hp(),L=d(D);{var H=q=>{var ee=Ep();h(q,ee)},V=q=>{var ee=Vp(),oe=fe(ee),ae=d(oe),ne=d(ae),ve=d(ne);Wu(ve,{class:"size-3"});var R=g(ve);c(ne);var y=g(ne,2),M=d(y);Uu(M,{class:"size-3"}),Ce(),c(y),c(ae);var m=g(ae,2),E=d(m);Dr(E,{class:"size-3"});var N=g(E,2);Je(N,20,()=>r(i).metrics,ue=>ue,(ue,le)=>{var we=Mp(),Ne=d(we,!0);c(we);var Se={};j(ze=>{T(Ne,ze),Se!==(Se=le)&&(we.value=(we.__value=le)??"")},[()=>A(le)]),h(ue,we)}),c(N),c(m);var O=g(m,2);{var K=ue=>{var le=zp(),we=g(d(le)),Ne=d(we);Ne.value=Ne.__value=1e3;var Se=g(Ne);Se.value=Se.__value=1e4;var ze=g(Se);ze.value=ze.__value=6e4;var me=g(ze);me.value=me.__value=3e5;var Ee=g(me);Ee.value=Ee.__value=6e5;var Ae=g(Ee);Ae.value=Ae.__value=36e5,c(we);var Ke;hi(we),c(le),j(()=>{Ke!==(Ke=r(a))&&(we.value=(we.__value=r(a))??"",xi(we,r(a)))}),_e("change",we,at=>{P(a,Number(at.currentTarget.value),!0),P(s,null)}),h(ue,le)};X(O,ue=>{r(o)==="rate"&&ue(K)})}var Z=g(O,2);{var z=ue=>{var le=Tp(),we=d(le);Qt(we,{class:"size-3"}),Ce(),c(le),_e("click",le,()=>P(s,null)),h(ue,le)};X(Z,ue=>{r(s)&&ue(z)})}var b=g(Z,2),k=d(b),I=d(k,!0);c(k);var U=g(k),ce=g(U);{var J=ue=>{var le=gt();j(we=>T(le,`of ${we??""}`),[()=>r(i).points.length.toLocaleString()]),h(ue,le)};X(ce,ue=>{r(s)&&ue(J)})}var Y=g(ce,2);{var Q=ue=>{var le=Pp(),we=g(fe(le)),Ne=d(we,!0);c(we),j(()=>T(Ne,e.collection)),h(ue,le)};X(Y,ue=>{e.collection&&ue(Q)})}c(b),c(oe);var $=g(oe,2),se=d($);{var W=ue=>{var le=Ap(),we=d(le);Je(we,17,()=>r(f).bars,Ee=>Ee.bucket.t,(Ee,Ae)=>{var Ke=Ip(),at=d(Ke),Be=d(at);c(at),c(Ke),j((Qe,dt,vt)=>{ke(Ke,"x",r(Ae).x),ke(Ke,"y",r(Ae).y),ke(Ke,"width",r(Ae).w),ke(Ke,"height",r(Ae).h),ke(Ke,"opacity",!r(s)||r(s).t===r(Ae).bucket.t?.9:.3),ke(Ke,"aria-label",`Bucket starting at ${Qe??""} with ${r(Ae).bucket.count??""} writes`),T(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)]),_e("click",Ke,()=>{var Qe;return P(s,((Qe=r(s))==null?void 0:Qe.t)===r(Ae).bucket.t?null:r(Ae).bucket,!0)}),_e("keydown",Ke,Qe=>{var dt;(Qe.key==="Enter"||Qe.key===" ")&&(Qe.preventDefault(),P(s,((dt=r(s))==null?void 0:dt.t)===r(Ae).bucket.t?null:r(Ae).bucket,!0))}),h(Ee,Ke)});var Ne=g(we),Se=d(Ne,!0);c(Ne);var ze=g(Ne),me=d(ze);c(ze),c(le),j((Ee,Ae)=>{ke(le,"viewBox",`0 0 ${r(f).width} ${r(f).height}`),ke(Ne,"x",r(f).padding),ke(Ne,"y",r(f).height-2),T(Se,Ee),ke(ze,"x",r(f).width-r(f).padding),ke(ze,"y",r(f).height-2),T(me,`peak ${r(f).maxCount??""}/${Ae??""}`)},[()=>{var Ee;return x(((Ee=r(f).bars[0])==null?void 0:Ee.bucket.t)??0)},()=>_(r(a))]),h(ue,le)},B=ue=>{var le=Lp(),we=d(le);c(le),j(()=>{ke(le,"viewBox",`0 0 ${r(l).width} ${r(l).height}`),ke(we,"d",r(l).path)}),h(ue,le)};X(se,ue=>{r(o)==="rate"&&r(f)?ue(W):r(l)&&ue(B,1)})}c($);var ie=g($,2),re=d(ie),te=d(re),ge=d(te),he=g(d(ge));{var be=ue=>{var le=Op();h(ue,le)};X(he,ue=>{r(i).metricNameColumn&&ue(be)})}Ce(2),c(ge),c(te);var Te=g(te);Je(Te,21,()=>r(v),qt,(ue,le)=>{var we=Dp(),Ne=d(we),Se=d(Ne,!0);c(Ne);var ze=g(Ne);{var me=Be=>{var Qe=Rp(),dt=d(Qe,!0);c(Qe),j(vt=>T(dt,vt),[()=>String(r(le).raw[r(i).metricNameColumn]??"")]),h(Be,Qe)};X(ze,Be=>{r(i).metricNameColumn&&Be(me)})}var Ee=g(ze),Ae=d(Ee,!0);c(Ee);var Ke=g(Ee),at=d(Ke,!0);c(Ke),c(we),j((Be,Qe)=>{T(Se,Be),T(Ae,r(le).v),T(at,Qe)},[()=>x(r(le).t),()=>w(r(le))]),h(ue,we)}),c(Te),c(re),c(ie);var ye=g(ie,2),pe=d(ye),Me=g(pe);{var Pe=ue=>{var le=gt();j((we,Ne)=>T(le,`· bucket ${we??""} (+${Ne??""})`),[()=>x(r(s).t),()=>_(r(a))]),h(ue,le)};X(Me,ue=>{r(s)&&ue(Pe)})}c(ye),j((ue,le,we,Ne,Se)=>{Oe(ne,1,ue),ke(ne,"aria-pressed",r(o)==="rate"),T(R,` Writes/${le??""}`),Oe(y,1,we),ke(y,"aria-pressed",r(o)==="line"),T(I,Ne),T(U,` · ${Se??""}`),T(pe,`${r(v).length??""} inserts${e.collection?" · ":""}${e.collection??""??""} `)},[()=>Ue(["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)),()=>Ue(["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(" ")),()=>F(),()=>r(v).length.toLocaleString()]),_e("click",ne,()=>P(o,"rate")),_e("click",y,()=>P(o,"line")),Ba(N,()=>r(n),ue=>P(n,ue)),h(q,ee)};X(L,q=>{r(i)?q(V,-1):q(H)})}c(D),h(t,D),$e()}Nt(["click","change","keydown"]);const qp={capability:"hypertable",renders:t=>wp(t),component:Fp};function Kp(t){return{query:t.query,capability:t.capability,record_count:t.record_count,records:t.result.records}}function Bp(t){return JSON.stringify(t,null,2)}function jp(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=S('<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 Up(t,e){Ze(e,!0);const n=C(()=>Bp(Kp(e.result))),o=C(()=>jp(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(()=>T(u,`${e.result.record_count??""} records · raw shape${e.collection?" · ":""}${e.collection??""??""}`)),h(t,a),$e()}const Yp={capability:"json",renders:()=>!1,component:Up},Xp=/(^|_)(vector|embedding|embeddings|turbovec)($|_)/i,Gp=/(^|_)(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 Za(t){return Array.isArray(t)&&t.length>0&&t.every(e=>typeof e=="number"&&Number.isFinite(e))}function $p(t){const e=Object.entries(t).find(([o,a])=>Xp.test(o)&&Za(a));if(e)return e;const n=Object.entries(t).find(([,o])=>Za(o));return n||null}function Qp(t,e){const n=Object.entries(t).find(([o,a])=>o!==e&&Gp.test(o)&&typeof a=="number"&&Number.isFinite(a));return n||null}function fs(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?Math.floor(t):null}function $a(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=>Za(v.vector)))??null,s=a!=null&&a.vector?["vector_results.vector",a.vector]:$p(o),i=Qp(o,(s==null?void 0:s[0])??null),l=(s==null?void 0:s[1].length)??fs(o.dimension)??fs(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 Jp(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:$a(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 eh(t){return/^VECTOR\s+SEARCH\s+\S+\s+SIMILAR\s+TO\s+\[1(?:\.0)?,\s*0(?:\.0)?/i.test(t.query.trim())}function th(t){return/^VECTOR\s+SEARCH\s+/i.test(t.query.trim())}function nh(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 rh(t){return`[${t.map(e=>Number(e.toPrecision(8))).join(", ")}]`}function oh(t){return`'${t.replace(/'/g,"''")}'`}function ah(t){return t.replace(/[^A-Za-z0-9_./-]/g,"")}function vs(t,e,n){const o=Math.max(1,Math.min(200,Math.floor(Number(n)||20))),a=e.kind==="text"?oh(e.text):rh(e.vector);return`VECTOR SEARCH ${ah(t)} SIMILAR TO ${a} INCLUDE VECTORS LIMIT ${o}`}var ih=S('<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"/>'),sh=S('<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"/>'),lh=S('<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),ch=S('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector row filter"><!></button>'),dh=S('<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>'),uh=S("<span> </span>"),fh=S('<div class="mt-1.5 text-warn"> </div>'),vh=S('<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>'),gh=S('<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>'),ph=S('<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>'),hh=S('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector result filter"><!></button>'),xh=S('<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>'),bh=S('<span class="ml-auto text-fg-1"> </span>'),mh=S('<div class="mt-0.5 truncate text-fg-3"> </div>'),_h=S('<button type="button"><div class="flex items-baseline gap-2"><span class="text-accent"> </span> <span class="text-fg-3"> </span> <!></div> <!></button>'),yh=S('<div class="text-fg-3">No vector selected.</div>'),wh=S('<div class="text-fg-3">vector column</div> <div class="text-fg-0"> </div>',1),kh=S('<div class="text-fg-3">ranking metric</div> <div class="text-fg-0"> </div>',1),Sh=S('<div class="text-fg-3 truncate"> </div> <div class="text-fg-1 break-words"> </div>',1),Ch=S('<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>'),Nh=S('<div class="border border-line-1 bg-bg-1/40 px-3 py-2 text-fg-3"> </div>'),Eh=S('<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>'),Mh=S('<div class="mt-2 text-fg-3">Showing first 256 dimensions.</div>'),zh=S('<div class="mb-2 flex items-center justify-between text-fg-3"><span> </span> <span> </span></div> <div class="grid gap-1"></div> <!>',1),Th=S('<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>'),Ph=S('<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>'),Ih=S('<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),Ah=S('<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 Lh(t,e){Ze(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=C(()=>$a(e.result)),_=C(()=>{var re;return((re=r(w).find(te=>te.dimension>0))==null?void 0:re.dimension)??null}),A=C(()=>r(v)??(th(e.result)?e.result:null)),F=C(()=>r(A)?$a(r(A)):[]),D=C(()=>r(n)==="search"?r(F):r(w)),L=C(()=>r(A)?eh(r(A)):!1),H=C(()=>{const re=r(u).trim().toLowerCase();return re?r(D).filter(te=>te.id.toLowerCase().includes(re)||Object.values(te.metadata).some(ge=>Na(ge).toLowerCase().includes(re))):r(D)}),V=C(()=>r(f)??r(H)[0]??null),q=C(()=>Math.max(1,...r(H).map(re=>xo(re.vector)))),ee=C(()=>r(A)!==null);function oe(re){const te=Object.entries(re.metadata).slice(0,3);return te.length===0?"":te.map(([ge,he])=>`${ge}=${Na(he)}`).join(" · ")}function ae(re,te){const ge=Math.max(1,...te.map(he=>Math.abs(he)));return Math.max(2,Math.abs(re)/ge*100)}async function ne(){if(!e.client||!e.collection){P(p,"No active RedDB connection for vector search.");return}P(p,null),P(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"?vs(e.collection,{kind:"text",text:re},r(l)):vs(e.collection,{kind:"vector",vector:nh(r(i))},r(l)),ge=await e.client.query(te);P(v,ge,!0),P(f,null),P(n,"search"),P(o,"metadata")}catch(re){P(p,re.message,!0)}finally{P(x,!1)}}var ve=Ah(),R=d(ve),y=d(R),M=d(y),m=d(M),E=d(m);Xa(E,{class:"size-3"}),Ce(),c(m);var N=g(m,2),O=d(N);un(O,{class:"size-3"}),Ce(),c(N),c(M);var K=g(M,2);{var Z=re=>{var te=lh(),ge=fe(te),he=d(ge),be=g(he,2);c(ge);var Te=g(ge,2),ye=d(Te);{var pe=ze=>{var me=ih();Vt(me),_e("keydown",me,Ee=>{Ee.key==="Enter"&&ne()}),Kt(me,()=>r(s),Ee=>P(s,Ee)),h(ze,me)},Me=ze=>{var me=sh();Vt(me),_e("keydown",me,Ee=>{Ee.key==="Enter"&&ne()}),Kt(me,()=>r(i),Ee=>P(i,Ee)),h(ze,me)};X(ye,ze=>{r(a)==="text"?ze(pe):ze(Me,-1)})}c(Te);var Pe=g(Te,2),ue=g(d(Pe),2);Vt(ue),c(Pe);var le=g(Pe,2),we=d(le);{var Ne=ze=>{mn(ze,{class:"size-3 animate-spin"})},Se=ze=>{oa(ze,{class:"size-3"})};X(we,ze=>{r(x)?ze(Ne):ze(Se,-1)})}Ce(),c(le),j((ze,me,Ee)=>{Oe(he,1,ze),ke(he,"aria-pressed",r(a)==="text"),Oe(be,1,me),ke(be,"aria-pressed",r(a)==="vector"),Oe(le,1,Ee),le.disabled=r(x)},[()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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(" "))]),_e("click",he,()=>P(a,"text")),_e("click",be,()=>P(a,"vector")),Kt(ue,()=>r(l),ze=>P(l,ze)),_e("click",le,()=>void ne()),h(re,te)},z=re=>{var te=dh(),ge=d(te);un(ge,{class:"size-3 text-fg-3"});var he=g(ge,2);Vt(he);var be=g(he,2);{var Te=ye=>{var pe=ch(),Me=d(pe);Qt(Me,{class:"size-3"}),c(pe),_e("click",pe,()=>P(u,"")),h(ye,pe)};X(be,ye=>{r(u)&&ye(Te)})}c(te),Kt(he,()=>r(u),ye=>P(u,ye)),h(re,te)};X(K,re=>{r(n)==="search"?re(Z):re(z,-1)})}var b=g(K,2),k=d(b),I=d(k,!0);c(k);var U=g(k,2);{var ce=re=>{var te=uh(),ge=d(te,!0);c(te),j(()=>T(ge,e.collection)),h(re,te)};X(U,re=>{e.collection&&re(ce)})}c(b),c(y);var J=g(y,2);{var Y=re=>{var te=fh(),ge=d(te,!0);c(te),j(()=>T(ge,r(p))),h(re,te)};X(J,re=>{r(p)&&re(Y)})}c(R);var Q=g(R,2);{var $=re=>{var te=vh();h(re,te)};X(Q,re=>{r(n)==="search"&&r(L)&&re($)})}var se=g(Q,2);{var W=re=>{var te=gh(),ge=d(te),he=d(ge);un(he,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4});var be=g(he,2),Te=d(be,!0);c(be),Ce(2),c(ge),c(te),j(()=>T(Te,r(ee)?"No search results.":"No vector search has been run.")),h(re,te)},B=re=>{var te=ph(),ge=d(te),he=d(ge);Xa(he,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4}),Ce(2),c(ge),c(te),h(re,te)},ie=re=>{var te=Ih(),ge=fe(te),he=d(ge),be=d(he),Te=d(be);xr(Te,{class:"size-3"}),Ce(),c(be);var ye=g(be,2),pe=d(ye);sf(pe,{class:"size-3"}),Ce(),c(ye);var Me=g(ye,2),Pe=d(Me);kl(Pe,{class:"size-3"}),Ce(),c(Me),c(he);var ue=g(he,2);{var le=Ge=>{var Re=xh(),Ie=d(Re);un(Ie,{class:"size-3 text-fg-3"});var qe=g(Ie,2);Vt(qe);var G=g(qe,2);{var De=Le=>{var je=hh(),Ye=d(je);Qt(Ye,{class:"size-3"}),c(je),_e("click",je,()=>P(u,"")),h(Le,je)};X(G,Le=>{r(u)&&Le(De)})}c(Re),Kt(qe,()=>r(u),Le=>P(u,Le)),h(Ge,Re)};X(ue,Ge=>{r(n)==="search"&&Ge(le)})}var we=g(ue,2),Ne=d(we,!0),Se=g(Ne);{var ze=Ge=>{var Re=gt();j(Ie=>T(Re,`of ${Ie??""}`),[()=>r(D).length.toLocaleString()]),h(Ge,Re)};X(Se,Ge=>{r(u)&&Ge(ze)})}var me=g(Se);c(we),c(ge);var Ee=g(ge,2),Ae=d(Ee);Je(Ae,21,()=>r(H),Ge=>Ge.id,(Ge,Re)=>{var Ie=_h(),qe=d(Ie),G=d(qe),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=bh(),st=d(tt,!0);c(tt),j((ut,ht)=>{ke(tt,"title",ut),T(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(qe);var ct=g(qe,2);{var pt=Xe=>{var tt=mh(),st=d(tt,!0);c(tt),j(ut=>T(st,ut),[()=>oe(r(Re))]),h(Xe,tt)},it=C(()=>oe(r(Re)));X(ct,Xe=>{r(it)&&Xe(pt)})}c(Ie),j(Xe=>{Oe(Ie,1,Xe),T(De,r(Re).id),T(je,`${r(Re).dimension??""}d`)},[()=>Ue(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(V)===r(Re)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),_e("click",Ie,()=>P(f,r(Re),!0)),h(Ge,Ie)}),c(Ae);var Ke=g(Ae,2),at=d(Ke);{var Be=Ge=>{var Re=yh();h(Ge,Re)},Qe=Ge=>{var Re=Ch(),Ie=g(d(Re),2),qe=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 pt=st=>{var ut=wh(),ht=g(fe(ut),2),xt=d(ht,!0);c(ht),j(()=>T(xt,r(V).vectorColumn)),h(st,ut)};X(ct,st=>{r(V).vectorColumn&&st(pt)})}var it=g(ct,2);{var Xe=st=>{var ut=kh(),ht=g(fe(ut),2),xt=d(ht,!0);c(ht),j(Tt=>T(xt,Tt),[()=>Ca(r(V))]),h(st,ut)};X(it,st=>{r(n)==="search"&&r(V).scalarColumn&&st(Xe)})}var tt=g(it,2);Je(tt,17,()=>Object.entries(r(V).metadata),qt,(st,ut)=>{var ht=C(()=>rn(r(ut),2));let xt=()=>r(ht)[0],Tt=()=>r(ht)[1];var bt=Sh(),mt=fe(bt),Et=d(mt,!0);c(mt);var Pt=g(mt,2),Rt=d(Pt,!0);c(Pt),j(Ht=>{T(Et,xt()),T(Rt,Ht)},[()=>Na(Tt())]),h(st,bt)}),c(Re),j(st=>{T(qe,r(V).id),T(De,r(V).dimension),T(je,st),T(lt,r(V).vector.length>0?"returned":"not returned")},[()=>r(V).vector.length>0?xo(r(V).vector).toFixed(6):"n/a"]),h(Ge,Re)},dt=Ge=>{var Re=He(),Ie=fe(Re);{var qe=De=>{var Le=Nh(),je=d(Le);c(Le),j(()=>T(je,`This result reports a ${r(V).dimension??""}d vector, but the coordinate array was not returned by RedDB.`)),h(De,Le)},G=De=>{var Le=zh(),je=fe(Le),Ye=d(je),lt=d(Ye);c(Ye);var ct=g(Ye,2),pt=d(ct);c(ct),c(je);var it=g(je,2);Je(it,21,()=>r(V).vector.slice(0,256),qt,(st,ut,ht)=>{var xt=Eh(),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,Ue(r(ut)<0?"text-warn text-right":"text-fg-1 text-right")),T(Rt,Bt)},[()=>({width:`${ae(r(ut),r(V).vector)}%`}),()=>r(ut).toFixed(5)]),h(st,xt)}),c(it);var Xe=g(it,2);{var tt=st=>{var ut=Mh();h(st,ut)};X(Xe,st=>{r(V).vector.length>256&&st(tt)})}j((st,ut)=>{T(lt,`${r(V).vector.length??""} dimensions`),T(pt,`|v| ${st??""} / max visible ${ut??""}`)},[()=>xo(r(V).vector).toFixed(6),()=>r(q).toFixed(2)]),h(De,Le)};X(Ie,De=>{r(V).vector.length===0?De(qe):De(G,-1)})}h(Ge,Re)},vt=Ge=>{var Re=Ph(),Ie=g(d(Re));Je(Ie,21,()=>r(H),qe=>qe.id,(qe,G)=>{var De=Th(),Le=d(De),je=d(Le,!0);c(Le);var Ye=g(Le),lt=d(Ye,!0);c(Ye);var ct=g(Ye),pt=d(ct,!0);c(ct),c(De),j((it,Xe,tt)=>{T(je,r(G).id),ke(Ye,"title",it),T(lt,Xe),T(pt,tt)},[()=>Ca(r(G)),()=>r(G).scalar===null?"n/a":r(G).scalar.toFixed(6),()=>xo(r(G).vector).toFixed(6)]),_e("click",De,()=>P(f,r(G),!0)),h(qe,De)}),c(Ie),c(Re),h(Ge,Re)};X(at,Ge=>{r(V)?r(o)==="metadata"?Ge(Qe,1):r(o)==="vector"?Ge(dt,2):Ge(vt,-1):Ge(Be)})}c(Ke),c(Ee),j((Ge,Re,Ie,qe)=>{Oe(be,1,Ge),ke(be,"aria-pressed",r(o)==="metadata"),Oe(ye,1,Re),ke(ye,"aria-pressed",r(o)==="vector"),Oe(Me,1,Ie),ke(Me,"aria-pressed",r(o)==="scalar"),T(Ne,qe),T(me,` ${r(n)==="search"?" results":" rows"}`)},[()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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(H).length.toLocaleString()]),_e("click",be,()=>P(o,"metadata")),_e("click",ye,()=>P(o,"vector")),_e("click",Me,()=>P(o,"scalar")),h(re,te)};X(se,re=>{r(n)==="search"&&r(F).length===0?re(W):r(D).length===0?re(B,1):re(ie,-1)})}c(ve),j((re,te)=>{Oe(m,1,re),ke(m,"aria-pressed",r(n)==="browse"),Oe(N,1,te),ke(N,"aria-pressed",r(n)==="search"),T(I,r(_)?`${r(_)}d`:"dimension n/a")},[()=>Ue(["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(" ")),()=>Ue(["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(" "))]),_e("click",m,()=>{P(n,"browse"),P(f,null)}),_e("click",N,()=>{P(n,"search"),P(f,null)}),h(t,ve),$e()}Nt(["click","keydown"]);const Oh={capability:"vector",renders:t=>Jp(t),component:Lh},Qa=["message","payload","body","value","data"],Fl=["state","status","delivery_state"],ql=["consumer","consumer_id","worker","lease_owner"],Kl=["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 Rh(t){return t.result.records.map((e,n)=>{const o=e.values??{},a=bo(o,Qa),s=bo(o,Fl),i=bo(o,ql),l=bo(o,Kl);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 Dh(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))||ql.some(o=>n.includes(o))||Kl.some(o=>n.includes(o)))})}function Vh(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 gs(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 Hh(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:gs(o.lsn),ts:gs(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 qh(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 Kh=S('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear queue filter"><!></button>'),Bh=S("<span> </span>"),jh=S('<span>from <span class="text-fg-2"> </span></span>'),Wh=S('<span>dlc <span class="text-fg-2"> </span></span>'),Uh=S('<span class="text-fg-2"> </span>'),Yh=S('<div class="mt-1.5 text-warn"> </div>'),Xh=S('<div class="mt-1.5 text-ok"> </div>'),Gh=S('<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=S('<div class="p-3 text-[12px] font-mono text-fg-3">No WITH EVENTS envelopes detected in this queue result.</div>'),$h=S('<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>'),Qh=S('<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>'),Jh=S('<div class="flex-1 min-h-0 overflow-auto"><!></div>'),e1=S('<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>'),t1=S('<div class="flex-1 min-h-0 overflow-auto p-3 text-[12px] font-mono"><div class="grid gap-2"></div></div>'),n1=S('<div class="p-3 text-fg-3">No queue messages in this result.</div>'),r1=S('<span class="ml-auto text-fg-3"> </span>'),o1=S('<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>'),a1=S('<pre class="whitespace-pre-wrap text-fg-1"> </pre>'),i1=S('<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>'),s1=S('<div class="text-fg-3">Select a message to inspect payload, delivery state, consumer, and DLC link.</div>'),l1=S('<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>'),c1=S('<span><span class="text-fg-2"> </span> </span>'),d1=S('<span><span class="text-fg-2"> </span> </span>'),u1=S('<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 f1(t,e){Ze(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=C(()=>Rh(e.result)),p=C(()=>Vh(r(x))),w=C(()=>Hh(r(x))),_=C(()=>e.collection?Fh(e.collection):[]),A=C(()=>{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 F(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 H(){const ue=We.client;if(!(!ue||!e.collection||!r(i).trim())){P(l,!0),P(u,null);try{await Mt.track(`${e.collection} · enqueue message`,()=>ue.query(qh(e.collection,L()))),P(i,""),P(f,r(f)+1)}catch(le){P(u,le.message,!0)}finally{P(l,!1)}}}var V=u1(),q=d(V),ee=d(q),oe=d(ee),ae=d(oe);vf(ae,{class:"size-3"}),Ce(),c(oe);var ne=g(oe,2),ve=d(ne);ns(ve,{class:"size-3"}),Ce(),c(ne);var R=g(ne,2),y=d(R);Gu(y,{class:"size-3"}),Ce(),c(R);var M=g(R,2),m=d(M);xr(m,{class:"size-3"}),Ce(),c(M),c(ee);var E=g(ee,2),N=d(E);Sl(N,{class:"size-3"}),Ce(),c(E);var O=g(E,2),K=d(O);un(K,{class:"size-3 text-fg-3"});var Z=g(K,2);Vt(Z);var z=g(Z,2);{var b=ue=>{var le=Kh(),we=d(le);Qt(we,{class:"size-3"}),c(le),_e("click",le,()=>P(o,"")),h(ue,le)};X(z,ue=>{r(o)&&ue(b)})}c(O);var k=g(O,2),I=d(k),U=d(I);c(I);var ce=g(I,2);{var J=ue=>{var le=Bh(),we=d(le);c(le),j(Ne=>T(we,`${Ne??""} events`),[()=>r(w).length.toLocaleString()]),h(ue,le)};X(ce,ue=>{r(w).length&&ue(J)})}var Y=g(ce,2),Q=d(Y);c(Y);var $=g(Y,2);{var se=ue=>{var le=jh(),we=g(d(le)),Ne=d(we,!0);c(we),c(le),j(Se=>T(Ne,Se),[()=>r(p).sources.join(", ")]),h(ue,le)};X($,ue=>{r(p).sources.length&&ue(se)})}var W=g($,2);{var B=ue=>{var le=Wh(),we=g(d(le)),Ne=d(we,!0);c(we),c(le),j(Se=>T(Ne,Se),[()=>r(p).dlcs.join(", ")]),h(ue,le)};X(W,ue=>{r(p).dlcs.length&&ue(B)})}var ie=g(W,2);{var re=ue=>{var le=Uh(),we=d(le,!0);c(le),j(()=>T(we,e.collection)),h(ue,le)};X(ie,ue=>{e.collection&&ue(re)})}c(k),c(q);var te=g(q,2);{var ge=ue=>{var le=Gh(),we=d(le),Ne=d(we);dl(Ne),ke(Ne,"placeholder",v);var Se=g(Ne,2),ze=d(Se);{var me=Be=>{mn(Be,{class:"size-3 animate-spin"})},Ee=Be=>{ns(Be,{class:"size-3"})};X(ze,Be=>{r(l)?Be(me):Be(Ee,-1)})}Ce(),c(Se),c(we);var Ae=g(we,2);{var Ke=Be=>{var Qe=Yh(),dt=d(Qe,!0);c(Qe),j(()=>T(dt,r(u))),h(Be,Qe)},at=Be=>{var Qe=Xh(),dt=d(Qe);c(Qe),j(()=>T(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=>Se.disabled=Be,[()=>r(l)||!r(i).trim()||!e.collection]),Kt(Ne,()=>r(i),Be=>P(i,Be)),_e("click",Se,H),h(ue,le)};X(te,ue=>{r(s)&&ue(ge)})}var he=g(te,2);{var be=ue=>{var le=Jh(),we=d(le);{var Ne=ze=>{var me=Zh();h(ze,me)},Se=ze=>{var me=Qh(),Ee=g(d(me));Je(Ee,21,()=>r(w),Ae=>`${Ae.messageId}-${Ae.lsn??Ae.entityId}`,(Ae,Ke)=>{var at=$h(),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 qe=g(Ge),G=d(qe,!0);c(qe);var De=g(qe),Le=d(De,!0);c(De);var je=g(De),Ye=d(je,!0);c(je),c(at),j((lt,ct)=>{T(Qe,lt),T(vt,r(Ke).collection),T(Ie,r(Ke).op),T(G,r(Ke).entityId),T(Le,r(Ke).lsn??"-"),T(Ye,ct)},[()=>D(r(Ke).ts),()=>F(r(Ke).after)]),h(Ae,at)}),c(Ee),c(me),h(ze,me)};X(we,ze=>{r(w).length===0?ze(Ne):ze(Se,-1)})}c(le),h(ue,le)},Te=ue=>{var le=t1(),we=d(le);Je(we,21,()=>r(_),Ne=>Ne.query,(Ne,Se)=>{var ze=e1(),me=d(ze),Ee=d(me),Ae=d(Ee,!0);c(Ee);var Ke=g(Ee,2),at=d(Ke,!0);c(Ke),c(me);var Be=g(me,2),Qe=d(Be,!0);c(Be);var dt=g(Be,2),vt=d(dt,!0);c(dt),c(ze),j(Ge=>{T(Ae,r(Se).label),Oe(Ke,1,Ge),T(at,r(Se).mutates?"mutates":"read-only"),T(Qe,r(Se).query),T(vt,r(Se).note)},[()=>Ue(["rounded border px-1.5 py-0.5 text-[10px]",r(Se).mutates?"border-warn/30 bg-warn/10 text-warn":"border-ok/30 bg-ok/10 text-ok"].join(" "))]),h(Ne,ze)}),c(we),c(le),h(ue,le)},ye=ue=>{var le=l1(),we=d(le),Ne=d(we);{var Se=Be=>{var Qe=n1();h(Be,Qe)},ze=Be=>{var Qe=He(),dt=fe(Qe);Je(dt,17,()=>r(A),vt=>vt.id,(vt,Ge)=>{var Re=o1(),Ie=d(Re),qe=d(Ie),G=d(qe,!0);c(qe);var De=g(qe,2),Le=d(De,!0);c(De);var je=g(De,2);{var Ye=pt=>{var it=r1(),Xe=d(it,!0);c(it),j(()=>T(Xe,r(Ge).consumer)),h(pt,it)};X(je,pt=>{r(Ge).consumer&&pt(Ye)})}c(Ie);var lt=g(Ie,2),ct=d(lt,!0);c(lt),c(Re),j((pt,it)=>{Oe(Re,1,pt),T(G,r(Ge).id),T(Le,r(Ge).state),T(ct,it)},[()=>Ue(["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(" ")),()=>F(r(Ge).message)]),_e("click",Re,()=>P(a,r(Ge),!0)),h(vt,Re)}),h(Be,Qe)};X(Ne,Be=>{r(A).length===0?Be(Se):Be(ze,-1)})}c(we);var me=g(we,2),Ee=d(me);{var Ae=Be=>{var Qe=a1(),dt=d(Qe,!0);c(Qe),j(vt=>T(dt,vt),[()=>JSON.stringify(r(A).map(vt=>vt.values),null,2)]),h(Be,Qe)},Ke=Be=>{var Qe=i1(),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),qe=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=>{T(vt,r(a).id),T(Re,r(a).state),T(qe,r(a).consumer??"none"),T(De,r(a).dlc??"none"),T(je,Ye)},[()=>F(r(a).message)]),h(Be,Qe)},at=Be=>{var Qe=s1();h(Be,Qe)};X(Ee,Be=>{r(n)==="json"?Be(Ae):r(a)?Be(Ke,1):Be(at,-1)})}c(me),c(le),h(ue,le)};X(he,ue=>{r(n)==="events"?ue(be):r(n)==="commands"?ue(Te,1):ue(ye,-1)})}var pe=g(he,2),Me=d(pe);Je(Me,17,()=>r(p).states,([ue,le])=>ue,(ue,le)=>{var we=C(()=>rn(r(le),2));let Ne=()=>r(we)[0],Se=()=>r(we)[1];var ze=c1(),me=d(ze),Ee=d(me,!0);c(me);var Ae=g(me);c(ze),j(Ke=>{T(Ee,Ne()),T(Ae,` ${Ke??""}`)},[()=>Se().toLocaleString()]),h(ue,ze)});var Pe=g(Me,2);Je(Pe,17,()=>r(p).operations,([ue,le])=>ue,(ue,le)=>{var we=C(()=>rn(r(le),2));let Ne=()=>r(we)[0],Se=()=>r(we)[1];var ze=d1(),me=d(ze),Ee=d(me,!0);c(me);var Ae=g(me);c(ze),j(Ke=>{T(Ee,Ne()),T(Ae,` ${Ke??""}`)},[()=>Se().toLocaleString()]),h(ue,ze)}),c(pe),c(V),j((ue,le,we,Ne,Se,ze)=>{Oe(oe,1,ue),ke(oe,"aria-pressed",r(n)==="events"),Oe(ne,1,le),ke(ne,"aria-pressed",r(n)==="messages"),Oe(R,1,we),ke(R,"aria-pressed",r(n)==="commands"),Oe(M,1,Ne),ke(M,"aria-pressed",r(n)==="json"),E.disabled=!e.collection,Oe(E,1,Se),ke(E,"aria-pressed",r(s)),ke(E,"title",e.collection?"Insert a queue message":"Open this as a collection to insert messages"),T(U,`${ze??""} messages`),T(Q,`${r(p).activeConsumers??""} active consumers`)},[()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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(A).length.toLocaleString()]),_e("click",oe,()=>P(n,"events")),_e("click",ne,()=>P(n,"messages")),_e("click",R,()=>P(n,"commands")),_e("click",M,()=>P(n,"json")),_e("click",E,()=>P(s,!r(s))),Kt(Z,()=>r(o),ue=>P(o,ue)),h(t,V),$e()}Nt(["click"]);const v1={capability:"queue",renders:t=>Dh(t),component:f1},g1=["metric","stat","name","key"],p1=["value","count","total","avg","rate","p50","p95","p99"],ps=["unit","units"];function hs(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 h1(t){for(const n of ps){const o=t[n];if(typeof o=="string"&&o.trim())return o.trim()}const e=Object.entries(t).find(([n,o])=>ps.includes(n.toLowerCase())&&typeof o=="string"&&o.trim());return e?String(e[1]).trim():null}function Bl(t){const e=[];for(const n of t.result.records){const o=n.values??{},a=Object.entries(o).find(([i,l])=>g1.includes(i.toLowerCase())&&(typeof l=="string"||typeof l=="number")),s=Object.entries(o).find(([i,l])=>p1.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:h1(o)??hs(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:hs(i),source:o})}return e}function x1(t){if(t.capability==="stats")return!0;const e=Bl(t);return e.length>0&&e.length>=t.result.records.length}function xs(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 b1=S('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No numeric statistics in this result.</div>'),m1=S('· <span class="text-fg-2"> </span>',1),_1=S('<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>'),y1=S('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2"></div></div>'),w1=S('<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>'),k1=S('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2"></div></div>'),S1=S('<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>'),C1=S('<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>'),N1=S('<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),E1=S('<div class="flex h-full flex-col text-fg-1"><!></div>');function M1(t,e){Ze(e,!0);let n=xe("kpi");const o=C(()=>Bl(e.result)),a=C(()=>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=E1(),l=d(i);{var u=v=>{var x=b1();h(v,x)},f=v=>{var x=N1(),p=fe(x),w=d(p),_=d(w),A=d(_);cf(A,{class:"size-3"}),Ce(),c(_);var F=g(_,2),D=d(F);kl(D,{class:"size-3"}),Ce(),c(F);var L=g(F,2),H=d(L);qd(H,{class:"size-3"}),Ce(),c(L),c(w);var V=g(w,2),q=d(V),ee=g(q);{var oe=y=>{var M=m1(),m=g(fe(M)),E=d(m,!0);c(m),j(()=>T(E,e.collection)),h(y,M)};X(ee,y=>{e.collection&&y(oe)})}c(V),c(p);var ae=g(p,2);{var ne=y=>{var M=y1(),m=d(M);Je(m,23,()=>r(o),(E,N)=>`${E.key}-${N}`,(E,N)=>{var O=_1(),K=d(O),Z=d(K,!0);c(K);var z=g(K,2),b=d(z,!0);c(z),c(O),j(k=>{T(Z,r(N).label),T(b,k)},[()=>xs(r(N).value,r(N).unit)]),h(E,O)}),c(m),c(M),h(y,M)},ve=y=>{var M=k1(),m=d(M);Je(m,23,()=>r(o),(E,N)=>`${E.key}-${N}`,(E,N)=>{const O=C(()=>s(r(N).value));var K=w1(),Z=d(K),z=g(d(Z)),b=g(z),k=d(b,!0);c(b),c(Z);var I=g(Z,2),U=d(I,!0);c(I),c(K),j(ce=>{ke(Z,"aria-label",`${r(N).label??""} gauge`),ke(z,"stroke-dasharray",`${r(O)} 100`),T(k,ce),T(U,r(N).label)},[()=>xs(r(N).value,r(N).unit)]),h(E,K)}),c(m),c(M),h(y,M)},R=y=>{var M=C1(),m=d(M),E=g(d(m));Je(E,23,()=>r(o),(N,O)=>`${N.key}-${O}`,(N,O)=>{var K=S1(),Z=d(K),z=d(Z,!0);c(Z);var b=g(Z),k=d(b,!0);c(b);var I=g(b),U=d(I,!0);c(I),c(K),j(ce=>{T(z,r(O).label),T(k,ce),T(U,r(O).unit||"-")},[()=>r(O).value.toLocaleString()]),h(N,K)}),c(E),c(m),c(M),h(y,M)};X(ae,y=>{r(n)==="kpi"?y(ne):r(n)==="gauge"?y(ve,1):y(R,-1)})}j((y,M,m,E)=>{Oe(_,1,y),ke(_,"aria-pressed",r(n)==="kpi"),Oe(F,1,M),ke(F,"aria-pressed",r(n)==="gauge"),Oe(L,1,m),ke(L,"aria-pressed",r(n)==="table"),T(q,`${E??""} metrics `)},[()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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()]),_e("click",_,()=>P(n,"kpi")),_e("click",F,()=>P(n,"gauge")),_e("click",L,()=>P(n,"table")),h(v,x)};X(l,v=>{r(o).length===0?v(u):v(f,-1)})}c(i),h(t,i),$e()}Nt(["click"]);const z1={capability:"stats",renders:t=>x1(t),component:M1},jl=["change","change_type","operation","op"],T1=["target_collection","collection_name","diff_collection"],P1=["entity_id","row_id","rid","id"],Wl=["before_state","before_row","before"],Ul=["after_state","after_row","after"],I1=["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 bs(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 A1(t){return t.result.records.map((e,n)=>{const o=e.values??{},a=ir(o,jl),s=ir(o,T1),i=ir(o,P1),l=ir(o,Wl),u=ir(o,Ul),f=ir(o,I1);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:bs((l==null?void 0:l[1])??null),after:bs((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 L1(t){return t.capability==="diff"?!0:t.result.records.some(e=>{const n=Object.keys(e.values??{}).map(o=>o.toLowerCase());return jl.some(o=>n.includes(o))&&(Wl.some(o=>n.includes(o))||Ul.some(o=>n.includes(o)))})}function O1(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 ms(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 R1(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":ms(l)===ms(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 D1=S('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No diff shape in this result.</div>'),V1=S('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear diff filter"><!></button>'),H1=S('<span><span class="text-fg-2"> </span> </span>'),F1=S('<span class="text-fg-2"> </span>'),q1=S('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><pre class="whitespace-pre-wrap text-fg-1"> </pre></div>'),K1=S('<span class="ml-auto text-fg-3"> </span>'),B1=S('<div class="mt-1 truncate text-fg-1"> </div>'),j1=S('<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=S('<span class="text-fg-3">note</span><span class="text-fg-1"> </span>',1),U1=S('<div class="px-2 py-2 text-fg-3">No changed fields in this row.</div>'),Y1=S('<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>'),X1=S('<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>'),G1=S('<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=S('<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),$1=S('<div class="text-fg-3">No diff entry selected.</div>'),Q1=S('<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>'),J1=S('<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),ex=S('<div class="flex h-full flex-col text-fg-1"><!></div>');function Yl(t,e){Ze(e,!0);let n=xe("summary"),o=xe(""),a=xe(null),s=xe(!1);const i=C(()=>A1(e.result)),l=C(()=>O1(r(i))),u=C(()=>{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=C(()=>r(a)??r(u)[0]??null),v=C(()=>r(f)?R1(r(f)):[]),x=C(()=>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=ex(),_=d(w);{var A=D=>{var L=D1();h(D,L)},F=D=>{var L=J1(),H=fe(L),V=d(H),q=d(V),ee=d(q);Ya(ee,{class:"size-3"}),Ce(),c(q);var oe=g(q,2),ae=d(oe);xr(ae,{class:"size-3"}),Ce(),c(oe),c(V);var ne=g(V,2),ve=d(ne);un(ve,{class:"size-3 text-fg-3"});var R=g(ve,2);Vt(R);var y=g(R,2);{var M=b=>{var k=V1(),I=d(k);Qt(I,{class:"size-3"}),c(k),_e("click",k,()=>P(o,"")),h(b,k)};X(y,b=>{r(o)&&b(M)})}c(ne);var m=g(ne,2),E=d(m);Je(E,17,()=>r(l),([b,k])=>b,(b,k)=>{var I=C(()=>rn(r(k),2));let U=()=>r(I)[0],ce=()=>r(I)[1];var J=H1(),Y=d(J),Q=d(Y,!0);c(Y);var $=g(Y);c(J),j(()=>{T(Q,U()),T($,` ${ce()??""}`)}),h(b,J)});var N=g(E,2);{var O=b=>{var k=F1(),I=d(k,!0);c(k),j(()=>T(I,e.collection)),h(b,k)};X(N,b=>{e.collection&&b(O)})}c(m),c(H);var K=g(H,2);{var Z=b=>{var k=q1(),I=d(k),U=d(I,!0);c(I),c(k),j(ce=>T(U,ce),[()=>JSON.stringify(r(u).map(ce=>ce.values),null,2)]),h(b,k)},z=b=>{var k=Q1(),I=d(k);Je(I,21,()=>r(u),Q=>Q.id,(Q,$)=>{var se=j1(),W=d(se),B=d(W),ie=d(B,!0);c(B);var re=g(B,2),te=d(re,!0);c(re);var ge=g(re,2);{var he=ye=>{var pe=K1(),Me=d(pe,!0);c(pe),j(()=>T(Me,r($).collection)),h(ye,pe)};X(ge,ye=>{r($).collection&&ye(he)})}c(W);var be=g(W,2);{var Te=ye=>{var pe=B1(),Me=d(pe,!0);c(pe),j(()=>T(Me,r($).note)),h(ye,pe)};X(be,ye=>{r($).note&&ye(Te)})}c(se),j(ye=>{Oe(se,1,ye),T(ie,r($).change),T(te,r($).entityId??r($).id)},[()=>Ue(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(f)===r($)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),_e("click",se,()=>P(a,r($),!0)),h(Q,se)}),c(I);var U=g(I,2),ce=d(U);{var J=Q=>{var $=Z1(),se=fe($),W=g(d(se)),B=d(W,!0);c(W);var ie=g(W,3),re=d(ie,!0);c(ie);var te=g(ie,3),ge=d(te,!0);c(te);var he=g(te,2);{var be=Se=>{var ze=W1(),me=g(fe(ze)),Ee=d(me,!0);c(me),j(()=>T(Ee,r(f).note)),h(Se,ze)};X(he,Se=>{r(f).note&&Se(be)})}c(se);var Te=g(se,2);{var ye=Se=>{var ze=G1(),me=d(ze),Ee=g(d(me),2),Ae=d(Ee);c(Ee);var Ke=g(Ee,2),at=d(Ke);Vt(at),Ce(),c(Ke),c(me);var Be=g(me,2);{var Qe=vt=>{var Ge=U1();h(vt,Ge)},dt=vt=>{var Ge=X1(),Re=g(d(Ge));Je(Re,21,()=>r(x),Ie=>Ie.field,(Ie,qe)=>{var G=Y1(),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),pt=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),T(Le,r(qe).status),T(Ye,r(qe).field),T(pt,ut),T(tt,ht)},[()=>Ue(["px-2 py-1 align-top",p(r(qe).status)].join(" ")),()=>sr(r(qe).before),()=>sr(r(qe).after)]),h(Ie,G)}),c(Re),c(Ge),h(vt,Ge)};X(Be,vt=>{r(x).length===0?vt(Qe):vt(dt,-1)})}c(ze),j(()=>T(Ae,`${r(x).length??""}/${r(v).length??""} fields`)),Kd(at,()=>r(s),vt=>P(s,vt)),h(Se,ze)};X(Te,Se=>{r(v).length>0&&Se(ye)})}var pe=g(Te,2),Me=d(pe),Pe=g(d(Me),2),ue=d(Pe,!0);c(Pe),c(Me);var le=g(Me,2),we=g(d(le),2),Ne=d(we,!0);c(we),c(le),c(pe),j((Se,ze)=>{T(B,r(f).change),T(re,r(f).entityId??r(f).id),T(ge,r(f).collection??"-"),T(ue,Se),T(Ne,ze)},[()=>sr(r(f).before),()=>sr(r(f).after)]),h(Q,$)},Y=Q=>{var $=$1();h(Q,$)};X(ce,Q=>{r(f)?Q(J):Q(Y,-1)})}c(U),c(k),h(b,k)};X(K,b=>{r(n)==="raw"?b(Z):b(z,-1)})}j((b,k)=>{Oe(q,1,b),ke(q,"aria-pressed",r(n)==="summary"),Oe(oe,1,k),ke(oe,"aria-pressed",r(n)==="raw")},[()=>Ue(["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(" ")),()=>Ue(["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(" "))]),_e("click",q,()=>P(n,"summary")),_e("click",oe,()=>P(n,"raw")),Kt(R,()=>r(o),b=>P(o,b)),h(D,L)};X(_,D=>{r(i).length===0?D(A):D(F,-1)})}c(w),h(t,w),$e()}Nt(["click"]);const tx={capability:"diff",renders:L1,component:Yl},nx=new Set(["rid","collection","kind","tenant","created_at","updated_at","body"]);function rx(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 ox(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 Xl(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))nx.has(l.toLowerCase())||(i[l]=u);e.push({rid:String(a.rid??n+1),title:rx(a,s,n),subtitle:ox(a,s),body:s,fields:i,values:a})}return e}function ax(t){return t.capability==="document"?!0:Xl(t).length>0}var ix=S('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No document shape in this result.</div>'),sx=S('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear document filter"><!></button>'),lx=S('· <span class="text-fg-2"> </span>',1),cx=S('<div class="mt-1 truncate text-fg-3"> </div>'),dx=S('<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>'),ux=S('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),fx=S('<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>'),vx=S('<table class="w-full border-collapse"><tbody></tbody></table>'),gx=S('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),px=S('<div class="text-fg-3">No documents match the current filter.</div>'),hx=S('<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),xx=S('<div class="flex h-full flex-col text-fg-1"><!></div>');function bx(t,e){Ze(e,!0);let n=xe("body"),o=xe(""),a=xe(null);const s=C(()=>Xl(e.result)),i=C(()=>{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=C(()=>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=xx(),v=d(f);{var x=w=>{var _=ix();h(w,_)},p=w=>{var _=hx(),A=fe(_),F=d(A),D=d(F),L=d(D);xr(L,{class:"size-3"}),Ce(),c(D);var H=g(D,2),V=d(H);tf(V,{class:"size-3"}),Ce(),c(H);var q=g(H,2),ee=d(q);xr(ee,{class:"size-3"}),Ce(),c(q),c(F);var oe=g(F,2),ae=d(oe);un(ae,{class:"size-3 text-fg-3"});var ne=g(ae,2);Vt(ne);var ve=g(ne,2);{var R=J=>{var Y=sx(),Q=d(Y);Qt(Q,{class:"size-3"}),c(Y),_e("click",Y,()=>P(o,"")),h(J,Y)};X(ve,J=>{r(o)&&J(R)})}c(oe);var y=g(oe,2),M=d(y,!0),m=g(M);{var E=J=>{var Y=gt();j(Q=>T(Y,`of ${Q??""}`),[()=>r(s).length.toLocaleString()]),h(J,Y)};X(m,J=>{r(o)&&J(E)})}var N=g(m,2);{var O=J=>{var Y=lx(),Q=g(fe(Y)),$=d(Q,!0);c(Q),j(()=>T($,e.collection)),h(J,Y)};X(N,J=>{e.collection&&J(O)})}c(y),c(A);var K=g(A,2),Z=d(K);Je(Z,21,()=>r(i),J=>J.rid,(J,Y)=>{var Q=dx(),$=d(Q),se=d($),W=d(se,!0);c(se);var B=g(se,2),ie=d(B);c(B),c($);var re=g($,2);{var te=ge=>{var he=cx(),be=d(he,!0);c(he),j(()=>T(be,r(Y).subtitle)),h(ge,he)};X(re,ge=>{r(Y).subtitle&&ge(te)})}c(Q),j(ge=>{Oe(Q,1,ge),T(W,r(Y).title),T(ie,`#${r(Y).rid??""}`)},[()=>Ue(["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(" "))]),_e("click",Q,()=>P(a,r(Y),!0)),h(J,Q)}),c(Z);var z=g(Z,2),b=d(z);{var k=J=>{var Y=He(),Q=fe(Y);{var $=B=>{var ie=ux(),re=d(ie,!0);c(ie),j(te=>T(re,te),[()=>u(r(l).body)]),h(B,ie)},se=B=>{var ie=vx(),re=d(ie);Je(re,21,()=>Object.entries(r(l).fields),([te,ge])=>te,(te,ge)=>{var he=C(()=>rn(r(ge),2));let be=()=>r(he)[0],Te=()=>r(he)[1];var ye=fx(),pe=d(ye),Me=d(pe,!0);c(pe);var Pe=g(pe),ue=d(Pe),le=d(ue,!0);c(ue),c(Pe),c(ye),j(we=>{T(Me,be()),T(le,we)},[()=>u(Te())]),h(te,ye)}),c(re),c(ie),h(B,ie)},W=B=>{var ie=gx(),re=d(ie,!0);c(ie),j(te=>T(re,te),[()=>u(r(l).values)]),h(B,ie)};X(Q,B=>{r(n)==="body"?B($):r(n)==="fields"?B(se,1):B(W,-1)})}h(J,Y)},I=J=>{var Y=px();h(J,Y)};X(b,J=>{r(l)?J(k):J(I,-1)})}c(z),c(K);var U=g(K,2),ce=d(U);c(U),j((J,Y,Q,$)=>{Oe(D,1,J),ke(D,"aria-pressed",r(n)==="body"),Oe(H,1,Y),ke(H,"aria-pressed",r(n)==="fields"),Oe(q,1,Q),ke(q,"aria-pressed",r(n)==="raw"),T(M,$),T(ce,`${r(s).length??""} documents${e.collection?" · ":""}${e.collection??""??""}`)},[()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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()]),_e("click",D,()=>P(n,"body")),_e("click",H,()=>P(n,"fields")),_e("click",q,()=>P(n,"raw")),Kt(ne,()=>r(o),J=>P(o,J)),h(w,_)};X(v,w=>{r(s).length===0?w(x):w(p,-1)})}c(f),h(t,f),$e()}Nt(["click"]);const mx={capability:"document",renders:ax,component:bx};an.register($g);an.register(Qg);an.register(mp);an.register(qp);an.register(Oh);an.register(v1);an.register(z1);an.register(tx);an.register(mx);an.register(Yp);var _x=S("<!> resume",1),yx=S("<!> pause",1),wx=S('<label class="inline-flex items-center gap-1 cursor-pointer"><input type="checkbox" class="accent-accent size-3"/> <span> </span></label>'),kx=S('<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>'),Sx=S('<div class="p-6 text-[12px] font-mono text-fg-3"><span class="text-accent">error:</span> </div>'),Cx=S('<div class="p-6 text-[12px] font-mono text-fg-3">Not connected. Use the topbar Connect button to open a stream.</div>'),Nx=S('<div class="p-6 text-[12px] font-mono text-fg-3"> </div>'),Ex=S('<span class="text-fg-3 ml-auto"> </span>'),Mx=S('<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>'),zx=S('<ul class="divide-y divide-line-1 font-mono text-[12px]"></ul>'),Tx=S('<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 Gl(t,e){Ze(e,!0);const n=["insert","update","delete"];let o=xe(Ct([])),a=xe(!1),s=xe(Ct({insert:!0,update:!0,delete:!0})),i=xe(null),l=null,u=null;const f=500;function v(){p(),P(i,null),P(o,[],!0);const k=We.client;if(!k){P(i,"No active connection.");return}l=new qu({client:k,sseFactory:null}).subscribe({collection:e.collection}),u=l.events.getReader(),x()}async function x(){if(u)try{for(;;){const{value:k,done:I}=await u.read();if(I)return;r(a)||k&&P(o,[k,...r(o)].slice(0,f),!0)}}catch(k){P(i,k.message,!0)}}function p(){if(u){try{u.cancel()}catch{}u=null}l&&(l.close(),l=null)}It(()=>{We.connected,e.collection,We.connected?v():p()}),ra(p);function w(k){const I=Date.now()-k;return I<1e3?"now":I<6e4?`${Math.floor(I/1e3)}s ago`:I<36e5?`${Math.floor(I/6e4)}m ago`:`${Math.floor(I/36e5)}h ago`}function _(k){return new Date(k).toISOString().replace("T"," ").replace("Z","")}const A=C(()=>r(o).filter(k=>r(s)[k.operation]??!0)),F=C(()=>e.collection?`collection: ${e.collection}`:"global");var D=Tx(),L=d(D),H=d(L);Dr(H,{class:"size-3.5"});var V=g(H,4),q=d(V);c(V);var ee=g(V,2),oe=d(ee),ae=d(oe);{var ne=k=>{var I=_x(),U=fe(I);oa(U,{class:"size-3"}),Ce(),h(k,I)},ve=k=>{var I=yx(),U=fe(I);uf(U,{class:"size-3"}),Ce(),h(k,I)};X(ae,k=>{r(a)?k(ne):k(ve,-1)})}c(oe);var R=g(oe,2),y=d(R);wl(y,{class:"size-3"});var M=g(y,2);Je(M,16,()=>n,k=>k,(k,I)=>{var U=wx(),ce=d(U);Vt(ce);var J=g(ce,2),Y=d(J,!0);c(J),c(U),j(()=>{vl(ce,r(s)[I]),Oe(J,1,Ue(r(s)[I]?"text-fg-1":"text-fg-3")),T(Y,I)}),_e("change",ce,Q=>P(s,{...r(s),[I]:Q.currentTarget.checked},!0)),h(k,U)}),c(R);var m=g(R,2);{var E=k=>{var I=kx(),U=d(I);Qt(U,{class:"size-3"}),Ce(),c(I),_e("click",I,()=>P(o,[],!0)),h(k,I)};X(m,k=>{r(o).length>0&&k(E)})}c(ee),c(L);var N=g(L,2),O=d(N);{var K=k=>{var I=Sx(),U=g(d(I));c(I),j(()=>T(U,` ${r(i)??""}`)),h(k,I)},Z=k=>{var I=Cx();h(k,I)},z=k=>{var I=Nx(),U=d(I,!0);c(I),j(()=>T(U,r(a)?"Paused — no events captured.":"Listening for changes…")),h(k,I)},b=k=>{var I=zx();Je(I,21,()=>r(A),U=>U.lsn,(U,ce)=>{var J=Mx(),Y=d(J),Q=d(Y,!0);c(Y);var $=g(Y,2),se=d($);c($);var W=g($,2),B=d(W,!0);c(W);var ie=g(W,2),re=d(ie,!0);c(ie);var te=g(ie,4),ge=d(te,!0);c(te);var he=g(te,2);{var be=Te=>{var ye=Ex(),pe=d(ye);c(ye),j(()=>T(pe,`rid ${r(ce).rid??""}`)),h(Te,ye)};X(he,Te=>{r(ce).rid!==void 0&&Te(be)})}c(J),j((Te,ye,pe)=>{ke(Y,"title",Te),T(Q,ye),T(se,`lsn ${r(ce).lsn??""}`),Oe(W,1,pe),T(B,r(ce).operation),T(re,r(ce).collection),T(ge,r(ce).kind)},[()=>_(r(ce).timestamp),()=>w(r(ce).timestamp),()=>Ue(["inline-block w-14 text-center text-[10px] uppercase rounded px-1 py-0.5 shrink-0 border",r(ce).operation==="insert"&&"border-ok/40 text-ok",r(ce).operation==="update"&&"border-warn/40 text-warn",r(ce).operation==="delete"&&"border-accent/40 text-accent"].filter(Boolean).join(" "))]),h(U,J)}),c(I),h(k,I)};X(O,k=>{r(i)?k(K):We.connected?r(A).length===0?k(z,2):k(b,-1):k(Z,1)})}c(N),c(D),j(()=>{T(q,`· ${r(F)??""}`),ke(oe,"title",r(a)?"Resume stream":"Pause stream")}),_e("click",oe,()=>P(a,!r(a))),h(t,D),$e()}Nt(["click","change"]);var Px=S('<div class="border-b border-line-1 px-3 py-1.5 font-mono text-[11px] text-warn"> </div>'),Ix=S('<div class="p-4 font-mono text-[12px] text-fg-3">No active RedDB connection.</div>'),Ax=S('<div class="p-4 font-mono text-[12px] text-fg-3">Loading version history…</div>'),Lx=S('<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>'),Ox=S('<div class="flex-1 min-h-0"><!></div>'),Rx=S("<option> </option>"),Dx=S("<option> </option>"),Vx=S('<span class="ml-auto text-fg-3"> </span>'),Hx=S('<div class="p-4 font-mono text-[12px] text-fg-3">Choose two commits to compare this collection.</div>'),Fx=S('<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),qx=S('<div class="p-4 font-mono text-[12px] text-fg-3">No commits yet.</div>'),Kx=S('<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>'),Bx=S('<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>'),jx=S('<div class="flex-1 overflow-auto"><!></div>'),Wx=S('<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 Ux(t,e){Ze(e,!0);let n=xe("commits"),o=xe(null),a=xe(Ct([])),s=xe(""),i=xe(""),l=xe(null),u=xe(!1),f=xe(!1),v=xe(null),x="";const p=C(()=>r(s).length>0&&r(i).length>0&&r(s)!==r(i));function w($){return $.slice(0,10)}function _($){return $?new Date($).toISOString().replace("T"," ").replace("Z",""):"-"}function A($){return{ok:!0,query:`/repo/commits/${$.from}/diff/${$.to}?collection=${e.collection}`,capability:"diff",record_count:$.entries.length,result:{columns:["collection","entity_id","change","before","after"],records:$.entries.map((se,W)=>({values:{id:`${se.collection}:${se.entity_id}:${W}`,collection:se.collection,entity_id:se.entity_id,change:se.change,before:se.before??null,after:se.after??null}}))}}}async function F(){if(e.client){P(u,!0),P(v,null),P(l,null);try{const[$,se]=await Promise.all([e.client.collectionVcs(e.collection),e.client.commits({limit:40})]);P(o,$,!0),P(a,se,!0),se.length>=2?(P(i,se[0].hash,!0),P(s,se[1].hash,!0)):se.length===1?(P(i,se[0].hash,!0),P(s,"")):(P(i,""),P(s,""))}catch($){P(v,$.message,!0)}finally{P(u,!1)}}}async function D(){if(e.client){P(u,!0),P(v,null);try{P(o,await e.client.setCollectionVcs(e.collection,!0),!0),P(a,await e.client.commits({limit:40}),!0)}catch($){P(v,$.message,!0)}finally{P(u,!1)}}}async function L(){if(!(!e.client||!r(p))){P(f,!0),P(v,null);try{P(l,await e.client.commitDiff(r(s),r(i),{collection:e.collection}),!0),P(n,"diff")}catch($){P(v,$.message,!0)}finally{P(f,!1)}}}It(()=>{var se;const $=`${((se=e.client)==null?void 0:se.baseUrl)??"none"}:${e.collection}`;$!==x&&(x=$,F())});var H=Wx(),V=d(H),q=d(V),ee=d(q),oe=d(ee);rf(oe,{class:"size-3"}),Ce(),c(ee);var ae=g(ee,2),ne=d(ae);Ya(ne,{class:"size-3"}),Ce(),c(ae);var ve=g(ae,2),R=d(ve);ff(R,{class:"size-3"}),Ce(),c(ve),c(q);var y=g(q,2),M=d(y,!0);c(y);var m=g(y,2),E=d(m,!0);c(m);var N=g(m,2),O=d(N);{var K=$=>{mn($,{class:"size-3 animate-spin"})},Z=$=>{wi($,{class:"size-3"})};X(O,$=>{r(u)?$(K):$(Z,-1)})}Ce(),c(N),c(V);var z=g(V,2);{var b=$=>{var se=Px(),W=d(se,!0);c(se),j(()=>T(W,r(v))),h($,se)};X(z,$=>{r(v)&&$(b)})}var k=g(z,2);{var I=$=>{var se=Ix();h($,se)},U=$=>{var se=Ax();h($,se)},ce=$=>{var se=Lx(),W=g(d(se),2),B=d(W);xf(B,{class:"size-3"}),Ce(),c(W),c(se),_e("click",W,()=>void D()),h($,se)},J=$=>{var se=Ox(),W=d(se);Gl(W,{get collection(){return e.collection}}),c(se),h($,se)},Y=$=>{var se=Fx(),W=fe(se),B=d(W),ie=g(d(B),2),re=d(ie);re.value=re.__value="";var te=g(re);Je(te,17,()=>r(a),me=>me.hash,(me,Ee)=>{var Ae=Rx(),Ke=d(Ae);c(Ae);var at={};j(Be=>{T(Ke,`${Be??""} · ${r(Ee).message??""}`),at!==(at=r(Ee).hash)&&(Ae.value=(Ae.__value=r(Ee).hash)??"")},[()=>w(r(Ee).hash)]),h(me,Ae)}),c(ie),c(B);var ge=g(B,2),he=g(d(ge),2),be=d(he);be.value=be.__value="";var Te=g(be);Je(Te,17,()=>r(a),me=>me.hash,(me,Ee)=>{var Ae=Dx(),Ke=d(Ae);c(Ae);var at={};j(Be=>{T(Ke,`${Be??""} · ${r(Ee).message??""}`),at!==(at=r(Ee).hash)&&(Ae.value=(Ae.__value=r(Ee).hash)??"")},[()=>w(r(Ee).hash)]),h(me,Ae)}),c(he),c(ge);var ye=g(ge,2),pe=d(ye);{var Me=me=>{mn(me,{class:"size-3 animate-spin"})},Pe=me=>{Ya(me,{class:"size-3"})};X(pe,me=>{r(f)?me(Me):me(Pe,-1)})}Ce(),c(ye);var ue=g(ye,2);{var le=me=>{var Ee=Vx(),Ae=d(Ee);c(Ee),j(()=>T(Ae,`+${r(l).added??""} -${r(l).removed??""} ~${r(l).modified??""}`)),h(me,Ee)};X(ue,me=>{r(l)&&me(le)})}c(W);var we=g(W,2),Ne=d(we);{var Se=me=>{{let Ee=C(()=>A(r(l)));Yl(me,{get result(){return r(Ee)},get collection(){return e.collection}})}},ze=me=>{var Ee=Hx();h(me,Ee)};X(Ne,me=>{r(l)?me(Se):me(ze,-1)})}c(we),j(()=>ye.disabled=!r(p)||r(f)),Ba(ie,()=>r(s),me=>P(s,me)),Ba(he,()=>r(i),me=>P(i,me)),_e("click",ye,()=>void L()),h($,se)},Q=$=>{var se=jx(),W=d(se);{var B=re=>{var te=qx();h(re,te)},ie=re=>{var te=Bx(),ge=g(d(te));Je(ge,21,()=>r(a),he=>he.hash,(he,be)=>{var Te=Kx(),ye=d(Te),pe=d(ye,!0);c(ye);var Me=g(ye),Pe=d(Me,!0);c(Me);var ue=g(Me),le=d(ue,!0);c(ue);var we=g(ue),Ne=d(we,!0);c(we),c(Te),j((Se,ze)=>{var me;T(pe,Se),T(Pe,r(be).message),T(le,((me=r(be).author)==null?void 0:me.name)??"-"),T(Ne,ze)},[()=>w(r(be).hash),()=>_(r(be).timestamp_ms)]),h(he,Te)}),c(ge),c(te),h(re,te)};X(W,re=>{r(a).length===0?re(B):re(ie,-1)})}c(se),h($,se)};X(k,$=>{e.client?r(u)&&!r(o)?$(U,1):r(o)&&!r(o).versioned?$(ce,2):r(n)==="live"?$(J,3):r(n)==="diff"?$(Y,4):$(Q,-1):$(I)})}c(H),j(($,se,W)=>{var B,ie;Oe(ee,1,$),Oe(ae,1,se),Oe(ve,1,W),Oe(y,1,Ue((B=r(o))!=null&&B.versioned?"text-ok":"text-fg-3")),T(M,(ie=r(o))!=null&&ie.versioned?"versioned":"not versioned"),T(E,e.collection),N.disabled=r(u)},[()=>Ue(["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(" ")),()=>Ue(["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(" ")),()=>Ue(["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(" "))]),_e("click",ee,()=>P(n,"commits")),_e("click",ae,()=>P(n,"diff")),_e("click",ve,()=>P(n,"live")),_e("click",N,()=>void F()),h(t,H),$e()}Nt(["click"]);var Yx=S('<span class="text-fg-3">·</span> <span class="text-fg-2 font-mono text-[11px] truncate max-w-[280px]"> </span>',1),Xx=S('<span class="text-warn font-mono text-[11px]">disconnected</span>'),Gx=S("<!> <span>Running…</span>",1),Zx=S("<!> <span>Run</span>",1),$x=S('<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>'),Qx=S('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Running…</div>'),Jx=S('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Run a query to see results here.</div>'),eb=S('<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>'),tb=S("<!> <!>",1),nb=S('<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 rb(t,e){Ze(e,!0),It(()=>{nn.ensure(e.tabId)});const n=C(()=>nn.states[e.tabId]),o=C(()=>_t.tabs.find(E=>E.id===e.tabId));let a=xe(void 0);function s(E){nn.setSql(e.tabId,E);const N=cg(E,e.fallbackLabel),O=_t.tabs.find(K=>K.id===e.tabId);O&&O.label!==N&&_t.rename(e.tabId,N)}async function i(){await nn.run(e.tabId)}function l(E){(E.metaKey||E.ctrlKey)&&E.key==="Enter"&&(E.preventDefault(),i())}function u(){var E,N;return(E=r(n))!=null&&E.result?an.pick(r(n).result.capability,r(n).result,(N=r(o))==null?void 0:N.overrideCapability):null}var f=nb(),v=d(f),x=d(v),p=d(x),w=g(d(p),2);{var _=E=>{var N=Yx(),O=g(fe(N),2),K=d(O,!0);c(O),j(()=>T(K,We.active.url)),h(E,N)},A=E=>{var N=Xx();h(E,N)};X(w,E=>{We.connected?E(_):E(A,-1)})}c(p);var F=g(p,2),D=d(F),L=g(d(D));Gt(L,{children:(E,N)=>{Ce();var O=gt("⌘");h(E,O)}});var H=g(L);Gt(H,{children:(E,N)=>{Ce();var O=gt("↵");h(E,O)}}),c(D);var V=g(D,2),q=d(V);{var ee=E=>{var N=Gx(),O=fe(N);mn(O,{class:"size-3.5 animate-spin"}),Ce(2),h(E,N)},oe=E=>{var N=Zx(),O=fe(N);oa(O,{class:"size-3.5"}),Ce(2),h(E,N)};X(q,E=>{var N;(N=r(n))!=null&&N.running?E(ee):E(oe,-1)})}c(V),c(F),c(x);var ae=g(x,2);dl(ae),ke(ae,"placeholder","SELECT * FROM users LIMIT 100"),on(ae,E=>P(a,E),()=>r(a)),c(v);var ne=g(v,2),ve=d(ne);{var R=E=>{var N=$x(),O=g(d(N),2),K=d(O,!0);c(O),c(N),j(()=>T(K,r(n).error)),h(E,N)},y=E=>{var N=Qx();h(E,N)},M=E=>{var N=Jx();h(E,N)},m=E=>{const N=C(u);var O=tb(),K=fe(O);{var Z=k=>{var I=eb(),U=d(I);Ce(2),c(I),j(ce=>T(U,`Streamed first ${ce??""} rows — more remain on the server. Add a `),[()=>r(n).result.record_count.toLocaleString()]),h(k,I)};X(K,k=>{r(n).result.truncated&&k(Z)})}var z=g(K,2);{var b=k=>{const I=C(()=>r(N).component);var U=He(),ce=fe(U);{let J=C(()=>{var Y;return((Y=r(o))==null?void 0:Y.showSystemColumns)??!1});Gn(ce,()=>r(I),(Y,Q)=>{Q(Y,{get result(){return r(n).result},get showSystem(){return r(J)}})})}h(k,U)};X(z,k=>{r(N)&&k(b)})}h(E,O)};X(ve,E=>{var N,O,K;(N=r(n))!=null&&N.error?E(R):(O=r(n))!=null&&O.running&&!r(n).result?E(y,1):(K=r(n))!=null&&K.result?E(m,-1):E(M,2)})}c(ne),c(f),j(()=>{var E,N;V.disabled=((E=r(n))==null?void 0:E.running)||!We.connected,Bd(ae,((N=r(n))==null?void 0:N.sql)??"")}),_e("click",V,i),_e("input",ae,E=>s(E.currentTarget.value)),_e("keydown",ae,l),h(t,f),$e()}Nt(["click","input","keydown"]);var ob=S('<div class="px-3 py-2 flex items-center gap-2 text-fg-3"><!> <span class="type-label">Results</span></div>'),ab=S('<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>'),ib=S('<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>'),sb=S('<div class="flex items-stretch overflow-x-auto"></div>'),lb=S('<button type="button"><!> <span>history</span></button>'),cb=S('<button type="button"><!> <span>meta</span></button> <!>',1),db=S("<option> </option>"),ub=S('<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>'),fb=S('<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>'),vb=S('<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>'),gb=S(`<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
|
|
972
|
-
collections and running queries.</p></div>`),pb=S('<div class="h-full grid place-items-center p-6"><!></div>'),hb=S('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Workspace</div>'),xb=S('<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>'),bb=S('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono"> </div>'),mb=S('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Catalog metadata unavailable.</span> <span class="truncate"> </span></div>'),_b=S('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Loading collection catalog…</span></div>'),yb=S('<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>'),wb=S('<span class="font-mono text-[10px] text-fg-3">No type-specific catalog fields.</span>'),kb=S('<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>'),Sb=S('<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>'),Cb=S('<div class="text-fg-3">Loading metadata…</div>'),Nb=S('<span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span>'),Eb=S('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),Mb=S('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),zb=S('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2">retention</span>'),Tb=S("<span> </span>"),Pb=S('<div class="mt-1 flex flex-wrap gap-1"></div>'),Ib=S('<div class="mt-1 text-fg-3">Action grants not exposed.</div>'),Ab=S('<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>'),Lb=S('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-2 text-[11px] font-mono"><!></div>'),Ob=S('<div class="h-[320px] min-h-[240px] border-b border-line-1"><!></div>'),Rb=S('<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>'),Db=S('<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 Vb(t,e){Ze(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=Ct({}),s=Ct({}),i=Ct({}),l=Ct({}),u=Ct({}),f=Ct({}),v=Ct({}),x=xe(Ct({})),p=xe(null),w=null,_=xe(!1),A=xe(!1);It(()=>{const W=_t.activeId;W!==w&&(P(p,w,!0),w=W)});async function F(W,B){const[he,be]=await Promise.all([Mt.track(`${B} · edges (LIMIT 50000)`,()=>W.query(`SELECT * FROM ${B} WHERE from_rid IS NOT NULL LIMIT 50000`)),Mt.track(`${B} · centrality (LIMIT 100)`,()=>W.query("GRAPH CENTRALITY LIMIT 100")).catch(()=>null)]),Te=new Map;be!=null&&be.ok&&be.result.records.forEach((Se,ze)=>{const me=Se.values.node_id??Se.values.rid??Se.values.id,Ee=Se.values.score??Se.values.centrality_score??Se.values.centrality,Ae=typeof me=="number"?me:typeof me=="string"?Number(me):NaN,Ke=typeof Ee=="number"?Ee:typeof Ee=="string"?Number(Ee):NaN;!Number.isFinite(Ae)||!Number.isFinite(Ke)||Te.set(Ae,{score:Ke,rank:ze+1,label:typeof Se.values.label=="string"?Se.values.label:void 0})});const ye=new Set;for(const Se of he.result.records){const ze=Se.values.from_rid,me=Se.values.to_rid;typeof ze=="number"&&ye.add(ze),typeof me=="number"&&ye.add(me)}for(const Se of Te.keys())ye.add(Se);const pe=[...ye],Me=Math.ceil(pe.length/5),Pe=[];for(let Se=0;Se<pe.length;Se+=5)Pe.push({idx:Math.floor(Se/5)+1,ids:pe.slice(Se,Se+5).join(",")});const ue=[];let le=he,we=0;async function Ne(){for(;we<Pe.length;){const Se=Pe[we++],ze=await Mt.track(`${B} · nodes ${Se.idx}/${Me}`,()=>W.query(`SELECT * FROM ${B} WHERE rid IN (${Se.ids})`));ue.push(...ze.result.records.map(me=>{const Ee=me.values.rid,Ae=typeof Ee=="number"?Te.get(Ee):void 0;return Ae?{...me,values:{...me.values,centrality_score:Ae.score,centrality_rank:Ae.rank,centrality_label:Ae.label}}:me})),le=ze}}return await Promise.all(Array.from({length:8},Ne)),{...le,record_count:ue.length+he.result.records.length,result:{...le.result,records:[...ue,...he.result.records]}}}function D(W){return W.replace(/[^A-Za-z0-9_./-]/g,"")}function L(W){return`'${W.replace(/'/g,"''")}'`}async function H(W,B){const ie=await W.query(ug(B)),re=vg(ie.result.records[0]);if(!re)throw new Error(`${B} was not found in red.collections`);return re}async function V(W,B){var ie;try{const te=(ie=(await W.query(`SELECT model FROM red.collections WHERE name = ${L(B)} LIMIT 1`)).result.records[0])==null?void 0:ie.values.model;return typeof te=="string"?te:null}catch{return null}}async function q(W,B){const ie=D(B),re=await V(W,B);if(re==="hll")return W.query(`HLL INFO ${ie}`);if(re==="sketch")return W.query(`SKETCH INFO ${ie}`);if(re==="filter")return W.query(`FILTER INFO ${ie}`);if(re==="mixed")for(const te of[`HLL INFO ${ie}`,`SKETCH INFO ${ie}`,`FILTER INFO ${ie}`])try{return await W.query(te)}catch{}try{return await W.query(`SELECT * FROM ${ie} LIMIT 200`)}catch{for(const te of[`HLL INFO ${ie}`,`SKETCH INFO ${ie}`,`FILTER INFO ${ie}`])try{return await W.query(te)}catch{}throw new Error(`No stats read form worked for ${B}`)}}async function ee(W,B){const ie=D(B),re=await W.query(`SELECT * FROM ${ie} LIMIT 200`);return{...re,capability:re.capability??"vector"}}It(()=>{if(Ot.locked)return;const W=We.client;if(W)for(const B of _t.tabs){if(B.kind!=="collection")continue;const ie=B.subpage??Ar(B.capability),re=ie==="graph"||ie==="svg",te=ie==="queue"||B.capability==="queue",ge=ie==="vector"||B.capability==="vector",he=ie==="stats"||B.capability==="stats",be=re?"graph-subgraph":te?"queue-peek":ge?"vector-inspector":he?"stats-info":B.capability??"unknown",Te=`${B.key}:${ie}:${be}`;if(i[B.id]&&i[B.id]!==Te&&(delete a[B.id],delete s[B.id]),a[B.id]!==void 0||s[B.id])continue;a[B.id]=null,i[B.id]=Te;const ye=B.key;(re?F(W,ye):te?Mt.track(`${ye} · QUEUE PEEK (LIMIT 200)`,()=>W.query(`QUEUE PEEK ${ye} 200`)):ge?Mt.track(`${ye} · vector inspector seed`,()=>ee(W,ye)):he?Mt.track(`${ye} · stats preview`,()=>q(W,ye)):Mt.track(`${ye} · SELECT * (LIMIT 200)`,()=>W.query(`SELECT * FROM ${ye} LIMIT 200`))).then(Me=>{a[B.id]=Me}).catch(Me=>{s[B.id]=Me.message})}}),It(()=>{if(Ot.locked)return;const W=We.client;if(W)for(const B of _t.tabs)B.kind==="collection"&&(l[B.id]!==void 0||u[B.id]||(l[B.id]=null,Mt.track(`catalog · ${B.key}`,()=>H(W,B.key)).then(ie=>{l[B.id]=ie}).catch(ie=>{u[B.id]=ie.message})))}),It(()=>{if(!r(A)||Ot.locked)return;const W=We.client;if(W)for(const B of _t.tabs)B.kind==="collection"&&(f[B.id]!==void 0||v[B.id]||(f[B.id]=null,Mt.track(`metadata · ${B.key}`,()=>W.collection(B.key)).then(ie=>{f[B.id]=ie}).catch(ie=>{v[B.id]=ie.message})))});function oe(W,B){W.stopPropagation();const ie=_t.tabs.find(te=>te.id===B);if((ie==null?void 0:ie.kind)==="query"&&nn.isDirty(B)&&!(typeof window<"u"?window.confirm("Discard unsaved query in this tab?"):!0))return;const re=(ie==null?void 0:ie.kind)==="collection"&&ie.key===n.collection;if(_t.close(B,r(p)),nn.remove(B),delete a[B],delete s[B],delete i[B],delete l[B],delete u[B],delete f[B],delete v[B],delete r(x)[B],re){const te=_t.tabs.find(ge=>ge.kind==="collection");n.go(te?{view:"collection",collection:te.key,subpage:te.subpage??Ar(te.capability)}:{view:"collections"},void 0,!0)}}function ae(){const W=nn.nextLabel(),B=_t.open({kind:"query",label:W,key:W},!0);nn.ensure(B.id),P(_,!1)}On(()=>{const W=()=>ae();return window.addEventListener("red:new-query",W),()=>window.removeEventListener("red:new-query",W)});function ne(W,B){const ie=jd(W.subpage,W.capability??B.capability);return an.pick(ie,B,W.overrideCapability)}function ve(){_t.open({kind:"live-changes",label:"live · global",key:"global"}),P(_,!1)}function R(W,B){const ie=B.currentTarget.value;_t.setOverride(W.id,ie===""?void 0:ie)}function y(W,B){return W.subpage?W.subpage:W.capability?W.capability:B!=null&&B.capability?B.capability:"auto"}function M(W){return typeof W=="boolean"?{allowed:W}:{allowed:W.allowed,reason:W.reason}}function m(W){return W&&typeof W=="object"&&!Array.isArray(W)?Object.keys(W):[]}var E=Db(),N=d(E),O=d(N);{var K=W=>{var B=ob(),ie=d(B);Dr(ie,{class:"size-3.5"}),Ce(2),c(B),h(W,B)},Z=W=>{var B=sb();Je(B,21,()=>_t.tabs,ie=>ie.id,(ie,re)=>{const te=C(()=>r(re).id===_t.activeId),ge=C(()=>["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 he=He(),be=fe(he);{var Te=pe=>{const Me=C(()=>({view:"collection",collection:r(re).key,subpage:r(re).subpage??Ar(r(re).capability)}));var Pe=ab(),ue=d(Pe),le=d(ue,!0);c(ue);var we=g(ue,2),Ne=d(we);Qt(Ne,{class:"size-3"}),c(we),c(Pe),j(Se=>{ke(Pe,"href",Se),Oe(Pe,1,Ue(r(ge))),ke(Pe,"title",r(re).label),T(le,r(re).label)},[()=>n.href(r(Me))]),_e("click",Pe,Se=>n.go(r(Me),Se)),_e("click",we,Se=>oe(Se,r(re).id)),_e("keydown",we,Se=>{Se.key==="Enter"&&oe(Se,r(re).id)}),h(pe,Pe)},ye=pe=>{var Me=ib(),Pe=d(Me),ue=d(Pe,!0);c(Pe);var le=g(Pe,2),we=d(le);Qt(we,{class:"size-3"}),c(le),c(Me),j(()=>{Oe(Me,1,Ue(r(ge))),ke(Me,"title",r(re).label),T(ue,r(re).label)}),_e("click",Me,()=>_t.focus(r(re).id)),_e("click",le,Ne=>oe(Ne,r(re).id)),_e("keydown",le,Ne=>{Ne.key==="Enter"&&oe(Ne,r(re).id)}),h(pe,Me)};X(be,pe=>{r(re).kind==="collection"?pe(Te):pe(ye,-1)})}h(ie,he)}),c(B),h(W,B)};X(O,W=>{_t.tabs.length===0?W(K):W(Z,-1)})}var z=g(O,2);{var b=W=>{const B=C(()=>_t.active),ie=C(()=>a[r(B).id]);var re=ub(),te=d(re);{var ge=le=>{var we=cb(),Ne=fe(we),Se=d(Ne);ba(Se,{class:"size-3"}),Ce(2),c(Ne);var ze=g(Ne,2);{var me=Ee=>{var Ae=lb(),Ke=d(Ae);nf(Ke,{class:"size-3"}),Ce(2),c(Ae),j(at=>{ke(Ae,"title",r(x)[r(B).id]?"Hide version history":"Show version history and diffs"),ke(Ae,"aria-pressed",r(x)[r(B).id]??!1),Oe(Ae,1,at)},[()=>Ue(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(x)[r(B).id]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),_e("click",Ae,()=>P(x,{...r(x),[r(B).id]:!(r(x)[r(B).id]??!1)},!0)),h(Ee,Ae)};X(ze,Ee=>{We.capabilities.vcs&&Ee(me)})}j(Ee=>{ke(Ne,"title",r(A)?"Hide collection metadata":"Show collection metadata"),ke(Ne,"aria-pressed",r(A)),Oe(Ne,1,Ee)},[()=>Ue(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(A)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),_e("click",Ne,()=>P(A,!r(A))),h(le,we)};X(te,le=>{r(B).kind==="collection"&&le(ge)})}var he=g(te,2),be=d(he);{var Te=le=>{Ju(le,{class:"size-3"})},ye=le=>{Qu(le,{class:"size-3"})};X(be,le=>{r(B).showSystemColumns?le(Te):le(ye,-1)})}Ce(2),c(he);var pe=g(he,2),Me=d(pe,!0);c(pe);var Pe=g(pe,4);Je(Pe,21,()=>o,le=>le.value,(le,we)=>{var Ne=db(),Se=d(Ne,!0);c(Ne);var ze={};j(()=>{T(Se,r(we).label),ze!==(ze=r(we).value)&&(Ne.value=(Ne.__value=r(we).value)??"")}),h(le,Ne)}),c(Pe);var ue;hi(Pe),c(re),j((le,we)=>{ke(he,"title",r(B).showSystemColumns?"Hide reddb system columns (rid, collection, kind, tenant, created_at, updated_at)":"Show reddb system columns"),ke(he,"aria-pressed",r(B).showSystemColumns??!1),Oe(he,1,le),T(Me,we),ue!==(ue=r(B).overrideCapability??"")&&(Pe.value=(Pe.__value=r(B).overrideCapability??"")??"",xi(Pe,r(B).overrideCapability??""))},[()=>Ue(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(B).showSystemColumns?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>y(r(B),r(ie))]),_e("click",he,()=>_t.setShowSystem(r(B).id,!r(B).showSystemColumns)),_e("change",Pe,le=>R(r(B),le)),h(W,re)};X(z,W=>{_t.active&&(_t.active.kind==="collection"||_t.active.kind==="query")&&W(b)})}var k=g(z,2),I=d(k),U=d(I);Sl(U,{class:"size-3.5"}),c(I);var ce=g(I,2);{var J=W=>{var B=fb(),ie=d(B),re=d(ie);yl(re,{class:"size-3.5 text-fg-3"}),Ce(4),c(ie);var te=g(ie,2);c(B),_e("click",ie,ae),_e("click",te,ve),h(W,B)};X(ce,W=>{r(_)&&W(J)})}c(k),c(N);var Y=g(N,2),Q=d(Y);{var $=W=>{var B=pb(),ie=d(B);{var re=ge=>{var he=vb(),be=g(d(he)),Te=d(be,!0);c(be),Ce(3),c(he),j(()=>T(Te,We.active.url)),h(ge,he)},te=ge=>{var he=gb(),be=d(he);Vr(be,{class:"size-8 text-fg-3 mx-auto mb-3",strokeWidth:1.4}),Ce(4),c(he),h(ge,he)};X(ie,ge=>{We.connected?ge(re):ge(te,-1)})}c(B),h(W,B)},se=W=>{const B=C(()=>_t.active);var ie=He(),re=fe(ie);{var te=Te=>{Gl(Te,{collection:void 0})},ge=Te=>{rb(Te,{get tabId(){return r(B).id},get fallbackLabel(){return r(B).key}})},he=Te=>{var ye=hb();h(Te,ye)},be=Te=>{const ye=C(()=>a[r(B).id]),pe=C(()=>s[r(B).id]);var Me=He(),Pe=fe(Me);{var ue=Ne=>{var Se=xb(),ze=g(d(Se),2),me=d(ze,!0);c(ze),c(Se),j(()=>T(me,r(pe))),h(Ne,Se)},le=Ne=>{var Se=bb(),ze=d(Se);c(Se),j(()=>T(ze,`Loading ${r(B).label??""}…`)),h(Ne,Se)},we=Ne=>{const Se=C(()=>ne(r(B),r(ye))),ze=C(()=>r(Se).component),me=C(()=>l[r(B).id]),Ee=C(()=>u[r(B).id]);var Ae=Rb(),Ke=d(Ae),at=d(Ke);{var Be=De=>{var Le=mb(),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(()=>T(lt,r(Ee))),h(De,Le)},Qe=De=>{var Le=_b(),je=d(Le);Vr(je,{class:"size-3.5"}),Ce(2),c(Le),h(De,Le)},dt=De=>{var Le=kb(),je=d(Le),Ye=d(je),lt=d(Ye),ct=d(lt,!0);c(lt);var pt=g(lt,2),it=d(pt,!0);c(pt),c(Ye);var Xe=g(Ye,2),tt=d(Xe);Je(tt,17,()=>cs(r(me)),qt,(yt,zt)=>{var Ft=yb(),ln=d(Ft,!0);c(Ft),j(()=>T(ln,r(zt))),h(yt,Ft)});var st=g(tt,2);{var ut=yt=>{var zt=wb();h(yt,zt)},ht=C(()=>cs(r(me)).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),Ce(2),c(Tt);var Pt=g(Tt,2),Rt=d(Pt);of(Rt,{class:"size-3.5 text-fg-3"});var Ht=g(Rt,2),Bt=d(Ht,!0);c(Ht),Ce(2),c(Pt);var Wt=g(Pt,2),sn=d(Wt);Dr(sn,{class:"size-3.5 text-fg-3"});var gn=g(sn,2),pn=d(gn,!0);c(gn),Ce(2),c(Wt);var Tn=g(Wt,2),Vn=d(Tn);Wd(Vn,{class:"size-3.5 text-fg-3"});var Hn=g(Vn,2),Cr=d(Hn,!0);c(Hn),Ce(2),c(Tn);var Pn=g(Tn,2),Fn=d(Pn);gf(Fn,{class:"size-3.5 text-fg-3"});var qn=g(Fn,2),or=d(qn,!0);c(qn),Ce(2),c(Pn),c(xt),c(Le),j((yt,zt,Ft,ln,In)=>{T(ct,r(me).model??"collection"),T(it,r(me).name),T(Et,yt),T(Bt,zt),T(pn,Ft),T(Cr,ln),T(or,In)},[()=>Po(r(me).entities),()=>ls(r(me).onDiskBytes),()=>ls(r(me).inMemoryBytes),()=>Po(r(me).segments),()=>Po(r(me).indices)]),h(De,Le)};X(at,De=>{r(Ee)?De(Be):r(me)?De(dt,-1):De(Qe,1)})}c(Ke);var vt=g(Ke,2);{var Ge=De=>{const Le=C(()=>f[r(B).id]),je=C(()=>v[r(B).id]);var Ye=Lb(),lt=d(Ye);{var ct=Xe=>{var tt=Sb(),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(()=>T(xt,r(je))),h(Xe,tt)},pt=Xe=>{var tt=Cb();h(Xe,tt)},it=Xe=>{var tt=Ab(),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 Wt=yt=>{var zt=Nb(),Ft=d(zt,!0);c(zt),j(()=>T(Ft,r(Le).capability)),h(yt,zt)};X(Bt,yt=>{r(Le).capability&&yt(Wt)})}var sn=g(Bt,2);Je(sn,17,()=>r(Le).capabilities??[],qt,(yt,zt)=>{var Ft=Eb(),ln=d(Ft,!0);c(Ft),j(()=>T(ln,r(zt))),h(yt,Ft)});var gn=g(sn,2);{var pn=yt=>{var zt=Mb(),Ft=d(zt);c(zt),j(ln=>T(Ft,`schema ${ln??""}`),[()=>m(r(Le).schema).length]),h(yt,zt)},Tn=C(()=>m(r(Le).schema).length>0);X(gn,yt=>{r(Tn)&&yt(pn)})}var Vn=g(gn,2);{var Hn=yt=>{var zt=zb();h(yt,zt)},Cr=C(()=>m(r(Le).retention).length>0);X(Vn,yt=>{r(Cr)&&yt(Hn)})}c(Ht);var Pn=g(Ht,2);{var Fn=yt=>{var zt=Pb();Je(zt,21,()=>Object.entries(r(Le).actions),qt,(Ft,ln)=>{var In=C(()=>rn(r(ln),2));let lo=()=>r(In)[0],co=()=>r(In)[1];const ar=C(()=>M(co()));var Kn=Tb(),Nr=d(Kn);c(Kn),j(uo=>{Oe(Kn,1,uo),ke(Kn,"title",r(ar).reason),T(Nr,`${lo()??""}: ${r(ar).allowed?"allow":"deny"}`)},[()=>Ue(["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(Ft,Kn)}),c(zt),h(yt,zt)},qn=C(()=>r(Le).actions&&m(r(Le).actions).length>0),or=yt=>{var zt=Ib();h(yt,zt)};X(Pn,yt=>{r(qn)?yt(Fn):yt(or,-1)})}c(Rt),c(tt),j(()=>{var yt;T(ht,r(Le).name??r(B).key),T(Tt,r(Le).kind??r(Le).capability??r(B).capability??"unknown"),T(mt,r(Le).tenant??"not exposed"),T(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(pt,1)})}c(Ye),h(De,Ye)};X(vt,De=>{r(A)&&De(Ge)})}var Re=g(vt,2);{var Ie=De=>{var Le=Ob(),je=d(Le);{let Ye=C(()=>We.client??void 0);Ux(je,{get client(){return r(Ye)},get collection(){return r(B).key}})}c(Le),h(De,Le)};X(Re,De=>{r(x)[r(B).id]&&De(Ie)})}var qe=g(Re,2),G=d(qe);{let De=C(()=>r(B).kind==="collection"?r(B).key:void 0),Le=C(()=>We.client??void 0),je=C(()=>r(B).kind==="collection"?r(B).subpage:void 0),Ye=C(()=>r(B).showSystemColumns??!1);Gn(G,()=>r(ze),(lt,ct)=>{ct(lt,{get result(){return r(ye)},get collection(){return r(De)},get client(){return r(Le)},get subpage(){return r(je)},get showSystem(){return r(Ye)}})})}c(qe),c(Ae),h(Ne,Ae)};X(Pe,Ne=>{r(pe)?Ne(ue):r(ye)?Ne(we,-1):Ne(le,1)})}h(Te,Me)};X(re,Te=>{r(B).kind==="live-changes"?Te(te):r(B).kind==="query"?Te(ge,1):r(B).kind==="welcome"?Te(he,2):Te(be,-1)})}h(W,ie)};X(Q,W=>{_t.active?W(se,-1):W($)})}c(Y),c(E),j(()=>Oe(k,1,`relative ${_t.active&&(_t.active.kind==="collection"||_t.active.kind==="query")?"":"ml-auto"} flex items-stretch`)),_e("click",I,()=>P(_,!r(_))),h(t,E),$e()}Nt(["click","keydown","change"]);var Hb=S('<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=Hb(),n=d(e),o=d(n);og(o,{}),c(n);var a=g(n,2),s=d(a);Vb(s,{}),c(a),c(e),h(t,e)}var qb={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 Kb(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=Kb(t+"",n),a,s=-1,i=o.length;if(arguments.length<2){for(;++s<i;)if((a=(t=o[s]).type)&&(a=Bb(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]=_s(n[a],t.name,e);else if(e==null)for(a in n)n[a]=_s(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 Bb(t,e){for(var n=0,o=t.length,a;n<o;++n)if((a=t[n]).name===e)return a.value}function _s(t,e,n){for(var o=0,a=t.length;o<a;++o)if(t[o].name===e){t[o]=qb,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 ys={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)),ys.hasOwnProperty(e)?{space:ys[e],local:t}:t}function jb(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:jb)(e)}function Ub(){}function Si(t){return t==null?Ub:function(){return this.querySelector(t)}}function Yb(t){typeof t!="function"&&(t=Si(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 en(o,this._parents)}function Xb(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Gb(){return[]}function $l(t){return t==null?Gb:function(){return this.querySelectorAll(t)}}function Zb(t){return function(){return Xb(t.apply(this,arguments))}}function $b(t){typeof t=="function"?t=Zb(t):t=$l(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 en(o,a)}function Ql(t){return function(){return this.matches(t)}}function Jl(t){return function(e){return e.matches(t)}}var Qb=Array.prototype.find;function Jb(t){return function(){return Qb.call(this.children,t)}}function em(){return this.firstElementChild}function tm(t){return this.select(t==null?em:Jb(typeof t=="function"?t:Jl(t)))}var nm=Array.prototype.filter;function rm(){return Array.from(this.children)}function om(t){return function(){return nm.call(this.children,t)}}function am(t){return this.selectAll(t==null?rm:om(typeof t=="function"?t:Jl(t)))}function im(t){typeof t!="function"&&(t=Ql(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 en(o,this._parents)}function ec(t){return new Array(t.length)}function sm(){return new en(this._enter||this._groups.map(ec),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 lm(t){return function(){return t}}function cm(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 dm(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 um(t){return t.__data__}function fm(t,e){if(!arguments.length)return Array.from(this,um);var n=e?dm:cm,o=this._parents,a=this._groups;typeof t!="function"&&(t=lm(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=vm(t.call(v,v&&v.__data__,f,o)),_=w.length,A=l[f]=new Array(_),F=i[f]=new Array(_),D=u[f]=new Array(p);n(v,x,A,F,D,w,e);for(var L=0,H=0,V,q;L<_;++L)if(V=A[L]){for(L>=H&&(H=L+1);!(q=F[H])&&++H<_;);V._next=q||null}}return i=new en(i,o),i._enter=l,i._exit=u,i}function vm(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function gm(){return new en(this._exit||this._groups.map(ec),this._parents)}function pm(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 hm(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 en(l,this._parents)}function xm(){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 bm(t){t||(t=mm);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 en(a,this._parents).order()}function mm(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function _m(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ym(){return Array.from(this)}function wm(){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 km(){let t=0;for(const e of this)++t;return t}function Sm(){return!this.node()}function Cm(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 Nm(t){return function(){this.removeAttribute(t)}}function Em(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Mm(t,e){return function(){this.setAttribute(t,e)}}function zm(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Tm(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Pm(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 Im(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?Em:Nm:typeof e=="function"?n.local?Pm:Tm:n.local?zm:Mm)(n,e))}function tc(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Am(t){return function(){this.style.removeProperty(t)}}function Lm(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Om(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Rm(t,e,n){return arguments.length>1?this.each((e==null?Am:typeof e=="function"?Om:Lm)(t,e,n??"")):br(this.node(),t)}function br(t,e){return t.style.getPropertyValue(e)||tc(t).getComputedStyle(t,null).getPropertyValue(e)}function Dm(t){return function(){delete this[t]}}function Vm(t,e){return function(){this[t]=e}}function Hm(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?Dm:typeof e=="function"?Hm:Vm)(t,e)):this.node()[t]}function nc(t){return t.trim().split(/^|\s+/)}function Ci(t){return t.classList||new rc(t)}function rc(t){this._node=t,this._names=nc(t.getAttribute("class")||"")}rc.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 oc(t,e){for(var n=Ci(t),o=-1,a=e.length;++o<a;)n.add(e[o])}function ac(t,e){for(var n=Ci(t),o=-1,a=e.length;++o<a;)n.remove(e[o])}function qm(t){return function(){oc(this,t)}}function Km(t){return function(){ac(this,t)}}function Bm(t,e){return function(){(e.apply(this,arguments)?oc:ac)(this,t)}}function jm(t,e){var n=nc(t+"");if(arguments.length<2){for(var o=Ci(this.node()),a=-1,s=n.length;++a<s;)if(!o.contains(n[a]))return!1;return!0}return this.each((typeof e=="function"?Bm:e?qm:Km)(n,e))}function Wm(){this.textContent=""}function Um(t){return function(){this.textContent=t}}function Ym(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Xm(t){return arguments.length?this.each(t==null?Wm:(typeof t=="function"?Ym:Um)(t)):this.node().textContent}function Gm(){this.innerHTML=""}function Zm(t){return function(){this.innerHTML=t}}function $m(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Qm(t){return arguments.length?this.each(t==null?Gm:(typeof t=="function"?$m:Zm)(t)):this.node().innerHTML}function Jm(){this.nextSibling&&this.parentNode.appendChild(this)}function e0(){return this.each(Jm)}function t0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function n0(){return this.each(t0)}function r0(t){var e=typeof t=="function"?t:Zl(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function o0(){return null}function a0(t,e){var n=typeof t=="function"?t:Zl(t),o=e==null?o0:typeof e=="function"?e:Si(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function i0(){var t=this.parentNode;t&&t.removeChild(this)}function s0(){return this.each(i0)}function l0(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function c0(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function d0(t){return this.select(t?c0:l0)}function u0(t){return arguments.length?this.property("__data__",t):this.node().__data__}function f0(t){return function(e){t.call(this,e,this.__data__)}}function v0(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 g0(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 p0(t,e,n){return function(){var o=this.__on,a,s=f0(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 h0(t,e,n){var o=v0(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?p0:g0,a=0;a<s;++a)this.each(l(o[a],e,n));return this}function ic(t,e,n){var o=tc(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 x0(t,e){return function(){return ic(this,t,e)}}function b0(t,e){return function(){return ic(this,t,e.apply(this,arguments))}}function m0(t,e){return this.each((typeof e=="function"?b0:x0)(t,e))}function*_0(){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 sc=[null];function en(t,e){this._groups=t,this._parents=e}function ro(){return new en([[document.documentElement]],sc)}function y0(){return this}en.prototype=ro.prototype={constructor:en,select:Yb,selectAll:$b,selectChild:tm,selectChildren:am,filter:im,data:fm,enter:sm,exit:gm,join:pm,merge:hm,selection:y0,order:xm,sort:bm,call:_m,nodes:ym,node:wm,size:km,empty:Sm,each:Cm,attr:Im,style:Rm,property:Fm,classed:jm,text:Xm,html:Qm,raise:e0,lower:n0,append:r0,insert:a0,remove:s0,clone:d0,datum:u0,on:h0,dispatch:m0,[Symbol.iterator]:_0};function cn(t){return typeof t=="string"?new en([[document.querySelector(t)]],[document.documentElement]):new en([[t]],sc)}function w0(t){let e;for(;e=t.sourceEvent;)t=e;return t}function hn(t,e){if(t=w0(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 k0={passive:!1},Hr={capture:!0,passive:!1};function Ea(t){t.stopImmediatePropagation()}function fr(t){t.preventDefault(),t.stopImmediatePropagation()}function lc(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 cc(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 S0(t){return!t.ctrlKey&&!t.button}function C0(){return this.parentNode}function N0(t,e){return e??{x:t.x,y:t.y}}function E0(){return navigator.maxTouchPoints||"ontouchstart"in this}function M0(){var t=S0,e=C0,n=N0,o=E0,a={},s=ia("start","drag","end"),i=0,l,u,f,v,x=0;function p(V){V.on("mousedown.drag",w).filter(o).on("touchstart.drag",F).on("touchmove.drag",D,k0).on("touchend.drag touchcancel.drag",L).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(V,q){if(!(v||!t.call(this,V,q))){var ee=H(this,e.call(this,V,q),V,q,"mouse");ee&&(cn(V.view).on("mousemove.drag",_,Hr).on("mouseup.drag",A,Hr),lc(V.view),Ea(V),f=!1,l=V.clientX,u=V.clientY,ee("start",V))}}function _(V){if(fr(V),!f){var q=V.clientX-l,ee=V.clientY-u;f=q*q+ee*ee>x}a.mouse("drag",V)}function A(V){cn(V.view).on("mousemove.drag mouseup.drag",null),cc(V.view,f),fr(V),a.mouse("end",V)}function F(V,q){if(t.call(this,V,q)){var ee=V.changedTouches,oe=e.call(this,V,q),ae=ee.length,ne,ve;for(ne=0;ne<ae;++ne)(ve=H(this,oe,V,q,ee[ne].identifier,ee[ne]))&&(Ea(V),ve("start",V,ee[ne]))}}function D(V){var q=V.changedTouches,ee=q.length,oe,ae;for(oe=0;oe<ee;++oe)(ae=a[q[oe].identifier])&&(fr(V),ae("drag",V,q[oe]))}function L(V){var q=V.changedTouches,ee=q.length,oe,ae;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),oe=0;oe<ee;++oe)(ae=a[q[oe].identifier])&&(Ea(V),ae("end",V,q[oe]))}function H(V,q,ee,oe,ae,ne){var ve=s.copy(),R=hn(ne||ee,q),y,M,m;if((m=n.call(V,new ti("beforestart",{sourceEvent:ee,target:p,identifier:ae,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:ve}),oe))!=null)return y=m.x-R[0]||0,M=m.y-R[1]||0,function E(N,O,K){var Z=R,z;switch(N){case"start":a[ae]=E,z=i++;break;case"end":delete a[ae],--i;case"drag":R=hn(K||O,q),z=i;break}ve.call(N,V,new ti(N,{sourceEvent:O,subject:m,target:p,identifier:ae,active:z,x:R[0]+y,y:R[1]+M,dx:R[0]-Z[0],dy:R[1]-Z[1],dispatch:ve}),oe)}}return p.filter=function(V){return arguments.length?(t=typeof V=="function"?V:mo(!!V),p):t},p.container=function(V){return arguments.length?(e=typeof V=="function"?V:mo(V),p):e},p.subject=function(V){return arguments.length?(n=typeof V=="function"?V:mo(V),p):n},p.touchable=function(V){return arguments.length?(o=typeof V=="function"?V:mo(!!V),p):o},p.on=function(){var V=s.on.apply(s,arguments);return V===s?p:V},p.clickDistance=function(V){return arguments.length?(x=(V=+V)*V,p):Math.sqrt(x)},p}function Ni(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function dc(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function oo(){}var Fr=.7,Fo=1/Fr,vr="\\s*([+-]?\\d+)\\s*",qr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z0=/^#([0-9a-f]{3,8})$/,T0=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),P0=new RegExp(`^rgb\\(${bn},${bn},${bn}\\)$`),I0=new RegExp(`^rgba\\(${vr},${vr},${vr},${qr}\\)$`),A0=new RegExp(`^rgba\\(${bn},${bn},${bn},${qr}\\)$`),L0=new RegExp(`^hsl\\(${qr},${bn},${bn}\\)$`),O0=new RegExp(`^hsla\\(${qr},${bn},${bn},${qr}\\)$`),ws={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};Ni(oo,Zn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ks,formatHex:ks,formatHex8:R0,formatHsl:D0,formatRgb:Ss,toString:Ss});function ks(){return this.rgb().formatHex()}function R0(){return this.rgb().formatHex8()}function D0(){return uc(this).formatHsl()}function Ss(){return this.rgb().formatRgb()}function Zn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=z0.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Cs(e):n===3?new Jt(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=T0.exec(t))?new Jt(e[1],e[2],e[3],1):(e=P0.exec(t))?new Jt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=I0.exec(t))?_o(e[1],e[2],e[3],e[4]):(e=A0.exec(t))?_o(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=L0.exec(t))?Ms(e[1],e[2]/100,e[3]/100,1):(e=O0.exec(t))?Ms(e[1],e[2]/100,e[3]/100,e[4]):ws.hasOwnProperty(t)?Cs(ws[t]):t==="transparent"?new Jt(NaN,NaN,NaN,0):null}function Cs(t){return new Jt(t>>16&255,t>>8&255,t&255,1)}function _o(t,e,n,o){return o<=0&&(t=e=n=NaN),new Jt(t,e,n,o)}function V0(t){return t instanceof oo||(t=Zn(t)),t?(t=t.rgb(),new Jt(t.r,t.g,t.b,t.opacity)):new Jt}function ni(t,e,n,o){return arguments.length===1?V0(t):new Jt(t,e,n,o??1)}function Jt(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}Ni(Jt,ni,dc(oo,{brighter(t){return t=t==null?Fo:Math.pow(Fo,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Fr:Math.pow(Fr,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jt(Xn(this.r),Xn(this.g),Xn(this.b),qo(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:Ns,formatHex:Ns,formatHex8:H0,formatRgb:Es,toString:Es}));function Ns(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}`}function H0(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}${Yn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Es(){const t=qo(this.opacity);return`${t===1?"rgb(":"rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${t===1?")":`, ${t})`}`}function qo(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 Ms(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 uc(t){if(t instanceof dn)return new dn(t.h,t.s,t.l,t.opacity);if(t instanceof oo||(t=Zn(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?uc(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}Ni(dn,F0,dc(oo,{brighter(t){return t=t==null?Fo:Math.pow(Fo,t),new dn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Fr:Math.pow(Fr,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 Jt(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(zs(this.h),yo(this.s),yo(this.l),qo(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=qo(this.opacity);return`${t===1?"hsl(":"hsla("}${zs(this.h)}, ${yo(this.s)*100}%, ${yo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zs(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 Ei=t=>()=>t;function q0(t,e){return function(n){return t+n*e}}function K0(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 B0(t){return(t=+t)==1?fc:function(e,n){return n-e?K0(e,n,t):Ei(isNaN(e)?n:e)}}function fc(t,e){var n=e-t;return n?q0(t,n):Ei(isNaN(t)?e:t)}const Ko=(function t(e){var n=B0(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=fc(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 j0(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 U0(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 Y0(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 X0(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 G0(t){return function(){return t}}function Z0(t){return function(e){return t(e)+""}}function vc(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):G0(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"?Ei(e):(n==="number"?xn:n==="string"?(o=Zn(e))?(e=o,Ko):vc:e instanceof Zn?Ko:e instanceof Date?Y0:W0(e)?j0:Array.isArray(e)?U0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?X0:xn)(t,e)}var Ts=180/Math.PI,oi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gc(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)*Ts,skewX:Math.atan(u)*Ts,scaleX:i,scaleY:l}}var wo;function $0(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?oi:gc(e.a,e.b,e.c,e.d,e.e,e.f)}function Q0(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,gc(t.a,t.b,t.c,t.d,t.e,t.f))}function pc(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 A=w.push("translate(",null,e,null,n);_.push({i:A-4,x:xn(f,x)},{i:A-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 A=w.push(a(w)+"scale(",null,",",null,")");_.push({i:A-4,x:xn(f,x)},{i:A-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,A=p.length,F;++_<A;)x[(F=p[_]).i]=F.x(w);return x.join("")}}}var J0=pc($0,"px, ","px)","deg)"),e_=pc(Q0,", ",")",")"),t_=1e-12;function Ps(t){return((t=Math.exp(t))+1/t)/2}function n_(t){return((t=Math.exp(t))-1/t)/2}function r_(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,A=w*w+_*_,F,D;if(A<t_)D=Math.log(p/f)/e,F=function(oe){return[l+oe*w,u+oe*_,f*Math.exp(e*oe*D)]};else{var L=Math.sqrt(A),H=(p*p-f*f+o*A)/(2*f*n*L),V=(p*p-f*f-o*A)/(2*p*n*L),q=Math.log(Math.sqrt(H*H+1)-H),ee=Math.log(Math.sqrt(V*V+1)-V);D=(ee-q)/e,F=function(oe){var ae=oe*D,ne=Ps(q),ve=f/(n*L)*(ne*r_(e*ae+q)-n_(q));return[l+ve*w,u+ve*_,f*ne/Ps(e*ae+q)]}}return F.duration=D*1e3*e/Math.SQRT2,F}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,hc=1e3,Bo,Ir,jo=0,$n=0,la=0,Kr=typeof performance=="object"&&performance.now?performance:Date,xc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Mi(){return $n||(xc(o_),$n=Kr.now()+la)}function o_(){$n=0}function Wo(){this._call=this._time=this._next=null}Wo.prototype=bc.prototype={constructor:Wo,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Mi():+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 bc(t,e,n){var o=new Wo;return o.restart(t,e,n),o}function a_(){Mi(),++mr;for(var t=Bo,e;t;)(e=$n-t._time)>=0&&t._call.call(void 0,e),t=t._next;--mr}function Is(){$n=(jo=Kr.now())+la,mr=Pr=0;try{a_()}finally{mr=0,s_(),$n=0}}function i_(){var t=Kr.now(),e=t-jo;e>hc&&(la-=e,jo=t)}function s_(){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-$n;e>24?(t<1/0&&(Pr=setTimeout(Is,t-Kr.now()-la)),zr&&(zr=clearInterval(zr))):(zr||(jo=Kr.now(),zr=setInterval(i_,hc)),mr=1,xc(Is))}}function As(t,e,n){var o=new Wo;return e=e==null?0:+e,o.restart(a=>{o.stop(),t(a+e)},e,n),o}var l_=ia("start","end","cancel","interrupt"),c_=[],mc=0,Ls=1,ii=2,Oo=3,Os=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;d_(t,n,{name:e,index:o,group:a,on:l_,tween:c_,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:mc})}function zi(t,e){var n=vn(t,e);if(n.state>mc)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 d_(t,e,n){var o=t.__transition,a;o[e]=n,n.timer=bc(s,0,n.time);function s(f){n.state=Ls,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!==Ls)return u();for(v in o)if(w=o[v],w.name===n.name){if(w.state===Oo)return As(i);w.state===Os?(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(As(function(){n.state===Oo&&(n.state=Os,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 u_(t){return this.each(function(){Do(this,t)})}function f_(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 v_(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 g_(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?f_:v_)(n,t,e))}function Ti(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 _c(t,e){var n;return(typeof e=="number"?xn:e instanceof Zn?Ko:(n=Zn(e))?(e=n,Ko):vc)(t,e)}function p_(t){return function(){this.removeAttribute(t)}}function h_(t){return function(){this.removeAttributeNS(t.space,t.local)}}function x_(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 b_(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 m_(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 __(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 y_(t,e){var n=sa(t),o=n==="transform"?e_:_c;return this.attrTween(t,typeof e=="function"?(n.local?__:m_)(n,o,Ti(this,"attr."+t,e)):e==null?(n.local?h_:p_)(n):(n.local?b_:x_)(n,o,e))}function w_(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function k_(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function S_(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 C_(t,e){var n,o;function a(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&w_(t,s)),n}return a._value=e,a}function N_(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?S_:C_)(o,e))}function E_(t,e){return function(){zi(this,t).delay=+e.apply(this,arguments)}}function M_(t,e){return e=+e,function(){zi(this,t).delay=e}}function z_(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?E_:M_)(e,t)):vn(this.node(),e).delay}function T_(t,e){return function(){yn(this,t).duration=+e.apply(this,arguments)}}function P_(t,e){return e=+e,function(){yn(this,t).duration=e}}function I_(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?T_:P_)(e,t)):vn(this.node(),e).duration}function A_(t,e){if(typeof e!="function")throw new Error;return function(){yn(this,t).ease=e}}function L_(t){var e=this._id;return arguments.length?this.each(A_(e,t)):vn(this.node(),e).ease}function O_(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;yn(this,t).ease=n}}function R_(t){if(typeof t!="function")throw new Error;return this.each(O_(this._id,t))}function D_(t){typeof t!="function"&&(t=Ql(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 zn(o,this._parents,this._name,this._id)}function V_(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 zn(i,this._parents,this._name,this._id)}function H_(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=H_(e)?zi:yn;return function(){var i=s(this,t),l=i.on;l!==o&&(a=(o=l).copy()).on(e,n),i.on=a}}function q_(t,e){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(t):this.each(F_(n,t,e))}function K_(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function B_(){return this.on("end.remove",K_(this._id))}function j_(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Si(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 zn(s,this._parents,e,n)}function W_(t){var e=this._name,n=this._id;typeof t!="function"&&(t=$l(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),A=0,F=p.length;A<F;++A)(w=p[A])&&ca(w,e,n,A,p,_);s.push(p),i.push(v)}return new zn(s,i,e,n)}var U_=ro.prototype.constructor;function Y_(){return new U_(this._groups,this._parents)}function X_(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 yc(t){return function(){this.style.removeProperty(t)}}function G_(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 $_(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=yc(e)):void 0;(f!==n||a!==v)&&(o=(n=f).copy()).on(i,a=v),u.on=o}}function Q_(t,e,n){var o=(t+="")=="transform"?J0:_c;return e==null?this.styleTween(t,X_(t,o)).on("end.style."+t,yc(t)):typeof e=="function"?this.styleTween(t,Z_(t,o,Ti(this,"style."+t,e))).each($_(this._id,t)):this.styleTween(t,G_(t,o,e),n).on("end.style."+t,null)}function J_(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function ey(t,e,n){var o,a;function s(){var i=e.apply(this,arguments);return i!==a&&(o=(a=i)&&J_(t,i,n)),o}return s._value=e,s}function ty(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,ey(t,e,n??""))}function ny(t){return function(){this.textContent=t}}function ry(t){return function(){var e=t(this);this.textContent=e??""}}function oy(t){return this.tween("text",typeof t=="function"?ry(Ti(this,"text",t)):ny(t==null?"":t+""))}function ay(t){return function(e){this.textContent=t.call(this,e)}}function iy(t){var e,n;function o(){var a=t.apply(this,arguments);return a!==n&&(e=(n=a)&&ay(a)),e}return o._value=t,o}function sy(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,iy(t))}function ly(){for(var t=this._name,e=this._id,n=wc(),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 zn(o,this._parents,t,n)}function cy(){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 dy=0;function zn(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function wc(){return++dy}var wn=ro.prototype;zn.prototype={constructor:zn,select:j_,selectAll:W_,selectChild:wn.selectChild,selectChildren:wn.selectChildren,filter:D_,merge:V_,selection:Y_,transition:ly,call:wn.call,nodes:wn.nodes,node:wn.node,size:wn.size,empty:wn.empty,each:wn.each,on:q_,attr:y_,attrTween:N_,style:Q_,styleTween:ty,text:oy,textTween:sy,remove:B_,tween:g_,delay:z_,duration:I_,ease:L_,easeVarying:R_,end:cy,[Symbol.iterator]:wn[Symbol.iterator]};function uy(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var fy={time:null,delay:0,duration:250,ease:uy};function vy(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 gy(t){var e,n;t instanceof zn?(e=t._id,t=t._name):(e=wc(),(n=fy).time=Mi(),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||vy(u,e));return new zn(o,this._parents,t,e)}ro.prototype.interrupt=u_;ro.prototype.transition=gy;const ko=t=>()=>t;function py(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);kc.prototype=Nn.prototype;function kc(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 hy(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function xy(){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 Rs(){return this.__zoom||da}function by(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function my(){return navigator.maxTouchPoints||"ontouchstart"in this}function _y(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 yy(){var t=hy,e=xy,n=_y,o=by,a=my,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,A=0,F=10;function D(m){m.property("__zoom",Rs).on("wheel.zoom",ae,{passive:!1}).on("mousedown.zoom",ne).on("dblclick.zoom",ve).filter(a).on("touchstart.zoom",R).on("touchmove.zoom",y).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}D.transform=function(m,E,N,O){var K=m.selection?m.selection():m;K.property("__zoom",Rs),m!==K?q(m,E,N,O):K.interrupt().each(function(){ee(this,arguments).event(O).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},D.scaleBy=function(m,E,N,O){D.scaleTo(m,function(){var K=this.__zoom.k,Z=typeof E=="function"?E.apply(this,arguments):E;return K*Z},N,O)},D.scaleTo=function(m,E,N,O){D.transform(m,function(){var K=e.apply(this,arguments),Z=this.__zoom,z=N==null?V(K):typeof N=="function"?N.apply(this,arguments):N,b=Z.invert(z),k=typeof E=="function"?E.apply(this,arguments):E;return n(H(L(Z,k),z,b),K,i)},N,O)},D.translateBy=function(m,E,N,O){D.transform(m,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof N=="function"?N.apply(this,arguments):N),e.apply(this,arguments),i)},null,O)},D.translateTo=function(m,E,N,O,K){D.transform(m,function(){var Z=e.apply(this,arguments),z=this.__zoom,b=O==null?V(Z):typeof O=="function"?O.apply(this,arguments):O;return n(da.translate(b[0],b[1]).scale(z.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof N=="function"?-N.apply(this,arguments):-N),Z,i)},O,K)};function L(m,E){return E=Math.max(s[0],Math.min(s[1],E)),E===m.k?m:new Nn(E,m.x,m.y)}function H(m,E,N){var O=E[0]-N[0]*m.k,K=E[1]-N[1]*m.k;return O===m.x&&K===m.y?m:new Nn(m.k,O,K)}function V(m){return[(+m[0][0]+ +m[1][0])/2,(+m[0][1]+ +m[1][1])/2]}function q(m,E,N,O){m.on("start.zoom",function(){ee(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){ee(this,arguments).event(O).end()}).tween("zoom",function(){var K=this,Z=arguments,z=ee(K,Z).event(O),b=e.apply(K,Z),k=N==null?V(b):typeof N=="function"?N.apply(K,Z):N,I=Math.max(b[1][0]-b[0][0],b[1][1]-b[0][1]),U=K.__zoom,ce=typeof E=="function"?E.apply(K,Z):E,J=u(U.invert(k).concat(I/U.k),ce.invert(k).concat(I/ce.k));return function(Y){if(Y===1)Y=ce;else{var Q=J(Y),$=I/Q[2];Y=new Nn($,k[0]-Q[0]*$,k[1]-Q[1]*$)}z.zoom(null,Y)}})}function ee(m,E,N){return!N&&m.__zooming||new oe(m,E)}function oe(m,E){this.that=m,this.args=E,this.active=0,this.sourceEvent=null,this.extent=e.apply(m,E),this.taps=0}oe.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,E){return this.mouse&&m!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var E=cn(this.that).datum();f.call(m,this.that,new py(m,{sourceEvent:this.sourceEvent,target:D,transform:this.that.__zoom,dispatch:f}),E)}};function ae(m,...E){if(!t.apply(this,arguments))return;var N=ee(this,E).event(m),O=this.__zoom,K=Math.max(s[0],Math.min(s[1],O.k*Math.pow(2,o.apply(this,arguments)))),Z=hn(m);if(N.wheel)(N.mouse[0][0]!==Z[0]||N.mouse[0][1]!==Z[1])&&(N.mouse[1]=O.invert(N.mouse[0]=Z)),clearTimeout(N.wheel);else{if(O.k===K)return;N.mouse=[Z,O.invert(Z)],Do(this),N.start()}Tr(m),N.wheel=setTimeout(z,_),N.zoom("mouse",n(H(L(O,K),N.mouse[0],N.mouse[1]),N.extent,i));function z(){N.wheel=null,N.end()}}function ne(m,...E){if(p||!t.apply(this,arguments))return;var N=m.currentTarget,O=ee(this,E,!0).event(m),K=cn(m.view).on("mousemove.zoom",k,!0).on("mouseup.zoom",I,!0),Z=hn(m,N),z=m.clientX,b=m.clientY;lc(m.view),Ta(m),O.mouse=[Z,this.__zoom.invert(Z)],Do(this),O.start();function k(U){if(Tr(U),!O.moved){var ce=U.clientX-z,J=U.clientY-b;O.moved=ce*ce+J*J>A}O.event(U).zoom("mouse",n(H(O.that.__zoom,O.mouse[0]=hn(U,N),O.mouse[1]),O.extent,i))}function I(U){K.on("mousemove.zoom mouseup.zoom",null),cc(U.view,O.moved),Tr(U),O.event(U).end()}}function ve(m,...E){if(t.apply(this,arguments)){var N=this.__zoom,O=hn(m.changedTouches?m.changedTouches[0]:m,this),K=N.invert(O),Z=N.k*(m.shiftKey?.5:2),z=n(H(L(N,Z),O,K),e.apply(this,E),i);Tr(m),l>0?cn(this).transition().duration(l).call(q,z,O,m):cn(this).call(D.transform,z,O,m)}}function R(m,...E){if(t.apply(this,arguments)){var N=m.touches,O=N.length,K=ee(this,E,m.changedTouches.length===O).event(m),Z,z,b,k;for(Ta(m),z=0;z<O;++z)b=N[z],k=hn(b,this),k=[k,this.__zoom.invert(k),b.identifier],K.touch0?!K.touch1&&K.touch0[2]!==k[2]&&(K.touch1=k,K.taps=0):(K.touch0=k,Z=!0,K.taps=1+!!v);v&&(v=clearTimeout(v)),Z&&(K.taps<2&&(x=k[0],v=setTimeout(function(){v=null},w)),Do(this),K.start())}}function y(m,...E){if(this.__zooming){var N=ee(this,E).event(m),O=m.changedTouches,K=O.length,Z,z,b,k;for(Tr(m),Z=0;Z<K;++Z)z=O[Z],b=hn(z,this),N.touch0&&N.touch0[2]===z.identifier?N.touch0[0]=b:N.touch1&&N.touch1[2]===z.identifier&&(N.touch1[0]=b);if(z=N.that.__zoom,N.touch1){var I=N.touch0[0],U=N.touch0[1],ce=N.touch1[0],J=N.touch1[1],Y=(Y=ce[0]-I[0])*Y+(Y=ce[1]-I[1])*Y,Q=(Q=J[0]-U[0])*Q+(Q=J[1]-U[1])*Q;z=L(z,Math.sqrt(Y/Q)),b=[(I[0]+ce[0])/2,(I[1]+ce[1])/2],k=[(U[0]+J[0])/2,(U[1]+J[1])/2]}else if(N.touch0)b=N.touch0[0],k=N.touch0[1];else return;N.zoom("touch",n(H(z,b,k),N.extent,i))}}function M(m,...E){if(this.__zooming){var N=ee(this,E).event(m),O=m.changedTouches,K=O.length,Z,z;for(Ta(m),p&&clearTimeout(p),p=setTimeout(function(){p=null},w),Z=0;Z<K;++Z)z=O[Z],N.touch0&&N.touch0[2]===z.identifier?delete N.touch0:N.touch1&&N.touch1[2]===z.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(z=hn(z,this),Math.hypot(x[0]-z[0],x[1]-z[1])<F)){var b=cn(this).on("dblclick.zoom");b&&b.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?(A=(m=+m)*m,D):Math.sqrt(A)},D.tapDistance=function(m){return arguments.length?(F=+m,D):F},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]],Sc=["Enter"," ","Escape"],wy={"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 Uo;(function(t){t.Partial="partial",t.Full="full"})(Uo||(Uo={}));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 An;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(An||(An={}));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 Ds={[ft.Left]:ft.Right,[ft.Right]:ft.Left,[ft.Top]:ft.Bottom,[ft.Bottom]:ft.Top};function ky(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 Vs(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 Sy(t){return t===null?null:t?"valid":"invalid"}const Cc=t=>"id"in t&&"source"in t&&"target"in t,Cy=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Pi=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}},Ny=(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):Pi(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}},Ii=(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,A=jr(l,wr(f)),F=(w??0)*(_??0),D=s&&A>0;(!f.internals.handleBounds||D||A>=F||f.dragging)&&u.push(f)}return u},Ey=(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 My(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 zy({nodes:t,width:e,height:n,panZoom:o,minZoom:a,maxZoom:s},i){if(t.size===0)return Promise.resolve(!0);const l=My(t,i),u=ua(l),f=Ai(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 Nc({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 Ty({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(A=>A.id===p.parentId);(w||_)&&i.push(p)}const l=new Set(e.map(p=>p.id)),u=o.filter(p=>p.deletable!==!1),v=Ey(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 Ec(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 Hs=(t,e,n)=>t<e?yr(Math.abs(t-e),1,e)/e:t>n?-yr(Math.abs(t-n),1,e)/e:0,Mc=(t,e,n=15,o=40)=>{const a=Hs(t.x,o,e.width-o)*n,s=Hs(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}=Pi(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}=Pi(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)}},Py=(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),Iy=(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 Ay(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 Ly(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 Ai=(t,e,n,o,a,s)=>{const i=Ay(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,A=Ly(t,w,_,v,e,n),F={left:Math.min(A.left-i.left,0),top:Math.min(A.top-i.top,0),right:Math.min(A.right-i.right,0),bottom:Math.min(A.bottom-i.bottom,0)};return{x:w-F.left+F.right,y:_-F.top+F.bottom,zoom:v}},Zo=()=>{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 Oy(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 Ry(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 Dy(t){return{...wy,...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 zc=t=>({width:t.offsetWidth,height:t.offsetHeight}),Tc=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Vy=["INPUT","SELECT","TEXTAREA"];function Pc(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:Vy.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Ic=t=>"clientX"in t,fn=(t,e)=>{var s,i;const n=Ic(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)}},qs=(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,...zc(i)}})};function Hy({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 Ks({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 Ac({sourceX:t,sourceY:e,sourcePosition:n=ft.Bottom,targetX:o,targetY:a,targetPosition:s=ft.Top,curvature:i=.25}){const[l,u]=Ks({pos:n,x1:t,y1:e,x2:o,y2:a,c:i}),[f,v]=Ks({pos:s,x1:o,y1:a,x2:t,y2:e,c:i}),[x,p,w,_]=Hy({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 Lc({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 qy({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 Ky=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,By=(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)),jy=(t,e,n={})=>{if(!t.source||!t.target)return e;const o=n.getEdgeId||Ky;let a;return Cc(t)?a={...t}:a={...t,id:o(t)},By(a,e)?e:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,e.concat(a))};function Oc({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[a,s,i,l]=Lc({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,a,s,i,l]}const Bs={[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},js=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function Uy({source:t,sourcePosition:e=ft.Bottom,target:n,targetPosition:o=ft.Top,center:a,offset:s,stepPosition:i}){const l=Bs[e],u=Bs[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 _=[],A,F;const D={x:0,y:0},L={x:0,y:0},[,,H,V]=Lc({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(l[p]*u[p]===-1){p==="x"?(A=a.x??f.x+(v.x-f.x)*i,F=a.y??(f.y+v.y)/2):(A=a.x??(f.x+v.x)/2,F=a.y??f.y+(v.y-f.y)*i);const ae=[{x:A,y:f.y},{x:A,y:v.y}],ne=[{x:f.x,y:F},{x:v.x,y:F}];l[p]===w?_=p==="x"?ae:ne:_=p==="x"?ne:ae}else{const ae=[{x:f.x,y:v.y}],ne=[{x:v.x,y:f.y}];if(p==="x"?_=l.x===w?ne:ae:_=l.y===w?ae:ne,e===o){const m=Math.abs(t[p]-n[p]);if(m<=s){const E=Math.min(s-1,s-m);l[p]===w?D[p]=(f[p]>t[p]?-1:1)*E:L[p]=(v[p]>n[p]?-1:1)*E}}if(e!==o){const m=p==="x"?"y":"x",E=l[p]===u[m],N=f[m]>v[m],O=f[m]<v[m];(l[p]===1&&(!E&&N||E&&O)||l[p]!==1&&(!E&&O||E&&N))&&(_=p==="x"?ae:ne)}const ve={x:f.x+D.x,y:f.y+D.y},R={x:v.x+L.x,y:v.y+L.y},y=Math.max(Math.abs(ve.x-_[0].x),Math.abs(R.x-_[0].x)),M=Math.max(Math.abs(ve.y-_[0].y),Math.abs(R.y-_[0].y));y>=M?(A=(ve.x+R.x)/2,F=_[0].y):(A=_[0].x,F=(ve.y+R.y)/2)}const q={x:f.x+D.x,y:f.y+D.y},ee={x:v.x+L.x,y:v.y+L.y};return[[t,...q.x!==_[0].x||q.y!==_[0].y?[q]:[],..._,...ee.x!==_[_.length-1].x||ee.y!==_[_.length-1].y?[ee]:[],n],A,F,H,V]}function Yy(t,e,n,o){const a=Math.min(js(t,e)/2,js(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 Li({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,_,A]=Uy({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:a},targetPosition:s,center:{x:l,y:u},offset:f,stepPosition:v});let F=`M${x[0].x} ${x[0].y}`;for(let D=1;D<x.length-1;D++)F+=Yy(x[D-1],x[D],x[D+1],i);return F+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[F,p,w,_,A]}function Ws(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Xy(t){var x;const{sourceNode:e,targetNode:n}=t;if(!Ws(e)||!Ws(n))return null;const o=e.internals.handleBounds||Us(e.handles),a=n.internals.handleBounds||Us(n.handles),s=Ys((o==null?void 0:o.source)??[],t.sourceHandle),i=Ys(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 Us(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 Ys(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 Gy(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 Rc=1e3,Zy=10,Oi={nodeOrigin:[0,0],nodeExtent:li,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},$y={...Oi,checkEquality:!0};function Ri(t,e){const n={...t};for(const o in e)e[o]!==void 0&&(n[o]=e[o]);return n}function Qy(t,e,n){const o=Ri(Oi,n);for(const a of t.values())if(a.parentId)Vi(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 Jy(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 Di(t){return t==="manual"}function e2(t,e,n,o={}){var v,x;const a=Ri($y,o),s={i:0},i=new Map(e),l=a!=null&&a.elevateNodesOnSelect&&!Di(a.zIndexMode)?Rc: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),A=kr(p.extent)?p.extent:a.nodeExtent,F=Qn(_,A,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:F,handleBounds:Jy(p,w),z:Dc(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&&Vi(w,e,n,o,s),f||(f=p.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:f}}function t2(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 Vi(t,e,n,o,a){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:l,zIndexMode:u}=Ri(Oi,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}t2(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&&!Di(u)?Rc:0,{x:p,y:w,z:_}=n2(t,v,i,l,x,u),{positionAbsolute:A}=t.internals,F=p!==A.x||w!==A.y;(F||_!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:F?{x:p,y:w}:A,z:_}})}function Dc(t,e,n){const o=En(t.zIndex)?t.zIndex:0;return Di(n)?o:o+(t.selected?e:0)}function n2(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=Ec(x,u,e));const p=Dc(t,a,s),w=e.internals.z??0;return{x:x.x,y:x.y,z:w>=p?w+1:p}}function r2(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=Py(f,l.rect);s.set(l.parentId,{expandedRect:v,parent:u})}return s.size>0&&s.forEach(({expandedRect:l,parent:u},f)=>{var H;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,A=Math.max(x.width,Math.round(l.width)),F=Math.max(x.height,Math.round(l.height)),D=(A-x.width)*p[0],L=(F-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}}),(H=n.get(f))==null||H.forEach(V=>{t.some(q=>q.id===V.id)||a.push({id:V.id,type:"position",position:{x:V.position.x+w,y:V.position.y+_}})})),(x.width<l.width||x.height<l.height||w||_)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:A+(w?p[0]*w-D:0),height:F+(_?p[1]*_-L:0)}})}),a}function o2(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 A=zc(w.nodeElement),F=_.measured.width!==A.width||_.measured.height!==A.height;if(!!(A.width&&A.height&&(F||!_.internals.handleBounds||w.force))){const L=w.nodeElement.getBoundingClientRect(),H=kr(_.extent)?_.extent:s;let{positionAbsolute:V}=_.internals;_.parentId&&_.extent==="parent"?V=Ec(V,A,e.get(_.parentId)):H&&(V=Qn(V,H,A));const q={..._,measured:A,internals:{..._.internals,positionAbsolute:V,handleBounds:{source:qs("source",w.nodeElement,L,x,_.id),target:qs("target",w.nodeElement,L,x,_.id)}}};e.set(_.id,q),_.parentId&&Vi(q,e,n,{nodeOrigin:a,zIndexMode:i}),u=!0,F&&(f.push({id:_.id,type:"dimensions",dimensions:A}),_.expandParent&&_.parentId&&p.push({id:_.id,parentId:_.parentId,rect:wr(q,a)}))}}if(p.length>0){const w=r2(p,e,n,a);f.push(...w)}return{changes:f,updatedInternals:u}}async function a2({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 Xs(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 i2(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}`;Xs("source",u,v,t,a,i),Xs("target",u,f,t,s,l),e.set(o.id,o)}}function Vc(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:Vc(n,e):!1}function Gs(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 s2(t,e,n,o){const a=new Map;for(const[s,i]of t)if((i.selected||i.id===o)&&(!i.parentId||!Vc(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 l2({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 c2({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,A=null;function F({noDragClassName:L,handleSelector:H,domNode:V,isSelectable:q,nodeId:ee,nodeClickDistance:oe=0}){p=cn(V);function ae({x:y,y:M}){const{nodeLookup:m,nodeExtent:E,snapGrid:N,snapToGrid:O,nodeOrigin:K,onNodeDrag:Z,onSelectionDrag:z,onError:b,updateNodePositions:k}=e();s={x:y,y:M};let I=!1;const U=l.size>1,ce=U&&E?di(ua(l)):null,J=U&&O?l2({dragItems:l,snapGrid:N,x:y,y:M}):null;for(const[Y,Q]of l){if(!m.has(Y))continue;let $={x:y-Q.distance.x,y:M-Q.distance.y};O&&($=J?{x:Math.round($.x+J.x),y:Math.round($.y+J.y)}:io($,N));let se=null;if(U&&E&&!Q.extent&&ce){const{positionAbsolute:ie}=Q.internals,re=ie.x-ce.x+E[0][0],te=ie.x+Q.measured.width-ce.x2+E[1][0],ge=ie.y-ce.y+E[0][1],he=ie.y+Q.measured.height-ce.y2+E[1][1];se=[[re,ge],[te,he]]}const{position:W,positionAbsolute:B}=Nc({nodeId:Y,nextPosition:$,nodeLookup:m,nodeExtent:se||E,nodeOrigin:K,onError:b});I=I||Q.position.x!==W.x||Q.position.y!==W.y,Q.position=W,Q.internals.positionAbsolute=B}if(_=_||I,!!I&&(k(l,!0),A&&(o||Z||!ee&&z))){const[Y,Q]=Ia({nodeId:ee,dragItems:l,nodeLookup:m});o==null||o(A,l,Y,Q),Z==null||Z(A,Y,Q),ee||z==null||z(A,Q)}}async function ne(){if(!v)return;const{transform:y,panBy:M,autoPanSpeed:m,autoPanOnNodeDrag:E}=e();if(!E){u=!1,cancelAnimationFrame(i);return}const[N,O]=Mc(f,v,m);(N!==0||O!==0)&&(s.x=(s.x??0)-N/y[2],s.y=(s.y??0)-O/y[2],await M({x:N,y:O})&&ae(s)),i=requestAnimationFrame(ne)}function ve(y){var U;const{nodeLookup:M,multiSelectionActive:m,nodesDraggable:E,transform:N,snapGrid:O,snapToGrid:K,selectNodesOnDrag:Z,onNodeDragStart:z,onSelectionDragStart:b,unselectNodesAndEdges:k}=e();x=!0,(!Z||!q)&&!m&&ee&&((U=M.get(ee))!=null&&U.selected||k()),q&&Z&&ee&&(t==null||t(ee));const I=Pa(y.sourceEvent,{transform:N,snapGrid:O,snapToGrid:K,containerBounds:v});if(s=I,l=s2(M,E,I,ee),l.size>0&&(n||z||!ee&&b)){const[ce,J]=Ia({nodeId:ee,dragItems:l,nodeLookup:M});n==null||n(y.sourceEvent,l,ce,J),z==null||z(y.sourceEvent,ce,J),ee||b==null||b(y.sourceEvent,J)}}const R=M0().clickDistance(oe).on("start",y=>{const{domNode:M,nodeDragThreshold:m,transform:E,snapGrid:N,snapToGrid:O}=e();v=(M==null?void 0:M.getBoundingClientRect())||null,w=!1,_=!1,A=y.sourceEvent,m===0&&ve(y),s=Pa(y.sourceEvent,{transform:E,snapGrid:N,snapToGrid:O,containerBounds:v}),f=fn(y.sourceEvent,v)}).on("drag",y=>{const{autoPanOnNodeDrag:M,transform:m,snapGrid:E,snapToGrid:N,nodeDragThreshold:O,nodeLookup:K}=e(),Z=Pa(y.sourceEvent,{transform:m,snapGrid:E,snapToGrid:N,containerBounds:v});if(A=y.sourceEvent,(y.sourceEvent.type==="touchmove"&&y.sourceEvent.touches.length>1||ee&&!K.has(ee))&&(w=!0),!w){if(!u&&M&&x&&(u=!0,ne()),!x){const z=fn(y.sourceEvent,v),b=z.x-f.x,k=z.y-f.y;Math.sqrt(b*b+k*k)>O&&ve(y)}(s.x!==Z.xSnapped||s.y!==Z.ySnapped)&&l&&x&&(f=fn(y.sourceEvent,v),ae(Z))}}).on("end",y=>{if(!(!x||w)&&(u=!1,x=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:M,updateNodePositions:m,onNodeDragStop:E,onSelectionDragStop:N}=e();if(_&&(m(l,!1),_=!1),a||E||!ee&&N){const[O,K]=Ia({nodeId:ee,dragItems:l,nodeLookup:M,dragging:!1});a==null||a(y.sourceEvent,l,O,K),E==null||E(y.sourceEvent,O,K),ee||N==null||N(y.sourceEvent,K)}}}).filter(y=>{const M=y.target;return!y.button&&(!L||!Gs(M,`.${L}`,V))&&(!H||Gs(M,H,V))});p.call(R)}function D(){p==null||p.on(".drag",null)}return{update:F,destroy:D}}function d2(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 u2=250;function f2(t,e,n,o){var l,u;let a=[],s=1/0;const i=d2(t,n,e+u2);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 Hc(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 v2(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const qc=()=>!0;function g2(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:A,onConnectEnd:F,isValidConnection:D=qc,onReconnectEnd:L,updateConnection:H,getTransform:V,getFromHandle:q,autoPanSpeed:ee,dragThreshold:oe=1,handleDomNode:ae}){const ne=Tc(t.target);let ve=0,R;const{x:y,y:M}=fn(t),m=Fc(s,ae),E=l==null?void 0:l.getBoundingClientRect();let N=!1;if(!E||!m)return;const O=Hc(a,m,o,u,e);if(!O)return;let K=fn(t,E),Z=!1,z=null,b=!1,k=null;function I(){if(!v||!E)return;const[W,B]=Mc(K,E,ee);p({x:W,y:B}),ve=requestAnimationFrame(I)}const U={...O,nodeId:a,type:m,position:O.position},ce=u.get(a);let Y={inProgress:!0,isValid:null,from:Jn(ce,U,ft.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:ce,to:K,toHandle:null,toPosition:Ds[U.position],toNode:null,pointer:K};function Q(){N=!0,H(Y),_==null||_(t,{nodeId:a,handleId:o,handleType:m})}oe===0&&Q();function $(W){if(!N){const{x:he,y:be}=fn(W),Te=he-y,ye=be-M;if(!(Te*Te+ye*ye>oe*oe))return;Q()}if(!q()||!U){se(W);return}const B=V();K=fn(W,E),R=f2(so(K,B,!1,[1,1]),n,u,U),Z||(I(),Z=!0);const ie=Kc(W,{handle:R,connectionMode:e,fromNodeId:a,fromHandleId:o,fromType:i?"target":"source",isValidConnection:D,doc:ne,lib:f,flowId:x,nodeLookup:u});k=ie.handleDomNode,z=ie.connection,b=v2(!!R,ie.isValid);const re=u.get(a),te=re?Jn(re,U,ft.Left,!0):Y.from,ge={...Y,from:te,isValid:b,to:ie.toHandle&&b?Go({x:ie.toHandle.x,y:ie.toHandle.y},B):K,toHandle:ie.toHandle,toPosition:b&&ie.toHandle?ie.toHandle.position:Ds[U.position],toNode:ie.toHandle?u.get(ie.toHandle.nodeId):null,pointer:K};H(ge),Y=ge}function se(W){if(!("touches"in W&&W.touches.length>0)){if(N){(R||k)&&z&&b&&(A==null||A(z));const{inProgress:B,...ie}=Y,re={...ie,toPosition:Y.toHandle?Y.toPosition:null};F==null||F(W,re),s&&(L==null||L(W,re))}w(),cancelAnimationFrame(ve),Z=!1,b=!1,z=null,k=null,ne.removeEventListener("mousemove",$),ne.removeEventListener("mouseup",se),ne.removeEventListener("touchmove",$),ne.removeEventListener("touchend",se)}}ne.addEventListener("mousemove",$),ne.addEventListener("mouseup",se),ne.addEventListener("touchmove",$),ne.addEventListener("touchend",se)}function Kc(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:s,doc:i,lib:l,flowId:u,isValidConnection:f=qc,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),A=i.elementFromPoint(w,_),F=A!=null&&A.classList.contains(`${l}-flow__handle`)?A:p,D={handleDomNode:F,isValid:!1,connection:null,toHandle:null};if(F){const L=Fc(void 0,F),H=F.getAttribute("data-nodeid"),V=F.getAttribute("data-handleid"),q=F.classList.contains("connectable"),ee=F.classList.contains("connectableend");if(!H||!L)return D;const oe={source:x?H:o,sourceHandle:x?V:a,target:x?o:H,targetHandle:x?a:V};D.connection=oe;const ne=q&&ee&&(n===_r.Strict?x&&L==="source"||!x&&L==="target":H!==o||V!==a);D.isValid=ne&&f(oe),D.toHandle=Hc(H,L,V,v,n,!0)}return D}const Zs={onPointerDown:g2,isValid:Kc},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}`),Bc=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),p2=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,La=(t,e=0,n=p2,o=()=>{})=>{const a=typeof e=="number"&&e>0;return a||o(),a?t.transition().duration(e).ease(n).on("end",o):t},jc=t=>{const e=t.ctrlKey&&Zo()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function h2({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 F=hn(v),D=jc(v),L=x*Math.pow(2,D);o.scaleTo(n,L,F,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;!Zo()&&v.shiftKey&&a!==gr.Vertical&&(w=v.deltaY*p,_=0),o.translateBy(n,-(w/x)*s,-(_/x)*s,{internal:!0});const A=ga(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(u==null||u(v,A),t.panScrollTimeout=setTimeout(()=>{f==null||f(v,A),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,l==null||l(v,A))}}function x2({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 b2({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 m2({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:a}){return s=>{var i,l;t.usedRightMouseButton=!!(n&&Bc(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 _2({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&&Bc(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 y2({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 F;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"&&((F=x.touches)==null?void 0:F.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 A=Array.isArray(o)&&o.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||_)&&A}}function w2({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=yy().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(jc);function A(R,y){return p?new Promise(M=>{x==null||x.interpolate((y==null?void 0:y.interpolate)==="linear"?Or:Lo).transform(La(p,y==null?void 0:y.duration,y==null?void 0:y.ease,()=>M(!0)),R)}):Promise.resolve(!1)}function F({noWheelClassName:R,noPanClassName:y,onPaneContextMenu:M,userSelectionActive:m,panOnScroll:E,panOnDrag:N,panOnScrollMode:O,panOnScrollSpeed:K,preventScrolling:Z,zoomOnPinch:z,zoomOnScroll:b,zoomOnDoubleClick:k,zoomActivationKeyPressed:I,lib:U,onTransformChange:ce,connectionInProgress:J,paneClickDistance:Y,selectionOnDrag:Q}){m&&!f.isZoomingOrPanning&&D();const $=E&&!I&&!m;x.clickDistance(Q?1/0:!En(Y)||Y<0?0:Y);const se=$?h2({zoomPanValues:f,noWheelClassName:R,d3Selection:p,d3Zoom:x,panOnScrollMode:O,panOnScrollSpeed:K,zoomOnPinch:z,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:l}):x2({noWheelClassName:R,preventScrolling:Z,d3ZoomHandler:w});if(p.on("wheel.zoom",se,{passive:!1}),!m){const B=b2({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:i});x.on("start",B);const ie=m2({zoomPanValues:f,panOnDrag:N,onPaneContextMenu:!!M,onPanZoom:s,onTransformChange:ce});x.on("zoom",ie);const re=_2({zoomPanValues:f,panOnDrag:N,panOnScroll:E,onPaneContextMenu:M,onPanZoomEnd:l,onDraggingChange:u});x.on("end",re)}const W=y2({zoomActivationKeyPressed:I,panOnDrag:N,zoomOnScroll:b,panOnScroll:E,zoomOnDoubleClick:k,zoomOnPinch:z,userSelectionActive:m,noPanClassName:y,noWheelClassName:R,lib:U,connectionInProgress:J});x.filter(W),k?p.on("dblclick.zoom",_):p.on("dblclick.zoom",null)}function D(){x.on("zoom",null)}async function L(R,y,M){const m=Aa(R),E=x==null?void 0:x.constrain()(m,y,M);return E&&await A(E),new Promise(N=>N(E))}async function H(R,y){const M=Aa(R);return await A(M,y),new Promise(m=>m(M))}function V(R){if(p){const y=Aa(R),M=p.property("__zoom");(M.k!==R.zoom||M.x!==R.x||M.y!==R.y)&&(x==null||x.transform(p,y,null,{sync:!0}))}}function q(){const R=p?kc(p.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function ee(R,y){return p?new Promise(M=>{x==null||x.interpolate((y==null?void 0:y.interpolate)==="linear"?Or:Lo).scaleTo(La(p,y==null?void 0:y.duration,y==null?void 0:y.ease,()=>M(!0)),R)}):Promise.resolve(!1)}function oe(R,y){return p?new Promise(M=>{x==null||x.interpolate((y==null?void 0:y.interpolate)==="linear"?Or:Lo).scaleBy(La(p,y==null?void 0:y.duration,y==null?void 0:y.ease,()=>M(!0)),R)}):Promise.resolve(!1)}function ae(R){x==null||x.scaleExtent(R)}function ne(R){x==null||x.translateExtent(R)}function ve(R){const y=!En(R)||R<0?0:R;x==null||x.clickDistance(y)}return{update:F,destroy:D,setViewport:H,setViewportConstrained:L,getViewport:q,scaleTo:ee,scaleBy:oe,setScaleExtent:ae,setTranslateExtent:ne,syncViewport:V,setClickDistance:ve}}var $s;(function(t){t.Line="line",t.Handle="handle"})($s||($s={}));function Hi(){const t={};return[e=>{if(e&&!Td(t))throw new Error(e);return na(t)},e=>pi(t,e)]}const[k2,S2]=Hi(),[C2,N2]=Hi(),[E2,M2]=Hi();var z2=S("<div><!></div>");function Sr(t,e){Ze(e,!0);let n=Fe(e,"id",3,null),o=Fe(e,"type",3,"source"),a=Fe(e,"position",19,()=>ft.Top),s=Fe(e,"isConnectableStart",3,!0),i=Fe(e,"isConnectableEnd",3,!0),l=er(e,["$$slots","$$events","$$legacy","id","type","position","style","class","isConnectable","isConnectableStart","isConnectableEnd","isValidConnection","onconnect","ondisconnect","children"]);const u=k2("Handle must be used within a Custom Node component"),f=C2("Handle must be used within a Custom Node component");let v=C(()=>o()==="target"),x=C(()=>e.isConnectable!==void 0?e.isConnectable:f.value),p=rr(),w=C(()=>p.ariaLabelConfig),_=null;Pd(()=>{if(e.onconnect||e.ondisconnect){p.edges;let y=p.connectionLookup.get(`${u}-${o()}${n()?`-${n()}`:""}`);if(_&&!ky(y,_)){const M=y??new Map;Vs(_,M,e.ondisconnect),Vs(M,_,e.onconnect)}_=new Map(y)}});let A=C(()=>{if(!p.connection.inProgress)return[!1,!1,!1,!1,null];const{fromHandle:y,toHandle:M,isValid:m}=p.connection,E=y&&y.nodeId===u&&y.type===o()&&y.id===n(),N=M&&M.nodeId===u&&M.type===o()&&M.id===n(),O=p.connectionMode===_r.Strict?(y==null?void 0:y.type)!==o():u!==(y==null?void 0:y.nodeId)||n()!==(y==null?void 0:y.id);return[!0,E,N,O,N&&m]}),F=C(()=>rn(r(A),5)),D=C(()=>r(F)[0]),L=C(()=>r(F)[1]),H=C(()=>r(F)[2]),V=C(()=>r(F)[3]),q=C(()=>r(F)[4]);function ee(y){var m;const M=p.onbeforeconnect?p.onbeforeconnect(y):y;M&&(p.addEdge(M),(m=p.onconnect)==null||m.call(p,y))}function oe(y){const M=Ic(y);y.currentTarget&&(M&&y.button===0||!M)&&Zs.onPointerDown(y,{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 E;return((E=p.isValidConnection)==null?void 0:E.call(p,...m))??!0}),updateConnection:p.updateConnection,cancelConnection:p.cancelConnection,panBy:p.panBy,onConnect:ee,onConnectStart:p.onconnectstart,onConnectEnd:(...m)=>{var E;return(E=p.onconnectend)==null?void 0:E.call(p,...m)},getTransform:()=>[p.viewport.x,p.viewport.y,p.viewport.zoom],getFromHandle:()=>p.connection.fromHandle,dragThreshold:p.connectionDragThreshold,handleDomNode:y.currentTarget})}function ae(y){var k,I;if(!u||!p.clickConnectStartHandle&&!s())return;if(!p.clickConnectStartHandle){(k=p.onclickconnectstart)==null||k.call(p,y,{nodeId:u,handleId:n(),handleType:o()}),p.clickConnectStartHandle={nodeId:u,type:o(),id:n()};return}const M=Tc(y.target),m=e.isValidConnection??p.isValidConnection,{connectionMode:E,clickConnectStartHandle:N,flowId:O,nodeLookup:K}=p,{connection:Z,isValid:z}=Zs.isValid(y,{handle:{nodeId:u,id:n(),type:o()},connectionMode:E,fromNodeId:N.nodeId,fromHandleId:N.id??null,fromType:N.type,isValidConnection:m,flowId:O,doc:M,lib:"svelte",nodeLookup:K});z&&Z&&ee(Z);const b=structuredClone(gl(p.connection));delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,(I=p.onclickconnectend)==null||I.call(p,y,b),p.clickConnectStartHandle=null}var ne=z2(),ve=()=>{};Dn(ne,()=>({"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:oe,ontouchstart:oe,onclick:p.clickConnect?ae:void 0,onkeypress:ve,style:e.style,role:"button","aria-label":r(w)["handle.ariaLabel"],tabindex:"-1",...l,[bi]:{valid:r(q),connectingto:r(H),connectingfrom:r(L),source:!r(v),target:r(v),connectablestart:s(),connectableend:i(),connectable:r(x),connectionindicator:r(x)&&(!r(D)||r(V))&&(r(D)||p.clickConnectStartHandle?i():s())}}));var R=d(ne);kt(R,()=>e.children??Zt),c(ne),h(t,ne),$e()}var T2=S("<!> <!>",1);function Wc(t,e){Ze(e,!0);let n=Fe(e,"targetPosition",19,()=>ft.Top),o=Fe(e,"sourcePosition",19,()=>ft.Bottom);var a=T2(),s=fe(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 T(i,` ${((u=e.data)==null?void 0:u.label)??""} `)}),h(t,a),$e()}var P2=S(" <!>",1);function I2(t,e){Ze(e,!0);let n=Fe(e,"data",19,()=>({label:"Node"})),o=Fe(e,"sourcePosition",19,()=>ft.Bottom);Ce();var a=P2(),s=fe(a),i=g(s);Sr(i,{type:"source",get position(){return o()}}),j(()=>{var l;return T(s,`${((l=n())==null?void 0:l.label)??""} `)}),h(t,a),$e()}var A2=S(" <!>",1);function L2(t,e){Ze(e,!0);let n=Fe(e,"data",19,()=>({label:"Node"})),o=Fe(e,"targetPosition",19,()=>ft.Top);Ce();var a=A2(),s=fe(a),i=g(s);Sr(i,{type:"target",get position(){return o()}}),j(()=>{var l;return T(s,`${((l=n())==null?void 0:l.label)??""} `)}),h(t,a),$e()}function O2(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=C(rr),o=C(()=>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 R2(){let t=xe(typeof window>"u");if(r(t)){const e=ul(()=>{It(()=>{P(t,!1),e==null||e()})})}return{get value(){return r(t)}}}const Qs=t=>Cy(t),D2=t=>Cc(t);function _n(t){return t===void 0?void 0:`${t}px`}const $o={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var V2=S("<div><!></div>");function H2(t,e){Ze(e,!0);let n=Fe(e,"x",3,0),o=Fe(e,"y",3,0),a=Fe(e,"selectEdgeOnClick",3,!1),s=Fe(e,"transparent",3,!1),i=er(e,["$$slots","$$events","$$legacy","x","y","width","height","selectEdgeOnClick","transparent","class","children"]);const l=rr(),u=E2("EdgeLabel must be used within a Custom Edge component");let f=C(()=>{var w;return(w=l.visible.edges.get(u))==null?void 0:w.zIndex});var v=V2(),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:R2().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);kt(p,()=>e.children??Zt),c(v),Xt(v,(w,_)=>Ra==null?void 0:Ra(w,_),()=>"edge-labels"),h(t,v),$e()}var F2=Dt("<path></path>"),q2=Dt('<path fill="none"></path><!><!>',1);function pa(t,e){let n=Fe(e,"interactionWidth",3,20),o=er(e,["$$slots","$$events","$$legacy","id","path","label","labelX","labelY","labelStyle","markerStart","markerEnd","style","interactionWidth","class"]);var a=q2(),s=fe(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=>{H2(v,{get x(){return e.labelX},get y(){return e.labelY},get style(){return e.labelStyle},selectEdgeOnClick:!0,children:(x,p)=>{Ce();var w=gt();j(()=>T(w,e.label)),h(x,w)},$$slots:{default:!0}})};X(u,v=>{e.label&&v(f)})}j(()=>{ke(s,"id",e.id),ke(s,"d",e.path),Oe(s,0,Ue(["svelte-flow__edge-path",e.class])),ke(s,"marker-start",e.markerStart),ke(s,"marker-end",e.markerEnd),$t(s,e.style)}),h(t,a)}function Uc(t,e){Ze(e,!0);let n=C(()=>{var l;return Ac({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=C(()=>rn(r(n),3)),a=C(()=>r(o)[0]),s=C(()=>r(o)[1]),i=C(()=>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}}),$e()}function K2(t,e){Ze(e,!0);let n=C(()=>Li({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition})),o=C(()=>rn(r(n),3)),a=C(()=>r(o)[0]),s=C(()=>r(o)[1]),i=C(()=>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}}),$e()}function B2(t,e){Ze(e,!0);let n=C(()=>Oc({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY})),o=C(()=>rn(r(n),3)),a=C(()=>r(o)[0]),s=C(()=>r(o)[1]),i=C(()=>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}}),$e()}function j2(t,e){Ze(e,!0);let n=C(()=>Li({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,borderRadius:0})),o=C(()=>rn(r(n),3)),a=C(()=>r(o)[0]),s=C(()=>r(o)[1]),i=C(()=>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}}),$e()}var Jr,eo;class W2{constructor(e,n){Ve(this,Jr);Ve(this,eo);Er(this,Jr,e),Er(this,eo,Ad(n))}get current(){return de(this,eo).call(this),de(this,Jr).call(this)}}Jr=new WeakMap,eo=new WeakMap;const U2=/\(.+\)/,Y2=new Set(["all","print","screen","and","or","not","only"]);class X2 extends W2{constructor(e,n){let o=U2.test(e)||e.split(/[\s,]+/).some(s=>Y2.has(s.trim()))?e:`(${e})`;const a=window.matchMedia(o);super(()=>a.matches,s=>Ka(a,"change",s))}}function G2(t,e,n,o){const a=new Map;return Ii(t,{x:0,y:0,width:n,height:o},e,!0).forEach(s=>{a.set(s.id,s)}),a}function Js(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:F,transform:D,width:L,height:H}=t;if(qy({sourceNode:p,targetNode:w,width:L,height:H,transform:D}))F.set(p.id,p),F.set(w.id,w);else continue}const _=a.get(x.id);if(_&&x===_.edge&&p==_.sourceNode&&w==_.targetNode){v.set(x.id,_);continue}const A=Xy({id:x.id,sourceNode:p,targetNode:w,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:s,onError:i});A&&v.set(x.id,{...n,...x,...A,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 Yc={input:I2,output:L2,default:Wc,group:O2},Xc={straight:B2,smoothstep:K2,default:Uc,step:j2};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 Ai(i,o,a,.5,2,.1)}else return n??{x:0,y:0,zoom:1}}function $2(t){var n,o,a,s,i,l,u,f,v,x,p,w,_,A,F,D,L,H,V,q,ee,oe,ae,ne,ve,R,y,M,m,E,N,O,K,Z,z,b,k,I,U,ce,J,Y,Q,$,se,W,B,ie,re,te,ge,he,be,Te,ye,pe,Me,Pe,ue,le,we,Ne,Se,ze,me,Ee,Ae,Ke,at,Be,Qe,dt,vt,Ge,Re,Ie;class e{constructor(){Ve(this,n,C(()=>t.props.id??"1"));Ve(this,o,xe(null));Ve(this,a,xe(null));Ve(this,s,xe(t.width??0));Ve(this,i,xe(t.height??0));Ve(this,l,xe(t.props.zIndexMode??"basic"));Ve(this,u,C(()=>{var De;const{nodesInitialized:G}=e2(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}));Ve(this,f,C(()=>this.panZoom!==null));Ve(this,v,C(()=>(i2(this.connectionLookup,this.edgeLookup,t.edges),t.edges)));wt(this,"_prevSelectedNodes",[]);wt(this,"_prevSelectedNodeIds",new Set);Ve(this,x,C(()=>{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);Ve(this,p,C(()=>{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);Ve(this,w,C(()=>{const{nodes:G,_edges:De,_prevVisibleEdges:Le,nodeLookup:je,connectionMode:Ye,onerror:lt,onlyRenderVisibleElements:ct,defaultEdgeOptions:pt,zIndexMode:it}=this;let Xe,tt;const st={edges:De,defaultEdgeOptions:pt,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=G2(je,Tt,ht,xt),tt=Js({...st,onlyRenderVisible:!0,visibleNodes:Xe,transform:Tt,width:ht,height:xt})}else Xe=this.nodeLookup,tt=Js(st);return{nodes:Xe,edges:tt}}));Ve(this,_,C(()=>t.props.nodesDraggable??!0));Ve(this,A,C(()=>t.props.nodesConnectable??!0));Ve(this,F,C(()=>t.props.elementsSelectable??!0));Ve(this,D,C(()=>t.props.nodesFocusable??!0));Ve(this,L,C(()=>t.props.edgesFocusable??!0));Ve(this,H,C(()=>t.props.disableKeyboardA11y??!1));Ve(this,V,C(()=>t.props.minZoom??.5));Ve(this,q,C(()=>t.props.maxZoom??2));Ve(this,ee,C(()=>t.props.nodeOrigin??[0,0]));Ve(this,oe,C(()=>t.props.nodeExtent??li));Ve(this,ae,C(()=>t.props.translateExtent??li));Ve(this,ne,C(()=>t.props.defaultEdgeOptions??{}));Ve(this,ve,C(()=>t.props.nodeDragThreshold??1));Ve(this,R,C(()=>t.props.autoPanOnNodeDrag??!0));Ve(this,y,C(()=>t.props.autoPanOnConnect??!0));Ve(this,M,C(()=>t.props.autoPanOnNodeFocus??!0));Ve(this,m,C(()=>t.props.autoPanSpeed??15));Ve(this,E,C(()=>t.props.connectionDragThreshold??1));wt(this,"fitViewQueued",t.props.fitView??!1);wt(this,"fitViewOptions",t.props.fitViewOptions);wt(this,"fitViewResolver",null);Ve(this,N,C(()=>t.props.snapGrid??null));Ve(this,O,xe(!1));Ve(this,K,xe(null));Ve(this,Z,xe(!1));Ve(this,z,xe(!1));Ve(this,b,xe(!1));Ve(this,k,xe(!1));Ve(this,I,xe(!1));Ve(this,U,xe(null));Ve(this,ce,xe(""));Ve(this,J,C(()=>t.props.selectionMode??Uo.Partial));Ve(this,Y,C(()=>({...Yc,...t.props.nodeTypes})));Ve(this,Q,C(()=>({...Xc,...t.props.edgeTypes})));Ve(this,$,C(()=>t.props.noPanClass??"nopan"));Ve(this,se,C(()=>t.props.noDragClass??"nodrag"));Ve(this,W,C(()=>t.props.noWheelClass??"nowheel"));Ve(this,B,C(()=>Dy(t.props.ariaLabelConfig)));Ve(this,ie,xe(Z2(this.nodesInitialized,t.props.fitView,t.props.initialViewport,this.width,this.height,this.nodeLookup)));Ve(this,re,xe(ci));Ve(this,te,C(()=>this._connection.inProgress?{...this._connection,to:so(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection));Ve(this,ge,C(()=>t.props.connectionMode??_r.Strict));Ve(this,he,C(()=>t.props.connectionRadius??20));Ve(this,be,C(()=>t.props.isValidConnection??(()=>!0)));Ve(this,Te,C(()=>t.props.selectNodesOnDrag??!0));Ve(this,ye,C(()=>t.props.defaultMarkerColor===void 0?"#b1b1b7":t.props.defaultMarkerColor));Ve(this,pe,C(()=>Gy(t.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd})));Ve(this,Me,C(()=>t.props.onlyRenderVisibleElements??!1));Ve(this,Pe,C(()=>t.props.onflowerror??Iy));Ve(this,ue,C(()=>t.props.ondelete));Ve(this,le,C(()=>t.props.onbeforedelete));Ve(this,we,C(()=>t.props.onbeforeconnect));Ve(this,Ne,C(()=>t.props.onconnect));Ve(this,Se,C(()=>t.props.onconnectstart));Ve(this,ze,C(()=>t.props.onconnectend));Ve(this,me,C(()=>t.props.onbeforereconnect));Ve(this,Ee,C(()=>t.props.onreconnect));Ve(this,Ae,C(()=>t.props.onreconnectstart));Ve(this,Ke,C(()=>t.props.onreconnectend));Ve(this,at,C(()=>t.props.clickConnect??!0));Ve(this,Be,C(()=>t.props.onclickconnectstart));Ve(this,Qe,C(()=>t.props.onclickconnectend));Ve(this,dt,xe(null));Ve(this,vt,C(()=>t.props.onselectiondrag));Ve(this,Ge,C(()=>t.props.onselectiondragstart));Ve(this,Re,C(()=>t.props.onselectiondragstop));wt(this,"resolveFitView",async()=>{var G;this.panZoom&&(await zy({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 X2("(prefers-color-scheme: dark)",t.props.colorModeSSR==="dark"));Ve(this,Ie,C(()=>t.props.colorMode==="system"?this._prefersDark.current?"dark":"light":t.props.colorMode??"light"))}get flowId(){return r(de(this,n))}set flowId(G){P(de(this,n),G)}get domNode(){return r(de(this,o))}set domNode(G){P(de(this,o),G)}get panZoom(){return r(de(this,a))}set panZoom(G){P(de(this,a),G)}get width(){return r(de(this,s))}set width(G){P(de(this,s),G)}get height(){return r(de(this,i))}set height(G){P(de(this,i),G)}get zIndexMode(){return r(de(this,l))}set zIndexMode(G){P(de(this,l),G)}get nodesInitialized(){return r(de(this,u))}set nodesInitialized(G){P(de(this,u),G)}get viewportInitialized(){return r(de(this,f))}set viewportInitialized(G){P(de(this,f),G)}get _edges(){return r(de(this,v))}set _edges(G){P(de(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(de(this,x))}set selectedNodes(G){P(de(this,x),G)}get selectedEdges(){return r(de(this,p))}set selectedEdges(G){P(de(this,p),G)}get visible(){return r(de(this,w))}set visible(G){P(de(this,w),G)}get nodesDraggable(){return r(de(this,_))}set nodesDraggable(G){P(de(this,_),G)}get nodesConnectable(){return r(de(this,A))}set nodesConnectable(G){P(de(this,A),G)}get elementsSelectable(){return r(de(this,F))}set elementsSelectable(G){P(de(this,F),G)}get nodesFocusable(){return r(de(this,D))}set nodesFocusable(G){P(de(this,D),G)}get edgesFocusable(){return r(de(this,L))}set edgesFocusable(G){P(de(this,L),G)}get disableKeyboardA11y(){return r(de(this,H))}set disableKeyboardA11y(G){P(de(this,H),G)}get minZoom(){return r(de(this,V))}set minZoom(G){P(de(this,V),G)}get maxZoom(){return r(de(this,q))}set maxZoom(G){P(de(this,q),G)}get nodeOrigin(){return r(de(this,ee))}set nodeOrigin(G){P(de(this,ee),G)}get nodeExtent(){return r(de(this,oe))}set nodeExtent(G){P(de(this,oe),G)}get translateExtent(){return r(de(this,ae))}set translateExtent(G){P(de(this,ae),G)}get defaultEdgeOptions(){return r(de(this,ne))}set defaultEdgeOptions(G){P(de(this,ne),G)}get nodeDragThreshold(){return r(de(this,ve))}set nodeDragThreshold(G){P(de(this,ve),G)}get autoPanOnNodeDrag(){return r(de(this,R))}set autoPanOnNodeDrag(G){P(de(this,R),G)}get autoPanOnConnect(){return r(de(this,y))}set autoPanOnConnect(G){P(de(this,y),G)}get autoPanOnNodeFocus(){return r(de(this,M))}set autoPanOnNodeFocus(G){P(de(this,M),G)}get autoPanSpeed(){return r(de(this,m))}set autoPanSpeed(G){P(de(this,m),G)}get connectionDragThreshold(){return r(de(this,E))}set connectionDragThreshold(G){P(de(this,E),G)}get snapGrid(){return r(de(this,N))}set snapGrid(G){P(de(this,N),G)}get dragging(){return r(de(this,O))}set dragging(G){P(de(this,O),G)}get selectionRect(){return r(de(this,K))}set selectionRect(G){P(de(this,K),G)}get selectionKeyPressed(){return r(de(this,Z))}set selectionKeyPressed(G){P(de(this,Z),G)}get multiselectionKeyPressed(){return r(de(this,z))}set multiselectionKeyPressed(G){P(de(this,z),G)}get deleteKeyPressed(){return r(de(this,b))}set deleteKeyPressed(G){P(de(this,b),G)}get panActivationKeyPressed(){return r(de(this,k))}set panActivationKeyPressed(G){P(de(this,k),G)}get zoomActivationKeyPressed(){return r(de(this,I))}set zoomActivationKeyPressed(G){P(de(this,I),G)}get selectionRectMode(){return r(de(this,U))}set selectionRectMode(G){P(de(this,U),G)}get ariaLiveMessage(){return r(de(this,ce))}set ariaLiveMessage(G){P(de(this,ce),G)}get selectionMode(){return r(de(this,J))}set selectionMode(G){P(de(this,J),G)}get nodeTypes(){return r(de(this,Y))}set nodeTypes(G){P(de(this,Y),G)}get edgeTypes(){return r(de(this,Q))}set edgeTypes(G){P(de(this,Q),G)}get noPanClass(){return r(de(this,$))}set noPanClass(G){P(de(this,$),G)}get noDragClass(){return r(de(this,se))}set noDragClass(G){P(de(this,se),G)}get noWheelClass(){return r(de(this,W))}set noWheelClass(G){P(de(this,W),G)}get ariaLabelConfig(){return r(de(this,B))}set ariaLabelConfig(G){P(de(this,B),G)}get _viewport(){return r(de(this,ie))}set _viewport(G){P(de(this,ie),G)}get viewport(){return t.viewport??this._viewport}set viewport(G){t.viewport&&(t.viewport=G),this._viewport=G}get _connection(){return r(de(this,re))}set _connection(G){P(de(this,re),G)}get connection(){return r(de(this,te))}set connection(G){P(de(this,te),G)}get connectionMode(){return r(de(this,ge))}set connectionMode(G){P(de(this,ge),G)}get connectionRadius(){return r(de(this,he))}set connectionRadius(G){P(de(this,he),G)}get isValidConnection(){return r(de(this,be))}set isValidConnection(G){P(de(this,be),G)}get selectNodesOnDrag(){return r(de(this,Te))}set selectNodesOnDrag(G){P(de(this,Te),G)}get defaultMarkerColor(){return r(de(this,ye))}set defaultMarkerColor(G){P(de(this,ye),G)}get markers(){return r(de(this,pe))}set markers(G){P(de(this,pe),G)}get onlyRenderVisibleElements(){return r(de(this,Me))}set onlyRenderVisibleElements(G){P(de(this,Me),G)}get onerror(){return r(de(this,Pe))}set onerror(G){P(de(this,Pe),G)}get ondelete(){return r(de(this,ue))}set ondelete(G){P(de(this,ue),G)}get onbeforedelete(){return r(de(this,le))}set onbeforedelete(G){P(de(this,le),G)}get onbeforeconnect(){return r(de(this,we))}set onbeforeconnect(G){P(de(this,we),G)}get onconnect(){return r(de(this,Ne))}set onconnect(G){P(de(this,Ne),G)}get onconnectstart(){return r(de(this,Se))}set onconnectstart(G){P(de(this,Se),G)}get onconnectend(){return r(de(this,ze))}set onconnectend(G){P(de(this,ze),G)}get onbeforereconnect(){return r(de(this,me))}set onbeforereconnect(G){P(de(this,me),G)}get onreconnect(){return r(de(this,Ee))}set onreconnect(G){P(de(this,Ee),G)}get onreconnectstart(){return r(de(this,Ae))}set onreconnectstart(G){P(de(this,Ae),G)}get onreconnectend(){return r(de(this,Ke))}set onreconnectend(G){P(de(this,Ke),G)}get clickConnect(){return r(de(this,at))}set clickConnect(G){P(de(this,at),G)}get onclickconnectstart(){return r(de(this,Be))}set onclickconnectstart(G){P(de(this,Be),G)}get onclickconnectend(){return r(de(this,Qe))}set onclickconnectend(G){P(de(this,Qe),G)}get clickConnectStartHandle(){return r(de(this,dt))}set clickConnectStartHandle(G){P(de(this,dt),G)}get onselectiondrag(){return r(de(this,vt))}set onselectiondrag(G){P(de(this,vt),G)}get onselectiondragstart(){return r(de(this,Ge))}set onselectiondragstart(G){P(de(this,Ge),G)}get onselectiondragstop(){return r(de(this,Re))}set onselectiondragstop(G){P(de(this,Re),G)}get colorMode(){return r(de(this,Ie))}set colorMode(G){P(de(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,A=new WeakMap,F=new WeakMap,D=new WeakMap,L=new WeakMap,H=new WeakMap,V=new WeakMap,q=new WeakMap,ee=new WeakMap,oe=new WeakMap,ae=new WeakMap,ne=new WeakMap,ve=new WeakMap,R=new WeakMap,y=new WeakMap,M=new WeakMap,m=new WeakMap,E=new WeakMap,N=new WeakMap,O=new WeakMap,K=new WeakMap,Z=new WeakMap,z=new WeakMap,b=new WeakMap,k=new WeakMap,I=new WeakMap,U=new WeakMap,ce=new WeakMap,J=new WeakMap,Y=new WeakMap,Q=new WeakMap,$=new WeakMap,se=new WeakMap,W=new WeakMap,B=new WeakMap,ie=new WeakMap,re=new WeakMap,te=new WeakMap,ge=new WeakMap,he=new WeakMap,be=new WeakMap,Te=new WeakMap,ye=new WeakMap,pe=new WeakMap,Me=new WeakMap,Pe=new WeakMap,ue=new WeakMap,le=new WeakMap,we=new WeakMap,Ne=new WeakMap,Se=new WeakMap,ze=new WeakMap,me=new WeakMap,Ee=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 Q2(t){const e=$2(t);function n(R){e.nodeTypes={...Yc,...R}}function o(R){e.edgeTypes={...Xc,...R}}function a(R){e.edges=jy(R,e.edges)}const s=(R,y=!1)=>{e.nodes=e.nodes.map(M=>{if(e.connection.inProgress&&e.connection.fromNode.id===M.id){const E=e.nodeLookup.get(M.id);E&&(e.connection={...e.connection,from:Jn(E,e.connection.fromHandle,ft.Left,!0)})}const m=R.get(M.id);return m?{...M,position:m.position,dragging:y}:M})};function i(R){var E,N,O;const{changes:y,updatedInternals:M}=o2(R,e.nodeLookup,e.parentLookup,e.domNode,e.nodeOrigin,e.nodeExtent,e.zIndexMode);if(!M)return;Qy(e.nodeLookup,e.parentLookup,{nodeOrigin:e.nodeOrigin,nodeExtent:e.nodeExtent,zIndexMode:e.zIndexMode}),e.fitViewQueued&&e.resolveFitView();const m=new Map;for(const K of y){const Z=(E=e.nodeLookup.get(K.id))==null?void 0:E.internals.userNode;if(!Z)continue;const z={...Z};switch(K.type){case"dimensions":{const b={...z.measured,...K.dimensions};K.setAttributes&&(z.width=((N=K.dimensions)==null?void 0:N.width)??z.width,z.height=((O=K.dimensions)==null?void 0:O.height)??z.height),z.measured=b;break}case"position":z.position=K.position??z.position;break}m.set(K.id,z)}e.nodes=e.nodes.map(K=>m.get(K.id)??K)}function l(R){const y=e.fitViewResolver??Promise.withResolvers();return e.fitViewQueued=!0,e.fitViewOptions=R,e.fitViewResolver=y,e.nodes=[...e.nodes],y.promise}async function u(R,y,M){const m=typeof(M==null?void 0:M.zoom)<"u"?M.zoom:e.maxZoom,E=e.panZoom;return E?(await E.setViewport({x:e.width/2-R*m,y:e.height/2-y*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(R,y){const M=e.panZoom;return M?M.scaleBy(R,y):Promise.resolve(!1)}function v(R){return f(1.2,R)}function x(R){return f(1/1.2,R)}function p(R){const y=e.panZoom;y&&(y.setScaleExtent([R,e.maxZoom]),e.minZoom=R)}function w(R){const y=e.panZoom;y&&(y.setScaleExtent([e.minZoom,R]),e.maxZoom=R)}function _(R){const y=e.panZoom;y&&(y.setTranslateExtent(R),e.translateExtent=R)}function A(R,y=null){let M=!1;const m=R.map(E=>(y?y.has(E.id):!0)&&E.selected?(M=!0,{...E,selected:!1}):E);return[M,m]}function F(R){const y=R!=null&&R.nodes?new Set(R.nodes.map(K=>K.id)):null,[M,m]=A(e.nodes,y);M&&(e.nodes=m);const E=R!=null&&R.edges?new Set(R.edges.map(K=>K.id)):null,[N,O]=A(e.edges,E);N&&(e.edges=O)}function D(R){const y=e.multiselectionKeyPressed;e.nodes=e.nodes.map(M=>{const m=R.includes(M.id),E=y&&M.selected||m;return!!M.selected!==E?{...M,selected:E}:M}),y||F({nodes:[]})}function L(R){const y=e.multiselectionKeyPressed;e.edges=e.edges.map(M=>{const m=R.includes(M.id),E=y&&M.selected||m;return!!M.selected!==E?{...M,selected:E}:M}),y||F({edges:[]})}function H(R,y,M){const m=e.nodeLookup.get(R);if(!m){console.warn("012",Br.error012(R));return}e.selectionRect=null,e.selectionRectMode=null,m.selected?(y||m.selected&&e.multiselectionKeyPressed)&&(F({nodes:[m],edges:[]}),requestAnimationFrame(()=>M==null?void 0:M.blur())):D([R])}function V(R){const y=e.edgeLookup.get(R);if(!y){console.warn("012",Br.error012(R));return}(y.selectable||e.elementsSelectable&&typeof y.selectable>"u")&&(e.selectionRect=null,e.selectionRectMode=null,y.selected?y.selected&&e.multiselectionKeyPressed&&F({nodes:[],edges:[y]}):L([R]))}function q(R,y){const{nodeExtent:M,snapGrid:m,nodeOrigin:E,nodeLookup:N,nodesDraggable:O,onerror:K}=e,Z=new Map,z=(m==null?void 0:m[0])??5,b=(m==null?void 0:m[1])??5,k=R.x*z*y,I=R.y*b*y;for(const U of N.values()){if(!(U.selected&&(U.draggable||O&&typeof U.draggable>"u")))continue;let J={x:U.internals.positionAbsolute.x+k,y:U.internals.positionAbsolute.y+I};m&&(J=io(J,m));const{position:Y,positionAbsolute:Q}=Nc({nodeId:U.id,nextPosition:J,nodeLookup:N,nodeExtent:M,nodeOrigin:E,onError:K});U.position=Y,U.internals.positionAbsolute=Q,Z.set(U.id,U)}s(Z)}function ee(R){return a2({delta:R,panZoom:e.panZoom,transform:[e.viewport.x,e.viewport.y,e.viewport.zoom],translateExtent:e.translateExtent,width:e.width,height:e.height})}const oe=R=>{e._connection={...R}};function ae(){e._connection=ci}function ne(){e.resetStoreValues(),F()}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:F,addSelectedNodes:D,addSelectedEdges:L,handleNodeSelection:H,handleEdgeSelection:V,moveSelectedNodes:q,panBy:ee,updateConnection:oe,cancelConnection:ae,reset:ne})}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=w2({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 J2=S('<div class="svelte-flow__zoom svelte-flow__container"><!></div>');function ew(t,e){Ze(e,!0);let n=Fe(e,"store",15),o=C(()=>n().panActivationKeyPressed||e.panOnDrag),a=C(()=>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=J2(),u=d(l);kt(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),$e()}function el(t,e){return n=>{n.target===e&&(t==null||t(n))}}function tl(t){return e=>{const n=t.has(e.id);return!!e.selected!==n?{...e,selected:n}:e}}function nl(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}var tw=S("<div><!></div>");function nw(t,e){Ze(e,!0);let n=Fe(e,"store",15),o=Fe(e,"panOnDrag",3,!0),a=Fe(e,"paneClickDistance",3,1),s,i=null,l=new Set,u=new Set,f=C(()=>n().panActivationKeyPressed||o()),v=C(()=>n().selectionKeyPressed||!!n().selectionRect||e.selectionOnDrag&&r(f)!==!0),x=C(()=>n().elementsSelectable&&(r(v)||n().selectionRectMode==="user")),p=!1;function w(ae){var m,E;if(i=s==null?void 0:s.getBoundingClientRect(),!i)return;const ne=ae.target===s,ve=!ne&&!!ae.target.closest(".nokey"),R=e.selectionOnDrag&&ne||n().selectionKeyPressed;if(ve||!r(v)||!R||ae.button!==0||!ae.isPrimary)return;(E=(m=ae.target)==null?void 0:m.setPointerCapture)==null||E.call(m,ae.pointerId),p=!1;const{x:y,y:M}=fn(ae,i);n(n().selectionRect={width:0,height:0,startX:y,startY:M,x:y,y:M},!0),ne||(ae.stopPropagation(),ae.preventDefault())}function _(ae){var N;if(!r(v)||!i||!n().selectionRect)return;const ne=fn(ae,i),{startX:ve=0,startY:R=0}=n().selectionRect;if(!p){const O=n().selectionKeyPressed?0:a();if(Math.hypot(ne.x-ve,ne.y-R)<=O)return;n().unselectNodesAndEdges(),(N=e.onselectionstart)==null||N.call(e,ae)}p=!0;const y={...n().selectionRect,x:ne.x<ve?ne.x:ve,y:ne.y<R?ne.y:R,width:Math.abs(ne.x-ve),height:Math.abs(ne.y-R)},M=l,m=u;l=new Set(Ii(n().nodeLookup,y,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===Uo.Partial,!0).map(O=>O.id));const E=n().defaultEdgeOptions.selectable??!0;u=new Set;for(const O of l){const K=n().connectionLookup.get(O);if(K)for(const{edgeId:Z}of K.values()){const z=n().edgeLookup.get(Z);z&&(z.selectable??E)&&u.add(Z)}}nl(M,l)||n(n().nodes=n().nodes.map(tl(l)),!0),nl(m,u)||n(n().edges=n().edges.map(tl(u)),!0),n(n().selectionRectMode="user",!0),n(n().selectionRect=y,!0)}function A(ae){var ne,ve,R;ae.button===0&&((ve=(ne=ae.target)==null?void 0:ne.releasePointerCapture)==null||ve.call(ne,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&&((R=e.onselectionend)==null||R.call(e,ae)))}const F=ae=>{var ne;if(Array.isArray(r(f))&&r(f).includes(2)){ae.preventDefault();return}(ne=e.onpanecontextmenu)==null||ne.call(e,{event:ae})},D=ae=>{p&&(ae.stopPropagation(),p=!1)};function L(ae){var ne;if(p||n().connection.inProgress){p=!1;return}(ne=e.onpaneclick)==null||ne.call(e,{event:ae}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var H=tw();let V;var q=C(()=>r(x)?void 0:el(L,s)),ee=C(()=>el(F,s)),oe=d(H);kt(oe,()=>e.children),c(H),on(H,ae=>s=ae,()=>s),j(ae=>V=Oe(H,1,"svelte-flow__pane svelte-flow__container",null,V,ae),[()=>({draggable:o()===!0||Array.isArray(o())&&o().includes(0),dragging:n().dragging,selection:r(v)})]),_e("click",H,function(...ae){var ne;(ne=r(q))==null||ne.apply(this,ae)}),Rn("pointerdown",H,function(...ae){var ne;(ne=r(x)?w:void 0)==null||ne.apply(this,ae)},!0),_e("pointermove",H,function(...ae){var ne;(ne=r(x)?_:void 0)==null||ne.apply(this,ae)}),_e("pointerup",H,function(...ae){var ne;(ne=r(x)?A:void 0)==null||ne.apply(this,ae)}),_e("contextmenu",H,function(...ae){var ne;(ne=r(ee))==null||ne.apply(this,ae)}),Rn("click",H,function(...ae){var ne;(ne=r(x)?D:void 0)==null||ne.apply(this,ae)},!0),h(t,H),$e()}Nt(["click","pointermove","pointerup","contextmenu"]);var rw=S('<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>');function ow(t,e){Ze(e,!0);var n=rw();let o;var a=d(n);kt(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),$e()}function pr(t,e){const{store:n,onDrag:o,onDragStart:a,onDragStop:s,onNodeMouseDown:i}=e,l=c2({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 aw=S('<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-1r7ybe1"> </div>'),iw=S('<div class="a11y-hidden svelte-1r7ybe1"> </div> <div class="a11y-hidden svelte-1r7ybe1"> </div> <!>',1);function sw(t,e){Ze(e,!0);var n=iw(),o=fe(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=aw(),x=d(v,!0);c(v),j(()=>{ke(v,"id",`${lw}-${e.store.flowId}`),T(x,e.store.ariaLiveMessage)}),h(f,v)};X(l,f=>{e.store.disableKeyboardA11y||f(u)})}j(()=>{ke(o,"id",`${Gc}-${e.store.flowId}`),T(a,e.store.disableKeyboardA11y?e.store.ariaLabelConfig["node.a11yDescription.default"]:e.store.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]),ke(s,"id",`${Zc}-${e.store.flowId}`),T(i,e.store.ariaLabelConfig["edge.a11yDescription.default"])}),h(t,n),$e()}const Gc="svelte-flow__node-desc",Zc="svelte-flow__edge-desc",lw="svelte-flow__aria-live";var cw=S("<div><!></div>");function dw(t,e){Ze(e,!0);let n=Fe(e,"store",15),o=C(()=>Yt(e.node.data,()=>({}),!0)),a=C(()=>Yt(e.node.selected,!1)),s=C(()=>e.node.draggable),i=C(()=>e.node.selectable),l=C(()=>Yt(e.node.deletable,!0)),u=C(()=>e.node.connectable),f=C(()=>e.node.focusable),v=C(()=>Yt(e.node.hidden,!1)),x=C(()=>Yt(e.node.dragging,!1)),p=C(()=>Yt(e.node.style,"")),w=C(()=>e.node.class),_=C(()=>Yt(e.node.type,"default")),A=C(()=>e.node.parentId),F=C(()=>e.node.sourcePosition),D=C(()=>e.node.targetPosition),L=C(()=>Yt(e.node.measured,()=>({width:0,height:0}),!0).width),H=C(()=>Yt(e.node.measured,()=>({width:0,height:0}),!0).height),V=C(()=>e.node.initialWidth),q=C(()=>e.node.initialHeight),ee=C(()=>e.node.width),oe=C(()=>e.node.height),ae=C(()=>e.node.dragHandle),ne=C(()=>Yt(e.node.internals.z,0)),ve=C(()=>e.node.internals.positionAbsolute.x),R=C(()=>e.node.internals.positionAbsolute.y),y=C(()=>e.node.internals.userNode),{id:M}=e.node,m=C(()=>r(s)??n().nodesDraggable),E=C(()=>r(i)??n().elementsSelectable),N=C(()=>r(u)??n().nodesConnectable),O=C(()=>Oy(e.node)),K=C(()=>!!e.node.internals.handleBounds),Z=C(()=>r(O)&&r(K)),z=C(()=>r(f)??n().nodesFocusable);function b(be){return n().parentLookup.has(be)}let k=C(()=>b(M)),I=xe(null),U=null,ce=r(_),J=r(F),Y=r(D),Q=C(()=>n().nodeTypes[r(_)]??Wc),$=C(()=>n().ariaLabelConfig),se={get value(){return r(N)}};S2(M),N2(se);let W=C(()=>{const be=r(L)===void 0?r(ee)??r(V):r(ee),Te=r(H)===void 0?r(oe)??r(q):r(oe);if(!(be===void 0&&Te===void 0&&r(p)===void 0))return`${r(p)};${be?`width:${_n(be)};`:""}${Te?`height:${_n(Te)};`:""}`});It(()=>{(r(_)!==ce||r(F)!==J||r(D)!==Y)&&r(I)!==null&&requestAnimationFrame(()=>{r(I)!==null&&n().updateNodeInternals(new Map([[M,{id:M,nodeElement:r(I),force:!0}]]))}),ce=r(_),J=r(F),Y=r(D)}),It(()=>{e.resizeObserver&&(!r(Z)||r(I)!==U)&&(U&&e.resizeObserver.unobserve(U),r(I)&&e.resizeObserver.observe(r(I)),U=r(I))}),ra(()=>{var be;U&&((be=e.resizeObserver)==null||be.unobserve(U))});function B(be){var Te;r(E)&&(!n().selectNodesOnDrag||!r(m)||n().nodeDragThreshold>0)&&n().handleNodeSelection(M),(Te=e.onnodeclick)==null||Te.call(e,{node:r(y),event:be})}function ie(be){if(!(Pc(be)||n().disableKeyboardA11y))if(Sc.includes(be.key)&&r(E)){const Te=be.key==="Escape";n().handleNodeSelection(M,Te,r(I))}else r(m)&&e.node.selected&&Object.prototype.hasOwnProperty.call($o,be.key)&&(be.preventDefault(),n(n().ariaLiveMessage=r($)["node.a11yDescription.ariaLiveMessage"]({direction:be.key.replace("Arrow","").toLowerCase(),x:~~e.node.internals.positionAbsolute.x,y:~~e.node.internals.positionAbsolute.y}),!0),n().moveSelectedNodes($o[be.key],be.shiftKey?4:1))}const re=()=>{var Me;if(n().disableKeyboardA11y||!n().autoPanOnNodeFocus||!((Me=r(I))!=null&&Me.matches(":focus-visible")))return;const{width:be,height:Te,viewport:ye}=n();Ii(new Map([[M,e.node]]),{x:0,y:0,width:be,height:Te},[ye.x,ye.y,ye.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:ye.zoom})};var te=He(),ge=fe(te);{var he=be=>{var Te=cw();Dn(Te,()=>({"data-id":M,class:["svelte-flow__node",`svelte-flow__node-${r(_)}`,r(w)],style:r(W),onclick:B,onpointerenter:e.onnodepointerenter?pe=>e.onnodepointerenter({node:r(y),event:pe}):void 0,onpointerleave:e.onnodepointerleave?pe=>e.onnodepointerleave({node:r(y),event:pe}):void 0,onpointermove:e.onnodepointermove?pe=>e.onnodepointermove({node:r(y),event:pe}):void 0,oncontextmenu:e.onnodecontextmenu?pe=>e.onnodecontextmenu({node:r(y),event:pe}):void 0,onkeydown:r(z)?ie:void 0,onfocus:r(z)?re:void 0,tabIndex:r(z)?0:void 0,role:e.node.ariaRole??(r(z)?"group":void 0),"aria-roledescription":"node","aria-describedby":n().disableKeyboardA11y?void 0:`${Gc}-${n().flowId}`,...e.node.domAttributes,[bi]:{dragging:r(x),selected:r(a),draggable:r(m),connectable:r(N),selectable:r(E),nopan:r(m),parent:r(k)},[aa]:{"z-index":r(ne),transform:`translate(${r(ve)??""}px, ${r(R)??""}px)`,visibility:r(O)?"visible":"hidden"}}));var ye=d(Te);Gn(ye,()=>r(Q),(pe,Me)=>{Me(pe,{get data(){return r(o)},get id(){return M},get selected(){return r(a)},get selectable(){return r(E)},get deletable(){return r(l)},get sourcePosition(){return r(F)},get targetPosition(){return r(D)},get zIndex(){return r(ne)},get dragging(){return r(x)},get draggable(){return r(m)},get dragHandle(){return r(ae)},get parentId(){return r(A)},get type(){return r(_)},get isConnectable(){return r(N)},get positionAbsoluteX(){return r(ve)},get positionAbsoluteY(){return r(R)},get width(){return r(ee)},get height(){return r(oe)}})}),c(Te),Xt(Te,(pe,Me)=>pr==null?void 0:pr(pe,Me),()=>({nodeId:M,isSelectable:r(E),disabled:!r(m),handleSelector:r(ae),noDragClass:n().noDragClass,nodeClickDistance:e.nodeClickDistance,onNodeMouseDown:n().handleNodeSelection,onDrag:(pe,Me,Pe,ue)=>{var le;(le=e.onnodedrag)==null||le.call(e,{event:pe,targetNode:Pe,nodes:ue})},onDragStart:(pe,Me,Pe,ue)=>{var le;(le=e.onnodedragstart)==null||le.call(e,{event:pe,targetNode:Pe,nodes:ue})},onDragStop:(pe,Me,Pe,ue)=>{var le;(le=e.onnodedragstop)==null||le.call(e,{event:pe,targetNode:Pe,nodes:ue})},store:n()})),on(Te,pe=>P(I,pe),()=>r(I)),h(be,Te)};X(ge,be=>{r(v)||be(he)})}h(t,te),$e()}var uw=S('<div class="svelte-flow__nodes"></div>');function fw(t,e){Ze(e,!0);let n=Fe(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=uw();Je(a,21,()=>n().visible.nodes.values(),s=>s.id,(s,i)=>{dw(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),$e()}var vw=Dt('<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>');function gw(t,e){Ze(e,!0);let n=C(()=>e.edge.id),o=C(()=>e.edge.source),a=C(()=>e.edge.target),s=C(()=>e.edge.sourceX),i=C(()=>e.edge.sourceY),l=C(()=>e.edge.targetX),u=C(()=>e.edge.targetY),f=C(()=>e.edge.sourcePosition),v=C(()=>e.edge.targetPosition),x=C(()=>Yt(e.edge.animated,!1)),p=C(()=>Yt(e.edge.selected,!1)),w=C(()=>e.edge.label),_=C(()=>e.edge.labelStyle),A=C(()=>Yt(e.edge.data,()=>({}),!0)),F=C(()=>e.edge.style),D=C(()=>e.edge.interactionWidth),L=C(()=>Yt(e.edge.type,"default")),H=C(()=>e.edge.sourceHandle),V=C(()=>e.edge.targetHandle),q=C(()=>e.edge.markerStart),ee=C(()=>e.edge.markerEnd),oe=C(()=>e.edge.selectable),ae=C(()=>e.edge.focusable),ne=C(()=>Yt(e.edge.deletable,!0)),ve=C(()=>e.edge.hidden),R=C(()=>e.edge.zIndex),y=C(()=>e.edge.class),M=C(()=>e.edge.ariaLabel);M2(r(n));let m=null,E=C(()=>r(oe)??e.store.elementsSelectable),N=C(()=>r(ae)??e.store.edgesFocusable),O=C(()=>e.store.edgeTypes[r(L)]??Uc),K=C(()=>r(q)?`url('#${ui(r(q),e.store.flowId)}')`:void 0),Z=C(()=>r(ee)?`url('#${ui(r(ee),e.store.flowId)}')`:void 0);function z(J){var Q;const Y=e.store.edgeLookup.get(r(n));Y&&(r(E)&&e.store.handleEdgeSelection(r(n)),(Q=e.onedgeclick)==null||Q.call(e,{event:J,edge:Y}))}function b(J,Y){const Q=e.store.edgeLookup.get(r(n));Q&&Y({event:J,edge:Q})}function k(J){if(!e.store.disableKeyboardA11y&&Sc.includes(J.key)&&r(E)){const{unselectNodesAndEdges:Y,addSelectedEdges:Q}=e.store;J.key==="Escape"?(m==null||m.blur(),Y({edges:[e.edge]})):Q([r(n)])}}var I=He(),U=fe(I);{var ce=J=>{var Y=vw();let Q;var $=d(Y);Dn($,()=>({class:["svelte-flow__edge",r(y)],"data-id":r(n),onclick:z,oncontextmenu:e.onedgecontextmenu?W=>{b(W,e.onedgecontextmenu)}:void 0,onpointerenter:e.onedgepointerenter?W=>{b(W,e.onedgepointerenter)}:void 0,onpointerleave:e.onedgepointerleave?W=>{b(W,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(N)?`${Zc}-${e.store.flowId}`:void 0,role:e.edge.ariaRole??(r(N)?"group":"img"),"aria-roledescription":"edge",onkeydown:r(N)?k:void 0,tabindex:r(N)?0:void 0,...e.edge.domAttributes,[bi]:{animated:r(x),selected:r(p),selectable:r(E)}}));var se=d($);Gn(se,()=>r(O),(W,B)=>{B(W,{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(A)},get style(){return r(F)},get interactionWidth(){return r(D)},get selectable(){return r(E)},get deletable(){return r(ne)},get type(){return r(L)},get sourceHandleId(){return r(H)},get targetHandleId(){return r(V)},get markerStart(){return r(K)},get markerEnd(){return r(Z)}})}),c($),on($,W=>m=W,()=>m),c(Y),j(()=>Q=$t(Y,"",Q,{"z-index":r(R)})),h(J,Y)};X(U,J=>{r(ve)||J(ce)})}h(t,I),$e()}var pw=Dt("<defs></defs>");function hw(t,e){Ze(e,!1);const n=rr();Ud();var o=pw();Je(o,5,()=>n.markers,a=>a.id,(a,s)=>{_w(a,et(()=>r(s)))}),c(o),h(t,o),$e()}var xw=Dt('<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>'),bw=Dt('<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),mw=Dt('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function _w(t,e){Ze(e,!0);let n=Fe(e,"width",3,12.5),o=Fe(e,"height",3,12.5),a=Fe(e,"markerUnits",3,"strokeWidth"),s=Fe(e,"orient",3,"auto-start-reverse"),i=Fe(e,"color",3,"none");var l=mw(),u=d(l);{var f=x=>{var p=xw();let w;j(()=>{ke(p,"stroke-width",e.strokeWidth),w=$t(p,"",w,{stroke:i()})}),h(x,p)},v=x=>{var p=bw();let w;j(()=>{ke(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(()=>{ke(l,"id",e.id),ke(l,"markerWidth",`${n()}`),ke(l,"markerHeight",`${o()}`),ke(l,"markerUnits",a()),ke(l,"orient",s())}),h(t,l),$e()}var yw=S('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>');function ww(t,e){Ze(e,!0);let n=Fe(e,"store",15);var o=yw(),a=d(o),s=d(a);hw(s,{}),c(a);var i=g(a,2);Je(i,17,()=>n().visible.edges.values(),l=>l.id,(l,u)=>{gw(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),$e()}var kw=S('<div class="svelte-flow__selection svelte-3lfgml"></div>');function $c(t,e){Ze(e,!0);let n=Fe(e,"x",3,0),o=Fe(e,"y",3,0),a=Fe(e,"width",3,0),s=Fe(e,"height",3,0),i=Fe(e,"isVisible",3,!0);var l=He(),u=fe(l);{var f=v=>{var x=kw();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),$e()}var Sw=S("<div><!></div>");function Cw(t,e){Ze(e,!0);let n=xe(void 0);It(()=>{var x;e.store.disableKeyboardA11y||(x=r(n))==null||x.focus({preventScroll:!0})});let o=C(()=>{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($o,x.key)&&(x.preventDefault(),e.store.moveSelectedNodes($o[x.key],x.shiftKey?4:1))}var l=He(),u=fe(l);{var f=x=>{var p=Sw();let w;var _=d(p);$c(_,{width:"100%",height:"100%",x:0,y:0}),c(p),Xt(p,(A,F)=>pr==null?void 0:pr(A,F),()=>({disabled:!1,store:e.store,onDrag:(A,F,D,L)=>{var H;(H=e.onnodedrag)==null||H.call(e,{event:A,targetNode:null,nodes:L})},onDragStart:(A,F,D,L)=>{var H;(H=e.onnodedragstart)==null||H.call(e,{event:A,targetNode:null,nodes:L})},onDragStop:(A,F,D,L)=>{var H;(H=e.onnodedragstop)==null||H.call(e,{event:A,targetNode:null,nodes:L})}})),on(p,A=>P(n,A),()=>r(n)),j(A=>{Oe(p,1,Ue(["svelte-flow__selection-wrapper",e.store.noPanClass]),"svelte-148ck9l"),ke(p,"role",e.store.disableKeyboardA11y?void 0:"button"),ke(p,"tabindex",e.store.disableKeyboardA11y?void 0:-1),w=$t(p,"",w,A)},[()=>({width:_n(r(o).width),height:_n(r(o).height),transform:`translate(${r(o).x??""}px, ${r(o).y??""}px)`})]),_e("contextmenu",p,a),_e("click",p,s),_e("keydown",p,function(...A){var F;(F=e.store.disableKeyboardA11y?void 0:i)==null||F.apply(this,A)}),h(x,p)},v=C(()=>e.store.selectionRectMode==="nodes"&&r(o)&&En(r(o).x)&&En(r(o).y));X(u,x=>{r(v)&&x(f)})}h(t,l),$e()}Nt(["contextmenu","click","keydown"]);function Nw(t){switch(t){case"ctrl":return 8;case"shift":return 4;case"alt":return 2;case"meta":return 1}}function St(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:A,preventDefault:F,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 H=Array.isArray(w)?w:[w];let V=!1;for(const q of H)if((Array.isArray(q)?q:[q]).reduce((oe,ae)=>oe|Nw(ae),0)===f){V=!0;break}if(!V)continue}F&&l.preventDefault();const L={node:t,trigger:p,originalEvent:l};t.dispatchEvent(new CustomEvent("shortcut",{detail:L})),A==null||A(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 Ew(){const t=C(rr),e=s=>{var f,v;const i=Qs(s)?s:r(t).nodeLookup.get(s.id),l=i.parentId?Ry(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&&Qs(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&&D2(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:rl(r(t).nodeLookup,s),getEdge:s=>r(t).edgeLookup.get(s),getEdges:s=>s===void 0?r(t).edges:rl(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:()=>gl(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=Ai(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 Ty({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=>Ny(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 rl(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 Mw(t,e){Ze(e,!0);let n=Fe(e,"store",15),o=Fe(e,"selectionKey",3,"Shift"),a=Fe(e,"multiSelectionKey",19,()=>Zo()?"Meta":"Control"),s=Fe(e,"deleteKey",3,"Backspace"),i=Fe(e,"panActivationKey",3," "),l=Fe(e,"zoomActivationKey",19,()=>Zo()?"Meta":"Control"),{deleteElements:u}=Ew();function f(A){return A!==null&&typeof A=="object"}function v(A){return f(A)?A.modifier||[]:[]}function x(A){return A==null?"":f(A)?A.key:A}function p(A,F){return(Array.isArray(A)?A:[A]).map(L=>{const H=x(L);return{key:H,modifier:v(L),enabled:H!==null,callback:F}})}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 A=n().nodes.filter(D=>D.selected),F=n().edges.filter(D=>D.selected);u({nodes:A,edges:F})}Rn("blur",tn,w),Rn("contextmenu",tn,w),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(o(),()=>n(n().selectionKeyPressed=!0,!0)),type:"keydown"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(o(),()=>n(n().selectionKeyPressed=!1,!0)),type:"keyup"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(a(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:"keydown"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(a(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:"keyup"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(s(),A=>{!(A.originalEvent.ctrlKey||A.originalEvent.metaKey||A.originalEvent.shiftKey)&&!Pc(A.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),_())}),type:"keydown"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(s(),()=>n(n().deleteKeyPressed=!1,!0)),type:"keyup"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(i(),()=>n(n().panActivationKeyPressed=!0,!0)),type:"keydown"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(i(),()=>n(n().panActivationKeyPressed=!1,!0)),type:"keyup"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(l(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:"keydown"})),Xt(tn,(A,F)=>St==null?void 0:St(A,F),()=>({trigger:p(l(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:"keyup"})),$e()}var zw=Dt('<path fill="none" class="svelte-flow__connection-path"></path>'),Tw=Dt('<svg class="svelte-flow__connectionline"><g><!></g></svg>');function Pw(t,e){Ze(e,!0);let n=C(()=>{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 An.Bezier:{const[l]=Ac(i);return l}case An.Straight:{const[l]=Oc(i);return l}case An.Step:case An.SmoothStep:{const[l]=Li({...i,borderRadius:e.type===An.Step?0:void 0});return l}}});var o=He(),a=fe(o);{var s=i=>{var l=Tw(),u=d(l),f=d(u);{var v=p=>{var w=He(),_=fe(w);Gn(_,()=>e.LineComponent,(A,F)=>{F(A,{})}),h(p,w)},x=p=>{var w=zw();j(()=>{ke(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=>{ke(l,"width",e.store.width),ke(l,"height",e.store.height),$t(l,e.containerStyle),Oe(u,0,p)},[()=>Ue(["svelte-flow__connection",Sy(e.store.connection.isValid)])]),h(i,l)};X(a,i=>{e.store.connection.inProgress&&i(s)})}h(t,o),$e()}var Iw=S("<div><!></div>");function Qc(t,e){Ze(e,!0);let n=Fe(e,"position",3,"top-right"),o=er(e,["$$slots","$$events","$$legacy","position","style","class","children"]),a=C(()=>`${n()}`.split("-"));var s=Iw();Dn(s,l=>({class:l,style:e.style,...o}),[()=>["svelte-flow__panel",e.class,...r(a)]]);var i=d(s);kt(i,()=>e.children??Zt),c(s),h(t,s),$e()}var Aw=S('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function Lw(t,e){Ze(e,!0);let n=Fe(e,"position",3,"bottom-right");var o=He(),a=fe(o);{var s=i=>{Qc(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=Aw();h(l,f)},$$slots:{default:!0}})};X(a,i=>{var l;(l=e.proOptions)!=null&&l.hideAttribution||i(s)})}h(t,o),$e()}var Ow=S("<div><!></div>");function Rw(t,e){Ze(e,!0);let n=Fe(e,"domNode",15),o=Fe(e,"clientWidth",15),a=Fe(e,"clientHeight",15),s=C(()=>e.rest.class),i=C(()=>Id(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=Ow();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);kt(f,()=>e.children??Zt),c(u),on(u,v=>n(v),()=>n()),Zi(u,"clientHeight",a),Zi(u,"clientWidth",o),h(t,u),$e()}var Dw=S('<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),Vw=S("<!> <!>",1),Hw=S("<!> <!> <!> <!> <!>",1);function Fw(t,e){Ze(e,!0);let n=Fe(e,"paneClickDistance",3,1),o=Fe(e,"nodeClickDistance",3,1),a=Fe(e,"panOnScrollMode",19,()=>gr.Free),s=Fe(e,"preventScrolling",3,!0),i=Fe(e,"zoomOnScroll",3,!0),l=Fe(e,"zoomOnDoubleClick",3,!0),u=Fe(e,"zoomOnPinch",3,!0),f=Fe(e,"panOnScroll",3,!1),v=Fe(e,"panOnScrollSpeed",3,.5),x=Fe(e,"panOnDrag",3,!0),p=Fe(e,"selectionOnDrag",3,!1),w=Fe(e,"connectionLineType",19,()=>An.Bezier),_=Fe(e,"nodes",31,()=>Ct([])),A=Fe(e,"edges",31,()=>Ct([])),F=Fe(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=Q2({props:D,width:e.width,height:e.height,get nodes(){return _()},set nodes(V){_(V)},get edges(){return A()},set edges(V){A(V)},get viewport(){return F()},set viewport(V){F(V)}});const H=na(fi);H&&H.setStore&&H.setStore(L),pi(fi,{provider:!1,getStore(){return L}}),It(()=>{var q;const V={nodes:L.selectedNodes,edges:L.selectedEdges};(q=Cn(()=>e.onselectionchange))==null||q(V);for(const ee of L.selectionChangeHandlers.values())ee(V)}),ra(()=>{L.reset()}),Rw(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(V){L.domNode=V},get clientWidth(){return L.width},set clientWidth(V){L.width=V},get clientHeight(){return L.height},set clientHeight(V){L.height=V},children:(V,q)=>{var ee=Hw(),oe=fe(ee);Mw(oe,{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(y){L=y}});var ae=g(oe,2);ew(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(y){L=y},children:(y,M)=>{nw(y,{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,E)=>{var N=Vw(),O=fe(N);ow(O,{get store(){return L},set store(Z){L=Z},children:(Z,z)=>{var b=Dw(),k=g(fe(b),2);ww(k,{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(J){L=J}});var I=g(k,4);Pw(I,{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(J){L=J}});var U=g(I,2);fw(U,{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(J){L=J}});var ce=g(U,2);Cw(ce,{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(J){L=J}}),Ce(2),h(Z,b)},$$slots:{default:!0}});var K=g(O,2);{let Z=C(()=>!!(L.selectionRect&&L.selectionRectMode==="user")),z=C(()=>{var U;return(U=L.selectionRect)==null?void 0:U.width}),b=C(()=>{var U;return(U=L.selectionRect)==null?void 0:U.height}),k=C(()=>{var U;return(U=L.selectionRect)==null?void 0:U.x}),I=C(()=>{var U;return(U=L.selectionRect)==null?void 0:U.y});$c(K,{get isVisible(){return r(Z)},get width(){return r(z)},get height(){return r(b)},get x(){return r(k)},get y(){return r(I)}})}h(m,N)},$$slots:{default:!0}})},$$slots:{default:!0}});var ne=g(ae,2);Lw(ne,{get proOptions(){return e.proOptions},get position(){return e.attributionPosition}});var ve=g(ne,2);sw(ve,{get store(){return L}});var R=g(ve,2);kt(R,()=>e.children??Zt),h(V,ee)},$$slots:{default:!0}}),$e()}var qw=S("<button><!></button>");function Co(t,e){let n=er(e,["$$slots","$$events","$$legacy","class","bgColor","bgColorHover","color","colorHover","borderColor","onclick","children"]);var o=qw();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);kt(a,()=>e.children??Zt),c(o),h(t,o)}var Kw=Dt('<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 Bw(t){var e=Kw();h(t,e)}var jw=Dt('<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=jw();h(t,e)}var Uw=Dt('<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 Yw(t){var e=Uw();h(t,e)}var Xw=Dt('<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 Gw(t){var e=Xw();h(t,e)}var Zw=Dt('<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 $w(t){var e=Zw();h(t,e)}var Qw=S("<!> <!>",1),Jw=S("<!> <!> <!> <!> <!> <!>",1);function e3(t,e){Ze(e,!0);let n=Fe(e,"position",3,"bottom-left"),o=Fe(e,"orientation",3,"vertical"),a=Fe(e,"showZoom",3,!0),s=Fe(e,"showFitView",3,!0),i=Fe(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=C(rr);const f={bgColor:e.buttonBgColor,bgColorHover:e.buttonBgColorHover,color:e.buttonColor,colorHover:e.buttonColorHover,borderColor:e.buttonBorderColor};let v=C(()=>r(u).nodesDraggable||r(u).nodesConnectable||r(u).elementsSelectable),x=C(()=>r(u).viewport.zoom<=r(u).minZoom),p=C(()=>r(u).viewport.zoom>=r(u).maxZoom),w=C(()=>r(u).ariaLabelConfig),_=C(()=>o()==="horizontal"?"horizontal":"vertical");const A=()=>{r(u).zoomIn()},F=()=>{r(u).zoomOut()},D=()=>{r(u).fitView(e.fitViewOptions)},L=()=>{let H=!r(v);r(u).nodesDraggable=H,r(u).nodesConnectable=H,r(u).elementsSelectable=H};{let H=C(()=>["svelte-flow__controls",r(_),e.class]);Qc(t,et({get class(){return r(H)},get position(){return n()},"data-testid":"svelte-flow__controls",get"aria-label"(){return r(w)["controls.ariaLabel"]},get style(){return e.style}},()=>l,{children:(V,q)=>{var ee=Jw(),oe=fe(ee);{var ae=Z=>{var z=He(),b=fe(z);kt(b,()=>e.before),h(Z,z)};X(oe,Z=>{e.before&&Z(ae)})}var ne=g(oe,2);{var ve=Z=>{var z=Qw(),b=fe(z);Co(b,et({onclick:A,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:(I,U)=>{Bw(I)},$$slots:{default:!0}}));var k=g(b,2);Co(k,et({onclick:F,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:(I,U)=>{Ww(I)},$$slots:{default:!0}})),h(Z,z)};X(ne,Z=>{a()&&Z(ve)})}var R=g(ne,2);{var y=Z=>{Co(Z,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:(z,b)=>{Yw(z)},$$slots:{default:!0}}))};X(R,Z=>{s()&&Z(y)})}var M=g(R,2);{var m=Z=>{Co(Z,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:(z,b)=>{var k=He(),I=fe(k);{var U=J=>{$w(J)},ce=J=>{Gw(J)};X(I,J=>{r(v)?J(U):J(ce,-1)})}h(z,k)},$$slots:{default:!0}}))};X(M,Z=>{i()&&Z(m)})}var E=g(M,2);{var N=Z=>{var z=He(),b=fe(z);kt(b,()=>e.children),h(Z,z)};X(E,Z=>{e.children&&Z(N)})}var O=g(E,2);{var K=Z=>{var z=He(),b=fe(z);kt(b,()=>e.after),h(Z,z)};X(O,Z=>{e.after&&Z(K)})}h(V,ee)},$$slots:{default:!0}}))}$e()}var Mn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Mn||(Mn={}));var t3=Dt("<circle></circle>");function n3(t,e){var n=t3();j(()=>{ke(n,"cx",e.radius),ke(n,"cy",e.radius),ke(n,"r",e.radius),Oe(n,0,Ue(["svelte-flow__background-pattern","dots",e.class]))}),h(t,n)}var r3=Dt("<path></path>");function o3(t,e){Ze(e,!0);var n=r3();j(()=>{ke(n,"stroke-width",e.lineWidth),ke(n,"d",`M${e.dimensions[0]/2} 0 V${e.dimensions[1]} M0 ${e.dimensions[1]/2} H${e.dimensions[0]}`),Oe(n,0,Ue(["svelte-flow__background-pattern",e.variant,e.class]))}),h(t,n),$e()}const a3={[Mn.Dots]:1,[Mn.Lines]:1,[Mn.Cross]:6};var i3=Dt('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');function s3(t,e){Ze(e,!0);let n=Fe(e,"variant",19,()=>Mn.Dots),o=Fe(e,"gap",3,20),a=Fe(e,"lineWidth",3,1),s=C(rr),i=C(()=>n()===Mn.Dots),l=C(()=>n()===Mn.Cross),u=C(()=>Array.isArray(o())?o():[o(),o()]),f=C(()=>`background-pattern-${r(s).flowId}-${e.id??""}`),v=C(()=>[r(u)[0]*r(s).viewport.zoom||1,r(u)[1]*r(s).viewport.zoom||1]),x=C(()=>(e.size??a3[n()])*r(s).viewport.zoom),p=C(()=>r(l)?[r(x),r(x)]:r(v)),w=C(()=>r(i)?[r(x)/2,r(x)/2]:[r(p)[0]/2,r(p)[1]/2]);var _=i3();let A;var F=d(_),D=d(F);{var L=q=>{{let ee=C(()=>r(x)/2);n3(q,{get radius(){return r(ee)},get class(){return e.patternClass}})}},H=q=>{o3(q,{get dimensions(){return r(p)},get variant(){return n()},get lineWidth(){return a()},get class(){return e.patternClass}})};X(D,q=>{r(i)?q(L):q(H,-1)})}c(F);var V=g(F);c(_),j(()=>{Oe(_,0,Ue(["svelte-flow__background","svelte-flow__container",e.class])),A=$t(_,"",A,{"--xy-background-color-props":e.bgColor,"--xy-background-pattern-color-props":e.patternColor}),ke(F,"id",r(f)),ke(F,"x",r(s).viewport.x%r(v)[0]),ke(F,"y",r(s).viewport.y%r(v)[1]),ke(F,"width",r(v)[0]),ke(F,"height",r(v)[1]),ke(F,"patternTransform",`translate(-${r(w)[0]},-${r(w)[1]})`),ke(V,"fill",`url(#${r(f)})`)}),h(t,_),$e()}var l3=S('<!> <!> <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 c3(t,e){Ze(e,!0);const n=C(()=>e.data.role==="primary"?"role-primary":e.data.role==="replica"?"role-replica":"role-embedded");var o=l3(),a=fe(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),Ce(2),c(f);var p=g(f,2),w=d(p,!0);c(p);var _=g(p,2),A=d(_),F=d(A),D=d(F,!0);c(F),Ce(),c(A);var L=g(A,4),H=d(L),V=d(H,!0);c(H),Ce(),c(L),c(_),c(u),c(i),j(q=>{l=Oe(i,1,`card ${r(n)??""}`,"svelte-hw5n61",l,{selected:e.selected}),T(x,e.data.role),T(w,e.data.label),T(D,e.data.collections),T(V,q)},[()=>e.data.entities.toLocaleString()]),h(t,o),$e()}var d3=S('<div class="absolute inset-0 grid place-items-center text-fg-3 font-mono text-[12px]">Probing reachable nodes…</div>'),u3=S('<div class="p-6"><!></div>'),f3=S('<div class="p-6"><!></div>'),v3=S("<!> <!>",1),g3=S('<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>'),p3=S('<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),h3=S('<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),x3=S('<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),b3=S('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">lag</span> <span><!></span></div>'),m3=S('<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),_3=S('<div class="pt-2 mt-1 border-t border-line-1"></div> <!>',1),y3=S('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-3"> </span>'),w3=S('<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>'),k3=S('<div class="absolute top-4 right-4 z-10 w-[420px] max-h-[calc(100vh-96px)] overflow-auto"><!></div>'),S3=S('<div class="absolute inset-0"><!></div> <div class="absolute top-4 left-4 z-10 w-64"><!></div> <!>',1);function C3(t,e){Ze(e,!0);let n=xe(Ct([])),o=xe(!0),a=xe(null);const s=new Map,i=new Map,l=6e4,u={cluster:c3},f=C(()=>{const z=Un.current==="dark";return{ok:z?"#4ade80":"#16a34a",warn:z?"#fbbf24":"#b45309",pattern:z?"#1c2027":"#d4d4d8",labelBg:z?"#0d0f13":"#fafafa",labelStroke:z?"#2a2e36":"#d4d4d8"}});async function v(){const z=Date.now(),b=await Promise.all(Yd.map(async k=>{const I=s.get(k.id)??0,U=i.get(k.id)??0;if(I>=2&&z-U<l)return r(n).find(J=>J.id===k.id)??{id:k.id,preset:k,reachable:!1,role:"standalone"};i.set(k.id,z);const ce=new Xd(k.url);try{const[J,Y,Q]=await Promise.all([Mt.track(`cluster · ${k.label} stats`,()=>ce.stats()),Mt.track(`cluster · ${k.label} replication`,()=>ce.replication()).catch(()=>{}),Mt.track(`cluster · ${k.label} status`,()=>ce.clusterStatus()).catch(()=>{})]);return s.set(k.id,0),{id:k.id,preset:k,reachable:!0,role:(Y==null?void 0:Y.role)??"standalone",stats:J,replication:Y,cluster:Q}}catch{return s.set(k.id,I+1),{id:k.id,preset:k,reachable:!1,role:"standalone"}}}));P(n,b,!0),P(o,!1)}It(()=>{if(Ot.locked){P(o,!1);return}P(o,!0),v();const z=setInterval(v,5e3);return()=>clearInterval(z)});const x=C(()=>r(n).filter(z=>z.reachable)),p=C(()=>r(x).map(z=>{var k,I;const b=z.role==="primary"?0:z.role==="replica"?1:-1;return{id:z.id,type:"cluster",position:{x:320+b*320,y:200},data:{label:z.preset.label,role:z.role,collections:((k=z.stats)==null?void 0:k.store.collection_count)??0,entities:((I=z.stats)==null?void 0:I.store.total_entities)??0,url:z.preset.url}}})),w=C(()=>r(x).filter(z=>z.role==="replica").map(z=>{var ce,J;const b=r(x).find(Y=>Y.role==="primary");if(!b)return null;const k=((ce=z.replication)==null?void 0:ce.last_applied_lsn)!==void 0&&((J=z.replication)==null?void 0:J.last_seen_primary_lsn)!==void 0?z.replication.last_seen_primary_lsn-z.replication.last_applied_lsn:null,I=k===0,U=I?r(f).ok:r(f).warn;return{id:`${b.id}-${z.id}`,source:b.id,target:z.id,type:"smoothstep",animated:!0,style:`stroke:${U};stroke-width:1.5;opacity:0.7`,label:k===null?"":I?"✓ in sync":`lag ${k}`,labelStyle:`fill:${U};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(z=>z!==null)),_=C(()=>r(n).find(z=>z.id===r(a))),A=C(()=>r(x).reduce((z,b)=>{var k;return z+(((k=b.stats)==null?void 0:k.store.total_entities)??0)},0));function F(z){var k,I;const b=(I=(k=z.cluster)==null?void 0:k.deployment)==null?void 0:I.mode;return b||(z.preset.id==="embedded"?"embedded file endpoint":z.preset.id.startsWith("docker-")?"server · docker preset":"server endpoint")}function D(z){var k;const b=(k=z.cluster)==null?void 0:k.deployment;return b!=null&&b.file_path?b.file_path:b!=null&&b.container_id||b!=null&&b.image?[b.container_id,b.image].filter(Boolean).join(" · "):b!=null&&b.configured_by||b!=null&&b.process_kind?[b.configured_by,b.process_kind].filter(Boolean).join(" · "):z.preset.id==="embedded"||z.preset.id.startsWith("docker-")?z.preset.description:"reddb has not exposed process/container metadata yet"}function L(z){var k,I;const b=(I=(k=z.cluster)==null?void 0:k.deployment)==null?void 0:I.mode;return b==="docker"?"info":b==="embedded"?"ok":b==="replicated"?"accent":z.preset.id.startsWith("docker-")?"info":z.preset.id==="embedded"?"ok":"neutral"}function H(z){return z===void 0||!Number.isFinite(z)?"not exposed":z>=1024**3?`${(z/1024**3).toFixed(1)} GiB`:z>=1024**2?`${(z/1024**2).toFixed(1)} MiB`:z>=1024?`${(z/1024).toFixed(1)} KiB`:`${z} B`}function V(z,b){return b<=0?"n/a":`${Math.round(z/b*100)}%`}function q(z){const b=Math.max(0,Math.round((Date.now()-z)/1e3));return b>=86400?`${Math.floor(b/86400)}d ${Math.floor(b%86400/3600)}h`:b>=3600?`${Math.floor(b/3600)}h ${Math.floor(b%3600/60)}m`:b>=60?`${Math.floor(b/60)}m ${b%60}s`:`${b}s`}function ee(z){const b=z.replication;return(b==null?void 0:b.last_applied_lsn)===void 0||b.last_seen_primary_lsn===void 0?null:b.last_seen_primary_lsn-b.last_applied_lsn}function oe(z){return z.system.total_memory_bytes-z.system.available_memory_bytes}function ae(...z){return z.find(b=>b!==void 0&&Number.isFinite(b))}function ne(z){return z===void 0||!Number.isFinite(z)?"not exposed":`${z.toLocaleString(void 0,{maximumFractionDigits:1})}/s`}function ve(z){return z===void 0||!Number.isFinite(z)?"not exposed":`${z.toLocaleString(void 0,{maximumFractionDigits:1})} ms`}function R(z){var U,ce,J,Y,Q,$;const b=(ce=(U=z.cluster)==null?void 0:U.storage)==null?void 0:ce.used_bytes,k=(Y=(J=z.cluster)==null?void 0:J.storage)==null?void 0:Y.capacity_bytes,I=($=(Q=z.cluster)==null?void 0:Q.storage)==null?void 0:$.free_bytes;return b===void 0&&k===void 0&&I===void 0?"not exposed":b!==void 0&&k!==void 0?`${H(b)} / ${H(k)} (${V(b,k)})`:b!==void 0&&I!==void 0?`${H(b)} used · ${H(I)} free`:k!==void 0&&I!==void 0?`${H(I)} free / ${H(k)}`:H(b??k??I)}function y(z,b){var k,I,U,ce,J,Y,Q,$,se;return b==="storage capacity"?(k=z.cluster)==null?void 0:k.storage:b==="wal size bytes"?((U=(I=z.cluster)==null?void 0:I.wal)==null?void 0:U.size_bytes)!==void 0:b==="throughput"?(ce=z.cluster)==null?void 0:ce.throughput:b==="avg response time"?((Y=(J=z.cluster)==null?void 0:J.throughput)==null?void 0:Y.avg_response_ms)!==void 0:b==="cpu usage"?(($=(Q=z.cluster)==null?void 0:Q.system)==null?void 0:$.cpu_usage_percent)!==void 0:b==="deployment metadata"?(se=z.cluster)==null?void 0:se.deployment:!1}const M=["storage capacity","wal size bytes","throughput","avg response time","cpu usage","deployment metadata"];var m=He(),E=fe(m);{var N=z=>{var b=d3();h(z,b)},O=z=>{var b=u3(),k=d(b);Rr(k,{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(b),h(z,b)},K=z=>{var b=f3(),k=d(b);Rr(k,{get icon(){return hf},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(b),h(z,b)},Z=z=>{var b=S3(),k=fe(b),I=d(k);Fw(I,{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=>P(a,Q.node.id,!0),children:(Q,$)=>{var se=v3(),W=fe(se);s3(W,{get variant(){return Mn.Dots},bgColor:"transparent",get patternColor(){return r(f).pattern},gap:32,size:1});var B=g(W,2);e3(B,{position:"bottom-right"}),h(Q,se)},$$slots:{default:!0}}),c(k);var U=g(k,2),ce=d(U);Wn(ce,{title:"cluster",children:(Q,$)=>{var se=p3(),W=fe(se),B=d(W),ie=g(d(B),2),re=d(ie,!0),te=g(re),ge=d(te);c(te),c(ie),c(B);var he=g(B,2),be=g(d(he),2),Te=d(be,!0);c(be),c(he),c(W);var ye=g(W,2);Je(ye,21,()=>r(x),qt,(pe,Me)=>{var Pe=g3(),ue=d(Pe),le=g(ue,2),we=d(le,!0);c(le);var Ne=g(le,2),Se=d(Ne,!0);c(Ne),c(Pe),j((ze,me,Ee)=>{Oe(Pe,1,ze),Oe(ue,1,me),T(we,r(Me).preset.label),T(Se,Ee)},[()=>Ue(["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(Me).id?"bg-bg-2":"hover:bg-bg-2"].join(" ")),()=>Ue(["w-1.5 h-1.5 rounded-full shrink-0",r(Me).role==="primary"?"bg-role-primary":r(Me).role==="replica"?"bg-role-replica":"bg-role-embedded"].join(" ")),()=>{var ze;return((ze=r(Me).stats)==null?void 0:ze.store.total_entities.toLocaleString())??0}]),_e("click",Pe,()=>P(a,r(Me).id,!0)),h(pe,Pe)}),c(ye),j(pe=>{T(re,r(x).length),T(ge,`of ${r(n).length??""}`),T(Te,pe)},[()=>r(A).toLocaleString()]),h(Q,se)},$$slots:{default:!0}}),c(U);var J=g(U,2);{var Y=Q=>{var $=k3(),se=d($);Wn(se,{get title(){return`node · ${r(_).id??""}`},floating:!0,children:(W,B)=>{var ie=w3(),re=d(ie),te=g(d(re),2),ge=d(te,!0);c(te),c(re);var he=g(re,2),be=g(d(he),2),Te=d(be,!0);c(be),c(he);var ye=g(he,2),pe=g(d(ye),2),Me=d(pe);{let Ie=C(()=>L(r(_)));Sn(Me,{get tone(){return r(Ie)},children:(qe,G)=>{Ce();var De=gt();j(Le=>T(De,Le),[()=>F(r(_))]),h(qe,De)},$$slots:{default:!0}})}c(pe),c(ye);var Pe=g(ye,2),ue=g(d(Pe),2),le=d(ue,!0);c(ue),c(Pe);var we=g(Pe,2),Ne=g(d(we),2),Se=d(Ne);{let Ie=C(()=>r(_).role==="primary"?"primary":r(_).role==="replica"?"replica":"embedded");vu(Se,{get role(){return r(Ie)},get label(){return r(_).role}})}c(Ne),c(we);var ze=g(we,2),me=g(d(ze),2),Ee=d(me);{var Ae=Ie=>{var qe=gt();j(()=>T(qe,r(_).replication.replica_count??0)),h(Ie,qe)},Ke=Ie=>{var qe=gt();j(()=>T(qe,`connected to ${r(_).replication.primary_addr??"primary"??""}`)),h(Ie,qe)},at=Ie=>{var qe=gt("none exposed");h(Ie,qe)};X(Ee,Ie=>{var qe,G;((qe=r(_).replication)==null?void 0:qe.role)==="primary"?Ie(Ae):((G=r(_).replication)==null?void 0:G.role)==="replica"?Ie(Ke,1):Ie(at,-1)})}c(me),c(ze);var Be=g(ze,2);{var Qe=Ie=>{var qe=h3(),G=g(fe(qe),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),pt=g(d(ct),2),it=d(pt),Xe=g(it),tt=d(Xe);c(Xe),c(pt),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 Wt=g(Rt,2),sn=g(d(Wt),2),gn=d(sn,!0);c(sn),c(Wt);var pn=g(Wt,2),Tn=g(d(pn),2),Vn=d(Tn),Hn=g(Vn),Cr=d(Hn);c(Hn),c(Tn),c(pn);var Pn=g(pn,2),Fn=g(d(Pn),2),qn=d(Fn),or=g(qn),yt=d(or);c(or),c(Fn),c(Pn);var zt=g(Pn,2),Ft=g(d(zt),2),ln=d(Ft,!0);c(Ft),c(zt);var In=g(zt,2),lo=g(d(In),2),co=d(lo),ar=g(co),Kn=d(ar);c(ar),c(lo),c(In);var Nr=g(In,2),uo=g(d(Nr),2),nd=d(uo,!0);c(uo),c(Nr);var qi=g(Nr,2),Ki=g(d(qi),2),rd=d(Ki,!0);c(Ki),c(qi),j((At,Lt,fo,vo,od,ad,id,sd,ld,cd,dd,ud)=>{var Bi,ji;T(Le,`${r(_).stats.system.hostname??""} · ${r(_).stats.system.os??""}/${r(_).stats.system.arch??""}`),T(lt,`pid ${r(_).stats.system.pid??""}`),T(it,`${r(_).stats.active_connections??""} active `),T(tt,`/ ${r(_).stats.idle_connections??""} idle`),T(ht,r(_).stats.store.collection_count),T(bt,At),T(Pt,Lt),T(Bt,fo),T(gn,vo),T(Vn,`${od??""} used `),T(Cr,`/ ${ad??""}
|
|
973
|
-
(${id??""})`),T(qn,`${r(_).stats.system.cpu_cores??""} cores `),T(yt,`· ${((ji=(Bi=r(_).cluster)==null?void 0:Bi.system)==null?void 0:ji.cpu_usage_percent)===void 0?"usage not exposed":`${r(_).cluster.system.cpu_usage_percent}%`}`),T(ln,sd),T(co,`${ld??""} `),T(Kn,`/ ${cd??""}`),T(nd,dd),T(rd,ud)},[()=>r(_).stats.store.total_entities.toLocaleString(),()=>r(_).stats.store.cross_ref_count.toLocaleString(),()=>H(r(_).stats.store.total_memory_bytes),()=>R(r(_)),()=>{var At,Lt;return H(ae((Lt=(At=r(_).cluster)==null?void 0:At.system)==null?void 0:Lt.memory_used_bytes,oe(r(_).stats)))},()=>{var At,Lt;return H(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 V(ae((Lt=(At=r(_).cluster)==null?void 0:At.system)==null?void 0:Lt.memory_used_bytes,oe(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 ne((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.requests_per_second)},()=>{var At,Lt;return ne((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.reads_per_second)},()=>{var At,Lt;return ne((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.writes_per_second)},()=>{var At,Lt;return ve((Lt=(At=r(_).cluster)==null?void 0:At.throughput)==null?void 0:Lt.avg_response_ms)},()=>q(r(_).stats.started_at_unix_ms)]),h(Ie,qe)};X(Be,Ie=>{r(_).stats&&Ie(Qe)})}var dt=g(Be,2);{var vt=Ie=>{var qe=_3(),G=g(fe(qe),2);{var De=je=>{var Ye=x3(),lt=fe(Ye),ct=g(d(lt),2),pt=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,Wt;T(pt,((Pt=(Et=r(_).cluster)==null?void 0:Et.wal)==null?void 0:Pt.lsn)??r(_).replication.wal_lsn),T(tt,mt),T(ht,((Ht=(Rt=r(_).cluster)==null?void 0:Rt.wal)==null?void 0:Ht.oldest_lsn)??r(_).replication.oldest_lsn??"not exposed"),T(bt,((Wt=(Bt=r(_).cluster)==null?void 0:Bt.replication)==null?void 0:Wt.replica_count)??r(_).replication.replica_count??0)},[()=>{var mt,Et;return H((Et=(mt=r(_).cluster)==null?void 0:mt.wal)==null?void 0:Et.size_bytes)}]),h(je,Ye)},Le=je=>{const Ye=C(()=>ee(r(_)));var lt=m3(),ct=fe(lt),pt=g(d(ct),2),it=d(pt),Xe=g(it),tt=d(Xe);c(Xe),c(pt),c(ct);var st=g(ct,2);{var ut=ht=>{var xt=b3(),Tt=g(d(xt),2),bt=d(Tt);{var mt=Pt=>{Sn(Pt,{tone:"ok",children:(Rt,Ht)=>{Ce();var Bt=gt("in sync");h(Rt,Bt)},$$slots:{default:!0}})},Et=Pt=>{Sn(Pt,{tone:"warn",children:(Rt,Ht)=>{Ce();var Bt=gt();j(()=>{var Wt,sn,gn,pn;return T(Bt,(sn=(Wt=r(_).cluster)==null?void 0:Wt.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(()=>{T(it,`${r(_).replication.last_applied_lsn??""} `),T(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,qe)};X(dt,Ie=>{r(_).replication&&Ie(vt)})}var Ge=g(dt,4),Re=g(d(Ge),2);Je(Re,21,()=>M,qt,(Ie,qe)=>{var G=He(),De=fe(G);{var Le=Ye=>{var lt=y3(),ct=d(lt,!0);c(lt),j(()=>T(ct,r(qe))),h(Ye,lt)},je=C(()=>!y(r(_),r(qe)));X(De,Ye=>{r(je)&&Ye(Le)})}h(Ie,G)}),c(Re),c(Ge),c(ie),j(Ie=>{T(ge,r(_).preset.label),T(Te,r(_).preset.url),T(le,Ie)},[()=>D(r(_))]),h(W,ie)},$$slots:{default:!0}}),c($),h(Q,$)};X(J,Q=>{r(_)&&Q(Y)})}h(z,b)};X(E,z=>{r(o)?z(N):Ot.locked?z(O,1):r(x).length===0?z(K,2):z(Z,-1)})}h(t,m),$e()}Nt(["click"]);var N3=S('<div class="type-label mb-1.5"> </div>'),E3=S('<p class="type-caption m-0 mt-1.5"> </p>'),M3=S('<div class="flex items-center gap-2 shrink-0"><!></div>'),z3=S('<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=z3(),o=d(n),a=d(o);{var s=_=>{var A=N3(),F=d(A,!0);c(A),j(()=>T(F,e.eyebrow)),h(_,A)};X(a,_=>{e.eyebrow&&_(s)})}var i=g(a,2),l=d(i),u=d(l,!0);c(l);var f=g(l,2);kt(f,()=>e.children??Zt),c(i);var v=g(i,2);{var x=_=>{var A=E3(),F=d(A,!0);c(A),j(()=>T(F,e.subtitle)),h(_,A)};X(v,_=>{e.subtitle&&_(x)})}c(o);var p=g(o,2);{var w=_=>{var A=M3(),F=d(A);kt(F,()=>e.actions),c(A),h(_,A)};X(p,_=>{e.actions&&_(w)})}c(n),j(()=>T(u,e.title)),h(t,n)}var T3=S('<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>'),P3=S('<div class="text-[12px] font-mono text-warn break-words"> </div>'),I3=S('<span class="text-fg-3">note</span> <span class="text-fg-1"> </span>',1),A3=S('<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>'),L3=S('<div class="text-[12px] font-mono text-fg-3">Loading session…</div>'),O3=S('<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),R3=S('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No tenants returned for this principal.</span></div>'),D3=S('<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>'),V3=S('<div class="grid gap-1 text-[12px] font-mono"></div>'),H3=S('<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=S('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No policies returned for this principal.</span></div>'),q3=S('<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>'),K3=S('<div class="text-[11px] text-fg-3"> </div>'),B3=S('<div class="grid gap-1 text-[12px] font-mono"><!> <!></div>'),j3=S('<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=S('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No users returned for this principal.</span></div>'),U3=S('<span class="text-fg-3">-</span>'),Y3=S('<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>'),X3=S('<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>'),G3=S('<div class="text-[12px] font-mono text-fg-3">Policy table unavailable for this principal.</div>'),Z3=S('<div class="text-[12px] font-mono text-fg-3">No policies to tabulate.</div>'),$3=S('<span class="text-fg-3">-</span>'),Q3=S('<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>'),J3=S('<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>'),ek=S('<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>'),tk=S('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <!></div>');function nk(t,e){Ze(e,!0);let n=xe(null),o=xe(Ct([])),a=xe(Ct([])),s=xe(Ct([])),i=xe(!1),l=xe(null),u=xe(null),f=xe(null),v=xe(null);const x=C(()=>We.active.url),p=C(()=>We.connected);function w(q){if(!q)return"-";const ee=q>1e10?q:q*1e3;return new Date(ee).toISOString().replace("T"," ").slice(0,19)}async function _(){const q=We.client;if(!q||Ot.locked||!r(p)){P(n,null),P(o,[],!0),P(a,[],!0),P(s,[],!0);return}P(i,!0),P(l,null),P(u,null),P(f,null),P(v,null);try{P(n,await Mt.track("security · whoami",()=>q.whoami()),!0)}catch(ee){P(l,ee.message,!0),P(n,null)}try{P(a,await Mt.track("security · users",()=>q.users()),!0)}catch(ee){P(f,ee.message,!0),P(a,[],!0)}finally{P(i,!1)}}It(()=>{Ot.locked||(r(x),r(p),_())});var A=tk(),F=d(A);Qo(F,{eyebrow:"Admin",title:"Security",subtitle:"Tenants, users, and policy surfaces are permission-aware. Controls only appear when reddb exposes the grant.",actions:ee=>{var oe=T3(),ae=d(oe);{let ne=C(()=>r(i)?"size-3.5 animate-spin":"size-3.5");wi(ae,{get class(){return r(ne)}})}Ce(),c(oe),j(()=>oe.disabled=r(i)||Ot.locked||!r(p)),_e("click",oe,_),h(ee,oe)}});var D=g(F,2);{var L=q=>{Rr(q,{get icon(){return tr},title:"Security locked",message:"Enter the master password before red-ui loads auth data."})},H=q=>{Rr(q,{get icon(){return ho},title:"No active connection",message:"Connect to a reddb instance to inspect security posture."})},V=q=>{var ee=ek(),oe=d(ee),ae=d(oe);Wn(ae,{title:"session",children:(m,E)=>{var N=He(),O=fe(N);{var K=b=>{var k=P3(),I=d(k,!0);c(k),j(()=>T(I,r(l))),h(b,k)},Z=b=>{var k=A3(),I=g(d(k),2),U=d(I);{var ce=ie=>{Sn(ie,{tone:"ok",children:(re,te)=>{Ce();var ge=gt("yes");h(re,ge)},$$slots:{default:!0}})},J=ie=>{Sn(ie,{tone:"warn",children:(re,te)=>{Ce();var ge=gt("no");h(re,ge)},$$slots:{default:!0}})};X(U,ie=>{r(n).authenticated?ie(ce):ie(J,-1)})}c(I);var Y=g(I,4),Q=d(Y,!0);c(Y);var $=g(Y,4),se=d($,!0);c($);var W=g($,2);{var B=ie=>{var re=I3(),te=g(fe(re),2),ge=d(te,!0);c(te),j(()=>T(ge,r(n).note)),h(ie,re)};X(W,ie=>{r(n).note&&ie(B)})}c(k),j(()=>{T(Q,r(n).username),T(se,r(n).role)}),h(b,k)},z=b=>{var k=L3();h(b,k)};X(O,b=>{r(l)?b(K):r(n)?b(Z,1):b(z,-1)})}h(m,N)},$$slots:{default:!0}});var ne=g(ae,2);Wn(ne,{title:"tenants",children:(m,E)=>{var N=He(),O=fe(N);{var K=b=>{var k=O3(),I=fe(k),U=d(I);ho(U,{class:"size-3.5"}),Ce(),c(I);var ce=g(I,2),J=d(ce,!0);c(ce),j(()=>T(J,r(u))),h(b,k)},Z=b=>{var k=R3(),I=d(k);ju(I,{class:"size-4"}),Ce(2),c(k),h(b,k)},z=b=>{var k=V3();Je(k,23,()=>r(o),(I,U)=>`${I.id??I.slug??I.name??U}`,(I,U)=>{var ce=D3(),J=d(ce),Y=d(J),Q=d(Y,!0);c(Y);var $=g(Y,2);{var se=te=>{Sn(te,{tone:"accent",children:(ge,he)=>{Ce();var be=gt();j(()=>T(be,r(U).role)),h(ge,be)},$$slots:{default:!0}})};X($,te=>{r(U).role&&te(se)})}c(J);var W=g(J,2),B=d(W),ie=g(B);{var re=te=>{var ge=gt();j(he=>T(ge,`· ${he??""}`),[()=>r(U).grants.join(", ")]),h(te,ge)};X(ie,te=>{var ge;(ge=r(U).grants)!=null&&ge.length&&te(re)})}c(W),c(ce),j(()=>{T(Q,r(U).name??r(U).slug??r(U).id??"tenant"),T(B,`${r(U).id??r(U).slug??"-"??""} `)}),h(I,ce)}),c(k),h(b,k)};X(O,b=>{r(u)?b(K):r(o).length===0?b(Z,1):b(z,-1)})}h(m,N)},$$slots:{default:!0}});var ve=g(ne,2);Wn(ve,{title:"policies",children:(m,E)=>{var N=He(),O=fe(N);{var K=b=>{var k=H3(),I=fe(k),U=d(I);ho(U,{class:"size-3.5"}),Ce(),c(I);var ce=g(I,2),J=d(ce,!0);c(ce),j(()=>T(J,r(v))),h(b,k)},Z=b=>{var k=F3(),I=d(k);pf(I,{class:"size-4"}),Ce(2),c(k),h(b,k)},z=b=>{var k=B3(),I=d(k);Je(I,19,()=>r(s).slice(0,6),(J,Y)=>`${J.id??J.name??Y}`,(J,Y)=>{var Q=q3(),$=d(Q),se=d($),W=d(se,!0);c(se);var B=g(se,2);{var ie=be=>{{let Te=C(()=>r(Y).effect==="deny"?"danger":"ok");Sn(be,{get tone(){return r(Te)},children:(ye,pe)=>{Ce();var Me=gt();j(()=>T(Me,r(Y).effect)),h(ye,Me)},$$slots:{default:!0}})}};X(B,be=>{r(Y).effect&&be(ie)})}c($);var re=g($,2),te=d(re),ge=g(te);{var he=be=>{var Te=gt();j(()=>T(Te,`· tenant ${r(Y).tenant??""}`)),h(be,Te)};X(ge,be=>{r(Y).tenant&&be(he)})}c(re),c(Q),j(()=>{T(W,r(Y).name??r(Y).id??"policy"),T(te,`${r(Y).action??"*"??""} · ${r(Y).resource??"*"??""} `)}),h(J,Q)});var U=g(I,2);{var ce=J=>{var Y=K3(),Q=d(Y);c(Y),j(()=>T(Q,`${r(s).length-6} more policies in the table.`)),h(J,Y)};X(U,J=>{r(s).length>6&&J(ce)})}c(k),h(b,k)};X(O,b=>{r(v)?b(K):r(s).length===0?b(Z,1):b(z,-1)})}h(m,N)},$$slots:{default:!0}}),c(oe);var R=g(oe,2),y=d(R);Wn(y,{title:"users",children:(m,E)=>{var N=He(),O=fe(N);{var K=b=>{var k=j3(),I=fe(k),U=d(I);ho(U,{class:"size-3.5"}),Ce(),c(I);var ce=g(I,2),J=d(ce,!0);c(ce),j(()=>T(J,r(f))),h(b,k)},Z=b=>{var k=W3(),I=d(k);_f(I,{class:"size-4"}),Ce(2),c(k),h(b,k)},z=b=>{var k=X3(),I=d(k),U=g(d(I));Je(U,21,()=>r(a),ce=>ce.username,(ce,J)=>{var Y=Y3(),Q=d(Y),$=d(Q,!0);c(Q);var se=g(Q),W=d(se,!0);c(se);var B=g(se),ie=d(B);{var re=ye=>{Sn(ye,{tone:"ok",children:(pe,Me)=>{Ce();var Pe=gt("on");h(pe,Pe)},$$slots:{default:!0}})},te=ye=>{var pe=U3();h(ye,pe)};X(ie,ye=>{r(J).mfa?ye(re):ye(te,-1)})}c(B);var ge=g(B),he=d(ge,!0);c(ge);var be=g(ge),Te=d(be,!0);c(be),c(Y),j((ye,pe)=>{T($,r(J).username),T(W,r(J).role??"-"),T(he,ye),T(Te,pe)},[()=>w(r(J).created_at),()=>w(r(J).last_active)]),h(ce,Y)}),c(U),c(I),c(k),h(b,k)};X(O,b=>{r(f)?b(K):r(a).length===0?b(Z,1):b(z,-1)})}h(m,N)},$$slots:{default:!0}});var M=g(y,2);Wn(M,{title:"policy table",children:(m,E)=>{var N=He(),O=fe(N);{var K=b=>{var k=G3();h(b,k)},Z=b=>{var k=Z3();h(b,k)},z=b=>{var k=J3(),I=d(k),U=g(d(I));Je(U,23,()=>r(s),(ce,J)=>`${ce.id??ce.name??J}`,(ce,J)=>{var Y=Q3(),Q=d(Y),$=d(Q);{var se=ye=>{{let pe=C(()=>r(J).effect==="deny"?"danger":"ok");Sn(ye,{get tone(){return r(pe)},children:(Me,Pe)=>{Ce();var ue=gt();j(()=>T(ue,r(J).effect)),h(Me,ue)},$$slots:{default:!0}})}},W=ye=>{var pe=$3();h(ye,pe)};X($,ye=>{r(J).effect?ye(se):ye(W,-1)})}c(Q);var B=g(Q),ie=d(B,!0);c(B);var re=g(B),te=d(re,!0);c(re);var ge=g(re),he=d(ge,!0);c(ge);var be=g(ge),Te=d(be,!0);c(be),c(Y),j(()=>{T(ie,r(J).principal??"-"),T(te,r(J).action??"*"),T(he,r(J).resource??"*"),T(Te,r(J).tenant??"-")}),h(ce,Y)}),c(U),c(I),c(k),h(b,k)};X(O,b=>{r(v)?b(K):r(s).length===0?b(Z,1):b(z,-1)})}h(m,N)},$$slots:{default:!0}}),c(R),c(ee),h(q,ee)};X(D,q=>{Ot.locked?q(L):r(p)?q(V,-1):q(H,1)})}c(A),h(t,A),$e()}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"]}],rk={"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"},ok={"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."},ak={"deployment.mode":["embedded","server","docker","replicated"]};function ik(t){const n=(t.split(".").pop()??t).replace(/[_-]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):t}function ol(t,e){const n=ak[t],o=n?"enum":typeof e=="boolean"?"boolean":typeof e=="number"?"number":"text",a={key:t,label:rk[t]??ik(t),kind:o},s=ok[t];return s&&(a.description=s),n&&(a.options=n),a}function sk(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 lk(t){return Jo.find(e=>e.id===t)??Jo[0]}var ck=S('<div class="h-full overflow-auto bg-bg-0 p-6"><!> <!></div>'),dk=S('<button type="button" class="flex h-7 w-full items-center gap-2 rounded-md border border-line-2 bg-bg-2 px-2.5 text-xs text-fg-2 transition-colors hover:border-line-3 hover:text-fg-1"><!> <span class="flex-1 text-left">Search settings</span> <span class="inline-flex gap-0.5"><!><!></span></button>'),uk=S('<nav class="grid gap-0.5 p-2"></nav>'),fk=S('<div class="px-3 py-2.5 text-[11px] text-fg-3">Live from <span class="font-mono text-fg-2"> </span>.</div>'),vk=S('<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>'),gk=S('<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>'),pk=S('<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>'),hk=S('<span class="font-mono text-[12px] text-accent"> </span>'),xk=S('<span class="font-mono text-[12px] text-fg-1"> </span>'),bk=S('<div class="divide-y divide-line-1 overflow-hidden rounded-lg border border-line-1 bg-bg-1"></div>'),mk=S('<div class="p-6"><!> <section class="mb-6"><!> <!></section></div>');function _k(t,e){Ze(e,!0);const n={settings:zo,database:Vr,network:fl,plug:yi,shield:Cl},o={stats:"stats:read",cluster:"cluster:status",capabilities:"capabilities",session:"auth:whoami"};let a=xe(Ct(Jo[0].id));const s=C(()=>lk(r(a)));let i=xe(Ct({})),l=xe(Ct({stats:null,cluster:null,capabilities:null,session:null})),u=xe(!1);const f=C(()=>We.connected),v=C(()=>We.active.url);async function x(){const V=We.client;if(!V||!r(f)){P(i,{},!0);return}P(u,!0);const q={},ee={stats:null,cluster:null,capabilities:null,session:null};Object.assign(q,No({capabilities:We.capabilities}));try{const oe=await Mt.track("settings · stats",()=>V.stats());Object.assign(q,No(oe))}catch(oe){ee.stats=oe.message}if(!We.capabilities.clusterStatus)ee.cluster="Server does not expose /cluster/status.";else try{const oe=await Mt.track("settings · cluster",()=>V.clusterStatus());Object.assign(q,No(oe))}catch(oe){ee.cluster=oe.message}try{const oe=await Mt.track("settings · whoami",()=>V.whoami());Object.assign(q,No({session:oe}))}catch(oe){ee.session=oe.message}P(i,q,!0),P(l,ee,!0),P(u,!1)}It(()=>{r(v),r(f),x()});const p=C(()=>{const V=[];for(const q of r(s).keys){const ee=sk(q),oe=r(l)[ee],ae=ol(q).label;oe?V.push({type:"denied",key:q,label:ae,reason:oe,grant:o[ee]}):q in r(i)&&V.push({type:"value",key:q,label:ae,control:ol(q,r(i)[q]),value:r(i)[q]})}return V});function w(V){if(!Number.isFinite(V))return String(V);const q=["B","KB","MB","GB","TB"];let ee=V,oe=0;for(;ee>=1024&&oe<q.length-1;)ee/=1024,oe++;return`${oe===0?ee:ee.toFixed(1)} ${q[oe]}`}function _(V,q){return V.kind==="number"&&V.key.endsWith("_bytes")?w(Number(q)):String(q)}function A(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0,bubbles:!0}))}var F=He(),D=fe(F);{var L=V=>{var q=ck(),ee=d(q);Qo(ee,{eyebrow:"Settings",title:"Settings",subtitle:"Live configuration for the active reddb connection."});var oe=g(ee,2);Rr(oe,{get icon(){return mf},title:"No active connection",message:"Connect to a reddb instance to inspect its live configuration.",hint:"red serve"}),c(q),h(V,q)},H=V=>{yu(V,{searchShortcut:null,search:ne=>{var ve=dk(),R=d(ve);un(R,{class:"size-3.5 text-fg-3"});var y=g(R,4),M=d(y);Gt(M,{children:(E,N)=>{Ce();var O=gt("⌘");h(E,O)}});var m=g(M);Gt(m,{children:(E,N)=>{Ce();var O=gt("K");h(E,O)}}),c(y),c(ve),_e("click",ve,A),h(ne,ve)},nav:ne=>{var ve=uk();Je(ve,21,()=>Jo,R=>R.id,(R,y)=>{const M=C(()=>n[r(y).icon]??zo);{const m=N=>{var O=He(),K=fe(O);Gn(K,()=>r(M),(Z,z)=>{z(Z,{class:"size-3.5"})}),h(N,O)};let E=C(()=>r(y).id===r(s).id);Hu(R,{get label(){return r(y).label},get active(){return r(E)},onclick:()=>P(a,r(y).id,!0),icon:m,$$slots:{icon:!0}})}}),c(ve),h(ne,ve)},footer:ne=>{var ve=fk(),R=g(d(ve)),y=d(R,!0);c(R),Ce(),c(ve),j(()=>T(y,r(v))),h(ne,ve)},content:ne=>{const ve=C(()=>n[r(s).icon]??zo);var R=mk(),y=d(R);Qo(y,{eyebrow:"Settings",get title(){return r(s).label},get subtitle(){return r(s).blurb},actions:Z=>{var z=vk(),b=d(z);{let k=C(()=>r(u)?"size-3.5 animate-spin":"size-3.5");wi(b,{get class(){return r(k)}})}Ce(),c(z),j(()=>z.disabled=r(u)),_e("click",z,x),h(Z,z)}});var M=g(y,2),m=d(M);Tu(m,{get title(){return r(s).label},class:"mb-2",icon:z=>{var b=He(),k=fe(b);Gn(k,()=>r(ve),(I,U)=>{U(I,{class:"size-3.5"})}),h(z,b)},meta:z=>{ts(z,{children:(b,k)=>{Ce();var I=gt();j(()=>T(I,r(p).length)),h(b,I)},$$slots:{default:!0}})},$$slots:{icon:!0,meta:!0}});var E=g(m,2);{var N=K=>{var Z=gk();h(K,Z)},O=K=>{var Z=bk();Je(Z,21,()=>r(p),z=>z.key,(z,b)=>{var k=He(),I=fe(k);{var U=J=>{es(J,{get title(){return r(b).label},get hint(){return r(b).key},action:Q=>{var $=pk(),se=d($);tr(se,{class:"size-3"});var W=g(se);c($),j(()=>{ke($,"title",r(b).reason),T(W,` requires ${r(b).grant??""}`)}),h(Q,$)},$$slots:{action:!0}})},ce=J=>{es(J,{get title(){return r(b).label},get description(){return r(b).control.description},get hint(){return r(b).key},action:Q=>{var $=He(),se=fe($);{var W=re=>{{let te=C(()=>r(b).value?"accent":"muted");ts(re,{get tone(){return r(te)},children:(ge,he)=>{Ce();var be=gt();j(()=>T(be,r(b).value?"on":"off")),h(ge,be)},$$slots:{default:!0}})}},B=re=>{var te=hk(),ge=d(te,!0);c(te),j(he=>{ke(te,"title",he),T(ge,r(b).value)},[()=>{var he;return`Options: ${(he=r(b).control.options)==null?void 0:he.join(", ")}`}]),h(re,te)},ie=re=>{var te=xk(),ge=d(te,!0);c(te),j(he=>T(ge,he),[()=>_(r(b).control,r(b).value)]),h(re,te)};X(se,re=>{r(b).control.kind==="boolean"?re(W):r(b).control.kind==="enum"?re(B,1):re(ie,-1)})}h(Q,$)},$$slots:{action:!0}})};X(I,J=>{r(b).type==="denied"?J(U):J(ce,-1)})}h(z,k)}),c(Z),h(K,Z)};X(E,K=>{r(p).length===0?K(N):K(O,-1)})}c(M),c(R),h(ne,R)},$$slots:{search:!0,nav:!0,footer:!0,content:!0}})};X(D,V=>{r(f)?V(H,-1):V(L)})}h(t,F),$e()}Nt(["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}}],Jc=Fi[0],ed="red-ui-skin";function sl(t){return Fi.find(e=>e.name===t)??Jc}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],Fa=[6,13,22],qa=[100,78,58,45];function td(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,qa[1],e),"--color-fg-2":kn(o,qa[2],e),"--color-fg-3":kn(o,qa[3],e),"--color-line-1":kn(a,Fa[0],e),"--color-line-2":kn(a,Fa[1],e),"--color-line-3":kn(a,Fa[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=td(t);for(const[o,a]of Object.entries(n))e.style.setProperty(o,a);e.dataset.theme="dark"}function yk(){return typeof localStorage>"u"?null:localStorage.getItem(ed)}function wk(t){typeof localStorage>"u"||localStorage.setItem(ed,t)}function cl(t){return t??(typeof document<"u"?document.documentElement:null)}var to;class kk{constructor(){Ve(this,to,xe(Ct(Jc)));wt(this,"target",null)}get current(){return r(de(this,to))}set current(e){P(de(this,to),e,!0)}init(e){this.target=cl(e);const n=yk();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)),wk(n.name)}}to=new WeakMap;const vi=new kk;var Sk=S('<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>'),Ck=S('<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>'),Nk=S('<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 Ek(t,e){Ze(e,!0);function n(l){return Object.entries(td(l)).map(([u,f])=>`${u}: ${f}`).join("; ")}const o=C(()=>vi.current.name);var a=Nk(),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=C(()=>r(u).name===r(o));var v=Ck(),x=d(v),p=g(x,2),w=d(p),_=d(w,!0);c(w);var A=g(w,2);{var F=H=>{var V=Sk(),q=d(V);Yu(q,{class:"size-3"}),Ce(),c(V),h(H,V)};X(A,H=>{r(f)&&H(F)})}c(p);var D=g(p,2),L=d(D,!0);c(D),c(v),j(H=>{ke(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,H),T(_,r(u).label),T(L,r(u).description)},[()=>n(r(u))]),_e("click",v,()=>vi.select(r(u).name)),h(l,v)}),c(i),c(a),h(t,a),$e()}Nt(["click"]);var Mk=S('<div class="app grid grid-rows-[44px_32px_1fr] h-screen"><!> <!> <main class="relative overflow-hidden z-[1]"><!></main> <!> <!> <!> <!></div>');function Rk(t,e){Ze(e,!0);let n=Fe(e,"showConnect",3,!0),o=Fe(e,"persistTheme",3,!0);const a=Uf(e.router??El());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 H=Wf(D.startsWith("/")?D:`/${D}`);H.collection?a.go({view:"collection",collection:H.collection,subpage:H.subpage??"table"},void 0,!0):a.go({view:H.view},void 0,!0)}On(()=>{e.connectionProvider?We.adoptInjected().then(()=>{e.initialRoute&&s(e.initialRoute)}):We.bootstrap().then(D=>{D&&s(D)})});let i=xe(!1),l=xe(!1);On(()=>{const D=()=>P(l,!0);return window.addEventListener("red:open-pending-changes",D),()=>window.removeEventListener("red:open-pending-changes",D)}),It(()=>{const D=We.client;if(!D){jt.setExecutor(null),nn.setExecutor(null);return}nn.setExecutor(L=>Zd(D,L)),jt.setExecutor(async L=>Promise.all(L.map(async H=>{try{const V=await D.query(ki(H));return V.ok?{id:H.id,ok:!0}:{id:H.id,ok:!1,error:V.error??"query failed"}}catch(V){return{id:H.id,ok:!1,error:V.message}}})))});const u=5e3;Un.init({target:e.themeTarget??null,persist:o(),initial:e.initialTheme}),vi.init(e.themeTarget??null),It(()=>{if(Ot.locked||!We.targetResolved)return;We.refresh();const D=setInterval(()=>We.refresh(),u);return()=>clearInterval(D)}),It(()=>{Ot.store&&We.hydrateUrls()});function f(){const D=nn.nextLabel(),L=_t.open({kind:"query",label:D,key:D},!0);nn.ensure(L.id)}async function v(D,L){const H=_t.tabs.find(q=>q.kind==="collection"&&q.key===D);H?_t.open({kind:"collection",label:D,key:D,capability:H.capability,overrideCapability:H.overrideCapability,showSystemColumns:H.showSystemColumns,subpage:L??H.subpage}):_t.open({kind:"collection",label:D,key:D,capability:"table",subpage:L??void 0});const V=We.client;if(!V){L||a.go({view:"collection",collection:D,subpage:"table"},void 0,!0);return}try{const q=await Pl(V,D),ee=_t.tabs.find(ae=>ae.kind==="collection"&&ae.key===D),oe=L??Ar(q);ee&&(_t.tabs=_t.tabs.map(ae=>ae===ee?{...ae,capability:q,subpage:oe}:ae)),L||a.go({view:"collection",collection:D,subpage:oe},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,H=a.subpage;if(D==="collections"&&L){const V=`${L}::${H??""}`;V!==p&&(p=V,Cn(()=>void v(L,H)))}else p=null;D==="query"&&x!=="query"&&Cn(()=>f()),x=D});var w=He(),_=fe(w);{var A=D=>{tu(D,{onDone:()=>P(i,!0)})},F=D=>{var L=Mk(),H=d(L);Zf(H,{get showConnect(){return n()}});var V=g(H,2);dv(V,{});var q=g(V,2),ee=d(q);{var oe=N=>{C3(N,{})},ae=N=>{nk(N,{})},ne=N=>{_k(N,{})},ve=N=>{Ek(N,{})},R=N=>{Fb(N)};X(ee,N=>{a.view==="cluster"?N(oe):a.view==="security"?N(ae,1):a.view==="settings"?N(ne,2):a.view==="appearance"?N(ve,3):N(R,-1)})}c(q);var y=g(q,2);hv(y,{});var M=g(y,2);wv(M,{});var m=g(M,2);zv(m,{});var E=g(m,2);Dv(E,{get open(){return r(l)},onClose:()=>P(l,!1)}),c(L),h(D,L)};X(_,D=>{r(i)?D(F,-1):D(A)})}h(t,w),$e()}export{Rk as W,Wf as p,as as t};
|