@reddb-io/ui 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_app/immutable/assets/0.BR-GggVq.css +1 -0
- package/build/_app/immutable/chunks/BspmDMQv.js +404 -0
- package/build/_app/immutable/chunks/{Bgb6fHGb.js → CAWnp6XP.js} +1 -1
- package/build/_app/immutable/chunks/{B-yl15ta.js → C_WxkIDp.js} +1 -1
- package/build/_app/immutable/chunks/CgQYykwo.js +1164 -0
- package/build/_app/immutable/chunks/D4Buwe3n.js +1 -0
- package/build/_app/immutable/chunks/{C7kf23SQ.js → DpZOD-db.js} +1 -1
- package/build/_app/immutable/entry/{app.BeX4Tmu5.js → app.A4vKpDuk.js} +2 -2
- package/build/_app/immutable/entry/start.CPPUYn3g.js +1 -0
- package/build/_app/immutable/nodes/{0.C0e5KQVb.js → 0.CNfy1rZt.js} +2 -2
- package/build/_app/immutable/nodes/{1.ceiVuZbB.js → 1.DyKCxpV1.js} +1 -1
- package/build/_app/immutable/nodes/{10.DeFqKRR2.js → 10.tDyQ2Z5A.js} +2 -2
- package/build/_app/immutable/nodes/15.CZWDD8kn.js +60 -0
- package/build/_app/version.json +1 -1
- package/build/index.html +11 -11
- package/dist/embed/{AnalyticsView-SKyGxeAx.js → AnalyticsView-b7oALOd5.js} +2 -2
- package/dist/embed/{AnalyticsView-SKyGxeAx.js.map → AnalyticsView-b7oALOd5.js.map} +1 -1
- package/dist/embed/RedUiEmbedRoot-Bngci7ez.js +35616 -0
- package/dist/embed/RedUiEmbedRoot-Bngci7ez.js.map +1 -0
- package/dist/embed/index-C0FJgu3h.js +881 -0
- package/dist/embed/index-C0FJgu3h.js.map +1 -0
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-BawyGZ3s.js → sigma.esm-CvtUChKS.js} +2 -2
- package/dist/embed/{sigma.esm-BawyGZ3s.js.map → sigma.esm-CvtUChKS.js.map} +1 -1
- package/package.json +3 -3
- package/src/app.css +5 -0
- package/src/lib/ConnectDropdown.svelte +36 -7
- package/src/lib/Workspace.svelte +6 -2
- package/src/lib/connections.svelte.ts +31 -0
- package/src/lib/reddb/client.ts +59 -3
- package/build/_app/immutable/assets/0.BWZTMKZW.css +0 -1
- package/build/_app/immutable/chunks/CO7K4bD2.js +0 -1164
- package/build/_app/immutable/chunks/CP65IkJc.js +0 -1
- package/build/_app/immutable/chunks/CxnvJShw.js +0 -404
- package/build/_app/immutable/entry/start.D7y1MZex.js +0 -1
- package/build/_app/immutable/nodes/15.CRDBqbiH.js +0 -60
- package/dist/embed/RedUiEmbedRoot-BzVzGAFK.js +0 -31960
- package/dist/embed/RedUiEmbedRoot-BzVzGAFK.js.map +0 -1
- package/dist/embed/index-BY6fc1oQ.js +0 -856
- package/dist/embed/index-BY6fc1oQ.js.map +0 -1
|
@@ -1,1164 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CHvQYbpl.js","./DhEqZVGG.js","./D02PB2u7.js","./Bgb6fHGb.js","./Bzak7iHL.js","./CGFL56WJ.js","./DIeogL5L.js","./DN7v3Tar.js","./DCJ0QyYH.js","./CxnvJShw.js","./69_IOA4Y.js","./BRIMmWzq.js","./Btd6PFkC.js","./C3SGj6Qd.js","../assets/EmptyState.RXcH7ryE.css","./DRlh90Cv.js","../assets/AnalyticsView.BLAJezw4.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var wu=Object.defineProperty;var Ws=t=>{throw TypeError(t)};var ku=(t,e,r)=>e in t?wu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ft=(t,e,r)=>ku(t,typeof e!="symbol"?e+"":e,r),pi=(t,e,r)=>e.has(t)||Ws("Cannot "+r);var ge=(t,e,r)=>(pi(t,e,"read from private field"),r?r.call(t):e.get(t)),Fe=(t,e,r)=>e.has(t)?Ws("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Qr=(t,e,r,a)=>(pi(t,e,"write to private field"),a?a.call(t,r):e.set(t,r),r),Us=(t,e,r)=>(pi(t,e,"access private method"),r);import{p as Ge,l as vt,s as lt,_ as Na,b as sr,c as Wr,r as Ur}from"./BRIMmWzq.js";import"./Bzak7iHL.js";import{a as fr,o as ei}from"./Btd6PFkC.js";import{aO as Su,aA as Cu,b4 as Eu,aF as $r,aD as Ki,aU as Nu,a2 as Mu,aT as Gs,s as Tu,br as ji,bx as zu,bs as Ys,ba as Au,aK as hi,ac as Xs,e as Pu,bJ as Lu,aR as Iu,as as Ou,by as Zs,X as Ru,b0 as Qs,a4 as $u,bG as L,ay as ka,Y as Du,bd as Vu,aE as Js,f as Hu,az as Fu,aH as qu,q as Ku,aa as ju,x as Bu,w as Wu,al as ys,bK as _r,bf as Uu,ad as Gu,bk as Yu,b9 as it,bm as _,aq as fe,at as n,b6 as st,bz as we,bO as Xt,a6 as c,bw as u,bg as l,bN as y,b8 as Kt,b2 as Ce,b3 as Kn,bn as ws,av as ti,bI as er,be as Ha,aC as Xu,bP as Zu,am as wc,ap as Vn,a as jn,ao as Qu}from"./CGFL56WJ.js";import{b as bi,e as Re,a as v,k as x,u as k,h as en,i as ke,j as Sr,w as _t,l as En,f as Ju,r as Bi}from"./DN7v3Tar.js";import{B as ef,i as K}from"./DCJ0QyYH.js";import{j as De,k as kn,e as je,g as Ae,r as nn,d as zn,i as aa,h as Aa,s as oa,c as Wi,b as tf,l as Jn,a as zr,C as ks,S as ni}from"./C3SGj6Qd.js";import{t as nf,m as Xe,o as el,I as gt,B as pt,l as rf,X as Ln,s as kc,g as Ct,C as pn,j as Ke,c as lr,r as bn,v as af,H as of,u as Sc,h as sf,N as lf,S as Xn,z as _n,f as Cc,k as Pa,d as ri,e as cf,G as df,q as uf,T as ff,a as xi,D as vf,L as gf,P as pf,R as hf,E as Fn,F as bf,b as xf,A as mf,x as _f}from"./CxnvJShw.js";import"./69_IOA4Y.js";const yf=[];function Ec(t,e=!1,r=!1){return Eo(t,new Map,"",yf,null,r)}function Eo(t,e,r,a,o=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(Su(t)){var d=Array(t.length);e.set(t,d),o!==null&&e.set(o,d);for(var f=0;f<t.length;f+=1){var g=t[f];f in t&&(d[f]=Eo(g,e,r,a,null,s))}return d}if(Cu(t)===Eu){d={},e.set(t,d),o!==null&&e.set(o,d);for(var p of Object.keys(t))d[p]=Eo(t[p],e,r,a,null,s);return d}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!s)return Eo(t.toJSON(),e,r,a,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}const tl=0,nl=1,wf=2;function kf(t,e,r,a,o){$r&&Ki();var s=Nu(),i=Ru,d=s?Zs(i):Qs(i,!1,!1),f=s?Zs(i):Qs(i,!1,!1),g=new ef(t);Mu(()=>{var p=Xs,b=e(),h=!1;let w=$r&&Gs(b)===(t.data===Tu);if(w&&(ji(zu()),Ys(!1)),Gs(b)){var S=$u(),A=!1;const D=W=>{if(!h){A=!0,S(!1),Xs===p&&p.deactivate(),Pu.ensure();try{W()}finally{Lu(!1),Iu||Ou()}}};b.then(W=>{D(()=>{hi(d,W),g.ensure(nl,a&&(C=>a(C,d)))})},W=>{D(()=>{if(hi(f,W),g.ensure(wf,o&&(C=>o(C,f))),!o)throw f.v})}),$r?g.ensure(tl,r):Au(()=>{A||D(()=>{g.ensure(tl,r)})})}else hi(d,b),g.ensure(nl,a&&(D=>a(D,d)));return w&&Ys(!0),()=>{h=!0}})}function Sf(t,e,r=!1,a=!1,o=!1,s=!1){var i=t,d="";if(r){var f=t;$r&&(i=ji(ka(f)))}L(()=>{var g=Du;if(d===(d=e()??"")){$r&&Ki();return}if(r&&!$r){g.nodes=null,f.innerHTML=d,d!==""&&bi(ka(f),f.lastChild);return}if(g.nodes!==null&&(Vu(g.nodes.start,g.nodes.end),g.nodes=null),d!==""){if($r){Js.data;for(var p=Ki(),b=p;p!==null&&(p.nodeType!==Hu||p.data!=="");)b=p,p=Fu(p);if(p===null)throw qu(),Ku;bi(Js,b),i=ji(p);return}var h=a?Bu:o?Wu:void 0,w=ju(a?"svg":o?"math":"template",h);w.innerHTML=d;var S=a||o?w:w.content;if(bi(ka(S),S.lastChild),a||o)for(;ka(S);)i.before(ka(S));else i.before(S)}})}function Hn(t,e,r){ys(()=>{var a=_r(()=>e(t,r==null?void 0:r())||{});if(r&&(a!=null&&a.update)){var o=!1,s={};Uu(()=>{var i=r();Gu(i),o&&Yu(s,i)&&(s=i,a.update(i))}),o=!0}if(a!=null&&a.destroy)return()=>a.destroy()})}var Mr,fa,Ya,Qo,Nc;const Jo=class Jo{constructor(e){Fe(this,Qo);Fe(this,Mr,new WeakMap);Fe(this,fa);Fe(this,Ya);Qr(this,Ya,e)}observe(e,r){var a=ge(this,Mr).get(e)||new Set;return a.add(r),ge(this,Mr).set(e,a),Us(this,Qo,Nc).call(this).observe(e,ge(this,Ya)),()=>{var o=ge(this,Mr).get(e);o.delete(r),o.size===0&&(ge(this,Mr).delete(e),ge(this,fa).unobserve(e))}}};Mr=new WeakMap,fa=new WeakMap,Ya=new WeakMap,Qo=new WeakSet,Nc=function(){return ge(this,fa)??Qr(this,fa,new ResizeObserver(e=>{for(var r of e){Jo.entries.set(r.target,r);for(var a of ge(this,Mr).get(r.target)||[])a(r)}}))},Ft(Jo,"entries",new WeakMap);let Ui=Jo;var Cf=new Ui({box:"border-box"});function rl(t,e,r){var a=Cf.observe(t,()=>r(t[e]));ys(()=>(_r(()=>r(t[e])),a))}var Ef=x('<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 Nf(t,e){it(e,!0);let r=we(!0),a=we(0);fr(()=>{const d=setTimeout(()=>_(a,1),20),f=setTimeout(()=>_(a,2),800),g=setTimeout(()=>{var p;_(r,!1),(p=e.onDone)==null||p.call(e)},1e3);return()=>{clearTimeout(d),clearTimeout(f),clearTimeout(g)}});var o=Re(),s=fe(o);{var i=d=>{var f=Ef();let g,p;L(()=>{g=De(f,1,"fixed inset-0 z-[9999] grid place-items-center bg-bg-0 transition-opacity duration-200 ease-out svelte-1js76h4",null,g,{"opacity-0":n(a)===2,"opacity-100":n(a)===1,"pointer-events-none":n(a)===2}),p=kn(f,"",p,{opacity:n(a)===0?0:void 0})}),v(d,f)};K(s,d=>{n(r)&&d(i)})}v(t,o),st()}var Mf=x('<span class="ml-1 text-fg-3"> </span>'),Tf=x('<span class="ml-1 text-danger"> </span>'),zf=x('<li class="flex items-start gap-2 font-mono text-[12px]" data-testid="loading-step"><span aria-hidden="true"></span> <span class="min-w-0 flex-1"><span> </span> <!> <!></span> <span class="shrink-0 tabular-nums text-fg-3" data-testid="loading-step-elapsed"> </span></li>'),Af=x('<div class="fixed inset-0 z-[9998] grid place-items-center bg-bg-0/85 backdrop-blur-sm" role="status" aria-live="polite" aria-busy="true" data-testid="loading-overlay"><div class="w-[min(460px,90vw)] rounded-lg border border-line-2 bg-bg-1 p-5 shadow-2xl"><div class="flex items-center justify-between gap-3"><div class="flex items-center gap-2 min-w-0"><span class="h-2 w-2 shrink-0 animate-pulse rounded-full bg-accent shadow-[0_0_12px_var(--color-accent-glow)] motion-reduce:animate-none"></span> <span class="truncate font-mono text-[13px] font-semibold text-fg-0"> </span></div> <span class="shrink-0 rounded bg-bg-2 px-1.5 py-0.5 font-mono text-[12px] tabular-nums text-fg-2" data-testid="loading-elapsed"> </span></div> <ol class="mt-4 max-h-[220px] space-y-1.5 overflow-y-auto" data-testid="loading-steps"></ol></div></div>');function Pf(t,e){it(e,!0);let r=Ge(e,"store",3,nf),a=Ge(e,"revealAfterMs",3,400),o=we(!1),s=we(0);Xt(()=>{if(!r().active){_(o,!1);return}_(s,Date.now(),!0);const b=setTimeout(()=>_(o,!0),a()),h=setInterval(()=>_(s,Date.now(),!0),100);return()=>{clearTimeout(b),clearInterval(h)}});const i=y(()=>r().active?r().elapsedMs(n(s)):0);function d(b){return b.durationMs!==null?b.durationMs:Math.max(0,n(s)-b.startedAt)}var f=Re(),g=fe(f);{var p=b=>{var h=Af(),w=c(h),S=c(w),A=c(S),D=u(c(A),2),W=c(D,!0);l(D),l(A);var C=u(A,2),G=c(C,!0);l(C),l(S);var X=u(S,2);Xe(X,21,()=>r().steps,I=>I.id,(I,te)=>{var le=zf(),oe=c(le);let ee;var ve=u(oe,2),Q=c(ve);let E;var M=c(Q,!0);l(Q);var m=u(Q,2);{var N=H=>{var V=Mf(),j=c(V,!0);l(V),L(()=>k(j,n(te).detail)),v(H,V)};K(m,H=>{n(te).detail&&H(N)})}var P=u(m,2);{var B=H=>{var V=Tf(),j=c(V);l(V),L(()=>k(j,`— ${n(te).error??""}`)),v(H,V)};K(P,H=>{n(te).error&&H(B)})}l(ve);var $=u(ve,2),R=c($,!0);l($),l(le),L(H=>{ee=De(oe,1,"mt-[3px] h-1.5 w-1.5 shrink-0 rounded-full",null,ee,{"bg-accent":n(te).status==="active","animate-pulse":n(te).status==="active","motion-reduce:animate-none":n(te).status==="active","bg-ok":n(te).status==="done","bg-danger":n(te).status==="error"}),E=De(Q,1,"text-fg-1",null,E,{"text-fg-0":n(te).status==="active","text-danger":n(te).status==="error"}),k(M,n(te).label),k(R,H)},[()=>el(d(n(te)))]),v(I,le)}),l(X),l(w),l(h),L(I=>{k(W,r().label??"Opening connection"),k(G,I)},[()=>el(n(i))]),v(b,h)};K(g,b=>{r().active&&n(o)&&b(p)})}v(t,f),st()}function Ss(t){return!!t&&typeof t=="object"&&t.available===!1}function Bn(t){if(!(t==null||Ss(t)))return t}function Lf(t){return Ss(t)?t.reason:void 0}function If(t,e,r){var s,i,d;const a=Bn((s=t==null?void 0:t.deployment)==null?void 0:s.process_role)??Bn((i=t==null?void 0:t.replication)==null?void 0:i.role)??(e==null?void 0:e.role);if(a==="primary"||a==="replica")return"replicated";const o=Bn((d=t==null?void 0:t.deployment)==null?void 0:d.shape);return o==="serverless"?"serverless":o==="embedded"||o==="file"?"embedded":o==="server"?"server":r==="primary"||r==="replica"?"replicated":r==="embedded"?"embedded":r==="standalone"||r==="server"?"server":"unknown"}function Of(t){const e=t==null?void 0:t.started_at_unix_ms,r=t==null?void 0:t.ready_at_unix_ms;if(e===void 0||r===void 0)return null;const a=r-e;return a>=0?a:null}function Rf(t){const e=t==null?void 0:t.replicas;if(!e||e.length===0)return null;let r=0,a=!1;for(const o of e)typeof o.lag_seconds=="number"&&Number.isFinite(o.lag_seconds)&&(r=Math.max(r,o.lag_seconds),a=!0);return a?r:null}function $f(t){if(!t)return[];const e=[],r=(a,o,s)=>{if(Ss(a)){e.push({path:o,reason:a.reason});return}if(!(s>=4||!a||typeof a!="object"||Array.isArray(a)))for(const[i,d]of Object.entries(a))r(d,o?`${o}.${i}`:i,s+1)};return r(t,"",0),e}const al=/\[\^(\d+)\]/g;function Df(t){const e=[],r=[],a=/```[\s\S]*?```|`[^`\n]*`/g;let o;for(;(o=a.exec(t))!==null;)r.push([o.index,o.index+o[0].length]);const s=f=>r.some(([g,p])=>f>=g&&f<p);let i=0,d;for(al.lastIndex=0;(d=al.exec(t))!==null;){const f=d.index;f>0&&t[f-1]==="\\"||s(f)||(f>i&&e.push({type:"text",value:t.slice(i,f)}),e.push({type:"cite",marker:Number(d[1])}),i=f+d[0].length)}return i<t.length&&e.push({type:"text",value:t.slice(i)}),e.map(f=>f.type==="text"?{type:"text",value:f.value.replace(/\\([[\]])/g,"$1")}:f)}function Vf(t){const e=/^reddb:([^/]+)\/(.+?)(?:#.*)?$/.exec(t);return e?{collection:e[1],id:e[2]}:null}const Hf=[1e3,2e3,4e3,8e3,3e4];class Ff{constructor(e){this.opts=e}subscribe(e={}){return new qf(this,e)}buildSseUrl(e,r){const a=this.opts.client.baseUrl??"",o=new URLSearchParams;r>0&&o.set("since",String(r)),e&&o.set("collection",e);const s=o.toString();return`${a}/changes/stream${s?`?${s}`:""}`}}class qf{constructor(e,r){Ft(this,"events");Ft(this,"controller");Ft(this,"closed",!1);Ft(this,"lastSeenLsn");Ft(this,"currentSse",null);Ft(this,"pollTimer",null);Ft(this,"reconnectTimer",null);Ft(this,"backoffIdx",0);Ft(this,"transport",null);this.parent=e,this.opts=r,this.lastSeenLsn=r.sinceLsn??0,this.events=new ReadableStream({start:a=>{this.controller=a},cancel:()=>this.close()}),this.connect()}timers(){return this.parent.opts.timers??{setTimeout:(e,r)=>globalThis.setTimeout(e,r),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 r=this.parent.opts.sseProbe??(async()=>!0);let a=!1;try{a=await r()}catch{a=!1}if(this.closed)return;this.transport=a?"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 r=this.parent.buildSseUrl(this.opts.collection,this.lastSeenLsn);let a;try{a=e(r)}catch{this.scheduleReconnect();return}this.currentSse=a,a.onopen=()=>{this.backoffIdx=0},a.onmessage=o=>{try{const s=JSON.parse(o.data);this.emit(s)}catch{}},a.onerror=()=>{if(!this.closed){try{a.close()}catch{}this.currentSse===a&&(this.currentSse=null),this.scheduleReconnect()}}}startRest(){const e=async()=>{if(!this.closed)try{const r=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 o of r)this.emit(o);this.backoffIdx=0;const a=this.parent.opts.pollIntervalMs??1e3;this.pollTimer=this.timers().setTimeout(()=>{this.pollTimer=null,e()},a)}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??Hf,r=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()},r)}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 Fa(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
3
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* ISC License
|
|
6
|
-
*
|
|
7
|
-
* 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.
|
|
8
|
-
*
|
|
9
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
10
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
11
|
-
* copyright notice and this permission notice appear in all copies.
|
|
12
|
-
*
|
|
13
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
14
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
15
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
16
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
17
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
18
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
19
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
*
|
|
21
|
-
*/const a=[["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"}]];gt(t,lt({name:"activity"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Kf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
22
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* ISC License
|
|
25
|
-
*
|
|
26
|
-
* 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.
|
|
27
|
-
*
|
|
28
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
29
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
30
|
-
* copyright notice and this permission notice appear in all copies.
|
|
31
|
-
*
|
|
32
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
33
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
34
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
35
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
36
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
37
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
38
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
39
|
-
*
|
|
40
|
-
*/const a=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]];gt(t,lt({name:"arrow-right"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function va(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
41
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
42
|
-
*
|
|
43
|
-
* ISC License
|
|
44
|
-
*
|
|
45
|
-
* 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.
|
|
46
|
-
*
|
|
47
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
48
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
49
|
-
* copyright notice and this permission notice appear in all copies.
|
|
50
|
-
*
|
|
51
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
52
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
53
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
54
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
55
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
56
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
57
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
58
|
-
*
|
|
59
|
-
*/const a=[["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"}]];gt(t,lt({name:"braces"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function jf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
60
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* ISC License
|
|
63
|
-
*
|
|
64
|
-
* 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.
|
|
65
|
-
*
|
|
66
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
67
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
68
|
-
* copyright notice and this permission notice appear in all copies.
|
|
69
|
-
*
|
|
70
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
71
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
72
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
73
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
74
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
75
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
76
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
77
|
-
*
|
|
78
|
-
*/const a=[["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"}]];gt(t,lt({name:"building-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Bf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
79
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* ISC License
|
|
82
|
-
*
|
|
83
|
-
* 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.
|
|
84
|
-
*
|
|
85
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
86
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
87
|
-
* copyright notice and this permission notice appear in all copies.
|
|
88
|
-
*
|
|
89
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
90
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
91
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
92
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
93
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
94
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
95
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
96
|
-
*
|
|
97
|
-
*/const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]];gt(t,lt({name:"chart-column"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Mc(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
98
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* ISC License
|
|
101
|
-
*
|
|
102
|
-
* 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.
|
|
103
|
-
*
|
|
104
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
105
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
106
|
-
* copyright notice and this permission notice appear in all copies.
|
|
107
|
-
*
|
|
108
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
109
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
110
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
111
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
112
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
113
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
114
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
115
|
-
*
|
|
116
|
-
*/const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"m19 9-5 5-4-4-3 3"}]];gt(t,lt({name:"chart-line"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Tc(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
117
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* ISC License
|
|
120
|
-
*
|
|
121
|
-
* 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.
|
|
122
|
-
*
|
|
123
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
124
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
125
|
-
* copyright notice and this permission notice appear in all copies.
|
|
126
|
-
*
|
|
127
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
128
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
129
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
130
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
131
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
132
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
133
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
134
|
-
*
|
|
135
|
-
*/const a=[["path",{d:"M20 6 9 17l-5-5"}]];gt(t,lt({name:"check"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Wf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
136
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* ISC License
|
|
139
|
-
*
|
|
140
|
-
* 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.
|
|
141
|
-
*
|
|
142
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
143
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
144
|
-
* copyright notice and this permission notice appear in all copies.
|
|
145
|
-
*
|
|
146
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
147
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
148
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
149
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
150
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
151
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
152
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
153
|
-
*
|
|
154
|
-
*/const a=[["path",{d:"m6 9 6 6 6-6"}]];gt(t,lt({name:"chevron-down"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function ia(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
155
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* ISC License
|
|
158
|
-
*
|
|
159
|
-
* 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.
|
|
160
|
-
*
|
|
161
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
162
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
163
|
-
* copyright notice and this permission notice appear in all copies.
|
|
164
|
-
*
|
|
165
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
166
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
167
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
168
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
169
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
170
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
171
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
172
|
-
*
|
|
173
|
-
*/const a=[["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"}]];gt(t,lt({name:"circle-alert"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Cs(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
174
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* ISC License
|
|
177
|
-
*
|
|
178
|
-
* 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.
|
|
179
|
-
*
|
|
180
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
181
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
182
|
-
* copyright notice and this permission notice appear in all copies.
|
|
183
|
-
*
|
|
184
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
185
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
186
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
187
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
188
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
189
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
190
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
191
|
-
*
|
|
192
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];gt(t,lt({name:"circle-check"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Uf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
193
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* ISC License
|
|
196
|
-
*
|
|
197
|
-
* 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.
|
|
198
|
-
*
|
|
199
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
200
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
201
|
-
* copyright notice and this permission notice appear in all copies.
|
|
202
|
-
*
|
|
203
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
204
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
205
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
206
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
207
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
208
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
209
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
210
|
-
*
|
|
211
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];gt(t,lt({name:"circle-x"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Gf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
212
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* ISC License
|
|
215
|
-
*
|
|
216
|
-
* 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.
|
|
217
|
-
*
|
|
218
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
219
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
220
|
-
* copyright notice and this permission notice appear in all copies.
|
|
221
|
-
*
|
|
222
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
223
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
224
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
225
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
226
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
227
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
228
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
229
|
-
*
|
|
230
|
-
*/const a=[["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"}]];gt(t,lt({name:"clipboard-list"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Yf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
231
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* ISC License
|
|
234
|
-
*
|
|
235
|
-
* 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.
|
|
236
|
-
*
|
|
237
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
238
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
239
|
-
* copyright notice and this permission notice appear in all copies.
|
|
240
|
-
*
|
|
241
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
242
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
243
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
244
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
245
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
246
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
247
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
248
|
-
*
|
|
249
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];gt(t,lt({name:"clock"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Xf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
250
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* ISC License
|
|
253
|
-
*
|
|
254
|
-
* 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.
|
|
255
|
-
*
|
|
256
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
257
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
258
|
-
* copyright notice and this permission notice appear in all copies.
|
|
259
|
-
*
|
|
260
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
261
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
262
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
263
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
264
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
265
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
266
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
267
|
-
*
|
|
268
|
-
*/const a=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];gt(t,lt({name:"columns-3"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Zf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
269
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
270
|
-
*
|
|
271
|
-
* ISC License
|
|
272
|
-
*
|
|
273
|
-
* 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.
|
|
274
|
-
*
|
|
275
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
276
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
277
|
-
* copyright notice and this permission notice appear in all copies.
|
|
278
|
-
*
|
|
279
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
280
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
281
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
282
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
283
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
284
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
285
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
286
|
-
*
|
|
287
|
-
*/const a=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];gt(t,lt({name:"copy"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Qf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
288
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* ISC License
|
|
291
|
-
*
|
|
292
|
-
* 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.
|
|
293
|
-
*
|
|
294
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
295
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
296
|
-
* copyright notice and this permission notice appear in all copies.
|
|
297
|
-
*
|
|
298
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
299
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
300
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
301
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
302
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
303
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
304
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
305
|
-
*
|
|
306
|
-
*/const a=[["polyline",{points:"9 10 4 15 9 20"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}]];gt(t,lt({name:"corner-down-left"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function $o(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
307
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* ISC License
|
|
310
|
-
*
|
|
311
|
-
* 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.
|
|
312
|
-
*
|
|
313
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
314
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
315
|
-
* copyright notice and this permission notice appear in all copies.
|
|
316
|
-
*
|
|
317
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
318
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
319
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
320
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
321
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
322
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
323
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
324
|
-
*
|
|
325
|
-
*/const a=[["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"}]];gt(t,lt({name:"database"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Jf(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
326
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* ISC License
|
|
329
|
-
*
|
|
330
|
-
* 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.
|
|
331
|
-
*
|
|
332
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
333
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
334
|
-
* copyright notice and this permission notice appear in all copies.
|
|
335
|
-
*
|
|
336
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
337
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
338
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
339
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
340
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
341
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
342
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
343
|
-
*
|
|
344
|
-
*/const a=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]];gt(t,lt({name:"download"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function zc(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
345
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* ISC License
|
|
348
|
-
*
|
|
349
|
-
* 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.
|
|
350
|
-
*
|
|
351
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
352
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
353
|
-
* copyright notice and this permission notice appear in all copies.
|
|
354
|
-
*
|
|
355
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
356
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
357
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
358
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
359
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
360
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
361
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
362
|
-
*
|
|
363
|
-
*/const a=[["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"}]];gt(t,lt({name:"eye-off"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ac(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
364
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
365
|
-
*
|
|
366
|
-
* ISC License
|
|
367
|
-
*
|
|
368
|
-
* 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.
|
|
369
|
-
*
|
|
370
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
371
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
372
|
-
* copyright notice and this permission notice appear in all copies.
|
|
373
|
-
*
|
|
374
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
375
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
376
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
377
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
378
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
379
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
380
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
381
|
-
*
|
|
382
|
-
*/const a=[["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"}]];gt(t,lt({name:"eye"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Pc(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
383
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
384
|
-
*
|
|
385
|
-
* ISC License
|
|
386
|
-
*
|
|
387
|
-
* 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.
|
|
388
|
-
*
|
|
389
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
390
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
391
|
-
* copyright notice and this permission notice appear in all copies.
|
|
392
|
-
*
|
|
393
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
394
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
395
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
396
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
397
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
398
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
399
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
400
|
-
*
|
|
401
|
-
*/const a=[["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"}]];gt(t,lt({name:"file-code-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function ev(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
402
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* ISC License
|
|
405
|
-
*
|
|
406
|
-
* 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.
|
|
407
|
-
*
|
|
408
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
409
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
410
|
-
* copyright notice and this permission notice appear in all copies.
|
|
411
|
-
*
|
|
412
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
413
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
414
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
415
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
416
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
417
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
418
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
419
|
-
*
|
|
420
|
-
*/const a=[["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"}]];gt(t,lt({name:"file-pen-line"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function tv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
421
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* ISC License
|
|
424
|
-
*
|
|
425
|
-
* 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.
|
|
426
|
-
*
|
|
427
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
428
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
429
|
-
* copyright notice and this permission notice appear in all copies.
|
|
430
|
-
*
|
|
431
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
432
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
433
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
434
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
435
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
436
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
437
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
438
|
-
*
|
|
439
|
-
*/const a=[["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"}]];gt(t,lt({name:"file-text"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Lc(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
440
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
441
|
-
*
|
|
442
|
-
* ISC License
|
|
443
|
-
*
|
|
444
|
-
* 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.
|
|
445
|
-
*
|
|
446
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
447
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
448
|
-
* copyright notice and this permission notice appear in all copies.
|
|
449
|
-
*
|
|
450
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
451
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
452
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
453
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
454
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
455
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
456
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
457
|
-
*
|
|
458
|
-
*/const a=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"}]];gt(t,lt({name:"filter"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function nv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
459
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
460
|
-
*
|
|
461
|
-
* ISC License
|
|
462
|
-
*
|
|
463
|
-
* 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.
|
|
464
|
-
*
|
|
465
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
466
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
467
|
-
* copyright notice and this permission notice appear in all copies.
|
|
468
|
-
*
|
|
469
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
470
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
471
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
472
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
473
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
474
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
475
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
476
|
-
*
|
|
477
|
-
*/const a=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];gt(t,lt({name:"folder-open"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ic(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
478
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
479
|
-
*
|
|
480
|
-
* ISC License
|
|
481
|
-
*
|
|
482
|
-
* 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.
|
|
483
|
-
*
|
|
484
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
485
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
486
|
-
* copyright notice and this permission notice appear in all copies.
|
|
487
|
-
*
|
|
488
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
489
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
490
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
491
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
492
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
493
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
494
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
495
|
-
*
|
|
496
|
-
*/const a=[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]];gt(t,lt({name:"gauge"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function rv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
497
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
498
|
-
*
|
|
499
|
-
* ISC License
|
|
500
|
-
*
|
|
501
|
-
* 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.
|
|
502
|
-
*
|
|
503
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
504
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
505
|
-
* copyright notice and this permission notice appear in all copies.
|
|
506
|
-
*
|
|
507
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
508
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
509
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
510
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
511
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
512
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
513
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
514
|
-
*
|
|
515
|
-
*/const a=[["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"}]];gt(t,lt({name:"git-branch"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function av(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
516
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
517
|
-
*
|
|
518
|
-
* ISC License
|
|
519
|
-
*
|
|
520
|
-
* 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.
|
|
521
|
-
*
|
|
522
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
523
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
524
|
-
* copyright notice and this permission notice appear in all copies.
|
|
525
|
-
*
|
|
526
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
527
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
528
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
529
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
530
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
531
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
532
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
533
|
-
*
|
|
534
|
-
*/const a=[["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"}]];gt(t,lt({name:"git-commit-horizontal"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Gi(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
535
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
536
|
-
*
|
|
537
|
-
* ISC License
|
|
538
|
-
*
|
|
539
|
-
* 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.
|
|
540
|
-
*
|
|
541
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
542
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
543
|
-
* copyright notice and this permission notice appear in all copies.
|
|
544
|
-
*
|
|
545
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
546
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
547
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
548
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
549
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
550
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
551
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
552
|
-
*
|
|
553
|
-
*/const a=[["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"}]];gt(t,lt({name:"git-compare-arrows"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function ov(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
554
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
555
|
-
*
|
|
556
|
-
* ISC License
|
|
557
|
-
*
|
|
558
|
-
* 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.
|
|
559
|
-
*
|
|
560
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
561
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
562
|
-
* copyright notice and this permission notice appear in all copies.
|
|
563
|
-
*
|
|
564
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
565
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
566
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
567
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
568
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
569
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
570
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
571
|
-
*
|
|
572
|
-
*/const a=[["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"}]];gt(t,lt({name:"hard-drive"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ma(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
573
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
574
|
-
*
|
|
575
|
-
* ISC License
|
|
576
|
-
*
|
|
577
|
-
* 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.
|
|
578
|
-
*
|
|
579
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
580
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
581
|
-
* copyright notice and this permission notice appear in all copies.
|
|
582
|
-
*
|
|
583
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
584
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
585
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
586
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
587
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
588
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
589
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
590
|
-
*
|
|
591
|
-
*/const a=[["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"}]];gt(t,lt({name:"key-round"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function iv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
592
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
593
|
-
*
|
|
594
|
-
* ISC License
|
|
595
|
-
*
|
|
596
|
-
* 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.
|
|
597
|
-
*
|
|
598
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
599
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
600
|
-
* copyright notice and this permission notice appear in all copies.
|
|
601
|
-
*
|
|
602
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
603
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
604
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
605
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
606
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
607
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
608
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
609
|
-
*
|
|
610
|
-
*/const a=[["path",{d:"M3 6h18"}],["path",{d:"M7 12h10"}],["path",{d:"M10 18h4"}]];gt(t,lt({name:"list-filter"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function sv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
611
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
612
|
-
*
|
|
613
|
-
* ISC License
|
|
614
|
-
*
|
|
615
|
-
* 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.
|
|
616
|
-
*
|
|
617
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
618
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
619
|
-
* copyright notice and this permission notice appear in all copies.
|
|
620
|
-
*
|
|
621
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
622
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
623
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
624
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
625
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
626
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
627
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
628
|
-
*
|
|
629
|
-
*/const a=[["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"}]];gt(t,lt({name:"list-tree"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function lv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
630
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
631
|
-
*
|
|
632
|
-
* ISC License
|
|
633
|
-
*
|
|
634
|
-
* 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.
|
|
635
|
-
*
|
|
636
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
637
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
638
|
-
* copyright notice and this permission notice appear in all copies.
|
|
639
|
-
*
|
|
640
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
641
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
642
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
643
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
644
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
645
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
646
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
647
|
-
*
|
|
648
|
-
*/const a=[["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"}]];gt(t,lt({name:"list"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Gr(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
649
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
650
|
-
*
|
|
651
|
-
* ISC License
|
|
652
|
-
*
|
|
653
|
-
* 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.
|
|
654
|
-
*
|
|
655
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
656
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
657
|
-
* copyright notice and this permission notice appear in all copies.
|
|
658
|
-
*
|
|
659
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
660
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
661
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
662
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
663
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
664
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
665
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
666
|
-
*
|
|
667
|
-
*/const a=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];gt(t,lt({name:"lock"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function cv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
668
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
669
|
-
*
|
|
670
|
-
* ISC License
|
|
671
|
-
*
|
|
672
|
-
* 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.
|
|
673
|
-
*
|
|
674
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
675
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
676
|
-
* copyright notice and this permission notice appear in all copies.
|
|
677
|
-
*
|
|
678
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
679
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
680
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
681
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
682
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
683
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
684
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
685
|
-
*
|
|
686
|
-
*/const a=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}]];gt(t,lt({name:"moon"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function dv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
687
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
688
|
-
*
|
|
689
|
-
* ISC License
|
|
690
|
-
*
|
|
691
|
-
* 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.
|
|
692
|
-
*
|
|
693
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
694
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
695
|
-
* copyright notice and this permission notice appear in all copies.
|
|
696
|
-
*
|
|
697
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
698
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
699
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
700
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
701
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
702
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
703
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
704
|
-
*
|
|
705
|
-
*/const a=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}]];gt(t,lt({name:"pause"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Oc(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
706
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
707
|
-
*
|
|
708
|
-
* ISC License
|
|
709
|
-
*
|
|
710
|
-
* 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.
|
|
711
|
-
*
|
|
712
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
713
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
714
|
-
* copyright notice and this permission notice appear in all copies.
|
|
715
|
-
*
|
|
716
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
717
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
718
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
719
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
720
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
721
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
722
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
723
|
-
*
|
|
724
|
-
*/const a=[["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"}]];gt(t,lt({name:"plug"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function La(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
725
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
726
|
-
*
|
|
727
|
-
* ISC License
|
|
728
|
-
*
|
|
729
|
-
* 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.
|
|
730
|
-
*
|
|
731
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
732
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
733
|
-
* copyright notice and this permission notice appear in all copies.
|
|
734
|
-
*
|
|
735
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
736
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
737
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
738
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
739
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
740
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
741
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
742
|
-
*
|
|
743
|
-
*/const a=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];gt(t,lt({name:"plus"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function uv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
744
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
745
|
-
*
|
|
746
|
-
* ISC License
|
|
747
|
-
*
|
|
748
|
-
* 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.
|
|
749
|
-
*
|
|
750
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
751
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
752
|
-
* copyright notice and this permission notice appear in all copies.
|
|
753
|
-
*
|
|
754
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
755
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
756
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
757
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
758
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
759
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
760
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
761
|
-
*
|
|
762
|
-
*/const a=[["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"}]];gt(t,lt({name:"radio-tower"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function fv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
763
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
764
|
-
*
|
|
765
|
-
* ISC License
|
|
766
|
-
*
|
|
767
|
-
* 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.
|
|
768
|
-
*
|
|
769
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
770
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
771
|
-
* copyright notice and this permission notice appear in all copies.
|
|
772
|
-
*
|
|
773
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
774
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
775
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
776
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
777
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
778
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
779
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
780
|
-
*
|
|
781
|
-
*/const a=[["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"}]];gt(t,lt({name:"radio"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Es(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
782
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
783
|
-
*
|
|
784
|
-
* ISC License
|
|
785
|
-
*
|
|
786
|
-
* 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.
|
|
787
|
-
*
|
|
788
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
789
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
790
|
-
* copyright notice and this permission notice appear in all copies.
|
|
791
|
-
*
|
|
792
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
793
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
794
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
795
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
796
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
797
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
798
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
799
|
-
*
|
|
800
|
-
*/const a=[["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"}]];gt(t,lt({name:"refresh-cw"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Yi(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
801
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
802
|
-
*
|
|
803
|
-
* ISC License
|
|
804
|
-
*
|
|
805
|
-
* 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.
|
|
806
|
-
*
|
|
807
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
808
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
809
|
-
* copyright notice and this permission notice appear in all copies.
|
|
810
|
-
*
|
|
811
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
812
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
813
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
814
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
815
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
816
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
817
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
818
|
-
*
|
|
819
|
-
*/const a=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M21 9H3"}],["path",{d:"M21 15H3"}]];gt(t,lt({name:"rows-3"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function ol(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
820
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
821
|
-
*
|
|
822
|
-
* ISC License
|
|
823
|
-
*
|
|
824
|
-
* 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.
|
|
825
|
-
*
|
|
826
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
827
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
828
|
-
* copyright notice and this permission notice appear in all copies.
|
|
829
|
-
*
|
|
830
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
831
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
832
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
833
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
834
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
835
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
836
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
837
|
-
*
|
|
838
|
-
*/const a=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7"}]];gt(t,lt({name:"save"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function vv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
839
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
840
|
-
*
|
|
841
|
-
* ISC License
|
|
842
|
-
*
|
|
843
|
-
* 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.
|
|
844
|
-
*
|
|
845
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
846
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
847
|
-
* copyright notice and this permission notice appear in all copies.
|
|
848
|
-
*
|
|
849
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
850
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
851
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
852
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
853
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
854
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
855
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
856
|
-
*
|
|
857
|
-
*/const a=[["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"}]];gt(t,lt({name:"scan-line"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function gv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
858
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
859
|
-
*
|
|
860
|
-
* ISC License
|
|
861
|
-
*
|
|
862
|
-
* 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.
|
|
863
|
-
*
|
|
864
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
865
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
866
|
-
* copyright notice and this permission notice appear in all copies.
|
|
867
|
-
*
|
|
868
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
869
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
870
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
871
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
872
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
873
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
874
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
875
|
-
*
|
|
876
|
-
*/const a=[["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"}]];gt(t,lt({name:"scroll-text"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function il(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
877
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
878
|
-
*
|
|
879
|
-
* ISC License
|
|
880
|
-
*
|
|
881
|
-
* 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.
|
|
882
|
-
*
|
|
883
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
884
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
885
|
-
* copyright notice and this permission notice appear in all copies.
|
|
886
|
-
*
|
|
887
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
888
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
889
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
890
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
891
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
892
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
893
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
894
|
-
*
|
|
895
|
-
*/const a=[["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"}]];gt(t,lt({name:"send"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function pv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
896
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
897
|
-
*
|
|
898
|
-
* ISC License
|
|
899
|
-
*
|
|
900
|
-
* 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.
|
|
901
|
-
*
|
|
902
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
903
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
904
|
-
* copyright notice and this permission notice appear in all copies.
|
|
905
|
-
*
|
|
906
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
907
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
908
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
909
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
910
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
911
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
912
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
913
|
-
*
|
|
914
|
-
*/const a=[["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"}]];gt(t,lt({name:"server-crash"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Xi(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
915
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
916
|
-
*
|
|
917
|
-
* ISC License
|
|
918
|
-
*
|
|
919
|
-
* 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.
|
|
920
|
-
*
|
|
921
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
922
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
923
|
-
* copyright notice and this permission notice appear in all copies.
|
|
924
|
-
*
|
|
925
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
926
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
927
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
928
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
929
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
930
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
931
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
932
|
-
*
|
|
933
|
-
*/const a=[["path",{d:"M20 7h-9"}],["path",{d:"M14 17H5"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];gt(t,lt({name:"settings-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Sa(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
934
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
935
|
-
*
|
|
936
|
-
* ISC License
|
|
937
|
-
*
|
|
938
|
-
* 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.
|
|
939
|
-
*
|
|
940
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
941
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
942
|
-
* copyright notice and this permission notice appear in all copies.
|
|
943
|
-
*
|
|
944
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
945
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
946
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
947
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
948
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
949
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
950
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
951
|
-
*
|
|
952
|
-
*/const a=[["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"}]];gt(t,lt({name:"shield-alert"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function hv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
953
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
954
|
-
*
|
|
955
|
-
* ISC License
|
|
956
|
-
*
|
|
957
|
-
* 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.
|
|
958
|
-
*
|
|
959
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
960
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
961
|
-
* copyright notice and this permission notice appear in all copies.
|
|
962
|
-
*
|
|
963
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
964
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
965
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
966
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
967
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
968
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
969
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
970
|
-
*
|
|
971
|
-
*/const a=[["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"}]];gt(t,lt({name:"shield-check"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function mi(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
972
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
973
|
-
*
|
|
974
|
-
* ISC License
|
|
975
|
-
*
|
|
976
|
-
* 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.
|
|
977
|
-
*
|
|
978
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
979
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
980
|
-
* copyright notice and this permission notice appear in all copies.
|
|
981
|
-
*
|
|
982
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
983
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
984
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
985
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
986
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
987
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
988
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
989
|
-
*
|
|
990
|
-
*/const a=[["path",{d:"m2 2 20 20"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264"}]];gt(t,lt({name:"shield-off"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function bv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
991
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
992
|
-
*
|
|
993
|
-
* ISC License
|
|
994
|
-
*
|
|
995
|
-
* 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.
|
|
996
|
-
*
|
|
997
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
998
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
999
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1000
|
-
*
|
|
1001
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1002
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1003
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1004
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1005
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1006
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1007
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1008
|
-
*
|
|
1009
|
-
*/const a=[["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"}]];gt(t,lt({name:"shield"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function xv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1010
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1011
|
-
*
|
|
1012
|
-
* ISC License
|
|
1013
|
-
*
|
|
1014
|
-
* 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.
|
|
1015
|
-
*
|
|
1016
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1017
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1018
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1019
|
-
*
|
|
1020
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1021
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1022
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1023
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1024
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1025
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1026
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1027
|
-
*
|
|
1028
|
-
*/const a=[["line",{x1:"21",x2:"14",y1:"4",y2:"4"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22"}]];gt(t,lt({name:"sliders-horizontal"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function No(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1029
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1030
|
-
*
|
|
1031
|
-
* ISC License
|
|
1032
|
-
*
|
|
1033
|
-
* 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.
|
|
1034
|
-
*
|
|
1035
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1036
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1037
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1038
|
-
*
|
|
1039
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1040
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1041
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1042
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1043
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1044
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1045
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1046
|
-
*
|
|
1047
|
-
*/const a=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}],["path",{d:"M20 3v4"}],["path",{d:"M22 5h-4"}],["path",{d:"M4 17v2"}],["path",{d:"M5 18H3"}]];gt(t,lt({name:"sparkles"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function mv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1048
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1049
|
-
*
|
|
1050
|
-
* ISC License
|
|
1051
|
-
*
|
|
1052
|
-
* 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.
|
|
1053
|
-
*
|
|
1054
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1055
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1056
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1057
|
-
*
|
|
1058
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1059
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1060
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1061
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1062
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1063
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1064
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1065
|
-
*
|
|
1066
|
-
*/const a=[["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"}]];gt(t,lt({name:"sun"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function _v(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1067
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1068
|
-
*
|
|
1069
|
-
* ISC License
|
|
1070
|
-
*
|
|
1071
|
-
* 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.
|
|
1072
|
-
*
|
|
1073
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1074
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1075
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1076
|
-
*
|
|
1077
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1078
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1079
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1080
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1081
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1082
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1083
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1084
|
-
*
|
|
1085
|
-
*/const a=[["polyline",{points:"4 17 10 11 4 5"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19"}]];gt(t,lt({name:"terminal"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function qa(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1086
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1087
|
-
*
|
|
1088
|
-
* ISC License
|
|
1089
|
-
*
|
|
1090
|
-
* 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.
|
|
1091
|
-
*
|
|
1092
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1093
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1094
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1095
|
-
*
|
|
1096
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1097
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1098
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1099
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1100
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1101
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1102
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1103
|
-
*
|
|
1104
|
-
*/const a=[["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"}]];gt(t,lt({name:"trash-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function sl(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1105
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1106
|
-
*
|
|
1107
|
-
* ISC License
|
|
1108
|
-
*
|
|
1109
|
-
* 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.
|
|
1110
|
-
*
|
|
1111
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1112
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1113
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1114
|
-
*
|
|
1115
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1116
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1117
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1118
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1119
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1120
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1121
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1122
|
-
*
|
|
1123
|
-
*/const a=[["path",{d:"m19 5 3-3"}],["path",{d:"m2 22 3-3"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}],["path",{d:"M7.5 13.5 10 11"}],["path",{d:"M10.5 16.5 13 14"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z"}]];gt(t,lt({name:"unplug"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function yv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1124
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1125
|
-
*
|
|
1126
|
-
* ISC License
|
|
1127
|
-
*
|
|
1128
|
-
* 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.
|
|
1129
|
-
*
|
|
1130
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1131
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1132
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1133
|
-
*
|
|
1134
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1135
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1136
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1137
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1138
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1139
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1140
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1141
|
-
*
|
|
1142
|
-
*/const a=[["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"}]];gt(t,lt({name:"users"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function wv(t,e){const r=vt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1143
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1144
|
-
*
|
|
1145
|
-
* ISC License
|
|
1146
|
-
*
|
|
1147
|
-
* 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.
|
|
1148
|
-
*
|
|
1149
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1150
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1151
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1152
|
-
*
|
|
1153
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1154
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1155
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1156
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1157
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1158
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1159
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1160
|
-
*
|
|
1161
|
-
*/const a=[["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"}]];gt(t,lt({name:"zap"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=Re(),d=fe(i);pt(d,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}var kv=x(`<div class="grid h-24 place-items-center font-mono text-[12px] text-fg-3">No calls yet — the client hasn't asked the database anything.</div>`),Sv=x('<span class="ml-1 text-fg-3 break-all"> </span>'),Cv=x('<span class="ml-1 text-danger break-all"> </span>'),Ev=x('<span class="shrink-0 tabular-nums text-fg-3" title="rows returned"> </span>'),Nv=x('<li class="group flex items-start gap-2 px-3 py-1.5 font-mono text-[11px] hover:bg-bg-2/40" data-testid="dev-console-entry"><span aria-hidden="true"></span> <span class="w-11 shrink-0 uppercase text-fg-2"> </span> <span class="min-w-0 flex-1"><span class="text-fg-1"> </span> <!> <!></span> <!> <span class="w-12 shrink-0 text-right tabular-nums text-fg-2" title="duration"> </span> <button type="button" title="Copy entry" aria-label="Copy entry" class="shrink-0 rounded p-0.5 text-fg-3 opacity-0 transition-opacity hover:bg-bg-3/60 hover:text-fg-1 group-hover:opacity-100 focus:opacity-100"><!></button></li>'),Mv=x('<ul class="divide-y divide-line-1/60"></ul>'),Tv=x('<div class="fixed inset-x-0 bottom-0 z-[9990] flex max-h-[45vh] flex-col border-t border-line-2 bg-bg-1 shadow-2xl" role="log" aria-label="Developer console" data-testid="dev-console"><div class="flex items-center justify-between gap-3 border-b border-line-1 bg-bg-2/60 px-3 py-1.5"><div class="flex items-center gap-2 font-mono text-[11px] text-fg-2"><span class="uppercase tracking-wider text-fg-1">Console</span> <span class="text-fg-3" data-testid="dev-console-count"> </span></div> <div class="flex items-center gap-1"><button type="button" title="Clear console" aria-label="Clear console" class="inline-flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[11px] text-fg-3 hover:bg-bg-3/60 hover:text-fg-1 transition-colors"><!> Clear</button> <button type="button" title="Close console" aria-label="Close console" class="inline-flex items-center rounded p-0.5 text-fg-3 hover:bg-bg-3/60 hover:text-fg-1 transition-colors"><!></button></div></div> <div class="min-h-0 flex-1 overflow-y-auto"><!></div></div>');function zv(t,e){it(e,!0);let r=Ge(e,"store",3,rf),a=Ge(e,"open",3,!1),o=we(Kt(a())),s=we(Kt([])),i=we(null);Xt(()=>r().subscribe(S=>_(s,S,!0))),Xt(()=>{const S=()=>_(o,!n(o));return window.addEventListener("red:toggle-dev-console",S),()=>window.removeEventListener("red:toggle-dev-console",S)});const d=y(()=>[...n(s)].reverse());async function f(S,A){var D;try{await((D=navigator.clipboard)==null?void 0:D.writeText(S)),_(i,A,!0),setTimeout(()=>{n(i)===A&&_(i,null)},1200)}catch{}}function g(S){const D=[`${S.verb} ${S.target} → ${S.ok?S.status??"ok":"error"} · ${S.durationMs}ms${S.rowCount===void 0?"":` · ${S.rowCount} rows`}`];return S.payload&&D.push(S.payload),S.error&&D.push(S.error),D.join(`
|
|
1162
|
-
`)}function p(S){return S>=1e3?`${(S/1e3).toFixed(1)}s`:`${S}ms`}var b=Re(),h=fe(b);{var w=S=>{var A=Tv(),D=c(A),W=c(D),C=u(c(W),2),G=c(C);l(C),l(W);var X=u(W,2),I=c(X),te=c(I);qa(te,{class:"size-3"}),Ce(),l(I);var le=u(I,2),oe=c(le);Ln(oe,{class:"size-3.5"}),l(le),l(X),l(D);var ee=u(D,2),ve=c(ee);{var Q=M=>{var m=kv();v(M,m)},E=M=>{var m=Mv();Xe(m,21,()=>n(d),N=>N.id,(N,P)=>{var B=Nv(),$=c(B);let R;var H=u($,2),V=c(H,!0);l(H);var j=u(H,2),F=c(j),ae=c(F,!0);l(F);var be=u(F,2);{var se=xe=>{var he=Sv(),me=c(he,!0);l(he),L(_e=>k(me,_e),[()=>n(P).payload.replace(/\s+/g," ").slice(0,120)]),v(xe,he)};K(be,xe=>{n(P).payload&&xe(se)})}var J=u(be,2);{var Y=xe=>{var he=Cv(),me=c(he);l(he),L(()=>k(me,`— ${n(P).error??""}`)),v(xe,he)};K(J,xe=>{n(P).error&&xe(Y)})}l(j);var Z=u(j,2);{var T=xe=>{var he=Ev(),me=c(he);l(he),L(()=>k(me,`${n(P).rowCount??""}r`)),v(xe,he)};K(Z,xe=>{n(P).rowCount!==void 0&&xe(T)})}var q=u(Z,2),O=c(q,!0);l(q);var z=u(q,2),U=c(z);{var ne=xe=>{Tc(xe,{class:"size-3 text-ok"})},ce=xe=>{Zf(xe,{class:"size-3"})};K(U,xe=>{n(i)===n(P).id?xe(ne):xe(ce,-1)})}l(z),l(B),L(xe=>{R=De($,1,"mt-[5px] h-1.5 w-1.5 shrink-0 rounded-full",null,R,{"bg-ok":n(P).ok,"bg-danger":!n(P).ok}),k(V,n(P).verb),k(ae,n(P).target),k(O,xe)},[()=>p(n(P).durationMs)]),ke("click",z,()=>f(g(n(P)),n(P).id)),v(N,B)}),l(m),v(M,m)};K(ve,M=>{n(d).length===0?M(Q):M(E,-1)})}l(ee),l(A),L(()=>k(G,`${n(s).length??""} calls`)),ke("click",I,()=>r().clear()),ke("click",le,()=>_(o,!1)),v(S,A)};K(h,S=>{n(o)&&S(w)})}v(t,b),st()}en(["click"]);var Av=x('<div class="global-progress" role="progressbar" aria-label="reddb activity" aria-valuetext="Loading"><div class="global-progress__bar"></div></div>');function Pv(t,e){it(e,!1),kc();var r=Re(),a=fe(r);{var o=s=>{var i=Av();v(s,i)};K(a,s=>{Ct.active&&s(o)})}v(t,r),st()}var Lv=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),ll=t=>t===!1?"false":t===!0?"true":t===0?"0":t,Dn=t=>{if(!t||typeof t!="object")return!0;for(let e in t)return!1;return!0},Iv=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;let r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(let o=0;o<r.length;o++){let s=r[o];if(!a.includes(s)||t[s]!==e[s])return!1}return!0};function Rc(t,e){for(let r=0;r<t.length;r++){let a=t[r];Array.isArray(a)?Rc(a,e):e.push(a)}}var $c=(...t)=>{let e=[];Rc(t,e);let r=[];for(let a=0;a<e.length;a++)e[a]&&r.push(e[a]);return r},Dc=(t,e)=>{let r={};for(let a in t){let o=t[a];if(a in e){let s=e[a];Array.isArray(o)||Array.isArray(s)?r[a]=$c(s,o):typeof o=="object"&&typeof s=="object"&&o&&s?r[a]=Dc(o,s):r[a]=s+" "+o}else r[a]=o}for(let a in e)a in t||(r[a]=e[a]);return r},Ov=/\s+/g,cl=t=>!t||typeof t!="string"?t:t.replace(Ov," ").trim(),na=null,Mo=null,Rv=async()=>na||Mo||(Mo=Na(()=>import("./3j4cZ58b.js"),[],import.meta.url).then(t=>(na=t,t)).catch(()=>null),Mo),$v=t=>e=>{if(Mo&&!na)return e;if(na){let{twMerge:r,extendTailwindMerge:a}=na;return(Dn(t)?r:a({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(e)}try{let{twMerge:r,extendTailwindMerge:a}=Lv("tailwind-merge");return na={twMerge:r,extendTailwindMerge:a},(Dn(t)?r:a({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(e)}catch{return Rv(),e}},Dv={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Do=(...t)=>{let e=[];Vc(t,e);let r="";for(let a=0;a<e.length;a++)e[a]&&(r&&(r+=" "),r+=e[a]);return r||void 0};function Vc(t,e){for(let r=0;r<t.length;r++){let a=t[r];Array.isArray(a)?Vc(a,e):a&&e.push(a)}}var _i=null,Zi={},Qi=!1,vo=(...t)=>e=>{let r=Do(t);return!r||!e.twMerge?r:((!_i||Qi)&&(Qi=!1,_i=$v(Zi)),_i(r)||void 0)},dl=(t,e)=>{for(let r in e)r in t?t[r]=Do(t[r],e[r]):t[r]=e[r];return t},Ns=(t,e)=>{let{extend:r=null,slots:a={},variants:o={},compoundVariants:s=[],compoundSlots:i=[],defaultVariants:d={}}=t,f={...Dv,...e},g=r!=null&&r.base?Do(r.base,t==null?void 0:t.base):t==null?void 0:t.base,p=r!=null&&r.variants&&!Dn(r.variants)?Dc(o,r.variants):o,b=r!=null&&r.defaultVariants&&!Dn(r.defaultVariants)?{...r.defaultVariants,...d}:d;!Dn(f.twMergeConfig)&&!Iv(f.twMergeConfig,Zi)&&(Qi=!0,Zi=f.twMergeConfig);let h=Dn(r==null?void 0:r.slots),w=Dn(a)?{}:{base:Do(t==null?void 0:t.base,h&&(r==null?void 0:r.base)),...a},S=h?w:dl({...r==null?void 0:r.slots},Dn(w)?{base:t==null?void 0:t.base}:w),A=Dn(r==null?void 0:r.compoundVariants)?s:$c(r==null?void 0:r.compoundVariants,s),D=C=>{if(Dn(p)&&Dn(a)&&h)return vo(g,C==null?void 0:C.class,C==null?void 0:C.className)(f);if(A&&!Array.isArray(A))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof A}`);if(i&&!Array.isArray(i))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof i}`);let G=(E,M,m=[],N)=>{let P=m;if(typeof M=="string"){let B=cl(M).split(" ");for(let $=0;$<B.length;$++)P.push(`${E}:${B[$]}`)}else if(Array.isArray(M))for(let B=0;B<M.length;B++)P.push(`${E}:${M[B]}`);else if(typeof M=="object"&&typeof N=="string"&&N in M){let B=M[N];if(B&&typeof B=="string"){let $=cl(B).split(" "),R=[];for(let H=0;H<$.length;H++)R.push(`${E}:${$[H]}`);P[N]=P[N]?P[N].concat(R):R}else if(Array.isArray(B)&&B.length>0){let $=[];for(let R=0;R<B.length;R++)$.push(`${E}:${B[R]}`);P[N]=$}}return P},X=(E,M=p,m=null,N=null)=>{let P=M[E];if(!P||Dn(P))return null;let B=(N==null?void 0:N[E])??(C==null?void 0:C[E]);if(B===null)return null;let $=ll(B),R=Array.isArray(f.responsiveVariants)&&f.responsiveVariants.length>0||f.responsiveVariants===!0,H=b==null?void 0:b[E],V=[];if(typeof $=="object"&&R)for(let[ae,be]of Object.entries($)){let se=P[be];if(ae==="initial"){H=be;continue}Array.isArray(f.responsiveVariants)&&!f.responsiveVariants.includes(ae)||(V=G(ae,se,V,m))}let j=$!=null&&typeof $!="object"?$:ll(H),F=P[j||"false"];return typeof V=="object"&&typeof m=="string"&&V[m]?dl(V,F):V.length>0?(V.push(F),m==="base"?V.join(" "):V):F},I=()=>{if(!p)return null;let E=Object.keys(p),M=[];for(let m=0;m<E.length;m++){let N=X(E[m],p);N&&M.push(N)}return M},te=(E,M)=>{if(!p||typeof p!="object")return null;let m=[];for(let N in p){let P=X(N,p,E,M),B=E==="base"&&typeof P=="string"?P:P&&P[E];B&&m.push(B)}return m},le={};for(let E in C){let M=C[E];M!==void 0&&(le[E]=M)}let oe=(E,M)=>{var N;let m=typeof(C==null?void 0:C[E])=="object"?{[E]:(N=C[E])==null?void 0:N.initial}:{};return{...b,...le,...m,...M}},ee=(E=[],M)=>{let m=[],N=E.length;for(let P=0;P<N;P++){let{class:B,className:$,...R}=E[P],H=!0,V=oe(null,M);for(let j in R){let F=R[j],ae=V[j];if(Array.isArray(F)){if(!F.includes(ae)){H=!1;break}}else{if((F==null||F===!1)&&(ae==null||ae===!1))continue;if(ae!==F){H=!1;break}}}H&&(B&&m.push(B),$&&m.push($))}return m},ve=E=>{let M=ee(A,E);if(!Array.isArray(M))return M;let m={},N=vo;for(let P=0;P<M.length;P++){let B=M[P];if(typeof B=="string")m.base=N(m.base,B)(f);else if(typeof B=="object")for(let $ in B)m[$]=N(m[$],B[$])(f)}return m},Q=E=>{if(i.length<1)return null;let M={},m=oe(null,E);for(let N=0;N<i.length;N++){let{slots:P=[],class:B,className:$,...R}=i[N];if(!Dn(R)){let H=!0;for(let V in R){let j=m[V],F=R[V];if(j===void 0||(Array.isArray(F)?!F.includes(j):F!==j)){H=!1;break}}if(!H)continue}for(let H=0;H<P.length;H++){let V=P[H];M[V]||(M[V]=[]),M[V].push([B,$])}}return M};if(!Dn(a)||!h){let E={};if(typeof S=="object"&&!Dn(S)){let M=vo;for(let m in S)E[m]=N=>{let P=ve(N),B=Q(N);return M(S[m],te(m,N),P?P[m]:void 0,B?B[m]:void 0,N==null?void 0:N.class,N==null?void 0:N.className)(f)}}return E}return vo(g,I(),ee(A),C==null?void 0:C.class,C==null?void 0:C.className)(f)},W=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return D.variantKeys=W(),D.extend=r,D.base=g,D.slots=S,D.variants=p,D.defaultVariants=b,D.compoundSlots=i,D.compoundVariants=A,D};Ns({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"}});en(["click"]);const Vv=Ns({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 Hv=x("<span><!></span>");function Wn(t,e){it(e,!0);let r=Ge(e,"tone",3,"neutral"),a=Ge(e,"class",3,"");var o=Hv(),s=c(o);pn(s,()=>e.children??Kn),l(o),L(i=>De(o,1,i),[()=>je(Vv({tone:r(),class:a()}))]),v(t,o),st()}var Fv=x('<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>'),qv=x('<section><!> <div class="p-4"><!></div></section>');function Er(t,e){let r=Ge(e,"floating",3,!1),a=Ge(e,"class",3,"");const o=y(()=>r()?"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=qv(),i=c(s);{var d=p=>{var b=Fv(),h=c(b,!0);l(b),L(()=>k(h,e.title)),v(p,b)};K(i,p=>{e.title&&p(d)})}var f=u(i,2),g=c(f);pn(g,()=>e.children??Kn),l(f),l(s),L(()=>De(s,1,`rounded-lg border overflow-hidden backdrop-blur-md ${n(o)??""} ${a()??""}`)),v(t,s)}var Kv=x('<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 jv(t,e){it(e,!0);const r=y(()=>({primary:"bg-role-primary text-role-primary",replica:"bg-role-replica text-role-replica",embedded:"bg-role-embedded text-role-embedded"})[e.role]);var a=Kv(),o=c(a),s=u(o,2),i=c(s,!0);l(s),l(a),L(()=>{De(o,1,`w-1.5 h-1.5 rounded-full ${n(r)??""} shadow-[0_0_0_3px_currentColor]/20`),k(i,e.label??e.role)}),v(t,a),st()}var Bv=x('<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 Un(t,e){var r=Bv(),a=c(r);pn(a,()=>e.children??Kn),l(r),v(t,r)}en(["click"]);var Wv=x('<span class="shrink-0 font-mono text-[11px] text-fg-2"> </span>'),Uv=x('<p class="mt-0.5 text-[12px] leading-snug text-fg-2"> </p>'),Gv=x("<div><!></div>"),Yv=x('<div class="w-full"><!></div>'),Xv=x('<div><div><div class="min-w-0"><div class="flex items-baseline gap-2"><span class="truncate text-[13px] text-fg-0"> </span> <!></div> <!></div></div> <!> <!></div>');function hr(t,e){it(e,!0);let r=Ge(e,"wide",3,!1),a=Ge(e,"class",3,"");var o=Xv(),s=c(o),i=c(s),d=c(i),f=c(d),g=c(f,!0);l(f);var p=u(f,2);{var b=C=>{var G=Wv(),X=c(G,!0);l(G),L(()=>k(X,e.hint)),v(C,G)};K(p,C=>{e.hint&&C(b)})}l(d);var h=u(d,2);{var w=C=>{var G=Uv(),X=c(G,!0);l(G),L(()=>k(X,e.description)),v(C,G)};K(h,C=>{e.description&&C(w)})}l(i),l(s);var S=u(s,2);{var A=C=>{var G=Gv(),X=c(G);pn(X,()=>e.action),l(G),L(I=>De(G,1,I),[()=>je(["flex items-center gap-2",r()?"w-full":"shrink-0"].join(" "))]),v(C,G)};K(S,C=>{e.action&&C(A)})}var D=u(S,2);{var W=C=>{var G=Yv(),X=c(G);pn(X,()=>e.below),l(G),v(C,G)};K(D,C=>{e.below&&C(W)})}l(o),L((C,G)=>{Ae(o,"data-wide",r()?"":void 0),De(o,1,C),De(s,1,G),k(g,e.title)},[()=>je(["px-3 py-2.5",r()?"flex flex-col gap-2":"flex items-center gap-3",a()].join(" ")),()=>je(["flex min-w-0 items-baseline gap-2",r()?"":"flex-1"].join(" "))]),v(t,o),st()}var Zv=x('<span class="flex size-4 shrink-0 items-center justify-center text-fg-2"><!></span>'),Qv=x('<span class="ml-0.5"><!></span>'),Jv=x('<div><!> <h2 class="text-[11px] font-mono uppercase tracking-[0.1em] text-fg-2"> </h2> <!></div>');function go(t,e){let r=Ge(e,"class",3,"");var a=Jv(),o=c(a);{var s=p=>{var b=Zv(),h=c(b);pn(h,()=>e.icon),l(b),v(p,b)};K(o,p=>{e.icon&&p(s)})}var i=u(o,2),d=c(i,!0);l(i);var f=u(i,2);{var g=p=>{var b=Qv(),h=c(b);pn(h,()=>e.meta),l(b),v(p,b)};K(f,p=>{e.meta&&p(g)})}l(a),L(()=>{De(a,1,`flex items-center gap-2 ${r()??""}`),k(d,e.title)}),v(t,a)}const eg=Ns({base:"inline-flex items-center gap-1 px-1.5 h-[18px] rounded-full text-[11px] font-mono leading-none border",variants:{tone:{muted:"bg-bg-2 text-fg-2 border-line-2",accent:"bg-accent/15 text-accent border-accent/30"}},defaultVariants:{tone:"muted"}});var tg=x("<span><!></span>");function Pr(t,e){it(e,!0);let r=Ge(e,"tone",3,"muted"),a=Ge(e,"class",3,"");var o=tg(),s=c(o);pn(s,()=>e.children??Kn),l(o),L(i=>De(o,1,i),[()=>je(eg({tone:r(),class:a()}))]),v(t,o),st()}var ng=x('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),rg=x('<span class="shrink-0"><!></span>'),ag=x('<a><!> <span class="flex-1 truncate"> </span> <!></a>'),og=x('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),ig=x('<span class="shrink-0"><!></span>'),sg=x('<button type="button"><!> <span class="flex-1 truncate"> </span> <!></button>');function lg(t,e){it(e,!0);let r=Ge(e,"active",3,!1),a=Ge(e,"class",3,"");const o=y(()=>["inline-flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] transition-colors",r()?"bg-bg-2 text-fg-0":"text-fg-2 hover:bg-bg-2 hover:text-fg-0",a()].join(" "));var s=Re(),i=fe(s);{var d=g=>{var p=ag(),b=c(p);{var h=W=>{var C=ng(),G=c(C);pn(G,()=>e.icon),l(C),v(W,C)};K(b,W=>{e.icon&&W(h)})}var w=u(b,2),S=c(w,!0);l(w);var A=u(w,2);{var D=W=>{var C=rg(),G=c(C);pn(G,()=>e.trailing),l(C),v(W,C)};K(A,W=>{e.trailing&&W(D)})}l(p),L(()=>{Ae(p,"href",e.href),Ae(p,"aria-current",r()?"page":void 0),De(p,1,je(n(o))),k(S,e.label)}),ke("click",p,function(...W){var C;(C=e.onclick)==null||C.apply(this,W)}),v(g,p)},f=g=>{var p=sg(),b=c(p);{var h=W=>{var C=og(),G=c(C);pn(G,()=>e.icon),l(C),v(W,C)};K(b,W=>{e.icon&&W(h)})}var w=u(b,2),S=c(w,!0);l(w);var A=u(w,2);{var D=W=>{var C=ig(),G=c(C);pn(G,()=>e.trailing),l(C),v(W,C)};K(A,W=>{e.trailing&&W(D)})}l(p),L(()=>{Ae(p,"aria-current",r()?"page":void 0),De(p,1,je(n(o))),k(S,e.label)}),ke("click",p,function(...W){var C;(C=e.onclick)==null||C.apply(this,W)}),v(g,p)};K(i,g=>{e.href?g(d):g(f,-1)})}v(t,s),st()}en(["click"]);var cg=x("<!> Connecting…",1),dg=x("<!> Connect",1),ug=x('<!> <span class="text-ok"> </span>',1),fg=x('<!> <span class="text-danger truncate"> </span>',1),vg=x('<button type="button" title="Open a local .rdb database file" class="mt-1 w-full h-9 bg-bg-2 border border-line-2 text-fg-1 font-medium rounded-md cursor-pointer transition-colors hover:border-line-3 hover:text-fg-0 disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"><!> Open database file…</button>'),gg=x("<span> </span>"),pg=x('<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>'),hg=x('<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>'),bg=x('<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),xg=x('<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 mg(t,e){it(e,!0);const r="red://localhost";function a(){var R,H;return(R=Ke.history[0])!=null&&R.url?Ke.history[0].url:(H=Ke.history[0])!=null&&H.label?Ke.history[0].label:Ke.active.url?Ke.active.url:r}let o=we(!1),s=we(Kt(a())),i=we("idle"),d=we(null),f=we(null),g=we(void 0),p=we(void 0);async function b(R){const H=R.trim().replace(/\/$/,"");if(!H)return;if(_(s,H,!0),!Ke.canReach(H)){_(i,"error"),_(d,of(H)??`This app can't reach that transport here — supported: ${n(X)}`,!0);return}_(i,"probing"),_(d,null),_(f,null),await Ke.tryConnect(Sc(H))?(_(i,"ok"),_(f,Ke.probe.rtt_ms??null,!0),setTimeout(()=>_(o,!1),350)):(_(i,"error"),_(d,Ke.probe.error??"unreachable",!0))}function h(R){R.preventDefault(),b(n(s))}async function w(){_(i,"probing"),_(d,null),_(f,null);const R=await af();R.ok?(_(i,"ok"),_(f,Ke.probe.rtt_ms??null,!0),_(s,Ke.active.url,!0),setTimeout(()=>_(o,!1),350)):R.cancelled?_(i,"idle"):(_(i,"error"),_(d,R.reason??"unreachable",!0))}function S(R){const H=Date.now()-R;return H<6e4?"just now":H<36e5?`${Math.round(H/6e4)}m ago`:H<864e5?`${Math.round(H/36e5)}h ago`:`${Math.round(H/864e5)}d ago`}function A(R,H){R.stopPropagation(),Ke.forgetById(H)}function D(){_(o,!n(o)),n(o)&&setTimeout(()=>{var R;return(R=n(p))==null?void 0:R.focus()},0)}fr(()=>{const R=()=>{_(o,!0),setTimeout(()=>{var H;return(H=n(p))==null?void 0:H.focus()},0)};return window.addEventListener("red:open-connect",R),()=>window.removeEventListener("red:open-connect",R)});const W=y(()=>Ke.connected?"bg-ok":n(i)==="error"?"bg-danger":"bg-fg-3"),C=y(()=>Ke.connected?Ke.active.label:"Connect"),G=y(()=>Ke.connected&&Ke.probe.rtt_ms!==void 0?`${Ke.probe.rtt_ms}ms`:Ke.connected?"live":"no connection"),X=y(()=>{const R=Ke.supportedTransports,H=[];return(R.includes("http")||R.includes("https"))&&H.push("http(s)://"),R.includes("unix")&&H.push("file://"),H.join(" · ")}),I=y(()=>Ke.history.filter(R=>!R.url||Ke.canReach(R.url))),te=y(()=>Ke.supportedTransports.includes("unix"));var le=xg(),oe=c(le),ee=c(oe),ve=u(ee,2);{var Q=R=>{Oc(R,{class:"size-3 text-fg-3"})};K(ve,R=>{Ke.connected||R(Q)})}var E=u(ve,2),M=c(E,!0);l(E);var m=u(E,2),N=c(m,!0);l(m);var P=u(m,2);Wf(P,{class:"size-3 text-fg-3"}),l(oe);var B=u(oe,2);{var $=R=>{var H=bg(),V=fe(H),j=u(V,2),F=c(j),ae=u(c(F),2);nn(ae),sr(ae,me=>_(p,me),()=>n(p));var be=u(ae,2),se=c(be);l(be);var J=u(be,2),Y=c(J);{var Z=me=>{var _e=cg(),pe=fe(_e);lr(pe,{class:"size-3.5 animate-spin"}),Ce(),v(me,_e)},T=me=>{var _e=dg(),pe=fe(_e);wv(pe,{class:"size-3.5"}),Ce(),v(me,_e)};K(Y,me=>{n(i)==="probing"?me(Z):me(T,-1)})}l(J);var q=u(J,2),O=c(q);{var z=me=>{var _e=ug(),pe=fe(_e);Cs(pe,{class:"size-3 text-ok"});var ue=u(pe,2),Oe=c(ue);l(ue),L(()=>k(Oe,`Connected${n(f)!==null?` · ${n(f)}ms`:""}`)),v(me,_e)},U=me=>{var _e=fg(),pe=fe(_e);ia(pe,{class:"size-3 text-danger"});var ue=u(pe,2),Oe=c(ue,!0);l(ue),L(()=>k(Oe,n(d))),v(me,_e)};K(O,me=>{n(i)==="ok"?me(z):n(i)==="error"&&me(U,1)})}l(q),l(F);var ne=u(F,2);{var ce=me=>{var _e=vg(),pe=c(_e);nv(pe,{class:"size-3.5 text-fg-3"}),Ce(),l(_e),L(()=>_e.disabled=n(i)==="probing"),ke("click",_e,w),v(me,_e)};K(ne,me=>{n(te)&&me(ce)})}var xe=u(ne,2);{var he=me=>{var _e=hg(),pe=c(_e),ue=c(pe);Yf(ue,{class:"size-3 text-fg-3"}),Ce(2),l(pe);var Oe=u(pe,2);Xe(Oe,21,()=>n(I),bn,(ie,de)=>{var ye=pg(),Pe=c(ye),Le=c(Pe),Ee=c(Le,!0);l(Le);var Te=u(Le,2),Me=c(Te);{var Ne=tt=>{var ct=gg(),qe=c(ct);l(ct),L(()=>k(qe,`${n(de).rtt_ms??""}ms`)),v(tt,ct)};K(Me,tt=>{n(de).rtt_ms!==void 0&&tt(Ne)})}var ze=u(Me,2),Ze=c(ze,!0);l(ze),l(Te),l(Pe);var $e=u(Pe,2),Je=c($e);Ln(Je,{class:"size-3"}),l($e),l(ye),L(tt=>{Pe.disabled=n(i)==="probing",Ae(Pe,"title",n(de).url?void 0:"Enter credentials to reconnect"),k(Ee,n(de).url??n(de).label),k(Ze,tt)},[()=>S(n(de).last_used)]),ke("click",Pe,()=>{n(de).url?b(n(de).url):(_(s,n(de).label,!0),setTimeout(()=>{var tt;return(tt=n(p))==null?void 0:tt.focus()},0))}),ke("click",$e,tt=>A(tt,n(de).id)),v(ie,ye)}),l(Oe),l(_e),v(me,_e)};K(xe,me=>{n(I).length>0&&me(he)})}l(j),sr(j,me=>_(g,me),()=>n(g)),L(me=>{k(se,`reachable here: ${n(X)??""}`),J.disabled=me},[()=>n(i)==="probing"||!n(s).trim()]),ke("click",V,()=>_(o,!1)),Sr("submit",F,h),zn(ae,()=>n(s),me=>_(s,me)),v(R,H)};K(B,R=>{n(o)&&R($)})}l(le),L(R=>{Ae(oe,"aria-expanded",n(o)),Ae(oe,"title",Ke.connected?"Switch connection":"Connect to reddb"),De(ee,1,R),k(M,n(C)),k(N,n(G))},[()=>je(["w-1.5 h-1.5 rounded-full shrink-0",n(W)].join(" "))]),ke("click",oe,D),v(t,le),st()}en(["click"]);var _g=x("<!> <span> </span>",1),yg=x('<!> <span class="text-fg-3">idle</span>',1),wg=x('<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>'),kg=x('<div class="px-3 py-3 text-fg-3">No activity yet.</div>'),Sg=x('<div class="text-danger text-[10px] truncate"> </div>'),Cg=x('<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>'),Eg=x('<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),Ng=x('<div class="relative"><button type="button" title="reddb activity"><!></button> <!></div>');function Mg(t,e){it(e,!0);let r=we(!1);function a(h){return h===null?"…":h<1e3?`${h}ms`:`${(h/1e3).toFixed(1)}s`}function o(h){const w=Date.now()-h;return w<1e3?"just now":w<6e4?`${Math.round(w/1e3)}s ago`:`${Math.round(w/6e4)}m ago`}var s=Ng(),i=c(s),d=c(i);{var f=h=>{var w=_g(),S=fe(w);lr(S,{class:"size-3.5 animate-spin"});var A=u(S,2),D=c(A,!0);l(A),L(()=>k(D,Ct.inflight)),v(h,w)},g=h=>{var w=yg(),S=fe(w);Fa(S,{class:"size-3.5"}),Ce(2),v(h,w)};K(d,h=>{Ct.inflight>0?h(f):h(g,-1)})}l(i);var p=u(i,2);{var b=h=>{var w=Eg(),S=fe(w),A=u(S,2),D=c(A),W=u(c(D),2),C=c(W),G=c(C);l(C);var X=u(C,2);{var I=ve=>{var Q=wg();ke("click",Q,()=>Ct.reset()),v(ve,Q)};K(X,ve=>{Ct.inflight>0&&ve(I)})}l(W),l(D);var te=u(D,2),le=c(te);{var oe=ve=>{var Q=kg();v(ve,Q)},ee=ve=>{var Q=Re(),E=fe(Q);Xe(E,17,()=>Ct.log,M=>M.id,(M,m)=>{var N=Cg(),P=c(N),B=c(P);{var $=T=>{lr(T,{class:"size-3 animate-spin text-accent"})},R=T=>{Cs(T,{class:"size-3 text-ok"})},H=T=>{ia(T,{class:"size-3 text-danger"})};K(B,T=>{n(m).status==="pending"?T($):n(m).status==="ok"?T(R,1):T(H,-1)})}l(P);var V=u(P,2),j=c(V),F=c(j,!0);l(j);var ae=u(j,2);{var be=T=>{var q=Sg(),O=c(q,!0);l(q),L(()=>k(O,n(m).error)),v(T,q)};K(ae,T=>{n(m).status==="error"&&n(m).error&&T(be)})}l(V);var se=u(V,2),J=c(se);{var Y=T=>{var q=_t();L(O=>k(q,O),[()=>o(n(m).startedAt)]),v(T,q)},Z=T=>{var q=_t();L(O=>k(q,O),[()=>a(n(m).durationMs)]),v(T,q)};K(J,T=>{n(m).status==="pending"?T(Y):T(Z,-1)})}l(se),l(N),L(()=>k(F,n(m).label)),v(M,N)}),v(ve,Q)};K(le,ve=>{Ct.log.length===0?ve(oe):ve(ee,-1)})}l(te),l(A),L(()=>k(G,`${Ct.inflight??""} active`)),ke("click",S,()=>_(r,!1)),v(h,w)};K(p,h=>{n(r)&&h(b)})}l(s),L(h=>{Ae(i,"aria-pressed",n(r)),De(i,1,h)},[()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md border text-xs font-mono transition-colors cursor-pointer",Ct.inflight>0?"border-accent/40 bg-accent/10 text-accent":"border-line-2 bg-bg-2 text-fg-3 hover:text-fg-1"].join(" "))]),ke("click",i,()=>_(r,!n(r))),v(t,s),st()}en(["click"]);const Hc="red-ui-theme",To="light";function Tg(t,e,r){const a=t==null?void 0:t.dataset.theme;if(a==="dark"||a==="light")return a;if(!e||typeof localStorage>"u")return r??To;const o=localStorage.getItem(Hc);return o==="dark"||o==="light"?o:r??To}function ul(t,e){if(e){e.dataset.theme=t;return}typeof document<"u"&&(document.documentElement.dataset.theme=t)}function zg(t,e){e&&(typeof localStorage>"u"||localStorage.setItem(Hc,t))}var Xa;class Ag{constructor(){Fe(this,Xa,we(To));Ft(this,"target",null);Ft(this,"persistTheme",!0)}get current(){return n(ge(this,Xa))}set current(e){_(ge(this,Xa),e,!0)}init(e={}){this.target=e.target??null,this.persistTheme=e.persist??!0,this.current=Tg(this.target,this.persistTheme,e.initial),ul(this.current,this.target)}set(e){this.current=e,ul(e,this.target),zg(e,this.persistTheme)}toggle(){this.set(this.current==="dark"?"light":"dark")}}Xa=new WeakMap;const Dr=new Ag;function fl(t){switch(t.view){case"ask":return"/ask";case"query":return"/query";case"collections":return"/collections";case"cluster":return"/cluster";case"security":return"/security";case"analytics":return"/analytics";case"settings":return"/settings";case"appearance":return"/appearance";case"collection":return sf(t.collection,t.subpage)}}function Pg(t){return t.view==="collection"?{view:"collections",collection:t.collection,subpage:t.subpage}:{view:t.view,collection:null,subpage:null}}function Lg(t){if(t.startsWith("/ask"))return{view:"ask",collection:null,subpage:null};if(t.startsWith("/query"))return{view:"query",collection:null,subpage:null};if(t.startsWith("/cluster"))return{view:"cluster",collection:null,subpage:null};if(t.startsWith("/security"))return{view:"security",collection:null,subpage:null};if(t.startsWith("/analytics"))return{view:"analytics",collection:null,subpage:null};if(t.startsWith("/settings"))return{view:"settings",collection:null,subpage:null};if(t.startsWith("/appearance"))return{view:"appearance",collection:null,subpage:null};const e=t.match(/^\/c\/([^/]+)(?:\/p\/([^/]+))?/);return e?{view:"collections",collection:decodeURIComponent(e[1]),subpage:e[2]?decodeURIComponent(e[2]):null}:{view:"collections",collection:null,subpage:null}}function Fc(t){let e=we(Kt({view:"collections",collection:null,subpage:null}));return{get view(){return n(e).view},get collection(){return n(e).collection},get subpage(){return n(e).subpage},get path(){return fl(n(e).collection?{view:"collection",collection:n(e).collection,subpage:n(e).subpage??"table"}:{view:n(e).view})},href:r=>fl(r),go:(r,a)=>{a==null||a.preventDefault(),_(e,Pg(r),!0)}}}const qc=Symbol("red-ui-router");let yi=null;function Ig(t){return ws(qc,t),t}function ya(){const t=ti(qc);return t||(yi||(yi=Fc()),yi)}var Og=x('<div class="w-px h-[18px] bg-line-2"></div> <!> <div class="w-px h-[18px] bg-line-2 ml-1"></div>',1),Rg=x('<div class="w-px h-[18px] bg-line-2"></div>'),$g=x('<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="Ask — grounded natural-language query"><!> <span>Ask</span></a> <a title="Query"><!> <span>Query</span></a> <a title="Collections"><!> <span>Collections</span></a> <a title="Cluster topology"><!> <span>Cluster</span></a> <a title="Security"><!> <span>Security</span></a> <a title="Analytics"><!> <span>Analytics</span></a> <a title="Settings"><!> <span>Settings</span></a></nav></div> <div class="flex items-center gap-2.5"><!> <button type="button" class="inline-flex items-center justify-center size-7 bg-bg-2 border border-line-2 rounded-md text-fg-2 cursor-pointer transition-colors hover:border-line-3 hover:text-fg-0"><!></button> <button class="inline-flex items-center gap-2 h-7 pl-2.5 pr-2 bg-bg-2 border border-line-2 rounded-md text-fg-2 cursor-pointer text-xs transition-colors hover:border-line-3 hover:text-fg-1"><!> <span>Search or run</span> <span class="inline-flex gap-0.5 ml-1"><!><!></span></button></div></header>');function Dg(t,e){it(e,!0);let r=Ge(e,"showConnect",3,!0);const a=ya();function o(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0,bubbles:!0}))}const s=y(()=>a.view==="ask"),i=y(()=>a.view==="query"),d=y(()=>a.view==="collections"),f=y(()=>a.view==="cluster"),g=y(()=>a.view==="security"),p=y(()=>a.view==="analytics"),b=y(()=>a.view==="settings");var h=$g(),w=c(h),S=c(w),A=u(S,2);{var D=Y=>{var Z=Og(),T=u(fe(Z),2);mg(T,{}),Ce(2),v(Y,Z)},W=Y=>{var Z=Rg();v(Y,Z)};K(A,Y=>{r()?Y(D):Y(W,-1)})}var C=u(A,2),G=c(C),X=c(G);No(X,{class:"size-3.5"}),Ce(2),l(G);var I=u(G,2),te=c(I);Pc(te,{class:"size-3.5"}),Ce(2),l(I);var le=u(I,2),oe=c(le);$o(oe,{class:"size-3.5"}),Ce(2),l(le);var ee=u(le,2),ve=c(ee);lf(ve,{class:"size-3.5"}),Ce(2),l(ee);var Q=u(ee,2),E=c(Q);bv(E,{class:"size-3.5"}),Ce(2),l(Q);var M=u(Q,2),m=c(M);Mc(m,{class:"size-3.5"}),Ce(2),l(M);var N=u(M,2),P=c(N);Xi(P,{class:"size-3.5"}),Ce(2),l(N),l(C),l(w);var B=u(w,2),$=c(B);Mg($,{});var R=u($,2),H=c(R);{var V=Y=>{mv(Y,{class:"size-3.5"})},j=Y=>{cv(Y,{class:"size-3.5"})};K(H,Y=>{Dr.current==="dark"?Y(V):Y(j,-1)})}l(R);var F=u(R,2),ae=c(F);Xn(ae,{class:"size-3.5 text-fg-3"});var be=u(ae,4),se=c(be);Un(se,{children:(Y,Z)=>{Ce();var T=_t("⌘");v(Y,T)}});var J=u(se);Un(J,{children:(Y,Z)=>{Ce();var T=_t("K");v(Y,T)}}),l(be),l(F),l(B),l(h),L((Y,Z,T,q,O,z,U,ne,ce,xe,he,me,_e,pe,ue)=>{Ae(S,"href",Y),Ae(G,"href",Z),Ae(G,"aria-current",n(s)?"page":void 0),De(G,1,T),Ae(I,"href",q),Ae(I,"aria-current",n(i)?"page":void 0),De(I,1,O),Ae(le,"href",z),Ae(le,"aria-current",n(d)?"page":void 0),De(le,1,U),Ae(ee,"href",ne),Ae(ee,"aria-current",n(f)?"page":void 0),De(ee,1,ce),Ae(Q,"href",xe),Ae(Q,"aria-current",n(g)?"page":void 0),De(Q,1,he),Ae(M,"href",me),Ae(M,"aria-current",n(p)?"page":void 0),De(M,1,_e),Ae(N,"href",pe),Ae(N,"aria-current",n(b)?"page":void 0),De(N,1,ue),Ae(R,"title",Dr.current==="dark"?"Switch to light theme":"Switch to dark theme"),Ae(R,"aria-label",Dr.current==="dark"?"Switch to light theme":"Switch to dark theme")},[()=>a.href({view:"collections"}),()=>a.href({view:"ask"}),()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(s)?"bg-bg-2 text-accent":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"query"}),()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(i)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"collections"}),()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(d)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"cluster"}),()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(f)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"security"}),()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(g)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"analytics"}),()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(p)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"settings"}),()=>je(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(b)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" "))]),ke("click",S,Y=>a.go({view:"collections"},Y)),ke("click",G,Y=>a.go({view:"ask"},Y)),ke("click",I,Y=>a.go({view:"query"},Y)),ke("click",le,Y=>a.go({view:"collections"},Y)),ke("click",ee,Y=>a.go({view:"cluster"},Y)),ke("click",Q,Y=>a.go({view:"security"},Y)),ke("click",M,Y=>a.go({view:"analytics"},Y)),ke("click",N,Y=>a.go({view:"settings"},Y)),ke("click",R,()=>Dr.toggle()),ke("click",F,o),v(t,h),st()}en(["click"]);function Vg(t){return`'${t.replace(/'/g,"''")}'`}function Hg(){return Math.random().toString(36).slice(2,10)}function Ms(t){return`UPDATE ${t.table} SET ${t.col} = ${Vg(t.newValue)} WHERE rid = ${t.row};`}var Za,Qa;class Fg{constructor(){Fe(this,Za,we(Kt([])));Fe(this,Qa,y(()=>this.changes.length));Ft(this,"executor",null)}get changes(){return n(ge(this,Za))}set changes(e){_(ge(this,Za),e,!0)}get count(){return n(ge(this,Qa))}set count(e){_(ge(this,Qa),e)}setExecutor(e){this.executor=e}stage(e,r,a,o,s){const i=this.changes.findIndex(f=>f.table===e&&f.row===r&&f.col===a);if(i>=0){const f=this.changes[i],g={...f,oldValue:f.oldValue,newValue:s,error:void 0},p=this.changes.slice();return p[i]=g,this.changes=p,f.id}const d=Hg();return this.changes=[...this.changes,{id:d,table:e,row:r,col:a,oldValue:o,newValue:s}],d}unstage(e){this.changes=this.changes.filter(r=>r.id!==e)}find(e,r,a){return this.changes.find(o=>o.table===e&&o.row===r&&o.col===a)}previewSql(){return this.changes.map(Ms)}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(),r=await this.executor(e),a=new Map(r.map(g=>[g.id,g])),o=[];let s=0;for(const g of e){const p=a.get(g.id);p!=null&&p.ok?s+=1:o.push({...g,error:(p==null?void 0:p.error)??"commit failed"})}const i=new Set(o.map(g=>g.id)),d=this.changes.filter(g=>!e.some(p=>p.id===g.id)),f=new Map(o.map(g=>[g.id,g]));return this.changes=[...this.changes.filter(g=>i.has(g.id)).map(g=>f.get(g.id)??g),...d],{applied:s,failed:o}}discardAll(){this.changes=[]}clear(){this.changes=[]}}Za=new WeakMap,Qa=new WeakMap;const Rn=new Fg;function wi(t){try{const e=t();return typeof e=="string"&&e.length>0?e:void 0}catch{return}}function qg(t){return t.startsWith("v")?t.slice(1):t}function Kc(){return{version:qg(wi(()=>"0.3.2")??"0.0.0-dev"),gitSha:wi(()=>"unknown")??"unknown",buildTime:wi(()=>"unknown")??"unknown"}}Kc().version;var Kg=x('<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),jg=x('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lag</span> <span> </span></span>',1),Bg=x('<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),Wg=x('<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),Ug=x('<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),Gg=x('<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>'),Yg=x('<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>'),Xg=x('<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>'),Zg=x('<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> <!> <!> <button type="button" data-no-nav="" aria-label="Toggle developer console" title="Developer console — every query and HTTP call, with timing and row counts" class="inline-flex items-center gap-1 px-3 text-fg-3 hover:text-fg-1 hover:bg-bg-2/60 transition-colors cursor-pointer bg-transparent border-0 border-l border-line-1"><!> <span>Console</span></button> <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 Qg(t,e){it(e,!0);const r=Kc(),a=ya(),o=y(()=>Rn.count),s=y(()=>Ke.readOnly),i=y(()=>Ke.readOnlyReason);function d(){window.dispatchEvent(new CustomEvent("red:open-pending-changes"))}const f=y(()=>Ke.connected),g=y(()=>{var m,N;return((m=Ke.probe.replication)==null?void 0:m.role)??((N=Ke.active)==null?void 0:N.role)??"standalone"}),p=y(()=>n(g)==="primary"?"var(--color-role-primary)":n(g)==="replica"?"var(--color-role-replica)":n(g)==="embedded"?"var(--color-role-embedded)":"var(--color-fg-3)"),b=y(()=>{var m,N;return((m=Ke.probe.replication)==null?void 0:m.wal_lsn)??((N=Ke.probe.replication)==null?void 0:N.last_applied_lsn)}),h=y(()=>{const m=Ke.probe.replication;if(!(!m||n(g)!=="replica")&&!(m.last_seen_primary_lsn===void 0||m.last_applied_lsn===void 0))return Math.max(0,m.last_seen_primary_lsn-m.last_applied_lsn)});function w(){window.dispatchEvent(new CustomEvent("red:open-connect"))}function S(){window.dispatchEvent(new CustomEvent("red:toggle-dev-console"))}function A(m){const N=m.target;N!=null&&N.closest("button, a, [data-no-nav]")||a.go({view:"cluster"})}function D(m){(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),a.go({view:"cluster"}))}var W=Zg(),C=c(W),G=c(C);{var X=m=>{var N=Ug(),P=fe(N),B=c(P);let $;var R=u(B,2),H=c(R,!0);l(R),l(P);var V=u(P,4),j=c(V,!0);l(V);var F=u(V,2);{var ae=q=>{var O=Kg(),z=u(fe(O),2),U=u(c(z),2),ne=c(U,!0);l(U),Ce(),l(z),L(()=>k(ne,Ke.probe.rtt_ms)),v(q,O)};K(F,q=>{Ke.probe.rtt_ms!==void 0&&q(ae)})}var be=u(F,2);{var se=q=>{var O=jg(),z=u(fe(O),2),U=u(c(z),2);let ne;var ce=c(U,!0);l(U),l(z),L(()=>{ne=De(U,1,"text-fg-1 tabular-nums",null,ne,{"text-warn":(n(h)??0)>0}),k(ce,n(h))}),v(q,O)};K(be,q=>{n(g)==="replica"&&n(h)!==void 0&&q(se)})}var J=u(be,2);{var Y=q=>{var O=Bg(),z=u(fe(O),2),U=u(c(z),2),ne=c(U,!0);l(U),l(z),L(()=>k(ne,n(b))),v(q,O)};K(J,q=>{n(b)!==void 0&&q(Y)})}var Z=u(J,2);{var T=q=>{var O=Wg(),z=u(fe(O),2),U=c(z);Gr(U,{class:"size-3"}),Ce(2),l(z),L(()=>Ae(z,"title",n(i)??"The server is open read-only — mutations are disabled.")),v(q,O)};K(Z,q=>{n(s)&&q(T)})}L(()=>{$=kn(B,"",$,{"background-color":n(p)}),k(H,n(g)),k(j,Ke.active.label)}),v(m,N)},I=m=>{var N=Gg();v(m,N)};K(G,m=>{n(f)?m(X):m(I,-1)})}l(C);var te=u(C,2);{var le=m=>{var N=Yg(),P=c(N);ev(P,{class:"size-3"});var B=u(P,2),$=c(B);l(B),l(N),L(()=>{Ae(N,"aria-label",`${n(o)} pending changes`),k($,`Pending changes (${n(o)??""})`)}),ke("click",N,d),v(m,N)};K(te,m=>{n(o)>0&&m(le)})}var oe=u(te,2);{var ee=m=>{var N=Xg(),P=u(c(N),2);Kf(P,{class:"size-3"}),l(N),ke("click",N,w),v(m,N)};K(oe,m=>{n(f)||m(ee)})}var ve=u(oe,2),Q=c(ve);_v(Q,{class:"size-3"}),Ce(2),l(ve);var E=u(ve,2),M=c(E);l(E),l(W),L(()=>{Ae(E,"title",`red-ui ${r.version} · ${r.gitSha} · built ${r.buildTime}`),k(M,`v${r.version??""}`)}),ke("click",C,A),ke("keydown",C,D),ke("click",ve,S),v(t,W),st()}en(["click","keydown"]);var Jg=x('<span class="hint svelte-1yq04zr"> </span>'),ep=x('<button><span class="label svelte-1yq04zr"> </span> <!> <!></button>'),tp=x('<div class="group-label svelte-1yq04zr"> </div> <!>',1),np=x('<div class="empty svelte-1yq04zr"> </div>'),rp=x('<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 ap(t,e){it(e,!0);const r=ya();let a=we(!1),o=we(""),s=we(0),i=we(void 0);function d(G){window.dispatchEvent(new CustomEvent(G))}const f=[{id:"ask",group:"navigate",label:"Open ask",hint:"/ask",run:()=>p({view:"ask"})},{id:"query",group:"navigate",label:"Open query",hint:"/query",run:()=>p({view:"query"})},{id:"collections",group:"navigate",label:"Open collections",hint:"/collections",run:()=>p({view:"collections"})},{id:"topology",group:"navigate",label:"Open cluster",hint:"/cluster",run:()=>p({view:"cluster"})},{id:"security",group:"navigate",label:"Open security",hint:"/security",run:()=>p({view:"security"})},{id:"analytics",group:"navigate",label:"Open analytics",hint:"/analytics",run:()=>p({view:"analytics"})},{id:"settings",group:"navigate",label:"Open settings",hint:"/settings",run:()=>p({view:"settings"})},{id:"appearance",group:"navigate",label:"Open appearance",hint:"/appearance",run:()=>p({view:"appearance"})},{id:"new-query",group:"data",label:"New query",shortcut:"⌘T",run:()=>{d("red:new-query"),b()}},{id:"open-connect",group:"actions",label:"Open Connect dropdown",shortcut:"⌘⇧C",run:()=>{d("red:open-connect"),b()}},{id:"apply-pending",group:"actions",label:"Apply pending changes",run:()=>{d("red:apply-pending"),b()}},{id:"discard-pending",group:"actions",label:"Discard pending changes",run:()=>{d("red:discard-pending"),b()}},{id:"toggle-theme",group:"view",label:"Toggle theme (light / dark)",hint:"theme",run:()=>{Dr.toggle(),b()}},{id:"show-shortcuts",group:"view",label:"Show keyboard shortcuts",shortcut:"?",run:()=>{b(),d("red:open-shortcuts")}}],g=y(()=>n(o).trim()===""?f:f.filter(G=>G.label.toLowerCase().includes(n(o).toLowerCase())));function p(G){r.go(G),b()}function b(){_(a,!1),_(o,""),_(s,0)}function h(G){if(!(G instanceof HTMLElement))return!1;if(G.isContentEditable)return!0;const X=G.tagName;return X==="INPUT"||X==="TEXTAREA"||X==="SELECT"}function w(G){var te;const X=G.metaKey||G.ctrlKey,I=G.key.toLowerCase();if(X&&I==="k"){G.preventDefault(),_(a,!n(a)),n(a)&&setTimeout(()=>{var le;return(le=n(i))==null?void 0:le.focus()},0);return}if(X&&G.shiftKey&&I==="c"){G.preventDefault(),d("red:open-connect");return}if(X&&!G.shiftKey&&I==="t"&&!h(G.target)){G.preventDefault(),d("red:new-query");return}if(n(a)){if(G.key==="Escape"){b();return}G.key==="ArrowDown"&&(G.preventDefault(),_(s,Math.min(n(s)+1,n(g).length-1),!0)),G.key==="ArrowUp"&&(G.preventDefault(),_(s,Math.max(n(s)-1,0),!0)),G.key==="Enter"&&(G.preventDefault(),(te=n(g)[n(s)])==null||te.run())}}fr(()=>{window.addEventListener("keydown",w);const G=()=>{_(a,!0),setTimeout(()=>{var X;return(X=n(i))==null?void 0:X.focus()},0)};return window.addEventListener("red:open-palette",G),()=>{window.removeEventListener("keydown",w),window.removeEventListener("red:open-palette",G)}});const S=["navigate","data","actions","view"],A={navigate:"Navigate",data:"Data",actions:"Actions",view:"View"};var D=Re(),W=fe(D);{var C=G=>{var X=rp(),I=fe(X),te=u(I,2),le=c(te),oe=u(c(le),2);nn(oe),sr(oe,F=>_(i,F),()=>n(i));var ee=u(oe,2);Un(ee,{children:(F,ae)=>{Ce();var be=_t("esc");v(F,be)}}),l(le);var ve=u(le,2),Q=c(ve);Xe(Q,17,()=>S,bn,(F,ae)=>{const be=y(()=>n(g).filter(Z=>Z.group===n(ae)));var se=Re(),J=fe(se);{var Y=Z=>{var T=tp(),q=fe(T),O=c(q,!0);l(q);var z=u(q,2);Xe(z,17,()=>n(be),bn,(U,ne)=>{const ce=y(()=>n(g).indexOf(n(ne)));var xe=ep();let he;var me=c(xe),_e=c(me,!0);l(me);var pe=u(me,2);{var ue=de=>{var ye=Jg(),Pe=c(ye,!0);l(ye),L(()=>k(Pe,n(ne).hint)),v(de,ye)};K(pe,de=>{n(ne).hint&&de(ue)})}var Oe=u(pe,2);{var ie=de=>{Un(de,{children:(ye,Pe)=>{Ce();var Le=_t();L(()=>k(Le,n(ne).shortcut)),v(ye,Le)}})};K(Oe,de=>{n(ne).shortcut&&de(ie)})}l(xe),L(()=>{he=De(xe,1,"row svelte-1yq04zr",null,he,{active:n(ce)===n(s)}),k(_e,n(ne).label)}),Sr("mouseenter",xe,()=>_(s,n(ce),!0)),ke("click",xe,()=>n(ne).run()),v(U,xe)}),L(()=>k(O,A[n(ae)])),v(Z,T)};K(J,Z=>{n(be).length&&Z(Y)})}v(F,se)});var E=u(Q,2);{var M=F=>{var ae=np(),be=c(ae);l(ae),L(()=>k(be,`No commands match "${n(o)??""}"`)),v(F,ae)};K(E,F=>{n(g).length===0&&F(M)})}l(ve);var m=u(ve,2),N=c(m),P=c(N);Un(P,{children:(F,ae)=>{Ce();var be=_t("↑");v(F,be)}});var B=u(P,2);Un(B,{children:(F,ae)=>{Ce();var be=_t("↓");v(F,be)}}),Ce(),l(N);var $=u(N,2),R=c($);Un(R,{children:(F,ae)=>{Ce();var be=_t("↵");v(F,be)}}),Ce(),l($);var H=u($,2),V=c(H);Un(V,{children:(F,ae)=>{Ce();var be=_t("⌘");v(F,be)}});var j=u(V);Un(j,{children:(F,ae)=>{Ce();var be=_t("K");v(F,be)}}),Ce(),l(H),l(m),l(te),ke("click",I,b),ke("keydown",I,function(...F){}),ke("input",oe,()=>_(s,0)),zn(oe,()=>n(o),F=>_(o,F)),v(G,X)};K(W,G=>{n(a)&&G(C)})}v(t,D),st()}en(["click","keydown","input"]);const op=[{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"}],ip=["Global","Connection","Workspace","Editing"];var sp=x('<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>'),lp=x('<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>'),cp=x('<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 dp(t,e){it(e,!0);let r=we(!1);function a(){_(r,!1)}function o(b){if(!(b instanceof HTMLElement))return!1;if(b.isContentEditable)return!0;const h=b.tagName;return h==="INPUT"||h==="TEXTAREA"||h==="SELECT"}function s(b){if(b.key==="Escape"&&n(r)){b.preventDefault(),a();return}if(b.key==="?"&&!b.metaKey&&!b.ctrlKey&&!b.altKey){if(o(b.target))return;b.preventDefault(),_(r,!n(r))}}fr(()=>{window.addEventListener("keydown",s);const b=()=>{_(r,!0)};return window.addEventListener("red:open-shortcuts",b),()=>{window.removeEventListener("keydown",s),window.removeEventListener("red:open-shortcuts",b)}});const i=y(()=>ip.map(b=>({ctx:b,items:op.filter(h=>h.context===b)})).filter(b=>b.items.length>0)),d={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 f=Re(),g=fe(f);{var p=b=>{var h=cp(),w=c(h),S=c(w),A=u(c(S),2),D=c(A);Un(D,{children:(C,G)=>{Ce();var X=_t("Esc");v(C,X)}}),Ce(),l(A),l(S);var W=u(S,2);Xe(W,21,()=>n(i),bn,(C,G)=>{var X=lp(),I=c(X),te=c(I),le=c(te,!0);l(te);var oe=u(te,2),ee=c(oe,!0);l(oe),l(I);var ve=u(I,2);Xe(ve,21,()=>n(G).items,bn,(Q,E)=>{var M=sp(),m=c(M),N=c(m,!0);l(m);var P=u(m,2);Xe(P,21,()=>n(E).keys,bn,(B,$)=>{Un(B,{children:(R,H)=>{Ce();var V=_t();L(()=>k(V,n($))),v(R,V)}})}),l(P),l(M),L(()=>k(N,n(E).label)),v(Q,M)}),l(ve),l(X),L(()=>{k(le,n(G).ctx),k(ee,d[n(G).ctx])}),v(C,X)}),l(W),l(w),l(h),ke("click",h,a),ke("click",w,C=>C.stopPropagation()),ke("keydown",w,function(...C){}),v(b,h)};K(g,b=>{n(r)&&b(p)})}v(t,f),st()}en(["click","keydown"]);var up=x('<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),fp=x("<!> ",1),vp=x('<!> <span class="text-danger truncate"> </span>',1),gp=x('<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>'),pp=x('<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),hp=x('<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 bp(t,e){it(e,!0);let r=we(""),a=we(""),o=we(!1),s=we(!1),i=we(void 0);function d(){_n.error=null,_(s,!0)}function f(){_(s,!1)}function g(){_n.wipe(),_(r,""),_(a,""),_(s,!1),setTimeout(()=>{var C;return(C=n(i))==null?void 0:C.focus()},0)}const p=y(()=>_n.needsSetup),b=y(()=>_n.error),h=y(()=>n(p)?"Set a master password":"Unlock credentials"),w=y(()=>n(p)?"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.");Xt(()=>{_n.locked&&setTimeout(()=>{var C;return(C=n(i))==null?void 0:C.focus()},0)});async function S(C){if(C.preventDefault(),n(o)||!n(r))return;if(n(p)&&n(r)!==n(a)){_n.error="Passwords don't match";return}_(o,!0);const G=await _n.unlock(n(r));_(o,!1),G&&(_(r,""),_(a,""),Ke.refresh())}var A=Re(),D=fe(A);{var W=C=>{var G=hp(),X=c(G),I=c(X),te=c(I);{var le=J=>{Ma(J,{class:"size-4 text-accent"})},oe=J=>{Gr(J,{class:"size-4 text-accent"})};K(te,J=>{n(p)?J(le):J(oe,-1)})}var ee=u(te,2),ve=c(ee,!0);l(ee),l(I);var Q=u(I,2),E=c(Q,!0);l(Q);var M=u(Q,4);nn(M),sr(M,J=>_(i,J),()=>n(i));var m=u(M,2);{var N=J=>{var Y=up(),Z=u(fe(Y),2);nn(Z),zn(Z,()=>n(a),T=>_(a,T)),v(J,Y)};K(m,J=>{n(p)&&J(N)})}var P=u(m,2),B=c(P);{var $=J=>{var Y=fp(),Z=fe(Y);lr(Z,{class:"size-3.5 animate-spin"});var T=u(Z);L(()=>k(T,` ${n(p)?"Setting up…":"Unlocking…"}`)),v(J,Y)},R=J=>{var Y=_t();L(()=>k(Y,n(p)?"Set password":"Unlock")),v(J,Y)};K(B,J=>{n(o)?J($):J(R,-1)})}l(P);var H=u(P,2),V=c(H);{var j=J=>{var Y=vp(),Z=fe(Y);ia(Z,{class:"size-3 text-danger"});var T=u(Z,2),q=c(T,!0);l(T),L(()=>k(q,n(b))),v(J,Y)};K(V,J=>{n(b)&&J(j)})}l(H);var F=u(H,2),ae=c(F);{var be=J=>{var Y=gp(),Z=c(Y);qa(Z,{class:"size-3"}),Ce(2),l(Y),ke("click",Y,d),v(J,Y)},se=J=>{var Y=pp(),Z=u(fe(Y),2),T=c(Z),q=c(T);qa(q,{class:"size-3"}),Ce(),l(T);var O=u(T,2);l(Z),ke("click",T,g),ke("click",O,f),v(J,Y)};K(ae,J=>{n(s)?J(se,-1):J(be)})}l(F),l(X),l(G),L(()=>{k(ve,n(h)),k(E,n(w)),Ae(M,"autocomplete",n(p)?"new-password":"current-password"),P.disabled=n(o)||!n(r)||n(p)&&!n(a)}),Sr("submit",X,S),zn(M,()=>n(r),J=>_(r,J)),v(C,G)};K(D,C=>{_n.backend==="web"&&_n.locked&&C(W)})}v(t,A),st()}en(["click"]);var xp=x('<div class="text-fg-3 text-[12px] font-mono py-6 text-center">No staged changes.</div>'),mp=x('<div class="text-warn text-[11px] mt-1 inline-flex items-center gap-1"><!> </div>'),_p=x('<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>'),yp=x('<ul class="space-y-2 text-[12px] font-mono"></ul>'),wp=x('<div class="text-warn text-[11px] font-mono mt-2"> </div>'),kp=x('<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>'),Sp=x('<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 Cp(t,e){it(e,!0);const r=y(()=>Ke.readOnly),a=y(()=>Ke.readOnlyReason);let o=we(!1),s=we(null);async function i(){if(!n(o)){_(o,!0),_(s,null);try{(await Rn.commitAll()).failed.length===0&&e.onClose()}catch(b){_(s,b.message,!0)}finally{_(o,!1)}}}function d(){Rn.discardAll(),e.onClose()}var f=Re(),g=fe(f);{var p=b=>{var h=Sp(),w=c(h),S=c(w),A=c(S),D=u(c(A),2),W=c(D);l(D),l(A);var C=u(A,2),G=c(C);Ln(G,{class:"size-4"}),l(C),l(S);var X=u(S,2),I=c(X);{var te=B=>{var $=xp();v(B,$)},le=B=>{var $=yp();Xe($,21,()=>Rn.changes,R=>R.id,(R,H)=>{var V=_p(),j=c(V),F=c(j),ae=c(F),be=c(ae,!0);l(ae);var se=u(ae,4),J=c(se,!0);l(se);var Y=u(se,4),Z=c(Y,!0);l(Y),l(F);var T=u(F,2);l(j);var q=u(j,2),O=u(c(q),2),z=c(O,!0);l(O);var U=u(O,4),ne=c(U,!0);l(U),l(q);var ce=u(q,2),xe=c(ce,!0);l(ce);var he=u(ce,2);{var me=_e=>{var pe=mp(),ue=c(pe);Cc(ue,{class:"size-3"});var Oe=u(ue);l(pe),L(()=>k(Oe,` ${n(H).error??""}`)),v(_e,pe)};K(he,_e=>{n(H).error&&_e(me)})}l(V),L((_e,pe)=>{k(be,n(H).table),k(J,n(H).row),k(Z,n(H).col),k(z,_e),k(ne,n(H).newValue),k(xe,pe)},[()=>String(n(H).oldValue??"NULL"),()=>Ms(n(H))]),ke("click",T,()=>Rn.unstage(n(H).id)),v(R,V)}),l($),v(B,$)};K(I,B=>{Rn.count===0?B(te):B(le,-1)})}var oe=u(I,2);{var ee=B=>{var $=wp(),R=c($,!0);l($),L(()=>k(R,n(s))),v(B,$)};K(oe,B=>{n(s)&&B(ee)})}l(X);var ve=u(X,2);{var Q=B=>{var $=kp(),R=c($);Gr(R,{class:"size-3 shrink-0"});var H=u(R,2),V=c(H,!0);l(H),l($),L(()=>k(V,n(a)??"Server is read-only (file in use) — changes can’t be applied.")),v(B,$)};K(ve,B=>{n(r)&&B(Q)})}var E=u(ve,2),M=c(E),m=u(M,2),N=u(m,2),P=c(N,!0);l(N),l(E),l(w),l(h),L(()=>{k(W,`${Rn.count??""} staged · review before applying`),m.disabled=Rn.count===0,N.disabled=Rn.count===0||n(o)||n(r),Ae(N,"title",n(r)?n(a)??"Server is read-only — mutations are disabled.":void 0),k(P,n(o)?"Applying…":"Apply all")}),ke("click",C,function(...B){var $;($=e.onClose)==null||$.apply(this,B)}),ke("click",M,function(...B){var $;($=e.onClose)==null||$.apply(this,B)}),ke("click",m,d),ke("click",N,i),v(b,h)};K(g,b=>{e.open&&b(p)})}v(t,f),st()}en(["click"]);const Ep=["vector","queue","stats","diff","hypertable","graph","kv","document","table"],jc={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 Np(t){return`'${t.replace(/'/g,"''")}'`}function vl(t){if(!t||t.length===0)return"table";const e=new Set;for(const r of t){const a=String(r).toLowerCase(),o=jc[a];o&&e.add(o)}for(const r of Ep)if(e.has(r))return r;return"table"}function Mp(t){var o,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 r=(o=t.schema)==null?void 0:o.kind;typeof r=="string"&&e.push(r);const a=(s=t.schema)==null?void 0:s.capability;return typeof a=="string"&&e.push(a),e}function Tp(t){return typeof t!="string"?null:jc[t.toLowerCase()]??null}async function gl(t,e){const r=e.replace(/[^A-Za-z0-9_./-]/g,"");for(const a of[`HLL INFO ${r}`,`SKETCH INFO ${r}`,`FILTER INFO ${r}`])try{if((await t.query(a)).ok)return"stats"}catch{}return null}function zp(t){var a,o,s,i;const e=new Set((((a=t.result)==null?void 0:a.columns)??[]).map(d=>d.toLowerCase())),r=(i=(s=(o=t.result)==null?void 0:o.records)==null?void 0:s[0])==null?void 0:i.values;if(r)for(const d of Object.keys(r))e.add(d.toLowerCase());return[...e]}function Ap(t){var i,d,f;const e=zp(t),r=g=>e.includes(g),a=g=>g.some(r),o=(f=(d=(i=t.result)==null?void 0:i.records)==null?void 0:d[0])==null?void 0:f.values,s=(o==null?void 0:o.kind)??(o==null?void 0:o.red_kind)??(o==null?void 0:o.red_entity_type);return s==="node"||s==="edge"||s==="graph"?"graph":s==="document"?"document":s==="kv"||r("key")&&r("value")?"kv":a(["message","payload","body"])&&a(["message_id","state","status","consumer","delivery_state"])?"queue":a(["timestamp","time","ts","event_time","bucket"])&&a(["value","count","metric"])?"hypertable":a(["metric","stat","name","table"])&&a(["value","count","total","avg","rate","row_count","page_count","cardinality","memory_bytes"])?"stats":null}async function Bc(t,e,r={}){var a,o,s,i,d,f,g;if(r.useMetadata)try{const p=await t.collection(e),b=Mp(p);if(b.length>0)return vl(b)}catch{}try{const b=(i=(s=(o=(a=(await t.query(`SELECT model FROM red.collections WHERE name = ${Np(e)} LIMIT 1`)).result)==null?void 0:a.records)==null?void 0:o[0])==null?void 0:s.values)==null?void 0:i.model,h=Tp(b);if(h&&h!=="table")return h;if(typeof b=="string"&&b.toLowerCase()==="mixed"){const w=await gl(t,e);if(w)return w}}catch{}try{const p=e.replace(/[^A-Za-z0-9_./-]/g,""),b=await t.query(`SELECT * FROM ${p} LIMIT 1`),h=[];b.capability&&h.push(b.capability);const w=(g=(f=(d=b.result)==null?void 0:d.records)==null?void 0:f[0])==null?void 0:g.values,S=w?w.red_capabilities:void 0;if(Array.isArray(S))for(const D of S)typeof D=="string"&&h.push(D);else if(typeof S=="string")for(const D of S.split(/[,\s]+/))D&&h.push(D);const A=vl(h);return A!=="table"?A:Ap(b)??"table"}catch{return await gl(t,e)??"table"}}const ki={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"}},Pp=/^red[._]/i;function Lp(t){return Pp.test(t)}var Ip=x('<span class="font-mono text-[10px] text-fg-3"> </span>'),Op=x('<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>'),Rp=x('<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>'),$p=x(`<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>`),Dp=x('<div class="h-5 rounded border border-line-1 bg-bg-1 px-1.5 motion-safe:animate-pulse"></div>'),Vp=x('<li class="flex h-7 items-center gap-2 px-3"><div class="h-4 w-4 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></li>'),Hp=x('<div class="schema-skeleton" aria-busy="true" aria-label="Loading schema"><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"><!> <div class="h-3 w-32 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div class="flex flex-wrap gap-1"></div></div> <ul class="py-1" role="presentation"></ul></div>'),Fp=x('<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>'),qp=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear collection search"><!></button>'),Kp=x('<button type="button"> </button>'),jp=x('<li class="px-3 py-2 font-mono text-[12px] text-fg-3">No matching collections.</li>'),Bp=x('<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>'),Wp=x('<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),Up=x('<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 Gp(t,e){it(e,!0);const r=ya(),a=y(()=>r.collection);let o=we(Kt([])),s=we(!1),i=we(null),d=we(""),f=we("all");const g=Array.from({length:10},(M,m)=>m),p=Array.from({length:4},(M,m)=>m),b=y(()=>Ke.connected),h=y(()=>Ke.active.url),w=y(()=>{const M=new Map;for(const m of n(o))M.set(m.capability,(M.get(m.capability)??0)+1);return[...M.entries()].sort((m,N)=>m[0].localeCompare(N[0]))}),S=y(()=>{const M=n(d).trim().toLowerCase();return n(o).filter(m=>{if(n(f)!=="all"&&m.capability!==n(f))return!1;if(!M)return!0;const N=ki[m.capability];return m.name.toLowerCase().includes(M)||N.label.toLowerCase().includes(M)})});async function A(){const M=Ke.client;if(!M||!n(b)){_(o,[],!0);return}_(s,!0),_(i,null);const m=n(h);try{const P=(await Ct.track("schema · list collections",()=>M.collections())).filter($=>!Lp($)).sort();_(o,P.map($=>({name:$,capability:"table"})),!0);const B=P.map($=>Ct.track(`schema · probe ${$}`,async()=>{const R=await Bc(M,$);m===n(h)&&_(o,n(o).map(H=>H.name===$?{...H,capability:R}:H),!0)}));await Promise.all(B)}catch(N){_(i,N.message,!0),_(o,[],!0)}finally{_(s,!1)}}Xt(()=>{_n.locked||(n(b),n(h),A())});var D=Up(),W=fe(D),C=c(W),G=c(C);$o(G,{class:"size-3.5"}),Ce(2),l(C);var X=u(C,2);{var I=M=>{var m=Ip(),N=c(m,!0);l(m),L(()=>k(N,n(o).length)),v(M,m)};K(X,M=>{n(b)&&n(o).length>0&&M(I)})}l(W);var te=u(W,2);{var le=M=>{var m=Op(),N=c(m);Gr(N,{class:"size-4 text-accent"}),Ce(4),l(m),v(M,m)},oe=M=>{var m=Rp(),N=c(m);Oc(N,{class:"size-4 text-fg-3"}),Ce(4),l(m),v(M,m)},ee=M=>{var m=$p(),N=u(c(m),2),P=c(N,!0);l(N),l(m),L(()=>k(P,n(i))),v(M,m)},ve=M=>{var m=Hp(),N=c(m),P=c(N),B=c(P);Xn(B,{class:"size-3 text-fg-3"}),Ce(2),l(P);var $=u(P,2);Xe($,20,()=>p,H=>H,(H,V)=>{var j=Dp();L(()=>kn(j,`width: ${V===0?42:28+V*8}px`)),v(H,j)}),l($),l(N);var R=u(N,2);Xe(R,20,()=>g,H=>H,(H,V)=>{var j=Vp(),F=u(c(j),2);l(j),L(()=>kn(F,`width: ${V%3===0?132:V%3===1?96:164}px`)),v(H,j)}),l(R),l(m),v(M,m)},Q=M=>{var m=Fp(),N=u(c(m),4),P=c(N);l(N),l(m),L(()=>k(P,`./scripts/seed.sh ${n(h)??""}`)),v(M,m)},E=M=>{var m=Wp(),N=fe(m),P=c(N),B=c(P);Xn(B,{class:"size-3 text-fg-3"});var $=u(B,2);nn($);var R=u($,2);{var H=Z=>{var T=qp(),q=c(T);Ln(q,{class:"size-3"}),l(T),ke("click",T,()=>_(d,"")),v(Z,T)};K(R,Z=>{n(d)&&Z(H)})}l(P);var V=u(P,2),j=c(V),F=c(j);l(j);var ae=u(j,2);Xe(ae,17,()=>n(w),([Z,T])=>Z,(Z,T)=>{var q=y(()=>er(n(T),2));let O=()=>n(q)[0],z=()=>n(q)[1];const U=y(()=>ki[O()]);var ne=Kp(),ce=c(ne);l(ne),L(xe=>{Ae(ne,"title",n(U).label),De(ne,1,xe),k(ce,`${n(U).glyph??""} ${z()??""}`)},[()=>je(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",n(f)===O()?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),ke("click",ne,()=>_(f,O(),!0)),v(Z,ne)}),l(V),l(N);var be=u(N,2),se=c(be);{var J=Z=>{var T=jp();v(Z,T)};K(se,Z=>{n(S).length===0&&Z(J)})}var Y=u(se,2);Xe(Y,17,()=>n(S),Z=>Z.name,(Z,T)=>{const q=y(()=>ki[n(T).capability]),O=y(()=>n(T).name===n(a)),z=y(()=>({view:"collection",collection:n(T).name,subpage:Pa(n(T).capability)}));var U=Bp(),ne=c(U),ce=c(ne),xe=c(ce,!0);l(ce);var he=u(ce,2),me=c(he,!0);l(he);var _e=u(he,2),pe=c(_e,!0);l(_e),l(ne),l(U),L((ue,Oe)=>{Ae(ne,"href",ue),Ae(ne,"aria-current",n(O)?"page":void 0),Ae(ne,"title",`${n(q).label} · ${n(T).name}`),De(ne,1,Oe),k(xe,n(q).glyph),k(me,n(T).name),k(pe,n(q).label)},[()=>r.href(n(z)),()=>je(["w-full flex items-center gap-2 px-3 py-1 font-mono text-[12px] no-underline transition-colors",n(O)?"bg-bg-1 text-fg-0":"text-fg-2 hover:bg-bg-1 hover:text-fg-0"].join(" "))]),ke("click",ne,ue=>r.go(n(z),ue)),v(Z,U)}),l(be),L(Z=>{De(j,1,Z),k(F,`all ${n(o).length??""}`)},[()=>je(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",n(f)==="all"?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),zn($,()=>n(d),Z=>_(d,Z)),ke("click",j,()=>_(f,"all")),v(M,m)};K(te,M=>{_n.locked?M(le):n(b)?n(i)?M(ee,2):n(s)&&n(o).length===0?M(ve,3):n(o).length===0?M(Q,4):M(E,-1):M(oe,1)})}v(t,D),st()}en(["click"]);function Yp(){return Math.random().toString(36).slice(2,10)}var Ja,eo,to;class Xp{constructor(){Fe(this,Ja,we(Kt([])));Fe(this,eo,we(null));Fe(this,to,y(()=>this.tabs.find(e=>e.id===this.activeId)??null))}get tabs(){return n(ge(this,Ja))}set tabs(e){_(ge(this,Ja),e,!0)}get activeId(){return n(ge(this,eo))}set activeId(e){_(ge(this,eo),e,!0)}get active(){return n(ge(this,to))}set active(e){_(ge(this,to),e)}open(e,r=!1){if(!r){const o=this.tabs.find(s=>s.kind===e.kind&&s.key===e.key);if(o){const s={...o,...e,id:o.id};return this.tabs=this.tabs.map(i=>i===o?s:i),this.activeId=o.id,s}}const a={...e,id:Yp()};return this.tabs=[...this.tabs,a],this.activeId=a.id,a}focus(e){this.tabs.some(r=>r.id===e)&&(this.activeId=e)}close(e,r){const a=this.tabs.findIndex(s=>s.id===e);if(a<0)return;const o=this.activeId===e;if(this.tabs=this.tabs.filter(s=>s.id!==e),o)if(r&&this.tabs.some(s=>s.id===r))this.activeId=r;else if(this.tabs.length===0)this.activeId=null;else{const s=this.tabs[Math.max(0,a-1)];this.activeId=(s==null?void 0:s.id)??null}}rename(e,r){this.tabs=this.tabs.map(a=>a.id===e?{...a,label:r}:a)}setOverride(e,r){this.tabs=this.tabs.map(a=>a.id===e?{...a,overrideCapability:r}:a)}setShowSystem(e,r){this.tabs=this.tabs.map(a=>a.id===e?{...a,showSystemColumns:r}:a)}hydrate(e,r){this.tabs=e,this.activeId=r}clear(){this.tabs=[],this.activeId=null}}Ja=new WeakMap,eo=new WeakMap,to=new WeakMap;const qt=new Xp;function Zp(){return{sql:"",result:null,error:null,running:!1,runningStartedAt:null}}function Qp(t){const e=t.replace(/\s+/g," ").trim();return e.length<=80?`query · ${e}`:`query · ${e.slice(0,79).trimEnd()}…`}function Jp(t){return t instanceof DOMException&&t.name==="AbortError"||t instanceof Error&&t.name==="AbortError"}function eh(t){if(t<1e3)return`${t}ms`;if(t<6e4)return`${(t/1e3).toFixed(1)}s`;const e=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${e}m ${r.toString().padStart(2,"0")}s`}var no;class th{constructor(){Fe(this,no,we(Kt({})));Ft(this,"counter",0);Ft(this,"executor",null);Ft(this,"runSeq",0);Ft(this,"inFlight",new Map)}get states(){return n(ge(this,no))}set states(e){_(ge(this,no),e,!0)}setExecutor(e){this.executor=e}nextLabel(){return this.counter+=1,`Query ${this.counter}`}ensure(e){return this.states[e]||(this.states[e]=Zp()),this.states[e]}setSql(e,r){const a=this.ensure(e);a.sql=r}get(e){return this.states[e]}has(e){return this.states[e]!==void 0}remove(e){this.cancel(e),delete this.states[e]}isDirty(e){const r=this.states[e];return r?r.sql.trim().length>0:!1}async run(e){var i,d,f;const r=this.ensure(e);if(r.running)return;if(!this.executor){r.error="No connection — connect to a reddb instance first.",r.result=null;return}const a=r.sql.trim();if(!a){r.error="Empty query.",r.result=null;return}const o=new AbortController,s=++this.runSeq;this.inFlight.set(e,{token:s,controller:o}),r.running=!0,r.runningStartedAt=Date.now(),r.error=null;try{const g=await Ct.track(Qp(a),()=>this.executor(a,{signal:o.signal}));if(((i=this.inFlight.get(e))==null?void 0:i.token)!==s)return;r.result=g,r.error=g.ok?null:g.error??"Query failed."}catch(g){if(((d=this.inFlight.get(e))==null?void 0:d.token)!==s)return;if(o.signal.aborted||Jp(g)){r.error=null;return}r.error=g.message,r.result=null}finally{((f=this.inFlight.get(e))==null?void 0:f.token)===s&&(this.inFlight.delete(e),r.running=!1,r.runningStartedAt=null)}}cancel(e){const r=this.inFlight.get(e);if(!r)return!1;this.inFlight.delete(e),r.controller.abort();const a=this.states[e];return a&&(a.running=!1,a.runningStartedAt=null,a.error=null),!0}clear(){for(const e of this.inFlight.values())e.controller.abort();this.inFlight.clear(),this.states={},this.counter=0,this.executor=null,this.runSeq=0}}no=new WeakMap;const Gn=new th;function nh(t,e,r=24){const a=t.trim();if(!a)return e;const o=a.match(/^\s*select\s+([\s\S]+?)\s+from\b/i);if(!o)return e;const s=o[1].replace(/\s+/g," ").trim();return!s||s==="*"?e:s.length<=r?s:s.slice(0,r-1).trimEnd()+"…"}function Ji(t){return t.replace(/[^A-Za-z0-9_./-]/g,"")}function pl(t,e){const r=Ji(t);return e==="kv"?`LIST KV ${r} LIMIT 200`:`SELECT * FROM ${r} LIMIT 200`}function rh(t){return`'${t.replace(/'/g,"''")}'`}function ah(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 = ${rh(t)}`,"LIMIT 1"].join(" ")}function Lr(t){return typeof t=="string"&&t.length>0?t:void 0}function Ir(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 oh(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t.toLowerCase()==="true")return!0;if(t.toLowerCase()==="false")return!1}}function ih(t){if(!t)return null;const e=t.values,r=Lr(e.name);return r?{name:r,model:Lr(e.model),schemaMode:Lr(e.schema_mode),entities:Ir(e.entities),segments:Ir(e.segments),indices:Ir(e.indices),inMemoryBytes:Ir(e.in_memory_bytes),onDiskBytes:Ir(e.on_disk_bytes),internal:oh(e.internal),tenantId:Lr(e.tenant_id),queueMode:Lr(e.queue_mode),dimension:Ir(e.dimension),metric:Lr(e.metric),sessionKey:Lr(e.session_key),sessionGapMs:Ir(e.session_gap_ms)}:null}function zo(t){return t===void 0?"n/a":new Intl.NumberFormat("en-US").format(t)}function hl(t){if(t===void 0)return"n/a";if(t===0)return"0 B";const e=["B","KiB","MiB","GiB","TiB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),e.length-1),a=t/1024**r,o=a>=100||r===0?0:1;return`${a.toFixed(o)} ${e[r]}`}function sh(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 bl(t){const e=[];t.schemaMode&&e.push(t.schemaMode),t.dimension!==void 0&&e.push(`${zo(t.dimension)}d`),t.metric&&e.push(t.metric),t.queueMode&&e.push(t.queueMode),t.sessionKey&&e.push(`session: ${t.sessionKey}`);const r=sh(t.sessionGapMs);return r&&e.push(`gap ${r}`),t.internal&&e.push("internal"),e}class lh{constructor(){Ft(this,"renderers",[])}register(e){const r=this.renderers.findIndex(a=>a.capability===e.capability);r>=0?this.renderers[r]=e:this.renderers.push(e)}unregister(e){this.renderers=this.renderers.filter(r=>r.capability!==e)}list(){return this.renderers}has(e){return this.renderers.some(r=>r.capability===e)}pick(e,r,a){if(a){const i=this.renderers.find(d=>d.capability===a);if(i)return i}if(e){const i=this.renderers.find(d=>d.capability===e);if(i&&i.renders(r))return i}const o=this.renderers.find(i=>i.renders(r));if(o)return o;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 tr=new lh,ch=80,Wc=["rid","collection","kind","tenant","created_at","updated_at"],dh=new Set(Wc);function es(t){return dh.has(t.toLowerCase())}function uh(t,e={}){const r=t.result.columns,a=r.filter(g=>!g.startsWith("red_")&&g!=="body"),o=a.filter(g=>!es(g)),s=o.find(g=>g.toLowerCase()==="id"),i=o.filter(g=>g!==s),d=[s,...i].filter(g=>!!g);return e.showSystem?[...Wc.filter(g=>a.includes(g)),...d]:d.length>0?d:r}function xl(t){const e=t.toLowerCase();return e==="rid"?"rid":e==="id"?"id":null}function fh(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 vh(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function gh(t){return t==null}function ph(t,e=ch){return t.result.records.slice(0,e).map(r=>r.values)}var hh=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6"> </div>'),bh=x('<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>'),xh=x('<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),mh=x('<span class="text-[9px] px-1 rounded bg-accent text-white"> </span>'),_h=x('<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>'),yh=x('<label><input type="checkbox" class="sr-only"/> </label>'),wh=x('<span class="text-warn"> </span>'),kh=x('<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>'),Sh=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">Empty result.</div>'),Ch=x(`<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>`),Eh=x('<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>'),Nh=x('<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>'),Mh=x('<span class="ml-1 text-[10px] text-fg-3 uppercase tracking-wide" title="Inferred primary key">pk</span>'),Th=x("<th><span> </span> <!></th>"),zh=x('<button type="button" class="absolute right-1 top-1/2 -translate-y-1/2 text-fg-3 hover:text-fg-1 cursor-pointer"><!></button>'),Ah=x('<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>'),Ph=x('<tr class="border-b border-line-1 bg-bg-0"><th class="px-2 py-1"></th><!></tr>'),Lh=x('<input class="w-full bg-bg-2 text-fg-1 border border-accent/60 rounded px-1 py-0.5 outline-none"/>'),Ih=x('<span class="text-fg-3 italic">NULL</span>'),Oh=x('<span class="block truncate"> </span>'),Rh=x("<td><!></td>"),$h=x('<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>'),Dh=x('· <span class="text-fg-2"> </span>',1),Vh=x('<span>· pk <code class="text-fg-2"> </code></span>'),Hh=x('<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),Fh=x('<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),qh=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function Kh(t,e){it(e,!0);let r=Ge(e,"showSystem",3,!1),a=we(null);const o=y(()=>n(a)??e.result),s=y(()=>ph(n(o))),i=y(()=>uh(n(o),{showSystem:r()})),d=y(()=>fh(n(i))),f=y(()=>n(i).filter(V=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(V)));let g=we(!1),p=we(Kt({})),b=we(200),h=we(!1),w=we(null);Xt(()=>{const V={...n(p)};let j=!1;for(const F of n(f))V[F]===void 0&&(V[F]=!0,j=!0);for(const F of Object.keys(V))n(f).includes(F)||(delete V[F],j=!0);j&&_(p,V,!0)});let S=we(Kt({})),A=we(!1);const D=y(()=>{const V=Object.entries(n(S)).filter(([,j])=>j.trim().length>0);return V.length===0?n(s):n(s).filter(j=>V.every(([F,ae])=>{const be=j[F];return be==null?!1:String(be).toLowerCase().includes(ae.toLowerCase())}))}),W=y(()=>n(D)),C=y(()=>Object.values(n(S)).filter(V=>V.trim().length>0).length);function G(V){const j={...n(S)};delete j[V],_(S,j,!0)}function X(){_(S,{},!0)}function I(){if(!e.collection)return null;const V=e.collection.replace(/[^A-Za-z0-9_./-]/g,"");return V.length>0?V:null}function te(){const V=n(f).filter(j=>n(p)[j]);return V.length===0||V.length===n(f).length?"*":V.join(", ")}function le(){const V=I();return V?`SELECT ${te()} FROM ${V} LIMIT ${n(b)}`:null}async function oe(){const V=Ke.client,j=le();if(!(!V||!j)){_(h,!0),_(w,null);try{const F=await Ct.track(`${e.collection} · ${j}`,()=>V.query(j));if(!F.ok){_(w,F.error??"query failed",!0);return}_(a,F,!0),_(S,{},!0),_(ve,null)}catch(F){_(w,F.message,!0)}finally{_(h,!1)}}}function ee(){_(a,null),_(S,{},!0),_(w,null)}let ve=we(null),Q=we("");function E(V,j,F){if(n(ve)||!e.collection||Ke.readOnly)return;_(ve,{row:V,col:j},!0);const ae=Rn.find(e.collection,V,j);_(Q,ae?ae.newValue:String(F??""),!0)}function M(){var be;if(!n(ve)||!e.collection)return;const{row:V,col:j}=n(ve),F=(be=n(W)[V])==null?void 0:be[j],ae=n(Q);if(String(F??"")!==ae)Rn.stage(e.collection,V,j,F,ae);else{const se=Rn.find(e.collection,V,j);se&&Rn.unstage(se.id)}_(ve,null)}function m(){_(ve,null)}function N(V){V.focus(),V.select()}function P(V,j,F){if(!e.collection)return{value:F,staged:!1};const ae=Rn.find(e.collection,V,j);return ae?{value:ae.newValue,staged:!0}:{value:F,staged:!1}}var B=qh(),$=c(B);{var R=V=>{var j=hh(),F=c(j,!0);l(j),L(()=>k(F,n(o).error??"Query failed.")),v(V,j)},H=V=>{var j=Fh(),F=fe(j),ae=c(F);{var be=pe=>{var ue=xh(),Oe=fe(ue),ie=c(Oe);Xf(ie,{class:"size-3"}),Ce(2),l(Oe);var de=u(Oe,2),ye=c(de);{var Pe=Me=>{lr(Me,{class:"size-3 animate-spin"})},Le=Me=>{ri(Me,{class:"size-3"})};K(ye,Me=>{n(h)?Me(Pe):Me(Le,-1)})}Ce(),l(de);var Ee=u(de,2);{var Te=Me=>{var Ne=bh(),ze=c(Ne);cf(ze,{class:"size-3"}),Ce(),l(Ne),ke("click",Ne,ee),v(Me,Ne)};K(Ee,Me=>{n(a)&&Me(Te)})}Ce(2),L(Me=>{Ae(Oe,"aria-pressed",n(g)),De(Oe,1,Me),de.disabled=n(h)||!Ke.connected},[()=>je(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",n(g)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),ke("click",Oe,()=>_(g,!n(g))),ke("click",de,oe),v(pe,ue)};K(ae,pe=>{e.collection&&pe(be)})}var se=u(ae,2),J=c(se);Lc(J,{class:"size-3"});var Y=u(J,4);{var Z=pe=>{var ue=mh(),Oe=c(ue,!0);l(ue),L(()=>k(Oe,n(C))),v(pe,ue)};K(Y,pe=>{n(C)>0&&pe(Z)})}l(se);var T=u(se,2);{var q=pe=>{var ue=_h(),Oe=c(ue);Ln(Oe,{class:"size-3"}),Ce(),l(ue),ke("click",ue,X),v(pe,ue)};K(T,pe=>{n(C)>0&&pe(q)})}var O=u(T,2),z=c(O,!0),U=u(z);{var ne=pe=>{var ue=_t();L(Oe=>k(ue,`of ${Oe??""}`),[()=>n(s).length.toLocaleString()]),v(pe,ue)};K(U,pe=>{n(C)>0&&pe(ne)})}Ce(),l(O),l(F);var ce=u(F,2);{var xe=pe=>{var ue=kh(),Oe=c(ue),ie=u(c(Oe),2),de=u(ie,2),ye=u(de,2),Pe=u(c(ye)),Le=c(Pe);Le.value=Le.__value=50;var Ee=u(Le);Ee.value=Ee.__value=100;var Te=u(Ee);Te.value=Te.__value=200;var Me=u(Te);Me.value=Me.__value=500;var Ne=u(Me);Ne.value=Ne.__value=1e3,l(Pe);var ze;aa(Pe),l(ye),l(Oe);var Ze=u(Oe,2);Xe(Ze,20,()=>n(f),Ve=>Ve,(Ve,Be)=>{var ot=yh(),re=c(ot);nn(re);var rt=u(re);l(ot),L(Qe=>{De(ot,1,Qe),Aa(re,n(p)[Be]??!1),k(rt,` ${Be??""}`)},[()=>je(["inline-flex h-5 items-center gap-1 rounded border px-1.5 cursor-pointer",n(p)[Be]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1"].join(" "))]),ke("change",re,Qe=>_(p,{...n(p),[Be]:Qe.currentTarget.checked},!0)),v(Ve,ot)}),l(Ze);var $e=u(Ze,2),Je=c($e),tt=c(Je,!0);l(Je);var ct=u(Je,2);{var qe=Ve=>{var Be=wh(),ot=c(Be,!0);l(Be),L(()=>k(ot,n(w))),v(Ve,Be)};K(ct,Ve=>{n(w)&&Ve(qe)})}l($e),l(ue),L(Ve=>{ze!==(ze=n(b))&&(Pe.value=(Pe.__value=n(b))??"",oa(Pe,n(b))),k(tt,Ve)},[()=>le()??"No collection selected"]),ke("click",ie,()=>{const Ve={};for(const Be of n(f))Ve[Be]=!0;_(p,Ve,!0)}),ke("click",de,()=>_(p,{},!0)),ke("change",Pe,Ve=>_(b,Number(Ve.currentTarget.value),!0)),v(pe,ue)};K(ce,pe=>{n(g)&&e.collection&&pe(xe)})}var he=u(ce,2);{var me=pe=>{var ue=Sh();v(pe,ue)},_e=pe=>{var ue=Hh(),Oe=fe(ue),ie=c(Oe),de=c(ie),ye=c(de),Pe=u(c(ye));Xe(Pe,17,()=>n(i),bn,(Ve,Be)=>{const ot=y(()=>xl(n(Be))),re=y(()=>es(n(Be)));var rt=Th(),Qe=c(rt),We=c(Qe,!0);l(Qe);var ft=u(Qe,2);{var Nt=mt=>{var yt=Ch();v(mt,yt)},At=mt=>{var yt=Eh();v(mt,yt)},Mt=mt=>{var yt=Nh();v(mt,yt)},Et=mt=>{var yt=Mh();v(mt,yt)};K(ft,mt=>{n(ot)==="rid"?mt(Nt):n(re)?mt(At,1):n(ot)==="id"?mt(Mt,2):n(Be)===n(d)&&mt(Et,3)})}l(rt),L(mt=>{De(rt,1,mt),De(Qe,1,je(n(ot)||n(re)?"font-semibold":"")),k(We,n(Be))},[()=>je(["px-2 py-1.5 text-left font-normal whitespace-nowrap",n(ot)==="rid"?"bg-accent/5 text-fg-0":n(re)?"bg-bg-1 text-fg-2":n(ot)==="id"?"text-fg-1":""].join(" "))]),v(Ve,rt)}),l(ye);var Le=u(ye);{var Ee=Ve=>{var Be=Ph(),ot=u(c(Be));Xe(ot,17,()=>n(i),bn,(re,rt)=>{var Qe=Ah(),We=c(Qe),ft=c(We);nn(ft);var Nt=u(ft,2);{var At=Mt=>{var Et=zh(),mt=c(Et);Ln(mt,{class:"size-3"}),l(Et),L(()=>Ae(Et,"aria-label",`Clear filter for ${n(rt)??""}`)),ke("click",Et,()=>G(n(rt))),v(Mt,Et)};K(Nt,Mt=>{var Et;(Et=n(S)[n(rt)])!=null&&Et.length&&Mt(At)})}l(We),l(Qe),L(()=>Ae(ft,"placeholder",`filter ${n(rt)??""}…`)),zn(ft,()=>n(S)[n(rt)],Mt=>n(S)[n(rt)]=Mt),v(re,Qe)}),l(Be),v(Ve,Be)};K(Le,Ve=>{n(A)&&Ve(Ee)})}l(de);var Te=u(de);Xe(Te,21,()=>n(W),bn,(Ve,Be,ot)=>{var re=$h(),rt=c(re);rt.textContent=ot+1;var Qe=u(rt);Xe(Qe,17,()=>n(i),bn,(We,ft)=>{const Nt=y(()=>n(Be)[n(ft)]),At=y(()=>P(ot,n(ft),n(Nt))),Mt=y(()=>{var at;return((at=n(ve))==null?void 0:at.row)===ot&&n(ve).col===n(ft)}),Et=y(()=>xl(n(ft))),mt=y(()=>es(n(ft)));var yt=Rh(),kt=c(yt);{var It=at=>{var ut=Lh();nn(ut),ys(()=>zn(ut,()=>n(Q),Lt=>_(Q,Lt))),Hn(ut,Lt=>N==null?void 0:N(Lt)),Sr("blur",ut,M),ke("keydown",ut,Lt=>{Lt.key==="Enter"?M():Lt.key==="Escape"&&m()}),v(at,ut)},Zt=at=>{var ut=Ih();v(at,ut)},hn=y(()=>gh(n(At).value)),xn=at=>{var ut=Oh(),Lt=c(ut,!0);l(ut),L(jt=>k(Lt,jt),[()=>vh(n(At).value)]),v(at,ut)};K(kt,at=>{n(Mt)?at(It):n(hn)?at(Zt,1):at(xn,-1)})}l(yt),L(at=>{De(yt,1,at),Ae(yt,"title",n(At).staged?"Staged change — open Pending Changes to commit":void 0)},[()=>je(["px-2 py-1 max-w-[260px] truncate align-top",n(Et)==="rid"?"bg-accent/5 text-accent font-semibold":n(mt)?"bg-bg-1 text-fg-2 font-mono":n(Et)==="id"?"text-fg-0":"",n(At).staged&&!n(Mt)?"bg-warn/15 text-fg-1":""].join(" "))]),ke("dblclick",yt,()=>E(ot,n(ft),n(Nt))),v(We,yt)}),l(re),v(Ve,re)}),l(Te),l(ie),l(Oe);var Me=u(Oe,2),Ne=c(Me),ze=c(Ne),Ze=u(ze);{var $e=Ve=>{var Be=_t("· filtered");v(Ve,Be)};K(Ze,Ve=>{n(C)>0&&Ve($e)})}var Je=u(Ze,2);{var tt=Ve=>{var Be=Dh(),ot=u(fe(Be)),re=c(ot,!0);l(ot),L(()=>k(re,e.collection)),v(Ve,Be)};K(Je,Ve=>{e.collection&&Ve(tt)})}l(Ne);var ct=u(Ne,4);{var qe=Ve=>{var Be=Vh(),ot=u(c(Be)),re=c(ot,!0);l(ot),l(Be),L(()=>k(re,n(d))),v(Ve,Be)};K(ct,Ve=>{n(d)&&Ve(qe)})}l(Me),L(()=>k(ze,`${n(W).length??""} of ${n(o).record_count??""} rows `)),v(pe,ue)};K(he,pe=>{n(o).result.records.length?pe(_e,-1):pe(me)})}L((pe,ue)=>{Ae(se,"aria-pressed",n(A)),Ae(se,"title",n(A)?"Hide column filters":"Show column filters"),De(se,1,pe),k(z,ue)},[()=>je(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",n(A)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>n(W).length.toLocaleString()]),ke("click",se,()=>_(A,!n(A))),v(V,j)};K($,V=>{n(o).ok?V(H,-1):V(R)})}l(B),v(t,B),st()}en(["click","change","dblclick","keydown"]);const jh={capability:"table",renders:t=>!!(t!=null&&t.result)&&Array.isArray(t.result.columns),component:Kh},Bh={capability:"graph",renders:t=>uf(t),component:df};function Uc(t){return t.find(e=>e.toLowerCase()==="key")??t.find(e=>e.toLowerCase()==="k")??t.find(e=>/(^|_)key$/i.test(e))??null}function Gc(t){return t.find(e=>e.toLowerCase()==="value")??t.find(e=>e.toLowerCase()==="v")??t.find(e=>/(^|_)value$/i.test(e))??null}function Wh(t){const e=t.result.columns,r=Uc(e),a=Gc(e);return!r||!a?[]:t.result.records.map(o=>({key:String(o.values[r]??""),value:o.values[a]}))}function Uh(t){var r;const e=((r=t.result)==null?void 0:r.columns)??[];return Uc(e)!==null&&Gc(e)!==null}function Gh(t,e){const r={};for(const a of t){if(!a.key.startsWith(e))continue;const s=a.key.slice(e.length).replace(/^\/+/,"").split("/").filter(Boolean);if(s.length===0){r.$value=a.value;continue}let i=r;for(let d=0;d<s.length;d+=1){const f=s[d];if(d===s.length-1){const p=i[f];p&&typeof p=="object"&&!Array.isArray(p)?p.$value=a.value:i[f]=a.value;continue}const g=i[f];if(!g||typeof g!="object"||Array.isArray(g)){const p={};g!==void 0&&(p.$value=g),i[f]=p,i=p}else i=g}}return r}function Yh(t){const e={name:"",fullKey:null,value:void 0,children:[]};for(const r of t){const a=r.key.split("/").filter(s=>s.length>0);if(a.length===0)continue;let o=e;a.forEach((s,i)=>{let d=o.children.find(f=>f.name===s);if(!d){d={name:s,fullKey:null,value:void 0,children:[]};const f=o.children.findIndex(g=>g.name>s);f<0?o.children.push(d):o.children.splice(f,0,d)}i===a.length-1&&(d.fullKey=r.key,d.value=r.value),o=d})}return e}function ml(t){return t==null?"null":typeof t=="object"?JSON.stringify(t):String(t)}var Xh=x('<span class="text-fg-3 ml-2"> </span>'),Zh=x("<ul></ul>"),Qh=x('<li><button type="button"><span class="text-fg-1"> </span> <!></button> <!></li>'),Jh=x(`<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
|
|
1163
|
-
(also accepts <code>*_key</code>/<code>*_value</code>).</div>`),e1=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear prefix"><!></button>'),t1=x('· <span class="text-fg-2"> </span>',1),n1=x('<li class="px-3 py-2 text-fg-3">No keys match prefix.</li>'),r1=x('<div class="text-fg-3 mb-2"> </div> <pre class="text-fg-1 whitespace-pre-wrap break-all"> </pre>',1),a1=x('<div class="text-fg-3">Click a key to inspect.</div>'),o1=x('<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>'),i1=x('<div class="text-fg-3">No keys match prefix.</div>'),s1=x('<pre class="whitespace-pre text-fg-1"> </pre>'),l1=x('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><!></div>'),c1=x('<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),d1=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function u1(t,e){it(e,!0);const r=(A,D=Kn,W=Kn)=>{var C=Qh(),G=c(C);let X,I;var te=c(G),le=c(te,!0);l(te);var oe=u(te,2);{var ee=E=>{var M=Xh(),m=c(M,!0);l(M),L(N=>k(m,N),[()=>p(D().value)]),v(E,M)};K(oe,E=>{D().fullKey!==null&&E(ee)})}l(G);var ve=u(G,2);{var Q=E=>{var M=Zh();Xe(M,21,()=>D().children,m=>m.name,(m,N)=>{r(m,()=>n(N),()=>W()+1)}),l(M),v(E,M)};K(ve,E=>{D().children.length>0&&E(Q)})}l(C),L(()=>{X=De(G,1,"w-full text-left px-2 py-0.5 hover:bg-bg-1/60",null,X,{"text-accent":n(s)===D()}),I=kn(G,"",I,{"padding-left":`${8+W()*12}px`}),k(le,D().name)}),ke("click",G,()=>_(s,D(),!0)),v(A,C)};let a=we(""),o=we("tree"),s=we(null);const i=y(()=>Wh(e.result)),d=y(()=>n(a).trim()?n(i).filter(A=>A.key.startsWith(n(a).trim())):n(i)),f=y(()=>Yh(n(d))),g=y(()=>Gh(n(i),n(a).trim()));function p(A){const D=ml(A);return D.length>60?D.slice(0,59)+"…":D}var b=d1(),h=c(b);{var w=A=>{var D=Jh();v(A,D)},S=A=>{var D=c1(),W=fe(D),C=c(W),G=c(C),X=c(G);sv(X,{class:"size-3"}),Ce(),l(G);var I=u(G,2),te=c(I);va(te,{class:"size-3"}),Ce(),l(I),l(C);var le=u(C,2),oe=c(le);Xn(oe,{class:"size-3 text-fg-3"});var ee=u(oe,2);nn(ee);var ve=u(ee,2);{var Q=V=>{var j=e1(),F=c(j);Ln(F,{class:"size-3"}),l(j),ke("click",j,()=>_(a,"")),v(V,j)};K(ve,V=>{n(a)&&V(Q)})}l(le);var E=u(le,2),M=c(E,!0),m=u(M);{var N=V=>{var j=_t();L(F=>k(j,`of ${F??""}`),[()=>n(i).length.toLocaleString()]),v(V,j)};K(m,V=>{n(a)&&V(N)})}var P=u(m,2);{var B=V=>{var j=t1(),F=u(fe(j)),ae=c(F,!0);l(F),L(()=>k(ae,e.collection)),v(V,j)};K(P,V=>{e.collection&&V(B)})}l(E),l(W);var $=u(W,2);{var R=V=>{var j=o1(),F=c(j),ae=c(F);{var be=q=>{var O=n1();v(q,O)},se=q=>{var O=Re(),z=fe(O);Xe(z,17,()=>n(f).children,U=>U.name,(U,ne)=>{r(U,()=>n(ne),()=>0)}),v(q,O)};K(ae,q=>{n(f).children.length===0?q(be):q(se,-1)})}l(F);var J=u(F,2),Y=c(J);{var Z=q=>{var O=r1(),z=fe(O),U=c(z,!0);l(z);var ne=u(z,2),ce=c(ne,!0);l(ne),L(xe=>{k(U,n(s).fullKey??n(s).name),k(ce,xe)},[()=>ml(n(s).value)]),v(q,O)},T=q=>{var O=a1();v(q,O)};K(Y,q=>{n(s)?q(Z):q(T,-1)})}l(J),l(j),v(V,j)},H=V=>{var j=l1(),F=c(j);{var ae=J=>{var Y=i1();v(J,Y)},be=y(()=>Object.keys(n(g)).length===0),se=J=>{var Y=s1(),Z=c(Y,!0);l(Y),L(T=>k(Z,T),[()=>JSON.stringify(n(g),null,2)]),v(J,Y)};K(F,J=>{n(be)?J(ae):J(se,-1)})}l(j),v(V,j)};K($,V=>{n(o)==="tree"?V(R):V(H,-1)})}L((V,j,F)=>{De(G,1,V),Ae(G,"aria-pressed",n(o)==="tree"),De(I,1,j),Ae(I,"aria-pressed",n(o)==="json"),k(M,F)},[()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(o)==="tree"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(o)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(d).length.toLocaleString()]),ke("click",G,()=>_(o,"tree")),ke("click",I,()=>_(o,"json")),zn(ee,()=>n(a),V=>_(a,V)),v(A,D)};K(h,A=>{n(i).length===0?A(w):A(S,-1)})}l(b),v(t,b),st()}en(["click"]);const f1={capability:"kv",renders:t=>Uh(t),component:u1},sa="__all__",v1=["time","timestamp","ts","event_time","bucket","created_at"],g1=new Set(["created_at","updated_at","time","timestamp","timestamp_ns","rid","tenant"]),Yc=640,Xc=180,Zc=16;function Ia(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 Si(t){return typeof t=="number"?t:Number(t)}function Ao(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 r=Date.parse(t);return Number.isNaN(r)?null:r}return null}function Qc(t){var a,o;const e=((a=t.result)==null?void 0:a.columns)??[];for(const s of v1){const i=e.find(d=>d.toLowerCase()===s);if(i)return i}const r=((o=t.result)==null?void 0:o.records)??[];if(r.length===0)return null;for(const s of e){const i=r.find(d=>d.values[s]!==null&&d.values[s]!==void 0);if(i&&Ao(i.values[s])!==null&&!Ia(i.values[s]))return s}return null}function Jc(t,e){var s,i;const r=((s=t.result)==null?void 0:s.columns)??[],a=((i=t.result)==null?void 0:i.records)??[];if(a.length===0)return[];const o=[];for(const d of r){if(d===e||d.startsWith("red_")||g1.has(d.toLowerCase()))continue;const f=a.find(g=>g.values[d]!==null&&g.values[d]!==void 0);f&&Ia(f.values[d])&&o.push(d)}return o}function p1(t){const e=Qc(t);return e?Jc(t,e).length>0:!1}function h1(t,e){const r=Qc(t);if(!r)return null;const a=t.result.columns.find(f=>f.toLowerCase()==="metric")??null,o=t.result.columns.find(f=>f.toLowerCase()==="value")??null;if(a&&o){const f=new Set,g=[];for(const b of t.result.records){const h=b.values[a],w=b.values[o];if((typeof h=="string"||typeof h=="number")&&Ia(w)){f.add(String(h));const S=Ao(b.values[r]);S!==null&&g.push({t:S,v:Si(w),raw:b.values})}}const p=[...f].sort();if(p.length>0){if(!e||e===sa)return g.sort((w,S)=>w.t-S.t),{timeColumn:r,metricColumn:o,metrics:[sa,...p],points:g,metricNameColumn:a};const b=p.includes(e)?e:p[0],h=[];for(const w of t.result.records){if(String(w.values[a])!==b)continue;const S=Ao(w.values[r]);if(S===null)continue;const A=w.values[o];Ia(A)&&h.push({t:S,v:Si(A),raw:w.values})}return h.sort((w,S)=>w.t-S.t),{timeColumn:r,metricColumn:o,metrics:[sa,...p],points:h,metricNameColumn:a}}}const s=Jc(t,r);if(s.length===0)return null;const i=e&&s.includes(e)?e:s[0],d=[];for(const f of t.result.records){const g=f.values[r],p=f.values[i],b=Ao(g);b!==null&&Ia(p)&&d.push({t:b,v:Si(p),raw:f.values})}return d.sort((f,g)=>f.t-g.t),{timeColumn:r,metricColumn:i,metrics:s,points:d,metricNameColumn:null}}function b1(t,e=Yc,r=Xc,a=Zc){const o=t.points;if(o.length===0)return null;const s=o[0].t,i=o[o.length-1].t;let d=1/0,f=-1/0;for(const S of o)S.v<d&&(d=S.v),S.v>f&&(f=S.v);if(!Number.isFinite(d)||!Number.isFinite(f))return null;const g=i-s||1,p=f-d||1,b=e-a*2,h=r-a*2,w=[];return o.forEach((S,A)=>{const D=a+(S.t-s)/g*b,W=a+h-(S.v-d)/p*h;w.push(`${A===0?"M":"L"}${D.toFixed(2)},${W.toFixed(2)}`)}),{width:e,height:r,padding:a,path:w.join(" "),minT:s,maxT:i,minV:d,maxV:f}}function x1(t,e=6e4){if(t.points.length===0)return[];const r=t.points[0].t,a=t.points[t.points.length-1].t,o=Math.floor(r/e)*e,s=Math.floor(a/e)*e,i=new Map;for(let d=o;d<=s;d+=e)i.set(d,{t:d,count:0,sum:0});for(const d of t.points){const f=Math.floor(d.t/e)*e,g=i.get(f);g&&(g.count+=1,g.sum+=d.v)}return[...i.values()].sort((d,f)=>d.t-f.t)}function m1(t,e=Yc,r=Xc,a=Zc){if(t.length===0)return null;const o=t.reduce((p,b)=>Math.max(p,b.count),0);if(o===0)return null;const s=e-a*2,i=r-a*2,d=s/t.length,f=Math.max(1,d-1),g=t.map((p,b)=>{const w=p.count/o*i;return{x:a+b*d,y:a+i-w,w:f,h:w,bucket:p}});return{width:e,height:r,padding:a,bars:g,maxCount:o}}var _1=x('<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>'),y1=x("<option> </option>"),w1=x('<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>'),k1=x('<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>'),S1=x('· <span class="text-fg-2"> </span>',1),C1=En('<rect class="cursor-pointer transition-opacity" fill="var(--color-accent)" role="button" tabindex="0"><title> </title></rect>'),E1=En('<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>'),N1=En('<svg class="block w-full h-[180px] text-accent" aria-label="Timeseries chart"><path fill="none" stroke="currentColor" stroke-width="1.5"></path></svg>'),M1=x('<th class="px-2 py-1.5 text-left font-normal">metric</th>'),T1=x('<td class="px-2 py-1 text-fg-2"> </td>'),z1=x('<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>'),A1=x('<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),P1=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function L1(t,e){it(e,!0);let r=we(Kt(sa)),a=we("rate"),o=we(6e4),s=we(null);const i=y(()=>h1(e.result,n(r))),d=y(()=>n(i)&&n(a)==="line"?b1(n(i)):null),f=y(()=>n(i)?x1(n(i),n(o)):[]),g=y(()=>n(i)&&n(a)==="rate"?m1(n(f)):null),p=y(()=>{if(!n(i))return[];if(!n(s))return n(i).points;const I=n(s).t,te=I+n(o);return n(i).points.filter(le=>le.t>=I&&le.t<te)});function b(I){try{return new Date(I).toISOString().replace("T"," ").slice(0,19)}catch{return String(I)}}function h(I){return I==null?"":typeof I=="object"?JSON.stringify(I):String(I)}function w(I){var ve;const te=[],le=(ve=n(i))!=null&&ve.metricNameColumn?I.raw[n(i).metricNameColumn]:void 0;le!==void 0&&te.push(String(le));const oe=I.raw.tags;if(oe&&typeof oe=="object"){const Q=Object.entries(oe).map(([E,M])=>`${E}=${h(M)}`).join(" ");Q&&te.push(Q)}const ee=I.raw.event??I.raw.action??I.raw.message??I.raw.payload;return ee!==void 0&&te.push(h(ee)),te.join(" · ")}function S(I){return I===1e3?"1s":I===1e4?"10s":I===6e4?"1min":I===3e5?"5min":I===6e5?"10min":I===36e5?"1hr":`${I}ms`}function A(I){return I===sa?"all writes":I}function D(){return n(i)?!n(r)||n(r)===sa?"all writes":n(r):""}var W=P1(),C=c(W);{var G=I=>{var te=_1();v(I,te)},X=I=>{var te=A1(),le=fe(te),oe=c(le),ee=c(oe),ve=c(ee);Bf(ve,{class:"size-3"});var Q=u(ve);l(ee);var E=u(ee,2),M=c(E);Mc(M,{class:"size-3"}),Ce(),l(E),l(oe);var m=u(oe,2),N=c(m);Fa(N,{class:"size-3"});var P=u(N,2);Xe(P,20,()=>n(i).metrics,ie=>ie,(ie,de)=>{var ye=y1(),Pe=c(ye,!0);l(ye);var Le={};L(Ee=>{k(Pe,Ee),Le!==(Le=de)&&(ye.value=(ye.__value=de)??"")},[()=>A(de)]),v(ie,ye)}),l(P),l(m);var B=u(m,2);{var $=ie=>{var de=w1(),ye=u(c(de)),Pe=c(ye);Pe.value=Pe.__value=1e3;var Le=u(Pe);Le.value=Le.__value=1e4;var Ee=u(Le);Ee.value=Ee.__value=6e4;var Te=u(Ee);Te.value=Te.__value=3e5;var Me=u(Te);Me.value=Me.__value=6e5;var Ne=u(Me);Ne.value=Ne.__value=36e5,l(ye);var ze;aa(ye),l(de),L(()=>{ze!==(ze=n(o))&&(ye.value=(ye.__value=n(o))??"",oa(ye,n(o)))}),ke("change",ye,Ze=>{_(o,Number(Ze.currentTarget.value),!0),_(s,null)}),v(ie,de)};K(B,ie=>{n(a)==="rate"&&ie($)})}var R=u(B,2);{var H=ie=>{var de=k1(),ye=c(de);Ln(ye,{class:"size-3"}),Ce(),l(de),ke("click",de,()=>_(s,null)),v(ie,de)};K(R,ie=>{n(s)&&ie(H)})}var V=u(R,2),j=c(V),F=c(j,!0);l(j);var ae=u(j),be=u(ae);{var se=ie=>{var de=_t();L(ye=>k(de,`of ${ye??""}`),[()=>n(i).points.length.toLocaleString()]),v(ie,de)};K(be,ie=>{n(s)&&ie(se)})}var J=u(be,2);{var Y=ie=>{var de=S1(),ye=u(fe(de)),Pe=c(ye,!0);l(ye),L(()=>k(Pe,e.collection)),v(ie,de)};K(J,ie=>{e.collection&&ie(Y)})}l(V),l(le);var Z=u(le,2),T=c(Z);{var q=ie=>{var de=E1(),ye=c(de);Xe(ye,17,()=>n(g).bars,Me=>Me.bucket.t,(Me,Ne)=>{var ze=C1(),Ze=c(ze),$e=c(Ze);l(Ze),l(ze),L((Je,tt,ct)=>{Ae(ze,"x",n(Ne).x),Ae(ze,"y",n(Ne).y),Ae(ze,"width",n(Ne).w),Ae(ze,"height",n(Ne).h),Ae(ze,"opacity",!n(s)||n(s).t===n(Ne).bucket.t?.9:.3),Ae(ze,"aria-label",`Bucket starting at ${Je??""} with ${n(Ne).bucket.count??""} writes`),k($e,`${tt??""} — ${n(Ne).bucket.count??""} writes (sum ${ct??""})`)},[()=>b(n(Ne).bucket.t),()=>b(n(Ne).bucket.t),()=>n(Ne).bucket.sum.toFixed(2)]),ke("click",ze,()=>{var Je;return _(s,((Je=n(s))==null?void 0:Je.t)===n(Ne).bucket.t?null:n(Ne).bucket,!0)}),ke("keydown",ze,Je=>{var tt;(Je.key==="Enter"||Je.key===" ")&&(Je.preventDefault(),_(s,((tt=n(s))==null?void 0:tt.t)===n(Ne).bucket.t?null:n(Ne).bucket,!0))}),v(Me,ze)});var Pe=u(ye),Le=c(Pe,!0);l(Pe);var Ee=u(Pe),Te=c(Ee);l(Ee),l(de),L((Me,Ne)=>{Ae(de,"viewBox",`0 0 ${n(g).width} ${n(g).height}`),Ae(Pe,"x",n(g).padding),Ae(Pe,"y",n(g).height-2),k(Le,Me),Ae(Ee,"x",n(g).width-n(g).padding),Ae(Ee,"y",n(g).height-2),k(Te,`peak ${n(g).maxCount??""}/${Ne??""}`)},[()=>{var Me;return b(((Me=n(g).bars[0])==null?void 0:Me.bucket.t)??0)},()=>S(n(o))]),v(ie,de)},O=ie=>{var de=N1(),ye=c(de);l(de),L(()=>{Ae(de,"viewBox",`0 0 ${n(d).width} ${n(d).height}`),Ae(ye,"d",n(d).path)}),v(ie,de)};K(T,ie=>{n(a)==="rate"&&n(g)?ie(q):n(d)&&ie(O,1)})}l(Z);var z=u(Z,2),U=c(z),ne=c(U),ce=c(ne),xe=u(c(ce));{var he=ie=>{var de=M1();v(ie,de)};K(xe,ie=>{n(i).metricNameColumn&&ie(he)})}Ce(2),l(ce),l(ne);var me=u(ne);Xe(me,21,()=>n(p),bn,(ie,de)=>{var ye=z1(),Pe=c(ye),Le=c(Pe,!0);l(Pe);var Ee=u(Pe);{var Te=$e=>{var Je=T1(),tt=c(Je,!0);l(Je),L(ct=>k(tt,ct),[()=>String(n(de).raw[n(i).metricNameColumn]??"")]),v($e,Je)};K(Ee,$e=>{n(i).metricNameColumn&&$e(Te)})}var Me=u(Ee),Ne=c(Me,!0);l(Me);var ze=u(Me),Ze=c(ze,!0);l(ze),l(ye),L(($e,Je)=>{k(Le,$e),k(Ne,n(de).v),k(Ze,Je)},[()=>b(n(de).t),()=>w(n(de))]),v(ie,ye)}),l(me),l(U),l(z);var _e=u(z,2),pe=c(_e),ue=u(pe);{var Oe=ie=>{var de=_t();L((ye,Pe)=>k(de,`· bucket ${ye??""} (+${Pe??""})`),[()=>b(n(s).t),()=>S(n(o))]),v(ie,de)};K(ue,ie=>{n(s)&&ie(Oe)})}l(_e),L((ie,de,ye,Pe,Le)=>{De(ee,1,ie),Ae(ee,"aria-pressed",n(a)==="rate"),k(Q,` Writes/${de??""}`),De(E,1,ye),Ae(E,"aria-pressed",n(a)==="line"),k(F,Pe),k(ae,` · ${Le??""}`),k(pe,`${n(p).length??""} inserts${e.collection?" · ":""}${e.collection??""??""} `)},[()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(a)==="rate"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>S(n(o)),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(a)==="line"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>D(),()=>n(p).length.toLocaleString()]),ke("click",ee,()=>_(a,"rate")),ke("click",E,()=>_(a,"line")),Wi(P,()=>n(r),ie=>_(r,ie)),v(I,te)};K(C,I=>{n(i)?I(X,-1):I(G)})}l(W),v(t,W),st()}en(["click","change","keydown"]);const I1={capability:"hypertable",renders:t=>p1(t),component:L1};function O1(t){return{query:t.query,capability:t.capability,record_count:t.record_count,records:t.result.records}}function R1(t){return JSON.stringify(t,null,2)}function $1(t){let e="",r=0;const a=t.length;for(;r<a;){const o=t[r];if(o==='"'){let s=r+1;for(;s<a;){if(t[s]==="\\"){s+=2;continue}if(t[s]==='"')break;s+=1}const i=t.slice(r,s+1);let d=s+1;for(;d<a&&(t[d]===" "||t[d]===" ");)d+=1;const f=t[d]===":";e+=`<span class="${f?"k":"s"}">${Ci(i)}</span>`,r=s+1;continue}if(o>="0"&&o<="9"||o==="-"&&t[r+1]>="0"&&t[r+1]<="9"){let s=r+1;for(;s<a&&/[0-9eE+\-.]/.test(t[s]);)s+=1;e+=`<span class="n">${Ci(t.slice(r,s))}</span>`,r=s;continue}if(t.startsWith("true",r)||t.startsWith("false",r)){const s=t[r]==="t"?4:5;e+=`<span class="b">${t.slice(r,r+s)}</span>`,r+=s;continue}if(t.startsWith("null",r)){e+='<span class="z">null</span>',r+=4;continue}e+=Ci(o),r+=1}return e}function Ci(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var D1=x('<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 V1(t,e){it(e,!0);const r=y(()=>R1(O1(e.result))),a=y(()=>$1(n(r)));var o=D1(),s=c(o),i=c(s);Sf(i,()=>n(a),!0),l(i),l(s);var d=u(s,2),f=c(d);l(d),l(o),L(()=>k(f,`${e.result.record_count??""} records · raw shape${e.collection?" · ":""}${e.collection??""??""}`)),v(t,o),st()}const H1={capability:"json",renders:()=>!1,component:V1},F1=/(^|_)(vector|embedding|embeddings|turbovec)($|_)/i,q1=/(^|_)(scalar|score|distance|similarity|magnitude|norm)($|_)/i,K1=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 ts(t){return Array.isArray(t)&&t.length>0&&t.every(e=>typeof e=="number"&&Number.isFinite(e))}function j1(t){const e=Object.entries(t).find(([a,o])=>F1.test(a)&&ts(o));if(e)return e;const r=Object.entries(t).find(([,a])=>ts(a));return r||null}function B1(t,e){const r=Object.entries(t).find(([a,o])=>a!==e&&q1.test(a)&&typeof o=="number"&&Number.isFinite(o));return r||null}function _l(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?Math.floor(t):null}function ns(t){return t.result.records.map((e,r)=>{var g;const a=e.values??{},o=((g=e.vector_results)==null?void 0:g.find(p=>ts(p.vector)))??null,s=o!=null&&o.vector?["vector_results.vector",o.vector]:j1(a),i=B1(a,(s==null?void 0:s[0])??null),d=(s==null?void 0:s[1].length)??_l(a.dimension)??_l(a.vector_dimension)??0,f={};for(const[p,b]of Object.entries(a))p===(s==null?void 0:s[0])||p===(i==null?void 0:i[0])||K1.has(p)||(f[p]=b);return{index:r,id:String(a.id??a.entity_id??a.red_entity_id??a.rid??r+1),vectorColumn:(s==null?void 0:s[0])??null,vector:(s==null?void 0:s[1])??[],dimension:d,scalarColumn:(i==null?void 0:i[0])??null,scalar:(i==null?void 0:i[1])??null,metadata:f}})}function W1(t){return t.capability==="vector"||t.result.records.some(e=>{var r;return(((r=e.vector_results)==null?void 0:r.length)??0)>0})?!0:ns(t).some(e=>e.vector.length>0||e.dimension>0||e.scalar!==null)}function po(t){return Math.sqrt(t.reduce((e,r)=>e+r*r,0))}function Ei(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 Ni(t){return t==null?"NULL":typeof t=="object"?JSON.stringify(t):String(t)}function U1(t){return/^VECTOR\s+SEARCH\s+\S+\s+SIMILAR\s+TO\s+\[1(?:\.0)?,\s*0(?:\.0)?/i.test(t.query.trim())}function G1(t){return/^VECTOR\s+SEARCH\s+/i.test(t.query.trim())}function Y1(t){const e=t.replace(/[\[\]]/g," ").split(/[,\s]+/).map(a=>a.trim()).filter(Boolean).map(Number);if(e.length===0)throw new Error("Paste a numeric vector first.");if(e.find(a=>!Number.isFinite(a))!==void 0)throw new Error("Vector contains a non-numeric value.");return e}function X1(t){return`[${t.map(e=>Number(e.toPrecision(8))).join(", ")}]`}function Z1(t){return`'${t.replace(/'/g,"''")}'`}function Q1(t){return t.replace(/[^A-Za-z0-9_./-]/g,"")}function yl(t,e,r){const a=Math.max(1,Math.min(200,Math.floor(Number(r)||20))),o=e.kind==="text"?Z1(e.text):X1(e.vector);return`VECTOR SEARCH ${Q1(t)} SIMILAR TO ${o} INCLUDE VECTORS LIMIT ${a}`}var J1=x('<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"/>'),eb=x('<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"/>'),tb=x('<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),nb=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector row filter"><!></button>'),rb=x('<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>'),ab=x("<span> </span>"),ob=x('<div class="mt-1.5 text-warn"> </div>'),ib=x('<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>'),sb=x('<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>'),lb=x('<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>'),cb=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector result filter"><!></button>'),db=x('<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>'),ub=x('<span class="ml-auto text-fg-1"> </span>'),fb=x('<div class="mt-0.5 truncate text-fg-3"> </div>'),vb=x('<button type="button"><div class="flex items-baseline gap-2"><span class="text-accent"> </span> <span class="text-fg-3"> </span> <!></div> <!></button>'),gb=x('<div class="text-fg-3">No vector selected.</div>'),pb=x('<div class="text-fg-3">vector column</div> <div class="text-fg-0"> </div>',1),hb=x('<div class="text-fg-3">ranking metric</div> <div class="text-fg-0"> </div>',1),bb=x('<div class="text-fg-3 truncate"> </div> <div class="text-fg-1 break-words"> </div>',1),xb=x('<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>'),mb=x('<div class="border border-line-1 bg-bg-1/40 px-3 py-2 text-fg-3"> </div>'),_b=x('<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>'),yb=x('<div class="mt-2 text-fg-3">Showing first 256 dimensions.</div>'),wb=x('<div class="mb-2 flex items-center justify-between text-fg-3"><span> </span> <span> </span></div> <div class="grid gap-1"></div> <!>',1),kb=x('<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>'),Sb=x('<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>'),Cb=x('<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),Eb=x('<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 Nb(t,e){it(e,!0);let r=we("browse"),a=we("metadata"),o=we("text"),s=we(""),i=we(""),d=we(20),f=we(""),g=we(null),p=we(null),b=we(!1),h=we(null);const w=y(()=>ns(e.result)),S=y(()=>{var U;return((U=n(w).find(ne=>ne.dimension>0))==null?void 0:U.dimension)??null}),A=y(()=>n(p)??(G1(e.result)?e.result:null)),D=y(()=>n(A)?ns(n(A)):[]),W=y(()=>n(r)==="search"?n(D):n(w)),C=y(()=>n(A)?U1(n(A)):!1),G=y(()=>{const U=n(f).trim().toLowerCase();return U?n(W).filter(ne=>ne.id.toLowerCase().includes(U)||Object.values(ne.metadata).some(ce=>Ni(ce).toLowerCase().includes(U))):n(W)}),X=y(()=>n(g)??n(G)[0]??null),I=y(()=>Math.max(1,...n(G).map(U=>po(U.vector)))),te=y(()=>n(A)!==null);function le(U){const ne=Object.entries(U.metadata).slice(0,3);return ne.length===0?"":ne.map(([ce,xe])=>`${ce}=${Ni(xe)}`).join(" · ")}function oe(U,ne){const ce=Math.max(1,...ne.map(xe=>Math.abs(xe)));return Math.max(2,Math.abs(U)/ce*100)}async function ee(){if(!e.client||!e.collection){_(h,"No active RedDB connection for vector search.");return}_(h,null),_(b,!0);try{const U=n(s).trim();if(n(o)==="text"&&U.length===0)throw new Error("Enter text for RedDB to embed.");const ne=n(o)==="text"?yl(e.collection,{kind:"text",text:U},n(d)):yl(e.collection,{kind:"vector",vector:Y1(n(i))},n(d)),ce=await e.client.query(ne);_(p,ce,!0),_(g,null),_(r,"search"),_(a,"metadata")}catch(U){_(h,U.message,!0)}finally{_(b,!1)}}var ve=Eb(),Q=c(ve),E=c(Q),M=c(E),m=c(M),N=c(m);Yi(N,{class:"size-3"}),Ce(),l(m);var P=u(m,2),B=c(P);Xn(B,{class:"size-3"}),Ce(),l(P),l(M);var $=u(M,2);{var R=U=>{var ne=tb(),ce=fe(ne),xe=c(ce),he=u(xe,2);l(ce);var me=u(ce,2),_e=c(me);{var pe=Ee=>{var Te=J1();nn(Te),ke("keydown",Te,Me=>{Me.key==="Enter"&&ee()}),zn(Te,()=>n(s),Me=>_(s,Me)),v(Ee,Te)},ue=Ee=>{var Te=eb();nn(Te),ke("keydown",Te,Me=>{Me.key==="Enter"&&ee()}),zn(Te,()=>n(i),Me=>_(i,Me)),v(Ee,Te)};K(_e,Ee=>{n(o)==="text"?Ee(pe):Ee(ue,-1)})}l(me);var Oe=u(me,2),ie=u(c(Oe),2);nn(ie),l(Oe);var de=u(Oe,2),ye=c(de);{var Pe=Ee=>{lr(Ee,{class:"size-3 animate-spin"})},Le=Ee=>{ri(Ee,{class:"size-3"})};K(ye,Ee=>{n(b)?Ee(Pe):Ee(Le,-1)})}Ce(),l(de),L((Ee,Te,Me)=>{De(xe,1,Ee),Ae(xe,"aria-pressed",n(o)==="text"),De(he,1,Te),Ae(he,"aria-pressed",n(o)==="vector"),De(de,1,Me),de.disabled=n(b)},[()=>je(["inline-flex h-7 items-center gap-1 px-2 transition-colors",n(o)==="text"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",n(o)==="vector"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex h-7 items-center gap-1 rounded border px-2 transition-colors",n(b)?"border-line-1 bg-bg-2 text-fg-3":"border-accent/40 bg-accent text-white hover:bg-accent/90"].join(" "))]),ke("click",xe,()=>_(o,"text")),ke("click",he,()=>_(o,"vector")),zn(ie,()=>n(d),Ee=>_(d,Ee)),ke("click",de,()=>void ee()),v(U,ne)},H=U=>{var ne=rb(),ce=c(ne);Xn(ce,{class:"size-3 text-fg-3"});var xe=u(ce,2);nn(xe);var he=u(xe,2);{var me=_e=>{var pe=nb(),ue=c(pe);Ln(ue,{class:"size-3"}),l(pe),ke("click",pe,()=>_(f,"")),v(_e,pe)};K(he,_e=>{n(f)&&_e(me)})}l(ne),zn(xe,()=>n(f),_e=>_(f,_e)),v(U,ne)};K($,U=>{n(r)==="search"?U(R):U(H,-1)})}var V=u($,2),j=c(V),F=c(j,!0);l(j);var ae=u(j,2);{var be=U=>{var ne=ab(),ce=c(ne,!0);l(ne),L(()=>k(ce,e.collection)),v(U,ne)};K(ae,U=>{e.collection&&U(be)})}l(V),l(E);var se=u(E,2);{var J=U=>{var ne=ob(),ce=c(ne,!0);l(ne),L(()=>k(ce,n(h))),v(U,ne)};K(se,U=>{n(h)&&U(J)})}l(Q);var Y=u(Q,2);{var Z=U=>{var ne=ib();v(U,ne)};K(Y,U=>{n(r)==="search"&&n(C)&&U(Z)})}var T=u(Y,2);{var q=U=>{var ne=sb(),ce=c(ne),xe=c(ce);Xn(xe,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4});var he=u(xe,2),me=c(he,!0);l(he),Ce(2),l(ce),l(ne),L(()=>k(me,n(te)?"No search results.":"No vector search has been run.")),v(U,ne)},O=U=>{var ne=lb(),ce=c(ne),xe=c(ce);Yi(xe,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4}),Ce(2),l(ce),l(ne),v(U,ne)},z=U=>{var ne=Cb(),ce=fe(ne),xe=c(ce),he=c(xe),me=c(he);va(me,{class:"size-3"}),Ce(),l(he);var _e=u(he,2),pe=c(_e);iv(pe,{class:"size-3"}),Ce(),l(_e);var ue=u(_e,2),Oe=c(ue);Ic(Oe,{class:"size-3"}),Ce(),l(ue),l(xe);var ie=u(xe,2);{var de=qe=>{var Ve=db(),Be=c(Ve);Xn(Be,{class:"size-3 text-fg-3"});var ot=u(Be,2);nn(ot);var re=u(ot,2);{var rt=Qe=>{var We=cb(),ft=c(We);Ln(ft,{class:"size-3"}),l(We),ke("click",We,()=>_(f,"")),v(Qe,We)};K(re,Qe=>{n(f)&&Qe(rt)})}l(Ve),zn(ot,()=>n(f),Qe=>_(f,Qe)),v(qe,Ve)};K(ie,qe=>{n(r)==="search"&&qe(de)})}var ye=u(ie,2),Pe=c(ye,!0),Le=u(Pe);{var Ee=qe=>{var Ve=_t();L(Be=>k(Ve,`of ${Be??""}`),[()=>n(W).length.toLocaleString()]),v(qe,Ve)};K(Le,qe=>{n(f)&&qe(Ee)})}var Te=u(Le);l(ye),l(ce);var Me=u(ce,2),Ne=c(Me);Xe(Ne,21,()=>n(G),qe=>qe.id,(qe,Ve)=>{var Be=vb(),ot=c(Be),re=c(ot),rt=c(re,!0);l(re);var Qe=u(re,2),We=c(Qe);l(Qe);var ft=u(Qe,2);{var Nt=mt=>{var yt=ub(),kt=c(yt,!0);l(yt),L((It,Zt)=>{Ae(yt,"title",It),k(kt,Zt)},[()=>Ei(n(Ve)),()=>n(Ve).scalar.toFixed(4)]),v(mt,yt)};K(ft,mt=>{n(r)==="search"&&n(Ve).scalar!==null&&mt(Nt)})}l(ot);var At=u(ot,2);{var Mt=mt=>{var yt=fb(),kt=c(yt,!0);l(yt),L(It=>k(kt,It),[()=>le(n(Ve))]),v(mt,yt)},Et=y(()=>le(n(Ve)));K(At,mt=>{n(Et)&&mt(Mt)})}l(Be),L(mt=>{De(Be,1,mt),k(rt,n(Ve).id),k(We,`${n(Ve).dimension??""}d`)},[()=>je(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(X)===n(Ve)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),ke("click",Be,()=>_(g,n(Ve),!0)),v(qe,Be)}),l(Ne);var ze=u(Ne,2),Ze=c(ze);{var $e=qe=>{var Ve=gb();v(qe,Ve)},Je=qe=>{var Ve=xb(),Be=u(c(Ve),2),ot=c(Be,!0);l(Be);var re=u(Be,4),rt=c(re,!0);l(re);var Qe=u(re,4),We=c(Qe,!0);l(Qe);var ft=u(Qe,4),Nt=c(ft,!0);l(ft);var At=u(ft,2);{var Mt=kt=>{var It=pb(),Zt=u(fe(It),2),hn=c(Zt,!0);l(Zt),L(()=>k(hn,n(X).vectorColumn)),v(kt,It)};K(At,kt=>{n(X).vectorColumn&&kt(Mt)})}var Et=u(At,2);{var mt=kt=>{var It=hb(),Zt=u(fe(It),2),hn=c(Zt,!0);l(Zt),L(xn=>k(hn,xn),[()=>Ei(n(X))]),v(kt,It)};K(Et,kt=>{n(r)==="search"&&n(X).scalarColumn&&kt(mt)})}var yt=u(Et,2);Xe(yt,17,()=>Object.entries(n(X).metadata),bn,(kt,It)=>{var Zt=y(()=>er(n(It),2));let hn=()=>n(Zt)[0],xn=()=>n(Zt)[1];var at=bb(),ut=fe(at),Lt=c(ut,!0);l(ut);var jt=u(ut,2),on=c(jt,!0);l(jt),L(sn=>{k(Lt,hn()),k(on,sn)},[()=>Ni(xn())]),v(kt,at)}),l(Ve),L(kt=>{k(ot,n(X).id),k(rt,n(X).dimension),k(We,kt),k(Nt,n(X).vector.length>0?"returned":"not returned")},[()=>n(X).vector.length>0?po(n(X).vector).toFixed(6):"n/a"]),v(qe,Ve)},tt=qe=>{var Ve=Re(),Be=fe(Ve);{var ot=rt=>{var Qe=mb(),We=c(Qe);l(Qe),L(()=>k(We,`This result reports a ${n(X).dimension??""}d vector, but the coordinate array was not returned by RedDB.`)),v(rt,Qe)},re=rt=>{var Qe=wb(),We=fe(Qe),ft=c(We),Nt=c(ft);l(ft);var At=u(ft,2),Mt=c(At);l(At),l(We);var Et=u(We,2);Xe(Et,21,()=>n(X).vector.slice(0,256),bn,(kt,It,Zt)=>{var hn=_b(),xn=c(hn);xn.textContent=Zt;var at=u(xn,2),ut=c(at);let Lt;l(at);var jt=u(at,2),on=c(jt,!0);l(jt),l(hn),L((sn,ln)=>{Lt=kn(ut,"",Lt,sn),De(jt,1,je(n(It)<0?"text-warn text-right":"text-fg-1 text-right")),k(on,ln)},[()=>({width:`${oe(n(It),n(X).vector)}%`}),()=>n(It).toFixed(5)]),v(kt,hn)}),l(Et);var mt=u(Et,2);{var yt=kt=>{var It=yb();v(kt,It)};K(mt,kt=>{n(X).vector.length>256&&kt(yt)})}L((kt,It)=>{k(Nt,`${n(X).vector.length??""} dimensions`),k(Mt,`|v| ${kt??""} / max visible ${It??""}`)},[()=>po(n(X).vector).toFixed(6),()=>n(I).toFixed(2)]),v(rt,Qe)};K(Be,rt=>{n(X).vector.length===0?rt(ot):rt(re,-1)})}v(qe,Ve)},ct=qe=>{var Ve=Sb(),Be=u(c(Ve));Xe(Be,21,()=>n(G),ot=>ot.id,(ot,re)=>{var rt=kb(),Qe=c(rt),We=c(Qe,!0);l(Qe);var ft=u(Qe),Nt=c(ft,!0);l(ft);var At=u(ft),Mt=c(At,!0);l(At),l(rt),L((Et,mt,yt)=>{k(We,n(re).id),Ae(ft,"title",Et),k(Nt,mt),k(Mt,yt)},[()=>Ei(n(re)),()=>n(re).scalar===null?"n/a":n(re).scalar.toFixed(6),()=>po(n(re).vector).toFixed(6)]),ke("click",rt,()=>_(g,n(re),!0)),v(ot,rt)}),l(Be),l(Ve),v(qe,Ve)};K(Ze,qe=>{n(X)?n(a)==="metadata"?qe(Je,1):n(a)==="vector"?qe(tt,2):qe(ct,-1):qe($e)})}l(ze),l(Me),L((qe,Ve,Be,ot)=>{De(he,1,qe),Ae(he,"aria-pressed",n(a)==="metadata"),De(_e,1,Ve),Ae(_e,"aria-pressed",n(a)==="vector"),De(ue,1,Be),Ae(ue,"aria-pressed",n(a)==="scalar"),k(Pe,ot),k(Te,` ${n(r)==="search"?" results":" rows"}`)},[()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(a)==="metadata"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(a)==="vector"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(a)==="scalar"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(G).length.toLocaleString()]),ke("click",he,()=>_(a,"metadata")),ke("click",_e,()=>_(a,"vector")),ke("click",ue,()=>_(a,"scalar")),v(U,ne)};K(T,U=>{n(r)==="search"&&n(D).length===0?U(q):n(W).length===0?U(O,1):U(z,-1)})}l(ve),L((U,ne)=>{De(m,1,U),Ae(m,"aria-pressed",n(r)==="browse"),De(P,1,ne),Ae(P,"aria-pressed",n(r)==="search"),k(F,n(S)?`${n(S)}d`:"dimension n/a")},[()=>je(["inline-flex h-7 items-center gap-1 px-2 transition-colors",n(r)==="browse"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",n(r)==="search"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),ke("click",m,()=>{_(r,"browse"),_(g,null)}),ke("click",P,()=>{_(r,"search"),_(g,null)}),v(t,ve),st()}en(["click","keydown"]);const Mb={capability:"vector",renders:t=>W1(t),component:Nb},rs=["message","payload","body","value","data"],ed=["state","status","delivery_state"],td=["consumer","consumer_id","worker","lease_owner"],nd=["dlc","dlq","dead_letter_collection","dead_letter_queue"];function ho(t,e){for(const a of e)if(a in t)return[a,t[a]];return Object.entries(t).find(([a])=>e.includes(a.toLowerCase()))??null}function Tb(t){return t.result.records.map((e,r)=>{const a=e.values??{},o=ho(a,rs),s=ho(a,ed),i=ho(a,td),d=ho(a,nd);return{index:r,id:String(a.message_id??a.id??a.rid??r+1),messageColumn:(o==null?void 0:o[0])??null,message:(o==null?void 0:o[1])??a,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:(d==null?void 0:d[1])===void 0||(d==null?void 0:d[1])===null?null:String(d[1]),values:a}})}function zb(t){return t.capability==="queue"?!0:t.result.records.some(e=>{const r=Object.keys(e.values??{}).map(a=>a.toLowerCase());return r.includes("message_id")&&rs.some(a=>r.includes(a))?!0:rs.some(a=>r.includes(a))&&(ed.some(a=>r.includes(a))||td.some(a=>r.includes(a))||nd.some(a=>r.includes(a)))})}function Ab(t){const e=new Set,r=new Map,a=new Set,o=new Map,s=new Set;for(const i of t)if(r.set(i.state,(r.get(i.state)??0)+1),i.consumer&&/active|leased|processing|running/i.test(i.state)&&e.add(i.consumer),i.dlc&&a.add(i.dlc),i.message&&typeof i.message=="object"&&!Array.isArray(i.message)){const d=i.message,f=d.op,g=d.collection;typeof f=="string"&&o.set(f,(o.get(f)??0)+1),typeof g=="string"&&s.add(g)}return{activeConsumers:e.size,states:[...r.entries()],dlcs:[...a],operations:[...o.entries()].sort((i,d)=>i[0].localeCompare(d[0])),sources:[...s].sort()}}function wl(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 Pb(t){const e=[];for(const r of t){if(!r.message||typeof r.message!="object"||Array.isArray(r.message))continue;const a=r.message,o=a.collection,s=a.op;if(typeof o!="string"||typeof s!="string")continue;const i=a.id??(a.after&&typeof a.after=="object"&&!Array.isArray(a.after)?a.after.id:void 0);e.push({messageId:r.id,collection:o,op:s,entityId:i==null?String(a.rid??r.id):String(i),lsn:wl(a.lsn),ts:wl(a.ts),before:a.before,after:a.after,payload:a})}return e}function Lb(t){const e=t.replace(/[^A-Za-z0-9_./-]/g,""),r="red-ui-preview",a="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 ${r} 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 ${a} 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 ${a}`,mutates:!1,note:"Shows leased-but-unacked messages for a group."},{label:"Ack a delivered message",query:`QUEUE ACK ${e} GROUP ${a} 'message-id'`,mutates:!0,note:"Removes a successfully processed message for that group."},{label:"Nack a delivered message",query:`QUEUE NACK ${e} GROUP ${a} 'message-id'`,mutates:!0,note:"Returns or retries a failed message according to queue policy."}]}function Ib(t,e){const r=t.replace(/[^A-Za-z0-9_./-]/g,""),a=typeof e=="string"?`'${e.replace(/'/g,"''")}'`:JSON.stringify(e??null);return`QUEUE PUSH ${r} ${a}`}var Ob=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear queue filter"><!></button>'),Rb=x("<span> </span>"),$b=x('<span>from <span class="text-fg-2"> </span></span>'),Db=x('<span>dlc <span class="text-fg-2"> </span></span>'),Vb=x('<span class="text-fg-2"> </span>'),Hb=x('<div class="mt-1.5 text-warn"> </div>'),Fb=x('<div class="mt-1.5 text-ok"> </div>'),qb=x('<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>'),Kb=x('<div class="p-3 text-[12px] font-mono text-fg-3">No WITH EVENTS envelopes detected in this queue result.</div>'),jb=x('<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>'),Bb=x('<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>'),Wb=x('<div class="flex-1 min-h-0 overflow-auto"><!></div>'),Ub=x('<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>'),Gb=x('<div class="flex-1 min-h-0 overflow-auto p-3 text-[12px] font-mono"><div class="grid gap-2"></div></div>'),Yb=x('<div class="p-3 text-fg-3">No queue messages in this result.</div>'),Xb=x('<span class="ml-auto text-fg-3"> </span>'),Zb=x('<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>'),Qb=x('<pre class="whitespace-pre-wrap text-fg-1"> </pre>'),Jb=x('<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>'),ex=x('<div class="text-fg-3">Select a message to inspect payload, delivery state, consumer, and DLC link.</div>'),tx=x('<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>'),nx=x('<span><span class="text-fg-2"> </span> </span>'),rx=x('<span><span class="text-fg-2"> </span> </span>'),ax=x('<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 ox(t,e){it(e,!0);let r=we("events"),a=we(""),o=we(null),s=we(!1),i=we(""),d=we(!1),f=we(null),g=we(0);const p='{"type":"email","to":"ops@example.com"}',b=y(()=>Tb(e.result)),h=y(()=>Ab(n(b))),w=y(()=>Pb(n(b))),S=y(()=>e.collection?Lb(e.collection):[]),A=y(()=>{const ie=n(a).trim().toLowerCase();return ie?n(b).filter(de=>de.id.toLowerCase().includes(ie)||de.state.toLowerCase().includes(ie)||JSON.stringify(de.message).toLowerCase().includes(ie)):n(b)});function D(ie){return typeof ie=="string"?ie:JSON.stringify(ie)}function W(ie){if(ie===null)return"-";try{return new Date(ie).toISOString().replace("T"," ").slice(0,19)}catch{return String(ie)}}function C(){const ie=n(i).trim();if(!ie)return"";try{return JSON.parse(ie)}catch{return ie}}async function G(){const ie=Ke.client;if(!(!ie||!e.collection||!n(i).trim())){_(d,!0),_(f,null);try{await Ct.track(`${e.collection} · enqueue message`,()=>ie.query(Ib(e.collection,C()))),_(i,""),_(g,n(g)+1)}catch(de){_(f,de.message,!0)}finally{_(d,!1)}}}var X=ax(),I=c(X),te=c(I),le=c(te),oe=c(le);fv(oe,{class:"size-3"}),Ce(),l(le);var ee=u(le,2),ve=c(ee);il(ve,{class:"size-3"}),Ce(),l(ee);var Q=u(ee,2),E=c(Q);Gf(E,{class:"size-3"}),Ce(),l(Q);var M=u(Q,2),m=c(M);va(m,{class:"size-3"}),Ce(),l(M),l(te);var N=u(te,2),P=c(N);La(P,{class:"size-3"}),Ce(),l(N);var B=u(N,2),$=c(B);Xn($,{class:"size-3 text-fg-3"});var R=u($,2);nn(R);var H=u(R,2);{var V=ie=>{var de=Ob(),ye=c(de);Ln(ye,{class:"size-3"}),l(de),ke("click",de,()=>_(a,"")),v(ie,de)};K(H,ie=>{n(a)&&ie(V)})}l(B);var j=u(B,2),F=c(j),ae=c(F);l(F);var be=u(F,2);{var se=ie=>{var de=Rb(),ye=c(de);l(de),L(Pe=>k(ye,`${Pe??""} events`),[()=>n(w).length.toLocaleString()]),v(ie,de)};K(be,ie=>{n(w).length&&ie(se)})}var J=u(be,2),Y=c(J);l(J);var Z=u(J,2);{var T=ie=>{var de=$b(),ye=u(c(de)),Pe=c(ye,!0);l(ye),l(de),L(Le=>k(Pe,Le),[()=>n(h).sources.join(", ")]),v(ie,de)};K(Z,ie=>{n(h).sources.length&&ie(T)})}var q=u(Z,2);{var O=ie=>{var de=Db(),ye=u(c(de)),Pe=c(ye,!0);l(ye),l(de),L(Le=>k(Pe,Le),[()=>n(h).dlcs.join(", ")]),v(ie,de)};K(q,ie=>{n(h).dlcs.length&&ie(O)})}var z=u(q,2);{var U=ie=>{var de=Vb(),ye=c(de,!0);l(de),L(()=>k(ye,e.collection)),v(ie,de)};K(z,ie=>{e.collection&&ie(U)})}l(j),l(I);var ne=u(I,2);{var ce=ie=>{var de=qb(),ye=c(de),Pe=c(ye);Ha(Pe),Ae(Pe,"placeholder",p);var Le=u(Pe,2),Ee=c(Le);{var Te=$e=>{lr($e,{class:"size-3 animate-spin"})},Me=$e=>{il($e,{class:"size-3"})};K(Ee,$e=>{n(d)?$e(Te):$e(Me,-1)})}Ce(),l(Le),l(ye);var Ne=u(ye,2);{var ze=$e=>{var Je=Hb(),tt=c(Je,!0);l(Je),L(()=>k(tt,n(f))),v($e,Je)},Ze=$e=>{var Je=Fb(),tt=c(Je);l(Je),L(()=>k(tt,`${n(g)??""} inserted. Refresh the collection to reload from reddb.`)),v($e,Je)};K(Ne,$e=>{n(f)?$e(ze):n(g)>0&&$e(Ze,1)})}l(de),L($e=>Le.disabled=$e,[()=>n(d)||!n(i).trim()||!e.collection]),zn(Pe,()=>n(i),$e=>_(i,$e)),ke("click",Le,G),v(ie,de)};K(ne,ie=>{n(s)&&ie(ce)})}var xe=u(ne,2);{var he=ie=>{var de=Wb(),ye=c(de);{var Pe=Ee=>{var Te=Kb();v(Ee,Te)},Le=Ee=>{var Te=Bb(),Me=u(c(Te));Xe(Me,21,()=>n(w),Ne=>`${Ne.messageId}-${Ne.lsn??Ne.entityId}`,(Ne,ze)=>{var Ze=jb(),$e=c(Ze),Je=c($e,!0);l($e);var tt=u($e),ct=c(tt,!0);l(tt);var qe=u(tt),Ve=c(qe),Be=c(Ve,!0);l(Ve),l(qe);var ot=u(qe),re=c(ot,!0);l(ot);var rt=u(ot),Qe=c(rt,!0);l(rt);var We=u(rt),ft=c(We,!0);l(We),l(Ze),L((Nt,At)=>{k(Je,Nt),k(ct,n(ze).collection),k(Be,n(ze).op),k(re,n(ze).entityId),k(Qe,n(ze).lsn??"-"),k(ft,At)},[()=>W(n(ze).ts),()=>D(n(ze).after)]),v(Ne,Ze)}),l(Me),l(Te),v(Ee,Te)};K(ye,Ee=>{n(w).length===0?Ee(Pe):Ee(Le,-1)})}l(de),v(ie,de)},me=ie=>{var de=Gb(),ye=c(de);Xe(ye,21,()=>n(S),Pe=>Pe.query,(Pe,Le)=>{var Ee=Ub(),Te=c(Ee),Me=c(Te),Ne=c(Me,!0);l(Me);var ze=u(Me,2),Ze=c(ze,!0);l(ze),l(Te);var $e=u(Te,2),Je=c($e,!0);l($e);var tt=u($e,2),ct=c(tt,!0);l(tt),l(Ee),L(qe=>{k(Ne,n(Le).label),De(ze,1,qe),k(Ze,n(Le).mutates?"mutates":"read-only"),k(Je,n(Le).query),k(ct,n(Le).note)},[()=>je(["rounded border px-1.5 py-0.5 text-[10px]",n(Le).mutates?"border-warn/30 bg-warn/10 text-warn":"border-ok/30 bg-ok/10 text-ok"].join(" "))]),v(Pe,Ee)}),l(ye),l(de),v(ie,de)},_e=ie=>{var de=tx(),ye=c(de),Pe=c(ye);{var Le=$e=>{var Je=Yb();v($e,Je)},Ee=$e=>{var Je=Re(),tt=fe(Je);Xe(tt,17,()=>n(A),ct=>ct.id,(ct,qe)=>{var Ve=Zb(),Be=c(Ve),ot=c(Be),re=c(ot,!0);l(ot);var rt=u(ot,2),Qe=c(rt,!0);l(rt);var We=u(rt,2);{var ft=Mt=>{var Et=Xb(),mt=c(Et,!0);l(Et),L(()=>k(mt,n(qe).consumer)),v(Mt,Et)};K(We,Mt=>{n(qe).consumer&&Mt(ft)})}l(Be);var Nt=u(Be,2),At=c(Nt,!0);l(Nt),l(Ve),L((Mt,Et)=>{De(Ve,1,Mt),k(re,n(qe).id),k(Qe,n(qe).state),k(At,Et)},[()=>je(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(o)===n(qe)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" ")),()=>D(n(qe).message)]),ke("click",Ve,()=>_(o,n(qe),!0)),v(ct,Ve)}),v($e,Je)};K(Pe,$e=>{n(A).length===0?$e(Le):$e(Ee,-1)})}l(ye);var Te=u(ye,2),Me=c(Te);{var Ne=$e=>{var Je=Qb(),tt=c(Je,!0);l(Je),L(ct=>k(tt,ct),[()=>JSON.stringify(n(A).map(ct=>ct.values),null,2)]),v($e,Je)},ze=$e=>{var Je=Jb(),tt=u(c(Je)),ct=c(tt,!0);l(tt);var qe=u(tt,3),Ve=c(qe,!0);l(qe);var Be=u(qe,3),ot=c(Be,!0);l(Be);var re=u(Be,3),rt=c(re,!0);l(re);var Qe=u(re,3),We=c(Qe,!0);l(Qe),l(Je),L(ft=>{k(ct,n(o).id),k(Ve,n(o).state),k(ot,n(o).consumer??"none"),k(rt,n(o).dlc??"none"),k(We,ft)},[()=>D(n(o).message)]),v($e,Je)},Ze=$e=>{var Je=ex();v($e,Je)};K(Me,$e=>{n(r)==="json"?$e(Ne):n(o)?$e(ze,1):$e(Ze,-1)})}l(Te),l(de),v(ie,de)};K(xe,ie=>{n(r)==="events"?ie(he):n(r)==="commands"?ie(me,1):ie(_e,-1)})}var pe=u(xe,2),ue=c(pe);Xe(ue,17,()=>n(h).states,([ie,de])=>ie,(ie,de)=>{var ye=y(()=>er(n(de),2));let Pe=()=>n(ye)[0],Le=()=>n(ye)[1];var Ee=nx(),Te=c(Ee),Me=c(Te,!0);l(Te);var Ne=u(Te);l(Ee),L(ze=>{k(Me,Pe()),k(Ne,` ${ze??""}`)},[()=>Le().toLocaleString()]),v(ie,Ee)});var Oe=u(ue,2);Xe(Oe,17,()=>n(h).operations,([ie,de])=>ie,(ie,de)=>{var ye=y(()=>er(n(de),2));let Pe=()=>n(ye)[0],Le=()=>n(ye)[1];var Ee=rx(),Te=c(Ee),Me=c(Te,!0);l(Te);var Ne=u(Te);l(Ee),L(ze=>{k(Me,Pe()),k(Ne,` ${ze??""}`)},[()=>Le().toLocaleString()]),v(ie,Ee)}),l(pe),l(X),L((ie,de,ye,Pe,Le,Ee)=>{De(le,1,ie),Ae(le,"aria-pressed",n(r)==="events"),De(ee,1,de),Ae(ee,"aria-pressed",n(r)==="messages"),De(Q,1,ye),Ae(Q,"aria-pressed",n(r)==="commands"),De(M,1,Pe),Ae(M,"aria-pressed",n(r)==="json"),N.disabled=!e.collection,De(N,1,Le),Ae(N,"aria-pressed",n(s)),Ae(N,"title",e.collection?"Insert a queue message":"Open this as a collection to insert messages"),k(ae,`${Ee??""} messages`),k(Y,`${n(h).activeConsumers??""} active consumers`)},[()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="events"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="messages"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="commands"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",n(s)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>n(A).length.toLocaleString()]),ke("click",le,()=>_(r,"events")),ke("click",ee,()=>_(r,"messages")),ke("click",Q,()=>_(r,"commands")),ke("click",M,()=>_(r,"json")),ke("click",N,()=>_(s,!n(s))),zn(R,()=>n(a),ie=>_(a,ie)),v(t,X),st()}en(["click"]);const ix={capability:"queue",renders:t=>zb(t),component:ox},sx=["metric","stat","name","key"],lx=["value","count","total","avg","rate","p50","p95","p99"],kl=["unit","units"];function Sl(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 cx(t){for(const r of kl){const a=t[r];if(typeof a=="string"&&a.trim())return a.trim()}const e=Object.entries(t).find(([r,a])=>kl.includes(r.toLowerCase())&&typeof a=="string"&&a.trim());return e?String(e[1]).trim():null}function rd(t){const e=[];for(const r of t.result.records){const a=r.values??{},o=Object.entries(a).find(([i,d])=>sx.includes(i.toLowerCase())&&(typeof d=="string"||typeof d=="number")),s=Object.entries(a).find(([i,d])=>lx.includes(i.toLowerCase())&&typeof d=="number"&&Number.isFinite(d));if(o&&s){const i=String(o[1]);e.push({key:i,label:i,value:s[1],unit:cx(a)??Sl(i),source:a});continue}for(const[i,d]of Object.entries(a))typeof d!="number"||!Number.isFinite(d)||e.push({key:i,label:i,value:d,unit:Sl(i),source:a})}return e}function dx(t){if(t.capability==="stats")return!0;const e=rd(t);return e.length>0&&e.length>=t.result.records.length}function Cl(t,e){if(e==="bytes"){const r=Math.abs(t);return r>=1024**3?`${(t/1024**3).toFixed(1)} GiB`:r>=1024**2?`${(t/1024**2).toFixed(1)} MiB`:r>=1024?`${(t/1024).toFixed(1)} KiB`:`${t} B`}return e==="%"||e==="ms"||e==="/s"?`${t.toLocaleString()}${e}`:t.toLocaleString()}var ux=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No numeric statistics in this result.</div>'),fx=x('· <span class="text-fg-2"> </span>',1),vx=x('<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>'),gx=x('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2"></div></div>'),px=x('<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>'),hx=x('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2"></div></div>'),bx=x('<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>'),xx=x('<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>'),mx=x('<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),_x=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function yx(t,e){it(e,!0);let r=we("kpi");const a=y(()=>rd(e.result)),o=y(()=>Math.max(1,...n(a).map(p=>Math.abs(p.value))));function s(p){return p>=0&&p<=100?p:Math.min(100,Math.abs(p)/n(o)*100)}var i=_x(),d=c(i);{var f=p=>{var b=ux();v(p,b)},g=p=>{var b=mx(),h=fe(b),w=c(h),S=c(w),A=c(S);lv(A,{class:"size-3"}),Ce(),l(S);var D=u(S,2),W=c(D);Ic(W,{class:"size-3"}),Ce(),l(D);var C=u(D,2),G=c(C);ff(G,{class:"size-3"}),Ce(),l(C),l(w);var X=u(w,2),I=c(X),te=u(I);{var le=E=>{var M=fx(),m=u(fe(M)),N=c(m,!0);l(m),L(()=>k(N,e.collection)),v(E,M)};K(te,E=>{e.collection&&E(le)})}l(X),l(h);var oe=u(h,2);{var ee=E=>{var M=gx(),m=c(M);Xe(m,23,()=>n(a),(N,P)=>`${N.key}-${P}`,(N,P)=>{var B=vx(),$=c(B),R=c($,!0);l($);var H=u($,2),V=c(H,!0);l(H),l(B),L(j=>{k(R,n(P).label),k(V,j)},[()=>Cl(n(P).value,n(P).unit)]),v(N,B)}),l(m),l(M),v(E,M)},ve=E=>{var M=hx(),m=c(M);Xe(m,23,()=>n(a),(N,P)=>`${N.key}-${P}`,(N,P)=>{const B=y(()=>s(n(P).value));var $=px(),R=c($),H=u(c(R)),V=u(H),j=c(V,!0);l(V),l(R);var F=u(R,2),ae=c(F,!0);l(F),l($),L(be=>{Ae(R,"aria-label",`${n(P).label??""} gauge`),Ae(H,"stroke-dasharray",`${n(B)} 100`),k(j,be),k(ae,n(P).label)},[()=>Cl(n(P).value,n(P).unit)]),v(N,$)}),l(m),l(M),v(E,M)},Q=E=>{var M=xx(),m=c(M),N=u(c(m));Xe(N,23,()=>n(a),(P,B)=>`${P.key}-${B}`,(P,B)=>{var $=bx(),R=c($),H=c(R,!0);l(R);var V=u(R),j=c(V,!0);l(V);var F=u(V),ae=c(F,!0);l(F),l($),L(be=>{k(H,n(B).label),k(j,be),k(ae,n(B).unit||"-")},[()=>n(B).value.toLocaleString()]),v(P,$)}),l(N),l(m),l(M),v(E,M)};K(oe,E=>{n(r)==="kpi"?E(ee):n(r)==="gauge"?E(ve,1):E(Q,-1)})}L((E,M,m,N)=>{De(S,1,E),Ae(S,"aria-pressed",n(r)==="kpi"),De(D,1,M),Ae(D,"aria-pressed",n(r)==="gauge"),De(C,1,m),Ae(C,"aria-pressed",n(r)==="table"),k(I,`${N??""} metrics `)},[()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="kpi"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="gauge"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="table"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(a).length.toLocaleString()]),ke("click",S,()=>_(r,"kpi")),ke("click",D,()=>_(r,"gauge")),ke("click",C,()=>_(r,"table")),v(p,b)};K(d,p=>{n(a).length===0?p(f):p(g,-1)})}l(i),v(t,i),st()}en(["click"]);const wx={capability:"stats",renders:t=>dx(t),component:yx},ad=["change","change_type","operation","op"],kx=["target_collection","collection_name","diff_collection"],Sx=["entity_id","row_id","rid","id"],od=["before_state","before_row","before"],id=["after_state","after_row","after"],Cx=["note","summary","message"];function Jr(t,e){for(const r of e)if(r in t)return[r,t[r]];return Object.entries(t).find(([r])=>e.includes(r.toLowerCase()))??null}function El(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 Ex(t){return t.result.records.map((e,r)=>{const a=e.values??{},o=Jr(a,ad),s=Jr(a,kx),i=Jr(a,Sx),d=Jr(a,od),f=Jr(a,id),g=Jr(a,Cx);return{index:r,id:String(a.id??a.diff_id??(i==null?void 0:i[1])??r+1),change:String((o==null?void 0:o[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:El((d==null?void 0:d[1])??null),after:El((f==null?void 0:f[1])??null),note:(g==null?void 0:g[1])===void 0||(g==null?void 0:g[1])===null?null:String(g[1]),values:a}})}function Nx(t){return t.capability==="diff"?!0:t.result.records.some(e=>{const r=Object.keys(e.values??{}).map(a=>a.toLowerCase());return ad.some(a=>r.includes(a))&&(od.some(a=>r.includes(a))||id.some(a=>r.includes(a)))})}function Mx(t){const e=new Map;for(const r of t)e.set(r.change,(e.get(r.change)??0)+1);return[...e.entries()].sort(([r],[a])=>r.localeCompare(a))}function as(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Nl(t){return t===void 0?"__red_ui_undefined__":as(t)?JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[r])=>e.localeCompare(r)))):JSON.stringify(t)}function Tx(t){const e=as(t.before)?t.before:{},r=as(t.after)?t.after:{};return[...new Set([...Object.keys(e),...Object.keys(r)])].sort((o,s)=>o.localeCompare(s)).map(o=>{const s=Object.prototype.hasOwnProperty.call(e,o),i=Object.prototype.hasOwnProperty.call(r,o),d=e[o],f=r[o],g=!s&&i?"added":s&&!i?"removed":Nl(d)===Nl(f)?"unchanged":"modified";return{field:o,before:d,after:f,status:g}})}function ea(t){return t==null||t===""?"-":typeof t=="object"?JSON.stringify(t,null,2):String(t)}var zx=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No diff shape in this result.</div>'),Ax=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear diff filter"><!></button>'),Px=x('<span><span class="text-fg-2"> </span> </span>'),Lx=x('<span class="text-fg-2"> </span>'),Ix=x('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><pre class="whitespace-pre-wrap text-fg-1"> </pre></div>'),Ox=x('<span class="ml-auto text-fg-3"> </span>'),Rx=x('<div class="mt-1 truncate text-fg-1"> </div>'),$x=x('<button type="button"><div class="flex items-center gap-2"><span class="text-accent"> </span> <span class="text-fg-3 truncate"> </span> <!></div> <!></button>'),Dx=x('<span class="text-fg-3">note</span><span class="text-fg-1"> </span>',1),Vx=x('<div class="px-2 py-2 text-fg-3">No changed fields in this row.</div>'),Hx=x('<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>'),Fx=x('<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>'),qx=x('<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>'),Kx=x('<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),jx=x('<div class="text-fg-3">No diff entry selected.</div>'),Bx=x('<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>'),Wx=x('<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),Ux=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function sd(t,e){it(e,!0);let r=we("summary"),a=we(""),o=we(null),s=we(!1);const i=y(()=>Ex(e.result)),d=y(()=>Mx(n(i))),f=y(()=>{const W=n(a).trim().toLowerCase();return W?n(i).filter(C=>C.id.toLowerCase().includes(W)||C.change.toLowerCase().includes(W)||(C.collection??"").toLowerCase().includes(W)||(C.entityId??"").toLowerCase().includes(W)||ea(C.before).toLowerCase().includes(W)||ea(C.after).toLowerCase().includes(W)):n(i)}),g=y(()=>n(o)??n(f)[0]??null),p=y(()=>n(g)?Tx(n(g)):[]),b=y(()=>n(s)?n(p):n(p).filter(W=>W.status!=="unchanged"));function h(W){return W==="added"?"text-ok":W==="removed"?"text-danger":W==="modified"?"text-accent":"text-fg-3"}var w=Ux(),S=c(w);{var A=W=>{var C=zx();v(W,C)},D=W=>{var C=Wx(),G=fe(C),X=c(G),I=c(X),te=c(I);Gi(te,{class:"size-3"}),Ce(),l(I);var le=u(I,2),oe=c(le);va(oe,{class:"size-3"}),Ce(),l(le),l(X);var ee=u(X,2),ve=c(ee);Xn(ve,{class:"size-3 text-fg-3"});var Q=u(ve,2);nn(Q);var E=u(Q,2);{var M=V=>{var j=Ax(),F=c(j);Ln(F,{class:"size-3"}),l(j),ke("click",j,()=>_(a,"")),v(V,j)};K(E,V=>{n(a)&&V(M)})}l(ee);var m=u(ee,2),N=c(m);Xe(N,17,()=>n(d),([V,j])=>V,(V,j)=>{var F=y(()=>er(n(j),2));let ae=()=>n(F)[0],be=()=>n(F)[1];var se=Px(),J=c(se),Y=c(J,!0);l(J);var Z=u(J);l(se),L(()=>{k(Y,ae()),k(Z,` ${be()??""}`)}),v(V,se)});var P=u(N,2);{var B=V=>{var j=Lx(),F=c(j,!0);l(j),L(()=>k(F,e.collection)),v(V,j)};K(P,V=>{e.collection&&V(B)})}l(m),l(G);var $=u(G,2);{var R=V=>{var j=Ix(),F=c(j),ae=c(F,!0);l(F),l(j),L(be=>k(ae,be),[()=>JSON.stringify(n(f).map(be=>be.values),null,2)]),v(V,j)},H=V=>{var j=Bx(),F=c(j);Xe(F,21,()=>n(f),Y=>Y.id,(Y,Z)=>{var T=$x(),q=c(T),O=c(q),z=c(O,!0);l(O);var U=u(O,2),ne=c(U,!0);l(U);var ce=u(U,2);{var xe=_e=>{var pe=Ox(),ue=c(pe,!0);l(pe),L(()=>k(ue,n(Z).collection)),v(_e,pe)};K(ce,_e=>{n(Z).collection&&_e(xe)})}l(q);var he=u(q,2);{var me=_e=>{var pe=Rx(),ue=c(pe,!0);l(pe),L(()=>k(ue,n(Z).note)),v(_e,pe)};K(he,_e=>{n(Z).note&&_e(me)})}l(T),L(_e=>{De(T,1,_e),k(z,n(Z).change),k(ne,n(Z).entityId??n(Z).id)},[()=>je(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(g)===n(Z)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),ke("click",T,()=>_(o,n(Z),!0)),v(Y,T)}),l(F);var ae=u(F,2),be=c(ae);{var se=Y=>{var Z=Kx(),T=fe(Z),q=u(c(T)),O=c(q,!0);l(q);var z=u(q,3),U=c(z,!0);l(z);var ne=u(z,3),ce=c(ne,!0);l(ne);var xe=u(ne,2);{var he=Le=>{var Ee=Dx(),Te=u(fe(Ee)),Me=c(Te,!0);l(Te),L(()=>k(Me,n(g).note)),v(Le,Ee)};K(xe,Le=>{n(g).note&&Le(he)})}l(T);var me=u(T,2);{var _e=Le=>{var Ee=qx(),Te=c(Ee),Me=u(c(Te),2),Ne=c(Me);l(Me);var ze=u(Me,2),Ze=c(ze);nn(Ze),Ce(),l(ze),l(Te);var $e=u(Te,2);{var Je=ct=>{var qe=Vx();v(ct,qe)},tt=ct=>{var qe=Fx(),Ve=u(c(qe));Xe(Ve,21,()=>n(b),Be=>Be.field,(Be,ot)=>{var re=Hx(),rt=c(re),Qe=c(rt,!0);l(rt);var We=u(rt),ft=c(We,!0);l(We);var Nt=u(We),At=c(Nt),Mt=c(At,!0);l(At),l(Nt);var Et=u(Nt),mt=c(Et),yt=c(mt,!0);l(mt),l(Et),l(re),L((kt,It,Zt)=>{De(rt,1,kt),k(Qe,n(ot).status),k(ft,n(ot).field),k(Mt,It),k(yt,Zt)},[()=>je(["px-2 py-1 align-top",h(n(ot).status)].join(" ")),()=>ea(n(ot).before),()=>ea(n(ot).after)]),v(Be,re)}),l(Ve),l(qe),v(ct,qe)};K($e,ct=>{n(b).length===0?ct(Je):ct(tt,-1)})}l(Ee),L(()=>k(Ne,`${n(b).length??""}/${n(p).length??""} fields`)),tf(Ze,()=>n(s),ct=>_(s,ct)),v(Le,Ee)};K(me,Le=>{n(p).length>0&&Le(_e)})}var pe=u(me,2),ue=c(pe),Oe=u(c(ue),2),ie=c(Oe,!0);l(Oe),l(ue);var de=u(ue,2),ye=u(c(de),2),Pe=c(ye,!0);l(ye),l(de),l(pe),L((Le,Ee)=>{k(O,n(g).change),k(U,n(g).entityId??n(g).id),k(ce,n(g).collection??"-"),k(ie,Le),k(Pe,Ee)},[()=>ea(n(g).before),()=>ea(n(g).after)]),v(Y,Z)},J=Y=>{var Z=jx();v(Y,Z)};K(be,Y=>{n(g)?Y(se):Y(J,-1)})}l(ae),l(j),v(V,j)};K($,V=>{n(r)==="raw"?V(R):V(H,-1)})}L((V,j)=>{De(I,1,V),Ae(I,"aria-pressed",n(r)==="summary"),De(le,1,j),Ae(le,"aria-pressed",n(r)==="raw")},[()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="summary"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),ke("click",I,()=>_(r,"summary")),ke("click",le,()=>_(r,"raw")),zn(Q,()=>n(a),V=>_(a,V)),v(W,C)};K(S,W=>{n(i).length===0?W(A):W(D,-1)})}l(w),v(t,w),st()}en(["click"]);const Gx={capability:"diff",renders:Nx,component:sd},Yx=new Set(["rid","collection","kind","tenant","created_at","updated_at","body"]);function Xx(t,e,r){const a=e&&typeof e=="object"&&!Array.isArray(e)?e:{};for(const s of["title","name","slug","id","event_type","type"]){const i=t[s]??a[s];if(typeof i=="string"&&i.trim())return i;if(typeof i=="number")return String(i)}const o=t.rid;return typeof o=="string"||typeof o=="number"?`document ${o}`:`document ${r+1}`}function Zx(t,e){const r=e&&typeof e=="object"&&!Array.isArray(e)?e:{},a=[];for(const s of["category","source","status","collection"]){const i=t[s]??r[s];typeof i=="string"&&i.trim()&&a.push(i)}const o=t.updated_at??t.created_at;return(typeof o=="string"||typeof o=="number")&&a.push(String(o)),a.join(" · ")}function ld(t){const e=[];for(const[r,a]of t.result.records.entries()){const o=a.values??{},s=o.body;if(o.kind!=="document"&&(s===null||typeof s!="object"))continue;const i={};for(const[d,f]of Object.entries(o))Yx.has(d.toLowerCase())||(i[d]=f);e.push({rid:String(o.rid??r+1),title:Xx(o,s,r),subtitle:Zx(o,s),body:s,fields:i,values:o})}return e}function Qx(t){return t.capability==="document"?!0:ld(t).length>0}var Jx=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No document shape in this result.</div>'),em=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear document filter"><!></button>'),tm=x('· <span class="text-fg-2"> </span>',1),nm=x('<div class="mt-1 truncate text-fg-3"> </div>'),rm=x('<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>'),am=x('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),om=x('<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>'),im=x('<table class="w-full border-collapse"><tbody></tbody></table>'),sm=x('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),lm=x('<div class="text-fg-3">No documents match the current filter.</div>'),cm=x('<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),dm=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function um(t,e){it(e,!0);let r=we("body"),a=we(""),o=we(null);const s=y(()=>ld(e.result)),i=y(()=>{const w=n(a).trim().toLowerCase();return w?n(s).filter(S=>S.title.toLowerCase().includes(w)||S.subtitle.toLowerCase().includes(w)||JSON.stringify(S.body).toLowerCase().includes(w)):n(s)}),d=y(()=>n(o)&&n(i).includes(n(o))?n(o):n(i)[0]??null);function f(w){return JSON.stringify(w??null,null,2)}var g=dm(),p=c(g);{var b=w=>{var S=Jx();v(w,S)},h=w=>{var S=cm(),A=fe(S),D=c(A),W=c(D),C=c(W);va(C,{class:"size-3"}),Ce(),l(W);var G=u(W,2),X=c(G);tv(X,{class:"size-3"}),Ce(),l(G);var I=u(G,2),te=c(I);va(te,{class:"size-3"}),Ce(),l(I),l(D);var le=u(D,2),oe=c(le);Xn(oe,{class:"size-3 text-fg-3"});var ee=u(oe,2);nn(ee);var ve=u(ee,2);{var Q=se=>{var J=em(),Y=c(J);Ln(Y,{class:"size-3"}),l(J),ke("click",J,()=>_(a,"")),v(se,J)};K(ve,se=>{n(a)&&se(Q)})}l(le);var E=u(le,2),M=c(E,!0),m=u(M);{var N=se=>{var J=_t();L(Y=>k(J,`of ${Y??""}`),[()=>n(s).length.toLocaleString()]),v(se,J)};K(m,se=>{n(a)&&se(N)})}var P=u(m,2);{var B=se=>{var J=tm(),Y=u(fe(J)),Z=c(Y,!0);l(Y),L(()=>k(Z,e.collection)),v(se,J)};K(P,se=>{e.collection&&se(B)})}l(E),l(A);var $=u(A,2),R=c($);Xe(R,21,()=>n(i),se=>se.rid,(se,J)=>{var Y=rm(),Z=c(Y),T=c(Z),q=c(T,!0);l(T);var O=u(T,2),z=c(O);l(O),l(Z);var U=u(Z,2);{var ne=ce=>{var xe=nm(),he=c(xe,!0);l(xe),L(()=>k(he,n(J).subtitle)),v(ce,xe)};K(U,ce=>{n(J).subtitle&&ce(ne)})}l(Y),L(ce=>{De(Y,1,ce),k(q,n(J).title),k(z,`#${n(J).rid??""}`)},[()=>je(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(d)===n(J)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),ke("click",Y,()=>_(o,n(J),!0)),v(se,Y)}),l(R);var H=u(R,2),V=c(H);{var j=se=>{var J=Re(),Y=fe(J);{var Z=O=>{var z=am(),U=c(z,!0);l(z),L(ne=>k(U,ne),[()=>f(n(d).body)]),v(O,z)},T=O=>{var z=im(),U=c(z);Xe(U,21,()=>Object.entries(n(d).fields),([ne,ce])=>ne,(ne,ce)=>{var xe=y(()=>er(n(ce),2));let he=()=>n(xe)[0],me=()=>n(xe)[1];var _e=om(),pe=c(_e),ue=c(pe,!0);l(pe);var Oe=u(pe),ie=c(Oe),de=c(ie,!0);l(ie),l(Oe),l(_e),L(ye=>{k(ue,he()),k(de,ye)},[()=>f(me())]),v(ne,_e)}),l(U),l(z),v(O,z)},q=O=>{var z=sm(),U=c(z,!0);l(z),L(ne=>k(U,ne),[()=>f(n(d).values)]),v(O,z)};K(Y,O=>{n(r)==="body"?O(Z):n(r)==="fields"?O(T,1):O(q,-1)})}v(se,J)},F=se=>{var J=lm();v(se,J)};K(V,se=>{n(d)?se(j):se(F,-1)})}l(H),l($);var ae=u($,2),be=c(ae);l(ae),L((se,J,Y,Z)=>{De(W,1,se),Ae(W,"aria-pressed",n(r)==="body"),De(G,1,J),Ae(G,"aria-pressed",n(r)==="fields"),De(I,1,Y),Ae(I,"aria-pressed",n(r)==="raw"),k(M,Z),k(be,`${n(s).length??""} documents${e.collection?" · ":""}${e.collection??""??""}`)},[()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="body"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="fields"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(i).length.toLocaleString()]),ke("click",W,()=>_(r,"body")),ke("click",G,()=>_(r,"fields")),ke("click",I,()=>_(r,"raw")),zn(ee,()=>n(a),se=>_(a,se)),v(w,S)};K(p,w=>{n(s).length===0?w(b):w(h,-1)})}l(g),v(t,g),st()}en(["click"]);const fm={capability:"document",renders:Qx,component:um};tr.register(jh);tr.register(Bh);tr.register(f1);tr.register(I1);tr.register(Mb);tr.register(ix);tr.register(wx);tr.register(Gx);tr.register(fm);tr.register(H1);var vm=x("<!> resume",1),gm=x("<!> pause",1),pm=x('<label class="inline-flex items-center gap-1 cursor-pointer"><input type="checkbox" class="accent-accent size-3"/> <span> </span></label>'),hm=x('<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>'),bm=x('<div class="p-6 text-[12px] font-mono text-fg-3"><span class="text-accent">error:</span> </div>'),xm=x('<div class="p-6 text-[12px] font-mono text-fg-3">Not connected. Use the topbar Connect button to open a stream.</div>'),mm=x('<div class="p-6 text-[12px] font-mono text-fg-3"> </div>'),_m=x('<span class="text-fg-3 ml-auto"> </span>'),ym=x('<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>'),wm=x('<ul class="divide-y divide-line-1 font-mono text-[12px]"></ul>'),km=x('<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 cd(t,e){it(e,!0);const r=["insert","update","delete"];let a=we(Kt([])),o=we(!1),s=we(Kt({insert:!0,update:!0,delete:!0})),i=we(null),d=null,f=null;const g=500;function p(){h(),_(i,null),_(a,[],!0);const j=Ke.client;if(!j){_(i,"No active connection.");return}d=new Ff({client:j,sseFactory:null}).subscribe({collection:e.collection}),f=d.events.getReader(),b()}async function b(){if(f)try{for(;;){const{value:j,done:F}=await f.read();if(F)return;n(o)||j&&_(a,[j,...n(a)].slice(0,g),!0)}}catch(j){_(i,j.message,!0)}}function h(){if(f){try{f.cancel()}catch{}f=null}d&&(d.close(),d=null)}Xt(()=>{Ke.connected,e.collection,Ke.connected?p():h()}),ei(h);function w(j){const F=Date.now()-j;return F<1e3?"now":F<6e4?`${Math.floor(F/1e3)}s ago`:F<36e5?`${Math.floor(F/6e4)}m ago`:`${Math.floor(F/36e5)}h ago`}function S(j){return new Date(j).toISOString().replace("T"," ").replace("Z","")}const A=y(()=>n(a).filter(j=>n(s)[j.operation]??!0)),D=y(()=>e.collection?`collection: ${e.collection}`:"global");var W=km(),C=c(W),G=c(C);Fa(G,{class:"size-3.5"});var X=u(G,4),I=c(X);l(X);var te=u(X,2),le=c(te),oe=c(le);{var ee=j=>{var F=vm(),ae=fe(F);ri(ae,{class:"size-3"}),Ce(),v(j,F)},ve=j=>{var F=gm(),ae=fe(F);dv(ae,{class:"size-3"}),Ce(),v(j,F)};K(oe,j=>{n(o)?j(ee):j(ve,-1)})}l(le);var Q=u(le,2),E=c(Q);Lc(E,{class:"size-3"});var M=u(E,2);Xe(M,16,()=>r,j=>j,(j,F)=>{var ae=pm(),be=c(ae);nn(be);var se=u(be,2),J=c(se,!0);l(se),l(ae),L(()=>{Aa(be,n(s)[F]),De(se,1,je(n(s)[F]?"text-fg-1":"text-fg-3")),k(J,F)}),ke("change",be,Y=>_(s,{...n(s),[F]:Y.currentTarget.checked},!0)),v(j,ae)}),l(Q);var m=u(Q,2);{var N=j=>{var F=hm(),ae=c(F);Ln(ae,{class:"size-3"}),Ce(),l(F),ke("click",F,()=>_(a,[],!0)),v(j,F)};K(m,j=>{n(a).length>0&&j(N)})}l(te),l(C);var P=u(C,2),B=c(P);{var $=j=>{var F=bm(),ae=u(c(F));l(F),L(()=>k(ae,` ${n(i)??""}`)),v(j,F)},R=j=>{var F=xm();v(j,F)},H=j=>{var F=mm(),ae=c(F,!0);l(F),L(()=>k(ae,n(o)?"Paused — no events captured.":"Listening for changes…")),v(j,F)},V=j=>{var F=wm();Xe(F,21,()=>n(A),ae=>ae.lsn,(ae,be)=>{var se=ym(),J=c(se),Y=c(J,!0);l(J);var Z=u(J,2),T=c(Z);l(Z);var q=u(Z,2),O=c(q,!0);l(q);var z=u(q,2),U=c(z,!0);l(z);var ne=u(z,4),ce=c(ne,!0);l(ne);var xe=u(ne,2);{var he=me=>{var _e=_m(),pe=c(_e);l(_e),L(()=>k(pe,`rid ${n(be).rid??""}`)),v(me,_e)};K(xe,me=>{n(be).rid!==void 0&&me(he)})}l(se),L((me,_e,pe)=>{Ae(J,"title",me),k(Y,_e),k(T,`lsn ${n(be).lsn??""}`),De(q,1,pe),k(O,n(be).operation),k(U,n(be).collection),k(ce,n(be).kind)},[()=>S(n(be).timestamp),()=>w(n(be).timestamp),()=>je(["inline-block w-14 text-center text-[10px] uppercase rounded px-1 py-0.5 shrink-0 border",n(be).operation==="insert"&&"border-ok/40 text-ok",n(be).operation==="update"&&"border-warn/40 text-warn",n(be).operation==="delete"&&"border-accent/40 text-accent"].filter(Boolean).join(" "))]),v(ae,se)}),l(F),v(j,F)};K(B,j=>{n(i)?j($):Ke.connected?n(A).length===0?j(H,2):j(V,-1):j(R,1)})}l(P),l(W),L(()=>{k(I,`· ${n(D)??""}`),Ae(le,"title",n(o)?"Resume stream":"Pause stream")}),ke("click",le,()=>_(o,!n(o))),v(t,W),st()}en(["click","change"]);var Sm=x('<div class="border-b border-line-1 px-3 py-1.5 font-mono text-[11px] text-warn"> </div>'),Cm=x('<div class="p-4 font-mono text-[12px] text-fg-3">No active RedDB connection.</div>'),Em=x('<div class="p-4 font-mono text-[12px] text-fg-3">Loading version history…</div>'),Nm=x('<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>'),Mm=x('<div class="flex-1 min-h-0"><!></div>'),Tm=x("<option> </option>"),zm=x("<option> </option>"),Am=x('<span class="ml-auto text-fg-3"> </span>'),Pm=x('<div class="p-4 font-mono text-[12px] text-fg-3">Choose two commits to compare this collection.</div>'),Lm=x('<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),Im=x('<div class="p-4 font-mono text-[12px] text-fg-3">No commits yet.</div>'),Om=x('<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>'),Rm=x('<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>'),$m=x('<div class="flex-1 overflow-auto"><!></div>'),Dm=x('<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 Vm(t,e){it(e,!0);let r=we("commits"),a=we(null),o=we(Kt([])),s=we(""),i=we(""),d=we(null),f=we(!1),g=we(!1),p=we(null),b="";const h=y(()=>n(s).length>0&&n(i).length>0&&n(s)!==n(i));function w(Z){return Z.slice(0,10)}function S(Z){return Z?new Date(Z).toISOString().replace("T"," ").replace("Z",""):"-"}function A(Z){return{ok:!0,query:`/repo/commits/${Z.from}/diff/${Z.to}?collection=${e.collection}`,capability:"diff",record_count:Z.entries.length,result:{columns:["collection","entity_id","change","before","after"],records:Z.entries.map((T,q)=>({values:{id:`${T.collection}:${T.entity_id}:${q}`,collection:T.collection,entity_id:T.entity_id,change:T.change,before:T.before??null,after:T.after??null}}))}}}async function D(){if(e.client){_(f,!0),_(p,null),_(d,null);try{const[Z,T]=await Promise.all([e.client.collectionVcs(e.collection),e.client.commits({limit:40})]);_(a,Z,!0),_(o,T,!0),T.length>=2?(_(i,T[0].hash,!0),_(s,T[1].hash,!0)):T.length===1?(_(i,T[0].hash,!0),_(s,"")):(_(i,""),_(s,""))}catch(Z){_(p,Z.message,!0)}finally{_(f,!1)}}}async function W(){if(e.client){_(f,!0),_(p,null);try{_(a,await e.client.setCollectionVcs(e.collection,!0),!0),_(o,await e.client.commits({limit:40}),!0)}catch(Z){_(p,Z.message,!0)}finally{_(f,!1)}}}async function C(){if(!(!e.client||!n(h))){_(g,!0),_(p,null);try{_(d,await e.client.commitDiff(n(s),n(i),{collection:e.collection}),!0),_(r,"diff")}catch(Z){_(p,Z.message,!0)}finally{_(g,!1)}}}Xt(()=>{var T;const Z=`${((T=e.client)==null?void 0:T.baseUrl)??"none"}:${e.collection}`;Z!==b&&(b=Z,D())});var G=Dm(),X=c(G),I=c(X),te=c(I),le=c(te);av(le,{class:"size-3"}),Ce(),l(te);var oe=u(te,2),ee=c(oe);Gi(ee,{class:"size-3"}),Ce(),l(oe);var ve=u(oe,2),Q=c(ve);uv(Q,{class:"size-3"}),Ce(),l(ve),l(I);var E=u(I,2),M=c(E,!0);l(E);var m=u(E,2),N=c(m,!0);l(m);var P=u(m,2),B=c(P);{var $=Z=>{lr(Z,{class:"size-3 animate-spin"})},R=Z=>{Es(Z,{class:"size-3"})};K(B,Z=>{n(f)?Z($):Z(R,-1)})}Ce(),l(P),l(X);var H=u(X,2);{var V=Z=>{var T=Sm(),q=c(T,!0);l(T),L(()=>k(q,n(p))),v(Z,T)};K(H,Z=>{n(p)&&Z(V)})}var j=u(H,2);{var F=Z=>{var T=Cm();v(Z,T)},ae=Z=>{var T=Em();v(Z,T)},be=Z=>{var T=Nm(),q=u(c(T),2),O=c(q);hv(O,{class:"size-3"}),Ce(),l(q),l(T),ke("click",q,()=>void W()),v(Z,T)},se=Z=>{var T=Mm(),q=c(T);cd(q,{get collection(){return e.collection}}),l(T),v(Z,T)},J=Z=>{var T=Lm(),q=fe(T),O=c(q),z=u(c(O),2),U=c(z);U.value=U.__value="";var ne=u(U);Xe(ne,17,()=>n(o),Te=>Te.hash,(Te,Me)=>{var Ne=Tm(),ze=c(Ne);l(Ne);var Ze={};L($e=>{k(ze,`${$e??""} · ${n(Me).message??""}`),Ze!==(Ze=n(Me).hash)&&(Ne.value=(Ne.__value=n(Me).hash)??"")},[()=>w(n(Me).hash)]),v(Te,Ne)}),l(z),l(O);var ce=u(O,2),xe=u(c(ce),2),he=c(xe);he.value=he.__value="";var me=u(he);Xe(me,17,()=>n(o),Te=>Te.hash,(Te,Me)=>{var Ne=zm(),ze=c(Ne);l(Ne);var Ze={};L($e=>{k(ze,`${$e??""} · ${n(Me).message??""}`),Ze!==(Ze=n(Me).hash)&&(Ne.value=(Ne.__value=n(Me).hash)??"")},[()=>w(n(Me).hash)]),v(Te,Ne)}),l(xe),l(ce);var _e=u(ce,2),pe=c(_e);{var ue=Te=>{lr(Te,{class:"size-3 animate-spin"})},Oe=Te=>{Gi(Te,{class:"size-3"})};K(pe,Te=>{n(g)?Te(ue):Te(Oe,-1)})}Ce(),l(_e);var ie=u(_e,2);{var de=Te=>{var Me=Am(),Ne=c(Me);l(Me),L(()=>k(Ne,`+${n(d).added??""} -${n(d).removed??""} ~${n(d).modified??""}`)),v(Te,Me)};K(ie,Te=>{n(d)&&Te(de)})}l(q);var ye=u(q,2),Pe=c(ye);{var Le=Te=>{{let Me=y(()=>A(n(d)));sd(Te,{get result(){return n(Me)},get collection(){return e.collection}})}},Ee=Te=>{var Me=Pm();v(Te,Me)};K(Pe,Te=>{n(d)?Te(Le):Te(Ee,-1)})}l(ye),L(()=>_e.disabled=!n(h)||n(g)),Wi(z,()=>n(s),Te=>_(s,Te)),Wi(xe,()=>n(i),Te=>_(i,Te)),ke("click",_e,()=>void C()),v(Z,T)},Y=Z=>{var T=$m(),q=c(T);{var O=U=>{var ne=Im();v(U,ne)},z=U=>{var ne=Rm(),ce=u(c(ne));Xe(ce,21,()=>n(o),xe=>xe.hash,(xe,he)=>{var me=Om(),_e=c(me),pe=c(_e,!0);l(_e);var ue=u(_e),Oe=c(ue,!0);l(ue);var ie=u(ue),de=c(ie,!0);l(ie);var ye=u(ie),Pe=c(ye,!0);l(ye),l(me),L((Le,Ee)=>{var Te;k(pe,Le),k(Oe,n(he).message),k(de,((Te=n(he).author)==null?void 0:Te.name)??"-"),k(Pe,Ee)},[()=>w(n(he).hash),()=>S(n(he).timestamp_ms)]),v(xe,me)}),l(ce),l(ne),v(U,ne)};K(q,U=>{n(o).length===0?U(O):U(z,-1)})}l(T),v(Z,T)};K(j,Z=>{e.client?n(f)&&!n(a)?Z(ae,1):n(a)&&!n(a).versioned?Z(be,2):n(r)==="live"?Z(se,3):n(r)==="diff"?Z(J,4):Z(Y,-1):Z(F)})}l(G),L((Z,T,q)=>{var O,z;De(te,1,Z),De(oe,1,T),De(ve,1,q),De(E,1,je((O=n(a))!=null&&O.versioned?"text-ok":"text-fg-3")),k(M,(z=n(a))!=null&&z.versioned?"versioned":"not versioned"),k(N,e.collection),P.disabled=n(f)},[()=>je(["inline-flex h-7 items-center gap-1 px-2",n(r)==="commits"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",n(r)==="diff"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>je(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",n(r)==="live"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),ke("click",te,()=>_(r,"commits")),ke("click",oe,()=>_(r,"diff")),ke("click",ve,()=>_(r,"live")),ke("click",P,()=>void D()),v(t,G),st()}en(["click"]);var Hm=x('<span class="text-fg-3">·</span> <span class="text-fg-2 font-mono text-[11px] truncate max-w-[280px]"> </span>',1),Fm=x('<span class="text-warn font-mono text-[11px]">disconnected</span>'),qm=x("<!> <span>Running…</span>",1),Km=x("<!> <span>Run</span>",1),jm=x('<div class="h-full grid place-items-center p-6" aria-live="polite" aria-busy="true"><div class="w-full max-w-md rounded border border-line-1 bg-bg-1 p-4 font-mono"><div class="flex items-start justify-between gap-4"><div class="min-w-0"><div class="flex items-center gap-2 text-fg-1 text-[13px]"><!> <span>Running query</span></div> <div class="mt-2 text-[11px] text-fg-3">elapsed <span class="tabular-nums text-fg-2"> </span></div></div> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-line-2 px-2 text-[11px] text-fg-2 hover:border-danger/50 hover:text-danger cursor-pointer" aria-label="Cancel running query"><!> <span>Cancel</span></button></div> <div class="mt-3 max-h-24 overflow-hidden rounded bg-bg-0 px-2 py-1.5 text-[11px] text-fg-3"><pre class="m-0 whitespace-pre-wrap break-words"> </pre></div></div></div>'),Bm=x('<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>'),Wm=x('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Run a query to see results here.</div>'),Um=x('<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>'),Gm=x("<!> <!>",1),Ym=x('<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 Xm(t,e){it(e,!0),Xt(()=>{Gn.ensure(e.tabId)});const r=y(()=>Gn.states[e.tabId]),a=y(()=>qt.tabs.find($=>$.id===e.tabId));let o=we(void 0),s=we(Kt(Date.now()));const i=y(()=>{var $;return($=n(r))!=null&&$.runningStartedAt?eh(Math.max(0,n(s)-n(r).runningStartedAt)):"0ms"});Xt(()=>{var R;if(!((R=n(r))!=null&&R.running))return;_(s,Date.now(),!0);const $=setInterval(()=>{_(s,Date.now(),!0)},100);return()=>clearInterval($)});function d($){Gn.setSql(e.tabId,$);const R=nh($,e.fallbackLabel),H=qt.tabs.find(V=>V.id===e.tabId);H&&H.label!==R&&qt.rename(e.tabId,R)}async function f(){await Gn.run(e.tabId)}function g(){Gn.cancel(e.tabId)}function p($){($.metaKey||$.ctrlKey)&&$.key==="Enter"&&($.preventDefault(),f())}function b(){var $,R;return($=n(r))!=null&&$.result?tr.pick(n(r).result.capability,n(r).result,(R=n(a))==null?void 0:R.overrideCapability):null}var h=Ym(),w=c(h),S=c(w),A=c(S),D=u(c(A),2);{var W=$=>{var R=Hm(),H=u(fe(R),2),V=c(H,!0);l(H),L(()=>k(V,Ke.active.url)),v($,R)},C=$=>{var R=Fm();v($,R)};K(D,$=>{Ke.connected?$(W):$(C,-1)})}l(A);var G=u(A,2),X=c(G),I=u(c(X));Un(I,{children:($,R)=>{Ce();var H=_t("⌘");v($,H)}});var te=u(I);Un(te,{children:($,R)=>{Ce();var H=_t("↵");v($,H)}}),l(X);var le=u(X,2),oe=c(le);{var ee=$=>{var R=qm(),H=fe(R);lr(H,{class:"size-3.5 animate-spin"}),Ce(2),v($,R)},ve=$=>{var R=Km(),H=fe(R);ri(H,{class:"size-3.5"}),Ce(2),v($,R)};K(oe,$=>{var R;(R=n(r))!=null&&R.running?$(ee):$(ve,-1)})}l(le),l(G),l(S);var Q=u(S,2);Ha(Q),Ae(Q,"placeholder","SELECT * FROM users LIMIT 100"),sr(Q,$=>_(o,$),()=>n(o)),l(w);var E=u(w,2),M=c(E);{var m=$=>{var R=jm(),H=c(R),V=c(H),j=c(V),F=c(j),ae=c(F);lr(ae,{class:"size-4 animate-spin text-accent"}),Ce(2),l(F);var be=u(F,2),se=u(c(be)),J=c(se,!0);l(se),l(be),l(j);var Y=u(j,2),Z=c(Y);Ln(Z,{class:"size-3.5"}),Ce(2),l(Y),l(V);var T=u(V,2),q=c(T),O=c(q,!0);l(q),l(T),l(H),l(R),L(z=>{k(J,n(i)),k(O,z)},[()=>n(r).sql.trim()]),ke("click",Y,g),v($,R)},N=$=>{var R=Bm(),H=u(c(R),2),V=c(H,!0);l(H),l(R),L(()=>k(V,n(r).error)),v($,R)},P=$=>{var R=Wm();v($,R)},B=$=>{const R=y(b);var H=Gm(),V=fe(H);{var j=be=>{var se=Um(),J=c(se);Ce(2),l(se),L(Y=>k(J,`Streamed first ${Y??""} rows — more remain on the server. Add a `),[()=>n(r).result.record_count.toLocaleString()]),v(be,se)};K(V,be=>{n(r).result.truncated&&be(j)})}var F=u(V,2);{var ae=be=>{const se=y(()=>n(R).component);var J=Re(),Y=fe(J);{let Z=y(()=>{var T;return((T=n(a))==null?void 0:T.showSystemColumns)??!1});Wr(Y,()=>n(se),(T,q)=>{q(T,{get result(){return n(r).result},get showSystem(){return n(Z)}})})}v(be,J)};K(F,be=>{n(R)&&be(ae)})}v($,H)};K(M,$=>{var R,H,V;(R=n(r))!=null&&R.running?$(m):(H=n(r))!=null&&H.error?$(N,1):(V=n(r))!=null&&V.result?$(B,-1):$(P,2)})}l(E),l(h),L(()=>{var $,R;le.disabled=(($=n(r))==null?void 0:$.running)||!Ke.connected,Jn(Q,((R=n(r))==null?void 0:R.sql)??"")}),ke("click",le,f),ke("input",Q,$=>d($.currentTarget.value)),ke("keydown",Q,p),v(t,h),st()}en(["click","input","keydown"]);var Zm=x('<div class="px-3 py-2 flex items-center gap-2 text-fg-3"><!> <span class="type-label">Results</span></div>'),Qm=x('<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>'),Jm=x('<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>'),e_=x('<div class="flex items-stretch overflow-x-auto"></div>'),t_=x('<button type="button"><!> <span>history</span></button>'),n_=x('<button type="button"><!> <span>meta</span></button> <!>',1),r_=x("<option> </option>"),a_=x('<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>'),o_=x('<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>'),i_=x('<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>'),s_=x(`<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
|
|
1164
|
-
collections and running queries.</p></div>`),l_=x('<div class="h-full grid place-items-center p-6"><!></div>'),c_=x('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Workspace</div>'),d_=x('<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>'),u_=x('<div class="px-2 py-2"><div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></div>'),f_=x('<div class="px-2 py-2"><div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></div>'),v_=x('<div class="grid h-[29px] grid-cols-[40px_repeat(6,minmax(96px,1fr))] border-b border-line-1/60"><div class="px-2 py-2"><div class="ml-auto h-3 w-4 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <!></div>'),g_=x('<div class="h-full flex flex-col" aria-busy="true"><div class="border-b border-line-1 bg-bg-1/35 px-3 py-2"><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"><div class="h-[21px] w-[78px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-4 w-44 max-w-[45vw] rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div class="mt-1 flex flex-wrap gap-1"><div class="h-[21px] w-24 rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[21px] w-32 rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[21px] w-20 rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div></div></div> <div class="flex flex-wrap items-center gap-2"><div class="h-[30px] w-[94px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[92px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[92px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[78px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[78px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div></div></div></div> <div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 bg-bg-1/40"><div class="h-6 w-[70px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-6 w-[54px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-4 w-px bg-line-1"></div> <div class="h-6 w-[76px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="ml-auto h-3 w-[58px] rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div class="flex-1 overflow-hidden"><div class="min-w-[760px]"><div class="grid h-8 grid-cols-[40px_repeat(6,minmax(96px,1fr))] border-b border-line-1 bg-bg-1"><div class="px-2 py-2"><div class="ml-auto h-3 w-4 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <!></div> <!></div></div> <div class="border-t border-line-1 px-3 py-1.5 flex items-center gap-3"><div class="h-3 w-28 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 w-44 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 w-20 rounded bg-bg-2 motion-safe:animate-pulse"></div></div></div>'),p_=x('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Catalog metadata unavailable.</span> <span class="truncate"> </span></div>'),h_=x('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Loading collection catalog…</span></div>'),b_=x('<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>'),x_=x('<span class="font-mono text-[10px] text-fg-3">No type-specific catalog fields.</span>'),m_=x('<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>'),__=x('<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>'),y_=x('<div class="text-fg-3">Loading metadata…</div>'),w_=x('<span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span>'),k_=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),S_=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),C_=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2">retention</span>'),E_=x("<span> </span>"),N_=x('<div class="mt-1 flex flex-wrap gap-1"></div>'),M_=x('<div class="mt-1 text-fg-3">Action grants not exposed.</div>'),T_=x('<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>'),z_=x('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-2 text-[11px] font-mono"><!></div>'),A_=x('<div class="h-[320px] min-h-[240px] border-b border-line-1"><!></div>'),P_=x('<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>'),L_=x('<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 I_(t,e){it(e,!0);const r=ya(),a=[{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"}],o=Array.from({length:14},(O,z)=>z),s=Array.from({length:6},(O,z)=>z);let i=Kt({}),d=Kt({}),f=Kt({}),g=Kt({}),p=Kt({}),b=Kt({}),h=Kt({}),w=we(Kt({})),S=we(null),A=null,D=we(!1),W=we(!1);Xt(()=>{const O=qt.activeId;O!==A&&(_(S,A,!0),A=O)});async function C(O,z){const[he,me]=await Promise.all([Ct.track(`${z} · edges (LIMIT 50000)`,()=>O.query(`SELECT * FROM ${z} WHERE from_rid IS NOT NULL LIMIT 50000`)),Ct.track(`${z} · centrality (LIMIT 100)`,()=>O.query("GRAPH CENTRALITY LIMIT 100")).catch(()=>null)]),_e=new Map;me!=null&&me.ok&&me.result.records.forEach((Ee,Te)=>{const Me=Ee.values.node_id??Ee.values.rid??Ee.values.id,Ne=Ee.values.score??Ee.values.centrality_score??Ee.values.centrality,ze=typeof Me=="number"?Me:typeof Me=="string"?Number(Me):NaN,Ze=typeof Ne=="number"?Ne:typeof Ne=="string"?Number(Ne):NaN;!Number.isFinite(ze)||!Number.isFinite(Ze)||_e.set(ze,{score:Ze,rank:Te+1,label:typeof Ee.values.label=="string"?Ee.values.label:void 0})});const pe=new Set;for(const Ee of he.result.records){const Te=Ee.values.from_rid,Me=Ee.values.to_rid;typeof Te=="number"&&pe.add(Te),typeof Me=="number"&&pe.add(Me)}for(const Ee of _e.keys())pe.add(Ee);const ue=[...pe],Oe=Math.ceil(ue.length/5),ie=[];for(let Ee=0;Ee<ue.length;Ee+=5)ie.push({idx:Math.floor(Ee/5)+1,ids:ue.slice(Ee,Ee+5).join(",")});const de=[];let ye=he,Pe=0;async function Le(){for(;Pe<ie.length;){const Ee=ie[Pe++],Te=await Ct.track(`${z} · nodes ${Ee.idx}/${Oe}`,()=>O.query(`SELECT * FROM ${z} WHERE rid IN (${Ee.ids})`));de.push(...Te.result.records.map(Me=>{const Ne=Me.values.rid,ze=typeof Ne=="number"?_e.get(Ne):void 0;return ze?{...Me,values:{...Me.values,centrality_score:ze.score,centrality_rank:ze.rank,centrality_label:ze.label}}:Me})),ye=Te}}return await Promise.all(Array.from({length:8},Le)),{...ye,record_count:de.length+he.result.records.length,result:{...ye.result,records:[...de,...he.result.records]}}}function G(O){return`'${O.replace(/'/g,"''")}'`}async function X(O,z){const U=await O.query(ah(z)),ne=ih(U.result.records[0]);if(!ne)throw new Error(`${z} was not found in red.collections`);return ne}async function I(O,z){var U;try{const ce=(U=(await O.query(`SELECT model FROM red.collections WHERE name = ${G(z)} LIMIT 1`)).result.records[0])==null?void 0:U.values.model;return typeof ce=="string"?ce:null}catch{return null}}async function te(O,z){const U=Ji(z),ne=await I(O,z);if(ne==="hll")return O.query(`HLL INFO ${U}`);if(ne==="sketch")return O.query(`SKETCH INFO ${U}`);if(ne==="filter")return O.query(`FILTER INFO ${U}`);if(ne==="mixed")for(const ce of[`HLL INFO ${U}`,`SKETCH INFO ${U}`,`FILTER INFO ${U}`])try{return await O.query(ce)}catch{}try{return await O.query(`SELECT * FROM ${U} LIMIT 200`)}catch{for(const ce of[`HLL INFO ${U}`,`SKETCH INFO ${U}`,`FILTER INFO ${U}`])try{return await O.query(ce)}catch{}throw new Error(`No stats read form worked for ${z}`)}}async function le(O,z){const U=Ji(z),ne=await O.query(`SELECT * FROM ${U} LIMIT 200`);return{...ne,capability:ne.capability??"vector"}}Xt(()=>{if(_n.locked)return;const O=Ke.client;if(O)for(const z of qt.tabs){if(z.kind!=="collection")continue;const U=z.subpage??Pa(z.capability),ne=U==="graph"||U==="svg",ce=U==="queue"||z.capability==="queue",xe=U==="vector"||z.capability==="vector",he=U==="stats"||z.capability==="stats",me=U==="kv"||z.capability==="kv",_e=ne?"graph-subgraph":ce?"queue-peek":xe?"vector-inspector":he?"stats-info":me?"kv-list":z.capability??"unknown",pe=`${z.key}:${U}:${_e}`;if(f[z.id]&&f[z.id]!==pe&&(delete i[z.id],delete d[z.id]),i[z.id]!==void 0||d[z.id])continue;i[z.id]=null,f[z.id]=pe;const ue=z.key;(ne?C(O,ue):ce?Ct.track(`${ue} · QUEUE PEEK (LIMIT 200)`,()=>O.query(`QUEUE PEEK ${ue} 200`)):xe?Ct.track(`${ue} · vector inspector seed`,()=>le(O,ue)):he?Ct.track(`${ue} · stats preview`,()=>te(O,ue)):me?Ct.track(`${ue} · LIST KV (LIMIT 200)`,()=>O.query(pl(ue,"kv"))):Ct.track(`${ue} · SELECT * (LIMIT 200)`,()=>O.query(pl(ue,z.capability)))).then(ie=>{i[z.id]=ie}).catch(ie=>{d[z.id]=ie.message})}}),Xt(()=>{if(_n.locked)return;const O=Ke.client;if(O)for(const z of qt.tabs)z.kind==="collection"&&(g[z.id]!==void 0||p[z.id]||(g[z.id]=null,Ct.track(`catalog · ${z.key}`,()=>X(O,z.key)).then(U=>{g[z.id]=U}).catch(U=>{p[z.id]=U.message})))}),Xt(()=>{if(!n(W)||_n.locked)return;const O=Ke.client;if(O)for(const z of qt.tabs)z.kind==="collection"&&(b[z.id]!==void 0||h[z.id]||(b[z.id]=null,Ct.track(`metadata · ${z.key}`,()=>O.collection(z.key)).then(U=>{b[z.id]=U}).catch(U=>{h[z.id]=U.message})))});function oe(O,z){O.stopPropagation();const U=qt.tabs.find(ce=>ce.id===z);if((U==null?void 0:U.kind)==="query"&&Gn.isDirty(z)&&!(typeof window<"u"?window.confirm("Discard unsaved query in this tab?"):!0))return;const ne=(U==null?void 0:U.kind)==="collection"&&U.key===r.collection;if(qt.close(z,n(S)),Gn.remove(z),delete i[z],delete d[z],delete f[z],delete g[z],delete p[z],delete b[z],delete h[z],delete n(w)[z],ne){const ce=qt.tabs.find(xe=>xe.kind==="collection");r.go(ce?{view:"collection",collection:ce.key,subpage:ce.subpage??Pa(ce.capability)}:{view:"collections"},void 0,!0)}}function ee(){const O=Gn.nextLabel(),z=qt.open({kind:"query",label:O,key:O},!0);Gn.ensure(z.id),_(D,!1)}fr(()=>{const O=()=>ee();return window.addEventListener("red:new-query",O),()=>window.removeEventListener("red:new-query",O)});function ve(O,z){const U=vf(O.subpage,O.capability??z.capability);return tr.pick(U,z,O.overrideCapability)}function Q(){qt.open({kind:"live-changes",label:"live · global",key:"global"}),_(D,!1)}function E(O,z){const U=z.currentTarget.value;qt.setOverride(O.id,U===""?void 0:U)}function M(O,z){return O.subpage?O.subpage:O.capability?O.capability:z!=null&&z.capability?z.capability:"auto"}function m(O){return typeof O=="boolean"?{allowed:O}:{allowed:O.allowed,reason:O.reason}}function N(O){return O&&typeof O=="object"&&!Array.isArray(O)?Object.keys(O):[]}var P=L_(),B=c(P),$=c(B);{var R=O=>{var z=Zm(),U=c(z);Fa(U,{class:"size-3.5"}),Ce(2),l(z),v(O,z)},H=O=>{var z=e_();Xe(z,21,()=>qt.tabs,U=>U.id,(U,ne)=>{const ce=y(()=>n(ne).id===qt.activeId),xe=y(()=>["group flex items-center gap-2 px-3 py-1.5 text-[12px] font-mono border-r border-line-1 whitespace-nowrap no-underline",n(ce)?"bg-bg-1 text-fg-1 border-b-2 border-b-accent -mb-px":"text-fg-3 hover:text-fg-1 hover:bg-bg-1/40"].join(" "));var he=Re(),me=fe(he);{var _e=ue=>{const Oe=y(()=>({view:"collection",collection:n(ne).key,subpage:n(ne).subpage??Pa(n(ne).capability)}));var ie=Qm(),de=c(ie),ye=c(de,!0);l(de);var Pe=u(de,2),Le=c(Pe);Ln(Le,{class:"size-3"}),l(Pe),l(ie),L(Ee=>{Ae(ie,"href",Ee),De(ie,1,je(n(xe))),Ae(ie,"title",n(ne).label),k(ye,n(ne).label)},[()=>r.href(n(Oe))]),ke("click",ie,Ee=>r.go(n(Oe),Ee)),ke("click",Pe,Ee=>oe(Ee,n(ne).id)),ke("keydown",Pe,Ee=>{Ee.key==="Enter"&&oe(Ee,n(ne).id)}),v(ue,ie)},pe=ue=>{var Oe=Jm(),ie=c(Oe),de=c(ie,!0);l(ie);var ye=u(ie,2),Pe=c(ye);Ln(Pe,{class:"size-3"}),l(ye),l(Oe),L(()=>{De(Oe,1,je(n(xe))),Ae(Oe,"title",n(ne).label),k(de,n(ne).label)}),ke("click",Oe,()=>qt.focus(n(ne).id)),ke("click",ye,Le=>oe(Le,n(ne).id)),ke("keydown",ye,Le=>{Le.key==="Enter"&&oe(Le,n(ne).id)}),v(ue,Oe)};K(me,ue=>{n(ne).kind==="collection"?ue(_e):ue(pe,-1)})}v(U,he)}),l(z),v(O,z)};K($,O=>{qt.tabs.length===0?O(R):O(H,-1)})}var V=u($,2);{var j=O=>{const z=y(()=>qt.active),U=y(()=>i[n(z).id]);var ne=a_(),ce=c(ne);{var xe=ye=>{var Pe=n_(),Le=fe(Pe),Ee=c(Le);xi(Ee,{class:"size-3"}),Ce(2),l(Le);var Te=u(Le,2);{var Me=Ne=>{var ze=t_(),Ze=c(ze);rv(Ze,{class:"size-3"}),Ce(2),l(ze),L($e=>{Ae(ze,"title",n(w)[n(z).id]?"Hide version history":"Show version history and diffs"),Ae(ze,"aria-pressed",n(w)[n(z).id]??!1),De(ze,1,$e)},[()=>je(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",n(w)[n(z).id]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),ke("click",ze,()=>_(w,{...n(w),[n(z).id]:!(n(w)[n(z).id]??!1)},!0)),v(Ne,ze)};K(Te,Ne=>{Ke.capabilities.vcs&&Ne(Me)})}L(Ne=>{Ae(Le,"title",n(W)?"Hide collection metadata":"Show collection metadata"),Ae(Le,"aria-pressed",n(W)),De(Le,1,Ne)},[()=>je(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",n(W)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),ke("click",Le,()=>_(W,!n(W))),v(ye,Pe)};K(ce,ye=>{n(z).kind==="collection"&&ye(xe)})}var he=u(ce,2),me=c(he);{var _e=ye=>{Ac(ye,{class:"size-3"})},pe=ye=>{zc(ye,{class:"size-3"})};K(me,ye=>{n(z).showSystemColumns?ye(_e):ye(pe,-1)})}Ce(2),l(he);var ue=u(he,2),Oe=c(ue,!0);l(ue);var ie=u(ue,4);Xe(ie,21,()=>a,ye=>ye.value,(ye,Pe)=>{var Le=r_(),Ee=c(Le,!0);l(Le);var Te={};L(()=>{k(Ee,n(Pe).label),Te!==(Te=n(Pe).value)&&(Le.value=(Le.__value=n(Pe).value)??"")}),v(ye,Le)}),l(ie);var de;aa(ie),l(ne),L((ye,Pe)=>{Ae(he,"title",n(z).showSystemColumns?"Hide reddb system columns (rid, collection, kind, tenant, created_at, updated_at)":"Show reddb system columns"),Ae(he,"aria-pressed",n(z).showSystemColumns??!1),De(he,1,ye),k(Oe,Pe),de!==(de=n(z).overrideCapability??"")&&(ie.value=(ie.__value=n(z).overrideCapability??"")??"",oa(ie,n(z).overrideCapability??""))},[()=>je(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",n(z).showSystemColumns?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>M(n(z),n(U))]),ke("click",he,()=>qt.setShowSystem(n(z).id,!n(z).showSystemColumns)),ke("change",ie,ye=>E(n(z),ye)),v(O,ne)};K(V,O=>{qt.active&&(qt.active.kind==="collection"||qt.active.kind==="query")&&O(j)})}var F=u(V,2),ae=c(F),be=c(ae);La(be,{class:"size-3.5"}),l(ae);var se=u(ae,2);{var J=O=>{var z=o_(),U=c(z),ne=c(U);Pc(ne,{class:"size-3.5 text-fg-3"}),Ce(4),l(U);var ce=u(U,2);l(z),ke("click",U,ee),ke("click",ce,Q),v(O,z)};K(se,O=>{n(D)&&O(J)})}l(F),l(B);var Y=u(B,2),Z=c(Y);{var T=O=>{var z=l_(),U=c(z);{var ne=xe=>{var he=i_(),me=u(c(he)),_e=c(me,!0);l(me),Ce(3),l(he),L(()=>k(_e,Ke.active.url)),v(xe,he)},ce=xe=>{var he=s_(),me=c(he);$o(me,{class:"size-8 text-fg-3 mx-auto mb-3",strokeWidth:1.4}),Ce(4),l(he),v(xe,he)};K(U,xe=>{Ke.connected?xe(ne):xe(ce,-1)})}l(z),v(O,z)},q=O=>{const z=y(()=>qt.active);var U=Re(),ne=fe(U);{var ce=_e=>{cd(_e,{collection:void 0})},xe=_e=>{Xm(_e,{get tabId(){return n(z).id},get fallbackLabel(){return n(z).key}})},he=_e=>{var pe=c_();v(_e,pe)},me=_e=>{const pe=y(()=>i[n(z).id]),ue=y(()=>d[n(z).id]);var Oe=Re(),ie=fe(Oe);{var de=Le=>{var Ee=d_(),Te=u(c(Ee),2),Me=c(Te,!0);l(Te),l(Ee),L(()=>k(Me,n(ue))),v(Le,Ee)},ye=Le=>{var Ee=g_(),Te=u(c(Ee),4),Me=c(Te),Ne=c(Me),ze=u(c(Ne),2);Xe(ze,16,()=>s,$e=>$e,($e,Je)=>{var tt=u_(),ct=c(tt);l(tt),L(()=>kn(ct,`width: ${Je%3===0?72:Je%3===1?104:56}px`)),v($e,tt)}),l(Ne);var Ze=u(Ne,2);Xe(Ze,16,()=>o,$e=>$e,($e,Je)=>{var tt=v_(),ct=u(c(tt),2);Xe(ct,16,()=>s,qe=>qe,(qe,Ve)=>{var Be=f_(),ot=c(Be);l(Be),L(()=>kn(ot,`width: ${Ve===0?48:64+(Je+Ve)%4*18}px`)),v(qe,Be)}),l(tt),v($e,tt)}),l(Me),l(Te),Ce(2),l(Ee),L(()=>Ae(Ee,"aria-label",`Loading ${n(z).label} results`)),v(Le,Ee)},Pe=Le=>{const Ee=y(()=>ve(n(z),n(pe))),Te=y(()=>n(Ee).component),Me=y(()=>g[n(z).id]),Ne=y(()=>p[n(z).id]);var ze=P_(),Ze=c(ze),$e=c(Ze);{var Je=Qe=>{var We=p_(),ft=c(We);xi(ft,{class:"size-3.5 text-warn"});var Nt=u(ft,4),At=c(Nt,!0);l(Nt),l(We),L(()=>k(At,n(Ne))),v(Qe,We)},tt=Qe=>{var We=h_(),ft=c(We);$o(ft,{class:"size-3.5"}),Ce(2),l(We),v(Qe,We)},ct=Qe=>{var We=m_(),ft=c(We),Nt=c(ft),At=c(Nt),Mt=c(At,!0);l(At);var Et=u(At,2),mt=c(Et,!0);l(Et),l(Nt);var yt=u(Nt,2),kt=c(yt);Xe(kt,17,()=>bl(n(Me)),bn,(Ue,wt)=>{var dt=b_(),ht=c(dt,!0);l(dt),L(()=>k(ht,n(wt))),v(Ue,dt)});var It=u(kt,2);{var Zt=Ue=>{var wt=x_();v(Ue,wt)},hn=y(()=>bl(n(Me)).length===0);K(It,Ue=>{n(hn)&&Ue(Zt)})}l(yt),l(ft);var xn=u(ft,2),at=c(xn),ut=c(at);Yi(ut,{class:"size-3.5 text-fg-3"});var Lt=u(ut,2),jt=c(Lt,!0);l(Lt),Ce(2),l(at);var on=u(at,2),sn=c(on);ov(sn,{class:"size-3.5 text-fg-3"});var ln=u(sn,2),Sn=c(ln,!0);l(ln),Ce(2),l(on);var cn=u(on,2),yn=c(cn);Fa(yn,{class:"size-3.5 text-fg-3"});var Nn=u(yn,2),An=c(Nn,!0);l(Nn),Ce(2),l(cn);var Cn=u(cn,2),Pn=c(Cn);gf(Pn,{class:"size-3.5 text-fg-3"});var Se=u(Pn,2),Ie=c(Se,!0);l(Se),Ce(2),l(Cn);var He=u(Cn,2),Ye=c(He);vv(Ye,{class:"size-3.5 text-fg-3"});var et=u(Ye,2),nt=c(et,!0);l(et),Ce(2),l(He),l(xn),l(We),L((Ue,wt,dt,ht,Pt)=>{k(Mt,n(Me).model??"collection"),k(mt,n(Me).name),k(jt,Ue),k(Sn,wt),k(An,dt),k(Ie,ht),k(nt,Pt)},[()=>zo(n(Me).entities),()=>hl(n(Me).onDiskBytes),()=>hl(n(Me).inMemoryBytes),()=>zo(n(Me).segments),()=>zo(n(Me).indices)]),v(Qe,We)};K($e,Qe=>{n(Ne)?Qe(Je):n(Me)?Qe(ct,-1):Qe(tt,1)})}l(Ze);var qe=u(Ze,2);{var Ve=Qe=>{const We=y(()=>b[n(z).id]),ft=y(()=>h[n(z).id]);var Nt=z_(),At=c(Nt);{var Mt=yt=>{var kt=__(),It=c(kt);xi(It,{class:"mt-0.5 size-3.5 text-warn"});var Zt=u(It,2),hn=u(c(Zt),2),xn=c(hn,!0);l(hn),l(Zt),l(kt),L(()=>k(xn,n(ft))),v(yt,kt)},Et=yt=>{var kt=y_();v(yt,kt)},mt=yt=>{var kt=T_(),It=c(kt),Zt=u(c(It),2),hn=c(Zt,!0);l(Zt);var xn=u(Zt,4),at=c(xn,!0);l(xn);var ut=u(xn,4),Lt=c(ut,!0);l(ut);var jt=u(ut,4),on=c(jt,!0);l(jt),l(It);var sn=u(It,2),ln=c(sn),Sn=c(ln);{var cn=Ue=>{var wt=w_(),dt=c(wt,!0);l(wt),L(()=>k(dt,n(We).capability)),v(Ue,wt)};K(Sn,Ue=>{n(We).capability&&Ue(cn)})}var yn=u(Sn,2);Xe(yn,17,()=>n(We).capabilities??[],bn,(Ue,wt)=>{var dt=k_(),ht=c(dt,!0);l(dt),L(()=>k(ht,n(wt))),v(Ue,dt)});var Nn=u(yn,2);{var An=Ue=>{var wt=S_(),dt=c(wt);l(wt),L(ht=>k(dt,`schema ${ht??""}`),[()=>N(n(We).schema).length]),v(Ue,wt)},Cn=y(()=>N(n(We).schema).length>0);K(Nn,Ue=>{n(Cn)&&Ue(An)})}var Pn=u(Nn,2);{var Se=Ue=>{var wt=C_();v(Ue,wt)},Ie=y(()=>N(n(We).retention).length>0);K(Pn,Ue=>{n(Ie)&&Ue(Se)})}l(ln);var He=u(ln,2);{var Ye=Ue=>{var wt=N_();Xe(wt,21,()=>Object.entries(n(We).actions),bn,(dt,ht)=>{var Pt=y(()=>er(n(ht),2));let Ot=()=>n(Pt)[0],tn=()=>n(Pt)[1];const fn=y(()=>m(tn()));var Dt=E_(),Rt=c(Dt);l(Dt),L(Ut=>{De(Dt,1,Ut),Ae(Dt,"title",n(fn).reason),k(Rt,`${Ot()??""}: ${n(fn).allowed?"allow":"deny"}`)},[()=>je(["rounded border px-1.5 py-0.5",n(fn).allowed?"border-ok/30 bg-ok/10 text-ok":"border-danger/30 bg-danger/10 text-danger"].join(" "))]),v(dt,Dt)}),l(wt),v(Ue,wt)},et=y(()=>n(We).actions&&N(n(We).actions).length>0),nt=Ue=>{var wt=M_();v(Ue,wt)};K(He,Ue=>{n(et)?Ue(Ye):Ue(nt,-1)})}l(sn),l(kt),L(()=>{var Ue;k(hn,n(We).name??n(z).key),k(at,n(We).kind??n(We).capability??n(z).capability??"unknown"),k(Lt,n(We).tenant??"not exposed"),k(on,((Ue=n(We).indexes)==null?void 0:Ue.length)??0)}),v(yt,kt)};K(At,yt=>{n(ft)?yt(Mt):n(We)?yt(mt,-1):yt(Et,1)})}l(Nt),v(Qe,Nt)};K(qe,Qe=>{n(W)&&Qe(Ve)})}var Be=u(qe,2);{var ot=Qe=>{var We=A_(),ft=c(We);{let Nt=y(()=>Ke.client??void 0);Vm(ft,{get client(){return n(Nt)},get collection(){return n(z).key}})}l(We),v(Qe,We)};K(Be,Qe=>{n(w)[n(z).id]&&Qe(ot)})}var re=u(Be,2),rt=c(re);{let Qe=y(()=>n(z).kind==="collection"?n(z).key:void 0),We=y(()=>Ke.client??void 0),ft=y(()=>n(z).kind==="collection"?n(z).subpage:void 0),Nt=y(()=>n(z).showSystemColumns??!1);Wr(rt,()=>n(Te),(At,Mt)=>{Mt(At,{get result(){return n(pe)},get collection(){return n(Qe)},get client(){return n(We)},get subpage(){return n(ft)},get showSystem(){return n(Nt)}})})}l(re),l(ze),v(Le,ze)};K(ie,Le=>{n(ue)?Le(de):n(pe)?Le(Pe,-1):Le(ye,1)})}v(_e,Oe)};K(ne,_e=>{n(z).kind==="live-changes"?_e(ce):n(z).kind==="query"?_e(xe,1):n(z).kind==="welcome"?_e(he,2):_e(me,-1)})}v(O,U)};K(Z,O=>{qt.active?O(q,-1):O(T)})}l(Y),l(P),L(()=>De(F,1,`relative ${qt.active&&(qt.active.kind==="collection"||qt.active.kind==="query")?"":"ml-auto"} flex items-stretch`)),ke("click",ae,()=>_(D,!n(D))),v(t,P),st()}en(["click","keydown","change"]);var O_=x('<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 R_(t){var e=O_(),r=c(e),a=c(r);Gp(a,{}),l(r);var o=u(r,2),s=c(o);I_(s,{}),l(o),l(e),v(t,e)}var $_={value:()=>{}};function ai(){for(var t=0,e=arguments.length,r={},a;t<e;++t){if(!(a=arguments[t]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new Po(r)}function Po(t){this._=t}function D_(t,e){return t.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}Po.prototype=ai.prototype={constructor:Po,on:function(t,e){var r=this._,a=D_(t+"",r),o,s=-1,i=a.length;if(arguments.length<2){for(;++s<i;)if((o=(t=a[s]).type)&&(o=V_(r[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<i;)if(o=(t=a[s]).type)r[o]=Ml(r[o],t.name,e);else if(e==null)for(o in r)r[o]=Ml(r[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new Po(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,s;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],a=0,o=s.length;a<o;++a)s[a].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],o=0,s=a.length;o<s;++o)a[o].value.apply(e,r)}};function V_(t,e){for(var r=0,a=t.length,o;r<a;++r)if((o=t[r]).name===e)return o.value}function Ml(t,e,r){for(var a=0,o=t.length;a<o;++a)if(t[a].name===e){t[a]=$_,t=t.slice(0,a).concat(t.slice(a+1));break}return r!=null&&t.push({name:e,value:r}),t}var os="http://www.w3.org/1999/xhtml";const Tl={svg:"http://www.w3.org/2000/svg",xhtml:os,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function oi(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Tl.hasOwnProperty(e)?{space:Tl[e],local:t}:t}function H_(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===os&&e.documentElement.namespaceURI===os?e.createElement(t):e.createElementNS(r,t)}}function F_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function dd(t){var e=oi(t);return(e.local?F_:H_)(e)}function q_(){}function Ts(t){return t==null?q_:function(){return this.querySelector(t)}}function K_(t){typeof t!="function"&&(t=Ts(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var s=e[o],i=s.length,d=a[o]=new Array(i),f,g,p=0;p<i;++p)(f=s[p])&&(g=t.call(f,f.__data__,p,s))&&("__data__"in f&&(g.__data__=f.__data__),d[p]=g);return new Zn(a,this._parents)}function j_(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function B_(){return[]}function ud(t){return t==null?B_:function(){return this.querySelectorAll(t)}}function W_(t){return function(){return j_(t.apply(this,arguments))}}function U_(t){typeof t=="function"?t=W_(t):t=ud(t);for(var e=this._groups,r=e.length,a=[],o=[],s=0;s<r;++s)for(var i=e[s],d=i.length,f,g=0;g<d;++g)(f=i[g])&&(a.push(t.call(f,f.__data__,g,i)),o.push(f));return new Zn(a,o)}function fd(t){return function(){return this.matches(t)}}function vd(t){return function(e){return e.matches(t)}}var G_=Array.prototype.find;function Y_(t){return function(){return G_.call(this.children,t)}}function X_(){return this.firstElementChild}function Z_(t){return this.select(t==null?X_:Y_(typeof t=="function"?t:vd(t)))}var Q_=Array.prototype.filter;function J_(){return Array.from(this.children)}function e0(t){return function(){return Q_.call(this.children,t)}}function t0(t){return this.selectAll(t==null?J_:e0(typeof t=="function"?t:vd(t)))}function n0(t){typeof t!="function"&&(t=fd(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var s=e[o],i=s.length,d=a[o]=[],f,g=0;g<i;++g)(f=s[g])&&t.call(f,f.__data__,g,s)&&d.push(f);return new Zn(a,this._parents)}function gd(t){return new Array(t.length)}function r0(){return new Zn(this._enter||this._groups.map(gd),this._parents)}function Vo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Vo.prototype={constructor:Vo,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 a0(t){return function(){return t}}function o0(t,e,r,a,o,s){for(var i=0,d,f=e.length,g=s.length;i<g;++i)(d=e[i])?(d.__data__=s[i],a[i]=d):r[i]=new Vo(t,s[i]);for(;i<f;++i)(d=e[i])&&(o[i]=d)}function i0(t,e,r,a,o,s,i){var d,f,g=new Map,p=e.length,b=s.length,h=new Array(p),w;for(d=0;d<p;++d)(f=e[d])&&(h[d]=w=i.call(f,f.__data__,d,e)+"",g.has(w)?o[d]=f:g.set(w,f));for(d=0;d<b;++d)w=i.call(t,s[d],d,s)+"",(f=g.get(w))?(a[d]=f,f.__data__=s[d],g.delete(w)):r[d]=new Vo(t,s[d]);for(d=0;d<p;++d)(f=e[d])&&g.get(h[d])===f&&(o[d]=f)}function s0(t){return t.__data__}function l0(t,e){if(!arguments.length)return Array.from(this,s0);var r=e?i0:o0,a=this._parents,o=this._groups;typeof t!="function"&&(t=a0(t));for(var s=o.length,i=new Array(s),d=new Array(s),f=new Array(s),g=0;g<s;++g){var p=a[g],b=o[g],h=b.length,w=c0(t.call(p,p&&p.__data__,g,a)),S=w.length,A=d[g]=new Array(S),D=i[g]=new Array(S),W=f[g]=new Array(h);r(p,b,A,D,W,w,e);for(var C=0,G=0,X,I;C<S;++C)if(X=A[C]){for(C>=G&&(G=C+1);!(I=D[G])&&++G<S;);X._next=I||null}}return i=new Zn(i,a),i._enter=d,i._exit=f,i}function c0(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function d0(){return new Zn(this._exit||this._groups.map(gd),this._parents)}function u0(t,e,r){var a=this.enter(),o=this,s=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),r==null?s.remove():r(s),a&&o?a.merge(o).order():o}function f0(t){for(var e=t.selection?t.selection():t,r=this._groups,a=e._groups,o=r.length,s=a.length,i=Math.min(o,s),d=new Array(o),f=0;f<i;++f)for(var g=r[f],p=a[f],b=g.length,h=d[f]=new Array(b),w,S=0;S<b;++S)(w=g[S]||p[S])&&(h[S]=w);for(;f<o;++f)d[f]=r[f];return new Zn(d,this._parents)}function v0(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var a=t[e],o=a.length-1,s=a[o],i;--o>=0;)(i=a[o])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function g0(t){t||(t=p0);function e(b,h){return b&&h?t(b.__data__,h.__data__):!b-!h}for(var r=this._groups,a=r.length,o=new Array(a),s=0;s<a;++s){for(var i=r[s],d=i.length,f=o[s]=new Array(d),g,p=0;p<d;++p)(g=i[p])&&(f[p]=g);f.sort(e)}return new Zn(o,this._parents).order()}function p0(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function h0(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function b0(){return Array.from(this)}function x0(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,s=a.length;o<s;++o){var i=a[o];if(i)return i}return null}function m0(){let t=0;for(const e of this)++t;return t}function _0(){return!this.node()}function y0(t){for(var e=this._groups,r=0,a=e.length;r<a;++r)for(var o=e[r],s=0,i=o.length,d;s<i;++s)(d=o[s])&&t.call(d,d.__data__,s,o);return this}function w0(t){return function(){this.removeAttribute(t)}}function k0(t){return function(){this.removeAttributeNS(t.space,t.local)}}function S0(t,e){return function(){this.setAttribute(t,e)}}function C0(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function E0(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function N0(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function M0(t,e){var r=oi(t);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((e==null?r.local?k0:w0:typeof e=="function"?r.local?N0:E0:r.local?C0:S0)(r,e))}function pd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function T0(t){return function(){this.style.removeProperty(t)}}function z0(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A0(t,e,r){return function(){var a=e.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,r)}}function P0(t,e,r){return arguments.length>1?this.each((e==null?T0:typeof e=="function"?A0:z0)(t,e,r??"")):ga(this.node(),t)}function ga(t,e){return t.style.getPropertyValue(e)||pd(t).getComputedStyle(t,null).getPropertyValue(e)}function L0(t){return function(){delete this[t]}}function I0(t,e){return function(){this[t]=e}}function O0(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function R0(t,e){return arguments.length>1?this.each((e==null?L0:typeof e=="function"?O0:I0)(t,e)):this.node()[t]}function hd(t){return t.trim().split(/^|\s+/)}function zs(t){return t.classList||new bd(t)}function bd(t){this._node=t,this._names=hd(t.getAttribute("class")||"")}bd.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 xd(t,e){for(var r=zs(t),a=-1,o=e.length;++a<o;)r.add(e[a])}function md(t,e){for(var r=zs(t),a=-1,o=e.length;++a<o;)r.remove(e[a])}function $0(t){return function(){xd(this,t)}}function D0(t){return function(){md(this,t)}}function V0(t,e){return function(){(e.apply(this,arguments)?xd:md)(this,t)}}function H0(t,e){var r=hd(t+"");if(arguments.length<2){for(var a=zs(this.node()),o=-1,s=r.length;++o<s;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?V0:e?$0:D0)(r,e))}function F0(){this.textContent=""}function q0(t){return function(){this.textContent=t}}function K0(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function j0(t){return arguments.length?this.each(t==null?F0:(typeof t=="function"?K0:q0)(t)):this.node().textContent}function B0(){this.innerHTML=""}function W0(t){return function(){this.innerHTML=t}}function U0(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function G0(t){return arguments.length?this.each(t==null?B0:(typeof t=="function"?U0:W0)(t)):this.node().innerHTML}function Y0(){this.nextSibling&&this.parentNode.appendChild(this)}function X0(){return this.each(Y0)}function Z0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Q0(){return this.each(Z0)}function J0(t){var e=typeof t=="function"?t:dd(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function e2(){return null}function t2(t,e){var r=typeof t=="function"?t:dd(t),a=e==null?e2:typeof e=="function"?e:Ts(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function n2(){var t=this.parentNode;t&&t.removeChild(this)}function r2(){return this.each(n2)}function a2(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function o2(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function i2(t){return this.select(t?o2:a2)}function s2(t){return arguments.length?this.property("__data__",t):this.node().__data__}function l2(t){return function(e){t.call(this,e,this.__data__)}}function c2(t){return t.trim().split(/^|\s+/).map(function(e){var r="",a=e.indexOf(".");return a>=0&&(r=e.slice(a+1),e=e.slice(0,a)),{type:e,name:r}})}function d2(t){return function(){var e=this.__on;if(e){for(var r=0,a=-1,o=e.length,s;r<o;++r)s=e[r],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++a]=s;++a?e.length=a:delete this.__on}}}function u2(t,e,r){return function(){var a=this.__on,o,s=l2(e);if(a){for(var i=0,d=a.length;i<d;++i)if((o=a[i]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=e;return}}this.addEventListener(t.type,s,r),o={type:t.type,name:t.name,value:e,listener:s,options:r},a?a.push(o):this.__on=[o]}}function f2(t,e,r){var a=c2(t+""),o,s=a.length,i;if(arguments.length<2){var d=this.node().__on;if(d){for(var f=0,g=d.length,p;f<g;++f)for(o=0,p=d[f];o<s;++o)if((i=a[o]).type===p.type&&i.name===p.name)return p.value}return}for(d=e?u2:d2,o=0;o<s;++o)this.each(d(a[o],e,r));return this}function _d(t,e,r){var a=pd(t),o=a.CustomEvent;typeof o=="function"?o=new o(e,r):(o=a.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function v2(t,e){return function(){return _d(this,t,e)}}function g2(t,e){return function(){return _d(this,t,e.apply(this,arguments))}}function p2(t,e){return this.each((typeof e=="function"?g2:v2)(t,e))}function*h2(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,s=a.length,i;o<s;++o)(i=a[o])&&(yield i)}var yd=[null];function Zn(t,e){this._groups=t,this._parents=e}function so(){return new Zn([[document.documentElement]],yd)}function b2(){return this}Zn.prototype=so.prototype={constructor:Zn,select:K_,selectAll:U_,selectChild:Z_,selectChildren:t0,filter:n0,data:l0,enter:r0,exit:d0,join:u0,merge:f0,selection:b2,order:v0,sort:g0,call:h0,nodes:b0,node:x0,size:m0,empty:_0,each:y0,attr:M0,style:P0,property:R0,classed:H0,text:j0,html:G0,raise:X0,lower:Q0,append:J0,insert:t2,remove:r2,clone:i2,datum:s2,on:f2,dispatch:p2,[Symbol.iterator]:h2};function ar(t){return typeof t=="string"?new Zn([[document.querySelector(t)]],[document.documentElement]):new Zn([[t]],yd)}function x2(t){let e;for(;e=t.sourceEvent;)t=e;return t}function dr(t,e){if(t=x2(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(e.getScreenCTM().inverse()),[a.x,a.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}const m2={passive:!1},Ka={capture:!0,passive:!1};function Mi(t){t.stopImmediatePropagation()}function la(t){t.preventDefault(),t.stopImmediatePropagation()}function wd(t){var e=t.document.documentElement,r=ar(t).on("dragstart.drag",la,Ka);"onselectstart"in e?r.on("selectstart.drag",la,Ka):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function kd(t,e){var r=t.document.documentElement,a=ar(t).on("dragstart.drag",null);e&&(a.on("click.drag",la,Ka),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const bo=t=>()=>t;function is(t,{sourceEvent:e,subject:r,target:a,identifier:o,active:s,x:i,y:d,dx:f,dy:g,dispatch:p}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:p}})}is.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function _2(t){return!t.ctrlKey&&!t.button}function y2(){return this.parentNode}function w2(t,e){return e??{x:t.x,y:t.y}}function k2(){return navigator.maxTouchPoints||"ontouchstart"in this}function S2(){var t=_2,e=y2,r=w2,a=k2,o={},s=ai("start","drag","end"),i=0,d,f,g,p,b=0;function h(X){X.on("mousedown.drag",w).filter(a).on("touchstart.drag",D).on("touchmove.drag",W,m2).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(X,I){if(!(p||!t.call(this,X,I))){var te=G(this,e.call(this,X,I),X,I,"mouse");te&&(ar(X.view).on("mousemove.drag",S,Ka).on("mouseup.drag",A,Ka),wd(X.view),Mi(X),g=!1,d=X.clientX,f=X.clientY,te("start",X))}}function S(X){if(la(X),!g){var I=X.clientX-d,te=X.clientY-f;g=I*I+te*te>b}o.mouse("drag",X)}function A(X){ar(X.view).on("mousemove.drag mouseup.drag",null),kd(X.view,g),la(X),o.mouse("end",X)}function D(X,I){if(t.call(this,X,I)){var te=X.changedTouches,le=e.call(this,X,I),oe=te.length,ee,ve;for(ee=0;ee<oe;++ee)(ve=G(this,le,X,I,te[ee].identifier,te[ee]))&&(Mi(X),ve("start",X,te[ee]))}}function W(X){var I=X.changedTouches,te=I.length,le,oe;for(le=0;le<te;++le)(oe=o[I[le].identifier])&&(la(X),oe("drag",X,I[le]))}function C(X){var I=X.changedTouches,te=I.length,le,oe;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),le=0;le<te;++le)(oe=o[I[le].identifier])&&(Mi(X),oe("end",X,I[le]))}function G(X,I,te,le,oe,ee){var ve=s.copy(),Q=dr(ee||te,I),E,M,m;if((m=r.call(X,new is("beforestart",{sourceEvent:te,target:h,identifier:oe,active:i,x:Q[0],y:Q[1],dx:0,dy:0,dispatch:ve}),le))!=null)return E=m.x-Q[0]||0,M=m.y-Q[1]||0,function N(P,B,$){var R=Q,H;switch(P){case"start":o[oe]=N,H=i++;break;case"end":delete o[oe],--i;case"drag":Q=dr($||B,I),H=i;break}ve.call(P,X,new is(P,{sourceEvent:B,subject:m,target:h,identifier:oe,active:H,x:Q[0]+E,y:Q[1]+M,dx:Q[0]-R[0],dy:Q[1]-R[1],dispatch:ve}),le)}}return h.filter=function(X){return arguments.length?(t=typeof X=="function"?X:bo(!!X),h):t},h.container=function(X){return arguments.length?(e=typeof X=="function"?X:bo(X),h):e},h.subject=function(X){return arguments.length?(r=typeof X=="function"?X:bo(X),h):r},h.touchable=function(X){return arguments.length?(a=typeof X=="function"?X:bo(!!X),h):a},h.on=function(){var X=s.on.apply(s,arguments);return X===s?h:X},h.clickDistance=function(X){return arguments.length?(b=(X=+X)*X,h):Math.sqrt(b)},h}function As(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Sd(t,e){var r=Object.create(t.prototype);for(var a in e)r[a]=e[a];return r}function lo(){}var ja=.7,Ho=1/ja,ca="\\s*([+-]?\\d+)\\s*",Ba="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",C2=/^#([0-9a-f]{3,8})$/,E2=new RegExp(`^rgb\\(${ca},${ca},${ca}\\)$`),N2=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),M2=new RegExp(`^rgba\\(${ca},${ca},${ca},${Ba}\\)$`),T2=new RegExp(`^rgba\\(${vr},${vr},${vr},${Ba}\\)$`),z2=new RegExp(`^hsl\\(${Ba},${vr},${vr}\\)$`),A2=new RegExp(`^hsla\\(${Ba},${vr},${vr},${Ba}\\)$`),zl={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};As(lo,qr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Al,formatHex:Al,formatHex8:P2,formatHsl:L2,formatRgb:Pl,toString:Pl});function Al(){return this.rgb().formatHex()}function P2(){return this.rgb().formatHex8()}function L2(){return Cd(this).formatHsl()}function Pl(){return this.rgb().formatRgb()}function qr(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=C2.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Ll(e):r===3?new qn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?xo(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?xo(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=E2.exec(t))?new qn(e[1],e[2],e[3],1):(e=N2.exec(t))?new qn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=M2.exec(t))?xo(e[1],e[2],e[3],e[4]):(e=T2.exec(t))?xo(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=z2.exec(t))?Rl(e[1],e[2]/100,e[3]/100,1):(e=A2.exec(t))?Rl(e[1],e[2]/100,e[3]/100,e[4]):zl.hasOwnProperty(t)?Ll(zl[t]):t==="transparent"?new qn(NaN,NaN,NaN,0):null}function Ll(t){return new qn(t>>16&255,t>>8&255,t&255,1)}function xo(t,e,r,a){return a<=0&&(t=e=r=NaN),new qn(t,e,r,a)}function I2(t){return t instanceof lo||(t=qr(t)),t?(t=t.rgb(),new qn(t.r,t.g,t.b,t.opacity)):new qn}function ss(t,e,r,a){return arguments.length===1?I2(t):new qn(t,e,r,a??1)}function qn(t,e,r,a){this.r=+t,this.g=+e,this.b=+r,this.opacity=+a}As(qn,ss,Sd(lo,{brighter(t){return t=t==null?Ho:Math.pow(Ho,t),new qn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ja:Math.pow(ja,t),new qn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new qn(Fr(this.r),Fr(this.g),Fr(this.b),Fo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Il,formatHex:Il,formatHex8:O2,formatRgb:Ol,toString:Ol}));function Il(){return`#${Vr(this.r)}${Vr(this.g)}${Vr(this.b)}`}function O2(){return`#${Vr(this.r)}${Vr(this.g)}${Vr(this.b)}${Vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ol(){const t=Fo(this.opacity);return`${t===1?"rgb(":"rgba("}${Fr(this.r)}, ${Fr(this.g)}, ${Fr(this.b)}${t===1?")":`, ${t})`}`}function Fo(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Vr(t){return t=Fr(t),(t<16?"0":"")+t.toString(16)}function Rl(t,e,r,a){return a<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new or(t,e,r,a)}function Cd(t){if(t instanceof or)return new or(t.h,t.s,t.l,t.opacity);if(t instanceof lo||(t=qr(t)),!t)return new or;if(t instanceof or)return t;t=t.rgb();var e=t.r/255,r=t.g/255,a=t.b/255,o=Math.min(e,r,a),s=Math.max(e,r,a),i=NaN,d=s-o,f=(s+o)/2;return d?(e===s?i=(r-a)/d+(r<a)*6:r===s?i=(a-e)/d+2:i=(e-r)/d+4,d/=f<.5?s+o:2-s-o,i*=60):d=f>0&&f<1?0:i,new or(i,d,f,t.opacity)}function R2(t,e,r,a){return arguments.length===1?Cd(t):new or(t,e,r,a??1)}function or(t,e,r,a){this.h=+t,this.s=+e,this.l=+r,this.opacity=+a}As(or,R2,Sd(lo,{brighter(t){return t=t==null?Ho:Math.pow(Ho,t),new or(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ja:Math.pow(ja,t),new or(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,r=this.l,a=r+(r<.5?r:1-r)*e,o=2*r-a;return new qn(Ti(t>=240?t-240:t+120,o,a),Ti(t,o,a),Ti(t<120?t+240:t-120,o,a),this.opacity)},clamp(){return new or($l(this.h),mo(this.s),mo(this.l),Fo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Fo(this.opacity);return`${t===1?"hsl(":"hsla("}${$l(this.h)}, ${mo(this.s)*100}%, ${mo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function $l(t){return t=(t||0)%360,t<0?t+360:t}function mo(t){return Math.max(0,Math.min(1,t||0))}function Ti(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Ps=t=>()=>t;function $2(t,e){return function(r){return t+r*e}}function D2(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(a){return Math.pow(t+a*e,r)}}function V2(t){return(t=+t)==1?Ed:function(e,r){return r-e?D2(e,r,t):Ps(isNaN(e)?r:e)}}function Ed(t,e){var r=e-t;return r?$2(t,r):Ps(isNaN(t)?e:t)}const qo=(function t(e){var r=V2(e);function a(o,s){var i=r((o=ss(o)).r,(s=ss(s)).r),d=r(o.g,s.g),f=r(o.b,s.b),g=Ed(o.opacity,s.opacity);return function(p){return o.r=i(p),o.g=d(p),o.b=f(p),o.opacity=g(p),o+""}}return a.gamma=t,a})(1);function H2(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,a=e.slice(),o;return function(s){for(o=0;o<r;++o)a[o]=t[o]*(1-s)+e[o]*s;return a}}function F2(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function q2(t,e){var r=e?e.length:0,a=t?Math.min(r,t.length):0,o=new Array(a),s=new Array(r),i;for(i=0;i<a;++i)o[i]=Oa(t[i],e[i]);for(;i<r;++i)s[i]=e[i];return function(d){for(i=0;i<a;++i)s[i]=o[i](d);return s}}function K2(t,e){var r=new Date;return t=+t,e=+e,function(a){return r.setTime(t*(1-a)+e*a),r}}function ur(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function j2(t,e){var r={},a={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?r[o]=Oa(t[o],e[o]):a[o]=e[o];return function(s){for(o in r)a[o]=r[o](s);return a}}var ls=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zi=new RegExp(ls.source,"g");function B2(t){return function(){return t}}function W2(t){return function(e){return t(e)+""}}function Nd(t,e){var r=ls.lastIndex=zi.lastIndex=0,a,o,s,i=-1,d=[],f=[];for(t=t+"",e=e+"";(a=ls.exec(t))&&(o=zi.exec(e));)(s=o.index)>r&&(s=e.slice(r,s),d[i]?d[i]+=s:d[++i]=s),(a=a[0])===(o=o[0])?d[i]?d[i]+=o:d[++i]=o:(d[++i]=null,f.push({i,x:ur(a,o)})),r=zi.lastIndex;return r<e.length&&(s=e.slice(r),d[i]?d[i]+=s:d[++i]=s),d.length<2?f[0]?W2(f[0].x):B2(e):(e=f.length,function(g){for(var p=0,b;p<e;++p)d[(b=f[p]).i]=b.x(g);return d.join("")})}function Oa(t,e){var r=typeof e,a;return e==null||r==="boolean"?Ps(e):(r==="number"?ur:r==="string"?(a=qr(e))?(e=a,qo):Nd:e instanceof qr?qo:e instanceof Date?K2:F2(e)?H2:Array.isArray(e)?q2:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?j2:ur)(t,e)}var Dl=180/Math.PI,cs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Md(t,e,r,a,o,s){var i,d,f;return(i=Math.sqrt(t*t+e*e))&&(t/=i,e/=i),(f=t*r+e*a)&&(r-=t*f,a-=e*f),(d=Math.sqrt(r*r+a*a))&&(r/=d,a/=d,f/=d),t*a<e*r&&(t=-t,e=-e,f=-f,i=-i),{translateX:o,translateY:s,rotate:Math.atan2(e,t)*Dl,skewX:Math.atan(f)*Dl,scaleX:i,scaleY:d}}var _o;function U2(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?cs:Md(e.a,e.b,e.c,e.d,e.e,e.f)}function G2(t){return t==null||(_o||(_o=document.createElementNS("http://www.w3.org/2000/svg","g")),_o.setAttribute("transform",t),!(t=_o.transform.baseVal.consolidate()))?cs:(t=t.matrix,Md(t.a,t.b,t.c,t.d,t.e,t.f))}function Td(t,e,r,a){function o(g){return g.length?g.pop()+" ":""}function s(g,p,b,h,w,S){if(g!==b||p!==h){var A=w.push("translate(",null,e,null,r);S.push({i:A-4,x:ur(g,b)},{i:A-2,x:ur(p,h)})}else(b||h)&&w.push("translate("+b+e+h+r)}function i(g,p,b,h){g!==p?(g-p>180?p+=360:p-g>180&&(g+=360),h.push({i:b.push(o(b)+"rotate(",null,a)-2,x:ur(g,p)})):p&&b.push(o(b)+"rotate("+p+a)}function d(g,p,b,h){g!==p?h.push({i:b.push(o(b)+"skewX(",null,a)-2,x:ur(g,p)}):p&&b.push(o(b)+"skewX("+p+a)}function f(g,p,b,h,w,S){if(g!==b||p!==h){var A=w.push(o(w)+"scale(",null,",",null,")");S.push({i:A-4,x:ur(g,b)},{i:A-2,x:ur(p,h)})}else(b!==1||h!==1)&&w.push(o(w)+"scale("+b+","+h+")")}return function(g,p){var b=[],h=[];return g=t(g),p=t(p),s(g.translateX,g.translateY,p.translateX,p.translateY,b,h),i(g.rotate,p.rotate,b,h),d(g.skewX,p.skewX,b,h),f(g.scaleX,g.scaleY,p.scaleX,p.scaleY,b,h),g=p=null,function(w){for(var S=-1,A=h.length,D;++S<A;)b[(D=h[S]).i]=D.x(w);return b.join("")}}}var Y2=Td(U2,"px, ","px)","deg)"),X2=Td(G2,", ",")",")"),Z2=1e-12;function Vl(t){return((t=Math.exp(t))+1/t)/2}function Q2(t){return((t=Math.exp(t))-1/t)/2}function J2(t){return((t=Math.exp(2*t))-1)/(t+1)}const Lo=(function t(e,r,a){function o(s,i){var d=s[0],f=s[1],g=s[2],p=i[0],b=i[1],h=i[2],w=p-d,S=b-f,A=w*w+S*S,D,W;if(A<Z2)W=Math.log(h/g)/e,D=function(le){return[d+le*w,f+le*S,g*Math.exp(e*le*W)]};else{var C=Math.sqrt(A),G=(h*h-g*g+a*A)/(2*g*r*C),X=(h*h-g*g-a*A)/(2*h*r*C),I=Math.log(Math.sqrt(G*G+1)-G),te=Math.log(Math.sqrt(X*X+1)-X);W=(te-I)/e,D=function(le){var oe=le*W,ee=Vl(I),ve=g/(r*C)*(ee*J2(e*oe+I)-Q2(I));return[d+ve*w,f+ve*S,g*ee/Vl(e*oe+I)]}}return D.duration=W*1e3*e/Math.SQRT2,D}return o.rho=function(s){var i=Math.max(.001,+s),d=i*i,f=d*d;return t(i,d,f)},o})(Math.SQRT2,2,4);var pa=0,Ta=0,Ca=0,zd=1e3,Ko,za,jo=0,Kr=0,ii=0,Wa=typeof performance=="object"&&performance.now?performance:Date,Ad=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ls(){return Kr||(Ad(ey),Kr=Wa.now()+ii)}function ey(){Kr=0}function Bo(){this._call=this._time=this._next=null}Bo.prototype=Pd.prototype={constructor:Bo,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?Ls():+r)+(e==null?0:+e),!this._next&&za!==this&&(za?za._next=this:Ko=this,za=this),this._call=t,this._time=r,ds()},stop:function(){this._call&&(this._call=null,this._time=1/0,ds())}};function Pd(t,e,r){var a=new Bo;return a.restart(t,e,r),a}function ty(){Ls(),++pa;for(var t=Ko,e;t;)(e=Kr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--pa}function Hl(){Kr=(jo=Wa.now())+ii,pa=Ta=0;try{ty()}finally{pa=0,ry(),Kr=0}}function ny(){var t=Wa.now(),e=t-jo;e>zd&&(ii-=e,jo=t)}function ry(){for(var t,e=Ko,r,a=1/0;e;)e._call?(a>e._time&&(a=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Ko=r);za=t,ds(a)}function ds(t){if(!pa){Ta&&(Ta=clearTimeout(Ta));var e=t-Kr;e>24?(t<1/0&&(Ta=setTimeout(Hl,t-Wa.now()-ii)),Ca&&(Ca=clearInterval(Ca))):(Ca||(jo=Wa.now(),Ca=setInterval(ny,zd)),pa=1,Ad(Hl))}}function Fl(t,e,r){var a=new Bo;return e=e==null?0:+e,a.restart(o=>{a.stop(),t(o+e)},e,r),a}var ay=ai("start","end","cancel","interrupt"),oy=[],Ld=0,ql=1,us=2,Io=3,Kl=4,fs=5,Oo=6;function si(t,e,r,a,o,s){var i=t.__transition;if(!i)t.__transition={};else if(r in i)return;iy(t,r,{name:e,index:a,group:o,on:ay,tween:oy,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Ld})}function Is(t,e){var r=cr(t,e);if(r.state>Ld)throw new Error("too late; already scheduled");return r}function pr(t,e){var r=cr(t,e);if(r.state>Io)throw new Error("too late; already running");return r}function cr(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function iy(t,e,r){var a=t.__transition,o;a[e]=r,r.timer=Pd(s,0,r.time);function s(g){r.state=ql,r.timer.restart(i,r.delay,r.time),r.delay<=g&&i(g-r.delay)}function i(g){var p,b,h,w;if(r.state!==ql)return f();for(p in a)if(w=a[p],w.name===r.name){if(w.state===Io)return Fl(i);w.state===Kl?(w.state=Oo,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete a[p]):+p<e&&(w.state=Oo,w.timer.stop(),w.on.call("cancel",t,t.__data__,w.index,w.group),delete a[p])}if(Fl(function(){r.state===Io&&(r.state=Kl,r.timer.restart(d,r.delay,r.time),d(g))}),r.state=us,r.on.call("start",t,t.__data__,r.index,r.group),r.state===us){for(r.state=Io,o=new Array(h=r.tween.length),p=0,b=-1;p<h;++p)(w=r.tween[p].value.call(t,t.__data__,r.index,r.group))&&(o[++b]=w);o.length=b+1}}function d(g){for(var p=g<r.duration?r.ease.call(null,g/r.duration):(r.timer.restart(f),r.state=fs,1),b=-1,h=o.length;++b<h;)o[b].call(t,p);r.state===fs&&(r.on.call("end",t,t.__data__,r.index,r.group),f())}function f(){r.state=Oo,r.timer.stop(),delete a[e];for(var g in a)return;delete t.__transition}}function Ro(t,e){var r=t.__transition,a,o,s=!0,i;if(r){e=e==null?null:e+"";for(i in r){if((a=r[i]).name!==e){s=!1;continue}o=a.state>us&&a.state<fs,a.state=Oo,a.timer.stop(),a.on.call(o?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete r[i]}s&&delete t.__transition}}function sy(t){return this.each(function(){Ro(this,t)})}function ly(t,e){var r,a;return function(){var o=pr(this,t),s=o.tween;if(s!==r){a=r=s;for(var i=0,d=a.length;i<d;++i)if(a[i].name===e){a=a.slice(),a.splice(i,1);break}}o.tween=a}}function cy(t,e,r){var a,o;if(typeof r!="function")throw new Error;return function(){var s=pr(this,t),i=s.tween;if(i!==a){o=(a=i).slice();for(var d={name:e,value:r},f=0,g=o.length;f<g;++f)if(o[f].name===e){o[f]=d;break}f===g&&o.push(d)}s.tween=o}}function dy(t,e){var r=this._id;if(t+="",arguments.length<2){for(var a=cr(this.node(),r).tween,o=0,s=a.length,i;o<s;++o)if((i=a[o]).name===t)return i.value;return null}return this.each((e==null?ly:cy)(r,t,e))}function Os(t,e,r){var a=t._id;return t.each(function(){var o=pr(this,a);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return cr(o,a).value[e]}}function Id(t,e){var r;return(typeof e=="number"?ur:e instanceof qr?qo:(r=qr(e))?(e=r,qo):Nd)(t,e)}function uy(t){return function(){this.removeAttribute(t)}}function fy(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vy(t,e,r){var a,o=r+"",s;return function(){var i=this.getAttribute(t);return i===o?null:i===a?s:s=e(a=i,r)}}function gy(t,e,r){var a,o=r+"",s;return function(){var i=this.getAttributeNS(t.space,t.local);return i===o?null:i===a?s:s=e(a=i,r)}}function py(t,e,r){var a,o,s;return function(){var i,d=r(this),f;return d==null?void this.removeAttribute(t):(i=this.getAttribute(t),f=d+"",i===f?null:i===a&&f===o?s:(o=f,s=e(a=i,d)))}}function hy(t,e,r){var a,o,s;return function(){var i,d=r(this),f;return d==null?void this.removeAttributeNS(t.space,t.local):(i=this.getAttributeNS(t.space,t.local),f=d+"",i===f?null:i===a&&f===o?s:(o=f,s=e(a=i,d)))}}function by(t,e){var r=oi(t),a=r==="transform"?X2:Id;return this.attrTween(t,typeof e=="function"?(r.local?hy:py)(r,a,Os(this,"attr."+t,e)):e==null?(r.local?fy:uy)(r):(r.local?gy:vy)(r,a,e))}function xy(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function my(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function _y(t,e){var r,a;function o(){var s=e.apply(this,arguments);return s!==a&&(r=(a=s)&&my(t,s)),r}return o._value=e,o}function yy(t,e){var r,a;function o(){var s=e.apply(this,arguments);return s!==a&&(r=(a=s)&&xy(t,s)),r}return o._value=e,o}function wy(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var a=oi(t);return this.tween(r,(a.local?_y:yy)(a,e))}function ky(t,e){return function(){Is(this,t).delay=+e.apply(this,arguments)}}function Sy(t,e){return e=+e,function(){Is(this,t).delay=e}}function Cy(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ky:Sy)(e,t)):cr(this.node(),e).delay}function Ey(t,e){return function(){pr(this,t).duration=+e.apply(this,arguments)}}function Ny(t,e){return e=+e,function(){pr(this,t).duration=e}}function My(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ey:Ny)(e,t)):cr(this.node(),e).duration}function Ty(t,e){if(typeof e!="function")throw new Error;return function(){pr(this,t).ease=e}}function zy(t){var e=this._id;return arguments.length?this.each(Ty(e,t)):cr(this.node(),e).ease}function Ay(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;pr(this,t).ease=r}}function Py(t){if(typeof t!="function")throw new Error;return this.each(Ay(this._id,t))}function Ly(t){typeof t!="function"&&(t=fd(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var s=e[o],i=s.length,d=a[o]=[],f,g=0;g<i;++g)(f=s[g])&&t.call(f,f.__data__,g,s)&&d.push(f);return new Cr(a,this._parents,this._name,this._id)}function Iy(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,a=e.length,o=r.length,s=Math.min(a,o),i=new Array(a),d=0;d<s;++d)for(var f=e[d],g=r[d],p=f.length,b=i[d]=new Array(p),h,w=0;w<p;++w)(h=f[w]||g[w])&&(b[w]=h);for(;d<a;++d)i[d]=e[d];return new Cr(i,this._parents,this._name,this._id)}function Oy(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function Ry(t,e,r){var a,o,s=Oy(e)?Is:pr;return function(){var i=s(this,t),d=i.on;d!==a&&(o=(a=d).copy()).on(e,r),i.on=o}}function $y(t,e){var r=this._id;return arguments.length<2?cr(this.node(),r).on.on(t):this.each(Ry(r,t,e))}function Dy(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Vy(){return this.on("end.remove",Dy(this._id))}function Hy(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Ts(t));for(var a=this._groups,o=a.length,s=new Array(o),i=0;i<o;++i)for(var d=a[i],f=d.length,g=s[i]=new Array(f),p,b,h=0;h<f;++h)(p=d[h])&&(b=t.call(p,p.__data__,h,d))&&("__data__"in p&&(b.__data__=p.__data__),g[h]=b,si(g[h],e,r,h,g,cr(p,r)));return new Cr(s,this._parents,e,r)}function Fy(t){var e=this._name,r=this._id;typeof t!="function"&&(t=ud(t));for(var a=this._groups,o=a.length,s=[],i=[],d=0;d<o;++d)for(var f=a[d],g=f.length,p,b=0;b<g;++b)if(p=f[b]){for(var h=t.call(p,p.__data__,b,f),w,S=cr(p,r),A=0,D=h.length;A<D;++A)(w=h[A])&&si(w,e,r,A,h,S);s.push(h),i.push(p)}return new Cr(s,i,e,r)}var qy=so.prototype.constructor;function Ky(){return new qy(this._groups,this._parents)}function jy(t,e){var r,a,o;return function(){var s=ga(this,t),i=(this.style.removeProperty(t),ga(this,t));return s===i?null:s===r&&i===a?o:o=e(r=s,a=i)}}function Od(t){return function(){this.style.removeProperty(t)}}function By(t,e,r){var a,o=r+"",s;return function(){var i=ga(this,t);return i===o?null:i===a?s:s=e(a=i,r)}}function Wy(t,e,r){var a,o,s;return function(){var i=ga(this,t),d=r(this),f=d+"";return d==null&&(f=d=(this.style.removeProperty(t),ga(this,t))),i===f?null:i===a&&f===o?s:(o=f,s=e(a=i,d))}}function Uy(t,e){var r,a,o,s="style."+e,i="end."+s,d;return function(){var f=pr(this,t),g=f.on,p=f.value[s]==null?d||(d=Od(e)):void 0;(g!==r||o!==p)&&(a=(r=g).copy()).on(i,o=p),f.on=a}}function Gy(t,e,r){var a=(t+="")=="transform"?Y2:Id;return e==null?this.styleTween(t,jy(t,a)).on("end.style."+t,Od(t)):typeof e=="function"?this.styleTween(t,Wy(t,a,Os(this,"style."+t,e))).each(Uy(this._id,t)):this.styleTween(t,By(t,a,e),r).on("end.style."+t,null)}function Yy(t,e,r){return function(a){this.style.setProperty(t,e.call(this,a),r)}}function Xy(t,e,r){var a,o;function s(){var i=e.apply(this,arguments);return i!==o&&(a=(o=i)&&Yy(t,i,r)),a}return s._value=e,s}function Zy(t,e,r){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(e==null)return this.tween(a,null);if(typeof e!="function")throw new Error;return this.tween(a,Xy(t,e,r??""))}function Qy(t){return function(){this.textContent=t}}function Jy(t){return function(){var e=t(this);this.textContent=e??""}}function ew(t){return this.tween("text",typeof t=="function"?Jy(Os(this,"text",t)):Qy(t==null?"":t+""))}function tw(t){return function(e){this.textContent=t.call(this,e)}}function nw(t){var e,r;function a(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&tw(o)),e}return a._value=t,a}function rw(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,nw(t))}function aw(){for(var t=this._name,e=this._id,r=Rd(),a=this._groups,o=a.length,s=0;s<o;++s)for(var i=a[s],d=i.length,f,g=0;g<d;++g)if(f=i[g]){var p=cr(f,e);si(f,t,r,g,i,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Cr(a,this._parents,t,r)}function ow(){var t,e,r=this,a=r._id,o=r.size();return new Promise(function(s,i){var d={value:i},f={value:function(){--o===0&&s()}};r.each(function(){var g=pr(this,a),p=g.on;p!==t&&(e=(t=p).copy(),e._.cancel.push(d),e._.interrupt.push(d),e._.end.push(f)),g.on=e}),o===0&&s()})}var iw=0;function Cr(t,e,r,a){this._groups=t,this._parents=e,this._name=r,this._id=a}function Rd(){return++iw}var br=so.prototype;Cr.prototype={constructor:Cr,select:Hy,selectAll:Fy,selectChild:br.selectChild,selectChildren:br.selectChildren,filter:Ly,merge:Iy,selection:Ky,transition:aw,call:br.call,nodes:br.nodes,node:br.node,size:br.size,empty:br.empty,each:br.each,on:$y,attr:by,attrTween:wy,style:Gy,styleTween:Zy,text:ew,textTween:rw,remove:Vy,tween:dy,delay:Cy,duration:My,ease:zy,easeVarying:Py,end:ow,[Symbol.iterator]:br[Symbol.iterator]};function sw(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var lw={time:null,delay:0,duration:250,ease:sw};function cw(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function dw(t){var e,r;t instanceof Cr?(e=t._id,t=t._name):(e=Rd(),(r=lw).time=Ls(),t=t==null?null:t+"");for(var a=this._groups,o=a.length,s=0;s<o;++s)for(var i=a[s],d=i.length,f,g=0;g<d;++g)(f=i[g])&&si(f,t,e,g,i,r||cw(f,e));return new Cr(a,this._parents,t,e)}so.prototype.interrupt=sy;so.prototype.transition=dw;const yo=t=>()=>t;function uw(t,{sourceEvent:e,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function yr(t,e,r){this.k=t,this.x=e,this.y=r}yr.prototype={constructor:yr,scale:function(t){return t===1?this:new yr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new yr(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 li=new yr(1,0,0);$d.prototype=yr.prototype;function $d(t){for(;!t.__zoom;)if(!(t=t.parentNode))return li;return t.__zoom}function Ai(t){t.stopImmediatePropagation()}function Ea(t){t.preventDefault(),t.stopImmediatePropagation()}function fw(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function vw(){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 jl(){return this.__zoom||li}function gw(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function pw(){return navigator.maxTouchPoints||"ontouchstart"in this}function hw(t,e,r){var a=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],s=t.invertY(e[0][1])-r[0][1],i=t.invertY(e[1][1])-r[1][1];return t.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function bw(){var t=fw,e=vw,r=hw,a=gw,o=pw,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],d=250,f=Lo,g=ai("start","zoom","end"),p,b,h,w=500,S=150,A=0,D=10;function W(m){m.property("__zoom",jl).on("wheel.zoom",oe,{passive:!1}).on("mousedown.zoom",ee).on("dblclick.zoom",ve).filter(o).on("touchstart.zoom",Q).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}W.transform=function(m,N,P,B){var $=m.selection?m.selection():m;$.property("__zoom",jl),m!==$?I(m,N,P,B):$.interrupt().each(function(){te(this,arguments).event(B).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},W.scaleBy=function(m,N,P,B){W.scaleTo(m,function(){var $=this.__zoom.k,R=typeof N=="function"?N.apply(this,arguments):N;return $*R},P,B)},W.scaleTo=function(m,N,P,B){W.transform(m,function(){var $=e.apply(this,arguments),R=this.__zoom,H=P==null?X($):typeof P=="function"?P.apply(this,arguments):P,V=R.invert(H),j=typeof N=="function"?N.apply(this,arguments):N;return r(G(C(R,j),H,V),$,i)},P,B)},W.translateBy=function(m,N,P,B){W.transform(m,function(){return r(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof P=="function"?P.apply(this,arguments):P),e.apply(this,arguments),i)},null,B)},W.translateTo=function(m,N,P,B,$){W.transform(m,function(){var R=e.apply(this,arguments),H=this.__zoom,V=B==null?X(R):typeof B=="function"?B.apply(this,arguments):B;return r(li.translate(V[0],V[1]).scale(H.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof P=="function"?-P.apply(this,arguments):-P),R,i)},B,$)};function C(m,N){return N=Math.max(s[0],Math.min(s[1],N)),N===m.k?m:new yr(N,m.x,m.y)}function G(m,N,P){var B=N[0]-P[0]*m.k,$=N[1]-P[1]*m.k;return B===m.x&&$===m.y?m:new yr(m.k,B,$)}function X(m){return[(+m[0][0]+ +m[1][0])/2,(+m[0][1]+ +m[1][1])/2]}function I(m,N,P,B){m.on("start.zoom",function(){te(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){te(this,arguments).event(B).end()}).tween("zoom",function(){var $=this,R=arguments,H=te($,R).event(B),V=e.apply($,R),j=P==null?X(V):typeof P=="function"?P.apply($,R):P,F=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),ae=$.__zoom,be=typeof N=="function"?N.apply($,R):N,se=f(ae.invert(j).concat(F/ae.k),be.invert(j).concat(F/be.k));return function(J){if(J===1)J=be;else{var Y=se(J),Z=F/Y[2];J=new yr(Z,j[0]-Y[0]*Z,j[1]-Y[1]*Z)}H.zoom(null,J)}})}function te(m,N,P){return!P&&m.__zooming||new le(m,N)}function le(m,N){this.that=m,this.args=N,this.active=0,this.sourceEvent=null,this.extent=e.apply(m,N),this.taps=0}le.prototype={event:function(m){return m&&(this.sourceEvent=m),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(m,N){return this.mouse&&m!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var N=ar(this.that).datum();g.call(m,this.that,new uw(m,{sourceEvent:this.sourceEvent,target:W,transform:this.that.__zoom,dispatch:g}),N)}};function oe(m,...N){if(!t.apply(this,arguments))return;var P=te(this,N).event(m),B=this.__zoom,$=Math.max(s[0],Math.min(s[1],B.k*Math.pow(2,a.apply(this,arguments)))),R=dr(m);if(P.wheel)(P.mouse[0][0]!==R[0]||P.mouse[0][1]!==R[1])&&(P.mouse[1]=B.invert(P.mouse[0]=R)),clearTimeout(P.wheel);else{if(B.k===$)return;P.mouse=[R,B.invert(R)],Ro(this),P.start()}Ea(m),P.wheel=setTimeout(H,S),P.zoom("mouse",r(G(C(B,$),P.mouse[0],P.mouse[1]),P.extent,i));function H(){P.wheel=null,P.end()}}function ee(m,...N){if(h||!t.apply(this,arguments))return;var P=m.currentTarget,B=te(this,N,!0).event(m),$=ar(m.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",F,!0),R=dr(m,P),H=m.clientX,V=m.clientY;wd(m.view),Ai(m),B.mouse=[R,this.__zoom.invert(R)],Ro(this),B.start();function j(ae){if(Ea(ae),!B.moved){var be=ae.clientX-H,se=ae.clientY-V;B.moved=be*be+se*se>A}B.event(ae).zoom("mouse",r(G(B.that.__zoom,B.mouse[0]=dr(ae,P),B.mouse[1]),B.extent,i))}function F(ae){$.on("mousemove.zoom mouseup.zoom",null),kd(ae.view,B.moved),Ea(ae),B.event(ae).end()}}function ve(m,...N){if(t.apply(this,arguments)){var P=this.__zoom,B=dr(m.changedTouches?m.changedTouches[0]:m,this),$=P.invert(B),R=P.k*(m.shiftKey?.5:2),H=r(G(C(P,R),B,$),e.apply(this,N),i);Ea(m),d>0?ar(this).transition().duration(d).call(I,H,B,m):ar(this).call(W.transform,H,B,m)}}function Q(m,...N){if(t.apply(this,arguments)){var P=m.touches,B=P.length,$=te(this,N,m.changedTouches.length===B).event(m),R,H,V,j;for(Ai(m),H=0;H<B;++H)V=P[H],j=dr(V,this),j=[j,this.__zoom.invert(j),V.identifier],$.touch0?!$.touch1&&$.touch0[2]!==j[2]&&($.touch1=j,$.taps=0):($.touch0=j,R=!0,$.taps=1+!!p);p&&(p=clearTimeout(p)),R&&($.taps<2&&(b=j[0],p=setTimeout(function(){p=null},w)),Ro(this),$.start())}}function E(m,...N){if(this.__zooming){var P=te(this,N).event(m),B=m.changedTouches,$=B.length,R,H,V,j;for(Ea(m),R=0;R<$;++R)H=B[R],V=dr(H,this),P.touch0&&P.touch0[2]===H.identifier?P.touch0[0]=V:P.touch1&&P.touch1[2]===H.identifier&&(P.touch1[0]=V);if(H=P.that.__zoom,P.touch1){var F=P.touch0[0],ae=P.touch0[1],be=P.touch1[0],se=P.touch1[1],J=(J=be[0]-F[0])*J+(J=be[1]-F[1])*J,Y=(Y=se[0]-ae[0])*Y+(Y=se[1]-ae[1])*Y;H=C(H,Math.sqrt(J/Y)),V=[(F[0]+be[0])/2,(F[1]+be[1])/2],j=[(ae[0]+se[0])/2,(ae[1]+se[1])/2]}else if(P.touch0)V=P.touch0[0],j=P.touch0[1];else return;P.zoom("touch",r(G(H,V,j),P.extent,i))}}function M(m,...N){if(this.__zooming){var P=te(this,N).event(m),B=m.changedTouches,$=B.length,R,H;for(Ai(m),h&&clearTimeout(h),h=setTimeout(function(){h=null},w),R=0;R<$;++R)H=B[R],P.touch0&&P.touch0[2]===H.identifier?delete P.touch0:P.touch1&&P.touch1[2]===H.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(H=dr(H,this),Math.hypot(b[0]-H[0],b[1]-H[1])<D)){var V=ar(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return W.wheelDelta=function(m){return arguments.length?(a=typeof m=="function"?m:yo(+m),W):a},W.filter=function(m){return arguments.length?(t=typeof m=="function"?m:yo(!!m),W):t},W.touchable=function(m){return arguments.length?(o=typeof m=="function"?m:yo(!!m),W):o},W.extent=function(m){return arguments.length?(e=typeof m=="function"?m:yo([[+m[0][0],+m[0][1]],[+m[1][0],+m[1][1]]]),W):e},W.scaleExtent=function(m){return arguments.length?(s[0]=+m[0],s[1]=+m[1],W):[s[0],s[1]]},W.translateExtent=function(m){return arguments.length?(i[0][0]=+m[0][0],i[1][0]=+m[1][0],i[0][1]=+m[0][1],i[1][1]=+m[1][1],W):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},W.constrain=function(m){return arguments.length?(r=m,W):r},W.duration=function(m){return arguments.length?(d=+m,W):d},W.interpolate=function(m){return arguments.length?(f=m,W):f},W.on=function(){var m=g.on.apply(g,arguments);return m===g?W:m},W.clickDistance=function(m){return arguments.length?(A=(m=+m)*m,W):Math.sqrt(A)},W.tapDistance=function(m){return arguments.length?(D=+m,W):D},W}const Ua={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:r,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?r:a}", 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."},vs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Dd=["Enter"," ","Escape"],xw={"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:r})=>`Moved selected node ${t}. New position, x: ${e}, y: ${r}`,"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 ha;(function(t){t.Strict="strict",t.Loose="loose"})(ha||(ha={}));var da;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(da||(da={}));var Wo;(function(t){t.Partial="partial",t.Full="full"})(Wo||(Wo={}));const gs={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Nr;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Nr||(Nr={}));var Uo;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Uo||(Uo={}));var zt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(zt||(zt={}));const Bl={[zt.Left]:zt.Right,[zt.Right]:zt.Left,[zt.Top]:zt.Bottom,[zt.Bottom]:zt.Top};function mw(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 r of t.keys())if(!e.has(r))return!1;return!0}function Wl(t,e,r){if(!r)return;const a=[];t.forEach((o,s)=>{e!=null&&e.has(s)||a.push(o)}),a.length&&r(a)}function _w(t){return t===null?null:t?"valid":"invalid"}const Vd=t=>"id"in t&&"source"in t&&"target"in t,yw=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Rs=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),co=(t,e=[0,0])=>{const{width:r,height:a}=Yr(t),o=t.origin??e,s=r*o[0],i=a*o[1];return{x:t.position.x-s,y:t.position.y-i}},ww=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const r=t.reduce((a,o)=>{const s=typeof o=="string";let i=!e.nodeLookup&&!s?o:void 0;e.nodeLookup&&(i=s?e.nodeLookup.get(o):Rs(o)?o:e.nodeLookup.get(o.id));const d=i?Go(i,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return di(a,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ui(r)},ci=(t,e={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(o=>{(e.filter===void 0||e.filter(o))&&(r=di(r,Go(o)),a=!0)}),a?ui(r):{x:0,y:0,width:0,height:0}},$s=(t,e,[r,a,o]=[0,0,1],s=!1,i=!1)=>{const d={...fo(e,[r,a,o]),width:e.width/o,height:e.height/o},f=[];for(const g of t.values()){const{measured:p,selectable:b=!0,hidden:h=!1}=g;if(i&&!b||h)continue;const w=p.width??g.width??g.initialWidth??null,S=p.height??g.height??g.initialHeight??null,A=Ga(d,xa(g)),D=(w??0)*(S??0),W=s&&A>0;(!g.internals.handleBounds||W||A>=D||g.dragging)&&f.push(g)}return f},kw=(t,e)=>{const r=new Set;return t.forEach(a=>{r.add(a.id)}),e.filter(a=>r.has(a.source)||r.has(a.target))};function Sw(t,e){const r=new Map,a=e!=null&&e.nodes?new Set(e.nodes.map(o=>o.id)):null;return t.forEach(o=>{o.measured.width&&o.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!o.hidden)&&(!a||a.has(o.id))&&r.set(o.id,o)}),r}async function Cw({nodes:t,width:e,height:r,panZoom:a,minZoom:o,maxZoom:s},i){if(t.size===0)return Promise.resolve(!0);const d=Sw(t,i),f=ci(d),g=Ds(f,e,r,(i==null?void 0:i.minZoom)??o,(i==null?void 0:i.maxZoom)??s,(i==null?void 0:i.padding)??.1);return await a.setViewport(g,{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 Hd({nodeId:t,nextPosition:e,nodeLookup:r,nodeOrigin:a=[0,0],nodeExtent:o,onError:s}){const i=r.get(t),d=i.parentId?r.get(i.parentId):void 0,{x:f,y:g}=d?d.internals.positionAbsolute:{x:0,y:0},p=i.origin??a;let b=i.extent||o;if(i.extent==="parent"&&!i.expandParent)if(!d)s==null||s("005",Ua.error005());else{const w=d.measured.width,S=d.measured.height;w&&S&&(b=[[f,g],[f+w,g+S]])}else d&&ma(i.extent)&&(b=[[i.extent[0][0]+f,i.extent[0][1]+g],[i.extent[1][0]+f,i.extent[1][1]+g]]);const h=ma(b)?jr(e,b,i.measured):e;return(i.measured.width===void 0||i.measured.height===void 0)&&(s==null||s("015",Ua.error015())),{position:{x:h.x-f+(i.measured.width??0)*p[0],y:h.y-g+(i.measured.height??0)*p[1]},positionAbsolute:h}}async function Ew({nodesToRemove:t=[],edgesToRemove:e=[],nodes:r,edges:a,onBeforeDelete:o}){const s=new Set(t.map(h=>h.id)),i=[];for(const h of r){if(h.deletable===!1)continue;const w=s.has(h.id),S=!w&&h.parentId&&i.find(A=>A.id===h.parentId);(w||S)&&i.push(h)}const d=new Set(e.map(h=>h.id)),f=a.filter(h=>h.deletable!==!1),p=kw(i,f);for(const h of f)d.has(h.id)&&!p.find(S=>S.id===h.id)&&p.push(h);if(!o)return{edges:p,nodes:i};const b=await o({nodes:i,edges:p});return typeof b=="boolean"?b?{edges:p,nodes:i}:{edges:[],nodes:[]}:b}const ba=(t,e=0,r=1)=>Math.min(Math.max(t,e),r),jr=(t={x:0,y:0},e,r)=>({x:ba(t.x,e[0][0],e[1][0]-((r==null?void 0:r.width)??0)),y:ba(t.y,e[0][1],e[1][1]-((r==null?void 0:r.height)??0))});function Fd(t,e,r){const{width:a,height:o}=Yr(r),{x:s,y:i}=r.internals.positionAbsolute;return jr(t,[[s,i],[s+a,i+o]],e)}const Ul=(t,e,r)=>t<e?ba(Math.abs(t-e),1,e)/e:t>r?-ba(Math.abs(t-r),1,e)/e:0,qd=(t,e,r=15,a=40)=>{const o=Ul(t.x,a,e.width-a)*r,s=Ul(t.y,a,e.height-a)*r;return[o,s]},di=(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)}),ps=({x:t,y:e,width:r,height:a})=>({x:t,y:e,x2:t+r,y2:e+a}),ui=({x:t,y:e,x2:r,y2:a})=>({x:t,y:e,width:r-t,height:a-e}),xa=(t,e=[0,0])=>{var o,s;const{x:r,y:a}=Rs(t)?t.internals.positionAbsolute:co(t,e);return{x:r,y:a,width:((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},Go=(t,e=[0,0])=>{var o,s;const{x:r,y:a}=Rs(t)?t.internals.positionAbsolute:co(t,e);return{x:r,y:a,x2:r+(((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0),y2:a+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},Nw=(t,e)=>ui(di(ps(t),ps(e))),Ga=(t,e)=>{const r=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),a=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(r*a)},Gl=t=>wr(t.width)&&wr(t.height)&&wr(t.x)&&wr(t.y),wr=t=>!isNaN(t)&&isFinite(t),Mw=(t,e)=>{},uo=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),fo=({x:t,y:e},[r,a,o],s=!1,i=[1,1])=>{const d={x:(t-r)/o,y:(e-a)/o};return s?uo(d,i):d},Yo=({x:t,y:e},[r,a,o])=>({x:t*o+r,y:e*o+a});function ta(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const r=parseFloat(t);if(!Number.isNaN(r))return Math.floor(r)}if(typeof t=="string"&&t.endsWith("%")){const r=parseFloat(t);if(!Number.isNaN(r))return Math.floor(e*r*.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 Tw(t,e,r){if(typeof t=="string"||typeof t=="number"){const a=ta(t,r),o=ta(t,e);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof t=="object"){const a=ta(t.top??t.y??0,r),o=ta(t.bottom??t.y??0,r),s=ta(t.left??t.x??0,e),i=ta(t.right??t.x??0,e);return{top:a,right:i,bottom:o,left:s,x:s+i,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zw(t,e,r,a,o,s){const{x:i,y:d}=Yo(t,[e,r,a]),{x:f,y:g}=Yo({x:t.x+t.width,y:t.y+t.height},[e,r,a]),p=o-f,b=s-g;return{left:Math.floor(i),top:Math.floor(d),right:Math.floor(p),bottom:Math.floor(b)}}const Ds=(t,e,r,a,o,s)=>{const i=Tw(s,e,r),d=(e-i.x)/t.width,f=(r-i.y)/t.height,g=Math.min(d,f),p=ba(g,a,o),b=t.x+t.width/2,h=t.y+t.height/2,w=e/2-b*p,S=r/2-h*p,A=zw(t,w,S,p,e,r),D={left:Math.min(A.left-i.left,0),top:Math.min(A.top-i.top,0),right:Math.min(A.right-i.right,0),bottom:Math.min(A.bottom-i.bottom,0)};return{x:w-D.left+D.right,y:S-D.top+D.bottom,zoom:p}},Xo=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function ma(t){return t!=null&&t!=="parent"}function Yr(t){var e,r;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((r=t.measured)==null?void 0:r.height)??t.height??t.initialHeight??0}}function Aw(t){var e,r;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((r=t.measured)==null?void 0:r.height)??t.height??t.initialHeight)!==void 0}function Pw(t,e={width:0,height:0},r,a,o){const s={...t},i=a.get(r);if(i){const d=i.origin||o;s.x+=i.internals.positionAbsolute.x-(e.width??0)*d[0],s.y+=i.internals.positionAbsolute.y-(e.height??0)*d[1]}return s}function Lw(t){return{...xw,...t||{}}}function Pi(t,{snapGrid:e=[0,0],snapToGrid:r=!1,transform:a,containerBounds:o}){const{x:s,y:i}=ir(t),d=fo({x:s-((o==null?void 0:o.left)??0),y:i-((o==null?void 0:o.top)??0)},a),{x:f,y:g}=r?uo(d,e):d;return{xSnapped:f,ySnapped:g,...d}}const Kd=t=>({width:t.offsetWidth,height:t.offsetHeight}),jd=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Iw=["INPUT","SELECT","TEXTAREA"];function Bd(t){var a,o;const e=((o=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:o[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:Iw.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Wd=t=>"clientX"in t,ir=(t,e)=>{var s,i;const r=Wd(t),a=r?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,o=r?t.clientY:(i=t.touches)==null?void 0:i[0].clientY;return{x:a-((e==null?void 0:e.left)??0),y:o-((e==null?void 0:e.top)??0)}},Yl=(t,e,r,a,o)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(i=>{const d=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:t,nodeId:o,position:i.getAttribute("data-handlepos"),x:(d.left-r.left)/a,y:(d.top-r.top)/a,...Kd(i)}})};function Ow({sourceX:t,sourceY:e,targetX:r,targetY:a,sourceControlX:o,sourceControlY:s,targetControlX:i,targetControlY:d}){const f=t*.125+o*.375+i*.375+r*.125,g=e*.125+s*.375+d*.375+a*.125,p=Math.abs(f-t),b=Math.abs(g-e);return[f,g,p,b]}function wo(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function Xl({pos:t,x1:e,y1:r,x2:a,y2:o,c:s}){switch(t){case zt.Left:return[e-wo(e-a,s),r];case zt.Right:return[e+wo(a-e,s),r];case zt.Top:return[e,r-wo(r-o,s)];case zt.Bottom:return[e,r+wo(o-r,s)]}}function Ud({sourceX:t,sourceY:e,sourcePosition:r=zt.Bottom,targetX:a,targetY:o,targetPosition:s=zt.Top,curvature:i=.25}){const[d,f]=Xl({pos:r,x1:t,y1:e,x2:a,y2:o,c:i}),[g,p]=Xl({pos:s,x1:a,y1:o,x2:t,y2:e,c:i}),[b,h,w,S]=Ow({sourceX:t,sourceY:e,targetX:a,targetY:o,sourceControlX:d,sourceControlY:f,targetControlX:g,targetControlY:p});return[`M${t},${e} C${d},${f} ${g},${p} ${a},${o}`,b,h,w,S]}function Gd({sourceX:t,sourceY:e,targetX:r,targetY:a}){const o=Math.abs(r-t)/2,s=r<t?r+o:r-o,i=Math.abs(a-e)/2,d=a<e?a+i:a-i;return[s,d,o,i]}function Rw({sourceNode:t,targetNode:e,selected:r=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return a;const i=o&&r?a+1e3:a,d=Math.max(t.parentId||o&&t.selected?t.internals.z:0,e.parentId||o&&e.selected?e.internals.z:0);return i+d}function $w({sourceNode:t,targetNode:e,width:r,height:a,transform:o}){const s=di(Go(t),Go(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const i={x:-o[0]/o[2],y:-o[1]/o[2],width:r/o[2],height:a/o[2]};return Ga(i,ui(s))>0}const Dw=({source:t,sourceHandle:e,target:r,targetHandle:a})=>`xy-edge__${t}${e||""}-${r}${a||""}`,Vw=(t,e)=>e.some(r=>r.source===t.source&&r.target===t.target&&(r.sourceHandle===t.sourceHandle||!r.sourceHandle&&!t.sourceHandle)&&(r.targetHandle===t.targetHandle||!r.targetHandle&&!t.targetHandle)),Hw=(t,e,r={})=>{if(!t.source||!t.target)return e;const a=r.getEdgeId||Dw;let o;return Vd(t)?o={...t}:o={...t,id:a(t)},Vw(o,e)?e:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,e.concat(o))};function Yd({sourceX:t,sourceY:e,targetX:r,targetY:a}){const[o,s,i,d]=Gd({sourceX:t,sourceY:e,targetX:r,targetY:a});return[`M ${t},${e}L ${r},${a}`,o,s,i,d]}const Zl={[zt.Left]:{x:-1,y:0},[zt.Right]:{x:1,y:0},[zt.Top]:{x:0,y:-1},[zt.Bottom]:{x:0,y:1}},Fw=({source:t,sourcePosition:e=zt.Bottom,target:r})=>e===zt.Left||e===zt.Right?t.x<r.x?{x:1,y:0}:{x:-1,y:0}:t.y<r.y?{x:0,y:1}:{x:0,y:-1},Ql=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function qw({source:t,sourcePosition:e=zt.Bottom,target:r,targetPosition:a=zt.Top,center:o,offset:s,stepPosition:i}){const d=Zl[e],f=Zl[a],g={x:t.x+d.x*s,y:t.y+d.y*s},p={x:r.x+f.x*s,y:r.y+f.y*s},b=Fw({source:g,sourcePosition:e,target:p}),h=b.x!==0?"x":"y",w=b[h];let S=[],A,D;const W={x:0,y:0},C={x:0,y:0},[,,G,X]=Gd({sourceX:t.x,sourceY:t.y,targetX:r.x,targetY:r.y});if(d[h]*f[h]===-1){h==="x"?(A=o.x??g.x+(p.x-g.x)*i,D=o.y??(g.y+p.y)/2):(A=o.x??(g.x+p.x)/2,D=o.y??g.y+(p.y-g.y)*i);const oe=[{x:A,y:g.y},{x:A,y:p.y}],ee=[{x:g.x,y:D},{x:p.x,y:D}];d[h]===w?S=h==="x"?oe:ee:S=h==="x"?ee:oe}else{const oe=[{x:g.x,y:p.y}],ee=[{x:p.x,y:g.y}];if(h==="x"?S=d.x===w?ee:oe:S=d.y===w?oe:ee,e===a){const m=Math.abs(t[h]-r[h]);if(m<=s){const N=Math.min(s-1,s-m);d[h]===w?W[h]=(g[h]>t[h]?-1:1)*N:C[h]=(p[h]>r[h]?-1:1)*N}}if(e!==a){const m=h==="x"?"y":"x",N=d[h]===f[m],P=g[m]>p[m],B=g[m]<p[m];(d[h]===1&&(!N&&P||N&&B)||d[h]!==1&&(!N&&B||N&&P))&&(S=h==="x"?oe:ee)}const ve={x:g.x+W.x,y:g.y+W.y},Q={x:p.x+C.x,y:p.y+C.y},E=Math.max(Math.abs(ve.x-S[0].x),Math.abs(Q.x-S[0].x)),M=Math.max(Math.abs(ve.y-S[0].y),Math.abs(Q.y-S[0].y));E>=M?(A=(ve.x+Q.x)/2,D=S[0].y):(A=S[0].x,D=(ve.y+Q.y)/2)}const I={x:g.x+W.x,y:g.y+W.y},te={x:p.x+C.x,y:p.y+C.y};return[[t,...I.x!==S[0].x||I.y!==S[0].y?[I]:[],...S,...te.x!==S[S.length-1].x||te.y!==S[S.length-1].y?[te]:[],r],A,D,G,X]}function Kw(t,e,r,a){const o=Math.min(Ql(t,e)/2,Ql(e,r)/2,a),{x:s,y:i}=e;if(t.x===s&&s===r.x||t.y===i&&i===r.y)return`L${s} ${i}`;if(t.y===i){const g=t.x<r.x?-1:1,p=t.y<r.y?1:-1;return`L ${s+o*g},${i}Q ${s},${i} ${s},${i+o*p}`}const d=t.x<r.x?1:-1,f=t.y<r.y?-1:1;return`L ${s},${i+o*f}Q ${s},${i} ${s+o*d},${i}`}function Vs({sourceX:t,sourceY:e,sourcePosition:r=zt.Bottom,targetX:a,targetY:o,targetPosition:s=zt.Top,borderRadius:i=5,centerX:d,centerY:f,offset:g=20,stepPosition:p=.5}){const[b,h,w,S,A]=qw({source:{x:t,y:e},sourcePosition:r,target:{x:a,y:o},targetPosition:s,center:{x:d,y:f},offset:g,stepPosition:p});let D=`M${b[0].x} ${b[0].y}`;for(let W=1;W<b.length-1;W++)D+=Kw(b[W-1],b[W],b[W+1],i);return D+=`L${b[b.length-1].x} ${b[b.length-1].y}`,[D,h,w,S,A]}function Jl(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function jw(t){var b;const{sourceNode:e,targetNode:r}=t;if(!Jl(e)||!Jl(r))return null;const a=e.internals.handleBounds||ec(e.handles),o=r.internals.handleBounds||ec(r.handles),s=tc((a==null?void 0:a.source)??[],t.sourceHandle),i=tc(t.connectionMode===ha.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),t.targetHandle);if(!s||!i)return(b=t.onError)==null||b.call(t,"008",Ua.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const d=(s==null?void 0:s.position)||zt.Bottom,f=(i==null?void 0:i.position)||zt.Top,g=Br(e,s,d),p=Br(r,i,f);return{sourceX:g.x,sourceY:g.y,targetX:p.x,targetY:p.y,sourcePosition:d,targetPosition:f}}function ec(t){if(!t)return null;const e=[],r=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?e.push(a):a.type==="target"&&r.push(a);return{source:e,target:r}}function Br(t,e,r=zt.Left,a=!1){const o=((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:d}=e??Yr(t);if(a)return{x:o+i/2,y:s+d/2};switch((e==null?void 0:e.position)??r){case zt.Top:return{x:o+i/2,y:s};case zt.Right:return{x:o+i,y:s+d/2};case zt.Bottom:return{x:o+i/2,y:s+d};case zt.Left:return{x:o,y:s+d/2}}}function tc(t,e){return t&&(e?t.find(r=>r.id===e):t[0])||null}function hs(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function Bw(t,{id:e,defaultColor:r,defaultMarkerStart:a,defaultMarkerEnd:o}){const s=new Set;return t.reduce((i,d)=>([d.markerStart||a,d.markerEnd||o].forEach(f=>{if(f&&typeof f=="object"){const g=hs(f,e);s.has(g)||(i.push({id:g,color:f.color||r,...f}),s.add(g))}}),i),[]).sort((i,d)=>i.id.localeCompare(d.id))}const Xd=1e3,Ww=10,Hs={nodeOrigin:[0,0],nodeExtent:vs,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Uw={...Hs,checkEquality:!0};function Fs(t,e){const r={...t};for(const a in e)e[a]!==void 0&&(r[a]=e[a]);return r}function Gw(t,e,r){const a=Fs(Hs,r);for(const o of t.values())if(o.parentId)Ks(o,t,e,a);else{const s=co(o,a.nodeOrigin),i=ma(o.extent)?o.extent:a.nodeExtent,d=jr(s,i,Yr(o));o.internals.positionAbsolute=d}}function Yw(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const r=[],a=[];for(const o of t.handles){const s={id:o.id,width:o.width??1,height:o.height??1,nodeId:t.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?r.push(s):o.type==="target"&&a.push(s)}return{source:r,target:a}}function qs(t){return t==="manual"}function Xw(t,e,r,a={}){var p,b;const o=Fs(Uw,a),s={i:0},i=new Map(e),d=o!=null&&o.elevateNodesOnSelect&&!qs(o.zIndexMode)?Xd:0;let f=t.length>0,g=!1;e.clear(),r.clear();for(const h of t){let w=i.get(h.id);if(o.checkEquality&&h===(w==null?void 0:w.internals.userNode))e.set(h.id,w);else{const S=co(h,o.nodeOrigin),A=ma(h.extent)?h.extent:o.nodeExtent,D=jr(S,A,Yr(h));w={...o.defaults,...h,measured:{width:(p=h.measured)==null?void 0:p.width,height:(b=h.measured)==null?void 0:b.height},internals:{positionAbsolute:D,handleBounds:Yw(h,w),z:Zd(h,d,o.zIndexMode),userNode:h}},e.set(h.id,w)}(w.measured===void 0||w.measured.width===void 0||w.measured.height===void 0)&&!w.hidden&&(f=!1),h.parentId&&Ks(w,e,r,a,s),g||(g=h.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:g}}function Zw(t,e){if(!t.parentId)return;const r=e.get(t.parentId);r?r.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Ks(t,e,r,a,o){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:d,zIndexMode:f}=Fs(Hs,a),g=t.parentId,p=e.get(g);if(!p){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Zw(t,r),o&&!p.parentId&&p.internals.rootParentIndex===void 0&&f==="auto"&&(p.internals.rootParentIndex=++o.i,p.internals.z=p.internals.z+o.i*Ww),o&&p.internals.rootParentIndex!==void 0&&(o.i=p.internals.rootParentIndex);const b=s&&!qs(f)?Xd:0,{x:h,y:w,z:S}=Qw(t,p,i,d,b,f),{positionAbsolute:A}=t.internals,D=h!==A.x||w!==A.y;(D||S!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:D?{x:h,y:w}:A,z:S}})}function Zd(t,e,r){const a=wr(t.zIndex)?t.zIndex:0;return qs(r)?a:a+(t.selected?e:0)}function Qw(t,e,r,a,o,s){const{x:i,y:d}=e.internals.positionAbsolute,f=Yr(t),g=co(t,r),p=ma(t.extent)?jr(g,t.extent,f):g;let b=jr({x:i+p.x,y:d+p.y},a,f);t.extent==="parent"&&(b=Fd(b,f,e));const h=Zd(t,o,s),w=e.internals.z??0;return{x:b.x,y:b.y,z:w>=h?w+1:h}}function Jw(t,e,r,a=[0,0]){var i;const o=[],s=new Map;for(const d of t){const f=e.get(d.parentId);if(!f)continue;const g=((i=s.get(d.parentId))==null?void 0:i.expandedRect)??xa(f),p=Nw(g,d.rect);s.set(d.parentId,{expandedRect:p,parent:f})}return s.size>0&&s.forEach(({expandedRect:d,parent:f},g)=>{var G;const p=f.internals.positionAbsolute,b=Yr(f),h=f.origin??a,w=d.x<p.x?Math.round(Math.abs(p.x-d.x)):0,S=d.y<p.y?Math.round(Math.abs(p.y-d.y)):0,A=Math.max(b.width,Math.round(d.width)),D=Math.max(b.height,Math.round(d.height)),W=(A-b.width)*h[0],C=(D-b.height)*h[1];(w>0||S>0||W||C)&&(o.push({id:g,type:"position",position:{x:f.position.x-w+W,y:f.position.y-S+C}}),(G=r.get(g))==null||G.forEach(X=>{t.some(I=>I.id===X.id)||o.push({id:X.id,type:"position",position:{x:X.position.x+w,y:X.position.y+S}})})),(b.width<d.width||b.height<d.height||w||S)&&o.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:A+(w?h[0]*w-W:0),height:D+(S?h[1]*S-C:0)}})}),o}function e3(t,e,r,a,o,s,i){const d=a==null?void 0:a.querySelector(".xyflow__viewport");let f=!1;if(!d)return{changes:[],updatedInternals:f};const g=[],p=window.getComputedStyle(d),{m22:b}=new window.DOMMatrixReadOnly(p.transform),h=[];for(const w of t.values()){const S=e.get(w.id);if(!S)continue;if(S.hidden){e.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),f=!0;continue}const A=Kd(w.nodeElement),D=S.measured.width!==A.width||S.measured.height!==A.height;if(!!(A.width&&A.height&&(D||!S.internals.handleBounds||w.force))){const C=w.nodeElement.getBoundingClientRect(),G=ma(S.extent)?S.extent:s;let{positionAbsolute:X}=S.internals;S.parentId&&S.extent==="parent"?X=Fd(X,A,e.get(S.parentId)):G&&(X=jr(X,G,A));const I={...S,measured:A,internals:{...S.internals,positionAbsolute:X,handleBounds:{source:Yl("source",w.nodeElement,C,b,S.id),target:Yl("target",w.nodeElement,C,b,S.id)}}};e.set(S.id,I),S.parentId&&Ks(I,e,r,{nodeOrigin:o,zIndexMode:i}),f=!0,D&&(g.push({id:S.id,type:"dimensions",dimensions:A}),S.expandParent&&S.parentId&&h.push({id:S.id,parentId:S.parentId,rect:xa(I,o)}))}}if(h.length>0){const w=Jw(h,e,r,o);g.push(...w)}return{changes:g,updatedInternals:f}}async function t3({delta:t,panZoom:e,transform:r,translateExtent:a,width:o,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const i=await e.setViewportConstrained({x:r[0]+t.x,y:r[1]+t.y,zoom:r[2]},[[0,0],[o,s]],a),d=!!i&&(i.x!==r[0]||i.y!==r[1]||i.k!==r[2]);return Promise.resolve(d)}function nc(t,e,r,a,o,s){let i=o;const d=a.get(i)||new Map;a.set(i,d.set(r,e)),i=`${o}-${t}`;const f=a.get(i)||new Map;if(a.set(i,f.set(r,e)),s){i=`${o}-${t}-${s}`;const g=a.get(i)||new Map;a.set(i,g.set(r,e))}}function n3(t,e,r){t.clear(),e.clear();for(const a of r){const{source:o,target:s,sourceHandle:i=null,targetHandle:d=null}=a,f={edgeId:a.id,source:o,target:s,sourceHandle:i,targetHandle:d},g=`${o}-${i}--${s}-${d}`,p=`${s}-${d}--${o}-${i}`;nc("source",f,p,t,o,i),nc("target",f,g,t,s,d),e.set(a.id,a)}}function Qd(t,e){if(!t.parentId)return!1;const r=e.get(t.parentId);return r?r.selected?!0:Qd(r,e):!1}function rc(t,e,r){var o;let a=t;do{if((o=a==null?void 0:a.matches)!=null&&o.call(a,e))return!0;if(a===r)return!1;a=a==null?void 0:a.parentElement}while(a);return!1}function r3(t,e,r,a){const o=new Map;for(const[s,i]of t)if((i.selected||i.id===a)&&(!i.parentId||!Qd(i,t))&&(i.draggable||e&&typeof i.draggable>"u")){const d=t.get(s);d&&o.set(s,{id:s,position:d.position||{x:0,y:0},distance:{x:r.x-d.internals.positionAbsolute.x,y:r.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function Li({nodeId:t,dragItems:e,nodeLookup:r,dragging:a=!0}){var i,d,f;const o=[];for(const[g,p]of e){const b=(i=r.get(g))==null?void 0:i.internals.userNode;b&&o.push({...b,position:p.position,dragging:a})}if(!t)return[o[0],o];const s=(d=r.get(t))==null?void 0:d.internals.userNode;return[s?{...s,position:((f=e.get(t))==null?void 0:f.position)||s.position,dragging:a}:o[0],o]}function a3({dragItems:t,snapGrid:e,x:r,y:a}){const o=t.values().next().value;if(!o)return null;const s={x:r-o.distance.x,y:a-o.distance.y},i=uo(s,e);return{x:i.x-s.x,y:i.y-s.y}}function o3({onNodeMouseDown:t,getStoreItems:e,onDragStart:r,onDrag:a,onDragStop:o}){let s={x:null,y:null},i=0,d=new Map,f=!1,g={x:0,y:0},p=null,b=!1,h=null,w=!1,S=!1,A=null;function D({noDragClassName:C,handleSelector:G,domNode:X,isSelectable:I,nodeId:te,nodeClickDistance:le=0}){h=ar(X);function oe({x:E,y:M}){const{nodeLookup:m,nodeExtent:N,snapGrid:P,snapToGrid:B,nodeOrigin:$,onNodeDrag:R,onSelectionDrag:H,onError:V,updateNodePositions:j}=e();s={x:E,y:M};let F=!1;const ae=d.size>1,be=ae&&N?ps(ci(d)):null,se=ae&&B?a3({dragItems:d,snapGrid:P,x:E,y:M}):null;for(const[J,Y]of d){if(!m.has(J))continue;let Z={x:E-Y.distance.x,y:M-Y.distance.y};B&&(Z=se?{x:Math.round(Z.x+se.x),y:Math.round(Z.y+se.y)}:uo(Z,P));let T=null;if(ae&&N&&!Y.extent&&be){const{positionAbsolute:z}=Y.internals,U=z.x-be.x+N[0][0],ne=z.x+Y.measured.width-be.x2+N[1][0],ce=z.y-be.y+N[0][1],xe=z.y+Y.measured.height-be.y2+N[1][1];T=[[U,ce],[ne,xe]]}const{position:q,positionAbsolute:O}=Hd({nodeId:J,nextPosition:Z,nodeLookup:m,nodeExtent:T||N,nodeOrigin:$,onError:V});F=F||Y.position.x!==q.x||Y.position.y!==q.y,Y.position=q,Y.internals.positionAbsolute=O}if(S=S||F,!!F&&(j(d,!0),A&&(a||R||!te&&H))){const[J,Y]=Li({nodeId:te,dragItems:d,nodeLookup:m});a==null||a(A,d,J,Y),R==null||R(A,J,Y),te||H==null||H(A,Y)}}async function ee(){if(!p)return;const{transform:E,panBy:M,autoPanSpeed:m,autoPanOnNodeDrag:N}=e();if(!N){f=!1,cancelAnimationFrame(i);return}const[P,B]=qd(g,p,m);(P!==0||B!==0)&&(s.x=(s.x??0)-P/E[2],s.y=(s.y??0)-B/E[2],await M({x:P,y:B})&&oe(s)),i=requestAnimationFrame(ee)}function ve(E){var ae;const{nodeLookup:M,multiSelectionActive:m,nodesDraggable:N,transform:P,snapGrid:B,snapToGrid:$,selectNodesOnDrag:R,onNodeDragStart:H,onSelectionDragStart:V,unselectNodesAndEdges:j}=e();b=!0,(!R||!I)&&!m&&te&&((ae=M.get(te))!=null&&ae.selected||j()),I&&R&&te&&(t==null||t(te));const F=Pi(E.sourceEvent,{transform:P,snapGrid:B,snapToGrid:$,containerBounds:p});if(s=F,d=r3(M,N,F,te),d.size>0&&(r||H||!te&&V)){const[be,se]=Li({nodeId:te,dragItems:d,nodeLookup:M});r==null||r(E.sourceEvent,d,be,se),H==null||H(E.sourceEvent,be,se),te||V==null||V(E.sourceEvent,se)}}const Q=S2().clickDistance(le).on("start",E=>{const{domNode:M,nodeDragThreshold:m,transform:N,snapGrid:P,snapToGrid:B}=e();p=(M==null?void 0:M.getBoundingClientRect())||null,w=!1,S=!1,A=E.sourceEvent,m===0&&ve(E),s=Pi(E.sourceEvent,{transform:N,snapGrid:P,snapToGrid:B,containerBounds:p}),g=ir(E.sourceEvent,p)}).on("drag",E=>{const{autoPanOnNodeDrag:M,transform:m,snapGrid:N,snapToGrid:P,nodeDragThreshold:B,nodeLookup:$}=e(),R=Pi(E.sourceEvent,{transform:m,snapGrid:N,snapToGrid:P,containerBounds:p});if(A=E.sourceEvent,(E.sourceEvent.type==="touchmove"&&E.sourceEvent.touches.length>1||te&&!$.has(te))&&(w=!0),!w){if(!f&&M&&b&&(f=!0,ee()),!b){const H=ir(E.sourceEvent,p),V=H.x-g.x,j=H.y-g.y;Math.sqrt(V*V+j*j)>B&&ve(E)}(s.x!==R.xSnapped||s.y!==R.ySnapped)&&d&&b&&(g=ir(E.sourceEvent,p),oe(R))}}).on("end",E=>{if(!(!b||w)&&(f=!1,b=!1,cancelAnimationFrame(i),d.size>0)){const{nodeLookup:M,updateNodePositions:m,onNodeDragStop:N,onSelectionDragStop:P}=e();if(S&&(m(d,!1),S=!1),o||N||!te&&P){const[B,$]=Li({nodeId:te,dragItems:d,nodeLookup:M,dragging:!1});o==null||o(E.sourceEvent,d,B,$),N==null||N(E.sourceEvent,B,$),te||P==null||P(E.sourceEvent,$)}}}).filter(E=>{const M=E.target;return!E.button&&(!C||!rc(M,`.${C}`,X))&&(!G||rc(M,G,X))});h.call(Q)}function W(){h==null||h.on(".drag",null)}return{update:D,destroy:W}}function i3(t,e,r){const a=[],o={x:t.x-r,y:t.y-r,width:r*2,height:r*2};for(const s of e.values())Ga(o,xa(s))>0&&a.push(s);return a}const s3=250;function l3(t,e,r,a){var d,f;let o=[],s=1/0;const i=i3(t,r,e+s3);for(const g of i){const p=[...((d=g.internals.handleBounds)==null?void 0:d.source)??[],...((f=g.internals.handleBounds)==null?void 0:f.target)??[]];for(const b of p){if(a.nodeId===b.nodeId&&a.type===b.type&&a.id===b.id)continue;const{x:h,y:w}=Br(g,b,b.position,!0),S=Math.sqrt(Math.pow(h-t.x,2)+Math.pow(w-t.y,2));S>e||(S<s?(o=[{...b,x:h,y:w}],s=S):S===s&&o.push({...b,x:h,y:w}))}}if(!o.length)return null;if(o.length>1){const g=a.type==="source"?"target":"source";return o.find(p=>p.type===g)??o[0]}return o[0]}function Jd(t,e,r,a,o,s=!1){var g,p,b;const i=a.get(t);if(!i)return null;const d=o==="strict"?(g=i.internals.handleBounds)==null?void 0:g[e]:[...((p=i.internals.handleBounds)==null?void 0:p.source)??[],...((b=i.internals.handleBounds)==null?void 0:b.target)??[]],f=(r?d==null?void 0:d.find(h=>h.id===r):d==null?void 0:d[0])??null;return f&&s?{...f,...Br(i,f,f.position,!0)}:f}function eu(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function c3(t,e){let r=null;return e?r=!0:t&&!e&&(r=!1),r}const tu=()=>!0;function d3(t,{connectionMode:e,connectionRadius:r,handleId:a,nodeId:o,edgeUpdaterType:s,isTarget:i,domNode:d,nodeLookup:f,lib:g,autoPanOnConnect:p,flowId:b,panBy:h,cancelConnection:w,onConnectStart:S,onConnect:A,onConnectEnd:D,isValidConnection:W=tu,onReconnectEnd:C,updateConnection:G,getTransform:X,getFromHandle:I,autoPanSpeed:te,dragThreshold:le=1,handleDomNode:oe}){const ee=jd(t.target);let ve=0,Q;const{x:E,y:M}=ir(t),m=eu(s,oe),N=d==null?void 0:d.getBoundingClientRect();let P=!1;if(!N||!m)return;const B=Jd(o,m,a,f,e);if(!B)return;let $=ir(t,N),R=!1,H=null,V=!1,j=null;function F(){if(!p||!N)return;const[q,O]=qd($,N,te);h({x:q,y:O}),ve=requestAnimationFrame(F)}const ae={...B,nodeId:o,type:m,position:B.position},be=f.get(o);let J={inProgress:!0,isValid:null,from:Br(be,ae,zt.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:be,to:$,toHandle:null,toPosition:Bl[ae.position],toNode:null,pointer:$};function Y(){P=!0,G(J),S==null||S(t,{nodeId:o,handleId:a,handleType:m})}le===0&&Y();function Z(q){if(!P){const{x:xe,y:he}=ir(q),me=xe-E,_e=he-M;if(!(me*me+_e*_e>le*le))return;Y()}if(!I()||!ae){T(q);return}const O=X();$=ir(q,N),Q=l3(fo($,O,!1,[1,1]),r,f,ae),R||(F(),R=!0);const z=nu(q,{handle:Q,connectionMode:e,fromNodeId:o,fromHandleId:a,fromType:i?"target":"source",isValidConnection:W,doc:ee,lib:g,flowId:b,nodeLookup:f});j=z.handleDomNode,H=z.connection,V=c3(!!Q,z.isValid);const U=f.get(o),ne=U?Br(U,ae,zt.Left,!0):J.from,ce={...J,from:ne,isValid:V,to:z.toHandle&&V?Yo({x:z.toHandle.x,y:z.toHandle.y},O):$,toHandle:z.toHandle,toPosition:V&&z.toHandle?z.toHandle.position:Bl[ae.position],toNode:z.toHandle?f.get(z.toHandle.nodeId):null,pointer:$};G(ce),J=ce}function T(q){if(!("touches"in q&&q.touches.length>0)){if(P){(Q||j)&&H&&V&&(A==null||A(H));const{inProgress:O,...z}=J,U={...z,toPosition:J.toHandle?J.toPosition:null};D==null||D(q,U),s&&(C==null||C(q,U))}w(),cancelAnimationFrame(ve),R=!1,V=!1,H=null,j=null,ee.removeEventListener("mousemove",Z),ee.removeEventListener("mouseup",T),ee.removeEventListener("touchmove",Z),ee.removeEventListener("touchend",T)}}ee.addEventListener("mousemove",Z),ee.addEventListener("mouseup",T),ee.addEventListener("touchmove",Z),ee.addEventListener("touchend",T)}function nu(t,{handle:e,connectionMode:r,fromNodeId:a,fromHandleId:o,fromType:s,doc:i,lib:d,flowId:f,isValidConnection:g=tu,nodeLookup:p}){const b=s==="target",h=e?i.querySelector(`.${d}-flow__handle[data-id="${f}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:w,y:S}=ir(t),A=i.elementFromPoint(w,S),D=A!=null&&A.classList.contains(`${d}-flow__handle`)?A:h,W={handleDomNode:D,isValid:!1,connection:null,toHandle:null};if(D){const C=eu(void 0,D),G=D.getAttribute("data-nodeid"),X=D.getAttribute("data-handleid"),I=D.classList.contains("connectable"),te=D.classList.contains("connectableend");if(!G||!C)return W;const le={source:b?G:a,sourceHandle:b?X:o,target:b?a:G,targetHandle:b?o:X};W.connection=le;const ee=I&&te&&(r===ha.Strict?b&&C==="source"||!b&&C==="target":G!==a||X!==o);W.isValid=ee&&g(le),W.toHandle=Jd(G,C,X,p,r,!0)}return W}const ac={onPointerDown:d3,isValid:nu},fi=t=>({x:t.x,y:t.y,zoom:t.k}),Ii=({x:t,y:e,zoom:r})=>li.translate(t,e).scale(r),ra=(t,e)=>t.target.closest(`.${e}`),ru=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),u3=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Oi=(t,e=0,r=u3,a=()=>{})=>{const o=typeof e=="number"&&e>0;return o||a(),o?t.transition().duration(e).ease(r).on("end",a):t},au=t=>{const e=t.ctrlKey&&Xo()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function f3({zoomPanValues:t,noWheelClassName:e,d3Selection:r,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:g}){return p=>{if(ra(p,e))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const b=r.property("__zoom").k||1;if(p.ctrlKey&&i){const D=dr(p),W=au(p),C=b*Math.pow(2,W);a.scaleTo(r,C,D,p);return}const h=p.deltaMode===1?20:1;let w=o===da.Vertical?0:p.deltaX*h,S=o===da.Horizontal?0:p.deltaY*h;!Xo()&&p.shiftKey&&o!==da.Vertical&&(w=p.deltaY*h,S=0),a.translateBy(r,-(w/b)*s,-(S/b)*s,{internal:!0});const A=fi(r.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(f==null||f(p,A),t.panScrollTimeout=setTimeout(()=>{g==null||g(p,A),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,d==null||d(p,A))}}function v3({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:r}){return function(a,o){const s=a.type==="wheel",i=!e&&s&&!a.ctrlKey,d=ra(a,t);if(a.ctrlKey&&s&&d&&a.preventDefault(),i||d)return null;a.preventDefault(),r.call(this,a,o)}}function g3({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:r}){return a=>{var s,i,d;if((s=a.sourceEvent)!=null&&s.internal)return;const o=fi(a.transform);t.mouseButton=((i=a.sourceEvent)==null?void 0:i.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=o,((d=a.sourceEvent)==null?void 0:d.type)==="mousedown"&&e(!0),r&&(r==null||r(a.sourceEvent,o))}}function p3({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:r,onTransformChange:a,onPanZoom:o}){return s=>{var i,d;t.usedRightMouseButton=!!(r&&ru(e,t.mouseButton??0)),(i=s.sourceEvent)!=null&&i.sync||a([s.transform.x,s.transform.y,s.transform.k]),o&&!((d=s.sourceEvent)!=null&&d.internal)&&(o==null||o(s.sourceEvent,fi(s.transform)))}}function h3({zoomPanValues:t,panOnDrag:e,panOnScroll:r,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:s}){return i=>{var d;if(!((d=i.sourceEvent)!=null&&d.internal)&&(t.isZoomingOrPanning=!1,s&&ru(e,t.mouseButton??0)&&!t.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),t.usedRightMouseButton=!1,a(!1),o)){const f=fi(i.transform);t.prevViewport=f,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{o==null||o(i.sourceEvent,f)},r?150:0)}}}function b3({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:r,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:d,noPanClassName:f,lib:g,connectionInProgress:p}){return b=>{var D;const h=t||e,w=r&&b.ctrlKey,S=b.type==="wheel";if(b.button===1&&b.type==="mousedown"&&(ra(b,`${g}-flow__node`)||ra(b,`${g}-flow__edge`)))return!0;if(!a&&!h&&!o&&!s&&!r||i||p&&!S||ra(b,d)&&S||ra(b,f)&&(!S||o&&S&&!t)||!r&&b.ctrlKey&&S)return!1;if(!r&&b.type==="touchstart"&&((D=b.touches)==null?void 0:D.length)>1)return b.preventDefault(),!1;if(!h&&!o&&!w&&S||!a&&(b.type==="mousedown"||b.type==="touchstart")||Array.isArray(a)&&!a.includes(b.button)&&b.type==="mousedown")return!1;const A=Array.isArray(a)&&a.includes(b.button)||!b.button||b.button<=1;return(!b.ctrlKey||S)&&A}}function x3({domNode:t,minZoom:e,maxZoom:r,translateExtent:a,viewport:o,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:d,onDraggingChange:f}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=t.getBoundingClientRect(),b=bw().scaleExtent([e,r]).translateExtent(a),h=ar(t).call(b);C({x:o.x,y:o.y,zoom:ba(o.zoom,e,r)},[[0,0],[p.width,p.height]],a);const w=h.on("wheel.zoom"),S=h.on("dblclick.zoom");b.wheelDelta(au);function A(Q,E){return h?new Promise(M=>{b==null||b.interpolate((E==null?void 0:E.interpolate)==="linear"?Oa:Lo).transform(Oi(h,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>M(!0)),Q)}):Promise.resolve(!1)}function D({noWheelClassName:Q,noPanClassName:E,onPaneContextMenu:M,userSelectionActive:m,panOnScroll:N,panOnDrag:P,panOnScrollMode:B,panOnScrollSpeed:$,preventScrolling:R,zoomOnPinch:H,zoomOnScroll:V,zoomOnDoubleClick:j,zoomActivationKeyPressed:F,lib:ae,onTransformChange:be,connectionInProgress:se,paneClickDistance:J,selectionOnDrag:Y}){m&&!g.isZoomingOrPanning&&W();const Z=N&&!F&&!m;b.clickDistance(Y?1/0:!wr(J)||J<0?0:J);const T=Z?f3({zoomPanValues:g,noWheelClassName:Q,d3Selection:h,d3Zoom:b,panOnScrollMode:B,panOnScrollSpeed:$,zoomOnPinch:H,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:d}):v3({noWheelClassName:Q,preventScrolling:R,d3ZoomHandler:w});if(h.on("wheel.zoom",T,{passive:!1}),!m){const O=g3({zoomPanValues:g,onDraggingChange:f,onPanZoomStart:i});b.on("start",O);const z=p3({zoomPanValues:g,panOnDrag:P,onPaneContextMenu:!!M,onPanZoom:s,onTransformChange:be});b.on("zoom",z);const U=h3({zoomPanValues:g,panOnDrag:P,panOnScroll:N,onPaneContextMenu:M,onPanZoomEnd:d,onDraggingChange:f});b.on("end",U)}const q=b3({zoomActivationKeyPressed:F,panOnDrag:P,zoomOnScroll:V,panOnScroll:N,zoomOnDoubleClick:j,zoomOnPinch:H,userSelectionActive:m,noPanClassName:E,noWheelClassName:Q,lib:ae,connectionInProgress:se});b.filter(q),j?h.on("dblclick.zoom",S):h.on("dblclick.zoom",null)}function W(){b.on("zoom",null)}async function C(Q,E,M){const m=Ii(Q),N=b==null?void 0:b.constrain()(m,E,M);return N&&await A(N),new Promise(P=>P(N))}async function G(Q,E){const M=Ii(Q);return await A(M,E),new Promise(m=>m(M))}function X(Q){if(h){const E=Ii(Q),M=h.property("__zoom");(M.k!==Q.zoom||M.x!==Q.x||M.y!==Q.y)&&(b==null||b.transform(h,E,null,{sync:!0}))}}function I(){const Q=h?$d(h.node()):{x:0,y:0,k:1};return{x:Q.x,y:Q.y,zoom:Q.k}}function te(Q,E){return h?new Promise(M=>{b==null||b.interpolate((E==null?void 0:E.interpolate)==="linear"?Oa:Lo).scaleTo(Oi(h,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>M(!0)),Q)}):Promise.resolve(!1)}function le(Q,E){return h?new Promise(M=>{b==null||b.interpolate((E==null?void 0:E.interpolate)==="linear"?Oa:Lo).scaleBy(Oi(h,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>M(!0)),Q)}):Promise.resolve(!1)}function oe(Q){b==null||b.scaleExtent(Q)}function ee(Q){b==null||b.translateExtent(Q)}function ve(Q){const E=!wr(Q)||Q<0?0:Q;b==null||b.clickDistance(E)}return{update:D,destroy:W,setViewport:G,setViewportConstrained:C,getViewport:I,scaleTo:te,scaleBy:le,setScaleExtent:oe,setTranslateExtent:ee,syncViewport:X,setClickDistance:ve}}var oc;(function(t){t.Line="line",t.Handle="handle"})(oc||(oc={}));function js(){const t={};return[e=>{if(e&&!Xu(t))throw new Error(e);return ti(t)},e=>ws(t,e)]}const[m3,_3]=js(),[y3,w3]=js(),[k3,S3]=js();var C3=x("<div><!></div>");function _a(t,e){it(e,!0);let r=Ge(e,"id",3,null),a=Ge(e,"type",3,"source"),o=Ge(e,"position",19,()=>zt.Top),s=Ge(e,"isConnectableStart",3,!0),i=Ge(e,"isConnectableEnd",3,!0),d=Ur(e,["$$slots","$$events","$$legacy","id","type","position","style","class","isConnectable","isConnectableStart","isConnectableEnd","isValidConnection","onconnect","ondisconnect","children"]);const f=m3("Handle must be used within a Custom Node component"),g=y3("Handle must be used within a Custom Node component");let p=y(()=>a()==="target"),b=y(()=>e.isConnectable!==void 0?e.isConnectable:g.value),h=Xr(),w=y(()=>h.ariaLabelConfig),S=null;Zu(()=>{if(e.onconnect||e.ondisconnect){h.edges;let E=h.connectionLookup.get(`${f}-${a()}${r()?`-${r()}`:""}`);if(S&&!mw(E,S)){const M=E??new Map;Wl(S,M,e.ondisconnect),Wl(M,S,e.onconnect)}S=new Map(E)}});let A=y(()=>{if(!h.connection.inProgress)return[!1,!1,!1,!1,null];const{fromHandle:E,toHandle:M,isValid:m}=h.connection,N=E&&E.nodeId===f&&E.type===a()&&E.id===r(),P=M&&M.nodeId===f&&M.type===a()&&M.id===r(),B=h.connectionMode===ha.Strict?(E==null?void 0:E.type)!==a():f!==(E==null?void 0:E.nodeId)||r()!==(E==null?void 0:E.id);return[!0,N,P,B,P&&m]}),D=y(()=>er(n(A),5)),W=y(()=>n(D)[0]),C=y(()=>n(D)[1]),G=y(()=>n(D)[2]),X=y(()=>n(D)[3]),I=y(()=>n(D)[4]);function te(E){var m;const M=h.onbeforeconnect?h.onbeforeconnect(E):E;M&&(h.addEdge(M),(m=h.onconnect)==null||m.call(h,E))}function le(E){const M=Wd(E);E.currentTarget&&(M&&E.button===0||!M)&&ac.onPointerDown(E,{handleId:r(),nodeId:f,isTarget:n(p),connectionRadius:h.connectionRadius,domNode:h.domNode,nodeLookup:h.nodeLookup,connectionMode:h.connectionMode,lib:"svelte",autoPanOnConnect:h.autoPanOnConnect,autoPanSpeed:h.autoPanSpeed,flowId:h.flowId,isValidConnection:e.isValidConnection||((...m)=>{var N;return((N=h.isValidConnection)==null?void 0:N.call(h,...m))??!0}),updateConnection:h.updateConnection,cancelConnection:h.cancelConnection,panBy:h.panBy,onConnect:te,onConnectStart:h.onconnectstart,onConnectEnd:(...m)=>{var N;return(N=h.onconnectend)==null?void 0:N.call(h,...m)},getTransform:()=>[h.viewport.x,h.viewport.y,h.viewport.zoom],getFromHandle:()=>h.connection.fromHandle,dragThreshold:h.connectionDragThreshold,handleDomNode:E.currentTarget})}function oe(E){var j,F;if(!f||!h.clickConnectStartHandle&&!s())return;if(!h.clickConnectStartHandle){(j=h.onclickconnectstart)==null||j.call(h,E,{nodeId:f,handleId:r(),handleType:a()}),h.clickConnectStartHandle={nodeId:f,type:a(),id:r()};return}const M=jd(E.target),m=e.isValidConnection??h.isValidConnection,{connectionMode:N,clickConnectStartHandle:P,flowId:B,nodeLookup:$}=h,{connection:R,isValid:H}=ac.isValid(E,{handle:{nodeId:f,id:r(),type:a()},connectionMode:N,fromNodeId:P.nodeId,fromHandleId:P.id??null,fromType:P.type,isValidConnection:m,flowId:B,doc:M,lib:"svelte",nodeLookup:$});H&&R&&te(R);const V=structuredClone(Ec(h.connection));delete V.inProgress,V.toPosition=V.toHandle?V.toHandle.position:null,(F=h.onclickconnectend)==null||F.call(h,E,V),h.clickConnectStartHandle=null}var ee=C3(),ve=()=>{};zr(ee,()=>({"data-handleid":r(),"data-nodeid":f,"data-handlepos":o(),"data-id":`${h.flowId??""}-${f??""}-${r()??"null"??""}-${a()??""}`,class:["svelte-flow__handle",`svelte-flow__handle-${o()}`,h.noDragClass,h.noPanClass,o(),e.class],onmousedown:le,ontouchstart:le,onclick:h.clickConnect?oe:void 0,onkeypress:ve,style:e.style,role:"button","aria-label":n(w)["handle.ariaLabel"],tabindex:"-1",...d,[ks]:{valid:n(I),connectingto:n(G),connectingfrom:n(C),source:!n(p),target:n(p),connectablestart:s(),connectableend:i(),connectable:n(b),connectionindicator:n(b)&&(!n(W)||n(X))&&(n(W)||h.clickConnectStartHandle?i():s())}}));var Q=c(ee);pn(Q,()=>e.children??Kn),l(ee),v(t,ee),st()}var E3=x("<!> <!>",1);function ou(t,e){it(e,!0);let r=Ge(e,"targetPosition",19,()=>zt.Top),a=Ge(e,"sourcePosition",19,()=>zt.Bottom);var o=E3(),s=fe(o);_a(s,{type:"target",get position(){return r()}});var i=u(s),d=u(i);_a(d,{type:"source",get position(){return a()}}),L(()=>{var f;return k(i,` ${((f=e.data)==null?void 0:f.label)??""} `)}),v(t,o),st()}var N3=x(" <!>",1);function M3(t,e){it(e,!0);let r=Ge(e,"data",19,()=>({label:"Node"})),a=Ge(e,"sourcePosition",19,()=>zt.Bottom);Ce();var o=N3(),s=fe(o),i=u(s);_a(i,{type:"source",get position(){return a()}}),L(()=>{var d;return k(s,`${((d=r())==null?void 0:d.label)??""} `)}),v(t,o),st()}var T3=x(" <!>",1);function z3(t,e){it(e,!0);let r=Ge(e,"data",19,()=>({label:"Node"})),a=Ge(e,"targetPosition",19,()=>zt.Top);Ce();var o=T3(),s=fe(o),i=u(s);_a(i,{type:"target",get position(){return a()}}),L(()=>{var d;return k(s,`${((d=r())==null?void 0:d.label)??""} `)}),v(t,o),st()}function A3(t,e){}function Ri(t,e,r){if(!r||!e)return;const a=r==="root"?e:e.querySelector(`.svelte-flow__${r}`);a&&a.appendChild(t)}function $i(t,e){const r=y(Xr),a=y(()=>n(r).domNode);let o;return n(a)?Ri(t,n(a),e):o=wc(()=>{Xt(()=>{Ri(t,n(a),e),o==null||o()})}),{async update(s){Ri(t,n(a),s)},destroy(){t.parentNode&&t.parentNode.removeChild(t),o==null||o()}}}function P3(){let t=we(typeof window>"u");if(n(t)){const e=wc(()=>{Xt(()=>{_(t,!1),e==null||e()})})}return{get value(){return n(t)}}}const ic=t=>yw(t),L3=t=>Vd(t);function gr(t){return t===void 0?void 0:`${t}px`}const Zo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var I3=x("<div><!></div>");function O3(t,e){it(e,!0);let r=Ge(e,"x",3,0),a=Ge(e,"y",3,0),o=Ge(e,"selectEdgeOnClick",3,!1),s=Ge(e,"transparent",3,!1),i=Ur(e,["$$slots","$$events","$$legacy","x","y","width","height","selectEdgeOnClick","transparent","class","children"]);const d=Xr(),f=k3("EdgeLabel must be used within a Custom Edge component");let g=y(()=>{var w;return(w=d.visible.edges.get(f))==null?void 0:w.zIndex});var p=I3(),b=()=>{o()&&f&&d.handleEdgeSelection(f)};zr(p,w=>({class:["svelte-flow__edge-label",{transparent:s()},e.class],tabindex:"-1",onclick:b,...i,[ni]:w}),[()=>({display:P3().value?"none":void 0,cursor:o()?"pointer":void 0,transform:`translate(-50%, -50%) translate(${r()??""}px,${a()??""}px)`,"pointer-events":"all",width:gr(e.width),height:gr(e.height),"z-index":n(g)})],void 0,void 0,"svelte-168dld1");var h=c(p);pn(h,()=>e.children??Kn),l(p),Hn(p,(w,S)=>$i==null?void 0:$i(w,S),()=>"edge-labels"),v(t,p),st()}var R3=En("<path></path>"),$3=En('<path fill="none"></path><!><!>',1);function vi(t,e){let r=Ge(e,"interactionWidth",3,20),a=Ur(e,["$$slots","$$events","$$legacy","id","path","label","labelX","labelY","labelStyle","markerStart","markerEnd","style","interactionWidth","class"]);var o=$3(),s=fe(o),i=u(s);{var d=p=>{var b=R3();zr(b,()=>({d:e.path,"stroke-opacity":0,"stroke-width":r(),fill:"none",class:"svelte-flow__edge-interaction",...a})),v(p,b)};K(i,p=>{r()>0&&p(d)})}var f=u(i);{var g=p=>{O3(p,{get x(){return e.labelX},get y(){return e.labelY},get style(){return e.labelStyle},selectEdgeOnClick:!0,children:(b,h)=>{Ce();var w=_t();L(()=>k(w,e.label)),v(b,w)},$$slots:{default:!0}})};K(f,p=>{e.label&&p(g)})}L(()=>{Ae(s,"id",e.id),Ae(s,"d",e.path),De(s,0,je(["svelte-flow__edge-path",e.class])),Ae(s,"marker-start",e.markerStart),Ae(s,"marker-end",e.markerEnd),kn(s,e.style)}),v(t,o)}function iu(t,e){it(e,!0);let r=y(()=>{var d;return Ud({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,curvature:(d=e.pathOptions)==null?void 0:d.curvature})}),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);vi(t,{get id(){return e.id},get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(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}}),st()}function D3(t,e){it(e,!0);let r=y(()=>Vs({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition})),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);vi(t,{get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(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}}),st()}function V3(t,e){it(e,!0);let r=y(()=>Yd({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY})),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);vi(t,{get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(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}}),st()}function H3(t,e){it(e,!0);let r=y(()=>Vs({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,borderRadius:0})),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);vi(t,{get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(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}}),st()}var ro,ao;class F3{constructor(e,r){Fe(this,ro);Fe(this,ao);Qr(this,ro,e),Qr(this,ao,Ju(r))}get current(){return ge(this,ao).call(this),ge(this,ro).call(this)}}ro=new WeakMap,ao=new WeakMap;const q3=/\(.+\)/,K3=new Set(["all","print","screen","and","or","not","only"]);class j3 extends F3{constructor(e,r){let a=q3.test(e)||e.split(/[\s,]+/).some(s=>K3.has(s.trim()))?e:`(${e})`;const o=window.matchMedia(a);super(()=>o.matches,s=>Bi(o,"change",s))}}function B3(t,e,r,a){const o=new Map;return $s(t,{x:0,y:0,width:r,height:a},e,!0).forEach(s=>{o.set(s.id,s)}),o}function sc(t){const{edges:e,defaultEdgeOptions:r,nodeLookup:a,previousEdges:o,connectionMode:s,onerror:i,onlyRenderVisible:d,elevateEdgesOnSelect:f,zIndexMode:g}=t,p=new Map;for(const b of e){const h=a.get(b.source),w=a.get(b.target);if(!h||!w)continue;if(d){const{visibleNodes:D,transform:W,width:C,height:G}=t;if($w({sourceNode:h,targetNode:w,width:C,height:G,transform:W}))D.set(h.id,h),D.set(w.id,w);else continue}const S=o.get(b.id);if(S&&b===S.edge&&h==S.sourceNode&&w==S.targetNode){p.set(b.id,S);continue}const A=jw({id:b.id,sourceNode:h,targetNode:w,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:s,onError:i});A&&p.set(b.id,{...r,...b,...A,zIndex:Rw({selected:b.selected,zIndex:b.zIndex??r.zIndex,sourceNode:h,targetNode:w,elevateOnSelect:f,zIndexMode:g}),sourceNode:h,targetNode:w,edge:b})}return p}const su={input:M3,output:z3,default:ou,group:A3},lu={straight:V3,smoothstep:D3,default:iu,step:H3};function W3(t,e,r,a,o,s){if(e&&!r&&a&&o){const i=ci(s,{filter:d=>!!((d.width||d.initialWidth)&&(d.height||d.initialHeight))});return Ds(i,a,o,.5,2,.1)}else return r??{x:0,y:0,zoom:1}}function U3(t){var r,a,o,s,i,d,f,g,p,b,h,w,S,A,D,W,C,G,X,I,te,le,oe,ee,ve,Q,E,M,m,N,P,B,$,R,H,V,j,F,ae,be,se,J,Y,Z,T,q,O,z,U,ne,ce,xe,he,me,_e,pe,ue,Oe,ie,de,ye,Pe,Le,Ee,Te,Me,Ne,ze,Ze,$e,Je,tt,ct,qe,Ve,Be;class e{constructor(){Fe(this,r,y(()=>t.props.id??"1"));Fe(this,a,we(null));Fe(this,o,we(null));Fe(this,s,we(t.width??0));Fe(this,i,we(t.height??0));Fe(this,d,we(t.props.zIndexMode??"basic"));Fe(this,f,y(()=>{var rt;const{nodesInitialized:re}=Xw(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&&re&&((rt=this.fitViewOptions)!=null&&rt.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),re}));Fe(this,g,y(()=>this.panZoom!==null));Fe(this,p,y(()=>(n3(this.connectionLookup,this.edgeLookup,t.edges),t.edges)));Ft(this,"_prevSelectedNodes",[]);Ft(this,"_prevSelectedNodeIds",new Set);Fe(this,b,y(()=>{const re=this._prevSelectedNodeIds.size,rt=new Set,Qe=this.nodes.filter(We=>(We.selected&&(rt.add(We.id),this._prevSelectedNodeIds.delete(We.id)),We.selected));return(re!==rt.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=Qe),this._prevSelectedNodeIds=rt,this._prevSelectedNodes}));Ft(this,"_prevSelectedEdges",[]);Ft(this,"_prevSelectedEdgeIds",new Set);Fe(this,h,y(()=>{const re=this._prevSelectedEdgeIds.size,rt=new Set,Qe=this.edges.filter(We=>(We.selected&&(rt.add(We.id),this._prevSelectedEdgeIds.delete(We.id)),We.selected));return(re!==rt.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=Qe),this._prevSelectedEdgeIds=rt,this._prevSelectedEdges}));Ft(this,"selectionChangeHandlers",new Map);Ft(this,"nodeLookup",new Map);Ft(this,"parentLookup",new Map);Ft(this,"connectionLookup",new Map);Ft(this,"edgeLookup",new Map);Ft(this,"_prevVisibleEdges",new Map);Fe(this,w,y(()=>{const{nodes:re,_edges:rt,_prevVisibleEdges:Qe,nodeLookup:We,connectionMode:ft,onerror:Nt,onlyRenderVisibleElements:At,defaultEdgeOptions:Mt,zIndexMode:Et}=this;let mt,yt;const kt={edges:rt,defaultEdgeOptions:Mt,previousEdges:Qe,nodeLookup:We,connectionMode:ft,elevateEdgesOnSelect:t.props.elevateEdgesOnSelect??!0,zIndexMode:Et,onerror:Nt};if(At){const{viewport:It,width:Zt,height:hn}=this,xn=[It.x,It.y,It.zoom];mt=B3(We,xn,Zt,hn),yt=sc({...kt,onlyRenderVisible:!0,visibleNodes:mt,transform:xn,width:Zt,height:hn})}else mt=this.nodeLookup,yt=sc(kt);return{nodes:mt,edges:yt}}));Fe(this,S,y(()=>t.props.nodesDraggable??!0));Fe(this,A,y(()=>t.props.nodesConnectable??!0));Fe(this,D,y(()=>t.props.elementsSelectable??!0));Fe(this,W,y(()=>t.props.nodesFocusable??!0));Fe(this,C,y(()=>t.props.edgesFocusable??!0));Fe(this,G,y(()=>t.props.disableKeyboardA11y??!1));Fe(this,X,y(()=>t.props.minZoom??.5));Fe(this,I,y(()=>t.props.maxZoom??2));Fe(this,te,y(()=>t.props.nodeOrigin??[0,0]));Fe(this,le,y(()=>t.props.nodeExtent??vs));Fe(this,oe,y(()=>t.props.translateExtent??vs));Fe(this,ee,y(()=>t.props.defaultEdgeOptions??{}));Fe(this,ve,y(()=>t.props.nodeDragThreshold??1));Fe(this,Q,y(()=>t.props.autoPanOnNodeDrag??!0));Fe(this,E,y(()=>t.props.autoPanOnConnect??!0));Fe(this,M,y(()=>t.props.autoPanOnNodeFocus??!0));Fe(this,m,y(()=>t.props.autoPanSpeed??15));Fe(this,N,y(()=>t.props.connectionDragThreshold??1));Ft(this,"fitViewQueued",t.props.fitView??!1);Ft(this,"fitViewOptions",t.props.fitViewOptions);Ft(this,"fitViewResolver",null);Fe(this,P,y(()=>t.props.snapGrid??null));Fe(this,B,we(!1));Fe(this,$,we(null));Fe(this,R,we(!1));Fe(this,H,we(!1));Fe(this,V,we(!1));Fe(this,j,we(!1));Fe(this,F,we(!1));Fe(this,ae,we(null));Fe(this,be,we(""));Fe(this,se,y(()=>t.props.selectionMode??Wo.Partial));Fe(this,J,y(()=>({...su,...t.props.nodeTypes})));Fe(this,Y,y(()=>({...lu,...t.props.edgeTypes})));Fe(this,Z,y(()=>t.props.noPanClass??"nopan"));Fe(this,T,y(()=>t.props.noDragClass??"nodrag"));Fe(this,q,y(()=>t.props.noWheelClass??"nowheel"));Fe(this,O,y(()=>Lw(t.props.ariaLabelConfig)));Fe(this,z,we(W3(this.nodesInitialized,t.props.fitView,t.props.initialViewport,this.width,this.height,this.nodeLookup)));Fe(this,U,we(gs));Fe(this,ne,y(()=>this._connection.inProgress?{...this._connection,to:fo(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection));Fe(this,ce,y(()=>t.props.connectionMode??ha.Strict));Fe(this,xe,y(()=>t.props.connectionRadius??20));Fe(this,he,y(()=>t.props.isValidConnection??(()=>!0)));Fe(this,me,y(()=>t.props.selectNodesOnDrag??!0));Fe(this,_e,y(()=>t.props.defaultMarkerColor===void 0?"#b1b1b7":t.props.defaultMarkerColor));Fe(this,pe,y(()=>Bw(t.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd})));Fe(this,ue,y(()=>t.props.onlyRenderVisibleElements??!1));Fe(this,Oe,y(()=>t.props.onflowerror??Mw));Fe(this,ie,y(()=>t.props.ondelete));Fe(this,de,y(()=>t.props.onbeforedelete));Fe(this,ye,y(()=>t.props.onbeforeconnect));Fe(this,Pe,y(()=>t.props.onconnect));Fe(this,Le,y(()=>t.props.onconnectstart));Fe(this,Ee,y(()=>t.props.onconnectend));Fe(this,Te,y(()=>t.props.onbeforereconnect));Fe(this,Me,y(()=>t.props.onreconnect));Fe(this,Ne,y(()=>t.props.onreconnectstart));Fe(this,ze,y(()=>t.props.onreconnectend));Fe(this,Ze,y(()=>t.props.clickConnect??!0));Fe(this,$e,y(()=>t.props.onclickconnectstart));Fe(this,Je,y(()=>t.props.onclickconnectend));Fe(this,tt,we(null));Fe(this,ct,y(()=>t.props.onselectiondrag));Fe(this,qe,y(()=>t.props.onselectiondragstart));Fe(this,Ve,y(()=>t.props.onselectiondragstop));Ft(this,"resolveFitView",async()=>{var re;this.panZoom&&(await Cw({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),(re=this.fitViewResolver)==null||re.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)});Ft(this,"_prefersDark",new j3("(prefers-color-scheme: dark)",t.props.colorModeSSR==="dark"));Fe(this,Be,y(()=>t.props.colorMode==="system"?this._prefersDark.current?"dark":"light":t.props.colorMode??"light"))}get flowId(){return n(ge(this,r))}set flowId(re){_(ge(this,r),re)}get domNode(){return n(ge(this,a))}set domNode(re){_(ge(this,a),re)}get panZoom(){return n(ge(this,o))}set panZoom(re){_(ge(this,o),re)}get width(){return n(ge(this,s))}set width(re){_(ge(this,s),re)}get height(){return n(ge(this,i))}set height(re){_(ge(this,i),re)}get zIndexMode(){return n(ge(this,d))}set zIndexMode(re){_(ge(this,d),re)}get nodesInitialized(){return n(ge(this,f))}set nodesInitialized(re){_(ge(this,f),re)}get viewportInitialized(){return n(ge(this,g))}set viewportInitialized(re){_(ge(this,g),re)}get _edges(){return n(ge(this,p))}set _edges(re){_(ge(this,p),re)}get nodes(){return this.nodesInitialized,t.nodes}set nodes(re){t.nodes=re}get edges(){return this._edges}set edges(re){t.edges=re}get selectedNodes(){return n(ge(this,b))}set selectedNodes(re){_(ge(this,b),re)}get selectedEdges(){return n(ge(this,h))}set selectedEdges(re){_(ge(this,h),re)}get visible(){return n(ge(this,w))}set visible(re){_(ge(this,w),re)}get nodesDraggable(){return n(ge(this,S))}set nodesDraggable(re){_(ge(this,S),re)}get nodesConnectable(){return n(ge(this,A))}set nodesConnectable(re){_(ge(this,A),re)}get elementsSelectable(){return n(ge(this,D))}set elementsSelectable(re){_(ge(this,D),re)}get nodesFocusable(){return n(ge(this,W))}set nodesFocusable(re){_(ge(this,W),re)}get edgesFocusable(){return n(ge(this,C))}set edgesFocusable(re){_(ge(this,C),re)}get disableKeyboardA11y(){return n(ge(this,G))}set disableKeyboardA11y(re){_(ge(this,G),re)}get minZoom(){return n(ge(this,X))}set minZoom(re){_(ge(this,X),re)}get maxZoom(){return n(ge(this,I))}set maxZoom(re){_(ge(this,I),re)}get nodeOrigin(){return n(ge(this,te))}set nodeOrigin(re){_(ge(this,te),re)}get nodeExtent(){return n(ge(this,le))}set nodeExtent(re){_(ge(this,le),re)}get translateExtent(){return n(ge(this,oe))}set translateExtent(re){_(ge(this,oe),re)}get defaultEdgeOptions(){return n(ge(this,ee))}set defaultEdgeOptions(re){_(ge(this,ee),re)}get nodeDragThreshold(){return n(ge(this,ve))}set nodeDragThreshold(re){_(ge(this,ve),re)}get autoPanOnNodeDrag(){return n(ge(this,Q))}set autoPanOnNodeDrag(re){_(ge(this,Q),re)}get autoPanOnConnect(){return n(ge(this,E))}set autoPanOnConnect(re){_(ge(this,E),re)}get autoPanOnNodeFocus(){return n(ge(this,M))}set autoPanOnNodeFocus(re){_(ge(this,M),re)}get autoPanSpeed(){return n(ge(this,m))}set autoPanSpeed(re){_(ge(this,m),re)}get connectionDragThreshold(){return n(ge(this,N))}set connectionDragThreshold(re){_(ge(this,N),re)}get snapGrid(){return n(ge(this,P))}set snapGrid(re){_(ge(this,P),re)}get dragging(){return n(ge(this,B))}set dragging(re){_(ge(this,B),re)}get selectionRect(){return n(ge(this,$))}set selectionRect(re){_(ge(this,$),re)}get selectionKeyPressed(){return n(ge(this,R))}set selectionKeyPressed(re){_(ge(this,R),re)}get multiselectionKeyPressed(){return n(ge(this,H))}set multiselectionKeyPressed(re){_(ge(this,H),re)}get deleteKeyPressed(){return n(ge(this,V))}set deleteKeyPressed(re){_(ge(this,V),re)}get panActivationKeyPressed(){return n(ge(this,j))}set panActivationKeyPressed(re){_(ge(this,j),re)}get zoomActivationKeyPressed(){return n(ge(this,F))}set zoomActivationKeyPressed(re){_(ge(this,F),re)}get selectionRectMode(){return n(ge(this,ae))}set selectionRectMode(re){_(ge(this,ae),re)}get ariaLiveMessage(){return n(ge(this,be))}set ariaLiveMessage(re){_(ge(this,be),re)}get selectionMode(){return n(ge(this,se))}set selectionMode(re){_(ge(this,se),re)}get nodeTypes(){return n(ge(this,J))}set nodeTypes(re){_(ge(this,J),re)}get edgeTypes(){return n(ge(this,Y))}set edgeTypes(re){_(ge(this,Y),re)}get noPanClass(){return n(ge(this,Z))}set noPanClass(re){_(ge(this,Z),re)}get noDragClass(){return n(ge(this,T))}set noDragClass(re){_(ge(this,T),re)}get noWheelClass(){return n(ge(this,q))}set noWheelClass(re){_(ge(this,q),re)}get ariaLabelConfig(){return n(ge(this,O))}set ariaLabelConfig(re){_(ge(this,O),re)}get _viewport(){return n(ge(this,z))}set _viewport(re){_(ge(this,z),re)}get viewport(){return t.viewport??this._viewport}set viewport(re){t.viewport&&(t.viewport=re),this._viewport=re}get _connection(){return n(ge(this,U))}set _connection(re){_(ge(this,U),re)}get connection(){return n(ge(this,ne))}set connection(re){_(ge(this,ne),re)}get connectionMode(){return n(ge(this,ce))}set connectionMode(re){_(ge(this,ce),re)}get connectionRadius(){return n(ge(this,xe))}set connectionRadius(re){_(ge(this,xe),re)}get isValidConnection(){return n(ge(this,he))}set isValidConnection(re){_(ge(this,he),re)}get selectNodesOnDrag(){return n(ge(this,me))}set selectNodesOnDrag(re){_(ge(this,me),re)}get defaultMarkerColor(){return n(ge(this,_e))}set defaultMarkerColor(re){_(ge(this,_e),re)}get markers(){return n(ge(this,pe))}set markers(re){_(ge(this,pe),re)}get onlyRenderVisibleElements(){return n(ge(this,ue))}set onlyRenderVisibleElements(re){_(ge(this,ue),re)}get onerror(){return n(ge(this,Oe))}set onerror(re){_(ge(this,Oe),re)}get ondelete(){return n(ge(this,ie))}set ondelete(re){_(ge(this,ie),re)}get onbeforedelete(){return n(ge(this,de))}set onbeforedelete(re){_(ge(this,de),re)}get onbeforeconnect(){return n(ge(this,ye))}set onbeforeconnect(re){_(ge(this,ye),re)}get onconnect(){return n(ge(this,Pe))}set onconnect(re){_(ge(this,Pe),re)}get onconnectstart(){return n(ge(this,Le))}set onconnectstart(re){_(ge(this,Le),re)}get onconnectend(){return n(ge(this,Ee))}set onconnectend(re){_(ge(this,Ee),re)}get onbeforereconnect(){return n(ge(this,Te))}set onbeforereconnect(re){_(ge(this,Te),re)}get onreconnect(){return n(ge(this,Me))}set onreconnect(re){_(ge(this,Me),re)}get onreconnectstart(){return n(ge(this,Ne))}set onreconnectstart(re){_(ge(this,Ne),re)}get onreconnectend(){return n(ge(this,ze))}set onreconnectend(re){_(ge(this,ze),re)}get clickConnect(){return n(ge(this,Ze))}set clickConnect(re){_(ge(this,Ze),re)}get onclickconnectstart(){return n(ge(this,$e))}set onclickconnectstart(re){_(ge(this,$e),re)}get onclickconnectend(){return n(ge(this,Je))}set onclickconnectend(re){_(ge(this,Je),re)}get clickConnectStartHandle(){return n(ge(this,tt))}set clickConnectStartHandle(re){_(ge(this,tt),re)}get onselectiondrag(){return n(ge(this,ct))}set onselectiondrag(re){_(ge(this,ct),re)}get onselectiondragstart(){return n(ge(this,qe))}set onselectiondragstart(re){_(ge(this,qe),re)}get onselectiondragstop(){return n(ge(this,Ve))}set onselectiondragstop(re){_(ge(this,Ve),re)}get colorMode(){return n(ge(this,Be))}set colorMode(re){_(ge(this,Be),re)}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=gs,this.clickConnectStartHandle=null,this.viewport=t.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=""}}return r=new WeakMap,a=new WeakMap,o=new WeakMap,s=new WeakMap,i=new WeakMap,d=new WeakMap,f=new WeakMap,g=new WeakMap,p=new WeakMap,b=new WeakMap,h=new WeakMap,w=new WeakMap,S=new WeakMap,A=new WeakMap,D=new WeakMap,W=new WeakMap,C=new WeakMap,G=new WeakMap,X=new WeakMap,I=new WeakMap,te=new WeakMap,le=new WeakMap,oe=new WeakMap,ee=new WeakMap,ve=new WeakMap,Q=new WeakMap,E=new WeakMap,M=new WeakMap,m=new WeakMap,N=new WeakMap,P=new WeakMap,B=new WeakMap,$=new WeakMap,R=new WeakMap,H=new WeakMap,V=new WeakMap,j=new WeakMap,F=new WeakMap,ae=new WeakMap,be=new WeakMap,se=new WeakMap,J=new WeakMap,Y=new WeakMap,Z=new WeakMap,T=new WeakMap,q=new WeakMap,O=new WeakMap,z=new WeakMap,U=new WeakMap,ne=new WeakMap,ce=new WeakMap,xe=new WeakMap,he=new WeakMap,me=new WeakMap,_e=new WeakMap,pe=new WeakMap,ue=new WeakMap,Oe=new WeakMap,ie=new WeakMap,de=new WeakMap,ye=new WeakMap,Pe=new WeakMap,Le=new WeakMap,Ee=new WeakMap,Te=new WeakMap,Me=new WeakMap,Ne=new WeakMap,ze=new WeakMap,Ze=new WeakMap,$e=new WeakMap,Je=new WeakMap,tt=new WeakMap,ct=new WeakMap,qe=new WeakMap,Ve=new WeakMap,Be=new WeakMap,new e}function Xr(){const t=ti(bs);if(!t)throw new Error("To call useStore outside of <SvelteFlow /> you need to wrap your component in a <SvelteFlowProvider />");return t.getStore()}const bs=Symbol();function G3(t){const e=U3(t);function r(Q){e.nodeTypes={...su,...Q}}function a(Q){e.edgeTypes={...lu,...Q}}function o(Q){e.edges=Hw(Q,e.edges)}const s=(Q,E=!1)=>{e.nodes=e.nodes.map(M=>{if(e.connection.inProgress&&e.connection.fromNode.id===M.id){const N=e.nodeLookup.get(M.id);N&&(e.connection={...e.connection,from:Br(N,e.connection.fromHandle,zt.Left,!0)})}const m=Q.get(M.id);return m?{...M,position:m.position,dragging:E}:M})};function i(Q){var N,P,B;const{changes:E,updatedInternals:M}=e3(Q,e.nodeLookup,e.parentLookup,e.domNode,e.nodeOrigin,e.nodeExtent,e.zIndexMode);if(!M)return;Gw(e.nodeLookup,e.parentLookup,{nodeOrigin:e.nodeOrigin,nodeExtent:e.nodeExtent,zIndexMode:e.zIndexMode}),e.fitViewQueued&&e.resolveFitView();const m=new Map;for(const $ of E){const R=(N=e.nodeLookup.get($.id))==null?void 0:N.internals.userNode;if(!R)continue;const H={...R};switch($.type){case"dimensions":{const V={...H.measured,...$.dimensions};$.setAttributes&&(H.width=((P=$.dimensions)==null?void 0:P.width)??H.width,H.height=((B=$.dimensions)==null?void 0:B.height)??H.height),H.measured=V;break}case"position":H.position=$.position??H.position;break}m.set($.id,H)}e.nodes=e.nodes.map($=>m.get($.id)??$)}function d(Q){const E=e.fitViewResolver??Promise.withResolvers();return e.fitViewQueued=!0,e.fitViewOptions=Q,e.fitViewResolver=E,e.nodes=[...e.nodes],E.promise}async function f(Q,E,M){const m=typeof(M==null?void 0:M.zoom)<"u"?M.zoom:e.maxZoom,N=e.panZoom;return N?(await N.setViewport({x:e.width/2-Q*m,y:e.height/2-E*m,zoom:m},{duration:M==null?void 0:M.duration,ease:M==null?void 0:M.ease,interpolate:M==null?void 0:M.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)}function g(Q,E){const M=e.panZoom;return M?M.scaleBy(Q,E):Promise.resolve(!1)}function p(Q){return g(1.2,Q)}function b(Q){return g(1/1.2,Q)}function h(Q){const E=e.panZoom;E&&(E.setScaleExtent([Q,e.maxZoom]),e.minZoom=Q)}function w(Q){const E=e.panZoom;E&&(E.setScaleExtent([e.minZoom,Q]),e.maxZoom=Q)}function S(Q){const E=e.panZoom;E&&(E.setTranslateExtent(Q),e.translateExtent=Q)}function A(Q,E=null){let M=!1;const m=Q.map(N=>(E?E.has(N.id):!0)&&N.selected?(M=!0,{...N,selected:!1}):N);return[M,m]}function D(Q){const E=Q!=null&&Q.nodes?new Set(Q.nodes.map($=>$.id)):null,[M,m]=A(e.nodes,E);M&&(e.nodes=m);const N=Q!=null&&Q.edges?new Set(Q.edges.map($=>$.id)):null,[P,B]=A(e.edges,N);P&&(e.edges=B)}function W(Q){const E=e.multiselectionKeyPressed;e.nodes=e.nodes.map(M=>{const m=Q.includes(M.id),N=E&&M.selected||m;return!!M.selected!==N?{...M,selected:N}:M}),E||D({nodes:[]})}function C(Q){const E=e.multiselectionKeyPressed;e.edges=e.edges.map(M=>{const m=Q.includes(M.id),N=E&&M.selected||m;return!!M.selected!==N?{...M,selected:N}:M}),E||D({edges:[]})}function G(Q,E,M){const m=e.nodeLookup.get(Q);if(!m){console.warn("012",Ua.error012(Q));return}e.selectionRect=null,e.selectionRectMode=null,m.selected?(E||m.selected&&e.multiselectionKeyPressed)&&(D({nodes:[m],edges:[]}),requestAnimationFrame(()=>M==null?void 0:M.blur())):W([Q])}function X(Q){const E=e.edgeLookup.get(Q);if(!E){console.warn("012",Ua.error012(Q));return}(E.selectable||e.elementsSelectable&&typeof E.selectable>"u")&&(e.selectionRect=null,e.selectionRectMode=null,E.selected?E.selected&&e.multiselectionKeyPressed&&D({nodes:[],edges:[E]}):C([Q]))}function I(Q,E){const{nodeExtent:M,snapGrid:m,nodeOrigin:N,nodeLookup:P,nodesDraggable:B,onerror:$}=e,R=new Map,H=(m==null?void 0:m[0])??5,V=(m==null?void 0:m[1])??5,j=Q.x*H*E,F=Q.y*V*E;for(const ae of P.values()){if(!(ae.selected&&(ae.draggable||B&&typeof ae.draggable>"u")))continue;let se={x:ae.internals.positionAbsolute.x+j,y:ae.internals.positionAbsolute.y+F};m&&(se=uo(se,m));const{position:J,positionAbsolute:Y}=Hd({nodeId:ae.id,nextPosition:se,nodeLookup:P,nodeExtent:M,nodeOrigin:N,onError:$});ae.position=J,ae.internals.positionAbsolute=Y,R.set(ae.id,ae)}s(R)}function te(Q){return t3({delta:Q,panZoom:e.panZoom,transform:[e.viewport.x,e.viewport.y,e.viewport.zoom],translateExtent:e.translateExtent,width:e.width,height:e.height})}const le=Q=>{e._connection={...Q}};function oe(){e._connection=gs}function ee(){e.resetStoreValues(),D()}return Object.assign(e,{setNodeTypes:r,setEdgeTypes:a,addEdge:o,updateNodePositions:s,updateNodeInternals:i,zoomIn:p,zoomOut:b,fitView:d,setCenter:f,setMinZoom:h,setMaxZoom:w,setTranslateExtent:S,unselectNodesAndEdges:D,addSelectedNodes:W,addSelectedEdges:C,handleNodeSelection:G,handleEdgeSelection:X,moveSelectedNodes:I,panBy:te,updateConnection:le,cancelConnection:oe,reset:ee})}function Di(t,e){const{minZoom:r,maxZoom:a,initialViewport:o,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:d,translateExtent:f,setPanZoomInstance:g,onDraggingChange:p,onTransformChange:b}=e,h=x3({domNode:t,minZoom:r,maxZoom:a,translateExtent:f,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:d,onDraggingChange:p}),w=h.getViewport();return(o.x!==w.x||o.y!==w.y||o.zoom!==w.zoom)&&b([w.x,w.y,w.zoom]),g(h),h.update(e),{update(S){h.update(S)}}}var Y3=x('<div class="svelte-flow__zoom svelte-flow__container"><!></div>');function X3(t,e){it(e,!0);let r=Ge(e,"store",15),a=y(()=>r().panActivationKeyPressed||e.panOnDrag),o=y(()=>r().panActivationKeyPressed||e.panOnScroll);const{viewport:s}=r();let i=!1;Xt(()=>{var g;!i&&r().viewportInitialized&&((g=e.oninit)==null||g.call(e),i=!0)});var d=Y3(),f=c(d);pn(f,()=>e.children),l(d),Hn(d,(g,p)=>Di==null?void 0:Di(g,p),()=>({viewport:r().viewport,minZoom:r().minZoom,maxZoom:r().maxZoom,initialViewport:s,onDraggingChange:g=>{r(r().dragging=g,!0)},setPanZoomInstance:g=>{r(r().panZoom=g,!0)},onPanZoomStart:e.onmovestart,onPanZoom:e.onmove,onPanZoomEnd:e.onmoveend,zoomOnScroll:e.zoomOnScroll,zoomOnDoubleClick:e.zoomOnDoubleClick,zoomOnPinch:e.zoomOnPinch,panOnScroll:n(o),panOnDrag:n(a),panOnScrollSpeed:e.panOnScrollSpeed,panOnScrollMode:e.panOnScrollMode,zoomActivationKeyPressed:r().zoomActivationKeyPressed,preventScrolling:typeof e.preventScrolling=="boolean"?e.preventScrolling:!0,noPanClassName:r().noPanClass,noWheelClassName:r().noWheelClass,userSelectionActive:!!r().selectionRect,translateExtent:r().translateExtent,lib:"svelte",paneClickDistance:e.paneClickDistance,selectionOnDrag:e.selectionOnDrag,onTransformChange:g=>{r(r().viewport={x:g[0],y:g[1],zoom:g[2]},!0)},connectionInProgress:r().connection.inProgress})),v(t,d),st()}function lc(t,e){return r=>{r.target===e&&(t==null||t(r))}}function cc(t){return e=>{const r=t.has(e.id);return!!e.selected!==r?{...e,selected:r}:e}}function dc(t,e){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}var Z3=x("<div><!></div>");function Q3(t,e){it(e,!0);let r=Ge(e,"store",15),a=Ge(e,"panOnDrag",3,!0),o=Ge(e,"paneClickDistance",3,1),s,i=null,d=new Set,f=new Set,g=y(()=>r().panActivationKeyPressed||a()),p=y(()=>r().selectionKeyPressed||!!r().selectionRect||e.selectionOnDrag&&n(g)!==!0),b=y(()=>r().elementsSelectable&&(n(p)||r().selectionRectMode==="user")),h=!1;function w(oe){var m,N;if(i=s==null?void 0:s.getBoundingClientRect(),!i)return;const ee=oe.target===s,ve=!ee&&!!oe.target.closest(".nokey"),Q=e.selectionOnDrag&&ee||r().selectionKeyPressed;if(ve||!n(p)||!Q||oe.button!==0||!oe.isPrimary)return;(N=(m=oe.target)==null?void 0:m.setPointerCapture)==null||N.call(m,oe.pointerId),h=!1;const{x:E,y:M}=ir(oe,i);r(r().selectionRect={width:0,height:0,startX:E,startY:M,x:E,y:M},!0),ee||(oe.stopPropagation(),oe.preventDefault())}function S(oe){var P;if(!n(p)||!i||!r().selectionRect)return;const ee=ir(oe,i),{startX:ve=0,startY:Q=0}=r().selectionRect;if(!h){const B=r().selectionKeyPressed?0:o();if(Math.hypot(ee.x-ve,ee.y-Q)<=B)return;r().unselectNodesAndEdges(),(P=e.onselectionstart)==null||P.call(e,oe)}h=!0;const E={...r().selectionRect,x:ee.x<ve?ee.x:ve,y:ee.y<Q?ee.y:Q,width:Math.abs(ee.x-ve),height:Math.abs(ee.y-Q)},M=d,m=f;d=new Set($s(r().nodeLookup,E,[r().viewport.x,r().viewport.y,r().viewport.zoom],r().selectionMode===Wo.Partial,!0).map(B=>B.id));const N=r().defaultEdgeOptions.selectable??!0;f=new Set;for(const B of d){const $=r().connectionLookup.get(B);if($)for(const{edgeId:R}of $.values()){const H=r().edgeLookup.get(R);H&&(H.selectable??N)&&f.add(R)}}dc(M,d)||r(r().nodes=r().nodes.map(cc(d)),!0),dc(m,f)||r(r().edges=r().edges.map(cc(f)),!0),r(r().selectionRectMode="user",!0),r(r().selectionRect=E,!0)}function A(oe){var ee,ve,Q;oe.button===0&&((ve=(ee=oe.target)==null?void 0:ee.releasePointerCapture)==null||ve.call(ee,oe.pointerId),!h&&oe.target===s&&(C==null||C(oe)),r(r().selectionRect=null,!0),h&&r(r().selectionRectMode=d.size>0?"nodes":null,!0),h&&((Q=e.onselectionend)==null||Q.call(e,oe)))}const D=oe=>{var ee;if(Array.isArray(n(g))&&n(g).includes(2)){oe.preventDefault();return}(ee=e.onpanecontextmenu)==null||ee.call(e,{event:oe})},W=oe=>{h&&(oe.stopPropagation(),h=!1)};function C(oe){var ee;if(h||r().connection.inProgress){h=!1;return}(ee=e.onpaneclick)==null||ee.call(e,{event:oe}),r().unselectNodesAndEdges(),r(r().selectionRectMode=null,!0),r(r().selectionRect=null,!0)}var G=Z3();let X;var I=y(()=>n(b)?void 0:lc(C,s)),te=y(()=>lc(D,s)),le=c(G);pn(le,()=>e.children),l(G),sr(G,oe=>s=oe,()=>s),L(oe=>X=De(G,1,"svelte-flow__pane svelte-flow__container",null,X,oe),[()=>({draggable:a()===!0||Array.isArray(a())&&a().includes(0),dragging:r().dragging,selection:n(p)})]),ke("click",G,function(...oe){var ee;(ee=n(I))==null||ee.apply(this,oe)}),Sr("pointerdown",G,function(...oe){var ee;(ee=n(b)?w:void 0)==null||ee.apply(this,oe)},!0),ke("pointermove",G,function(...oe){var ee;(ee=n(b)?S:void 0)==null||ee.apply(this,oe)}),ke("pointerup",G,function(...oe){var ee;(ee=n(b)?A:void 0)==null||ee.apply(this,oe)}),ke("contextmenu",G,function(...oe){var ee;(ee=n(te))==null||ee.apply(this,oe)}),Sr("click",G,function(...oe){var ee;(ee=n(b)?W:void 0)==null||ee.apply(this,oe)},!0),v(t,G),st()}en(["click","pointermove","pointerup","contextmenu"]);var J3=x('<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>');function ek(t,e){it(e,!0);var r=J3();let a;var o=c(r);pn(o,()=>e.children),l(r),L(()=>a=kn(r,"",a,{transform:`translate(${e.store.viewport.x??""}px, ${e.store.viewport.y??""}px) scale(${e.store.viewport.zoom??""})`})),v(t,r),st()}function ua(t,e){const{store:r,onDrag:a,onDragStart:o,onDragStop:s,onNodeMouseDown:i}=e,d=o3({onDrag:a,onDragStart:o,onDragStop:s,onNodeMouseDown:i,getStoreItems:()=>{const{snapGrid:g,viewport:p}=r;return{nodes:r.nodes,nodeLookup:r.nodeLookup,edges:r.edges,nodeExtent:r.nodeExtent,snapGrid:g||[0,0],snapToGrid:!!g,nodeOrigin:r.nodeOrigin,multiSelectionActive:r.multiselectionKeyPressed,domNode:r.domNode,transform:[p.x,p.y,p.zoom],autoPanOnNodeDrag:r.autoPanOnNodeDrag,nodesDraggable:r.nodesDraggable,selectNodesOnDrag:r.selectNodesOnDrag,nodeDragThreshold:r.nodeDragThreshold,unselectNodesAndEdges:r.unselectNodesAndEdges,updateNodePositions:r.updateNodePositions,onSelectionDrag:r.onselectiondrag,onSelectionDragStart:r.onselectiondragstart,onSelectionDragStop:r.onselectiondragstop,panBy:r.panBy}}});function f(g,p){if(p.disabled){d.destroy();return}d.update({domNode:g,noDragClassName:p.noDragClass,handleSelector:p.handleSelector,nodeId:p.nodeId,isSelectable:p.isSelectable,nodeClickDistance:p.nodeClickDistance})}return f(t,e),{update(g){f(t,g)},destroy(){d.destroy()}}}var tk=x('<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-1r7ybe1"> </div>'),nk=x('<div class="a11y-hidden svelte-1r7ybe1"> </div> <div class="a11y-hidden svelte-1r7ybe1"> </div> <!>',1);function rk(t,e){it(e,!0);var r=nk(),a=fe(r),o=c(a,!0);l(a);var s=u(a,2),i=c(s,!0);l(s);var d=u(s,2);{var f=g=>{var p=tk(),b=c(p,!0);l(p),L(()=>{Ae(p,"id",`${ak}-${e.store.flowId}`),k(b,e.store.ariaLiveMessage)}),v(g,p)};K(d,g=>{e.store.disableKeyboardA11y||g(f)})}L(()=>{Ae(a,"id",`${cu}-${e.store.flowId}`),k(o,e.store.disableKeyboardA11y?e.store.ariaLabelConfig["node.a11yDescription.default"]:e.store.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]),Ae(s,"id",`${du}-${e.store.flowId}`),k(i,e.store.ariaLabelConfig["edge.a11yDescription.default"])}),v(t,r),st()}const cu="svelte-flow__node-desc",du="svelte-flow__edge-desc",ak="svelte-flow__aria-live";var ok=x("<div><!></div>");function ik(t,e){it(e,!0);let r=Ge(e,"store",15),a=y(()=>Vn(e.node.data,()=>({}),!0)),o=y(()=>Vn(e.node.selected,!1)),s=y(()=>e.node.draggable),i=y(()=>e.node.selectable),d=y(()=>Vn(e.node.deletable,!0)),f=y(()=>e.node.connectable),g=y(()=>e.node.focusable),p=y(()=>Vn(e.node.hidden,!1)),b=y(()=>Vn(e.node.dragging,!1)),h=y(()=>Vn(e.node.style,"")),w=y(()=>e.node.class),S=y(()=>Vn(e.node.type,"default")),A=y(()=>e.node.parentId),D=y(()=>e.node.sourcePosition),W=y(()=>e.node.targetPosition),C=y(()=>Vn(e.node.measured,()=>({width:0,height:0}),!0).width),G=y(()=>Vn(e.node.measured,()=>({width:0,height:0}),!0).height),X=y(()=>e.node.initialWidth),I=y(()=>e.node.initialHeight),te=y(()=>e.node.width),le=y(()=>e.node.height),oe=y(()=>e.node.dragHandle),ee=y(()=>Vn(e.node.internals.z,0)),ve=y(()=>e.node.internals.positionAbsolute.x),Q=y(()=>e.node.internals.positionAbsolute.y),E=y(()=>e.node.internals.userNode),{id:M}=e.node,m=y(()=>n(s)??r().nodesDraggable),N=y(()=>n(i)??r().elementsSelectable),P=y(()=>n(f)??r().nodesConnectable),B=y(()=>Aw(e.node)),$=y(()=>!!e.node.internals.handleBounds),R=y(()=>n(B)&&n($)),H=y(()=>n(g)??r().nodesFocusable);function V(he){return r().parentLookup.has(he)}let j=y(()=>V(M)),F=we(null),ae=null,be=n(S),se=n(D),J=n(W),Y=y(()=>r().nodeTypes[n(S)]??ou),Z=y(()=>r().ariaLabelConfig),T={get value(){return n(P)}};_3(M),w3(T);let q=y(()=>{const he=n(C)===void 0?n(te)??n(X):n(te),me=n(G)===void 0?n(le)??n(I):n(le);if(!(he===void 0&&me===void 0&&n(h)===void 0))return`${n(h)};${he?`width:${gr(he)};`:""}${me?`height:${gr(me)};`:""}`});Xt(()=>{(n(S)!==be||n(D)!==se||n(W)!==J)&&n(F)!==null&&requestAnimationFrame(()=>{n(F)!==null&&r().updateNodeInternals(new Map([[M,{id:M,nodeElement:n(F),force:!0}]]))}),be=n(S),se=n(D),J=n(W)}),Xt(()=>{e.resizeObserver&&(!n(R)||n(F)!==ae)&&(ae&&e.resizeObserver.unobserve(ae),n(F)&&e.resizeObserver.observe(n(F)),ae=n(F))}),ei(()=>{var he;ae&&((he=e.resizeObserver)==null||he.unobserve(ae))});function O(he){var me;n(N)&&(!r().selectNodesOnDrag||!n(m)||r().nodeDragThreshold>0)&&r().handleNodeSelection(M),(me=e.onnodeclick)==null||me.call(e,{node:n(E),event:he})}function z(he){if(!(Bd(he)||r().disableKeyboardA11y))if(Dd.includes(he.key)&&n(N)){const me=he.key==="Escape";r().handleNodeSelection(M,me,n(F))}else n(m)&&e.node.selected&&Object.prototype.hasOwnProperty.call(Zo,he.key)&&(he.preventDefault(),r(r().ariaLiveMessage=n(Z)["node.a11yDescription.ariaLiveMessage"]({direction:he.key.replace("Arrow","").toLowerCase(),x:~~e.node.internals.positionAbsolute.x,y:~~e.node.internals.positionAbsolute.y}),!0),r().moveSelectedNodes(Zo[he.key],he.shiftKey?4:1))}const U=()=>{var ue;if(r().disableKeyboardA11y||!r().autoPanOnNodeFocus||!((ue=n(F))!=null&&ue.matches(":focus-visible")))return;const{width:he,height:me,viewport:_e}=r();$s(new Map([[M,e.node]]),{x:0,y:0,width:he,height:me},[_e.x,_e.y,_e.zoom],!0).length>0||r().setCenter(e.node.position.x+(e.node.measured.width??0)/2,e.node.position.y+(e.node.measured.height??0)/2,{zoom:_e.zoom})};var ne=Re(),ce=fe(ne);{var xe=he=>{var me=ok();zr(me,()=>({"data-id":M,class:["svelte-flow__node",`svelte-flow__node-${n(S)}`,n(w)],style:n(q),onclick:O,onpointerenter:e.onnodepointerenter?pe=>e.onnodepointerenter({node:n(E),event:pe}):void 0,onpointerleave:e.onnodepointerleave?pe=>e.onnodepointerleave({node:n(E),event:pe}):void 0,onpointermove:e.onnodepointermove?pe=>e.onnodepointermove({node:n(E),event:pe}):void 0,oncontextmenu:e.onnodecontextmenu?pe=>e.onnodecontextmenu({node:n(E),event:pe}):void 0,onkeydown:n(H)?z:void 0,onfocus:n(H)?U:void 0,tabIndex:n(H)?0:void 0,role:e.node.ariaRole??(n(H)?"group":void 0),"aria-roledescription":"node","aria-describedby":r().disableKeyboardA11y?void 0:`${cu}-${r().flowId}`,...e.node.domAttributes,[ks]:{dragging:n(b),selected:n(o),draggable:n(m),connectable:n(P),selectable:n(N),nopan:n(m),parent:n(j)},[ni]:{"z-index":n(ee),transform:`translate(${n(ve)??""}px, ${n(Q)??""}px)`,visibility:n(B)?"visible":"hidden"}}));var _e=c(me);Wr(_e,()=>n(Y),(pe,ue)=>{ue(pe,{get data(){return n(a)},get id(){return M},get selected(){return n(o)},get selectable(){return n(N)},get deletable(){return n(d)},get sourcePosition(){return n(D)},get targetPosition(){return n(W)},get zIndex(){return n(ee)},get dragging(){return n(b)},get draggable(){return n(m)},get dragHandle(){return n(oe)},get parentId(){return n(A)},get type(){return n(S)},get isConnectable(){return n(P)},get positionAbsoluteX(){return n(ve)},get positionAbsoluteY(){return n(Q)},get width(){return n(te)},get height(){return n(le)}})}),l(me),Hn(me,(pe,ue)=>ua==null?void 0:ua(pe,ue),()=>({nodeId:M,isSelectable:n(N),disabled:!n(m),handleSelector:n(oe),noDragClass:r().noDragClass,nodeClickDistance:e.nodeClickDistance,onNodeMouseDown:r().handleNodeSelection,onDrag:(pe,ue,Oe,ie)=>{var de;(de=e.onnodedrag)==null||de.call(e,{event:pe,targetNode:Oe,nodes:ie})},onDragStart:(pe,ue,Oe,ie)=>{var de;(de=e.onnodedragstart)==null||de.call(e,{event:pe,targetNode:Oe,nodes:ie})},onDragStop:(pe,ue,Oe,ie)=>{var de;(de=e.onnodedragstop)==null||de.call(e,{event:pe,targetNode:Oe,nodes:ie})},store:r()})),sr(me,pe=>_(F,pe),()=>n(F)),v(he,me)};K(ce,he=>{n(p)||he(xe)})}v(t,ne),st()}var sk=x('<div class="svelte-flow__nodes"></div>');function lk(t,e){it(e,!0);let r=Ge(e,"store",15);const a=typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const i=new Map;s.forEach(d=>{const f=d.target.getAttribute("data-id");i.set(f,{id:f,nodeElement:d.target,force:!0})}),r().updateNodeInternals(i)});ei(()=>{a==null||a.disconnect()});var o=sk();Xe(o,21,()=>r().visible.nodes.values(),s=>s.id,(s,i)=>{ik(s,{get node(){return n(i)},get resizeObserver(){return a},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 r()},set store(d){r(d)}})}),l(o),v(t,o),st()}var ck=En('<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>');function dk(t,e){it(e,!0);let r=y(()=>e.edge.id),a=y(()=>e.edge.source),o=y(()=>e.edge.target),s=y(()=>e.edge.sourceX),i=y(()=>e.edge.sourceY),d=y(()=>e.edge.targetX),f=y(()=>e.edge.targetY),g=y(()=>e.edge.sourcePosition),p=y(()=>e.edge.targetPosition),b=y(()=>Vn(e.edge.animated,!1)),h=y(()=>Vn(e.edge.selected,!1)),w=y(()=>e.edge.label),S=y(()=>e.edge.labelStyle),A=y(()=>Vn(e.edge.data,()=>({}),!0)),D=y(()=>e.edge.style),W=y(()=>e.edge.interactionWidth),C=y(()=>Vn(e.edge.type,"default")),G=y(()=>e.edge.sourceHandle),X=y(()=>e.edge.targetHandle),I=y(()=>e.edge.markerStart),te=y(()=>e.edge.markerEnd),le=y(()=>e.edge.selectable),oe=y(()=>e.edge.focusable),ee=y(()=>Vn(e.edge.deletable,!0)),ve=y(()=>e.edge.hidden),Q=y(()=>e.edge.zIndex),E=y(()=>e.edge.class),M=y(()=>e.edge.ariaLabel);S3(n(r));let m=null,N=y(()=>n(le)??e.store.elementsSelectable),P=y(()=>n(oe)??e.store.edgesFocusable),B=y(()=>e.store.edgeTypes[n(C)]??iu),$=y(()=>n(I)?`url('#${hs(n(I),e.store.flowId)}')`:void 0),R=y(()=>n(te)?`url('#${hs(n(te),e.store.flowId)}')`:void 0);function H(se){var Y;const J=e.store.edgeLookup.get(n(r));J&&(n(N)&&e.store.handleEdgeSelection(n(r)),(Y=e.onedgeclick)==null||Y.call(e,{event:se,edge:J}))}function V(se,J){const Y=e.store.edgeLookup.get(n(r));Y&&J({event:se,edge:Y})}function j(se){if(!e.store.disableKeyboardA11y&&Dd.includes(se.key)&&n(N)){const{unselectNodesAndEdges:J,addSelectedEdges:Y}=e.store;se.key==="Escape"?(m==null||m.blur(),J({edges:[e.edge]})):Y([n(r)])}}var F=Re(),ae=fe(F);{var be=se=>{var J=ck();let Y;var Z=c(J);zr(Z,()=>({class:["svelte-flow__edge",n(E)],"data-id":n(r),onclick:H,oncontextmenu:e.onedgecontextmenu?q=>{V(q,e.onedgecontextmenu)}:void 0,onpointerenter:e.onedgepointerenter?q=>{V(q,e.onedgepointerenter)}:void 0,onpointerleave:e.onedgepointerleave?q=>{V(q,e.onedgepointerleave)}:void 0,"aria-label":n(M)===null?void 0:n(M)?n(M):`Edge from ${n(a)} to ${n(o)}`,"aria-describedby":n(P)?`${du}-${e.store.flowId}`:void 0,role:e.edge.ariaRole??(n(P)?"group":"img"),"aria-roledescription":"edge",onkeydown:n(P)?j:void 0,tabindex:n(P)?0:void 0,...e.edge.domAttributes,[ks]:{animated:n(b),selected:n(h),selectable:n(N)}}));var T=c(Z);Wr(T,()=>n(B),(q,O)=>{O(q,{get id(){return n(r)},get source(){return n(a)},get target(){return n(o)},get sourceX(){return n(s)},get sourceY(){return n(i)},get targetX(){return n(d)},get targetY(){return n(f)},get sourcePosition(){return n(g)},get targetPosition(){return n(p)},get animated(){return n(b)},get selected(){return n(h)},get label(){return n(w)},get labelStyle(){return n(S)},get data(){return n(A)},get style(){return n(D)},get interactionWidth(){return n(W)},get selectable(){return n(N)},get deletable(){return n(ee)},get type(){return n(C)},get sourceHandleId(){return n(G)},get targetHandleId(){return n(X)},get markerStart(){return n($)},get markerEnd(){return n(R)}})}),l(Z),sr(Z,q=>m=q,()=>m),l(J),L(()=>Y=kn(J,"",Y,{"z-index":n(Q)})),v(se,J)};K(ae,se=>{n(ve)||se(be)})}v(t,F),st()}var uk=En("<defs></defs>");function fk(t,e){it(e,!1);const r=Xr();kc();var a=uk();Xe(a,5,()=>r.markers,o=>o.id,(o,s)=>{hk(o,lt(()=>n(s)))}),l(a),v(t,a),st()}var vk=En('<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>'),gk=En('<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),pk=En('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function hk(t,e){it(e,!0);let r=Ge(e,"width",3,12.5),a=Ge(e,"height",3,12.5),o=Ge(e,"markerUnits",3,"strokeWidth"),s=Ge(e,"orient",3,"auto-start-reverse"),i=Ge(e,"color",3,"none");var d=pk(),f=c(d);{var g=b=>{var h=vk();let w;L(()=>{Ae(h,"stroke-width",e.strokeWidth),w=kn(h,"",w,{stroke:i()})}),v(b,h)},p=b=>{var h=gk();let w;L(()=>{Ae(h,"stroke-width",e.strokeWidth),w=kn(h,"",w,{stroke:i(),fill:i()})}),v(b,h)};K(f,b=>{e.type===Uo.Arrow?b(g):e.type===Uo.ArrowClosed&&b(p,1)})}l(d),L(()=>{Ae(d,"id",e.id),Ae(d,"markerWidth",`${r()}`),Ae(d,"markerHeight",`${a()}`),Ae(d,"markerUnits",o()),Ae(d,"orient",s())}),v(t,d),st()}var bk=x('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>');function xk(t,e){it(e,!0);let r=Ge(e,"store",15);var a=bk(),o=c(a),s=c(o);fk(s,{}),l(o);var i=u(o,2);Xe(i,17,()=>r().visible.edges.values(),d=>d.id,(d,f)=>{dk(d,{get edge(){return n(f)},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(g){r(g)}})}),l(a),v(t,a),st()}var mk=x('<div class="svelte-flow__selection svelte-3lfgml"></div>');function uu(t,e){it(e,!0);let r=Ge(e,"x",3,0),a=Ge(e,"y",3,0),o=Ge(e,"width",3,0),s=Ge(e,"height",3,0),i=Ge(e,"isVisible",3,!0);var d=Re(),f=fe(d);{var g=p=>{var b=mk();let h;L(w=>h=kn(b,"",h,w),[()=>({width:typeof o()=="string"?o():gr(o()),height:typeof s()=="string"?s():gr(s()),transform:`translate(${r()}px, ${a()}px)`})]),v(p,b)};K(f,p=>{i()&&p(g)})}v(t,d),st()}var _k=x("<div><!></div>");function yk(t,e){it(e,!0);let r=we(void 0);Xt(()=>{var b;e.store.disableKeyboardA11y||(b=n(r))==null||b.focus({preventScroll:!0})});let a=y(()=>{if(e.store.selectionRectMode==="nodes"){e.store.nodes;const b=ci(e.store.nodeLookup,{filter:h=>!!h.selected});if(b.width>0&&b.height>0)return b}return null});function o(b){var w;const h=e.store.nodes.filter(S=>S.selected);(w=e.onselectioncontextmenu)==null||w.call(e,{nodes:h,event:b})}function s(b){var w;const h=e.store.nodes.filter(S=>S.selected);(w=e.onselectionclick)==null||w.call(e,{nodes:h,event:b})}function i(b){Object.prototype.hasOwnProperty.call(Zo,b.key)&&(b.preventDefault(),e.store.moveSelectedNodes(Zo[b.key],b.shiftKey?4:1))}var d=Re(),f=fe(d);{var g=b=>{var h=_k();let w;var S=c(h);uu(S,{width:"100%",height:"100%",x:0,y:0}),l(h),Hn(h,(A,D)=>ua==null?void 0:ua(A,D),()=>({disabled:!1,store:e.store,onDrag:(A,D,W,C)=>{var G;(G=e.onnodedrag)==null||G.call(e,{event:A,targetNode:null,nodes:C})},onDragStart:(A,D,W,C)=>{var G;(G=e.onnodedragstart)==null||G.call(e,{event:A,targetNode:null,nodes:C})},onDragStop:(A,D,W,C)=>{var G;(G=e.onnodedragstop)==null||G.call(e,{event:A,targetNode:null,nodes:C})}})),sr(h,A=>_(r,A),()=>n(r)),L(A=>{De(h,1,je(["svelte-flow__selection-wrapper",e.store.noPanClass]),"svelte-148ck9l"),Ae(h,"role",e.store.disableKeyboardA11y?void 0:"button"),Ae(h,"tabindex",e.store.disableKeyboardA11y?void 0:-1),w=kn(h,"",w,A)},[()=>({width:gr(n(a).width),height:gr(n(a).height),transform:`translate(${n(a).x??""}px, ${n(a).y??""}px)`})]),ke("contextmenu",h,o),ke("click",h,s),ke("keydown",h,function(...A){var D;(D=e.store.disableKeyboardA11y?void 0:i)==null||D.apply(this,A)}),v(b,h)},p=y(()=>e.store.selectionRectMode==="nodes"&&n(a)&&wr(n(a).x)&&wr(n(a).y));K(f,b=>{n(p)&&b(g)})}v(t,d),st()}en(["contextmenu","click","keydown"]);function wk(t){switch(t){case"ctrl":return 8;case"shift":return 4;case"alt":return 2;case"meta":return 1}}function rn(t,e){let{enabled:r=!0,trigger:a,type:o="keydown"}=e;function s(d){var p;const f=Array.isArray(a)?a:[a],g=[d.metaKey,d.altKey,d.shiftKey,d.ctrlKey].reduce((b,h,w)=>h?b|1<<w:b,0);for(const b of f){const h={preventDefault:!1,enabled:!0,...b},{modifier:w,key:S,callback:A,preventDefault:D,enabled:W}=h;if(W){if(d.key!==S)continue;if(w===null||w===!1){if(g!==0)continue}else if(w!==void 0&&((p=w==null?void 0:w[0])==null?void 0:p.length)>0){const G=Array.isArray(w)?w:[w];let X=!1;for(const I of G)if((Array.isArray(I)?I:[I]).reduce((le,oe)=>le|wk(oe),0)===g){X=!0;break}if(!X)continue}D&&d.preventDefault();const C={node:t,trigger:h,originalEvent:d};t.dispatchEvent(new CustomEvent("shortcut",{detail:C})),A==null||A(C)}}}let i;return r&&(i=Bi(t,o,s)),{update:d=>{const{enabled:f=!0,type:g="keydown"}=d;r&&(!f||o!==g)?i==null||i():!r&&f&&(i=Bi(t,g,s)),r=f,o=g,a=d.trigger},destroy:()=>{i==null||i()}}}function kk(){const t=y(Xr),e=s=>{var g,p;const i=ic(s)?s:n(t).nodeLookup.get(s.id),d=i.parentId?Pw(i.position,i.measured,i.parentId,n(t).nodeLookup,n(t).nodeOrigin):i.position,f={...i,position:d,width:((g=i.measured)==null?void 0:g.width)??i.width,height:((p=i.measured)==null?void 0:p.height)??i.height};return xa(f)};function r(s,i,d={replace:!1}){n(t).nodes=_r(()=>n(t).nodes).map(f=>{if(f.id===s){const g=typeof i=="function"?i(f):i;return d!=null&&d.replace&&ic(g)?g:{...f,...g}}return f})}function a(s,i,d={replace:!1}){n(t).edges=_r(()=>n(t).edges).map(f=>{if(f.id===s){const g=typeof i=="function"?i(f):i;return d.replace&&L3(g)?g:{...f,...g}}return f})}const o=s=>n(t).nodeLookup.get(s);return{zoomIn:n(t).zoomIn,zoomOut:n(t).zoomOut,getInternalNode:o,getNode:s=>{var i;return(i=o(s))==null?void 0:i.internals.userNode},getNodes:s=>s===void 0?n(t).nodes:uc(n(t).nodeLookup,s),getEdge:s=>n(t).edgeLookup.get(s),getEdges:s=>s===void 0?n(t).edges:uc(n(t).edgeLookup,s),setZoom:(s,i)=>{const d=n(t).panZoom;return d?d.scaleTo(s,i):Promise.resolve(!1)},getZoom:()=>n(t).viewport.zoom,setViewport:async(s,i)=>{const d=n(t).viewport;return n(t).panZoom?(await n(t).panZoom.setViewport({x:s.x??d.x,y:s.y??d.y,zoom:s.zoom??d.zoom},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>Ec(n(t).viewport),setCenter:async(s,i,d)=>n(t).setCenter(s,i,d),fitView:s=>n(t).fitView(s),fitBounds:async(s,i)=>{if(!n(t).panZoom)return Promise.resolve(!1);const d=Ds(s,n(t).width,n(t).height,n(t).minZoom,n(t).maxZoom,(i==null?void 0:i.padding)??.1);return await n(t).panZoom.setViewport(d,{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,d)=>{const f=Gl(s),g=f?s:e(s);return g?(d||n(t).nodes).filter(p=>{const b=n(t).nodeLookup.get(p.id);if(!b||!f&&p.id===s.id)return!1;const h=xa(b),w=Ga(h,g);return i&&w>0||w>=h.width*h.height||w>=g.width*g.height}):[]},isNodeIntersecting:(s,i,d=!0)=>{const g=Gl(s)?s:e(s);if(!g)return!1;const p=Ga(g,i);return d&&p>0||p>=i.width*i.height||p>=g.width*g.height},deleteElements:async({nodes:s=[],edges:i=[]})=>{var g,p;const{nodes:d,edges:f}=await Ew({nodesToRemove:s,edgesToRemove:i,nodes:n(t).nodes,edges:n(t).edges,onBeforeDelete:n(t).onbeforedelete});return d&&(n(t).nodes=_r(()=>n(t).nodes).filter(b=>!d.some(({id:h})=>h===b.id))),f&&(n(t).edges=_r(()=>n(t).edges).filter(b=>!f.some(({id:h})=>h===b.id))),(d.length>0||f.length>0)&&((p=(g=n(t)).ondelete)==null||p.call(g,{nodes:d,edges:f})),{deletedNodes:d,deletedEdges:f}},screenToFlowPosition:(s,i={snapToGrid:!0})=>{if(!n(t).domNode)return s;const d=i.snapToGrid?n(t).snapGrid:!1,{x:f,y:g,zoom:p}=n(t).viewport,{x:b,y:h}=n(t).domNode.getBoundingClientRect(),w={x:s.x-b,y:s.y-h};return fo(w,[f,g,p],d!==null,d||[1,1])},flowToScreenPosition:s=>{if(!n(t).domNode)return s;const{x:i,y:d,zoom:f}=n(t).viewport,{x:g,y:p}=n(t).domNode.getBoundingClientRect(),b=Yo(s,[i,d,f]);return{x:b.x+g,y:b.y+p}},toObject:()=>structuredClone({nodes:[...n(t).nodes],edges:[...n(t).edges],viewport:{...n(t).viewport}}),updateNode:r,updateNodeData:(s,i,d)=>{var p;const f=(p=n(t).nodeLookup.get(s))==null?void 0:p.internals.userNode;if(!f)return;const g=typeof i=="function"?i(f):i;r(s,b=>({...b,data:d!=null&&d.replace?g:{...b.data,...g}}))},updateEdge:a,getNodesBounds:s=>ww(s,{nodeLookup:n(t).nodeLookup,nodeOrigin:n(t).nodeOrigin}),getHandleConnections:({type:s,id:i,nodeId:d})=>{var f;return Array.from(((f=n(t).connectionLookup.get(`${d}-${s}-${i??null}`))==null?void 0:f.values())??[])}}}function uc(t,e){var a;const r=[];for(const o of e){const s=t.get(o);if(s){const i="internals"in s?(a=s.internals)==null?void 0:a.userNode:s;r.push(i)}}return r}function Sk(t,e){it(e,!0);let r=Ge(e,"store",15),a=Ge(e,"selectionKey",3,"Shift"),o=Ge(e,"multiSelectionKey",19,()=>Xo()?"Meta":"Control"),s=Ge(e,"deleteKey",3,"Backspace"),i=Ge(e,"panActivationKey",3," "),d=Ge(e,"zoomActivationKey",19,()=>Xo()?"Meta":"Control"),{deleteElements:f}=kk();function g(A){return A!==null&&typeof A=="object"}function p(A){return g(A)?A.modifier||[]:[]}function b(A){return A==null?"":g(A)?A.key:A}function h(A,D){return(Array.isArray(A)?A:[A]).map(C=>{const G=b(C);return{key:G,modifier:p(C),enabled:G!==null,callback:D}})}function w(){r(r().selectionRect=null,!0),r(r().selectionKeyPressed=!1,!0),r(r().multiselectionKeyPressed=!1,!0),r(r().deleteKeyPressed=!1,!0),r(r().panActivationKeyPressed=!1,!0),r(r().zoomActivationKeyPressed=!1,!0)}function S(){const A=r().nodes.filter(W=>W.selected),D=r().edges.filter(W=>W.selected);f({nodes:A,edges:D})}Sr("blur",jn,w),Sr("contextmenu",jn,w),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(a(),()=>r(r().selectionKeyPressed=!0,!0)),type:"keydown"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(a(),()=>r(r().selectionKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(o(),()=>{r(r().multiselectionKeyPressed=!0,!0)}),type:"keydown"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(o(),()=>r(r().multiselectionKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(s(),A=>{!(A.originalEvent.ctrlKey||A.originalEvent.metaKey||A.originalEvent.shiftKey)&&!Bd(A.originalEvent)&&(r(r().deleteKeyPressed=!0,!0),S())}),type:"keydown"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(s(),()=>r(r().deleteKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(i(),()=>r(r().panActivationKeyPressed=!0,!0)),type:"keydown"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(i(),()=>r(r().panActivationKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(d(),()=>r(r().zoomActivationKeyPressed=!0,!0)),type:"keydown"})),Hn(jn,(A,D)=>rn==null?void 0:rn(A,D),()=>({trigger:h(d(),()=>r(r().zoomActivationKeyPressed=!1,!0)),type:"keyup"})),st()}var Ck=En('<path fill="none" class="svelte-flow__connection-path"></path>'),Ek=En('<svg class="svelte-flow__connectionline"><g><!></g></svg>');function Nk(t,e){it(e,!0);let r=y(()=>{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 Nr.Bezier:{const[d]=Ud(i);return d}case Nr.Straight:{const[d]=Yd(i);return d}case Nr.Step:case Nr.SmoothStep:{const[d]=Vs({...i,borderRadius:e.type===Nr.Step?0:void 0});return d}}});var a=Re(),o=fe(a);{var s=i=>{var d=Ek(),f=c(d),g=c(f);{var p=h=>{var w=Re(),S=fe(w);Wr(S,()=>e.LineComponent,(A,D)=>{D(A,{})}),v(h,w)},b=h=>{var w=Ck();L(()=>{Ae(w,"d",n(r)),kn(w,e.style)}),v(h,w)};K(g,h=>{e.LineComponent?h(p):h(b,-1)})}l(f),l(d),L(h=>{Ae(d,"width",e.store.width),Ae(d,"height",e.store.height),kn(d,e.containerStyle),De(f,0,h)},[()=>je(["svelte-flow__connection",_w(e.store.connection.isValid)])]),v(i,d)};K(o,i=>{e.store.connection.inProgress&&i(s)})}v(t,a),st()}var Mk=x("<div><!></div>");function fu(t,e){it(e,!0);let r=Ge(e,"position",3,"top-right"),a=Ur(e,["$$slots","$$events","$$legacy","position","style","class","children"]),o=y(()=>`${r()}`.split("-"));var s=Mk();zr(s,d=>({class:d,style:e.style,...a}),[()=>["svelte-flow__panel",e.class,...n(o)]]);var i=c(s);pn(i,()=>e.children??Kn),l(s),v(t,s),st()}var Tk=x('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function zk(t,e){it(e,!0);let r=Ge(e,"position",3,"bottom-right");var a=Re(),o=fe(a);{var s=i=>{fu(i,{get position(){return r()},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:(d,f)=>{var g=Tk();v(d,g)},$$slots:{default:!0}})};K(o,i=>{var d;(d=e.proOptions)!=null&&d.hideAttribution||i(s)})}v(t,a),st()}var Ak=x("<div><!></div>");function Pk(t,e){it(e,!0);let r=Ge(e,"domNode",15),a=Ge(e,"clientWidth",15),o=Ge(e,"clientHeight",15),s=y(()=>e.rest.class),i=y(()=>Qu(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 d(p){p.currentTarget.scrollTo({top:0,left:0,behavior:"auto"}),e.rest.onscroll&&e.rest.onscroll(p)}var f=Ak();zr(f,p=>({class:["svelte-flow","svelte-flow__container",n(s),e.colorMode],"data-testid":"svelte-flow__wrapper",role:"application",onscroll:d,...n(i),[ni]:p}),[()=>({width:gr(e.width),height:gr(e.height)})],void 0,void 0,"svelte-1ywk9tc");var g=c(f);pn(g,()=>e.children??Kn),l(f),sr(f,p=>r(p),()=>r()),rl(f,"clientHeight",o),rl(f,"clientWidth",a),v(t,f),st()}var Lk=x('<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),Ik=x("<!> <!>",1),Ok=x("<!> <!> <!> <!> <!>",1);function Rk(t,e){it(e,!0);let r=Ge(e,"paneClickDistance",3,1),a=Ge(e,"nodeClickDistance",3,1),o=Ge(e,"panOnScrollMode",19,()=>da.Free),s=Ge(e,"preventScrolling",3,!0),i=Ge(e,"zoomOnScroll",3,!0),d=Ge(e,"zoomOnDoubleClick",3,!0),f=Ge(e,"zoomOnPinch",3,!0),g=Ge(e,"panOnScroll",3,!1),p=Ge(e,"panOnScrollSpeed",3,.5),b=Ge(e,"panOnDrag",3,!0),h=Ge(e,"selectionOnDrag",3,!1),w=Ge(e,"connectionLineType",19,()=>Nr.Bezier),S=Ge(e,"nodes",31,()=>Kt([])),A=Ge(e,"edges",31,()=>Kt([])),D=Ge(e,"viewport",15,void 0),W=Ur(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"]),C=G3({props:W,width:e.width,height:e.height,get nodes(){return S()},set nodes(X){S(X)},get edges(){return A()},set edges(X){A(X)},get viewport(){return D()},set viewport(X){D(X)}});const G=ti(bs);G&&G.setStore&&G.setStore(C),ws(bs,{provider:!1,getStore(){return C}}),Xt(()=>{var I;const X={nodes:C.selectedNodes,edges:C.selectedEdges};(I=_r(()=>e.onselectionchange))==null||I(X);for(const te of C.selectionChangeHandlers.values())te(X)}),ei(()=>{C.reset()}),Pk(t,{get colorMode(){return C.colorMode},get width(){return e.width},get height(){return e.height},get rest(){return W},get domNode(){return C.domNode},set domNode(X){C.domNode=X},get clientWidth(){return C.width},set clientWidth(X){C.width=X},get clientHeight(){return C.height},set clientHeight(X){C.height=X},children:(X,I)=>{var te=Ok(),le=fe(te);Sk(le,{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 C},set store(E){C=E}});var oe=u(le,2);X3(oe,{get panOnScrollMode(){return o()},get preventScrolling(){return s()},get zoomOnScroll(){return i()},get zoomOnDoubleClick(){return d()},get zoomOnPinch(){return f()},get panOnScroll(){return g()},get panOnScrollSpeed(){return p()},get panOnDrag(){return b()},get paneClickDistance(){return r()},get selectionOnDrag(){return h()},get onmovestart(){return e.onmovestart},get onmove(){return e.onmove},get onmoveend(){return e.onmoveend},get oninit(){return e.oninit},get store(){return C},set store(E){C=E},children:(E,M)=>{Q3(E,{get onpaneclick(){return e.onpaneclick},get onpanecontextmenu(){return e.onpanecontextmenu},get onselectionstart(){return e.onselectionstart},get onselectionend(){return e.onselectionend},get panOnDrag(){return b()},get paneClickDistance(){return r()},get selectionOnDrag(){return h()},get store(){return C},set store(m){C=m},children:(m,N)=>{var P=Ik(),B=fe(P);ek(B,{get store(){return C},set store(R){C=R},children:(R,H)=>{var V=Lk(),j=u(fe(V),2);xk(j,{get onedgeclick(){return e.onedgeclick},get onedgecontextmenu(){return e.onedgecontextmenu},get onedgepointerenter(){return e.onedgepointerenter},get onedgepointerleave(){return e.onedgepointerleave},get store(){return C},set store(se){C=se}});var F=u(j,4);Nk(F,{get type(){return w()},get LineComponent(){return e.connectionLineComponent},get containerStyle(){return e.connectionLineContainerStyle},get style(){return e.connectionLineStyle},get store(){return C},set store(se){C=se}});var ae=u(F,2);lk(ae,{get nodeClickDistance(){return a()},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 C},set store(se){C=se}});var be=u(ae,2);yk(be,{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 C},set store(se){C=se}}),Ce(2),v(R,V)},$$slots:{default:!0}});var $=u(B,2);{let R=y(()=>!!(C.selectionRect&&C.selectionRectMode==="user")),H=y(()=>{var ae;return(ae=C.selectionRect)==null?void 0:ae.width}),V=y(()=>{var ae;return(ae=C.selectionRect)==null?void 0:ae.height}),j=y(()=>{var ae;return(ae=C.selectionRect)==null?void 0:ae.x}),F=y(()=>{var ae;return(ae=C.selectionRect)==null?void 0:ae.y});uu($,{get isVisible(){return n(R)},get width(){return n(H)},get height(){return n(V)},get x(){return n(j)},get y(){return n(F)}})}v(m,P)},$$slots:{default:!0}})},$$slots:{default:!0}});var ee=u(oe,2);zk(ee,{get proOptions(){return e.proOptions},get position(){return e.attributionPosition}});var ve=u(ee,2);rk(ve,{get store(){return C}});var Q=u(ve,2);pn(Q,()=>e.children??Kn),v(X,te)},$$slots:{default:!0}}),st()}var $k=x("<button><!></button>");function ko(t,e){let r=Ur(e,["$$slots","$$events","$$legacy","class","bgColor","bgColorHover","color","colorHover","borderColor","onclick","children"]);var a=$k();zr(a,()=>({type:"button",onclick:e.onclick,class:["svelte-flow__controls-button",e.class],...r,[ni]:{"--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 o=c(a);pn(o,()=>e.children??Kn),l(a),v(t,a)}var Dk=En('<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 Vk(t){var e=Dk();v(t,e)}var Hk=En('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function Fk(t){var e=Hk();v(t,e)}var qk=En('<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 Kk(t){var e=qk();v(t,e)}var jk=En('<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 Bk(t){var e=jk();v(t,e)}var Wk=En('<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 Uk(t){var e=Wk();v(t,e)}var Gk=x("<!> <!>",1),Yk=x("<!> <!> <!> <!> <!> <!>",1);function Xk(t,e){it(e,!0);let r=Ge(e,"position",3,"bottom-left"),a=Ge(e,"orientation",3,"vertical"),o=Ge(e,"showZoom",3,!0),s=Ge(e,"showFitView",3,!0),i=Ge(e,"showLock",3,!0),d=Ur(e,["$$slots","$$events","$$legacy","position","orientation","showZoom","showFitView","showLock","style","class","buttonBgColor","buttonBgColorHover","buttonColor","buttonColorHover","buttonBorderColor","fitViewOptions","children","before","after"]),f=y(Xr);const g={bgColor:e.buttonBgColor,bgColorHover:e.buttonBgColorHover,color:e.buttonColor,colorHover:e.buttonColorHover,borderColor:e.buttonBorderColor};let p=y(()=>n(f).nodesDraggable||n(f).nodesConnectable||n(f).elementsSelectable),b=y(()=>n(f).viewport.zoom<=n(f).minZoom),h=y(()=>n(f).viewport.zoom>=n(f).maxZoom),w=y(()=>n(f).ariaLabelConfig),S=y(()=>a()==="horizontal"?"horizontal":"vertical");const A=()=>{n(f).zoomIn()},D=()=>{n(f).zoomOut()},W=()=>{n(f).fitView(e.fitViewOptions)},C=()=>{let G=!n(p);n(f).nodesDraggable=G,n(f).nodesConnectable=G,n(f).elementsSelectable=G};{let G=y(()=>["svelte-flow__controls",n(S),e.class]);fu(t,lt({get class(){return n(G)},get position(){return r()},"data-testid":"svelte-flow__controls",get"aria-label"(){return n(w)["controls.ariaLabel"]},get style(){return e.style}},()=>d,{children:(X,I)=>{var te=Yk(),le=fe(te);{var oe=R=>{var H=Re(),V=fe(H);pn(V,()=>e.before),v(R,H)};K(le,R=>{e.before&&R(oe)})}var ee=u(le,2);{var ve=R=>{var H=Gk(),V=fe(H);ko(V,lt({onclick:A,class:"svelte-flow__controls-zoomin",get title(){return n(w)["controls.zoomIn.ariaLabel"]},get"aria-label"(){return n(w)["controls.zoomIn.ariaLabel"]},get disabled(){return n(h)}},()=>g,{children:(F,ae)=>{Vk(F)},$$slots:{default:!0}}));var j=u(V,2);ko(j,lt({onclick:D,class:"svelte-flow__controls-zoomout",get title(){return n(w)["controls.zoomOut.ariaLabel"]},get"aria-label"(){return n(w)["controls.zoomOut.ariaLabel"]},get disabled(){return n(b)}},()=>g,{children:(F,ae)=>{Fk(F)},$$slots:{default:!0}})),v(R,H)};K(ee,R=>{o()&&R(ve)})}var Q=u(ee,2);{var E=R=>{ko(R,lt({class:"svelte-flow__controls-fitview",onclick:W,get title(){return n(w)["controls.fitView.ariaLabel"]},get"aria-label"(){return n(w)["controls.fitView.ariaLabel"]}},()=>g,{children:(H,V)=>{Kk(H)},$$slots:{default:!0}}))};K(Q,R=>{s()&&R(E)})}var M=u(Q,2);{var m=R=>{ko(R,lt({class:"svelte-flow__controls-interactive",onclick:C,get title(){return n(w)["controls.interactive.ariaLabel"]},get"aria-label"(){return n(w)["controls.interactive.ariaLabel"]}},()=>g,{children:(H,V)=>{var j=Re(),F=fe(j);{var ae=se=>{Uk(se)},be=se=>{Bk(se)};K(F,se=>{n(p)?se(ae):se(be,-1)})}v(H,j)},$$slots:{default:!0}}))};K(M,R=>{i()&&R(m)})}var N=u(M,2);{var P=R=>{var H=Re(),V=fe(H);pn(V,()=>e.children),v(R,H)};K(N,R=>{e.children&&R(P)})}var B=u(N,2);{var $=R=>{var H=Re(),V=fe(H);pn(V,()=>e.after),v(R,H)};K(B,R=>{e.after&&R($)})}v(X,te)},$$slots:{default:!0}}))}st()}var kr;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(kr||(kr={}));var Zk=En("<circle></circle>");function Qk(t,e){var r=Zk();L(()=>{Ae(r,"cx",e.radius),Ae(r,"cy",e.radius),Ae(r,"r",e.radius),De(r,0,je(["svelte-flow__background-pattern","dots",e.class]))}),v(t,r)}var Jk=En("<path></path>");function e5(t,e){it(e,!0);var r=Jk();L(()=>{Ae(r,"stroke-width",e.lineWidth),Ae(r,"d",`M${e.dimensions[0]/2} 0 V${e.dimensions[1]} M0 ${e.dimensions[1]/2} H${e.dimensions[0]}`),De(r,0,je(["svelte-flow__background-pattern",e.variant,e.class]))}),v(t,r),st()}const t5={[kr.Dots]:1,[kr.Lines]:1,[kr.Cross]:6};var n5=En('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');function r5(t,e){it(e,!0);let r=Ge(e,"variant",19,()=>kr.Dots),a=Ge(e,"gap",3,20),o=Ge(e,"lineWidth",3,1),s=y(Xr),i=y(()=>r()===kr.Dots),d=y(()=>r()===kr.Cross),f=y(()=>Array.isArray(a())?a():[a(),a()]),g=y(()=>`background-pattern-${n(s).flowId}-${e.id??""}`),p=y(()=>[n(f)[0]*n(s).viewport.zoom||1,n(f)[1]*n(s).viewport.zoom||1]),b=y(()=>(e.size??t5[r()])*n(s).viewport.zoom),h=y(()=>n(d)?[n(b),n(b)]:n(p)),w=y(()=>n(i)?[n(b)/2,n(b)/2]:[n(h)[0]/2,n(h)[1]/2]);var S=n5();let A;var D=c(S),W=c(D);{var C=I=>{{let te=y(()=>n(b)/2);Qk(I,{get radius(){return n(te)},get class(){return e.patternClass}})}},G=I=>{e5(I,{get dimensions(){return n(h)},get variant(){return r()},get lineWidth(){return o()},get class(){return e.patternClass}})};K(W,I=>{n(i)?I(C):I(G,-1)})}l(D);var X=u(D);l(S),L(()=>{De(S,0,je(["svelte-flow__background","svelte-flow__container",e.class])),A=kn(S,"",A,{"--xy-background-color-props":e.bgColor,"--xy-background-pattern-color-props":e.patternColor}),Ae(D,"id",n(g)),Ae(D,"x",n(s).viewport.x%n(p)[0]),Ae(D,"y",n(s).viewport.y%n(p)[1]),Ae(D,"width",n(p)[0]),Ae(D,"height",n(p)[1]),Ae(D,"patternTransform",`translate(-${n(w)[0]},-${n(w)[1]})`),Ae(X,"fill",`url(#${n(g)})`)}),v(t,S),st()}var a5=x('<!> <!> <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 o5(t,e){it(e,!0);const r=y(()=>e.data.role==="primary"?"role-primary":e.data.role==="replica"?"role-replica":"role-embedded");var a=a5(),o=fe(a);_a(o,{type:"target",get position(){return zt.Left},style:"opacity:0;pointer-events:none"});var s=u(o,2);_a(s,{type:"source",get position(){return zt.Right},style:"opacity:0;pointer-events:none"});var i=u(s,2);let d;var f=u(c(i),2),g=c(f),p=c(g),b=c(p,!0);l(p),Ce(2),l(g);var h=u(g,2),w=c(h,!0);l(h);var S=u(h,2),A=c(S),D=c(A),W=c(D,!0);l(D),Ce(),l(A);var C=u(A,4),G=c(C),X=c(G,!0);l(G),Ce(),l(C),l(S),l(f),l(i),L(I=>{d=De(i,1,`card ${n(r)??""}`,"svelte-hw5n61",d,{selected:e.selected}),k(b,e.data.role),k(w,e.data.label),k(W,e.data.collections),k(X,I)},[()=>e.data.entities.toLocaleString()]),v(t,a),st()}const Ra={action:"policy:read",resource:{kind:"policy",name:"*"}};function Rr(t){return[t.action,t.resource.kind,t.resource.name,t.resource.tenant??"",t.current_tenant??""].join("")}function i5(t){const e=`${t.kind}:${t.name}`;return t.tenant?`${e} @ ${t.tenant}`:e}function vu(t,e){const r=t==null?void 0:t.trim();if(!r||r==="*")return{kind:"resource",name:"*",tenant:e};const a=r.includes(":")?":":r.includes("/")?"/":null;if(!a)return{kind:"resource",name:r,tenant:e};const[o,...s]=r.split(a),i=s.join(a)||"*";return{kind:o||"resource",name:i,tenant:e}}function gu(t){var a;const e=[Ra],r=new Set(e.map(Rr));for(const o of t){const s={action:((a=o.action)==null?void 0:a.trim())||"*",resource:vu(o.resource,o.tenant)},i=Rr(s);r.has(i)||(r.add(i),e.push(s))}return e}function s5(t,e){const r=gu(t),a=new Map(e.map(o=>[Rr(o),o]));return r.map(o=>{const s=a.get(Rr(o)),i=t.filter(d=>{var g;const f={action:((g=d.action)==null?void 0:g.trim())||"*",resource:vu(d.resource,d.tenant)};return Rr(f)===Rr(o)});return{id:Rr(o),action:o.action,resource:o.resource,resourceLabel:i5(o.resource),allowed:(s==null?void 0:s.allowed)===!0,reason:s==null?void 0:s.reason,effects:[...new Set(i.map(d=>d.effect).filter(d=>!!d))],principals:[...new Set(i.map(d=>d.principal).filter(d=>!!d))],policies:[...new Set(i.map((d,f)=>d.name??d.id??`policy ${f+1}`).filter(d=>!!d))]}})}var l5=x('<div class="absolute w-[220px] rounded border border-line-2 bg-bg-1 p-3 shadow-md motion-safe:animate-pulse"><div class="mb-3 flex items-center gap-2"><div></div> <div class="h-3 rounded bg-bg-3"></div></div> <div class="grid grid-cols-2 gap-2"><div class="h-9 rounded border border-line-1 bg-bg-2"></div> <div class="h-9 rounded border border-line-1 bg-bg-2"></div></div></div>'),c5=x('<div class="flex h-[30px] items-center gap-2.5 rounded px-2"><div class="h-1.5 w-1.5 rounded-full bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 flex-1 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></div>'),d5=x('<div class="absolute inset-0 overflow-hidden bg-bg-0" aria-busy="true" aria-label="Loading cluster topology"><div class="absolute inset-0 cluster-skeleton-grid svelte-gcvueu"></div> <svg class="absolute inset-0 h-full w-full" aria-hidden="true"><line x1="50%" y1="38%" x2="32%" y2="54%" class="cluster-skeleton-edge motion-safe:animate-pulse svelte-gcvueu"></line><line x1="50%" y1="38%" x2="68%" y2="54%" class="cluster-skeleton-edge motion-safe:animate-pulse svelte-gcvueu"></line></svg> <!> <div class="absolute top-4 left-4 z-10 w-64 rounded border border-line-2 bg-bg-1 p-3 shadow-md"><div class="mb-3 h-3 w-16 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="mb-3 grid grid-cols-2 gap-3 border-b border-line-1 pb-3"><div><div class="mb-2 h-3 w-16 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-6 w-12 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div><div class="mb-2 h-3 w-14 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-6 w-20 rounded bg-bg-2 motion-safe:animate-pulse"></div></div></div> <div class="grid gap-1"></div></div></div>'),u5=x('<div class="p-6"><!></div>'),f5=x('<div class="p-6"><!></div>'),v5=x("<!> <!>",1),g5=x('<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>'),p5=x('<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),h5=x('<div class="text-[10px] text-fg-3 mt-1"> </div>'),b5=x('<div class="mb-1 rounded border border-line-1 bg-bg-2 p-3"><div class="type-label"> </div> <div> </div> <!></div>'),x5=x('<span class="text-fg-3"> </span>'),m5=x('<span class="text-fg-3">· usage not exposed</span>'),_5=x(' <span class="text-fg-3"> </span>',1),y5=x('<span class="text-fg-3">not sampled</span>'),w5=x('<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></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">throughput</span> <span class="text-fg-0"><!></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),k5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">commit mark</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div>'),S5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">resyncs</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div>'),C5=x('<span class="text-amber-400">↻</span>'),E5=x('<div class="flex items-center gap-2 text-[10px]"><span></span> <span class="text-fg-1 flex-1 truncate"> <!></span> <span class="text-fg-3"> </span> <span> </span></div>'),N5=x('<div class="grid gap-1 pl-1"></div>'),M5=x('<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">archive lag</span> <span class="text-fg-0"> <span class="text-fg-3">records</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> <!>',1),T5=x('<span class="text-fg-3 ml-1"> </span>'),z5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">lag</span> <span><!> <!></span></div>'),A5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">last error</span> <span class="text-accent break-all"> </span></div>'),P5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">primary</span> <span class="text-fg-0 break-all"> </span></div> <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),L5=x('<div class="pt-2 mt-1 border-t border-line-1"></div> <!>',1),I5=x('you are <span class="text-accent"> </span> <span class="text-fg-3"> </span>',1),O5=x('<span class="text-fg-3"> </span>'),R5=x('<span class="text-fg-3">…</span>'),$5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-1"> </span>'),D5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-1"> </span>'),V5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-1"> </span>'),H5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-3" title="reddb did not grant policy:read to this principal">policies · no grant</span>'),F5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">metalanguage</span> <span class="text-fg-0"><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-start"><span class="text-fg-3"></span> <span class="flex flex-wrap items-center gap-1.5"><!> <!> <!> <button type="button" class="rounded border border-line-2 bg-bg-2 px-1.5 py-0.5 text-[10px] text-fg-1 hover:border-line-3 hover:text-fg-0">Security →</button></span></div>',1),q5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">metalanguage</span> <span class="text-fg-3">connect to this node to inspect users · tenants · policies</span></div>'),K5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-3"> </span>'),j5=x('<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>',1),B5=x('<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">topology</span> <span><!></span></div> <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>'),W5=x('<div class="absolute top-4 right-4 z-10 w-[420px] max-h-[calc(100vh-96px)] overflow-auto"><!></div>'),U5=x('<div class="absolute inset-0"><!></div> <div class="absolute top-4 left-4 z-10 w-64"><!></div> <!>',1);function G5(t,e){it(e,!0);function r(T){return If(T.cluster,T.replication,T.preset.role)}const a={embedded:"embedded · standalone",serverless:"serverless",replicated:"primary / replica",server:"server · standalone",unknown:"unknown"};let o=we(Kt([])),s=we(!0),i=we(null);const d=[{id:"primary",x:"50%",y:"38%",role:"primary",label:92},{id:"replica",x:"68%",y:"54%",role:"replica",label:112},{id:"embedded",x:"32%",y:"54%",role:"embedded",label:104}],f=Array.from({length:3},(T,q)=>q),g=new Map,p=new Map,b=6e4,h={cluster:o5},w=y(()=>{const T=Dr.current==="dark";return{ok:T?"#4ade80":"#16a34a",warn:T?"#fbbf24":"#b45309",pattern:T?"#1c2027":"#d4d4d8",labelBg:T?"#0d0f13":"#fafafa",labelStroke:T?"#2a2e36":"#d4d4d8"}});async function S(){const T=Date.now(),q=await Promise.all(pf.map(async O=>{const z=g.get(O.id)??0,U=p.get(O.id)??0;if(z>=2&&T-U<b)return n(o).find(ce=>ce.id===O.id)??{id:O.id,preset:O,reachable:!1,role:"standalone"};p.set(O.id,T);const ne=new hf(O.url);try{const[ce,xe,he]=await Promise.all([Ct.track(`cluster · ${O.label} stats`,()=>ne.stats()),Ct.track(`cluster · ${O.label} replication`,()=>ne.replication()).catch(()=>{}),Ct.track(`cluster · ${O.label} status`,()=>ne.clusterStatus()).catch(()=>{})]);return g.set(O.id,0),{id:O.id,preset:O,reachable:!0,role:(xe==null?void 0:xe.role)??"standalone",stats:ce,replication:xe,cluster:he}}catch{return g.set(O.id,z+1),{id:O.id,preset:O,reachable:!1,role:"standalone"}}}));_(o,q,!0),_(s,!1)}Xt(()=>{if(_n.locked){_(s,!1);return}_(s,!0),S();const T=setInterval(S,5e3);return()=>clearInterval(T)});const A=y(()=>n(o).filter(T=>T.reachable)),D=y(()=>n(A).map(T=>{var O,z;const q=T.role==="primary"?0:T.role==="replica"?1:-1;return{id:T.id,type:"cluster",position:{x:320+q*320,y:200},data:{label:T.preset.label,role:T.role,collections:((O=T.stats)==null?void 0:O.store.collection_count)??0,entities:((z=T.stats)==null?void 0:z.store.total_entities)??0,url:T.preset.url}}})),W=y(()=>n(A).filter(T=>T.role==="replica").map(T=>{var ne,ce;const q=n(A).find(xe=>xe.role==="primary");if(!q)return null;const O=((ne=T.replication)==null?void 0:ne.last_applied_lsn)!==void 0&&((ce=T.replication)==null?void 0:ce.last_seen_primary_lsn)!==void 0?T.replication.last_seen_primary_lsn-T.replication.last_applied_lsn:null,z=O===0,U=z?n(w).ok:n(w).warn;return{id:`${q.id}-${T.id}`,source:q.id,target:T.id,type:"smoothstep",animated:!0,style:`stroke:${U};stroke-width:1.5;opacity:0.7`,label:O===null?"":z?"✓ in sync":`lag ${O}`,labelStyle:`fill:${U};font-family:JetBrains Mono Variable;font-size:10px;font-weight:500`,labelBgStyle:`fill:${n(w).labelBg};stroke:${n(w).labelStroke};stroke-width:1`,labelBgPadding:[6,4],labelBgBorderRadius:4}}).filter(T=>T!==null)),C=y(()=>n(o).find(T=>T.id===n(i))),G=y(()=>n(C)?P(n(C)):null),X=y(()=>n(C)?r(n(C)):"unknown"),I=y(()=>n(C)?F(n(C)):[]),te=y(()=>n(A).reduce((T,q)=>{var O;return T+(((O=q.stats)==null?void 0:O.store.total_entities)??0)},0)),le=ya(),oe=y(()=>{var T;return!!n(C)&&Ke.connected&&!_n.locked&&((T=Ke.active)==null?void 0:T.url)===n(C).preset.url});let ee=we(null);Xt(()=>{const T=n(C);if(n(i),!T||!n(oe)){_(ee,null);return}const q=Ke.client;if(!q){_(ee,null);return}let O=!1;return(async()=>{const z={};try{const U=await Ct.track("cluster · whoami",()=>q.whoami());z.username=U.username,z.role=U.role}catch(U){z.error=U.message}try{z.users=(await Ct.track("cluster · users",()=>q.users())).length}catch{}try{z.tenants=(await Ct.track("cluster · tenants",()=>q.tenants())).length}catch{}try{const[U]=await Ct.track("cluster · auth.can policy read",()=>q.authCan([Ra]));if(z.policyAllowed=(U==null?void 0:U.allowed)===!0,z.policyAllowed)try{z.policies=(await Ct.track("cluster · policies",()=>q.policies())).length}catch{}}catch{z.policyAllowed=!1}O||_(ee,z,!0)})(),()=>{O=!0}});function ve(T){var O,z;const q=Bn((z=(O=T.cluster)==null?void 0:O.deployment)==null?void 0:z.shape);return q||(T.preset.id==="embedded"?"embedded":T.preset.id.startsWith("docker-")?"server · docker preset":"server")}function Q(T){var z,U,ne,ce,xe;const q=(ne=(U=(z=T.cluster)==null?void 0:z.transports)==null?void 0:U.active)==null?void 0:ne[0];if(q)return`${q.transport} · ${q.bind_addr}`;const O=(xe=(ce=T.cluster)==null?void 0:ce.storage)==null?void 0:xe.remote_backend;return O?`remote backend · ${O}`:T.preset.description}function E(T){switch(r(T)){case"replicated":return"accent";case"embedded":return"ok";case"serverless":return"info";default:return"neutral"}}function M(T){return T==null||!Number.isFinite(T)?"not exposed":T<1e3?`${Math.round(T)} ms`:T<6e4?`${(T/1e3).toFixed(T<1e4?2:1)} s`:`${Math.floor(T/6e4)}m ${Math.round(T%6e4/1e3)}s`}function m(T){return T==null||!Number.isFinite(T)?"not exposed":T<1?`${Math.round(T*1e3)} ms`:T<60?`${T.toFixed(1)}s`:`${Math.floor(T/60)}m ${Math.round(T%60)}s`}function N(T){const q=T.replication;return(q==null?void 0:q.last_applied_lsn)===void 0||q.last_seen_primary_lsn===void 0?null:q.last_seen_primary_lsn-q.last_applied_lsn}function P(T){var z,U,ne,ce,xe,he,me,_e,pe;const q=r(T);if(q==="replicated"){if(T.role==="primary"){const Oe=((z=T.replication)==null?void 0:z.replicas)??[],ie=Rf(T.replication);return Oe.length===0?{label:"replication lag",value:"no replicas",tone:"neutral"}:ie===null?{label:"replication lag",value:"not exposed",tone:"neutral"}:{label:"replication lag",value:ie===0?"✓ in sync":m(ie),tone:ie===0?"ok":ie<5?"warn":"danger",sub:`${Oe.length} replica${Oe.length===1?"":"s"} · worst case`}}const ue=N(T);return{label:"replica lag",value:ue===null?"not exposed":ue===0?"✓ in sync":`${ue.toLocaleString()} lsn`,tone:ue===null?"neutral":ue===0?"ok":"warn",sub:(U=T.replication)==null?void 0:U.state}}if(q==="serverless"){const ue=Of(T.cluster);return{label:"boot time",value:M(ue),tone:ue===null?"neutral":ue<1e3?"ok":ue<5e3?"info":"warn",sub:(ne=T.cluster)!=null&&ne.phase?`phase · ${T.cluster.phase}`:void 0}}if(q==="embedded"){const ue=Bn((xe=(ce=T.cluster)==null?void 0:ce.storage)==null?void 0:xe.db_size_bytes);return{label:"on-disk size",value:ue===void 0?"not exposed":B(ue),tone:ue===void 0?"neutral":"ok",sub:`${(((he=T.stats)==null?void 0:he.store.total_entities)??0).toLocaleString()} entities`}}const O=Bn((_e=(me=T.cluster)==null?void 0:me.storage)==null?void 0:_e.db_size_bytes);return{label:"entities",value:(((pe=T.stats)==null?void 0:pe.store.total_entities)??0).toLocaleString(),tone:"accent",sub:O===void 0?void 0:`${B(O)} on disk`}}function B(T){return T===void 0||!Number.isFinite(T)?"not exposed":T>=1024**3?`${(T/1024**3).toFixed(1)} GiB`:T>=1024**2?`${(T/1024**2).toFixed(1)} MiB`:T>=1024?`${(T/1024).toFixed(1)} KiB`:`${T} B`}function $(T,q){return q<=0?"n/a":`${Math.round(T/q*100)}%`}function R(T){const q=Math.max(0,Math.round((Date.now()-T)/1e3));return q>=86400?`${Math.floor(q/86400)}d ${Math.floor(q%86400/3600)}h`:q>=3600?`${Math.floor(q/3600)}h ${Math.floor(q%3600/60)}m`:q>=60?`${Math.floor(q/60)}m ${q%60}s`:`${q}s`}function H(T){return T===void 0||!Number.isFinite(T)?"not exposed":`${T.toLocaleString(void 0,{maximumFractionDigits:1})}/s`}function V(T){return T===void 0||!Number.isFinite(T)?"not exposed":`${T.toLocaleString(void 0,{maximumFractionDigits:1})} ms`}function j(T){var U,ne,ce,xe,he,me;const q=Bn((ne=(U=T.cluster)==null?void 0:U.storage)==null?void 0:ne.db_size_bytes),O=(xe=(ce=T.cluster)==null?void 0:ce.storage)==null?void 0:xe.remote_backend;if(q!==void 0)return O?`${B(q)} · ${O}`:B(q);if(O)return`remote · ${O}`;const z=Lf((me=(he=T.cluster)==null?void 0:he.storage)==null?void 0:me.db_size_bytes);return z?`not exposed (${z})`:"not exposed"}function F(T){return $f(T.cluster).map(q=>q.path.replace(/_/g," "))}var ae=Re(),be=fe(ae);{var se=T=>{var q=d5(),O=u(c(q),4);Xe(O,17,()=>d,ne=>ne.id,(ne,ce)=>{var xe=l5(),he=c(xe),me=c(he),_e=u(me,2);l(he),Ce(2),l(xe),L(pe=>{kn(xe,`left: ${n(ce).x}; top: ${n(ce).y}; transform: translate(-50%, -50%);`),De(me,1,pe,"svelte-gcvueu"),kn(_e,`width: ${n(ce).label}px`)},[()=>je(["h-2 w-2 rounded-full",n(ce).role==="primary"?"bg-role-primary":n(ce).role==="replica"?"bg-role-replica":"bg-role-embedded"].join(" "))]),v(ne,xe)});var z=u(O,2),U=u(c(z),4);Xe(U,20,()=>f,ne=>ne,(ne,ce)=>{var xe=c5(),he=u(c(xe),4);l(xe),L(()=>kn(he,`width: ${ce===0?36:24}px`)),v(ne,xe)}),l(U),l(z),l(q),v(T,q)},J=T=>{var q=u5(),O=c(q);Fn(O,{get icon(){return Gr},title:"Locked",message:"Unlock the secure store to probe configured nodes. Automatic probes are paused until you authenticate this session."}),l(q),v(T,q)},Y=T=>{var q=f5(),O=c(q);Fn(O,{get icon(){return pv},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"}),l(q),v(T,q)},Z=T=>{var q=U5(),O=fe(q),z=c(O);Rk(z,{get nodes(){return n(D)},get edges(){return n(W)},get nodeTypes(){return h},fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,onnodeclick:he=>_(i,he.node.id,!0),children:(he,me)=>{var _e=v5(),pe=fe(_e);r5(pe,{get variant(){return kr.Dots},bgColor:"transparent",get patternColor(){return n(w).pattern},gap:32,size:1});var ue=u(pe,2);Xk(ue,{position:"bottom-right"}),v(he,_e)},$$slots:{default:!0}}),l(O);var U=u(O,2),ne=c(U);Er(ne,{title:"cluster",children:(he,me)=>{var _e=p5(),pe=fe(_e),ue=c(pe),Oe=u(c(ue),2),ie=c(Oe,!0),de=u(ie),ye=c(de);l(de),l(Oe),l(ue);var Pe=u(ue,2),Le=u(c(Pe),2),Ee=c(Le,!0);l(Le),l(Pe),l(pe);var Te=u(pe,2);Xe(Te,21,()=>n(A),bn,(Me,Ne)=>{var ze=g5(),Ze=c(ze),$e=u(Ze,2),Je=c($e,!0);l($e);var tt=u($e,2),ct=c(tt,!0);l(tt),l(ze),L((qe,Ve,Be)=>{De(ze,1,qe,"svelte-gcvueu"),De(Ze,1,Ve,"svelte-gcvueu"),k(Je,n(Ne).preset.label),k(ct,Be)},[()=>je(["flex items-center gap-2.5 px-2 py-1.5 rounded text-left bg-transparent border-0 cursor-pointer transition-colors",n(i)===n(Ne).id?"bg-bg-2":"hover:bg-bg-2"].join(" ")),()=>je(["w-1.5 h-1.5 rounded-full shrink-0",n(Ne).role==="primary"?"bg-role-primary":n(Ne).role==="replica"?"bg-role-replica":"bg-role-embedded"].join(" ")),()=>{var qe;return((qe=n(Ne).stats)==null?void 0:qe.store.total_entities.toLocaleString())??0}]),ke("click",ze,()=>_(i,n(Ne).id,!0)),v(Me,ze)}),l(Te),L(Me=>{k(ie,n(A).length),k(ye,`of ${n(o).length??""}`),k(Ee,Me)},[()=>n(te).toLocaleString()]),v(he,_e)},$$slots:{default:!0}}),l(U);var ce=u(U,2);{var xe=he=>{var me=W5(),_e=c(me);Er(_e,{get title(){return`node · ${n(C).id??""}`},floating:!0,children:(pe,ue)=>{var Oe=B5(),ie=c(Oe);{var de=at=>{var ut=b5(),Lt=c(ut),jt=c(Lt,!0);l(Lt);var on=u(Lt,2),sn=c(on,!0);l(on);var ln=u(on,2);{var Sn=cn=>{var yn=h5(),Nn=c(yn,!0);l(yn),L(()=>k(Nn,n(G).sub)),v(cn,yn)};K(ln,cn=>{n(G).sub&&cn(Sn)})}l(ut),L(cn=>{k(jt,n(G).label),De(on,1,cn,"svelte-gcvueu"),k(sn,n(G).value)},[()=>je(["font-mono text-[22px] font-semibold mt-0.5 leading-none",n(G).tone==="ok"?"text-role-replica":n(G).tone==="warn"?"text-amber-400":n(G).tone==="danger"||n(G).tone==="accent"?"text-accent":"text-fg-0"].join(" "))]),v(at,ut)};K(ie,at=>{n(G)&&at(de)})}var ye=u(ie,2),Pe=u(c(ye),2),Le=c(Pe);{let at=y(()=>E(n(C)));Wn(Le,{get tone(){return n(at)},children:(ut,Lt)=>{Ce();var jt=_t();L(()=>k(jt,a[n(X)])),v(ut,jt)},$$slots:{default:!0}})}l(Pe),l(ye);var Ee=u(ye,2),Te=u(c(Ee),2),Me=c(Te,!0);l(Te),l(Ee);var Ne=u(Ee,2),ze=u(c(Ne),2),Ze=c(ze,!0);l(ze),l(Ne);var $e=u(Ne,2),Je=u(c($e),2),tt=c(Je);{let at=y(()=>E(n(C)));Wn(tt,{get tone(){return n(at)},children:(ut,Lt)=>{Ce();var jt=_t();L(on=>k(jt,on),[()=>ve(n(C))]),v(ut,jt)},$$slots:{default:!0}})}l(Je),l($e);var ct=u($e,2),qe=u(c(ct),2),Ve=c(qe,!0);l(qe),l(ct);var Be=u(ct,2),ot=u(c(Be),2),re=c(ot);{let at=y(()=>n(C).role==="primary"?"primary":n(C).role==="replica"?"replica":"embedded");jv(re,{get role(){return n(at)},get label(){return n(C).role}})}l(ot),l(Be);var rt=u(Be,2),Qe=u(c(rt),2),We=c(Qe);{var ft=at=>{var ut=_t();L(()=>k(ut,n(C).replication.replica_count??0)),v(at,ut)},Nt=at=>{var ut=_t();L(()=>k(ut,`connected to ${n(C).replication.primary_addr??"primary"??""}`)),v(at,ut)},At=at=>{var ut=_t("none exposed");v(at,ut)};K(We,at=>{var ut,Lt;((ut=n(C).replication)==null?void 0:ut.role)==="primary"?at(ft):((Lt=n(C).replication)==null?void 0:Lt.role)==="replica"?at(Nt,1):at(At,-1)})}l(Qe),l(rt);var Mt=u(rt,2);{var Et=at=>{const ut=y(()=>{var Ht,Tt;return Bn((Tt=(Ht=n(C).cluster)==null?void 0:Ht.system)==null?void 0:Tt.total_memory_bytes)??n(C).stats.system.total_memory_bytes}),Lt=y(()=>{var Ht,Tt;return Bn((Tt=(Ht=n(C).cluster)==null?void 0:Ht.system)==null?void 0:Tt.available_memory_bytes)??n(C).stats.system.available_memory_bytes}),jt=y(()=>{var Ht;return Bn((Ht=n(C).cluster)==null?void 0:Ht.throughput)});var on=w5(),sn=u(fe(on),2),ln=u(c(sn),2),Sn=c(ln);l(ln),l(sn);var cn=u(sn,2),yn=u(c(cn),2),Nn=c(yn);l(yn),l(cn);var An=u(cn,2),Cn=u(c(An),2),Pn=c(Cn),Se=u(Pn),Ie=c(Se);l(Se),l(Cn),l(An);var He=u(An,2),Ye=u(c(He),2),et=c(Ye,!0);l(Ye),l(He);var nt=u(He,2),Ue=u(c(nt),2),wt=c(Ue,!0);l(Ue),l(nt);var dt=u(nt,2),ht=u(c(dt),2),Pt=c(ht,!0);l(ht),l(dt);var Ot=u(dt,2),tn=u(c(Ot),2),fn=c(tn,!0);l(tn),l(Ot);var Dt=u(Ot,2),Rt=u(c(Dt),2),Ut=c(Rt,!0);l(Rt),l(Dt);var Bt=u(Dt,2),an=u(c(Bt),2),vn=c(an),gn=u(vn),Gt=c(gn);l(gn),l(an),l(Bt);var St=u(Bt,2),Vt=u(c(St),2),Wt=c(Vt),dn=u(Wt);{var Qt=Ht=>{var Tt=x5(),Yt=c(Tt);l(Tt),L(wn=>k(Yt,`· ${wn??""}%`),[()=>{var wn,rr;return Bn((rr=(wn=n(C).cluster)==null?void 0:wn.system)==null?void 0:rr.cpu_usage)}]),v(Ht,Tt)},Mn=y(()=>{var Ht,Tt;return Bn((Tt=(Ht=n(C).cluster)==null?void 0:Ht.system)==null?void 0:Tt.cpu_usage)!==void 0}),$t=Ht=>{var Tt=m5();v(Ht,Tt)};K(dn,Ht=>{n(Mn)?Ht(Qt):Ht($t,-1)})}l(Vt),l(St);var bt=u(St,2),xt=u(c(bt),2),un=c(xt);{var Tn=Ht=>{var Tt=_5(),Yt=fe(Tt),wn=u(Yt),rr=c(wn);l(wn),L((Ar,wa,gi)=>{k(Yt,`${Ar??""} `),k(rr,`· r ${wa??""} / w ${gi??""}`)},[()=>H(n(jt).requests_per_second),()=>H(n(jt).reads_per_second),()=>H(n(jt).writes_per_second)]),v(Ht,Tt)},In=Ht=>{var Tt=y5();v(Ht,Tt)};K(un,Ht=>{n(jt)?Ht(Tn):Ht(In,-1)})}l(xt),l(bt);var $n=u(bt,2),Jt=u(c($n),2),mn=c(Jt,!0);l(Jt),l($n);var On=u($n,2),Qn=u(c(On),2),nr=c(Qn,!0);l(Qn),l(On),L((Ht,Tt,Yt,wn,rr,Ar,wa,gi,yu)=>{k(Sn,`${n(C).stats.system.hostname??""} · ${n(C).stats.system.os??""}/${n(C).stats.system.arch??""}`),k(Nn,`pid ${n(C).stats.system.pid??""}`),k(Pn,`${n(C).stats.active_connections??""} active `),k(Ie,`/ ${n(C).stats.idle_connections??""} idle`),k(et,n(C).stats.store.collection_count),k(wt,Ht),k(Pt,Tt),k(fn,Yt),k(Ut,wn),k(vn,`${rr??""} used `),k(Gt,`/ ${Ar??""} (${wa??""})`),k(Wt,`${n(C).stats.system.cpu_cores??""} cores `),k(mn,gi),k(nr,yu)},[()=>n(C).stats.store.total_entities.toLocaleString(),()=>n(C).stats.store.cross_ref_count.toLocaleString(),()=>B(n(C).stats.store.total_memory_bytes),()=>j(n(C)),()=>B(n(ut)-n(Lt)),()=>B(n(ut)),()=>$(n(ut)-n(Lt),n(ut)),()=>{var Ht,Tt;return V((Tt=Bn((Ht=n(C).cluster)==null?void 0:Ht.latency))==null?void 0:Tt.avg_response_ms)},()=>{var Ht;return((Ht=n(C).cluster)==null?void 0:Ht.uptime_secs)!==void 0?R(Date.now()-n(C).cluster.uptime_secs*1e3):R(n(C).stats.started_at_unix_ms)}]),v(at,on)};K(Mt,at=>{n(C).stats&&at(Et)})}var mt=u(Mt,2);{var yt=at=>{var ut=L5(),Lt=u(fe(ut),2);{var jt=sn=>{var ln=M5(),Sn=fe(ln),cn=u(c(Sn),2),yn=c(cn,!0);l(cn),l(Sn);var Nn=u(Sn,2);{var An=dt=>{var ht=k5(),Pt=u(c(ht),2),Ot=c(Pt),tn=u(Ot),fn=c(tn);l(tn),l(Pt),l(ht),L(()=>{var Dt,Rt;k(Ot,`${n(C).replication.commit_watermark??""} `),k(fn,`· ${((Rt=(Dt=n(C).cluster)==null?void 0:Dt.replication)==null?void 0:Rt.commit_policy)??""??""}`)}),v(dt,ht)};K(Nn,dt=>{n(C).replication.commit_watermark!==void 0&&dt(An)})}var Cn=u(Nn,2),Pn=u(c(Cn),2),Se=c(Pn);Ce(),l(Pn),l(Cn);var Ie=u(Cn,2);{var He=dt=>{var ht=S5(),Pt=u(c(ht),2),Ot=c(Pt),tn=u(Ot),fn=c(tn);l(tn),l(Pt),l(ht),L(()=>{k(Ot,`${n(C).replication.full_resync_count??0??""} full `),k(fn,`/ ${n(C).replication.partial_resync_count??0??""} partial`)}),v(dt,ht)};K(Ie,dt=>{((n(C).replication.full_resync_count??0)>0||(n(C).replication.partial_resync_count??0)>0)&&dt(He)})}var Ye=u(Ie,2),et=u(c(Ye),2),nt=c(et,!0);l(et),l(Ye);var Ue=u(Ye,2);{var wt=dt=>{var ht=N5();Xe(ht,21,()=>n(C).replication.replicas,Pt=>Pt.id,(Pt,Ot)=>{var tn=E5(),fn=c(tn),Dt=u(fn,2),Rt=c(Dt,!0),Ut=u(Rt);{var Bt=St=>{var Vt=C5();v(St,Vt)};K(Ut,St=>{n(Ot).rebootstrapping&&St(Bt)})}l(Dt);var an=u(Dt,2),vn=c(an);l(an);var gn=u(an,2),Gt=c(gn,!0);l(gn),l(tn),L((St,Vt)=>{De(fn,1,St,"svelte-gcvueu"),k(Rt,n(Ot).id),k(vn,`${n(Ot).lag_lsn??""} lsn`),De(gn,1,je(n(Ot).lag_seconds===0?"text-role-replica":"text-fg-0")),k(Gt,Vt)},[()=>je(["w-1.5 h-1.5 rounded-full shrink-0",n(Ot).lag_seconds===0?"bg-role-replica":n(Ot).lag_seconds<5?"bg-amber-400":"bg-accent"].join(" ")),()=>n(Ot).lag_seconds===0?"✓ sync":m(n(Ot).lag_seconds)]),v(Pt,tn)}),l(ht),v(dt,ht)};K(Ue,dt=>{var ht;(ht=n(C).replication.replicas)!=null&&ht.length&&dt(wt)})}L(()=>{var dt,ht,Pt,Ot,tn,fn;k(yn,((ht=(dt=n(C).cluster)==null?void 0:dt.wal)==null?void 0:ht.current_lsn)??n(C).replication.wal_lsn??"not exposed"),k(Se,`${((Ot=(Pt=n(C).cluster)==null?void 0:Pt.wal)==null?void 0:Ot.archive_lag_records)??"not exposed"??""} `),k(nt,n(C).replication.replica_count??((fn=(tn=n(C).cluster)==null?void 0:tn.replication)==null?void 0:fn.replica_count)??0)}),v(sn,ln)},on=sn=>{const ln=y(()=>N(n(C)));var Sn=P5(),cn=fe(Sn),yn=u(c(cn),2),Nn=c(yn,!0);l(yn),l(cn);var An=u(cn,2),Cn=u(c(An),2),Pn=c(Cn),Se=u(Pn),Ie=c(Se);l(Se),l(Cn),l(An);var He=u(An,2);{var Ye=Ue=>{var wt=z5(),dt=u(c(wt),2),ht=c(dt);{var Pt=Dt=>{Wn(Dt,{tone:"ok",children:(Rt,Ut)=>{Ce();var Bt=_t("in sync");v(Rt,Bt)},$$slots:{default:!0}})},Ot=Dt=>{Wn(Dt,{tone:"warn",children:(Rt,Ut)=>{Ce();var Bt=_t();L(an=>k(Bt,`${an??""} lsn`),[()=>n(ln).toLocaleString()]),v(Rt,Bt)},$$slots:{default:!0}})};K(ht,Dt=>{n(ln)===0?Dt(Pt):Dt(Ot,-1)})}var tn=u(ht,2);{var fn=Dt=>{var Rt=T5(),Ut=c(Rt,!0);l(Rt),L(()=>k(Ut,n(C).replication.state)),v(Dt,Rt)};K(tn,Dt=>{n(C).replication.state&&Dt(fn)})}l(dt),l(wt),v(Ue,wt)};K(He,Ue=>{n(ln)!==null&&Ue(Ye)})}var et=u(He,2);{var nt=Ue=>{var wt=A5(),dt=u(c(wt),2),ht=c(dt,!0);l(dt),l(wt),L(()=>k(ht,n(C).replication.last_error)),v(Ue,wt)};K(et,Ue=>{n(C).replication.last_error&&Ue(nt)})}L(()=>{k(Nn,n(C).replication.primary_addr??n(C).replication.leader??"unknown"),k(Pn,`${n(C).replication.last_applied_lsn??""} `),k(Ie,`/ ${n(C).replication.last_seen_primary_lsn??""}`)}),v(sn,Sn)};K(Lt,sn=>{n(C).replication.role==="primary"?sn(jt):n(C).replication.role==="replica"&&sn(on,1)})}v(at,ut)};K(mt,at=>{n(C).replication&&at(yt)})}var kt=u(mt,4);{var It=at=>{var ut=F5(),Lt=fe(ut),jt=u(c(Lt),2),on=c(jt);{var sn=et=>{var nt=I5(),Ue=u(fe(nt)),wt=c(Ue,!0);l(Ue);var dt=u(Ue,2),ht=c(dt);l(dt),L(()=>{k(wt,n(ee).username),k(ht,`· ${n(ee).role??""}`)}),v(et,nt)},ln=et=>{var nt=O5(),Ue=c(nt,!0);l(nt),L(()=>k(Ue,n(ee).error)),v(et,nt)},Sn=et=>{var nt=R5();v(et,nt)};K(on,et=>{var nt,Ue;(nt=n(ee))!=null&&nt.username?et(sn):(Ue=n(ee))!=null&&Ue.error?et(ln,1):et(Sn,-1)})}l(jt),l(Lt);var cn=u(Lt,2),yn=u(c(cn),2),Nn=c(yn);{var An=et=>{var nt=$5(),Ue=c(nt);l(nt),L(()=>k(Ue,`${n(ee).users??""} users`)),v(et,nt)};K(Nn,et=>{var nt;((nt=n(ee))==null?void 0:nt.users)!==void 0&&et(An)})}var Cn=u(Nn,2);{var Pn=et=>{var nt=D5(),Ue=c(nt);l(nt),L(()=>k(Ue,`${n(ee).tenants??""} tenants`)),v(et,nt)};K(Cn,et=>{var nt;((nt=n(ee))==null?void 0:nt.tenants)!==void 0&&et(Pn)})}var Se=u(Cn,2);{var Ie=et=>{var nt=V5(),Ue=c(nt);l(nt),L(()=>k(Ue,`${n(ee).policies??""} policies`)),v(et,nt)},He=et=>{var nt=H5();v(et,nt)};K(Se,et=>{var nt,Ue;(nt=n(ee))!=null&&nt.policyAllowed&&((Ue=n(ee))==null?void 0:Ue.policies)!==void 0?et(Ie):n(ee)&&n(ee).policyAllowed===!1&&et(He,1)})}var Ye=u(Se,2);l(yn),l(cn),ke("click",Ye,et=>le.go({view:"security"},et)),v(at,ut)},Zt=at=>{var ut=q5();v(at,ut)};K(kt,at=>{n(oe)?at(It):at(Zt,-1)})}var hn=u(kt,2);{var xn=at=>{var ut=j5(),Lt=u(fe(ut),2),jt=u(c(Lt),2);Xe(jt,21,()=>n(I),bn,(on,sn)=>{var ln=K5(),Sn=c(ln,!0);l(ln),L(()=>k(Sn,n(sn))),v(on,ln)}),l(jt),l(Lt),v(at,ut)};K(hn,at=>{n(I).length&&at(xn)})}l(Oe),L(at=>{k(Me,n(C).preset.label),k(Ze,n(C).preset.url),k(Ve,at)},[()=>Q(n(C))]),v(pe,Oe)},$$slots:{default:!0}}),l(me),v(he,me)};K(ce,he=>{n(C)&&he(xe)})}v(T,q)};K(be,T=>{n(s)?T(se):_n.locked?T(J,1):n(A).length===0?T(Y,2):T(Z,-1)})}v(t,ae),st()}en(["click"]);var Y5=x('<button type="button" class="rounded-full border border-line-2 bg-bg-1 px-3 py-1.5 text-[11px] text-fg-2 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"> </button>'),X5=x('<div class="flex flex-col items-center gap-4 py-16 text-center"><div class="flex size-12 items-center justify-center rounded-full border border-line-2 bg-bg-1"><!></div> <div><div class="font-mono text-[15px] text-fg-0">Ask your database</div> <div class="mt-1 text-[12px] text-fg-3">Grounded answers with citations to the rows, docs, and vectors behind them.</div></div> <div class="flex flex-wrap justify-center gap-1.5"></div></div>'),Z5=x('<div class="flex justify-end"><div class="max-w-[85%] rounded-lg rounded-br-sm border border-line-2 bg-bg-2 px-3 py-2 font-mono text-[12px] text-fg-0"> </div></div>'),Q5=x('<div class="flex items-center gap-2 text-[12px] text-fg-3"><!> thinking…</div>'),J5=x('<div class="flex items-start gap-2 rounded-lg border border-accent/30 bg-accent/5 px-3 py-2 text-[12px] text-fg-1"><!> <span> </span></div>'),e4=x('<button type="button" class="mx-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded bg-accent/15 px-1 align-super text-[9px] font-semibold text-accent hover:bg-accent/25"> </button>'),t4=x('<button type="button" class="rounded border border-line-1 px-1.5 py-0.5 hover:border-line-3 hover:text-fg-1"> </button>'),n4=x('<span class="font-mono"> </span>'),r4=x("<span>cached</span>"),a4=x('<span class="font-mono"> </span>'),o4=x('<div class="text-[13px] leading-relaxed text-fg-1"></div> <div class="flex flex-wrap items-center gap-1.5 text-[10px] text-fg-3"><!> <!> <!> <!> <!></div>',1),i4=x('<div class="flex flex-col gap-1.5"><!></div>'),s4=x('<div class="flex h-full flex-col"><div class="flex-1 overflow-auto"><div><!> <!></div></div> <div class="border-t border-line-1 bg-bg-0/80 p-3 backdrop-blur"><div><textarea rows="1" class="max-h-32 min-h-9 flex-1 resize-none rounded-lg border border-line-2 bg-bg-1 px-3 py-2 font-mono text-[12px] text-fg-0 placeholder:text-fg-3 focus:border-line-3 focus:outline-none disabled:opacity-50"></textarea> <button type="button" class="inline-flex h-9 items-center gap-1.5 rounded-lg bg-accent px-3 text-[12px] font-medium text-white hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-40"><!> Ask</button></div></div></div>'),l4=x('<span class="font-mono text-[10px] text-fg-2"> <span class="text-fg-3"> </span></span>'),c4=x('<span class="ml-auto font-mono text-[10px] text-fg-3"> </span>'),d4=x('<div><div class="mb-1.5 flex items-center gap-2"><span class="inline-flex size-4 items-center justify-center rounded bg-accent/15 text-[9px] font-semibold text-accent"> </span> <!> <!> <!></div> <pre class="max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[10px] leading-relaxed text-fg-1"> </pre></div>'),u4=x('<div class="flex items-center justify-between border-b border-line-1 px-4 py-2.5"><span class="type-label"> </span> <span class="font-mono text-[10px] text-fg-3"> </span></div> <div class="flex-1 overflow-auto p-3"><div class="grid gap-2"></div></div>',1),f4=x('<div class="flex h-full items-center justify-center font-mono text-[12px] text-fg-3">no grounding to show</div>'),v4=x('<div class="flex h-full flex-col overflow-hidden bg-bg-1"><!></div>'),g4=x('<div class="p-6"><!></div>'),p4=x('<div class="p-6"><!></div>'),h4=x('<div class="grid h-full grid-cols-[minmax(340px,42%)_1fr] overflow-hidden"><div class="min-h-0 border-r border-line-1"><!></div> <div class="min-h-0"><!></div></div>'),b4=x('<div class="h-full overflow-hidden bg-bg-0 text-fg-1"><!></div>');function x4(t,e){it(e,!0);const r=(E,M=Kn)=>{var m=s4(),N=c(m),P=c(N),B=c(P);{var $=be=>{var se=X5(),J=c(se),Y=c(J);No(Y,{class:"size-5 text-accent"}),l(J);var Z=u(J,4);Xe(Z,21,()=>A,bn,(T,q)=>{var O=Y5(),z=c(O,!0);l(O),L(()=>{O.disabled=!n(p)||n(b),k(z,n(q))}),ke("click",O,()=>{_(s,n(q),!0),n(h)&&D()}),v(T,O)}),l(Z),l(se),v(be,se)};K(B,be=>{n(o).length===0&&be($)})}var R=u(B,2);Xe(R,19,()=>n(o),be=>be.id,(be,se,J)=>{var Y=Re(),Z=fe(Y);{var T=O=>{var z=Z5(),U=c(z),ne=c(U,!0);l(U),l(z),L(()=>k(ne,n(se).text)),v(O,z)},q=O=>{var z=i4(),U=c(z);{var ne=he=>{var me=Q5(),_e=c(me);No(_e,{class:"size-3.5 animate-pulse text-accent"}),Ce(),l(me),v(he,me)},ce=he=>{var me=J5(),_e=c(me);Cc(_e,{class:"mt-0.5 size-3.5 shrink-0 text-accent"});var pe=u(_e,2),ue=c(pe,!0);l(pe),l(me),L(Oe=>k(ue,Oe),[()=>n(se).error.includes("404")||n(se).error.includes("route not found")?"This reddb has no AI endpoint (/ai/ask). Configure a provider to enable Ask.":n(se).error]),v(he,me)},xe=he=>{var me=o4(),_e=fe(me);Xe(_e,21,()=>Df(n(se).response.answer),bn,(Ne,ze)=>{var Ze=Re(),$e=fe(Ze);{var Je=ct=>{var qe=_t();L(()=>k(qe,n(ze).value)),v(ct,qe)},tt=ct=>{var qe=e4(),Ve=c(qe,!0);l(qe),L(()=>{Ae(qe,"title",`Jump to source ${n(ze).marker??""}`),k(Ve,n(ze).marker)}),ke("click",qe,()=>C(n(J),n(ze).marker)),v(ct,qe)};K($e,ct=>{n(ze).type==="text"?ct(Je):ct(tt,-1)})}v(Ne,Ze)}),l(_e);var pe=u(_e,2),ue=c(pe);{var Oe=Ne=>{Wn(Ne,{tone:"warn",children:(ze,Ze)=>{Ce();var $e=_t("unverified citations");v(ze,$e)},$$slots:{default:!0}})};K(ue,Ne=>{n(se).response.validation&&!n(se).response.validation.ok&&Ne(Oe)})}var ie=u(ue,2);{var de=Ne=>{var ze=t4(),Ze=c(ze);l(ze),L(()=>k(Ze,`${n(se).response.sources_flat.length??""} source${n(se).response.sources_flat.length===1?"":"s"}`)),ke("click",ze,()=>{_(d,n(J),!0),_(f,null)}),v(Ne,ze)};K(ie,Ne=>{var ze;(ze=n(se).response.sources_flat)!=null&&ze.length&&Ne(de)})}var ye=u(ie,2);{var Pe=Ne=>{var ze=n4(),Ze=c(ze);l(ze),L(()=>k(Ze,`${n(se).response.provider??""}${n(se).response.model?`·${n(se).response.model}`:""}`)),v(Ne,ze)};K(ye,Ne=>{n(se).response.provider&&Ne(Pe)})}var Le=u(ye,2);{var Ee=Ne=>{var ze=r4();v(Ne,ze)};K(Le,Ne=>{n(se).response.cache_hit&&Ne(Ee)})}var Te=u(Le,2);{var Me=Ne=>{var ze=a4(),Ze=c(ze,!0);l(ze),L($e=>k(Ze,$e),[()=>X(n(se).response.cost_usd)]),v(Ne,ze)};K(Te,Ne=>{n(se).response.cost_usd!==void 0&&Ne(Me)})}l(pe),v(he,me)};K(U,he=>{n(se).pending?he(ne):n(se).error?he(ce,1):n(se).response&&he(xe,2)})}l(z),v(O,z)};K(Z,O=>{n(se).role==="user"?O(T):O(q,-1)})}v(be,Y)}),l(P),l(N);var H=u(N,2),V=c(H),j=c(V);Ha(j);var F=u(j,2),ae=c(F);Qf(ae,{class:"size-3.5"}),Ce(),l(F),l(V),l(H),l(m),L((be,se)=>{De(P,1,be),De(V,1,se),Ae(j,"placeholder",n(p)?"Ask anything about this database…":"Connect to ask"),j.disabled=!n(p)||n(b),F.disabled=!n(h)},[()=>je(["mx-auto flex flex-col gap-4 p-4",M()?"max-w-none":"max-w-2xl"].join(" ")),()=>je(["mx-auto flex items-end gap-2",M()?"max-w-none":"max-w-2xl"].join(" "))]),ke("keydown",j,W),zn(j,()=>n(s),be=>_(s,be)),ke("click",F,D),v(E,m)},a=E=>{var M=v4(),m=c(M);{var N=B=>{const $=y(()=>n(S).response);var R=u4(),H=fe(R),V=c(H),j=c(V);l(V);var F=u(V,2),ae=c(F);l(F),l(H);var be=u(H,2),se=c(be);Xe(se,23,()=>n($).sources_flat,(J,Y)=>J.urn+Y,(J,Y,Z)=>{const T=y(()=>Vf(n(Y).urn));var q=d4(),O=c(q),z=c(O),U=c(z,!0);l(z);var ne=u(z,2);{let ue=y(()=>I[n(Y).kind]??"neutral");Wn(ne,{get tone(){return n(ue)},children:(Oe,ie)=>{Ce();var de=_t();L(()=>k(de,n(Y).kind)),v(Oe,de)},$$slots:{default:!0}})}var ce=u(ne,2);{var xe=ue=>{var Oe=l4(),ie=c(Oe,!0),de=u(ie),ye=c(de);l(de),l(Oe),L(()=>{k(ie,n(T).collection),k(ye,`/${n(T).id??""}`)}),v(ue,Oe)};K(ce,ue=>{n(T)&&ue(xe)})}var he=u(ce,2);{var me=ue=>{var Oe=c4(),ie=c(Oe);l(Oe),L(de=>k(ie,`score ${de??""}`),[()=>n(Y).score.toFixed(2)]),v(ue,Oe)};K(he,ue=>{n(Y).score!==void 0&&ue(me)})}l(O);var _e=u(O,2),pe=c(_e,!0);l(_e),l(q),L((ue,Oe)=>{De(q,1,ue),k(U,n(Z)+1),k(pe,Oe)},[()=>je(["rounded border bg-bg-0 p-2.5 transition-colors",n(f)===n(Z)+1?"border-accent":"border-line-1"].join(" ")),()=>G(n(Y).content)]),v(J,q)}),l(se),l(be),L(()=>{k(j,`grounding · ${n($).sources_flat.length??""} source${n($).sources_flat.length===1?"":"s"}`),k(ae,`${n($).provider??""??""}${n($).model?` · ${n($).model}`:""}`)}),v(B,R)},P=B=>{var $=f4();v(B,$)};K(m,B=>{var $;($=n(S))!=null&&$.response?B(N):B(P,-1)})}l(M),v(E,M)};let o=we(Kt([])),s=we(""),i=we(!1),d=we(null),f=we(null),g=0;const p=y(()=>Ke.connected),b=y(()=>_n.locked),h=y(()=>n(p)&&!n(b)&&!n(i)&&n(s).trim().length>0),w=y(()=>n(o).some(E=>{var M,m;return E.role==="assistant"&&(((m=(M=E.response)==null?void 0:M.sources_flat)==null?void 0:m.length)??0)>0})),S=y(()=>n(d)!==null?n(o)[n(d)]:[...n(o)].reverse().find(E=>{var M,m;return(((m=(M=E.response)==null?void 0:M.sources_flat)==null?void 0:m.length)??0)>0})),A=["What changed in the last hour?","Which collections hold the most rows?","Summarize the most recent errors."];async function D(){var P;const E=n(s).trim(),M=Ke.client;if(!E||!M||n(i))return;_(s,"");const m={id:g++,role:"user",text:E},N={id:g++,role:"assistant",text:"",pending:!0};_(o,[...n(o),m,N],!0),_(i,!0);try{const B=await Ct.track("ask",()=>M.ask(E)),$=n(o).findIndex(R=>R.id===N.id);$!==-1&&(n(o)[$]={...N,pending:!1,text:B.answer,response:B},(((P=B.sources_flat)==null?void 0:P.length)??0)>0&&_(d,$,!0))}catch(B){const $=n(o).findIndex(R=>R.id===N.id);$!==-1&&(n(o)[$]={...N,pending:!1,error:B.message})}finally{_(i,!1)}}function W(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),n(h)&&D())}function C(E,M){_(d,E,!0),_(f,M,!0)}function G(E){try{return JSON.stringify(JSON.parse(E),null,2)}catch{return E}}function X(E){return E===void 0?"":E<.01?`$${E.toFixed(4)}`:`$${E.toFixed(2)}`}const I={table:"info",document:"ok",vector:"accent",graph_node:"warn",graph_edge:"warn",kv:"neutral"};var te=b4(),le=c(te);{var oe=E=>{var M=g4(),m=c(M);Fn(m,{get icon(){return Gr},title:"Locked",message:"Unlock the secure store to ask."}),l(M),v(E,M)},ee=E=>{var M=p4(),m=c(M);Fn(m,{get icon(){return No},title:"Not connected",message:"Connect to a reddb instance to ask grounded questions."}),l(M),v(E,M)},ve=E=>{var M=h4(),m=c(M),N=c(m);r(N,()=>!0),l(m);var P=u(m,2),B=c(P);a(B),l(P),l(M),v(E,M)},Q=E=>{r(E,()=>!1)};K(le,E=>{n(b)?E(oe):n(p)?n(w)?E(ve,2):E(Q,-1):E(ee,1)})}l(te),v(t,te),st()}en(["click","keydown"]);var m4=x('<div class="type-label mb-1.5"> </div>'),_4=x('<p class="type-caption m-0 mt-1.5"> </p>'),y4=x('<div class="flex items-center gap-2 shrink-0"><!></div>'),w4=x('<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 $a(t,e){var r=w4(),a=c(r),o=c(a);{var s=S=>{var A=m4(),D=c(A,!0);l(A),L(()=>k(D,e.eyebrow)),v(S,A)};K(o,S=>{e.eyebrow&&S(s)})}var i=u(o,2),d=c(i),f=c(d,!0);l(d);var g=u(d,2);pn(g,()=>e.children??Kn),l(i);var p=u(i,2);{var b=S=>{var A=_4(),D=c(A,!0);l(A),L(()=>k(D,e.subtitle)),v(S,A)};K(p,S=>{e.subtitle&&S(b)})}l(a);var h=u(a,2);{var w=S=>{var A=y4(),D=c(A);pn(D,()=>e.actions),l(A),v(S,A)};K(h,S=>{e.actions&&S(w)})}l(r),L(()=>k(f,e.title)),v(t,r)}var k4=x('<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>'),S4=x('<div class="text-[12px] font-mono text-warn break-words"> </div>'),C4=x('<span class="text-fg-3">note</span> <span class="text-fg-1"> </span>',1),E4=x('<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>'),N4=x('<div class="text-[12px] font-mono text-fg-3">Loading session…</div>'),M4=x('<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),T4=x('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No tenants returned for this principal.</span></div>'),z4=x('<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>'),A4=x('<div class="grid gap-1 text-[12px] font-mono"></div>'),P4=x('<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),L4=x('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No policies returned for this principal.</span></div>'),I4=x('<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>'),O4=x('<div class="text-[11px] text-fg-3"> </div>'),R4=x('<div class="grid gap-1 text-[12px] font-mono"><!> <!></div>'),$4=x('<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),D4=x('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No users returned for this principal.</span></div>'),V4=x('<span class="text-fg-3">-</span>'),H4=x('<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>'),F4=x('<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>'),q4=x('<div class="text-[12px] font-mono text-fg-3">Policy table unavailable for this principal.</div>'),K4=x('<div class="text-[12px] font-mono text-fg-3">No policies to tabulate.</div>'),j4=x('<span class="text-fg-3">-</span>'),B4=x('<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>'),W4=x('<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>'),U4=x('<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"><!> capability matrix unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),G4=x('<div class="text-[12px] font-mono text-fg-3">No capability checks returned.</div>'),Y4=x('<span class="inline-flex items-center gap-1 text-ok"><!> yes</span>'),X4=x('<span class="inline-flex items-center gap-1 text-danger"><!> no</span>'),Z4=x('<span class="text-fg-3">-</span>'),Q4=x('<span class="inline-flex flex-wrap gap-1"></span>'),J4=x('<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-accent"> </td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1"><!></td><td class="max-w-[320px] px-2 py-1 text-fg-3"> </td></tr>'),eS=x('<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">can</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">policy effect</th><th class="px-2 py-1.5 text-left font-normal">reason</th></tr></thead><tbody></tbody></table></div>'),tS=x("<!> <!>",1),nS=x('<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>'),rS=x('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <!></div>');function aS(t,e){it(e,!0);let r=we(null),a=we(Kt([])),o=we(Kt([])),s=we(Kt([])),i=we(null),d=we(Kt([])),f=we(!1),g=we(null),p=we(null),b=we(null),h=we(null),w=we(null);const S=y(()=>Ke.active.url),A=y(()=>Ke.connected),D=y(()=>{var ee;return((ee=n(i))==null?void 0:ee.allowed)===!0});function W(ee){if(!ee)return"-";const ve=ee>1e10?ee:ee*1e3;return new Date(ve).toISOString().replace("T"," ").slice(0,19)}async function C(){const ee=Ke.client;if(!ee||_n.locked||!n(A)){_(r,null),_(a,[],!0),_(o,[],!0),_(s,[],!0),_(i,null),_(d,[],!0);return}_(f,!0),_(g,null),_(p,null),_(b,null),_(h,null),_(w,null),_(i,null),_(d,[],!0);try{_(r,await Ct.track("security · whoami",()=>ee.whoami()),!0)}catch(ve){_(g,ve.message,!0),_(r,null)}try{_(a,await Ct.track("security · tenants",()=>ee.tenants()),!0)}catch(ve){_(p,ve.message,!0),_(a,[],!0)}try{_(o,await Ct.track("security · users",()=>ee.users()),!0)}catch(ve){_(b,ve.message,!0),_(o,[],!0)}try{const[ve]=await Ct.track("security · auth.can policy read",()=>ee.authCan([Ra]));_(i,ve??{...Ra,allowed:!1,reason:"auth.can omitted policy-read decision"},!0)}catch(ve){_(i,{...Ra,allowed:!1,reason:ve.message||"auth.can failed"},!0)}if(n(i).allowed){try{_(s,await Ct.track("security · policies",()=>ee.policies()),!0)}catch(ve){_(h,ve.message,!0),_(s,[],!0)}try{const ve=gu(n(s)),Q=await Ct.track("security · auth.can capability matrix",()=>ee.authCan(ve));_(d,s5(n(s),Q),!0)}catch(ve){_(w,ve.message,!0),_(d,[],!0)}}else _(s,[],!0),_(d,[],!0);_(f,!1)}Xt(()=>{_n.locked||(n(S),n(A),C())});var G=rS(),X=c(G);$a(X,{eyebrow:"Admin",title:"Security",subtitle:"Tenants, users, and policy surfaces are permission-aware. Controls only appear when reddb exposes the grant.",actions:ve=>{var Q=k4(),E=c(Q);{let M=y(()=>n(f)?"size-3.5 animate-spin":"size-3.5");Es(E,{get class(){return n(M)}})}Ce(),l(Q),L(()=>Q.disabled=n(f)||_n.locked||!n(A)),ke("click",Q,C),v(ve,Q)}});var I=u(X,2);{var te=ee=>{Fn(ee,{get icon(){return Gr},title:"Security locked",message:"Enter the master password before red-ui loads auth data."})},le=ee=>{Fn(ee,{get icon(){return Sa},title:"No active connection",message:"Connect to a reddb instance to inspect security posture."})},oe=ee=>{var ve=nS(),Q=c(ve),E=c(Q);Er(E,{title:"session",children:(H,V)=>{var j=Re(),F=fe(j);{var ae=J=>{var Y=S4(),Z=c(Y,!0);l(Y),L(()=>k(Z,n(g))),v(J,Y)},be=J=>{var Y=E4(),Z=u(c(Y),2),T=c(Z);{var q=me=>{Wn(me,{tone:"ok",children:(_e,pe)=>{Ce();var ue=_t("yes");v(_e,ue)},$$slots:{default:!0}})},O=me=>{Wn(me,{tone:"warn",children:(_e,pe)=>{Ce();var ue=_t("no");v(_e,ue)},$$slots:{default:!0}})};K(T,me=>{n(r).authenticated?me(q):me(O,-1)})}l(Z);var z=u(Z,4),U=c(z,!0);l(z);var ne=u(z,4),ce=c(ne,!0);l(ne);var xe=u(ne,2);{var he=me=>{var _e=C4(),pe=u(fe(_e),2),ue=c(pe,!0);l(pe),L(()=>k(ue,n(r).note)),v(me,_e)};K(xe,me=>{n(r).note&&me(he)})}l(Y),L(()=>{k(U,n(r).username),k(ce,n(r).role)}),v(J,Y)},se=J=>{var Y=N4();v(J,Y)};K(F,J=>{n(g)?J(ae):n(r)?J(be,1):J(se,-1)})}v(H,j)},$$slots:{default:!0}});var M=u(E,2);Er(M,{title:"tenants",children:(H,V)=>{var j=Re(),F=fe(j);{var ae=J=>{var Y=M4(),Z=fe(Y),T=c(Z);Sa(T,{class:"size-3.5"}),Ce(),l(Z);var q=u(Z,2),O=c(q,!0);l(q),L(()=>k(O,n(p))),v(J,Y)},be=J=>{var Y=T4(),Z=c(Y);jf(Z,{class:"size-4"}),Ce(2),l(Y),v(J,Y)},se=J=>{var Y=A4();Xe(Y,23,()=>n(a),(Z,T)=>`${Z.id??Z.slug??Z.name??T}`,(Z,T)=>{var q=z4(),O=c(q),z=c(O),U=c(z,!0);l(z);var ne=u(z,2);{var ce=pe=>{Wn(pe,{tone:"accent",children:(ue,Oe)=>{Ce();var ie=_t();L(()=>k(ie,n(T).role)),v(ue,ie)},$$slots:{default:!0}})};K(ne,pe=>{n(T).role&&pe(ce)})}l(O);var xe=u(O,2),he=c(xe),me=u(he);{var _e=pe=>{var ue=_t();L(Oe=>k(ue,`· ${Oe??""}`),[()=>n(T).grants.join(", ")]),v(pe,ue)};K(me,pe=>{var ue;(ue=n(T).grants)!=null&&ue.length&&pe(_e)})}l(xe),l(q),L(()=>{k(U,n(T).name??n(T).slug??n(T).id??"tenant"),k(he,`${n(T).id??n(T).slug??"-"??""} `)}),v(Z,q)}),l(Y),v(J,Y)};K(F,J=>{n(p)?J(ae):n(a).length===0?J(be,1):J(se,-1)})}v(H,j)},$$slots:{default:!0}});var m=u(M,2);{var N=H=>{Er(H,{title:"policies",children:(V,j)=>{var F=Re(),ae=fe(F);{var be=Y=>{var Z=P4(),T=fe(Z),q=c(T);Sa(q,{class:"size-3.5"}),Ce(),l(T);var O=u(T,2),z=c(O,!0);l(O),L(()=>k(z,n(h))),v(Y,Z)},se=Y=>{var Z=L4(),T=c(Z);gv(T,{class:"size-4"}),Ce(2),l(Z),v(Y,Z)},J=Y=>{var Z=R4(),T=c(Z);Xe(T,19,()=>n(s).slice(0,6),(z,U)=>`${z.id??z.name??U}`,(z,U)=>{var ne=I4(),ce=c(ne),xe=c(ce),he=c(xe,!0);l(xe);var me=u(xe,2);{var _e=de=>{{let ye=y(()=>n(U).effect==="deny"?"danger":"ok");Wn(de,{get tone(){return n(ye)},children:(Pe,Le)=>{Ce();var Ee=_t();L(()=>k(Ee,n(U).effect)),v(Pe,Ee)},$$slots:{default:!0}})}};K(me,de=>{n(U).effect&&de(_e)})}l(ce);var pe=u(ce,2),ue=c(pe),Oe=u(ue);{var ie=de=>{var ye=_t();L(()=>k(ye,`· tenant ${n(U).tenant??""}`)),v(de,ye)};K(Oe,de=>{n(U).tenant&&de(ie)})}l(pe),l(ne),L(()=>{k(he,n(U).name??n(U).id??"policy"),k(ue,`${n(U).action??"*"??""} · ${n(U).resource??"*"??""} `)}),v(z,ne)});var q=u(T,2);{var O=z=>{var U=O4(),ne=c(U);l(U),L(()=>k(ne,`${n(s).length-6} more policies in the table.`)),v(z,U)};K(q,z=>{n(s).length>6&&z(O)})}l(Z),v(Y,Z)};K(ae,Y=>{n(h)?Y(be):n(s).length===0?Y(se,1):Y(J,-1)})}v(V,F)},$$slots:{default:!0}})};K(m,H=>{n(D)&&H(N)})}l(Q);var P=u(Q,2),B=c(P);Er(B,{title:"users",children:(H,V)=>{var j=Re(),F=fe(j);{var ae=J=>{var Y=$4(),Z=fe(Y),T=c(Z);Sa(T,{class:"size-3.5"}),Ce(),l(Z);var q=u(Z,2),O=c(q,!0);l(q),L(()=>k(O,n(b))),v(J,Y)},be=J=>{var Y=D4(),Z=c(Y);yv(Z,{class:"size-4"}),Ce(2),l(Y),v(J,Y)},se=J=>{var Y=F4(),Z=c(Y),T=u(c(Z));Xe(T,21,()=>n(o),q=>q.username,(q,O)=>{var z=H4(),U=c(z),ne=c(U,!0);l(U);var ce=u(U),xe=c(ce,!0);l(ce);var he=u(ce),me=c(he);{var _e=ye=>{Wn(ye,{tone:"ok",children:(Pe,Le)=>{Ce();var Ee=_t("on");v(Pe,Ee)},$$slots:{default:!0}})},pe=ye=>{var Pe=V4();v(ye,Pe)};K(me,ye=>{n(O).mfa?ye(_e):ye(pe,-1)})}l(he);var ue=u(he),Oe=c(ue,!0);l(ue);var ie=u(ue),de=c(ie,!0);l(ie),l(z),L((ye,Pe)=>{k(ne,n(O).username),k(xe,n(O).role??"-"),k(Oe,ye),k(de,Pe)},[()=>W(n(O).created_at),()=>W(n(O).last_active)]),v(q,z)}),l(T),l(Z),l(Y),v(J,Y)};K(F,J=>{n(b)?J(ae):n(o).length===0?J(be,1):J(se,-1)})}v(H,j)},$$slots:{default:!0}});var $=u(B,2);{var R=H=>{var V=tS(),j=fe(V);Er(j,{title:"policy table",children:(ae,be)=>{var se=Re(),J=fe(se);{var Y=q=>{var O=q4();v(q,O)},Z=q=>{var O=K4();v(q,O)},T=q=>{var O=W4(),z=c(O),U=u(c(z));Xe(U,23,()=>n(s),(ne,ce)=>`${ne.id??ne.name??ce}`,(ne,ce)=>{var xe=B4(),he=c(xe),me=c(he);{var _e=Te=>{{let Me=y(()=>n(ce).effect==="deny"?"danger":"ok");Wn(Te,{get tone(){return n(Me)},children:(Ne,ze)=>{Ce();var Ze=_t();L(()=>k(Ze,n(ce).effect)),v(Ne,Ze)},$$slots:{default:!0}})}},pe=Te=>{var Me=j4();v(Te,Me)};K(me,Te=>{n(ce).effect?Te(_e):Te(pe,-1)})}l(he);var ue=u(he),Oe=c(ue,!0);l(ue);var ie=u(ue),de=c(ie,!0);l(ie);var ye=u(ie),Pe=c(ye,!0);l(ye);var Le=u(ye),Ee=c(Le,!0);l(Le),l(xe),L(()=>{k(Oe,n(ce).principal??"-"),k(de,n(ce).action??"*"),k(Pe,n(ce).resource??"*"),k(Ee,n(ce).tenant??"-")}),v(ne,xe)}),l(U),l(z),l(O),v(q,O)};K(J,q=>{n(h)?q(Y):n(s).length===0?q(Z,1):q(T,-1)})}v(ae,se)},$$slots:{default:!0}});var F=u(j,2);Er(F,{title:"my capabilities",children:(ae,be)=>{var se=Re(),J=fe(se);{var Y=q=>{var O=U4(),z=fe(O),U=c(z);Sa(U,{class:"size-3.5"}),Ce(),l(z);var ne=u(z,2),ce=c(ne,!0);l(ne),L(()=>k(ce,n(w))),v(q,O)},Z=q=>{var O=G4();v(q,O)},T=q=>{var O=eS(),z=c(O),U=u(c(z));Xe(U,21,()=>n(d),ne=>ne.id,(ne,ce)=>{var xe=J4(),he=c(xe),me=c(he);{var _e=Ne=>{var ze=Y4(),Ze=c(ze);Cs(Ze,{class:"size-3.5"}),Ce(),l(ze),v(Ne,ze)},pe=Ne=>{var ze=X4(),Ze=c(ze);Uf(Ze,{class:"size-3.5"}),Ce(),l(ze),v(Ne,ze)};K(me,Ne=>{n(ce).allowed?Ne(_e):Ne(pe,-1)})}l(he);var ue=u(he),Oe=c(ue,!0);l(ue);var ie=u(ue),de=c(ie,!0);l(ie);var ye=u(ie),Pe=c(ye);{var Le=Ne=>{var ze=Z4();v(Ne,ze)},Ee=Ne=>{var ze=Q4();Xe(ze,21,()=>n(ce).effects,bn,(Ze,$e)=>{{let Je=y(()=>n($e)==="deny"?"danger":"ok");Wn(Ze,{get tone(){return n(Je)},children:(tt,ct)=>{Ce();var qe=_t();L(()=>k(qe,n($e))),v(tt,qe)},$$slots:{default:!0}})}}),l(ze),v(Ne,ze)};K(Pe,Ne=>{n(ce).effects.length===0?Ne(Le):Ne(Ee,-1)})}l(ye);var Te=u(ye),Me=c(Te,!0);l(Te),l(xe),L(()=>{k(Oe,n(ce).action),k(de,n(ce).resourceLabel),k(Me,n(ce).reason??"-")}),v(ne,xe)}),l(U),l(z),l(O),v(q,O)};K(J,q=>{n(w)?q(Y):n(d).length===0?q(Z,1):q(T,-1)})}v(ae,se)},$$slots:{default:!0}}),v(H,V)};K($,H=>{n(D)&&H(R)})}l(P),l(ve),v(ee,ve)};K(I,ee=>{_n.locked?ee(te):n(A)?ee(oe,-1):ee(le,1)})}l(G),v(t,G),st()}en(["click"]);function xr(t){const e=t.resource.tenant??"",r=t.current_tenant??"";return[t.action,t.resource.kind,t.resource.name,e,r].join("")}function So(t,e){return{...t,allowed:!1,reason:e}}var oo,Tr,Hr;class oS{constructor(e){Fe(this,oo);Fe(this,Tr,new Map);Fe(this,Hr,new Map);Qr(this,oo,e)}cachedDecision(e){return ge(this,Tr).get(xr(e))??null}cachedCan(e){var r;return((r=this.cachedDecision(e))==null?void 0:r.allowed)===!0}async decision(e){return await this.preload([e]),this.cachedDecision(e)??So(e,"auth.can did not return a decision")}async can(e){return(await this.decision(e)).allowed}async preload(e){const r=e.filter(o=>!ge(this,Tr).has(xr(o)));if(r.length===0)return;const a=new Map;for(const o of r){const s=xr(o);ge(this,Hr).has(s)||a.set(s,o)}if(a.size>0){const o=[...a.values()],s=ge(this,oo).authCan(o).then(i=>{const d=new Map(i.map(f=>[xr(f),f]));for(const f of o){const g=xr(f);ge(this,Tr).set(g,d.get(g)??So(f,"auth.can omitted this check"))}}).catch(i=>{const d=i.message||"auth.can failed";for(const f of o)ge(this,Tr).set(xr(f),So(f,d))}).finally(()=>{for(const i of o)ge(this,Hr).delete(xr(i))});for(const i of o){const d=xr(i);ge(this,Hr).set(d,s.then(()=>ge(this,Tr).get(d)??So(i,"auth.can did not return a decision")))}}await Promise.all(r.map(o=>ge(this,Hr).get(xr(o))))}}oo=new WeakMap,Tr=new WeakMap,Hr=new WeakMap;function Yn(t){return typeof t=="string"&&t.trim()?t:void 0}function Da(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function iS(t){const e=Yn(t.value_type)??Yn(t.valueType)??Yn(t["value-type"]);return e==null?void 0:e.toLowerCase()}function sS(t){return Da(t.schema_version)??Da(t.schemaVersion)??Da(t["schema-version"])}function lS(t){if(typeof t=="string"){const i=t.trim();return i==="&***"?{type:"secret_ref",key:"***",masked:!0}:/^&[A-Za-z0-9_.-]+$/.test(i)?{type:"secret_ref",key:i.slice(1)}:void 0}if(!t||typeof t!="object"||Array.isArray(t))return;const e=t;if(e.type!=="secret_ref")return;const r=Yn(e.key)??Yn(e.path)??Yn(e.name);if(!r)return;const a={type:"secret_ref",key:r},o=Yn(e.store),s=Yn(e.collection);return o&&(a.store=o),s&&(a.collection=s),r==="***"&&(a.masked=!0),a}function fc(t){const e=t==null?void 0:t.trim();if(e)return Zr(e,"SHOW CONFIG prefix")}function Zr(t,e){const r=t.trim();if(!/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(r))throw new Error(`${e} must be a dotted identifier path`);return r}function pu(t){return`'${t.replace(/'/g,"''")}'`}function cS(t){if(t===null)return"NULL";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"){if(!Number.isFinite(t))throw new Error("Config number value must be finite");return String(t)}return typeof t=="string"?pu(t):JSON.stringify(t)}function dS(t,e){return`SET CONFIG ${Zr(t,"SET CONFIG key")} = ${cS(e)}`}function uS(t){const e=Zr(t,"DELETE CONFIG key"),r=e.lastIndexOf(".");if(r<=0||r===e.length-1)throw new Error("DELETE CONFIG key must include a collection and key");return`DELETE CONFIG ${e.slice(0,r)} ${e.slice(r+1)}`}function fS(t,e){return`SET SECRET ${Zr(t,"SET SECRET key")} = ${pu(e)}`}function vS(t){return`DELETE SECRET ${Zr(t,"DELETE SECRET key")}`}function gS(t){return`UNSEAL VAULT ${Zr(t,"UNSEAL VAULT key")}`}function vc(t,e){if(!t.ok)throw new Error(t.error??`${e} failed`);return t}function gc(t,e){if(!t.ok)throw new Error(t.error??`${e} failed`);return{...t,query:e,record_count:0,result:{columns:[],records:[]}}}function pS(t,e){if(!t.ok)throw new Error(t.error??"UNSEAL VAULT failed");for(const r of t.result.records){const a=r.values,o=Yn(a.key);if(o&&o!==e)continue;const s=a.value??a.plaintext??a.secret;if(typeof s=="string")return{key:e,value:s}}throw new Error("UNSEAL VAULT returned no plaintext value")}function hS(t){if(!t.ok)throw new Error(t.error??"SHOW CONFIG failed");const e=[];for(const r of t.result.records){const a=r.values,o=Yn(a.key);if(!o||a.tombstone===!0)continue;const s={key:o,value:lS(a.value)??a.value},i=Yn(a.collection),d=Da(a.version),f=iS(a),g=sS(a);i&&(s.collection=i),d!==void 0&&(s.version=d),f&&(s.valueType=f),g!==void 0&&(s.schemaVersion=g),"tags"in a&&(s.tags=a.tags),e.push(s)}return e.sort((r,a)=>r.key.localeCompare(a.key))}function bS(t){if(!t.ok)throw new Error(t.error??"SHOW SECRETS failed");const e=[];for(const r of t.result.records){const a=r.values,o=Yn(a.key);if(!o)continue;if(a.value!=="***")throw new Error("SHOW SECRETS returned an unmasked secret value");const i={key:o,value:"***"},d=Yn(a.status),f=Da(a.version);d&&(i.status=d),f!==void 0&&(i.version=f),e.push(i)}return e.sort((r,a)=>r.key.localeCompare(a.key))}class Or{constructor(e){this.transport=e}async showConfig(e){const r=fc(e),a=await this.transport.query(r?`SHOW CONFIG ${r}`:"SHOW CONFIG");return hS(a)}async showSecrets(e){const r=fc(e),a=await this.transport.query(r?`SHOW SECRETS ${r}`:"SHOW SECRETS");return bS(a)}async setConfig(e,r){const a=await this.transport.query(dS(e,r));return vc(a,"SET CONFIG")}async unsetConfig(e){const r=await this.transport.query(uS(e));return vc(r,"DELETE CONFIG")}async setSecret(e,r){const a=await this.transport.query(fS(e,r));return gc(a,"SET SECRET")}async deleteSecret(e){const r=await this.transport.query(vS(e));return gc(r,"DELETE SECRET")}async revealSecret(e){const r=Zr(e,"UNSEAL VAULT key"),a=await this.transport.query(gS(r));return pS(a,r)}}const Va=[{id:"config",label:"Config",blurb:"Live non-secret configuration from SHOW CONFIG.",icon:"settings",readGrant:{action:"config:read",resource:{kind:"config",name:"*"}},writeGrant:{action:"config:write",resource:{kind:"config",name:"*"}}},{id:"secrets",label:"Secrets",blurb:"Vault inventory from SHOW SECRETS with values masked.",icon:"key",readGrant:{action:"vault:read_metadata",resource:{kind:"vault",name:"*"}},writeGrant:{action:"vault:write",resource:{kind:"vault",name:"*"}},revealGrant:{action:"vault:read",resource:{kind:"vault",name:"*"}}}],xS={"durability.mode":"Durability mode","concurrency.locking.enabled":"Locking","cache.blob.l1_bytes_max":"Blob L1 cache","cache.blob.l2_bytes_max":"Blob L2 cache","red.auth.enabled":"Authentication","red.auth.require_auth":"Require authentication","red.auth.session_ttl_secs":"Session TTL","red.backup.backend":"Backup backend","red.backup.enabled":"Backups","red.backup.interval_secs":"Backup interval","red.cdc.enabled":"Change data capture","red.config.secret.auto_decrypt":"Auto-decrypt config secrets","red.config.secret.auto_encrypt":"Auto-encrypt config secrets","red.server.max_body_size":"Max request body","red.server.max_scan_limit":"Max scan limit","red.server.read_timeout_ms":"Read timeout","red.server.write_timeout_ms":"Write timeout","red.storage.page_size":"Page size","red.storage.page_cache_capacity":"Page cache capacity","red.storage.verify_checksums":"Verify checksums","red.system.os":"Operating system","red.system.arch":"Architecture","red.system.hostname":"Hostname","red.system.cpu_cores":"CPU cores","red.system.total_memory_bytes":"System memory","red.vcs.default_branch":"Default branch","red.vcs.protected_branches":"Protected branches","runtime.result_cache.backend":"Result cache backend","runtime.result_cache.enabled":"Result cache","storage.bgwriter.delay_ms":"Background writer delay","storage.btree.lehman_yao":"Lehman-Yao B-tree","storage.wal.max_interval_ms":"WAL max interval","system.bootstrap.completed":"Bootstrap completed","system.bootstrap.preset":"Bootstrap preset"},mS={"durability.mode":"Write durability policy currently reported by reddb.","red.auth.enabled":"Whether reddb authentication is enabled for this instance.","red.auth.require_auth":"Whether unauthenticated requests are rejected.","red.backup.backend":"The selected backup storage backend.","red.backup.enabled":"Whether scheduled backups are enabled.","red.cdc.enabled":"Whether the change stream subsystem is enabled.","red.server.max_body_size":"Maximum accepted HTTP request body size, in bytes.","red.server.max_scan_limit":"Default cap for scan-heavy API paths.","red.storage.page_size":"On-disk page size used by the storage engine.","red.storage.verify_checksums":"Whether page checksums are verified on read.","red.vcs.default_branch":"Branch name used when VCS features need a default.","red.vcs.protected_branches":"Branches protected from destructive operations.","runtime.result_cache.enabled":"Whether query result caching is enabled.","system.bootstrap.preset":"The bootstrap profile that initialized defaults."},_S={"durability.mode":["sync","async","none"],"red.backup.backend":["local","s3","gcs"],"runtime.result_cache.backend":["legacy","blob_cache"]};function hu(t){const r=(t.split(".").pop()??t).replace(/[_-]+/g," ").trim();return r?r.charAt(0).toUpperCase()+r.slice(1):t}function yS(t){switch(t){case"bool":case"boolean":return"boolean";case"int":case"integer":case"float":case"number":case"count":return"number";case"array":case"list":return"list";case"object":case"string":case"text":case"url":return"text";default:return null}}function wS(t){return typeof t=="boolean"?"boolean":typeof t=="number"?"number":Array.isArray(t)?"list":"text"}function bu(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&t.type==="secret_ref"&&typeof t.key=="string"}function xs(t){const e=_S[t.key],r=bu(t.value)?t.value:void 0,a=r?"secret-reference":e?"enum":yS(t.valueType)??wS(t.value),o={key:t.key,label:xS[t.key]??hu(t.key),kind:a},s=mS[t.key];return s&&(o.description=s),e&&(o.options=e),t.valueType&&(o.valueType=t.valueType),t.schemaVersion!==void 0&&(o.schemaVersion=t.schemaVersion),r&&(o.secretReference=r),o}function ms(t){return{key:t.key,label:hu(t.key),kind:"text",masked:!0}}function kS(t,e=Va){return e.find(r=>r.id===t)??e[0]??Va[0]}function SS(t,e){return t.filter(r=>e.cachedCan(r.readGrant))}function CS(t,e){const r=e.trim().toLowerCase();return r?t.filter(a=>a.key.toLowerCase().includes(r)||xs(a).label.toLowerCase().includes(r)||bu(a.value)&&a.value.key.toLowerCase().includes(r)):[...t]}function ES(t,e){const r=e.trim().toLowerCase();return r?t.filter(a=>{var o;return a.key.toLowerCase().includes(r)||ms(a).label.toLowerCase().includes(r)||((o=a.status)==null?void 0:o.toLowerCase().includes(r))}):[...t]}function NS(t){return Array.isArray(t.value)||t.value&&typeof t.value=="object"?JSON.stringify(t.value,null,2):t.value===null||t.value===void 0?"":String(t.value)}function pc(t,e){var a;const r=e.trim();switch(t.kind){case"boolean":return r==="true"?{ok:!0,value:!0}:r==="false"?{ok:!0,value:!1}:{ok:!1,error:"Boolean config values must be true or false."};case"number":{if(!r)return{ok:!1,error:"Number config values cannot be empty."};const o=Number(r);return Number.isFinite(o)?{ok:!0,value:o}:{ok:!1,error:"Number config values must be finite."}}case"enum":return(a=t.options)!=null&&a.includes(e)?{ok:!0,value:e}:{ok:!1,error:"Choose one of the allowed config values."};case"list":try{const o=JSON.parse(e);return Array.isArray(o)?{ok:!0,value:o}:{ok:!1,error:"List config values must be a JSON array."}}catch{return{ok:!1,error:"List config values must be valid JSON."}}case"secret-reference":return{ok:!1,error:"Secret references can be unset, but not edited as plaintext config."};case"text":default:return{ok:!0,value:e}}}var MS=x('<span class="font-mono text-fg-2"> </span> live rows',1),TS=x('<div class="h-12 rounded-md bg-bg-2 motion-safe:animate-pulse"></div>'),zS=x('<div class="grid gap-1 p-2"></div>'),AS=x('<div class="h-12 rounded-md bg-bg-2 motion-safe:animate-pulse"></div>'),PS=x('<div class="grid gap-1 p-2"></div>'),LS=x('<div><button type="button" class="min-w-0 text-left"><span class="block truncate text-[13px]"> </span> <span class="block truncate font-mono text-[11px] text-fg-3"> </span></button> <div class="inline-flex h-6 items-center gap-1.5 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-fg-2"><!> </div></div>'),IS=x('<div class="grid gap-1 p-2"></div>'),OS=x('<label class="inline-flex h-6 items-center gap-1.5 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-fg-2"><input type="checkbox" disabled="" tabindex="-1" class="size-3 accent-current"/> </label>'),RS=x("<option> </option>"),$S=x("<option> </option>"),DS=x('<select disabled="" tabindex="-1" class="h-6 w-28 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-accent disabled:opacity-100"><!><!></select>'),VS=x('<input readonly="" tabindex="-1" class="h-6 w-28 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-fg-2 outline-none"/>'),HS=x('<div><button type="button" class="min-w-0 text-left"><span class="block truncate text-[13px]"> </span> <span class="block truncate font-mono text-[11px] text-fg-3"> </span></button> <!></div>'),FS=x('<div class="grid gap-1 p-2"></div>'),qS=x('<button type="button" class="inline-flex h-7 items-center justify-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 transition-colors hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> export config</button>'),KS=x('Live from <span class="font-mono text-fg-2"> </span>.',1),jS=x("<!> <!>",1),BS=x("<!> <!>",1),WS=x('<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>'),US=x('<input readonly="" class="h-8 w-full rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none"/>'),GS=x('<span class="font-mono text-[12px] text-fg-1"> </span>'),YS=x('<div class="flex flex-wrap justify-end gap-1.5"><!> <!></div>'),XS=x('<button type="button" class="inline-flex h-8 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"><!> hide</button>'),ZS=x('<button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-warn/40 bg-warn/5 px-2.5 text-[11px] font-mono text-warn hover:border-warn/70 disabled:cursor-not-allowed disabled:opacity-40"><!> reveal</button>'),QS=x('<button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-danger/30 bg-danger/5 px-2.5 text-[11px] font-mono text-danger hover:border-danger/60 disabled:cursor-not-allowed disabled:opacity-40"><!> delete</button>'),JS=x('<section><!> <div class="divide-y divide-line-1 overflow-hidden rounded-lg border border-line-1 bg-bg-1"><!> <!> <!> <!> <!></div></section>'),eC=x('<div role="status"><!> <span class="truncate"> </span></div>'),tC=x('<div role="status"><!> <span class="truncate"> </span></div>'),nC=x('<!> <section><!> <div class="grid gap-2 rounded-lg border border-line-1 bg-bg-1 p-3"><input type="text" placeholder="mycompany.payments.key" aria-label="Secret key" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/> <input type="password" placeholder="New secret value" autocomplete="new-password" aria-label="New secret value" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/> <div class="flex justify-end"><button type="button" class="inline-flex h-8 shrink-0 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"><!> set</button></div></div></section>',1),rC=x('<section class="grid gap-4"><!> <!> <!></section>'),aC=x('<label class="inline-flex h-8 items-center gap-2 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1"><input type="checkbox" class="size-3 accent-current"/> </label>'),oC=x("<option> </option>"),iC=x("<option> </option>"),sC=x('<select class="h-8 min-w-[12rem] rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 disabled:opacity-100"><!><!></select>'),lC=x('<textarea rows="5" class="min-h-24 w-full resize-y rounded-md border border-line-2 bg-bg-2 px-2.5 py-2 font-mono text-[12px] text-fg-1 outline-none"></textarea>'),cC=x('<input readonly="" type="text" class="h-8 w-full rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none"/>'),dC=x('<input class="h-8 w-full rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none"/>'),uC=x('<span class="font-mono text-[12px] text-fg-1"> </span>'),fC=x('<div class="flex flex-wrap justify-end gap-1.5"><!> <!></div>'),vC=x('<div class="flex flex-wrap justify-end gap-2"><button type="button" class="inline-flex h-8 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"><!> save</button> <button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-danger/30 bg-danger/5 px-2.5 text-[11px] font-mono text-danger hover:border-danger/60 disabled:cursor-not-allowed disabled:opacity-40"><!> unset</button></div>'),gC=x('<div role="status"><!> <span class="truncate"> </span></div>'),pC=x('<label class="inline-flex h-8 w-fit items-center gap-2 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1"><input type="checkbox" class="size-3 accent-current"/> </label>'),hC=x('<textarea rows="4" placeholder="["main", "release"]" aria-label="New config value" class="min-h-20 resize-y rounded-md border border-line-2 bg-bg-2 px-2.5 py-2 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"></textarea>'),bC=x('<input type="text" aria-label="New config value" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/>'),xC=x('<!> <section class="mt-4 border-t border-line-1 pt-4"><!> <div class="grid gap-2 rounded-lg border border-line-1 bg-bg-1 p-3"><div class="grid gap-2 @min-[42rem]:grid-cols-[minmax(0,1fr)_8rem]"><input type="text" placeholder="red.example.key" aria-label="New config key" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/> <select aria-label="New config value type" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none disabled:cursor-not-allowed disabled:opacity-50"><option>text</option><option>number</option><option>boolean</option><option>list</option></select></div> <!> <div class="flex justify-end"><button type="button" class="inline-flex h-8 shrink-0 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"><!> set</button></div></div></section>',1),mC=x('<section><!> <div class="divide-y divide-line-1 overflow-hidden rounded-lg border border-line-1 bg-bg-1"><!> <!> <!> <!></div> <!></section>'),_C=x("<!> <!>",1),yC=x('<div class="@container h-full min-h-0 bg-bg-0"><div class="grid h-full min-h-0 grid-cols-1 @min-[62rem]:grid-cols-[13rem_minmax(18rem,24rem)_minmax(0,1fr)]"><aside class="flex min-h-0 flex-col border-b border-line-1 bg-bg-1 @min-[62rem]:border-b-0 @min-[62rem]:border-r"><div class="border-b border-line-1 px-3 py-3"><div class="type-label">Settings</div> <div class="mt-1 text-[13px] text-fg-1">Governance surface</div></div> <nav class="grid gap-0.5 p-2"></nav> <div class="mt-auto border-t border-line-1 px-3 py-2.5 text-[11px] text-fg-3"><!></div></aside> <section class="flex min-h-0 flex-col border-b border-line-1 bg-bg-1 @min-[62rem]:border-b-0 @min-[62rem]:border-r"><div class="border-b border-line-1 p-2"><div class="relative"><!> <input type="text" class="h-7 w-full rounded-md border border-line-2 bg-bg-2 pl-8 pr-2.5 text-xs text-fg-1 placeholder:text-fg-3 outline-none transition-colors focus:border-line-3 disabled:cursor-not-allowed disabled:opacity-50"/></div></div> <div class="min-h-0 flex-1 overflow-y-auto"><!></div> <div class="grid gap-2 border-t border-line-1 px-3 py-2.5"><!> <div class="truncate text-[11px] text-fg-3"><!></div></div></section> <main class="min-h-0 min-w-0 overflow-auto bg-bg-0"><div class="p-6"><!></div></main></div></div>');function wC(t,e){it(e,!0);const r={key:Ma,settings:Xi};let a=we(Kt(Va[0].id)),o=we(Kt([])),s=we(null),i=we(!1),d=we(null),f=0;const g=y(()=>n(o).length>0),p=y(()=>kS(n(a),n(o)));let b=we(Kt({})),h=we(null);const w=y(()=>n(g)?n(b)[n(p).id]??"":"");let S=we(Kt([])),A=we(Kt([])),D=we(null),W=we(null),C=we(!1),G=we(null),X=we(null),I=we(!1),te=we(null),le=we(null),oe=we(""),ee=we(""),ve=we("text"),Q=we(""),E=we(null),M=we(""),m=we(""),N=we(!1),P=we(null),B=we(null),$=null;const R=y(()=>Ke.connected),H=y(()=>Ke.active.url),V=y(()=>n(p).id==="secrets"?n(X):n(G)),j=y(()=>!n(R)||n(V)!==null),F=y(()=>CS(n(S),n(w))),ae=y(()=>ES(n(A),n(w))),be=y(()=>n(p).id==="secrets"?n(ae).length:n(F).length),se=y(()=>n(p).id==="secrets"?n(A).length:n(S).length),J=y(()=>n(F).find(Se=>Se.key===n(D))??n(F)[0]??null),Y=y(()=>n(ae).find(Se=>Se.key===n(W))??n(ae)[0]??null),Z=y(()=>n(J)?xs(n(J)):null),T=y(()=>n(Y)?ms(n(Y)):null),q=y(()=>{var Se;return n(p).id==="config"&&!!n(p).writeGrant&&((Se=n(s))==null?void 0:Se.cachedCan(n(p).writeGrant))===!0}),O=y(()=>{var Se;return n(p).id==="secrets"&&!!n(p).writeGrant&&((Se=n(s))==null?void 0:Se.cachedCan(n(p).writeGrant))===!0}),z=y(()=>{var Se;return n(p).id==="secrets"&&!!n(p).revealGrant&&((Se=n(s))==null?void 0:Se.cachedCan(n(p).revealGrant))===!0}),U=y(()=>{var Se;return n(Y)&&((Se=n(B))==null?void 0:Se.key)===n(Y).key?n(B).value:null});function ne(Se){n(g)&&_(b,{...n(b),[n(p).id]:Se},!0)}function ce(Se,Ie,He){_(te,{paneId:Se,tone:Ie,message:He},!0)}function xe(){$&&(clearTimeout($),$=null),_(B,null)}function he(Se,Ie){xe(),_(B,{key:Se,value:Ie},!0),$=setTimeout(()=>{_(B,null),$=null},3e4)}function me(Se){n(W)!==Se&&xe(),_(W,Se,!0)}function _e(Se){var Ie,He;(Se.metaKey||Se.ctrlKey)&&Se.key.toLowerCase()==="k"&&(Se.preventDefault(),(Ie=n(h))==null||Ie.focus(),(He=n(h))==null||He.select())}async function pe(){const Se=Ke.client,Ie=++f;if(_(s,null),_(o,[],!0),_(d,null),_(S,[],!0),_(A,[],!0),_(D,null),_(W,null),_(te,null),_(le,null),_(E,null),_(M,""),_(m,""),_(P,null),xe(),!Se||!n(R)){_(i,!1);return}_(i,!0);const He=new oS(Se);try{if(await Ct.track("settings · auth.can panes",()=>He.preload(Va.flatMap(et=>[et.readGrant,et.writeGrant,et.revealGrant].filter(nt=>!!nt)))),Ie!==f)return;_(s,He,!0);const Ye=SS(Va,He);_(o,Ye,!0),Ye.length>0&&!Ye.some(et=>et.id===n(a))&&_(a,Ye[0].id,!0)}catch(Ye){if(Ie!==f)return;_(o,[],!0),_(s,null),_(d,Ye.message,!0)}finally{Ie===f&&_(i,!1)}}async function ue(){var He,Ye;const Se=Ke.client,Ie=n(s);if(!Se||!n(R)||!Ie||!n(g)||!Ie.cachedCan(n(p).readGrant)){_(S,[],!0),_(A,[],!0),_(D,null),_(W,null),_(G,null),_(X,null);return}_(C,!0),n(p).id==="secrets"?(_(X,null),_(P,null),xe()):_(G,null);try{const et=new Or(Se);if(n(p).id==="secrets"){const nt=await Ct.track("settings · show secrets",()=>et.showSecrets());_(A,nt,!0),(!n(W)||!nt.some(Ue=>Ue.key===n(W)))&&_(W,((He=nt[0])==null?void 0:He.key)??null,!0)}else{const nt=await Ct.track("settings · show config",()=>et.showConfig());_(S,nt,!0),(!n(D)||!nt.some(Ue=>Ue.key===n(D)))&&_(D,((Ye=nt[0])==null?void 0:Ye.key)??null,!0)}}catch(et){n(p).id==="secrets"?(_(A,[],!0),_(W,null),_(X,et.message,!0)):(_(S,[],!0),_(D,null),_(G,et.message,!0))}finally{_(C,!1)}}function Oe(){return pc({key:n(ee),label:n(ee),kind:n(ve)},n(ve)==="boolean"&&!n(Q).trim()?"false":n(Q))}async function ie(){const Se=Ke.client;if(!Se||!n(J)||!n(Z)||!n(q)||n(I))return;const Ie=pc(n(Z),n(oe));if(!Ie.ok){ce("config","error",Ie.error??"Invalid config value.");return}_(I,!0),_(te,null);try{const He=new Or(Se);await Ct.track("settings · set config",()=>He.setConfig(n(J).key,Ie.value??null)),_(D,n(J).key,!0),ce("config","ok",`${n(J).key} saved.`),await ue()}catch(He){ce("config","error",He.message)}finally{_(I,!1)}}async function de(){const Se=Ke.client;if(!Se||!n(J)||!n(q)||n(I)||!window.confirm(`Unset ${n(J).key}?`))return;const Ie=n(J).key;_(I,!0),_(te,null);try{const He=new Or(Se);await Ct.track("settings · delete config",()=>He.unsetConfig(Ie)),_(D,Ie,!0),ce("config","ok",`${Ie} unset.`),await ue()}catch(He){ce("config","error",He.message)}finally{_(I,!1)}}async function ye(){const Se=Ke.client;if(!Se||!n(q)||n(I))return;const Ie=Oe();if(!Ie.ok){ce("config","error",Ie.error??"Invalid config value.");return}const He=n(ee).trim();_(I,!0),_(te,null);try{const Ye=new Or(Se);await Ct.track("settings · set config",()=>Ye.setConfig(He,Ie.value??null)),_(D,He,!0),_(ee,""),_(Q,""),ce("config","ok",`${He} set.`),await ue()}catch(Ye){ce("config","error",Ye.message)}finally{_(I,!1)}}async function Pe(){const Se=Ke.client;if(!Se||!n(O)||n(I))return;const Ie=n(M).trim(),He=n(m);if(!Ie){ce("secrets","error","Secret key is required.");return}if(!He){ce("secrets","error","Secret value is required.");return}_(I,!0),_(te,null);try{const Ye=new Or(Se);await Ct.track("settings · set secret",()=>Ye.setSecret(Ie,He)),_(W,Ie,!0),_(m,""),ce("secrets","ok",`${Ie} set.`),await ue()}catch(Ye){_(m,""),ce("secrets","error",Ye.message)}finally{_(I,!1)}}async function Le(){const Se=Ke.client;if(!Se||!n(Y)||!n(O)||n(I)||!window.confirm(`Delete secret ${n(Y).key}?`))return;const Ie=n(Y).key;_(I,!0),_(te,null);try{const He=new Or(Se);await Ct.track("settings · delete secret",()=>He.deleteSecret(Ie)),_(m,""),_(W,Ie,!0),ce("secrets","ok",`${Ie} deleted.`),await ue()}catch(He){_(m,""),ce("secrets","error",He.message)}finally{_(I,!1)}}async function Ee(){const Se=Ke.client;if(!Se||!n(Y)||!n(z)||n(N))return;const Ie=n(Y).key;_(N,!0),_(P,null),xe();try{const He=new Or(Se),Ye=await Ct.track("settings · reveal secret",()=>He.revealSecret(Ie));he(Ye.key,Ye.value),_(P,{tone:"ok",key:Ie,message:"Plaintext revealed temporarily."},!0)}catch(He){_(P,{tone:"error",key:Ie,message:He.message},!0)}finally{_(N,!1)}}Xt(()=>{n(H),n(R),pe()}),Xt(()=>{n(H),n(R),n(a),n(s),n(o),ue()}),Xt(()=>{if(!n(J)){_(le,null),_(oe,"");return}n(le)!==n(J).key&&(_(le,n(J).key,!0),_(oe,NS(n(J)),!0),_(te,null))}),Xt(()=>{n(p).id!=="secrets"||!n(Y)||n(E)!==n(Y).key&&(!n(M).trim()||n(M)===n(E))&&(_(M,n(Y).key,!0),_(E,n(Y).key,!0),_(te,null))});function Te(Se){if(!Number.isFinite(Se))return String(Se);const Ie=["B","KB","MB","GB","TB"];let He=Se,Ye=0;for(;He>=1024&&Ye<Ie.length-1;)He/=1024,Ye++;return`${Ye===0?He:He.toFixed(1)} ${Ie[Ye]}`}function Me(Se){return Se.masked?"&***":`&${Se.collection?`${Se.collection}.`:""}${Se.key}`}function Ne(Se){return!!Se&&typeof Se=="object"&&!Array.isArray(Se)&&"type"in Se&&Se.type==="secret_ref"}function ze(Se){const Ie=Se.value;return Ne(Ie)?Me(Ie):typeof Ie=="number"&&Se.key.endsWith("_bytes")?Te(Ie):Array.isArray(Ie)?`${Ie.length} item${Ie.length===1?"":"s"}`:Ie&&typeof Ie=="object"?JSON.stringify(Ie):Ie==null?"null":String(Ie)}function Ze(Se){return Array.isArray(Se)||Se&&typeof Se=="object"?JSON.stringify(Se,null,2):Se==null?"null":String(Se)}function $e(){const Se={url:n(H),exportedAt:new Date().toISOString(),projection:"SHOW CONFIG",config:n(S).map(et=>({key:et.key,value:et.value,value_type:et.valueType??null,schema_version:et.schemaVersion??null}))},Ie=new Blob([JSON.stringify(Se,null,2)],{type:"application/json"}),He=URL.createObjectURL(Ie),Ye=document.createElement("a");Ye.href=He,Ye.download=`reddb-config-${new Date().toISOString().slice(0,10)}.json`,Ye.click(),URL.revokeObjectURL(He)}function Je(Se){return Se.id==="secrets"?n(A).length:n(S).length}var tt=yC();Sr("keydown",jn,_e);var ct=c(tt),qe=c(ct),Ve=u(c(qe),2);Xe(Ve,21,()=>n(o),Se=>Se.id,(Se,Ie)=>{const He=y(()=>r[n(Ie).icon]??Xi);{const Ye=Ue=>{var wt=Re(),dt=fe(wt);Wr(dt,()=>n(He),(ht,Pt)=>{Pt(ht,{class:"size-3.5"})}),v(Ue,wt)},et=Ue=>{Pr(Ue,{children:(wt,dt)=>{Ce();var ht=_t();L(Pt=>k(ht,Pt),[()=>Je(n(Ie))]),v(wt,ht)},$$slots:{default:!0}})};let nt=y(()=>n(Ie).id===n(p).id);lg(Se,{get label(){return n(Ie).label},get active(){return n(nt)},onclick:()=>_(a,n(Ie).id,!0),icon:Ye,trailing:et,$$slots:{icon:!0,trailing:!0}})}}),l(Ve);var Be=u(Ve,2),ot=c(Be);{var re=Se=>{var Ie=_t("checking grants");v(Se,Ie)},rt=Se=>{var Ie=MS(),He=fe(Ie),Ye=c(He,!0);l(He),Ce(),L(()=>k(Ye,n(se))),v(Se,Ie)},Qe=Se=>{var Ie=_t("no readable panes");v(Se,Ie)};K(ot,Se=>{n(i)?Se(re):n(g)?Se(rt,1):Se(Qe,-1)})}l(Be),l(qe);var We=u(qe,2),ft=c(We),Nt=c(ft),At=c(Nt);Xn(At,{class:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-fg-3"});var Mt=u(At,2);nn(Mt),sr(Mt,Se=>_(h,Se),()=>n(h)),l(Nt),l(ft);var Et=u(ft,2),mt=c(Et);{var yt=Se=>{var Ie=zS();Xe(Ie,20,()=>Array(4),bn,(He,Ye)=>{var et=TS();v(He,et)}),l(Ie),v(Se,Ie)},kt=Se=>{{let Ie=y(()=>n(R)?"No readable settings panes":"No active connection"),He=y(()=>n(R)?"The current principal has no Settings read grant.":"Connect to a reddb instance to inspect its live configuration."),Ye=y(()=>n(d)??(n(R)?"auth.can denied settings reads":"red serve"));Fn(Se,{get icon(){return mi},get title(){return n(Ie)},get message(){return n(He)},get hint(){return n(Ye)}})}},It=Se=>{{let Ie=y(()=>n(R)?`${n(p).label} is unreachable`:"No active connection"),He=y(()=>n(R)?`red-ui could not read ${n(p).id==="secrets"?"SHOW SECRETS":"SHOW CONFIG"} from the active target.`:"Connect to a reddb instance to inspect its live configuration."),Ye=y(()=>n(R)?n(V)??n(H):"red serve");Fn(Se,{get icon(){return sl},get title(){return n(Ie)},get message(){return n(He)},get hint(){return n(Ye)}})}},Zt=Se=>{var Ie=PS();Xe(Ie,20,()=>Array(8),bn,(He,Ye)=>{var et=AS();v(He,et)}),l(Ie),v(Se,Ie)},hn=Se=>{{let Ie=y(()=>n(w)?`No ${n(p).label.toLowerCase()} match`:`No ${n(p).label.toLowerCase()} reported`),He=y(()=>n(w)?`Search checks the ${n(p).label.toLowerCase()} key and metadata.`:`${n(p).id==="secrets"?"SHOW SECRETS":"SHOW CONFIG"} returned no rows for this connection.`);Fn(Se,{get icon(){return Xn},get title(){return n(Ie)},get message(){return n(He)}})}},xn=Se=>{var Ie=IS();Xe(Ie,21,()=>n(ae),He=>He.key,(He,Ye)=>{const et=y(()=>ms(n(Ye)));var nt=LS(),Ue=c(nt),wt=c(Ue),dt=c(wt,!0);l(wt);var ht=u(wt,2),Pt=c(ht,!0);l(ht),l(Ue);var Ot=u(Ue,2),tn=c(Ot);Ma(tn,{class:"size-3"});var fn=u(tn);l(Ot),l(nt),L(Dt=>{var Rt;De(nt,1,Dt),Ae(Ue,"aria-current",((Rt=n(Y))==null?void 0:Rt.key)===n(Ye).key?"page":void 0),k(dt,n(et).label),k(Pt,n(Ye).key),k(fn,` ${n(Ye).value??""}`)},[()=>{var Dt;return je(["grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 rounded-md px-2.5 py-2 transition-colors",((Dt=n(Y))==null?void 0:Dt.key)===n(Ye).key?"bg-bg-3 text-fg-0":"text-fg-1 hover:bg-bg-2"].join(" "))}]),ke("click",Ue,()=>me(n(Ye).key)),v(He,nt)}),l(Ie),v(Se,Ie)},at=Se=>{var Ie=FS();Xe(Ie,21,()=>n(F),He=>He.key,(He,Ye)=>{const et=y(()=>xs(n(Ye)));var nt=HS(),Ue=c(nt),wt=c(Ue),dt=c(wt,!0);l(wt);var ht=u(wt,2),Pt=c(ht,!0);l(ht),l(Ue);var Ot=u(Ue,2);{var tn=Rt=>{var Ut=OS(),Bt=c(Ut);nn(Bt);var an=u(Bt);l(Ut),L(()=>{Aa(Bt,n(Ye).value===!0),k(an,` ${n(Ye).value?"true":"false"}`)}),v(Rt,Ut)},fn=Rt=>{var Ut=DS(),Bt=c(Ut);{var an=St=>{var Vt=RS(),Wt=c(Vt,!0);l(Vt);var dn={};L((Qt,Mn)=>{k(Wt,Qt),dn!==(dn=Mn)&&(Vt.value=(Vt.__value=Mn)??"")},[()=>ze(n(Ye)),()=>String(n(Ye).value)]),v(St,Vt)},vn=y(()=>{var St;return!((St=n(et).options)!=null&&St.includes(String(n(Ye).value)))});K(Bt,St=>{n(vn)&&St(an)})}var gn=u(Bt);Xe(gn,17,()=>n(et).options??[],bn,(St,Vt)=>{var Wt=$S(),dn=c(Wt,!0);l(Wt);var Qt={};L(()=>{k(dn,n(Vt)),Qt!==(Qt=n(Vt))&&(Wt.value=(Wt.__value=n(Vt))??"")}),v(St,Wt)}),l(Ut);var Gt;aa(Ut),L(St=>{Ae(Ut,"aria-label",n(et).label),Gt!==(Gt=St)&&(Ut.value=(Ut.__value=St)??"",oa(Ut,St))},[()=>String(n(Ye).value)]),v(Rt,Ut)},Dt=Rt=>{var Ut=VS();nn(Ut),L(Bt=>{Ae(Ut,"aria-label",n(et).label),Jn(Ut,Bt)},[()=>ze(n(Ye))]),v(Rt,Ut)};K(Ot,Rt=>{n(et).kind==="boolean"?Rt(tn):n(et).kind==="enum"?Rt(fn,1):Rt(Dt,-1)})}l(nt),L(Rt=>{var Ut;De(nt,1,Rt),Ae(Ue,"aria-current",((Ut=n(J))==null?void 0:Ut.key)===n(Ye).key?"page":void 0),k(dt,n(et).label),k(Pt,n(Ye).key)},[()=>{var Rt;return je(["grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 rounded-md px-2.5 py-2 transition-colors",((Rt=n(J))==null?void 0:Rt.key)===n(Ye).key?"bg-bg-3 text-fg-0":"text-fg-1 hover:bg-bg-2"].join(" "))}]),ke("click",Ue,()=>_(D,n(Ye).key,!0)),v(He,nt)}),l(Ie),v(Se,Ie)};K(mt,Se=>{n(i)?Se(yt):n(g)?n(j)?Se(It,2):n(C)&&n(be)===0?Se(Zt,3):n(be)===0?Se(hn,4):n(p).id==="secrets"?Se(xn,5):Se(at,-1):Se(kt,1)})}l(Et);var ut=u(Et,2),Lt=c(ut);{var jt=Se=>{var Ie=qS(),He=c(Ie);Jf(He,{class:"size-3.5"}),Ce(),l(Ie),L(()=>Ie.disabled=n(i)||!n(g)||n(C)||n(S).length===0),ke("click",Ie,$e),v(Se,Ie)};K(Lt,Se=>{n(p).id==="config"&&Se(jt)})}var on=u(Lt,2),sn=c(on);{var ln=Se=>{var Ie=KS(),He=u(fe(Ie)),Ye=c(He,!0);l(He),Ce(),L(()=>k(Ye,n(H))),v(Se,Ie)},Sn=Se=>{var Ie=_t("Requires a Settings read grant.");v(Se,Ie)};K(sn,Se=>{n(g)?Se(ln):Se(Sn,-1)})}l(on),l(ut),l(We);var cn=u(We,2),yn=c(cn),Nn=c(yn);{var An=Se=>{var Ie=jS(),He=fe(Ie);$a(He,{eyebrow:"Settings",title:"Settings",subtitle:"Checking Settings grants."});var Ye=u(He,2);Fn(Ye,{get icon(){return mi},title:"Checking settings grants",message:"red-ui is asking reddb which Settings panes this principal can read.",hint:"POST /auth/can"}),v(Se,Ie)},Cn=Se=>{var Ie=BS(),He=fe(Ie);$a(He,{eyebrow:"Settings",title:"Settings",subtitle:"No readable governance surface."});var Ye=u(He,2);{let et=y(()=>n(R)?"No readable settings panes":"No active connection"),nt=y(()=>n(R)?"Missing Settings read grant for this principal.":"Start or select a reddb target, then return here to inspect live config."),Ue=y(()=>n(d)??(n(R)?"missing Settings read grant":"docker compose -f docker/compose.yml up -d"));Fn(Ye,{get icon(){return mi},get title(){return n(et)},get message(){return n(nt)},get hint(){return n(Ue)}})}v(Se,Ie)},Pn=Se=>{var Ie=_C(),He=fe(Ie);$a(He,{eyebrow:"Settings",get title(){return n(p).label},get subtitle(){return n(p).blurb},actions:ht=>{var Pt=WS(),Ot=c(Pt);{let tn=y(()=>n(C)?"size-3.5 animate-spin":"size-3.5");Es(Ot,{get class(){return n(tn)}})}Ce(),l(Pt),L(()=>Pt.disabled=n(C)||!n(R)),ke("click",Pt,ue),v(ht,Pt)}});var Ye=u(He,2);{var et=dt=>{{let ht=y(()=>n(R)?`Unable to read ${n(p).label.toLowerCase()}`:"No active connection"),Pt=y(()=>n(R)?`The ${n(p).label} pane is intentionally empty because ${n(p).id==="secrets"?"SHOW SECRETS":"SHOW CONFIG"} did not complete.`:"Start or select a reddb target, then return here to inspect live config."),Ot=y(()=>n(R)?n(V)??n(H):"docker compose -f docker/compose.yml up -d");Fn(dt,{get icon(){return sl},get title(){return n(ht)},get message(){return n(Pt)},get hint(){return n(Ot)}})}},nt=dt=>{var ht=rC(),Pt=c(ht);{var Ot=Bt=>{Fn(Bt,{get icon(){return Ma},title:"No secret selected",message:"Select a live SHOW SECRETS row to inspect its masked metadata."})},tn=Bt=>{var an=JS(),vn=c(an);go(vn,{get title(){return n(T).label},class:"mb-2",icon:xt=>{Ma(xt,{class:"size-3.5"})},meta:xt=>{Pr(xt,{children:(un,Tn)=>{Ce();var In=_t("masked");v(un,In)},$$slots:{default:!0}})},$$slots:{icon:!0,meta:!0}});var gn=u(vn,2),Gt=c(gn);hr(Gt,{get title(){return n(T).label},description:"Vault metadata row; plaintext is masked unless break-glass reveal is granted.",get hint(){return n(Y).key},wide:!0,action:bt=>{var xt=US();nn(xt),L(()=>{Jn(xt,n(U)??n(Y).value),Ae(xt,"aria-label",n(T).label)}),v(bt,xt)},$$slots:{action:!0}});var St=u(Gt,2);hr(St,{title:"Key",get hint(){return n(Y).key},action:bt=>{var xt=GS(),un=c(xt,!0);l(xt),L(()=>k(un,n(Y).key)),v(bt,xt)},$$slots:{action:!0}});var Vt=u(St,2);hr(Vt,{title:"Metadata",action:bt=>{var xt=YS(),un=c(xt);Pr(un,{children:(In,$n)=>{Ce();var Jt=_t();L(()=>k(Jt,n(Y).status??"status unknown")),v(In,Jt)},$$slots:{default:!0}});var Tn=u(un,2);Pr(Tn,{children:(In,$n)=>{Ce();var Jt=_t();L(()=>k(Jt,`version ${(n(Y).version===void 0?"unknown":n(Y).version)??""}`)),v(In,Jt)},$$slots:{default:!0}}),l(xt),v(bt,xt)},$$slots:{action:!0}});var Wt=u(Vt,2);{var dn=$t=>{hr($t,{title:"Break-glass reveal",description:"Calls reddb's audited UNSEAL VAULT path and clears plaintext after 30 seconds.",action:xt=>{var un=Re(),Tn=fe(un);{var In=Jt=>{var mn=XS(),On=c(mn);zc(On,{class:"size-3.5"}),Ce(),l(mn),ke("click",mn,xe),v(Jt,mn)},$n=Jt=>{var mn=ZS(),On=c(mn);{let Qn=y(()=>n(N)?"size-3.5 animate-pulse":"size-3.5");Ac(On,{get class(){return n(Qn)}})}Ce(),l(mn),L(()=>mn.disabled=n(N)),ke("click",mn,Ee),v(Jt,mn)};K(Tn,Jt=>{n(U)!==null?Jt(In):Jt($n,-1)})}v(xt,un)},$$slots:{action:!0}})};K(Wt,$t=>{n(z)&&$t(dn)})}var Qt=u(Wt,2);{var Mn=$t=>{hr($t,{title:"Authoring",description:"Delete the selected vault secret through DELETE SECRET.",action:xt=>{var un=QS(),Tn=c(un);qa(Tn,{class:"size-3.5"}),Ce(),l(un),L(()=>un.disabled=n(I)),ke("click",un,Le),v(xt,un)},$$slots:{action:!0}})};K(Qt,$t=>{n(O)&&$t(Mn)})}l(gn),l(an),v(Bt,an)};K(Pt,Bt=>{!n(Y)||!n(T)?Bt(Ot):Bt(tn,-1)})}var fn=u(Pt,2);{var Dt=Bt=>{var an=eC(),vn=c(an);ia(vn,{class:"size-3 shrink-0"});var gn=u(vn,2),Gt=c(gn,!0);l(gn),l(an),L(St=>{De(an,1,St),k(Gt,n(P).message)},[()=>je(["inline-flex max-w-full items-center gap-1.5 rounded-md border px-2.5 py-1.5 font-mono text-[11px]",n(P).tone==="ok"?"border-ok/30 bg-ok/5 text-ok":"border-danger/30 bg-danger/5 text-danger"].join(" "))]),v(Bt,an)};K(fn,Bt=>{var an;n(P)&&n(P).key===((an=n(Y))==null?void 0:an.key)&&Bt(Dt)})}var Rt=u(fn,2);{var Ut=Bt=>{var an=nC(),vn=fe(an);{var gn=bt=>{var xt=tC(),un=c(xt);ia(un,{class:"size-3 shrink-0"});var Tn=u(un,2),In=c(Tn,!0);l(Tn),l(xt),L($n=>{De(xt,1,$n),k(In,n(te).message)},[()=>je(["inline-flex max-w-full items-center gap-1.5 rounded-md border px-2.5 py-1.5 font-mono text-[11px]",n(te).tone==="ok"?"border-ok/30 bg-ok/5 text-ok":"border-danger/30 bg-danger/5 text-danger"].join(" "))]),v(bt,xt)};K(vn,bt=>{var xt;((xt=n(te))==null?void 0:xt.paneId)==="secrets"&&bt(gn)})}var Gt=u(vn,2),St=c(Gt);go(St,{title:"Set secret",class:"mb-2",icon:xt=>{La(xt,{class:"size-3.5"})},$$slots:{icon:!0}});var Vt=u(St,2),Wt=c(Vt);nn(Wt);var dn=u(Wt,2);nn(dn);var Qt=u(dn,2),Mn=c(Qt),$t=c(Mn);ol($t,{class:"size-3.5"}),Ce(),l(Mn),l(Qt),l(Vt),l(Gt),L(bt=>{Jn(Wt,n(M)),Wt.disabled=n(I),Jn(dn,n(m)),dn.disabled=n(I),Mn.disabled=bt},[()=>n(I)||!n(M).trim()||!n(m)]),ke("input",Wt,bt=>_(M,bt.currentTarget.value,!0)),ke("input",dn,bt=>_(m,bt.currentTarget.value,!0)),ke("click",Mn,Pe),v(Bt,an)};K(Rt,Bt=>{n(O)&&Bt(Ut)})}l(ht),v(dt,ht)},Ue=dt=>{Fn(dt,{get icon(){return bf},title:"No config entry selected",message:"Select a live SHOW CONFIG row to inspect its read-only control."})},wt=dt=>{var ht=mC(),Pt=c(ht);go(Pt,{get title(){return n(Z).label},class:"mb-2",icon:Gt=>{var St=Re(),Vt=fe(St);{var Wt=Qt=>{xf(Qt,{class:"size-3.5"})},dn=Qt=>{xv(Qt,{class:"size-3.5"})};K(Vt,Qt=>{n(Z).kind==="secret-reference"?Qt(Wt):Qt(dn,-1)})}v(Gt,St)},meta:Gt=>{Pr(Gt,{children:(St,Vt)=>{Ce();var Wt=_t();L(()=>k(Wt,n(Z).kind)),v(St,Wt)},$$slots:{default:!0}})},$$slots:{icon:!0,meta:!0}});var Ot=u(Pt,2),tn=c(Ot);hr(tn,{get title(){return n(Z).label},get description(){return n(Z).description},get hint(){return n(J).key},wide:!0,action:gn=>{var Gt=Re(),St=fe(Gt);{var Vt=$t=>{var bt=aC(),xt=c(bt);nn(xt);var un=u(xt);l(bt),L(()=>{Aa(xt,n(q)?n(oe)==="true":n(J).value===!0),xt.disabled=!n(q)||n(I),k(un,` ${(n(q)?n(oe):n(J).value?"true":"false")??""}`)}),ke("change",xt,Tn=>_(oe,Tn.currentTarget.checked?"true":"false",!0)),v($t,bt)},Wt=$t=>{var bt=sC(),xt=c(bt);{var un=Jt=>{var mn=oC(),On=c(mn,!0);l(mn);var Qn={};L((nr,Ht)=>{k(On,nr),Qn!==(Qn=Ht)&&(mn.value=(mn.__value=Ht)??"")},[()=>ze(n(J)),()=>String(n(J).value)]),v(Jt,mn)},Tn=y(()=>{var Jt;return!((Jt=n(Z).options)!=null&&Jt.includes(String(n(J).value)))});K(xt,Jt=>{n(Tn)&&Jt(un)})}var In=u(xt);Xe(In,17,()=>n(Z).options??[],bn,(Jt,mn)=>{var On=iC(),Qn=c(On,!0);l(On);var nr={};L(()=>{k(Qn,n(mn)),nr!==(nr=n(mn))&&(On.value=(On.__value=n(mn))??"")}),v(Jt,On)}),l(bt);var $n;aa(bt),L(Jt=>{bt.disabled=!n(q)||n(I),$n!==($n=Jt)&&(bt.value=(bt.__value=Jt)??"",oa(bt,Jt))},[()=>n(q)?n(oe):String(n(J).value)]),ke("change",bt,Jt=>_(oe,Jt.currentTarget.value,!0)),v($t,bt)},dn=$t=>{var bt=lC();Ha(bt),L(xt=>{bt.readOnly=!n(q),bt.disabled=n(I),Jn(bt,xt)},[()=>n(q)?n(oe):Ze(n(J).value)]),ke("input",bt,xt=>_(oe,xt.currentTarget.value,!0)),v($t,bt)},Qt=$t=>{var bt=cC();nn(bt),L(xt=>Jn(bt,xt),[()=>ze(n(J))]),v($t,bt)},Mn=$t=>{var bt=dC();nn(bt),L(xt=>{bt.readOnly=!n(q),bt.disabled=n(I),Ae(bt,"type",(n(Z).kind==="number","text")),Jn(bt,xt)},[()=>n(q)?n(oe):ze(n(J))]),ke("input",bt,xt=>_(oe,xt.currentTarget.value,!0)),v($t,bt)};K(St,$t=>{n(Z).kind==="boolean"?$t(Vt):n(Z).kind==="enum"?$t(Wt,1):n(Z).kind==="list"?$t(dn,2):n(Z).kind==="secret-reference"?$t(Qt,3):$t(Mn,-1)})}v(gn,Gt)},$$slots:{action:!0}});var fn=u(tn,2);hr(fn,{title:"Key",get hint(){return n(J).key},action:gn=>{var Gt=uC(),St=c(Gt,!0);l(Gt),L(()=>k(St,n(J).key)),v(gn,Gt)},$$slots:{action:!0}});var Dt=u(fn,2);hr(Dt,{title:"Schema",action:gn=>{var Gt=fC(),St=c(Gt);Pr(St,{children:(Wt,dn)=>{Ce();var Qt=_t();L(()=>k(Qt,n(Z).valueType??"runtime type")),v(Wt,Qt)},$$slots:{default:!0}});var Vt=u(St,2);Pr(Vt,{children:(Wt,dn)=>{Ce();var Qt=_t();L(()=>k(Qt,`schema ${(n(Z).schemaVersion===void 0?"unknown":n(Z).schemaVersion)??""}`)),v(Wt,Qt)},$$slots:{default:!0}}),l(Gt),v(gn,Gt)},$$slots:{action:!0}});var Rt=u(Dt,2);{var Ut=vn=>{hr(vn,{title:"Authoring",description:"Submit changes through SET CONFIG or unset through DELETE CONFIG.",action:Gt=>{var St=vC(),Vt=c(St),Wt=c(Vt);ol(Wt,{class:"size-3.5"}),Ce(),l(Vt);var dn=u(Vt,2),Qt=c(dn);qa(Qt,{class:"size-3.5"}),Ce(),l(dn),l(St),L(()=>{Vt.disabled=n(I)||n(Z).kind==="secret-reference",Ae(Vt,"title",n(Z).kind==="secret-reference"?"Secret references can be unset, but not edited as plaintext config.":"Save config value"),dn.disabled=n(I)}),ke("click",Vt,ie),ke("click",dn,de),v(Gt,St)},$$slots:{action:!0}})};K(Rt,vn=>{n(q)&&vn(Ut)})}l(Ot);var Bt=u(Ot,2);{var an=vn=>{var gn=xC(),Gt=fe(gn);{var St=Tt=>{var Yt=gC(),wn=c(Yt);ia(wn,{class:"size-3 shrink-0"});var rr=u(wn,2),Ar=c(rr,!0);l(rr),l(Yt),L(wa=>{De(Yt,1,wa),k(Ar,n(te).message)},[()=>je(["mt-3 inline-flex max-w-full items-center gap-1.5 rounded-md border px-2.5 py-1.5 font-mono text-[11px]",n(te).tone==="ok"?"border-ok/30 bg-ok/5 text-ok":"border-danger/30 bg-danger/5 text-danger"].join(" "))]),v(Tt,Yt)};K(Gt,Tt=>{var Yt;((Yt=n(te))==null?void 0:Yt.paneId)==="config"&&Tt(St)})}var Vt=u(Gt,2),Wt=c(Vt);go(Wt,{title:"Set config key",class:"mb-2",icon:Yt=>{La(Yt,{class:"size-3.5"})},$$slots:{icon:!0}});var dn=u(Wt,2),Qt=c(dn),Mn=c(Qt);nn(Mn);var $t=u(Mn,2),bt=c($t);bt.value=bt.__value="text";var xt=u(bt);xt.value=xt.__value="number";var un=u(xt);un.value=un.__value="boolean";var Tn=u(un);Tn.value=Tn.__value="list",l($t);var In;aa($t),l(Qt);var $n=u(Qt,2);{var Jt=Tt=>{var Yt=pC(),wn=c(Yt);nn(wn);var rr=u(wn);l(Yt),L(()=>{Aa(wn,n(Q)==="true"),wn.disabled=n(I),k(rr,` ${n(Q)==="true"?"true":"false"}`)}),ke("change",wn,Ar=>_(Q,Ar.currentTarget.checked?"true":"false",!0)),v(Tt,Yt)},mn=Tt=>{var Yt=hC();Ha(Yt),L(()=>{Jn(Yt,n(Q)),Yt.disabled=n(I)}),ke("input",Yt,wn=>_(Q,wn.currentTarget.value,!0)),v(Tt,Yt)},On=Tt=>{var Yt=bC();nn(Yt),L(()=>{Jn(Yt,n(Q)),Ae(Yt,"placeholder",n(ve)==="number"?"1000":"value"),Yt.disabled=n(I)}),ke("input",Yt,wn=>_(Q,wn.currentTarget.value,!0)),v(Tt,Yt)};K($n,Tt=>{n(ve)==="boolean"?Tt(Jt):n(ve)==="list"?Tt(mn,1):Tt(On,-1)})}var Qn=u($n,2),nr=c(Qn),Ht=c(nr);La(Ht,{class:"size-3.5"}),Ce(),l(nr),l(Qn),l(dn),l(Vt),L(Tt=>{Jn(Mn,n(ee)),Mn.disabled=n(I),$t.disabled=n(I),In!==(In=n(ve))&&($t.value=($t.__value=n(ve))??"",oa($t,n(ve))),nr.disabled=Tt},[()=>n(I)||!n(ee).trim()]),ke("input",Mn,Tt=>_(ee,Tt.currentTarget.value,!0)),ke("change",$t,Tt=>_(ve,Tt.currentTarget.value,!0)),ke("click",nr,ye),v(vn,gn)};K(Bt,vn=>{n(q)&&vn(an)})}l(ht),v(dt,ht)};K(Ye,dt=>{n(j)?dt(et):n(p).id==="secrets"?dt(nt,1):!n(J)||!n(Z)?dt(Ue,2):dt(wt,-1)})}v(Se,Ie)};K(Nn,Se=>{n(i)?Se(An):n(g)?Se(Pn,-1):Se(Cn,1)})}l(yn),l(cn),l(ct),l(tt),L(Se=>{Ae(We,"aria-label",`${n(p).label} entries`),Ae(Mt,"placeholder",Se),Jn(Mt,n(w)),Mt.disabled=n(i)||!n(g)||n(j)},[()=>`Search ${n(p).label.toLowerCase()} ⌘K`]),ke("input",Mt,Se=>ne(Se.currentTarget.value)),ke("keydown",Mt,Se=>{Se.key==="Escape"&&(ne(""),Se.currentTarget.blur())}),v(t,tt),st()}en(["input","keydown","click","change"]);const hc="'Inter Variable', 'Inter', system-ui, -apple-system, sans-serif",bc="'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, 'SF Mono', 'Menlo', monospace",Bs=[{name:"reddb",label:"Reddb",description:"The signature near-black with a surgical rose accent.",colors:{bg:"#050607",accent:"#ff2056",fg:"#f7f8fa"},typography:{sans:hc,mono:bc}},{name:"nocturne",label:"Nocturne",description:"Indigo-tinted midnight with a violet accent.",colors:{bg:"#0a0b14",accent:"#7c5cff",fg:"#f5f6fb"},typography:{sans:hc,mono:bc}}],xu=Bs[0],mu="red-ui-skin";function xc(t){return Bs.find(e=>e.name===t)??xu}function mr(t,e,r){return`color-mix(in srgb, ${t} ${e}%, ${r})`}function Vi(t,e){return`color-mix(in srgb, ${t} ${e}%, transparent)`}const Hi=[0,4,9,15],Fi=[6,13,22],qi=[100,78,58,45];function _u(t){const{bg:e,accent:r,fg:a}=t.colors,o="#ffffff";return{"--color-bg-0":e,"--color-bg-1":mr(o,Hi[1],e),"--color-bg-2":mr(o,Hi[2],e),"--color-bg-3":mr(o,Hi[3],e),"--color-fg-0":a,"--color-fg-1":mr(a,qi[1],e),"--color-fg-2":mr(a,qi[2],e),"--color-fg-3":mr(a,qi[3],e),"--color-line-1":mr(o,Fi[0],e),"--color-line-2":mr(o,Fi[1],e),"--color-line-3":mr(o,Fi[2],e),"--color-accent":r,"--color-accent-soft":Vi(r,12),"--color-accent-glow":Vi(r,45),"--color-ambient-glow":Vi(r,6),"--color-role-primary":r,"--color-role-replica":"#60a5fa","--color-role-embedded":"#4ade80","--color-ok":"#4ade80","--color-warn":"#fbbf24","--color-danger":"#ff5470","--color-info":"#60a5fa","--font-sans":t.typography.sans,"--font-mono":t.typography.mono}}function mc(t,e){const r=_u(t);for(const[a,o]of Object.entries(r))e.style.setProperty(a,o);e.dataset.theme="dark"}function kC(){return typeof localStorage>"u"?null:localStorage.getItem(mu)}function SC(t){typeof localStorage>"u"||localStorage.setItem(mu,t)}function _c(t){return t??(typeof document<"u"?document.documentElement:null)}var io;class CC{constructor(){Fe(this,io,we(Kt(xu)));Ft(this,"target",null)}get current(){return n(ge(this,io))}set current(e){_(ge(this,io),e,!0)}init(e){this.target=_c(e);const r=kC();r&&(this.current=xc(r),this.target&&mc(this.current,this.target))}select(e){const r=xc(e);this.current=r;const a=_c(this.target);a&&(this.target=a,mc(r,a)),SC(r.name)}}io=new WeakMap;const _s=new CC;var EC=x('<span class="inline-flex items-center gap-1 rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-accent"><!> Active</span>'),NC=x('<button type="button"><div class="rounded-md overflow-hidden border border-line-1"><div class="bg-bg-0 p-3"><div class="flex items-center gap-1.5 mb-2.5"><span class="size-2 rounded-full" style="background: var(--color-accent)"></span> <span class="h-1.5 w-12 rounded-full bg-bg-3"></span> <span class="ml-auto h-1.5 w-6 rounded-full bg-bg-2"></span></div> <div class="rounded-md bg-bg-1 border border-line-2 p-2.5"><div class="h-1.5 w-2/3 rounded-full bg-fg-2 mb-2"></div> <div class="h-1.5 w-full rounded-full bg-bg-3 mb-1.5"></div> <div class="h-1.5 w-4/5 rounded-full bg-bg-3 mb-2.5"></div> <div class="flex items-center gap-1.5"><span class="h-4 w-12 rounded" style="background: var(--color-accent)"></span> <span class="h-4 w-8 rounded bg-bg-2 border border-line-2"></span></div></div></div> <div class="flex h-2.5"><span class="flex-1 bg-bg-0"></span> <span class="flex-1 bg-bg-1"></span> <span class="flex-1 bg-bg-2"></span> <span class="flex-1 bg-bg-3"></span></div></div> <div class="flex items-center gap-2 mt-3"><span class="type-h2 text-fg-0"> </span> <!></div> <p class="type-caption m-0 mt-1"> </p></button>'),MC=x('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <div class="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4 max-w-4xl"></div></div>');function TC(t,e){it(e,!0);function r(d){return Object.entries(_u(d)).map(([f,g])=>`${f}: ${g}`).join("; ")}const a=y(()=>_s.current.name);var o=MC(),s=c(o);$a(s,{eyebrow:"Settings",title:"Appearance",subtitle:"Pick a skin. Surfaces are derived from a single seed; the accent stays surgical. Dark only."});var i=u(s,2);Xe(i,21,()=>Bs,d=>d.name,(d,f)=>{const g=y(()=>n(f).name===n(a));var p=NC(),b=c(p),h=u(b,2),w=c(h),S=c(w,!0);l(w);var A=u(w,2);{var D=G=>{var X=EC(),I=c(X);Tc(I,{class:"size-3"}),Ce(),l(X),v(G,X)};K(A,G=>{n(g)&&G(D)})}l(h);var W=u(h,2),C=c(W,!0);l(W),l(p),L(G=>{Ae(p,"aria-pressed",n(g)),De(p,1,`group text-left rounded-lg border bg-bg-1 p-3 transition-colors ${n(g)?"border-accent":"border-line-2 hover:border-line-3"}`),kn(b,G),k(S,n(f).label),k(C,n(f).description)},[()=>r(n(f))]),ke("click",p,()=>_s.select(n(f).name)),v(d,p)}),l(i),l(o),v(t,o),st()}en(["click"]);const yc="red-ui-workspace-session";class zC{constructor(e=1e3,r=null){Ft(this,"_timer",null);Ft(this,"debounceMs");Ft(this,"_storage");this.debounceMs=e,this._storage=r}_store(){return this._storage?this._storage:typeof localStorage<"u"?localStorage:null}_write(e){var r;try{(r=this._store())==null||r.setItem(yc,JSON.stringify(e))}catch{}}schedule(e){this._timer!==null&&clearTimeout(this._timer),this._timer=setTimeout(()=>{this._timer=null,this._write(e)},this.debounceMs)}flush(e){this._timer!==null&&(clearTimeout(this._timer),this._timer=null),this._write(e)}restore(){var e;try{const r=(e=this._store())==null?void 0:e.getItem(yc);if(!r)return null;const a=JSON.parse(r);return typeof a.view!="string"?null:a}catch{return null}}}const Co=new zC;var AC=x('<div class="flex h-full items-center justify-center font-mono text-[12px] text-fg-3">loading analytics…</div>'),PC=x('<div class="app relative grid grid-rows-[44px_32px_1fr] h-screen"><!> <!> <!> <main class="relative overflow-hidden z-[1]"><!></main> <!> <!> <!> <!></div>'),LC=x("<!> <!> <!>",1);function jC(t,e){it(e,!0);let r=Ge(e,"showConnect",3,!0),a=Ge(e,"persistTheme",3,!0);const o=Ig(e.router??Fc());e.connectionProvider&&mf(e.connectionProvider);function s(I){const te=I;if(te==="query"||te==="collections"||te==="cluster"||te==="security"||te==="settings"||te==="appearance"){o.go({view:te},void 0,!0);return}const le=Lg(I.startsWith("/")?I:`/${I}`);le.collection?o.go({view:"collection",collection:le.collection,subpage:le.subpage??"table"},void 0,!0):o.go({view:le.view},void 0,!0)}function i(){return{view:o.view,collection:o.collection,subpage:o.subpage,tabs:qt.tabs,activeTabId:qt.activeId}}function d(I){I.tabs.length>0&&qt.hydrate(I.tabs,I.activeTabId),o.go(I.collection?{view:"collection",collection:I.collection,subpage:I.subpage??"table"}:{view:I.view},void 0,!0)}fr(()=>{e.connectionProvider?Ke.adoptInjected().then(()=>{e.initialRoute&&s(e.initialRoute)}):Ke.bootstrap().then(I=>{if(I)s(I);else{const te=Co.restore();te&&d(te)}})});let f=we(!1),g=we(!1);fr(()=>{const I=()=>_(g,!0);return window.addEventListener("red:open-pending-changes",I),()=>window.removeEventListener("red:open-pending-changes",I)}),fr(()=>{if(typeof window>"u"||!("__TAURI_INTERNALS__"in window||"__TAURI__"in window))return;let I;return Na(async()=>{const{listen:te}=await import("./CHvQYbpl.js");return{listen:te}},__vite__mapDeps([0,1]),import.meta.url).then(({listen:te})=>te("deep-link",async le=>{var Q;const oe=(Q=le.payload)==null?void 0:Q[0];if(!oe)return;let ee=oe,ve=null;try{const E=oe.replace(/^reds?(\+[a-z]+)?:\/\//,"http://");ve=new URL(E).searchParams.get("to"),ve&&(ee=oe.split("?")[0])}catch{}await Ke.tryConnect(Sc(ee)),ve&&s(ve)})).then(te=>{I=te}),()=>{I==null||I()}}),Xt(()=>{const I=Ke.client;if(!I){Rn.setExecutor(null),Gn.setExecutor(null);return}Gn.setExecutor((te,le)=>_f(I,te,le)),Rn.setExecutor(async te=>Promise.all(te.map(async le=>{try{const oe=await I.query(Ms(le));return oe.ok?{id:le.id,ok:!0}:{id:le.id,ok:!1,error:oe.error??"query failed"}}catch(oe){return{id:le.id,ok:!1,error:oe.message}}})))});const p=5e3;Dr.init({target:e.themeTarget??null,persist:a(),initial:e.initialTheme}),_s.init(e.themeTarget??null),Xt(()=>{if(_n.locked||!Ke.targetResolved)return;Ke.refresh();const I=setInterval(()=>Ke.refresh(),p);return()=>clearInterval(I)}),Xt(()=>{_n.store&&Ke.hydrateUrls()}),Xt(()=>{if(!n(f))return;const I=i();Co.schedule(I)}),fr(()=>{const I=()=>{n(f)&&Co.flush(i())};return document.addEventListener("visibilitychange",I),window.addEventListener("blur",I),()=>{document.removeEventListener("visibilitychange",I),window.removeEventListener("blur",I)}}),fr(()=>{if(typeof window>"u"||!("__TAURI_INTERNALS__"in window||"__TAURI__"in window))return;let I;return Na(async()=>{const{listen:te}=await import("./CHvQYbpl.js");return{listen:te}},__vite__mapDeps([0,1]),import.meta.url).then(({listen:te})=>te("close-request",async()=>{Co.flush(i());const{getCurrentWindow:le}=await Na(async()=>{const{getCurrentWindow:oe}=await import("./D02PB2u7.js");return{getCurrentWindow:oe}},__vite__mapDeps([2,1,0]),import.meta.url);await le().destroy()})).then(te=>{I=te}),()=>{I==null||I()}});function b(){const I=Gn.nextLabel(),te=qt.open({kind:"query",label:I,key:I},!0);Gn.ensure(te.id)}async function h(I,te){const le=qt.tabs.find(ee=>ee.kind==="collection"&&ee.key===I);le?qt.open({kind:"collection",label:I,key:I,capability:le.capability,overrideCapability:le.overrideCapability,showSystemColumns:le.showSystemColumns,subpage:te??le.subpage}):qt.open({kind:"collection",label:I,key:I,capability:"table",subpage:te??void 0});const oe=Ke.client;if(!oe){te||o.go({view:"collection",collection:I,subpage:"table"},void 0,!0);return}try{const ee=await Bc(oe,I),ve=qt.tabs.find(E=>E.kind==="collection"&&E.key===I),Q=te??Pa(ee);ve&&(qt.tabs=qt.tabs.map(E=>E===ve?{...E,capability:ee,subpage:Q}:E)),te||o.go({view:"collection",collection:I,subpage:Q},void 0,!0)}catch{te||o.go({view:"collection",collection:I,subpage:"table"},void 0,!0)}}let w=null,S=null;Xt(()=>{const I=o.view,te=o.collection,le=o.subpage;if(I==="collections"&&te){const oe=`${te}::${le??""}`;oe!==S&&(S=oe,_r(()=>void h(te,le)))}else S=null;I==="query"&&w!=="query"&&_r(()=>b()),w=I});var A=LC(),D=fe(A);{var W=I=>{Nf(I,{onDone:()=>_(f,!0)})},C=I=>{var te=PC(),le=c(te);Pv(le,{});var oe=u(le,2);Dg(oe,{get showConnect(){return r()}});var ee=u(oe,2);Qg(ee,{});var ve=u(ee,2),Q=c(ve);{var E=F=>{x4(F,{})},M=F=>{G5(F,{})},m=F=>{aS(F,{})},N=F=>{var ae=Re(),be=fe(ae);kf(be,()=>Na(()=>import("./Bgb6fHGb.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url),se=>{var J=AC();v(se,J)},(se,J)=>{var Y=y(()=>{var{default:O}=n(J);return{AnalyticsView:O}}),Z=y(()=>n(Y).AnalyticsView),T=Re(),q=fe(T);Wr(q,()=>n(Z),(O,z)=>{z(O,{})}),v(se,T)}),v(F,ae)},P=F=>{wC(F,{})},B=F=>{TC(F,{})},$=F=>{R_(F)};K(Q,F=>{o.view==="ask"?F(E):o.view==="cluster"?F(M,1):o.view==="security"?F(m,2):o.view==="analytics"?F(N,3):o.view==="settings"?F(P,4):o.view==="appearance"?F(B,5):F($,-1)})}l(ve);var R=u(ve,2);ap(R,{});var H=u(R,2);dp(H,{});var V=u(H,2);bp(V,{});var j=u(V,2);Cp(j,{get open(){return n(g)},onClose:()=>_(g,!1)}),l(te),v(I,te)};K(D,I=>{n(f)?I(C,-1):I(W)})}var G=u(D,2);Pf(G,{});var X=u(G,2);zv(X,{}),v(t,A),st()}export{Wn as B,Mc as C,Gr as L,$a as P,Es as R,jC as W,ur as a,rl as b,Oa as i,Lg as p,ss as r,fl as t};
|