@prisma/studio-core 0.0.0-dev.202504151339 → 0.0.0-dev.202504151421
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/dist/{adapter-DnrnbSIC.d.ts → adapter-DOfxRYJO.d.cts} +23 -6
- package/dist/{adapter-B6MTgAD1.d.cts → adapter-dDnGaS1S.d.ts} +23 -6
- package/dist/{chunk-YMPRBKIC.js → chunk-BSQUEOOL.js} +1 -1
- package/dist/data/accelerate/index.d.cts +2 -2
- package/dist/data/accelerate/index.d.ts +2 -2
- package/dist/data/bff/index.d.cts +2 -2
- package/dist/data/bff/index.d.ts +2 -2
- package/dist/data/index.d.cts +3 -3
- package/dist/data/index.d.ts +3 -3
- package/dist/data/pglite/index.cjs +1 -1
- package/dist/data/pglite/index.d.cts +3 -3
- package/dist/data/pglite/index.d.ts +3 -3
- package/dist/data/pglite/index.js +1 -1
- package/dist/data/postgres-core/index.cjs +1 -1
- package/dist/data/postgres-core/index.d.cts +8 -4
- package/dist/data/postgres-core/index.d.ts +8 -4
- package/dist/data/postgres-core/index.js +1 -1
- package/dist/{executor-CySfZPUK.d.ts → executor-DI7JTcqO.d.ts} +1 -1
- package/dist/{executor-BLAClqkI.d.cts → executor-DbZM00RR.d.cts} +1 -1
- package/dist/{index-RCHJGGEM.css → index-ESMXH6DI.css} +0 -3
- package/dist/type-utils-u92OZz8n.d.cts +4 -0
- package/dist/type-utils-u92OZz8n.d.ts +4 -0
- package/dist/ui/index.cjs +32 -32
- package/dist/ui/index.d.cts +2 -2
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/package.json +1 -2
- package/dist/type-utils-rTHUvEmt.d.cts +0 -3
- package/dist/type-utils-rTHUvEmt.d.ts +0 -3
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { A as Adapter } from '../adapter-
|
|
3
|
-
import '../type-utils-
|
|
2
|
+
import { A as Adapter } from '../adapter-DOfxRYJO.cjs';
|
|
3
|
+
import '../type-utils-u92OZz8n.cjs';
|
|
4
4
|
|
|
5
5
|
interface StudioProps {
|
|
6
6
|
adapter: Adapter;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { A as Adapter } from '../adapter-
|
|
3
|
-
import '../type-utils-
|
|
2
|
+
import { A as Adapter } from '../adapter-dDnGaS1S.js';
|
|
3
|
+
import '../type-utils-u92OZz8n.js';
|
|
4
4
|
|
|
5
5
|
interface StudioProps {
|
|
6
6
|
adapter: Adapter;
|
package/dist/ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as be,aa as Re,c as b,q as we,r as ke,t as ve}from"../chunk-N2MLAUEV.js";import"../chunk-2FW6TKD6.js";import"../index-RCHJGGEM.css";import{useQuery as at}from"@tanstack/react-query";import{QueryClient as Qa,QueryClientProvider as Za}from"@tanstack/react-query";import*as y from"react";import{onlineManager as Na,useQueryClient as Ea}from"@tanstack/react-query";var $e=class{#a;#f;#i;#n;#e=!1;#c;#t;#o;#u;#l;#s;#r;#d;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:u,buttonPosition:d,position:s,initialIsOpen:f,errorTypes:x,styleNonce:m,shadowDOMTarget:D}=e;this.#a=b(a),this.#i=t,this.#n=o,this.#f=u,this.#c=m,this.#t=D,this.#o=b(d),this.#u=b(s),this.#l=b(f),this.#s=b(x)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#u[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#s[1](e)}setClient(e){this.#a[1](e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=be(()=>{let t=this,[o]=this.#o,[u]=this.#u,[d]=this.#l,[s]=this.#s,[f]=this.#a,x;return this.#r?x=this.#r:(x=ve(()=>import("../CPIOZS5X-NALOZFPD.js")),this.#r=x),Re(this.#c,this.#t),we(x,ke({get queryFlavor(){return t.#i},get version(){return t.#n},get onlineManager(){return t.#f},get shadowDOMTarget(){return t.#t}},{get client(){return f()},get buttonPosition(){return o()},get position(){return u()},get initialIsOpen(){return d()},get errorTypes(){return s()}}))},e);this.#e=!0,this.#d=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#d?.(),this.#e=!1}},je=class{#a;#f;#i;#n;#e=!1;#c;#t;#o;#u;#l;#s;#r;#d;#p;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:u,buttonPosition:d,position:s,initialIsOpen:f,errorTypes:x,styleNonce:m,shadowDOMTarget:D,onClose:C}=e;this.#a=b(a),this.#i=t,this.#n=o,this.#f=u,this.#c=m,this.#t=D,this.#o=b(d),this.#u=b(s),this.#l=b(f),this.#s=b(x),this.#r=b(C)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#u[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#s[1](e)}setClient(e){this.#a[1](e)}setOnClose(e){this.#r[1](()=>e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=be(()=>{let t=this,[o]=this.#o,[u]=this.#u,[d]=this.#l,[s]=this.#s,[f]=this.#a,[x]=this.#r,m;return this.#d?m=this.#d:(m=ve(()=>import("../OKF6E45R-6KC3BLVB.js")),this.#d=m),Re(this.#c,this.#t),we(m,ke({get queryFlavor(){return t.#i},get version(){return t.#n},get onlineManager(){return t.#f},get shadowDOMTarget(){return t.#t}},{get client(){return f()},get buttonPosition(){return o()},get position(){return u()},get initialIsOpen(){return d()},get errorTypes(){return s()},get onClose(){return x()}}))},e);this.#e=!0,this.#p=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#p?.(),this.#e=!1}};import{jsx as Ga}from"react/jsx-runtime";function Ye(e){let a=Ea(e.client),t=y.useRef(null),{buttonPosition:o,position:u,initialIsOpen:d,errorTypes:s,styleNonce:f,shadowDOMTarget:x}=e,[m]=y.useState(new $e({client:a,queryFlavor:"React Query",version:"5",onlineManager:Na,buttonPosition:o,position:u,initialIsOpen:d,errorTypes:s,styleNonce:f,shadowDOMTarget:x}));return y.useEffect(()=>{m.setClient(a)},[a,m]),y.useEffect(()=>{o&&m.setButtonPosition(o)},[o,m]),y.useEffect(()=>{u&&m.setPosition(u)},[u,m]),y.useEffect(()=>{m.setInitialIsOpen(d||!1)},[d,m]),y.useEffect(()=>{m.setErrorTypes(s||[])},[s,m]),y.useEffect(()=>(t.current&&m.mount(t.current),()=>{m.unmount()}),[m]),Ga("div",{dir:"ltr",className:"tsqd-parent-container",ref:t})}import*as O from"react";import{onlineManager as Va,useQueryClient as Wa}from"@tanstack/react-query";import{jsx as Xa}from"react/jsx-runtime";function ea(e){let a=Wa(e.client),t=O.useRef(null),{errorTypes:o,styleNonce:u,shadowDOMTarget:d}=e,[s]=O.useState(new je({client:a,queryFlavor:"React Query",version:"5",onlineManager:Va,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:o,styleNonce:u,shadowDOMTarget:d,onClose:e.onClose}));return O.useEffect(()=>{s.setClient(a)},[a,s]),O.useEffect(()=>{s.setOnClose(e.onClose??(()=>{}))},[e.onClose,s]),O.useEffect(()=>{s.setErrorTypes(o||[])},[o,s]),O.useEffect(()=>(t.current&&s.mount(t.current),()=>{s.unmount()}),[s]),Xa("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:t})}var aa=process.env.NODE_ENV!=="development"?function(){return null}:Ye,Bo=process.env.NODE_ENV!=="development"?function(){return null}:ea;import{NuqsAdapter as Ja}from"nuqs/adapters/react";import{createContext as _a,useContext as $a,useState as ja}from"react";import{jsx as ye,jsxs as et}from"react/jsx-runtime";var Ya=new Qa,ta=_a(void 0);function oa(e){let{children:a,...t}=e,[o,u]=ja(null);return et(Za,{client:Ya,children:[ye(aa,{}),ye(Ja,{children:ye(ta.Provider,{value:{...t,activeTable:o,setActiveTable:u},children:a})})]})}function W(){let e=$a(ta);if(!e)throw new Error("`useStudio` must be used within a `StudioContext.Provider`");return e}function ua(){let{activeTable:e,adapter:a}=W();return at({enabled:!!e,gcTime:0,queryFn:async({signal:t})=>{let[o,u]=await a.query({table:e.name,schema:e.schema},{abortSignal:t});if(o)throw o;return u},queryKey:["schema",e?.schema,"table",e?.name,"query"],staleTime:1/0})}import{DndContext as zt,MouseSensor as Vt,useSensor as Wt,useSensors as Xt}from"@dnd-kit/core";import{horizontalListSortingStrategy as Kt,SortableContext as Qt,useSortable as Zt}from"@dnd-kit/sortable";import{CSS as Jt}from"@dnd-kit/utilities";import{getCoreRowModel as _t,getFilteredRowModel as $t,getPaginationRowModel as jt,getSortedRowModel as Yt,useReactTable as eo}from"@tanstack/react-table";import{useEffect as ao,useMemo as to,useState as te}from"react";import*as H from"react";import{clsx as tt}from"clsx";import{twMerge as ot}from"tailwind-merge";function l(...e){return ot(tt(e))}import{jsx as U}from"react/jsx-runtime";var Me=H.forwardRef(({className:e,...a},t)=>U("div",{className:"ps-relative ps-w-full ps-overflow-auto ps-flex ps-items-start ps-h-full",children:U("table",{ref:t,className:l("ps-w-full ps-caption-bottom ps-text-sm table-fixed",e),...a})}));Me.displayName="Table";var De=H.forwardRef(({className:e,...a},t)=>U("thead",{ref:t,className:l("[&_tr]:ps-border-b",e),...a}));De.displayName="TableHeader";var Ae=H.forwardRef(({className:e,...a},t)=>U("tbody",{ref:t,className:l("[&_tr:last-child]:ps-border-0",e),...a}));Ae.displayName="TableBody";var ut=H.forwardRef(({className:e,...a},t)=>U("tfoot",{ref:t,className:l("ps-border-t ps-bg-muted/50 ps-font-medium [&>tr]:last:ps-border-b-0",e),...a}));ut.displayName="TableFooter";var de=H.forwardRef(({className:e,...a},t)=>U("tr",{ref:t,className:l("ps-border-b ps-transition-colors hover:ps-bg-muted/50 data-[state=selected]:ps-bg-muted",e),...a}));de.displayName="TableRow";var ge=H.forwardRef(({className:e,...a},t)=>U("th",{ref:t,className:l("ps-h-10 ps-px-2 ps-text-left ps-align-middle ps-font-medium ps-text-muted-foreground [&:has([role=checkbox])]:ps-pr-0 [&>[role=checkbox]]:ps-translate-y-[2px]",e),...a}));ge.displayName="TableHead";var fe=H.forwardRef(({className:e,...a},t)=>U("td",{ref:t,className:l("ps-p-2 ps-align-middle [&:has([role=checkbox])]:ps-pr-0 [&>[role=checkbox]]:ps-translate-y-[2px]",e),...a}));fe.displayName="TableCell";var lt=H.forwardRef(({className:e,...a},t)=>U("caption",{ref:t,className:l("ps-mt-4 ps-text-sm ps-text-muted-foreground",e),...a}));lt.displayName="TableCaption";import{tokyoNight as St}from"@uiw/codemirror-theme-tokyo-night";import Pt from"@uiw/react-codemirror";import*as N from"@radix-ui/react-popover";import*as P from"react";import{jsx as ie}from"react/jsx-runtime";var la=P.createContext(null),Te=({children:e,...a})=>{let[t,o]=P.useState(!1);return ie(la.Provider,{value:{open:t,setOpen:o},children:ie(N.Root,{open:t,onOpenChange:o,...a,children:e})})};Te.displayName="PopoverCell";var Be=P.forwardRef(({children:e,onDoubleClick:a,className:t,...o},u)=>{let d=P.useContext(la),[s,f]=P.useState(!1),x=P.useRef(null);return P.useEffect(()=>{let C=F=>{let se=F.target;x.current&&!x.current.contains(se)&&(console.log("Outside click - removing focus"),f(!1))};return document.addEventListener("click",C),()=>document.removeEventListener("click",C)},[]),ie(N.Trigger,{ref:C=>{typeof u=="function"?u(C):u&&(u.current=C),x.current=C},onClick:C=>{C.preventDefault(),console.log("Click handler - setting focus to true"),f(!0)},onDoubleClick:C=>{C.preventDefault(),d?.setOpen(!0),a?.()},"data-focus":s.toString(),className:l("w-full h-full cursor-pointer",t),...o,children:e})});Be.displayName="PopoverCellTrigger";var Fe=P.forwardRef(({className:e,align:a="center",sideOffset:t=4,...o},u)=>ie(N.Portal,{children:ie(N.Content,{ref:u,align:a,sideOffset:t,className:l("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Fe.displayName=N.Content.displayName;var _=e=>{if(e==null)return"NULL";if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch(a){return console.error("Error stringifying value:",a),String(e)}return String(e)};import sa from"dayjs";import st from"dayjs/plugin/localizedFormat";sa.extend(st);function ra(e){let a=e;try{let s=JSON.parse(e);a=typeof s=="string"?s:e}catch{a=e.replace(/^"|"$/g,"")}let t=new Date(a),o=navigator.language||"en",u=new Intl.DateTimeFormat(o,{timeZoneName:"short"}).formatToParts(t).find(s=>s.type==="timeZoneName")?.value||"";return{date:sa(a).locale(o).format("LLL"),timezone:u}}import{jsx as rt,jsxs as dt}from"react/jsx-runtime";var da=({value:e})=>{let{date:a,timezone:t}=ra(e);return dt("div",{className:"ps-flex ps-gap-1 ps-items-end",children:[a,rt("span",{className:"ps-text-xs ps-text-gray-500",children:t})]})};import{jsx as ft}from"react/jsx-runtime";function fa(){return ft("code",{className:"ps-text-gray-500",children:"NULL"})}import{forwardRef as nt,createElement as ct}from"react";var ia=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),he=(...e)=>e.filter((a,t,o)=>!!a&&o.indexOf(a)===t).join(" ");import{forwardRef as it,createElement as ca}from"react";var na={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var pa=it(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:u="",children:d,iconNode:s,...f},x)=>ca("svg",{ref:x,...na,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:he("lucide",u),...f},[...s.map(([m,D])=>ca(m,D)),...Array.isArray(d)?d:[d]]));var L=(e,a)=>{let t=nt(({className:o,...u},d)=>ct(pa,{ref:d,iconNode:a,className:he(`lucide-${ia(e)}`,o),...u}));return t.displayName=`${e}`,t};var X=L("ArrowDownWideNarrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);var ne=L("ArrowUpWideNarrow",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]]);var E=L("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var ae=L("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var ce=L("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var G=L("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var pe=L("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var me=L("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);var Le=L("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var $=L("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var xe=L("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var K=L("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var Ie=L("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var Ce=L("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);import{isValidElement as ht}from"react";import*as n from"@radix-ui/react-context-menu";import*as z from"react";import{jsx as w,jsxs as Ue}from"react/jsx-runtime";var ma=n.Root,La=n.Trigger;var pt=z.forwardRef(({className:e,inset:a,children:t,...o},u)=>Ue(n.SubTrigger,{ref:u,className:l("ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[state=open]:ps-bg-accent data-[state=open]:ps-text-accent-foreground",a&&"ps-pl-8",e),...o,children:[t,w(G,{className:"ps-ml-auto ps-h-4 ps-w-4"})]}));pt.displayName=n.SubTrigger.displayName;var mt=z.forwardRef(({className:e,...a},t)=>w(n.SubContent,{ref:t,className:l("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a}));mt.displayName=n.SubContent.displayName;var qe=z.forwardRef(({className:e,...a},t)=>w(n.Portal,{children:w(n.Content,{ref:t,className:l("ps-z-50 ps-max-h-[--radix-context-menu-content-available-height] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a})}));qe.displayName=n.Content.displayName;var Oe=z.forwardRef(({className:e,inset:a,...t},o)=>w(n.Item,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",a&&"ps-pl-8",e),...t}));Oe.displayName=n.Item.displayName;var Lt=z.forwardRef(({className:e,children:a,checked:t,...o},u)=>Ue(n.CheckboxItem,{ref:u,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[w("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:w(n.ItemIndicator,{children:w(E,{className:"ps-h-4 ps-w-4"})})}),a]}));Lt.displayName=n.CheckboxItem.displayName;var xt=z.forwardRef(({className:e,children:a,...t},o)=>Ue(n.RadioItem,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[w("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:w(n.ItemIndicator,{children:w($,{className:"ps-h-4 ps-w-4 ps-fill-current"})})}),a]}));xt.displayName=n.RadioItem.displayName;var It=z.forwardRef(({className:e,inset:a,...t},o)=>w(n.Label,{ref:o,className:l("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold ps-text-foreground",a&&"ps-pl-8",e),...t}));It.displayName=n.Label.displayName;var Ct=z.forwardRef(({className:e,...a},t)=>w(n.Separator,{ref:t,className:l("ps--mx-1 ps-my-1 ps-h-px ps-bg-border",e),...a}));Ct.displayName=n.Separator.displayName;var gt=({className:e,...a})=>w("span",{className:l("ps-ml-auto ps-text-xs ps-tracking-widest ps-text-muted-foreground",e),...a});gt.displayName="ContextMenuShortcut";import{jsx as He,jsxs as xa}from"react/jsx-runtime";function Ia(e){let{children:a}=e;return xa(ma,{children:[He(La,{className:"ps-block ps-w-full ps-p-[var(--studio-cell-spacing)]",children:a}),He(qe,{children:xa(Oe,{onClick:()=>{let t=Ne(a);navigator.clipboard.writeText(t).catch(o=>{console.error("Failed to copy to clipboard:",o)})},className:"ps-flex ps-items-center ps-gap-2",children:[He(xe,{size:12}),"Copy"]})})]})}function Ne(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(e==null)return"";if(ht(e)){let a=e.props;return e.type&&typeof e.type=="function"&&e.type.name==="RevealText"?a.text||"":e.type&&typeof e.type=="function"&&e.type.name==="NullValue"?"NULL":a.children?Ne(a.children):""}return Array.isArray(e)?e.map(Ne).join(""):""}function Q(e){let a=e.getIsPinned(),t=a==="left"&&e.getIsLastColumn("left"),o=a==="right"&&e.getIsFirstColumn("right");return{className:l("ps-overflow-hidden ps-whitespace-nowrap ps-text-ellipsis",a&&["ps-sticky ps-bg-background ps-shadow-[1px_0_0_0_hsl(var(--border))]",a==="left"?"ps-left-0":"ps-right-0","ps-z-20"],!a&&"ps-relative ps-z-10",t&&"ps-shadow-[1px_0_0_0_hsl(var(--border))]",o&&"ps-shadow-[-1px_0_0_0_hsl(var(--border))]"),style:{width:e.getSize(),left:a==="left"?`${e.getStart("left")}px`:void 0,right:a==="right"?`${e.getAfter("right")}px`:void 0}}}import{jsx as M,jsxs as vt}from"react/jsx-runtime";function wt(e,a,t){if(t)return M(fa,{});switch(a){case"datetime":return M(da,{value:_(e)});case"string":return M("div",{children:_(e)});case"time":return M("div",{children:_(e)});case"unsupported":return M("div",{children:_(e)});case void 0:return M("div",{children:_(e)});default:kt(a)}}function kt(e){throw new Error(`Unhandled datatype group: ${e}`)}function Ca(e){let{cell:a}=e,t=a.getValue(),o=t==null,d=a.column.columnDef.meta?.datatype?.group,s=a.column.id;return vt(Te,{children:[M(Be,{asChild:!0,children:M(fe,{...Q(a.column),className:l(Q(a.column).className,"ps-p-0",a.column.getIsPinned()&&"ps-sticky"),"data-type":d||"undefined","data-column":s,children:M(Ia,{children:wt(t,d,o)})})}),M(Fe,{align:"start",alignOffset:0,sideOffset:0,className:"ps-min-w-(--radix-popover-trigger-width) ps-rounded-none ps-bg-muted ps-p-0 ps-z-10",children:M(Pt,{value:_(t),theme:St,height:"100px",basicSetup:{lineNumbers:!0,foldGutter:!1,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!1},onChange:f=>{console.log("New value:",f)}})})]},a.id)}import{flexRender as Ut}from"@tanstack/react-table";import{Slot as bt}from"@radix-ui/react-slot";import{cva as Rt}from"class-variance-authority";import*as ga from"react";import{jsx as Mt}from"react/jsx-runtime";var yt=Rt("ps-inline-flex ps-items-center ps-justify-center ps-gap-2 ps-whitespace-nowrap ps-rounded-md ps-text-sm ps-font-medium ps-transition-colors focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-pointer-events-none disabled:ps-opacity-50 [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",{variants:{variant:{default:"ps-bg-primary ps-text-primary-foreground ps-shadow hover:ps-bg-primary/90",destructive:"ps-bg-destructive ps-text-destructive-foreground ps-shadow-sm hover:ps-bg-destructive/90",outline:"ps-border ps-border-input ps-bg-background ps-shadow-sm hover:ps-bg-accent hover:ps-text-accent-foreground",secondary:"ps-bg-secondary ps-text-secondary-foreground ps-shadow-sm hover:ps-bg-secondary/80",ghost:"hover:ps-bg-accent hover:ps-text-accent-foreground",link:"ps-text-primary ps-underline-offset-4 hover:ps-underline"},size:{default:"ps-h-9 ps-px-4 ps-py-2",sm:"ps-h-8 ps-rounded-md ps-px-3 ps-text-xs",lg:"ps-h-10 ps-rounded-md ps-px-8",icon:"ps-h-9 ps-w-9"}},defaultVariants:{variant:"default",size:"default"}}),B=ga.forwardRef(({className:e,variant:a,size:t,asChild:o=!1,...u},d)=>Mt(o?bt:"button",{className:l(yt({variant:a,size:t,className:e})),ref:d,...u}));B.displayName="Button";import*as c from"@radix-ui/react-dropdown-menu";import*as V from"react";import{jsx as k,jsxs as Ge}from"react/jsx-runtime";var ha=c.Root,Sa=c.Trigger;var Dt=V.forwardRef(({className:e,inset:a,children:t,...o},u)=>Ge(c.SubTrigger,{ref:u,className:l("ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent data-[state=open]:ps-bg-accent [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",a&&"ps-pl-8",e),...o,children:[t,k(G,{className:"ps-ml-auto"})]}));Dt.displayName=c.SubTrigger.displayName;var At=V.forwardRef(({className:e,...a},t)=>k(c.SubContent,{ref:t,className:l("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...a}));At.displayName=c.SubContent.displayName;var Ee=V.forwardRef(({className:e,sideOffset:a=4,...t},o)=>k(c.Portal,{children:k(c.Content,{ref:o,sideOffset:a,className:l("ps-z-50 ps-max-h-[var(--radix-dropdown-menu-content-available-height)] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md","data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...t})}));Ee.displayName=c.Content.displayName;var Se=V.forwardRef(({className:e,inset:a,...t},o)=>k(c.Item,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50 [&>svg]:ps-size-4 [&>svg]:ps-shrink-0",a&&"ps-pl-8",e),...t}));Se.displayName=c.Item.displayName;var Tt=V.forwardRef(({className:e,children:a,checked:t,...o},u)=>Ge(c.CheckboxItem,{ref:u,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[k("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:k(c.ItemIndicator,{children:k(E,{className:"ps-h-4 ps-w-4"})})}),a]}));Tt.displayName=c.CheckboxItem.displayName;var Bt=V.forwardRef(({className:e,children:a,...t},o)=>Ge(c.RadioItem,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[k("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:k(c.ItemIndicator,{children:k($,{className:"ps-h-2 ps-w-2 ps-fill-current"})})}),a]}));Bt.displayName=c.RadioItem.displayName;var Ft=V.forwardRef(({className:e,inset:a,...t},o)=>k(c.Label,{ref:o,className:l("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold",a&&"ps-pl-8",e),...t}));Ft.displayName=c.Label.displayName;var qt=V.forwardRef(({className:e,...a},t)=>k(c.Separator,{ref:t,className:l("ps--mx-1 ps-my-1 ps-h-px ps-bg-muted",e),...a}));qt.displayName=c.Separator.displayName;var Ot=({className:e,...a})=>k("span",{className:l("ps-ml-auto ps-text-xs ps-tracking-widest ps-opacity-60",e),...a});Ot.displayName="DropdownMenuShortcut";import{jsx as v,jsxs as Z}from"react/jsx-runtime";function ze(e){let{header:a}=e;return Z("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full ps-h-full",children:[Z("div",{className:"ps-flex-1 ps-flex ps-items-center ps-justify-between",children:[Z("div",{className:"ps-align-text-bottom ps-leading-none ps-h-[20px]",children:[v("span",{className:"ps-inline-block ps-text-foreground ps-font-bold ps-text-sm",children:a.isPlaceholder?null:Ut(a.column.columnDef.header,a.getContext())}),v("span",{className:"ps-inline-block ps-ml-2 ps-text-xs ps-font-mono ps-text-muted-foreground/70 ps-lowercase",children:a.column.columnDef.meta.datatype.name})]}),v("span",{className:"ps-flex ps-items-center ps-gap-1",children:a.column.getCanPin()&&a.column.id!=="select"&&Z(ha,{children:[v(Sa,{asChild:!0,children:v(B,{variant:"ghost",size:"icon",children:v(K,{size:16})})}),Z(Ee,{children:[a.column.getCanSort()&&v(Se,{onClick:()=>a.column.toggleSorting(a.column.getIsSorted()==="asc"),children:Z("span",{className:"ps-flex ps-items-center ps-gap-2",children:[a.column.getIsSorted()==="asc"?v(X,{size:16}):v(ne,{size:16}),a.column.getIsSorted()==="asc"?"Sort descending":"Sort ascending"]})}),v(Se,{onClick:()=>a.column.pin(a.column.getIsPinned()?!1:"left"),children:a.column.getIsPinned()?Z("span",{className:"ps-flex ps-items-center ps-gap-2",children:[v(Ie,{size:16}),"Unpin column"]}):Z("span",{className:"ps-flex ps-items-center ps-gap-2",children:[v(Ce,{size:16}),"Pin column"]})})]})]})})]}),a.column.getCanResize()&&v("button",{type:"button",tabIndex:0,onMouseDown:t=>{t.stopPropagation(),a.getResizeHandler()(t)},onTouchStart:t=>{t.stopPropagation(),a.getResizeHandler()(t)},onClick:t=>t.stopPropagation(),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),a.getResizeHandler()(t))},className:l("ps-absolute ps-right-0 ps-top-0 ps-h-full ps-w-3 ps-cursor-col-resize","ps-select-none ps-touch-none ps-transition-colors ps-group","ps-border-0 ps-bg-transparent",a.column.getIsResizing()&&"ps-bg-gray-300","before:ps-absolute before:ps-right-[3px] before:ps-top-1/2 before:ps--translate-y-1/2","after:ps-absolute after:ps-right-[7px] after:ps-top-1/2 after:ps--translate-y-1/2","before:ps-w-[2px] before:ps-h-0 before:ps-bg-gray-400 before:ps-rounded-full before:ps-opacity-0","after:ps-w-[2px] after:ps-h-0 after:ps-bg-gray-400 after:ps-rounded-full after:ps-opacity-0","before:ps-transition-all before:ps-duration-200","after:ps-transition-all after:ps-duration-200","group-hover:before:ps-opacity-100","group-hover:after:ps-opacity-100","group-hover:before:ps-h-4","group-hover:after:ps-h-4","group-active:ps-bg-transparent group-active:before:ps-bg-white group-active:after:ps-bg-white",a.column.getIsResizing()&&"before:ps-opacity-100"),"aria-label":"Resize column"})]})}import*as Pa from"react";import{jsx as Ht}from"react/jsx-runtime";var Ve=Pa.forwardRef(({className:e,type:a,...t},o)=>Ht("input",{type:a,className:l("ps-flex ps-h-9 ps-w-full ps-rounded-md ps-border ps-border-input ps-bg-transparent ps-px-3 ps-py-1 ps-text-base ps-shadow-sm ps-transition-colors file:ps-border-0 file:ps-bg-transparent file:ps-text-sm file:ps-font-medium file:ps-text-foreground placeholder:ps-text-muted-foreground focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50 md:ps-text-sm",e),ref:o,...t}));Ve.displayName="Input";import*as p from"@radix-ui/react-select";import*as J from"react";import{jsx as h,jsxs as Qe}from"react/jsx-runtime";var wa=p.Root;var ka=p.Value,We=J.forwardRef(({className:e,children:a,...t},o)=>Qe(p.Trigger,{ref:o,className:l("ps-flex ps-h-9 ps-w-full ps-items-center ps-justify-between ps-whitespace-nowrap ps-rounded-md ps-border ps-border-input ps-bg-transparent ps-px-3 ps-py-2 ps-text-sm ps-shadow-sm ps-ring-offset-background data-[placeholder]:ps-text-muted-foreground focus:ps-outline-none focus:ps-ring-1 focus:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50 [&>span]:ps-line-clamp-1",e),...t,children:[a,h(p.Icon,{asChild:!0,children:h(ae,{className:"ps-h-4 ps-w-4 ps-opacity-50"})})]}));We.displayName=p.Trigger.displayName;var va=J.forwardRef(({className:e,...a},t)=>h(p.ScrollUpButton,{ref:t,className:l("ps-flex ps-cursor-default ps-items-center ps-justify-center ps-py-1",e),...a,children:h(pe,{className:"ps-h-4 ps-w-4"})}));va.displayName=p.ScrollUpButton.displayName;var ba=J.forwardRef(({className:e,...a},t)=>h(p.ScrollDownButton,{ref:t,className:l("ps-flex ps-cursor-default ps-items-center ps-justify-center ps-py-1",e),...a,children:h(ae,{className:"ps-h-4 ps-w-4"})}));ba.displayName=p.ScrollDownButton.displayName;var Xe=J.forwardRef(({className:e,children:a,position:t="popper",...o},u)=>h(p.Portal,{children:Qe(p.Content,{ref:u,className:l("ps-relative ps-z-50 ps-max-h-[--radix-select-content-available-height] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-text-popover-foreground ps-shadow-md data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-select-content-transform-origin]",t==="popper"&&"data-[side=bottom]:ps-translate-y-1 data-[side=left]:ps--translate-x-1 data-[side=right]:ps-translate-x-1 data-[side=top]:ps--translate-y-1",e),position:t,...o,children:[h(va,{}),h(p.Viewport,{className:l("ps-p-1",t==="popper"&&"ps-h-[var(--radix-select-trigger-height)] ps-w-full ps-min-w-[var(--radix-select-trigger-width)]"),children:a}),h(ba,{})]})}));Xe.displayName=p.Content.displayName;var Nt=J.forwardRef(({className:e,...a},t)=>h(p.Label,{ref:t,className:l("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold",e),...a}));Nt.displayName=p.Label.displayName;var Ke=J.forwardRef(({className:e,children:a,...t},o)=>Qe(p.Item,{ref:o,className:l("ps-relative ps-flex ps-w-full ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-2 ps-pr-8 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[h("span",{className:"ps-absolute ps-right-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:h(p.ItemIndicator,{children:h(E,{className:"ps-h-4 ps-w-4"})})}),h(p.ItemText,{children:a})]}));Ke.displayName=p.Item.displayName;var Et=J.forwardRef(({className:e,...a},t)=>h(p.Separator,{ref:t,className:l("ps--mx-1 ps-my-1 ps-h-px ps-bg-muted",e),...a}));Et.displayName=p.Separator.displayName;import{jsx as S,jsxs as j}from"react/jsx-runtime";var Gt=[10,20,50,100];function Ra(e){let{className:a,table:t,variant:o="basic"}=e,{pageSize:u,pageIndex:d}=t.getState().pagination,s=t.getPageCount();return S("div",{className:l("ps-flex ps-items-center ps-justify-between ps-space-x-2 ps-py-4 ps-px-4",a),children:o==="basic"?j("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[S(B,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:"Previous"}),S(B,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:"Next"})]}):j("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[j("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[S(B,{variant:"outline",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:S(me,{className:"ps-w-4 ps-h-4"})}),S(B,{variant:"outline",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:S(ce,{className:"ps-w-4 ps-h-4"})}),j("div",{className:"ps-flex ps-items-center ps-gap-1 ps-text-xs ps-font-medium",children:["Page",S(Ve,{type:"number",min:1,max:s,value:d+1,className:"ps-w-12",onChange:f=>{let x=f.target.value?Number(f.target.value)-1:0;t.setPageIndex(x)}}),j("span",{className:"ps-shrink-0 ps-w-max",children:["of ",s]})]}),S(B,{variant:"outline",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:S(G,{className:"ps-w-4 ps-h-4"})}),S(B,{variant:"outline",onClick:()=>t.setPageIndex(s-1),disabled:!t.getCanNextPage(),children:S(Le,{className:"ps-w-4 ps-h-4"})})]}),j(wa,{value:u.toString(),onValueChange:f=>t.setPageSize(Number(f)),children:[S(We,{children:S(ka,{})}),S(Xe,{children:Gt.map(f=>j(Ke,{value:f.toString(),children:[f," per page"]},f))})]})]})})}import{jsx as I,jsxs as Ze}from"react/jsx-runtime";var oo=e=>{let{children:a,className:t,header:o,style:u}=e,{attributes:d,listeners:s,transform:f,transition:x,setNodeRef:m,isDragging:D,isOver:C}=Zt({id:o.id});return Ze(ge,{ref:m,...d,...s,style:{cursor:"grab",touchAction:"none",transform:Jt.Transform.toString(f),transition:x,...u},className:l("ps-group",t,D&&"ps-opacity-50",C&&"ps-bg-gray-100","ps-select-none ps-touch-none ps-relative",o.column.getIsPinned()&&"ps-sticky"),children:[a,C&&I("div",{className:"ps-absolute ps-inset-0 ps-border-2 ps-border-primary ps-rounded-sm ps-pointer-events-none"})]})};function ya(e){let{columns:a,isLoading:t,rows:o}=e,[u,d]=te([]),[s,f]=te([]),[x,m]=te({}),[D,C]=te({left:[],right:[]}),[F,se]=te([]),[Ba,Fa]=te(""),re=to(()=>Object.values(a).map(g=>({accessorKey:g.name,header:()=>I("div",{className:"ps-font-medium",children:g.name}),meta:g})),[a]);ao(()=>{let g=re.map(T=>T.accessorKey);if(F.length===0){se(g);return}let i=[...F],R=i.filter(T=>!re.some(ee=>ee.accessorKey===T));R.forEach(T=>{let ee=i.indexOf(T);ee!==-1&&i.splice(ee,1)});let A=g.filter(T=>!i.includes(T));A.length>0&&i.push(...A),(R.length>0||A.length>0)&&se(i)},[re,F]);let qa=Wt(Vt,{activationConstraint:{distance:10}}),Oa=Xt(qa),Ua=g=>{let{active:i,over:R}=g;if(R&&i.id!==R.id){let A=q.getColumn(i.id),T=q.getColumn(R.id);if(!A||!T)return;let ee=A.getIsPinned(),Ha=T.getIsPinned();if(ee!==Ha)return;let Je=F.indexOf(i.id),_e=F.indexOf(R.id);if(Je===-1||_e===-1)return;let Pe=[...F];Pe.splice(Je,1),Pe.splice(_e,0,i.id),se(Pe)}},q=eo({columns:re,data:o,defaultColumn:{size:200,minSize:50,maxSize:500},getCoreRowModel:_t(),onSortingChange:d,getSortedRowModel:Yt(),getPaginationRowModel:jt(),getFilteredRowModel:$t(),onColumnFiltersChange:f,enableColumnResizing:!0,columnResizeMode:"onChange",onColumnSizingChange:m,enableColumnPinning:!0,onColumnPinningChange:C,onGlobalFilterChange:Fa,globalFilterFn:(g,i,R)=>{let A=g.getValue(i);return A==null?!1:String(A).toLowerCase().includes(String(R).toLowerCase())},state:{sorting:u,columnFilters:s,columnSizing:x,columnPinning:D,columnOrder:F,globalFilter:Ba}});return!t&&!o.length?I("div",{className:"ps-p-4 ps-border ps-rounded-md ps-w-full",children:I("p",{className:"ps-text-lg ps-font-semibold",children:"No data available."})}):I("div",{"data-studio":"content",className:"ps-flex-1 ps-w-0 ps-h-0 ps-min-w-full",children:Ze("div",{className:"ps-flex ps-flex-col ps-w-full ps-h-full ps-overflow-scroll",children:[I(zt,{sensors:Oa,onDragEnd:Ua,children:Ze(Me,{children:[I(De,{children:q.getHeaderGroups().map(g=>I(de,{className:l("ps-relative",q.getLeftLeafHeaders().some(i=>i.column.getIsPinned()==="left")&&`ps-pl-[${q.getLeftLeafHeaders().filter(i=>i.column.getIsPinned()==="left").reduce((i,R)=>i+R.getSize(),0)}px]`),children:I(Qt,{items:g.headers.map(i=>i.id),strategy:Kt,children:g.headers.map(i=>i.column.id==="select"?I(ge,{className:l("ps-px-[var(--studio-cell-spacing)]",Q(i.column).className,i.column.getIsPinned()&&"ps-sticky"),style:Q(i.column).style,"data-cell-type":"select",children:I(ze,{header:i})},i.id):I(oo,{header:i,table:q,...Q(i.column),children:I(ze,{header:i})},i.id))})},g.id))}),I(Ae,{children:q.getRowModel().rows?.length?q.getRowModel().rows.map(g=>I(de,{className:l("ps-bg-table-row ps-odd:bg-table-row-odd ps-group"),children:g.getVisibleCells().map(i=>I(Ca,{cell:i,...Q(i.column)},i.id))},g.id)):I(de,{children:I(fe,{colSpan:re.length,className:"ps-h-24 ps-text-center",children:"No results."})})})]})}),I(Ra,{table:q,variant:"numeric"})]})})}import{Fragment as uo,jsx as oe,jsxs as lo}from"react/jsx-runtime";function Ma(e){let{activeTable:a}=W(),{data:t,isLoading:o}=ua();if(!a)return null;let u=t?.rows||[];return lo(uo,{children:[oe("div",{className:"ps-bg-studio-header-background ps-flex ps-w-full ps-p-2 ps-py-3 ps-border-b",children:oe("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full ps-gap-2",children:oe("div",{className:"ps-flex ps-items-center ps-gap-2",children:oe("span",{className:"ps-flex ps-items-center ps-gap-2",children:oe("h1",{className:"ps-text-sm ps-font-medium",children:a.name})})})})}),oe(ya,{columns:a.columns,isLoading:o,rows:u})]})}import{Slot as ro}from"@radix-ui/react-slot";import{useQuery as so}from"@tanstack/react-query";var Da=-1;function Aa(){let{adapter:e}=W();return so({initialData:{schemas:{[e.defaultSchema||"db"]:{tables:{}}},timezone:"UTC"},initialDataUpdatedAt:Da,queryFn:async({signal:a})=>{let[t,o]=await e.introspect({abortSignal:a});if(t)throw t;return o},queryKey:["introspection"],staleTime:a=>a.state.dataUpdatedAt===Da?0:1/0})}import{jsx as Y,jsxs as no}from"react/jsx-runtime";function ue(){let{data:e}=Aa(),{activeTable:a,adapter:t,setActiveTable:o}=W(),u=Object.values(e.schemas[t.defaultSchema||"db"].tables),[d]=u;return d?.schema!==a?.schema&&d?.schema!==a?.name&&o(d||null),Y("div",{className:"ps-flex ps-flex-col ps-w-64 ps-gap-4 ps-shrink-0",children:Y(ue.Block,{label:"Tables",children:u.map(s=>Y(ue.Item,{isActive:a===s,onClick:f=>{f.preventDefault(),a!==s&&o(s)},className:`ps-px-2 ps-py-1 ps-cursor-pointer ps-rounded ${a===s?"ps-bg-primary ps-text-white":"ps-hover:ps-bg-gray-100"}`,children:s.name},`${s.schema}-${s.name}`))})})}var fo=({className:e,label:a,children:t,...o})=>no("div",{className:l("ps-rounded-lg ps-border ps-bg-card ps-text-card-foreground ps-shadow-xs",e),...o,children:[Y("div",{className:"ps-pt-4 ps-pb-2 ps-px-4",children:Y("h2",{className:"ps-text-sm ps-font-medium",children:a})}),Y("nav",{"aria-label":a,className:"ps-flex ps-flex-col ps-gap-px ps-pb-3",children:t})]}),io=({className:e,asChild:a=!1,isActive:t,size:o,...u})=>Y(a?ro:"button",{"data-sidebar":"menu-button","data-size":o,"data-active":t,className:l("ps-py-1.5 ps-px-4 ps-text-sm ps-font-medium ps-flex ps-gap-2 ps-items-center ps-border ps-border-transparent ps-bg-transparent ps-hover:bg-muted/50",e),...u});ue.Block=fo;ue.Item=io;import{createContext as co,useContext as kr,useEffect as po,useState as mo}from"react";import{jsx as Io}from"react/jsx-runtime";var Lo={theme:"system",setTheme:()=>null},xo=co(Lo);function Ta({children:e,defaultTheme:a="system",storageKey:t="vite-ui-theme",...o}){let[u,d]=mo(()=>localStorage.getItem(t)||a);po(()=>{let f=window.document.documentElement;if(f.classList.remove("light","dark"),u==="system"){let x=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(x);return}f.classList.add(u)},[u]);let s={theme:u,setTheme:f=>{localStorage.setItem(t,f),d(f)}};return Io(xo.Provider,{...o,value:s,children:e})}import{jsx as le,jsxs as go}from"react/jsx-runtime";function Co(e){let{adapter:a}=e;return a?le(Ta,{children:le(oa,{adapter:a,children:go("div",{className:"ps-flex ps-gap-4 ps-w-full ps-rounded-sm ps-bg-background ps-p-4 ps-relative",children:[le(ue,{}),le("div",{className:"ps-flex ps-w-full ps-flex-col ps-border ps-rounded-lg",children:le(Ma,{})})]})})}):(console.error("No adapter provided to Studio component"),le("div",{children:"Error: No adapter provided"}))}export{Co as Studio};
|
|
1
|
+
import{B as ve,aa as Re,c as v,q as we,r as ke,t as be}from"../chunk-N2MLAUEV.js";import"../chunk-2FW6TKD6.js";import"../index-ESMXH6DI.css";import{useQuery as ja}from"@tanstack/react-query";import{QueryClient as Wa,QueryClientProvider as Xa}from"@tanstack/react-query";import*as M from"react";import{onlineManager as Ua,useQueryClient as Oa}from"@tanstack/react-query";var $e=class{#a;#f;#i;#n;#e=!1;#c;#t;#o;#u;#l;#s;#r;#d;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:u,buttonPosition:s,position:r,initialIsOpen:f,errorTypes:x,styleNonce:m,shadowDOMTarget:y}=e;this.#a=v(a),this.#i=t,this.#n=o,this.#f=u,this.#c=m,this.#t=y,this.#o=v(s),this.#u=v(r),this.#l=v(f),this.#s=v(x)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#u[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#s[1](e)}setClient(e){this.#a[1](e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=ve(()=>{let t=this,[o]=this.#o,[u]=this.#u,[s]=this.#l,[r]=this.#s,[f]=this.#a,x;return this.#r?x=this.#r:(x=be(()=>import("../CPIOZS5X-NALOZFPD.js")),this.#r=x),Re(this.#c,this.#t),we(x,ke({get queryFlavor(){return t.#i},get version(){return t.#n},get onlineManager(){return t.#f},get shadowDOMTarget(){return t.#t}},{get client(){return f()},get buttonPosition(){return o()},get position(){return u()},get initialIsOpen(){return s()},get errorTypes(){return r()}}))},e);this.#e=!0,this.#d=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#d?.(),this.#e=!1}},je=class{#a;#f;#i;#n;#e=!1;#c;#t;#o;#u;#l;#s;#r;#d;#p;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:u,buttonPosition:s,position:r,initialIsOpen:f,errorTypes:x,styleNonce:m,shadowDOMTarget:y,onClose:C}=e;this.#a=v(a),this.#i=t,this.#n=o,this.#f=u,this.#c=m,this.#t=y,this.#o=v(s),this.#u=v(r),this.#l=v(f),this.#s=v(x),this.#r=v(C)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#u[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#s[1](e)}setClient(e){this.#a[1](e)}setOnClose(e){this.#r[1](()=>e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=ve(()=>{let t=this,[o]=this.#o,[u]=this.#u,[s]=this.#l,[r]=this.#s,[f]=this.#a,[x]=this.#r,m;return this.#d?m=this.#d:(m=be(()=>import("../OKF6E45R-6KC3BLVB.js")),this.#d=m),Re(this.#c,this.#t),we(m,ke({get queryFlavor(){return t.#i},get version(){return t.#n},get onlineManager(){return t.#f},get shadowDOMTarget(){return t.#t}},{get client(){return f()},get buttonPosition(){return o()},get position(){return u()},get initialIsOpen(){return s()},get errorTypes(){return r()},get onClose(){return x()}}))},e);this.#e=!0,this.#p=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#p?.(),this.#e=!1}};import{jsx as Ha}from"react/jsx-runtime";function Ye(e){let a=Oa(e.client),t=M.useRef(null),{buttonPosition:o,position:u,initialIsOpen:s,errorTypes:r,styleNonce:f,shadowDOMTarget:x}=e,[m]=M.useState(new $e({client:a,queryFlavor:"React Query",version:"5",onlineManager:Ua,buttonPosition:o,position:u,initialIsOpen:s,errorTypes:r,styleNonce:f,shadowDOMTarget:x}));return M.useEffect(()=>{m.setClient(a)},[a,m]),M.useEffect(()=>{o&&m.setButtonPosition(o)},[o,m]),M.useEffect(()=>{u&&m.setPosition(u)},[u,m]),M.useEffect(()=>{m.setInitialIsOpen(s||!1)},[s,m]),M.useEffect(()=>{m.setErrorTypes(r||[])},[r,m]),M.useEffect(()=>(t.current&&m.mount(t.current),()=>{m.unmount()}),[m]),Ha("div",{dir:"ltr",className:"tsqd-parent-container",ref:t})}import*as q from"react";import{onlineManager as Ea,useQueryClient as Ga}from"@tanstack/react-query";import{jsx as za}from"react/jsx-runtime";function ea(e){let a=Ga(e.client),t=q.useRef(null),{errorTypes:o,styleNonce:u,shadowDOMTarget:s}=e,[r]=q.useState(new je({client:a,queryFlavor:"React Query",version:"5",onlineManager:Ea,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:o,styleNonce:u,shadowDOMTarget:s,onClose:e.onClose}));return q.useEffect(()=>{r.setClient(a)},[a,r]),q.useEffect(()=>{r.setOnClose(e.onClose??(()=>{}))},[e.onClose,r]),q.useEffect(()=>{r.setErrorTypes(o||[])},[o,r]),q.useEffect(()=>(t.current&&r.mount(t.current),()=>{r.unmount()}),[r]),za("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:t})}var aa=process.env.NODE_ENV!=="development"?function(){return null}:Ye,bo=process.env.NODE_ENV!=="development"?function(){return null}:ea;import{NuqsAdapter as Ka}from"nuqs/adapters/react";import{createContext as Qa,useContext as Za,useState as Ja}from"react";import{jsx as Me,jsxs as $a}from"react/jsx-runtime";var _a=new Wa,ta=Qa(void 0);function oa(e){let{children:a,...t}=e,[o,u]=Ja(null);return $a(Xa,{client:_a,children:[Me(aa,{}),Me(Ka,{children:Me(ta.Provider,{value:{...t,activeTable:o,setActiveTable:u},children:a})})]})}function V(){let e=Za(ta);if(!e)throw new Error("`useStudio` must be used within a `StudioContext.Provider`");return e}function ua(){let{activeTable:e,adapter:a}=V();return ja({enabled:!!e,gcTime:0,queryFn:async({signal:t})=>{let[o,u]=await a.query({table:e.name,schema:e.schema},{abortSignal:t});if(o)throw o;return u},queryKey:["schema",e?.schema,"table",e?.name,"query"],staleTime:1/0})}import{DndContext as Ft,MouseSensor as qt,useSensor as Ut,useSensors as Ot}from"@dnd-kit/core";import{horizontalListSortingStrategy as Ht,SortableContext as Nt,useSortable as Et}from"@dnd-kit/sortable";import{CSS as Gt}from"@dnd-kit/utilities";import{getCoreRowModel as zt,getFilteredRowModel as Vt,getPaginationRowModel as Wt,getSortedRowModel as Xt,useReactTable as Kt}from"@tanstack/react-table";import{useEffect as Qt,useMemo as Zt,useState as ae}from"react";import*as O from"react";import{clsx as Ya}from"clsx";import{twMerge as et}from"tailwind-merge";function l(...e){return et(Ya(e))}import{jsx as U}from"react/jsx-runtime";var ye=O.forwardRef(({className:e,...a},t)=>U("div",{className:"ps-relative ps-w-full ps-overflow-auto ps-flex ps-items-start ps-h-full",children:U("table",{ref:t,className:l("ps-w-full ps-caption-bottom ps-text-sm table-fixed",e),...a})}));ye.displayName="Table";var De=O.forwardRef(({className:e,...a},t)=>U("thead",{ref:t,className:l("[&_tr]:ps-border-b",e),...a}));De.displayName="TableHeader";var Ae=O.forwardRef(({className:e,...a},t)=>U("tbody",{ref:t,className:l("[&_tr:last-child]:ps-border-0",e),...a}));Ae.displayName="TableBody";var at=O.forwardRef(({className:e,...a},t)=>U("tfoot",{ref:t,className:l("ps-border-t ps-bg-muted/50 ps-font-medium [&>tr]:last:ps-border-b-0",e),...a}));at.displayName="TableFooter";var se=O.forwardRef(({className:e,...a},t)=>U("tr",{ref:t,className:l("ps-border-b ps-transition-colors hover:ps-bg-muted/50 data-[state=selected]:ps-bg-muted",e),...a}));se.displayName="TableRow";var Ie=O.forwardRef(({className:e,...a},t)=>U("th",{ref:t,className:l("ps-h-10 ps-px-2 ps-text-left ps-align-middle ps-font-medium ps-text-muted-foreground [&:has([role=checkbox])]:ps-pr-0 [&>[role=checkbox]]:ps-translate-y-[2px]",e),...a}));Ie.displayName="TableHead";var re=O.forwardRef(({className:e,...a},t)=>U("td",{ref:t,className:l("ps-p-2 ps-align-middle [&:has([role=checkbox])]:ps-pr-0 [&>[role=checkbox]]:ps-translate-y-[2px]",e),...a}));re.displayName="TableCell";var tt=O.forwardRef(({className:e,...a},t)=>U("caption",{ref:t,className:l("ps-mt-4 ps-text-sm ps-text-muted-foreground",e),...a}));tt.displayName="TableCaption";import{tokyoNight as Lt}from"@uiw/codemirror-theme-tokyo-night";import xt from"@uiw/react-codemirror";import*as H from"@radix-ui/react-popover";import*as P from"react";import{jsx as de}from"react/jsx-runtime";var la=P.createContext(null),Te=({children:e,...a})=>{let[t,o]=P.useState(!1);return de(la.Provider,{value:{open:t,setOpen:o},children:de(H.Root,{open:t,onOpenChange:o,...a,children:e})})};Te.displayName="PopoverCell";var Be=P.forwardRef(({children:e,onDoubleClick:a,className:t,...o},u)=>{let s=P.useContext(la),[r,f]=P.useState(!1),x=P.useRef(null);return P.useEffect(()=>{let C=he=>{let B=he.target;x.current&&!x.current.contains(B)&&(console.log("Outside click - removing focus"),f(!1))};return document.addEventListener("click",C),()=>document.removeEventListener("click",C)},[]),de(H.Trigger,{ref:C=>{typeof u=="function"?u(C):u&&(u.current=C),x.current=C},onClick:C=>{C.preventDefault(),console.log("Click handler - setting focus to true"),f(!0)},onDoubleClick:C=>{C.preventDefault(),s?.setOpen(!0),a?.()},"data-focus":r.toString(),className:l("w-full h-full cursor-pointer",t),...o,children:e})});Be.displayName="PopoverCellTrigger";var Fe=P.forwardRef(({className:e,align:a="center",sideOffset:t=4,...o},u)=>de(H.Portal,{children:de(H.Content,{ref:u,align:a,sideOffset:t,className:l("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Fe.displayName=H.Content.displayName;import{jsx as ot}from"react/jsx-runtime";function sa(){return ot("code",{className:"ps-text-gray-500",children:"NULL"})}import{forwardRef as lt,createElement as st}from"react";var ra=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ce=(...e)=>e.filter((a,t,o)=>!!a&&o.indexOf(a)===t).join(" ");import{forwardRef as ut,createElement as fa}from"react";var da={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ia=ut(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:u="",children:s,iconNode:r,...f},x)=>fa("svg",{ref:x,...da,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:Ce("lucide",u),...f},[...r.map(([m,y])=>fa(m,y)),...Array.isArray(s)?s:[s]]));var L=(e,a)=>{let t=lt(({className:o,...u},s)=>st(ia,{ref:s,iconNode:a,className:Ce(`lucide-${ra(e)}`,o),...u}));return t.displayName=`${e}`,t};var W=L("ArrowDownWideNarrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);var fe=L("ArrowUpWideNarrow",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]]);var N=L("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Y=L("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var ie=L("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var E=L("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var ne=L("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var ce=L("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);var pe=L("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var J=L("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var me=L("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var X=L("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var Le=L("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var xe=L("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);import{isValidElement as mt}from"react";import*as n from"@radix-ui/react-context-menu";import*as G from"react";import{jsx as w,jsxs as Oe}from"react/jsx-runtime";var na=n.Root,ca=n.Trigger;var rt=G.forwardRef(({className:e,inset:a,children:t,...o},u)=>Oe(n.SubTrigger,{ref:u,className:l("ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[state=open]:ps-bg-accent data-[state=open]:ps-text-accent-foreground",a&&"ps-pl-8",e),...o,children:[t,w(E,{className:"ps-ml-auto ps-h-4 ps-w-4"})]}));rt.displayName=n.SubTrigger.displayName;var dt=G.forwardRef(({className:e,...a},t)=>w(n.SubContent,{ref:t,className:l("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a}));dt.displayName=n.SubContent.displayName;var qe=G.forwardRef(({className:e,...a},t)=>w(n.Portal,{children:w(n.Content,{ref:t,className:l("ps-z-50 ps-max-h-[--radix-context-menu-content-available-height] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a})}));qe.displayName=n.Content.displayName;var Ue=G.forwardRef(({className:e,inset:a,...t},o)=>w(n.Item,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",a&&"ps-pl-8",e),...t}));Ue.displayName=n.Item.displayName;var ft=G.forwardRef(({className:e,children:a,checked:t,...o},u)=>Oe(n.CheckboxItem,{ref:u,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[w("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:w(n.ItemIndicator,{children:w(N,{className:"ps-h-4 ps-w-4"})})}),a]}));ft.displayName=n.CheckboxItem.displayName;var it=G.forwardRef(({className:e,children:a,...t},o)=>Oe(n.RadioItem,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[w("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:w(n.ItemIndicator,{children:w(J,{className:"ps-h-4 ps-w-4 ps-fill-current"})})}),a]}));it.displayName=n.RadioItem.displayName;var nt=G.forwardRef(({className:e,inset:a,...t},o)=>w(n.Label,{ref:o,className:l("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold ps-text-foreground",a&&"ps-pl-8",e),...t}));nt.displayName=n.Label.displayName;var ct=G.forwardRef(({className:e,...a},t)=>w(n.Separator,{ref:t,className:l("ps--mx-1 ps-my-1 ps-h-px ps-bg-border",e),...a}));ct.displayName=n.Separator.displayName;var pt=({className:e,...a})=>w("span",{className:l("ps-ml-auto ps-text-xs ps-tracking-widest ps-text-muted-foreground",e),...a});pt.displayName="ContextMenuShortcut";import{jsx as He,jsxs as pa}from"react/jsx-runtime";function ma(e){let{children:a}=e;return pa(na,{children:[He(ca,{className:"ps-block ps-w-full ps-p-[var(--studio-cell-spacing)]",children:a}),He(qe,{children:pa(Ue,{onClick:()=>{let t=Ne(a);navigator.clipboard.writeText(t).catch(o=>{console.error("Failed to copy to clipboard:",o)})},className:"ps-flex ps-items-center ps-gap-2",children:[He(me,{size:12}),"Copy"]})})]})}function Ne(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(e==null)return"";if(mt(e)){let a=e.props;return e.type&&typeof e.type=="function"&&e.type.name==="RevealText"?a.text||"":e.type&&typeof e.type=="function"&&e.type.name==="NullValue"?"NULL":a.children?Ne(a.children):""}return Array.isArray(e)?e.map(Ne).join(""):""}function K(e){let a=e.getIsPinned(),t=a==="left"&&e.getIsLastColumn("left"),o=a==="right"&&e.getIsFirstColumn("right");return{className:l("ps-overflow-hidden ps-whitespace-nowrap ps-text-ellipsis",a&&["ps-sticky ps-bg-background ps-shadow-[1px_0_0_0_hsl(var(--border))]",a==="left"?"ps-left-0":"ps-right-0","ps-z-20"],!a&&"ps-relative ps-z-10",t&&"ps-shadow-[1px_0_0_0_hsl(var(--border))]",o&&"ps-shadow-[-1px_0_0_0_hsl(var(--border))]"),style:{width:e.getSize(),left:a==="left"?`${e.getStart("left")}px`:void 0,right:a==="right"?`${e.getAfter("right")}px`:void 0}}}import{jsx as ee,jsxs as It}from"react/jsx-runtime";function La(e){let{cell:a}=e,t=a.getValue(),o=t==null,u=s=>{if(s==null)return"NULL";if(typeof s=="object")try{return JSON.stringify(s,null,2)}catch(r){return console.error("Error stringifying value:",r),String(s)}return String(s)};return It(Te,{children:[ee(Be,{asChild:!0,children:ee(re,{...K(a.column),className:l(K(a.column).className,"ps-p-0",a.column.getIsPinned()&&"ps-sticky"),children:ee(ma,{children:o?ee(sa,{}):u(t)})})}),ee(Fe,{align:"start",alignOffset:0,sideOffset:0,className:"ps-min-w-(--radix-popover-trigger-width) ps-rounded-none ps-bg-muted ps-p-0",children:ee(xt,{value:u(t),theme:Lt,height:"100px",basicSetup:{lineNumbers:!0,foldGutter:!1,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!1},onChange:s=>{console.log("New value:",s)}})})]},a.id)}import{flexRender as yt}from"@tanstack/react-table";import{Slot as Ct}from"@radix-ui/react-slot";import{cva as gt}from"class-variance-authority";import*as xa from"react";import{jsx as St}from"react/jsx-runtime";var ht=gt("ps-inline-flex ps-items-center ps-justify-center ps-gap-2 ps-whitespace-nowrap ps-rounded-md ps-text-sm ps-font-medium ps-transition-colors focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-pointer-events-none disabled:ps-opacity-50 [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",{variants:{variant:{default:"ps-bg-primary ps-text-primary-foreground ps-shadow hover:ps-bg-primary/90",destructive:"ps-bg-destructive ps-text-destructive-foreground ps-shadow-sm hover:ps-bg-destructive/90",outline:"ps-border ps-border-input ps-bg-background ps-shadow-sm hover:ps-bg-accent hover:ps-text-accent-foreground",secondary:"ps-bg-secondary ps-text-secondary-foreground ps-shadow-sm hover:ps-bg-secondary/80",ghost:"hover:ps-bg-accent hover:ps-text-accent-foreground",link:"ps-text-primary ps-underline-offset-4 hover:ps-underline"},size:{default:"ps-h-9 ps-px-4 ps-py-2",sm:"ps-h-8 ps-rounded-md ps-px-3 ps-text-xs",lg:"ps-h-10 ps-rounded-md ps-px-8",icon:"ps-h-9 ps-w-9"}},defaultVariants:{variant:"default",size:"default"}}),T=xa.forwardRef(({className:e,variant:a,size:t,asChild:o=!1,...u},s)=>St(o?Ct:"button",{className:l(ht({variant:a,size:t,className:e})),ref:s,...u}));T.displayName="Button";import*as c from"@radix-ui/react-dropdown-menu";import*as z from"react";import{jsx as k,jsxs as Ge}from"react/jsx-runtime";var Ia=c.Root,Ca=c.Trigger;var Pt=z.forwardRef(({className:e,inset:a,children:t,...o},u)=>Ge(c.SubTrigger,{ref:u,className:l("ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent data-[state=open]:ps-bg-accent [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",a&&"ps-pl-8",e),...o,children:[t,k(E,{className:"ps-ml-auto"})]}));Pt.displayName=c.SubTrigger.displayName;var wt=z.forwardRef(({className:e,...a},t)=>k(c.SubContent,{ref:t,className:l("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...a}));wt.displayName=c.SubContent.displayName;var Ee=z.forwardRef(({className:e,sideOffset:a=4,...t},o)=>k(c.Portal,{children:k(c.Content,{ref:o,sideOffset:a,className:l("ps-z-50 ps-max-h-[var(--radix-dropdown-menu-content-available-height)] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md","data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...t})}));Ee.displayName=c.Content.displayName;var ge=z.forwardRef(({className:e,inset:a,...t},o)=>k(c.Item,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50 [&>svg]:ps-size-4 [&>svg]:ps-shrink-0",a&&"ps-pl-8",e),...t}));ge.displayName=c.Item.displayName;var kt=z.forwardRef(({className:e,children:a,checked:t,...o},u)=>Ge(c.CheckboxItem,{ref:u,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[k("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:k(c.ItemIndicator,{children:k(N,{className:"ps-h-4 ps-w-4"})})}),a]}));kt.displayName=c.CheckboxItem.displayName;var bt=z.forwardRef(({className:e,children:a,...t},o)=>Ge(c.RadioItem,{ref:o,className:l("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[k("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:k(c.ItemIndicator,{children:k(J,{className:"ps-h-2 ps-w-2 ps-fill-current"})})}),a]}));bt.displayName=c.RadioItem.displayName;var vt=z.forwardRef(({className:e,inset:a,...t},o)=>k(c.Label,{ref:o,className:l("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold",a&&"ps-pl-8",e),...t}));vt.displayName=c.Label.displayName;var Rt=z.forwardRef(({className:e,...a},t)=>k(c.Separator,{ref:t,className:l("ps--mx-1 ps-my-1 ps-h-px ps-bg-muted",e),...a}));Rt.displayName=c.Separator.displayName;var Mt=({className:e,...a})=>k("span",{className:l("ps-ml-auto ps-text-xs ps-tracking-widest ps-opacity-60",e),...a});Mt.displayName="DropdownMenuShortcut";import{jsx as b,jsxs as Q}from"react/jsx-runtime";function ze(e){let{header:a}=e;return Q("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full ps-h-full",children:[Q("div",{className:"ps-flex-1 ps-flex ps-items-center ps-justify-between",children:[Q("div",{className:"ps-align-text-bottom ps-leading-none ps-h-[20px]",children:[b("span",{className:"ps-inline-block ps-text-foreground ps-font-bold ps-text-sm",children:a.isPlaceholder?null:yt(a.column.columnDef.header,a.getContext())}),b("span",{className:"ps-inline-block ps-ml-2 ps-text-xs ps-font-mono ps-text-muted-foreground/70 ps-lowercase",children:a.column.columnDef.meta.datatype.name})]}),b("span",{className:"ps-flex ps-items-center ps-gap-1",children:a.column.getCanPin()&&a.column.id!=="select"&&Q(Ia,{children:[b(Ca,{asChild:!0,children:b(T,{variant:"ghost",size:"icon",children:b(X,{size:16})})}),Q(Ee,{children:[a.column.getCanSort()&&b(ge,{onClick:()=>a.column.toggleSorting(a.column.getIsSorted()==="asc"),children:Q("span",{className:"ps-flex ps-items-center ps-gap-2",children:[a.column.getIsSorted()==="asc"?b(W,{size:16}):b(fe,{size:16}),a.column.getIsSorted()==="asc"?"Sort descending":"Sort ascending"]})}),b(ge,{onClick:()=>a.column.pin(a.column.getIsPinned()?!1:"left"),children:a.column.getIsPinned()?Q("span",{className:"ps-flex ps-items-center ps-gap-2",children:[b(Le,{size:16}),"Unpin column"]}):Q("span",{className:"ps-flex ps-items-center ps-gap-2",children:[b(xe,{size:16}),"Pin column"]})})]})]})})]}),a.column.getCanResize()&&b("button",{type:"button",tabIndex:0,onMouseDown:t=>{t.stopPropagation(),a.getResizeHandler()(t)},onTouchStart:t=>{t.stopPropagation(),a.getResizeHandler()(t)},onClick:t=>t.stopPropagation(),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),a.getResizeHandler()(t))},className:l("ps-absolute ps-right-0 ps-top-0 ps-h-full ps-w-3 ps-cursor-col-resize","ps-select-none ps-touch-none ps-transition-colors ps-group","ps-border-0 ps-bg-transparent",a.column.getIsResizing()&&"ps-bg-gray-300","before:ps-absolute before:ps-right-[3px] before:ps-top-1/2 before:ps--translate-y-1/2","after:ps-absolute after:ps-right-[7px] after:ps-top-1/2 after:ps--translate-y-1/2","before:ps-w-[2px] before:ps-h-0 before:ps-bg-gray-400 before:ps-rounded-full before:ps-opacity-0","after:ps-w-[2px] after:ps-h-0 after:ps-bg-gray-400 after:ps-rounded-full after:ps-opacity-0","before:ps-transition-all before:ps-duration-200","after:ps-transition-all after:ps-duration-200","group-hover:before:ps-opacity-100","group-hover:after:ps-opacity-100","group-hover:before:ps-h-4","group-hover:after:ps-h-4","group-active:ps-bg-transparent group-active:before:ps-bg-white group-active:after:ps-bg-white",a.column.getIsResizing()&&"before:ps-opacity-100"),"aria-label":"Resize column"})]})}import*as ga from"react";import{jsx as Dt}from"react/jsx-runtime";var Ve=ga.forwardRef(({className:e,type:a,...t},o)=>Dt("input",{type:a,className:l("ps-flex ps-h-9 ps-w-full ps-rounded-md ps-border ps-border-input ps-bg-transparent ps-px-3 ps-py-1 ps-text-base ps-shadow-sm ps-transition-colors file:ps-border-0 file:ps-bg-transparent file:ps-text-sm file:ps-font-medium file:ps-text-foreground placeholder:ps-text-muted-foreground focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50 md:ps-text-sm",e),ref:o,...t}));Ve.displayName="Input";import*as p from"@radix-ui/react-select";import*as Z from"react";import{jsx as h,jsxs as Qe}from"react/jsx-runtime";var ha=p.Root;var Sa=p.Value,We=Z.forwardRef(({className:e,children:a,...t},o)=>Qe(p.Trigger,{ref:o,className:l("ps-flex ps-h-9 ps-w-full ps-items-center ps-justify-between ps-whitespace-nowrap ps-rounded-md ps-border ps-border-input ps-bg-transparent ps-px-3 ps-py-2 ps-text-sm ps-shadow-sm ps-ring-offset-background data-[placeholder]:ps-text-muted-foreground focus:ps-outline-none focus:ps-ring-1 focus:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50 [&>span]:ps-line-clamp-1",e),...t,children:[a,h(p.Icon,{asChild:!0,children:h(Y,{className:"ps-h-4 ps-w-4 ps-opacity-50"})})]}));We.displayName=p.Trigger.displayName;var Pa=Z.forwardRef(({className:e,...a},t)=>h(p.ScrollUpButton,{ref:t,className:l("ps-flex ps-cursor-default ps-items-center ps-justify-center ps-py-1",e),...a,children:h(ne,{className:"ps-h-4 ps-w-4"})}));Pa.displayName=p.ScrollUpButton.displayName;var wa=Z.forwardRef(({className:e,...a},t)=>h(p.ScrollDownButton,{ref:t,className:l("ps-flex ps-cursor-default ps-items-center ps-justify-center ps-py-1",e),...a,children:h(Y,{className:"ps-h-4 ps-w-4"})}));wa.displayName=p.ScrollDownButton.displayName;var Xe=Z.forwardRef(({className:e,children:a,position:t="popper",...o},u)=>h(p.Portal,{children:Qe(p.Content,{ref:u,className:l("ps-relative ps-z-50 ps-max-h-[--radix-select-content-available-height] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-text-popover-foreground ps-shadow-md data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-select-content-transform-origin]",t==="popper"&&"data-[side=bottom]:ps-translate-y-1 data-[side=left]:ps--translate-x-1 data-[side=right]:ps-translate-x-1 data-[side=top]:ps--translate-y-1",e),position:t,...o,children:[h(Pa,{}),h(p.Viewport,{className:l("ps-p-1",t==="popper"&&"ps-h-[var(--radix-select-trigger-height)] ps-w-full ps-min-w-[var(--radix-select-trigger-width)]"),children:a}),h(wa,{})]})}));Xe.displayName=p.Content.displayName;var At=Z.forwardRef(({className:e,...a},t)=>h(p.Label,{ref:t,className:l("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold",e),...a}));At.displayName=p.Label.displayName;var Ke=Z.forwardRef(({className:e,children:a,...t},o)=>Qe(p.Item,{ref:o,className:l("ps-relative ps-flex ps-w-full ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-2 ps-pr-8 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[h("span",{className:"ps-absolute ps-right-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:h(p.ItemIndicator,{children:h(N,{className:"ps-h-4 ps-w-4"})})}),h(p.ItemText,{children:a})]}));Ke.displayName=p.Item.displayName;var Tt=Z.forwardRef(({className:e,...a},t)=>h(p.Separator,{ref:t,className:l("ps--mx-1 ps-my-1 ps-h-px ps-bg-muted",e),...a}));Tt.displayName=p.Separator.displayName;import{jsx as S,jsxs as _}from"react/jsx-runtime";var Bt=[10,20,50,100];function ka(e){let{className:a,table:t,variant:o="basic"}=e,{pageSize:u,pageIndex:s}=t.getState().pagination,r=t.getPageCount();return S("div",{className:l("ps-flex ps-items-center ps-justify-between ps-space-x-2 ps-py-4 ps-px-4",a),children:o==="basic"?_("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[S(T,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:"Previous"}),S(T,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:"Next"})]}):_("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[_("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[S(T,{variant:"outline",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:S(ce,{className:"ps-w-4 ps-h-4"})}),S(T,{variant:"outline",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:S(ie,{className:"ps-w-4 ps-h-4"})}),_("div",{className:"ps-flex ps-items-center ps-gap-1 ps-text-xs ps-font-medium",children:["Page",S(Ve,{type:"number",min:1,max:r,value:s+1,className:"ps-w-12",onChange:f=>{let x=f.target.value?Number(f.target.value)-1:0;t.setPageIndex(x)}}),_("span",{className:"ps-shrink-0 ps-w-max",children:["of ",r]})]}),S(T,{variant:"outline",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:S(E,{className:"ps-w-4 ps-h-4"})}),S(T,{variant:"outline",onClick:()=>t.setPageIndex(r-1),disabled:!t.getCanNextPage(),children:S(pe,{className:"ps-w-4 ps-h-4"})})]}),_(ha,{value:u.toString(),onValueChange:f=>t.setPageSize(Number(f)),children:[S(We,{children:S(Sa,{})}),S(Xe,{children:Bt.map(f=>_(Ke,{value:f.toString(),children:[f," per page"]},f))})]})]})})}import{jsx as I,jsxs as Ze}from"react/jsx-runtime";var Jt=e=>{let{children:a,className:t,header:o,style:u}=e,{attributes:s,listeners:r,transform:f,transition:x,setNodeRef:m,isDragging:y,isOver:C}=Et({id:o.id});return Ze(Ie,{ref:m,...s,...r,style:{cursor:"grab",touchAction:"none",transform:Gt.Transform.toString(f),transition:x,...u},className:l("ps-group",t,y&&"ps-opacity-50",C&&"ps-bg-gray-100","ps-select-none ps-touch-none ps-relative",o.column.getIsPinned()&&"ps-sticky"),children:[a,C&&I("div",{className:"ps-absolute ps-inset-0 ps-border-2 ps-border-primary ps-rounded-sm ps-pointer-events-none"})]})};function ba(e){let{columns:a,isLoading:t,rowCount:o,rows:u}=e,[s,r]=ae([]),[f,x]=ae([]),[m,y]=ae({}),[C,he]=ae({left:[],right:[]}),[B,Se]=ae([]),[Da,Aa]=ae(""),le=Zt(()=>Object.values(a).map(g=>({accessorKey:g.name,header:()=>I("div",{className:"ps-font-medium",children:g.name}),meta:g})),[a]);Qt(()=>{let g=le.map(A=>A.accessorKey);if(B.length===0){Se(g);return}let i=[...B],R=i.filter(A=>!le.some(j=>j.accessorKey===A));R.forEach(A=>{let j=i.indexOf(A);j!==-1&&i.splice(j,1)});let D=g.filter(A=>!i.includes(A));D.length>0&&i.push(...D),(R.length>0||D.length>0)&&Se(i)},[le,B]);let Ta=Ut(qt,{activationConstraint:{distance:10}}),Ba=Ot(Ta),Fa=g=>{let{active:i,over:R}=g;if(R&&i.id!==R.id){let D=F.getColumn(i.id),A=F.getColumn(R.id);if(!D||!A)return;let j=D.getIsPinned(),qa=A.getIsPinned();if(j!==qa)return;let Je=B.indexOf(i.id),_e=B.indexOf(R.id);if(Je===-1||_e===-1)return;let Pe=[...B];Pe.splice(Je,1),Pe.splice(_e,0,i.id),Se(Pe)}},F=Kt({columns:le,data:u,defaultColumn:{size:200,minSize:50,maxSize:500},getCoreRowModel:zt(),onSortingChange:r,getSortedRowModel:Xt(),getPaginationRowModel:Wt(),getFilteredRowModel:Vt(),onColumnFiltersChange:x,enableColumnResizing:!0,columnResizeMode:"onChange",onColumnSizingChange:y,enableColumnPinning:!0,onColumnPinningChange:he,onGlobalFilterChange:Aa,globalFilterFn:(g,i,R)=>{let D=g.getValue(i);return D==null?!1:String(D).toLowerCase().includes(String(R).toLowerCase())},state:{sorting:s,columnFilters:f,columnSizing:m,columnPinning:C,columnOrder:B,globalFilter:Da}});return!t&&!u.length?I("div",{className:"ps-p-4 ps-border ps-rounded-md ps-w-full",children:I("p",{className:"ps-text-lg ps-font-semibold",children:"No data available."})}):I("div",{"data-studio":"content",className:"ps-flex-1 ps-w-0 ps-h-0 ps-min-w-full",children:Ze("div",{className:"ps-flex ps-flex-col ps-w-full ps-h-full ps-overflow-scroll",children:[I(Ft,{sensors:Ba,onDragEnd:Fa,children:Ze(ye,{children:[I(De,{children:F.getHeaderGroups().map(g=>I(se,{className:l("ps-relative",F.getLeftLeafHeaders().some(i=>i.column.getIsPinned()==="left")&&`ps-pl-[${F.getLeftLeafHeaders().filter(i=>i.column.getIsPinned()==="left").reduce((i,R)=>i+R.getSize(),0)}px]`),children:I(Nt,{items:g.headers.map(i=>i.id),strategy:Ht,children:g.headers.map(i=>i.column.id==="select"?I(Ie,{className:l("ps-px-[var(--studio-cell-spacing)]",K(i.column).className,i.column.getIsPinned()&&"ps-sticky"),style:K(i.column).style,"data-cell-type":"select",children:I(ze,{header:i})},i.id):I(Jt,{header:i,table:F,...K(i.column),children:I(ze,{header:i})},i.id))})},g.id))}),I(Ae,{children:F.getRowModel().rows?.length?F.getRowModel().rows.map(g=>I(se,{className:l("ps-bg-table-row ps-odd:bg-table-row-odd ps-group"),children:g.getVisibleCells().map(i=>I(La,{cell:i,...K(i.column)},i.id))},g.id)):I(se,{children:I(re,{colSpan:le.length,className:"ps-h-24 ps-text-center",children:"No results."})})})]})}),I(ka,{rowCount:o,table:F,variant:"numeric"})]})})}import{Fragment as _t,jsx as te,jsxs as $t}from"react/jsx-runtime";function va(e){let{activeTable:a}=V(),{data:t,isLoading:o}=ua();if(!a)return null;let{filteredRowCount:u=1/0,rows:s=[]}=t||{};return $t(_t,{children:[te("div",{className:"ps-bg-studio-header-background ps-flex ps-w-full ps-p-2 ps-py-3 ps-border-b",children:te("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full ps-gap-2",children:te("div",{className:"ps-flex ps-items-center ps-gap-2",children:te("span",{className:"ps-flex ps-items-center ps-gap-2",children:te("h1",{className:"ps-text-sm ps-font-medium",children:a.name})})})})}),te(ba,{columns:a.columns,isLoading:o,rowCount:u,rows:s})]})}import{Slot as Yt}from"@radix-ui/react-slot";import{useQuery as jt}from"@tanstack/react-query";var Ra=-1;function Ma(){let{adapter:e}=V();return jt({initialData:{schemas:{[e.defaultSchema||"db"]:{tables:{}}},timezone:"UTC"},initialDataUpdatedAt:Ra,queryFn:async({signal:a})=>{let[t,o]=await e.introspect({abortSignal:a});if(t)throw t;return o},queryKey:["introspection"],staleTime:a=>a.state.dataUpdatedAt===Ra?0:1/0})}import{jsx as $,jsxs as to}from"react/jsx-runtime";function oe(){let{data:e}=Ma(),{activeTable:a,adapter:t,setActiveTable:o}=V(),u=Object.values(e.schemas[t.defaultSchema||"db"].tables),[s]=u;return s?.schema!==a?.schema&&s?.schema!==a?.name&&o(s||null),$("div",{className:"ps-flex ps-flex-col ps-w-64 ps-gap-4 ps-shrink-0",children:$(oe.Block,{label:"Tables",children:u.map(r=>$(oe.Item,{isActive:a===r,onClick:f=>{f.preventDefault(),a!==r&&o(r)},className:`ps-px-2 ps-py-1 ps-cursor-pointer ps-rounded ${a===r?"ps-bg-primary ps-text-white":"ps-hover:ps-bg-gray-100"}`,children:r.name},`${r.schema}-${r.name}`))})})}var eo=({className:e,label:a,children:t,...o})=>to("div",{className:l("ps-rounded-lg ps-border ps-bg-card ps-text-card-foreground ps-shadow-xs",e),...o,children:[$("div",{className:"ps-pt-4 ps-pb-2 ps-px-4",children:$("h2",{className:"ps-text-sm ps-font-medium",children:a})}),$("nav",{"aria-label":a,className:"ps-flex ps-flex-col ps-gap-px ps-pb-3",children:t})]}),ao=({className:e,asChild:a=!1,isActive:t,size:o,...u})=>$(a?Yt:"button",{"data-sidebar":"menu-button","data-size":o,"data-active":t,className:l("ps-py-1.5 ps-px-4 ps-text-sm ps-font-medium ps-flex ps-gap-2 ps-items-center ps-border ps-border-transparent ps-bg-transparent ps-hover:bg-muted/50",e),...u});oe.Block=eo;oe.Item=ao;import{createContext as oo,useContext as ur,useEffect as uo,useState as lo}from"react";import{jsx as fo}from"react/jsx-runtime";var so={theme:"system",setTheme:()=>null},ro=oo(so);function ya({children:e,defaultTheme:a="system",storageKey:t="vite-ui-theme",...o}){let[u,s]=lo(()=>localStorage.getItem(t)||a);uo(()=>{let f=window.document.documentElement;if(f.classList.remove("light","dark"),u==="system"){let x=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(x);return}f.classList.add(u)},[u]);let r={theme:u,setTheme:f=>{localStorage.setItem(t,f),s(f)}};return fo(ro.Provider,{...o,value:r,children:e})}import{jsx as ue,jsxs as no}from"react/jsx-runtime";function io(e){let{adapter:a}=e;return a?ue(ya,{children:ue(oa,{adapter:a,children:no("div",{className:"ps-flex ps-gap-4 ps-w-full ps-rounded-sm ps-bg-background ps-p-4 ps-relative",children:[ue(oe,{}),ue("div",{className:"ps-flex ps-w-full ps-flex-col ps-border ps-rounded-lg",children:ue(va,{})})]})})}):(console.error("No adapter provided to Studio component"),ue("div",{children:"Error: No adapter provided"}))}export{io as Studio};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
lucide-react/dist/esm/shared/src/utils.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/studio-core",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.202504151421",
|
|
4
4
|
"description": "Modular Prisma Studio components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -115,7 +115,6 @@
|
|
|
115
115
|
"autoprefixer": "10.4.21",
|
|
116
116
|
"class-variance-authority": "0.7.0",
|
|
117
117
|
"clsx": "2.1.1",
|
|
118
|
-
"dayjs": "1.11.13",
|
|
119
118
|
"nuqs": "2.4.1",
|
|
120
119
|
"postcss": "8.4.41",
|
|
121
120
|
"tailwind-merge": "2.5.2",
|