@reddb-io/ui 0.1.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/LICENSE +17 -0
- package/bin/red-ui.js +259 -0
- package/build/CNAME +1 -0
- package/build/_app/env.js +1 -0
- package/build/_app/immutable/assets/0.C63jY5jX.css +1 -0
- package/build/_app/immutable/assets/10.Dblyk0Kr.css +1 -0
- package/build/_app/immutable/assets/EmptyState.RXcH7ryE.css +1 -0
- package/build/_app/immutable/assets/Workspace.BCzG1DsH.css +1 -0
- package/build/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
- package/build/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
- package/build/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
- package/build/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
- package/build/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
- package/build/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
- package/build/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
- package/build/_app/immutable/assets/jetbrains-mono-cyrillic-wght-normal.D73BlboJ.woff2 +0 -0
- package/build/_app/immutable/assets/jetbrains-mono-greek-wght-normal.Bw9x6K1M.woff2 +0 -0
- package/build/_app/immutable/assets/jetbrains-mono-latin-ext-wght-normal.DBQx-q_a.woff2 +0 -0
- package/build/_app/immutable/assets/jetbrains-mono-latin-wght-normal.B9CIFXIH.woff2 +0 -0
- package/build/_app/immutable/assets/jetbrains-mono-vietnamese-wght-normal.Bt-aOZkq.woff2 +0 -0
- package/build/_app/immutable/chunks/3j4cZ58b.js +1 -0
- package/build/_app/immutable/chunks/69_IOA4Y.js +1 -0
- package/build/_app/immutable/chunks/ALqaDrNQ.js +2 -0
- package/build/_app/immutable/chunks/BGcIe2ep.js +2 -0
- package/build/_app/immutable/chunks/BMHKbvs8.js +1 -0
- package/build/_app/immutable/chunks/BQHbwf54.js +916 -0
- package/build/_app/immutable/chunks/Bgso8cDH.js +311 -0
- package/build/_app/immutable/chunks/Bmgx1mfv.js +310 -0
- package/build/_app/immutable/chunks/BrvvOVaJ.js +1 -0
- package/build/_app/immutable/chunks/Bzak7iHL.js +1 -0
- package/build/_app/immutable/chunks/D9CTkMjK.js +1 -0
- package/build/_app/immutable/chunks/DIeogL5L.js +1 -0
- package/build/_app/immutable/chunks/DXY_Rxa7.js +113 -0
- package/build/_app/immutable/chunks/DhEqZVGG.js +1 -0
- package/build/_app/immutable/chunks/Ov8N-vxt.js +1 -0
- package/build/_app/immutable/chunks/oiO4RLqp.js +1 -0
- package/build/_app/immutable/entry/app.D_IVtpdv.js +2 -0
- package/build/_app/immutable/entry/start.3oC0UQ_Q.js +1 -0
- package/build/_app/immutable/nodes/0.CHPiFxDo.js +1 -0
- package/build/_app/immutable/nodes/1.BC_4YZ0h.js +1 -0
- package/build/_app/immutable/nodes/10.B7DMKSNc.js +60 -0
- package/build/_app/immutable/nodes/2.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/3.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/4.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/5.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/6.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/7.BZX9Iird.js +134 -0
- package/build/_app/immutable/nodes/8.CAG5_cGP.js +1 -0
- package/build/_app/immutable/nodes/9.CAG5_cGP.js +1 -0
- package/build/_app/version.json +1 -0
- package/build/favicon.png +0 -0
- package/build/index.html +59 -0
- package/dist/embed/RedUiEmbedRoot-BGoLxJf1.js +26562 -0
- package/dist/embed/RedUiEmbedRoot-BGoLxJf1.js.map +1 -0
- package/dist/embed/bundle-mjs-UuVRz3O4.js +3047 -0
- package/dist/embed/bundle-mjs-UuVRz3O4.js.map +1 -0
- package/dist/embed/core-QuRYvMt8.js +118 -0
- package/dist/embed/core-QuRYvMt8.js.map +1 -0
- package/dist/embed/index-B6ZQhCsu.js +577 -0
- package/dist/embed/index-B6ZQhCsu.js.map +1 -0
- package/dist/embed/index-client-ItCEU64C.js +3087 -0
- package/dist/embed/index-client-ItCEU64C.js.map +1 -0
- package/dist/embed/index-fad77a13.esm-BqPj0saH.js +1318 -0
- package/dist/embed/index-fad77a13.esm-BqPj0saH.js.map +1 -0
- package/dist/embed/index.js +11 -0
- package/dist/embed/index.js.map +1 -0
- package/dist/embed/sigma-node-border.esm-CGtlgqmo.js +432 -0
- package/dist/embed/sigma-node-border.esm-CGtlgqmo.js.map +1 -0
- package/dist/embed/sigma.esm-y0qgY-OC.js +2355 -0
- package/dist/embed/sigma.esm-y0qgY-OC.js.map +1 -0
- package/dist/embed/ui.css +1 -0
- package/package.json +101 -0
- package/src/app.css +238 -0
- package/src/lib/ActivityIndicator.svelte +100 -0
- package/src/lib/ClusterNode.svelte +119 -0
- package/src/lib/ClusterView.svelte +541 -0
- package/src/lib/CollectionHistory.svelte +266 -0
- package/src/lib/CollectionsView.svelte +14 -0
- package/src/lib/CommandPalette.svelte +237 -0
- package/src/lib/ConnectDropdown.svelte +222 -0
- package/src/lib/EmptyState.svelte +27 -0
- package/src/lib/LiveChanges.svelte +195 -0
- package/src/lib/MasterPasswordDialog.svelte +168 -0
- package/src/lib/PageHeader.svelte +32 -0
- package/src/lib/PendingChangesPanel.svelte +153 -0
- package/src/lib/QueryEditor.svelte +122 -0
- package/src/lib/ResultsPane.svelte +747 -0
- package/src/lib/SchemaTree.svelte +193 -0
- package/src/lib/SecurityView.svelte +255 -0
- package/src/lib/ShortcutOverlay.svelte +104 -0
- package/src/lib/Splash.svelte +46 -0
- package/src/lib/StatusBar.svelte +163 -0
- package/src/lib/SubNav.svelte +62 -0
- package/src/lib/Topbar.svelte +119 -0
- package/src/lib/Workspace.svelte +247 -0
- package/src/lib/activity.svelte.ts +91 -0
- package/src/lib/build-info.ts +41 -0
- package/src/lib/capability.ts +221 -0
- package/src/lib/cn.ts +6 -0
- package/src/lib/collection-catalog.ts +116 -0
- package/src/lib/collection-pages.ts +33 -0
- package/src/lib/connection-history.ts +301 -0
- package/src/lib/connections.svelte.ts +493 -0
- package/src/lib/embed/RedUiEmbedRoot.svelte +31 -0
- package/src/lib/embed/index.ts +234 -0
- package/src/lib/graph-loader/contract.ts +336 -0
- package/src/lib/graph-loader/drilldown.ts +334 -0
- package/src/lib/graph-loader/index.ts +13 -0
- package/src/lib/index.ts +114 -0
- package/src/lib/pending-changes.svelte.ts +149 -0
- package/src/lib/query-tabs.svelte.ts +130 -0
- package/src/lib/reddb/boot-params.ts +254 -0
- package/src/lib/reddb/cdc-stream-client.ts +234 -0
- package/src/lib/reddb/client.ts +698 -0
- package/src/lib/reddb/connection-bootstrap.ts +260 -0
- package/src/lib/reddb/connection-provider.contract.ts +72 -0
- package/src/lib/reddb/connection-provider.ts +72 -0
- package/src/lib/reddb/index.ts +14 -0
- package/src/lib/reddb/injected-client-provider.ts +76 -0
- package/src/lib/reddb/local-url-provider.ts +245 -0
- package/src/lib/reddb/secure-store.ts +41 -0
- package/src/lib/reddb/server-capabilities.ts +71 -0
- package/src/lib/reddb/tauri-encrypted-store.ts +64 -0
- package/src/lib/reddb/transports.ts +89 -0
- package/src/lib/reddb/types.ts +32 -0
- package/src/lib/reddb/uri.ts +54 -0
- package/src/lib/reddb/web-encrypted-store.ts +201 -0
- package/src/lib/renderers/DiffRenderer.svelte +184 -0
- package/src/lib/renderers/DocumentRenderer.svelte +134 -0
- package/src/lib/renderers/GraphRenderer.svelte +1328 -0
- package/src/lib/renderers/HypertableRenderer.svelte +253 -0
- package/src/lib/renderers/JsonRenderer.svelte +30 -0
- package/src/lib/renderers/KvRenderer.svelte +150 -0
- package/src/lib/renderers/QueueRenderer.svelte +286 -0
- package/src/lib/renderers/StatsRenderer.svelte +123 -0
- package/src/lib/renderers/TableRenderer.svelte +440 -0
- package/src/lib/renderers/VectorRenderer.svelte +388 -0
- package/src/lib/renderers/diff-render.ts +122 -0
- package/src/lib/renderers/diff.ts +9 -0
- package/src/lib/renderers/document-render.ts +64 -0
- package/src/lib/renderers/document.ts +9 -0
- package/src/lib/renderers/graph-render.ts +631 -0
- package/src/lib/renderers/graph-sigma.ts +395 -0
- package/src/lib/renderers/graph.ts +9 -0
- package/src/lib/renderers/hypertable-render.ts +320 -0
- package/src/lib/renderers/hypertable.ts +9 -0
- package/src/lib/renderers/index.ts +42 -0
- package/src/lib/renderers/json-render.ts +89 -0
- package/src/lib/renderers/json.ts +10 -0
- package/src/lib/renderers/kv-render.ts +193 -0
- package/src/lib/renderers/kv.ts +9 -0
- package/src/lib/renderers/queue-render.ts +197 -0
- package/src/lib/renderers/queue.ts +9 -0
- package/src/lib/renderers/registry.ts +68 -0
- package/src/lib/renderers/stats-render.ts +73 -0
- package/src/lib/renderers/stats.ts +9 -0
- package/src/lib/renderers/table-render.ts +156 -0
- package/src/lib/renderers/table.ts +11 -0
- package/src/lib/renderers/types.ts +33 -0
- package/src/lib/renderers/vector-render.ts +154 -0
- package/src/lib/renderers/vector.ts +9 -0
- package/src/lib/router.svelte.ts +163 -0
- package/src/lib/secureStore.svelte.ts +148 -0
- package/src/lib/shadow-dom-spike/ShadowDomSpikeCore.svelte +198 -0
- package/src/lib/shadow-dom-spike/mount-shadow-dom-spike.ts +94 -0
- package/src/lib/shortcuts.ts +22 -0
- package/src/lib/surface.ts +80 -0
- package/src/lib/tabs.svelte.ts +115 -0
- package/src/lib/theme.svelte.ts +63 -0
|
@@ -0,0 +1,916 @@
|
|
|
1
|
+
var Fc=Object.defineProperty;var Ti=t=>{throw TypeError(t)};var Kc=(t,e,n)=>e in t?Fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wt=(t,e,n)=>Kc(t,typeof e!="symbol"?e+"":e,n),da=(t,e,n)=>e.has(t)||Ti("Cannot "+n);var ce=(t,e,n)=>(da(t,e,"read from private field"),n?n.call(t):e.get(t)),De=(t,e,n)=>e.has(t)?Ti("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Sr=(t,e,n,o)=>(da(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),Pi=(t,e,n)=>(da(t,e,"access private method"),n);import"./Bzak7iHL.js";import{aG as Bc,at as jc,aS as Uc,bp as $,ay as co,be as Ii,ar as Nr,aw as Ai,Q as Yc,b0 as Wc,ax as Li,e as Xc,as as $c,aA as Gc,p as Zc,a4 as Qc,w as Jc,v as ed,ae as ri,bs as Cn,b2 as td,a7 as nd,b7 as rd,aZ as Ze,aU as Wn,b9 as z,aj as fe,am as r,aW as Qe,bl as ye,a0 as d,aR as nn,b3 as c,bi as v,bv as S,aY as zt,aQ as Te,ba as oi,ao as Go,bw as Pt,br as rn,b1 as Fs,aT as Zo,av as od,bx as ad,af as Ks,ai as Wt,a as en,ah as id}from"./oiO4RLqp.js";import{b as ua,d as qe,a as x,j as k,g as Tt,s as T,h as we,i as Ln,t as pt,k as Rt,e as sd,q as Ia}from"./BGcIe2ep.js";import{i as G,_ as ld,p as je,l as it,s as tt,b as bn,c as Zr,r as Qn}from"./D9CTkMjK.js";import{M as Fe,O as Zt,V as Kt,l as We,I as st,U as lt,p as Ue,J as Me,z as Dt,k as Ft,b as mn,r as Je,X as $t,v as qt,y as cd,g as Mt,n as dd,N as ud,e as hn,D as Lt,f as fd,q as Pr,x as ai,K as Bs,F as ii,c as Qo,d as vd,G as gd,u as pd,j as Aa,T as hd,i as xd,Q as bd,a as fa,W as md,L as _d,h as On,C as si,S as Jo,w as yd,P as wd,R as kd,E as Io,H as Cd,B as Sd}from"./Bmgx1mfv.js";import"./69_IOA4Y.js";const Nd=[];function js(t,e=!1,n=!1){return wo(t,new Map,"",Nd,null,n)}function wo(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(Bc(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]=wo(f,e,n,o,null,s))}return l}if(jc(t)===Uc){l={},e.set(t,l),a!==null&&e.set(a,l);for(var g of Object.keys(t))l[g]=wo(t[g],e,n,o,null,s);return l}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!s)return wo(t.toJSON(),e,n,o,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}function Ed(t,e,n=!1,o=!1,a=!1,s=!1){var i=t,l="";if(n){var u=t;co&&(i=Ii(Nr(u)))}$(()=>{var f=Yc;if(l===(l=e()??"")){co&&Ai();return}if(n&&!co){f.nodes=null,u.innerHTML=l,l!==""&&ua(Nr(u),u.lastChild);return}if(f.nodes!==null&&(Wc(f.nodes.start,f.nodes.end),f.nodes=null),l!==""){if(co){Li.data;for(var g=Ai(),h=g;g!==null&&(g.nodeType!==Xc||g.data!=="");)h=g,g=$c(g);if(g===null)throw Gc(),Zc;ua(Li,h),i=Ii(g);return}var p=o?Jc:a?ed:void 0,y=Qc(o?"svg":a?"math":"template",p);y.innerHTML=l;var _=o||a?y:y.content;if(ua(Nr(_),_.lastChild),o||a)for(;Nr(_);)i.before(Nr(_));else i.before(_)}})}function Xt(t,e,n){ri(()=>{var o=Cn(()=>e(t,n==null?void 0:n())||{});if(n&&(o!=null&&o.update)){var a=!1,s={};td(()=>{var i=n();nd(i),a&&rd(s,i)&&(s=i,o.update(i))}),a=!0}if(o!=null&&o.destroy)return()=>o.destroy()})}var An,vr,Fr,Xo,Us;const $o=class $o{constructor(e){De(this,Xo);De(this,An,new WeakMap);De(this,vr);De(this,Fr);Sr(this,Fr,e)}observe(e,n){var o=ce(this,An).get(e)||new Set;return o.add(n),ce(this,An).set(e,o),Pi(this,Xo,Us).call(this).observe(e,ce(this,Fr)),()=>{var a=ce(this,An).get(e);a.delete(n),a.size===0&&(ce(this,An).delete(e),ce(this,vr).unobserve(e))}}};An=new WeakMap,vr=new WeakMap,Fr=new WeakMap,Xo=new WeakSet,Us=function(){return ce(this,vr)??Sr(this,vr,new ResizeObserver(e=>{for(var n of e){$o.entries.set(n.target,n);for(var o of ce(this,An).get(n.target)||[])o(n)}}))},wt($o,"entries",new WeakMap);let La=$o;var Md=new La({box:"border-box"});function Oi(t,e,n){var o=Md.observe(t,()=>n(t[e]));ri(()=>(Cn(()=>n(t[e])),o))}var zd=k('<div><div class="flex items-center gap-2 svelte-1js76h4"><div class="w-2 h-2 rounded-full bg-accent shadow-[0_0_12px_var(--color-accent-glow)] svelte-1js76h4"></div> <span class="font-mono font-semibold text-fg-0 text-[15px] tracking-tight">red<span class="text-accent mx-px">·</span>ui</span></div></div>');function Td(t,e){Ze(e,!0);let n=ye(!0),o=ye(0);Wn(()=>{const l=setTimeout(()=>z(o,1),20),u=setTimeout(()=>z(o,2),800),f=setTimeout(()=>{var g;z(n,!1),(g=e.onDone)==null||g.call(e)},1e3);return()=>{clearTimeout(l),clearTimeout(u),clearTimeout(f)}});var a=qe(),s=fe(a);{var i=l=>{var u=zd();let f,g;$(()=>{f=Fe(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}),g=Zt(u,"",g,{opacity:r(o)===0?0:void 0})}),x(l,u)};G(s,l=>{r(n)&&l(i)})}x(t,a),Qe()}var Pd=(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')}),Ri=t=>t===!1?"false":t===!0?"true":t===0?"0":t,Yt=t=>{if(!t||typeof t!="object")return!0;for(let e in t)return!1;return!0},Id=(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 Ys(t,e){for(let n=0;n<t.length;n++){let o=t[n];Array.isArray(o)?Ys(o,e):e.push(o)}}var Ws=(...t)=>{let e=[];Ys(t,e);let n=[];for(let o=0;o<e.length;o++)e[o]&&n.push(e[o]);return n},Xs=(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]=Ws(s,a):typeof a=="object"&&typeof s=="object"&&a&&s?n[o]=Xs(a,s):n[o]=s+" "+a}else n[o]=a}for(let o in e)o in t||(n[o]=e[o]);return n},Ad=/\s+/g,Di=t=>!t||typeof t!="string"?t:t.replace(Ad," ").trim(),ir=null,ko=null,Ld=async()=>ir||ko||(ko=ld(()=>import("./3j4cZ58b.js"),[],import.meta.url).then(t=>(ir=t,t)).catch(()=>null),ko),Od=t=>e=>{if(ko&&!ir)return e;if(ir){let{twMerge:n,extendTailwindMerge:o}=ir;return(Yt(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}=Pd("tailwind-merge");return ir={twMerge:n,extendTailwindMerge:o},(Yt(t)?n:o({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(e)}catch{return Ld(),e}},Rd={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Ao=(...t)=>{let e=[];$s(t,e);let n="";for(let o=0;o<e.length;o++)e[o]&&(n&&(n+=" "),n+=e[o]);return n||void 0};function $s(t,e){for(let n=0;n<t.length;n++){let o=t[n];Array.isArray(o)?$s(o,e):o&&e.push(o)}}var va=null,Oa={},Ra=!1,uo=(...t)=>e=>{let n=Ao(t);return!n||!e.twMerge?n:((!va||Ra)&&(Ra=!1,va=Od(Oa)),va(n)||void 0)},Vi=(t,e)=>{for(let n in e)n in t?t[n]=Ao(t[n],e[n]):t[n]=e[n];return t},Gs=(t,e)=>{let{extend:n=null,slots:o={},variants:a={},compoundVariants:s=[],compoundSlots:i=[],defaultVariants:l={}}=t,u={...Rd,...e},f=n!=null&&n.base?Ao(n.base,t==null?void 0:t.base):t==null?void 0:t.base,g=n!=null&&n.variants&&!Yt(n.variants)?Xs(a,n.variants):a,h=n!=null&&n.defaultVariants&&!Yt(n.defaultVariants)?{...n.defaultVariants,...l}:l;!Yt(u.twMergeConfig)&&!Id(u.twMergeConfig,Oa)&&(Ra=!0,Oa=u.twMergeConfig);let p=Yt(n==null?void 0:n.slots),y=Yt(o)?{}:{base:Ao(t==null?void 0:t.base,p&&(n==null?void 0:n.base)),...o},_=p?y:Vi({...n==null?void 0:n.slots},Yt(y)?{base:t==null?void 0:t.base}:y),I=Yt(n==null?void 0:n.compoundVariants)?s:Ws(n==null?void 0:n.compoundVariants,s),D=R=>{if(Yt(g)&&Yt(o)&&p)return uo(f,R==null?void 0:R.class,R==null?void 0:R.className)(u);if(I&&!Array.isArray(I))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof I}`);if(i&&!Array.isArray(i))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof i}`);let K=(w,A,b=[],N)=>{let E=b;if(typeof A=="string"){let L=Di(A).split(" ");for(let F=0;F<L.length;F++)E.push(`${w}:${L[F]}`)}else if(Array.isArray(A))for(let L=0;L<A.length;L++)E.push(`${w}:${A[L]}`);else if(typeof A=="object"&&typeof N=="string"&&N in A){let L=A[N];if(L&&typeof L=="string"){let F=Di(L).split(" "),W=[];for(let M=0;M<F.length;M++)W.push(`${w}:${F[M]}`);E[N]=E[N]?E[N].concat(W):W}else if(Array.isArray(L)&&L.length>0){let F=[];for(let W=0;W<L.length;W++)F.push(`${w}:${L[W]}`);E[N]=F}}return E},V=(w,A=g,b=null,N=null)=>{let E=A[w];if(!E||Yt(E))return null;let L=(N==null?void 0:N[w])??(R==null?void 0:R[w]);if(L===null)return null;let F=Ri(L),W=Array.isArray(u.responsiveVariants)&&u.responsiveVariants.length>0||u.responsiveVariants===!0,M=h==null?void 0:h[w],m=[];if(typeof F=="object"&&W)for(let[X,le]of Object.entries(F)){let J=E[le];if(X==="initial"){M=le;continue}Array.isArray(u.responsiveVariants)&&!u.responsiveVariants.includes(X)||(m=K(X,J,m,b))}let C=F!=null&&typeof F!="object"?F:Ri(M),P=E[C||"false"];return typeof m=="object"&&typeof b=="string"&&m[b]?Vi(m,P):m.length>0?(m.push(P),b==="base"?m.join(" "):m):P},U=()=>{if(!g)return null;let w=Object.keys(g),A=[];for(let b=0;b<w.length;b++){let N=V(w[b],g);N&&A.push(N)}return A},ne=(w,A)=>{if(!g||typeof g!="object")return null;let b=[];for(let N in g){let E=V(N,g,w,A),L=w==="base"&&typeof E=="string"?E:E&&E[w];L&&b.push(L)}return b},ue={};for(let w in R){let A=R[w];A!==void 0&&(ue[w]=A)}let re=(w,A)=>{var N;let b=typeof(R==null?void 0:R[w])=="object"?{[w]:(N=R[w])==null?void 0:N.initial}:{};return{...h,...ue,...b,...A}},ae=(w=[],A)=>{let b=[],N=w.length;for(let E=0;E<N;E++){let{class:L,className:F,...W}=w[E],M=!0,m=re(null,A);for(let C in W){let P=W[C],X=m[C];if(Array.isArray(P)){if(!P.includes(X)){M=!1;break}}else{if((P==null||P===!1)&&(X==null||X===!1))continue;if(X!==P){M=!1;break}}}M&&(L&&b.push(L),F&&b.push(F))}return b},pe=w=>{let A=ae(I,w);if(!Array.isArray(A))return A;let b={},N=uo;for(let E=0;E<A.length;E++){let L=A[E];if(typeof L=="string")b.base=N(b.base,L)(u);else if(typeof L=="object")for(let F in L)b[F]=N(b[F],L[F])(u)}return b},O=w=>{if(i.length<1)return null;let A={},b=re(null,w);for(let N=0;N<i.length;N++){let{slots:E=[],class:L,className:F,...W}=i[N];if(!Yt(W)){let M=!0;for(let m in W){let C=b[m],P=W[m];if(C===void 0||(Array.isArray(P)?!P.includes(C):P!==C)){M=!1;break}}if(!M)continue}for(let M=0;M<E.length;M++){let m=E[M];A[m]||(A[m]=[]),A[m].push([L,F])}}return A};if(!Yt(o)||!p){let w={};if(typeof _=="object"&&!Yt(_)){let A=uo;for(let b in _)w[b]=N=>{let E=pe(N),L=O(N);return A(_[b],ne(b,N),E?E[b]:void 0,L?L[b]:void 0,N==null?void 0:N.class,N==null?void 0:N.className)(u)}}return w}return uo(f,U(),ae(I),R==null?void 0:R.class,R==null?void 0:R.className)(u)},H=()=>{if(!(!g||typeof g!="object"))return Object.keys(g)};return D.variantKeys=H(),D.extend=n,D.base=f,D.slots=_,D.variants=g,D.defaultVariants=h,D.compoundSlots=i,D.compoundVariants=I,D};Gs({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"}});Tt(["click"]);const Dd=Gs({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 Vd=k("<span><!></span>");function kn(t,e){Ze(e,!0);let n=je(e,"tone",3,"neutral"),o=je(e,"class",3,"");var a=Vd(),s=d(a);Kt(s,()=>e.children??nn),c(a),$(i=>Fe(a,1,i),[()=>We(Dd({tone:n(),class:o()}))]),x(t,a),Qe()}var Hd=k('<header class="px-4 h-9 flex items-center font-mono text-[10px] uppercase tracking-[0.1em] text-fg-2 border-b border-line-1 bg-bg-1"> </header>'),qd=k('<section><!> <div class="p-4"><!></div></section>');function Bn(t,e){let n=je(e,"floating",3,!1),o=je(e,"class",3,"");const a=S(()=>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=qd(),i=d(s);{var l=g=>{var h=Hd(),p=d(h,!0);c(h),$(()=>T(p,e.title)),x(g,h)};G(i,g=>{e.title&&g(l)})}var u=v(i,2),f=d(u);Kt(f,()=>e.children??nn),c(u),c(s),$(()=>Fe(s,1,`rounded-lg border overflow-hidden backdrop-blur-md ${r(a)??""} ${o()??""}`)),x(t,s)}var Fd=k('<span class="inline-flex items-center gap-1.5 font-mono text-[11px] text-fg-1 uppercase tracking-[0.06em]"><span></span> <span> </span></span>');function Kd(t,e){Ze(e,!0);const n=S(()=>({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=Fd(),a=d(o),s=v(a,2),i=d(s,!0);c(s),c(o),$(()=>{Fe(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)}),x(t,o),Qe()}var Bd=k('<kbd class="inline-flex items-center justify-center min-w-[18px] h-[18px] px-1.5 font-mono text-[10px] text-fg-1 bg-bg-2 border border-line-2 border-b-2 rounded-sm"><!></kbd>');function Qt(t,e){var n=Bd(),o=d(n);Kt(o,()=>e.children??nn),c(n),x(t,n)}const jd=[1e3,2e3,4e3,8e3,3e4];class Ud{constructor(e){this.opts=e}subscribe(e={}){return new Yd(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 Yd{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??jd,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 Lr(t,e){const n=it(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"}]];st(t,tt({name:"activity"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Wd(t,e){const n=it(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"}]];st(t,tt({name:"arrow-right"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function gr(t,e){const n=it(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"}]];st(t,tt({name:"braces"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Xd(t,e){const n=it(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"}]];st(t,tt({name:"building-2"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function $d(t,e){const n=it(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"}]];st(t,tt({name:"chart-column"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Gd(t,e){const n=it(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"}]];st(t,tt({name:"chart-line"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Zd(t,e){const n=it(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:"m6 9 6 6 6-6"}]];st(t,tt({name:"chevron-down"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function li(t,e){const n=it(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=[["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"}]];st(t,tt({name:"circle-alert"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Zs(t,e){const n=it(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"}],["path",{d:"m9 12 2 2 4-4"}]];st(t,tt({name:"circle-check"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Qd(t,e){const n=it(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=[["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"}]];st(t,tt({name:"clipboard-list"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Jd(t,e){const n=it(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=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];st(t,tt({name:"clock"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function eu(t,e){const n=it(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=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];st(t,tt({name:"columns-3"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Lo(t,e){const n=it(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=[["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"}]];st(t,tt({name:"database"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function tu(t,e){const n=it(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=[["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"}]];st(t,tt({name:"eye-off"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function nu(t,e){const n=it(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:"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"}]];st(t,tt({name:"eye"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Qs(t,e){const n=it(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:"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"}]];st(t,tt({name:"file-code-2"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function ru(t,e){const n=it(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:"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"}]];st(t,tt({name:"file-pen-line"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function ou(t,e){const n=it(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:"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"}]];st(t,tt({name:"file-text"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Js(t,e){const n=it(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=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"}]];st(t,tt({name:"filter"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function el(t,e){const n=it(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
363
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* ISC License
|
|
366
|
+
*
|
|
367
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
368
|
+
*
|
|
369
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
370
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
371
|
+
* copyright notice and this permission notice appear in all copies.
|
|
372
|
+
*
|
|
373
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
374
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
375
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
376
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
377
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
378
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
379
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
380
|
+
*
|
|
381
|
+
*/const o=[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]];st(t,tt({name:"gauge"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function au(t,e){const n=it(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=[["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"}]];st(t,tt({name:"git-branch"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function iu(t,e){const n=it(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=[["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"}]];st(t,tt({name:"git-commit-horizontal"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Da(t,e){const n=it(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:"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"}]];st(t,tt({name:"git-compare-arrows"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function su(t,e){const n=it(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=[["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"}]];st(t,tt({name:"hard-drive"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function lu(t,e){const n=it(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=[["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"}]];st(t,tt({name:"key-round"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function cu(t,e){const n=it(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:"M3 6h18"}],["path",{d:"M7 12h10"}],["path",{d:"M10 18h4"}]];st(t,tt({name:"list-filter"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function du(t,e){const n=it(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:"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"}]];st(t,tt({name:"list-tree"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function uu(t,e){const n=it(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
515
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
516
|
+
*
|
|
517
|
+
* ISC License
|
|
518
|
+
*
|
|
519
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
520
|
+
*
|
|
521
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
522
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
523
|
+
* copyright notice and this permission notice appear in all copies.
|
|
524
|
+
*
|
|
525
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
526
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
527
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
528
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
529
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
530
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
531
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
532
|
+
*
|
|
533
|
+
*/const o=[["path",{d:"M3 12h.01"}],["path",{d:"M3 18h.01"}],["path",{d:"M3 6h.01"}],["path",{d:"M8 12h13"}],["path",{d:"M8 18h13"}],["path",{d:"M8 6h13"}]];st(t,tt({name:"list"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function wr(t,e){const n=it(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=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];st(t,tt({name:"lock"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function fu(t,e){const n=it(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
553
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
554
|
+
*
|
|
555
|
+
* ISC License
|
|
556
|
+
*
|
|
557
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
558
|
+
*
|
|
559
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
560
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
561
|
+
* copyright notice and this permission notice appear in all copies.
|
|
562
|
+
*
|
|
563
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
564
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
565
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
566
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
567
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
568
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
569
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
570
|
+
*
|
|
571
|
+
*/const o=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}]];st(t,tt({name:"moon"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function vu(t,e){const n=it(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
572
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
573
|
+
*
|
|
574
|
+
* ISC License
|
|
575
|
+
*
|
|
576
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
577
|
+
*
|
|
578
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
579
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
580
|
+
* copyright notice and this permission notice appear in all copies.
|
|
581
|
+
*
|
|
582
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
583
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
584
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
585
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
586
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
587
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
588
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
589
|
+
*
|
|
590
|
+
*/const o=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}]];st(t,tt({name:"pause"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function tl(t,e){const n=it(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
591
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
592
|
+
*
|
|
593
|
+
* ISC License
|
|
594
|
+
*
|
|
595
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
596
|
+
*
|
|
597
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
598
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
599
|
+
* copyright notice and this permission notice appear in all copies.
|
|
600
|
+
*
|
|
601
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
602
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
603
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
604
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
605
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
606
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
607
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
608
|
+
*
|
|
609
|
+
*/const o=[["path",{d:"M12 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"}]];st(t,tt({name:"plug"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function nl(t,e){const n=it(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:"M5 12h14"}],["path",{d:"M12 5v14"}]];st(t,tt({name:"plus"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function gu(t,e){const n=it(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:"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"}]];st(t,tt({name:"radio-tower"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function pu(t,e){const n=it(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 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"}]];st(t,tt({name:"radio"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function rl(t,e){const n=it(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:"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"}]];st(t,tt({name:"refresh-cw"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Va(t,e){const n=it(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=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M21 9H3"}],["path",{d:"M21 15H3"}]];st(t,tt({name:"rows-3"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function hu(t,e){const n=it(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
705
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
706
|
+
*
|
|
707
|
+
* ISC License
|
|
708
|
+
*
|
|
709
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
710
|
+
*
|
|
711
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
712
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
713
|
+
* copyright notice and this permission notice appear in all copies.
|
|
714
|
+
*
|
|
715
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
716
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
717
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
718
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
719
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
720
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
721
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
722
|
+
*
|
|
723
|
+
*/const o=[["path",{d:"M3 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"}]];st(t,tt({name:"scan-line"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function xu(t,e){const n=it(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:"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"}]];st(t,tt({name:"scroll-text"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function Hi(t,e){const n=it(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:"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"}]];st(t,tt({name:"send"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function bu(t,e){const n=it(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:"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"}]];st(t,tt({name:"server-crash"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function fo(t,e){const n=it(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:"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"}]];st(t,tt({name:"shield-alert"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function mu(t,e){const n=it(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 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"}]];st(t,tt({name:"shield-check"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function _u(t,e){const n=it(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"}]];st(t,tt({name:"shield"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function yu(t,e){const n=it(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=[["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"}]];st(t,tt({name:"sun"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function qi(t,e){const n=it(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:"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"}]];st(t,tt({name:"trash-2"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function wu(t,e){const n=it(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
876
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
877
|
+
*
|
|
878
|
+
* ISC License
|
|
879
|
+
*
|
|
880
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
881
|
+
*
|
|
882
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
883
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
884
|
+
* copyright notice and this permission notice appear in all copies.
|
|
885
|
+
*
|
|
886
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
887
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
888
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
889
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
890
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
891
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
892
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
893
|
+
*
|
|
894
|
+
*/const o=[["path",{d:"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"}]];st(t,tt({name:"users"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}function ku(t,e){const n=it(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:"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"}]];st(t,tt({name:"zap"},()=>n,{get iconNode(){return o},children:(a,s)=>{var i=qe(),l=fe(i);lt(l,e,"default",{}),x(a,i)},$$slots:{default:!0}}))}var Cu=k("<!> Connecting…",1),Su=k("<!> Connect",1),Nu=k('<!> <span class="text-ok"> </span>',1),Eu=k('<!> <span class="text-danger truncate"> </span>',1),Mu=k("<span> </span>"),zu=k('<div class="group flex items-center gap-1 rounded hover:bg-bg-2 transition-colors"><button type="button" class="flex-1 flex items-center justify-between gap-3 px-2 py-1.5 text-left cursor-pointer bg-transparent border-0 disabled:cursor-not-allowed disabled:opacity-50 min-w-0"><code class="font-mono text-[11px] text-fg-1 truncate"> </code> <span class="font-mono text-[10px] text-fg-3 shrink-0 flex items-center gap-1.5"><!> <span> </span></span></button> <button type="button" title="Remove from history" class="opacity-0 group-hover:opacity-100 p-1 mr-0.5 text-fg-3 hover:text-danger transition-all cursor-pointer bg-transparent border-0"><!></button></div>'),Tu=k('<div class="mt-3 pt-3 border-t border-line-1"><div class="flex items-center gap-1.5 mb-2"><!> <span class="type-label">Recent</span></div> <div class="grid gap-0.5 max-h-[180px] overflow-y-auto"></div></div>'),Pu=k('<div class="fixed inset-0 z-40" role="presentation"></div> <div class="absolute top-[calc(100%+6px)] left-0 z-50 w-[380px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl p-4" role="dialog" aria-label="Connect to reddb"><form><label for="connect-url" class="type-label block mb-1.5">Instance URL</label> <input id="connect-url" spellcheck="false" placeholder="red://localhost" class="w-full h-9 px-3 mb-1 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent placeholder:text-fg-3"/> <div class="mb-2 text-[10px] font-mono text-fg-3"> </div> <button type="submit" class="w-full h-9 bg-accent text-white font-medium rounded-md cursor-pointer transition-colors hover:bg-[#ff3868] disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"><!></button> <div class="h-5 mt-2 flex items-center gap-1.5 text-[11px] font-mono"><!></div></form> <!></div>',1),Iu=k('<div class="relative"><button type="button" aria-haspopup="dialog" class="inline-flex items-center gap-2 h-7 pl-2 pr-1.5 bg-bg-2 border border-line-2 rounded-md text-fg-1 cursor-pointer text-xs transition-colors hover:border-line-3 hover:text-fg-0"><span></span> <!> <span class="font-mono"> </span> <span class="font-mono text-[10px] text-fg-3"> </span> <!></button> <!></div>');function Au(t,e){Ze(e,!0);const n="red://localhost";function o(){var L,F;return(L=Ue.history[0])!=null&&L.url?Ue.history[0].url:(F=Ue.history[0])!=null&&F.label?Ue.history[0].label:Ue.active.url?Ue.active.url:n}let a=ye(!1),s=ye(zt(o())),i=ye("idle"),l=ye(null),u=ye(null),f=ye(void 0),g=ye(void 0);async function h(L){const F=L.trim().replace(/\/$/,"");if(!F)return;if(z(s,F,!0),!Ue.canReach(F)){z(i,"error"),z(l,`This app can't reach that transport here — supported: ${r(K)}`);return}z(i,"probing"),z(l,null),z(u,null),await Ue.tryConnect(cd(F))?(z(i,"ok"),z(u,Ue.probe.rtt_ms??null,!0),setTimeout(()=>z(a,!1),350)):(z(i,"error"),z(l,Ue.probe.error??"unreachable",!0))}function p(L){L.preventDefault(),h(r(s))}function y(L){const F=Date.now()-L;return F<6e4?"just now":F<36e5?`${Math.round(F/6e4)}m ago`:F<864e5?`${Math.round(F/36e5)}h ago`:`${Math.round(F/864e5)}d ago`}function _(L,F){L.stopPropagation(),Ue.forgetById(F)}function I(){z(a,!r(a)),r(a)&&setTimeout(()=>{var L;return(L=r(g))==null?void 0:L.focus()},0)}Wn(()=>{const L=()=>{z(a,!0),setTimeout(()=>{var F;return(F=r(g))==null?void 0:F.focus()},0)};return window.addEventListener("red:open-connect",L),()=>window.removeEventListener("red:open-connect",L)});const D=S(()=>Ue.connected?"bg-ok":r(i)==="error"?"bg-danger":"bg-fg-3"),H=S(()=>Ue.connected?Ue.active.label:"Connect"),R=S(()=>Ue.connected&&Ue.probe.rtt_ms!==void 0?`${Ue.probe.rtt_ms}ms`:Ue.connected?"live":"no connection"),K=S(()=>{const L=Ue.supportedTransports,F=[];return(L.includes("http")||L.includes("https"))&&F.push("http(s)://"),L.includes("unix")&&F.push("file://"),F.join(" · ")}),V=S(()=>Ue.history.filter(L=>!L.url||Ue.canReach(L.url)));var U=Iu(),ne=d(U),ue=d(ne),re=v(ue,2);{var ae=L=>{tl(L,{class:"size-3 text-fg-3"})};G(re,L=>{Ue.connected||L(ae)})}var pe=v(re,2),O=d(pe,!0);c(pe);var w=v(pe,2),A=d(w,!0);c(w);var b=v(w,2);Zd(b,{class:"size-3 text-fg-3"}),c(ne);var N=v(ne,2);{var E=L=>{var F=Pu(),W=fe(F),M=v(W,2),m=d(M),C=v(d(m),2);Dt(C),bn(C,te=>z(g,te),()=>r(g));var P=v(C,2),X=d(P);c(P);var le=v(P,2),J=d(le);{var Y=te=>{var ge=Cu(),xe=fe(ge);mn(xe,{class:"size-3.5 animate-spin"}),Te(),x(te,ge)},Z=te=>{var ge=Su(),xe=fe(ge);ku(xe,{class:"size-3.5"}),Te(),x(te,ge)};G(J,te=>{r(i)==="probing"?te(Y):te(Z,-1)})}c(le);var Q=v(le,2),se=d(Q);{var B=te=>{var ge=Nu(),xe=fe(ge);Zs(xe,{class:"size-3 text-ok"});var _e=v(xe,2),ze=d(_e);c(_e),$(()=>T(ze,`Connected${r(u)!==null?` · ${r(u)}ms`:""}`)),x(te,ge)},q=te=>{var ge=Eu(),xe=fe(ge);li(xe,{class:"size-3 text-danger"});var _e=v(xe,2),ze=d(_e,!0);c(_e),$(()=>T(ze,r(l))),x(te,ge)};G(se,te=>{r(i)==="ok"?te(B):r(i)==="error"&&te(q,1)})}c(Q),c(m);var ee=v(m,2);{var oe=te=>{var ge=Tu(),xe=d(ge),_e=d(xe);Jd(_e,{class:"size-3 text-fg-3"}),Te(2),c(xe);var ze=v(xe,2);Je(ze,21,()=>r(V),qt,(be,ve)=>{var Ne=zu(),Pe=d(Ne),de=d(Pe),ie=d(de,!0);c(de);var me=v(de,2),Ce=d(me);{var ke=He=>{var nt=Mu(),Ke=d(nt);c(nt),$(()=>T(Ke,`${r(ve).rtt_ms??""}ms`)),x(He,nt)};G(Ce,He=>{r(ve).rtt_ms!==void 0&&He(ke)})}var Ee=v(Ce,2),he=d(Ee,!0);c(Ee),c(me),c(Pe);var Se=v(Pe,2),Ae=d(Se);$t(Ae,{class:"size-3"}),c(Se),c(Ne),$(He=>{Pe.disabled=r(i)==="probing",Me(Pe,"title",r(ve).url?void 0:"Enter credentials to reconnect"),T(ie,r(ve).url??r(ve).label),T(he,He)},[()=>y(r(ve).last_used)]),we("click",Pe,()=>{r(ve).url?h(r(ve).url):(z(s,r(ve).label,!0),setTimeout(()=>{var He;return(He=r(g))==null?void 0:He.focus()},0))}),we("click",Se,He=>_(He,r(ve).id)),x(be,Ne)}),c(ze),c(ge),x(te,ge)};G(ee,te=>{r(V).length>0&&te(oe)})}c(M),bn(M,te=>z(f,te),()=>r(f)),$(te=>{T(X,`reachable here: ${r(K)??""}`),le.disabled=te},[()=>r(i)==="probing"||!r(s).trim()]),we("click",W,()=>z(a,!1)),Ln("submit",m,p),Ft(C,()=>r(s),te=>z(s,te)),x(L,F)};G(N,L=>{r(a)&&L(E)})}c(U),$(L=>{Me(ne,"aria-expanded",r(a)),Me(ne,"title",Ue.connected?"Switch connection":"Connect to reddb"),Fe(ue,1,L),T(O,r(H)),T(A,r(R))},[()=>We(["w-1.5 h-1.5 rounded-full shrink-0",r(D)].join(" "))]),we("click",ne,I),x(t,U),Qe()}Tt(["click"]);var Lu=k("<!> <span> </span>",1),Ou=k('<!> <span class="text-fg-3">idle</span>',1),Ru=k('<button type="button" title="Force-clear the in-flight counter (use when a request hangs)" class="px-1.5 py-0.5 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer text-[10px]">reset</button>'),Du=k('<div class="px-3 py-3 text-fg-3">No activity yet.</div>'),Vu=k('<div class="text-danger text-[10px] truncate"> </div>'),Hu=k('<div class="px-3 py-1.5 border-b border-line-1/50 last:border-0 grid grid-cols-[16px_1fr_auto] items-center gap-2"><span aria-hidden="true"><!></span> <div class="min-w-0"><div class="text-fg-1 truncate"> </div> <!></div> <div class="text-fg-3 text-[10px] tabular-nums whitespace-nowrap"><!></div></div>'),qu=k('<div class="fixed inset-0 z-40" role="presentation"></div> <div role="dialog" aria-label="Activity log" class="absolute top-[calc(100%+6px)] right-0 z-50 w-[360px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl text-[11px] font-mono"><header class="flex items-center justify-between px-3 py-2 border-b border-line-1"><span class="type-label">Recent reddb requests</span> <div class="flex items-center gap-2"><span class="text-fg-3"> </span> <!></div></header> <div class="max-h-[320px] overflow-y-auto py-1"><!></div></div>',1),Fu=k('<div class="relative"><button type="button" title="reddb activity"><!></button> <!></div>');function Ku(t,e){Ze(e,!0);let n=ye(!1);function o(p){return p===null?"…":p<1e3?`${p}ms`:`${(p/1e3).toFixed(1)}s`}function a(p){const y=Date.now()-p;return y<1e3?"just now":y<6e4?`${Math.round(y/1e3)}s ago`:`${Math.round(y/6e4)}m ago`}var s=Fu(),i=d(s),l=d(i);{var u=p=>{var y=Lu(),_=fe(y);mn(_,{class:"size-3.5 animate-spin"});var I=v(_,2),D=d(I,!0);c(I),$(()=>T(D,Mt.inflight)),x(p,y)},f=p=>{var y=Ou(),_=fe(y);Lr(_,{class:"size-3.5"}),Te(2),x(p,y)};G(l,p=>{Mt.inflight>0?p(u):p(f,-1)})}c(i);var g=v(i,2);{var h=p=>{var y=qu(),_=fe(y),I=v(_,2),D=d(I),H=v(d(D),2),R=d(H),K=d(R);c(R);var V=v(R,2);{var U=pe=>{var O=Ru();we("click",O,()=>Mt.reset()),x(pe,O)};G(V,pe=>{Mt.inflight>0&&pe(U)})}c(H),c(D);var ne=v(D,2),ue=d(ne);{var re=pe=>{var O=Du();x(pe,O)},ae=pe=>{var O=qe(),w=fe(O);Je(w,17,()=>Mt.log,A=>A.id,(A,b)=>{var N=Hu(),E=d(N),L=d(E);{var F=se=>{mn(se,{class:"size-3 animate-spin text-accent"})},W=se=>{Zs(se,{class:"size-3 text-ok"})},M=se=>{li(se,{class:"size-3 text-danger"})};G(L,se=>{r(b).status==="pending"?se(F):r(b).status==="ok"?se(W,1):se(M,-1)})}c(E);var m=v(E,2),C=d(m),P=d(C,!0);c(C);var X=v(C,2);{var le=se=>{var B=Vu(),q=d(B,!0);c(B),$(()=>T(q,r(b).error)),x(se,B)};G(X,se=>{r(b).status==="error"&&r(b).error&&se(le)})}c(m);var J=v(m,2),Y=d(J);{var Z=se=>{var B=pt();$(q=>T(B,q),[()=>a(r(b).startedAt)]),x(se,B)},Q=se=>{var B=pt();$(q=>T(B,q),[()=>o(r(b).durationMs)]),x(se,B)};G(Y,se=>{r(b).status==="pending"?se(Z):se(Q,-1)})}c(J),c(N),$(()=>T(P,r(b).label)),x(A,N)}),x(pe,O)};G(ue,pe=>{Mt.log.length===0?pe(re):pe(ae,-1)})}c(ne),c(I),$(()=>T(K,`${Mt.inflight??""} active`)),we("click",_,()=>z(n,!1)),x(p,y)};G(g,p=>{r(n)&&p(h)})}c(s),$(p=>{Me(i,"aria-pressed",r(n)),Fe(i,1,p)},[()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md border text-xs font-mono transition-colors cursor-pointer",Mt.inflight>0?"border-accent/40 bg-accent/10 text-accent":"border-line-2 bg-bg-2 text-fg-3 hover:text-fg-1"].join(" "))]),we("click",i,()=>z(n,!r(n))),x(t,s),Qe()}Tt(["click"]);const ol="red-ui-theme",Co="light";function Bu(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??Co;const a=localStorage.getItem(ol);return a==="dark"||a==="light"?a:n??Co}function Fi(t,e){if(e){e.dataset.theme=t;return}typeof document<"u"&&(document.documentElement.dataset.theme=t)}function ju(t,e){e&&(typeof localStorage>"u"||localStorage.setItem(ol,t))}var Kr;class Uu{constructor(){De(this,Kr,ye(Co));wt(this,"target",null);wt(this,"persistTheme",!0)}get current(){return r(ce(this,Kr))}set current(e){z(ce(this,Kr),e,!0)}init(e={}){this.target=e.target??null,this.persistTheme=e.persist??!0,this.current=Bu(this.target,this.persistTheme,e.initial),Fi(this.current,this.target)}set(e){this.current=e,Fi(e,this.target),ju(e,this.persistTheme)}toggle(){this.set(this.current==="dark"?"light":"dark")}}Kr=new WeakMap;const jn=new Uu;function Ki(t){switch(t.view){case"query":return"/query";case"collections":return"/collections";case"cluster":return"/cluster";case"security":return"/security";case"collection":return dd(t.collection,t.subpage)}}function Yu(t){return t.view==="collection"?{view:"collections",collection:t.collection,subpage:t.subpage}:{view:t.view,collection:null,subpage:null}}function Wu(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};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 al(t){let e=ye(zt({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 Ki(r(e).collection?{view:"collection",collection:r(e).collection,subpage:r(e).subpage??"table"}:{view:r(e).view})},href:n=>Ki(n),go:(n,o)=>{o==null||o.preventDefault(),z(e,Yu(n),!0)}}}const il=Symbol("red-ui-router");let ga=null;function Xu(t){return oi(il,t),t}function Qr(){const t=Go(il);return t||(ga||(ga=al()),ga)}var $u=k('<div class="w-px h-[18px] bg-line-2"></div> <!> <div class="w-px h-[18px] bg-line-2 ml-1"></div>',1),Gu=k('<div class="w-px h-[18px] bg-line-2"></div>'),Zu=k('<header class="h-11 flex items-center justify-between px-3.5 bg-bg-1/80 backdrop-blur-md border-b border-line-1 relative z-10"><div class="flex items-center gap-2.5"><a class="font-mono font-semibold text-[13px] tracking-tight text-fg-0 no-underline hover:text-accent transition-colors">red<span class="text-accent mx-px">·</span>ui</a> <!> <nav class="flex items-center gap-0.5"><a title="Query"><!> <span>Query</span></a> <a title="Collections"><!> <span>Collections</span></a> <a title="Cluster topology"><!> <span>Cluster</span></a> <a title="Security"><!> <span>Security</span></a></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 Qu(t,e){Ze(e,!0);let n=je(e,"showConnect",3,!0);const o=Qr();function a(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0,bubbles:!0}))}const s=S(()=>o.view==="query"),i=S(()=>o.view==="collections"),l=S(()=>o.view==="cluster"),u=S(()=>o.view==="security");var f=Zu(),g=d(f),h=d(g),p=v(h,2);{var y=W=>{var M=$u(),m=v(fe(M),2);Au(m,{}),Te(2),x(W,M)},_=W=>{var M=Gu();x(W,M)};G(p,W=>{n()?W(y):W(_,-1)})}var I=v(p,2),D=d(I),H=d(D);Qs(H,{class:"size-3.5"}),Te(2),c(D);var R=v(D,2),K=d(R);Lo(K,{class:"size-3.5"}),Te(2),c(R);var V=v(R,2),U=d(V);ud(U,{class:"size-3.5"}),Te(2),c(V);var ne=v(V,2),ue=d(ne);_u(ue,{class:"size-3.5"}),Te(2),c(ne),c(I),c(g);var re=v(g,2),ae=d(re);Ku(ae,{});var pe=v(ae,2),O=d(pe);{var w=W=>{yu(W,{class:"size-3.5"})},A=W=>{fu(W,{class:"size-3.5"})};G(O,W=>{jn.current==="dark"?W(w):W(A,-1)})}c(pe);var b=v(pe,2),N=d(b);hn(N,{class:"size-3.5 text-fg-3"});var E=v(N,4),L=d(E);Qt(L,{children:(W,M)=>{Te();var m=pt("⌘");x(W,m)}});var F=v(L);Qt(F,{children:(W,M)=>{Te();var m=pt("K");x(W,m)}}),c(E),c(b),c(re),c(f),$((W,M,m,C,P,X,le,J,Y)=>{Me(h,"href",W),Me(D,"href",M),Me(D,"aria-current",r(s)?"page":void 0),Fe(D,1,m),Me(R,"href",C),Me(R,"aria-current",r(i)?"page":void 0),Fe(R,1,P),Me(V,"href",X),Me(V,"aria-current",r(l)?"page":void 0),Fe(V,1,le),Me(ne,"href",J),Me(ne,"aria-current",r(u)?"page":void 0),Fe(ne,1,Y),Me(pe,"title",jn.current==="dark"?"Switch to light theme":"Switch to dark theme"),Me(pe,"aria-label",jn.current==="dark"?"Switch to light theme":"Switch to dark theme")},[()=>o.href({view:"collections"}),()=>o.href({view:"query"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(s)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>o.href({view:"collections"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(i)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>o.href({view:"cluster"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(l)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>o.href({view:"security"}),()=>We(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",r(u)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" "))]),we("click",h,W=>o.go({view:"collections"},W)),we("click",D,W=>o.go({view:"query"},W)),we("click",R,W=>o.go({view:"collections"},W)),we("click",V,W=>o.go({view:"cluster"},W)),we("click",ne,W=>o.go({view:"security"},W)),we("click",pe,()=>jn.toggle()),we("click",b,a),x(t,f),Qe()}Tt(["click"]);function Ju(t){return`'${t.replace(/'/g,"''")}'`}function ef(){return Math.random().toString(36).slice(2,10)}function ci(t){return`UPDATE ${t.table} SET ${t.col} = ${Ju(t.newValue)} WHERE rid = ${t.row};`}var Br,jr;class tf{constructor(){De(this,Br,ye(zt([])));De(this,jr,S(()=>this.changes.length));wt(this,"executor",null)}get changes(){return r(ce(this,Br))}set changes(e){z(ce(this,Br),e,!0)}get count(){return r(ce(this,jr))}set count(e){z(ce(this,jr),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},g=this.changes.slice();return g[i]=f,this.changes=g,u.id}const l=ef();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(ci)}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 g=o.get(f.id);g!=null&&g.ok?s+=1:a.push({...f,error:(g==null?void 0:g.error)??"commit failed"})}const i=new Set(a.map(f=>f.id)),l=this.changes.filter(f=>!e.some(g=>g.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=[]}}Br=new WeakMap,jr=new WeakMap;const jt=new tf;function pa(t){try{const e=t();return typeof e=="string"&&e.length>0?e:void 0}catch{return}}function nf(t){return t.startsWith("v")?t.slice(1):t}function sl(){return{version:nf(pa(()=>"0.1.1")??"0.0.0-dev"),gitSha:pa(()=>"unknown")??"unknown",buildTime:pa(()=>"unknown")??"unknown"}}sl().version;var rf=k('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">rtt</span> <span class="text-fg-1 tabular-nums"> </span><span class="text-fg-3">ms</span></span>',1),of=k('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lag</span> <span> </span></span>',1),af=k('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lsn</span> <span class="text-fg-1 tabular-nums"> </span></span>',1),sf=k('<span class="text-fg-3">·</span> <span class="inline-flex items-center gap-1 shrink-0 text-warn"><!> <span class="uppercase tracking-wider text-[10px]">read-only — file in use</span></span>',1),lf=k('<span class="inline-flex items-center gap-1.5 shrink-0"><span class="w-1.5 h-1.5 rounded-full"></span> <span class="text-fg-1 uppercase tracking-wider text-[10px]"> </span></span> <span class="text-fg-3">·</span> <span class="text-fg-1 truncate"> </span> <!> <!> <!> <!>',1),cf=k('<span class="inline-flex items-center gap-1.5 shrink-0"><span class="w-1.5 h-1.5 rounded-full bg-fg-3"></span> <span class="text-fg-3">Not connected</span></span>'),df=k('<button type="button" data-no-nav="" class="inline-flex items-center gap-1.5 px-3 text-accent hover:bg-bg-2/60 transition-colors cursor-pointer bg-transparent border-0 border-l border-line-1"><!> <span class="tabular-nums"> </span></button>'),uf=k('<button type="button" data-no-nav="" class="inline-flex items-center gap-1 px-3 text-fg-2 hover:text-fg-0 hover:bg-bg-2/60 transition-colors cursor-pointer bg-transparent border-0 border-l border-line-1"><span>Connect</span> <!></button>'),ff=k('<div class="h-8 flex items-stretch border-b border-line-1 bg-bg-1/60 text-[11px] font-mono select-none" role="status" aria-label="Connection status"><div role="button" tabindex="0" title="Open cluster overview" class="flex-1 flex items-center gap-3 px-3 cursor-pointer hover:bg-bg-2/40 transition-colors min-w-0"><!></div> <!> <!> <span class="inline-flex items-center px-3 shrink-0 font-mono text-fg-3 border-l border-line-1 select-none"> </span></div>');function vf(t,e){Ze(e,!0);const n=sl(),o=Qr(),a=S(()=>jt.count),s=S(()=>Ue.readOnly),i=S(()=>Ue.readOnlyReason);function l(){window.dispatchEvent(new CustomEvent("red:open-pending-changes"))}const u=S(()=>Ue.connected),f=S(()=>{var O,w;return((O=Ue.probe.replication)==null?void 0:O.role)??((w=Ue.active)==null?void 0:w.role)??"standalone"}),g=S(()=>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)"),h=S(()=>{var O,w;return((O=Ue.probe.replication)==null?void 0:O.wal_lsn)??((w=Ue.probe.replication)==null?void 0:w.last_applied_lsn)}),p=S(()=>{const O=Ue.probe.replication;if(!(!O||r(f)!=="replica")&&!(O.last_seen_primary_lsn===void 0||O.last_applied_lsn===void 0))return Math.max(0,O.last_seen_primary_lsn-O.last_applied_lsn)});function y(){window.dispatchEvent(new CustomEvent("red:open-connect"))}function _(O){const w=O.target;w!=null&&w.closest("button, a, [data-no-nav]")||o.go({view:"cluster"})}function I(O){(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),o.go({view:"cluster"}))}var D=ff(),H=d(D),R=d(H);{var K=O=>{var w=lf(),A=fe(w),b=d(A);let N;var E=v(b,2),L=d(E,!0);c(E),c(A);var F=v(A,4),W=d(F,!0);c(F);var M=v(F,2);{var m=Z=>{var Q=rf(),se=v(fe(Q),2),B=v(d(se),2),q=d(B,!0);c(B),Te(),c(se),$(()=>T(q,Ue.probe.rtt_ms)),x(Z,Q)};G(M,Z=>{Ue.probe.rtt_ms!==void 0&&Z(m)})}var C=v(M,2);{var P=Z=>{var Q=of(),se=v(fe(Q),2),B=v(d(se),2);let q;var ee=d(B,!0);c(B),c(se),$(()=>{q=Fe(B,1,"text-fg-1 tabular-nums",null,q,{"text-warn":(r(p)??0)>0}),T(ee,r(p))}),x(Z,Q)};G(C,Z=>{r(f)==="replica"&&r(p)!==void 0&&Z(P)})}var X=v(C,2);{var le=Z=>{var Q=af(),se=v(fe(Q),2),B=v(d(se),2),q=d(B,!0);c(B),c(se),$(()=>T(q,r(h))),x(Z,Q)};G(X,Z=>{r(h)!==void 0&&Z(le)})}var J=v(X,2);{var Y=Z=>{var Q=sf(),se=v(fe(Q),2),B=d(se);wr(B,{class:"size-3"}),Te(2),c(se),$(()=>Me(se,"title",r(i)??"The server is open read-only — mutations are disabled.")),x(Z,Q)};G(J,Z=>{r(s)&&Z(Y)})}$(()=>{N=Zt(b,"",N,{"background-color":r(g)}),T(L,r(f)),T(W,Ue.active.label)}),x(O,w)},V=O=>{var w=cf();x(O,w)};G(R,O=>{r(u)?O(K):O(V,-1)})}c(H);var U=v(H,2);{var ne=O=>{var w=df(),A=d(w);ru(A,{class:"size-3"});var b=v(A,2),N=d(b);c(b),c(w),$(()=>{Me(w,"aria-label",`${r(a)} pending changes`),T(N,`Pending changes (${r(a)??""})`)}),we("click",w,l),x(O,w)};G(U,O=>{r(a)>0&&O(ne)})}var ue=v(U,2);{var re=O=>{var w=uf(),A=v(d(w),2);Wd(A,{class:"size-3"}),c(w),we("click",w,y),x(O,w)};G(ue,O=>{r(u)||O(re)})}var ae=v(ue,2),pe=d(ae);c(ae),c(D),$(()=>{Me(ae,"title",`red-ui ${n.version} · ${n.gitSha} · built ${n.buildTime}`),T(pe,`v${n.version??""}`)}),we("click",H,_),we("keydown",H,I),x(t,D),Qe()}Tt(["click","keydown"]);var gf=k('<span class="hint svelte-1yq04zr"> </span>'),pf=k('<button><span class="label svelte-1yq04zr"> </span> <!> <!></button>'),hf=k('<div class="group-label svelte-1yq04zr"> </div> <!>',1),xf=k('<div class="empty svelte-1yq04zr"> </div>'),bf=k('<div class="scrim svelte-1yq04zr" role="presentation"></div> <div class="palette svelte-1yq04zr" role="dialog" aria-modal="true"><div class="input-wrap svelte-1yq04zr"><span class="search-icon svelte-1yq04zr">⌕</span> <input placeholder="Search or run a command…" spellcheck="false" class="svelte-1yq04zr"/> <!></div> <div class="list svelte-1yq04zr"><!> <!></div> <footer class="svelte-1yq04zr"><span><!> <!> navigate</span> <span><!> run</span> <span><!><!> toggle</span></footer></div>',1);function mf(t,e){Ze(e,!0);const n=Qr();let o=ye(!1),a=ye(""),s=ye(0),i=ye(void 0);function l(K){window.dispatchEvent(new CustomEvent(K))}const u=[{id:"query",group:"navigate",label:"Open query",hint:"/query",run:()=>g({view:"query"})},{id:"collections",group:"navigate",label:"Open collections",hint:"/collections",run:()=>g({view:"collections"})},{id:"topology",group:"navigate",label:"Open cluster",hint:"/cluster",run:()=>g({view:"cluster"})},{id:"security",group:"navigate",label:"Open security",hint:"/security",run:()=>g({view:"security"})},{id:"new-query",group:"data",label:"New query",shortcut:"⌘T",run:()=>{l("red:new-query"),h()}},{id:"open-connect",group:"actions",label:"Open Connect dropdown",shortcut:"⌘⇧C",run:()=>{l("red:open-connect"),h()}},{id:"apply-pending",group:"actions",label:"Apply pending changes",run:()=>{l("red:apply-pending"),h()}},{id:"discard-pending",group:"actions",label:"Discard pending changes",run:()=>{l("red:discard-pending"),h()}},{id:"toggle-theme",group:"view",label:"Toggle theme (light / dark)",hint:"theme",run:()=>{jn.toggle(),h()}},{id:"show-shortcuts",group:"view",label:"Show keyboard shortcuts",shortcut:"?",run:()=>{h(),l("red:open-shortcuts")}}],f=S(()=>r(a).trim()===""?u:u.filter(K=>K.label.toLowerCase().includes(r(a).toLowerCase())));function g(K){n.go(K),h()}function h(){z(o,!1),z(a,""),z(s,0)}function p(K){if(!(K instanceof HTMLElement))return!1;if(K.isContentEditable)return!0;const V=K.tagName;return V==="INPUT"||V==="TEXTAREA"||V==="SELECT"}function y(K){var ne;const V=K.metaKey||K.ctrlKey,U=K.key.toLowerCase();if(V&&U==="k"){K.preventDefault(),z(o,!r(o)),r(o)&&setTimeout(()=>{var ue;return(ue=r(i))==null?void 0:ue.focus()},0);return}if(V&&K.shiftKey&&U==="c"){K.preventDefault(),l("red:open-connect");return}if(V&&!K.shiftKey&&U==="t"&&!p(K.target)){K.preventDefault(),l("red:new-query");return}if(r(o)){if(K.key==="Escape"){h();return}K.key==="ArrowDown"&&(K.preventDefault(),z(s,Math.min(r(s)+1,r(f).length-1),!0)),K.key==="ArrowUp"&&(K.preventDefault(),z(s,Math.max(r(s)-1,0),!0)),K.key==="Enter"&&(K.preventDefault(),(ne=r(f)[r(s)])==null||ne.run())}}Wn(()=>{window.addEventListener("keydown",y);const K=()=>{z(o,!0),setTimeout(()=>{var V;return(V=r(i))==null?void 0:V.focus()},0)};return window.addEventListener("red:open-palette",K),()=>{window.removeEventListener("keydown",y),window.removeEventListener("red:open-palette",K)}});const _=["navigate","data","actions","view"],I={navigate:"Navigate",data:"Data",actions:"Actions",view:"View"};var D=qe(),H=fe(D);{var R=K=>{var V=bf(),U=fe(V),ne=v(U,2),ue=d(ne),re=v(d(ue),2);Dt(re),bn(re,P=>z(i,P),()=>r(i));var ae=v(re,2);Qt(ae,{children:(P,X)=>{Te();var le=pt("esc");x(P,le)}}),c(ue);var pe=v(ue,2),O=d(pe);Je(O,17,()=>_,qt,(P,X)=>{const le=S(()=>r(f).filter(Q=>Q.group===r(X)));var J=qe(),Y=fe(J);{var Z=Q=>{var se=hf(),B=fe(se),q=d(B,!0);c(B);var ee=v(B,2);Je(ee,17,()=>r(le),qt,(oe,te)=>{const ge=S(()=>r(f).indexOf(r(te)));var xe=pf();let _e;var ze=d(xe),be=d(ze,!0);c(ze);var ve=v(ze,2);{var Ne=ie=>{var me=gf(),Ce=d(me,!0);c(me),$(()=>T(Ce,r(te).hint)),x(ie,me)};G(ve,ie=>{r(te).hint&&ie(Ne)})}var Pe=v(ve,2);{var de=ie=>{Qt(ie,{children:(me,Ce)=>{Te();var ke=pt();$(()=>T(ke,r(te).shortcut)),x(me,ke)}})};G(Pe,ie=>{r(te).shortcut&&ie(de)})}c(xe),$(()=>{_e=Fe(xe,1,"row svelte-1yq04zr",null,_e,{active:r(ge)===r(s)}),T(be,r(te).label)}),Ln("mouseenter",xe,()=>z(s,r(ge),!0)),we("click",xe,()=>r(te).run()),x(oe,xe)}),$(()=>T(q,I[r(X)])),x(Q,se)};G(Y,Q=>{r(le).length&&Q(Z)})}x(P,J)});var w=v(O,2);{var A=P=>{var X=xf(),le=d(X);c(X),$(()=>T(le,`No commands match "${r(a)??""}"`)),x(P,X)};G(w,P=>{r(f).length===0&&P(A)})}c(pe);var b=v(pe,2),N=d(b),E=d(N);Qt(E,{children:(P,X)=>{Te();var le=pt("↑");x(P,le)}});var L=v(E,2);Qt(L,{children:(P,X)=>{Te();var le=pt("↓");x(P,le)}}),Te(),c(N);var F=v(N,2),W=d(F);Qt(W,{children:(P,X)=>{Te();var le=pt("↵");x(P,le)}}),Te(),c(F);var M=v(F,2),m=d(M);Qt(m,{children:(P,X)=>{Te();var le=pt("⌘");x(P,le)}});var C=v(m);Qt(C,{children:(P,X)=>{Te();var le=pt("K");x(P,le)}}),Te(),c(M),c(b),c(ne),we("click",U,h),we("keydown",U,function(...P){}),we("input",re,()=>z(s,0)),Ft(re,()=>r(a),P=>z(a,P)),x(K,V)};G(H,K=>{r(o)&&K(R)})}x(t,D),Qe()}Tt(["click","keydown","input"]);const _f=[{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"}],yf=["Global","Connection","Workspace","Editing"];var wf=k('<li class="flex items-center justify-between gap-3 px-2 py-1.5 rounded hover:bg-bg-2"><span class="text-fg-1 text-[13px]"> </span> <span class="inline-flex gap-1 shrink-0"></span></li>'),kf=k('<section><div class="flex items-baseline justify-between mb-2"><h3 class="type-label m-0"> </h3> <span class="text-fg-3 text-[11px]"> </span></div> <ul class="grid gap-1 m-0 p-0 list-none"></ul></section>'),Cf=k('<div class="fixed inset-0 z-[200] bg-bg-0/70 backdrop-blur-md flex items-center justify-center p-6" role="presentation"><div class="w-full max-w-[640px] max-h-[80vh] overflow-y-auto bg-bg-1 border border-line-2 rounded-lg shadow-2xl" role="dialog" aria-modal="true" aria-label="Keyboard shortcuts" tabindex="-1"><header class="flex items-center justify-between px-5 py-3 border-b border-line-1"><div class="flex items-center gap-2"><span class="type-label">Keyboard shortcuts</span></div> <div class="flex items-center gap-1.5 text-fg-3 text-[11px]"><!> close</div></header> <div class="p-5 grid gap-5"></div></div></div>');function Sf(t,e){Ze(e,!0);let n=ye(!1);function o(){z(n,!1)}function a(h){if(!(h instanceof HTMLElement))return!1;if(h.isContentEditable)return!0;const p=h.tagName;return p==="INPUT"||p==="TEXTAREA"||p==="SELECT"}function s(h){if(h.key==="Escape"&&r(n)){h.preventDefault(),o();return}if(h.key==="?"&&!h.metaKey&&!h.ctrlKey&&!h.altKey){if(a(h.target))return;h.preventDefault(),z(n,!r(n))}}Wn(()=>{window.addEventListener("keydown",s);const h=()=>{z(n,!0)};return window.addEventListener("red:open-shortcuts",h),()=>{window.removeEventListener("keydown",s),window.removeEventListener("red:open-shortcuts",h)}});const i=S(()=>yf.map(h=>({ctx:h,items:_f.filter(p=>p.context===h)})).filter(h=>h.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=qe(),f=fe(u);{var g=h=>{var p=Cf(),y=d(p),_=d(y),I=v(d(_),2),D=d(I);Qt(D,{children:(R,K)=>{Te();var V=pt("Esc");x(R,V)}}),Te(),c(I),c(_);var H=v(_,2);Je(H,21,()=>r(i),qt,(R,K)=>{var V=kf(),U=d(V),ne=d(U),ue=d(ne,!0);c(ne);var re=v(ne,2),ae=d(re,!0);c(re),c(U);var pe=v(U,2);Je(pe,21,()=>r(K).items,qt,(O,w)=>{var A=wf(),b=d(A),N=d(b,!0);c(b);var E=v(b,2);Je(E,21,()=>r(w).keys,qt,(L,F)=>{Qt(L,{children:(W,M)=>{Te();var m=pt();$(()=>T(m,r(F))),x(W,m)}})}),c(E),c(A),$(()=>T(N,r(w).label)),x(O,A)}),c(pe),c(V),$(()=>{T(ue,r(K).ctx),T(ae,l[r(K).ctx])}),x(R,V)}),c(H),c(y),c(p),we("click",p,o),we("click",y,R=>R.stopPropagation()),we("keydown",y,function(...R){}),x(h,p)};G(f,h=>{r(n)&&h(g)})}x(t,u),Qe()}Tt(["click","keydown"]);var Nf=k('<label for="mp-confirm" class="type-label block mb-1">Confirm</label> <input id="mp-confirm" type="password" autocomplete="new-password" spellcheck="false" class="w-full h-9 px-3 mb-2 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent"/>',1),Ef=k("<!> ",1),Mf=k('<!> <span class="text-danger truncate"> </span>',1),zf=k('<button type="button" class="inline-flex items-center gap-1.5 text-fg-3 hover:text-danger transition-colors cursor-pointer bg-transparent border-0 p-0"><!> <span>Start fresh — wipe this browser</span></button>'),Tf=k('<div class="flex items-center justify-between gap-2"><span class="text-danger">Erase the encrypted store and all saved connections?</span></div> <div class="flex items-center gap-2 mt-1.5"><button type="button" class="inline-flex items-center gap-1.5 px-2 py-1 rounded border border-danger/40 bg-danger/10 text-danger hover:bg-danger/20 cursor-pointer"><!> Yes, wipe</button> <button type="button" class="px-2 py-1 rounded border border-line-2 text-fg-2 hover:text-fg-0 cursor-pointer">Cancel</button></div>',1),Pf=k('<div class="fixed inset-0 z-[100] flex items-center justify-center bg-bg-0/70 backdrop-blur-sm motion-reduce:backdrop-blur-none" role="dialog" aria-modal="true" aria-labelledby="mp-title"><form class="w-[380px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl p-5"><div class="flex items-center gap-2 mb-1.5 text-fg-0"><!> <h2 id="mp-title" class="type-h2 m-0"> </h2></div> <p class="text-fg-3 text-[12px] leading-relaxed m-0 mb-3"> </p> <label for="mp-pwd" class="type-label block mb-1">Master password</label> <input id="mp-pwd" type="password" spellcheck="false" class="w-full h-9 px-3 mb-2 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent"/> <!> <button type="submit" class="w-full h-9 mt-1 bg-accent text-white font-medium rounded-md cursor-pointer transition-colors hover:bg-[#ff3868] disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"><!></button> <div class="h-5 mt-2 flex items-center gap-1.5 text-[11px] font-mono"><!></div> <div class="mt-3 pt-3 border-t border-line-1 text-[11px] font-mono"><!></div></form></div>');function If(t,e){Ze(e,!0);let n=ye(""),o=ye(""),a=ye(!1),s=ye(!1),i=ye(void 0);function l(){Lt.error=null,z(s,!0)}function u(){z(s,!1)}function f(){Lt.wipe(),z(n,""),z(o,""),z(s,!1),setTimeout(()=>{var R;return(R=r(i))==null?void 0:R.focus()},0)}const g=S(()=>Lt.needsSetup),h=S(()=>Lt.error),p=S(()=>r(g)?"Set a master password":"Unlock credentials"),y=S(()=>r(g)?"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.");Pt(()=>{Lt.locked&&setTimeout(()=>{var R;return(R=r(i))==null?void 0:R.focus()},0)});async function _(R){if(R.preventDefault(),r(a)||!r(n))return;if(r(g)&&r(n)!==r(o)){Lt.error="Passwords don't match";return}z(a,!0);const K=await Lt.unlock(r(n));z(a,!1),K&&(z(n,""),z(o,""),Ue.refresh())}var I=qe(),D=fe(I);{var H=R=>{var K=Pf(),V=d(K),U=d(V),ne=d(U);{var ue=Y=>{lu(Y,{class:"size-4 text-accent"})},re=Y=>{wr(Y,{class:"size-4 text-accent"})};G(ne,Y=>{r(g)?Y(ue):Y(re,-1)})}var ae=v(ne,2),pe=d(ae,!0);c(ae),c(U);var O=v(U,2),w=d(O,!0);c(O);var A=v(O,4);Dt(A),bn(A,Y=>z(i,Y),()=>r(i));var b=v(A,2);{var N=Y=>{var Z=Nf(),Q=v(fe(Z),2);Dt(Q),Ft(Q,()=>r(o),se=>z(o,se)),x(Y,Z)};G(b,Y=>{r(g)&&Y(N)})}var E=v(b,2),L=d(E);{var F=Y=>{var Z=Ef(),Q=fe(Z);mn(Q,{class:"size-3.5 animate-spin"});var se=v(Q);$(()=>T(se,` ${r(g)?"Setting up…":"Unlocking…"}`)),x(Y,Z)},W=Y=>{var Z=pt();$(()=>T(Z,r(g)?"Set password":"Unlock")),x(Y,Z)};G(L,Y=>{r(a)?Y(F):Y(W,-1)})}c(E);var M=v(E,2),m=d(M);{var C=Y=>{var Z=Mf(),Q=fe(Z);li(Q,{class:"size-3 text-danger"});var se=v(Q,2),B=d(se,!0);c(se),$(()=>T(B,r(h))),x(Y,Z)};G(m,Y=>{r(h)&&Y(C)})}c(M);var P=v(M,2),X=d(P);{var le=Y=>{var Z=zf(),Q=d(Z);qi(Q,{class:"size-3"}),Te(2),c(Z),we("click",Z,l),x(Y,Z)},J=Y=>{var Z=Tf(),Q=v(fe(Z),2),se=d(Q),B=d(se);qi(B,{class:"size-3"}),Te(),c(se);var q=v(se,2);c(Q),we("click",se,f),we("click",q,u),x(Y,Z)};G(X,Y=>{r(s)?Y(J,-1):Y(le)})}c(P),c(V),c(K),$(()=>{T(pe,r(p)),T(w,r(y)),Me(A,"autocomplete",r(g)?"new-password":"current-password"),E.disabled=r(a)||!r(n)||r(g)&&!r(o)}),Ln("submit",V,_),Ft(A,()=>r(n),Y=>z(n,Y)),x(R,K)};G(D,R=>{Lt.backend==="web"&&Lt.locked&&R(H)})}x(t,I),Qe()}Tt(["click"]);var Af=k('<div class="text-fg-3 text-[12px] font-mono py-6 text-center">No staged changes.</div>'),Lf=k('<div class="text-warn text-[11px] mt-1 inline-flex items-center gap-1"><!> </div>'),Of=k('<li class="border border-line-1 rounded px-2 py-1.5 bg-bg-2/30"><div class="flex items-center justify-between gap-2 mb-1"><span class="text-fg-2"><span class="text-fg-1"> </span> <span class="text-fg-3">· rid</span> <span class="text-fg-1 tabular-nums"> </span> <span class="text-fg-3">·</span> <span class="text-fg-1"> </span></span> <button type="button" class="text-fg-3 hover:text-fg-1 text-[11px]">Unstage</button></div> <div class="text-[11px] grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5"><span class="text-fg-3">old</span> <span class="text-fg-2 truncate"> </span> <span class="text-fg-3">new</span> <span class="text-accent truncate"> </span></div> <div class="text-fg-3 text-[10.5px] mt-1 truncate"> </div> <!></li>'),Rf=k('<ul class="space-y-2 text-[12px] font-mono"></ul>'),Df=k('<div class="text-warn text-[11px] font-mono mt-2"> </div>'),Vf=k('<div class="flex items-center gap-1.5 px-4 py-2 text-warn text-[11px] font-mono border-t border-line-1 bg-warn/5"><!> <span> </span></div>'),Hf=k('<div class="fixed inset-0 z-50 grid place-items-center bg-bg-0/70 backdrop-blur-sm motion-reduce:backdrop-blur-none" role="dialog" aria-modal="true" aria-label="Pending changes"><div class="w-full max-w-2xl mx-4 bg-bg-1 border border-line-1 rounded-md shadow-lg overflow-hidden"><div class="flex items-center justify-between px-4 py-3 border-b border-line-1"><div><h2 class="type-h3 m-0">Pending changes</h2> <p class="text-fg-3 text-[11px] font-mono m-0 mt-0.5"> </p></div> <button type="button" class="p-1 text-fg-3 hover:text-fg-1" aria-label="Close"><!></button></div> <div class="max-h-[50vh] overflow-auto px-4 py-3"><!> <!></div> <!> <div class="flex items-center justify-end gap-2 px-4 py-3 border-t border-line-1 bg-bg-1/60"><button type="button" class="text-[12px] font-mono px-3 py-1 text-fg-3 hover:text-fg-1">Cancel</button> <button type="button" class="text-[12px] font-mono px-3 py-1 text-fg-1 border border-line-1 rounded hover:bg-bg-2">Discard all</button> <button type="button" class="text-[12px] font-mono px-3 py-1 bg-accent text-white rounded disabled:opacity-50"> </button></div></div></div>');function qf(t,e){Ze(e,!0);const n=S(()=>Ue.readOnly),o=S(()=>Ue.readOnlyReason);let a=ye(!1),s=ye(null);async function i(){if(!r(a)){z(a,!0),z(s,null);try{(await jt.commitAll()).failed.length===0&&e.onClose()}catch(h){z(s,h.message,!0)}finally{z(a,!1)}}}function l(){jt.discardAll(),e.onClose()}var u=qe(),f=fe(u);{var g=h=>{var p=Hf(),y=d(p),_=d(y),I=d(_),D=v(d(I),2),H=d(D);c(D),c(I);var R=v(I,2),K=d(R);$t(K,{class:"size-4"}),c(R),c(_);var V=v(_,2),U=d(V);{var ne=L=>{var F=Af();x(L,F)},ue=L=>{var F=Rf();Je(F,21,()=>jt.changes,W=>W.id,(W,M)=>{var m=Of(),C=d(m),P=d(C),X=d(P),le=d(X,!0);c(X);var J=v(X,4),Y=d(J,!0);c(J);var Z=v(J,4),Q=d(Z,!0);c(Z),c(P);var se=v(P,2);c(C);var B=v(C,2),q=v(d(B),2),ee=d(q,!0);c(q);var oe=v(q,4),te=d(oe,!0);c(oe),c(B);var ge=v(B,2),xe=d(ge,!0);c(ge);var _e=v(ge,2);{var ze=be=>{var ve=Lf(),Ne=d(ve);fd(Ne,{class:"size-3"});var Pe=v(Ne);c(ve),$(()=>T(Pe,` ${r(M).error??""}`)),x(be,ve)};G(_e,be=>{r(M).error&&be(ze)})}c(m),$((be,ve)=>{T(le,r(M).table),T(Y,r(M).row),T(Q,r(M).col),T(ee,be),T(te,r(M).newValue),T(xe,ve)},[()=>String(r(M).oldValue??"NULL"),()=>ci(r(M))]),we("click",se,()=>jt.unstage(r(M).id)),x(W,m)}),c(F),x(L,F)};G(U,L=>{jt.count===0?L(ne):L(ue,-1)})}var re=v(U,2);{var ae=L=>{var F=Df(),W=d(F,!0);c(F),$(()=>T(W,r(s))),x(L,F)};G(re,L=>{r(s)&&L(ae)})}c(V);var pe=v(V,2);{var O=L=>{var F=Vf(),W=d(F);wr(W,{class:"size-3 shrink-0"});var M=v(W,2),m=d(M,!0);c(M),c(F),$(()=>T(m,r(o)??"Server is read-only (file in use) — changes can’t be applied.")),x(L,F)};G(pe,L=>{r(n)&&L(O)})}var w=v(pe,2),A=d(w),b=v(A,2),N=v(b,2),E=d(N,!0);c(N),c(w),c(y),c(p),$(()=>{T(H,`${jt.count??""} staged · review before applying`),b.disabled=jt.count===0,N.disabled=jt.count===0||r(a)||r(n),Me(N,"title",r(n)?r(o)??"Server is read-only — mutations are disabled.":void 0),T(E,r(a)?"Applying…":"Apply all")}),we("click",R,function(...L){var F;(F=e.onClose)==null||F.apply(this,L)}),we("click",A,function(...L){var F;(F=e.onClose)==null||F.apply(this,L)}),we("click",b,l),we("click",N,i),x(h,p)};G(f,h=>{e.open&&h(g)})}x(t,u),Qe()}Tt(["click"]);const Ff=["vector","queue","stats","diff","hypertable","graph","kv","document","table"],ll={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 Kf(t){return`'${t.replace(/'/g,"''")}'`}function Bi(t){if(!t||t.length===0)return"table";const e=new Set;for(const n of t){const o=String(n).toLowerCase(),a=ll[o];a&&e.add(a)}for(const n of Ff)if(e.has(n))return n;return"table"}function Bf(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 jf(t){return typeof t!="string"?null:ll[t.toLowerCase()]??null}async function ji(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 Uf(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 Yf(t){var i,l,u;const e=Uf(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 cl(t,e,n={}){var o,a,s,i,l,u,f;if(n.useMetadata)try{const g=await t.collection(e),h=Bf(g);if(h.length>0)return Bi(h)}catch{}try{const h=(i=(s=(a=(o=(await t.query(`SELECT model FROM red.collections WHERE name = ${Kf(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=jf(h);if(p&&p!=="table")return p;if(typeof h=="string"&&h.toLowerCase()==="mixed"){const y=await ji(t,e);if(y)return y}}catch{}try{const g=e.replace(/[^A-Za-z0-9_./-]/g,""),h=await t.query(`SELECT * FROM ${g} LIMIT 1`),p=[];h.capability&&p.push(h.capability);const y=(f=(u=(l=h.result)==null?void 0:l.records)==null?void 0:u[0])==null?void 0:f.values,_=y?y.red_capabilities:void 0;if(Array.isArray(_))for(const D of _)typeof D=="string"&&p.push(D);else if(typeof _=="string")for(const D of _.split(/[,\s]+/))D&&p.push(D);const I=Bi(p);return I!=="table"?I:Yf(h)??"table"}catch{return await ji(t,e)??"table"}}const ha={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"}},Wf=/^red[._]/i;function Xf(t){return Wf.test(t)}var $f=k('<span class="font-mono text-[10px] text-fg-3"> </span>'),Gf=k('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><!> <span class="text-fg-1">Locked.</span> <span>Enter your master password to load the schema.</span></div>'),Zf=k('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><!> <span>No schema to show.</span> <span>Connect to a reddb instance to inspect collections.</span></div>'),Qf=k(`<div class="p-3 text-[12px] text-fg-3 font-mono leading-relaxed"><div class="text-fg-2">Couldn't load collections.</div> <div class="mt-1 break-words"> </div></div>`),Jf=k('<div class="p-3 text-[12px] text-fg-3 font-mono">Loading…</div>'),ev=k('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><span class="text-fg-2">No user collections.</span> <span>Seed the instance to populate the schema.</span> <code class="px-2 py-1 bg-bg-2 border border-line-1 rounded text-[11px]"> </code></div>'),tv=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear collection search"><!></button>'),nv=k('<button type="button"> </button>'),rv=k('<li class="px-3 py-2 font-mono text-[12px] text-fg-3">No matching collections.</li>'),ov=k('<li><a><span class="inline-block w-4 text-center text-fg-3" aria-hidden="true"> </span> <span class="truncate"> </span> <span class="sr-only"> </span></a></li>'),av=k('<div class="p-2 border-b border-line-1 grid gap-2"><div class="flex items-center gap-1.5 h-7 rounded border border-line-1 bg-bg-0 px-2 text-[11px] font-mono"><!> <input type="text" placeholder="search collections…" class="min-w-0 flex-1 bg-transparent text-fg-1 outline-none placeholder:text-fg-3"/> <!></div> <div class="flex flex-wrap gap-1"><button type="button"> </button> <!></div></div> <ul class="py-1" role="list"><!> <!></ul>',1),iv=k('<div class="px-3 py-2 border-b border-line-1 flex items-center justify-between text-fg-3"><div class="flex items-center gap-2"><!> <span class="type-label">Schema</span></div> <!></div> <!>',1);function sv(t,e){Ze(e,!0);const n=Qr(),o=S(()=>n.collection);let a=ye(zt([])),s=ye(!1),i=ye(null),l=ye(""),u=ye("all");const f=S(()=>Ue.connected),g=S(()=>Ue.active.url),h=S(()=>{const O=new Map;for(const w of r(a))O.set(w.capability,(O.get(w.capability)??0)+1);return[...O.entries()].sort((w,A)=>w[0].localeCompare(A[0]))}),p=S(()=>{const O=r(l).trim().toLowerCase();return r(a).filter(w=>{if(r(u)!=="all"&&w.capability!==r(u))return!1;if(!O)return!0;const A=ha[w.capability];return w.name.toLowerCase().includes(O)||A.label.toLowerCase().includes(O)})});async function y(){const O=Ue.client;if(!O||!r(f)){z(a,[],!0);return}z(s,!0),z(i,null);const w=r(g);try{const b=(await Mt.track("schema · list collections",()=>O.collections())).filter(E=>!Xf(E)).sort();z(a,b.map(E=>({name:E,capability:"table"})),!0);const N=b.map(E=>Mt.track(`schema · probe ${E}`,async()=>{const L=await cl(O,E);w===r(g)&&z(a,r(a).map(F=>F.name===E?{...F,capability:L}:F),!0)}));await Promise.all(N)}catch(A){z(i,A.message,!0),z(a,[],!0)}finally{z(s,!1)}}Pt(()=>{Lt.locked||(r(f),r(g),y())});var _=iv(),I=fe(_),D=d(I),H=d(D);Lo(H,{class:"size-3.5"}),Te(2),c(D);var R=v(D,2);{var K=O=>{var w=$f(),A=d(w,!0);c(w),$(()=>T(A,r(a).length)),x(O,w)};G(R,O=>{r(f)&&r(a).length>0&&O(K)})}c(I);var V=v(I,2);{var U=O=>{var w=Gf(),A=d(w);wr(A,{class:"size-4 text-accent"}),Te(4),c(w),x(O,w)},ne=O=>{var w=Zf(),A=d(w);tl(A,{class:"size-4 text-fg-3"}),Te(4),c(w),x(O,w)},ue=O=>{var w=Qf(),A=v(d(w),2),b=d(A,!0);c(A),c(w),$(()=>T(b,r(i))),x(O,w)},re=O=>{var w=Jf();x(O,w)},ae=O=>{var w=ev(),A=v(d(w),4),b=d(A);c(A),c(w),$(()=>T(b,`./scripts/seed.sh ${r(g)??""}`)),x(O,w)},pe=O=>{var w=av(),A=fe(w),b=d(A),N=d(b);hn(N,{class:"size-3 text-fg-3"});var E=v(N,2);Dt(E);var L=v(E,2);{var F=Y=>{var Z=tv(),Q=d(Z);$t(Q,{class:"size-3"}),c(Z),we("click",Z,()=>z(l,"")),x(Y,Z)};G(L,Y=>{r(l)&&Y(F)})}c(b);var W=v(b,2),M=d(W),m=d(M);c(M);var C=v(M,2);Je(C,17,()=>r(h),([Y,Z])=>Y,(Y,Z)=>{var Q=S(()=>rn(r(Z),2));let se=()=>r(Q)[0],B=()=>r(Q)[1];const q=S(()=>ha[se()]);var ee=nv(),oe=d(ee);c(ee),$(te=>{Me(ee,"title",r(q).label),Fe(ee,1,te),T(oe,`${r(q).glyph??""} ${B()??""}`)},[()=>We(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",r(u)===se()?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",ee,()=>z(u,se(),!0)),x(Y,ee)}),c(W),c(A);var P=v(A,2),X=d(P);{var le=Y=>{var Z=rv();x(Y,Z)};G(X,Y=>{r(p).length===0&&Y(le)})}var J=v(X,2);Je(J,17,()=>r(p),Y=>Y.name,(Y,Z)=>{const Q=S(()=>ha[r(Z).capability]),se=S(()=>r(Z).name===r(o)),B=S(()=>({view:"collection",collection:r(Z).name,subpage:Pr(r(Z).capability)}));var q=ov(),ee=d(q),oe=d(ee),te=d(oe,!0);c(oe);var ge=v(oe,2),xe=d(ge,!0);c(ge);var _e=v(ge,2),ze=d(_e,!0);c(_e),c(ee),c(q),$((be,ve)=>{Me(ee,"href",be),Me(ee,"aria-current",r(se)?"page":void 0),Me(ee,"title",`${r(Q).label} · ${r(Z).name}`),Fe(ee,1,ve),T(te,r(Q).glyph),T(xe,r(Z).name),T(ze,r(Q).label)},[()=>n.href(r(B)),()=>We(["w-full flex items-center gap-2 px-3 py-1 font-mono text-[12px] no-underline transition-colors",r(se)?"bg-bg-1 text-fg-0":"text-fg-2 hover:bg-bg-1 hover:text-fg-0"].join(" "))]),we("click",ee,be=>n.go(r(B),be)),x(Y,q)}),c(P),$(Y=>{Fe(M,1,Y),T(m,`all ${r(a).length??""}`)},[()=>We(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",r(u)==="all"?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),Ft(E,()=>r(l),Y=>z(l,Y)),we("click",M,()=>z(u,"all")),x(O,w)};G(V,O=>{Lt.locked?O(U):r(f)?r(i)?O(ue,2):r(s)&&r(a).length===0?O(re,3):r(a).length===0?O(ae,4):O(pe,-1):O(ne,1)})}x(t,_),Qe()}Tt(["click"]);function lv(){return Math.random().toString(36).slice(2,10)}var Ur,Yr,Wr;class cv{constructor(){De(this,Ur,ye(zt([])));De(this,Yr,ye(null));De(this,Wr,S(()=>this.tabs.find(e=>e.id===this.activeId)??null))}get tabs(){return r(ce(this,Ur))}set tabs(e){z(ce(this,Ur),e,!0)}get activeId(){return r(ce(this,Yr))}set activeId(e){z(ce(this,Yr),e,!0)}get active(){return r(ce(this,Wr))}set active(e){z(ce(this,Wr),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:lv()};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}}Ur=new WeakMap,Yr=new WeakMap,Wr=new WeakMap;const _t=new cv;function dv(){return{sql:"",result:null,error:null,running:!1}}var Xr;class uv{constructor(){De(this,Xr,ye(zt({})));wt(this,"counter",0);wt(this,"executor",null)}get states(){return r(ce(this,Xr))}set states(e){z(ce(this,Xr),e,!0)}setExecutor(e){this.executor=e}nextLabel(){return this.counter+=1,`Query ${this.counter}`}ensure(e){return this.states[e]||(this.states[e]=dv()),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}}Xr=new WeakMap;const tn=new uv;function fv(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 vv(t){return`'${t.replace(/'/g,"''")}'`}function gv(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 = ${vv(t)}`,"LIMIT 1"].join(" ")}function Fn(t){return typeof t=="string"&&t.length>0?t:void 0}function Kn(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 pv(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t.toLowerCase()==="true")return!0;if(t.toLowerCase()==="false")return!1}}function hv(t){if(!t)return null;const e=t.values,n=Fn(e.name);return n?{name:n,model:Fn(e.model),schemaMode:Fn(e.schema_mode),entities:Kn(e.entities),segments:Kn(e.segments),indices:Kn(e.indices),inMemoryBytes:Kn(e.in_memory_bytes),onDiskBytes:Kn(e.on_disk_bytes),internal:pv(e.internal),tenantId:Fn(e.tenant_id),queueMode:Fn(e.queue_mode),dimension:Kn(e.dimension),metric:Fn(e.metric),sessionKey:Fn(e.session_key),sessionGapMs:Kn(e.session_gap_ms)}:null}function So(t){return t===void 0?"n/a":new Intl.NumberFormat("en-US").format(t)}function Ui(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 xv(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 Yi(t){const e=[];t.schemaMode&&e.push(t.schemaMode),t.dimension!==void 0&&e.push(`${So(t.dimension)}d`),t.metric&&e.push(t.metric),t.queueMode&&e.push(t.queueMode),t.sessionKey&&e.push(`session: ${t.sessionKey}`);const n=xv(t.sessionGapMs);return n&&e.push(`gap ${n}`),t.internal&&e.push("internal"),e}class bv{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 on=new bv,mv=80,dl=["rid","collection","kind","tenant","created_at","updated_at"],_v=new Set(dl);function Ha(t){return _v.has(t.toLowerCase())}function yv(t,e={}){const n=t.result.columns,o=n.filter(f=>!f.startsWith("red_")&&f!=="body"),a=o.filter(f=>!Ha(f)),s=a.find(f=>f.toLowerCase()==="id"),i=a.filter(f=>f!==s),l=[s,...i].filter(f=>!!f);return e.showSystem?[...dl.filter(f=>o.includes(f)),...l]:l.length>0?l:n}function Wi(t){const e=t.toLowerCase();return e==="rid"?"rid":e==="id"?"id":null}function wv(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 kv(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function Cv(t){return t==null}function Sv(t,e=mv){return t.result.records.slice(0,e).map(n=>n.values)}var Nv=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6"> </div>'),Ev=k('<button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer" title="Return to the original result"><!> reset</button>'),Mv=k('<button type="button" title="Build a SELECT for this collection"><!> <span>select</span></button> <button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed" title="Run the current SELECT against reddb"><!> run</button> <!> <div class="h-4 w-px bg-line-1"></div>',1),zv=k('<span class="text-[9px] px-1 rounded bg-accent text-white"> </span>'),Tv=k('<button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer" title="Clear all filters"><!> clear</button>'),Pv=k('<label><input type="checkbox" class="sr-only"/> </label>'),Iv=k('<span class="text-warn"> </span>'),Av=k('<div class="border-b border-line-1 bg-bg-1/20 px-3 py-2 text-[11px] font-mono"><div class="mb-2 flex items-center gap-2"><span class="text-fg-3">columns:</span> <button type="button" class="rounded border border-line-1 px-1.5 py-0.5 text-fg-3 hover:text-fg-1 hover:border-line-2">all</button> <button type="button" class="rounded border border-line-1 px-1.5 py-0.5 text-fg-3 hover:text-fg-1 hover:border-line-2">none</button> <label class="ml-auto inline-flex items-center gap-1.5 text-fg-3">limit <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5"><option>50</option><option>100</option><option>200</option><option>500</option><option>1k</option></select></label></div> <div class="flex flex-wrap gap-1"></div> <div class="mt-2 flex items-center gap-2 text-fg-3"><code class="min-w-0 flex-1 truncate rounded border border-line-1 bg-bg-0 px-2 py-1 text-fg-1"> </code> <!></div></div>'),Lv=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">Empty result.</div>'),Ov=k(`<span class="ml-1 text-[9px] px-1 py-0.5 rounded bg-accent text-white uppercase tracking-wider font-semibold" title="System-assigned row id — reddb's canonical address">sys</span>`),Rv=k('<span class="ml-1 text-[9px] px-1 py-0.5 rounded border border-line-2 text-fg-3 uppercase tracking-wider" title="Reserved system field — written by reddb">sys</span>'),Dv=k('<span class="ml-1 text-[9px] px-1 py-0.5 rounded border border-line-2 text-fg-2 uppercase tracking-wider" title="User-defined identifier">pk</span>'),Vv=k('<span class="ml-1 text-[10px] text-fg-3 uppercase tracking-wide" title="Inferred primary key">pk</span>'),Hv=k("<th><span> </span> <!></th>"),qv=k('<button type="button" class="absolute right-1 top-1/2 -translate-y-1/2 text-fg-3 hover:text-fg-1 cursor-pointer"><!></button>'),Fv=k('<th class="px-1 py-1"><div class="relative"><input type="text" class="w-full h-6 pl-2 pr-5 bg-bg-1 text-fg-1 border border-line-1 rounded text-[11px] font-mono outline-none focus:border-accent placeholder:text-fg-3"/> <!></div></th>'),Kv=k('<tr class="border-b border-line-1 bg-bg-0"><th class="px-2 py-1"></th><!></tr>'),Bv=k('<input class="w-full bg-bg-2 text-fg-1 border border-accent/60 rounded px-1 py-0.5 outline-none"/>'),jv=k('<span class="text-fg-3 italic">NULL</span>'),Uv=k('<span class="block truncate"> </span>'),Yv=k("<td><!></td>"),Wv=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-right text-fg-3 select-none"></td><!></tr>'),Xv=k('· <span class="text-fg-2"> </span>',1),$v=k('<span>· pk <code class="text-fg-2"> </code></span>'),Gv=k('<div class="flex-1 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-right w-10 font-normal">#</th><!></tr><!></thead><tbody></tbody></table></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3 flex items-center gap-3"><span> <!> <!></span> <span>· double-click a cell to stage edit</span> <!></div>',1),Zv=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><!> <button type="button"><!> <span>filters</span> <!></button> <!> <div class="ml-auto text-fg-3"> <!> rows</div></div> <!> <!>',1),Qv=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function Jv(t,e){Ze(e,!0);let n=je(e,"showSystem",3,!1),o=ye(null);const a=S(()=>r(o)??e.result),s=S(()=>Sv(r(a))),i=S(()=>yv(r(a),{showSystem:n()})),l=S(()=>wv(r(i))),u=S(()=>r(i).filter(m=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(m)));let f=ye(!1),g=ye(zt({})),h=ye(200),p=ye(!1),y=ye(null);Pt(()=>{const m={...r(g)};let C=!1;for(const P of r(u))m[P]===void 0&&(m[P]=!0,C=!0);for(const P of Object.keys(m))r(u).includes(P)||(delete m[P],C=!0);C&&z(g,m,!0)});let _=ye(zt({})),I=ye(!1);const D=S(()=>{const m=Object.entries(r(_)).filter(([,C])=>C.trim().length>0);return m.length===0?r(s):r(s).filter(C=>m.every(([P,X])=>{const le=C[P];return le==null?!1:String(le).toLowerCase().includes(X.toLowerCase())}))}),H=S(()=>r(D)),R=S(()=>Object.values(r(_)).filter(m=>m.trim().length>0).length);function K(m){const C={...r(_)};delete C[m],z(_,C,!0)}function V(){z(_,{},!0)}function U(){if(!e.collection)return null;const m=e.collection.replace(/[^A-Za-z0-9_./-]/g,"");return m.length>0?m:null}function ne(){const m=r(u).filter(C=>r(g)[C]);return m.length===0||m.length===r(u).length?"*":m.join(", ")}function ue(){const m=U();return m?`SELECT ${ne()} FROM ${m} LIMIT ${r(h)}`:null}async function re(){const m=Ue.client,C=ue();if(!(!m||!C)){z(p,!0),z(y,null);try{const P=await Mt.track(`${e.collection} · ${C}`,()=>m.query(C));if(!P.ok){z(y,P.error??"query failed",!0);return}z(o,P,!0),z(_,{},!0),z(pe,null)}catch(P){z(y,P.message,!0)}finally{z(p,!1)}}}function ae(){z(o,null),z(_,{},!0),z(y,null)}let pe=ye(null),O=ye("");function w(m,C,P){if(r(pe)||!e.collection||Ue.readOnly)return;z(pe,{row:m,col:C},!0);const X=jt.find(e.collection,m,C);z(O,X?X.newValue:String(P??""),!0)}function A(){var le;if(!r(pe)||!e.collection)return;const{row:m,col:C}=r(pe),P=(le=r(H)[m])==null?void 0:le[C],X=r(O);if(String(P??"")!==X)jt.stage(e.collection,m,C,P,X);else{const J=jt.find(e.collection,m,C);J&&jt.unstage(J.id)}z(pe,null)}function b(){z(pe,null)}function N(m){m.focus(),m.select()}function E(m,C,P){if(!e.collection)return{value:P,staged:!1};const X=jt.find(e.collection,m,C);return X?{value:X.newValue,staged:!0}:{value:P,staged:!1}}var L=Qv(),F=d(L);{var W=m=>{var C=Nv(),P=d(C,!0);c(C),$(()=>T(P,r(a).error??"Query failed.")),x(m,C)},M=m=>{var C=Zv(),P=fe(C),X=d(P);{var le=ve=>{var Ne=Mv(),Pe=fe(Ne),de=d(Pe);eu(de,{class:"size-3"}),Te(2),c(Pe);var ie=v(Pe,2),me=d(ie);{var Ce=Se=>{mn(Se,{class:"size-3 animate-spin"})},ke=Se=>{Qo(Se,{class:"size-3"})};G(me,Se=>{r(p)?Se(Ce):Se(ke,-1)})}Te(),c(ie);var Ee=v(ie,2);{var he=Se=>{var Ae=Ev(),He=d(Ae);vd(He,{class:"size-3"}),Te(),c(Ae),we("click",Ae,ae),x(Se,Ae)};G(Ee,Se=>{r(o)&&Se(he)})}Te(2),$(Se=>{Me(Pe,"aria-pressed",r(f)),Fe(Pe,1,Se),ie.disabled=r(p)||!Ue.connected},[()=>We(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",r(f)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",Pe,()=>z(f,!r(f))),we("click",ie,re),x(ve,Ne)};G(X,ve=>{e.collection&&ve(le)})}var J=v(X,2),Y=d(J);Js(Y,{class:"size-3"});var Z=v(Y,4);{var Q=ve=>{var Ne=zv(),Pe=d(Ne,!0);c(Ne),$(()=>T(Pe,r(R))),x(ve,Ne)};G(Z,ve=>{r(R)>0&&ve(Q)})}c(J);var se=v(J,2);{var B=ve=>{var Ne=Tv(),Pe=d(Ne);$t(Pe,{class:"size-3"}),Te(),c(Ne),we("click",Ne,V),x(ve,Ne)};G(se,ve=>{r(R)>0&&ve(B)})}var q=v(se,2),ee=d(q,!0),oe=v(ee);{var te=ve=>{var Ne=pt();$(Pe=>T(Ne,`of ${Pe??""}`),[()=>r(s).length.toLocaleString()]),x(ve,Ne)};G(oe,ve=>{r(R)>0&&ve(te)})}Te(),c(q),c(P);var ge=v(P,2);{var xe=ve=>{var Ne=Av(),Pe=d(Ne),de=v(d(Pe),2),ie=v(de,2),me=v(ie,2),Ce=v(d(me)),ke=d(Ce);ke.value=ke.__value=50;var Ee=v(ke);Ee.value=Ee.__value=100;var he=v(Ee);he.value=he.__value=200;var Se=v(he);Se.value=Se.__value=500;var Ae=v(Se);Ae.value=Ae.__value=1e3,c(Ce);var He;ai(Ce),c(me),c(Pe);var nt=v(Pe,2);Je(nt,20,()=>r(u),Oe=>Oe,(Oe,Ie)=>{var Ve=Pv(),j=d(Ve);Dt(j);var Re=v(j);c(Ve),$(Le=>{Fe(Ve,1,Le),Bs(j,r(g)[Ie]??!1),T(Re,` ${Ie??""}`)},[()=>We(["inline-flex h-5 items-center gap-1 rounded border px-1.5 cursor-pointer",r(g)[Ie]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1"].join(" "))]),we("change",j,Le=>z(g,{...r(g),[Ie]:Le.currentTarget.checked},!0)),x(Oe,Ve)}),c(nt);var Ke=v(nt,2),Ge=d(Ke),dt=d(Ge,!0);c(Ge);var vt=v(Ge,2);{var $e=Oe=>{var Ie=Iv(),Ve=d(Ie,!0);c(Ie),$(()=>T(Ve,r(y))),x(Oe,Ie)};G(vt,Oe=>{r(y)&&Oe($e)})}c(Ke),c(Ne),$(Oe=>{He!==(He=r(h))&&(Ce.value=(Ce.__value=r(h))??"",ii(Ce,r(h))),T(dt,Oe)},[()=>ue()??"No collection selected"]),we("click",de,()=>{const Oe={};for(const Ie of r(u))Oe[Ie]=!0;z(g,Oe,!0)}),we("click",ie,()=>z(g,{},!0)),we("change",Ce,Oe=>z(h,Number(Oe.currentTarget.value),!0)),x(ve,Ne)};G(ge,ve=>{r(f)&&e.collection&&ve(xe)})}var _e=v(ge,2);{var ze=ve=>{var Ne=Lv();x(ve,Ne)},be=ve=>{var Ne=Gv(),Pe=fe(Ne),de=d(Pe),ie=d(de),me=d(ie),Ce=v(d(me));Je(Ce,17,()=>r(i),qt,(Oe,Ie)=>{const Ve=S(()=>Wi(r(Ie))),j=S(()=>Ha(r(Ie)));var Re=Hv(),Le=d(Re),Be=d(Le,!0);c(Le);var Ye=v(Le,2);{var at=Xe=>{var et=Ov();x(Xe,et)},ct=Xe=>{var et=Rv();x(Xe,et)},gt=Xe=>{var et=Dv();x(Xe,et)},rt=Xe=>{var et=Vv();x(Xe,et)};G(Ye,Xe=>{r(Ve)==="rid"?Xe(at):r(j)?Xe(ct,1):r(Ve)==="id"?Xe(gt,2):r(Ie)===r(l)&&Xe(rt,3)})}c(Re),$(Xe=>{Fe(Re,1,Xe),Fe(Le,1,We(r(Ve)||r(j)?"font-semibold":"")),T(Be,r(Ie))},[()=>We(["px-2 py-1.5 text-left font-normal whitespace-nowrap",r(Ve)==="rid"?"bg-accent/5 text-fg-0":r(j)?"bg-bg-1 text-fg-2":r(Ve)==="id"?"text-fg-1":""].join(" "))]),x(Oe,Re)}),c(me);var ke=v(me);{var Ee=Oe=>{var Ie=Kv(),Ve=v(d(Ie));Je(Ve,17,()=>r(i),qt,(j,Re)=>{var Le=Fv(),Be=d(Le),Ye=d(Be);Dt(Ye);var at=v(Ye,2);{var ct=gt=>{var rt=qv(),Xe=d(rt);$t(Xe,{class:"size-3"}),c(rt),$(()=>Me(rt,"aria-label",`Clear filter for ${r(Re)??""}`)),we("click",rt,()=>K(r(Re))),x(gt,rt)};G(at,gt=>{var rt;(rt=r(_)[r(Re)])!=null&&rt.length&>(ct)})}c(Be),c(Le),$(()=>Me(Ye,"placeholder",`filter ${r(Re)??""}…`)),Ft(Ye,()=>r(_)[r(Re)],gt=>r(_)[r(Re)]=gt),x(j,Le)}),c(Ie),x(Oe,Ie)};G(ke,Oe=>{r(I)&&Oe(Ee)})}c(ie);var he=v(ie);Je(he,21,()=>r(H),qt,(Oe,Ie,Ve)=>{var j=Wv(),Re=d(j);Re.textContent=Ve+1;var Le=v(Re);Je(Le,17,()=>r(i),qt,(Be,Ye)=>{const at=S(()=>r(Ie)[r(Ye)]),ct=S(()=>E(Ve,r(Ye),r(at))),gt=S(()=>{var bt;return((bt=r(pe))==null?void 0:bt.row)===Ve&&r(pe).col===r(Ye)}),rt=S(()=>Wi(r(Ye))),Xe=S(()=>Ha(r(Ye)));var et=Yv(),ot=d(et);{var ut=bt=>{var mt=Bv();Dt(mt),ri(()=>Ft(mt,()=>r(O),Ct=>z(O,Ct))),Xt(mt,Ct=>N==null?void 0:N(Ct)),Ln("blur",mt,A),we("keydown",mt,Ct=>{Ct.key==="Enter"?A():Ct.key==="Escape"&&b()}),x(bt,mt)},ht=bt=>{var mt=jv();x(bt,mt)},xt=S(()=>Cv(r(ct).value)),Nt=bt=>{var mt=Uv(),Ct=d(mt,!0);c(mt),$(Et=>T(Ct,Et),[()=>kv(r(ct).value)]),x(bt,mt)};G(ot,bt=>{r(gt)?bt(ut):r(xt)?bt(ht,1):bt(Nt,-1)})}c(et),$(bt=>{Fe(et,1,bt),Me(et,"title",r(ct).staged?"Staged change — open Pending Changes to commit":void 0)},[()=>We(["px-2 py-1 max-w-[260px] truncate align-top",r(rt)==="rid"?"bg-accent/5 text-accent font-semibold":r(Xe)?"bg-bg-1 text-fg-2 font-mono":r(rt)==="id"?"text-fg-0":"",r(ct).staged&&!r(gt)?"bg-warn/15 text-fg-1":""].join(" "))]),we("dblclick",et,()=>w(Ve,r(Ye),r(at))),x(Be,et)}),c(j),x(Oe,j)}),c(he),c(de),c(Pe);var Se=v(Pe,2),Ae=d(Se),He=d(Ae),nt=v(He);{var Ke=Oe=>{var Ie=pt("· filtered");x(Oe,Ie)};G(nt,Oe=>{r(R)>0&&Oe(Ke)})}var Ge=v(nt,2);{var dt=Oe=>{var Ie=Xv(),Ve=v(fe(Ie)),j=d(Ve,!0);c(Ve),$(()=>T(j,e.collection)),x(Oe,Ie)};G(Ge,Oe=>{e.collection&&Oe(dt)})}c(Ae);var vt=v(Ae,4);{var $e=Oe=>{var Ie=$v(),Ve=v(d(Ie)),j=d(Ve,!0);c(Ve),c(Ie),$(()=>T(j,r(l))),x(Oe,Ie)};G(vt,Oe=>{r(l)&&Oe($e)})}c(Se),$(()=>T(He,`${r(H).length??""} of ${r(a).record_count??""} rows `)),x(ve,Ne)};G(_e,ve=>{r(a).result.records.length?ve(be,-1):ve(ze)})}$((ve,Ne)=>{Me(J,"aria-pressed",r(I)),Me(J,"title",r(I)?"Hide column filters":"Show column filters"),Fe(J,1,ve),T(ee,Ne)},[()=>We(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",r(I)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>r(H).length.toLocaleString()]),we("click",J,()=>z(I,!r(I))),x(m,C)};G(F,m=>{r(a).ok?m(M,-1):m(W)})}c(L),x(t,L),Qe()}Tt(["click","change","dblclick","keydown"]);const eg={capability:"table",renders:t=>!!(t!=null&&t.result)&&Array.isArray(t.result.columns),component:Jv},tg={capability:"graph",renders:t=>pd(t),component:gd};function ul(t){return t.find(e=>e.toLowerCase()==="key")??t.find(e=>e.toLowerCase()==="k")??t.find(e=>/(^|_)key$/i.test(e))??null}function fl(t){return t.find(e=>e.toLowerCase()==="value")??t.find(e=>e.toLowerCase()==="v")??t.find(e=>/(^|_)value$/i.test(e))??null}function ng(t){const e=t.result.columns,n=ul(e),o=fl(e);return!n||!o?[]:t.result.records.map(a=>({key:String(a.values[n]??""),value:a.values[o]}))}function rg(t){var n;const e=((n=t.result)==null?void 0:n.columns)??[];return ul(e)!==null&&fl(e)!==null}function og(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 g=i[u];g&&typeof g=="object"&&!Array.isArray(g)?g.$value=o.value:i[u]=o.value;continue}const f=i[u];if(!f||typeof f!="object"||Array.isArray(f)){const g={};f!==void 0&&(g.$value=f),i[u]=g,i=g}else i=f}}return n}function ag(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 Xi(t){return t==null?"null":typeof t=="object"?JSON.stringify(t):String(t)}var ig=k('<span class="text-fg-3 ml-2"> </span>'),sg=k("<ul></ul>"),lg=k('<li><button type="button"><span class="text-fg-1"> </span> <!></button> <!></li>'),cg=k(`<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No KV shape — expected <code>key</code> and <code>value</code> columns
|
|
914
|
+
(also accepts <code>*_key</code>/<code>*_value</code>).</div>`),dg=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear prefix"><!></button>'),ug=k('· <span class="text-fg-2"> </span>',1),fg=k('<li class="px-3 py-2 text-fg-3">No keys match prefix.</li>'),vg=k('<div class="text-fg-3 mb-2"> </div> <pre class="text-fg-1 whitespace-pre-wrap break-all"> </pre>',1),gg=k('<div class="text-fg-3">Click a key to inspect.</div>'),pg=k('<div class="flex-1 grid grid-cols-[280px_1fr] min-h-0"><ul class="overflow-auto border-r border-line-1 text-[12px] font-mono py-1"><!></ul> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),hg=k('<div class="text-fg-3">No keys match prefix.</div>'),xg=k('<pre class="whitespace-pre text-fg-1"> </pre>'),bg=k('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><!></div>'),mg=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> Tree</button> <button type="button"><!> JSON</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="key prefix…" class="bg-transparent text-fg-1 outline-none w-[220px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto text-fg-3"> <!> keys <!></div></div> <!>',1),_g=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function yg(t,e){Ze(e,!0);const n=(I,D=nn,H=nn)=>{var R=lg(),K=d(R);let V,U;var ne=d(K),ue=d(ne,!0);c(ne);var re=v(ne,2);{var ae=w=>{var A=ig(),b=d(A,!0);c(A),$(N=>T(b,N),[()=>g(D().value)]),x(w,A)};G(re,w=>{D().fullKey!==null&&w(ae)})}c(K);var pe=v(K,2);{var O=w=>{var A=sg();Je(A,21,()=>D().children,b=>b.name,(b,N)=>{n(b,()=>r(N),()=>H()+1)}),c(A),x(w,A)};G(pe,w=>{D().children.length>0&&w(O)})}c(R),$(()=>{V=Fe(K,1,"w-full text-left px-2 py-0.5 hover:bg-bg-1/60",null,V,{"text-accent":r(s)===D()}),U=Zt(K,"",U,{"padding-left":`${8+H()*12}px`}),T(ue,D().name)}),we("click",K,()=>z(s,D(),!0)),x(I,R)};let o=ye(""),a=ye("tree"),s=ye(null);const i=S(()=>ng(e.result)),l=S(()=>r(o).trim()?r(i).filter(I=>I.key.startsWith(r(o).trim())):r(i)),u=S(()=>ag(r(l))),f=S(()=>og(r(i),r(o).trim()));function g(I){const D=Xi(I);return D.length>60?D.slice(0,59)+"…":D}var h=_g(),p=d(h);{var y=I=>{var D=cg();x(I,D)},_=I=>{var D=mg(),H=fe(D),R=d(H),K=d(R),V=d(K);du(V,{class:"size-3"}),Te(),c(K);var U=v(K,2),ne=d(U);gr(ne,{class:"size-3"}),Te(),c(U),c(R);var ue=v(R,2),re=d(ue);hn(re,{class:"size-3 text-fg-3"});var ae=v(re,2);Dt(ae);var pe=v(ae,2);{var O=m=>{var C=dg(),P=d(C);$t(P,{class:"size-3"}),c(C),we("click",C,()=>z(o,"")),x(m,C)};G(pe,m=>{r(o)&&m(O)})}c(ue);var w=v(ue,2),A=d(w,!0),b=v(A);{var N=m=>{var C=pt();$(P=>T(C,`of ${P??""}`),[()=>r(i).length.toLocaleString()]),x(m,C)};G(b,m=>{r(o)&&m(N)})}var E=v(b,2);{var L=m=>{var C=ug(),P=v(fe(C)),X=d(P,!0);c(P),$(()=>T(X,e.collection)),x(m,C)};G(E,m=>{e.collection&&m(L)})}c(w),c(H);var F=v(H,2);{var W=m=>{var C=pg(),P=d(C),X=d(P);{var le=B=>{var q=fg();x(B,q)},J=B=>{var q=qe(),ee=fe(q);Je(ee,17,()=>r(u).children,oe=>oe.name,(oe,te)=>{n(oe,()=>r(te),()=>0)}),x(B,q)};G(X,B=>{r(u).children.length===0?B(le):B(J,-1)})}c(P);var Y=v(P,2),Z=d(Y);{var Q=B=>{var q=vg(),ee=fe(q),oe=d(ee,!0);c(ee);var te=v(ee,2),ge=d(te,!0);c(te),$(xe=>{T(oe,r(s).fullKey??r(s).name),T(ge,xe)},[()=>Xi(r(s).value)]),x(B,q)},se=B=>{var q=gg();x(B,q)};G(Z,B=>{r(s)?B(Q):B(se,-1)})}c(Y),c(C),x(m,C)},M=m=>{var C=bg(),P=d(C);{var X=Y=>{var Z=hg();x(Y,Z)},le=S(()=>Object.keys(r(f)).length===0),J=Y=>{var Z=xg(),Q=d(Z,!0);c(Z),$(se=>T(Q,se),[()=>JSON.stringify(r(f),null,2)]),x(Y,Z)};G(P,Y=>{r(le)?Y(X):Y(J,-1)})}c(C),x(m,C)};G(F,m=>{r(a)==="tree"?m(W):m(M,-1)})}$((m,C,P)=>{Fe(K,1,m),Me(K,"aria-pressed",r(a)==="tree"),Fe(U,1,C),Me(U,"aria-pressed",r(a)==="json"),T(A,P)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(a)==="tree"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(a)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(l).length.toLocaleString()]),we("click",K,()=>z(a,"tree")),we("click",U,()=>z(a,"json")),Ft(ae,()=>r(o),m=>z(o,m)),x(I,D)};G(p,I=>{r(i).length===0?I(y):I(_,-1)})}c(h),x(t,h),Qe()}Tt(["click"]);const wg={capability:"kv",renders:t=>rg(t),component:yg},lr="__all__",kg=["time","timestamp","ts","event_time","bucket","created_at"],Cg=new Set(["created_at","updated_at","time","timestamp","timestamp_ns","rid","tenant"]),vl=640,gl=180,pl=16;function Ir(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 xa(t){return typeof t=="number"?t:Number(t)}function No(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;if(t instanceof Date)return t.getTime();if(typeof t=="string"){const e=Number(t);if(Number.isFinite(e))return e;const n=Date.parse(t);return Number.isNaN(n)?null:n}return null}function hl(t){var o,a;const e=((o=t.result)==null?void 0:o.columns)??[];for(const s of kg){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&&No(i.values[s])!==null&&!Ir(i.values[s]))return s}return null}function xl(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_")||Cg.has(l.toLowerCase()))continue;const u=o.find(f=>f.values[l]!==null&&f.values[l]!==void 0);u&&Ir(u.values[l])&&a.push(l)}return a}function Sg(t){const e=hl(t);return e?xl(t,e).length>0:!1}function Ng(t,e){const n=hl(t);if(!n)return null;const o=t.result.columns.find(u=>u.toLowerCase()==="metric")??null,a=t.result.columns.find(u=>u.toLowerCase()==="value")??null;if(o&&a){const u=new Set,f=[];for(const h of t.result.records){const p=h.values[o],y=h.values[a];if((typeof p=="string"||typeof p=="number")&&Ir(y)){u.add(String(p));const _=No(h.values[n]);_!==null&&f.push({t:_,v:xa(y),raw:h.values})}}const g=[...u].sort();if(g.length>0){if(!e||e===lr)return f.sort((y,_)=>y.t-_.t),{timeColumn:n,metricColumn:a,metrics:[lr,...g],points:f,metricNameColumn:o};const h=g.includes(e)?e:g[0],p=[];for(const y of t.result.records){if(String(y.values[o])!==h)continue;const _=No(y.values[n]);if(_===null)continue;const I=y.values[a];Ir(I)&&p.push({t:_,v:xa(I),raw:y.values})}return p.sort((y,_)=>y.t-_.t),{timeColumn:n,metricColumn:a,metrics:[lr,...g],points:p,metricNameColumn:o}}}const s=xl(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],g=u.values[i],h=No(f);h!==null&&Ir(g)&&l.push({t:h,v:xa(g),raw:u.values})}return l.sort((u,f)=>u.t-f.t),{timeColumn:n,metricColumn:i,metrics:s,points:l,metricNameColumn:null}}function Eg(t,e=vl,n=gl,o=pl){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,g=u-l||1,h=e-o*2,p=n-o*2,y=[];return a.forEach((_,I)=>{const D=o+(_.t-s)/f*h,H=o+p-(_.v-l)/g*p;y.push(`${I===0?"M":"L"}${D.toFixed(2)},${H.toFixed(2)}`)}),{width:e,height:n,padding:o,path:y.join(" "),minT:s,maxT:i,minV:l,maxV:u}}function Mg(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 zg(t,e=vl,n=gl,o=pl){if(t.length===0)return null;const a=t.reduce((g,h)=>Math.max(g,h.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((g,h)=>{const y=g.count/a*i;return{x:o+h*l,y:o+i-y,w:u,h:y,bucket:g}});return{width:e,height:n,padding:o,bars:f,maxCount:a}}var Tg=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No timeseries shape (need a time column and a numeric metric).</div>'),Pg=k("<option> </option>"),Ig=k('<label class="inline-flex items-center gap-1.5 text-fg-3">bucket: <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1.5 py-0.5"><option>1s</option><option>10s</option><option>1min</option><option>5min</option><option>10min</option><option>1hr</option></select></label>'),Ag=k('<button type="button" class="inline-flex items-center gap-1 px-2 py-1 rounded border border-line-1 text-fg-3 hover:text-fg-1 cursor-pointer" title="Show all rows again"><!> clear bucket</button>'),Lg=k('· <span class="text-fg-2"> </span>',1),Og=Rt('<rect class="cursor-pointer transition-opacity" fill="var(--color-accent)" role="button" tabindex="0"><title> </title></rect>'),Rg=Rt('<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>'),Dg=Rt('<svg class="block w-full h-[180px] text-accent" aria-label="Timeseries chart"><path fill="none" stroke="currentColor" stroke-width="1.5"></path></svg>'),Vg=k('<th class="px-2 py-1.5 text-left font-normal">metric</th>'),Hg=k('<td class="px-2 py-1 text-fg-2"> </td>'),qg=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1"> </td><!><td class="px-2 py-1 text-right text-accent"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),Fg=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> </button> <button type="button"><!> Value</button></div> <label class="inline-flex items-center gap-1.5 text-fg-3"><!> metric: <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1.5 py-0.5"></select></label> <!> <!> <div class="ml-auto text-fg-3"><span class="text-fg-2"> </span> <!> inserts <!></div></div> <div class="px-3 pt-2"><!></div> <div class="flex-1 min-h-0 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">time</th><!><th class="px-2 py-1.5 text-right font-normal">value</th><th class="px-2 py-1.5 text-left font-normal">log</th></tr></thead><tbody></tbody></table></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3"> <!></div>',1),Kg=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function Bg(t,e){Ze(e,!0);let n=ye(zt(lr)),o=ye("rate"),a=ye(6e4),s=ye(null);const i=S(()=>Ng(e.result,r(n))),l=S(()=>r(i)&&r(o)==="line"?Eg(r(i)):null),u=S(()=>r(i)?Mg(r(i),r(a)):[]),f=S(()=>r(i)&&r(o)==="rate"?zg(r(u)):null),g=S(()=>{if(!r(i))return[];if(!r(s))return r(i).points;const U=r(s).t,ne=U+r(a);return r(i).points.filter(ue=>ue.t>=U&&ue.t<ne)});function h(U){try{return new Date(U).toISOString().replace("T"," ").slice(0,19)}catch{return String(U)}}function p(U){return U==null?"":typeof U=="object"?JSON.stringify(U):String(U)}function y(U){var pe;const ne=[],ue=(pe=r(i))!=null&&pe.metricNameColumn?U.raw[r(i).metricNameColumn]:void 0;ue!==void 0&&ne.push(String(ue));const re=U.raw.tags;if(re&&typeof re=="object"){const O=Object.entries(re).map(([w,A])=>`${w}=${p(A)}`).join(" ");O&&ne.push(O)}const ae=U.raw.event??U.raw.action??U.raw.message??U.raw.payload;return ae!==void 0&&ne.push(p(ae)),ne.join(" · ")}function _(U){return U===1e3?"1s":U===1e4?"10s":U===6e4?"1min":U===3e5?"5min":U===6e5?"10min":U===36e5?"1hr":`${U}ms`}function I(U){return U===lr?"all writes":U}function D(){return r(i)?!r(n)||r(n)===lr?"all writes":r(n):""}var H=Kg(),R=d(H);{var K=U=>{var ne=Tg();x(U,ne)},V=U=>{var ne=Fg(),ue=fe(ne),re=d(ue),ae=d(re),pe=d(ae);$d(pe,{class:"size-3"});var O=v(pe);c(ae);var w=v(ae,2),A=d(w);Gd(A,{class:"size-3"}),Te(),c(w),c(re);var b=v(re,2),N=d(b);Lr(N,{class:"size-3"});var E=v(N,2);Je(E,20,()=>r(i).metrics,de=>de,(de,ie)=>{var me=Pg(),Ce=d(me,!0);c(me);var ke={};$(Ee=>{T(Ce,Ee),ke!==(ke=ie)&&(me.value=(me.__value=ie)??"")},[()=>I(ie)]),x(de,me)}),c(E),c(b);var L=v(b,2);{var F=de=>{var ie=Ig(),me=v(d(ie)),Ce=d(me);Ce.value=Ce.__value=1e3;var ke=v(Ce);ke.value=ke.__value=1e4;var Ee=v(ke);Ee.value=Ee.__value=6e4;var he=v(Ee);he.value=he.__value=3e5;var Se=v(he);Se.value=Se.__value=6e5;var Ae=v(Se);Ae.value=Ae.__value=36e5,c(me);var He;ai(me),c(ie),$(()=>{He!==(He=r(a))&&(me.value=(me.__value=r(a))??"",ii(me,r(a)))}),we("change",me,nt=>{z(a,Number(nt.currentTarget.value),!0),z(s,null)}),x(de,ie)};G(L,de=>{r(o)==="rate"&&de(F)})}var W=v(L,2);{var M=de=>{var ie=Ag(),me=d(ie);$t(me,{class:"size-3"}),Te(),c(ie),we("click",ie,()=>z(s,null)),x(de,ie)};G(W,de=>{r(s)&&de(M)})}var m=v(W,2),C=d(m),P=d(C,!0);c(C);var X=v(C),le=v(X);{var J=de=>{var ie=pt();$(me=>T(ie,`of ${me??""}`),[()=>r(i).points.length.toLocaleString()]),x(de,ie)};G(le,de=>{r(s)&&de(J)})}var Y=v(le,2);{var Z=de=>{var ie=Lg(),me=v(fe(ie)),Ce=d(me,!0);c(me),$(()=>T(Ce,e.collection)),x(de,ie)};G(Y,de=>{e.collection&&de(Z)})}c(m),c(ue);var Q=v(ue,2),se=d(Q);{var B=de=>{var ie=Rg(),me=d(ie);Je(me,17,()=>r(f).bars,Se=>Se.bucket.t,(Se,Ae)=>{var He=Og(),nt=d(He),Ke=d(nt);c(nt),c(He),$((Ge,dt,vt)=>{Me(He,"x",r(Ae).x),Me(He,"y",r(Ae).y),Me(He,"width",r(Ae).w),Me(He,"height",r(Ae).h),Me(He,"opacity",!r(s)||r(s).t===r(Ae).bucket.t?.9:.3),Me(He,"aria-label",`Bucket starting at ${Ge??""} with ${r(Ae).bucket.count??""} writes`),T(Ke,`${dt??""} — ${r(Ae).bucket.count??""} writes (sum ${vt??""})`)},[()=>h(r(Ae).bucket.t),()=>h(r(Ae).bucket.t),()=>r(Ae).bucket.sum.toFixed(2)]),we("click",He,()=>{var Ge;return z(s,((Ge=r(s))==null?void 0:Ge.t)===r(Ae).bucket.t?null:r(Ae).bucket,!0)}),we("keydown",He,Ge=>{var dt;(Ge.key==="Enter"||Ge.key===" ")&&(Ge.preventDefault(),z(s,((dt=r(s))==null?void 0:dt.t)===r(Ae).bucket.t?null:r(Ae).bucket,!0))}),x(Se,He)});var Ce=v(me),ke=d(Ce,!0);c(Ce);var Ee=v(Ce),he=d(Ee);c(Ee),c(ie),$((Se,Ae)=>{Me(ie,"viewBox",`0 0 ${r(f).width} ${r(f).height}`),Me(Ce,"x",r(f).padding),Me(Ce,"y",r(f).height-2),T(ke,Se),Me(Ee,"x",r(f).width-r(f).padding),Me(Ee,"y",r(f).height-2),T(he,`peak ${r(f).maxCount??""}/${Ae??""}`)},[()=>{var Se;return h(((Se=r(f).bars[0])==null?void 0:Se.bucket.t)??0)},()=>_(r(a))]),x(de,ie)},q=de=>{var ie=Dg(),me=d(ie);c(ie),$(()=>{Me(ie,"viewBox",`0 0 ${r(l).width} ${r(l).height}`),Me(me,"d",r(l).path)}),x(de,ie)};G(se,de=>{r(o)==="rate"&&r(f)?de(B):r(l)&&de(q,1)})}c(Q);var ee=v(Q,2),oe=d(ee),te=d(oe),ge=d(te),xe=v(d(ge));{var _e=de=>{var ie=Vg();x(de,ie)};G(xe,de=>{r(i).metricNameColumn&&de(_e)})}Te(2),c(ge),c(te);var ze=v(te);Je(ze,21,()=>r(g),qt,(de,ie)=>{var me=qg(),Ce=d(me),ke=d(Ce,!0);c(Ce);var Ee=v(Ce);{var he=Ke=>{var Ge=Hg(),dt=d(Ge,!0);c(Ge),$(vt=>T(dt,vt),[()=>String(r(ie).raw[r(i).metricNameColumn]??"")]),x(Ke,Ge)};G(Ee,Ke=>{r(i).metricNameColumn&&Ke(he)})}var Se=v(Ee),Ae=d(Se,!0);c(Se);var He=v(Se),nt=d(He,!0);c(He),c(me),$((Ke,Ge)=>{T(ke,Ke),T(Ae,r(ie).v),T(nt,Ge)},[()=>h(r(ie).t),()=>y(r(ie))]),x(de,me)}),c(ze),c(oe),c(ee);var be=v(ee,2),ve=d(be),Ne=v(ve);{var Pe=de=>{var ie=pt();$((me,Ce)=>T(ie,`· bucket ${me??""} (+${Ce??""})`),[()=>h(r(s).t),()=>_(r(a))]),x(de,ie)};G(Ne,de=>{r(s)&&de(Pe)})}c(be),$((de,ie,me,Ce,ke)=>{Fe(ae,1,de),Me(ae,"aria-pressed",r(o)==="rate"),T(O,` Writes/${ie??""}`),Fe(w,1,me),Me(w,"aria-pressed",r(o)==="line"),T(P,Ce),T(X,` · ${ke??""}`),T(ve,`${r(g).length??""} inserts${e.collection?" · ":""}${e.collection??""??""} `)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(o)==="rate"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>_(r(a)),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(o)==="line"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>D(),()=>r(g).length.toLocaleString()]),we("click",ae,()=>z(o,"rate")),we("click",w,()=>z(o,"line")),Aa(E,()=>r(n),de=>z(n,de)),x(U,ne)};G(R,U=>{r(i)?U(V,-1):U(K)})}c(H),x(t,H),Qe()}Tt(["click","change","keydown"]);const jg={capability:"hypertable",renders:t=>Sg(t),component:Bg};function Ug(t){return{query:t.query,capability:t.capability,record_count:t.record_count,records:t.result.records}}function Yg(t){return JSON.stringify(t,null,2)}function Wg(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"}">${ba(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">${ba(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+=ba(a),n+=1}return e}function ba(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var Xg=k('<div class="flex h-full flex-col text-fg-1"><div class="flex-1 min-h-0 overflow-auto"><pre class="json text-[12px] font-mono p-3 leading-relaxed svelte-1h2o46f"></pre></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3"> </div></div>');function $g(t,e){Ze(e,!0);const n=S(()=>Yg(Ug(e.result))),o=S(()=>Wg(r(n)));var a=Xg(),s=d(a),i=d(s);Ed(i,()=>r(o),!0),c(i),c(s);var l=v(s,2),u=d(l);c(l),c(a),$(()=>T(u,`${e.result.record_count??""} records · raw shape${e.collection?" · ":""}${e.collection??""??""}`)),x(t,a),Qe()}const Gg={capability:"json",renders:()=>!1,component:$g},Zg=/(^|_)(vector|embedding|embeddings|turbovec)($|_)/i,Qg=/(^|_)(scalar|score|distance|similarity|magnitude|norm)($|_)/i,Jg=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 qa(t){return Array.isArray(t)&&t.length>0&&t.every(e=>typeof e=="number"&&Number.isFinite(e))}function ep(t){const e=Object.entries(t).find(([o,a])=>Zg.test(o)&&qa(a));if(e)return e;const n=Object.entries(t).find(([,o])=>qa(o));return n||null}function tp(t,e){const n=Object.entries(t).find(([o,a])=>o!==e&&Qg.test(o)&&typeof a=="number"&&Number.isFinite(a));return n||null}function $i(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?Math.floor(t):null}function Fa(t){return t.result.records.map((e,n)=>{var f;const o=e.values??{},a=((f=e.vector_results)==null?void 0:f.find(g=>qa(g.vector)))??null,s=a!=null&&a.vector?["vector_results.vector",a.vector]:ep(o),i=tp(o,(s==null?void 0:s[0])??null),l=(s==null?void 0:s[1].length)??$i(o.dimension)??$i(o.vector_dimension)??0,u={};for(const[g,h]of Object.entries(o))g===(s==null?void 0:s[0])||g===(i==null?void 0:i[0])||Jg.has(g)||(u[g]=h);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 np(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:Fa(t).some(e=>e.vector.length>0||e.dimension>0||e.scalar!==null)}function vo(t){return Math.sqrt(t.reduce((e,n)=>e+n*n,0))}function ma(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 _a(t){return t==null?"NULL":typeof t=="object"?JSON.stringify(t):String(t)}function rp(t){return/^VECTOR\s+SEARCH\s+\S+\s+SIMILAR\s+TO\s+\[1(?:\.0)?,\s*0(?:\.0)?/i.test(t.query.trim())}function op(t){return/^VECTOR\s+SEARCH\s+/i.test(t.query.trim())}function ap(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 ip(t){return`[${t.map(e=>Number(e.toPrecision(8))).join(", ")}]`}function sp(t){return`'${t.replace(/'/g,"''")}'`}function lp(t){return t.replace(/[^A-Za-z0-9_./-]/g,"")}function Gi(t,e,n){const o=Math.max(1,Math.min(200,Math.floor(Number(n)||20))),a=e.kind==="text"?sp(e.text):ip(e.vector);return`VECTOR SEARCH ${lp(t)} SIMILAR TO ${a} INCLUDE VECTORS LIMIT ${o}`}var cp=k('<input type="text" placeholder="text query…" class="h-7 w-full rounded border border-line-1 bg-bg-0 px-2 text-fg-1 outline-none placeholder:text-fg-3 focus:border-line-3"/>'),dp=k('<input type="text" placeholder="[0.12, -0.04, 0.91, …]" class="h-7 w-full rounded border border-line-1 bg-bg-0 px-2 text-fg-1 outline-none placeholder:text-fg-3 focus:border-line-3"/>'),up=k('<div class="inline-flex shrink-0 overflow-hidden rounded border border-line-2"><button type="button">text</button> <button type="button">vector</button></div> <div class="min-w-[260px] flex-1"><!></div> <label class="inline-flex h-7 items-center gap-1 rounded border border-line-1 bg-bg-0 px-2 text-fg-3"><span>limit</span> <input type="number" min="1" max="200" class="w-12 bg-transparent text-right text-fg-1 outline-none"/></label> <button type="button"><!> search</button>',1),fp=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector row filter"><!></button>'),vp=k('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="filter rows…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div>'),gp=k("<span> </span>"),pp=k('<div class="mt-1.5 text-warn"> </div>'),hp=k('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-1.5 text-[11px] font-mono text-fg-3">Preview search: distances and scores are computed against the synthetic basis vector <span class="text-fg-1">[1, 0, 0, …]</span>.</div>'),xp=k('<div class="flex-1 grid place-items-center p-6 text-center font-mono text-[12px] text-fg-3"><div><!> <div class="text-fg-1"> </div> <div class="mt-1">Text queries are embedded by RedDB.</div></div></div>'),bp=k('<div class="flex-1 grid place-items-center p-6 text-center font-mono text-[12px] text-fg-3"><div><!> <div class="text-fg-1">No vector rows returned.</div></div></div>'),mp=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector result filter"><!></button>'),_p=k('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="filter results…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div>'),yp=k('<span class="ml-auto text-fg-1"> </span>'),wp=k('<div class="mt-0.5 truncate text-fg-3"> </div>'),kp=k('<button type="button"><div class="flex items-baseline gap-2"><span class="text-accent"> </span> <span class="text-fg-3"> </span> <!></div> <!></button>'),Cp=k('<div class="text-fg-3">No vector selected.</div>'),Sp=k('<div class="text-fg-3">vector column</div> <div class="text-fg-0"> </div>',1),Np=k('<div class="text-fg-3">ranking metric</div> <div class="text-fg-0"> </div>',1),Ep=k('<div class="text-fg-3 truncate"> </div> <div class="text-fg-1 break-words"> </div>',1),Mp=k('<div class="grid grid-cols-[160px_1fr] gap-x-3 gap-y-1.5"><div class="text-fg-3">id</div> <div class="text-fg-0"> </div> <div class="text-fg-3">dimension</div> <div class="text-fg-0"> </div> <div class="text-fg-3">magnitude</div> <div class="text-fg-0"> </div> <div class="text-fg-3">coordinates</div> <div class="text-fg-0"> </div> <!> <!> <!></div>'),zp=k('<div class="border border-line-1 bg-bg-1/40 px-3 py-2 text-fg-3"> </div>'),Tp=k('<div class="grid grid-cols-[52px_1fr_90px] items-center gap-2"><span class="text-fg-3 text-right"></span> <div class="h-2 bg-bg-2 rounded overflow-hidden"><div class="h-full bg-accent/80"></div></div> <span> </span></div>'),Pp=k('<div class="mt-2 text-fg-3">Showing first 256 dimensions.</div>'),Ip=k('<div class="mb-2 flex items-center justify-between text-fg-3"><span> </span> <span> </span></div> <div class="grid gap-1"></div> <!>',1),Ap=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer"><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1 text-right"> </td><td class="px-2 py-1 text-right"> </td></tr>'),Lp=k('<table class="w-full border-collapse"><thead class="sticky top-0 bg-bg-0"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">id</th><th class="px-2 py-1.5 text-right font-normal">ranking metric</th><th class="px-2 py-1.5 text-right font-normal">magnitude</th></tr></thead><tbody></tbody></table>'),Op=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-0"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> metadata</button> <button type="button"><!> vector</button> <button type="button"><!> scores</button></div> <!> <div class="ml-auto text-fg-3"> <!> </div></div> <div class="flex-1 min-h-0 grid grid-cols-[320px_1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>',1),Rp=k('<div class="flex h-full flex-col text-fg-1"><div class="border-b border-line-1 bg-bg-1/40 px-3 py-2 font-mono text-[11px]"><div class="flex flex-wrap items-center gap-2"><div class="inline-flex shrink-0 overflow-hidden rounded border border-line-2"><button type="button"><!> browse</button> <button type="button"><!> search</button></div> <!> <div class="ml-auto flex items-center gap-2 text-fg-3"><span> </span> <!></div></div> <!></div> <!> <!></div>');function Dp(t,e){Ze(e,!0);let n=ye("browse"),o=ye("metadata"),a=ye("text"),s=ye(""),i=ye(""),l=ye(20),u=ye(""),f=ye(null),g=ye(null),h=ye(!1),p=ye(null);const y=S(()=>Fa(e.result)),_=S(()=>{var oe;return((oe=r(y).find(te=>te.dimension>0))==null?void 0:oe.dimension)??null}),I=S(()=>r(g)??(op(e.result)?e.result:null)),D=S(()=>r(I)?Fa(r(I)):[]),H=S(()=>r(n)==="search"?r(D):r(y)),R=S(()=>r(I)?rp(r(I)):!1),K=S(()=>{const oe=r(u).trim().toLowerCase();return oe?r(H).filter(te=>te.id.toLowerCase().includes(oe)||Object.values(te.metadata).some(ge=>_a(ge).toLowerCase().includes(oe))):r(H)}),V=S(()=>r(f)??r(K)[0]??null),U=S(()=>Math.max(1,...r(K).map(oe=>vo(oe.vector)))),ne=S(()=>r(I)!==null);function ue(oe){const te=Object.entries(oe.metadata).slice(0,3);return te.length===0?"":te.map(([ge,xe])=>`${ge}=${_a(xe)}`).join(" · ")}function re(oe,te){const ge=Math.max(1,...te.map(xe=>Math.abs(xe)));return Math.max(2,Math.abs(oe)/ge*100)}async function ae(){if(!e.client||!e.collection){z(p,"No active RedDB connection for vector search.");return}z(p,null),z(h,!0);try{const oe=r(s).trim();if(r(a)==="text"&&oe.length===0)throw new Error("Enter text for RedDB to embed.");const te=r(a)==="text"?Gi(e.collection,{kind:"text",text:oe},r(l)):Gi(e.collection,{kind:"vector",vector:ap(r(i))},r(l)),ge=await e.client.query(te);z(g,ge,!0),z(f,null),z(n,"search"),z(o,"metadata")}catch(oe){z(p,oe.message,!0)}finally{z(h,!1)}}var pe=Rp(),O=d(pe),w=d(O),A=d(w),b=d(A),N=d(b);Va(N,{class:"size-3"}),Te(),c(b);var E=v(b,2),L=d(E);hn(L,{class:"size-3"}),Te(),c(E),c(A);var F=v(A,2);{var W=oe=>{var te=up(),ge=fe(te),xe=d(ge),_e=v(xe,2);c(ge);var ze=v(ge,2),be=d(ze);{var ve=Ee=>{var he=cp();Dt(he),we("keydown",he,Se=>{Se.key==="Enter"&&ae()}),Ft(he,()=>r(s),Se=>z(s,Se)),x(Ee,he)},Ne=Ee=>{var he=dp();Dt(he),we("keydown",he,Se=>{Se.key==="Enter"&&ae()}),Ft(he,()=>r(i),Se=>z(i,Se)),x(Ee,he)};G(be,Ee=>{r(a)==="text"?Ee(ve):Ee(Ne,-1)})}c(ze);var Pe=v(ze,2),de=v(d(Pe),2);Dt(de),c(Pe);var ie=v(Pe,2),me=d(ie);{var Ce=Ee=>{mn(Ee,{class:"size-3 animate-spin"})},ke=Ee=>{Qo(Ee,{class:"size-3"})};G(me,Ee=>{r(h)?Ee(Ce):Ee(ke,-1)})}Te(),c(ie),$((Ee,he,Se)=>{Fe(xe,1,Ee),Me(xe,"aria-pressed",r(a)==="text"),Fe(_e,1,he),Me(_e,"aria-pressed",r(a)==="vector"),Fe(ie,1,Se),ie.disabled=r(h)},[()=>We(["inline-flex h-7 items-center gap-1 px-2 transition-colors",r(a)==="text"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",r(a)==="vector"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 rounded border px-2 transition-colors",r(h)?"border-line-1 bg-bg-2 text-fg-3":"border-accent/40 bg-accent text-white hover:bg-accent/90"].join(" "))]),we("click",xe,()=>z(a,"text")),we("click",_e,()=>z(a,"vector")),Ft(de,()=>r(l),Ee=>z(l,Ee)),we("click",ie,()=>void ae()),x(oe,te)},M=oe=>{var te=vp(),ge=d(te);hn(ge,{class:"size-3 text-fg-3"});var xe=v(ge,2);Dt(xe);var _e=v(xe,2);{var ze=be=>{var ve=fp(),Ne=d(ve);$t(Ne,{class:"size-3"}),c(ve),we("click",ve,()=>z(u,"")),x(be,ve)};G(_e,be=>{r(u)&&be(ze)})}c(te),Ft(xe,()=>r(u),be=>z(u,be)),x(oe,te)};G(F,oe=>{r(n)==="search"?oe(W):oe(M,-1)})}var m=v(F,2),C=d(m),P=d(C,!0);c(C);var X=v(C,2);{var le=oe=>{var te=gp(),ge=d(te,!0);c(te),$(()=>T(ge,e.collection)),x(oe,te)};G(X,oe=>{e.collection&&oe(le)})}c(m),c(w);var J=v(w,2);{var Y=oe=>{var te=pp(),ge=d(te,!0);c(te),$(()=>T(ge,r(p))),x(oe,te)};G(J,oe=>{r(p)&&oe(Y)})}c(O);var Z=v(O,2);{var Q=oe=>{var te=hp();x(oe,te)};G(Z,oe=>{r(n)==="search"&&r(R)&&oe(Q)})}var se=v(Z,2);{var B=oe=>{var te=xp(),ge=d(te),xe=d(ge);hn(xe,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4});var _e=v(xe,2),ze=d(_e,!0);c(_e),Te(2),c(ge),c(te),$(()=>T(ze,r(ne)?"No search results.":"No vector search has been run.")),x(oe,te)},q=oe=>{var te=bp(),ge=d(te),xe=d(ge);Va(xe,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4}),Te(2),c(ge),c(te),x(oe,te)},ee=oe=>{var te=Op(),ge=fe(te),xe=d(ge),_e=d(xe),ze=d(_e);gr(ze,{class:"size-3"}),Te(),c(_e);var be=v(_e,2),ve=d(be);cu(ve,{class:"size-3"}),Te(),c(be);var Ne=v(be,2),Pe=d(Ne);el(Pe,{class:"size-3"}),Te(),c(Ne),c(xe);var de=v(xe,2);{var ie=$e=>{var Oe=_p(),Ie=d(Oe);hn(Ie,{class:"size-3 text-fg-3"});var Ve=v(Ie,2);Dt(Ve);var j=v(Ve,2);{var Re=Le=>{var Be=mp(),Ye=d(Be);$t(Ye,{class:"size-3"}),c(Be),we("click",Be,()=>z(u,"")),x(Le,Be)};G(j,Le=>{r(u)&&Le(Re)})}c(Oe),Ft(Ve,()=>r(u),Le=>z(u,Le)),x($e,Oe)};G(de,$e=>{r(n)==="search"&&$e(ie)})}var me=v(de,2),Ce=d(me,!0),ke=v(Ce);{var Ee=$e=>{var Oe=pt();$(Ie=>T(Oe,`of ${Ie??""}`),[()=>r(H).length.toLocaleString()]),x($e,Oe)};G(ke,$e=>{r(u)&&$e(Ee)})}var he=v(ke);c(me),c(ge);var Se=v(ge,2),Ae=d(Se);Je(Ae,21,()=>r(K),$e=>$e.id,($e,Oe)=>{var Ie=kp(),Ve=d(Ie),j=d(Ve),Re=d(j,!0);c(j);var Le=v(j,2),Be=d(Le);c(Le);var Ye=v(Le,2);{var at=Xe=>{var et=yp(),ot=d(et,!0);c(et),$((ut,ht)=>{Me(et,"title",ut),T(ot,ht)},[()=>ma(r(Oe)),()=>r(Oe).scalar.toFixed(4)]),x(Xe,et)};G(Ye,Xe=>{r(n)==="search"&&r(Oe).scalar!==null&&Xe(at)})}c(Ve);var ct=v(Ve,2);{var gt=Xe=>{var et=wp(),ot=d(et,!0);c(et),$(ut=>T(ot,ut),[()=>ue(r(Oe))]),x(Xe,et)},rt=S(()=>ue(r(Oe)));G(ct,Xe=>{r(rt)&&Xe(gt)})}c(Ie),$(Xe=>{Fe(Ie,1,Xe),T(Re,r(Oe).id),T(Be,`${r(Oe).dimension??""}d`)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(V)===r(Oe)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),we("click",Ie,()=>z(f,r(Oe),!0)),x($e,Ie)}),c(Ae);var He=v(Ae,2),nt=d(He);{var Ke=$e=>{var Oe=Cp();x($e,Oe)},Ge=$e=>{var Oe=Mp(),Ie=v(d(Oe),2),Ve=d(Ie,!0);c(Ie);var j=v(Ie,4),Re=d(j,!0);c(j);var Le=v(j,4),Be=d(Le,!0);c(Le);var Ye=v(Le,4),at=d(Ye,!0);c(Ye);var ct=v(Ye,2);{var gt=ot=>{var ut=Sp(),ht=v(fe(ut),2),xt=d(ht,!0);c(ht),$(()=>T(xt,r(V).vectorColumn)),x(ot,ut)};G(ct,ot=>{r(V).vectorColumn&&ot(gt)})}var rt=v(ct,2);{var Xe=ot=>{var ut=Np(),ht=v(fe(ut),2),xt=d(ht,!0);c(ht),$(Nt=>T(xt,Nt),[()=>ma(r(V))]),x(ot,ut)};G(rt,ot=>{r(n)==="search"&&r(V).scalarColumn&&ot(Xe)})}var et=v(rt,2);Je(et,17,()=>Object.entries(r(V).metadata),qt,(ot,ut)=>{var ht=S(()=>rn(r(ut),2));let xt=()=>r(ht)[0],Nt=()=>r(ht)[1];var bt=Ep(),mt=fe(bt),Ct=d(mt,!0);c(mt);var Et=v(mt,2),Ot=d(Et,!0);c(Et),$(Vt=>{T(Ct,xt()),T(Ot,Vt)},[()=>_a(Nt())]),x(ot,bt)}),c(Oe),$(ot=>{T(Ve,r(V).id),T(Re,r(V).dimension),T(Be,ot),T(at,r(V).vector.length>0?"returned":"not returned")},[()=>r(V).vector.length>0?vo(r(V).vector).toFixed(6):"n/a"]),x($e,Oe)},dt=$e=>{var Oe=qe(),Ie=fe(Oe);{var Ve=Re=>{var Le=zp(),Be=d(Le);c(Le),$(()=>T(Be,`This result reports a ${r(V).dimension??""}d vector, but the coordinate array was not returned by RedDB.`)),x(Re,Le)},j=Re=>{var Le=Ip(),Be=fe(Le),Ye=d(Be),at=d(Ye);c(Ye);var ct=v(Ye,2),gt=d(ct);c(ct),c(Be);var rt=v(Be,2);Je(rt,21,()=>r(V).vector.slice(0,256),qt,(ot,ut,ht)=>{var xt=Tp(),Nt=d(xt);Nt.textContent=ht;var bt=v(Nt,2),mt=d(bt);let Ct;c(bt);var Et=v(bt,2),Ot=d(Et,!0);c(Et),c(xt),$((Vt,Bt)=>{Ct=Zt(mt,"",Ct,Vt),Fe(Et,1,We(r(ut)<0?"text-warn text-right":"text-fg-1 text-right")),T(Ot,Bt)},[()=>({width:`${re(r(ut),r(V).vector)}%`}),()=>r(ut).toFixed(5)]),x(ot,xt)}),c(rt);var Xe=v(rt,2);{var et=ot=>{var ut=Pp();x(ot,ut)};G(Xe,ot=>{r(V).vector.length>256&&ot(et)})}$((ot,ut)=>{T(at,`${r(V).vector.length??""} dimensions`),T(gt,`|v| ${ot??""} / max visible ${ut??""}`)},[()=>vo(r(V).vector).toFixed(6),()=>r(U).toFixed(2)]),x(Re,Le)};G(Ie,Re=>{r(V).vector.length===0?Re(Ve):Re(j,-1)})}x($e,Oe)},vt=$e=>{var Oe=Lp(),Ie=v(d(Oe));Je(Ie,21,()=>r(K),Ve=>Ve.id,(Ve,j)=>{var Re=Ap(),Le=d(Re),Be=d(Le,!0);c(Le);var Ye=v(Le),at=d(Ye,!0);c(Ye);var ct=v(Ye),gt=d(ct,!0);c(ct),c(Re),$((rt,Xe,et)=>{T(Be,r(j).id),Me(Ye,"title",rt),T(at,Xe),T(gt,et)},[()=>ma(r(j)),()=>r(j).scalar===null?"n/a":r(j).scalar.toFixed(6),()=>vo(r(j).vector).toFixed(6)]),we("click",Re,()=>z(f,r(j),!0)),x(Ve,Re)}),c(Ie),c(Oe),x($e,Oe)};G(nt,$e=>{r(V)?r(o)==="metadata"?$e(Ge,1):r(o)==="vector"?$e(dt,2):$e(vt,-1):$e(Ke)})}c(He),c(Se),$(($e,Oe,Ie,Ve)=>{Fe(_e,1,$e),Me(_e,"aria-pressed",r(o)==="metadata"),Fe(be,1,Oe),Me(be,"aria-pressed",r(o)==="vector"),Fe(Ne,1,Ie),Me(Ne,"aria-pressed",r(o)==="scalar"),T(Ce,Ve),T(he,` ${r(n)==="search"?" results":" rows"}`)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(o)==="metadata"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(o)==="vector"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(o)==="scalar"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(K).length.toLocaleString()]),we("click",_e,()=>z(o,"metadata")),we("click",be,()=>z(o,"vector")),we("click",Ne,()=>z(o,"scalar")),x(oe,te)};G(se,oe=>{r(n)==="search"&&r(D).length===0?oe(B):r(H).length===0?oe(q,1):oe(ee,-1)})}c(pe),$((oe,te)=>{Fe(b,1,oe),Me(b,"aria-pressed",r(n)==="browse"),Fe(E,1,te),Me(E,"aria-pressed",r(n)==="search"),T(P,r(_)?`${r(_)}d`:"dimension n/a")},[()=>We(["inline-flex h-7 items-center gap-1 px-2 transition-colors",r(n)==="browse"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",r(n)==="search"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),we("click",b,()=>{z(n,"browse"),z(f,null)}),we("click",E,()=>{z(n,"search"),z(f,null)}),x(t,pe),Qe()}Tt(["click","keydown"]);const Vp={capability:"vector",renders:t=>np(t),component:Dp},Ka=["message","payload","body","value","data"],bl=["state","status","delivery_state"],ml=["consumer","consumer_id","worker","lease_owner"],_l=["dlc","dlq","dead_letter_collection","dead_letter_queue"];function go(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 Hp(t){return t.result.records.map((e,n)=>{const o=e.values??{},a=go(o,Ka),s=go(o,bl),i=go(o,ml),l=go(o,_l);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 qp(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")&&Ka.some(o=>n.includes(o))?!0:Ka.some(o=>n.includes(o))&&(bl.some(o=>n.includes(o))||ml.some(o=>n.includes(o))||_l.some(o=>n.includes(o)))})}function Fp(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 Zi(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 Kp(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:Zi(o.lsn),ts:Zi(o.ts),before:o.before,after:o.after,payload:o})}return e}function Bp(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 jp(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 Up=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear queue filter"><!></button>'),Yp=k("<span> </span>"),Wp=k('<span>from <span class="text-fg-2"> </span></span>'),Xp=k('<span>dlc <span class="text-fg-2"> </span></span>'),$p=k('<span class="text-fg-2"> </span>'),Gp=k('<div class="mt-1.5 text-warn"> </div>'),Zp=k('<div class="mt-1.5 text-ok"> </div>'),Qp=k('<div class="border-b border-line-1 bg-bg-1/20 px-3 py-2 text-[11px] font-mono"><div class="flex gap-2"><textarea rows="3" class="flex-1 resize-none rounded border border-line-1 bg-bg-0 px-2 py-1 text-[12px] text-fg-1 outline-none placeholder:text-fg-3 focus:border-accent"></textarea> <button type="button" class="inline-flex h-7 items-center gap-1.5 rounded bg-accent px-3 text-white disabled:opacity-40 disabled:cursor-not-allowed"><!> insert</button></div> <!></div>'),Jp=k('<div class="p-3 text-[12px] font-mono text-fg-3">No WITH EVENTS envelopes detected in this queue result.</div>'),eh=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-2"> </td><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1"><span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span></td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-right text-fg-3"> </td><td class="px-2 py-1 text-fg-2 truncate max-w-[520px]"> </td></tr>'),th=k('<table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">time</th><th class="px-2 py-1.5 text-left font-normal">source</th><th class="px-2 py-1.5 text-left font-normal">op</th><th class="px-2 py-1.5 text-left font-normal">entity</th><th class="px-2 py-1.5 text-right font-normal">lsn</th><th class="px-2 py-1.5 text-left font-normal">after</th></tr></thead><tbody></tbody></table>'),nh=k('<div class="flex-1 min-h-0 overflow-auto"><!></div>'),rh=k('<div class="rounded border border-line-1 bg-bg-1 px-3 py-2"><div class="mb-1 flex items-center gap-2"><span class="text-fg-0"> </span> <span> </span></div> <pre class="m-0 overflow-x-auto rounded bg-bg-0 px-2 py-1 text-fg-1"> </pre> <div class="mt-1 text-fg-3"> </div></div>'),oh=k('<div class="flex-1 min-h-0 overflow-auto p-3 text-[12px] font-mono"><div class="grid gap-2"></div></div>'),ah=k('<div class="p-3 text-fg-3">No queue messages in this result.</div>'),ih=k('<span class="ml-auto text-fg-3"> </span>'),sh=k('<button type="button"><div class="flex items-center gap-2"><span class="text-accent"> </span> <span class="rounded border border-line-1 px-1 py-0.5 text-[10px] text-fg-3"> </span> <!></div> <div class="mt-1 truncate text-fg-1"> </div></button>'),lh=k('<pre class="whitespace-pre-wrap text-fg-1"> </pre>'),ch=k('<div class="grid grid-cols-[120px_1fr] gap-x-3 gap-y-1.5"><span class="text-fg-3">id</span><span class="text-fg-0"> </span> <span class="text-fg-3">state</span><span class="text-fg-0"> </span> <span class="text-fg-3">consumer</span><span class="text-fg-0"> </span> <span class="text-fg-3">dlc</span><span class="text-fg-0"> </span> <span class="text-fg-3">message</span><pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre></div>'),dh=k('<div class="text-fg-3">Select a message to inspect payload, delivery state, consumer, and DLC link.</div>'),uh=k('<div class="flex-1 min-h-0 grid grid-cols-[minmax(360px,0.9fr)_1.1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"><!></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),fh=k('<span><span class="text-fg-2"> </span> </span>'),vh=k('<span><span class="text-fg-2"> </span> </span>'),gh=k('<div class="flex h-full flex-col text-fg-1"><div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> events</button> <button type="button"><!> messages</button> <button type="button"><!> commands</button> <button type="button"><!> json</button></div> <button type="button"><!> insert</button> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="message/state…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto flex items-center gap-3 text-fg-3"><span> </span> <!> <span> </span> <!> <!> <!></div></div> <!> <!> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3 flex items-center gap-3"><!> <!></div></div>');function ph(t,e){Ze(e,!0);let n=ye("events"),o=ye(""),a=ye(null),s=ye(!1),i=ye(""),l=ye(!1),u=ye(null),f=ye(0);const g='{"type":"email","to":"ops@example.com"}',h=S(()=>Hp(e.result)),p=S(()=>Fp(r(h))),y=S(()=>Kp(r(h))),_=S(()=>e.collection?Bp(e.collection):[]),I=S(()=>{const de=r(o).trim().toLowerCase();return de?r(h).filter(ie=>ie.id.toLowerCase().includes(de)||ie.state.toLowerCase().includes(de)||JSON.stringify(ie.message).toLowerCase().includes(de)):r(h)});function D(de){return typeof de=="string"?de:JSON.stringify(de)}function H(de){if(de===null)return"-";try{return new Date(de).toISOString().replace("T"," ").slice(0,19)}catch{return String(de)}}function R(){const de=r(i).trim();if(!de)return"";try{return JSON.parse(de)}catch{return de}}async function K(){const de=Ue.client;if(!(!de||!e.collection||!r(i).trim())){z(l,!0),z(u,null);try{await Mt.track(`${e.collection} · enqueue message`,()=>de.query(jp(e.collection,R()))),z(i,""),z(f,r(f)+1)}catch(ie){z(u,ie.message,!0)}finally{z(l,!1)}}}var V=gh(),U=d(V),ne=d(U),ue=d(ne),re=d(ue);pu(re,{class:"size-3"}),Te(),c(ue);var ae=v(ue,2),pe=d(ae);Hi(pe,{class:"size-3"}),Te(),c(ae);var O=v(ae,2),w=d(O);Qd(w,{class:"size-3"}),Te(),c(O);var A=v(O,2),b=d(A);gr(b,{class:"size-3"}),Te(),c(A),c(ne);var N=v(ne,2),E=d(N);nl(E,{class:"size-3"}),Te(),c(N);var L=v(N,2),F=d(L);hn(F,{class:"size-3 text-fg-3"});var W=v(F,2);Dt(W);var M=v(W,2);{var m=de=>{var ie=Up(),me=d(ie);$t(me,{class:"size-3"}),c(ie),we("click",ie,()=>z(o,"")),x(de,ie)};G(M,de=>{r(o)&&de(m)})}c(L);var C=v(L,2),P=d(C),X=d(P);c(P);var le=v(P,2);{var J=de=>{var ie=Yp(),me=d(ie);c(ie),$(Ce=>T(me,`${Ce??""} events`),[()=>r(y).length.toLocaleString()]),x(de,ie)};G(le,de=>{r(y).length&&de(J)})}var Y=v(le,2),Z=d(Y);c(Y);var Q=v(Y,2);{var se=de=>{var ie=Wp(),me=v(d(ie)),Ce=d(me,!0);c(me),c(ie),$(ke=>T(Ce,ke),[()=>r(p).sources.join(", ")]),x(de,ie)};G(Q,de=>{r(p).sources.length&&de(se)})}var B=v(Q,2);{var q=de=>{var ie=Xp(),me=v(d(ie)),Ce=d(me,!0);c(me),c(ie),$(ke=>T(Ce,ke),[()=>r(p).dlcs.join(", ")]),x(de,ie)};G(B,de=>{r(p).dlcs.length&&de(q)})}var ee=v(B,2);{var oe=de=>{var ie=$p(),me=d(ie,!0);c(ie),$(()=>T(me,e.collection)),x(de,ie)};G(ee,de=>{e.collection&&de(oe)})}c(C),c(U);var te=v(U,2);{var ge=de=>{var ie=Qp(),me=d(ie),Ce=d(me);Fs(Ce),Me(Ce,"placeholder",g);var ke=v(Ce,2),Ee=d(ke);{var he=Ke=>{mn(Ke,{class:"size-3 animate-spin"})},Se=Ke=>{Hi(Ke,{class:"size-3"})};G(Ee,Ke=>{r(l)?Ke(he):Ke(Se,-1)})}Te(),c(ke),c(me);var Ae=v(me,2);{var He=Ke=>{var Ge=Gp(),dt=d(Ge,!0);c(Ge),$(()=>T(dt,r(u))),x(Ke,Ge)},nt=Ke=>{var Ge=Zp(),dt=d(Ge);c(Ge),$(()=>T(dt,`${r(f)??""} inserted. Refresh the collection to reload from reddb.`)),x(Ke,Ge)};G(Ae,Ke=>{r(u)?Ke(He):r(f)>0&&Ke(nt,1)})}c(ie),$(Ke=>ke.disabled=Ke,[()=>r(l)||!r(i).trim()||!e.collection]),Ft(Ce,()=>r(i),Ke=>z(i,Ke)),we("click",ke,K),x(de,ie)};G(te,de=>{r(s)&&de(ge)})}var xe=v(te,2);{var _e=de=>{var ie=nh(),me=d(ie);{var Ce=Ee=>{var he=Jp();x(Ee,he)},ke=Ee=>{var he=th(),Se=v(d(he));Je(Se,21,()=>r(y),Ae=>`${Ae.messageId}-${Ae.lsn??Ae.entityId}`,(Ae,He)=>{var nt=eh(),Ke=d(nt),Ge=d(Ke,!0);c(Ke);var dt=v(Ke),vt=d(dt,!0);c(dt);var $e=v(dt),Oe=d($e),Ie=d(Oe,!0);c(Oe),c($e);var Ve=v($e),j=d(Ve,!0);c(Ve);var Re=v(Ve),Le=d(Re,!0);c(Re);var Be=v(Re),Ye=d(Be,!0);c(Be),c(nt),$((at,ct)=>{T(Ge,at),T(vt,r(He).collection),T(Ie,r(He).op),T(j,r(He).entityId),T(Le,r(He).lsn??"-"),T(Ye,ct)},[()=>H(r(He).ts),()=>D(r(He).after)]),x(Ae,nt)}),c(Se),c(he),x(Ee,he)};G(me,Ee=>{r(y).length===0?Ee(Ce):Ee(ke,-1)})}c(ie),x(de,ie)},ze=de=>{var ie=oh(),me=d(ie);Je(me,21,()=>r(_),Ce=>Ce.query,(Ce,ke)=>{var Ee=rh(),he=d(Ee),Se=d(he),Ae=d(Se,!0);c(Se);var He=v(Se,2),nt=d(He,!0);c(He),c(he);var Ke=v(he,2),Ge=d(Ke,!0);c(Ke);var dt=v(Ke,2),vt=d(dt,!0);c(dt),c(Ee),$($e=>{T(Ae,r(ke).label),Fe(He,1,$e),T(nt,r(ke).mutates?"mutates":"read-only"),T(Ge,r(ke).query),T(vt,r(ke).note)},[()=>We(["rounded border px-1.5 py-0.5 text-[10px]",r(ke).mutates?"border-warn/30 bg-warn/10 text-warn":"border-ok/30 bg-ok/10 text-ok"].join(" "))]),x(Ce,Ee)}),c(me),c(ie),x(de,ie)},be=de=>{var ie=uh(),me=d(ie),Ce=d(me);{var ke=Ke=>{var Ge=ah();x(Ke,Ge)},Ee=Ke=>{var Ge=qe(),dt=fe(Ge);Je(dt,17,()=>r(I),vt=>vt.id,(vt,$e)=>{var Oe=sh(),Ie=d(Oe),Ve=d(Ie),j=d(Ve,!0);c(Ve);var Re=v(Ve,2),Le=d(Re,!0);c(Re);var Be=v(Re,2);{var Ye=gt=>{var rt=ih(),Xe=d(rt,!0);c(rt),$(()=>T(Xe,r($e).consumer)),x(gt,rt)};G(Be,gt=>{r($e).consumer&>(Ye)})}c(Ie);var at=v(Ie,2),ct=d(at,!0);c(at),c(Oe),$((gt,rt)=>{Fe(Oe,1,gt),T(j,r($e).id),T(Le,r($e).state),T(ct,rt)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(a)===r($e)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" ")),()=>D(r($e).message)]),we("click",Oe,()=>z(a,r($e),!0)),x(vt,Oe)}),x(Ke,Ge)};G(Ce,Ke=>{r(I).length===0?Ke(ke):Ke(Ee,-1)})}c(me);var he=v(me,2),Se=d(he);{var Ae=Ke=>{var Ge=lh(),dt=d(Ge,!0);c(Ge),$(vt=>T(dt,vt),[()=>JSON.stringify(r(I).map(vt=>vt.values),null,2)]),x(Ke,Ge)},He=Ke=>{var Ge=ch(),dt=v(d(Ge)),vt=d(dt,!0);c(dt);var $e=v(dt,3),Oe=d($e,!0);c($e);var Ie=v($e,3),Ve=d(Ie,!0);c(Ie);var j=v(Ie,3),Re=d(j,!0);c(j);var Le=v(j,3),Be=d(Le,!0);c(Le),c(Ge),$(Ye=>{T(vt,r(a).id),T(Oe,r(a).state),T(Ve,r(a).consumer??"none"),T(Re,r(a).dlc??"none"),T(Be,Ye)},[()=>D(r(a).message)]),x(Ke,Ge)},nt=Ke=>{var Ge=dh();x(Ke,Ge)};G(Se,Ke=>{r(n)==="json"?Ke(Ae):r(a)?Ke(He,1):Ke(nt,-1)})}c(he),c(ie),x(de,ie)};G(xe,de=>{r(n)==="events"?de(_e):r(n)==="commands"?de(ze,1):de(be,-1)})}var ve=v(xe,2),Ne=d(ve);Je(Ne,17,()=>r(p).states,([de,ie])=>de,(de,ie)=>{var me=S(()=>rn(r(ie),2));let Ce=()=>r(me)[0],ke=()=>r(me)[1];var Ee=fh(),he=d(Ee),Se=d(he,!0);c(he);var Ae=v(he);c(Ee),$(He=>{T(Se,Ce()),T(Ae,` ${He??""}`)},[()=>ke().toLocaleString()]),x(de,Ee)});var Pe=v(Ne,2);Je(Pe,17,()=>r(p).operations,([de,ie])=>de,(de,ie)=>{var me=S(()=>rn(r(ie),2));let Ce=()=>r(me)[0],ke=()=>r(me)[1];var Ee=vh(),he=d(Ee),Se=d(he,!0);c(he);var Ae=v(he);c(Ee),$(He=>{T(Se,Ce()),T(Ae,` ${He??""}`)},[()=>ke().toLocaleString()]),x(de,Ee)}),c(ve),c(V),$((de,ie,me,Ce,ke,Ee)=>{Fe(ue,1,de),Me(ue,"aria-pressed",r(n)==="events"),Fe(ae,1,ie),Me(ae,"aria-pressed",r(n)==="messages"),Fe(O,1,me),Me(O,"aria-pressed",r(n)==="commands"),Fe(A,1,Ce),Me(A,"aria-pressed",r(n)==="json"),N.disabled=!e.collection,Fe(N,1,ke),Me(N,"aria-pressed",r(s)),Me(N,"title",e.collection?"Insert a queue message":"Open this as a collection to insert messages"),T(X,`${Ee??""} messages`),T(Z,`${r(p).activeConsumers??""} active consumers`)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="events"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="messages"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="commands"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",r(s)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>r(I).length.toLocaleString()]),we("click",ue,()=>z(n,"events")),we("click",ae,()=>z(n,"messages")),we("click",O,()=>z(n,"commands")),we("click",A,()=>z(n,"json")),we("click",N,()=>z(s,!r(s))),Ft(W,()=>r(o),de=>z(o,de)),x(t,V),Qe()}Tt(["click"]);const hh={capability:"queue",renders:t=>qp(t),component:ph},xh=["metric","stat","name","key"],bh=["value","count","total","avg","rate","p50","p95","p99"],Qi=["unit","units"];function Ji(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 mh(t){for(const n of Qi){const o=t[n];if(typeof o=="string"&&o.trim())return o.trim()}const e=Object.entries(t).find(([n,o])=>Qi.includes(n.toLowerCase())&&typeof o=="string"&&o.trim());return e?String(e[1]).trim():null}function yl(t){const e=[];for(const n of t.result.records){const o=n.values??{},a=Object.entries(o).find(([i,l])=>xh.includes(i.toLowerCase())&&(typeof l=="string"||typeof l=="number")),s=Object.entries(o).find(([i,l])=>bh.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:mh(o)??Ji(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:Ji(i),source:o})}return e}function _h(t){if(t.capability==="stats")return!0;const e=yl(t);return e.length>0&&e.length>=t.result.records.length}function es(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 yh=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No numeric statistics in this result.</div>'),wh=k('· <span class="text-fg-2"> </span>',1),kh=k('<div class="rounded border border-line-1 bg-bg-1 px-3 py-2"><div class="type-label truncate"> </div> <div class="mt-1 font-mono text-[20px] font-semibold text-fg-0"> </div></div>'),Ch=k('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2"></div></div>'),Sh=k('<div class="rounded border border-line-1 bg-bg-1 px-3 py-3 text-center"><svg viewBox="0 0 120 70" class="mx-auto h-[82px] w-[150px]"><path d="M 15 60 A 45 45 0 0 1 105 60" fill="none" stroke="var(--color-line-2)" stroke-width="10" stroke-linecap="round"></path><path d="M 15 60 A 45 45 0 0 1 105 60" fill="none" stroke="var(--color-accent)" stroke-width="10" stroke-linecap="round" pathLength="100"></path><text x="60" y="58" text-anchor="middle" class="fill-fg-0 font-mono text-[13px] font-semibold"> </text></svg> <div class="mt-1 truncate font-mono text-[11px] text-fg-2"> </div></div>'),Nh=k('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2"></div></div>'),Eh=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1 text-right text-accent"> </td><td class="px-2 py-1 text-fg-3"> </td></tr>'),Mh=k('<div class="flex-1 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">metric</th><th class="px-2 py-1.5 text-right font-normal">value</th><th class="px-2 py-1.5 text-left font-normal">unit</th></tr></thead><tbody></tbody></table></div>'),zh=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> kpis</button> <button type="button"><!> gauges</button> <button type="button"><!> table</button></div> <div class="ml-auto text-fg-3"> <!></div></div> <!>',1),Th=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function Ph(t,e){Ze(e,!0);let n=ye("kpi");const o=S(()=>yl(e.result)),a=S(()=>Math.max(1,...r(o).map(g=>Math.abs(g.value))));function s(g){return g>=0&&g<=100?g:Math.min(100,Math.abs(g)/r(a)*100)}var i=Th(),l=d(i);{var u=g=>{var h=yh();x(g,h)},f=g=>{var h=zh(),p=fe(h),y=d(p),_=d(y),I=d(_);uu(I,{class:"size-3"}),Te(),c(_);var D=v(_,2),H=d(D);el(H,{class:"size-3"}),Te(),c(D);var R=v(D,2),K=d(R);hd(K,{class:"size-3"}),Te(),c(R),c(y);var V=v(y,2),U=d(V),ne=v(U);{var ue=w=>{var A=wh(),b=v(fe(A)),N=d(b,!0);c(b),$(()=>T(N,e.collection)),x(w,A)};G(ne,w=>{e.collection&&w(ue)})}c(V),c(p);var re=v(p,2);{var ae=w=>{var A=Ch(),b=d(A);Je(b,23,()=>r(o),(N,E)=>`${N.key}-${E}`,(N,E)=>{var L=kh(),F=d(L),W=d(F,!0);c(F);var M=v(F,2),m=d(M,!0);c(M),c(L),$(C=>{T(W,r(E).label),T(m,C)},[()=>es(r(E).value,r(E).unit)]),x(N,L)}),c(b),c(A),x(w,A)},pe=w=>{var A=Nh(),b=d(A);Je(b,23,()=>r(o),(N,E)=>`${N.key}-${E}`,(N,E)=>{const L=S(()=>s(r(E).value));var F=Sh(),W=d(F),M=v(d(W)),m=v(M),C=d(m,!0);c(m),c(W);var P=v(W,2),X=d(P,!0);c(P),c(F),$(le=>{Me(W,"aria-label",`${r(E).label??""} gauge`),Me(M,"stroke-dasharray",`${r(L)} 100`),T(C,le),T(X,r(E).label)},[()=>es(r(E).value,r(E).unit)]),x(N,F)}),c(b),c(A),x(w,A)},O=w=>{var A=Mh(),b=d(A),N=v(d(b));Je(N,23,()=>r(o),(E,L)=>`${E.key}-${L}`,(E,L)=>{var F=Eh(),W=d(F),M=d(W,!0);c(W);var m=v(W),C=d(m,!0);c(m);var P=v(m),X=d(P,!0);c(P),c(F),$(le=>{T(M,r(L).label),T(C,le),T(X,r(L).unit||"-")},[()=>r(L).value.toLocaleString()]),x(E,F)}),c(N),c(b),c(A),x(w,A)};G(re,w=>{r(n)==="kpi"?w(ae):r(n)==="gauge"?w(pe,1):w(O,-1)})}$((w,A,b,N)=>{Fe(_,1,w),Me(_,"aria-pressed",r(n)==="kpi"),Fe(D,1,A),Me(D,"aria-pressed",r(n)==="gauge"),Fe(R,1,b),Me(R,"aria-pressed",r(n)==="table"),T(U,`${N??""} metrics `)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="kpi"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="gauge"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="table"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(o).length.toLocaleString()]),we("click",_,()=>z(n,"kpi")),we("click",D,()=>z(n,"gauge")),we("click",R,()=>z(n,"table")),x(g,h)};G(l,g=>{r(o).length===0?g(u):g(f,-1)})}c(i),x(t,i),Qe()}Tt(["click"]);const Ih={capability:"stats",renders:t=>_h(t),component:Ph},wl=["change","change_type","operation","op"],Ah=["target_collection","collection_name","diff_collection"],Lh=["entity_id","row_id","rid","id"],kl=["before_state","before_row","before"],Cl=["after_state","after_row","after"],Oh=["note","summary","message"];function rr(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 ts(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 Rh(t){return t.result.records.map((e,n)=>{const o=e.values??{},a=rr(o,wl),s=rr(o,Ah),i=rr(o,Lh),l=rr(o,kl),u=rr(o,Cl),f=rr(o,Oh);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:ts((l==null?void 0:l[1])??null),after:ts((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 Dh(t){return t.capability==="diff"?!0:t.result.records.some(e=>{const n=Object.keys(e.values??{}).map(o=>o.toLowerCase());return wl.some(o=>n.includes(o))&&(kl.some(o=>n.includes(o))||Cl.some(o=>n.includes(o)))})}function Vh(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 Ba(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function ns(t){return t===void 0?"__red_ui_undefined__":Ba(t)?JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))):JSON.stringify(t)}function Hh(t){const e=Ba(t.before)?t.before:{},n=Ba(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":ns(l)===ns(u)?"unchanged":"modified";return{field:a,before:l,after:u,status:f}})}function or(t){return t==null||t===""?"-":typeof t=="object"?JSON.stringify(t,null,2):String(t)}var qh=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No diff shape in this result.</div>'),Fh=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear diff filter"><!></button>'),Kh=k('<span><span class="text-fg-2"> </span> </span>'),Bh=k('<span class="text-fg-2"> </span>'),jh=k('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><pre class="whitespace-pre-wrap text-fg-1"> </pre></div>'),Uh=k('<span class="ml-auto text-fg-3"> </span>'),Yh=k('<div class="mt-1 truncate text-fg-1"> </div>'),Wh=k('<button type="button"><div class="flex items-center gap-2"><span class="text-accent"> </span> <span class="text-fg-3 truncate"> </span> <!></div> <!></button>'),Xh=k('<span class="text-fg-3">note</span><span class="text-fg-1"> </span>',1),$h=k('<div class="px-2 py-2 text-fg-3">No changed fields in this row.</div>'),Gh=k('<tr class="border-b border-line-1/60 last:border-b-0"><td> </td><td class="px-2 py-1 align-top text-fg-0"> </td><td class="max-w-[260px] px-2 py-1 align-top text-fg-2"><pre class="whitespace-pre-wrap break-words"> </pre></td><td class="max-w-[260px] px-2 py-1 align-top text-fg-2"><pre class="whitespace-pre-wrap break-words"> </pre></td></tr>'),Zh=k('<table class="w-full border-collapse"><thead class="bg-bg-0 text-fg-3"><tr class="border-b border-line-1"><th class="w-[110px] px-2 py-1 text-left font-normal">status</th><th class="w-[150px] px-2 py-1 text-left font-normal">field</th><th class="px-2 py-1 text-left font-normal">before</th><th class="px-2 py-1 text-left font-normal">after</th></tr></thead><tbody></tbody></table>'),Qh=k('<div class="mb-3 border border-line-1"><div class="flex items-center gap-2 border-b border-line-1 bg-bg-1 px-2 py-1.5"><span class="text-fg-0">field diff</span> <span class="text-fg-3"> </span> <label class="ml-auto inline-flex items-center gap-1 text-fg-3"><input type="checkbox" class="size-3 accent-current"/> unchanged</label></div> <!></div>'),Jh=k('<div class="mb-3 grid grid-cols-[100px_1fr] gap-x-3 gap-y-1"><span class="text-fg-3">change</span><span class="text-accent"> </span> <span class="text-fg-3">entity</span><span class="text-fg-0"> </span> <span class="text-fg-3">collection</span><span class="text-fg-0"> </span> <!></div> <!> <div class="grid grid-cols-2 gap-3"><section class="min-w-0"><div class="type-label mb-1">full before</div> <pre class="min-h-[160px] whitespace-pre-wrap break-words rounded border border-line-1 bg-bg-1 p-2 text-fg-1"> </pre></section> <section class="min-w-0"><div class="type-label mb-1">full after</div> <pre class="min-h-[160px] whitespace-pre-wrap break-words rounded border border-line-1 bg-bg-1 p-2 text-fg-1"> </pre></section></div>',1),e1=k('<div class="text-fg-3">No diff entry selected.</div>'),t1=k('<div class="flex-1 min-h-0 grid grid-cols-[minmax(320px,0.9fr)_1.1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),n1=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> diff</button> <button type="button"><!> raw</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="change, id, value…" class="bg-transparent text-fg-1 outline-none w-[190px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto flex items-center gap-3 text-fg-3"><!> <!></div></div> <!>',1),r1=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function Sl(t,e){Ze(e,!0);let n=ye("summary"),o=ye(""),a=ye(null),s=ye(!1);const i=S(()=>Rh(e.result)),l=S(()=>Vh(r(i))),u=S(()=>{const H=r(o).trim().toLowerCase();return H?r(i).filter(R=>R.id.toLowerCase().includes(H)||R.change.toLowerCase().includes(H)||(R.collection??"").toLowerCase().includes(H)||(R.entityId??"").toLowerCase().includes(H)||or(R.before).toLowerCase().includes(H)||or(R.after).toLowerCase().includes(H)):r(i)}),f=S(()=>r(a)??r(u)[0]??null),g=S(()=>r(f)?Hh(r(f)):[]),h=S(()=>r(s)?r(g):r(g).filter(H=>H.status!=="unchanged"));function p(H){return H==="added"?"text-ok":H==="removed"?"text-danger":H==="modified"?"text-accent":"text-fg-3"}var y=r1(),_=d(y);{var I=H=>{var R=qh();x(H,R)},D=H=>{var R=n1(),K=fe(R),V=d(K),U=d(V),ne=d(U);Da(ne,{class:"size-3"}),Te(),c(U);var ue=v(U,2),re=d(ue);gr(re,{class:"size-3"}),Te(),c(ue),c(V);var ae=v(V,2),pe=d(ae);hn(pe,{class:"size-3 text-fg-3"});var O=v(pe,2);Dt(O);var w=v(O,2);{var A=m=>{var C=Fh(),P=d(C);$t(P,{class:"size-3"}),c(C),we("click",C,()=>z(o,"")),x(m,C)};G(w,m=>{r(o)&&m(A)})}c(ae);var b=v(ae,2),N=d(b);Je(N,17,()=>r(l),([m,C])=>m,(m,C)=>{var P=S(()=>rn(r(C),2));let X=()=>r(P)[0],le=()=>r(P)[1];var J=Kh(),Y=d(J),Z=d(Y,!0);c(Y);var Q=v(Y);c(J),$(()=>{T(Z,X()),T(Q,` ${le()??""}`)}),x(m,J)});var E=v(N,2);{var L=m=>{var C=Bh(),P=d(C,!0);c(C),$(()=>T(P,e.collection)),x(m,C)};G(E,m=>{e.collection&&m(L)})}c(b),c(K);var F=v(K,2);{var W=m=>{var C=jh(),P=d(C),X=d(P,!0);c(P),c(C),$(le=>T(X,le),[()=>JSON.stringify(r(u).map(le=>le.values),null,2)]),x(m,C)},M=m=>{var C=t1(),P=d(C);Je(P,21,()=>r(u),Z=>Z.id,(Z,Q)=>{var se=Wh(),B=d(se),q=d(B),ee=d(q,!0);c(q);var oe=v(q,2),te=d(oe,!0);c(oe);var ge=v(oe,2);{var xe=be=>{var ve=Uh(),Ne=d(ve,!0);c(ve),$(()=>T(Ne,r(Q).collection)),x(be,ve)};G(ge,be=>{r(Q).collection&&be(xe)})}c(B);var _e=v(B,2);{var ze=be=>{var ve=Yh(),Ne=d(ve,!0);c(ve),$(()=>T(Ne,r(Q).note)),x(be,ve)};G(_e,be=>{r(Q).note&&be(ze)})}c(se),$(be=>{Fe(se,1,be),T(ee,r(Q).change),T(te,r(Q).entityId??r(Q).id)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(f)===r(Q)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),we("click",se,()=>z(a,r(Q),!0)),x(Z,se)}),c(P);var X=v(P,2),le=d(X);{var J=Z=>{var Q=Jh(),se=fe(Q),B=v(d(se)),q=d(B,!0);c(B);var ee=v(B,3),oe=d(ee,!0);c(ee);var te=v(ee,3),ge=d(te,!0);c(te);var xe=v(te,2);{var _e=ke=>{var Ee=Xh(),he=v(fe(Ee)),Se=d(he,!0);c(he),$(()=>T(Se,r(f).note)),x(ke,Ee)};G(xe,ke=>{r(f).note&&ke(_e)})}c(se);var ze=v(se,2);{var be=ke=>{var Ee=Qh(),he=d(Ee),Se=v(d(he),2),Ae=d(Se);c(Se);var He=v(Se,2),nt=d(He);Dt(nt),Te(),c(He),c(he);var Ke=v(he,2);{var Ge=vt=>{var $e=$h();x(vt,$e)},dt=vt=>{var $e=Zh(),Oe=v(d($e));Je(Oe,21,()=>r(h),Ie=>Ie.field,(Ie,Ve)=>{var j=Gh(),Re=d(j),Le=d(Re,!0);c(Re);var Be=v(Re),Ye=d(Be,!0);c(Be);var at=v(Be),ct=d(at),gt=d(ct,!0);c(ct),c(at);var rt=v(at),Xe=d(rt),et=d(Xe,!0);c(Xe),c(rt),c(j),$((ot,ut,ht)=>{Fe(Re,1,ot),T(Le,r(Ve).status),T(Ye,r(Ve).field),T(gt,ut),T(et,ht)},[()=>We(["px-2 py-1 align-top",p(r(Ve).status)].join(" ")),()=>or(r(Ve).before),()=>or(r(Ve).after)]),x(Ie,j)}),c(Oe),c($e),x(vt,$e)};G(Ke,vt=>{r(h).length===0?vt(Ge):vt(dt,-1)})}c(Ee),$(()=>T(Ae,`${r(h).length??""}/${r(g).length??""} fields`)),xd(nt,()=>r(s),vt=>z(s,vt)),x(ke,Ee)};G(ze,ke=>{r(g).length>0&&ke(be)})}var ve=v(ze,2),Ne=d(ve),Pe=v(d(Ne),2),de=d(Pe,!0);c(Pe),c(Ne);var ie=v(Ne,2),me=v(d(ie),2),Ce=d(me,!0);c(me),c(ie),c(ve),$((ke,Ee)=>{T(q,r(f).change),T(oe,r(f).entityId??r(f).id),T(ge,r(f).collection??"-"),T(de,ke),T(Ce,Ee)},[()=>or(r(f).before),()=>or(r(f).after)]),x(Z,Q)},Y=Z=>{var Q=e1();x(Z,Q)};G(le,Z=>{r(f)?Z(J):Z(Y,-1)})}c(X),c(C),x(m,C)};G(F,m=>{r(n)==="raw"?m(W):m(M,-1)})}$((m,C)=>{Fe(U,1,m),Me(U,"aria-pressed",r(n)==="summary"),Fe(ue,1,C),Me(ue,"aria-pressed",r(n)==="raw")},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="summary"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),we("click",U,()=>z(n,"summary")),we("click",ue,()=>z(n,"raw")),Ft(O,()=>r(o),m=>z(o,m)),x(H,R)};G(_,H=>{r(i).length===0?H(I):H(D,-1)})}c(y),x(t,y),Qe()}Tt(["click"]);const o1={capability:"diff",renders:Dh,component:Sl},a1=new Set(["rid","collection","kind","tenant","created_at","updated_at","body"]);function i1(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 s1(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 Nl(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))a1.has(l.toLowerCase())||(i[l]=u);e.push({rid:String(a.rid??n+1),title:i1(a,s,n),subtitle:s1(a,s),body:s,fields:i,values:a})}return e}function l1(t){return t.capability==="document"?!0:Nl(t).length>0}var c1=k('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No document shape in this result.</div>'),d1=k('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear document filter"><!></button>'),u1=k('· <span class="text-fg-2"> </span>',1),f1=k('<div class="mt-1 truncate text-fg-3"> </div>'),v1=k('<button type="button"><div class="flex items-center gap-2"><span class="text-accent truncate"> </span> <span class="ml-auto text-fg-3"> </span></div> <!></button>'),g1=k('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),p1=k('<tr class="border-b border-line-1/60"><td class="w-[180px] px-2 py-1 text-fg-3 align-top"> </td><td class="px-2 py-1 text-fg-1 align-top"><pre class="m-0 whitespace-pre-wrap"> </pre></td></tr>'),h1=k('<table class="w-full border-collapse"><tbody></tbody></table>'),x1=k('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),b1=k('<div class="text-fg-3">No documents match the current filter.</div>'),m1=k('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> body</button> <button type="button"><!> fields</button> <button type="button"><!> raw</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="document search…" class="bg-transparent text-fg-1 outline-none w-[200px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto text-fg-3"> <!> documents <!></div></div> <div class="flex-1 min-h-0 grid grid-cols-[minmax(280px,0.75fr)_1.25fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="min-h-0 overflow-auto p-3 text-[12px] font-mono"><!></div></div> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3"> </div>',1),_1=k('<div class="flex h-full flex-col text-fg-1"><!></div>');function y1(t,e){Ze(e,!0);let n=ye("body"),o=ye(""),a=ye(null);const s=S(()=>Nl(e.result)),i=S(()=>{const y=r(o).trim().toLowerCase();return y?r(s).filter(_=>_.title.toLowerCase().includes(y)||_.subtitle.toLowerCase().includes(y)||JSON.stringify(_.body).toLowerCase().includes(y)):r(s)}),l=S(()=>r(a)&&r(i).includes(r(a))?r(a):r(i)[0]??null);function u(y){return JSON.stringify(y??null,null,2)}var f=_1(),g=d(f);{var h=y=>{var _=c1();x(y,_)},p=y=>{var _=m1(),I=fe(_),D=d(I),H=d(D),R=d(H);gr(R,{class:"size-3"}),Te(),c(H);var K=v(H,2),V=d(K);ou(V,{class:"size-3"}),Te(),c(K);var U=v(K,2),ne=d(U);gr(ne,{class:"size-3"}),Te(),c(U),c(D);var ue=v(D,2),re=d(ue);hn(re,{class:"size-3 text-fg-3"});var ae=v(re,2);Dt(ae);var pe=v(ae,2);{var O=J=>{var Y=d1(),Z=d(Y);$t(Z,{class:"size-3"}),c(Y),we("click",Y,()=>z(o,"")),x(J,Y)};G(pe,J=>{r(o)&&J(O)})}c(ue);var w=v(ue,2),A=d(w,!0),b=v(A);{var N=J=>{var Y=pt();$(Z=>T(Y,`of ${Z??""}`),[()=>r(s).length.toLocaleString()]),x(J,Y)};G(b,J=>{r(o)&&J(N)})}var E=v(b,2);{var L=J=>{var Y=u1(),Z=v(fe(Y)),Q=d(Z,!0);c(Z),$(()=>T(Q,e.collection)),x(J,Y)};G(E,J=>{e.collection&&J(L)})}c(w),c(I);var F=v(I,2),W=d(F);Je(W,21,()=>r(i),J=>J.rid,(J,Y)=>{var Z=v1(),Q=d(Z),se=d(Q),B=d(se,!0);c(se);var q=v(se,2),ee=d(q);c(q),c(Q);var oe=v(Q,2);{var te=ge=>{var xe=f1(),_e=d(xe,!0);c(xe),$(()=>T(_e,r(Y).subtitle)),x(ge,xe)};G(oe,ge=>{r(Y).subtitle&&ge(te)})}c(Z),$(ge=>{Fe(Z,1,ge),T(B,r(Y).title),T(ee,`#${r(Y).rid??""}`)},[()=>We(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",r(l)===r(Y)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),we("click",Z,()=>z(a,r(Y),!0)),x(J,Z)}),c(W);var M=v(W,2),m=d(M);{var C=J=>{var Y=qe(),Z=fe(Y);{var Q=q=>{var ee=g1(),oe=d(ee,!0);c(ee),$(te=>T(oe,te),[()=>u(r(l).body)]),x(q,ee)},se=q=>{var ee=h1(),oe=d(ee);Je(oe,21,()=>Object.entries(r(l).fields),([te,ge])=>te,(te,ge)=>{var xe=S(()=>rn(r(ge),2));let _e=()=>r(xe)[0],ze=()=>r(xe)[1];var be=p1(),ve=d(be),Ne=d(ve,!0);c(ve);var Pe=v(ve),de=d(Pe),ie=d(de,!0);c(de),c(Pe),c(be),$(me=>{T(Ne,_e()),T(ie,me)},[()=>u(ze())]),x(te,be)}),c(oe),c(ee),x(q,ee)},B=q=>{var ee=x1(),oe=d(ee,!0);c(ee),$(te=>T(oe,te),[()=>u(r(l).values)]),x(q,ee)};G(Z,q=>{r(n)==="body"?q(Q):r(n)==="fields"?q(se,1):q(B,-1)})}x(J,Y)},P=J=>{var Y=b1();x(J,Y)};G(m,J=>{r(l)?J(C):J(P,-1)})}c(M),c(F);var X=v(F,2),le=d(X);c(X),$((J,Y,Z,Q)=>{Fe(H,1,J),Me(H,"aria-pressed",r(n)==="body"),Fe(K,1,Y),Me(K,"aria-pressed",r(n)==="fields"),Fe(U,1,Z),Me(U,"aria-pressed",r(n)==="raw"),T(A,Q),T(le,`${r(s).length??""} documents${e.collection?" · ":""}${e.collection??""??""}`)},[()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",r(n)==="body"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="fields"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",r(n)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>r(i).length.toLocaleString()]),we("click",H,()=>z(n,"body")),we("click",K,()=>z(n,"fields")),we("click",U,()=>z(n,"raw")),Ft(ae,()=>r(o),J=>z(o,J)),x(y,_)};G(g,y=>{r(s).length===0?y(h):y(p,-1)})}c(f),x(t,f),Qe()}Tt(["click"]);const w1={capability:"document",renders:l1,component:y1};on.register(eg);on.register(tg);on.register(wg);on.register(jg);on.register(Vp);on.register(hh);on.register(Ih);on.register(o1);on.register(w1);on.register(Gg);var k1=k("<!> resume",1),C1=k("<!> pause",1),S1=k('<label class="inline-flex items-center gap-1 cursor-pointer"><input type="checkbox" class="accent-accent size-3"/> <span> </span></label>'),N1=k('<button type="button" class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 hover:bg-bg-2 text-fg-3" title="Clear buffer"><!> clear</button>'),E1=k('<div class="p-6 text-[12px] font-mono text-fg-3"><span class="text-accent">error:</span> </div>'),M1=k('<div class="p-6 text-[12px] font-mono text-fg-3">Not connected. Use the topbar Connect button to open a stream.</div>'),z1=k('<div class="p-6 text-[12px] font-mono text-fg-3"> </div>'),T1=k('<span class="text-fg-3 ml-auto"> </span>'),P1=k('<li class="px-3 py-1.5 flex items-center gap-3 hover:bg-bg-1"><span class="text-fg-3 w-16 shrink-0"> </span> <span class="text-fg-3 w-16 shrink-0"> </span> <span> </span> <span class="text-fg-2 truncate"> </span> <span class="text-fg-3">·</span> <span class="text-fg-3 truncate"> </span> <!></li>'),I1=k('<ul class="divide-y divide-line-1 font-mono text-[12px]"></ul>'),A1=k('<div class="h-full flex flex-col bg-bg-0"><header class="px-3 py-2 border-b border-line-1 flex items-center gap-3 text-fg-3"><!> <span class="type-label">Live changes</span> <span class="text-[11px] font-mono text-fg-3"> </span> <div class="ml-auto flex items-center gap-1"><button type="button" class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 hover:bg-bg-2 text-fg-2"><!></button> <div class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 text-fg-3"><!> <!></div> <!></div></header> <div class="flex-1 overflow-auto"><!></div></div>');function El(t,e){Ze(e,!0);const n=["insert","update","delete"];let o=ye(zt([])),a=ye(!1),s=ye(zt({insert:!0,update:!0,delete:!0})),i=ye(null),l=null,u=null;const f=500;function g(){p(),z(i,null),z(o,[],!0);const C=Ue.client;if(!C){z(i,"No active connection.");return}l=new Ud({client:C,sseFactory:null}).subscribe({collection:e.collection}),u=l.events.getReader(),h()}async function h(){if(u)try{for(;;){const{value:C,done:P}=await u.read();if(P)return;r(a)||C&&z(o,[C,...r(o)].slice(0,f),!0)}}catch(C){z(i,C.message,!0)}}function p(){if(u){try{u.cancel()}catch{}u=null}l&&(l.close(),l=null)}Pt(()=>{Ue.connected,e.collection,Ue.connected?g():p()}),Zo(p);function y(C){const P=Date.now()-C;return P<1e3?"now":P<6e4?`${Math.floor(P/1e3)}s ago`:P<36e5?`${Math.floor(P/6e4)}m ago`:`${Math.floor(P/36e5)}h ago`}function _(C){return new Date(C).toISOString().replace("T"," ").replace("Z","")}const I=S(()=>r(o).filter(C=>r(s)[C.operation]??!0)),D=S(()=>e.collection?`collection: ${e.collection}`:"global");var H=A1(),R=d(H),K=d(R);Lr(K,{class:"size-3.5"});var V=v(K,4),U=d(V);c(V);var ne=v(V,2),ue=d(ne),re=d(ue);{var ae=C=>{var P=k1(),X=fe(P);Qo(X,{class:"size-3"}),Te(),x(C,P)},pe=C=>{var P=C1(),X=fe(P);vu(X,{class:"size-3"}),Te(),x(C,P)};G(re,C=>{r(a)?C(ae):C(pe,-1)})}c(ue);var O=v(ue,2),w=d(O);Js(w,{class:"size-3"});var A=v(w,2);Je(A,16,()=>n,C=>C,(C,P)=>{var X=S1(),le=d(X);Dt(le);var J=v(le,2),Y=d(J,!0);c(J),c(X),$(()=>{Bs(le,r(s)[P]),Fe(J,1,We(r(s)[P]?"text-fg-1":"text-fg-3")),T(Y,P)}),we("change",le,Z=>z(s,{...r(s),[P]:Z.currentTarget.checked},!0)),x(C,X)}),c(O);var b=v(O,2);{var N=C=>{var P=N1(),X=d(P);$t(X,{class:"size-3"}),Te(),c(P),we("click",P,()=>z(o,[],!0)),x(C,P)};G(b,C=>{r(o).length>0&&C(N)})}c(ne),c(R);var E=v(R,2),L=d(E);{var F=C=>{var P=E1(),X=v(d(P));c(P),$(()=>T(X,` ${r(i)??""}`)),x(C,P)},W=C=>{var P=M1();x(C,P)},M=C=>{var P=z1(),X=d(P,!0);c(P),$(()=>T(X,r(a)?"Paused — no events captured.":"Listening for changes…")),x(C,P)},m=C=>{var P=I1();Je(P,21,()=>r(I),X=>X.lsn,(X,le)=>{var J=P1(),Y=d(J),Z=d(Y,!0);c(Y);var Q=v(Y,2),se=d(Q);c(Q);var B=v(Q,2),q=d(B,!0);c(B);var ee=v(B,2),oe=d(ee,!0);c(ee);var te=v(ee,4),ge=d(te,!0);c(te);var xe=v(te,2);{var _e=ze=>{var be=T1(),ve=d(be);c(be),$(()=>T(ve,`rid ${r(le).rid??""}`)),x(ze,be)};G(xe,ze=>{r(le).rid!==void 0&&ze(_e)})}c(J),$((ze,be,ve)=>{Me(Y,"title",ze),T(Z,be),T(se,`lsn ${r(le).lsn??""}`),Fe(B,1,ve),T(q,r(le).operation),T(oe,r(le).collection),T(ge,r(le).kind)},[()=>_(r(le).timestamp),()=>y(r(le).timestamp),()=>We(["inline-block w-14 text-center text-[10px] uppercase rounded px-1 py-0.5 shrink-0 border",r(le).operation==="insert"&&"border-ok/40 text-ok",r(le).operation==="update"&&"border-warn/40 text-warn",r(le).operation==="delete"&&"border-accent/40 text-accent"].filter(Boolean).join(" "))]),x(X,J)}),c(P),x(C,P)};G(L,C=>{r(i)?C(F):Ue.connected?r(I).length===0?C(M,2):C(m,-1):C(W,1)})}c(E),c(H),$(()=>{T(U,`· ${r(D)??""}`),Me(ue,"title",r(a)?"Resume stream":"Pause stream")}),we("click",ue,()=>z(a,!r(a))),x(t,H),Qe()}Tt(["click","change"]);var L1=k('<div class="border-b border-line-1 px-3 py-1.5 font-mono text-[11px] text-warn"> </div>'),O1=k('<div class="p-4 font-mono text-[12px] text-fg-3">No active RedDB connection.</div>'),R1=k('<div class="p-4 font-mono text-[12px] text-fg-3">Loading version history…</div>'),D1=k('<div class="p-4 font-mono text-[12px] text-fg-3"><div class="mb-2 text-fg-1">This collection is a normal collection with versioning disabled.</div> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-accent/40 bg-accent px-2 text-white hover:bg-accent/90"><!> enable versioning</button></div>'),V1=k('<div class="flex-1 min-h-0"><!></div>'),H1=k("<option> </option>"),q1=k("<option> </option>"),F1=k('<span class="ml-auto text-fg-3"> </span>'),K1=k('<div class="p-4 font-mono text-[12px] text-fg-3">Choose two commits to compare this collection.</div>'),B1=k('<div class="border-b border-line-1 px-3 py-1.5 flex flex-wrap items-center gap-2 font-mono text-[11px]"><label class="inline-flex items-center gap-1 text-fg-3"><span>from</span> <select class="h-7 rounded border border-line-1 bg-bg-0 px-2 text-fg-1"><option>select commit</option><!></select></label> <label class="inline-flex items-center gap-1 text-fg-3"><span>to</span> <select class="h-7 rounded border border-line-1 bg-bg-0 px-2 text-fg-1"><option>select commit</option><!></select></label> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-line-1 px-2 text-fg-2 hover:bg-bg-2 disabled:text-fg-3"><!> run diff</button> <!></div> <div class="flex-1 min-h-0"><!></div>',1),j1=k('<div class="p-4 font-mono text-[12px] text-fg-3">No commits yet.</div>'),U1=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/50"><td class="px-3 py-1.5 text-accent"> </td><td class="px-3 py-1.5 text-fg-1"> </td><td class="px-3 py-1.5 text-fg-3"> </td><td class="px-3 py-1.5 text-fg-3"> </td></tr>'),Y1=k('<table class="w-full border-collapse font-mono text-[12px]"><thead class="sticky top-0 bg-bg-0 text-fg-3"><tr class="border-b border-line-1"><th class="px-3 py-1.5 text-left font-normal">commit</th><th class="px-3 py-1.5 text-left font-normal">message</th><th class="px-3 py-1.5 text-left font-normal">author</th><th class="px-3 py-1.5 text-left font-normal">time</th></tr></thead><tbody></tbody></table>'),W1=k('<div class="flex-1 overflow-auto"><!></div>'),X1=k('<div class="h-full min-h-0 flex flex-col bg-bg-0"><div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 font-mono text-[11px]"><div class="inline-flex overflow-hidden rounded border border-line-2"><button type="button"><!> commits</button> <button type="button"><!> diff</button> <button type="button"><!> live</button></div> <span> </span> <span class="text-fg-3"> </span> <button type="button" class="ml-auto inline-flex h-7 items-center gap-1 rounded border border-line-1 px-2 text-fg-3 hover:bg-bg-2 hover:text-fg-1"><!> refresh</button></div> <!> <!></div>');function $1(t,e){Ze(e,!0);let n=ye("commits"),o=ye(null),a=ye(zt([])),s=ye(""),i=ye(""),l=ye(null),u=ye(!1),f=ye(!1),g=ye(null),h="";const p=S(()=>r(s).length>0&&r(i).length>0&&r(s)!==r(i));function y(Q){return Q.slice(0,10)}function _(Q){return Q?new Date(Q).toISOString().replace("T"," ").replace("Z",""):"-"}function I(Q){return{ok:!0,query:`/repo/commits/${Q.from}/diff/${Q.to}?collection=${e.collection}`,capability:"diff",record_count:Q.entries.length,result:{columns:["collection","entity_id","change","before","after"],records:Q.entries.map((se,B)=>({values:{id:`${se.collection}:${se.entity_id}:${B}`,collection:se.collection,entity_id:se.entity_id,change:se.change,before:se.before??null,after:se.after??null}}))}}}async function D(){if(e.client){z(u,!0),z(g,null),z(l,null);try{const[Q,se]=await Promise.all([e.client.collectionVcs(e.collection),e.client.commits({limit:40})]);z(o,Q,!0),z(a,se,!0),se.length>=2?(z(i,se[0].hash,!0),z(s,se[1].hash,!0)):se.length===1?(z(i,se[0].hash,!0),z(s,"")):(z(i,""),z(s,""))}catch(Q){z(g,Q.message,!0)}finally{z(u,!1)}}}async function H(){if(e.client){z(u,!0),z(g,null);try{z(o,await e.client.setCollectionVcs(e.collection,!0),!0),z(a,await e.client.commits({limit:40}),!0)}catch(Q){z(g,Q.message,!0)}finally{z(u,!1)}}}async function R(){if(!(!e.client||!r(p))){z(f,!0),z(g,null);try{z(l,await e.client.commitDiff(r(s),r(i),{collection:e.collection}),!0),z(n,"diff")}catch(Q){z(g,Q.message,!0)}finally{z(f,!1)}}}Pt(()=>{var se;const Q=`${((se=e.client)==null?void 0:se.baseUrl)??"none"}:${e.collection}`;Q!==h&&(h=Q,D())});var K=X1(),V=d(K),U=d(V),ne=d(U),ue=d(ne);iu(ue,{class:"size-3"}),Te(),c(ne);var re=v(ne,2),ae=d(re);Da(ae,{class:"size-3"}),Te(),c(re);var pe=v(re,2),O=d(pe);gu(O,{class:"size-3"}),Te(),c(pe),c(U);var w=v(U,2),A=d(w,!0);c(w);var b=v(w,2),N=d(b,!0);c(b);var E=v(b,2),L=d(E);{var F=Q=>{mn(Q,{class:"size-3 animate-spin"})},W=Q=>{rl(Q,{class:"size-3"})};G(L,Q=>{r(u)?Q(F):Q(W,-1)})}Te(),c(E),c(V);var M=v(V,2);{var m=Q=>{var se=L1(),B=d(se,!0);c(se),$(()=>T(B,r(g))),x(Q,se)};G(M,Q=>{r(g)&&Q(m)})}var C=v(M,2);{var P=Q=>{var se=O1();x(Q,se)},X=Q=>{var se=R1();x(Q,se)},le=Q=>{var se=D1(),B=v(d(se),2),q=d(B);mu(q,{class:"size-3"}),Te(),c(B),c(se),we("click",B,()=>void H()),x(Q,se)},J=Q=>{var se=V1(),B=d(se);El(B,{get collection(){return e.collection}}),c(se),x(Q,se)},Y=Q=>{var se=B1(),B=fe(se),q=d(B),ee=v(d(q),2),oe=d(ee);oe.value=oe.__value="";var te=v(oe);Je(te,17,()=>r(a),he=>he.hash,(he,Se)=>{var Ae=H1(),He=d(Ae);c(Ae);var nt={};$(Ke=>{T(He,`${Ke??""} · ${r(Se).message??""}`),nt!==(nt=r(Se).hash)&&(Ae.value=(Ae.__value=r(Se).hash)??"")},[()=>y(r(Se).hash)]),x(he,Ae)}),c(ee),c(q);var ge=v(q,2),xe=v(d(ge),2),_e=d(xe);_e.value=_e.__value="";var ze=v(_e);Je(ze,17,()=>r(a),he=>he.hash,(he,Se)=>{var Ae=q1(),He=d(Ae);c(Ae);var nt={};$(Ke=>{T(He,`${Ke??""} · ${r(Se).message??""}`),nt!==(nt=r(Se).hash)&&(Ae.value=(Ae.__value=r(Se).hash)??"")},[()=>y(r(Se).hash)]),x(he,Ae)}),c(xe),c(ge);var be=v(ge,2),ve=d(be);{var Ne=he=>{mn(he,{class:"size-3 animate-spin"})},Pe=he=>{Da(he,{class:"size-3"})};G(ve,he=>{r(f)?he(Ne):he(Pe,-1)})}Te(),c(be);var de=v(be,2);{var ie=he=>{var Se=F1(),Ae=d(Se);c(Se),$(()=>T(Ae,`+${r(l).added??""} -${r(l).removed??""} ~${r(l).modified??""}`)),x(he,Se)};G(de,he=>{r(l)&&he(ie)})}c(B);var me=v(B,2),Ce=d(me);{var ke=he=>{{let Se=S(()=>I(r(l)));Sl(he,{get result(){return r(Se)},get collection(){return e.collection}})}},Ee=he=>{var Se=K1();x(he,Se)};G(Ce,he=>{r(l)?he(ke):he(Ee,-1)})}c(me),$(()=>be.disabled=!r(p)||r(f)),Aa(ee,()=>r(s),he=>z(s,he)),Aa(xe,()=>r(i),he=>z(i,he)),we("click",be,()=>void R()),x(Q,se)},Z=Q=>{var se=W1(),B=d(se);{var q=oe=>{var te=j1();x(oe,te)},ee=oe=>{var te=Y1(),ge=v(d(te));Je(ge,21,()=>r(a),xe=>xe.hash,(xe,_e)=>{var ze=U1(),be=d(ze),ve=d(be,!0);c(be);var Ne=v(be),Pe=d(Ne,!0);c(Ne);var de=v(Ne),ie=d(de,!0);c(de);var me=v(de),Ce=d(me,!0);c(me),c(ze),$((ke,Ee)=>{var he;T(ve,ke),T(Pe,r(_e).message),T(ie,((he=r(_e).author)==null?void 0:he.name)??"-"),T(Ce,Ee)},[()=>y(r(_e).hash),()=>_(r(_e).timestamp_ms)]),x(xe,ze)}),c(ge),c(te),x(oe,te)};G(B,oe=>{r(a).length===0?oe(q):oe(ee,-1)})}c(se),x(Q,se)};G(C,Q=>{e.client?r(u)&&!r(o)?Q(X,1):r(o)&&!r(o).versioned?Q(le,2):r(n)==="live"?Q(J,3):r(n)==="diff"?Q(Y,4):Q(Z,-1):Q(P)})}c(K),$((Q,se,B)=>{var q,ee;Fe(ne,1,Q),Fe(re,1,se),Fe(pe,1,B),Fe(w,1,We((q=r(o))!=null&&q.versioned?"text-ok":"text-fg-3")),T(A,(ee=r(o))!=null&&ee.versioned?"versioned":"not versioned"),T(N,e.collection),E.disabled=r(u)},[()=>We(["inline-flex h-7 items-center gap-1 px-2",r(n)==="commits"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",r(n)==="diff"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>We(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",r(n)==="live"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),we("click",ne,()=>z(n,"commits")),we("click",re,()=>z(n,"diff")),we("click",pe,()=>z(n,"live")),we("click",E,()=>void D()),x(t,K),Qe()}Tt(["click"]);var G1=k('<span class="text-fg-3">·</span> <span class="text-fg-2 font-mono text-[11px] truncate max-w-[280px]"> </span>',1),Z1=k('<span class="text-warn font-mono text-[11px]">disconnected</span>'),Q1=k("<!> <span>Running…</span>",1),J1=k("<!> <span>Run</span>",1),ex=k('<div class="p-4 text-[12px] font-mono text-warn"><div class="font-semibold mb-1">Query failed</div> <pre class="whitespace-pre-wrap"> </pre></div>'),tx=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Running…</div>'),nx=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Run a query to see results here.</div>'),rx=k('<div class="px-3 py-1.5 border-b border-line-1 bg-bg-1 text-[11px] font-mono text-fg-3"> <span class="text-fg-2">LIMIT</span> to narrow.</div>'),ox=k("<!> <!>",1),ax=k('<div class="flex h-full flex-col"><div class="flex flex-col border-b border-line-1 bg-bg-0" style="height: 40%;"><div class="flex items-center justify-between px-3 py-1.5 border-b border-line-1"><div class="flex items-center gap-2 text-fg-3 type-label"><span>SQL</span> <!></div> <div class="flex items-center gap-2"><span class="text-fg-3 font-mono text-[11px] hidden sm:inline">Run with <!><!></span> <button type="button" class="inline-flex items-center gap-1 rounded border border-accent/60 bg-accent/10 px-2 py-1 text-[12px] font-mono text-accent hover:bg-accent/20 disabled:opacity-50 disabled:cursor-not-allowed" aria-label="Run query"><!></button></div></div> <textarea class="flex-1 resize-none bg-bg-0 px-3 py-2 font-mono text-[13px] text-fg-1 outline-none placeholder:text-fg-3" spellcheck="false" autocapitalize="off"></textarea></div> <div class="flex-1 overflow-hidden bg-bg-0"><!></div></div>');function ix(t,e){Ze(e,!0),Pt(()=>{tn.ensure(e.tabId)});const n=S(()=>tn.states[e.tabId]),o=S(()=>_t.tabs.find(N=>N.id===e.tabId));let a=ye(void 0);function s(N){tn.setSql(e.tabId,N);const E=fv(N,e.fallbackLabel),L=_t.tabs.find(F=>F.id===e.tabId);L&&L.label!==E&&_t.rename(e.tabId,E)}async function i(){await tn.run(e.tabId)}function l(N){(N.metaKey||N.ctrlKey)&&N.key==="Enter"&&(N.preventDefault(),i())}function u(){var N,E;return(N=r(n))!=null&&N.result?on.pick(r(n).result.capability,r(n).result,(E=r(o))==null?void 0:E.overrideCapability):null}var f=ax(),g=d(f),h=d(g),p=d(h),y=v(d(p),2);{var _=N=>{var E=G1(),L=v(fe(E),2),F=d(L,!0);c(L),$(()=>T(F,Ue.active.url)),x(N,E)},I=N=>{var E=Z1();x(N,E)};G(y,N=>{Ue.connected?N(_):N(I,-1)})}c(p);var D=v(p,2),H=d(D),R=v(d(H));Qt(R,{children:(N,E)=>{Te();var L=pt("⌘");x(N,L)}});var K=v(R);Qt(K,{children:(N,E)=>{Te();var L=pt("↵");x(N,L)}}),c(H);var V=v(H,2),U=d(V);{var ne=N=>{var E=Q1(),L=fe(E);mn(L,{class:"size-3.5 animate-spin"}),Te(2),x(N,E)},ue=N=>{var E=J1(),L=fe(E);Qo(L,{class:"size-3.5"}),Te(2),x(N,E)};G(U,N=>{var E;(E=r(n))!=null&&E.running?N(ne):N(ue,-1)})}c(V),c(D),c(h);var re=v(h,2);Fs(re),Me(re,"placeholder","SELECT * FROM users LIMIT 100"),bn(re,N=>z(a,N),()=>r(a)),c(g);var ae=v(g,2),pe=d(ae);{var O=N=>{var E=ex(),L=v(d(E),2),F=d(L,!0);c(L),c(E),$(()=>T(F,r(n).error)),x(N,E)},w=N=>{var E=tx();x(N,E)},A=N=>{var E=nx();x(N,E)},b=N=>{const E=S(u);var L=ox(),F=fe(L);{var W=C=>{var P=rx(),X=d(P);Te(2),c(P),$(le=>T(X,`Streamed first ${le??""} rows — more remain on the server. Add a `),[()=>r(n).result.record_count.toLocaleString()]),x(C,P)};G(F,C=>{r(n).result.truncated&&C(W)})}var M=v(F,2);{var m=C=>{const P=S(()=>r(E).component);var X=qe(),le=fe(X);{let J=S(()=>{var Y;return((Y=r(o))==null?void 0:Y.showSystemColumns)??!1});Zr(le,()=>r(P),(Y,Z)=>{Z(Y,{get result(){return r(n).result},get showSystem(){return r(J)}})})}x(C,X)};G(M,C=>{r(E)&&C(m)})}x(N,L)};G(pe,N=>{var E,L,F;(E=r(n))!=null&&E.error?N(O):(L=r(n))!=null&&L.running&&!r(n).result?N(w,1):(F=r(n))!=null&&F.result?N(b,-1):N(A,2)})}c(ae),c(f),$(()=>{var N,E;V.disabled=((N=r(n))==null?void 0:N.running)||!Ue.connected,bd(re,((E=r(n))==null?void 0:E.sql)??"")}),we("click",V,i),we("input",re,N=>s(N.currentTarget.value)),we("keydown",re,l),x(t,f),Qe()}Tt(["click","input","keydown"]);var sx=k('<div class="px-3 py-2 flex items-center gap-2 text-fg-3"><!> <span class="type-label">Results</span></div>'),lx=k('<a><span class="truncate max-w-[180px]"> </span> <span class="opacity-60 group-hover:opacity-100 hover:bg-bg-2 rounded p-0.5" role="button" tabindex="-1" aria-label="Close tab"><!></span></a>'),cx=k('<button type="button"><span class="truncate max-w-[180px]"> </span> <span class="opacity-60 group-hover:opacity-100 hover:bg-bg-2 rounded p-0.5" role="button" tabindex="-1" aria-label="Close tab"><!></span></button>'),dx=k('<div class="flex items-stretch overflow-x-auto"></div>'),ux=k('<button type="button"><!> <span>history</span></button>'),fx=k('<button type="button"><!> <span>meta</span></button> <!>',1),vx=k("<option> </option>"),gx=k('<div class="ml-auto flex items-center gap-2 px-2 text-[11px] font-mono text-fg-3"><!> <button type="button"><!> <span>sys</span></button> <span> </span> <span class="text-fg-3">· override:</span> <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5" aria-label="Renderer override"></select></div>'),px=k('<div role="menu" class="absolute right-0 top-full mt-1 z-10 min-w-[220px] rounded border border-line-1 bg-bg-1 shadow-lg p-1 text-[12px] font-mono"><button type="button" class="w-full text-left px-2 py-1 rounded hover:bg-bg-2 text-fg-1 flex items-center gap-2"><!> <span class="flex-1">New query</span> <span class="text-fg-3 text-[10px]">⌘T</span></button> <button type="button" class="w-full text-left px-2 py-1 rounded hover:bg-bg-2 text-fg-1">Live changes (global)</button></div>'),hx=k('<div class="text-center text-fg-3 text-[12px] font-mono">Connected to <span class="text-fg-1"> </span>. <br/> Pick a collection from the left to open a tab.</div>'),xx=k(`<div class="text-center max-w-md"><!> <h2 class="type-h2 m-0 mb-2">Workspace</h2> <p class="text-fg-2 text-[13px] m-0">Connect to a reddb instance from the topbar to start browsing
|
|
915
|
+
collections and running queries.</p></div>`),bx=k('<div class="h-full grid place-items-center p-6"><!></div>'),mx=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Workspace</div>'),_x=k('<div class="p-4 text-[12px] font-mono text-warn"><div class="font-semibold mb-1">Query failed</div> <pre class="whitespace-pre-wrap"> </pre></div>'),yx=k('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono"> </div>'),wx=k('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Catalog metadata unavailable.</span> <span class="truncate"> </span></div>'),kx=k('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Loading collection catalog…</span></div>'),Cx=k('<span class="rounded border border-line-1 bg-bg-0/70 px-1.5 py-0.5 font-mono text-[10px] text-fg-2"> </span>'),Sx=k('<span class="font-mono text-[10px] text-fg-3">No type-specific catalog fields.</span>'),Nx=k('<div class="flex flex-wrap items-center gap-x-4 gap-y-2"><div class="min-w-[180px] flex-1"><div class="flex items-center gap-2"><span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-[0.08em] text-accent"> </span> <span class="truncate font-mono text-[12px] text-fg-0"> </span></div> <div class="mt-1 flex flex-wrap gap-1"><!> <!></div></div> <div class="flex flex-wrap items-center gap-2 font-mono text-[11px]"><div class="inline-flex min-w-[94px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">entities</span></div> <div class="inline-flex min-w-[92px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">disk</span></div> <div class="inline-flex min-w-[92px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">mem</span></div> <div class="inline-flex min-w-[78px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">seg</span></div> <div class="inline-flex min-w-[78px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">idx</span></div></div></div>'),Ex=k('<div class="flex items-start gap-2 text-fg-3"><!> <div><div class="text-warn">Collection metadata unavailable.</div> <div class="mt-0.5 break-words"> </div></div></div>'),Mx=k('<div class="text-fg-3">Loading metadata…</div>'),zx=k('<span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span>'),Tx=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),Px=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),Ix=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2">retention</span>'),Ax=k("<span> </span>"),Lx=k('<div class="mt-1 flex flex-wrap gap-1"></div>'),Ox=k('<div class="mt-1 text-fg-3">Action grants not exposed.</div>'),Rx=k('<div class="grid grid-cols-[minmax(160px,0.8fr)_1.2fr] gap-3"><div class="grid grid-cols-[78px_1fr] gap-x-2 gap-y-1"><span class="text-fg-3">name</span> <span class="text-fg-0 truncate"> </span> <span class="text-fg-3">kind</span> <span class="text-accent"> </span> <span class="text-fg-3">tenant</span> <span class="text-fg-1"> </span> <span class="text-fg-3">indexes</span> <span class="text-fg-1"> </span></div> <div class="grid gap-1"><div class="flex flex-wrap gap-1"><!> <!> <!> <!></div> <!></div></div>'),Dx=k('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-2 text-[11px] font-mono"><!></div>'),Vx=k('<div class="h-[320px] min-h-[240px] border-b border-line-1"><!></div>'),Hx=k('<div class="h-full flex flex-col"><div class="border-b border-line-1 bg-bg-1/35 px-3 py-2"><!></div> <!> <!> <div class="flex-1 min-h-0"><!></div></div>'),qx=k('<div class="h-full flex flex-col"><div class="border-b border-line-1 flex items-stretch min-h-[36px] bg-bg-0"><!> <!> <div><button type="button" class="px-2 inline-flex items-center text-fg-3 hover:text-fg-1" aria-label="Open tab menu"><!></button> <!></div></div> <div class="flex-1 overflow-hidden bg-bg-0"><!></div></div>');function Fx(t,e){Ze(e,!0);const n=Qr(),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=zt({}),s=zt({}),i=zt({}),l=zt({}),u=zt({}),f=zt({}),g=zt({}),h=ye(zt({})),p=ye(null),y=null,_=ye(!1),I=ye(!1);Pt(()=>{const B=_t.activeId;B!==y&&(z(p,y,!0),y=B)});async function D(B,q){const[xe,_e]=await Promise.all([Mt.track(`${q} · edges (LIMIT 50000)`,()=>B.query(`SELECT * FROM ${q} WHERE from_rid IS NOT NULL LIMIT 50000`)),Mt.track(`${q} · centrality (LIMIT 100)`,()=>B.query("GRAPH CENTRALITY LIMIT 100")).catch(()=>null)]),ze=new Map;_e!=null&&_e.ok&&_e.result.records.forEach((ke,Ee)=>{const he=ke.values.node_id??ke.values.rid??ke.values.id,Se=ke.values.score??ke.values.centrality_score??ke.values.centrality,Ae=typeof he=="number"?he:typeof he=="string"?Number(he):NaN,He=typeof Se=="number"?Se:typeof Se=="string"?Number(Se):NaN;!Number.isFinite(Ae)||!Number.isFinite(He)||ze.set(Ae,{score:He,rank:Ee+1,label:typeof ke.values.label=="string"?ke.values.label:void 0})});const be=new Set;for(const ke of xe.result.records){const Ee=ke.values.from_rid,he=ke.values.to_rid;typeof Ee=="number"&&be.add(Ee),typeof he=="number"&&be.add(he)}for(const ke of ze.keys())be.add(ke);const ve=[...be],Ne=Math.ceil(ve.length/5),Pe=[];for(let ke=0;ke<ve.length;ke+=5)Pe.push({idx:Math.floor(ke/5)+1,ids:ve.slice(ke,ke+5).join(",")});const de=[];let ie=xe,me=0;async function Ce(){for(;me<Pe.length;){const ke=Pe[me++],Ee=await Mt.track(`${q} · nodes ${ke.idx}/${Ne}`,()=>B.query(`SELECT * FROM ${q} WHERE rid IN (${ke.ids})`));de.push(...Ee.result.records.map(he=>{const Se=he.values.rid,Ae=typeof Se=="number"?ze.get(Se):void 0;return Ae?{...he,values:{...he.values,centrality_score:Ae.score,centrality_rank:Ae.rank,centrality_label:Ae.label}}:he})),ie=Ee}}return await Promise.all(Array.from({length:8},Ce)),{...ie,record_count:de.length+xe.result.records.length,result:{...ie.result,records:[...de,...xe.result.records]}}}function H(B){return B.replace(/[^A-Za-z0-9_./-]/g,"")}function R(B){return`'${B.replace(/'/g,"''")}'`}async function K(B,q){const ee=await B.query(gv(q)),oe=hv(ee.result.records[0]);if(!oe)throw new Error(`${q} was not found in red.collections`);return oe}async function V(B,q){var ee;try{const te=(ee=(await B.query(`SELECT model FROM red.collections WHERE name = ${R(q)} LIMIT 1`)).result.records[0])==null?void 0:ee.values.model;return typeof te=="string"?te:null}catch{return null}}async function U(B,q){const ee=H(q),oe=await V(B,q);if(oe==="hll")return B.query(`HLL INFO ${ee}`);if(oe==="sketch")return B.query(`SKETCH INFO ${ee}`);if(oe==="filter")return B.query(`FILTER INFO ${ee}`);if(oe==="mixed")for(const te of[`HLL INFO ${ee}`,`SKETCH INFO ${ee}`,`FILTER INFO ${ee}`])try{return await B.query(te)}catch{}try{return await B.query(`SELECT * FROM ${ee} LIMIT 200`)}catch{for(const te of[`HLL INFO ${ee}`,`SKETCH INFO ${ee}`,`FILTER INFO ${ee}`])try{return await B.query(te)}catch{}throw new Error(`No stats read form worked for ${q}`)}}async function ne(B,q){const ee=H(q),oe=await B.query(`SELECT * FROM ${ee} LIMIT 200`);return{...oe,capability:oe.capability??"vector"}}Pt(()=>{if(Lt.locked)return;const B=Ue.client;if(B)for(const q of _t.tabs){if(q.kind!=="collection")continue;const ee=q.subpage??Pr(q.capability),oe=ee==="graph"||ee==="svg",te=ee==="queue"||q.capability==="queue",ge=ee==="vector"||q.capability==="vector",xe=ee==="stats"||q.capability==="stats",_e=oe?"graph-subgraph":te?"queue-peek":ge?"vector-inspector":xe?"stats-info":q.capability??"unknown",ze=`${q.key}:${ee}:${_e}`;if(i[q.id]&&i[q.id]!==ze&&(delete a[q.id],delete s[q.id]),a[q.id]!==void 0||s[q.id])continue;a[q.id]=null,i[q.id]=ze;const be=q.key;(oe?D(B,be):te?Mt.track(`${be} · QUEUE PEEK (LIMIT 200)`,()=>B.query(`QUEUE PEEK ${be} 200`)):ge?Mt.track(`${be} · vector inspector seed`,()=>ne(B,be)):xe?Mt.track(`${be} · stats preview`,()=>U(B,be)):Mt.track(`${be} · SELECT * (LIMIT 200)`,()=>B.query(`SELECT * FROM ${be} LIMIT 200`))).then(Ne=>{a[q.id]=Ne}).catch(Ne=>{s[q.id]=Ne.message})}}),Pt(()=>{if(Lt.locked)return;const B=Ue.client;if(B)for(const q of _t.tabs)q.kind==="collection"&&(l[q.id]!==void 0||u[q.id]||(l[q.id]=null,Mt.track(`catalog · ${q.key}`,()=>K(B,q.key)).then(ee=>{l[q.id]=ee}).catch(ee=>{u[q.id]=ee.message})))}),Pt(()=>{if(!r(I)||Lt.locked)return;const B=Ue.client;if(B)for(const q of _t.tabs)q.kind==="collection"&&(f[q.id]!==void 0||g[q.id]||(f[q.id]=null,Mt.track(`metadata · ${q.key}`,()=>B.collection(q.key)).then(ee=>{f[q.id]=ee}).catch(ee=>{g[q.id]=ee.message})))});function ue(B,q){B.stopPropagation();const ee=_t.tabs.find(te=>te.id===q);if((ee==null?void 0:ee.kind)==="query"&&tn.isDirty(q)&&!(typeof window<"u"?window.confirm("Discard unsaved query in this tab?"):!0))return;const oe=(ee==null?void 0:ee.kind)==="collection"&&ee.key===n.collection;if(_t.close(q,r(p)),tn.remove(q),delete a[q],delete s[q],delete i[q],delete l[q],delete u[q],delete f[q],delete g[q],delete r(h)[q],oe){const te=_t.tabs.find(ge=>ge.kind==="collection");n.go(te?{view:"collection",collection:te.key,subpage:te.subpage??Pr(te.capability)}:{view:"collections"},void 0,!0)}}function re(){const B=tn.nextLabel(),q=_t.open({kind:"query",label:B,key:B},!0);tn.ensure(q.id),z(_,!1)}Wn(()=>{const B=()=>re();return window.addEventListener("red:new-query",B),()=>window.removeEventListener("red:new-query",B)});function ae(B,q){const ee=md(B.subpage,B.capability??q.capability);return on.pick(ee,q,B.overrideCapability)}function pe(){_t.open({kind:"live-changes",label:"live · global",key:"global"}),z(_,!1)}function O(B,q){const ee=q.currentTarget.value;_t.setOverride(B.id,ee===""?void 0:ee)}function w(B,q){return B.subpage?B.subpage:B.capability?B.capability:q!=null&&q.capability?q.capability:"auto"}function A(B){return typeof B=="boolean"?{allowed:B}:{allowed:B.allowed,reason:B.reason}}function b(B){return B&&typeof B=="object"&&!Array.isArray(B)?Object.keys(B):[]}var N=qx(),E=d(N),L=d(E);{var F=B=>{var q=sx(),ee=d(q);Lr(ee,{class:"size-3.5"}),Te(2),c(q),x(B,q)},W=B=>{var q=dx();Je(q,21,()=>_t.tabs,ee=>ee.id,(ee,oe)=>{const te=S(()=>r(oe).id===_t.activeId),ge=S(()=>["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 xe=qe(),_e=fe(xe);{var ze=ve=>{const Ne=S(()=>({view:"collection",collection:r(oe).key,subpage:r(oe).subpage??Pr(r(oe).capability)}));var Pe=lx(),de=d(Pe),ie=d(de,!0);c(de);var me=v(de,2),Ce=d(me);$t(Ce,{class:"size-3"}),c(me),c(Pe),$(ke=>{Me(Pe,"href",ke),Fe(Pe,1,We(r(ge))),Me(Pe,"title",r(oe).label),T(ie,r(oe).label)},[()=>n.href(r(Ne))]),we("click",Pe,ke=>n.go(r(Ne),ke)),we("click",me,ke=>ue(ke,r(oe).id)),we("keydown",me,ke=>{ke.key==="Enter"&&ue(ke,r(oe).id)}),x(ve,Pe)},be=ve=>{var Ne=cx(),Pe=d(Ne),de=d(Pe,!0);c(Pe);var ie=v(Pe,2),me=d(ie);$t(me,{class:"size-3"}),c(ie),c(Ne),$(()=>{Fe(Ne,1,We(r(ge))),Me(Ne,"title",r(oe).label),T(de,r(oe).label)}),we("click",Ne,()=>_t.focus(r(oe).id)),we("click",ie,Ce=>ue(Ce,r(oe).id)),we("keydown",ie,Ce=>{Ce.key==="Enter"&&ue(Ce,r(oe).id)}),x(ve,Ne)};G(_e,ve=>{r(oe).kind==="collection"?ve(ze):ve(be,-1)})}x(ee,xe)}),c(q),x(B,q)};G(L,B=>{_t.tabs.length===0?B(F):B(W,-1)})}var M=v(L,2);{var m=B=>{const q=S(()=>_t.active),ee=S(()=>a[r(q).id]);var oe=gx(),te=d(oe);{var ge=ie=>{var me=fx(),Ce=fe(me),ke=d(Ce);fa(ke,{class:"size-3"}),Te(2),c(Ce);var Ee=v(Ce,2);{var he=Se=>{var Ae=ux(),He=d(Ae);au(He,{class:"size-3"}),Te(2),c(Ae),$(nt=>{Me(Ae,"title",r(h)[r(q).id]?"Hide version history":"Show version history and diffs"),Me(Ae,"aria-pressed",r(h)[r(q).id]??!1),Fe(Ae,1,nt)},[()=>We(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(h)[r(q).id]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",Ae,()=>z(h,{...r(h),[r(q).id]:!(r(h)[r(q).id]??!1)},!0)),x(Se,Ae)};G(Ee,Se=>{Ue.capabilities.vcs&&Se(he)})}$(Se=>{Me(Ce,"title",r(I)?"Hide collection metadata":"Show collection metadata"),Me(Ce,"aria-pressed",r(I)),Fe(Ce,1,Se)},[()=>We(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(I)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",Ce,()=>z(I,!r(I))),x(ie,me)};G(te,ie=>{r(q).kind==="collection"&&ie(ge)})}var xe=v(te,2),_e=d(xe);{var ze=ie=>{nu(ie,{class:"size-3"})},be=ie=>{tu(ie,{class:"size-3"})};G(_e,ie=>{r(q).showSystemColumns?ie(ze):ie(be,-1)})}Te(2),c(xe);var ve=v(xe,2),Ne=d(ve,!0);c(ve);var Pe=v(ve,4);Je(Pe,21,()=>o,ie=>ie.value,(ie,me)=>{var Ce=vx(),ke=d(Ce,!0);c(Ce);var Ee={};$(()=>{T(ke,r(me).label),Ee!==(Ee=r(me).value)&&(Ce.value=(Ce.__value=r(me).value)??"")}),x(ie,Ce)}),c(Pe);var de;ai(Pe),c(oe),$((ie,me)=>{Me(xe,"title",r(q).showSystemColumns?"Hide reddb system columns (rid, collection, kind, tenant, created_at, updated_at)":"Show reddb system columns"),Me(xe,"aria-pressed",r(q).showSystemColumns??!1),Fe(xe,1,ie),T(Ne,me),de!==(de=r(q).overrideCapability??"")&&(Pe.value=(Pe.__value=r(q).overrideCapability??"")??"",ii(Pe,r(q).overrideCapability??""))},[()=>We(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",r(q).showSystemColumns?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>w(r(q),r(ee))]),we("click",xe,()=>_t.setShowSystem(r(q).id,!r(q).showSystemColumns)),we("change",Pe,ie=>O(r(q),ie)),x(B,oe)};G(M,B=>{_t.active&&(_t.active.kind==="collection"||_t.active.kind==="query")&&B(m)})}var C=v(M,2),P=d(C),X=d(P);nl(X,{class:"size-3.5"}),c(P);var le=v(P,2);{var J=B=>{var q=px(),ee=d(q),oe=d(ee);Qs(oe,{class:"size-3.5 text-fg-3"}),Te(4),c(ee);var te=v(ee,2);c(q),we("click",ee,re),we("click",te,pe),x(B,q)};G(le,B=>{r(_)&&B(J)})}c(C),c(E);var Y=v(E,2),Z=d(Y);{var Q=B=>{var q=bx(),ee=d(q);{var oe=ge=>{var xe=hx(),_e=v(d(xe)),ze=d(_e,!0);c(_e),Te(3),c(xe),$(()=>T(ze,Ue.active.url)),x(ge,xe)},te=ge=>{var xe=xx(),_e=d(xe);Lo(_e,{class:"size-8 text-fg-3 mx-auto mb-3",strokeWidth:1.4}),Te(4),c(xe),x(ge,xe)};G(ee,ge=>{Ue.connected?ge(oe):ge(te,-1)})}c(q),x(B,q)},se=B=>{const q=S(()=>_t.active);var ee=qe(),oe=fe(ee);{var te=ze=>{El(ze,{collection:void 0})},ge=ze=>{ix(ze,{get tabId(){return r(q).id},get fallbackLabel(){return r(q).key}})},xe=ze=>{var be=mx();x(ze,be)},_e=ze=>{const be=S(()=>a[r(q).id]),ve=S(()=>s[r(q).id]);var Ne=qe(),Pe=fe(Ne);{var de=Ce=>{var ke=_x(),Ee=v(d(ke),2),he=d(Ee,!0);c(Ee),c(ke),$(()=>T(he,r(ve))),x(Ce,ke)},ie=Ce=>{var ke=yx(),Ee=d(ke);c(ke),$(()=>T(Ee,`Loading ${r(q).label??""}…`)),x(Ce,ke)},me=Ce=>{const ke=S(()=>ae(r(q),r(be))),Ee=S(()=>r(ke).component),he=S(()=>l[r(q).id]),Se=S(()=>u[r(q).id]);var Ae=Hx(),He=d(Ae),nt=d(He);{var Ke=Re=>{var Le=wx(),Be=d(Le);fa(Be,{class:"size-3.5 text-warn"});var Ye=v(Be,4),at=d(Ye,!0);c(Ye),c(Le),$(()=>T(at,r(Se))),x(Re,Le)},Ge=Re=>{var Le=kx(),Be=d(Le);Lo(Be,{class:"size-3.5"}),Te(2),c(Le),x(Re,Le)},dt=Re=>{var Le=Nx(),Be=d(Le),Ye=d(Be),at=d(Ye),ct=d(at,!0);c(at);var gt=v(at,2),rt=d(gt,!0);c(gt),c(Ye);var Xe=v(Ye,2),et=d(Xe);Je(et,17,()=>Yi(r(he)),qt,(yt,St)=>{var Ht=Cx(),sn=d(Ht,!0);c(Ht),$(()=>T(sn,r(St))),x(yt,Ht)});var ot=v(et,2);{var ut=yt=>{var St=Sx();x(yt,St)},ht=S(()=>Yi(r(he)).length===0);G(ot,yt=>{r(ht)&&yt(ut)})}c(Xe),c(Be);var xt=v(Be,2),Nt=d(xt),bt=d(Nt);Va(bt,{class:"size-3.5 text-fg-3"});var mt=v(bt,2),Ct=d(mt,!0);c(mt),Te(2),c(Nt);var Et=v(Nt,2),Ot=d(Et);su(Ot,{class:"size-3.5 text-fg-3"});var Vt=v(Ot,2),Bt=d(Vt,!0);c(Vt),Te(2),c(Et);var Ut=v(Et,2),an=d(Ut);Lr(an,{class:"size-3.5 text-fg-3"});var fn=v(an,2),vn=d(fn,!0);c(fn),Te(2),c(Ut);var zn=v(Ut,2),Rn=d(zn);_d(Rn,{class:"size-3.5 text-fg-3"});var Dn=v(Rn,2),kr=d(Dn,!0);c(Dn),Te(2),c(zn);var Tn=v(zn,2),Vn=d(Tn);hu(Vn,{class:"size-3.5 text-fg-3"});var Hn=v(Vn,2),tr=d(Hn,!0);c(Hn),Te(2),c(Tn),c(xt),c(Le),$((yt,St,Ht,sn,Pn)=>{T(ct,r(he).model??"collection"),T(rt,r(he).name),T(Ct,yt),T(Bt,St),T(vn,Ht),T(kr,sn),T(tr,Pn)},[()=>So(r(he).entities),()=>Ui(r(he).onDiskBytes),()=>Ui(r(he).inMemoryBytes),()=>So(r(he).segments),()=>So(r(he).indices)]),x(Re,Le)};G(nt,Re=>{r(Se)?Re(Ke):r(he)?Re(dt,-1):Re(Ge,1)})}c(He);var vt=v(He,2);{var $e=Re=>{const Le=S(()=>f[r(q).id]),Be=S(()=>g[r(q).id]);var Ye=Dx(),at=d(Ye);{var ct=Xe=>{var et=Ex(),ot=d(et);fa(ot,{class:"mt-0.5 size-3.5 text-warn"});var ut=v(ot,2),ht=v(d(ut),2),xt=d(ht,!0);c(ht),c(ut),c(et),$(()=>T(xt,r(Be))),x(Xe,et)},gt=Xe=>{var et=Mx();x(Xe,et)},rt=Xe=>{var et=Rx(),ot=d(et),ut=v(d(ot),2),ht=d(ut,!0);c(ut);var xt=v(ut,4),Nt=d(xt,!0);c(xt);var bt=v(xt,4),mt=d(bt,!0);c(bt);var Ct=v(bt,4),Et=d(Ct,!0);c(Ct),c(ot);var Ot=v(ot,2),Vt=d(Ot),Bt=d(Vt);{var Ut=yt=>{var St=zx(),Ht=d(St,!0);c(St),$(()=>T(Ht,r(Le).capability)),x(yt,St)};G(Bt,yt=>{r(Le).capability&&yt(Ut)})}var an=v(Bt,2);Je(an,17,()=>r(Le).capabilities??[],qt,(yt,St)=>{var Ht=Tx(),sn=d(Ht,!0);c(Ht),$(()=>T(sn,r(St))),x(yt,Ht)});var fn=v(an,2);{var vn=yt=>{var St=Px(),Ht=d(St);c(St),$(sn=>T(Ht,`schema ${sn??""}`),[()=>b(r(Le).schema).length]),x(yt,St)},zn=S(()=>b(r(Le).schema).length>0);G(fn,yt=>{r(zn)&&yt(vn)})}var Rn=v(fn,2);{var Dn=yt=>{var St=Ix();x(yt,St)},kr=S(()=>b(r(Le).retention).length>0);G(Rn,yt=>{r(kr)&&yt(Dn)})}c(Vt);var Tn=v(Vt,2);{var Vn=yt=>{var St=Lx();Je(St,21,()=>Object.entries(r(Le).actions),qt,(Ht,sn)=>{var Pn=S(()=>rn(r(sn),2));let oo=()=>r(Pn)[0],ao=()=>r(Pn)[1];const nr=S(()=>A(ao()));var qn=Ax(),Cr=d(qn);c(qn),$(io=>{Fe(qn,1,io),Me(qn,"title",r(nr).reason),T(Cr,`${oo()??""}: ${r(nr).allowed?"allow":"deny"}`)},[()=>We(["rounded border px-1.5 py-0.5",r(nr).allowed?"border-ok/30 bg-ok/10 text-ok":"border-danger/30 bg-danger/10 text-danger"].join(" "))]),x(Ht,qn)}),c(St),x(yt,St)},Hn=S(()=>r(Le).actions&&b(r(Le).actions).length>0),tr=yt=>{var St=Ox();x(yt,St)};G(Tn,yt=>{r(Hn)?yt(Vn):yt(tr,-1)})}c(Ot),c(et),$(()=>{var yt;T(ht,r(Le).name??r(q).key),T(Nt,r(Le).kind??r(Le).capability??r(q).capability??"unknown"),T(mt,r(Le).tenant??"not exposed"),T(Et,((yt=r(Le).indexes)==null?void 0:yt.length)??0)}),x(Xe,et)};G(at,Xe=>{r(Be)?Xe(ct):r(Le)?Xe(rt,-1):Xe(gt,1)})}c(Ye),x(Re,Ye)};G(vt,Re=>{r(I)&&Re($e)})}var Oe=v(vt,2);{var Ie=Re=>{var Le=Vx(),Be=d(Le);{let Ye=S(()=>Ue.client??void 0);$1(Be,{get client(){return r(Ye)},get collection(){return r(q).key}})}c(Le),x(Re,Le)};G(Oe,Re=>{r(h)[r(q).id]&&Re(Ie)})}var Ve=v(Oe,2),j=d(Ve);{let Re=S(()=>r(q).kind==="collection"?r(q).key:void 0),Le=S(()=>Ue.client??void 0),Be=S(()=>r(q).kind==="collection"?r(q).subpage:void 0),Ye=S(()=>r(q).showSystemColumns??!1);Zr(j,()=>r(Ee),(at,ct)=>{ct(at,{get result(){return r(be)},get collection(){return r(Re)},get client(){return r(Le)},get subpage(){return r(Be)},get showSystem(){return r(Ye)}})})}c(Ve),c(Ae),x(Ce,Ae)};G(Pe,Ce=>{r(ve)?Ce(de):r(be)?Ce(me,-1):Ce(ie,1)})}x(ze,Ne)};G(oe,ze=>{r(q).kind==="live-changes"?ze(te):r(q).kind==="query"?ze(ge,1):r(q).kind==="welcome"?ze(xe,2):ze(_e,-1)})}x(B,ee)};G(Z,B=>{_t.active?B(se,-1):B(Q)})}c(Y),c(N),$(()=>Fe(C,1,`relative ${_t.active&&(_t.active.kind==="collection"||_t.active.kind==="query")?"":"ml-auto"} flex items-stretch`)),we("click",P,()=>z(_,!r(_))),x(t,N),Qe()}Tt(["click","keydown","change"]);var Kx=k('<div class="h-full grid grid-cols-[260px_1fr] bg-bg-0 text-fg-1"><aside class="row-start-1 col-start-1 border-r border-line-1 bg-bg-0 overflow-y-auto"><!></aside> <section class="row-start-1 col-start-2 bg-bg-0 overflow-hidden"><!></section></div>');function Bx(t){var e=Kx(),n=d(e),o=d(n);sv(o,{}),c(n);var a=v(n,2),s=d(a);Fx(s,{}),c(a),c(e),x(t,e)}var jx={value:()=>{}};function ea(){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 Eo(n)}function Eo(t){this._=t}function Ux(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}})}Eo.prototype=ea.prototype={constructor:Eo,on:function(t,e){var n=this._,o=Ux(t+"",n),a,s=-1,i=o.length;if(arguments.length<2){for(;++s<i;)if((a=(t=o[s]).type)&&(a=Yx(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]=rs(n[a],t.name,e);else if(e==null)for(a in n)n[a]=rs(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 Eo(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 Yx(t,e){for(var n=0,o=t.length,a;n<o;++n)if((a=t[n]).name===e)return a.value}function rs(t,e,n){for(var o=0,a=t.length;o<a;++o)if(t[o].name===e){t[o]=jx,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var ja="http://www.w3.org/1999/xhtml";const os={svg:"http://www.w3.org/2000/svg",xhtml:ja,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ta(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),os.hasOwnProperty(e)?{space:os[e],local:t}:t}function Wx(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ja&&e.documentElement.namespaceURI===ja?e.createElement(t):e.createElementNS(n,t)}}function Xx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ml(t){var e=ta(t);return(e.local?Xx:Wx)(e)}function $x(){}function di(t){return t==null?$x:function(){return this.querySelector(t)}}function Gx(t){typeof t!="function"&&(t=di(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,g=0;g<i;++g)(u=s[g])&&(f=t.call(u,u.__data__,g,s))&&("__data__"in u&&(f.__data__=u.__data__),l[g]=f);return new Jt(o,this._parents)}function Zx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Qx(){return[]}function zl(t){return t==null?Qx:function(){return this.querySelectorAll(t)}}function Jx(t){return function(){return Zx(t.apply(this,arguments))}}function eb(t){typeof t=="function"?t=Jx(t):t=zl(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 Jt(o,a)}function Tl(t){return function(){return this.matches(t)}}function Pl(t){return function(e){return e.matches(t)}}var tb=Array.prototype.find;function nb(t){return function(){return tb.call(this.children,t)}}function rb(){return this.firstElementChild}function ob(t){return this.select(t==null?rb:nb(typeof t=="function"?t:Pl(t)))}var ab=Array.prototype.filter;function ib(){return Array.from(this.children)}function sb(t){return function(){return ab.call(this.children,t)}}function lb(t){return this.selectAll(t==null?ib:sb(typeof t=="function"?t:Pl(t)))}function cb(t){typeof t!="function"&&(t=Tl(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 Jt(o,this._parents)}function Il(t){return new Array(t.length)}function db(){return new Jt(this._enter||this._groups.map(Il),this._parents)}function Oo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Oo.prototype={constructor:Oo,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 ub(t){return function(){return t}}function fb(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 Oo(t,s[i]);for(;i<u;++i)(l=e[i])&&(a[i]=l)}function vb(t,e,n,o,a,s,i){var l,u,f=new Map,g=e.length,h=s.length,p=new Array(g),y;for(l=0;l<g;++l)(u=e[l])&&(p[l]=y=i.call(u,u.__data__,l,e)+"",f.has(y)?a[l]=u:f.set(y,u));for(l=0;l<h;++l)y=i.call(t,s[l],l,s)+"",(u=f.get(y))?(o[l]=u,u.__data__=s[l],f.delete(y)):n[l]=new Oo(t,s[l]);for(l=0;l<g;++l)(u=e[l])&&f.get(p[l])===u&&(a[l]=u)}function gb(t){return t.__data__}function pb(t,e){if(!arguments.length)return Array.from(this,gb);var n=e?vb:fb,o=this._parents,a=this._groups;typeof t!="function"&&(t=ub(t));for(var s=a.length,i=new Array(s),l=new Array(s),u=new Array(s),f=0;f<s;++f){var g=o[f],h=a[f],p=h.length,y=hb(t.call(g,g&&g.__data__,f,o)),_=y.length,I=l[f]=new Array(_),D=i[f]=new Array(_),H=u[f]=new Array(p);n(g,h,I,D,H,y,e);for(var R=0,K=0,V,U;R<_;++R)if(V=I[R]){for(R>=K&&(K=R+1);!(U=D[K])&&++K<_;);V._next=U||null}}return i=new Jt(i,o),i._enter=l,i._exit=u,i}function hb(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function xb(){return new Jt(this._exit||this._groups.map(Il),this._parents)}function bb(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 mb(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],g=o[u],h=f.length,p=l[u]=new Array(h),y,_=0;_<h;++_)(y=f[_]||g[_])&&(p[_]=y);for(;u<a;++u)l[u]=n[u];return new Jt(l,this._parents)}function _b(){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 yb(t){t||(t=wb);function e(h,p){return h&&p?t(h.__data__,p.__data__):!h-!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,g=0;g<l;++g)(f=i[g])&&(u[g]=f);u.sort(e)}return new Jt(a,this._parents).order()}function wb(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function kb(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Cb(){return Array.from(this)}function Sb(){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 Nb(){let t=0;for(const e of this)++t;return t}function Eb(){return!this.node()}function Mb(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 zb(t){return function(){this.removeAttribute(t)}}function Tb(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Pb(t,e){return function(){this.setAttribute(t,e)}}function Ib(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ab(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Lb(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 Ob(t,e){var n=ta(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?Tb:zb:typeof e=="function"?n.local?Lb:Ab:n.local?Ib:Pb)(n,e))}function Al(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Rb(t){return function(){this.style.removeProperty(t)}}function Db(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Vb(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Hb(t,e,n){return arguments.length>1?this.each((e==null?Rb:typeof e=="function"?Vb:Db)(t,e,n??"")):pr(this.node(),t)}function pr(t,e){return t.style.getPropertyValue(e)||Al(t).getComputedStyle(t,null).getPropertyValue(e)}function qb(t){return function(){delete this[t]}}function Fb(t,e){return function(){this[t]=e}}function Kb(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Bb(t,e){return arguments.length>1?this.each((e==null?qb:typeof e=="function"?Kb:Fb)(t,e)):this.node()[t]}function Ll(t){return t.trim().split(/^|\s+/)}function ui(t){return t.classList||new Ol(t)}function Ol(t){this._node=t,this._names=Ll(t.getAttribute("class")||"")}Ol.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 Rl(t,e){for(var n=ui(t),o=-1,a=e.length;++o<a;)n.add(e[o])}function Dl(t,e){for(var n=ui(t),o=-1,a=e.length;++o<a;)n.remove(e[o])}function jb(t){return function(){Rl(this,t)}}function Ub(t){return function(){Dl(this,t)}}function Yb(t,e){return function(){(e.apply(this,arguments)?Rl:Dl)(this,t)}}function Wb(t,e){var n=Ll(t+"");if(arguments.length<2){for(var o=ui(this.node()),a=-1,s=n.length;++a<s;)if(!o.contains(n[a]))return!1;return!0}return this.each((typeof e=="function"?Yb:e?jb:Ub)(n,e))}function Xb(){this.textContent=""}function $b(t){return function(){this.textContent=t}}function Gb(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Zb(t){return arguments.length?this.each(t==null?Xb:(typeof t=="function"?Gb:$b)(t)):this.node().textContent}function Qb(){this.innerHTML=""}function Jb(t){return function(){this.innerHTML=t}}function em(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function tm(t){return arguments.length?this.each(t==null?Qb:(typeof t=="function"?em:Jb)(t)):this.node().innerHTML}function nm(){this.nextSibling&&this.parentNode.appendChild(this)}function rm(){return this.each(nm)}function om(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function am(){return this.each(om)}function im(t){var e=typeof t=="function"?t:Ml(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function sm(){return null}function lm(t,e){var n=typeof t=="function"?t:Ml(t),o=e==null?sm:typeof e=="function"?e:di(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function cm(){var t=this.parentNode;t&&t.removeChild(this)}function dm(){return this.each(cm)}function um(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function fm(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function vm(t){return this.select(t?fm:um)}function gm(t){return arguments.length?this.property("__data__",t):this.node().__data__}function pm(t){return function(e){t.call(this,e,this.__data__)}}function hm(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 xm(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 bm(t,e,n){return function(){var o=this.__on,a,s=pm(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 mm(t,e,n){var o=hm(t+""),a,s=o.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,f=l.length,g;u<f;++u)for(a=0,g=l[u];a<s;++a)if((i=o[a]).type===g.type&&i.name===g.name)return g.value}return}for(l=e?bm:xm,a=0;a<s;++a)this.each(l(o[a],e,n));return this}function Vl(t,e,n){var o=Al(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 _m(t,e){return function(){return Vl(this,t,e)}}function ym(t,e){return function(){return Vl(this,t,e.apply(this,arguments))}}function wm(t,e){return this.each((typeof e=="function"?ym:_m)(t,e))}function*km(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],a=0,s=o.length,i;a<s;++a)(i=o[a])&&(yield i)}var Hl=[null];function Jt(t,e){this._groups=t,this._parents=e}function Jr(){return new Jt([[document.documentElement]],Hl)}function Cm(){return this}Jt.prototype=Jr.prototype={constructor:Jt,select:Gx,selectAll:eb,selectChild:ob,selectChildren:lb,filter:cb,data:pb,enter:db,exit:xb,join:bb,merge:mb,selection:Cm,order:_b,sort:yb,call:kb,nodes:Cb,node:Sb,size:Nb,empty:Eb,each:Mb,attr:Ob,style:Hb,property:Bb,classed:Wb,text:Zb,html:tm,raise:rm,lower:am,append:im,insert:lm,remove:dm,clone:vm,datum:gm,on:mm,dispatch:wm,[Symbol.iterator]:km};function ln(t){return typeof t=="string"?new Jt([[document.querySelector(t)]],[document.documentElement]):new Jt([[t]],Hl)}function Sm(t){let e;for(;e=t.sourceEvent;)t=e;return t}function gn(t,e){if(t=Sm(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 Nm={passive:!1},Or={capture:!0,passive:!1};function ya(t){t.stopImmediatePropagation()}function cr(t){t.preventDefault(),t.stopImmediatePropagation()}function ql(t){var e=t.document.documentElement,n=ln(t).on("dragstart.drag",cr,Or);"onselectstart"in e?n.on("selectstart.drag",cr,Or):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Fl(t,e){var n=t.document.documentElement,o=ln(t).on("dragstart.drag",null);e&&(o.on("click.drag",cr,Or),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 po=t=>()=>t;function Ua(t,{sourceEvent:e,subject:n,target:o,identifier:a,active:s,x:i,y:l,dx:u,dy:f,dispatch:g}){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:g}})}Ua.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Em(t){return!t.ctrlKey&&!t.button}function Mm(){return this.parentNode}function zm(t,e){return e??{x:t.x,y:t.y}}function Tm(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pm(){var t=Em,e=Mm,n=zm,o=Tm,a={},s=ea("start","drag","end"),i=0,l,u,f,g,h=0;function p(V){V.on("mousedown.drag",y).filter(o).on("touchstart.drag",D).on("touchmove.drag",H,Nm).on("touchend.drag touchcancel.drag",R).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(V,U){if(!(g||!t.call(this,V,U))){var ne=K(this,e.call(this,V,U),V,U,"mouse");ne&&(ln(V.view).on("mousemove.drag",_,Or).on("mouseup.drag",I,Or),ql(V.view),ya(V),f=!1,l=V.clientX,u=V.clientY,ne("start",V))}}function _(V){if(cr(V),!f){var U=V.clientX-l,ne=V.clientY-u;f=U*U+ne*ne>h}a.mouse("drag",V)}function I(V){ln(V.view).on("mousemove.drag mouseup.drag",null),Fl(V.view,f),cr(V),a.mouse("end",V)}function D(V,U){if(t.call(this,V,U)){var ne=V.changedTouches,ue=e.call(this,V,U),re=ne.length,ae,pe;for(ae=0;ae<re;++ae)(pe=K(this,ue,V,U,ne[ae].identifier,ne[ae]))&&(ya(V),pe("start",V,ne[ae]))}}function H(V){var U=V.changedTouches,ne=U.length,ue,re;for(ue=0;ue<ne;++ue)(re=a[U[ue].identifier])&&(cr(V),re("drag",V,U[ue]))}function R(V){var U=V.changedTouches,ne=U.length,ue,re;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),ue=0;ue<ne;++ue)(re=a[U[ue].identifier])&&(ya(V),re("end",V,U[ue]))}function K(V,U,ne,ue,re,ae){var pe=s.copy(),O=gn(ae||ne,U),w,A,b;if((b=n.call(V,new Ua("beforestart",{sourceEvent:ne,target:p,identifier:re,active:i,x:O[0],y:O[1],dx:0,dy:0,dispatch:pe}),ue))!=null)return w=b.x-O[0]||0,A=b.y-O[1]||0,function N(E,L,F){var W=O,M;switch(E){case"start":a[re]=N,M=i++;break;case"end":delete a[re],--i;case"drag":O=gn(F||L,U),M=i;break}pe.call(E,V,new Ua(E,{sourceEvent:L,subject:b,target:p,identifier:re,active:M,x:O[0]+w,y:O[1]+A,dx:O[0]-W[0],dy:O[1]-W[1],dispatch:pe}),ue)}}return p.filter=function(V){return arguments.length?(t=typeof V=="function"?V:po(!!V),p):t},p.container=function(V){return arguments.length?(e=typeof V=="function"?V:po(V),p):e},p.subject=function(V){return arguments.length?(n=typeof V=="function"?V:po(V),p):n},p.touchable=function(V){return arguments.length?(o=typeof V=="function"?V:po(!!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?(h=(V=+V)*V,p):Math.sqrt(h)},p}function fi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Kl(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function eo(){}var Rr=.7,Ro=1/Rr,dr="\\s*([+-]?\\d+)\\s*",Dr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Im=/^#([0-9a-f]{3,8})$/,Am=new RegExp(`^rgb\\(${dr},${dr},${dr}\\)$`),Lm=new RegExp(`^rgb\\(${xn},${xn},${xn}\\)$`),Om=new RegExp(`^rgba\\(${dr},${dr},${dr},${Dr}\\)$`),Rm=new RegExp(`^rgba\\(${xn},${xn},${xn},${Dr}\\)$`),Dm=new RegExp(`^hsl\\(${Dr},${xn},${xn}\\)$`),Vm=new RegExp(`^hsla\\(${Dr},${xn},${xn},${Dr}\\)$`),as={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};fi(eo,Xn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:is,formatHex:is,formatHex8:Hm,formatHsl:qm,formatRgb:ss,toString:ss});function is(){return this.rgb().formatHex()}function Hm(){return this.rgb().formatHex8()}function qm(){return Bl(this).formatHsl()}function ss(){return this.rgb().formatRgb()}function Xn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Im.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ls(e):n===3?new Gt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ho(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ho(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=Am.exec(t))?new Gt(e[1],e[2],e[3],1):(e=Lm.exec(t))?new Gt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Om.exec(t))?ho(e[1],e[2],e[3],e[4]):(e=Rm.exec(t))?ho(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Dm.exec(t))?us(e[1],e[2]/100,e[3]/100,1):(e=Vm.exec(t))?us(e[1],e[2]/100,e[3]/100,e[4]):as.hasOwnProperty(t)?ls(as[t]):t==="transparent"?new Gt(NaN,NaN,NaN,0):null}function ls(t){return new Gt(t>>16&255,t>>8&255,t&255,1)}function ho(t,e,n,o){return o<=0&&(t=e=n=NaN),new Gt(t,e,n,o)}function Fm(t){return t instanceof eo||(t=Xn(t)),t?(t=t.rgb(),new Gt(t.r,t.g,t.b,t.opacity)):new Gt}function Ya(t,e,n,o){return arguments.length===1?Fm(t):new Gt(t,e,n,o??1)}function Gt(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}fi(Gt,Ya,Kl(eo,{brighter(t){return t=t==null?Ro:Math.pow(Ro,t),new Gt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Rr:Math.pow(Rr,t),new Gt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Gt(Yn(this.r),Yn(this.g),Yn(this.b),Do(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:cs,formatHex:cs,formatHex8:Km,formatRgb:ds,toString:ds}));function cs(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}`}function Km(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}${Un((isNaN(this.opacity)?1:this.opacity)*255)}`}function ds(){const t=Do(this.opacity);return`${t===1?"rgb(":"rgba("}${Yn(this.r)}, ${Yn(this.g)}, ${Yn(this.b)}${t===1?")":`, ${t})`}`}function Do(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Yn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Un(t){return t=Yn(t),(t<16?"0":"")+t.toString(16)}function us(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new cn(t,e,n,o)}function Bl(t){if(t instanceof cn)return new cn(t.h,t.s,t.l,t.opacity);if(t instanceof eo||(t=Xn(t)),!t)return new cn;if(t instanceof cn)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 cn(i,l,u,t.opacity)}function Bm(t,e,n,o){return arguments.length===1?Bl(t):new cn(t,e,n,o??1)}function cn(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}fi(cn,Bm,Kl(eo,{brighter(t){return t=t==null?Ro:Math.pow(Ro,t),new cn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Rr:Math.pow(Rr,t),new cn(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 Gt(wa(t>=240?t-240:t+120,a,o),wa(t,a,o),wa(t<120?t+240:t-120,a,o),this.opacity)},clamp(){return new cn(fs(this.h),xo(this.s),xo(this.l),Do(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=Do(this.opacity);return`${t===1?"hsl(":"hsla("}${fs(this.h)}, ${xo(this.s)*100}%, ${xo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function fs(t){return t=(t||0)%360,t<0?t+360:t}function xo(t){return Math.max(0,Math.min(1,t||0))}function wa(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 vi=t=>()=>t;function jm(t,e){return function(n){return t+n*e}}function Um(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 Ym(t){return(t=+t)==1?jl:function(e,n){return n-e?Um(e,n,t):vi(isNaN(e)?n:e)}}function jl(t,e){var n=e-t;return n?jm(t,n):vi(isNaN(t)?e:t)}const Vo=(function t(e){var n=Ym(e);function o(a,s){var i=n((a=Ya(a)).r,(s=Ya(s)).r),l=n(a.g,s.g),u=n(a.b,s.b),f=jl(a.opacity,s.opacity);return function(g){return a.r=i(g),a.g=l(g),a.b=u(g),a.opacity=f(g),a+""}}return o.gamma=t,o})(1);function Wm(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 Xm(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $m(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]=Ar(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 Gm(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function pn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Zm(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]=Ar(t[a],e[a]):o[a]=e[a];return function(s){for(a in n)o[a]=n[a](s);return o}}var Wa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ka=new RegExp(Wa.source,"g");function Qm(t){return function(){return t}}function Jm(t){return function(e){return t(e)+""}}function Ul(t,e){var n=Wa.lastIndex=ka.lastIndex=0,o,a,s,i=-1,l=[],u=[];for(t=t+"",e=e+"";(o=Wa.exec(t))&&(a=ka.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:pn(o,a)})),n=ka.lastIndex;return n<e.length&&(s=e.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?u[0]?Jm(u[0].x):Qm(e):(e=u.length,function(f){for(var g=0,h;g<e;++g)l[(h=u[g]).i]=h.x(f);return l.join("")})}function Ar(t,e){var n=typeof e,o;return e==null||n==="boolean"?vi(e):(n==="number"?pn:n==="string"?(o=Xn(e))?(e=o,Vo):Ul:e instanceof Xn?Vo:e instanceof Date?Gm:Xm(e)?Wm:Array.isArray(e)?$m:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Zm:pn)(t,e)}var vs=180/Math.PI,Xa={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yl(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)*vs,skewX:Math.atan(u)*vs,scaleX:i,scaleY:l}}var bo;function e0(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Xa:Yl(e.a,e.b,e.c,e.d,e.e,e.f)}function t0(t){return t==null||(bo||(bo=document.createElementNS("http://www.w3.org/2000/svg","g")),bo.setAttribute("transform",t),!(t=bo.transform.baseVal.consolidate()))?Xa:(t=t.matrix,Yl(t.a,t.b,t.c,t.d,t.e,t.f))}function Wl(t,e,n,o){function a(f){return f.length?f.pop()+" ":""}function s(f,g,h,p,y,_){if(f!==h||g!==p){var I=y.push("translate(",null,e,null,n);_.push({i:I-4,x:pn(f,h)},{i:I-2,x:pn(g,p)})}else(h||p)&&y.push("translate("+h+e+p+n)}function i(f,g,h,p){f!==g?(f-g>180?g+=360:g-f>180&&(f+=360),p.push({i:h.push(a(h)+"rotate(",null,o)-2,x:pn(f,g)})):g&&h.push(a(h)+"rotate("+g+o)}function l(f,g,h,p){f!==g?p.push({i:h.push(a(h)+"skewX(",null,o)-2,x:pn(f,g)}):g&&h.push(a(h)+"skewX("+g+o)}function u(f,g,h,p,y,_){if(f!==h||g!==p){var I=y.push(a(y)+"scale(",null,",",null,")");_.push({i:I-4,x:pn(f,h)},{i:I-2,x:pn(g,p)})}else(h!==1||p!==1)&&y.push(a(y)+"scale("+h+","+p+")")}return function(f,g){var h=[],p=[];return f=t(f),g=t(g),s(f.translateX,f.translateY,g.translateX,g.translateY,h,p),i(f.rotate,g.rotate,h,p),l(f.skewX,g.skewX,h,p),u(f.scaleX,f.scaleY,g.scaleX,g.scaleY,h,p),f=g=null,function(y){for(var _=-1,I=p.length,D;++_<I;)h[(D=p[_]).i]=D.x(y);return h.join("")}}}var n0=Wl(e0,"px, ","px)","deg)"),r0=Wl(t0,", ",")",")"),o0=1e-12;function gs(t){return((t=Math.exp(t))+1/t)/2}function a0(t){return((t=Math.exp(t))-1/t)/2}function i0(t){return((t=Math.exp(2*t))-1)/(t+1)}const Mo=(function t(e,n,o){function a(s,i){var l=s[0],u=s[1],f=s[2],g=i[0],h=i[1],p=i[2],y=g-l,_=h-u,I=y*y+_*_,D,H;if(I<o0)H=Math.log(p/f)/e,D=function(ue){return[l+ue*y,u+ue*_,f*Math.exp(e*ue*H)]};else{var R=Math.sqrt(I),K=(p*p-f*f+o*I)/(2*f*n*R),V=(p*p-f*f-o*I)/(2*p*n*R),U=Math.log(Math.sqrt(K*K+1)-K),ne=Math.log(Math.sqrt(V*V+1)-V);H=(ne-U)/e,D=function(ue){var re=ue*H,ae=gs(U),pe=f/(n*R)*(ae*i0(e*re+U)-a0(U));return[l+pe*y,u+pe*_,f*ae/gs(e*re+U)]}}return D.duration=H*1e3*e/Math.SQRT2,D}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 hr=0,zr=0,Er=0,Xl=1e3,Ho,Tr,qo=0,$n=0,na=0,Vr=typeof performance=="object"&&performance.now?performance:Date,$l=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function gi(){return $n||($l(s0),$n=Vr.now()+na)}function s0(){$n=0}function Fo(){this._call=this._time=this._next=null}Fo.prototype=Gl.prototype={constructor:Fo,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?gi():+n)+(e==null?0:+e),!this._next&&Tr!==this&&(Tr?Tr._next=this:Ho=this,Tr=this),this._call=t,this._time=n,$a()},stop:function(){this._call&&(this._call=null,this._time=1/0,$a())}};function Gl(t,e,n){var o=new Fo;return o.restart(t,e,n),o}function l0(){gi(),++hr;for(var t=Ho,e;t;)(e=$n-t._time)>=0&&t._call.call(void 0,e),t=t._next;--hr}function ps(){$n=(qo=Vr.now())+na,hr=zr=0;try{l0()}finally{hr=0,d0(),$n=0}}function c0(){var t=Vr.now(),e=t-qo;e>Xl&&(na-=e,qo=t)}function d0(){for(var t,e=Ho,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:Ho=n);Tr=t,$a(o)}function $a(t){if(!hr){zr&&(zr=clearTimeout(zr));var e=t-$n;e>24?(t<1/0&&(zr=setTimeout(ps,t-Vr.now()-na)),Er&&(Er=clearInterval(Er))):(Er||(qo=Vr.now(),Er=setInterval(c0,Xl)),hr=1,$l(ps))}}function hs(t,e,n){var o=new Fo;return e=e==null?0:+e,o.restart(a=>{o.stop(),t(a+e)},e,n),o}var u0=ea("start","end","cancel","interrupt"),f0=[],Zl=0,xs=1,Ga=2,zo=3,bs=4,Za=5,To=6;function ra(t,e,n,o,a,s){var i=t.__transition;if(!i)t.__transition={};else if(n in i)return;v0(t,n,{name:e,index:o,group:a,on:u0,tween:f0,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Zl})}function pi(t,e){var n=un(t,e);if(n.state>Zl)throw new Error("too late; already scheduled");return n}function yn(t,e){var n=un(t,e);if(n.state>zo)throw new Error("too late; already running");return n}function un(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function v0(t,e,n){var o=t.__transition,a;o[e]=n,n.timer=Gl(s,0,n.time);function s(f){n.state=xs,n.timer.restart(i,n.delay,n.time),n.delay<=f&&i(f-n.delay)}function i(f){var g,h,p,y;if(n.state!==xs)return u();for(g in o)if(y=o[g],y.name===n.name){if(y.state===zo)return hs(i);y.state===bs?(y.state=To,y.timer.stop(),y.on.call("interrupt",t,t.__data__,y.index,y.group),delete o[g]):+g<e&&(y.state=To,y.timer.stop(),y.on.call("cancel",t,t.__data__,y.index,y.group),delete o[g])}if(hs(function(){n.state===zo&&(n.state=bs,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=Ga,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ga){for(n.state=zo,a=new Array(p=n.tween.length),g=0,h=-1;g<p;++g)(y=n.tween[g].value.call(t,t.__data__,n.index,n.group))&&(a[++h]=y);a.length=h+1}}function l(f){for(var g=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=Za,1),h=-1,p=a.length;++h<p;)a[h].call(t,g);n.state===Za&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=To,n.timer.stop(),delete o[e];for(var f in o)return;delete t.__transition}}function Po(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>Ga&&o.state<Za,o.state=To,o.timer.stop(),o.on.call(a?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[i]}s&&delete t.__transition}}function g0(t){return this.each(function(){Po(this,t)})}function p0(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 h0(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 x0(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=un(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?p0:h0)(n,t,e))}function hi(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 un(a,o).value[e]}}function Ql(t,e){var n;return(typeof e=="number"?pn:e instanceof Xn?Vo:(n=Xn(e))?(e=n,Vo):Ul)(t,e)}function b0(t){return function(){this.removeAttribute(t)}}function m0(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _0(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 y0(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 w0(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 k0(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 C0(t,e){var n=ta(t),o=n==="transform"?r0:Ql;return this.attrTween(t,typeof e=="function"?(n.local?k0:w0)(n,o,hi(this,"attr."+t,e)):e==null?(n.local?m0:b0)(n):(n.local?y0:_0)(n,o,e))}function S0(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function N0(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function E0(t,e){var n,o;function a(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&N0(t,s)),n}return a._value=e,a}function M0(t,e){var n,o;function a(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&S0(t,s)),n}return a._value=e,a}function z0(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=ta(t);return this.tween(n,(o.local?E0:M0)(o,e))}function T0(t,e){return function(){pi(this,t).delay=+e.apply(this,arguments)}}function P0(t,e){return e=+e,function(){pi(this,t).delay=e}}function I0(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?T0:P0)(e,t)):un(this.node(),e).delay}function A0(t,e){return function(){yn(this,t).duration=+e.apply(this,arguments)}}function L0(t,e){return e=+e,function(){yn(this,t).duration=e}}function O0(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?A0:L0)(e,t)):un(this.node(),e).duration}function R0(t,e){if(typeof e!="function")throw new Error;return function(){yn(this,t).ease=e}}function D0(t){var e=this._id;return arguments.length?this.each(R0(e,t)):un(this.node(),e).ease}function V0(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;yn(this,t).ease=n}}function H0(t){if(typeof t!="function")throw new Error;return this.each(V0(this._id,t))}function q0(t){typeof t!="function"&&(t=Tl(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 Mn(o,this._parents,this._name,this._id)}function F0(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],g=u.length,h=i[l]=new Array(g),p,y=0;y<g;++y)(p=u[y]||f[y])&&(h[y]=p);for(;l<o;++l)i[l]=e[l];return new Mn(i,this._parents,this._name,this._id)}function K0(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 B0(t,e,n){var o,a,s=K0(e)?pi:yn;return function(){var i=s(this,t),l=i.on;l!==o&&(a=(o=l).copy()).on(e,n),i.on=a}}function j0(t,e){var n=this._id;return arguments.length<2?un(this.node(),n).on.on(t):this.each(B0(n,t,e))}function U0(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Y0(){return this.on("end.remove",U0(this._id))}function W0(t){var e=this._name,n=this._id;typeof t!="function"&&(t=di(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),g,h,p=0;p<u;++p)(g=l[p])&&(h=t.call(g,g.__data__,p,l))&&("__data__"in g&&(h.__data__=g.__data__),f[p]=h,ra(f[p],e,n,p,f,un(g,n)));return new Mn(s,this._parents,e,n)}function X0(t){var e=this._name,n=this._id;typeof t!="function"&&(t=zl(t));for(var o=this._groups,a=o.length,s=[],i=[],l=0;l<a;++l)for(var u=o[l],f=u.length,g,h=0;h<f;++h)if(g=u[h]){for(var p=t.call(g,g.__data__,h,u),y,_=un(g,n),I=0,D=p.length;I<D;++I)(y=p[I])&&ra(y,e,n,I,p,_);s.push(p),i.push(g)}return new Mn(s,i,e,n)}var $0=Jr.prototype.constructor;function G0(){return new $0(this._groups,this._parents)}function Z0(t,e){var n,o,a;return function(){var s=pr(this,t),i=(this.style.removeProperty(t),pr(this,t));return s===i?null:s===n&&i===o?a:a=e(n=s,o=i)}}function Jl(t){return function(){this.style.removeProperty(t)}}function Q0(t,e,n){var o,a=n+"",s;return function(){var i=pr(this,t);return i===a?null:i===o?s:s=e(o=i,n)}}function J0(t,e,n){var o,a,s;return function(){var i=pr(this,t),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),pr(this,t))),i===u?null:i===o&&u===a?s:(a=u,s=e(o=i,l))}}function e_(t,e){var n,o,a,s="style."+e,i="end."+s,l;return function(){var u=yn(this,t),f=u.on,g=u.value[s]==null?l||(l=Jl(e)):void 0;(f!==n||a!==g)&&(o=(n=f).copy()).on(i,a=g),u.on=o}}function t_(t,e,n){var o=(t+="")=="transform"?n0:Ql;return e==null?this.styleTween(t,Z0(t,o)).on("end.style."+t,Jl(t)):typeof e=="function"?this.styleTween(t,J0(t,o,hi(this,"style."+t,e))).each(e_(this._id,t)):this.styleTween(t,Q0(t,o,e),n).on("end.style."+t,null)}function n_(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function r_(t,e,n){var o,a;function s(){var i=e.apply(this,arguments);return i!==a&&(o=(a=i)&&n_(t,i,n)),o}return s._value=e,s}function o_(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,r_(t,e,n??""))}function a_(t){return function(){this.textContent=t}}function i_(t){return function(){var e=t(this);this.textContent=e??""}}function s_(t){return this.tween("text",typeof t=="function"?i_(hi(this,"text",t)):a_(t==null?"":t+""))}function l_(t){return function(e){this.textContent=t.call(this,e)}}function c_(t){var e,n;function o(){var a=t.apply(this,arguments);return a!==n&&(e=(n=a)&&l_(a)),e}return o._value=t,o}function d_(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,c_(t))}function u_(){for(var t=this._name,e=this._id,n=ec(),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 g=un(u,e);ra(u,t,n,f,i,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Mn(o,this._parents,t,n)}function f_(){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),g=f.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),f.on=e}),a===0&&s()})}var v_=0;function Mn(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function ec(){return++v_}var wn=Jr.prototype;Mn.prototype={constructor:Mn,select:W0,selectAll:X0,selectChild:wn.selectChild,selectChildren:wn.selectChildren,filter:q0,merge:F0,selection:G0,transition:u_,call:wn.call,nodes:wn.nodes,node:wn.node,size:wn.size,empty:wn.empty,each:wn.each,on:j0,attr:C0,attrTween:z0,style:t_,styleTween:o_,text:s_,textTween:d_,remove:Y0,tween:x0,delay:I0,duration:O0,ease:D0,easeVarying:H0,end:f_,[Symbol.iterator]:wn[Symbol.iterator]};function g_(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var p_={time:null,delay:0,duration:250,ease:g_};function h_(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 x_(t){var e,n;t instanceof Mn?(e=t._id,t=t._name):(e=ec(),(n=p_).time=gi(),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])&&ra(u,t,e,f,i,n||h_(u,e));return new Mn(o,this._parents,t,e)}Jr.prototype.interrupt=g0;Jr.prototype.transition=x_;const mo=t=>()=>t;function b_(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 Sn(t,e,n){this.k=t,this.x=e,this.y=n}Sn.prototype={constructor:Sn,scale:function(t){return t===1?this:new Sn(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Sn(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 oa=new Sn(1,0,0);tc.prototype=Sn.prototype;function tc(t){for(;!t.__zoom;)if(!(t=t.parentNode))return oa;return t.__zoom}function Ca(t){t.stopImmediatePropagation()}function Mr(t){t.preventDefault(),t.stopImmediatePropagation()}function m_(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function __(){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 ms(){return this.__zoom||oa}function y_(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function w_(){return navigator.maxTouchPoints||"ontouchstart"in this}function k_(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 C_(){var t=m_,e=__,n=k_,o=y_,a=w_,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Mo,f=ea("start","zoom","end"),g,h,p,y=500,_=150,I=0,D=10;function H(b){b.property("__zoom",ms).on("wheel.zoom",re,{passive:!1}).on("mousedown.zoom",ae).on("dblclick.zoom",pe).filter(a).on("touchstart.zoom",O).on("touchmove.zoom",w).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}H.transform=function(b,N,E,L){var F=b.selection?b.selection():b;F.property("__zoom",ms),b!==F?U(b,N,E,L):F.interrupt().each(function(){ne(this,arguments).event(L).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},H.scaleBy=function(b,N,E,L){H.scaleTo(b,function(){var F=this.__zoom.k,W=typeof N=="function"?N.apply(this,arguments):N;return F*W},E,L)},H.scaleTo=function(b,N,E,L){H.transform(b,function(){var F=e.apply(this,arguments),W=this.__zoom,M=E==null?V(F):typeof E=="function"?E.apply(this,arguments):E,m=W.invert(M),C=typeof N=="function"?N.apply(this,arguments):N;return n(K(R(W,C),M,m),F,i)},E,L)},H.translateBy=function(b,N,E,L){H.transform(b,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof E=="function"?E.apply(this,arguments):E),e.apply(this,arguments),i)},null,L)},H.translateTo=function(b,N,E,L,F){H.transform(b,function(){var W=e.apply(this,arguments),M=this.__zoom,m=L==null?V(W):typeof L=="function"?L.apply(this,arguments):L;return n(oa.translate(m[0],m[1]).scale(M.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof E=="function"?-E.apply(this,arguments):-E),W,i)},L,F)};function R(b,N){return N=Math.max(s[0],Math.min(s[1],N)),N===b.k?b:new Sn(N,b.x,b.y)}function K(b,N,E){var L=N[0]-E[0]*b.k,F=N[1]-E[1]*b.k;return L===b.x&&F===b.y?b:new Sn(b.k,L,F)}function V(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function U(b,N,E,L){b.on("start.zoom",function(){ne(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){ne(this,arguments).event(L).end()}).tween("zoom",function(){var F=this,W=arguments,M=ne(F,W).event(L),m=e.apply(F,W),C=E==null?V(m):typeof E=="function"?E.apply(F,W):E,P=Math.max(m[1][0]-m[0][0],m[1][1]-m[0][1]),X=F.__zoom,le=typeof N=="function"?N.apply(F,W):N,J=u(X.invert(C).concat(P/X.k),le.invert(C).concat(P/le.k));return function(Y){if(Y===1)Y=le;else{var Z=J(Y),Q=P/Z[2];Y=new Sn(Q,C[0]-Z[0]*Q,C[1]-Z[1]*Q)}M.zoom(null,Y)}})}function ne(b,N,E){return!E&&b.__zooming||new ue(b,N)}function ue(b,N){this.that=b,this.args=N,this.active=0,this.sourceEvent=null,this.extent=e.apply(b,N),this.taps=0}ue.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,N){return this.mouse&&b!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var N=ln(this.that).datum();f.call(b,this.that,new b_(b,{sourceEvent:this.sourceEvent,target:H,transform:this.that.__zoom,dispatch:f}),N)}};function re(b,...N){if(!t.apply(this,arguments))return;var E=ne(this,N).event(b),L=this.__zoom,F=Math.max(s[0],Math.min(s[1],L.k*Math.pow(2,o.apply(this,arguments)))),W=gn(b);if(E.wheel)(E.mouse[0][0]!==W[0]||E.mouse[0][1]!==W[1])&&(E.mouse[1]=L.invert(E.mouse[0]=W)),clearTimeout(E.wheel);else{if(L.k===F)return;E.mouse=[W,L.invert(W)],Po(this),E.start()}Mr(b),E.wheel=setTimeout(M,_),E.zoom("mouse",n(K(R(L,F),E.mouse[0],E.mouse[1]),E.extent,i));function M(){E.wheel=null,E.end()}}function ae(b,...N){if(p||!t.apply(this,arguments))return;var E=b.currentTarget,L=ne(this,N,!0).event(b),F=ln(b.view).on("mousemove.zoom",C,!0).on("mouseup.zoom",P,!0),W=gn(b,E),M=b.clientX,m=b.clientY;ql(b.view),Ca(b),L.mouse=[W,this.__zoom.invert(W)],Po(this),L.start();function C(X){if(Mr(X),!L.moved){var le=X.clientX-M,J=X.clientY-m;L.moved=le*le+J*J>I}L.event(X).zoom("mouse",n(K(L.that.__zoom,L.mouse[0]=gn(X,E),L.mouse[1]),L.extent,i))}function P(X){F.on("mousemove.zoom mouseup.zoom",null),Fl(X.view,L.moved),Mr(X),L.event(X).end()}}function pe(b,...N){if(t.apply(this,arguments)){var E=this.__zoom,L=gn(b.changedTouches?b.changedTouches[0]:b,this),F=E.invert(L),W=E.k*(b.shiftKey?.5:2),M=n(K(R(E,W),L,F),e.apply(this,N),i);Mr(b),l>0?ln(this).transition().duration(l).call(U,M,L,b):ln(this).call(H.transform,M,L,b)}}function O(b,...N){if(t.apply(this,arguments)){var E=b.touches,L=E.length,F=ne(this,N,b.changedTouches.length===L).event(b),W,M,m,C;for(Ca(b),M=0;M<L;++M)m=E[M],C=gn(m,this),C=[C,this.__zoom.invert(C),m.identifier],F.touch0?!F.touch1&&F.touch0[2]!==C[2]&&(F.touch1=C,F.taps=0):(F.touch0=C,W=!0,F.taps=1+!!g);g&&(g=clearTimeout(g)),W&&(F.taps<2&&(h=C[0],g=setTimeout(function(){g=null},y)),Po(this),F.start())}}function w(b,...N){if(this.__zooming){var E=ne(this,N).event(b),L=b.changedTouches,F=L.length,W,M,m,C;for(Mr(b),W=0;W<F;++W)M=L[W],m=gn(M,this),E.touch0&&E.touch0[2]===M.identifier?E.touch0[0]=m:E.touch1&&E.touch1[2]===M.identifier&&(E.touch1[0]=m);if(M=E.that.__zoom,E.touch1){var P=E.touch0[0],X=E.touch0[1],le=E.touch1[0],J=E.touch1[1],Y=(Y=le[0]-P[0])*Y+(Y=le[1]-P[1])*Y,Z=(Z=J[0]-X[0])*Z+(Z=J[1]-X[1])*Z;M=R(M,Math.sqrt(Y/Z)),m=[(P[0]+le[0])/2,(P[1]+le[1])/2],C=[(X[0]+J[0])/2,(X[1]+J[1])/2]}else if(E.touch0)m=E.touch0[0],C=E.touch0[1];else return;E.zoom("touch",n(K(M,m,C),E.extent,i))}}function A(b,...N){if(this.__zooming){var E=ne(this,N).event(b),L=b.changedTouches,F=L.length,W,M;for(Ca(b),p&&clearTimeout(p),p=setTimeout(function(){p=null},y),W=0;W<F;++W)M=L[W],E.touch0&&E.touch0[2]===M.identifier?delete E.touch0:E.touch1&&E.touch1[2]===M.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(M=gn(M,this),Math.hypot(h[0]-M[0],h[1]-M[1])<D)){var m=ln(this).on("dblclick.zoom");m&&m.apply(this,arguments)}}}return H.wheelDelta=function(b){return arguments.length?(o=typeof b=="function"?b:mo(+b),H):o},H.filter=function(b){return arguments.length?(t=typeof b=="function"?b:mo(!!b),H):t},H.touchable=function(b){return arguments.length?(a=typeof b=="function"?b:mo(!!b),H):a},H.extent=function(b){return arguments.length?(e=typeof b=="function"?b:mo([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),H):e},H.scaleExtent=function(b){return arguments.length?(s[0]=+b[0],s[1]=+b[1],H):[s[0],s[1]]},H.translateExtent=function(b){return arguments.length?(i[0][0]=+b[0][0],i[1][0]=+b[1][0],i[0][1]=+b[0][1],i[1][1]=+b[1][1],H):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},H.constrain=function(b){return arguments.length?(n=b,H):n},H.duration=function(b){return arguments.length?(l=+b,H):l},H.interpolate=function(b){return arguments.length?(u=b,H):u},H.on=function(){var b=f.on.apply(f,arguments);return b===f?H:b},H.clickDistance=function(b){return arguments.length?(I=(b=+b)*b,H):Math.sqrt(I)},H.tapDistance=function(b){return arguments.length?(D=+b,H):D},H}const Hr={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."},Qa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nc=["Enter"," ","Escape"],S_={"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 xr;(function(t){t.Strict="strict",t.Loose="loose"})(xr||(xr={}));var ur;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(ur||(ur={}));var Ko;(function(t){t.Partial="partial",t.Full="full"})(Ko||(Ko={}));const Ja={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var In;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(In||(In={}));var Bo;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Bo||(Bo={}));var ft;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(ft||(ft={}));const _s={[ft.Left]:ft.Right,[ft.Right]:ft.Left,[ft.Top]:ft.Bottom,[ft.Bottom]:ft.Top};function N_(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 ys(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 E_(t){return t===null?null:t?"valid":"invalid"}const rc=t=>"id"in t&&"source"in t&&"target"in t,M_=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),xi=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),to=(t,e=[0,0])=>{const{width:n,height:o}=Jn(t),a=t.origin??e,s=n*a[0],i=o*a[1];return{x:t.position.x-s,y:t.position.y-i}},z_=(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):xi(a)?a:e.nodeLookup.get(a.id));const l=i?jo(i,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ia(o,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return sa(n)},aa=(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=ia(n,jo(a)),o=!0)}),o?sa(n):{x:0,y:0,width:0,height:0}},bi=(t,e,[n,o,a]=[0,0,1],s=!1,i=!1)=>{const l={...ro(e,[n,o,a]),width:e.width/a,height:e.height/a},u=[];for(const f of t.values()){const{measured:g,selectable:h=!0,hidden:p=!1}=f;if(i&&!h||p)continue;const y=g.width??f.width??f.initialWidth??null,_=g.height??f.height??f.initialHeight??null,I=qr(l,mr(f)),D=(y??0)*(_??0),H=s&&I>0;(!f.internals.handleBounds||H||I>=D||f.dragging)&&u.push(f)}return u},T_=(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 P_(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 I_({nodes:t,width:e,height:n,panZoom:o,minZoom:a,maxZoom:s},i){if(t.size===0)return Promise.resolve(!0);const l=P_(t,i),u=aa(l),f=mi(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 oc({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},g=i.origin??o;let h=i.extent||a;if(i.extent==="parent"&&!i.expandParent)if(!l)s==null||s("005",Hr.error005());else{const y=l.measured.width,_=l.measured.height;y&&_&&(h=[[u,f],[u+y,f+_]])}else l&&_r(i.extent)&&(h=[[i.extent[0][0]+u,i.extent[0][1]+f],[i.extent[1][0]+u,i.extent[1][1]+f]]);const p=_r(h)?Gn(e,h,i.measured):e;return(i.measured.width===void 0||i.measured.height===void 0)&&(s==null||s("015",Hr.error015())),{position:{x:p.x-u+(i.measured.width??0)*g[0],y:p.y-f+(i.measured.height??0)*g[1]},positionAbsolute:p}}async function A_({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 y=s.has(p.id),_=!y&&p.parentId&&i.find(I=>I.id===p.parentId);(y||_)&&i.push(p)}const l=new Set(e.map(p=>p.id)),u=o.filter(p=>p.deletable!==!1),g=T_(i,u);for(const p of u)l.has(p.id)&&!g.find(_=>_.id===p.id)&&g.push(p);if(!a)return{edges:g,nodes:i};const h=await a({nodes:i,edges:g});return typeof h=="boolean"?h?{edges:g,nodes:i}:{edges:[],nodes:[]}:h}const br=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Gn=(t={x:0,y:0},e,n)=>({x:br(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:br(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function ac(t,e,n){const{width:o,height:a}=Jn(n),{x:s,y:i}=n.internals.positionAbsolute;return Gn(t,[[s,i],[s+o,i+a]],e)}const ws=(t,e,n)=>t<e?br(Math.abs(t-e),1,e)/e:t>n?-br(Math.abs(t-n),1,e)/e:0,ic=(t,e,n=15,o=40)=>{const a=ws(t.x,o,e.width-o)*n,s=ws(t.y,o,e.height-o)*n;return[a,s]},ia=(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)}),ei=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),sa=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),mr=(t,e=[0,0])=>{var a,s;const{x:n,y:o}=xi(t)?t.internals.positionAbsolute:to(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}},jo=(t,e=[0,0])=>{var a,s;const{x:n,y:o}=xi(t)?t.internals.positionAbsolute:to(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)}},L_=(t,e)=>sa(ia(ei(t),ei(e))),qr=(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)},ks=t=>Nn(t.width)&&Nn(t.height)&&Nn(t.x)&&Nn(t.y),Nn=t=>!isNaN(t)&&isFinite(t),O_=(t,e)=>{},no=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),ro=({x:t,y:e},[n,o,a],s=!1,i=[1,1])=>{const l={x:(t-n)/a,y:(e-o)/a};return s?no(l,i):l},Uo=({x:t,y:e},[n,o,a])=>({x:t*a+n,y:e*a+o});function ar(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 R_(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=ar(t,n),a=ar(t,e);return{top:o,right:a,bottom:o,left:a,x:a*2,y:o*2}}if(typeof t=="object"){const o=ar(t.top??t.y??0,n),a=ar(t.bottom??t.y??0,n),s=ar(t.left??t.x??0,e),i=ar(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 D_(t,e,n,o,a,s){const{x:i,y:l}=Uo(t,[e,n,o]),{x:u,y:f}=Uo({x:t.x+t.width,y:t.y+t.height},[e,n,o]),g=a-u,h=s-f;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(g),bottom:Math.floor(h)}}const mi=(t,e,n,o,a,s)=>{const i=R_(s,e,n),l=(e-i.x)/t.width,u=(n-i.y)/t.height,f=Math.min(l,u),g=br(f,o,a),h=t.x+t.width/2,p=t.y+t.height/2,y=e/2-h*g,_=n/2-p*g,I=D_(t,y,_,g,e,n),D={left:Math.min(I.left-i.left,0),top:Math.min(I.top-i.top,0),right:Math.min(I.right-i.right,0),bottom:Math.min(I.bottom-i.bottom,0)};return{x:y-D.left+D.right,y:_-D.top+D.bottom,zoom:g}},Yo=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function _r(t){return t!=null&&t!=="parent"}function Jn(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 V_(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 H_(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 q_(t){return{...S_,...t||{}}}function Sa(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:a}){const{x:s,y:i}=dn(t),l=ro({x:s-((a==null?void 0:a.left)??0),y:i-((a==null?void 0:a.top)??0)},o),{x:u,y:f}=n?no(l,e):l;return{xSnapped:u,ySnapped:f,...l}}const sc=t=>({width:t.offsetWidth,height:t.offsetHeight}),lc=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},F_=["INPUT","SELECT","TEXTAREA"];function cc(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:F_.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const dc=t=>"clientX"in t,dn=(t,e)=>{var s,i;const n=dc(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)}},Cs=(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,...sc(i)}})};function K_({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,g=Math.abs(u-t),h=Math.abs(f-e);return[u,f,g,h]}function _o(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function Ss({pos:t,x1:e,y1:n,x2:o,y2:a,c:s}){switch(t){case ft.Left:return[e-_o(e-o,s),n];case ft.Right:return[e+_o(o-e,s),n];case ft.Top:return[e,n-_o(n-a,s)];case ft.Bottom:return[e,n+_o(a-n,s)]}}function uc({sourceX:t,sourceY:e,sourcePosition:n=ft.Bottom,targetX:o,targetY:a,targetPosition:s=ft.Top,curvature:i=.25}){const[l,u]=Ss({pos:n,x1:t,y1:e,x2:o,y2:a,c:i}),[f,g]=Ss({pos:s,x1:o,y1:a,x2:t,y2:e,c:i}),[h,p,y,_]=K_({sourceX:t,sourceY:e,targetX:o,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:f,targetControlY:g});return[`M${t},${e} C${l},${u} ${f},${g} ${o},${a}`,h,p,y,_]}function fc({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 B_({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 j_({sourceNode:t,targetNode:e,width:n,height:o,transform:a}){const s=ia(jo(t),jo(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 qr(i,sa(s))>0}const U_=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,Y_=(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)),W_=(t,e,n={})=>{if(!t.source||!t.target)return e;const o=n.getEdgeId||U_;let a;return rc(t)?a={...t}:a={...t,id:o(t)},Y_(a,e)?e:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,e.concat(a))};function vc({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[a,s,i,l]=fc({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,a,s,i,l]}const Ns={[ft.Left]:{x:-1,y:0},[ft.Right]:{x:1,y:0},[ft.Top]:{x:0,y:-1},[ft.Bottom]:{x:0,y:1}},X_=({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},Es=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function $_({source:t,sourcePosition:e=ft.Bottom,target:n,targetPosition:o=ft.Top,center:a,offset:s,stepPosition:i}){const l=Ns[e],u=Ns[o],f={x:t.x+l.x*s,y:t.y+l.y*s},g={x:n.x+u.x*s,y:n.y+u.y*s},h=X_({source:f,sourcePosition:e,target:g}),p=h.x!==0?"x":"y",y=h[p];let _=[],I,D;const H={x:0,y:0},R={x:0,y:0},[,,K,V]=fc({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(l[p]*u[p]===-1){p==="x"?(I=a.x??f.x+(g.x-f.x)*i,D=a.y??(f.y+g.y)/2):(I=a.x??(f.x+g.x)/2,D=a.y??f.y+(g.y-f.y)*i);const re=[{x:I,y:f.y},{x:I,y:g.y}],ae=[{x:f.x,y:D},{x:g.x,y:D}];l[p]===y?_=p==="x"?re:ae:_=p==="x"?ae:re}else{const re=[{x:f.x,y:g.y}],ae=[{x:g.x,y:f.y}];if(p==="x"?_=l.x===y?ae:re:_=l.y===y?re:ae,e===o){const b=Math.abs(t[p]-n[p]);if(b<=s){const N=Math.min(s-1,s-b);l[p]===y?H[p]=(f[p]>t[p]?-1:1)*N:R[p]=(g[p]>n[p]?-1:1)*N}}if(e!==o){const b=p==="x"?"y":"x",N=l[p]===u[b],E=f[b]>g[b],L=f[b]<g[b];(l[p]===1&&(!N&&E||N&&L)||l[p]!==1&&(!N&&L||N&&E))&&(_=p==="x"?re:ae)}const pe={x:f.x+H.x,y:f.y+H.y},O={x:g.x+R.x,y:g.y+R.y},w=Math.max(Math.abs(pe.x-_[0].x),Math.abs(O.x-_[0].x)),A=Math.max(Math.abs(pe.y-_[0].y),Math.abs(O.y-_[0].y));w>=A?(I=(pe.x+O.x)/2,D=_[0].y):(I=_[0].x,D=(pe.y+O.y)/2)}const U={x:f.x+H.x,y:f.y+H.y},ne={x:g.x+R.x,y:g.y+R.y};return[[t,...U.x!==_[0].x||U.y!==_[0].y?[U]:[],..._,...ne.x!==_[_.length-1].x||ne.y!==_[_.length-1].y?[ne]:[],n],I,D,K,V]}function G_(t,e,n,o){const a=Math.min(Es(t,e)/2,Es(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,g=t.y<n.y?1:-1;return`L ${s+a*f},${i}Q ${s},${i} ${s},${i+a*g}`}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 _i({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:g=.5}){const[h,p,y,_,I]=$_({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:a},targetPosition:s,center:{x:l,y:u},offset:f,stepPosition:g});let D=`M${h[0].x} ${h[0].y}`;for(let H=1;H<h.length-1;H++)D+=G_(h[H-1],h[H],h[H+1],i);return D+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[D,p,y,_,I]}function Ms(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Z_(t){var h;const{sourceNode:e,targetNode:n}=t;if(!Ms(e)||!Ms(n))return null;const o=e.internals.handleBounds||zs(e.handles),a=n.internals.handleBounds||zs(n.handles),s=Ts((o==null?void 0:o.source)??[],t.sourceHandle),i=Ts(t.connectionMode===xr.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(h=t.onError)==null||h.call(t,"008",Hr.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=Zn(e,s,l),g=Zn(n,i,u);return{sourceX:f.x,sourceY:f.y,targetX:g.x,targetY:g.y,sourcePosition:l,targetPosition:u}}function zs(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 Zn(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??Jn(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 Ts(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function ti(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function Q_(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=ti(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 gc=1e3,J_=10,yi={nodeOrigin:[0,0],nodeExtent:Qa,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},ey={...yi,checkEquality:!0};function wi(t,e){const n={...t};for(const o in e)e[o]!==void 0&&(n[o]=e[o]);return n}function ty(t,e,n){const o=wi(yi,n);for(const a of t.values())if(a.parentId)Ci(a,t,e,o);else{const s=to(a,o.nodeOrigin),i=_r(a.extent)?a.extent:o.nodeExtent,l=Gn(s,i,Jn(a));a.internals.positionAbsolute=l}}function ny(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 ki(t){return t==="manual"}function ry(t,e,n,o={}){var g,h;const a=wi(ey,o),s={i:0},i=new Map(e),l=a!=null&&a.elevateNodesOnSelect&&!ki(a.zIndexMode)?gc:0;let u=t.length>0,f=!1;e.clear(),n.clear();for(const p of t){let y=i.get(p.id);if(a.checkEquality&&p===(y==null?void 0:y.internals.userNode))e.set(p.id,y);else{const _=to(p,a.nodeOrigin),I=_r(p.extent)?p.extent:a.nodeExtent,D=Gn(_,I,Jn(p));y={...a.defaults,...p,measured:{width:(g=p.measured)==null?void 0:g.width,height:(h=p.measured)==null?void 0:h.height},internals:{positionAbsolute:D,handleBounds:ny(p,y),z:pc(p,l,a.zIndexMode),userNode:p}},e.set(p.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(u=!1),p.parentId&&Ci(y,e,n,o,s),f||(f=p.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:f}}function oy(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 Ci(t,e,n,o,a){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:l,zIndexMode:u}=wi(yi,o),f=t.parentId,g=e.get(f);if(!g){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}oy(t,n),a&&!g.parentId&&g.internals.rootParentIndex===void 0&&u==="auto"&&(g.internals.rootParentIndex=++a.i,g.internals.z=g.internals.z+a.i*J_),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const h=s&&!ki(u)?gc:0,{x:p,y,z:_}=ay(t,g,i,l,h,u),{positionAbsolute:I}=t.internals,D=p!==I.x||y!==I.y;(D||_!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:D?{x:p,y}:I,z:_}})}function pc(t,e,n){const o=Nn(t.zIndex)?t.zIndex:0;return ki(n)?o:o+(t.selected?e:0)}function ay(t,e,n,o,a,s){const{x:i,y:l}=e.internals.positionAbsolute,u=Jn(t),f=to(t,n),g=_r(t.extent)?Gn(f,t.extent,u):f;let h=Gn({x:i+g.x,y:l+g.y},o,u);t.extent==="parent"&&(h=ac(h,u,e));const p=pc(t,a,s),y=e.internals.z??0;return{x:h.x,y:h.y,z:y>=p?y+1:p}}function iy(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)??mr(u),g=L_(f,l.rect);s.set(l.parentId,{expandedRect:g,parent:u})}return s.size>0&&s.forEach(({expandedRect:l,parent:u},f)=>{var K;const g=u.internals.positionAbsolute,h=Jn(u),p=u.origin??o,y=l.x<g.x?Math.round(Math.abs(g.x-l.x)):0,_=l.y<g.y?Math.round(Math.abs(g.y-l.y)):0,I=Math.max(h.width,Math.round(l.width)),D=Math.max(h.height,Math.round(l.height)),H=(I-h.width)*p[0],R=(D-h.height)*p[1];(y>0||_>0||H||R)&&(a.push({id:f,type:"position",position:{x:u.position.x-y+H,y:u.position.y-_+R}}),(K=n.get(f))==null||K.forEach(V=>{t.some(U=>U.id===V.id)||a.push({id:V.id,type:"position",position:{x:V.position.x+y,y:V.position.y+_}})})),(h.width<l.width||h.height<l.height||y||_)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:I+(y?p[0]*y-H:0),height:D+(_?p[1]*_-R:0)}})}),a}function sy(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=[],g=window.getComputedStyle(l),{m22:h}=new window.DOMMatrixReadOnly(g.transform),p=[];for(const y of t.values()){const _=e.get(y.id);if(!_)continue;if(_.hidden){e.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),u=!0;continue}const I=sc(y.nodeElement),D=_.measured.width!==I.width||_.measured.height!==I.height;if(!!(I.width&&I.height&&(D||!_.internals.handleBounds||y.force))){const R=y.nodeElement.getBoundingClientRect(),K=_r(_.extent)?_.extent:s;let{positionAbsolute:V}=_.internals;_.parentId&&_.extent==="parent"?V=ac(V,I,e.get(_.parentId)):K&&(V=Gn(V,K,I));const U={..._,measured:I,internals:{..._.internals,positionAbsolute:V,handleBounds:{source:Cs("source",y.nodeElement,R,h,_.id),target:Cs("target",y.nodeElement,R,h,_.id)}}};e.set(_.id,U),_.parentId&&Ci(U,e,n,{nodeOrigin:a,zIndexMode:i}),u=!0,D&&(f.push({id:_.id,type:"dimensions",dimensions:I}),_.expandParent&&_.parentId&&p.push({id:_.id,parentId:_.parentId,rect:mr(U,a)}))}}if(p.length>0){const y=iy(p,e,n,a);f.push(...y)}return{changes:f,updatedInternals:u}}async function ly({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 Ps(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 cy(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}`,g=`${s}-${l}--${a}-${i}`;Ps("source",u,g,t,a,i),Ps("target",u,f,t,s,l),e.set(o.id,o)}}function hc(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:hc(n,e):!1}function Is(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 dy(t,e,n,o){const a=new Map;for(const[s,i]of t)if((i.selected||i.id===o)&&(!i.parentId||!hc(i,t))&&(i.draggable||e&&typeof i.draggable>"u")){const l=t.get(s);l&&a.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return a}function Na({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){var i,l,u;const a=[];for(const[f,g]of e){const h=(i=n.get(f))==null?void 0:i.internals.userNode;h&&a.push({...h,position:g.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 uy({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=no(s,e);return{x:i.x-s.x,y:i.y-s.y}}function fy({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},g=null,h=!1,p=null,y=!1,_=!1,I=null;function D({noDragClassName:R,handleSelector:K,domNode:V,isSelectable:U,nodeId:ne,nodeClickDistance:ue=0}){p=ln(V);function re({x:w,y:A}){const{nodeLookup:b,nodeExtent:N,snapGrid:E,snapToGrid:L,nodeOrigin:F,onNodeDrag:W,onSelectionDrag:M,onError:m,updateNodePositions:C}=e();s={x:w,y:A};let P=!1;const X=l.size>1,le=X&&N?ei(aa(l)):null,J=X&&L?uy({dragItems:l,snapGrid:E,x:w,y:A}):null;for(const[Y,Z]of l){if(!b.has(Y))continue;let Q={x:w-Z.distance.x,y:A-Z.distance.y};L&&(Q=J?{x:Math.round(Q.x+J.x),y:Math.round(Q.y+J.y)}:no(Q,E));let se=null;if(X&&N&&!Z.extent&&le){const{positionAbsolute:ee}=Z.internals,oe=ee.x-le.x+N[0][0],te=ee.x+Z.measured.width-le.x2+N[1][0],ge=ee.y-le.y+N[0][1],xe=ee.y+Z.measured.height-le.y2+N[1][1];se=[[oe,ge],[te,xe]]}const{position:B,positionAbsolute:q}=oc({nodeId:Y,nextPosition:Q,nodeLookup:b,nodeExtent:se||N,nodeOrigin:F,onError:m});P=P||Z.position.x!==B.x||Z.position.y!==B.y,Z.position=B,Z.internals.positionAbsolute=q}if(_=_||P,!!P&&(C(l,!0),I&&(o||W||!ne&&M))){const[Y,Z]=Na({nodeId:ne,dragItems:l,nodeLookup:b});o==null||o(I,l,Y,Z),W==null||W(I,Y,Z),ne||M==null||M(I,Z)}}async function ae(){if(!g)return;const{transform:w,panBy:A,autoPanSpeed:b,autoPanOnNodeDrag:N}=e();if(!N){u=!1,cancelAnimationFrame(i);return}const[E,L]=ic(f,g,b);(E!==0||L!==0)&&(s.x=(s.x??0)-E/w[2],s.y=(s.y??0)-L/w[2],await A({x:E,y:L})&&re(s)),i=requestAnimationFrame(ae)}function pe(w){var X;const{nodeLookup:A,multiSelectionActive:b,nodesDraggable:N,transform:E,snapGrid:L,snapToGrid:F,selectNodesOnDrag:W,onNodeDragStart:M,onSelectionDragStart:m,unselectNodesAndEdges:C}=e();h=!0,(!W||!U)&&!b&&ne&&((X=A.get(ne))!=null&&X.selected||C()),U&&W&&ne&&(t==null||t(ne));const P=Sa(w.sourceEvent,{transform:E,snapGrid:L,snapToGrid:F,containerBounds:g});if(s=P,l=dy(A,N,P,ne),l.size>0&&(n||M||!ne&&m)){const[le,J]=Na({nodeId:ne,dragItems:l,nodeLookup:A});n==null||n(w.sourceEvent,l,le,J),M==null||M(w.sourceEvent,le,J),ne||m==null||m(w.sourceEvent,J)}}const O=Pm().clickDistance(ue).on("start",w=>{const{domNode:A,nodeDragThreshold:b,transform:N,snapGrid:E,snapToGrid:L}=e();g=(A==null?void 0:A.getBoundingClientRect())||null,y=!1,_=!1,I=w.sourceEvent,b===0&&pe(w),s=Sa(w.sourceEvent,{transform:N,snapGrid:E,snapToGrid:L,containerBounds:g}),f=dn(w.sourceEvent,g)}).on("drag",w=>{const{autoPanOnNodeDrag:A,transform:b,snapGrid:N,snapToGrid:E,nodeDragThreshold:L,nodeLookup:F}=e(),W=Sa(w.sourceEvent,{transform:b,snapGrid:N,snapToGrid:E,containerBounds:g});if(I=w.sourceEvent,(w.sourceEvent.type==="touchmove"&&w.sourceEvent.touches.length>1||ne&&!F.has(ne))&&(y=!0),!y){if(!u&&A&&h&&(u=!0,ae()),!h){const M=dn(w.sourceEvent,g),m=M.x-f.x,C=M.y-f.y;Math.sqrt(m*m+C*C)>L&&pe(w)}(s.x!==W.xSnapped||s.y!==W.ySnapped)&&l&&h&&(f=dn(w.sourceEvent,g),re(W))}}).on("end",w=>{if(!(!h||y)&&(u=!1,h=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:A,updateNodePositions:b,onNodeDragStop:N,onSelectionDragStop:E}=e();if(_&&(b(l,!1),_=!1),a||N||!ne&&E){const[L,F]=Na({nodeId:ne,dragItems:l,nodeLookup:A,dragging:!1});a==null||a(w.sourceEvent,l,L,F),N==null||N(w.sourceEvent,L,F),ne||E==null||E(w.sourceEvent,F)}}}).filter(w=>{const A=w.target;return!w.button&&(!R||!Is(A,`.${R}`,V))&&(!K||Is(A,K,V))});p.call(O)}function H(){p==null||p.on(".drag",null)}return{update:D,destroy:H}}function vy(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())qr(a,mr(s))>0&&o.push(s);return o}const gy=250;function py(t,e,n,o){var l,u;let a=[],s=1/0;const i=vy(t,n,e+gy);for(const f of i){const g=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((u=f.internals.handleBounds)==null?void 0:u.target)??[]];for(const h of g){if(o.nodeId===h.nodeId&&o.type===h.type&&o.id===h.id)continue;const{x:p,y}=Zn(f,h,h.position,!0),_=Math.sqrt(Math.pow(p-t.x,2)+Math.pow(y-t.y,2));_>e||(_<s?(a=[{...h,x:p,y}],s=_):_===s&&a.push({...h,x:p,y}))}}if(!a.length)return null;if(a.length>1){const f=o.type==="source"?"target":"source";return a.find(g=>g.type===f)??a[0]}return a[0]}function xc(t,e,n,o,a,s=!1){var f,g,h;const i=o.get(t);if(!i)return null;const l=a==="strict"?(f=i.internals.handleBounds)==null?void 0:f[e]:[...((g=i.internals.handleBounds)==null?void 0:g.source)??[],...((h=i.internals.handleBounds)==null?void 0:h.target)??[]],u=(n?l==null?void 0:l.find(p=>p.id===n):l==null?void 0:l[0])??null;return u&&s?{...u,...Zn(i,u,u.position,!0)}:u}function bc(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function hy(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const mc=()=>!0;function xy(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:a,edgeUpdaterType:s,isTarget:i,domNode:l,nodeLookup:u,lib:f,autoPanOnConnect:g,flowId:h,panBy:p,cancelConnection:y,onConnectStart:_,onConnect:I,onConnectEnd:D,isValidConnection:H=mc,onReconnectEnd:R,updateConnection:K,getTransform:V,getFromHandle:U,autoPanSpeed:ne,dragThreshold:ue=1,handleDomNode:re}){const ae=lc(t.target);let pe=0,O;const{x:w,y:A}=dn(t),b=bc(s,re),N=l==null?void 0:l.getBoundingClientRect();let E=!1;if(!N||!b)return;const L=xc(a,b,o,u,e);if(!L)return;let F=dn(t,N),W=!1,M=null,m=!1,C=null;function P(){if(!g||!N)return;const[B,q]=ic(F,N,ne);p({x:B,y:q}),pe=requestAnimationFrame(P)}const X={...L,nodeId:a,type:b,position:L.position},le=u.get(a);let Y={inProgress:!0,isValid:null,from:Zn(le,X,ft.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:le,to:F,toHandle:null,toPosition:_s[X.position],toNode:null,pointer:F};function Z(){E=!0,K(Y),_==null||_(t,{nodeId:a,handleId:o,handleType:b})}ue===0&&Z();function Q(B){if(!E){const{x:xe,y:_e}=dn(B),ze=xe-w,be=_e-A;if(!(ze*ze+be*be>ue*ue))return;Z()}if(!U()||!X){se(B);return}const q=V();F=dn(B,N),O=py(ro(F,q,!1,[1,1]),n,u,X),W||(P(),W=!0);const ee=_c(B,{handle:O,connectionMode:e,fromNodeId:a,fromHandleId:o,fromType:i?"target":"source",isValidConnection:H,doc:ae,lib:f,flowId:h,nodeLookup:u});C=ee.handleDomNode,M=ee.connection,m=hy(!!O,ee.isValid);const oe=u.get(a),te=oe?Zn(oe,X,ft.Left,!0):Y.from,ge={...Y,from:te,isValid:m,to:ee.toHandle&&m?Uo({x:ee.toHandle.x,y:ee.toHandle.y},q):F,toHandle:ee.toHandle,toPosition:m&&ee.toHandle?ee.toHandle.position:_s[X.position],toNode:ee.toHandle?u.get(ee.toHandle.nodeId):null,pointer:F};K(ge),Y=ge}function se(B){if(!("touches"in B&&B.touches.length>0)){if(E){(O||C)&&M&&m&&(I==null||I(M));const{inProgress:q,...ee}=Y,oe={...ee,toPosition:Y.toHandle?Y.toPosition:null};D==null||D(B,oe),s&&(R==null||R(B,oe))}y(),cancelAnimationFrame(pe),W=!1,m=!1,M=null,C=null,ae.removeEventListener("mousemove",Q),ae.removeEventListener("mouseup",se),ae.removeEventListener("touchmove",Q),ae.removeEventListener("touchend",se)}}ae.addEventListener("mousemove",Q),ae.addEventListener("mouseup",se),ae.addEventListener("touchmove",Q),ae.addEventListener("touchend",se)}function _c(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:s,doc:i,lib:l,flowId:u,isValidConnection:f=mc,nodeLookup:g}){const h=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:y,y:_}=dn(t),I=i.elementFromPoint(y,_),D=I!=null&&I.classList.contains(`${l}-flow__handle`)?I:p,H={handleDomNode:D,isValid:!1,connection:null,toHandle:null};if(D){const R=bc(void 0,D),K=D.getAttribute("data-nodeid"),V=D.getAttribute("data-handleid"),U=D.classList.contains("connectable"),ne=D.classList.contains("connectableend");if(!K||!R)return H;const ue={source:h?K:o,sourceHandle:h?V:a,target:h?o:K,targetHandle:h?a:V};H.connection=ue;const ae=U&&ne&&(n===xr.Strict?h&&R==="source"||!h&&R==="target":K!==o||V!==a);H.isValid=ae&&f(ue),H.toHandle=xc(K,R,V,g,n,!0)}return H}const As={onPointerDown:xy,isValid:_c},la=t=>({x:t.x,y:t.y,zoom:t.k}),Ea=({x:t,y:e,zoom:n})=>oa.translate(t,e).scale(n),sr=(t,e)=>t.target.closest(`.${e}`),yc=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),by=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Ma=(t,e=0,n=by,o=()=>{})=>{const a=typeof e=="number"&&e>0;return a||o(),a?t.transition().duration(e).ease(n).on("end",o):t},wc=t=>{const e=t.ctrlKey&&Yo()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function my({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:a,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:f}){return g=>{if(sr(g,e))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(g.ctrlKey&&i){const D=gn(g),H=wc(g),R=h*Math.pow(2,H);o.scaleTo(n,R,D,g);return}const p=g.deltaMode===1?20:1;let y=a===ur.Vertical?0:g.deltaX*p,_=a===ur.Horizontal?0:g.deltaY*p;!Yo()&&g.shiftKey&&a!==ur.Vertical&&(y=g.deltaY*p,_=0),o.translateBy(n,-(y/h)*s,-(_/h)*s,{internal:!0});const I=la(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(u==null||u(g,I),t.panScrollTimeout=setTimeout(()=>{f==null||f(g,I),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,l==null||l(g,I))}}function _y({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,a){const s=o.type==="wheel",i=!e&&s&&!o.ctrlKey,l=sr(o,t);if(o.ctrlKey&&s&&l&&o.preventDefault(),i||l)return null;o.preventDefault(),n.call(this,o,a)}}function yy({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{var s,i,l;if((s=o.sourceEvent)!=null&&s.internal)return;const a=la(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 wy({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:a}){return s=>{var i,l;t.usedRightMouseButton=!!(n&&yc(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,la(s.transform)))}}function ky({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&&yc(e,t.mouseButton??0)&&!t.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),t.usedRightMouseButton=!1,o(!1),a)){const u=la(i.transform);t.prevViewport=u,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a==null||a(i.sourceEvent,u)},n?150:0)}}}function Cy({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:a,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:l,noPanClassName:u,lib:f,connectionInProgress:g}){return h=>{var D;const p=t||e,y=n&&h.ctrlKey,_=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(sr(h,`${f}-flow__node`)||sr(h,`${f}-flow__edge`)))return!0;if(!o&&!p&&!a&&!s&&!n||i||g&&!_||sr(h,l)&&_||sr(h,u)&&(!_||a&&_&&!t)||!n&&h.ctrlKey&&_)return!1;if(!n&&h.type==="touchstart"&&((D=h.touches)==null?void 0:D.length)>1)return h.preventDefault(),!1;if(!p&&!a&&!y&&_||!o&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(o)&&!o.includes(h.button)&&h.type==="mousedown")return!1;const I=Array.isArray(o)&&o.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||_)&&I}}function Sy({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},g=t.getBoundingClientRect(),h=C_().scaleExtent([e,n]).translateExtent(o),p=ln(t).call(h);R({x:a.x,y:a.y,zoom:br(a.zoom,e,n)},[[0,0],[g.width,g.height]],o);const y=p.on("wheel.zoom"),_=p.on("dblclick.zoom");h.wheelDelta(wc);function I(O,w){return p?new Promise(A=>{h==null||h.interpolate((w==null?void 0:w.interpolate)==="linear"?Ar:Mo).transform(Ma(p,w==null?void 0:w.duration,w==null?void 0:w.ease,()=>A(!0)),O)}):Promise.resolve(!1)}function D({noWheelClassName:O,noPanClassName:w,onPaneContextMenu:A,userSelectionActive:b,panOnScroll:N,panOnDrag:E,panOnScrollMode:L,panOnScrollSpeed:F,preventScrolling:W,zoomOnPinch:M,zoomOnScroll:m,zoomOnDoubleClick:C,zoomActivationKeyPressed:P,lib:X,onTransformChange:le,connectionInProgress:J,paneClickDistance:Y,selectionOnDrag:Z}){b&&!f.isZoomingOrPanning&&H();const Q=N&&!P&&!b;h.clickDistance(Z?1/0:!Nn(Y)||Y<0?0:Y);const se=Q?my({zoomPanValues:f,noWheelClassName:O,d3Selection:p,d3Zoom:h,panOnScrollMode:L,panOnScrollSpeed:F,zoomOnPinch:M,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:l}):_y({noWheelClassName:O,preventScrolling:W,d3ZoomHandler:y});if(p.on("wheel.zoom",se,{passive:!1}),!b){const q=yy({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:i});h.on("start",q);const ee=wy({zoomPanValues:f,panOnDrag:E,onPaneContextMenu:!!A,onPanZoom:s,onTransformChange:le});h.on("zoom",ee);const oe=ky({zoomPanValues:f,panOnDrag:E,panOnScroll:N,onPaneContextMenu:A,onPanZoomEnd:l,onDraggingChange:u});h.on("end",oe)}const B=Cy({zoomActivationKeyPressed:P,panOnDrag:E,zoomOnScroll:m,panOnScroll:N,zoomOnDoubleClick:C,zoomOnPinch:M,userSelectionActive:b,noPanClassName:w,noWheelClassName:O,lib:X,connectionInProgress:J});h.filter(B),C?p.on("dblclick.zoom",_):p.on("dblclick.zoom",null)}function H(){h.on("zoom",null)}async function R(O,w,A){const b=Ea(O),N=h==null?void 0:h.constrain()(b,w,A);return N&&await I(N),new Promise(E=>E(N))}async function K(O,w){const A=Ea(O);return await I(A,w),new Promise(b=>b(A))}function V(O){if(p){const w=Ea(O),A=p.property("__zoom");(A.k!==O.zoom||A.x!==O.x||A.y!==O.y)&&(h==null||h.transform(p,w,null,{sync:!0}))}}function U(){const O=p?tc(p.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}function ne(O,w){return p?new Promise(A=>{h==null||h.interpolate((w==null?void 0:w.interpolate)==="linear"?Ar:Mo).scaleTo(Ma(p,w==null?void 0:w.duration,w==null?void 0:w.ease,()=>A(!0)),O)}):Promise.resolve(!1)}function ue(O,w){return p?new Promise(A=>{h==null||h.interpolate((w==null?void 0:w.interpolate)==="linear"?Ar:Mo).scaleBy(Ma(p,w==null?void 0:w.duration,w==null?void 0:w.ease,()=>A(!0)),O)}):Promise.resolve(!1)}function re(O){h==null||h.scaleExtent(O)}function ae(O){h==null||h.translateExtent(O)}function pe(O){const w=!Nn(O)||O<0?0:O;h==null||h.clickDistance(w)}return{update:D,destroy:H,setViewport:K,setViewportConstrained:R,getViewport:U,scaleTo:ne,scaleBy:ue,setScaleExtent:re,setTranslateExtent:ae,syncViewport:V,setClickDistance:pe}}var Ls;(function(t){t.Line="line",t.Handle="handle"})(Ls||(Ls={}));function Si(){const t={};return[e=>{if(e&&!od(t))throw new Error(e);return Go(t)},e=>oi(t,e)]}const[Ny,Ey]=Si(),[My,zy]=Si(),[Ty,Py]=Si();var Iy=k("<div><!></div>");function yr(t,e){Ze(e,!0);let n=je(e,"id",3,null),o=je(e,"type",3,"source"),a=je(e,"position",19,()=>ft.Top),s=je(e,"isConnectableStart",3,!0),i=je(e,"isConnectableEnd",3,!0),l=Qn(e,["$$slots","$$events","$$legacy","id","type","position","style","class","isConnectable","isConnectableStart","isConnectableEnd","isValidConnection","onconnect","ondisconnect","children"]);const u=Ny("Handle must be used within a Custom Node component"),f=My("Handle must be used within a Custom Node component");let g=S(()=>o()==="target"),h=S(()=>e.isConnectable!==void 0?e.isConnectable:f.value),p=er(),y=S(()=>p.ariaLabelConfig),_=null;ad(()=>{if(e.onconnect||e.ondisconnect){p.edges;let w=p.connectionLookup.get(`${u}-${o()}${n()?`-${n()}`:""}`);if(_&&!N_(w,_)){const A=w??new Map;ys(_,A,e.ondisconnect),ys(A,_,e.onconnect)}_=new Map(w)}});let I=S(()=>{if(!p.connection.inProgress)return[!1,!1,!1,!1,null];const{fromHandle:w,toHandle:A,isValid:b}=p.connection,N=w&&w.nodeId===u&&w.type===o()&&w.id===n(),E=A&&A.nodeId===u&&A.type===o()&&A.id===n(),L=p.connectionMode===xr.Strict?(w==null?void 0:w.type)!==o():u!==(w==null?void 0:w.nodeId)||n()!==(w==null?void 0:w.id);return[!0,N,E,L,E&&b]}),D=S(()=>rn(r(I),5)),H=S(()=>r(D)[0]),R=S(()=>r(D)[1]),K=S(()=>r(D)[2]),V=S(()=>r(D)[3]),U=S(()=>r(D)[4]);function ne(w){var b;const A=p.onbeforeconnect?p.onbeforeconnect(w):w;A&&(p.addEdge(A),(b=p.onconnect)==null||b.call(p,w))}function ue(w){const A=dc(w);w.currentTarget&&(A&&w.button===0||!A)&&As.onPointerDown(w,{handleId:n(),nodeId:u,isTarget:r(g),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||((...b)=>{var N;return((N=p.isValidConnection)==null?void 0:N.call(p,...b))??!0}),updateConnection:p.updateConnection,cancelConnection:p.cancelConnection,panBy:p.panBy,onConnect:ne,onConnectStart:p.onconnectstart,onConnectEnd:(...b)=>{var N;return(N=p.onconnectend)==null?void 0:N.call(p,...b)},getTransform:()=>[p.viewport.x,p.viewport.y,p.viewport.zoom],getFromHandle:()=>p.connection.fromHandle,dragThreshold:p.connectionDragThreshold,handleDomNode:w.currentTarget})}function re(w){var C,P;if(!u||!p.clickConnectStartHandle&&!s())return;if(!p.clickConnectStartHandle){(C=p.onclickconnectstart)==null||C.call(p,w,{nodeId:u,handleId:n(),handleType:o()}),p.clickConnectStartHandle={nodeId:u,type:o(),id:n()};return}const A=lc(w.target),b=e.isValidConnection??p.isValidConnection,{connectionMode:N,clickConnectStartHandle:E,flowId:L,nodeLookup:F}=p,{connection:W,isValid:M}=As.isValid(w,{handle:{nodeId:u,id:n(),type:o()},connectionMode:N,fromNodeId:E.nodeId,fromHandleId:E.id??null,fromType:E.type,isValidConnection:b,flowId:L,doc:A,lib:"svelte",nodeLookup:F});M&&W&&ne(W);const m=structuredClone(js(p.connection));delete m.inProgress,m.toPosition=m.toHandle?m.toHandle.position:null,(P=p.onclickconnectend)==null||P.call(p,w,m),p.clickConnectStartHandle=null}var ae=Iy(),pe=()=>{};On(ae,()=>({"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:ue,ontouchstart:ue,onclick:p.clickConnect?re:void 0,onkeypress:pe,style:e.style,role:"button","aria-label":r(y)["handle.ariaLabel"],tabindex:"-1",...l,[si]:{valid:r(U),connectingto:r(K),connectingfrom:r(R),source:!r(g),target:r(g),connectablestart:s(),connectableend:i(),connectable:r(h),connectionindicator:r(h)&&(!r(H)||r(V))&&(r(H)||p.clickConnectStartHandle?i():s())}}));var O=d(ae);Kt(O,()=>e.children??nn),c(ae),x(t,ae),Qe()}var Ay=k("<!> <!>",1);function kc(t,e){Ze(e,!0);let n=je(e,"targetPosition",19,()=>ft.Top),o=je(e,"sourcePosition",19,()=>ft.Bottom);var a=Ay(),s=fe(a);yr(s,{type:"target",get position(){return n()}});var i=v(s),l=v(i);yr(l,{type:"source",get position(){return o()}}),$(()=>{var u;return T(i,` ${((u=e.data)==null?void 0:u.label)??""} `)}),x(t,a),Qe()}var Ly=k(" <!>",1);function Oy(t,e){Ze(e,!0);let n=je(e,"data",19,()=>({label:"Node"})),o=je(e,"sourcePosition",19,()=>ft.Bottom);Te();var a=Ly(),s=fe(a),i=v(s);yr(i,{type:"source",get position(){return o()}}),$(()=>{var l;return T(s,`${((l=n())==null?void 0:l.label)??""} `)}),x(t,a),Qe()}var Ry=k(" <!>",1);function Dy(t,e){Ze(e,!0);let n=je(e,"data",19,()=>({label:"Node"})),o=je(e,"targetPosition",19,()=>ft.Top);Te();var a=Ry(),s=fe(a),i=v(s);yr(i,{type:"target",get position(){return o()}}),$(()=>{var l;return T(s,`${((l=n())==null?void 0:l.label)??""} `)}),x(t,a),Qe()}function Vy(t,e){}function za(t,e,n){if(!n||!e)return;const o=n==="root"?e:e.querySelector(`.svelte-flow__${n}`);o&&o.appendChild(t)}function Ta(t,e){const n=S(er),o=S(()=>r(n).domNode);let a;return r(o)?za(t,r(o),e):a=Ks(()=>{Pt(()=>{za(t,r(o),e),a==null||a()})}),{async update(s){za(t,r(o),s)},destroy(){t.parentNode&&t.parentNode.removeChild(t),a==null||a()}}}function Hy(){let t=ye(typeof window>"u");if(r(t)){const e=Ks(()=>{Pt(()=>{z(t,!1),e==null||e()})})}return{get value(){return r(t)}}}const Os=t=>M_(t),qy=t=>rc(t);function _n(t){return t===void 0?void 0:`${t}px`}const Wo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Fy=k("<div><!></div>");function Ky(t,e){Ze(e,!0);let n=je(e,"x",3,0),o=je(e,"y",3,0),a=je(e,"selectEdgeOnClick",3,!1),s=je(e,"transparent",3,!1),i=Qn(e,["$$slots","$$events","$$legacy","x","y","width","height","selectEdgeOnClick","transparent","class","children"]);const l=er(),u=Ty("EdgeLabel must be used within a Custom Edge component");let f=S(()=>{var y;return(y=l.visible.edges.get(u))==null?void 0:y.zIndex});var g=Fy(),h=()=>{a()&&u&&l.handleEdgeSelection(u)};On(g,y=>({class:["svelte-flow__edge-label",{transparent:s()},e.class],tabindex:"-1",onclick:h,...i,[Jo]:y}),[()=>({display:Hy().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-1jpn92f");var p=d(g);Kt(p,()=>e.children??nn),c(g),Xt(g,(y,_)=>Ta==null?void 0:Ta(y,_),()=>"edge-labels"),x(t,g),Qe()}var By=Rt("<path></path>"),jy=Rt('<path fill="none"></path><!><!>',1);function ca(t,e){let n=je(e,"interactionWidth",3,20),o=Qn(e,["$$slots","$$events","$$legacy","id","path","label","labelX","labelY","labelStyle","markerStart","markerEnd","style","interactionWidth","class"]);var a=jy(),s=fe(a),i=v(s);{var l=g=>{var h=By();On(h,()=>({d:e.path,"stroke-opacity":0,"stroke-width":n(),fill:"none",class:"svelte-flow__edge-interaction",...o})),x(g,h)};G(i,g=>{n()>0&&g(l)})}var u=v(i);{var f=g=>{Ky(g,{get x(){return e.labelX},get y(){return e.labelY},get style(){return e.labelStyle},selectEdgeOnClick:!0,children:(h,p)=>{Te();var y=pt();$(()=>T(y,e.label)),x(h,y)},$$slots:{default:!0}})};G(u,g=>{e.label&&g(f)})}$(()=>{Me(s,"id",e.id),Me(s,"d",e.path),Fe(s,0,We(["svelte-flow__edge-path",e.class])),Me(s,"marker-start",e.markerStart),Me(s,"marker-end",e.markerEnd),Zt(s,e.style)}),x(t,a)}function Cc(t,e){Ze(e,!0);let n=S(()=>{var l;return uc({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=S(()=>rn(r(n),3)),a=S(()=>r(o)[0]),s=S(()=>r(o)[1]),i=S(()=>r(o)[2]);ca(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}}),Qe()}function Uy(t,e){Ze(e,!0);let n=S(()=>_i({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition})),o=S(()=>rn(r(n),3)),a=S(()=>r(o)[0]),s=S(()=>r(o)[1]),i=S(()=>r(o)[2]);ca(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}}),Qe()}function Yy(t,e){Ze(e,!0);let n=S(()=>vc({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY})),o=S(()=>rn(r(n),3)),a=S(()=>r(o)[0]),s=S(()=>r(o)[1]),i=S(()=>r(o)[2]);ca(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}}),Qe()}function Wy(t,e){Ze(e,!0);let n=S(()=>_i({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,borderRadius:0})),o=S(()=>rn(r(n),3)),a=S(()=>r(o)[0]),s=S(()=>r(o)[1]),i=S(()=>r(o)[2]);ca(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}}),Qe()}var $r,Gr;class Xy{constructor(e,n){De(this,$r);De(this,Gr);Sr(this,$r,e),Sr(this,Gr,sd(n))}get current(){return ce(this,Gr).call(this),ce(this,$r).call(this)}}$r=new WeakMap,Gr=new WeakMap;const $y=/\(.+\)/,Gy=new Set(["all","print","screen","and","or","not","only"]);class Zy extends Xy{constructor(e,n){let o=$y.test(e)||e.split(/[\s,]+/).some(s=>Gy.has(s.trim()))?e:`(${e})`;const a=window.matchMedia(o);super(()=>a.matches,s=>Ia(a,"change",s))}}function Qy(t,e,n,o){const a=new Map;return bi(t,{x:0,y:0,width:n,height:o},e,!0).forEach(s=>{a.set(s.id,s)}),a}function Rs(t){const{edges:e,defaultEdgeOptions:n,nodeLookup:o,previousEdges:a,connectionMode:s,onerror:i,onlyRenderVisible:l,elevateEdgesOnSelect:u,zIndexMode:f}=t,g=new Map;for(const h of e){const p=o.get(h.source),y=o.get(h.target);if(!p||!y)continue;if(l){const{visibleNodes:D,transform:H,width:R,height:K}=t;if(j_({sourceNode:p,targetNode:y,width:R,height:K,transform:H}))D.set(p.id,p),D.set(y.id,y);else continue}const _=a.get(h.id);if(_&&h===_.edge&&p==_.sourceNode&&y==_.targetNode){g.set(h.id,_);continue}const I=Z_({id:h.id,sourceNode:p,targetNode:y,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:s,onError:i});I&&g.set(h.id,{...n,...h,...I,zIndex:B_({selected:h.selected,zIndex:h.zIndex??n.zIndex,sourceNode:p,targetNode:y,elevateOnSelect:u,zIndexMode:f}),sourceNode:p,targetNode:y,edge:h})}return g}const Sc={input:Oy,output:Dy,default:kc,group:Vy},Nc={straight:Yy,smoothstep:Uy,default:Cc,step:Wy};function Jy(t,e,n,o,a,s){if(e&&!n&&o&&a){const i=aa(s,{filter:l=>!!((l.width||l.initialWidth)&&(l.height||l.initialHeight))});return mi(i,o,a,.5,2,.1)}else return n??{x:0,y:0,zoom:1}}function e2(t){var n,o,a,s,i,l,u,f,g,h,p,y,_,I,D,H,R,K,V,U,ne,ue,re,ae,pe,O,w,A,b,N,E,L,F,W,M,m,C,P,X,le,J,Y,Z,Q,se,B,q,ee,oe,te,ge,xe,_e,ze,be,ve,Ne,Pe,de,ie,me,Ce,ke,Ee,he,Se,Ae,He,nt,Ke,Ge,dt,vt,$e,Oe,Ie;class e{constructor(){De(this,n,S(()=>t.props.id??"1"));De(this,o,ye(null));De(this,a,ye(null));De(this,s,ye(t.width??0));De(this,i,ye(t.height??0));De(this,l,ye(t.props.zIndexMode??"basic"));De(this,u,S(()=>{var Re;const{nodesInitialized:j}=ry(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&&j&&((Re=this.fitViewOptions)!=null&&Re.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),j}));De(this,f,S(()=>this.panZoom!==null));De(this,g,S(()=>(cy(this.connectionLookup,this.edgeLookup,t.edges),t.edges)));wt(this,"_prevSelectedNodes",[]);wt(this,"_prevSelectedNodeIds",new Set);De(this,h,S(()=>{const j=this._prevSelectedNodeIds.size,Re=new Set,Le=this.nodes.filter(Be=>(Be.selected&&(Re.add(Be.id),this._prevSelectedNodeIds.delete(Be.id)),Be.selected));return(j!==Re.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=Le),this._prevSelectedNodeIds=Re,this._prevSelectedNodes}));wt(this,"_prevSelectedEdges",[]);wt(this,"_prevSelectedEdgeIds",new Set);De(this,p,S(()=>{const j=this._prevSelectedEdgeIds.size,Re=new Set,Le=this.edges.filter(Be=>(Be.selected&&(Re.add(Be.id),this._prevSelectedEdgeIds.delete(Be.id)),Be.selected));return(j!==Re.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=Le),this._prevSelectedEdgeIds=Re,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);De(this,y,S(()=>{const{nodes:j,_edges:Re,_prevVisibleEdges:Le,nodeLookup:Be,connectionMode:Ye,onerror:at,onlyRenderVisibleElements:ct,defaultEdgeOptions:gt,zIndexMode:rt}=this;let Xe,et;const ot={edges:Re,defaultEdgeOptions:gt,previousEdges:Le,nodeLookup:Be,connectionMode:Ye,elevateEdgesOnSelect:t.props.elevateEdgesOnSelect??!0,zIndexMode:rt,onerror:at};if(ct){const{viewport:ut,width:ht,height:xt}=this,Nt=[ut.x,ut.y,ut.zoom];Xe=Qy(Be,Nt,ht,xt),et=Rs({...ot,onlyRenderVisible:!0,visibleNodes:Xe,transform:Nt,width:ht,height:xt})}else Xe=this.nodeLookup,et=Rs(ot);return{nodes:Xe,edges:et}}));De(this,_,S(()=>t.props.nodesDraggable??!0));De(this,I,S(()=>t.props.nodesConnectable??!0));De(this,D,S(()=>t.props.elementsSelectable??!0));De(this,H,S(()=>t.props.nodesFocusable??!0));De(this,R,S(()=>t.props.edgesFocusable??!0));De(this,K,S(()=>t.props.disableKeyboardA11y??!1));De(this,V,S(()=>t.props.minZoom??.5));De(this,U,S(()=>t.props.maxZoom??2));De(this,ne,S(()=>t.props.nodeOrigin??[0,0]));De(this,ue,S(()=>t.props.nodeExtent??Qa));De(this,re,S(()=>t.props.translateExtent??Qa));De(this,ae,S(()=>t.props.defaultEdgeOptions??{}));De(this,pe,S(()=>t.props.nodeDragThreshold??1));De(this,O,S(()=>t.props.autoPanOnNodeDrag??!0));De(this,w,S(()=>t.props.autoPanOnConnect??!0));De(this,A,S(()=>t.props.autoPanOnNodeFocus??!0));De(this,b,S(()=>t.props.autoPanSpeed??15));De(this,N,S(()=>t.props.connectionDragThreshold??1));wt(this,"fitViewQueued",t.props.fitView??!1);wt(this,"fitViewOptions",t.props.fitViewOptions);wt(this,"fitViewResolver",null);De(this,E,S(()=>t.props.snapGrid??null));De(this,L,ye(!1));De(this,F,ye(null));De(this,W,ye(!1));De(this,M,ye(!1));De(this,m,ye(!1));De(this,C,ye(!1));De(this,P,ye(!1));De(this,X,ye(null));De(this,le,ye(""));De(this,J,S(()=>t.props.selectionMode??Ko.Partial));De(this,Y,S(()=>({...Sc,...t.props.nodeTypes})));De(this,Z,S(()=>({...Nc,...t.props.edgeTypes})));De(this,Q,S(()=>t.props.noPanClass??"nopan"));De(this,se,S(()=>t.props.noDragClass??"nodrag"));De(this,B,S(()=>t.props.noWheelClass??"nowheel"));De(this,q,S(()=>q_(t.props.ariaLabelConfig)));De(this,ee,ye(Jy(this.nodesInitialized,t.props.fitView,t.props.initialViewport,this.width,this.height,this.nodeLookup)));De(this,oe,ye(Ja));De(this,te,S(()=>this._connection.inProgress?{...this._connection,to:ro(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection));De(this,ge,S(()=>t.props.connectionMode??xr.Strict));De(this,xe,S(()=>t.props.connectionRadius??20));De(this,_e,S(()=>t.props.isValidConnection??(()=>!0)));De(this,ze,S(()=>t.props.selectNodesOnDrag??!0));De(this,be,S(()=>t.props.defaultMarkerColor===void 0?"#b1b1b7":t.props.defaultMarkerColor));De(this,ve,S(()=>Q_(t.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd})));De(this,Ne,S(()=>t.props.onlyRenderVisibleElements??!1));De(this,Pe,S(()=>t.props.onflowerror??O_));De(this,de,S(()=>t.props.ondelete));De(this,ie,S(()=>t.props.onbeforedelete));De(this,me,S(()=>t.props.onbeforeconnect));De(this,Ce,S(()=>t.props.onconnect));De(this,ke,S(()=>t.props.onconnectstart));De(this,Ee,S(()=>t.props.onconnectend));De(this,he,S(()=>t.props.onbeforereconnect));De(this,Se,S(()=>t.props.onreconnect));De(this,Ae,S(()=>t.props.onreconnectstart));De(this,He,S(()=>t.props.onreconnectend));De(this,nt,S(()=>t.props.clickConnect??!0));De(this,Ke,S(()=>t.props.onclickconnectstart));De(this,Ge,S(()=>t.props.onclickconnectend));De(this,dt,ye(null));De(this,vt,S(()=>t.props.onselectiondrag));De(this,$e,S(()=>t.props.onselectiondragstart));De(this,Oe,S(()=>t.props.onselectiondragstop));wt(this,"resolveFitView",async()=>{var j;this.panZoom&&(await I_({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),(j=this.fitViewResolver)==null||j.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)});wt(this,"_prefersDark",new Zy("(prefers-color-scheme: dark)",t.props.colorModeSSR==="dark"));De(this,Ie,S(()=>t.props.colorMode==="system"?this._prefersDark.current?"dark":"light":t.props.colorMode??"light"))}get flowId(){return r(ce(this,n))}set flowId(j){z(ce(this,n),j)}get domNode(){return r(ce(this,o))}set domNode(j){z(ce(this,o),j)}get panZoom(){return r(ce(this,a))}set panZoom(j){z(ce(this,a),j)}get width(){return r(ce(this,s))}set width(j){z(ce(this,s),j)}get height(){return r(ce(this,i))}set height(j){z(ce(this,i),j)}get zIndexMode(){return r(ce(this,l))}set zIndexMode(j){z(ce(this,l),j)}get nodesInitialized(){return r(ce(this,u))}set nodesInitialized(j){z(ce(this,u),j)}get viewportInitialized(){return r(ce(this,f))}set viewportInitialized(j){z(ce(this,f),j)}get _edges(){return r(ce(this,g))}set _edges(j){z(ce(this,g),j)}get nodes(){return this.nodesInitialized,t.nodes}set nodes(j){t.nodes=j}get edges(){return this._edges}set edges(j){t.edges=j}get selectedNodes(){return r(ce(this,h))}set selectedNodes(j){z(ce(this,h),j)}get selectedEdges(){return r(ce(this,p))}set selectedEdges(j){z(ce(this,p),j)}get visible(){return r(ce(this,y))}set visible(j){z(ce(this,y),j)}get nodesDraggable(){return r(ce(this,_))}set nodesDraggable(j){z(ce(this,_),j)}get nodesConnectable(){return r(ce(this,I))}set nodesConnectable(j){z(ce(this,I),j)}get elementsSelectable(){return r(ce(this,D))}set elementsSelectable(j){z(ce(this,D),j)}get nodesFocusable(){return r(ce(this,H))}set nodesFocusable(j){z(ce(this,H),j)}get edgesFocusable(){return r(ce(this,R))}set edgesFocusable(j){z(ce(this,R),j)}get disableKeyboardA11y(){return r(ce(this,K))}set disableKeyboardA11y(j){z(ce(this,K),j)}get minZoom(){return r(ce(this,V))}set minZoom(j){z(ce(this,V),j)}get maxZoom(){return r(ce(this,U))}set maxZoom(j){z(ce(this,U),j)}get nodeOrigin(){return r(ce(this,ne))}set nodeOrigin(j){z(ce(this,ne),j)}get nodeExtent(){return r(ce(this,ue))}set nodeExtent(j){z(ce(this,ue),j)}get translateExtent(){return r(ce(this,re))}set translateExtent(j){z(ce(this,re),j)}get defaultEdgeOptions(){return r(ce(this,ae))}set defaultEdgeOptions(j){z(ce(this,ae),j)}get nodeDragThreshold(){return r(ce(this,pe))}set nodeDragThreshold(j){z(ce(this,pe),j)}get autoPanOnNodeDrag(){return r(ce(this,O))}set autoPanOnNodeDrag(j){z(ce(this,O),j)}get autoPanOnConnect(){return r(ce(this,w))}set autoPanOnConnect(j){z(ce(this,w),j)}get autoPanOnNodeFocus(){return r(ce(this,A))}set autoPanOnNodeFocus(j){z(ce(this,A),j)}get autoPanSpeed(){return r(ce(this,b))}set autoPanSpeed(j){z(ce(this,b),j)}get connectionDragThreshold(){return r(ce(this,N))}set connectionDragThreshold(j){z(ce(this,N),j)}get snapGrid(){return r(ce(this,E))}set snapGrid(j){z(ce(this,E),j)}get dragging(){return r(ce(this,L))}set dragging(j){z(ce(this,L),j)}get selectionRect(){return r(ce(this,F))}set selectionRect(j){z(ce(this,F),j)}get selectionKeyPressed(){return r(ce(this,W))}set selectionKeyPressed(j){z(ce(this,W),j)}get multiselectionKeyPressed(){return r(ce(this,M))}set multiselectionKeyPressed(j){z(ce(this,M),j)}get deleteKeyPressed(){return r(ce(this,m))}set deleteKeyPressed(j){z(ce(this,m),j)}get panActivationKeyPressed(){return r(ce(this,C))}set panActivationKeyPressed(j){z(ce(this,C),j)}get zoomActivationKeyPressed(){return r(ce(this,P))}set zoomActivationKeyPressed(j){z(ce(this,P),j)}get selectionRectMode(){return r(ce(this,X))}set selectionRectMode(j){z(ce(this,X),j)}get ariaLiveMessage(){return r(ce(this,le))}set ariaLiveMessage(j){z(ce(this,le),j)}get selectionMode(){return r(ce(this,J))}set selectionMode(j){z(ce(this,J),j)}get nodeTypes(){return r(ce(this,Y))}set nodeTypes(j){z(ce(this,Y),j)}get edgeTypes(){return r(ce(this,Z))}set edgeTypes(j){z(ce(this,Z),j)}get noPanClass(){return r(ce(this,Q))}set noPanClass(j){z(ce(this,Q),j)}get noDragClass(){return r(ce(this,se))}set noDragClass(j){z(ce(this,se),j)}get noWheelClass(){return r(ce(this,B))}set noWheelClass(j){z(ce(this,B),j)}get ariaLabelConfig(){return r(ce(this,q))}set ariaLabelConfig(j){z(ce(this,q),j)}get _viewport(){return r(ce(this,ee))}set _viewport(j){z(ce(this,ee),j)}get viewport(){return t.viewport??this._viewport}set viewport(j){t.viewport&&(t.viewport=j),this._viewport=j}get _connection(){return r(ce(this,oe))}set _connection(j){z(ce(this,oe),j)}get connection(){return r(ce(this,te))}set connection(j){z(ce(this,te),j)}get connectionMode(){return r(ce(this,ge))}set connectionMode(j){z(ce(this,ge),j)}get connectionRadius(){return r(ce(this,xe))}set connectionRadius(j){z(ce(this,xe),j)}get isValidConnection(){return r(ce(this,_e))}set isValidConnection(j){z(ce(this,_e),j)}get selectNodesOnDrag(){return r(ce(this,ze))}set selectNodesOnDrag(j){z(ce(this,ze),j)}get defaultMarkerColor(){return r(ce(this,be))}set defaultMarkerColor(j){z(ce(this,be),j)}get markers(){return r(ce(this,ve))}set markers(j){z(ce(this,ve),j)}get onlyRenderVisibleElements(){return r(ce(this,Ne))}set onlyRenderVisibleElements(j){z(ce(this,Ne),j)}get onerror(){return r(ce(this,Pe))}set onerror(j){z(ce(this,Pe),j)}get ondelete(){return r(ce(this,de))}set ondelete(j){z(ce(this,de),j)}get onbeforedelete(){return r(ce(this,ie))}set onbeforedelete(j){z(ce(this,ie),j)}get onbeforeconnect(){return r(ce(this,me))}set onbeforeconnect(j){z(ce(this,me),j)}get onconnect(){return r(ce(this,Ce))}set onconnect(j){z(ce(this,Ce),j)}get onconnectstart(){return r(ce(this,ke))}set onconnectstart(j){z(ce(this,ke),j)}get onconnectend(){return r(ce(this,Ee))}set onconnectend(j){z(ce(this,Ee),j)}get onbeforereconnect(){return r(ce(this,he))}set onbeforereconnect(j){z(ce(this,he),j)}get onreconnect(){return r(ce(this,Se))}set onreconnect(j){z(ce(this,Se),j)}get onreconnectstart(){return r(ce(this,Ae))}set onreconnectstart(j){z(ce(this,Ae),j)}get onreconnectend(){return r(ce(this,He))}set onreconnectend(j){z(ce(this,He),j)}get clickConnect(){return r(ce(this,nt))}set clickConnect(j){z(ce(this,nt),j)}get onclickconnectstart(){return r(ce(this,Ke))}set onclickconnectstart(j){z(ce(this,Ke),j)}get onclickconnectend(){return r(ce(this,Ge))}set onclickconnectend(j){z(ce(this,Ge),j)}get clickConnectStartHandle(){return r(ce(this,dt))}set clickConnectStartHandle(j){z(ce(this,dt),j)}get onselectiondrag(){return r(ce(this,vt))}set onselectiondrag(j){z(ce(this,vt),j)}get onselectiondragstart(){return r(ce(this,$e))}set onselectiondragstart(j){z(ce(this,$e),j)}get onselectiondragstop(){return r(ce(this,Oe))}set onselectiondragstop(j){z(ce(this,Oe),j)}get colorMode(){return r(ce(this,Ie))}set colorMode(j){z(ce(this,Ie),j)}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=Ja,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,g=new WeakMap,h=new WeakMap,p=new WeakMap,y=new WeakMap,_=new WeakMap,I=new WeakMap,D=new WeakMap,H=new WeakMap,R=new WeakMap,K=new WeakMap,V=new WeakMap,U=new WeakMap,ne=new WeakMap,ue=new WeakMap,re=new WeakMap,ae=new WeakMap,pe=new WeakMap,O=new WeakMap,w=new WeakMap,A=new WeakMap,b=new WeakMap,N=new WeakMap,E=new WeakMap,L=new WeakMap,F=new WeakMap,W=new WeakMap,M=new WeakMap,m=new WeakMap,C=new WeakMap,P=new WeakMap,X=new WeakMap,le=new WeakMap,J=new WeakMap,Y=new WeakMap,Z=new WeakMap,Q=new WeakMap,se=new WeakMap,B=new WeakMap,q=new WeakMap,ee=new WeakMap,oe=new WeakMap,te=new WeakMap,ge=new WeakMap,xe=new WeakMap,_e=new WeakMap,ze=new WeakMap,be=new WeakMap,ve=new WeakMap,Ne=new WeakMap,Pe=new WeakMap,de=new WeakMap,ie=new WeakMap,me=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Ee=new WeakMap,he=new WeakMap,Se=new WeakMap,Ae=new WeakMap,He=new WeakMap,nt=new WeakMap,Ke=new WeakMap,Ge=new WeakMap,dt=new WeakMap,vt=new WeakMap,$e=new WeakMap,Oe=new WeakMap,Ie=new WeakMap,new e}function er(){const t=Go(ni);if(!t)throw new Error("To call useStore outside of <SvelteFlow /> you need to wrap your component in a <SvelteFlowProvider />");return t.getStore()}const ni=Symbol();function t2(t){const e=e2(t);function n(O){e.nodeTypes={...Sc,...O}}function o(O){e.edgeTypes={...Nc,...O}}function a(O){e.edges=W_(O,e.edges)}const s=(O,w=!1)=>{e.nodes=e.nodes.map(A=>{if(e.connection.inProgress&&e.connection.fromNode.id===A.id){const N=e.nodeLookup.get(A.id);N&&(e.connection={...e.connection,from:Zn(N,e.connection.fromHandle,ft.Left,!0)})}const b=O.get(A.id);return b?{...A,position:b.position,dragging:w}:A})};function i(O){var N,E,L;const{changes:w,updatedInternals:A}=sy(O,e.nodeLookup,e.parentLookup,e.domNode,e.nodeOrigin,e.nodeExtent,e.zIndexMode);if(!A)return;ty(e.nodeLookup,e.parentLookup,{nodeOrigin:e.nodeOrigin,nodeExtent:e.nodeExtent,zIndexMode:e.zIndexMode}),e.fitViewQueued&&e.resolveFitView();const b=new Map;for(const F of w){const W=(N=e.nodeLookup.get(F.id))==null?void 0:N.internals.userNode;if(!W)continue;const M={...W};switch(F.type){case"dimensions":{const m={...M.measured,...F.dimensions};F.setAttributes&&(M.width=((E=F.dimensions)==null?void 0:E.width)??M.width,M.height=((L=F.dimensions)==null?void 0:L.height)??M.height),M.measured=m;break}case"position":M.position=F.position??M.position;break}b.set(F.id,M)}e.nodes=e.nodes.map(F=>b.get(F.id)??F)}function l(O){const w=e.fitViewResolver??Promise.withResolvers();return e.fitViewQueued=!0,e.fitViewOptions=O,e.fitViewResolver=w,e.nodes=[...e.nodes],w.promise}async function u(O,w,A){const b=typeof(A==null?void 0:A.zoom)<"u"?A.zoom:e.maxZoom,N=e.panZoom;return N?(await N.setViewport({x:e.width/2-O*b,y:e.height/2-w*b,zoom:b},{duration:A==null?void 0:A.duration,ease:A==null?void 0:A.ease,interpolate:A==null?void 0:A.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)}function f(O,w){const A=e.panZoom;return A?A.scaleBy(O,w):Promise.resolve(!1)}function g(O){return f(1.2,O)}function h(O){return f(1/1.2,O)}function p(O){const w=e.panZoom;w&&(w.setScaleExtent([O,e.maxZoom]),e.minZoom=O)}function y(O){const w=e.panZoom;w&&(w.setScaleExtent([e.minZoom,O]),e.maxZoom=O)}function _(O){const w=e.panZoom;w&&(w.setTranslateExtent(O),e.translateExtent=O)}function I(O,w=null){let A=!1;const b=O.map(N=>(w?w.has(N.id):!0)&&N.selected?(A=!0,{...N,selected:!1}):N);return[A,b]}function D(O){const w=O!=null&&O.nodes?new Set(O.nodes.map(F=>F.id)):null,[A,b]=I(e.nodes,w);A&&(e.nodes=b);const N=O!=null&&O.edges?new Set(O.edges.map(F=>F.id)):null,[E,L]=I(e.edges,N);E&&(e.edges=L)}function H(O){const w=e.multiselectionKeyPressed;e.nodes=e.nodes.map(A=>{const b=O.includes(A.id),N=w&&A.selected||b;return!!A.selected!==N?{...A,selected:N}:A}),w||D({nodes:[]})}function R(O){const w=e.multiselectionKeyPressed;e.edges=e.edges.map(A=>{const b=O.includes(A.id),N=w&&A.selected||b;return!!A.selected!==N?{...A,selected:N}:A}),w||D({edges:[]})}function K(O,w,A){const b=e.nodeLookup.get(O);if(!b){console.warn("012",Hr.error012(O));return}e.selectionRect=null,e.selectionRectMode=null,b.selected?(w||b.selected&&e.multiselectionKeyPressed)&&(D({nodes:[b],edges:[]}),requestAnimationFrame(()=>A==null?void 0:A.blur())):H([O])}function V(O){const w=e.edgeLookup.get(O);if(!w){console.warn("012",Hr.error012(O));return}(w.selectable||e.elementsSelectable&&typeof w.selectable>"u")&&(e.selectionRect=null,e.selectionRectMode=null,w.selected?w.selected&&e.multiselectionKeyPressed&&D({nodes:[],edges:[w]}):R([O]))}function U(O,w){const{nodeExtent:A,snapGrid:b,nodeOrigin:N,nodeLookup:E,nodesDraggable:L,onerror:F}=e,W=new Map,M=(b==null?void 0:b[0])??5,m=(b==null?void 0:b[1])??5,C=O.x*M*w,P=O.y*m*w;for(const X of E.values()){if(!(X.selected&&(X.draggable||L&&typeof X.draggable>"u")))continue;let J={x:X.internals.positionAbsolute.x+C,y:X.internals.positionAbsolute.y+P};b&&(J=no(J,b));const{position:Y,positionAbsolute:Z}=oc({nodeId:X.id,nextPosition:J,nodeLookup:E,nodeExtent:A,nodeOrigin:N,onError:F});X.position=Y,X.internals.positionAbsolute=Z,W.set(X.id,X)}s(W)}function ne(O){return ly({delta:O,panZoom:e.panZoom,transform:[e.viewport.x,e.viewport.y,e.viewport.zoom],translateExtent:e.translateExtent,width:e.width,height:e.height})}const ue=O=>{e._connection={...O}};function re(){e._connection=Ja}function ae(){e.resetStoreValues(),D()}return Object.assign(e,{setNodeTypes:n,setEdgeTypes:o,addEdge:a,updateNodePositions:s,updateNodeInternals:i,zoomIn:g,zoomOut:h,fitView:l,setCenter:u,setMinZoom:p,setMaxZoom:y,setTranslateExtent:_,unselectNodesAndEdges:D,addSelectedNodes:H,addSelectedEdges:R,handleNodeSelection:K,handleEdgeSelection:V,moveSelectedNodes:U,panBy:ne,updateConnection:ue,cancelConnection:re,reset:ae})}function Pa(t,e){const{minZoom:n,maxZoom:o,initialViewport:a,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l,translateExtent:u,setPanZoomInstance:f,onDraggingChange:g,onTransformChange:h}=e,p=Sy({domNode:t,minZoom:n,maxZoom:o,translateExtent:u,viewport:a,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:g}),y=p.getViewport();return(a.x!==y.x||a.y!==y.y||a.zoom!==y.zoom)&&h([y.x,y.y,y.zoom]),f(p),p.update(e),{update(_){p.update(_)}}}var n2=k('<div class="svelte-flow__zoom svelte-flow__container"><!></div>');function r2(t,e){Ze(e,!0);let n=je(e,"store",15),o=S(()=>n().panActivationKeyPressed||e.panOnDrag),a=S(()=>n().panActivationKeyPressed||e.panOnScroll);const{viewport:s}=n();let i=!1;Pt(()=>{var f;!i&&n().viewportInitialized&&((f=e.oninit)==null||f.call(e),i=!0)});var l=n2(),u=d(l);Kt(u,()=>e.children),c(l),Xt(l,(f,g)=>Pa==null?void 0:Pa(f,g),()=>({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})),x(t,l),Qe()}function Ds(t,e){return n=>{n.target===e&&(t==null||t(n))}}function Vs(t){return e=>{const n=t.has(e.id);return!!e.selected!==n?{...e,selected:n}:e}}function Hs(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}var o2=k("<div><!></div>");function a2(t,e){Ze(e,!0);let n=je(e,"store",15),o=je(e,"panOnDrag",3,!0),a=je(e,"paneClickDistance",3,1),s,i=null,l=new Set,u=new Set,f=S(()=>n().panActivationKeyPressed||o()),g=S(()=>n().selectionKeyPressed||!!n().selectionRect||e.selectionOnDrag&&r(f)!==!0),h=S(()=>n().elementsSelectable&&(r(g)||n().selectionRectMode==="user")),p=!1;function y(re){var b,N;if(i=s==null?void 0:s.getBoundingClientRect(),!i)return;const ae=re.target===s,pe=!ae&&!!re.target.closest(".nokey"),O=e.selectionOnDrag&&ae||n().selectionKeyPressed;if(pe||!r(g)||!O||re.button!==0||!re.isPrimary)return;(N=(b=re.target)==null?void 0:b.setPointerCapture)==null||N.call(b,re.pointerId),p=!1;const{x:w,y:A}=dn(re,i);n(n().selectionRect={width:0,height:0,startX:w,startY:A,x:w,y:A},!0),ae||(re.stopPropagation(),re.preventDefault())}function _(re){var E;if(!r(g)||!i||!n().selectionRect)return;const ae=dn(re,i),{startX:pe=0,startY:O=0}=n().selectionRect;if(!p){const L=n().selectionKeyPressed?0:a();if(Math.hypot(ae.x-pe,ae.y-O)<=L)return;n().unselectNodesAndEdges(),(E=e.onselectionstart)==null||E.call(e,re)}p=!0;const w={...n().selectionRect,x:ae.x<pe?ae.x:pe,y:ae.y<O?ae.y:O,width:Math.abs(ae.x-pe),height:Math.abs(ae.y-O)},A=l,b=u;l=new Set(bi(n().nodeLookup,w,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===Ko.Partial,!0).map(L=>L.id));const N=n().defaultEdgeOptions.selectable??!0;u=new Set;for(const L of l){const F=n().connectionLookup.get(L);if(F)for(const{edgeId:W}of F.values()){const M=n().edgeLookup.get(W);M&&(M.selectable??N)&&u.add(W)}}Hs(A,l)||n(n().nodes=n().nodes.map(Vs(l)),!0),Hs(b,u)||n(n().edges=n().edges.map(Vs(u)),!0),n(n().selectionRectMode="user",!0),n(n().selectionRect=w,!0)}function I(re){var ae,pe,O;re.button===0&&((pe=(ae=re.target)==null?void 0:ae.releasePointerCapture)==null||pe.call(ae,re.pointerId),!p&&re.target===s&&(R==null||R(re)),n(n().selectionRect=null,!0),p&&n(n().selectionRectMode=l.size>0?"nodes":null,!0),p&&((O=e.onselectionend)==null||O.call(e,re)))}const D=re=>{var ae;if(Array.isArray(r(f))&&r(f).includes(2)){re.preventDefault();return}(ae=e.onpanecontextmenu)==null||ae.call(e,{event:re})},H=re=>{p&&(re.stopPropagation(),p=!1)};function R(re){var ae;if(p||n().connection.inProgress){p=!1;return}(ae=e.onpaneclick)==null||ae.call(e,{event:re}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var K=o2();let V;var U=S(()=>r(h)?void 0:Ds(R,s)),ne=S(()=>Ds(D,s)),ue=d(K);Kt(ue,()=>e.children),c(K),bn(K,re=>s=re,()=>s),$(re=>V=Fe(K,1,"svelte-flow__pane svelte-flow__container",null,V,re),[()=>({draggable:o()===!0||Array.isArray(o())&&o().includes(0),dragging:n().dragging,selection:r(g)})]),we("click",K,function(...re){var ae;(ae=r(U))==null||ae.apply(this,re)}),Ln("pointerdown",K,function(...re){var ae;(ae=r(h)?y:void 0)==null||ae.apply(this,re)},!0),we("pointermove",K,function(...re){var ae;(ae=r(h)?_:void 0)==null||ae.apply(this,re)}),we("pointerup",K,function(...re){var ae;(ae=r(h)?I:void 0)==null||ae.apply(this,re)}),we("contextmenu",K,function(...re){var ae;(ae=r(ne))==null||ae.apply(this,re)}),Ln("click",K,function(...re){var ae;(ae=r(h)?H:void 0)==null||ae.apply(this,re)},!0),x(t,K),Qe()}Tt(["click","pointermove","pointerup","contextmenu"]);var i2=k('<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>');function s2(t,e){Ze(e,!0);var n=i2();let o;var a=d(n);Kt(a,()=>e.children),c(n),$(()=>o=Zt(n,"",o,{transform:`translate(${e.store.viewport.x??""}px, ${e.store.viewport.y??""}px) scale(${e.store.viewport.zoom??""})`})),x(t,n),Qe()}function fr(t,e){const{store:n,onDrag:o,onDragStart:a,onDragStop:s,onNodeMouseDown:i}=e,l=fy({onDrag:o,onDragStart:a,onDragStop:s,onNodeMouseDown:i,getStoreItems:()=>{const{snapGrid:f,viewport:g}=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:[g.x,g.y,g.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,g){if(g.disabled){l.destroy();return}l.update({domNode:f,noDragClassName:g.noDragClass,handleSelector:g.handleSelector,nodeId:g.nodeId,isSelectable:g.isSelectable,nodeClickDistance:g.nodeClickDistance})}return u(t,e),{update(f){u(t,f)},destroy(){l.destroy()}}}var l2=k('<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-60aadv"> </div>'),c2=k('<div class="a11y-hidden svelte-60aadv"> </div> <div class="a11y-hidden svelte-60aadv"> </div> <!>',1);function d2(t,e){Ze(e,!0);var n=c2(),o=fe(n),a=d(o,!0);c(o);var s=v(o,2),i=d(s,!0);c(s);var l=v(s,2);{var u=f=>{var g=l2(),h=d(g,!0);c(g),$(()=>{Me(g,"id",`${u2}-${e.store.flowId}`),T(h,e.store.ariaLiveMessage)}),x(f,g)};G(l,f=>{e.store.disableKeyboardA11y||f(u)})}$(()=>{Me(o,"id",`${Ec}-${e.store.flowId}`),T(a,e.store.disableKeyboardA11y?e.store.ariaLabelConfig["node.a11yDescription.default"]:e.store.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]),Me(s,"id",`${Mc}-${e.store.flowId}`),T(i,e.store.ariaLabelConfig["edge.a11yDescription.default"])}),x(t,n),Qe()}const Ec="svelte-flow__node-desc",Mc="svelte-flow__edge-desc",u2="svelte-flow__aria-live";var f2=k("<div><!></div>");function v2(t,e){Ze(e,!0);let n=je(e,"store",15),o=S(()=>Wt(e.node.data,()=>({}),!0)),a=S(()=>Wt(e.node.selected,!1)),s=S(()=>e.node.draggable),i=S(()=>e.node.selectable),l=S(()=>Wt(e.node.deletable,!0)),u=S(()=>e.node.connectable),f=S(()=>e.node.focusable),g=S(()=>Wt(e.node.hidden,!1)),h=S(()=>Wt(e.node.dragging,!1)),p=S(()=>Wt(e.node.style,"")),y=S(()=>e.node.class),_=S(()=>Wt(e.node.type,"default")),I=S(()=>e.node.parentId),D=S(()=>e.node.sourcePosition),H=S(()=>e.node.targetPosition),R=S(()=>Wt(e.node.measured,()=>({width:0,height:0}),!0).width),K=S(()=>Wt(e.node.measured,()=>({width:0,height:0}),!0).height),V=S(()=>e.node.initialWidth),U=S(()=>e.node.initialHeight),ne=S(()=>e.node.width),ue=S(()=>e.node.height),re=S(()=>e.node.dragHandle),ae=S(()=>Wt(e.node.internals.z,0)),pe=S(()=>e.node.internals.positionAbsolute.x),O=S(()=>e.node.internals.positionAbsolute.y),w=S(()=>e.node.internals.userNode),{id:A}=e.node,b=S(()=>r(s)??n().nodesDraggable),N=S(()=>r(i)??n().elementsSelectable),E=S(()=>r(u)??n().nodesConnectable),L=S(()=>V_(e.node)),F=S(()=>!!e.node.internals.handleBounds),W=S(()=>r(L)&&r(F)),M=S(()=>r(f)??n().nodesFocusable);function m(_e){return n().parentLookup.has(_e)}let C=S(()=>m(A)),P=ye(null),X=null,le=r(_),J=r(D),Y=r(H),Z=S(()=>n().nodeTypes[r(_)]??kc),Q=S(()=>n().ariaLabelConfig),se={get value(){return r(E)}};Ey(A),zy(se);let B=S(()=>{const _e=r(R)===void 0?r(ne)??r(V):r(ne),ze=r(K)===void 0?r(ue)??r(U):r(ue);if(!(_e===void 0&&ze===void 0&&r(p)===void 0))return`${r(p)};${_e?`width:${_n(_e)};`:""}${ze?`height:${_n(ze)};`:""}`});Pt(()=>{(r(_)!==le||r(D)!==J||r(H)!==Y)&&r(P)!==null&&requestAnimationFrame(()=>{r(P)!==null&&n().updateNodeInternals(new Map([[A,{id:A,nodeElement:r(P),force:!0}]]))}),le=r(_),J=r(D),Y=r(H)}),Pt(()=>{e.resizeObserver&&(!r(W)||r(P)!==X)&&(X&&e.resizeObserver.unobserve(X),r(P)&&e.resizeObserver.observe(r(P)),X=r(P))}),Zo(()=>{var _e;X&&((_e=e.resizeObserver)==null||_e.unobserve(X))});function q(_e){var ze;r(N)&&(!n().selectNodesOnDrag||!r(b)||n().nodeDragThreshold>0)&&n().handleNodeSelection(A),(ze=e.onnodeclick)==null||ze.call(e,{node:r(w),event:_e})}function ee(_e){if(!(cc(_e)||n().disableKeyboardA11y))if(nc.includes(_e.key)&&r(N)){const ze=_e.key==="Escape";n().handleNodeSelection(A,ze,r(P))}else r(b)&&e.node.selected&&Object.prototype.hasOwnProperty.call(Wo,_e.key)&&(_e.preventDefault(),n(n().ariaLiveMessage=r(Q)["node.a11yDescription.ariaLiveMessage"]({direction:_e.key.replace("Arrow","").toLowerCase(),x:~~e.node.internals.positionAbsolute.x,y:~~e.node.internals.positionAbsolute.y}),!0),n().moveSelectedNodes(Wo[_e.key],_e.shiftKey?4:1))}const oe=()=>{var Ne;if(n().disableKeyboardA11y||!n().autoPanOnNodeFocus||!((Ne=r(P))!=null&&Ne.matches(":focus-visible")))return;const{width:_e,height:ze,viewport:be}=n();bi(new Map([[A,e.node]]),{x:0,y:0,width:_e,height:ze},[be.x,be.y,be.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:be.zoom})};var te=qe(),ge=fe(te);{var xe=_e=>{var ze=f2();On(ze,()=>({"data-id":A,class:["svelte-flow__node",`svelte-flow__node-${r(_)}`,r(y)],style:r(B),onclick:q,onpointerenter:e.onnodepointerenter?ve=>e.onnodepointerenter({node:r(w),event:ve}):void 0,onpointerleave:e.onnodepointerleave?ve=>e.onnodepointerleave({node:r(w),event:ve}):void 0,onpointermove:e.onnodepointermove?ve=>e.onnodepointermove({node:r(w),event:ve}):void 0,oncontextmenu:e.onnodecontextmenu?ve=>e.onnodecontextmenu({node:r(w),event:ve}):void 0,onkeydown:r(M)?ee:void 0,onfocus:r(M)?oe:void 0,tabIndex:r(M)?0:void 0,role:e.node.ariaRole??(r(M)?"group":void 0),"aria-roledescription":"node","aria-describedby":n().disableKeyboardA11y?void 0:`${Ec}-${n().flowId}`,...e.node.domAttributes,[si]:{dragging:r(h),selected:r(a),draggable:r(b),connectable:r(E),selectable:r(N),nopan:r(b),parent:r(C)},[Jo]:{"z-index":r(ae),transform:`translate(${r(pe)??""}px, ${r(O)??""}px)`,visibility:r(L)?"visible":"hidden"}}));var be=d(ze);Zr(be,()=>r(Z),(ve,Ne)=>{Ne(ve,{get data(){return r(o)},get id(){return A},get selected(){return r(a)},get selectable(){return r(N)},get deletable(){return r(l)},get sourcePosition(){return r(D)},get targetPosition(){return r(H)},get zIndex(){return r(ae)},get dragging(){return r(h)},get draggable(){return r(b)},get dragHandle(){return r(re)},get parentId(){return r(I)},get type(){return r(_)},get isConnectable(){return r(E)},get positionAbsoluteX(){return r(pe)},get positionAbsoluteY(){return r(O)},get width(){return r(ne)},get height(){return r(ue)}})}),c(ze),Xt(ze,(ve,Ne)=>fr==null?void 0:fr(ve,Ne),()=>({nodeId:A,isSelectable:r(N),disabled:!r(b),handleSelector:r(re),noDragClass:n().noDragClass,nodeClickDistance:e.nodeClickDistance,onNodeMouseDown:n().handleNodeSelection,onDrag:(ve,Ne,Pe,de)=>{var ie;(ie=e.onnodedrag)==null||ie.call(e,{event:ve,targetNode:Pe,nodes:de})},onDragStart:(ve,Ne,Pe,de)=>{var ie;(ie=e.onnodedragstart)==null||ie.call(e,{event:ve,targetNode:Pe,nodes:de})},onDragStop:(ve,Ne,Pe,de)=>{var ie;(ie=e.onnodedragstop)==null||ie.call(e,{event:ve,targetNode:Pe,nodes:de})},store:n()})),bn(ze,ve=>z(P,ve),()=>r(P)),x(_e,ze)};G(ge,_e=>{r(g)||_e(xe)})}x(t,te),Qe()}var g2=k('<div class="svelte-flow__nodes"></div>');function p2(t,e){Ze(e,!0);let n=je(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)});Zo(()=>{o==null||o.disconnect()});var a=g2();Je(a,21,()=>n().visible.nodes.values(),s=>s.id,(s,i)=>{v2(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),x(t,a),Qe()}var h2=Rt('<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>');function x2(t,e){Ze(e,!0);let n=S(()=>e.edge.id),o=S(()=>e.edge.source),a=S(()=>e.edge.target),s=S(()=>e.edge.sourceX),i=S(()=>e.edge.sourceY),l=S(()=>e.edge.targetX),u=S(()=>e.edge.targetY),f=S(()=>e.edge.sourcePosition),g=S(()=>e.edge.targetPosition),h=S(()=>Wt(e.edge.animated,!1)),p=S(()=>Wt(e.edge.selected,!1)),y=S(()=>e.edge.label),_=S(()=>e.edge.labelStyle),I=S(()=>Wt(e.edge.data,()=>({}),!0)),D=S(()=>e.edge.style),H=S(()=>e.edge.interactionWidth),R=S(()=>Wt(e.edge.type,"default")),K=S(()=>e.edge.sourceHandle),V=S(()=>e.edge.targetHandle),U=S(()=>e.edge.markerStart),ne=S(()=>e.edge.markerEnd),ue=S(()=>e.edge.selectable),re=S(()=>e.edge.focusable),ae=S(()=>Wt(e.edge.deletable,!0)),pe=S(()=>e.edge.hidden),O=S(()=>e.edge.zIndex),w=S(()=>e.edge.class),A=S(()=>e.edge.ariaLabel);Py(r(n));let b=null,N=S(()=>r(ue)??e.store.elementsSelectable),E=S(()=>r(re)??e.store.edgesFocusable),L=S(()=>e.store.edgeTypes[r(R)]??Cc),F=S(()=>r(U)?`url('#${ti(r(U),e.store.flowId)}')`:void 0),W=S(()=>r(ne)?`url('#${ti(r(ne),e.store.flowId)}')`:void 0);function M(J){var Z;const Y=e.store.edgeLookup.get(r(n));Y&&(r(N)&&e.store.handleEdgeSelection(r(n)),(Z=e.onedgeclick)==null||Z.call(e,{event:J,edge:Y}))}function m(J,Y){const Z=e.store.edgeLookup.get(r(n));Z&&Y({event:J,edge:Z})}function C(J){if(!e.store.disableKeyboardA11y&&nc.includes(J.key)&&r(N)){const{unselectNodesAndEdges:Y,addSelectedEdges:Z}=e.store;J.key==="Escape"?(b==null||b.blur(),Y({edges:[e.edge]})):Z([r(n)])}}var P=qe(),X=fe(P);{var le=J=>{var Y=h2();let Z;var Q=d(Y);On(Q,()=>({class:["svelte-flow__edge",r(w)],"data-id":r(n),onclick:M,oncontextmenu:e.onedgecontextmenu?B=>{m(B,e.onedgecontextmenu)}:void 0,onpointerenter:e.onedgepointerenter?B=>{m(B,e.onedgepointerenter)}:void 0,onpointerleave:e.onedgepointerleave?B=>{m(B,e.onedgepointerleave)}:void 0,"aria-label":r(A)===null?void 0:r(A)?r(A):`Edge from ${r(o)} to ${r(a)}`,"aria-describedby":r(E)?`${Mc}-${e.store.flowId}`:void 0,role:e.edge.ariaRole??(r(E)?"group":"img"),"aria-roledescription":"edge",onkeydown:r(E)?C:void 0,tabindex:r(E)?0:void 0,...e.edge.domAttributes,[si]:{animated:r(h),selected:r(p),selectable:r(N)}}));var se=d(Q);Zr(se,()=>r(L),(B,q)=>{q(B,{get id(){return r(n)},get source(){return r(o)},get target(){return r(a)},get sourceX(){return r(s)},get sourceY(){return r(i)},get targetX(){return r(l)},get targetY(){return r(u)},get sourcePosition(){return r(f)},get targetPosition(){return r(g)},get animated(){return r(h)},get selected(){return r(p)},get label(){return r(y)},get labelStyle(){return r(_)},get data(){return r(I)},get style(){return r(D)},get interactionWidth(){return r(H)},get selectable(){return r(N)},get deletable(){return r(ae)},get type(){return r(R)},get sourceHandleId(){return r(K)},get targetHandleId(){return r(V)},get markerStart(){return r(F)},get markerEnd(){return r(W)}})}),c(Q),bn(Q,B=>b=B,()=>b),c(Y),$(()=>Z=Zt(Y,"",Z,{"z-index":r(O)})),x(J,Y)};G(X,J=>{r(pe)||J(le)})}x(t,P),Qe()}var b2=Rt("<defs></defs>");function m2(t,e){Ze(e,!1);const n=er();yd();var o=b2();Je(o,5,()=>n.markers,a=>a.id,(a,s)=>{k2(a,tt(()=>r(s)))}),c(o),x(t,o),Qe()}var _2=Rt('<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>'),y2=Rt('<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),w2=Rt('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function k2(t,e){Ze(e,!0);let n=je(e,"width",3,12.5),o=je(e,"height",3,12.5),a=je(e,"markerUnits",3,"strokeWidth"),s=je(e,"orient",3,"auto-start-reverse"),i=je(e,"color",3,"none");var l=w2(),u=d(l);{var f=h=>{var p=_2();let y;$(()=>{Me(p,"stroke-width",e.strokeWidth),y=Zt(p,"",y,{stroke:i()})}),x(h,p)},g=h=>{var p=y2();let y;$(()=>{Me(p,"stroke-width",e.strokeWidth),y=Zt(p,"",y,{stroke:i(),fill:i()})}),x(h,p)};G(u,h=>{e.type===Bo.Arrow?h(f):e.type===Bo.ArrowClosed&&h(g,1)})}c(l),$(()=>{Me(l,"id",e.id),Me(l,"markerWidth",`${n()}`),Me(l,"markerHeight",`${o()}`),Me(l,"markerUnits",a()),Me(l,"orient",s())}),x(t,l),Qe()}var C2=k('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>');function S2(t,e){Ze(e,!0);let n=je(e,"store",15);var o=C2(),a=d(o),s=d(a);m2(s,{}),c(a);var i=v(a,2);Je(i,17,()=>n().visible.edges.values(),l=>l.id,(l,u)=>{x2(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),x(t,o),Qe()}var N2=k('<div class="svelte-flow__selection svelte-d28r6n"></div>');function zc(t,e){Ze(e,!0);let n=je(e,"x",3,0),o=je(e,"y",3,0),a=je(e,"width",3,0),s=je(e,"height",3,0),i=je(e,"isVisible",3,!0);var l=qe(),u=fe(l);{var f=g=>{var h=N2();let p;$(y=>p=Zt(h,"",p,y),[()=>({width:typeof a()=="string"?a():_n(a()),height:typeof s()=="string"?s():_n(s()),transform:`translate(${n()}px, ${o()}px)`})]),x(g,h)};G(u,g=>{i()&&g(f)})}x(t,l),Qe()}var E2=k("<div><!></div>");function M2(t,e){Ze(e,!0);let n=ye(void 0);Pt(()=>{var h;e.store.disableKeyboardA11y||(h=r(n))==null||h.focus({preventScroll:!0})});let o=S(()=>{if(e.store.selectionRectMode==="nodes"){e.store.nodes;const h=aa(e.store.nodeLookup,{filter:p=>!!p.selected});if(h.width>0&&h.height>0)return h}return null});function a(h){var y;const p=e.store.nodes.filter(_=>_.selected);(y=e.onselectioncontextmenu)==null||y.call(e,{nodes:p,event:h})}function s(h){var y;const p=e.store.nodes.filter(_=>_.selected);(y=e.onselectionclick)==null||y.call(e,{nodes:p,event:h})}function i(h){Object.prototype.hasOwnProperty.call(Wo,h.key)&&(h.preventDefault(),e.store.moveSelectedNodes(Wo[h.key],h.shiftKey?4:1))}var l=qe(),u=fe(l);{var f=h=>{var p=E2();let y;var _=d(p);zc(_,{width:"100%",height:"100%",x:0,y:0}),c(p),Xt(p,(I,D)=>fr==null?void 0:fr(I,D),()=>({disabled:!1,store:e.store,onDrag:(I,D,H,R)=>{var K;(K=e.onnodedrag)==null||K.call(e,{event:I,targetNode:null,nodes:R})},onDragStart:(I,D,H,R)=>{var K;(K=e.onnodedragstart)==null||K.call(e,{event:I,targetNode:null,nodes:R})},onDragStop:(I,D,H,R)=>{var K;(K=e.onnodedragstop)==null||K.call(e,{event:I,targetNode:null,nodes:R})}})),bn(p,I=>z(n,I),()=>r(n)),$(I=>{Fe(p,1,We(["svelte-flow__selection-wrapper",e.store.noPanClass]),"svelte-3o9hpf"),Me(p,"role",e.store.disableKeyboardA11y?void 0:"button"),Me(p,"tabindex",e.store.disableKeyboardA11y?void 0:-1),y=Zt(p,"",y,I)},[()=>({width:_n(r(o).width),height:_n(r(o).height),transform:`translate(${r(o).x??""}px, ${r(o).y??""}px)`})]),we("contextmenu",p,a),we("click",p,s),we("keydown",p,function(...I){var D;(D=e.store.disableKeyboardA11y?void 0:i)==null||D.apply(this,I)}),x(h,p)},g=S(()=>e.store.selectionRectMode==="nodes"&&r(o)&&Nn(r(o).x)&&Nn(r(o).y));G(u,h=>{r(g)&&h(f)})}x(t,l),Qe()}Tt(["contextmenu","click","keydown"]);function z2(t){switch(t){case"ctrl":return 8;case"shift":return 4;case"alt":return 2;case"meta":return 1}}function kt(t,e){let{enabled:n=!0,trigger:o,type:a="keydown"}=e;function s(l){var g;const u=Array.isArray(o)?o:[o],f=[l.metaKey,l.altKey,l.shiftKey,l.ctrlKey].reduce((h,p,y)=>p?h|1<<y:h,0);for(const h of u){const p={preventDefault:!1,enabled:!0,...h},{modifier:y,key:_,callback:I,preventDefault:D,enabled:H}=p;if(H){if(l.key!==_)continue;if(y===null||y===!1){if(f!==0)continue}else if(y!==void 0&&((g=y==null?void 0:y[0])==null?void 0:g.length)>0){const K=Array.isArray(y)?y:[y];let V=!1;for(const U of K)if((Array.isArray(U)?U:[U]).reduce((ue,re)=>ue|z2(re),0)===f){V=!0;break}if(!V)continue}D&&l.preventDefault();const R={node:t,trigger:p,originalEvent:l};t.dispatchEvent(new CustomEvent("shortcut",{detail:R})),I==null||I(R)}}}let i;return n&&(i=Ia(t,a,s)),{update:l=>{const{enabled:u=!0,type:f="keydown"}=l;n&&(!u||a!==f)?i==null||i():!n&&u&&(i=Ia(t,f,s)),n=u,a=f,o=l.trigger},destroy:()=>{i==null||i()}}}function T2(){const t=S(er),e=s=>{var f,g;const i=Os(s)?s:r(t).nodeLookup.get(s.id),l=i.parentId?H_(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:((g=i.measured)==null?void 0:g.height)??i.height};return mr(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&&Os(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&&qy(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:qs(r(t).nodeLookup,s),getEdge:s=>r(t).edgeLookup.get(s),getEdges:s=>s===void 0?r(t).edges:qs(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:()=>js(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=mi(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=ks(s),f=u?s:e(s);return f?(l||r(t).nodes).filter(g=>{const h=r(t).nodeLookup.get(g.id);if(!h||!u&&g.id===s.id)return!1;const p=mr(h),y=qr(p,f);return i&&y>0||y>=p.width*p.height||y>=f.width*f.height}):[]},isNodeIntersecting:(s,i,l=!0)=>{const f=ks(s)?s:e(s);if(!f)return!1;const g=qr(f,i);return l&&g>0||g>=i.width*i.height||g>=f.width*f.height},deleteElements:async({nodes:s=[],edges:i=[]})=>{var f,g;const{nodes:l,edges:u}=await A_({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(h=>!l.some(({id:p})=>p===h.id))),u&&(r(t).edges=Cn(()=>r(t).edges).filter(h=>!u.some(({id:p})=>p===h.id))),(l.length>0||u.length>0)&&((g=(f=r(t)).ondelete)==null||g.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:g}=r(t).viewport,{x:h,y:p}=r(t).domNode.getBoundingClientRect(),y={x:s.x-h,y:s.y-p};return ro(y,[u,f,g],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:g}=r(t).domNode.getBoundingClientRect(),h=Uo(s,[i,l,u]);return{x:h.x+f,y:h.y+g}},toObject:()=>structuredClone({nodes:[...r(t).nodes],edges:[...r(t).edges],viewport:{...r(t).viewport}}),updateNode:n,updateNodeData:(s,i,l)=>{var g;const u=(g=r(t).nodeLookup.get(s))==null?void 0:g.internals.userNode;if(!u)return;const f=typeof i=="function"?i(u):i;n(s,h=>({...h,data:l!=null&&l.replace?f:{...h.data,...f}}))},updateEdge:o,getNodesBounds:s=>z_(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 qs(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 P2(t,e){Ze(e,!0);let n=je(e,"store",15),o=je(e,"selectionKey",3,"Shift"),a=je(e,"multiSelectionKey",19,()=>Yo()?"Meta":"Control"),s=je(e,"deleteKey",3,"Backspace"),i=je(e,"panActivationKey",3," "),l=je(e,"zoomActivationKey",19,()=>Yo()?"Meta":"Control"),{deleteElements:u}=T2();function f(I){return I!==null&&typeof I=="object"}function g(I){return f(I)?I.modifier||[]:[]}function h(I){return I==null?"":f(I)?I.key:I}function p(I,D){return(Array.isArray(I)?I:[I]).map(R=>{const K=h(R);return{key:K,modifier:g(R),enabled:K!==null,callback:D}})}function y(){n(n().selectionRect=null,!0),n(n().selectionKeyPressed=!1,!0),n(n().multiselectionKeyPressed=!1,!0),n(n().deleteKeyPressed=!1,!0),n(n().panActivationKeyPressed=!1,!0),n(n().zoomActivationKeyPressed=!1,!0)}function _(){const I=n().nodes.filter(H=>H.selected),D=n().edges.filter(H=>H.selected);u({nodes:I,edges:D})}Ln("blur",en,y),Ln("contextmenu",en,y),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(o(),()=>n(n().selectionKeyPressed=!0,!0)),type:"keydown"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(o(),()=>n(n().selectionKeyPressed=!1,!0)),type:"keyup"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(a(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:"keydown"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(a(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:"keyup"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(s(),I=>{!(I.originalEvent.ctrlKey||I.originalEvent.metaKey||I.originalEvent.shiftKey)&&!cc(I.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),_())}),type:"keydown"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(s(),()=>n(n().deleteKeyPressed=!1,!0)),type:"keyup"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(i(),()=>n(n().panActivationKeyPressed=!0,!0)),type:"keydown"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(i(),()=>n(n().panActivationKeyPressed=!1,!0)),type:"keyup"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(l(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:"keydown"})),Xt(en,(I,D)=>kt==null?void 0:kt(I,D),()=>({trigger:p(l(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:"keyup"})),Qe()}var I2=Rt('<path fill="none" class="svelte-flow__connection-path"></path>'),A2=Rt('<svg class="svelte-flow__connectionline"><g><!></g></svg>');function L2(t,e){Ze(e,!0);let n=S(()=>{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 In.Bezier:{const[l]=uc(i);return l}case In.Straight:{const[l]=vc(i);return l}case In.Step:case In.SmoothStep:{const[l]=_i({...i,borderRadius:e.type===In.Step?0:void 0});return l}}});var o=qe(),a=fe(o);{var s=i=>{var l=A2(),u=d(l),f=d(u);{var g=p=>{var y=qe(),_=fe(y);Zr(_,()=>e.LineComponent,(I,D)=>{D(I,{})}),x(p,y)},h=p=>{var y=I2();$(()=>{Me(y,"d",r(n)),Zt(y,e.style)}),x(p,y)};G(f,p=>{e.LineComponent?p(g):p(h,-1)})}c(u),c(l),$(p=>{Me(l,"width",e.store.width),Me(l,"height",e.store.height),Zt(l,e.containerStyle),Fe(u,0,p)},[()=>We(["svelte-flow__connection",E_(e.store.connection.isValid)])]),x(i,l)};G(a,i=>{e.store.connection.inProgress&&i(s)})}x(t,o),Qe()}var O2=k("<div><!></div>");function Tc(t,e){Ze(e,!0);let n=je(e,"position",3,"top-right"),o=Qn(e,["$$slots","$$events","$$legacy","position","style","class","children"]),a=S(()=>`${n()}`.split("-"));var s=O2();On(s,l=>({class:l,style:e.style,...o}),[()=>["svelte-flow__panel",e.class,...r(a)]]);var i=d(s);Kt(i,()=>e.children??nn),c(s),x(t,s),Qe()}var R2=k('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function D2(t,e){Ze(e,!0);let n=je(e,"position",3,"bottom-right");var o=qe(),a=fe(o);{var s=i=>{Tc(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=R2();x(l,f)},$$slots:{default:!0}})};G(a,i=>{var l;(l=e.proOptions)!=null&&l.hideAttribution||i(s)})}x(t,o),Qe()}var V2=k("<div><!></div>");function H2(t,e){Ze(e,!0);let n=je(e,"domNode",15),o=je(e,"clientWidth",15),a=je(e,"clientHeight",15),s=S(()=>e.rest.class),i=S(()=>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(g){g.currentTarget.scrollTo({top:0,left:0,behavior:"auto"}),e.rest.onscroll&&e.rest.onscroll(g)}var u=V2();On(u,g=>({class:["svelte-flow","svelte-flow__container",r(s),e.colorMode],"data-testid":"svelte-flow__wrapper",role:"application",onscroll:l,...r(i),[Jo]:g}),[()=>({width:_n(e.width),height:_n(e.height)})],void 0,void 0,"svelte-1hljjtg");var f=d(u);Kt(f,()=>e.children??nn),c(u),bn(u,g=>n(g),()=>n()),Oi(u,"clientHeight",a),Oi(u,"clientWidth",o),x(t,u),Qe()}var q2=k('<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>',1),F2=k("<!> <!>",1),K2=k("<!> <!> <!> <!> <!>",1);function B2(t,e){Ze(e,!0);let n=je(e,"paneClickDistance",3,1),o=je(e,"nodeClickDistance",3,1),a=je(e,"panOnScrollMode",19,()=>ur.Free),s=je(e,"preventScrolling",3,!0),i=je(e,"zoomOnScroll",3,!0),l=je(e,"zoomOnDoubleClick",3,!0),u=je(e,"zoomOnPinch",3,!0),f=je(e,"panOnScroll",3,!1),g=je(e,"panOnScrollSpeed",3,.5),h=je(e,"panOnDrag",3,!0),p=je(e,"selectionOnDrag",3,!1),y=je(e,"connectionLineType",19,()=>In.Bezier),_=je(e,"nodes",31,()=>zt([])),I=je(e,"edges",31,()=>zt([])),D=je(e,"viewport",15,void 0),H=Qn(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"]),R=t2({props:H,width:e.width,height:e.height,get nodes(){return _()},set nodes(V){_(V)},get edges(){return I()},set edges(V){I(V)},get viewport(){return D()},set viewport(V){D(V)}});const K=Go(ni);K&&K.setStore&&K.setStore(R),oi(ni,{provider:!1,getStore(){return R}}),Pt(()=>{var U;const V={nodes:R.selectedNodes,edges:R.selectedEdges};(U=Cn(()=>e.onselectionchange))==null||U(V);for(const ne of R.selectionChangeHandlers.values())ne(V)}),Zo(()=>{R.reset()}),H2(t,{get colorMode(){return R.colorMode},get width(){return e.width},get height(){return e.height},get rest(){return H},get domNode(){return R.domNode},set domNode(V){R.domNode=V},get clientWidth(){return R.width},set clientWidth(V){R.width=V},get clientHeight(){return R.height},set clientHeight(V){R.height=V},children:(V,U)=>{var ne=K2(),ue=fe(ne);P2(ue,{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 R},set store(w){R=w}});var re=v(ue,2);r2(re,{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 g()},get panOnDrag(){return h()},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 R},set store(w){R=w},children:(w,A)=>{a2(w,{get onpaneclick(){return e.onpaneclick},get onpanecontextmenu(){return e.onpanecontextmenu},get onselectionstart(){return e.onselectionstart},get onselectionend(){return e.onselectionend},get panOnDrag(){return h()},get paneClickDistance(){return n()},get selectionOnDrag(){return p()},get store(){return R},set store(b){R=b},children:(b,N)=>{var E=F2(),L=fe(E);s2(L,{get store(){return R},set store(W){R=W},children:(W,M)=>{var m=q2(),C=v(fe(m),2);S2(C,{get onedgeclick(){return e.onedgeclick},get onedgecontextmenu(){return e.onedgecontextmenu},get onedgepointerenter(){return e.onedgepointerenter},get onedgepointerleave(){return e.onedgepointerleave},get store(){return R},set store(J){R=J}});var P=v(C,4);L2(P,{get type(){return y()},get LineComponent(){return e.connectionLineComponent},get containerStyle(){return e.connectionLineContainerStyle},get style(){return e.connectionLineStyle},get store(){return R},set store(J){R=J}});var X=v(P,2);p2(X,{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 R},set store(J){R=J}});var le=v(X,2);M2(le,{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 R},set store(J){R=J}}),Te(2),x(W,m)},$$slots:{default:!0}});var F=v(L,2);{let W=S(()=>!!(R.selectionRect&&R.selectionRectMode==="user")),M=S(()=>{var X;return(X=R.selectionRect)==null?void 0:X.width}),m=S(()=>{var X;return(X=R.selectionRect)==null?void 0:X.height}),C=S(()=>{var X;return(X=R.selectionRect)==null?void 0:X.x}),P=S(()=>{var X;return(X=R.selectionRect)==null?void 0:X.y});zc(F,{get isVisible(){return r(W)},get width(){return r(M)},get height(){return r(m)},get x(){return r(C)},get y(){return r(P)}})}x(b,E)},$$slots:{default:!0}})},$$slots:{default:!0}});var ae=v(re,2);D2(ae,{get proOptions(){return e.proOptions},get position(){return e.attributionPosition}});var pe=v(ae,2);d2(pe,{get store(){return R}});var O=v(pe,2);Kt(O,()=>e.children??nn),x(V,ne)},$$slots:{default:!0}}),Qe()}var j2=k("<button><!></button>");function yo(t,e){let n=Qn(e,["$$slots","$$events","$$legacy","class","bgColor","bgColorHover","color","colorHover","borderColor","onclick","children"]);var o=j2();On(o,()=>({type:"button",onclick:e.onclick,class:["svelte-flow__controls-button",e.class],...n,[Jo]:{"--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??nn),c(o),x(t,o)}var U2=Rt('<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 Y2(t){var e=U2();x(t,e)}var W2=Rt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function X2(t){var e=W2();x(t,e)}var $2=Rt('<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 G2(t){var e=$2();x(t,e)}var Z2=Rt('<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 Q2(t){var e=Z2();x(t,e)}var J2=Rt('<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 ew(t){var e=J2();x(t,e)}var tw=k("<!> <!>",1),nw=k("<!> <!> <!> <!> <!> <!>",1);function rw(t,e){Ze(e,!0);let n=je(e,"position",3,"bottom-left"),o=je(e,"orientation",3,"vertical"),a=je(e,"showZoom",3,!0),s=je(e,"showFitView",3,!0),i=je(e,"showLock",3,!0),l=Qn(e,["$$slots","$$events","$$legacy","position","orientation","showZoom","showFitView","showLock","style","class","buttonBgColor","buttonBgColorHover","buttonColor","buttonColorHover","buttonBorderColor","fitViewOptions","children","before","after"]),u=S(er);const f={bgColor:e.buttonBgColor,bgColorHover:e.buttonBgColorHover,color:e.buttonColor,colorHover:e.buttonColorHover,borderColor:e.buttonBorderColor};let g=S(()=>r(u).nodesDraggable||r(u).nodesConnectable||r(u).elementsSelectable),h=S(()=>r(u).viewport.zoom<=r(u).minZoom),p=S(()=>r(u).viewport.zoom>=r(u).maxZoom),y=S(()=>r(u).ariaLabelConfig),_=S(()=>o()==="horizontal"?"horizontal":"vertical");const I=()=>{r(u).zoomIn()},D=()=>{r(u).zoomOut()},H=()=>{r(u).fitView(e.fitViewOptions)},R=()=>{let K=!r(g);r(u).nodesDraggable=K,r(u).nodesConnectable=K,r(u).elementsSelectable=K};{let K=S(()=>["svelte-flow__controls",r(_),e.class]);Tc(t,tt({get class(){return r(K)},get position(){return n()},"data-testid":"svelte-flow__controls",get"aria-label"(){return r(y)["controls.ariaLabel"]},get style(){return e.style}},()=>l,{children:(V,U)=>{var ne=nw(),ue=fe(ne);{var re=W=>{var M=qe(),m=fe(M);Kt(m,()=>e.before),x(W,M)};G(ue,W=>{e.before&&W(re)})}var ae=v(ue,2);{var pe=W=>{var M=tw(),m=fe(M);yo(m,tt({onclick:I,class:"svelte-flow__controls-zoomin",get title(){return r(y)["controls.zoomIn.ariaLabel"]},get"aria-label"(){return r(y)["controls.zoomIn.ariaLabel"]},get disabled(){return r(p)}},()=>f,{children:(P,X)=>{Y2(P)},$$slots:{default:!0}}));var C=v(m,2);yo(C,tt({onclick:D,class:"svelte-flow__controls-zoomout",get title(){return r(y)["controls.zoomOut.ariaLabel"]},get"aria-label"(){return r(y)["controls.zoomOut.ariaLabel"]},get disabled(){return r(h)}},()=>f,{children:(P,X)=>{X2(P)},$$slots:{default:!0}})),x(W,M)};G(ae,W=>{a()&&W(pe)})}var O=v(ae,2);{var w=W=>{yo(W,tt({class:"svelte-flow__controls-fitview",onclick:H,get title(){return r(y)["controls.fitView.ariaLabel"]},get"aria-label"(){return r(y)["controls.fitView.ariaLabel"]}},()=>f,{children:(M,m)=>{G2(M)},$$slots:{default:!0}}))};G(O,W=>{s()&&W(w)})}var A=v(O,2);{var b=W=>{yo(W,tt({class:"svelte-flow__controls-interactive",onclick:R,get title(){return r(y)["controls.interactive.ariaLabel"]},get"aria-label"(){return r(y)["controls.interactive.ariaLabel"]}},()=>f,{children:(M,m)=>{var C=qe(),P=fe(C);{var X=J=>{ew(J)},le=J=>{Q2(J)};G(P,J=>{r(g)?J(X):J(le,-1)})}x(M,C)},$$slots:{default:!0}}))};G(A,W=>{i()&&W(b)})}var N=v(A,2);{var E=W=>{var M=qe(),m=fe(M);Kt(m,()=>e.children),x(W,M)};G(N,W=>{e.children&&W(E)})}var L=v(N,2);{var F=W=>{var M=qe(),m=fe(M);Kt(m,()=>e.after),x(W,M)};G(L,W=>{e.after&&W(F)})}x(V,ne)},$$slots:{default:!0}}))}Qe()}var En;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(En||(En={}));var ow=Rt("<circle></circle>");function aw(t,e){var n=ow();$(()=>{Me(n,"cx",e.radius),Me(n,"cy",e.radius),Me(n,"r",e.radius),Fe(n,0,We(["svelte-flow__background-pattern","dots",e.class]))}),x(t,n)}var iw=Rt("<path></path>");function sw(t,e){Ze(e,!0);var n=iw();$(()=>{Me(n,"stroke-width",e.lineWidth),Me(n,"d",`M${e.dimensions[0]/2} 0 V${e.dimensions[1]} M0 ${e.dimensions[1]/2} H${e.dimensions[0]}`),Fe(n,0,We(["svelte-flow__background-pattern",e.variant,e.class]))}),x(t,n),Qe()}const lw={[En.Dots]:1,[En.Lines]:1,[En.Cross]:6};var cw=Rt('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');function dw(t,e){Ze(e,!0);let n=je(e,"variant",19,()=>En.Dots),o=je(e,"gap",3,20),a=je(e,"lineWidth",3,1),s=S(er),i=S(()=>n()===En.Dots),l=S(()=>n()===En.Cross),u=S(()=>Array.isArray(o())?o():[o(),o()]),f=S(()=>`background-pattern-${r(s).flowId}-${e.id??""}`),g=S(()=>[r(u)[0]*r(s).viewport.zoom||1,r(u)[1]*r(s).viewport.zoom||1]),h=S(()=>(e.size??lw[n()])*r(s).viewport.zoom),p=S(()=>r(l)?[r(h),r(h)]:r(g)),y=S(()=>r(i)?[r(h)/2,r(h)/2]:[r(p)[0]/2,r(p)[1]/2]);var _=cw();let I;var D=d(_),H=d(D);{var R=U=>{{let ne=S(()=>r(h)/2);aw(U,{get radius(){return r(ne)},get class(){return e.patternClass}})}},K=U=>{sw(U,{get dimensions(){return r(p)},get variant(){return n()},get lineWidth(){return a()},get class(){return e.patternClass}})};G(H,U=>{r(i)?U(R):U(K,-1)})}c(D);var V=v(D);c(_),$(()=>{Fe(_,0,We(["svelte-flow__background","svelte-flow__container",e.class])),I=Zt(_,"",I,{"--xy-background-color-props":e.bgColor,"--xy-background-pattern-color-props":e.patternColor}),Me(D,"id",r(f)),Me(D,"x",r(s).viewport.x%r(g)[0]),Me(D,"y",r(s).viewport.y%r(g)[1]),Me(D,"width",r(g)[0]),Me(D,"height",r(g)[1]),Me(D,"patternTransform",`translate(-${r(y)[0]},-${r(y)[1]})`),Me(V,"fill",`url(#${r(f)})`)}),x(t,_),Qe()}var uw=k('<!> <!> <div><div class="stripe svelte-hw5n61"></div> <div class="body svelte-hw5n61"><div class="head svelte-hw5n61"><span class="role svelte-hw5n61"> </span> <span class="dot svelte-hw5n61"></span></div> <div class="label svelte-hw5n61"> </div> <div class="meta svelte-hw5n61"><span class="metric svelte-hw5n61"><span class="n svelte-hw5n61"> </span><span class="u svelte-hw5n61">colls</span></span> <span class="sep svelte-hw5n61">·</span> <span class="metric svelte-hw5n61"><span class="n svelte-hw5n61"> </span><span class="u svelte-hw5n61">entities</span></span></div></div></div>',1);function fw(t,e){Ze(e,!0);const n=S(()=>e.data.role==="primary"?"role-primary":e.data.role==="replica"?"role-replica":"role-embedded");var o=uw(),a=fe(o);yr(a,{type:"target",get position(){return ft.Left},style:"opacity:0;pointer-events:none"});var s=v(a,2);yr(s,{type:"source",get position(){return ft.Right},style:"opacity:0;pointer-events:none"});var i=v(s,2);let l;var u=v(d(i),2),f=d(u),g=d(f),h=d(g,!0);c(g),Te(2),c(f);var p=v(f,2),y=d(p,!0);c(p);var _=v(p,2),I=d(_),D=d(I),H=d(D,!0);c(D),Te(),c(I);var R=v(I,4),K=d(R),V=d(K,!0);c(K),Te(),c(R),c(_),c(u),c(i),$(U=>{l=Fe(i,1,`card ${r(n)??""}`,"svelte-hw5n61",l,{selected:e.selected}),T(h,e.data.role),T(y,e.data.label),T(H,e.data.collections),T(V,U)},[()=>e.data.entities.toLocaleString()]),x(t,o),Qe()}var vw=k('<div class="absolute inset-0 grid place-items-center text-fg-3 font-mono text-[12px]">Probing reachable nodes…</div>'),gw=k('<div class="p-6"><!></div>'),pw=k('<div class="p-6"><!></div>'),hw=k("<!> <!>",1),xw=k('<button><span></span> <span class="font-mono text-[11px] text-fg-1 flex-1 truncate"> </span> <span class="font-mono text-[10px] text-fg-3"> </span></button>'),bw=k('<div class="grid grid-cols-2 gap-3 mb-3 pb-3 border-b border-line-1"><div><div class="type-label">reachable</div> <div class="font-mono text-fg-0 text-[18px] font-semibold mt-0.5"> <span class="text-fg-3 text-[11px] font-normal ml-1"> </span></div></div> <div><div class="type-label">entities</div> <div class="font-mono text-accent text-[18px] font-semibold mt-0.5"> </div></div></div> <div class="grid gap-1"></div>',1),mw=k('<div class="pt-2 mt-1 border-t border-line-1"></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">host</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">process</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">connections</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">collections</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">entities</span> <span class="text-accent"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">cross refs</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">store memory</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">storage</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">ram</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">cpu</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">requests/sec</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">read/write</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">avg response</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">uptime</span> <span class="text-fg-0"> </span></div>',1),_w=k('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">wal lsn</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">wal size</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">oldest lsn</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">replicas</span> <span class="text-fg-0"> </span></div>',1),yw=k('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">lag</span> <span><!></span></div>'),ww=k('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">applied</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <!>',1),kw=k('<div class="pt-2 mt-1 border-t border-line-1"></div> <!>',1),Cw=k('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-3"> </span>'),Sw=k('<div class="grid gap-2 font-mono text-[11px]"><div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">label</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">url</span> <code class="text-fg-0 break-all"> </code></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">deployment</span> <span><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">evidence</span> <span class="text-fg-1"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">role</span> <span><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">replicas</span> <span class="text-fg-0"><!></span></div> <!> <!> <div class="pt-2 mt-1 border-t border-line-1"></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-start"><span class="text-fg-3">not exposed</span> <span class="flex flex-wrap gap-1"></span></div></div>'),Nw=k('<div class="absolute top-4 right-4 z-10 w-[420px] max-h-[calc(100vh-96px)] overflow-auto"><!></div>'),Ew=k('<div class="absolute inset-0"><!></div> <div class="absolute top-4 left-4 z-10 w-64"><!></div> <!>',1);function Mw(t,e){Ze(e,!0);let n=ye(zt([])),o=ye(!0),a=ye(null);const s=new Map,i=new Map,l=6e4,u={cluster:fw},f=S(()=>{const M=jn.current==="dark";return{ok:M?"#4ade80":"#16a34a",warn:M?"#fbbf24":"#b45309",pattern:M?"#1c2027":"#d4d4d8",labelBg:M?"#0d0f13":"#fafafa",labelStroke:M?"#2a2e36":"#d4d4d8"}});async function g(){const M=Date.now(),m=await Promise.all(wd.map(async C=>{const P=s.get(C.id)??0,X=i.get(C.id)??0;if(P>=2&&M-X<l)return r(n).find(J=>J.id===C.id)??{id:C.id,preset:C,reachable:!1,role:"standalone"};i.set(C.id,M);const le=new kd(C.url);try{const[J,Y,Z]=await Promise.all([Mt.track(`cluster · ${C.label} stats`,()=>le.stats()),Mt.track(`cluster · ${C.label} replication`,()=>le.replication()).catch(()=>{}),Mt.track(`cluster · ${C.label} status`,()=>le.clusterStatus()).catch(()=>{})]);return s.set(C.id,0),{id:C.id,preset:C,reachable:!0,role:(Y==null?void 0:Y.role)??"standalone",stats:J,replication:Y,cluster:Z}}catch{return s.set(C.id,P+1),{id:C.id,preset:C,reachable:!1,role:"standalone"}}}));z(n,m,!0),z(o,!1)}Pt(()=>{if(Lt.locked){z(o,!1);return}z(o,!0),g();const M=setInterval(g,5e3);return()=>clearInterval(M)});const h=S(()=>r(n).filter(M=>M.reachable)),p=S(()=>r(h).map(M=>{var C,P;const m=M.role==="primary"?0:M.role==="replica"?1:-1;return{id:M.id,type:"cluster",position:{x:320+m*320,y:200},data:{label:M.preset.label,role:M.role,collections:((C=M.stats)==null?void 0:C.store.collection_count)??0,entities:((P=M.stats)==null?void 0:P.store.total_entities)??0,url:M.preset.url}}})),y=S(()=>r(h).filter(M=>M.role==="replica").map(M=>{var le,J;const m=r(h).find(Y=>Y.role==="primary");if(!m)return null;const C=((le=M.replication)==null?void 0:le.last_applied_lsn)!==void 0&&((J=M.replication)==null?void 0:J.last_seen_primary_lsn)!==void 0?M.replication.last_seen_primary_lsn-M.replication.last_applied_lsn:null,P=C===0,X=P?r(f).ok:r(f).warn;return{id:`${m.id}-${M.id}`,source:m.id,target:M.id,type:"smoothstep",animated:!0,style:`stroke:${X};stroke-width:1.5;opacity:0.7`,label:C===null?"":P?"✓ in sync":`lag ${C}`,labelStyle:`fill:${X};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(M=>M!==null)),_=S(()=>r(n).find(M=>M.id===r(a))),I=S(()=>r(h).reduce((M,m)=>{var C;return M+(((C=m.stats)==null?void 0:C.store.total_entities)??0)},0));function D(M){var C,P;const m=(P=(C=M.cluster)==null?void 0:C.deployment)==null?void 0:P.mode;return m||(M.preset.id==="embedded"?"embedded file endpoint":M.preset.id.startsWith("docker-")?"server · docker preset":"server endpoint")}function H(M){var C;const m=(C=M.cluster)==null?void 0:C.deployment;return m!=null&&m.file_path?m.file_path:m!=null&&m.container_id||m!=null&&m.image?[m.container_id,m.image].filter(Boolean).join(" · "):m!=null&&m.configured_by||m!=null&&m.process_kind?[m.configured_by,m.process_kind].filter(Boolean).join(" · "):M.preset.id==="embedded"||M.preset.id.startsWith("docker-")?M.preset.description:"reddb has not exposed process/container metadata yet"}function R(M){var C,P;const m=(P=(C=M.cluster)==null?void 0:C.deployment)==null?void 0:P.mode;return m==="docker"?"info":m==="embedded"?"ok":m==="replicated"?"accent":M.preset.id.startsWith("docker-")?"info":M.preset.id==="embedded"?"ok":"neutral"}function K(M){return M===void 0||!Number.isFinite(M)?"not exposed":M>=1024**3?`${(M/1024**3).toFixed(1)} GiB`:M>=1024**2?`${(M/1024**2).toFixed(1)} MiB`:M>=1024?`${(M/1024).toFixed(1)} KiB`:`${M} B`}function V(M,m){return m<=0?"n/a":`${Math.round(M/m*100)}%`}function U(M){const m=Math.max(0,Math.round((Date.now()-M)/1e3));return m>=86400?`${Math.floor(m/86400)}d ${Math.floor(m%86400/3600)}h`:m>=3600?`${Math.floor(m/3600)}h ${Math.floor(m%3600/60)}m`:m>=60?`${Math.floor(m/60)}m ${m%60}s`:`${m}s`}function ne(M){const m=M.replication;return(m==null?void 0:m.last_applied_lsn)===void 0||m.last_seen_primary_lsn===void 0?null:m.last_seen_primary_lsn-m.last_applied_lsn}function ue(M){return M.system.total_memory_bytes-M.system.available_memory_bytes}function re(...M){return M.find(m=>m!==void 0&&Number.isFinite(m))}function ae(M){return M===void 0||!Number.isFinite(M)?"not exposed":`${M.toLocaleString(void 0,{maximumFractionDigits:1})}/s`}function pe(M){return M===void 0||!Number.isFinite(M)?"not exposed":`${M.toLocaleString(void 0,{maximumFractionDigits:1})} ms`}function O(M){var X,le,J,Y,Z,Q;const m=(le=(X=M.cluster)==null?void 0:X.storage)==null?void 0:le.used_bytes,C=(Y=(J=M.cluster)==null?void 0:J.storage)==null?void 0:Y.capacity_bytes,P=(Q=(Z=M.cluster)==null?void 0:Z.storage)==null?void 0:Q.free_bytes;return m===void 0&&C===void 0&&P===void 0?"not exposed":m!==void 0&&C!==void 0?`${K(m)} / ${K(C)} (${V(m,C)})`:m!==void 0&&P!==void 0?`${K(m)} used · ${K(P)} free`:C!==void 0&&P!==void 0?`${K(P)} free / ${K(C)}`:K(m??C??P)}function w(M,m){var C,P,X,le,J,Y,Z,Q,se;return m==="storage capacity"?(C=M.cluster)==null?void 0:C.storage:m==="wal size bytes"?((X=(P=M.cluster)==null?void 0:P.wal)==null?void 0:X.size_bytes)!==void 0:m==="throughput"?(le=M.cluster)==null?void 0:le.throughput:m==="avg response time"?((Y=(J=M.cluster)==null?void 0:J.throughput)==null?void 0:Y.avg_response_ms)!==void 0:m==="cpu usage"?((Q=(Z=M.cluster)==null?void 0:Z.system)==null?void 0:Q.cpu_usage_percent)!==void 0:m==="deployment metadata"?(se=M.cluster)==null?void 0:se.deployment:!1}const A=["storage capacity","wal size bytes","throughput","avg response time","cpu usage","deployment metadata"];var b=qe(),N=fe(b);{var E=M=>{var m=vw();x(M,m)},L=M=>{var m=gw(),C=d(m);Io(C,{get icon(){return wr},title:"Locked",message:"Unlock the secure store to probe configured nodes. Automatic probes are paused until you authenticate this session."}),c(m),x(M,m)},F=M=>{var m=pw(),C=d(m);Io(C,{get icon(){return bu},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(m),x(M,m)},W=M=>{var m=Ew(),C=fe(m),P=d(C);B2(P,{get nodes(){return r(p)},get edges(){return r(y)},get nodeTypes(){return u},fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,onnodeclick:Z=>z(a,Z.node.id,!0),children:(Z,Q)=>{var se=hw(),B=fe(se);dw(B,{get variant(){return En.Dots},bgColor:"transparent",get patternColor(){return r(f).pattern},gap:32,size:1});var q=v(B,2);rw(q,{position:"bottom-right"}),x(Z,se)},$$slots:{default:!0}}),c(C);var X=v(C,2),le=d(X);Bn(le,{title:"cluster",children:(Z,Q)=>{var se=bw(),B=fe(se),q=d(B),ee=v(d(q),2),oe=d(ee,!0),te=v(oe),ge=d(te);c(te),c(ee),c(q);var xe=v(q,2),_e=v(d(xe),2),ze=d(_e,!0);c(_e),c(xe),c(B);var be=v(B,2);Je(be,21,()=>r(h),qt,(ve,Ne)=>{var Pe=xw(),de=d(Pe),ie=v(de,2),me=d(ie,!0);c(ie);var Ce=v(ie,2),ke=d(Ce,!0);c(Ce),c(Pe),$((Ee,he,Se)=>{Fe(Pe,1,Ee),Fe(de,1,he),T(me,r(Ne).preset.label),T(ke,Se)},[()=>We(["flex items-center gap-2.5 px-2 py-1.5 rounded text-left bg-transparent border-0 cursor-pointer transition-colors",r(a)===r(Ne).id?"bg-bg-2":"hover:bg-bg-2"].join(" ")),()=>We(["w-1.5 h-1.5 rounded-full shrink-0",r(Ne).role==="primary"?"bg-role-primary":r(Ne).role==="replica"?"bg-role-replica":"bg-role-embedded"].join(" ")),()=>{var Ee;return((Ee=r(Ne).stats)==null?void 0:Ee.store.total_entities.toLocaleString())??0}]),we("click",Pe,()=>z(a,r(Ne).id,!0)),x(ve,Pe)}),c(be),$(ve=>{T(oe,r(h).length),T(ge,`of ${r(n).length??""}`),T(ze,ve)},[()=>r(I).toLocaleString()]),x(Z,se)},$$slots:{default:!0}}),c(X);var J=v(X,2);{var Y=Z=>{var Q=Nw(),se=d(Q);Bn(se,{get title(){return`node · ${r(_).id??""}`},floating:!0,children:(B,q)=>{var ee=Sw(),oe=d(ee),te=v(d(oe),2),ge=d(te,!0);c(te),c(oe);var xe=v(oe,2),_e=v(d(xe),2),ze=d(_e,!0);c(_e),c(xe);var be=v(xe,2),ve=v(d(be),2),Ne=d(ve);{let Ie=S(()=>R(r(_)));kn(Ne,{get tone(){return r(Ie)},children:(Ve,j)=>{Te();var Re=pt();$(Le=>T(Re,Le),[()=>D(r(_))]),x(Ve,Re)},$$slots:{default:!0}})}c(ve),c(be);var Pe=v(be,2),de=v(d(Pe),2),ie=d(de,!0);c(de),c(Pe);var me=v(Pe,2),Ce=v(d(me),2),ke=d(Ce);{let Ie=S(()=>r(_).role==="primary"?"primary":r(_).role==="replica"?"replica":"embedded");Kd(ke,{get role(){return r(Ie)},get label(){return r(_).role}})}c(Ce),c(me);var Ee=v(me,2),he=v(d(Ee),2),Se=d(he);{var Ae=Ie=>{var Ve=pt();$(()=>T(Ve,r(_).replication.replica_count??0)),x(Ie,Ve)},He=Ie=>{var Ve=pt();$(()=>T(Ve,`connected to ${r(_).replication.primary_addr??"primary"??""}`)),x(Ie,Ve)},nt=Ie=>{var Ve=pt("none exposed");x(Ie,Ve)};G(Se,Ie=>{var Ve,j;((Ve=r(_).replication)==null?void 0:Ve.role)==="primary"?Ie(Ae):((j=r(_).replication)==null?void 0:j.role)==="replica"?Ie(He,1):Ie(nt,-1)})}c(he),c(Ee);var Ke=v(Ee,2);{var Ge=Ie=>{var Ve=mw(),j=v(fe(Ve),2),Re=v(d(j),2),Le=d(Re);c(Re),c(j);var Be=v(j,2),Ye=v(d(Be),2),at=d(Ye);c(Ye),c(Be);var ct=v(Be,2),gt=v(d(ct),2),rt=d(gt),Xe=v(rt),et=d(Xe);c(Xe),c(gt),c(ct);var ot=v(ct,2),ut=v(d(ot),2),ht=d(ut,!0);c(ut),c(ot);var xt=v(ot,2),Nt=v(d(xt),2),bt=d(Nt,!0);c(Nt),c(xt);var mt=v(xt,2),Ct=v(d(mt),2),Et=d(Ct,!0);c(Ct),c(mt);var Ot=v(mt,2),Vt=v(d(Ot),2),Bt=d(Vt,!0);c(Vt),c(Ot);var Ut=v(Ot,2),an=v(d(Ut),2),fn=d(an,!0);c(an),c(Ut);var vn=v(Ut,2),zn=v(d(vn),2),Rn=d(zn),Dn=v(Rn),kr=d(Dn);c(Dn),c(zn),c(vn);var Tn=v(vn,2),Vn=v(d(Tn),2),Hn=d(Vn),tr=v(Hn),yt=d(tr);c(tr),c(Vn),c(Tn);var St=v(Tn,2),Ht=v(d(St),2),sn=d(Ht,!0);c(Ht),c(St);var Pn=v(St,2),oo=v(d(Pn),2),ao=d(oo),nr=v(ao),qn=d(nr);c(nr),c(oo),c(Pn);var Cr=v(Pn,2),io=v(d(Cr),2),Pc=d(io,!0);c(io),c(Cr);var Ni=v(Cr,2),Ei=v(d(Ni),2),Ic=d(Ei,!0);c(Ei),c(Ni),$((It,At,so,lo,Ac,Lc,Oc,Rc,Dc,Vc,Hc,qc)=>{var Mi,zi;T(Le,`${r(_).stats.system.hostname??""} · ${r(_).stats.system.os??""}/${r(_).stats.system.arch??""}`),T(at,`pid ${r(_).stats.system.pid??""}`),T(rt,`${r(_).stats.active_connections??""} active `),T(et,`/ ${r(_).stats.idle_connections??""} idle`),T(ht,r(_).stats.store.collection_count),T(bt,It),T(Et,At),T(Bt,so),T(fn,lo),T(Rn,`${Ac??""} used `),T(kr,`/ ${Lc??""}
|
|
916
|
+
(${Oc??""})`),T(Hn,`${r(_).stats.system.cpu_cores??""} cores `),T(yt,`· ${((zi=(Mi=r(_).cluster)==null?void 0:Mi.system)==null?void 0:zi.cpu_usage_percent)===void 0?"usage not exposed":`${r(_).cluster.system.cpu_usage_percent}%`}`),T(sn,Rc),T(ao,`${Dc??""} `),T(qn,`/ ${Vc??""}`),T(Pc,Hc),T(Ic,qc)},[()=>r(_).stats.store.total_entities.toLocaleString(),()=>r(_).stats.store.cross_ref_count.toLocaleString(),()=>K(r(_).stats.store.total_memory_bytes),()=>O(r(_)),()=>{var It,At;return K(re((At=(It=r(_).cluster)==null?void 0:It.system)==null?void 0:At.memory_used_bytes,ue(r(_).stats)))},()=>{var It,At;return K(re((At=(It=r(_).cluster)==null?void 0:It.system)==null?void 0:At.memory_total_bytes,r(_).stats.system.total_memory_bytes))},()=>{var It,At,so,lo;return V(re((At=(It=r(_).cluster)==null?void 0:It.system)==null?void 0:At.memory_used_bytes,ue(r(_).stats))??0,re((lo=(so=r(_).cluster)==null?void 0:so.system)==null?void 0:lo.memory_total_bytes,r(_).stats.system.total_memory_bytes)??0)},()=>{var It,At;return ae((At=(It=r(_).cluster)==null?void 0:It.throughput)==null?void 0:At.requests_per_second)},()=>{var It,At;return ae((At=(It=r(_).cluster)==null?void 0:It.throughput)==null?void 0:At.reads_per_second)},()=>{var It,At;return ae((At=(It=r(_).cluster)==null?void 0:It.throughput)==null?void 0:At.writes_per_second)},()=>{var It,At;return pe((At=(It=r(_).cluster)==null?void 0:It.throughput)==null?void 0:At.avg_response_ms)},()=>U(r(_).stats.started_at_unix_ms)]),x(Ie,Ve)};G(Ke,Ie=>{r(_).stats&&Ie(Ge)})}var dt=v(Ke,2);{var vt=Ie=>{var Ve=kw(),j=v(fe(Ve),2);{var Re=Be=>{var Ye=_w(),at=fe(Ye),ct=v(d(at),2),gt=d(ct,!0);c(ct),c(at);var rt=v(at,2),Xe=v(d(rt),2),et=d(Xe,!0);c(Xe),c(rt);var ot=v(rt,2),ut=v(d(ot),2),ht=d(ut,!0);c(ut),c(ot);var xt=v(ot,2),Nt=v(d(xt),2),bt=d(Nt,!0);c(Nt),c(xt),$(mt=>{var Ct,Et,Ot,Vt,Bt,Ut;T(gt,((Et=(Ct=r(_).cluster)==null?void 0:Ct.wal)==null?void 0:Et.lsn)??r(_).replication.wal_lsn),T(et,mt),T(ht,((Vt=(Ot=r(_).cluster)==null?void 0:Ot.wal)==null?void 0:Vt.oldest_lsn)??r(_).replication.oldest_lsn??"not exposed"),T(bt,((Ut=(Bt=r(_).cluster)==null?void 0:Bt.replication)==null?void 0:Ut.replica_count)??r(_).replication.replica_count??0)},[()=>{var mt,Ct;return K((Ct=(mt=r(_).cluster)==null?void 0:mt.wal)==null?void 0:Ct.size_bytes)}]),x(Be,Ye)},Le=Be=>{const Ye=S(()=>ne(r(_)));var at=ww(),ct=fe(at),gt=v(d(ct),2),rt=d(gt),Xe=v(rt),et=d(Xe);c(Xe),c(gt),c(ct);var ot=v(ct,2);{var ut=ht=>{var xt=yw(),Nt=v(d(xt),2),bt=d(Nt);{var mt=Et=>{kn(Et,{tone:"ok",children:(Ot,Vt)=>{Te();var Bt=pt("in sync");x(Ot,Bt)},$$slots:{default:!0}})},Ct=Et=>{kn(Et,{tone:"warn",children:(Ot,Vt)=>{Te();var Bt=pt();$(()=>{var Ut,an,fn,vn;return T(Bt,(an=(Ut=r(_).cluster)==null?void 0:Ut.replication)!=null&&an.lag_ms?`${r(_).cluster.replication.lag_ms} ms`:`${((vn=(fn=r(_).cluster)==null?void 0:fn.replication)==null?void 0:vn.lag_lsn)??r(Ye)} lsn`)}),x(Ot,Bt)},$$slots:{default:!0}})};G(bt,Et=>{r(Ye)===0?Et(mt):Et(Ct,-1)})}c(Nt),c(xt),x(ht,xt)};G(ot,ht=>{r(Ye)!==null&&ht(ut)})}$(()=>{T(rt,`${r(_).replication.last_applied_lsn??""} `),T(et,`/ ${r(_).replication.last_seen_primary_lsn??""}`)}),x(Be,at)};G(j,Be=>{r(_).replication.role==="primary"?Be(Re):r(_).replication.role==="replica"&&Be(Le,1)})}x(Ie,Ve)};G(dt,Ie=>{r(_).replication&&Ie(vt)})}var $e=v(dt,4),Oe=v(d($e),2);Je(Oe,21,()=>A,qt,(Ie,Ve)=>{var j=qe(),Re=fe(j);{var Le=Ye=>{var at=Cw(),ct=d(at,!0);c(at),$(()=>T(ct,r(Ve))),x(Ye,at)},Be=S(()=>!w(r(_),r(Ve)));G(Re,Ye=>{r(Be)&&Ye(Le)})}x(Ie,j)}),c(Oe),c($e),c(ee),$(Ie=>{T(ge,r(_).preset.label),T(ze,r(_).preset.url),T(ie,Ie)},[()=>H(r(_))]),x(B,ee)},$$slots:{default:!0}}),c(Q),x(Z,Q)};G(J,Z=>{r(_)&&Z(Y)})}x(M,m)};G(N,M=>{r(o)?M(E):Lt.locked?M(L,1):r(h).length===0?M(F,2):M(W,-1)})}x(t,b),Qe()}Tt(["click"]);var zw=k('<div class="type-label mb-1.5"> </div>'),Tw=k('<p class="type-caption m-0 mt-1.5"> </p>'),Pw=k('<div class="flex items-center gap-2 shrink-0"><!></div>'),Iw=k('<header class="flex items-end justify-between gap-4 pb-4 mb-4 border-b border-line-1"><div class="min-w-0"><!> <div class="flex items-baseline gap-3 flex-wrap"><h1 class="type-h1 m-0"> </h1> <!></div> <!></div> <!></header>');function Aw(t,e){var n=Iw(),o=d(n),a=d(o);{var s=_=>{var I=zw(),D=d(I,!0);c(I),$(()=>T(D,e.eyebrow)),x(_,I)};G(a,_=>{e.eyebrow&&_(s)})}var i=v(a,2),l=d(i),u=d(l,!0);c(l);var f=v(l,2);Kt(f,()=>e.children??nn),c(i);var g=v(i,2);{var h=_=>{var I=Tw(),D=d(I,!0);c(I),$(()=>T(D,e.subtitle)),x(_,I)};G(g,_=>{e.subtitle&&_(h)})}c(o);var p=v(o,2);{var y=_=>{var I=Pw(),D=d(I);Kt(D,()=>e.actions),c(I),x(_,I)};G(p,_=>{e.actions&&_(y)})}c(n),$(()=>T(u,e.title)),x(t,n)}var Lw=k('<button type="button" class="inline-flex h-7 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> refresh</button>'),Ow=k('<div class="text-[12px] font-mono text-warn break-words"> </div>'),Rw=k('<span class="text-fg-3">note</span> <span class="text-fg-1"> </span>',1),Dw=k('<div class="grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-[12px] font-mono"><span class="text-fg-3">authenticated</span> <span><!></span> <span class="text-fg-3">username</span> <span class="text-fg-0"> </span> <span class="text-fg-3">role</span> <span class="text-accent"> </span> <!></div>'),Vw=k('<div class="text-[12px] font-mono text-fg-3">Loading session…</div>'),Hw=k('<div class="mb-2 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> tenants endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),qw=k('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No tenants returned for this principal.</span></div>'),Fw=k('<div class="rounded border border-line-1 bg-bg-0 px-2 py-1.5"><div class="flex items-center gap-2"><span class="text-fg-0"> </span> <!></div> <div class="mt-1 text-fg-3"> <!></div></div>'),Kw=k('<div class="grid gap-1 text-[12px] font-mono"></div>'),Bw=k('<div class="mb-2 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> policies endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),jw=k('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No policies returned for this principal.</span></div>'),Uw=k('<div class="rounded border border-line-1 bg-bg-0 px-2 py-1.5"><div class="flex items-center gap-2"><span class="text-fg-0"> </span> <!></div> <div class="mt-1 text-fg-3"> <!></div></div>'),Yw=k('<div class="text-[11px] text-fg-3"> </div>'),Ww=k('<div class="grid gap-1 text-[12px] font-mono"><!> <!></div>'),Xw=k('<div class="mb-3 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> users endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),$w=k('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No users returned for this principal.</span></div>'),Gw=k('<span class="text-fg-3">-</span>'),Zw=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1"><!></td><td class="px-2 py-1 text-fg-2"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),Qw=k('<div class="overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">user</th><th class="px-2 py-1.5 text-left font-normal">role</th><th class="px-2 py-1.5 text-left font-normal">mfa</th><th class="px-2 py-1.5 text-left font-normal">created</th><th class="px-2 py-1.5 text-left font-normal">last active</th></tr></thead><tbody></tbody></table></div>'),Jw=k('<div class="text-[12px] font-mono text-fg-3">Policy table unavailable for this principal.</div>'),e3=k('<div class="text-[12px] font-mono text-fg-3">No policies to tabulate.</div>'),t3=k('<span class="text-fg-3">-</span>'),n3=k('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1"><!></td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),r3=k('<div class="overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">effect</th><th class="px-2 py-1.5 text-left font-normal">principal</th><th class="px-2 py-1.5 text-left font-normal">action</th><th class="px-2 py-1.5 text-left font-normal">resource</th><th class="px-2 py-1.5 text-left font-normal">tenant</th></tr></thead><tbody></tbody></table></div>'),o3=k('<div class="grid grid-cols-[minmax(280px,0.75fr)_1.25fr] gap-3"><div class="grid gap-3 content-start"><!> <!> <!></div> <div class="grid gap-3 content-start"><!> <!></div></div>'),a3=k('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <!></div>');function i3(t,e){Ze(e,!0);let n=ye(null),o=ye(zt([])),a=ye(zt([])),s=ye(zt([])),i=ye(!1),l=ye(null),u=ye(null),f=ye(null),g=ye(null);const h=S(()=>Ue.active.url),p=S(()=>Ue.connected);function y(U){if(!U)return"-";const ne=U>1e10?U:U*1e3;return new Date(ne).toISOString().replace("T"," ").slice(0,19)}async function _(){const U=Ue.client;if(!U||Lt.locked||!r(p)){z(n,null),z(o,[],!0),z(a,[],!0),z(s,[],!0);return}z(i,!0),z(l,null),z(u,null),z(f,null),z(g,null);try{z(n,await Mt.track("security · whoami",()=>U.whoami()),!0)}catch(ne){z(l,ne.message,!0),z(n,null)}try{z(a,await Mt.track("security · users",()=>U.users()),!0)}catch(ne){z(f,ne.message,!0),z(a,[],!0)}finally{z(i,!1)}}Pt(()=>{Lt.locked||(r(h),r(p),_())});var I=a3(),D=d(I);Aw(D,{eyebrow:"Admin",title:"Security",subtitle:"Tenants, users, and policy surfaces are permission-aware. Controls only appear when reddb exposes the grant.",actions:ne=>{var ue=Lw(),re=d(ue);{let ae=S(()=>r(i)?"size-3.5 animate-spin":"size-3.5");rl(re,{get class(){return r(ae)}})}Te(),c(ue),$(()=>ue.disabled=r(i)||Lt.locked||!r(p)),we("click",ue,_),x(ne,ue)}});var H=v(D,2);{var R=U=>{Io(U,{get icon(){return wr},title:"Security locked",message:"Enter the master password before red-ui loads auth data."})},K=U=>{Io(U,{get icon(){return fo},title:"No active connection",message:"Connect to a reddb instance to inspect security posture."})},V=U=>{var ne=o3(),ue=d(ne),re=d(ue);Bn(re,{title:"session",children:(b,N)=>{var E=qe(),L=fe(E);{var F=m=>{var C=Ow(),P=d(C,!0);c(C),$(()=>T(P,r(l))),x(m,C)},W=m=>{var C=Dw(),P=v(d(C),2),X=d(P);{var le=ee=>{kn(ee,{tone:"ok",children:(oe,te)=>{Te();var ge=pt("yes");x(oe,ge)},$$slots:{default:!0}})},J=ee=>{kn(ee,{tone:"warn",children:(oe,te)=>{Te();var ge=pt("no");x(oe,ge)},$$slots:{default:!0}})};G(X,ee=>{r(n).authenticated?ee(le):ee(J,-1)})}c(P);var Y=v(P,4),Z=d(Y,!0);c(Y);var Q=v(Y,4),se=d(Q,!0);c(Q);var B=v(Q,2);{var q=ee=>{var oe=Rw(),te=v(fe(oe),2),ge=d(te,!0);c(te),$(()=>T(ge,r(n).note)),x(ee,oe)};G(B,ee=>{r(n).note&&ee(q)})}c(C),$(()=>{T(Z,r(n).username),T(se,r(n).role)}),x(m,C)},M=m=>{var C=Vw();x(m,C)};G(L,m=>{r(l)?m(F):r(n)?m(W,1):m(M,-1)})}x(b,E)},$$slots:{default:!0}});var ae=v(re,2);Bn(ae,{title:"tenants",children:(b,N)=>{var E=qe(),L=fe(E);{var F=m=>{var C=Hw(),P=fe(C),X=d(P);fo(X,{class:"size-3.5"}),Te(),c(P);var le=v(P,2),J=d(le,!0);c(le),$(()=>T(J,r(u))),x(m,C)},W=m=>{var C=qw(),P=d(C);Xd(P,{class:"size-4"}),Te(2),c(C),x(m,C)},M=m=>{var C=Kw();Je(C,23,()=>r(o),(P,X)=>`${P.id??P.slug??P.name??X}`,(P,X)=>{var le=Fw(),J=d(le),Y=d(J),Z=d(Y,!0);c(Y);var Q=v(Y,2);{var se=te=>{kn(te,{tone:"accent",children:(ge,xe)=>{Te();var _e=pt();$(()=>T(_e,r(X).role)),x(ge,_e)},$$slots:{default:!0}})};G(Q,te=>{r(X).role&&te(se)})}c(J);var B=v(J,2),q=d(B),ee=v(q);{var oe=te=>{var ge=pt();$(xe=>T(ge,`· ${xe??""}`),[()=>r(X).grants.join(", ")]),x(te,ge)};G(ee,te=>{var ge;(ge=r(X).grants)!=null&&ge.length&&te(oe)})}c(B),c(le),$(()=>{T(Z,r(X).name??r(X).slug??r(X).id??"tenant"),T(q,`${r(X).id??r(X).slug??"-"??""} `)}),x(P,le)}),c(C),x(m,C)};G(L,m=>{r(u)?m(F):r(o).length===0?m(W,1):m(M,-1)})}x(b,E)},$$slots:{default:!0}});var pe=v(ae,2);Bn(pe,{title:"policies",children:(b,N)=>{var E=qe(),L=fe(E);{var F=m=>{var C=Bw(),P=fe(C),X=d(P);fo(X,{class:"size-3.5"}),Te(),c(P);var le=v(P,2),J=d(le,!0);c(le),$(()=>T(J,r(g))),x(m,C)},W=m=>{var C=jw(),P=d(C);xu(P,{class:"size-4"}),Te(2),c(C),x(m,C)},M=m=>{var C=Ww(),P=d(C);Je(P,19,()=>r(s).slice(0,6),(J,Y)=>`${J.id??J.name??Y}`,(J,Y)=>{var Z=Uw(),Q=d(Z),se=d(Q),B=d(se,!0);c(se);var q=v(se,2);{var ee=_e=>{{let ze=S(()=>r(Y).effect==="deny"?"danger":"ok");kn(_e,{get tone(){return r(ze)},children:(be,ve)=>{Te();var Ne=pt();$(()=>T(Ne,r(Y).effect)),x(be,Ne)},$$slots:{default:!0}})}};G(q,_e=>{r(Y).effect&&_e(ee)})}c(Q);var oe=v(Q,2),te=d(oe),ge=v(te);{var xe=_e=>{var ze=pt();$(()=>T(ze,`· tenant ${r(Y).tenant??""}`)),x(_e,ze)};G(ge,_e=>{r(Y).tenant&&_e(xe)})}c(oe),c(Z),$(()=>{T(B,r(Y).name??r(Y).id??"policy"),T(te,`${r(Y).action??"*"??""} · ${r(Y).resource??"*"??""} `)}),x(J,Z)});var X=v(P,2);{var le=J=>{var Y=Yw(),Z=d(Y);c(Y),$(()=>T(Z,`${r(s).length-6} more policies in the table.`)),x(J,Y)};G(X,J=>{r(s).length>6&&J(le)})}c(C),x(m,C)};G(L,m=>{r(g)?m(F):r(s).length===0?m(W,1):m(M,-1)})}x(b,E)},$$slots:{default:!0}}),c(ue);var O=v(ue,2),w=d(O);Bn(w,{title:"users",children:(b,N)=>{var E=qe(),L=fe(E);{var F=m=>{var C=Xw(),P=fe(C),X=d(P);fo(X,{class:"size-3.5"}),Te(),c(P);var le=v(P,2),J=d(le,!0);c(le),$(()=>T(J,r(f))),x(m,C)},W=m=>{var C=$w(),P=d(C);wu(P,{class:"size-4"}),Te(2),c(C),x(m,C)},M=m=>{var C=Qw(),P=d(C),X=v(d(P));Je(X,21,()=>r(a),le=>le.username,(le,J)=>{var Y=Zw(),Z=d(Y),Q=d(Z,!0);c(Z);var se=v(Z),B=d(se,!0);c(se);var q=v(se),ee=d(q);{var oe=be=>{kn(be,{tone:"ok",children:(ve,Ne)=>{Te();var Pe=pt("on");x(ve,Pe)},$$slots:{default:!0}})},te=be=>{var ve=Gw();x(be,ve)};G(ee,be=>{r(J).mfa?be(oe):be(te,-1)})}c(q);var ge=v(q),xe=d(ge,!0);c(ge);var _e=v(ge),ze=d(_e,!0);c(_e),c(Y),$((be,ve)=>{T(Q,r(J).username),T(B,r(J).role??"-"),T(xe,be),T(ze,ve)},[()=>y(r(J).created_at),()=>y(r(J).last_active)]),x(le,Y)}),c(X),c(P),c(C),x(m,C)};G(L,m=>{r(f)?m(F):r(a).length===0?m(W,1):m(M,-1)})}x(b,E)},$$slots:{default:!0}});var A=v(w,2);Bn(A,{title:"policy table",children:(b,N)=>{var E=qe(),L=fe(E);{var F=m=>{var C=Jw();x(m,C)},W=m=>{var C=e3();x(m,C)},M=m=>{var C=r3(),P=d(C),X=v(d(P));Je(X,23,()=>r(s),(le,J)=>`${le.id??le.name??J}`,(le,J)=>{var Y=n3(),Z=d(Y),Q=d(Z);{var se=be=>{{let ve=S(()=>r(J).effect==="deny"?"danger":"ok");kn(be,{get tone(){return r(ve)},children:(Ne,Pe)=>{Te();var de=pt();$(()=>T(de,r(J).effect)),x(Ne,de)},$$slots:{default:!0}})}},B=be=>{var ve=t3();x(be,ve)};G(Q,be=>{r(J).effect?be(se):be(B,-1)})}c(Z);var q=v(Z),ee=d(q,!0);c(q);var oe=v(q),te=d(oe,!0);c(oe);var ge=v(oe),xe=d(ge,!0);c(ge);var _e=v(ge),ze=d(_e,!0);c(_e),c(Y),$(()=>{T(ee,r(J).principal??"-"),T(te,r(J).action??"*"),T(xe,r(J).resource??"*"),T(ze,r(J).tenant??"-")}),x(le,Y)}),c(X),c(P),c(C),x(m,C)};G(L,m=>{r(g)?m(F):r(s).length===0?m(W,1):m(M,-1)})}x(b,E)},$$slots:{default:!0}}),c(O),c(ne),x(U,ne)};G(H,U=>{Lt.locked?U(R):r(p)?U(V,-1):U(K,1)})}c(I),x(t,I),Qe()}Tt(["click"]);var s3=k('<div class="app grid grid-rows-[44px_32px_1fr] h-screen"><!> <!> <main class="relative overflow-hidden z-[1]"><!></main> <!> <!> <!> <!></div>');function p3(t,e){Ze(e,!0);let n=je(e,"showConnect",3,!0),o=je(e,"persistTheme",3,!0);const a=Xu(e.router??al());e.connectionProvider&&Cd(e.connectionProvider);function s(H){const R=H;if(R==="query"||R==="collections"||R==="cluster"||R==="security"){a.go({view:R},void 0,!0);return}const K=Wu(H.startsWith("/")?H:`/${H}`);K.collection?a.go({view:"collection",collection:K.collection,subpage:K.subpage??"table"},void 0,!0):a.go({view:K.view},void 0,!0)}Wn(()=>{e.connectionProvider?Ue.adoptInjected().then(()=>{e.initialRoute&&s(e.initialRoute)}):Ue.bootstrap().then(H=>{H&&s(H)})});let i=ye(!1),l=ye(!1);Wn(()=>{const H=()=>z(l,!0);return window.addEventListener("red:open-pending-changes",H),()=>window.removeEventListener("red:open-pending-changes",H)}),Pt(()=>{const H=Ue.client;if(!H){jt.setExecutor(null),tn.setExecutor(null);return}tn.setExecutor(R=>Sd(H,R)),jt.setExecutor(async R=>Promise.all(R.map(async K=>{try{const V=await H.query(ci(K));return V.ok?{id:K.id,ok:!0}:{id:K.id,ok:!1,error:V.error??"query failed"}}catch(V){return{id:K.id,ok:!1,error:V.message}}})))});const u=5e3;jn.init({target:e.themeTarget??null,persist:o(),initial:e.initialTheme}),Pt(()=>{if(Lt.locked||!Ue.targetResolved)return;Ue.refresh();const H=setInterval(()=>Ue.refresh(),u);return()=>clearInterval(H)}),Pt(()=>{Lt.store&&Ue.hydrateUrls()});function f(){const H=tn.nextLabel(),R=_t.open({kind:"query",label:H,key:H},!0);tn.ensure(R.id)}async function g(H,R){const K=_t.tabs.find(U=>U.kind==="collection"&&U.key===H);K?_t.open({kind:"collection",label:H,key:H,capability:K.capability,overrideCapability:K.overrideCapability,showSystemColumns:K.showSystemColumns,subpage:R??K.subpage}):_t.open({kind:"collection",label:H,key:H,capability:"table",subpage:R??void 0});const V=Ue.client;if(!V){R||a.go({view:"collection",collection:H,subpage:"table"},void 0,!0);return}try{const U=await cl(V,H),ne=_t.tabs.find(re=>re.kind==="collection"&&re.key===H),ue=R??Pr(U);ne&&(_t.tabs=_t.tabs.map(re=>re===ne?{...re,capability:U,subpage:ue}:re)),R||a.go({view:"collection",collection:H,subpage:ue},void 0,!0)}catch{R||a.go({view:"collection",collection:H,subpage:"table"},void 0,!0)}}let h=null,p=null;Pt(()=>{const H=a.view,R=a.collection,K=a.subpage;if(H==="collections"&&R){const V=`${R}::${K??""}`;V!==p&&(p=V,Cn(()=>void g(R,K)))}else p=null;H==="query"&&h!=="query"&&Cn(()=>f()),h=H});var y=qe(),_=fe(y);{var I=H=>{Td(H,{onDone:()=>z(i,!0)})},D=H=>{var R=s3(),K=d(R);Qu(K,{get showConnect(){return n()}});var V=v(K,2);vf(V,{});var U=v(V,2),ne=d(U);{var ue=b=>{Mw(b,{})},re=b=>{i3(b,{})},ae=b=>{Bx(b)};G(ne,b=>{a.view==="cluster"?b(ue):a.view==="security"?b(re,1):b(ae,-1)})}c(U);var pe=v(U,2);mf(pe,{});var O=v(pe,2);Sf(O,{});var w=v(O,2);If(w,{});var A=v(w,2);qf(A,{get open(){return r(l)},onClose:()=>z(l,!1)}),c(R),x(H,R)};G(_,H=>{r(i)?H(D,-1):H(I)})}x(t,y),Qe()}export{p3 as W,Wu as p,Ki as t};
|