@theobourgeois/ytdb 0.2.15 → 0.2.16
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +3 -3
- package/.next/build-manifest.json +2 -2
- package/.next/server/app/[connectionId]/[schema]/[table]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[connectionId]/diff/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[connectionId]/migrations/[setId]/page.js +1 -1
- package/.next/server/app/[connectionId]/migrations/[setId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[connectionId]/migrations/page.js +1 -1
- package/.next/server/app/[connectionId]/migrations/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[connectionId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[connectionId]/query/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/activity/route.js +1 -1
- package/.next/server/app/api/repo/route.js +1 -1
- package/.next/server/app/api/schema/route.js +1 -1
- package/.next/server/app/api/tables/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +3 -3
- package/.next/server/chunks/161.js +1 -1
- package/.next/server/chunks/172.js +1 -1
- package/.next/server/chunks/605.js +1 -1
- package/.next/server/chunks/729.js +1 -1
- package/.next/server/chunks/814.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/{3732-422f344679f5d126.js → 3732-535d9f485cf90098.js} +1 -1
- package/.next/static/chunks/6090-3a613287bf7c9e90.js +1 -0
- package/.next/static/chunks/app/[connectionId]/migrations/[setId]/page-18158f23ccdab4cf.js +1 -0
- package/.next/static/chunks/app/[connectionId]/migrations/page-2ed07ba3810d1ee6.js +1 -0
- package/.next/static/chunks/app/[connectionId]/page-22bcfd48d84d7598.js +1 -0
- package/package.json +1 -1
- package/.next/static/chunks/6090-2831a02797d69073.js +0 -1
- package/.next/static/chunks/app/[connectionId]/migrations/[setId]/page-1886726af1052176.js +0 -1
- package/.next/static/chunks/app/[connectionId]/migrations/page-33e44680d62cbc05.js +0 -1
- package/.next/static/chunks/app/[connectionId]/page-df1d6620d85e3e15.js +0 -1
- /package/.next/static/{7RCujTjKg604vUCcqYNh6 → OyIGZSorg5OrE1_BWj2Lr}/_buildManifest.js +0 -0
- /package/.next/static/{7RCujTjKg604vUCcqYNh6 → OyIGZSorg5OrE1_BWj2Lr}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=729,exports.ids=[729],exports.modules={1777:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(34766);async function f({children:a,params:b}){let{connectionId:c}=await b;return(0,d.jsx)(e.ExplorerShell,{connectionId:c,children:a})}},1814:(a,b,c)=>{"use strict";c.d(b,{L:()=>g});var d=c(48249),e=c(23171),f=c(14490);function g({trailing:a,className:b,...c}){return(0,d.jsxs)("div",{className:(0,f.cn)("flex h-8 items-center gap-1.5 rounded-lg px-2 text-muted-foreground transition-colors focus-within:bg-muted/60 hover:bg-muted/60",b),children:[(0,d.jsx)(e.TfF,{className:"size-3.5 shrink-0"}),(0,d.jsx)("input",{type:"text",spellCheck:!1,autoComplete:"off",...c,className:"h-full min-w-0 flex-1 bg-transparent text-[0.8rem] text-foreground outline-none placeholder:text-muted-foreground"}),a]})}},8508:(a,b,c)=>{"use strict";c.d(b,{Ar:()=>d,US:()=>h,s5:()=>j,tT:()=>k,vI:()=>i});let d={commandPalette:"⌘⇧P",tableSearch:"⌘P",columnSearch:"⌘/",sqlEditor:"⌘E",switchConnection:"⌘⇧E",compareSchema:"⌘⇧D",migrations:"⌘⇧M",back:"⌘[",forward:"⌘]"};function e(){let a=new Set;return{register:b=>(a.add(b),()=>{a.delete(b)}),open(){for(let b of a)b()}}}let f=e(),g=e(),h=f.register,i=f.open,j=g.register,k=g.open},13449:(a,b,c)=>{"use strict";function d(a){let b=a.split("/").filter(Boolean).map(decodeURIComponent);if(0===b.length)return{kind:"home"};let[c,d,e]=b;if(1===b.length)return{kind:"connection",connectionId:c};if(2===b.length){if("query"===d)return{kind:"query",connectionId:c};if("diff"===d)return{kind:"diff",connectionId:c};if("migrations"===d)return{kind:"migrations",connectionId:c}}return 3===b.length?"migrations"===d?{kind:"migration",connectionId:c,setId:e}:{kind:"table",connectionId:c,table:{schema:d,name:e}}:{kind:"connection",connectionId:c}}function e(a){let b=encodeURIComponent;switch(a.kind){case"home":return"/";case"connection":return`/${b(a.connectionId)}`;case"query":case"diff":case"migrations":return`/${b(a.connectionId)}/${a.kind}`;case"migration":return`/${b(a.connectionId)}/migrations/${b(a.setId)}`;case"table":return`/${b(a.connectionId)}/${b(a.table.schema)}/${b(a.table.name)}`}}function f(a,b,{tableExists:c=!0}={}){let g=d(a);return"home"!==g.kind&&("table"!==g.kind||c)?e({...g,connectionId:b}):e({kind:"connection",connectionId:b})}c.d(b,{Jn:()=>e,ZG:()=>d,gZ:()=>f})},13656:(a,b,c)=>{"use strict";c.d(b,{E:()=>f});var d=c(48249),e=c(14490);function f({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"skeleton",className:(0,e.cn)("animate-pulse rounded-md bg-muted",a),...b})}},20886:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(67484);function e(a,b){let[c,e]=(0,d.useState)(0),[f,g]=(0,d.useState)({key:"",error:null}),h=`${c}:${a}`,i=(0,d.useCallback)(()=>e(a=>a+1),[]),j=f.key!==h;return{data:f.data,error:j?null:f.error,loading:j,reload:i}}},21883:(a,b,c)=>{"use strict";c.d(b,{F:()=>f});var d=c(16950);async function e(a,b,c){let e,f=await (0,d.Qv)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b),signal:c}),g=await f.text();if(!g)throw Error(`YTDB bridge returned an empty response (HTTP ${f.status}). Restart YTDB to update the local bridge.`);try{e=JSON.parse(g)}catch{if(404===f.status)throw Error("The YTDB running on your machine is older than this page and does not know this request. Restart it with `npx @theobourgeois/ytdb@latest`.");throw Error(`YTDB bridge returned an invalid response (HTTP ${f.status}).`)}if(!f.ok)throw Error((e&&"object"==typeof e&&"error"in e&&"string"==typeof e.error?e.error:f.statusText)||`YTDB bridge request failed with HTTP ${f.status}.`);return e}let f={tables:(a,b)=>e("/api/tables",{connectionUrl:a},b),rows:(a,b,c)=>e("/api/rows",{connectionUrl:a,query:b},c),query:(a,b,c)=>e("/api/query",{connectionUrl:a,sql:b},c),updateCell:(a,b,c)=>e("/api/cell",{connectionUrl:a,update:b},c),insertRow:(a,b,c)=>e("/api/insert-row",{connectionUrl:a,insertion:b},c),updateRow:(a,b,c)=>e("/api/update-row",{connectionUrl:a,update:b},c),deleteRows:(a,b,c)=>e("/api/delete-rows",{connectionUrl:a,deletion:b},c),related:(a,b,c)=>e("/api/related",{connectionUrl:a,lookups:b},c),lookup:(a,b,c)=>e("/api/lookup",{connectionUrl:a,query:b},c),definition:(a,b,c)=>e("/api/definition",{connectionUrl:a,table:b},c),schema:(a,b)=>e("/api/schema",{connectionUrl:a},b),ledger:(a,b,c,d=!1)=>e("/api/ledger",{connectionUrl:a,ledgerSchema:b,withSql:d},c),migrate:(a,b,c)=>e("/api/migrate",{connectionUrl:a,migration:b},c),adopt:(a,b,c)=>e("/api/adopt",{connectionUrl:a,adopt:b},c),detect:(a,b,c)=>e("/api/detect",{connectionUrl:a,migrations:b},c),repo:(a,b)=>e("/api/repo",{root:a},b),note:(a,b,c,d)=>e("/api/note",{root:a,path:b,note:c},d)}},34766:(a,b,c)=>{"use strict";c.d(b,{ExplorerShell:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ExplorerShell() from the server but ExplorerShell is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/theobourgeois/code/db-studio/src/components/explorer/explorer-shell.tsx","ExplorerShell")},35412:(a,b,c)=>{Promise.resolve().then(c.bind(c,53371))},43189:(a,b,c)=>{"use strict";c.d(b,{Q:()=>j});var d=c(19099),e=c(67484),f=c(91732),g=c(66280),h=c(43851),i=c(13449);function j(a){let b,c,j=(0,d.useRouter)(),k=(0,h.c)(a=>a.entries),l=(0,h.c)(a=>a.index),m=(b=(0,f.Z)(a=>a.connections),c=(0,g.jV)(a=>a.sets),(0,e.useCallback)((a,d)=>{let e=a=>b.find(b=>b.id===a)?.name??a,f="connectionId"in a&&a.connectionId!==d?` \xb7 ${e(a.connectionId)}`:"";switch(a.kind){case"home":return"Connections";case"connection":return e(a.connectionId);case"query":return`SQL query${f}`;case"diff":return`Compare schema${f}`;case"migrations":return`Migrations${f}`;case"migration":return`${c.find(b=>b.id===a.setId)?.name??"Migration"}${f}`;case"table":return`${a.table.name}${f}`}},[b,c]));return(0,e.useMemo)(()=>{let b=b=>{let c=k[b];if(void 0===c)return null;let d=(0,i.ZG)(c);return{href:c,route:d,label:m(d,a)}},c=b(l-1),d=b(l+1);return{back:c,forward:d,goBack:()=>{c&&j.back()},goForward:()=>{d&&j.forward()}}},[k,l,m,a,j])}},44231:(a,b,c)=>{"use strict";c.d(b,{Z:()=>i,k:()=>j});var d=c(48249),e=c(67484),f=c(21883),g=c(20886);let h=(0,e.createContext)(null);function i({connection:a,children:b}){let c=(0,g.Y)(a.url,b=>f.F.tables(a.url,b));return(0,d.jsx)(h.Provider,{value:{connection:a,tables:c},children:b})}function j(){let a=(0,e.useContext)(h);if(!a)throw Error("useExplorerContext must be used inside ExplorerProvider");return a}},53286:(a,b,c)=>{"use strict";c.d(b,{F:()=>k});var d=c(48249);c(67484);var e=c(99058),f=c(40336),g=c(69856),h=c(18656),i=c(41764),j=c(14490);function k({className:a,children:b,...c}){return(0,d.jsxs)(e.V,{"data-slot":"scroll-area",className:(0,j.cn)("relative",a),...c,children:[(0,d.jsx)(f.B,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:b}),(0,d.jsx)(l,{}),(0,d.jsx)(g.I,{})]})}function l({className:a,orientation:b="vertical",...c}){return(0,d.jsx)(h.V,{"data-slot":"scroll-area-scrollbar","data-orientation":b,orientation:b,className:(0,j.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",a),...c,children:(0,d.jsx)(i.l,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}},53371:(a,b,c)=>{"use strict";c.d(b,{ExplorerShell:()=>ac});var d=c(48249),e=c(2116),f=c.n(e),g=c(23171),h=c(25297),i=c(98609),j=c(91732),k=c(99598),l=c(78260),m=c(44231),n=c(19099),o=c(67484),p=c(53286),q=c(1814),r=c(13656),s=c(8508),t=c(89366),u=c(14490),v=c(82244),w=c(30770),x=c(60671);function y({current:a}){let b=(0,j.Z)(a=>a.connections),c=(0,x.$C)();return(0,d.jsxs)(v.rI,{children:[(0,d.jsxs)(v.ty,{className:"flex h-8 w-full items-center justify-between gap-2 rounded-lg px-2 text-left font-medium outline-none hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50 data-open:bg-muted/60",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)(w.F,{connection:a}),(0,d.jsx)("span",{className:"truncate",children:a.name}),a.layoutGroup&&(0,d.jsx)(g.WnQ,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),(0,d.jsx)(g.klM,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),(0,d.jsxs)(v.SQ,{align:"start",className:"w-(--anchor-width)",children:[b.map(b=>(0,d.jsxs)(v._2,{onClick:()=>void c(b.id),className:b.id===a.id?"font-medium":void 0,children:[(0,d.jsx)(w.F,{connection:b}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:b.name}),b.layoutGroup&&b.layoutGroup===a.layoutGroup&&(0,d.jsx)(g.WnQ,{className:"size-3.5 shrink-0 text-muted-foreground"})]},b.id)),(0,d.jsx)(v.mB,{}),(0,d.jsx)(v._2,{render:(0,d.jsx)(f(),{href:"/"}),children:"Manage connections"})]})]})}var z=c(79820);function A(a,b){let c=a.trim(),d=c.lastIndexOf(".");return -1===d?c:"schema"===b?c.slice(0,d):c.slice(d+1)}function B({text:a,query:b}){if(!b)return a;let c=[],e=a.toLocaleLowerCase(),f=b.toLocaleLowerCase(),g=0,h=e.indexOf(f);if(-1===h)return a;for(;-1!==h;)h>g&&c.push(a.slice(g,h)),c.push((0,d.jsx)("mark",{className:"rounded-[3px] bg-yellow-300/90 px-px text-yellow-950 dark:bg-yellow-400/85 dark:text-yellow-950",children:a.slice(h,h+b.length)},h)),g=h+b.length,h=e.indexOf(f,g);return g<a.length&&c.push(a.slice(g)),c}function C({connectionId:a,table:b,search:c,pinned:e,showSchema:h,active:i,reorderable:j,dragging:k,dropEdge:l,onTogglePin:m,onDragStart:n,onDragOver:o,onDrop:p,onDragEnd:q,onMove:r}){return(0,d.jsxs)("li",{onDragOver:o,onDrop:p,className:(0,u.cn)("group/table-row relative flex h-7 items-center rounded-md text-[13px] transition-[color,background-color,opacity] hover:bg-muted/60",i&&"bg-muted text-foreground",!i&&"text-foreground/80",k&&"opacity-45","before"===l&&"before:absolute before:inset-x-1 before:top-0 before:z-10 before:h-0.5 before:-translate-y-1/2 before:rounded-full before:bg-primary","after"===l&&"after:absolute after:inset-x-1 after:bottom-0 after:z-10 after:h-0.5 after:translate-y-1/2 after:rounded-full after:bg-primary"),children:[j&&(0,d.jsx)("button",{type:"button",draggable:!0,"aria-label":`Reorder ${b.schema}.${b.name}`,title:"Drag to reorder; use Up and Down arrow keys",onDragStart:n,onDragEnd:q,onKeyDown:a=>{("ArrowUp"===a.key||"ArrowDown"===a.key)&&(a.preventDefault(),r?.("ArrowUp"===a.key?-1:1))},className:"ml-1.5 flex size-5 shrink-0 cursor-grab touch-none items-center justify-center rounded text-muted-foreground opacity-50 outline-none transition-[color,background-color,opacity] hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:opacity-100 active:cursor-grabbing",children:(0,d.jsx)(g.Mvf,{className:"size-3.5"})}),(0,d.jsxs)(f(),{href:`/${a}/${encodeURIComponent(b.schema)}/${encodeURIComponent(b.name)}`,className:(0,u.cn)("flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/60",j?"pl-1":"pl-6"),children:[(0,d.jsx)("span",{className:"truncate",children:(0,d.jsx)(B,{text:b.name,query:A(c,"table")})}),h?(0,d.jsx)("span",{className:"ml-auto max-w-20 truncate text-[10px] text-muted-foreground",children:b.schema}):"view"===b.kind&&(0,d.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:"view"})]}),(0,d.jsx)("button",{type:"button","aria-label":`${e?"Unpin":"Pin"} ${b.schema}.${b.name}`,"aria-pressed":e,title:e?"Unpin table":"Pin table",onClick:()=>m(b),className:(0,u.cn)("mr-0.5 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 outline-none transition-[color,background-color,opacity] hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:opacity-100 group-hover/table-row:opacity-100",e&&"text-foreground"),children:e?(0,d.jsx)(g.M0d,{className:"size-3.5"}):(0,d.jsx)(g.rq5,{className:"size-3.5"})})]})}function D({label:a,count:b,collapsed:c,pinned:e,search:f,onToggle:h}){return(0,d.jsxs)("button",{type:"button","aria-expanded":!c,onClick:h,className:"flex h-7 w-full cursor-pointer items-center gap-1 rounded-md px-1 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60",children:[(0,d.jsx)(g.nNJ,{className:(0,u.cn)("size-3.5 transition-transform",!c&&"rotate-90")}),e&&(0,d.jsx)(g.M0d,{className:"mr-0.5 size-3"}),(0,d.jsx)("span",{className:"truncate",children:e?a:(0,d.jsx)(B,{text:a,query:A(f,"schema")})}),(0,d.jsx)("span",{className:"ml-auto pr-1 tabular-nums opacity-60",children:b})]})}function E({connectionId:a,tables:b,search:c,collapsedSchemas:e,pinnedTables:f,onToggleSchema:g,onTogglePin:h,onReorderPinned:i}){let j=(0,n.useParams)(),[k,l]=(0,o.useState)(!1),[m,p]=(0,o.useState)(null),[q,r]=(0,o.useState)(null),s=new Map(b.map(a=>[(0,t.i)(a),a])),u=f.flatMap(a=>{let b=s.get(a);return b?[b]:[]});function v(){p(null),r(null)}return 0===b.length?(0,d.jsx)("p",{className:"px-3 py-8 text-center text-xs text-muted-foreground",children:c.trim()?"No tables match your search":"No tables in these schemas"}):(0,d.jsxs)("div",{className:"flex flex-col gap-1 px-2 pb-4",children:[u.length>0&&(0,d.jsxs)("div",{className:"mb-1 border-b border-border/60 pb-1",children:[(0,d.jsx)(D,{label:"Pinned tables",count:u.length,collapsed:k,pinned:!0,search:c,onToggle:()=>l(a=>!a)}),!k&&(0,d.jsx)("ul",{children:u.map(b=>{let e=(0,t.i)(b);return(0,d.jsx)(C,{connectionId:a,table:b,search:c,pinned:!0,showSchema:!0,active:j.schema===b.schema&&j.table===b.name,reorderable:!0,dragging:m===e,dropEdge:q?.key===e?q.edge:null,onTogglePin:h,onDragStart:a=>{a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",e),p(e),r(null)},onDragOver:a=>(function(a,b){if(!m||m===b)return;a.preventDefault(),a.dataTransfer.dropEffect="move";let c=a.currentTarget.getBoundingClientRect(),d=a.clientY<c.top+c.height/2?"before":"after";r(a=>a?.key===b&&a.edge===d?a:{key:b,edge:d})})(a,e),onDrop:a=>{let b,c;return a.preventDefault(),b=m??a.dataTransfer.getData("text/plain"),c=q?.key===e?q.edge:"before",void(b&&i(b,e,c),v())},onDragEnd:v,onMove:a=>{let b,c;return b=u.findIndex(a=>(0,t.i)(a)===e),void((c=u[b+a])&&i(e,(0,t.i)(c),-1===a?"before":"after"))}},e)})})]}),(function(a){let b=new Map;for(let c of a)b.set(c.schema,[...b.get(c.schema)??[],c]);return[...b.entries()].sort(([a],[b])=>{let c;return((c=new Map([["public",0],["auth",1]])).get(a)??2)-(c.get(b)??2)||a.localeCompare(b)})})(b).map(([b,i])=>{let k=e.includes(b);return(0,d.jsxs)("div",{children:[(0,d.jsx)(D,{label:b,count:i.length,collapsed:k,search:c,onToggle:()=>g(b)}),!k&&(0,d.jsx)("ul",{children:i.map(b=>(0,d.jsx)(C,{connectionId:a,table:b,search:c,pinned:f.includes((0,t.i)(b)),active:j.schema===b.schema&&j.table===b.name,onTogglePin:h},(0,t.i)(b)))})]},b)})]})}function F(a){return Math.min(480,Math.max(180,Math.round(a)))}function G(a,b){let c=new Map([["public",0],["auth",1]]);return(c.get(a)??2)-(c.get(b)??2)||a.localeCompare(b)}function H(a,b,c){let d=b.trim().toLocaleLowerCase();return a.filter(a=>(null===c||!!c.includes(a.schema))&&(!d||a.name.toLocaleLowerCase().includes(d)||`${a.schema}.${a.name}`.toLocaleLowerCase().includes(d)))}function I({href:a,active:b,shortcut:c,children:e}){return(0,d.jsxs)(f(),{href:a,"aria-current":b?"page":void 0,className:(0,u.cn)((0,h.r)({variant:b?"secondary":"ghost",size:"sm"}),"h-8 w-full justify-start px-2"),children:[e,(0,d.jsx)("kbd",{className:"ml-auto font-mono text-[10px] text-muted-foreground/55",children:c})]})}function J({width:a,onWidthChange:b,onCollapse:c}){let e=(0,n.usePathname)(),{connection:f,tables:i}=(0,m.k)(),[l,u]=(0,k.DE)(f.id),v=(0,j.Z)(a=>a.connections.length>1),[w,x]=(0,o.useState)(()=>F(a)),A=(0,o.useRef)(null),B=(0,o.useMemo)(()=>[...new Set((i.data??[]).map(a=>a.schema))].sort(G),[i.data]),C=(0,o.useMemo)(()=>null===l.selectedSchemas?null:l.selectedSchemas.filter(a=>B.includes(a)),[l.selectedSchemas,B]),D=(0,o.useMemo)(()=>H(i.data??[],l.search,C),[i.data,l.search,C]),K=`/${encodeURIComponent(f.id)}`,L=`${K}/query`,M=`${K}/diff`,N=`${K}/migrations`;function O(a,b){let c=new Set(H(i.data??[],a,b).map(a=>a.schema));return l.collapsedSchemas.filter(a=>!c.has(a))}return(0,d.jsxs)("aside",{id:"database-explorer-sidebar",style:{width:w},className:"relative flex h-full shrink-0 flex-col border-r bg-sidebar",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 border-b border-sidebar-border/60 p-2",children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center gap-1",children:[(0,d.jsx)("div",{className:"min-w-0 flex-1",children:(0,d.jsx)(y,{current:f})}),(0,d.jsx)(h.$,{variant:"ghost",size:"icon-sm","aria-label":"Collapse database sidebar",title:"Collapse sidebar",onClick:c,children:(0,d.jsx)(g.cFu,{})})]}),(0,d.jsxs)(I,{href:L,active:e===L,shortcut:s.Ar.sqlEditor,children:[(0,d.jsx)(g.Uoo,{"data-icon":"inline-start"}),"SQL query"]}),(0,d.jsxs)(I,{href:N,active:e===N||e.startsWith(`${N}/`),shortcut:s.Ar.migrations,children:[(0,d.jsx)(g.olY,{"data-icon":"inline-start"}),"Migrations"]}),v&&(0,d.jsxs)(I,{href:M,active:e===M,shortcut:s.Ar.compareSchema,children:[(0,d.jsx)(g.R4X,{"data-icon":"inline-start"}),"Compare schema"]}),(0,d.jsx)(q.L,{value:l.search,onChange:a=>{var b;u({search:b=a.target.value,collapsedSchemas:b.trim()?O(b,C):l.collapsedSchemas})},placeholder:"Search tables","aria-label":"Search tables",className:"mt-1",trailing:(0,d.jsxs)(d.Fragment,{children:[!l.search&&(0,d.jsx)("kbd",{className:"font-mono text-[10px] text-muted-foreground/55",children:s.Ar.tableSearch}),(0,d.jsx)(z.V,{compact:!0,schemas:B,selected:C,onChange:function(a){u({selectedSchemas:a,collapsedSchemas:l.search.trim()?O(l.search,a):l.collapsedSchemas})}})]})})]}),(0,d.jsx)(p.F,{className:"min-h-0 flex-1 pt-1.5",children:i.error?(0,d.jsx)("p",{className:"px-3 py-4 text-xs text-destructive",children:i.error}):i.data?(0,d.jsx)(E,{connectionId:f.id,tables:D,search:l.search,collapsedSchemas:l.collapsedSchemas,pinnedTables:l.pinnedTables,onToggleSchema:function(a){u({collapsedSchemas:l.collapsedSchemas.includes(a)?l.collapsedSchemas.filter(b=>b!==a):[...l.collapsedSchemas,a]})},onTogglePin:function(a){let b=(0,t.i)(a);u({pinnedTables:l.pinnedTables.includes(b)?l.pinnedTables.filter(a=>a!==b):[...l.pinnedTables,b]})},onReorderPinned:function(a,b,c){if(a===b)return;let d=l.pinnedTables.filter(b=>b!==a),e=d.indexOf(b);-1!==e&&(d.splice(e+ +("after"===c),0,a),u({pinnedTables:d}))}}):(0,d.jsx)("div",{className:"flex flex-col gap-2 px-3 py-2",children:Array.from({length:8},(a,b)=>(0,d.jsx)(r.E,{className:"h-5 w-full"},b))})}),(0,d.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize database sidebar","aria-valuemin":180,"aria-valuemax":480,"aria-valuenow":w,tabIndex:0,title:"Drag to resize; double-click to reset",onPointerDown:function(a){a.preventDefault(),A.current={pointerId:a.pointerId,startX:a.clientX,startWidth:w},a.currentTarget.setPointerCapture(a.pointerId)},onPointerMove:function(a){let b=A.current;b&&b.pointerId===a.pointerId&&(a.preventDefault(),x(F(b.startWidth+a.clientX-b.startX)))},onPointerUp:function(a){let c=A.current;if(!c||c.pointerId!==a.pointerId)return;let d=F(c.startWidth+a.clientX-c.startX);A.current=null,x(d),a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId),b(d)},onPointerCancel:function(a){let c=A.current;c&&c.pointerId===a.pointerId&&(A.current=null,a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId),b(w))},onKeyDown:function(a){if("ArrowLeft"!==a.key&&"ArrowRight"!==a.key)return;a.preventDefault();let c=F(w+("ArrowLeft"===a.key?-1:1)*16);x(c),b(c)},onDoubleClick:function(a){a.preventDefault(),x(256),b(256)},className:"group/resize absolute inset-y-0 -right-1 z-30 w-2 cursor-col-resize touch-none outline-none after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-transparent after:transition-colors hover:after:bg-primary focus-visible:after:bg-primary"})]})}var K=c(89267),L=c(16280),M=c(61561);c(61159);var N=c(93291);function O(a,{nested:b=!1}={}){let c=(0,n.useRouter)(),d=(0,n.usePathname)(),{connection:e,tables:f}=(0,m.k)(),[g]=(0,k.DE)(e.id),h=`/${encodeURIComponent(e.id)}`,i=`${h}/${a}`,j=b?d===i||d.startsWith(`${i}/`):d===i;return{open:j,href:i,toggle:()=>c.push(j?function(){for(let a of g.recentTables){let b=(f.data??[]).find(b=>(0,t.i)(b)===a);if(b)return`${h}/${encodeURIComponent(b.schema)}/${encodeURIComponent(b.name)}`}return h}():i)}}function P(){let a=O("migrations",{nested:!0});return{open:a.open,migrationsHref:a.href,toggle:a.toggle}}var Q=c(43189);function R(){let a=O("diff");return{open:a.open,diffHref:a.href,toggle:a.toggle}}function S(){let a=O("query");return{open:a.open,queryHref:a.href,toggle:a.toggle}}function T({text:a,query:b}){if(!b)return a;let c=a.toLocaleLowerCase(),e=b.toLocaleLowerCase(),f=c.indexOf(e);return -1===f?a:(0,d.jsxs)(d.Fragment,{children:[a.slice(0,f),(0,d.jsx)("mark",{className:"rounded-[3px] bg-yellow-300/90 px-px text-yellow-950 dark:bg-yellow-400/85 dark:text-yellow-950",children:a.slice(f,f+b.length)}),a.slice(f+b.length)]})}async function U(a){try{await navigator.clipboard.writeText(a)}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}}function V(){let a=(0,n.useRouter)(),b=(0,n.useParams)(),{connection:c,tables:e}=(0,m.k)(),f=S(),h=R(),i=P(),l=(0,k.y3)(c.id),p=(0,x.yG)(),q=(0,Q.Q)(c.id),r=(0,j.Z)(a=>a.add),[v,w]=(0,k.DE)(c.id),[y,z]=(0,o.useState)(!1),[A,B]=(0,o.useState)("commands"),[C,D]=(0,o.useState)(""),[E,F]=(0,o.useState)(0),[G,H]=(0,o.useState)(!1),I=(0,o.useRef)(null),J=(0,o.useRef)(null),O=(0,o.useRef)(null),V=(0,o.useRef)(A),W=(0,L.C)(a=>a.theme),X=b.schema&&b.table?{schema:decodeURIComponent(b.schema),name:decodeURIComponent(b.table)}:null,Y=!!X&&v.pinnedTables.includes((0,t.i)(X)),Z=(0,k.lz)(a=>X?a.tables[`${c.id}:${(0,t.i)(X)}`]:void 0),$=(0,o.useMemo)(()=>[{id:"sql-editor",title:f.open?"Back to Table":"Open SQL Query",keywords:["new","query","sql","console","editor","close","back","table"],enabled:!0,shortcut:s.Ar.sqlEditor,run:()=>f.toggle()},{id:"go-back",title:q.back?`Back to ${q.back.label}`:"Back",keywords:["back","previous","return","history","undo"],enabled:null!==q.back,shortcut:s.Ar.back,run:()=>q.goBack()},{id:"go-forward",title:q.forward?`Forward to ${q.forward.label}`:"Forward",keywords:["forward","next","history","redo"],enabled:null!==q.forward,shortcut:s.Ar.forward,run:()=>q.goForward()},{id:"switch-connection",title:p.next?`Switch Connection (${p.next.name})`:"Switch Connection",keywords:["database","env","environment","next","cycle","other"],enabled:p.enabled,shortcut:s.Ar.switchConnection,run:()=>void p.run()},{id:"migrations",title:i.open?"Back to Table":"Open Migrations",keywords:["migration","migrate","apply","revert","rollback","ledger","schema","run"],enabled:!0,shortcut:s.Ar.migrations,run:()=>i.toggle()},{id:"compare-schema",title:l.target?`Compare Schema with ${l.target.name}`:"Compare Schema",keywords:["diff","difference","migration","drift","prod","dev","schema","compare"],enabled:null!==l.target,shortcut:s.Ar.compareSchema,run:()=>h.toggle()},{id:"search-tables",title:"Search Tables",keywords:["find","jump","open","goto","table"],enabled:!0,shortcut:s.Ar.tableSearch,run:()=>window.requestAnimationFrame(()=>(0,s.tT)())},{id:"search-columns",title:"Search Columns",keywords:["find","jump","goto","column","field"],enabled:null!==X,shortcut:s.Ar.columnSearch,run:()=>window.requestAnimationFrame(()=>(0,s.vI)())},{id:"reload-tables",title:"Reload Tables",keywords:["refresh","reload","tables","sync"],enabled:!0,run:()=>e.reload()},{id:"pin-table",title:Y?"Unpin Table":"Pin Table",keywords:["pin","unpin","favorite","star"],enabled:null!==X,run:()=>{if(!X)return;let a=(0,t.i)(X);w({pinnedTables:v.pinnedTables.includes(a)?v.pinnedTables.filter(b=>b!==a):[...v.pinnedTables,a]})}},{id:"clear-filters",title:"Clear Filters",keywords:["filter","reset","remove"],enabled:null!==X,run:()=>{X&&k.lz.getState().setTable(c.id,X,{filters:[],page:0})}},{id:"clear-search",title:"Clear Search",keywords:["find","search","reset"],enabled:null!==X&&!!Z?.search,run:()=>{X&&k.lz.getState().setTable(c.id,X,{search:"",page:0})}},{id:"reset-columns",title:"Reset Columns",keywords:["pin","hide","frozen","layout","show"],enabled:null!==X,run:()=>{X&&k.lz.getState().setTable(c.id,X,{pinnedColumns:void 0,hiddenColumns:[]})}},{id:"copy-table",title:"Copy Schema.Table",keywords:["copy","name","qualified"],enabled:null!==X,run:()=>{X&&U((0,t.i)(X))}},{id:"color-theme",title:"Color Theme",keywords:["theme","appearance","dark","light","color","set","preferences"],enabled:!0,keepOpen:!0,run:()=>{let a=L.C.getState().theme,b=M.zG.findIndex(b=>b.id===a);B("themes"),D(""),F(-1===b?0:b)}},{id:"add-connection",title:"Add Connection",keywords:["new","database","postgres"],enabled:!0,run:()=>H(!0)}],[v.pinnedTables,l.target,c.id,q,i,Y,h,w,f,p,X,Z?.search,e]),_=(0,o.useMemo)(()=>C.trim()?(0,N.R6)(C,$,a=>[a.title,...a.keywords].join(" ")).map(a=>a.item):$,[$,C]),aa=(0,o.useMemo)(()=>C.trim()?(0,N.R6)(C,[...M.zG],a=>[a.name,...a.keywords].join(" ")).map(a=>a.item):[...M.zG],[C]),ab="themes"===A?aa:_,ac="commands"===A?_[E]??null:null,ad="themes"===A?aa[E]??null:null;function ae(a){a?.revertTheme&&"themes"===V.current&&(0,M.AZ)(L.C.getState().theme),z(!1),D(""),F(0),B("commands")}function af(a){a.enabled&&(a.keepOpen||ae({revertTheme:!0}),a.run())}function ag(a){L.C.getState().setTheme(a.id),(0,M.AZ)(a.id),ae({revertTheme:!1})}return(0,d.jsxs)(d.Fragment,{children:[y&&(0,d.jsxs)("div",{ref:J,"data-command-palette":"",className:"fixed top-3 left-1/2 z-50 flex w-[min(36rem,calc(100%-1.5rem))] -translate-x-1/2 flex-col overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ring-1 ring-foreground/10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b px-3",children:[(0,d.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:">"}),(0,d.jsx)("input",{ref:I,value:C,onChange:a=>D(a.target.value),onKeyDown:function(a){if("ArrowDown"===a.key){if(a.preventDefault(),0===ab.length)return;F(a=>(a+1)%ab.length);return}if("ArrowUp"===a.key){if(a.preventDefault(),0===ab.length)return;F(a=>(a-1+ab.length)%ab.length);return}if("Enter"===a.key){if(a.preventDefault(),"themes"===A){ad&&ag(ad);return}ac&&af(ac)}},spellCheck:!1,autoComplete:"off",autoCorrect:"off",placeholder:"themes"===A?"Select color theme":"Type a command","aria-label":"themes"===A?"Color theme":"Command palette",className:"h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),(0,d.jsx)("div",{ref:O,role:"listbox","aria-label":"themes"===A?"Color themes":"Commands",className:"max-h-[min(24rem,50vh)] overflow-auto py-1",children:0===ab.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"themes"===A?"No matching themes":"No matching commands"}):"themes"===A?aa.map((a,b)=>{let c=b===E,e=a.id===W;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"data-active":c||void 0,onMouseEnter:()=>F(b),onClick:()=>ag(a),className:(0,u.cn)("flex h-8 w-full cursor-pointer items-center gap-2 px-3 text-left text-[13px] outline-none",c&&"bg-primary/10"),children:[(0,d.jsx)("span",{"aria-hidden":!0,className:"size-3.5 shrink-0 rounded-sm border",style:{background:a.swatch}}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:(0,d.jsx)(T,{text:a.name,query:C.trim()})}),e&&(0,d.jsx)(g.wiW,{className:"ml-auto size-3.5 shrink-0 text-muted-foreground"})]},a.id)}):_.map((a,b)=>{let c=b===E;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"aria-disabled":!a.enabled,"data-active":c||void 0,onMouseEnter:()=>F(b),onClick:()=>af(a),className:(0,u.cn)("flex h-8 w-full cursor-pointer items-center px-3 text-left text-[13px] outline-none",c&&"bg-primary/10",!a.enabled&&"cursor-default opacity-40"),children:[(0,d.jsx)("span",{className:"min-w-0 truncate",children:(0,d.jsx)(T,{text:a.title,query:C.trim()})}),a.shortcut&&(0,d.jsx)("kbd",{className:"ml-auto shrink-0 pl-3 font-mono text-[11px] text-muted-foreground/70",children:a.shortcut})]},a.id)})})]}),(0,d.jsx)(K.f,{open:G,onOpenChange:H,onSubmit:b=>{let{shareWith:c,...d}=b,e=r(d);(0,k.mQ)(e.id,c),a.push(`/${e.id}`)}})]})}function W(){let{toggle:a}=S(),{toggle:b}=R(),{toggle:c}=P(),{run:d}=(0,x.yG)(),e=(0,Q.Q)(),f=(0,j.Z)(a=>a.connections.length>1);return(0,o.useRef)(a),(0,o.useRef)(b),(0,o.useRef)(c),(0,o.useRef)(d),(0,o.useRef)(e),(0,o.useRef)(f),null}c(21883);let X={pinned:"Pinned",recent:"Recent",tables:"Tables",connections:"Connections"};function Y({text:a,query:b}){if(!b)return a;let c=a.toLocaleLowerCase(),e=b.toLocaleLowerCase(),f=c.indexOf(e);return -1===f?a:(0,d.jsxs)(d.Fragment,{children:[a.slice(0,f),(0,d.jsx)("mark",{className:"rounded-[3px] bg-yellow-300/90 px-px text-yellow-950 dark:bg-yellow-400/85 dark:text-yellow-950",children:a.slice(f,f+b.length)}),a.slice(f+b.length)]})}function Z(a){try{return new URL(a).hostname}catch{return""}}function $(a){return[a.name,Z(a.url)].filter(Boolean)}function _(a,b){let c=new Map([["public",0],["auth",1]]);return(c.get(a.schema)??2)-(c.get(b.schema)??2)||a.schema.localeCompare(b.schema)||a.name.localeCompare(b.name)}function aa(a,b){return a.map((a,c)=>0===c?{...a,section:b}:a)}function ab(){let a=(0,n.useRouter)(),b=(0,x.$C)(),c=(0,n.useParams)(),{connection:e,tables:f}=(0,m.k)(),h=(0,j.Z)(a=>a.connections),[i,l]=(0,o.useState)(!1),[p,q]=(0,o.useState)(""),[r,s]=(0,o.useState)(0),[v,y]=(0,o.useState)(null),z=(0,o.useRef)(null),A=(0,o.useRef)(null),B=(0,o.useRef)(null),C=h.find(a=>a.id===v)??null,D=C??e,E=C&&C.id!==e.id?C.url:null,F=function(a){let[b]=(0,o.useState)(()=>new Map),[c,d]=(0,o.useState)({url:"",error:null});if(!a)return{data:void 0,error:null,loading:!1};let e=c.url===a?c.data:b.get(a);return{data:e,error:c.url===a?c.error:null,loading:void 0===e}}(E),[G,H]=(0,k.DE)(e.id),[I,J]=(0,k.DE)(D.id),K=D.id===e.id?G:I,L=(0,o.useMemo)(()=>E?F.data??[]:f.data??[],[F.data,E,f.data]),M=E?F.loading:f.loading,O=E?F.error:null,P=(0,o.useMemo)(()=>[...new Set(L.map(a=>a.schema))],[L]),Q=null===K.selectedSchemas?null:K.selectedSchemas.filter(a=>P.includes(a)),R=(0,o.useMemo)(()=>null===Q?L:L.filter(a=>Q.includes(a.schema)),[L,Q]),S=K.pinnedTables,T=K.recentTables,U=(0,o.useMemo)(()=>{let a,b;return -1===(b=(a=p.trim()).indexOf(":"))?{schema:null,table:a}:{schema:a.slice(0,b).trim(),table:a.slice(b+1).trim()}},[p]),V=U.table||(U.schema?"":p.trim()),W=(0,o.useMemo)(()=>{let a=new Set(S),b=new Set(T),c=null===U.schema?null:function(a,b){if(!a)return b;let c=a.toLocaleLowerCase(),d=b.filter(a=>a.toLocaleLowerCase()===c);if(d.length>0)return d;let e=b.filter(a=>a.toLocaleLowerCase().startsWith(c));return e.length>0?e:(0,N.R6)(a,b,a=>a).map(a=>a.item)}(U.schema,P),d=null===c?R:L.filter(a=>c.includes(a.schema)),f=new Map(d.map(a=>[(0,t.i)(a),a])),g=S.flatMap(a=>{let b=f.get(a);return b?[b]:[]}),i=T.flatMap(b=>{let c=f.get(b);return!c||a.has(b)?[]:[c]}),j=(a,b)=>({type:"table",key:`table:${(0,t.i)(a)}`,table:a,...b}),k=a=>({type:"connection",key:`connection:${a.id}`,connection:a,current:a.id===e.id}),l=null===U.schema?p.trim():U.table,m=null===C&&null===U.schema;if(!l){let a=new Set([...g.map(a=>(0,t.i)(a)),...i.map(a=>(0,t.i)(a))]),c=d.filter(b=>!a.has((0,t.i)(b))).sort(_),f=m?h.filter(a=>a.id!==e.id):[];return[...aa(g.map(a=>j(a,{pinned:!0})),"pinned"),...aa(i.map(a=>j(a,{pinned:!1,recent:!0})),"recent"),...aa(c.map(a=>j(a,{pinned:!1,recent:b.has((0,t.i)(a))})),"tables"),...aa(f.map(k),"connections")]}let n=(0,N.UO)(l,d,a=>null===U.schema?[a.name,`${a.schema}.${a.name}`,a.schema]:[a.name]).map(c=>({...c,score:c.score+80*!!a.has((0,t.i)(c.item))+40*!!b.has((0,t.i)(c.item))})).sort((a,b)=>b.score-a.score).map(c=>j(c.item,{pinned:a.has((0,t.i)(c.item)),recent:b.has((0,t.i)(c.item))}));return[...aa(m?(0,N.UO)(p,h,$).map(a=>k(a.item)):[],"connections"),...aa(n,"tables")]},[L,e.id,h,C,U.schema,U.table,S,p,T,P,R]),ab=W[r]??null;function ac(){y(null),s(0),z.current?.focus()}function ad(c){var d,e;(l(!1),q(""),s(0),y(null),"connection"===c.type)?b(c.connection.id):a.push((d=D.id,e=c.table,`/${d}/${encodeURIComponent(e.schema)}/${encodeURIComponent(e.name)}`))}function ae(a){let b=(0,t.i)(a),c=K.pinnedTables.includes(b)?K.pinnedTables.filter(a=>a!==b):[...K.pinnedTables,b];(D.id===e.id?H:J)({pinnedTables:c})}let af=D.id===e.id&&c.schema&&c.table?`${decodeURIComponent(c.schema)}.${decodeURIComponent(c.table)}`:null;return i?(0,d.jsxs)("div",{ref:A,"data-table-palette":"",className:"fixed top-3 left-1/2 z-50 flex w-[min(36rem,calc(100%-1.5rem))] -translate-x-1/2 flex-col overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ring-1 ring-foreground/10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b px-3",children:[(0,d.jsx)(g.TfF,{className:"size-4 shrink-0 text-muted-foreground"}),C&&(0,d.jsxs)("button",{type:"button",onClick:ac,"aria-label":`Stop searching ${C.name}`,className:"flex h-6 max-w-40 shrink-0 items-center gap-1.5 rounded-md bg-muted px-1.5 text-xs outline-none hover:bg-muted/80",children:[(0,d.jsx)(w.F,{connection:C,className:"size-2"}),(0,d.jsx)("span",{className:"truncate",children:C.name})]}),(0,d.jsx)("input",{ref:z,value:p,onChange:a=>q(a.target.value),onKeyDown:function(a){if("ArrowDown"===a.key){if(a.preventDefault(),0===W.length)return;s(a=>(a+1)%W.length);return}if("ArrowUp"===a.key){if(a.preventDefault(),0===W.length)return;s(a=>(a-1+W.length)%W.length);return}if("Tab"===a.key){if(a.preventDefault(),C||a.shiftKey)return;ab?.type==="connection"&&(y(ab.connection.id),q(""),s(0));return}if("Backspace"===a.key&&""===p&&C){a.preventDefault(),ac();return}"Enter"===a.key&&(a.preventDefault(),a.shiftKey&&ab?.type==="table"?ae(ab.table):ab&&ad(ab))},spellCheck:!1,autoComplete:"off",autoCorrect:"off",placeholder:C?`Search tables in ${C.name}`:"Go to table (schema:name)","aria-label":C?`Go to table in ${C.name}`:"Go to table or connection",className:"h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),(0,d.jsx)("div",{ref:B,role:"listbox","aria-label":C?`Tables in ${C.name}`:"Tables and connections",className:"max-h-[min(24rem,50vh)] overflow-auto py-1",children:M&&0===L.length&&0===W.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"Loading tables…"}):O&&0===L.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:O}):0===W.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p.trim()?"No matches":"No tables"}):W.map((a,b)=>{let c=b===r;if("connection"===a.type){let e=Z(a.connection.url);return(0,d.jsxs)("div",{children:[a.section&&(0,d.jsx)("p",{className:"px-3 pt-2 pb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase",children:X[a.section]}),(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"data-active":c||void 0,onMouseEnter:()=>s(b),onClick:()=>ad(a),className:(0,u.cn)("flex h-8 w-full cursor-pointer items-center gap-2 px-3 text-left text-[13px] outline-none",c&&"bg-primary/10"),children:[(0,d.jsx)(g.bkQ,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)(w.F,{connection:a.connection,className:"size-2"}),(0,d.jsx)("span",{className:(0,u.cn)("min-w-0 truncate",a.current&&"font-medium"),children:(0,d.jsx)(Y,{text:a.connection.name,query:V})}),(0,d.jsx)("span",{className:"ml-auto flex min-w-0 shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:c?(0,d.jsx)("span",{children:"Tab to search"}):(0,d.jsx)("span",{className:"max-w-36 truncate",children:a.current?"current":e||"connection"})})]})]},a.key)}let e=(0,t.i)(a.table)===af;return(0,d.jsxs)("div",{children:[a.section&&(0,d.jsx)("p",{className:"px-3 pt-2 pb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase",children:X[a.section]}),(0,d.jsxs)("div",{onMouseEnter:()=>s(b),className:(0,u.cn)("group/table-result flex items-center",c&&"bg-primary/10"),children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"data-active":c||void 0,onClick:()=>ad(a),className:"flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 pl-3 text-left text-[13px] outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/60",children:[a.recent&&!a.pinned?(0,d.jsx)(g.A01,{className:"size-3.5 shrink-0 text-muted-foreground"}):(0,d.jsx)(g.ooN,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:(0,u.cn)("min-w-0 truncate",e&&"font-medium"),children:(0,d.jsx)(Y,{text:a.table.name,query:V})}),(0,d.jsxs)("span",{className:"ml-auto flex min-w-0 shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:["view"===a.table.kind&&(0,d.jsx)("span",{children:"view"}),(0,d.jsx)("span",{className:"max-w-36 truncate",children:a.table.schema})]})]}),(0,d.jsx)("button",{type:"button","aria-label":`${a.pinned?"Unpin":"Pin"} ${(0,t.i)(a.table)}`,"aria-pressed":a.pinned,title:a.pinned?"Unpin table":"Pin table",onClick:()=>ae(a.table),className:(0,u.cn)("mr-2 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 outline-none transition-[color,background-color,opacity] hover:bg-foreground/10 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:opacity-100 group-hover/table-result:opacity-100",(a.pinned||c)&&"opacity-100",a.pinned&&"text-foreground"),children:a.pinned?(0,d.jsx)(g.M0d,{className:"size-3.5"}):(0,d.jsx)(g.rq5,{className:"size-3.5"})})]})]},a.key)})}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 border-t px-3 py-1.5 text-[10px] text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("kbd",{className:"font-mono text-foreground/70",children:"↑↓"}),"Navigate"]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("kbd",{className:"font-mono text-foreground/70",children:"↵"}),"Open"]}),ab?.type==="table"&&(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("kbd",{className:"font-mono text-foreground/70",children:"⇧↵"}),ab.pinned?"Unpin":"Pin"]})]})]}):null}function ac({connectionId:a,children:b}){let c=(0,i.p)(),e=(0,j.w)(a),[n,o]=(0,k.DE)(a);if(!c)return null;if(!e)return(0,d.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground",children:[(0,d.jsx)("p",{children:"Connection not found"}),(0,d.jsx)(f(),{href:"/",className:"text-foreground underline underline-offset-4",children:"Connections"})]});let p=(0,l.Mq)(e);return(0,d.jsxs)(m.Z,{connection:e,children:[(0,d.jsxs)("div",{className:"flex h-dvh flex-col overflow-hidden",children:[(0,d.jsx)("div",{"aria-hidden":!0,title:e.name,className:"h-1.5 w-full shrink-0",style:{background:p}}),(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[n.sidebarCollapsed?(0,d.jsxs)("aside",{className:"relative flex h-full w-10 shrink-0 justify-center border-r bg-sidebar pt-2",children:[(0,d.jsx)("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1",style:{background:p}}),(0,d.jsx)(h.$,{variant:"ghost",size:"icon-sm","aria-label":"Show database sidebar",title:"Show sidebar",onClick:()=>o({sidebarCollapsed:!1}),children:(0,d.jsx)(g.cFu,{})})]}):(0,d.jsx)(J,{width:n.sidebarWidth,onWidthChange:a=>o({sidebarWidth:a}),onCollapse:()=>o({sidebarCollapsed:!0})},e.id),(0,d.jsx)("main",{className:"flex min-w-0 flex-1 flex-col",children:b})]})]}),(0,d.jsx)(ab,{}),(0,d.jsx)(V,{}),(0,d.jsx)(W,{})]})}},56918:(a,b,c)=>{"use strict";c.d(b,{Ai:()=>p,Nz:()=>o,Zy:()=>m,mj:()=>q,wQ:()=>t});var d=c(14490),e=c(67657);let f=new Set(["apply","up","forward"]),g=new Set(["revert","down","rollback","undo"]),h=[".up",".apply",".forward","_up","_apply","-up","-apply"],i=[".down",".revert",".rollback",".undo","_down","_revert","_rollback","_undo","-down","-revert","-rollback","-undo"];function j(a){return a.split("/").filter(a=>a.length>0)}function k(a){let b=/^[Vv](\d+(?:[._]\d+)*)__(.*)$/.exec(a);if(b)return{version:b[1].replace(/_/g,"."),name:l(b[2])};let c=/^(\d+(?:[-.]\d+)*)(?:[-_.\s]+(.*))?$/.exec(a);return c?{version:c[1],name:l(c[2]??"")}:{version:a,name:l(a)}}function l(a){return a.replace(/[-_]+/g," ").trim()}function m(a,b){let c=/(\d+)|(\D+)/g,d=a.match(c)??[],e=b.match(c)??[],f=Math.min(d.length,e.length);for(let a=0;a<f;a+=1){let b=d[a],c=e[a],f=/^\d+$/.test(b)&&/^\d+$/.test(c)?Number(b)-Number(c):b.localeCompare(c);if(0!==f)return f}return d.length-e.length}function n(a){let b=a.replace(/\r\n/g,"\n").trim(),c=0x811c9dc5,d=0x1000193;for(let a=0;a<b.length;a+=1){let e=b.charCodeAt(a);c=Math.imul(c^e,0x1000193)>>>0,d=Math.imul(d+e,0x85ebca6b)>>>0}return`${c.toString(16).padStart(8,"0")}${d.toString(16).padStart(8,"0")}`}function o(a){let b={applies:new Map,reverts:new Map,skipped:[],errors:[]},c=a.filter(a=>{var b;let c=j(b=a.path).at(-1)??b;return!c.startsWith(".")&&/\.sql$/i.test(c)});if(0===c.length)return b.errors.push("No .sql files in there."),b;let d=c.reduce((a,b)=>a+b.text.length,0);if(d>4e6)return b.errors.push(`That is ${s(d)} of SQL, over the ${s(4e6)} limit.`),b;let e=[];for(let a of c){if(a.text.length>5e5){b.skipped.push(`${a.path} — over ${s(5e5)}`);continue}if(a.text.includes("\0")){b.skipped.push(`${a.path} — not text`);continue}if(!a.text.trim()){b.skipped.push(`${a.path} — empty`);continue}e.push({file:a,...function(a){let b=j(a),c=(b.at(-1)??a).replace(/\.sql$/i,"");for(let a of b.slice(0,-1)){let b=a.toLowerCase();if(g.has(b))return{direction:"revert",stem:c};if(f.has(b))return{direction:"apply",stem:c}}let d=c.toLowerCase();for(let a of i)if(d.endsWith(a))return{direction:"revert",stem:c.slice(0,-a.length)};for(let a of h)if(d.endsWith(a))return{direction:"apply",stem:c.slice(0,-a.length)};return{direction:"apply",stem:c}}(a.path)})}let m=new Set,n=!1;for(let{direction:a,stem:b}of e){if("apply"!==a)continue;let{version:c}=k(b);m.has(c)&&(n=!0),m.add(c)}for(let{file:a,direction:c,stem:d}of e){let{version:e,name:f}=n?{version:d,name:l(d)}:k(d),g=("apply"===c?b.applies:b.reverts).get(e);if(g){b.skipped.push(`${a.path} — ${g.path} is already version ${e}`);continue}"apply"===c?b.applies.set(e,{path:a.path,sql:a.text,name:f}):b.reverts.set(e,{path:a.path,sql:a.text})}return 0===b.applies.size&&0===b.reverts.size&&b.errors.push("None of those .sql files could be read as a migration."),b}function p(a,b){let c=new Map(a.map(a=>[a.version,{...a}])),d=[...b.skipped],f=0,g=0,h=0;for(let[a,h]of b.applies){let b=c.get(a);if(b){b.applySql!==h.sql&&(g+=1),b.name=h.name||b.name,b.applyPath=h.path,b.applySql=h.sql,b.checksum=n(h.sql),b.transaction=(0,e.Ol)(h.sql).mode;continue}if(c.size>=500){d.push(`${h.path} — over 500 migrations`);continue}c.set(a,{version:a,name:h.name||a,applyPath:h.path,applySql:h.sql,checksum:n(h.sql),transaction:(0,e.Ol)(h.sql).mode}),f+=1}for(let[a,e]of b.reverts){let b=c.get(a);if(!b){d.push(`${e.path} — no migration ${a} to revert`);continue}b.revertPath=e.path,b.revertSql=e.sql,h+=1}return{steps:[...c.values()].sort((a,b)=>m(a.version,b.version)),added:f,updated:g,reverts:h,skipped:d}}function q(a){return{id:(0,d.z)(),name:r(a),importedAt:Date.now(),steps:[],skipped:[]}}function r(a){return a.trim().replace(/\s+/g," ").slice(0,80)||"Migrations"}function s(a){return a<1024?`${a} B`:a<1048576?`${Math.round(a/1024)} KB`:`${(a/1048576).toFixed(1)} MB`}function t(a,b){let c=[],f=[];for(let a of[...b].sort((a,b)=>m(a.version,b.version))){if(!a.applySql){c.push(a.version);continue}f.push({version:a.version,name:a.name||a.version,applyPath:`${a.version} (from the ledger)`,applySql:a.applySql,checksum:n(a.applySql),revertPath:a.revertSql?`${a.version} revert (from the ledger)`:void 0,revertSql:a.revertSql,transaction:(0,e.Ol)(a.applySql).mode})}return{set:{id:(0,d.z)(),name:r(a),importedAt:Date.now(),steps:f,skipped:[]},missing:c}}},60671:(a,b,c)=>{"use strict";c.d(b,{$C:()=>k,yG:()=>l});var d=c(19099),e=c(67484),f=c(21883),g=c(61159),h=c(13449),i=c(91732),j=c(44231);function k(){let a=(0,d.useRouter)(),b=(0,d.usePathname)(),{connection:c}=(0,j.k)(),k=(0,i.Z)(a=>a.connections);return(0,e.useCallback)(async d=>{if(d===c.id)return;let e=k.find(a=>a.id===d);if(!e)return;(0,g.r)();let i=(0,h.ZG)(b),j=!!c.layoutGroup&&c.layoutGroup===e.layoutGroup,l=!0;if("table"===i.kind&&!j)try{var m,n;m=await f.F.tables(e.url),n=i.table,l=m.some(a=>a.schema===n.schema&&a.name===n.name)}catch{l=!1}a.push((0,h.gZ)(b,d,{tableExists:l}))},[c.id,c.layoutGroup,k,b,a])}function l(){let{connection:a}=(0,j.k)(),b=(0,i.Z)(a=>a.connections),c=k(),d=function(a,b){let c=a.findIndex(a=>a.id===b);if(!(a.length<2)&&-1!==c)return a[(c+1)%a.length]}(b,a.id);return{run:()=>d?c(d.id):Promise.resolve(),enabled:void 0!==d,next:d}}},61159:(a,b,c)=>{"use strict";c.d(b,{T:()=>e,r:()=>f});let d=new Set;function e(a){return d.add(a),()=>{d.delete(a)}}function f(){for(let a of d)a()}},66280:(a,b,c)=>{"use strict";c.d(b,{Ss:()=>m,jV:()=>l,kG:()=>n,ox:()=>o});var d=c(31417),e=c(300),f=c(4106),g=c(56918),h=c(72428),i=c(14490),j=c(91732);let k={query:"",status:"all"},l=(0,d.v)()((0,e.Zr)((a,b)=>({sets:[],history:[],ledgerSchema:h.aC,setLedgerSchema:b=>{(0,h.hD)(b)&&a({ledgerSchema:b})},listFilters:{},setListFilter:(b,c)=>a(a=>({listFilters:{...a.listFilters,[b]:{...a.listFilters[b]??k,...c}}})),repoRoots:{},setRepoRoot:(b,c)=>a(a=>{let d={...a.repoRoots},e=c?.trim();return e?d[b]=e:delete d[b],(0,f.L)("migrations.folder",{set:!!e}),{repoRoots:d}}),createSet:b=>{let c=(0,g.mj)(b);return a(a=>({sets:[...a.sets,c]})),c.id},addFiles:(c,d)=>{let e=b().sets.find(a=>a.id===c),h=(0,g.Nz)(d),i=(0,g.Ai)(e?.steps??[],h);return e&&a(a=>({sets:a.sets.map(a=>a.id===c?{...a,steps:i.steps,skipped:i.skipped,importedAt:Date.now()}:a)})),(0,f.L)("migrations.import",{name:e?.name,added:i.added,updated:i.updated,reverts:i.reverts,skipped:i.skipped.length}),i},adoptSet:b=>(a(a=>({sets:[...a.sets,b]})),(0,f.L)("migrations.import",{name:b.name,migrations:b.steps.length,source:"ledger"}),b.id),renameSet:(b,c)=>{let d=c.trim().replace(/\s+/g," ").slice(0,80);d&&a(a=>({sets:a.sets.map(a=>a.id===b?{...a,name:d}:a)}))},setNote:(b,c)=>{let d=c.trim().slice(0,h.XG)||void 0;a(a=>({sets:a.sets.map(a=>a.id===b?{...a,note:d}:a)}))},removeStep:(b,c)=>a(a=>({sets:a.sets.map(a=>a.id===b?{...a,steps:a.steps.filter(a=>a.version!==c)}:a)})),removeSet:c=>{let d=b().sets.find(a=>a.id===c);a(a=>({sets:a.sets.filter(a=>a.id!==c)})),(0,f.L)("migrations.remove",{name:d?.name})},record:b=>a(a=>({history:[{...b,id:(0,i.z)(),ranAt:Date.now()},...a.history].slice(0,300)})),clearHistory:b=>a(a=>({history:b?a.history.filter(a=>a.setId!==b):[]}))}),{name:"ytdb:migrations"}));function m(a){return l(b=>b.sets.find(b=>b.id===a)??null)}function n(a){return l(b=>b.listFilters[a]??k)}function o(a){let b=(0,j.Z)(b=>b.connections.find(b=>b.id===a)?.layoutGroup??a),c=l(a=>a.repoRoots[b]??null);return{scope:b,root:c}}},67657:(a,b,c)=>{"use strict";c.d(b,{Ol:()=>i,TA:()=>j,qb:()=>k});let d=/^[ \t]*--+[ \t]*ytdb:[ \t]*no-?transaction\b/im,e=new Set(["begin","start"]),f=new Set(["commit","end"]),g=new Set(["rollback"]);function h(a){return void 0!==a&&(a>="A"&&a<="Z"||a>="a"&&a<="z"||"_"===a)||void 0!==a&&a>="0"&&a<="9"}function i(a){if(d.test(a))return{mode:"unwrapped",sql:a,atomic:!1};let b=function(a){let b=[],c=0,d=0,e=d=>{let e=function(a,b){let c=b;for(;c<a.length;){let b=a[c];if(" "===b||" "===b||"\n"===b||"\r"===b){c+=1;continue}if("-"===b&&"-"===a[c+1]){for(;c<a.length&&"\n"!==a[c];)c+=1;continue}if("/"===b&&"*"===a[c+1]){let b=a.indexOf("*/",c+2);c=-1===b?a.length:b+2;continue}break}return c}(a,c);if(e>=d)return;let f=e;for(;f<a.length&&h(a[f]);)f+=1;b.push({at:e,end:d,keyword:a.slice(e,f).toLowerCase()})};for(;d<a.length;){let b=a[d];if("-"===b&&"-"===a[d+1]){for(;d<a.length&&"\n"!==a[d];)d+=1;continue}if("/"===b&&"*"===a[d+1]){let b=a.indexOf("*/",d+2);d=-1===b?a.length:b+2;continue}if("'"===b||'"'===b){d=function(a,b,c){let d=b+1;for(;d<a.length;){if(a[d]===c){if(a[d+1]===c){d+=2;continue}return d+1}d+=1}return d}(a,d,b);continue}if("$"===b){let b=function(a,b){if("$"!==a[b])return null;let c=b+1;for(;c<a.length&&h(a[c]);)c+=1;return"$"!==a[c]?null:a.slice(b,c+1)}(a,d);if(b){let c=a.indexOf(b,d+b.length);d=-1===c?a.length:c+b.length;continue}}if(";"===b){e(d+1),d+=1,c=d;continue}d+=1}return e(a.length),b}(a),c=b.filter(a=>e.has(a.keyword)||f.has(a.keyword)||g.has(a.keyword));if(0===c.length)return{mode:"wrapped-by-ytdb",sql:a,atomic:!0};let i=b[0],j=b[b.length-1];return 2===c.length&&c[0]===i&&c[1]===j&&e.has(i.keyword)&&f.has(j.keyword)?{mode:"self-wrapped",sql:a.slice(0,i.at)+a.slice(i.end,j.at)+a.slice(j.end),atomic:!0}:{mode:"self-managed",sql:a,atomic:!1}}function j(a){switch(a){case"unwrapped":return"Marked `-- ytdb:no-transaction`, so it runs with no transaction. A failure partway leaves the statements before it applied.";case"self-managed":return"This file commits more than once, so YTDB runs it as written and records it afterwards. A failure partway can leave it half applied and unrecorded.";default:return null}}function k(a){return"unwrapped"===a?"no transaction":"self-managed"===a?"self-managed":null}},72428:(a,b,c)=>{"use strict";c.d(b,{R9:()=>e,XG:()=>g,aC:()=>d,hD:()=>f,km:()=>h});let d="maintenance",e="ytdb_migrations";function f(a){return"string"==typeof a&&a.length>0&&a.length<=63&&/^[A-Za-z_][A-Za-z0-9_$]*$/.test(a)}let g=2e4;function h(a){return a.startsWith("repo:")}},79820:(a,b,c)=>{"use strict";c.d(b,{V:()=>h});var d=c(48249),e=c(23171),f=c(82244),g=c(14490);function h({schemas:a,selected:b,onChange:c,compact:i=!1}){let j=null===b||b.length===a.length,k=null===b||b.length===a.length?"All schemas":0===b.length?"No schemas":1===b.length?b[0]:`${b.length} of ${a.length} schemas`;return(0,d.jsxs)(f.rI,{children:[i?(0,d.jsxs)(f.ty,{"aria-label":`Schemas: ${k}`,title:k,className:(0,g.cn)("flex h-6 shrink-0 cursor-pointer items-center gap-1 rounded-md px-1 text-[11px] tabular-nums outline-none transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 data-open:bg-foreground/10 data-open:text-foreground",j?"text-muted-foreground":"text-foreground"),children:[(0,d.jsx)(e.olY,{className:"size-3.5"}),!j&&(0,d.jsx)("span",{children:b.length})]}):(0,d.jsxs)(f.ty,{className:"group flex h-8 w-full cursor-pointer items-center gap-2 rounded-lg px-2 text-left text-[0.8rem] outline-none transition-colors hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/60 data-open:bg-muted/60",children:[(0,d.jsx)(e.olY,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:k}),(0,d.jsx)(e.RQe,{className:"size-3.5 shrink-0 text-muted-foreground transition-transform group-data-open:rotate-180"})]}),(0,d.jsx)(f.SQ,{align:i?"end":"start",sideOffset:6,className:(0,g.cn)("max-h-80 min-w-52",!i&&"w-(--anchor-width)"),children:(0,d.jsxs)(f.I,{children:[(0,d.jsx)(f.hO,{checked:j,onCheckedChange:a=>c(a?null:[]),children:"All schemas"}),(0,d.jsx)(f.mB,{}),a.map(e=>(0,d.jsx)(f.hO,{checked:j||(b?.includes(e)??!1),onCheckedChange:d=>{let f,g;return f=b??a,void c((g=d?[...new Set([...f,e])]:f.filter(a=>a!==e)).length===a.length?null:g)},children:(0,d.jsx)("span",{className:"truncate",children:e})},e))]})})]})}},82676:(a,b,c)=>{Promise.resolve().then(c.bind(c,34766))},93291:(a,b,c)=>{"use strict";function d(a,b){if(0===b)return!0;let c=a[b-1];return"_"===c||"-"===c||" "===c||"."===c}function e(a,b,c){return f(a,b,a=>[c(a)])}function f(a,b,c){if(!a.trim())return[];let e=[];for(let f of b){let b=c(f),g=null;for(let c of b){let b=function(a,b){let c=a.trim().toLocaleLowerCase(),e=b.toLocaleLowerCase();if(!c)return 0;if(0===e.length)return null;if(e===c)return 1e4;if(e.startsWith(c))return 5e3-e.length;let f=e.indexOf(c);if(-1!==f)return 2400+1200*!!d(b,f)-f-e.length;let g=0,h=0,i=0;for(let a=0;a<e.length&&g<c.length;a+=1){if(e[a]!==c[g]){i=0;continue}h+=12,(i+=1)>1&&(h+=18*i),d(b,a)&&(h+=40),g+=1}if(g<c.length)return null;let j=b.split(/[_\-\s.]+/).map(a=>a[0]??"").join("").toLocaleLowerCase();return j.startsWith(c)?h+=2200:j.includes(c)&&(h+=700),h-(e.length-c.length)}(a,c);null!==b&&(null===g||b>g)&&(g=b)}null!==g&&e.push({item:f,score:g})}return e.sort((a,b)=>b.score!==a.score?b.score-a.score:c(a.item)[0]?.localeCompare(c(b.item)[0]??"")??0)}c.d(b,{R6:()=>e,UO:()=>f})}};
|
|
1
|
+
exports.id=729,exports.ids=[729],exports.modules={1777:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(34766);async function f({children:a,params:b}){let{connectionId:c}=await b;return(0,d.jsx)(e.ExplorerShell,{connectionId:c,children:a})}},1814:(a,b,c)=>{"use strict";c.d(b,{L:()=>g});var d=c(48249),e=c(23171),f=c(14490);function g({trailing:a,className:b,...c}){return(0,d.jsxs)("div",{className:(0,f.cn)("flex h-8 items-center gap-1.5 rounded-lg px-2 text-muted-foreground transition-colors focus-within:bg-muted/60 hover:bg-muted/60",b),children:[(0,d.jsx)(e.TfF,{className:"size-3.5 shrink-0"}),(0,d.jsx)("input",{type:"text",spellCheck:!1,autoComplete:"off",...c,className:"h-full min-w-0 flex-1 bg-transparent text-[0.8rem] text-foreground outline-none placeholder:text-muted-foreground"}),a]})}},8508:(a,b,c)=>{"use strict";c.d(b,{Ar:()=>d,US:()=>h,s5:()=>j,tT:()=>k,vI:()=>i});let d={commandPalette:"⌘⇧P",tableSearch:"⌘P",columnSearch:"⌘/",sqlEditor:"⌘E",switchConnection:"⌘⇧E",compareSchema:"⌘⇧D",migrations:"⌘⇧M",back:"⌘[",forward:"⌘]"};function e(){let a=new Set;return{register:b=>(a.add(b),()=>{a.delete(b)}),open(){for(let b of a)b()}}}let f=e(),g=e(),h=f.register,i=f.open,j=g.register,k=g.open},13449:(a,b,c)=>{"use strict";function d(a){let b=a.split("/").filter(Boolean).map(decodeURIComponent);if(0===b.length)return{kind:"home"};let[c,d,e]=b;if(1===b.length)return{kind:"connection",connectionId:c};if(2===b.length){if("query"===d)return{kind:"query",connectionId:c};if("diff"===d)return{kind:"diff",connectionId:c};if("migrations"===d)return{kind:"migrations",connectionId:c}}return 3===b.length?"migrations"===d?{kind:"migration",connectionId:c,setId:e}:{kind:"table",connectionId:c,table:{schema:d,name:e}}:{kind:"connection",connectionId:c}}function e(a){let b=encodeURIComponent;switch(a.kind){case"home":return"/";case"connection":return`/${b(a.connectionId)}`;case"query":case"diff":case"migrations":return`/${b(a.connectionId)}/${a.kind}`;case"migration":return`/${b(a.connectionId)}/migrations/${b(a.setId)}`;case"table":return`/${b(a.connectionId)}/${b(a.table.schema)}/${b(a.table.name)}`}}function f(a,b,{tableExists:c=!0}={}){let g=d(a);return"home"!==g.kind&&("table"!==g.kind||c)?e({...g,connectionId:b}):e({kind:"connection",connectionId:b})}c.d(b,{Jn:()=>e,ZG:()=>d,gZ:()=>f})},13656:(a,b,c)=>{"use strict";c.d(b,{E:()=>f});var d=c(48249),e=c(14490);function f({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"skeleton",className:(0,e.cn)("animate-pulse rounded-md bg-muted",a),...b})}},20886:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(67484);function e(a,b){let[c,e]=(0,d.useState)(0),[f,g]=(0,d.useState)({key:"",error:null}),h=`${c}:${a}`,i=(0,d.useCallback)(()=>e(a=>a+1),[]),j=f.key!==h;return{data:f.data,error:j?null:f.error,loading:j,reload:i}}},21883:(a,b,c)=>{"use strict";c.d(b,{F:()=>f});var d=c(16950);async function e(a,b,c){let e,f=await (0,d.Qv)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b),signal:c}),g=await f.text();if(!g)throw Error(`YTDB bridge returned an empty response (HTTP ${f.status}). Restart YTDB to update the local bridge.`);try{e=JSON.parse(g)}catch{if(404===f.status)throw Error("The YTDB running on your machine is older than this page and does not know this request. Restart it with `npx @theobourgeois/ytdb@latest`.");throw Error(`YTDB bridge returned an invalid response (HTTP ${f.status}).`)}if(!f.ok)throw Error((e&&"object"==typeof e&&"error"in e&&"string"==typeof e.error?e.error:f.statusText)||`YTDB bridge request failed with HTTP ${f.status}.`);return e}let f={tables:(a,b)=>e("/api/tables",{connectionUrl:a},b),rows:(a,b,c)=>e("/api/rows",{connectionUrl:a,query:b},c),query:(a,b,c)=>e("/api/query",{connectionUrl:a,sql:b},c),updateCell:(a,b,c)=>e("/api/cell",{connectionUrl:a,update:b},c),insertRow:(a,b,c)=>e("/api/insert-row",{connectionUrl:a,insertion:b},c),updateRow:(a,b,c)=>e("/api/update-row",{connectionUrl:a,update:b},c),deleteRows:(a,b,c)=>e("/api/delete-rows",{connectionUrl:a,deletion:b},c),related:(a,b,c)=>e("/api/related",{connectionUrl:a,lookups:b},c),lookup:(a,b,c)=>e("/api/lookup",{connectionUrl:a,query:b},c),definition:(a,b,c)=>e("/api/definition",{connectionUrl:a,table:b},c),schema:(a,b)=>e("/api/schema",{connectionUrl:a},b),ledger:(a,b,c,d=!1)=>e("/api/ledger",{connectionUrl:a,ledgerSchema:b,withSql:d},c),migrate:(a,b,c)=>e("/api/migrate",{connectionUrl:a,migration:b},c),adopt:(a,b,c)=>e("/api/adopt",{connectionUrl:a,adopt:b},c),detect:(a,b,c)=>e("/api/detect",{connectionUrl:a,migrations:b},c),repo:(a,b,c)=>e("/api/repo",{root:a,checkout:b},c),note:(a,b,c,d)=>e("/api/note",{root:a,path:b,note:c},d)}},34766:(a,b,c)=>{"use strict";c.d(b,{ExplorerShell:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ExplorerShell() from the server but ExplorerShell is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/theobourgeois/code/db-studio/src/components/explorer/explorer-shell.tsx","ExplorerShell")},35412:(a,b,c)=>{Promise.resolve().then(c.bind(c,53371))},43189:(a,b,c)=>{"use strict";c.d(b,{Q:()=>j});var d=c(19099),e=c(67484),f=c(91732),g=c(66280),h=c(43851),i=c(13449);function j(a){let b,c,j=(0,d.useRouter)(),k=(0,h.c)(a=>a.entries),l=(0,h.c)(a=>a.index),m=(b=(0,f.Z)(a=>a.connections),c=(0,g.jV)(a=>a.sets),(0,e.useCallback)((a,d)=>{let e=a=>b.find(b=>b.id===a)?.name??a,f="connectionId"in a&&a.connectionId!==d?` \xb7 ${e(a.connectionId)}`:"";switch(a.kind){case"home":return"Connections";case"connection":return e(a.connectionId);case"query":return`SQL query${f}`;case"diff":return`Compare schema${f}`;case"migrations":return`Migrations${f}`;case"migration":return`${c.find(b=>b.id===a.setId)?.name??"Migration"}${f}`;case"table":return`${a.table.name}${f}`}},[b,c]));return(0,e.useMemo)(()=>{let b=b=>{let c=k[b];if(void 0===c)return null;let d=(0,i.ZG)(c);return{href:c,route:d,label:m(d,a)}},c=b(l-1),d=b(l+1);return{back:c,forward:d,goBack:()=>{c&&j.back()},goForward:()=>{d&&j.forward()}}},[k,l,m,a,j])}},44231:(a,b,c)=>{"use strict";c.d(b,{Z:()=>i,k:()=>j});var d=c(48249),e=c(67484),f=c(21883),g=c(20886);let h=(0,e.createContext)(null);function i({connection:a,children:b}){let c=(0,g.Y)(a.url,b=>f.F.tables(a.url,b));return(0,d.jsx)(h.Provider,{value:{connection:a,tables:c},children:b})}function j(){let a=(0,e.useContext)(h);if(!a)throw Error("useExplorerContext must be used inside ExplorerProvider");return a}},53286:(a,b,c)=>{"use strict";c.d(b,{F:()=>k});var d=c(48249);c(67484);var e=c(99058),f=c(40336),g=c(69856),h=c(18656),i=c(41764),j=c(14490);function k({className:a,children:b,...c}){return(0,d.jsxs)(e.V,{"data-slot":"scroll-area",className:(0,j.cn)("relative",a),...c,children:[(0,d.jsx)(f.B,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:b}),(0,d.jsx)(l,{}),(0,d.jsx)(g.I,{})]})}function l({className:a,orientation:b="vertical",...c}){return(0,d.jsx)(h.V,{"data-slot":"scroll-area-scrollbar","data-orientation":b,orientation:b,className:(0,j.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",a),...c,children:(0,d.jsx)(i.l,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}},53371:(a,b,c)=>{"use strict";c.d(b,{ExplorerShell:()=>ac});var d=c(48249),e=c(2116),f=c.n(e),g=c(23171),h=c(25297),i=c(98609),j=c(91732),k=c(99598),l=c(78260),m=c(44231),n=c(19099),o=c(67484),p=c(53286),q=c(1814),r=c(13656),s=c(8508),t=c(89366),u=c(14490),v=c(82244),w=c(30770),x=c(60671);function y({current:a}){let b=(0,j.Z)(a=>a.connections),c=(0,x.$C)();return(0,d.jsxs)(v.rI,{children:[(0,d.jsxs)(v.ty,{className:"flex h-8 w-full items-center justify-between gap-2 rounded-lg px-2 text-left font-medium outline-none hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50 data-open:bg-muted/60",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)(w.F,{connection:a}),(0,d.jsx)("span",{className:"truncate",children:a.name}),a.layoutGroup&&(0,d.jsx)(g.WnQ,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),(0,d.jsx)(g.klM,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),(0,d.jsxs)(v.SQ,{align:"start",className:"w-(--anchor-width)",children:[b.map(b=>(0,d.jsxs)(v._2,{onClick:()=>void c(b.id),className:b.id===a.id?"font-medium":void 0,children:[(0,d.jsx)(w.F,{connection:b}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:b.name}),b.layoutGroup&&b.layoutGroup===a.layoutGroup&&(0,d.jsx)(g.WnQ,{className:"size-3.5 shrink-0 text-muted-foreground"})]},b.id)),(0,d.jsx)(v.mB,{}),(0,d.jsx)(v._2,{render:(0,d.jsx)(f(),{href:"/"}),children:"Manage connections"})]})]})}var z=c(79820);function A(a,b){let c=a.trim(),d=c.lastIndexOf(".");return -1===d?c:"schema"===b?c.slice(0,d):c.slice(d+1)}function B({text:a,query:b}){if(!b)return a;let c=[],e=a.toLocaleLowerCase(),f=b.toLocaleLowerCase(),g=0,h=e.indexOf(f);if(-1===h)return a;for(;-1!==h;)h>g&&c.push(a.slice(g,h)),c.push((0,d.jsx)("mark",{className:"rounded-[3px] bg-yellow-300/90 px-px text-yellow-950 dark:bg-yellow-400/85 dark:text-yellow-950",children:a.slice(h,h+b.length)},h)),g=h+b.length,h=e.indexOf(f,g);return g<a.length&&c.push(a.slice(g)),c}function C({connectionId:a,table:b,search:c,pinned:e,showSchema:h,active:i,reorderable:j,dragging:k,dropEdge:l,onTogglePin:m,onDragStart:n,onDragOver:o,onDrop:p,onDragEnd:q,onMove:r}){return(0,d.jsxs)("li",{onDragOver:o,onDrop:p,className:(0,u.cn)("group/table-row relative flex h-7 items-center rounded-md text-[13px] transition-[color,background-color,opacity] hover:bg-muted/60",i&&"bg-muted text-foreground",!i&&"text-foreground/80",k&&"opacity-45","before"===l&&"before:absolute before:inset-x-1 before:top-0 before:z-10 before:h-0.5 before:-translate-y-1/2 before:rounded-full before:bg-primary","after"===l&&"after:absolute after:inset-x-1 after:bottom-0 after:z-10 after:h-0.5 after:translate-y-1/2 after:rounded-full after:bg-primary"),children:[j&&(0,d.jsx)("button",{type:"button",draggable:!0,"aria-label":`Reorder ${b.schema}.${b.name}`,title:"Drag to reorder; use Up and Down arrow keys",onDragStart:n,onDragEnd:q,onKeyDown:a=>{("ArrowUp"===a.key||"ArrowDown"===a.key)&&(a.preventDefault(),r?.("ArrowUp"===a.key?-1:1))},className:"ml-1.5 flex size-5 shrink-0 cursor-grab touch-none items-center justify-center rounded text-muted-foreground opacity-50 outline-none transition-[color,background-color,opacity] hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:opacity-100 active:cursor-grabbing",children:(0,d.jsx)(g.Mvf,{className:"size-3.5"})}),(0,d.jsxs)(f(),{href:`/${a}/${encodeURIComponent(b.schema)}/${encodeURIComponent(b.name)}`,className:(0,u.cn)("flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/60",j?"pl-1":"pl-6"),children:[(0,d.jsx)("span",{className:"truncate",children:(0,d.jsx)(B,{text:b.name,query:A(c,"table")})}),h?(0,d.jsx)("span",{className:"ml-auto max-w-20 truncate text-[10px] text-muted-foreground",children:b.schema}):"view"===b.kind&&(0,d.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:"view"})]}),(0,d.jsx)("button",{type:"button","aria-label":`${e?"Unpin":"Pin"} ${b.schema}.${b.name}`,"aria-pressed":e,title:e?"Unpin table":"Pin table",onClick:()=>m(b),className:(0,u.cn)("mr-0.5 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 outline-none transition-[color,background-color,opacity] hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:opacity-100 group-hover/table-row:opacity-100",e&&"text-foreground"),children:e?(0,d.jsx)(g.M0d,{className:"size-3.5"}):(0,d.jsx)(g.rq5,{className:"size-3.5"})})]})}function D({label:a,count:b,collapsed:c,pinned:e,search:f,onToggle:h}){return(0,d.jsxs)("button",{type:"button","aria-expanded":!c,onClick:h,className:"flex h-7 w-full cursor-pointer items-center gap-1 rounded-md px-1 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60",children:[(0,d.jsx)(g.nNJ,{className:(0,u.cn)("size-3.5 transition-transform",!c&&"rotate-90")}),e&&(0,d.jsx)(g.M0d,{className:"mr-0.5 size-3"}),(0,d.jsx)("span",{className:"truncate",children:e?a:(0,d.jsx)(B,{text:a,query:A(f,"schema")})}),(0,d.jsx)("span",{className:"ml-auto pr-1 tabular-nums opacity-60",children:b})]})}function E({connectionId:a,tables:b,search:c,collapsedSchemas:e,pinnedTables:f,onToggleSchema:g,onTogglePin:h,onReorderPinned:i}){let j=(0,n.useParams)(),[k,l]=(0,o.useState)(!1),[m,p]=(0,o.useState)(null),[q,r]=(0,o.useState)(null),s=new Map(b.map(a=>[(0,t.i)(a),a])),u=f.flatMap(a=>{let b=s.get(a);return b?[b]:[]});function v(){p(null),r(null)}return 0===b.length?(0,d.jsx)("p",{className:"px-3 py-8 text-center text-xs text-muted-foreground",children:c.trim()?"No tables match your search":"No tables in these schemas"}):(0,d.jsxs)("div",{className:"flex flex-col gap-1 px-2 pb-4",children:[u.length>0&&(0,d.jsxs)("div",{className:"mb-1 border-b border-border/60 pb-1",children:[(0,d.jsx)(D,{label:"Pinned tables",count:u.length,collapsed:k,pinned:!0,search:c,onToggle:()=>l(a=>!a)}),!k&&(0,d.jsx)("ul",{children:u.map(b=>{let e=(0,t.i)(b);return(0,d.jsx)(C,{connectionId:a,table:b,search:c,pinned:!0,showSchema:!0,active:j.schema===b.schema&&j.table===b.name,reorderable:!0,dragging:m===e,dropEdge:q?.key===e?q.edge:null,onTogglePin:h,onDragStart:a=>{a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",e),p(e),r(null)},onDragOver:a=>(function(a,b){if(!m||m===b)return;a.preventDefault(),a.dataTransfer.dropEffect="move";let c=a.currentTarget.getBoundingClientRect(),d=a.clientY<c.top+c.height/2?"before":"after";r(a=>a?.key===b&&a.edge===d?a:{key:b,edge:d})})(a,e),onDrop:a=>{let b,c;return a.preventDefault(),b=m??a.dataTransfer.getData("text/plain"),c=q?.key===e?q.edge:"before",void(b&&i(b,e,c),v())},onDragEnd:v,onMove:a=>{let b,c;return b=u.findIndex(a=>(0,t.i)(a)===e),void((c=u[b+a])&&i(e,(0,t.i)(c),-1===a?"before":"after"))}},e)})})]}),(function(a){let b=new Map;for(let c of a)b.set(c.schema,[...b.get(c.schema)??[],c]);return[...b.entries()].sort(([a],[b])=>{let c;return((c=new Map([["public",0],["auth",1]])).get(a)??2)-(c.get(b)??2)||a.localeCompare(b)})})(b).map(([b,i])=>{let k=e.includes(b);return(0,d.jsxs)("div",{children:[(0,d.jsx)(D,{label:b,count:i.length,collapsed:k,search:c,onToggle:()=>g(b)}),!k&&(0,d.jsx)("ul",{children:i.map(b=>(0,d.jsx)(C,{connectionId:a,table:b,search:c,pinned:f.includes((0,t.i)(b)),active:j.schema===b.schema&&j.table===b.name,onTogglePin:h},(0,t.i)(b)))})]},b)})]})}function F(a){return Math.min(480,Math.max(180,Math.round(a)))}function G(a,b){let c=new Map([["public",0],["auth",1]]);return(c.get(a)??2)-(c.get(b)??2)||a.localeCompare(b)}function H(a,b,c){let d=b.trim().toLocaleLowerCase();return a.filter(a=>(null===c||!!c.includes(a.schema))&&(!d||a.name.toLocaleLowerCase().includes(d)||`${a.schema}.${a.name}`.toLocaleLowerCase().includes(d)))}function I({href:a,active:b,shortcut:c,children:e}){return(0,d.jsxs)(f(),{href:a,"aria-current":b?"page":void 0,className:(0,u.cn)((0,h.r)({variant:b?"secondary":"ghost",size:"sm"}),"h-8 w-full justify-start px-2"),children:[e,(0,d.jsx)("kbd",{className:"ml-auto font-mono text-[10px] text-muted-foreground/55",children:c})]})}function J({width:a,onWidthChange:b,onCollapse:c}){let e=(0,n.usePathname)(),{connection:f,tables:i}=(0,m.k)(),[l,u]=(0,k.DE)(f.id),v=(0,j.Z)(a=>a.connections.length>1),[w,x]=(0,o.useState)(()=>F(a)),A=(0,o.useRef)(null),B=(0,o.useMemo)(()=>[...new Set((i.data??[]).map(a=>a.schema))].sort(G),[i.data]),C=(0,o.useMemo)(()=>null===l.selectedSchemas?null:l.selectedSchemas.filter(a=>B.includes(a)),[l.selectedSchemas,B]),D=(0,o.useMemo)(()=>H(i.data??[],l.search,C),[i.data,l.search,C]),K=`/${encodeURIComponent(f.id)}`,L=`${K}/query`,M=`${K}/diff`,N=`${K}/migrations`;function O(a,b){let c=new Set(H(i.data??[],a,b).map(a=>a.schema));return l.collapsedSchemas.filter(a=>!c.has(a))}return(0,d.jsxs)("aside",{id:"database-explorer-sidebar",style:{width:w},className:"relative flex h-full shrink-0 flex-col border-r bg-sidebar",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 border-b border-sidebar-border/60 p-2",children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center gap-1",children:[(0,d.jsx)("div",{className:"min-w-0 flex-1",children:(0,d.jsx)(y,{current:f})}),(0,d.jsx)(h.$,{variant:"ghost",size:"icon-sm","aria-label":"Collapse database sidebar",title:"Collapse sidebar",onClick:c,children:(0,d.jsx)(g.cFu,{})})]}),(0,d.jsxs)(I,{href:L,active:e===L,shortcut:s.Ar.sqlEditor,children:[(0,d.jsx)(g.Uoo,{"data-icon":"inline-start"}),"SQL query"]}),(0,d.jsxs)(I,{href:N,active:e===N||e.startsWith(`${N}/`),shortcut:s.Ar.migrations,children:[(0,d.jsx)(g.olY,{"data-icon":"inline-start"}),"Migrations"]}),v&&(0,d.jsxs)(I,{href:M,active:e===M,shortcut:s.Ar.compareSchema,children:[(0,d.jsx)(g.R4X,{"data-icon":"inline-start"}),"Compare schema"]}),(0,d.jsx)(q.L,{value:l.search,onChange:a=>{var b;u({search:b=a.target.value,collapsedSchemas:b.trim()?O(b,C):l.collapsedSchemas})},placeholder:"Search tables","aria-label":"Search tables",className:"mt-1",trailing:(0,d.jsxs)(d.Fragment,{children:[!l.search&&(0,d.jsx)("kbd",{className:"font-mono text-[10px] text-muted-foreground/55",children:s.Ar.tableSearch}),(0,d.jsx)(z.V,{compact:!0,schemas:B,selected:C,onChange:function(a){u({selectedSchemas:a,collapsedSchemas:l.search.trim()?O(l.search,a):l.collapsedSchemas})}})]})})]}),(0,d.jsx)(p.F,{className:"min-h-0 flex-1 pt-1.5",children:i.error?(0,d.jsx)("p",{className:"px-3 py-4 text-xs text-destructive",children:i.error}):i.data?(0,d.jsx)(E,{connectionId:f.id,tables:D,search:l.search,collapsedSchemas:l.collapsedSchemas,pinnedTables:l.pinnedTables,onToggleSchema:function(a){u({collapsedSchemas:l.collapsedSchemas.includes(a)?l.collapsedSchemas.filter(b=>b!==a):[...l.collapsedSchemas,a]})},onTogglePin:function(a){let b=(0,t.i)(a);u({pinnedTables:l.pinnedTables.includes(b)?l.pinnedTables.filter(a=>a!==b):[...l.pinnedTables,b]})},onReorderPinned:function(a,b,c){if(a===b)return;let d=l.pinnedTables.filter(b=>b!==a),e=d.indexOf(b);-1!==e&&(d.splice(e+ +("after"===c),0,a),u({pinnedTables:d}))}}):(0,d.jsx)("div",{className:"flex flex-col gap-2 px-3 py-2",children:Array.from({length:8},(a,b)=>(0,d.jsx)(r.E,{className:"h-5 w-full"},b))})}),(0,d.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize database sidebar","aria-valuemin":180,"aria-valuemax":480,"aria-valuenow":w,tabIndex:0,title:"Drag to resize; double-click to reset",onPointerDown:function(a){a.preventDefault(),A.current={pointerId:a.pointerId,startX:a.clientX,startWidth:w},a.currentTarget.setPointerCapture(a.pointerId)},onPointerMove:function(a){let b=A.current;b&&b.pointerId===a.pointerId&&(a.preventDefault(),x(F(b.startWidth+a.clientX-b.startX)))},onPointerUp:function(a){let c=A.current;if(!c||c.pointerId!==a.pointerId)return;let d=F(c.startWidth+a.clientX-c.startX);A.current=null,x(d),a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId),b(d)},onPointerCancel:function(a){let c=A.current;c&&c.pointerId===a.pointerId&&(A.current=null,a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId),b(w))},onKeyDown:function(a){if("ArrowLeft"!==a.key&&"ArrowRight"!==a.key)return;a.preventDefault();let c=F(w+("ArrowLeft"===a.key?-1:1)*16);x(c),b(c)},onDoubleClick:function(a){a.preventDefault(),x(256),b(256)},className:"group/resize absolute inset-y-0 -right-1 z-30 w-2 cursor-col-resize touch-none outline-none after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-transparent after:transition-colors hover:after:bg-primary focus-visible:after:bg-primary"})]})}var K=c(89267),L=c(16280),M=c(61561);c(61159);var N=c(93291);function O(a,{nested:b=!1}={}){let c=(0,n.useRouter)(),d=(0,n.usePathname)(),{connection:e,tables:f}=(0,m.k)(),[g]=(0,k.DE)(e.id),h=`/${encodeURIComponent(e.id)}`,i=`${h}/${a}`,j=b?d===i||d.startsWith(`${i}/`):d===i;return{open:j,href:i,toggle:()=>c.push(j?function(){for(let a of g.recentTables){let b=(f.data??[]).find(b=>(0,t.i)(b)===a);if(b)return`${h}/${encodeURIComponent(b.schema)}/${encodeURIComponent(b.name)}`}return h}():i)}}function P(){let a=O("migrations",{nested:!0});return{open:a.open,migrationsHref:a.href,toggle:a.toggle}}var Q=c(43189);function R(){let a=O("diff");return{open:a.open,diffHref:a.href,toggle:a.toggle}}function S(){let a=O("query");return{open:a.open,queryHref:a.href,toggle:a.toggle}}function T({text:a,query:b}){if(!b)return a;let c=a.toLocaleLowerCase(),e=b.toLocaleLowerCase(),f=c.indexOf(e);return -1===f?a:(0,d.jsxs)(d.Fragment,{children:[a.slice(0,f),(0,d.jsx)("mark",{className:"rounded-[3px] bg-yellow-300/90 px-px text-yellow-950 dark:bg-yellow-400/85 dark:text-yellow-950",children:a.slice(f,f+b.length)}),a.slice(f+b.length)]})}async function U(a){try{await navigator.clipboard.writeText(a)}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}}function V(){let a=(0,n.useRouter)(),b=(0,n.useParams)(),{connection:c,tables:e}=(0,m.k)(),f=S(),h=R(),i=P(),l=(0,k.y3)(c.id),p=(0,x.yG)(),q=(0,Q.Q)(c.id),r=(0,j.Z)(a=>a.add),[v,w]=(0,k.DE)(c.id),[y,z]=(0,o.useState)(!1),[A,B]=(0,o.useState)("commands"),[C,D]=(0,o.useState)(""),[E,F]=(0,o.useState)(0),[G,H]=(0,o.useState)(!1),I=(0,o.useRef)(null),J=(0,o.useRef)(null),O=(0,o.useRef)(null),V=(0,o.useRef)(A),W=(0,L.C)(a=>a.theme),X=b.schema&&b.table?{schema:decodeURIComponent(b.schema),name:decodeURIComponent(b.table)}:null,Y=!!X&&v.pinnedTables.includes((0,t.i)(X)),Z=(0,k.lz)(a=>X?a.tables[`${c.id}:${(0,t.i)(X)}`]:void 0),$=(0,o.useMemo)(()=>[{id:"sql-editor",title:f.open?"Back to Table":"Open SQL Query",keywords:["new","query","sql","console","editor","close","back","table"],enabled:!0,shortcut:s.Ar.sqlEditor,run:()=>f.toggle()},{id:"go-back",title:q.back?`Back to ${q.back.label}`:"Back",keywords:["back","previous","return","history","undo"],enabled:null!==q.back,shortcut:s.Ar.back,run:()=>q.goBack()},{id:"go-forward",title:q.forward?`Forward to ${q.forward.label}`:"Forward",keywords:["forward","next","history","redo"],enabled:null!==q.forward,shortcut:s.Ar.forward,run:()=>q.goForward()},{id:"switch-connection",title:p.next?`Switch Connection (${p.next.name})`:"Switch Connection",keywords:["database","env","environment","next","cycle","other"],enabled:p.enabled,shortcut:s.Ar.switchConnection,run:()=>void p.run()},{id:"migrations",title:i.open?"Back to Table":"Open Migrations",keywords:["migration","migrate","apply","revert","rollback","ledger","schema","run"],enabled:!0,shortcut:s.Ar.migrations,run:()=>i.toggle()},{id:"compare-schema",title:l.target?`Compare Schema with ${l.target.name}`:"Compare Schema",keywords:["diff","difference","migration","drift","prod","dev","schema","compare"],enabled:null!==l.target,shortcut:s.Ar.compareSchema,run:()=>h.toggle()},{id:"search-tables",title:"Search Tables",keywords:["find","jump","open","goto","table"],enabled:!0,shortcut:s.Ar.tableSearch,run:()=>window.requestAnimationFrame(()=>(0,s.tT)())},{id:"search-columns",title:"Search Columns",keywords:["find","jump","goto","column","field"],enabled:null!==X,shortcut:s.Ar.columnSearch,run:()=>window.requestAnimationFrame(()=>(0,s.vI)())},{id:"reload-tables",title:"Reload Tables",keywords:["refresh","reload","tables","sync"],enabled:!0,run:()=>e.reload()},{id:"pin-table",title:Y?"Unpin Table":"Pin Table",keywords:["pin","unpin","favorite","star"],enabled:null!==X,run:()=>{if(!X)return;let a=(0,t.i)(X);w({pinnedTables:v.pinnedTables.includes(a)?v.pinnedTables.filter(b=>b!==a):[...v.pinnedTables,a]})}},{id:"clear-filters",title:"Clear Filters",keywords:["filter","reset","remove"],enabled:null!==X,run:()=>{X&&k.lz.getState().setTable(c.id,X,{filters:[],page:0})}},{id:"clear-search",title:"Clear Search",keywords:["find","search","reset"],enabled:null!==X&&!!Z?.search,run:()=>{X&&k.lz.getState().setTable(c.id,X,{search:"",page:0})}},{id:"reset-columns",title:"Reset Columns",keywords:["pin","hide","frozen","layout","show"],enabled:null!==X,run:()=>{X&&k.lz.getState().setTable(c.id,X,{pinnedColumns:void 0,hiddenColumns:[]})}},{id:"copy-table",title:"Copy Schema.Table",keywords:["copy","name","qualified"],enabled:null!==X,run:()=>{X&&U((0,t.i)(X))}},{id:"color-theme",title:"Color Theme",keywords:["theme","appearance","dark","light","color","set","preferences"],enabled:!0,keepOpen:!0,run:()=>{let a=L.C.getState().theme,b=M.zG.findIndex(b=>b.id===a);B("themes"),D(""),F(-1===b?0:b)}},{id:"add-connection",title:"Add Connection",keywords:["new","database","postgres"],enabled:!0,run:()=>H(!0)}],[v.pinnedTables,l.target,c.id,q,i,Y,h,w,f,p,X,Z?.search,e]),_=(0,o.useMemo)(()=>C.trim()?(0,N.R6)(C,$,a=>[a.title,...a.keywords].join(" ")).map(a=>a.item):$,[$,C]),aa=(0,o.useMemo)(()=>C.trim()?(0,N.R6)(C,[...M.zG],a=>[a.name,...a.keywords].join(" ")).map(a=>a.item):[...M.zG],[C]),ab="themes"===A?aa:_,ac="commands"===A?_[E]??null:null,ad="themes"===A?aa[E]??null:null;function ae(a){a?.revertTheme&&"themes"===V.current&&(0,M.AZ)(L.C.getState().theme),z(!1),D(""),F(0),B("commands")}function af(a){a.enabled&&(a.keepOpen||ae({revertTheme:!0}),a.run())}function ag(a){L.C.getState().setTheme(a.id),(0,M.AZ)(a.id),ae({revertTheme:!1})}return(0,d.jsxs)(d.Fragment,{children:[y&&(0,d.jsxs)("div",{ref:J,"data-command-palette":"",className:"fixed top-3 left-1/2 z-50 flex w-[min(36rem,calc(100%-1.5rem))] -translate-x-1/2 flex-col overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ring-1 ring-foreground/10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b px-3",children:[(0,d.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:">"}),(0,d.jsx)("input",{ref:I,value:C,onChange:a=>D(a.target.value),onKeyDown:function(a){if("ArrowDown"===a.key){if(a.preventDefault(),0===ab.length)return;F(a=>(a+1)%ab.length);return}if("ArrowUp"===a.key){if(a.preventDefault(),0===ab.length)return;F(a=>(a-1+ab.length)%ab.length);return}if("Enter"===a.key){if(a.preventDefault(),"themes"===A){ad&&ag(ad);return}ac&&af(ac)}},spellCheck:!1,autoComplete:"off",autoCorrect:"off",placeholder:"themes"===A?"Select color theme":"Type a command","aria-label":"themes"===A?"Color theme":"Command palette",className:"h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),(0,d.jsx)("div",{ref:O,role:"listbox","aria-label":"themes"===A?"Color themes":"Commands",className:"max-h-[min(24rem,50vh)] overflow-auto py-1",children:0===ab.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"themes"===A?"No matching themes":"No matching commands"}):"themes"===A?aa.map((a,b)=>{let c=b===E,e=a.id===W;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"data-active":c||void 0,onMouseEnter:()=>F(b),onClick:()=>ag(a),className:(0,u.cn)("flex h-8 w-full cursor-pointer items-center gap-2 px-3 text-left text-[13px] outline-none",c&&"bg-primary/10"),children:[(0,d.jsx)("span",{"aria-hidden":!0,className:"size-3.5 shrink-0 rounded-sm border",style:{background:a.swatch}}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:(0,d.jsx)(T,{text:a.name,query:C.trim()})}),e&&(0,d.jsx)(g.wiW,{className:"ml-auto size-3.5 shrink-0 text-muted-foreground"})]},a.id)}):_.map((a,b)=>{let c=b===E;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"aria-disabled":!a.enabled,"data-active":c||void 0,onMouseEnter:()=>F(b),onClick:()=>af(a),className:(0,u.cn)("flex h-8 w-full cursor-pointer items-center px-3 text-left text-[13px] outline-none",c&&"bg-primary/10",!a.enabled&&"cursor-default opacity-40"),children:[(0,d.jsx)("span",{className:"min-w-0 truncate",children:(0,d.jsx)(T,{text:a.title,query:C.trim()})}),a.shortcut&&(0,d.jsx)("kbd",{className:"ml-auto shrink-0 pl-3 font-mono text-[11px] text-muted-foreground/70",children:a.shortcut})]},a.id)})})]}),(0,d.jsx)(K.f,{open:G,onOpenChange:H,onSubmit:b=>{let{shareWith:c,...d}=b,e=r(d);(0,k.mQ)(e.id,c),a.push(`/${e.id}`)}})]})}function W(){let{toggle:a}=S(),{toggle:b}=R(),{toggle:c}=P(),{run:d}=(0,x.yG)(),e=(0,Q.Q)(),f=(0,j.Z)(a=>a.connections.length>1);return(0,o.useRef)(a),(0,o.useRef)(b),(0,o.useRef)(c),(0,o.useRef)(d),(0,o.useRef)(e),(0,o.useRef)(f),null}c(21883);let X={pinned:"Pinned",recent:"Recent",tables:"Tables",connections:"Connections"};function Y({text:a,query:b}){if(!b)return a;let c=a.toLocaleLowerCase(),e=b.toLocaleLowerCase(),f=c.indexOf(e);return -1===f?a:(0,d.jsxs)(d.Fragment,{children:[a.slice(0,f),(0,d.jsx)("mark",{className:"rounded-[3px] bg-yellow-300/90 px-px text-yellow-950 dark:bg-yellow-400/85 dark:text-yellow-950",children:a.slice(f,f+b.length)}),a.slice(f+b.length)]})}function Z(a){try{return new URL(a).hostname}catch{return""}}function $(a){return[a.name,Z(a.url)].filter(Boolean)}function _(a,b){let c=new Map([["public",0],["auth",1]]);return(c.get(a.schema)??2)-(c.get(b.schema)??2)||a.schema.localeCompare(b.schema)||a.name.localeCompare(b.name)}function aa(a,b){return a.map((a,c)=>0===c?{...a,section:b}:a)}function ab(){let a=(0,n.useRouter)(),b=(0,x.$C)(),c=(0,n.useParams)(),{connection:e,tables:f}=(0,m.k)(),h=(0,j.Z)(a=>a.connections),[i,l]=(0,o.useState)(!1),[p,q]=(0,o.useState)(""),[r,s]=(0,o.useState)(0),[v,y]=(0,o.useState)(null),z=(0,o.useRef)(null),A=(0,o.useRef)(null),B=(0,o.useRef)(null),C=h.find(a=>a.id===v)??null,D=C??e,E=C&&C.id!==e.id?C.url:null,F=function(a){let[b]=(0,o.useState)(()=>new Map),[c,d]=(0,o.useState)({url:"",error:null});if(!a)return{data:void 0,error:null,loading:!1};let e=c.url===a?c.data:b.get(a);return{data:e,error:c.url===a?c.error:null,loading:void 0===e}}(E),[G,H]=(0,k.DE)(e.id),[I,J]=(0,k.DE)(D.id),K=D.id===e.id?G:I,L=(0,o.useMemo)(()=>E?F.data??[]:f.data??[],[F.data,E,f.data]),M=E?F.loading:f.loading,O=E?F.error:null,P=(0,o.useMemo)(()=>[...new Set(L.map(a=>a.schema))],[L]),Q=null===K.selectedSchemas?null:K.selectedSchemas.filter(a=>P.includes(a)),R=(0,o.useMemo)(()=>null===Q?L:L.filter(a=>Q.includes(a.schema)),[L,Q]),S=K.pinnedTables,T=K.recentTables,U=(0,o.useMemo)(()=>{let a,b;return -1===(b=(a=p.trim()).indexOf(":"))?{schema:null,table:a}:{schema:a.slice(0,b).trim(),table:a.slice(b+1).trim()}},[p]),V=U.table||(U.schema?"":p.trim()),W=(0,o.useMemo)(()=>{let a=new Set(S),b=new Set(T),c=null===U.schema?null:function(a,b){if(!a)return b;let c=a.toLocaleLowerCase(),d=b.filter(a=>a.toLocaleLowerCase()===c);if(d.length>0)return d;let e=b.filter(a=>a.toLocaleLowerCase().startsWith(c));return e.length>0?e:(0,N.R6)(a,b,a=>a).map(a=>a.item)}(U.schema,P),d=null===c?R:L.filter(a=>c.includes(a.schema)),f=new Map(d.map(a=>[(0,t.i)(a),a])),g=S.flatMap(a=>{let b=f.get(a);return b?[b]:[]}),i=T.flatMap(b=>{let c=f.get(b);return!c||a.has(b)?[]:[c]}),j=(a,b)=>({type:"table",key:`table:${(0,t.i)(a)}`,table:a,...b}),k=a=>({type:"connection",key:`connection:${a.id}`,connection:a,current:a.id===e.id}),l=null===U.schema?p.trim():U.table,m=null===C&&null===U.schema;if(!l){let a=new Set([...g.map(a=>(0,t.i)(a)),...i.map(a=>(0,t.i)(a))]),c=d.filter(b=>!a.has((0,t.i)(b))).sort(_),f=m?h.filter(a=>a.id!==e.id):[];return[...aa(g.map(a=>j(a,{pinned:!0})),"pinned"),...aa(i.map(a=>j(a,{pinned:!1,recent:!0})),"recent"),...aa(c.map(a=>j(a,{pinned:!1,recent:b.has((0,t.i)(a))})),"tables"),...aa(f.map(k),"connections")]}let n=(0,N.UO)(l,d,a=>null===U.schema?[a.name,`${a.schema}.${a.name}`,a.schema]:[a.name]).map(c=>({...c,score:c.score+80*!!a.has((0,t.i)(c.item))+40*!!b.has((0,t.i)(c.item))})).sort((a,b)=>b.score-a.score).map(c=>j(c.item,{pinned:a.has((0,t.i)(c.item)),recent:b.has((0,t.i)(c.item))}));return[...aa(m?(0,N.UO)(p,h,$).map(a=>k(a.item)):[],"connections"),...aa(n,"tables")]},[L,e.id,h,C,U.schema,U.table,S,p,T,P,R]),ab=W[r]??null;function ac(){y(null),s(0),z.current?.focus()}function ad(c){var d,e;(l(!1),q(""),s(0),y(null),"connection"===c.type)?b(c.connection.id):a.push((d=D.id,e=c.table,`/${d}/${encodeURIComponent(e.schema)}/${encodeURIComponent(e.name)}`))}function ae(a){let b=(0,t.i)(a),c=K.pinnedTables.includes(b)?K.pinnedTables.filter(a=>a!==b):[...K.pinnedTables,b];(D.id===e.id?H:J)({pinnedTables:c})}let af=D.id===e.id&&c.schema&&c.table?`${decodeURIComponent(c.schema)}.${decodeURIComponent(c.table)}`:null;return i?(0,d.jsxs)("div",{ref:A,"data-table-palette":"",className:"fixed top-3 left-1/2 z-50 flex w-[min(36rem,calc(100%-1.5rem))] -translate-x-1/2 flex-col overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ring-1 ring-foreground/10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b px-3",children:[(0,d.jsx)(g.TfF,{className:"size-4 shrink-0 text-muted-foreground"}),C&&(0,d.jsxs)("button",{type:"button",onClick:ac,"aria-label":`Stop searching ${C.name}`,className:"flex h-6 max-w-40 shrink-0 items-center gap-1.5 rounded-md bg-muted px-1.5 text-xs outline-none hover:bg-muted/80",children:[(0,d.jsx)(w.F,{connection:C,className:"size-2"}),(0,d.jsx)("span",{className:"truncate",children:C.name})]}),(0,d.jsx)("input",{ref:z,value:p,onChange:a=>q(a.target.value),onKeyDown:function(a){if("ArrowDown"===a.key){if(a.preventDefault(),0===W.length)return;s(a=>(a+1)%W.length);return}if("ArrowUp"===a.key){if(a.preventDefault(),0===W.length)return;s(a=>(a-1+W.length)%W.length);return}if("Tab"===a.key){if(a.preventDefault(),C||a.shiftKey)return;ab?.type==="connection"&&(y(ab.connection.id),q(""),s(0));return}if("Backspace"===a.key&&""===p&&C){a.preventDefault(),ac();return}"Enter"===a.key&&(a.preventDefault(),a.shiftKey&&ab?.type==="table"?ae(ab.table):ab&&ad(ab))},spellCheck:!1,autoComplete:"off",autoCorrect:"off",placeholder:C?`Search tables in ${C.name}`:"Go to table (schema:name)","aria-label":C?`Go to table in ${C.name}`:"Go to table or connection",className:"h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),(0,d.jsx)("div",{ref:B,role:"listbox","aria-label":C?`Tables in ${C.name}`:"Tables and connections",className:"max-h-[min(24rem,50vh)] overflow-auto py-1",children:M&&0===L.length&&0===W.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"Loading tables…"}):O&&0===L.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:O}):0===W.length?(0,d.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p.trim()?"No matches":"No tables"}):W.map((a,b)=>{let c=b===r;if("connection"===a.type){let e=Z(a.connection.url);return(0,d.jsxs)("div",{children:[a.section&&(0,d.jsx)("p",{className:"px-3 pt-2 pb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase",children:X[a.section]}),(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"data-active":c||void 0,onMouseEnter:()=>s(b),onClick:()=>ad(a),className:(0,u.cn)("flex h-8 w-full cursor-pointer items-center gap-2 px-3 text-left text-[13px] outline-none",c&&"bg-primary/10"),children:[(0,d.jsx)(g.bkQ,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)(w.F,{connection:a.connection,className:"size-2"}),(0,d.jsx)("span",{className:(0,u.cn)("min-w-0 truncate",a.current&&"font-medium"),children:(0,d.jsx)(Y,{text:a.connection.name,query:V})}),(0,d.jsx)("span",{className:"ml-auto flex min-w-0 shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:c?(0,d.jsx)("span",{children:"Tab to search"}):(0,d.jsx)("span",{className:"max-w-36 truncate",children:a.current?"current":e||"connection"})})]})]},a.key)}let e=(0,t.i)(a.table)===af;return(0,d.jsxs)("div",{children:[a.section&&(0,d.jsx)("p",{className:"px-3 pt-2 pb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase",children:X[a.section]}),(0,d.jsxs)("div",{onMouseEnter:()=>s(b),className:(0,u.cn)("group/table-result flex items-center",c&&"bg-primary/10"),children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,"data-active":c||void 0,onClick:()=>ad(a),className:"flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 pl-3 text-left text-[13px] outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/60",children:[a.recent&&!a.pinned?(0,d.jsx)(g.A01,{className:"size-3.5 shrink-0 text-muted-foreground"}):(0,d.jsx)(g.ooN,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:(0,u.cn)("min-w-0 truncate",e&&"font-medium"),children:(0,d.jsx)(Y,{text:a.table.name,query:V})}),(0,d.jsxs)("span",{className:"ml-auto flex min-w-0 shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:["view"===a.table.kind&&(0,d.jsx)("span",{children:"view"}),(0,d.jsx)("span",{className:"max-w-36 truncate",children:a.table.schema})]})]}),(0,d.jsx)("button",{type:"button","aria-label":`${a.pinned?"Unpin":"Pin"} ${(0,t.i)(a.table)}`,"aria-pressed":a.pinned,title:a.pinned?"Unpin table":"Pin table",onClick:()=>ae(a.table),className:(0,u.cn)("mr-2 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 outline-none transition-[color,background-color,opacity] hover:bg-foreground/10 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:opacity-100 group-hover/table-result:opacity-100",(a.pinned||c)&&"opacity-100",a.pinned&&"text-foreground"),children:a.pinned?(0,d.jsx)(g.M0d,{className:"size-3.5"}):(0,d.jsx)(g.rq5,{className:"size-3.5"})})]})]},a.key)})}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 border-t px-3 py-1.5 text-[10px] text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("kbd",{className:"font-mono text-foreground/70",children:"↑↓"}),"Navigate"]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("kbd",{className:"font-mono text-foreground/70",children:"↵"}),"Open"]}),ab?.type==="table"&&(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("kbd",{className:"font-mono text-foreground/70",children:"⇧↵"}),ab.pinned?"Unpin":"Pin"]})]})]}):null}function ac({connectionId:a,children:b}){let c=(0,i.p)(),e=(0,j.w)(a),[n,o]=(0,k.DE)(a);if(!c)return null;if(!e)return(0,d.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground",children:[(0,d.jsx)("p",{children:"Connection not found"}),(0,d.jsx)(f(),{href:"/",className:"text-foreground underline underline-offset-4",children:"Connections"})]});let p=(0,l.Mq)(e);return(0,d.jsxs)(m.Z,{connection:e,children:[(0,d.jsxs)("div",{className:"flex h-dvh flex-col overflow-hidden",children:[(0,d.jsx)("div",{"aria-hidden":!0,title:e.name,className:"h-1.5 w-full shrink-0",style:{background:p}}),(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[n.sidebarCollapsed?(0,d.jsxs)("aside",{className:"relative flex h-full w-10 shrink-0 justify-center border-r bg-sidebar pt-2",children:[(0,d.jsx)("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1",style:{background:p}}),(0,d.jsx)(h.$,{variant:"ghost",size:"icon-sm","aria-label":"Show database sidebar",title:"Show sidebar",onClick:()=>o({sidebarCollapsed:!1}),children:(0,d.jsx)(g.cFu,{})})]}):(0,d.jsx)(J,{width:n.sidebarWidth,onWidthChange:a=>o({sidebarWidth:a}),onCollapse:()=>o({sidebarCollapsed:!0})},e.id),(0,d.jsx)("main",{className:"flex min-w-0 flex-1 flex-col",children:b})]})]}),(0,d.jsx)(ab,{}),(0,d.jsx)(V,{}),(0,d.jsx)(W,{})]})}},56918:(a,b,c)=>{"use strict";c.d(b,{Ai:()=>p,Nz:()=>o,Zy:()=>m,mj:()=>q,wQ:()=>t});var d=c(14490),e=c(67657);let f=new Set(["apply","up","forward"]),g=new Set(["revert","down","rollback","undo"]),h=[".up",".apply",".forward","_up","_apply","-up","-apply"],i=[".down",".revert",".rollback",".undo","_down","_revert","_rollback","_undo","-down","-revert","-rollback","-undo"];function j(a){return a.split("/").filter(a=>a.length>0)}function k(a){let b=/^[Vv](\d+(?:[._]\d+)*)__(.*)$/.exec(a);if(b)return{version:b[1].replace(/_/g,"."),name:l(b[2])};let c=/^(\d+(?:[-.]\d+)*)(?:[-_.\s]+(.*))?$/.exec(a);return c?{version:c[1],name:l(c[2]??"")}:{version:a,name:l(a)}}function l(a){return a.replace(/[-_]+/g," ").trim()}function m(a,b){let c=/(\d+)|(\D+)/g,d=a.match(c)??[],e=b.match(c)??[],f=Math.min(d.length,e.length);for(let a=0;a<f;a+=1){let b=d[a],c=e[a],f=/^\d+$/.test(b)&&/^\d+$/.test(c)?Number(b)-Number(c):b.localeCompare(c);if(0!==f)return f}return d.length-e.length}function n(a){let b=a.replace(/\r\n/g,"\n").trim(),c=0x811c9dc5,d=0x1000193;for(let a=0;a<b.length;a+=1){let e=b.charCodeAt(a);c=Math.imul(c^e,0x1000193)>>>0,d=Math.imul(d+e,0x85ebca6b)>>>0}return`${c.toString(16).padStart(8,"0")}${d.toString(16).padStart(8,"0")}`}function o(a){let b={applies:new Map,reverts:new Map,skipped:[],errors:[]},c=a.filter(a=>{var b;let c=j(b=a.path).at(-1)??b;return!c.startsWith(".")&&/\.sql$/i.test(c)});if(0===c.length)return b.errors.push("No .sql files in there."),b;let d=c.reduce((a,b)=>a+b.text.length,0);if(d>4e6)return b.errors.push(`That is ${s(d)} of SQL, over the ${s(4e6)} limit.`),b;let e=[];for(let a of c){if(a.text.length>5e5){b.skipped.push(`${a.path} — over ${s(5e5)}`);continue}if(a.text.includes("\0")){b.skipped.push(`${a.path} — not text`);continue}if(!a.text.trim()){b.skipped.push(`${a.path} — empty`);continue}e.push({file:a,...function(a){let b=j(a),c=(b.at(-1)??a).replace(/\.sql$/i,"");for(let a of b.slice(0,-1)){let b=a.toLowerCase();if(g.has(b))return{direction:"revert",stem:c};if(f.has(b))return{direction:"apply",stem:c}}let d=c.toLowerCase();for(let a of i)if(d.endsWith(a))return{direction:"revert",stem:c.slice(0,-a.length)};for(let a of h)if(d.endsWith(a))return{direction:"apply",stem:c.slice(0,-a.length)};return{direction:"apply",stem:c}}(a.path)})}let m=new Set,n=!1;for(let{direction:a,stem:b}of e){if("apply"!==a)continue;let{version:c}=k(b);m.has(c)&&(n=!0),m.add(c)}for(let{file:a,direction:c,stem:d}of e){let{version:e,name:f}=n?{version:d,name:l(d)}:k(d),g=("apply"===c?b.applies:b.reverts).get(e);if(g){b.skipped.push(`${a.path} — ${g.path} is already version ${e}`);continue}"apply"===c?b.applies.set(e,{path:a.path,sql:a.text,name:f}):b.reverts.set(e,{path:a.path,sql:a.text})}return 0===b.applies.size&&0===b.reverts.size&&b.errors.push("None of those .sql files could be read as a migration."),b}function p(a,b){let c=new Map(a.map(a=>[a.version,{...a}])),d=[...b.skipped],f=0,g=0,h=0;for(let[a,h]of b.applies){let b=c.get(a);if(b){b.applySql!==h.sql&&(g+=1),b.name=h.name||b.name,b.applyPath=h.path,b.applySql=h.sql,b.checksum=n(h.sql),b.transaction=(0,e.Ol)(h.sql).mode;continue}if(c.size>=500){d.push(`${h.path} — over 500 migrations`);continue}c.set(a,{version:a,name:h.name||a,applyPath:h.path,applySql:h.sql,checksum:n(h.sql),transaction:(0,e.Ol)(h.sql).mode}),f+=1}for(let[a,e]of b.reverts){let b=c.get(a);if(!b){d.push(`${e.path} — no migration ${a} to revert`);continue}b.revertPath=e.path,b.revertSql=e.sql,h+=1}return{steps:[...c.values()].sort((a,b)=>m(a.version,b.version)),added:f,updated:g,reverts:h,skipped:d}}function q(a){return{id:(0,d.z)(),name:r(a),importedAt:Date.now(),steps:[],skipped:[]}}function r(a){return a.trim().replace(/\s+/g," ").slice(0,80)||"Migrations"}function s(a){return a<1024?`${a} B`:a<1048576?`${Math.round(a/1024)} KB`:`${(a/1048576).toFixed(1)} MB`}function t(a,b){let c=[],f=[];for(let a of[...b].sort((a,b)=>m(a.version,b.version))){if(!a.applySql){c.push(a.version);continue}f.push({version:a.version,name:a.name||a.version,applyPath:`${a.version} (from the ledger)`,applySql:a.applySql,checksum:n(a.applySql),revertPath:a.revertSql?`${a.version} revert (from the ledger)`:void 0,revertSql:a.revertSql,transaction:(0,e.Ol)(a.applySql).mode})}return{set:{id:(0,d.z)(),name:r(a),importedAt:Date.now(),steps:f,skipped:[]},missing:c}}},60671:(a,b,c)=>{"use strict";c.d(b,{$C:()=>k,yG:()=>l});var d=c(19099),e=c(67484),f=c(21883),g=c(61159),h=c(13449),i=c(91732),j=c(44231);function k(){let a=(0,d.useRouter)(),b=(0,d.usePathname)(),{connection:c}=(0,j.k)(),k=(0,i.Z)(a=>a.connections);return(0,e.useCallback)(async d=>{if(d===c.id)return;let e=k.find(a=>a.id===d);if(!e)return;(0,g.r)();let i=(0,h.ZG)(b),j=!!c.layoutGroup&&c.layoutGroup===e.layoutGroup,l=!0;if("table"===i.kind&&!j)try{var m,n;m=await f.F.tables(e.url),n=i.table,l=m.some(a=>a.schema===n.schema&&a.name===n.name)}catch{l=!1}a.push((0,h.gZ)(b,d,{tableExists:l}))},[c.id,c.layoutGroup,k,b,a])}function l(){let{connection:a}=(0,j.k)(),b=(0,i.Z)(a=>a.connections),c=k(),d=function(a,b){let c=a.findIndex(a=>a.id===b);if(!(a.length<2)&&-1!==c)return a[(c+1)%a.length]}(b,a.id);return{run:()=>d?c(d.id):Promise.resolve(),enabled:void 0!==d,next:d}}},61159:(a,b,c)=>{"use strict";c.d(b,{T:()=>e,r:()=>f});let d=new Set;function e(a){return d.add(a),()=>{d.delete(a)}}function f(){for(let a of d)a()}},66280:(a,b,c)=>{"use strict";c.d(b,{Ss:()=>m,jV:()=>l,kG:()=>n,ox:()=>o});var d=c(31417),e=c(300),f=c(4106),g=c(56918),h=c(72428),i=c(14490),j=c(91732);let k={query:"",status:"all"},l=(0,d.v)()((0,e.Zr)((a,b)=>({sets:[],history:[],ledgerSchema:h.aC,setLedgerSchema:b=>{(0,h.hD)(b)&&a({ledgerSchema:b})},listFilters:{},setListFilter:(b,c)=>a(a=>({listFilters:{...a.listFilters,[b]:{...a.listFilters[b]??k,...c}}})),repoRoots:{},setRepoRoot:(b,c)=>a(a=>{let d={...a.repoRoots},e=c?.trim();e?d[b]=e:delete d[b],(0,f.L)("migrations.folder",{set:!!e});let g={...a.repoCheckouts};return delete g[b],{repoRoots:d,repoCheckouts:g}}),repoCheckouts:{},setRepoCheckout:(b,c)=>a(a=>{let d={...a.repoCheckouts};return c?d[b]=c:delete d[b],(0,f.L)("migrations.checkout",{set:!!c}),{repoCheckouts:d}}),createSet:b=>{let c=(0,g.mj)(b);return a(a=>({sets:[...a.sets,c]})),c.id},addFiles:(c,d)=>{let e=b().sets.find(a=>a.id===c),h=(0,g.Nz)(d),i=(0,g.Ai)(e?.steps??[],h);return e&&a(a=>({sets:a.sets.map(a=>a.id===c?{...a,steps:i.steps,skipped:i.skipped,importedAt:Date.now()}:a)})),(0,f.L)("migrations.import",{name:e?.name,added:i.added,updated:i.updated,reverts:i.reverts,skipped:i.skipped.length}),i},adoptSet:b=>(a(a=>({sets:[...a.sets,b]})),(0,f.L)("migrations.import",{name:b.name,migrations:b.steps.length,source:"ledger"}),b.id),renameSet:(b,c)=>{let d=c.trim().replace(/\s+/g," ").slice(0,80);d&&a(a=>({sets:a.sets.map(a=>a.id===b?{...a,name:d}:a)}))},setNote:(b,c)=>{let d=c.trim().slice(0,h.XG)||void 0;a(a=>({sets:a.sets.map(a=>a.id===b?{...a,note:d}:a)}))},removeStep:(b,c)=>a(a=>({sets:a.sets.map(a=>a.id===b?{...a,steps:a.steps.filter(a=>a.version!==c)}:a)})),removeSet:c=>{let d=b().sets.find(a=>a.id===c);a(a=>({sets:a.sets.filter(a=>a.id!==c)})),(0,f.L)("migrations.remove",{name:d?.name})},record:b=>a(a=>({history:[{...b,id:(0,i.z)(),ranAt:Date.now()},...a.history].slice(0,300)})),clearHistory:b=>a(a=>({history:b?a.history.filter(a=>a.setId!==b):[]}))}),{name:"ytdb:migrations"}));function m(a){return l(b=>b.sets.find(b=>b.id===a)??null)}function n(a){return l(b=>b.listFilters[a]??k)}function o(a){let b=(0,j.Z)(b=>b.connections.find(b=>b.id===a)?.layoutGroup??a),c=l(a=>a.repoRoots[b]??null),d=l(a=>a.repoCheckouts[b]??null);return{scope:b,root:c,checkout:d}}},67657:(a,b,c)=>{"use strict";c.d(b,{Ol:()=>i,TA:()=>j,qb:()=>k});let d=/^[ \t]*--+[ \t]*ytdb:[ \t]*no-?transaction\b/im,e=new Set(["begin","start"]),f=new Set(["commit","end"]),g=new Set(["rollback"]);function h(a){return void 0!==a&&(a>="A"&&a<="Z"||a>="a"&&a<="z"||"_"===a)||void 0!==a&&a>="0"&&a<="9"}function i(a){if(d.test(a))return{mode:"unwrapped",sql:a,atomic:!1};let b=function(a){let b=[],c=0,d=0,e=d=>{let e=function(a,b){let c=b;for(;c<a.length;){let b=a[c];if(" "===b||" "===b||"\n"===b||"\r"===b){c+=1;continue}if("-"===b&&"-"===a[c+1]){for(;c<a.length&&"\n"!==a[c];)c+=1;continue}if("/"===b&&"*"===a[c+1]){let b=a.indexOf("*/",c+2);c=-1===b?a.length:b+2;continue}break}return c}(a,c);if(e>=d)return;let f=e;for(;f<a.length&&h(a[f]);)f+=1;b.push({at:e,end:d,keyword:a.slice(e,f).toLowerCase()})};for(;d<a.length;){let b=a[d];if("-"===b&&"-"===a[d+1]){for(;d<a.length&&"\n"!==a[d];)d+=1;continue}if("/"===b&&"*"===a[d+1]){let b=a.indexOf("*/",d+2);d=-1===b?a.length:b+2;continue}if("'"===b||'"'===b){d=function(a,b,c){let d=b+1;for(;d<a.length;){if(a[d]===c){if(a[d+1]===c){d+=2;continue}return d+1}d+=1}return d}(a,d,b);continue}if("$"===b){let b=function(a,b){if("$"!==a[b])return null;let c=b+1;for(;c<a.length&&h(a[c]);)c+=1;return"$"!==a[c]?null:a.slice(b,c+1)}(a,d);if(b){let c=a.indexOf(b,d+b.length);d=-1===c?a.length:c+b.length;continue}}if(";"===b){e(d+1),d+=1,c=d;continue}d+=1}return e(a.length),b}(a),c=b.filter(a=>e.has(a.keyword)||f.has(a.keyword)||g.has(a.keyword));if(0===c.length)return{mode:"wrapped-by-ytdb",sql:a,atomic:!0};let i=b[0],j=b[b.length-1];return 2===c.length&&c[0]===i&&c[1]===j&&e.has(i.keyword)&&f.has(j.keyword)?{mode:"self-wrapped",sql:a.slice(0,i.at)+a.slice(i.end,j.at)+a.slice(j.end),atomic:!0}:{mode:"self-managed",sql:a,atomic:!1}}function j(a){switch(a){case"unwrapped":return"Marked `-- ytdb:no-transaction`, so it runs with no transaction. A failure partway leaves the statements before it applied.";case"self-managed":return"This file commits more than once, so YTDB runs it as written and records it afterwards. A failure partway can leave it half applied and unrecorded.";default:return null}}function k(a){return"unwrapped"===a?"no transaction":"self-managed"===a?"self-managed":null}},72428:(a,b,c)=>{"use strict";c.d(b,{R9:()=>e,XG:()=>g,aC:()=>d,hD:()=>f,km:()=>h});let d="maintenance",e="ytdb_migrations";function f(a){return"string"==typeof a&&a.length>0&&a.length<=63&&/^[A-Za-z_][A-Za-z0-9_$]*$/.test(a)}let g=2e4;function h(a){return a.startsWith("repo:")}},79820:(a,b,c)=>{"use strict";c.d(b,{V:()=>h});var d=c(48249),e=c(23171),f=c(82244),g=c(14490);function h({schemas:a,selected:b,onChange:c,compact:i=!1}){let j=null===b||b.length===a.length,k=null===b||b.length===a.length?"All schemas":0===b.length?"No schemas":1===b.length?b[0]:`${b.length} of ${a.length} schemas`;return(0,d.jsxs)(f.rI,{children:[i?(0,d.jsxs)(f.ty,{"aria-label":`Schemas: ${k}`,title:k,className:(0,g.cn)("flex h-6 shrink-0 cursor-pointer items-center gap-1 rounded-md px-1 text-[11px] tabular-nums outline-none transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 data-open:bg-foreground/10 data-open:text-foreground",j?"text-muted-foreground":"text-foreground"),children:[(0,d.jsx)(e.olY,{className:"size-3.5"}),!j&&(0,d.jsx)("span",{children:b.length})]}):(0,d.jsxs)(f.ty,{className:"group flex h-8 w-full cursor-pointer items-center gap-2 rounded-lg px-2 text-left text-[0.8rem] outline-none transition-colors hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/60 data-open:bg-muted/60",children:[(0,d.jsx)(e.olY,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:k}),(0,d.jsx)(e.RQe,{className:"size-3.5 shrink-0 text-muted-foreground transition-transform group-data-open:rotate-180"})]}),(0,d.jsx)(f.SQ,{align:i?"end":"start",sideOffset:6,className:(0,g.cn)("max-h-80 min-w-52",!i&&"w-(--anchor-width)"),children:(0,d.jsxs)(f.I,{children:[(0,d.jsx)(f.hO,{checked:j,onCheckedChange:a=>c(a?null:[]),children:"All schemas"}),(0,d.jsx)(f.mB,{}),a.map(e=>(0,d.jsx)(f.hO,{checked:j||(b?.includes(e)??!1),onCheckedChange:d=>{let f,g;return f=b??a,void c((g=d?[...new Set([...f,e])]:f.filter(a=>a!==e)).length===a.length?null:g)},children:(0,d.jsx)("span",{className:"truncate",children:e})},e))]})})]})}},82676:(a,b,c)=>{Promise.resolve().then(c.bind(c,34766))},93291:(a,b,c)=>{"use strict";function d(a,b){if(0===b)return!0;let c=a[b-1];return"_"===c||"-"===c||" "===c||"."===c}function e(a,b,c){return f(a,b,a=>[c(a)])}function f(a,b,c){if(!a.trim())return[];let e=[];for(let f of b){let b=c(f),g=null;for(let c of b){let b=function(a,b){let c=a.trim().toLocaleLowerCase(),e=b.toLocaleLowerCase();if(!c)return 0;if(0===e.length)return null;if(e===c)return 1e4;if(e.startsWith(c))return 5e3-e.length;let f=e.indexOf(c);if(-1!==f)return 2400+1200*!!d(b,f)-f-e.length;let g=0,h=0,i=0;for(let a=0;a<e.length&&g<c.length;a+=1){if(e[a]!==c[g]){i=0;continue}h+=12,(i+=1)>1&&(h+=18*i),d(b,a)&&(h+=40),g+=1}if(g<c.length)return null;let j=b.split(/[_\-\s.]+/).map(a=>a[0]??"").join("").toLocaleLowerCase();return j.startsWith(c)?h+=2200:j.includes(c)&&(h+=700),h-(e.length-c.length)}(a,c);null!==b&&(null===g||b>g)&&(g=b)}null!==g&&e.push({item:f,score:g})}return e.sort((a,b)=>b.score!==a.score?b.score-a.score:c(a.item)[0]?.localeCompare(c(b.item)[0]??"")??0)}c.d(b,{R6:()=>e,UO:()=>f})}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
exports.id=814,exports.ids=[814],exports.modules={19225:(a,b,c)=>{"use strict";a.exports=c(44870)},41834:(a,b,c)=>{"use strict";c.d(b,{$F:()=>g,Be:()=>e,H4:()=>j,d6:()=>f,mb:()=>h,mf:()=>i,nc:()=>d,qX:()=>k});let d=8e3,e=8388608,f=1e4,g=500,h=6e4,i=6e5,j=5e5;function k(a){return!function(a){if("object"!=typeof a||null===a)return!1;if("57014"===("code"in a?a.code:void 0))return!0;let b="message"in a&&"string"==typeof a.message?a.message:"";return/timeout|cancell?ed|cancell?ing/i.test(b)}(a)?a instanceof Error?a.message:"Unknown error":"Query took too long and was cancelled. Add a filter or limit the result set."}},51975:(a,b,c)=>{"use strict";c.d(b,{MG:()=>i,Ol:()=>j});let d=/^[ \t]*--+[ \t]*ytdb:[ \t]*no-?transaction\b/im,e=new Set(["begin","start"]),f=new Set(["commit","end"]),g=new Set(["rollback"]);function h(a){return void 0!==a&&(a>="A"&&a<="Z"||a>="a"&&a<="z"||"_"===a)||void 0!==a&&a>="0"&&a<="9"}function i(a){let b=[],c=0,d=0,e=d=>{let e=function(a,b){let c=b;for(;c<a.length;){let b=a[c];if(" "===b||" "===b||"\n"===b||"\r"===b){c+=1;continue}if("-"===b&&"-"===a[c+1]){for(;c<a.length&&"\n"!==a[c];)c+=1;continue}if("/"===b&&"*"===a[c+1]){let b=a.indexOf("*/",c+2);c=-1===b?a.length:b+2;continue}break}return c}(a,c);if(e>=d)return;let f=e;for(;f<a.length&&h(a[f]);)f+=1;b.push({at:e,end:d,keyword:a.slice(e,f).toLowerCase()})};for(;d<a.length;){let b=a[d];if("-"===b&&"-"===a[d+1]){for(;d<a.length&&"\n"!==a[d];)d+=1;continue}if("/"===b&&"*"===a[d+1]){let b=a.indexOf("*/",d+2);d=-1===b?a.length:b+2;continue}if("'"===b||'"'===b){d=function(a,b,c){let d=b+1;for(;d<a.length;){if(a[d]===c){if(a[d+1]===c){d+=2;continue}return d+1}d+=1}return d}(a,d,b);continue}if("$"===b){let b=function(a,b){if("$"!==a[b])return null;let c=b+1;for(;c<a.length&&h(a[c]);)c+=1;return"$"!==a[c]?null:a.slice(b,c+1)}(a,d);if(b){let c=a.indexOf(b,d+b.length);d=-1===c?a.length:c+b.length;continue}}if(";"===b){e(d+1),d+=1,c=d;continue}d+=1}return e(a.length),b}function j(a){if(d.test(a))return{mode:"unwrapped",sql:a,atomic:!1};let b=i(a),c=b.filter(a=>e.has(a.keyword)||f.has(a.keyword)||g.has(a.keyword));if(0===c.length)return{mode:"wrapped-by-ytdb",sql:a,atomic:!0};let h=b[0],j=b[b.length-1];return 2===c.length&&c[0]===h&&c[1]===j&&e.has(h.keyword)&&f.has(j.keyword)?{mode:"self-wrapped",sql:a.slice(0,h.at)+a.slice(h.end,j.at)+a.slice(j.end),atomic:!0}:{mode:"self-managed",sql:a,atomic:!1}}},70613:(a,b,c)=>{"use strict";c.d(b,{Ai:()=>o,EB:()=>n,L1:()=>m,v_:()=>q});var d=c(77598),e=c(51455),f=c(76760),g=c.n(f),h=c(89194);let i=process.env.YTDB_LOG_DIR??g().join(process.cwd(),".ytdb","activity"),j=null,k=Promise.resolve(),l=!1;function m(a){if(["0","off","false"].includes((process.env.YTDB_LOG??"").toLowerCase()))return;let b=`${JSON.stringify({v:h.aH,id:(0,d.randomUUID)(),ts:new Date().toISOString(),...a})}
|
|
2
|
-
`;k=k.then(async()=>{var a;j??=(0,e.mkdir)(i,{recursive:!0}).then(()=>void 0),await j,await (0,e.appendFile)((a=new Date,g().join(i,`${a.toISOString().slice(0,10)}.jsonl`)),b,"utf8")}).catch(a=>{j=null,l||(l=!0,console.warn("[activity-log] disabled for this run:",a))})}function n(a){if("string"!=typeof a||0===a.length)return null;try{let b=new URL(a),c=b.username?`${decodeURIComponent(b.username)}@`:"",d=b.port?`:${b.port}`:"";return`${b.protocol}//${c}${b.hostname}${d}${b.pathname}`}catch{return"invalid-url"}}function o(a){return!a||"object"!=typeof a||Array.isArray(a)?p(a):p(Object.fromEntries(Object.entries(a).filter(([a])=>"connectionUrl"!==a)))}function p(a){let b;try{b=JSON.stringify(a)??"null"}catch{return{unserializable:!0}}return b.length<=2e4?a:{truncated:!0,bytes:b.length,preview:b.slice(0,1e3)}}function q(a,b){switch(a){case"tables":return{tables:Array.isArray(b)?b.length:0};case"rows":case"lookup":return{rows:r(b?.rows),columns:r(b?.columns),total:b?.total??null,estimated:b?.estimated??!1,capped:b?.capped??!1};case"query":{let a=Array.isArray(b?.statements)?b.statements:[];return{statements:a.length,commands:a.map(a=>a.command),rows:a.reduce((a,b)=>a+r(b.rows),0),durationMs:b?.durationMs??null}}case"cell.update":return{updated:+!!b?.row};case"rows.insert":return{inserted:+!!b?.row};case"rows.update":return{updated:b?.updated??0};case"rows.delete":return{deleted:b?.deleted??0};case"related":{let a=Array.isArray(b)?b:[];return{lookups:a.length,matched:a.reduce((a,b)=>a+r(b.rows),0)}}case"definition":return{sqlLength:"string"==typeof b?.sql?b.sql.length:0};case"ledger":return{initialized:b?.initialized??!1,entries:r(b?.entries)};case"migrate":return{version:b?.version??null,direction:b?.direction??null,statements:b?.statements??0,durationMs:b?.durationMs??null};case"adopt":return{recorded:b?.recorded??0,existing:b?.existing??0};case"detect":{let a=Array.isArray(b?.results)?b.results:[],c={};for(let b of a){let a=String(b.verdict);c[a]=(c[a]??0)+1}return{migrations:a.length,...c}}case"repo":return{sets:r(b?.sets),migrations:Array.isArray(b?.sets)?b.sets.reduce((a,b)=>a+r(b.steps),0):0,branch:b?.git?.branch??null};case"note":return{notePath:b?.notePath??null};case"schema":return{relations:r(b?.relations),enums:r(b?.enums),functions:r(b?.functions),extensions:r(b?.extensions)};default:return}}function r(a){return Array.isArray(a)?a.length:0}},78335:()=>{},84152:(a,b,c)=>{"use strict";c.d(b,{VW:()=>g,fx:()=>f,ms:()=>h});var d=c(41834),e=c(70613);function f(a,b){return async c=>{let f;if("1"===process.env.VERCEL)return Response.json({error:"Database API is local-only"},{status:404});let g=performance.now();try{f=await c.json()}catch{return(0,e.L1)({source:"api",action:a,connection:null,status:"error",durationMs:Math.round(performance.now()-g),error:"Invalid JSON body"}),Response.json({error:"Invalid JSON body"},{status:400})}let h=(0,e.EB)(f?.connectionUrl),i=(0,e.Ai)(f);try{let c=await b(f);return(0,e.L1)({source:"api",action:a,connection:h,status:"ok",durationMs:Math.round(performance.now()-g),params:i,result:(0,e.v_)(a,c)}),Response.json(c)}catch(c){let b=(0,d.qX)(c);return(0,e.L1)({source:"api",action:a,connection:h,status:"error",durationMs:Math.round(performance.now()-g),params:i,error:b}),Response.json({error:b},{status:500})}}}function g(a,b){if("string"!=typeof a||0===a.length)throw Error(`Missing ${b}`);return a}function h(a,b="table"){if(!a||"object"!=typeof a)throw Error(`Missing ${b}`);return{schema:g(a.schema,`${b}.schema`),name:g(a.name,`${b}.name`)}}},89194:(a,b,c)=>{"use strict";c.d(b,{P7:()=>f,aH:()=>d});let d=1,e=["connection.add","connection.update","connection.remove","config.export","config.import","migrations.import","migrations.remove","migrations.folder"];function f(a){return"string"==typeof a&&e.includes(a)}},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};
|
|
2
|
+
`;k=k.then(async()=>{var a;j??=(0,e.mkdir)(i,{recursive:!0}).then(()=>void 0),await j,await (0,e.appendFile)((a=new Date,g().join(i,`${a.toISOString().slice(0,10)}.jsonl`)),b,"utf8")}).catch(a=>{j=null,l||(l=!0,console.warn("[activity-log] disabled for this run:",a))})}function n(a){if("string"!=typeof a||0===a.length)return null;try{let b=new URL(a),c=b.username?`${decodeURIComponent(b.username)}@`:"",d=b.port?`:${b.port}`:"";return`${b.protocol}//${c}${b.hostname}${d}${b.pathname}`}catch{return"invalid-url"}}function o(a){return!a||"object"!=typeof a||Array.isArray(a)?p(a):p(Object.fromEntries(Object.entries(a).filter(([a])=>"connectionUrl"!==a)))}function p(a){let b;try{b=JSON.stringify(a)??"null"}catch{return{unserializable:!0}}return b.length<=2e4?a:{truncated:!0,bytes:b.length,preview:b.slice(0,1e3)}}function q(a,b){switch(a){case"tables":return{tables:Array.isArray(b)?b.length:0};case"rows":case"lookup":return{rows:r(b?.rows),columns:r(b?.columns),total:b?.total??null,estimated:b?.estimated??!1,capped:b?.capped??!1};case"query":{let a=Array.isArray(b?.statements)?b.statements:[];return{statements:a.length,commands:a.map(a=>a.command),rows:a.reduce((a,b)=>a+r(b.rows),0),durationMs:b?.durationMs??null}}case"cell.update":return{updated:+!!b?.row};case"rows.insert":return{inserted:+!!b?.row};case"rows.update":return{updated:b?.updated??0};case"rows.delete":return{deleted:b?.deleted??0};case"related":{let a=Array.isArray(b)?b:[];return{lookups:a.length,matched:a.reduce((a,b)=>a+r(b.rows),0)}}case"definition":return{sqlLength:"string"==typeof b?.sql?b.sql.length:0};case"ledger":return{initialized:b?.initialized??!1,entries:r(b?.entries)};case"migrate":return{version:b?.version??null,direction:b?.direction??null,statements:b?.statements??0,durationMs:b?.durationMs??null};case"adopt":return{recorded:b?.recorded??0,existing:b?.existing??0};case"detect":{let a=Array.isArray(b?.results)?b.results:[],c={};for(let b of a){let a=String(b.verdict);c[a]=(c[a]??0)+1}return{migrations:a.length,...c}}case"repo":return{sets:r(b?.sets),migrations:Array.isArray(b?.sets)?b.sets.reduce((a,b)=>a+r(b.steps),0):0,branch:b?.git?.branch??null};case"note":return{notePath:b?.notePath??null};case"schema":return{relations:r(b?.relations),enums:r(b?.enums),functions:r(b?.functions),extensions:r(b?.extensions)};default:return}}function r(a){return Array.isArray(a)?a.length:0}},78335:()=>{},84152:(a,b,c)=>{"use strict";c.d(b,{VW:()=>g,fx:()=>f,ms:()=>h});var d=c(41834),e=c(70613);function f(a,b){return async c=>{let f;if("1"===process.env.VERCEL)return Response.json({error:"Database API is local-only"},{status:404});let g=performance.now();try{f=await c.json()}catch{return(0,e.L1)({source:"api",action:a,connection:null,status:"error",durationMs:Math.round(performance.now()-g),error:"Invalid JSON body"}),Response.json({error:"Invalid JSON body"},{status:400})}let h=(0,e.EB)(f?.connectionUrl),i=(0,e.Ai)(f);try{let c=await b(f);return(0,e.L1)({source:"api",action:a,connection:h,status:"ok",durationMs:Math.round(performance.now()-g),params:i,result:(0,e.v_)(a,c)}),Response.json(c)}catch(c){let b=(0,d.qX)(c);return(0,e.L1)({source:"api",action:a,connection:h,status:"error",durationMs:Math.round(performance.now()-g),params:i,error:b}),Response.json({error:b},{status:500})}}}function g(a,b){if("string"!=typeof a||0===a.length)throw Error(`Missing ${b}`);return a}function h(a,b="table"){if(!a||"object"!=typeof a)throw Error(`Missing ${b}`);return{schema:g(a.schema,`${b}.schema`),name:g(a.name,`${b}.name`)}}},89194:(a,b,c)=>{"use strict";c.d(b,{P7:()=>f,aH:()=>d});let d=1,e=["connection.add","connection.update","connection.remove","config.export","config.import","migrations.import","migrations.remove","migrations.folder","migrations.checkout"];function f(a){return"string"==typeof a&&e.includes(a)}},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/
|
|
1
|
+
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/OyIGZSorg5OrE1_BWj2Lr/_buildManifest.js","static/OyIGZSorg5OrE1_BWj2Lr/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-34eb118f56295776.js","static/chunks/4bd1b696-8a4ab4fdf0ae305a.js","static/chunks/3794-d7cddff008311ab3.js","static/chunks/main-app-f73ec34e89cb8fdd.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="__variable_246ccd __variable_c29908 dark h-full" data-theme="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/22a5144ee8d83bca-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/7d4881bb7e1bf84d-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/e02ab5db9ff2dca2.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/87a80461c6ff2903.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-34eb118f56295776.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-d7cddff008311ab3.js" async=""></script><script src="/_next/static/chunks/main-app-f73ec34e89cb8fdd.js" async=""></script><script src="/_next/static/chunks/223-a4fca67d979d899d.js" async=""></script><script src="/_next/static/chunks/app/layout-e3fdecae5544dc60.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>YTDB</title><meta name="description" content="A database management UI"/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/icon.svg?38bdd49dcdf01715" type="image/svg+xml" sizes="any"/><script>(function(){try{var allowed=["dark","light","one-dark-pro","nord","dracula","tokyo-night"];var light=["light"];var id="dark";var raw=localStorage.getItem("ytdb:theme")||localStorage.getItem("db-studio:theme");if(raw){var parsed=JSON.parse(raw);var value=parsed&&parsed.state&&parsed.state.theme;if(typeof value==="string"&&allowed.indexOf(value)!==-1)id=value;}var root=document.documentElement;root.setAttribute("data-theme",id);root.classList.toggle("dark",light.indexOf(id)===-1);}catch(e){}})();</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="flex min-h-full flex-col"><div hidden=""><!--$--><!--/$--></div><main class="grid min-h-dvh place-items-center bg-background px-6 text-foreground"><div class="max-w-lg space-y-4"><p class="font-mono text-xs tracking-[0.22em] text-muted-foreground">YTDB</p><h1 class="text-2xl font-semibold tracking-tight">Connecting to YTDB…</h1></div></main><script src="/_next/static/chunks/webpack-34eb118f56295776.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[72737,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"ThemeProvider\"]\n3:I[94821,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"ConvexClientProvider\"]\n4:I[48491,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"NavigationTracker\"]\n5:I[65377,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"LocalBridgeGate\"]\n6:I[57121,[],\"\"]\n7:I[74581,[],\"\"]\n8:I[90484,[],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nc:I[90484,[],\"ViewportBoundary\"]\ne:I[90484,[],\"MetadataBoundary\"]\n10:I[27123,[],\"default\",1]\n:HL[\"/_next/static/media/22a5144ee8d83bca-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/7d4881bb7e1bf84d-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/e02ab5db9ff2dca2.css\",\"style\"]\n:HL[\"/_next/static/css/87a80461c6ff2903.css\",\"style\"]\nb:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/e02ab5db9ff2dca2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/87a80461c6ff2903.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_246ccd __variable_c29908 dark h-full\",\"data-theme\":\"dark\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{var allowed=[\\\"dark\\\",\\\"light\\\",\\\"one-dark-pro\\\",\\\"nord\\\",\\\"dracula\\\",\\\"tokyo-night\\\"];var light=[\\\"light\\\"];var id=\\\"dark\\\";var raw=localStorage.getItem(\\\"ytdb:theme\\\")||localStorage.getItem(\\\"db-studio:theme\\\");if(raw){var parsed=JSON.parse(raw);var value=parsed\u0026\u0026parsed.state\u0026\u0026parsed.state.theme;if(typeof value===\\\"string\\\"\u0026\u0026allowed.indexOf(value)!==-1)id=value;}var root=document.documentElement;root.setAttribute(\\\"data-theme\\\",id);root.classList.toggle(\\\"dark\\\",light.indexOf(id)===-1);}catch(e){}})();\"}}]}],[\"$\",\"body\",null,{\"className\":\"flex min-h-full flex-col\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[[\"$\",\"$L4\",null,{}],[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,\"$b\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Le\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="__variable_246ccd __variable_c29908 dark h-full" data-theme="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/22a5144ee8d83bca-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/7d4881bb7e1bf84d-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/e02ab5db9ff2dca2.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/87a80461c6ff2903.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-34eb118f56295776.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-d7cddff008311ab3.js" async=""></script><script src="/_next/static/chunks/main-app-f73ec34e89cb8fdd.js" async=""></script><script src="/_next/static/chunks/223-a4fca67d979d899d.js" async=""></script><script src="/_next/static/chunks/app/layout-e3fdecae5544dc60.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>YTDB</title><meta name="description" content="A database management UI"/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/icon.svg?38bdd49dcdf01715" type="image/svg+xml" sizes="any"/><script>(function(){try{var allowed=["dark","light","one-dark-pro","nord","dracula","tokyo-night"];var light=["light"];var id="dark";var raw=localStorage.getItem("ytdb:theme")||localStorage.getItem("db-studio:theme");if(raw){var parsed=JSON.parse(raw);var value=parsed&&parsed.state&&parsed.state.theme;if(typeof value==="string"&&allowed.indexOf(value)!==-1)id=value;}var root=document.documentElement;root.setAttribute("data-theme",id);root.classList.toggle("dark",light.indexOf(id)===-1);}catch(e){}})();</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="flex min-h-full flex-col"><div hidden=""><!--$--><!--/$--></div><main class="grid min-h-dvh place-items-center bg-background px-6 text-foreground"><div class="max-w-lg space-y-4"><p class="font-mono text-xs tracking-[0.22em] text-muted-foreground">YTDB</p><h1 class="text-2xl font-semibold tracking-tight">Connecting to YTDB…</h1></div></main><script src="/_next/static/chunks/webpack-34eb118f56295776.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[72737,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"ThemeProvider\"]\n3:I[94821,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"ConvexClientProvider\"]\n4:I[48491,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"NavigationTracker\"]\n5:I[65377,[\"223\",\"static/chunks/223-a4fca67d979d899d.js\",\"7177\",\"static/chunks/app/layout-e3fdecae5544dc60.js\"],\"LocalBridgeGate\"]\n6:I[57121,[],\"\"]\n7:I[74581,[],\"\"]\n8:I[90484,[],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nc:I[90484,[],\"ViewportBoundary\"]\ne:I[90484,[],\"MetadataBoundary\"]\n10:I[27123,[],\"default\",1]\n:HL[\"/_next/static/media/22a5144ee8d83bca-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/7d4881bb7e1bf84d-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/e02ab5db9ff2dca2.css\",\"style\"]\n:HL[\"/_next/static/css/87a80461c6ff2903.css\",\"style\"]\nb:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/e02ab5db9ff2dca2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/87a80461c6ff2903.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_246ccd __variable_c29908 dark h-full\",\"data-theme\":\"dark\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{var allowed=[\\\"dark\\\",\\\"light\\\",\\\"one-dark-pro\\\",\\\"nord\\\",\\\"dracula\\\",\\\"tokyo-night\\\"];var light=[\\\"light\\\"];var id=\\\"dark\\\";var raw=localStorage.getItem(\\\"ytdb:theme\\\")||localStorage.getItem(\\\"db-studio:theme\\\");if(raw){var parsed=JSON.parse(raw);var value=parsed\u0026\u0026parsed.state\u0026\u0026parsed.state.theme;if(typeof value===\\\"string\\\"\u0026\u0026allowed.indexOf(value)!==-1)id=value;}var root=document.documentElement;root.setAttribute(\\\"data-theme\\\",id);root.classList.toggle(\\\"dark\\\",light.indexOf(id)===-1);}catch(e){}})();\"}}]}],[\"$\",\"body\",null,{\"className\":\"flex min-h-full flex-col\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[[\"$\",\"$L4\",null,{}],[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,\"$b\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Le\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"OyIGZSorg5OrE1_BWj2Lr\"}\n"])</script><script>self.__next_f.push([1,"b:C\nd:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"11:I[86869,[],\"IconMark\"]\na:null\nf:[[\"$\",\"title\",\"0\",{\"children\":\"YTDB\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"A database management UI\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?603d046c9a6fdfbb\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/icon.svg?38bdd49dcdf01715\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$L11\",\"4\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-34eb118f56295776.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-d7cddff008311ab3.js" async=""></script><script src="/_next/static/chunks/main-app-f73ec34e89cb8fdd.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-34eb118f56295776.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-34eb118f56295776.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-d7cddff008311ab3.js" async=""></script><script src="/_next/static/chunks/main-app-f73ec34e89cb8fdd.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-34eb118f56295776.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"OyIGZSorg5OrE1_BWj2Lr\"}\n"])</script><script>self.__next_f.push([1,"7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
|