@kaitranntt/ccs 5.12.1-dev.2 → 5.12.1-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/VERSION +1 -1
- package/dist/cliproxy/account-manager.d.ts +20 -1
- package/dist/cliproxy/account-manager.d.ts.map +1 -1
- package/dist/cliproxy/account-manager.js +58 -3
- package/dist/cliproxy/account-manager.js.map +1 -1
- package/dist/cliproxy/auth-handler.d.ts +2 -0
- package/dist/cliproxy/auth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth-handler.js +26 -3
- package/dist/cliproxy/auth-handler.js.map +1 -1
- package/dist/cliproxy/cliproxy-executor.d.ts.map +1 -1
- package/dist/cliproxy/cliproxy-executor.js +57 -2
- package/dist/cliproxy/cliproxy-executor.js.map +1 -1
- package/dist/commands/cliproxy-command.d.ts.map +1 -1
- package/dist/commands/cliproxy-command.js +121 -5
- package/dist/commands/cliproxy-command.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +3 -0
- package/dist/commands/help-command.js.map +1 -1
- package/dist/ui/assets/{accounts-B9xp2MbI.js → accounts-CINaiRWK.js} +1 -1
- package/dist/ui/assets/{analytics-BfjSH3d-.js → analytics-FGMB3Rg8.js} +36 -36
- package/dist/ui/assets/{api-DYr0Tx6Z.js → api-CgKbdMRy.js} +1 -1
- package/dist/ui/assets/cliproxy-BHWpNSSw.js +1 -0
- package/dist/ui/assets/{dropdown-menu-iwA6PgQW.js → dropdown-menu-B25I20Pd.js} +1 -1
- package/dist/ui/assets/form-utils-DKkU3nz7.js +20 -0
- package/dist/ui/assets/{health-ChYme1jV.js → health-BVdxHbAV.js} +1 -1
- package/dist/ui/assets/icons-DT8ZzQec.js +1 -0
- package/dist/ui/assets/index-CQlEaCI8.css +1 -0
- package/dist/ui/assets/index-CfJhTNCX.js +10 -0
- package/dist/ui/assets/{settings-B2OdR7RO.js → settings-DrNBNTwT.js} +1 -1
- package/dist/ui/assets/{shared-ZSfv4HA6.js → shared-CsIcdSca.js} +1 -1
- package/dist/ui/assets/{table-OTpVLgy9.js → table-C7tMF2ph.js} +1 -1
- package/dist/ui/index.html +4 -4
- package/dist/web-server/usage-routes.d.ts.map +1 -1
- package/dist/web-server/usage-routes.js +204 -2
- package/dist/web-server/usage-routes.js.map +1 -1
- package/package.json +3 -2
- package/dist/ui/assets/cliproxy-BuB-MuAt.js +0 -1
- package/dist/ui/assets/form-utils-CSa50xnO.js +0 -20
- package/dist/ui/assets/icons-ByUiVGTN.js +0 -1
- package/dist/ui/assets/index-ChihF1Y9.css +0 -1
- package/dist/ui/assets/index-P2CKOdyd.js +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,t as M,v as L,w as k,x as I,y as K,z as R,B as z,E as F}from"./radix-ui-DAH8Vq_G.js";import{r as m}from"./react-vendor-CjrBBxxX.js";import{u as $,B as p,I as E,c as u,j as A,D as H,k as _,l as q,m as V,n as B,T as Q,e as U,f as C,g as w,o as Y,L as G,C as J,h as X,i as W,p as Z,a as ee,t as y,q as se,P as te}from"./index-P2CKOdyd.js";import{d as ae,f as D,g as ne,u as ie,a as re,b as le}from"./tanstack-DAI1tKxf.js";import{T as oe,a as de,b as T,c as ce,d as me,e as ue}from"./table-OTpVLgy9.js";import{D as xe,a as ge,b as fe,c as P,d as he}from"./dropdown-menu-iwA6PgQW.js";import{E as je,u as pe,v as ve,w as be,x as Ne,L as S,X as Ce,y as we,k as ye}from"./icons-ByUiVGTN.js";import"./form-utils-CSa50xnO.js";function De({data:s,onEditSettings:t}){const i=$(),d=ae({data:s,columns:[{accessorKey:"name",header:"Name",size:200},{accessorKey:"settingsPath",header:"Settings Path"},{accessorKey:"configured",header:"Status",size:100,cell:({row:n})=>e.jsx("span",{className:n.original.configured?"text-green-600":"text-yellow-600",children:n.original.configured?"[OK]":"[!]"})},{id:"actions",header:"Actions",size:100,cell:({row:n})=>e.jsxs(xe,{children:[e.jsx(ge,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",children:e.jsx(je,{className:"w-4 h-4"})})}),e.jsxs(fe,{align:"end",className:"bg-white dark:bg-zinc-950 border shadow-md",children:[t&&e.jsxs(P,{onClick:()=>t(n.original),children:[e.jsx(pe,{className:"w-4 h-4 mr-2"}),"Edit"]}),e.jsx(he,{}),e.jsxs(P,{className:"text-red-600 focus:text-red-600 focus:bg-red-100/50",onClick:()=>i.mutate(n.original.name),children:[e.jsx(ve,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}],getCoreRowModel:ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No profiles found. Create one to get started."}):e.jsx("div",{className:"border rounded-md",children:e.jsxs(oe,{children:[e.jsx(de,{children:d.getHeaderGroups().map(n=>e.jsx(T,{children:n.headers.map(r=>{const l=r.id==="actions",f=r.id==="configured",h=r.id==="name";return e.jsx(ce,{className:l?"w-[50px]":f?"w-[100px]":h?"w-[200px]":"w-auto",children:r.isPlaceholder?null:D(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(me,{children:d.getRowModel().rows.map(n=>e.jsx(T,{children:n.getVisibleCells().map(r=>e.jsx(ue,{children:D(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})})}function Te({label:s,...t}){const[i,o]=m.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[s&&e.jsx("label",{className:"text-sm font-medium",children:s}),e.jsxs("div",{className:"relative",children:[e.jsx(E,{type:i?"text":"password",className:"pr-10 font-mono",...t}),e.jsx(p,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>o(!i),tabIndex:-1,children:i?e.jsx(be,{className:"w-4 h-4"}):e.jsx(Ne,{className:"w-4 h-4"})})]})]})}function Pe({...s}){return e.jsx(M,{"data-slot":"alert-dialog",...s})}function Se({...s}){return e.jsx(z,{"data-slot":"alert-dialog-portal",...s})}function Ee({className:s,...t}){return e.jsx(F,{"data-slot":"alert-dialog-overlay",className:u("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),...t})}function Ae({className:s,...t}){return e.jsxs(Se,{children:[e.jsx(Ee,{}),e.jsx(L,{"data-slot":"alert-dialog-content",className:u("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",s),...t})]})}function Oe({className:s,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:u("flex flex-col gap-2 text-center sm:text-left",s),...t})}function Me({className:s,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:u("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),...t})}function Le({className:s,...t}){return e.jsx(k,{"data-slot":"alert-dialog-title",className:u("text-lg font-semibold",s),...t})}function ke({className:s,...t}){return e.jsx(I,{"data-slot":"alert-dialog-description",className:u("text-muted-foreground text-sm",s),...t})}function Ie({className:s,...t}){return e.jsx(R,{className:u(A(),s),...t})}function Ke({className:s,...t}){return e.jsx(K,{className:u(A({variant:"outline"}),s),...t})}function Re({open:s,onConfirm:t,onCancel:i,title:o,description:d,confirmText:n="Confirm",variant:r="default"}){return e.jsx(Pe,{open:s,onOpenChange:l=>!l&&i(),children:e.jsxs(Ae,{children:[e.jsxs(Oe,{children:[e.jsx(Le,{children:o}),e.jsx(ke,{children:d})]}),e.jsxs(Me,{children:[e.jsx(Ke,{onClick:i,children:"Cancel"}),e.jsx(Ie,{onClick:t,className:r==="destructive"?"bg-red-600 hover:bg-red-700":"",children:n})]})]})})}function ze({profileName:s,onClose:t}){const[i,o]=m.useState({}),[d,n]=m.useState(!1),r=ie(),{data:l,isLoading:f,refetch:h}=re({queryKey:["settings",s],queryFn:()=>fetch(`/api/settings/${s}/raw`).then(a=>a.json())}),j=m.useMemo(()=>{const a=l?.settings;if(a)return{...a,env:{...a.env,...i}}},[l?.settings,i]),g=le({mutationFn:async()=>{const a={...l?.settings,env:{...l?.settings?.env,...i}},c=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:a,expectedMtime:l?.mtime})});if(c.status===409)throw new Error("CONFLICT");if(!c.ok)throw new Error("Failed to save");return c.json()},onSuccess:()=>{r.invalidateQueries({queryKey:["settings",s]}),r.invalidateQueries({queryKey:["profiles"]}),y.success("Settings saved"),t()},onError:a=>{a.message==="CONFLICT"?n(!0):y.error(a.message)}}),b=()=>{g.mutate()},v=async a=>{n(!1),a?(await h(),g.mutate()):t()},N=(a,c)=>{o(x=>({...x,[a]:c}))},O=a=>[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(x=>x.test(a));return e.jsxs(e.Fragment,{children:[e.jsxs(q,{children:[e.jsxs(V,{children:["Edit Profile: ",s]}),e.jsx(B,{children:"Configure environment variables and settings for this profile."})]}),f?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):e.jsxs("div",{className:"flex flex-col h-[60vh]",children:[e.jsxs(Q,{defaultValue:"env",className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(U,{className:"w-full justify-start border-b rounded-none p-0 h-auto bg-transparent",children:[e.jsx(C,{value:"env",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Environment"}),e.jsx(C,{value:"general",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"General"})]}),e.jsx(w,{value:"env",className:"flex-1 overflow-hidden p-4 pt-4 m-0",children:e.jsx(Y,{className:"h-full pr-4",children:j?.env&&Object.keys(j.env).length>0?e.jsx("div",{className:"space-y-6",children:Object.entries(j.env).map(([a,c])=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(G,{className:"text-sm font-medium text-foreground",children:a}),O(a)?e.jsx(Te,{value:c,onChange:x=>N(a,x.target.value),className:"font-mono text-sm"}):e.jsx(E,{value:c,onChange:x=>N(a,x.target.value),className:"font-mono text-sm"})]},a))}):e.jsxs("div",{className:"py-12 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx("p",{children:"No environment variables configured."}),e.jsx("p",{className:"text-xs mt-1",children:"Add variables in your settings.json file."})]})})}),e.jsx(w,{value:"general",className:"p-4 m-0",children:e.jsxs(J,{children:[e.jsxs(X,{children:[e.jsx(W,{className:"text-base",children:"Profile Information"}),e.jsx(Z,{children:"Details about this configuration file."})]}),e.jsx(ee,{className:"space-y-4",children:l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Path"}),e.jsx("code",{className:"col-span-2 bg-muted p-1 rounded text-xs break-all",children:l.path})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("span",{className:"col-span-2",children:new Date(l.mtime).toLocaleString()})]})]})})]})})]}),e.jsxs("div",{className:"pt-4 mt-auto border-t flex justify-end gap-2",children:[e.jsxs(p,{type:"button",variant:"outline",onClick:t,children:[e.jsx(Ce,{className:"w-4 h-4 mr-2"})," Cancel"]}),e.jsx(p,{onClick:b,disabled:g.isPending,children:g.isPending?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-4 h-4 mr-2 animate-spin"})," Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"w-4 h-4 mr-2"})," Save Changes"]})})]})]}),e.jsx(Re,{open:d,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>v(!0),onCancel:()=>v(!1)})]})}function Fe({open:s,onClose:t,profileName:i}){const o=m.useCallback(d=>{d||t()},[t]);return e.jsx(H,{open:s,onOpenChange:o,children:e.jsx(_,{className:"sm:max-w-3xl max-h-[80vh] overflow-y-auto",children:s&&i&&e.jsx(ze,{profileName:i,onClose:t},`${i}-${s}`)})})}function Ye(){const[s,t]=m.useState(!1),[i,o]=m.useState(null),[d,n]=m.useState(!1),[r,l]=m.useState(null),{data:f,isLoading:h}=se(),j=v=>{l(v.name),n(!0)},g=()=>{t(!1),o(null)},b=()=>{n(!1),l(null)};return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"API Profiles"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage custom API profiles for Claude CLI"})]}),e.jsxs(p,{onClick:()=>t(!0),children:[e.jsx(ye,{className:"w-4 h-4 mr-2"}),"Create Profile"]})]}),h?e.jsx("div",{className:"text-muted-foreground",children:"Loading profiles..."}):e.jsx(De,{data:f?.profiles||[],onEditSettings:j}),e.jsx(te,{open:s,onClose:g,profile:i}),e.jsx(Fe,{open:d,onClose:b,profileName:r})]})}export{Ye as ApiPage};
|
|
1
|
+
import{j as e,t as M,v as L,w as k,x as I,y as K,z as R,B as z,E as F}from"./radix-ui-DAH8Vq_G.js";import{r as m}from"./react-vendor-CjrBBxxX.js";import{u as $,B as p,I as E,c as u,k as A,D as H,l as _,m as q,n as V,o as B,T as Q,e as U,f as C,h as w,p as Y,L as G,C as J,i as X,j as W,q as Z,a as ee,t as y,r as se,P as te}from"./index-CfJhTNCX.js";import{d as ae,f as D,g as ne,u as ie,a as re,b as le}from"./tanstack-DAI1tKxf.js";import{T as oe,a as de,b as T,c as ce,d as me,e as ue}from"./table-C7tMF2ph.js";import{D as xe,a as ge,b as fe,c as P,d as he}from"./dropdown-menu-B25I20Pd.js";import{E as je,u as pe,v as ve,w as be,x as Ne,L as S,X as Ce,y as we,k as ye}from"./icons-DT8ZzQec.js";import"./form-utils-DKkU3nz7.js";function De({data:s,onEditSettings:t}){const i=$(),d=ae({data:s,columns:[{accessorKey:"name",header:"Name",size:200},{accessorKey:"settingsPath",header:"Settings Path"},{accessorKey:"configured",header:"Status",size:100,cell:({row:n})=>e.jsx("span",{className:n.original.configured?"text-green-600":"text-yellow-600",children:n.original.configured?"[OK]":"[!]"})},{id:"actions",header:"Actions",size:100,cell:({row:n})=>e.jsxs(xe,{children:[e.jsx(ge,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",children:e.jsx(je,{className:"w-4 h-4"})})}),e.jsxs(fe,{align:"end",className:"bg-white dark:bg-zinc-950 border shadow-md",children:[t&&e.jsxs(P,{onClick:()=>t(n.original),children:[e.jsx(pe,{className:"w-4 h-4 mr-2"}),"Edit"]}),e.jsx(he,{}),e.jsxs(P,{className:"text-red-600 focus:text-red-600 focus:bg-red-100/50",onClick:()=>i.mutate(n.original.name),children:[e.jsx(ve,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}],getCoreRowModel:ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No profiles found. Create one to get started."}):e.jsx("div",{className:"border rounded-md",children:e.jsxs(oe,{children:[e.jsx(de,{children:d.getHeaderGroups().map(n=>e.jsx(T,{children:n.headers.map(r=>{const l=r.id==="actions",f=r.id==="configured",h=r.id==="name";return e.jsx(ce,{className:l?"w-[50px]":f?"w-[100px]":h?"w-[200px]":"w-auto",children:r.isPlaceholder?null:D(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(me,{children:d.getRowModel().rows.map(n=>e.jsx(T,{children:n.getVisibleCells().map(r=>e.jsx(ue,{children:D(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})})}function Te({label:s,...t}){const[i,o]=m.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[s&&e.jsx("label",{className:"text-sm font-medium",children:s}),e.jsxs("div",{className:"relative",children:[e.jsx(E,{type:i?"text":"password",className:"pr-10 font-mono",...t}),e.jsx(p,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>o(!i),tabIndex:-1,children:i?e.jsx(be,{className:"w-4 h-4"}):e.jsx(Ne,{className:"w-4 h-4"})})]})]})}function Pe({...s}){return e.jsx(M,{"data-slot":"alert-dialog",...s})}function Se({...s}){return e.jsx(z,{"data-slot":"alert-dialog-portal",...s})}function Ee({className:s,...t}){return e.jsx(F,{"data-slot":"alert-dialog-overlay",className:u("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),...t})}function Ae({className:s,...t}){return e.jsxs(Se,{children:[e.jsx(Ee,{}),e.jsx(L,{"data-slot":"alert-dialog-content",className:u("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",s),...t})]})}function Oe({className:s,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:u("flex flex-col gap-2 text-center sm:text-left",s),...t})}function Me({className:s,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:u("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),...t})}function Le({className:s,...t}){return e.jsx(k,{"data-slot":"alert-dialog-title",className:u("text-lg font-semibold",s),...t})}function ke({className:s,...t}){return e.jsx(I,{"data-slot":"alert-dialog-description",className:u("text-muted-foreground text-sm",s),...t})}function Ie({className:s,...t}){return e.jsx(R,{className:u(A(),s),...t})}function Ke({className:s,...t}){return e.jsx(K,{className:u(A({variant:"outline"}),s),...t})}function Re({open:s,onConfirm:t,onCancel:i,title:o,description:d,confirmText:n="Confirm",variant:r="default"}){return e.jsx(Pe,{open:s,onOpenChange:l=>!l&&i(),children:e.jsxs(Ae,{children:[e.jsxs(Oe,{children:[e.jsx(Le,{children:o}),e.jsx(ke,{children:d})]}),e.jsxs(Me,{children:[e.jsx(Ke,{onClick:i,children:"Cancel"}),e.jsx(Ie,{onClick:t,className:r==="destructive"?"bg-red-600 hover:bg-red-700":"",children:n})]})]})})}function ze({profileName:s,onClose:t}){const[i,o]=m.useState({}),[d,n]=m.useState(!1),r=ie(),{data:l,isLoading:f,refetch:h}=re({queryKey:["settings",s],queryFn:()=>fetch(`/api/settings/${s}/raw`).then(a=>a.json())}),j=m.useMemo(()=>{const a=l?.settings;if(a)return{...a,env:{...a.env,...i}}},[l?.settings,i]),g=le({mutationFn:async()=>{const a={...l?.settings,env:{...l?.settings?.env,...i}},c=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:a,expectedMtime:l?.mtime})});if(c.status===409)throw new Error("CONFLICT");if(!c.ok)throw new Error("Failed to save");return c.json()},onSuccess:()=>{r.invalidateQueries({queryKey:["settings",s]}),r.invalidateQueries({queryKey:["profiles"]}),y.success("Settings saved"),t()},onError:a=>{a.message==="CONFLICT"?n(!0):y.error(a.message)}}),b=()=>{g.mutate()},v=async a=>{n(!1),a?(await h(),g.mutate()):t()},N=(a,c)=>{o(x=>({...x,[a]:c}))},O=a=>[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(x=>x.test(a));return e.jsxs(e.Fragment,{children:[e.jsxs(q,{children:[e.jsxs(V,{children:["Edit Profile: ",s]}),e.jsx(B,{children:"Configure environment variables and settings for this profile."})]}),f?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):e.jsxs("div",{className:"flex flex-col h-[60vh]",children:[e.jsxs(Q,{defaultValue:"env",className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(U,{className:"w-full justify-start border-b rounded-none p-0 h-auto bg-transparent",children:[e.jsx(C,{value:"env",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Environment"}),e.jsx(C,{value:"general",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"General"})]}),e.jsx(w,{value:"env",className:"flex-1 overflow-hidden p-4 pt-4 m-0",children:e.jsx(Y,{className:"h-full pr-4",children:j?.env&&Object.keys(j.env).length>0?e.jsx("div",{className:"space-y-6",children:Object.entries(j.env).map(([a,c])=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(G,{className:"text-sm font-medium text-foreground",children:a}),O(a)?e.jsx(Te,{value:c,onChange:x=>N(a,x.target.value),className:"font-mono text-sm"}):e.jsx(E,{value:c,onChange:x=>N(a,x.target.value),className:"font-mono text-sm"})]},a))}):e.jsxs("div",{className:"py-12 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx("p",{children:"No environment variables configured."}),e.jsx("p",{className:"text-xs mt-1",children:"Add variables in your settings.json file."})]})})}),e.jsx(w,{value:"general",className:"p-4 m-0",children:e.jsxs(J,{children:[e.jsxs(X,{children:[e.jsx(W,{className:"text-base",children:"Profile Information"}),e.jsx(Z,{children:"Details about this configuration file."})]}),e.jsx(ee,{className:"space-y-4",children:l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Path"}),e.jsx("code",{className:"col-span-2 bg-muted p-1 rounded text-xs break-all",children:l.path})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("span",{className:"col-span-2",children:new Date(l.mtime).toLocaleString()})]})]})})]})})]}),e.jsxs("div",{className:"pt-4 mt-auto border-t flex justify-end gap-2",children:[e.jsxs(p,{type:"button",variant:"outline",onClick:t,children:[e.jsx(Ce,{className:"w-4 h-4 mr-2"})," Cancel"]}),e.jsx(p,{onClick:b,disabled:g.isPending,children:g.isPending?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-4 h-4 mr-2 animate-spin"})," Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"w-4 h-4 mr-2"})," Save Changes"]})})]})]}),e.jsx(Re,{open:d,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>v(!0),onCancel:()=>v(!1)})]})}function Fe({open:s,onClose:t,profileName:i}){const o=m.useCallback(d=>{d||t()},[t]);return e.jsx(H,{open:s,onOpenChange:o,children:e.jsx(_,{className:"sm:max-w-3xl max-h-[80vh] overflow-y-auto",children:s&&i&&e.jsx(ze,{profileName:i,onClose:t},`${i}-${s}`)})})}function Ye(){const[s,t]=m.useState(!1),[i,o]=m.useState(null),[d,n]=m.useState(!1),[r,l]=m.useState(null),{data:f,isLoading:h}=se(),j=v=>{l(v.name),n(!0)},g=()=>{t(!1),o(null)},b=()=>{n(!1),l(null)};return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"API Profiles"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage custom API profiles for Claude CLI"})]}),e.jsxs(p,{onClick:()=>t(!0),children:[e.jsx(ye,{className:"w-4 h-4 mr-2"}),"Create Profile"]})]}),h?e.jsx("div",{className:"text-muted-foreground",children:"Loading profiles..."}):e.jsx(De,{data:f?.profiles||[],onEditSettings:j}),e.jsx(te,{open:s,onClose:g,profile:i}),e.jsx(Fe,{open:d,onClose:b,profileName:r})]})}export{Ye as ApiPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-ui-DAH8Vq_G.js";import{r as l}from"./react-vendor-CjrBBxxX.js";import{s as f,t as h,d as $,B as d,D as G,l as U,m as H,n as W,o as J,C as v,a as N,L,I as K}from"./index-CfJhTNCX.js";import{D as X,a as Y,b as Z,c as R}from"./dropdown-menu-B25I20Pd.js";import{a as _,u as b,b as C,d as he,f as V,g as pe}from"./tanstack-DAI1tKxf.js";import{T as ge,a as fe,b as z,c as je,d as ve,e as Ne}from"./table-C7tMF2ph.js";import{z as y,E as ye,v as ee,G as se,a as E,T as te,h as w,i as ae,I as T,R as re,X as we,k as be,J as O,N as Ce}from"./icons-DT8ZzQec.js";import"./form-utils-DKkU3nz7.js";function Ae(){return _({queryKey:["cliproxy"],queryFn:()=>f.cliproxy.list()})}function P(){return _({queryKey:["cliproxy-auth"],queryFn:()=>f.cliproxy.auth()})}function ke(){const s=b();return C({mutationFn:r=>f.cliproxy.create(r),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy"]}),h.success("Variant created successfully")},onError:r=>{h.error(r.message)}})}function Se(){const s=b();return C({mutationFn:r=>f.cliproxy.delete(r),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy"]}),h.success("Variant deleted successfully")},onError:r=>{h.error(r.message)}})}function De(){const s=b();return C({mutationFn:({provider:r,accountId:n})=>f.cliproxy.accounts.setDefault(r,n),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy-accounts"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]}),h.success("Default account updated")},onError:r=>{h.error(r.message)}})}function Te(){const s=b();return C({mutationFn:({provider:r,accountId:n})=>f.cliproxy.accounts.remove(r,n),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy-accounts"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]}),h.success("Account removed")},onError:r=>{h.error(r.message)}})}const Re={gemini:"Google Gemini",codex:"OpenAI Codex",agy:"Antigravity",qwen:"Alibaba Qwen",iflow:"iFlow"};function Pe({data:s}){const r=Se(),i=he({data:s,columns:[{accessorKey:"name",header:"Name",cell:({row:a})=>e.jsx("span",{className:"font-medium",children:a.original.name})},{accessorKey:"provider",header:"Provider",cell:({row:a})=>Re[a.original.provider]||a.original.provider},{accessorKey:"account",header:"Account",cell:({row:a})=>{const c=a.original.account;return c?e.jsxs($,{variant:"secondary",className:"text-xs font-normal",children:[e.jsx(y,{className:"w-3 h-3 mr-1 opacity-70"}),c]}):e.jsx("span",{className:"text-muted-foreground text-xs italic",children:"default"})}},{accessorKey:"settings",header:"Settings Path",cell:({row:a})=>e.jsx("code",{className:"text-[10px] bg-muted px-1.5 py-0.5 rounded text-muted-foreground",children:a.original.settings||`config.cliproxy.${a.original.name}`})},{id:"actions",header:"Actions",cell:({row:a})=>e.jsx("div",{className:"flex justify-end",children:e.jsxs(X,{children:[e.jsx(Y,{asChild:!0,children:e.jsxs(d,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(ye,{className:"w-4 h-4"})]})}),e.jsx(Z,{align:"end",className:"bg-white dark:bg-zinc-950",children:e.jsxs(R,{className:"text-red-600 focus:text-red-600 focus:bg-red-50 dark:focus:bg-red-950/30",onClick:()=>r.mutate(a.original.name),children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),"Delete"]})})]})})}],getCoreRowModel:pe()});return s.length===0?e.jsxs("div",{className:"text-center py-12 border rounded-lg bg-muted/5 border-dashed",children:[e.jsx("div",{className:"text-muted-foreground text-sm",children:"No CLIProxy variants found."}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Create one to use OAuth-based providers with specific account configurations."})]}):e.jsx("div",{className:"border rounded-md overflow-hidden bg-card",children:e.jsxs(ge,{children:[e.jsx(fe,{className:"bg-muted/50",children:i.getHeaderGroups().map(a=>e.jsx(z,{children:a.headers.map(c=>e.jsx(je,{children:c.isPlaceholder?null:V(c.column.columnDef.header,c.getContext())},c.id))},a.id))}),e.jsx(ve,{children:i.getRowModel().rows.map(a=>e.jsx(z,{children:a.getVisibleCells().map(c=>e.jsx(Ne,{children:V(c.column.columnDef.cell,c.getContext())},c.id))},a.id))})]})})}const B=[{id:"gemini",name:"Google Gemini",description:"Gemini Pro/Flash models"},{id:"codex",name:"OpenAI Codex",description:"GPT-4 and codex models"},{id:"agy",name:"Antigravity",description:"Antigravity AI models"},{id:"qwen",name:"Alibaba Qwen",description:"Qwen Code models"},{id:"iflow",name:"iFlow",description:"iFlow AI models"}];function qe({open:s,onClose:r}){const[n,i]=l.useState("provider"),[a,c]=l.useState(""),[o,u]=l.useState(null),[m,p]=l.useState(""),[x,j]=l.useState(""),[ne,A]=l.useState(!1),[k,q]=l.useState(!1),{data:I,refetch:ie}=P(),S=ke(),g=I?.authStatus.find(t=>t.provider===a)?.accounts||[];l.useEffect(()=>{if(!s){const t=setTimeout(()=>{i("provider"),c(""),u(null),p(""),j(""),A(!1)},0);return()=>clearTimeout(t)}},[s]),l.useEffect(()=>{if(n==="auth"&&g.length>0){const t=setTimeout(()=>{g.length===1?(u(g[0]),i("variant")):i("account")},0);return()=>clearTimeout(t)}},[n,g]);const ce=async t=>{await navigator.clipboard.writeText(t),A(!0),setTimeout(()=>A(!1),2e3)},le=async()=>{q(!0),await ie(),q(!1)},de=t=>{c(t);const D=I?.authStatus.find(xe=>xe.provider===t)?.accounts||[];D.length===0?i("auth"):D.length===1?(u(D[0]),i("variant")):i("account")},oe=t=>{u(t),i("variant")},me=async()=>{if(!(!m||!a))try{await S.mutateAsync({name:m,provider:a,model:x||void 0,account:o?.id}),i("success")}catch(t){console.error("Failed to create variant:",t)}},M=`ccs ${a} --auth --add`,Q=["provider","auth","variant","success"],ue=(t=>t==="account"?1:Q.indexOf(t))(n);return e.jsx(G,{open:s,onOpenChange:r,children:e.jsxs(U,{className:"sm:max-w-lg",children:[e.jsxs(H,{children:[e.jsxs(W,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"w-5 h-5 text-primary"}),"Quick Setup Wizard"]}),e.jsxs(J,{children:[n==="provider"&&"Select a provider to get started",n==="auth"&&"Authenticate with your provider",n==="account"&&"Select which account to use",n==="variant"&&"Create your custom variant",n==="success"&&"Setup complete!"]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[n==="provider"&&e.jsx("div",{className:"grid gap-2",children:B.map(t=>e.jsxs("button",{onClick:()=>de(t.id),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t.description})]}),e.jsx(E,{className:"w-4 h-4 text-muted-foreground"})]},t.id))}),n==="auth"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4"}),"Run this command in your terminal:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:M}),e.jsx(d,{variant:"outline",size:"icon",onClick:()=>ce(M),children:ne?e.jsx(w,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["This will open your browser to authenticate with"," ",B.find(t=>t.id===a)?.name]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(d,{variant:"ghost",onClick:()=>i("provider"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs(d,{onClick:le,disabled:k,children:[e.jsx(re,{className:`w-4 h-4 mr-2 ${k?"animate-spin":""}`}),k?"Checking...":"I ran the command"]})]})]}),n==="account"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid gap-2",children:g.map(t=>e.jsxs("button",{onClick:()=>oe(t),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{className:"w-5 h-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.email||t.id}),t.isDefault&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Default account"})]})]}),e.jsx(E,{className:"w-4 h-4 text-muted-foreground"})]},t.id))}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs(d,{variant:"ghost",onClick:()=>i("auth"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Add different account"]})})]}),n==="variant"&&e.jsxs("div",{className:"space-y-4",children:[o&&e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx(y,{className:"w-4 h-4"}),e.jsxs("span",{children:["Using: ",o.email||o.id]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"variant-name",children:"Variant Name *"}),e.jsx(K,{id:"variant-name",value:m,onChange:t=>p(t.target.value),placeholder:"e.g., my-gemini, g3, flash"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Use this name to invoke: ccs ",m||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"model-name",children:"Model (optional)"}),e.jsx(K,{id:"model-name",value:x,onChange:t=>j(t.target.value),placeholder:"e.g., gemini-2.5-pro"})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(d,{variant:"ghost",onClick:()=>g.length>1?i("account"):i("auth"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsx(d,{onClick:me,disabled:!m||S.isPending,children:S.isPending?"Creating...":"Create Variant"})]})]}),n==="success"&&e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:e.jsx(w,{className:"w-8 h-8 text-green-600 dark:text-green-400"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:"Variant Created!"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Your custom variant is ready to use"})]}),e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Usage:"}),e.jsxs("code",{className:"block px-3 py-2 bg-muted rounded-md font-mono text-sm",children:["ccs ",m,' "your prompt here"']})]})}),e.jsx(d,{onClick:r,className:"w-full",children:"Done"})]})]}),e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:Q.map((t,F)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${ue>=F?"bg-primary":"bg-muted"}`},t))})]})})}function Ie({open:s,onClose:r,provider:n,displayName:i}){const[a,c]=l.useState(!1),[o,u]=l.useState(!1),{refetch:m}=P(),p=`ccs ${n} --auth --add`,x=async()=>{await navigator.clipboard.writeText(p),c(!0),setTimeout(()=>c(!1),2e3)},j=async()=>{u(!0),await m(),u(!1),r()};return e.jsx(G,{open:s,onOpenChange:r,children:e.jsxs(U,{className:"sm:max-w-md",children:[e.jsxs(H,{children:[e.jsxs(W,{children:["Add ",i," Account"]}),e.jsx(J,{children:"Run the command below in your terminal to authenticate a new account"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4"}),"Run this command:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:p}),e.jsx(d,{variant:"outline",size:"icon",onClick:x,children:a?e.jsx(w,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["This will open your browser to authenticate with ",i]})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(d,{variant:"ghost",onClick:r,children:"Cancel"}),e.jsxs(d,{onClick:j,disabled:o,children:[e.jsx(re,{className:`w-4 h-4 mr-2 ${o?"animate-spin":""}`}),o?"Checking...":"I ran the command"]})]})]})]})})}function Me({account:s,onSetDefault:r,onRemove:n,isRemoving:i}){return e.jsxs(X,{children:[e.jsx(Y,{asChild:!0,children:e.jsxs("button",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full border transition-colors hover:bg-muted/80 ${s.isDefault?"border-primary/30 bg-primary/10 text-primary font-medium":"border-muted bg-muted/40"}`,children:[e.jsx(y,{className:"w-3 h-3"}),e.jsx("span",{className:"max-w-[200px] truncate",children:s.email||s.id}),s.isDefault&&e.jsx(O,{className:"w-3 h-3 fill-current"}),e.jsx(Ce,{className:"w-3 h-3 opacity-50"})]})}),e.jsxs(Z,{align:"start",className:"w-56",children:[e.jsxs("div",{className:"px-2 py-1.5 text-xs text-muted-foreground bg-muted/30 -mx-1 -mt-1 mb-1 border-b",children:[e.jsx("div",{className:"font-medium text-foreground mb-0.5 truncate",children:s.email||s.id}),s.lastUsedAt&&e.jsxs("div",{children:["Last used: ",new Date(s.lastUsedAt).toLocaleDateString()]})]}),!s.isDefault&&e.jsxs(R,{onClick:r,children:[e.jsx(O,{className:"w-4 h-4 mr-2"}),"Set as default"]}),e.jsxs(R,{className:"text-red-600 focus:text-red-600 focus:bg-red-50 dark:focus:bg-red-950/30",onClick:n,disabled:i,children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),i?"Removing...":"Remove account"]})]})]})}function Qe({status:s,setDefaultMutation:r,removeMutation:n,onAddAccount:i}){const a=s.accounts||[];return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between p-4 border-b last:border-0 hover:bg-muted/5 transition-colors gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-[180px]",children:[e.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${s.authenticated?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:s.authenticated?e.jsx(w,{className:"w-5 h-5"}):e.jsx(we,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[s.displayName,a.length>0&&e.jsx($,{variant:"secondary",className:"text-[10px] h-5 px-1.5 font-normal",children:a.length})]}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:s.provider})]})]}),e.jsx("div",{className:"flex-1 flex items-center gap-2 flex-wrap",children:s.authenticated&&a.length>0?a.map(c=>e.jsx(Me,{account:c,onSetDefault:()=>r.mutate({provider:s.provider,accountId:c.id}),onRemove:()=>n.mutate({provider:s.provider,accountId:c.id}),isRemoving:n.isPending},c.id)):e.jsx("div",{className:"text-sm text-muted-foreground italic",children:s.authenticated?"Authenticated (No specific accounts tracked)":"Not authenticated"})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(d,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:i,children:[e.jsx(be,{className:"w-3 h-3"}),"Add Account"]})})]})}function Ue(){const[s,r]=l.useState(!1),[n,i]=l.useState(null),{data:a,isLoading:c}=Ae(),{data:o,isLoading:u}=P(),m=De(),p=Te();return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"CLIProxy"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage OAuth-based provider variants and multi-account configurations"})]}),e.jsxs(d,{onClick:()=>r(!0),children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Quick Setup"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Built-in Providers"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage authentication status and accounts for built-in providers."})]}),e.jsx(v,{className:"py-0 gap-0",children:e.jsx(N,{className:"p-0",children:u?e.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading authentication status..."}):e.jsx("div",{className:"flex flex-col",children:o?.authStatus.map(x=>e.jsx(Qe,{status:x,setDefaultMutation:m,removeMutation:p,onAddAccount:()=>i({provider:x.provider,displayName:x.displayName})},x.provider))})})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Custom Variants"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create custom aliases for providers with specific accounts."})]})}),c?e.jsx("div",{className:"text-muted-foreground",children:"Loading variants..."}):e.jsx(Pe,{data:a?.variants||[]})]}),e.jsx(qe,{open:s,onClose:()=>r(!1)}),e.jsx(Ie,{open:n!==null,onClose:()=>i(null),provider:n?.provider||"",displayName:n?.displayName||""})]})}export{Ue as CliproxyPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,F as d,G as s,H as i,J as u,K as c,L as m}from"./radix-ui-DAH8Vq_G.js";import"./react-vendor-CjrBBxxX.js";import{c as n}from"./index-
|
|
1
|
+
import{j as e,F as d,G as s,H as i,J as u,K as c,L as m}from"./radix-ui-DAH8Vq_G.js";import"./react-vendor-CjrBBxxX.js";import{c as n}from"./index-CfJhTNCX.js";function v({...t}){return e.jsx(d,{"data-slot":"dropdown-menu",...t})}function g({...t}){return e.jsx(s,{"data-slot":"dropdown-menu-trigger",...t})}function x({className:t,sideOffset:a=4,...o}){return e.jsx(i,{children:e.jsx(u,{"data-slot":"dropdown-menu-content",sideOffset:a,className:n("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",t),...o})})}function w({className:t,inset:a,variant:o="default",...r}){return e.jsx(c,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:n("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function b({className:t,...a}){return e.jsx(m,{"data-slot":"dropdown-menu-separator",className:n("bg-border -mx-1 my-1 h-px",t),...a})}export{v as D,g as a,x as b,w as c,b as d};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{c as H}from"./react-vendor-CjrBBxxX.js";var Se=e=>e.type==="checkbox",he=e=>e instanceof Date,K=e=>e==null;const cr=e=>typeof e=="object";var j=e=>!K(e)&&!Array.isArray(e)&&cr(e)&&!he(e),Mr=e=>j(e)&&e.target?Se(e.target)?e.target.checked:e.target.value:e,Br=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Wr=(e,t)=>e.has(Br(t)),qr=e=>{const t=e.constructor&&e.constructor.prototype;return j(t)&&t.hasOwnProperty("isPrototypeOf")},lt=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function M(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(lt&&(e instanceof Blob||n))&&(r||j(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!qr(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=M(e[o]));else return e;return t}var Be=e=>/^\w*$/.test(e),R=e=>e===void 0,ft=e=>Array.isArray(e)?e.filter(Boolean):[],dt=e=>ft(e.replace(/["|']|\]/g,"").split(/\.|\[/)),g=(e,t,r)=>{if(!t||!j(e))return r;const n=(Be(t)?[t]:dt(t)).reduce((o,s)=>K(o)?o:o[s],e);return R(n)||n===e?R(e[t])?r:e[t]:n},se=e=>typeof e=="boolean",E=(e,t,r)=>{let n=-1;const o=Be(t)?[t]:dt(t),s=o.length,i=s-1;for(;++n<s;){const a=o[n];let _=r;if(n!==i){const v=e[a];_=j(v)||Array.isArray(v)?v:isNaN(+o[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=_,e=e[a]}};const Ot={BLUR:"blur",FOCUS_OUT:"focusout"},te={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ue={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Jr=H.createContext(null);Jr.displayName="HookFormContext";var Kr=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==te.all&&(t._proxyFormState[i]=!n||te.all),e[i]}});return o};const Hr=typeof window<"u"?H.useLayoutEffect:H.useEffect;var G=e=>typeof e=="string",Gr=(e,t,r,n,o)=>G(e)?(n&&t.watch.add(e),g(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),g(r,s))):(n&&(t.watchAll=!0),r),st=e=>K(e)||!cr(e);function le(e,t,r=new WeakSet){if(st(e)||st(t))return Object.is(e,t);if(he(e)&&he(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const i=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const a=t[s];if(he(i)&&he(a)||j(i)&&j(a)||Array.isArray(i)&&Array.isArray(a)?!le(i,a,r):!Object.is(i,a))return!1}}return!0}var Xr=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Ee=e=>Array.isArray(e)?e:[e],St=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function ar(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&j(o)&&s){const i=ar(o,s);j(i)&&(r[n]=i)}else e[n]&&(r[n]=s)}return r}var q=e=>j(e)&&!Object.keys(e).length,ht=e=>e.type==="file",re=e=>typeof e=="function",Ue=e=>{if(!lt)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lr=e=>e.type==="select-multiple",pt=e=>e.type==="radio",Yr=e=>pt(e)||Se(e),ot=e=>Ue(e)&&e.isConnected;function Qr(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=R(e)?n++:e[t[n++]];return e}function en(e){for(const t in e)if(e.hasOwnProperty(t)&&!R(e[t]))return!1;return!0}function U(e,t){const r=Array.isArray(t)?t:Be(t)?[t]:dt(t),n=r.length===1?e:Qr(e,r),o=r.length-1,s=r[o];return n&&delete n[s],o!==0&&(j(n)&&q(n)||Array.isArray(n)&&en(n))&&U(e,r.slice(0,-1)),e}var tn=e=>{for(const t in e)if(re(e[t]))return!0;return!1};function fr(e){return Array.isArray(e)||j(e)&&!tn(e)}function it(e,t={}){for(const r in e){const n=e[r];fr(n)?(t[r]=Array.isArray(n)?[]:{},it(n,t[r])):R(n)||(t[r]=!0)}return t}function we(e,t,r){r||(r=it(t));for(const n in e){const o=e[n];if(fr(o))R(t)||st(r[n])?r[n]=it(o,Array.isArray(o)?[]:{}):we(o,K(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!le(o,s)}}return r}const xt={value:!1,isValid:!1},Vt={value:!0,isValid:!0};var dr=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!R(e[0].attributes.value)?R(e[0].value)||e[0].value===""?Vt:{value:e[0].value,isValid:!0}:Vt:xt}return xt},hr=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>R(e)?e:t?e===""?NaN:e&&+e:r&&G(e)?new Date(e):n?n(e):e;const Pt={isValid:!1,value:null};var pr=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Pt):Pt;function Tt(e){const t=e.ref;return ht(t)?t.files:pt(t)?pr(e.refs).value:lr(t)?[...t.selectedOptions].map(({value:r})=>r):Se(t)?dr(e.refs).value:hr(R(t.value)?e.ref.value:t.value,e)}var rn=(e,t,r,n)=>{const o={};for(const s of e){const i=g(t,s);i&&E(o,s,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},je=e=>e instanceof RegExp,Ae=e=>R(e)?e:je(e)?e.source:j(e)?je(e.value)?e.value.source:e.value:e,It=e=>({isOnSubmit:!e||e===te.onSubmit,isOnBlur:e===te.onBlur,isOnChange:e===te.onChange,isOnAll:e===te.all,isOnTouch:e===te.onTouched});const Ct="AsyncFunction";var nn=e=>!!e&&!!e.validate&&!!(re(e.validate)&&e.validate.constructor.name===Ct||j(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Ct)),on=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Rt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const De=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=g(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(De(a,t))break}else if(j(a)&&De(a,t))break}}};function Ut(e,t,r){const n=g(e,r);if(n||Be(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),i=g(t,s),a=g(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:r}}var sn=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return q(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!n||te.all))},un=(e,t,r)=>!e||!t||e===t||Ee(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),cn=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,an=(e,t)=>!ft(g(e,t)).length&&U(e,t),ln=(e,t,r)=>{const n=Ee(g(e,r));return E(n,"root",t[r]),E(e,r,n),e};function jt(e,t,r="validate"){if(G(e)||Array.isArray(e)&&e.every(G)||se(e)&&!e)return{type:r,message:G(e)?e:"",ref:t}}var ye=e=>j(e)&&!je(e)?e:{value:e,message:""},Lt=async(e,t,r,n,o,s)=>{const{ref:i,refs:a,required:_,maxLength:v,minLength:y,min:k,max:m,pattern:S,validate:T,name:V,valueAsNumber:Q,mount:Ze}=e._f,z=g(r,V);if(!Ze||t.has(V))return{};const L=a?a[0]:i,I=Z=>{o&&L.reportValidity&&(L.setCustomValidity(se(Z)?"":Z||""),L.reportValidity())},O={},xe=pt(i),ce=Se(i),Ye=xe||ce,ee=(Q||ht(i))&&R(i.value)&&R(z)||Ue(i)&&i.value===""||z===""||Array.isArray(z)&&!z.length,de=Xr.bind(null,V,n,O),ne=(Z,A,C,W=ue.maxLength,J=ue.minLength)=>{const oe=Z?A:C;O[V]={type:Z?W:J,message:oe,ref:i,...de(Z?W:J,oe)}};if(s?!Array.isArray(z)||!z.length:_&&(!Ye&&(ee||K(z))||se(z)&&!z||ce&&!dr(a).isValid||xe&&!pr(a).isValid)){const{value:Z,message:A}=G(_)?{value:!!_,message:_}:ye(_);if(Z&&(O[V]={type:ue.required,message:A,ref:L,...de(ue.required,A)},!n))return I(A),O}if(!ee&&(!K(k)||!K(m))){let Z,A;const C=ye(m),W=ye(k);if(!K(z)&&!isNaN(z)){const J=i.valueAsNumber||z&&+z;K(C.value)||(Z=J>C.value),K(W.value)||(A=J<W.value)}else{const J=i.valueAsDate||new Date(z),oe=Ve=>new Date(new Date().toDateString()+" "+Ve),$e=i.type=="time",ve=i.type=="week";G(C.value)&&z&&(Z=$e?oe(z)>oe(C.value):ve?z>C.value:J>new Date(C.value)),G(W.value)&&z&&(A=$e?oe(z)<oe(W.value):ve?z<W.value:J<new Date(W.value))}if((Z||A)&&(ne(!!Z,C.message,W.message,ue.max,ue.min),!n))return I(O[V].message),O}if((v||y)&&!ee&&(G(z)||s&&Array.isArray(z))){const Z=ye(v),A=ye(y),C=!K(Z.value)&&z.length>+Z.value,W=!K(A.value)&&z.length<+A.value;if((C||W)&&(ne(C,Z.message,A.message),!n))return I(O[V].message),O}if(S&&!ee&&G(z)){const{value:Z,message:A}=ye(S);if(je(Z)&&!z.match(Z)&&(O[V]={type:ue.pattern,message:A,ref:i,...de(ue.pattern,A)},!n))return I(A),O}if(T){if(re(T)){const Z=await T(z,r),A=jt(Z,L);if(A&&(O[V]={...A,...de(ue.validate,A.message)},!n))return I(A.message),O}else if(j(T)){let Z={};for(const A in T){if(!q(Z)&&!n)break;const C=jt(await T[A](z,r),L,A);C&&(Z={...C,...de(A,C.message)},I(C.message),n&&(O[V]=Z))}if(!q(Z)&&(O[V]={ref:L,...Z},!n))return O}}return I(!0),O};const fn={mode:te.onSubmit,reValidateMode:te.onChange,shouldFocusError:!0};function dn(e={}){let t={...fn,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:re(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},o=j(t.defaultValues)||j(t.values)?M(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:M(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},_,v=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let k={...y};const m={array:St(),state:St()},S=t.criteriaMode===te.all,T=u=>c=>{clearTimeout(v),v=setTimeout(u,c)},V=async u=>{if(!t.disabled&&(y.isValid||k.isValid||u)){const c=t.resolver?q((await ce()).errors):await ee(n,!0);c!==r.isValid&&m.state.next({isValid:c})}},Q=(u,c)=>{!t.disabled&&(y.isValidating||y.validatingFields||k.isValidating||k.validatingFields)&&((u||Array.from(a.mount)).forEach(l=>{l&&(c?E(r.validatingFields,l,c):U(r.validatingFields,l))}),m.state.next({validatingFields:r.validatingFields,isValidating:!q(r.validatingFields)}))},Ze=(u,c=[],l,p,h=!0,d=!0)=>{if(p&&l&&!t.disabled){if(i.action=!0,d&&Array.isArray(g(n,u))){const w=l(g(n,u),p.argA,p.argB);h&&E(n,u,w)}if(d&&Array.isArray(g(r.errors,u))){const w=l(g(r.errors,u),p.argA,p.argB);h&&E(r.errors,u,w),an(r.errors,u)}if((y.touchedFields||k.touchedFields)&&d&&Array.isArray(g(r.touchedFields,u))){const w=l(g(r.touchedFields,u),p.argA,p.argB);h&&E(r.touchedFields,u,w)}(y.dirtyFields||k.dirtyFields)&&(r.dirtyFields=we(o,s)),m.state.next({name:u,isDirty:ne(u,c),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else E(s,u,c)},z=(u,c)=>{E(r.errors,u,c),m.state.next({errors:r.errors})},L=u=>{r.errors=u,m.state.next({errors:r.errors,isValid:!1})},I=(u,c,l,p)=>{const h=g(n,u);if(h){const d=g(s,u,R(l)?g(o,u):l);R(d)||p&&p.defaultChecked||c?E(s,u,c?d:Tt(h._f)):C(u,d),i.mount&&!i.action&&V()}},O=(u,c,l,p,h)=>{let d=!1,w=!1;const $={name:u};if(!t.disabled){if(!l||p){(y.isDirty||k.isDirty)&&(w=r.isDirty,r.isDirty=$.isDirty=ne(),d=w!==$.isDirty);const D=le(g(o,u),c);w=!!g(r.dirtyFields,u),D?U(r.dirtyFields,u):E(r.dirtyFields,u,!0),$.dirtyFields=r.dirtyFields,d=d||(y.dirtyFields||k.dirtyFields)&&w!==!D}if(l){const D=g(r.touchedFields,u);D||(E(r.touchedFields,u,l),$.touchedFields=r.touchedFields,d=d||(y.touchedFields||k.touchedFields)&&D!==l)}d&&h&&m.state.next($)}return d?$:{}},xe=(u,c,l,p)=>{const h=g(r.errors,u),d=(y.isValid||k.isValid)&&se(c)&&r.isValid!==c;if(t.delayError&&l?(_=T(()=>z(u,l)),_(t.delayError)):(clearTimeout(v),_=null,l?E(r.errors,u,l):U(r.errors,u)),(l?!le(h,l):h)||!q(p)||d){const w={...p,...d&&se(c)?{isValid:c}:{},errors:r.errors,name:u};r={...r,...w},m.state.next(w)}},ce=async u=>{Q(u,!0);const c=await t.resolver(s,t.context,rn(u||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return Q(u),c},Ye=async u=>{const{errors:c}=await ce(u);if(u)for(const l of u){const p=g(c,l);p?E(r.errors,l,p):U(r.errors,l)}else r.errors=c;return c},ee=async(u,c,l={valid:!0})=>{for(const p in u){const h=u[p];if(h){const{_f:d,...w}=h;if(d){const $=a.array.has(d.name),D=h._f&&nn(h._f);D&&y.validatingFields&&Q([d.name],!0);const X=await Lt(h,a.disabled,s,S,t.shouldUseNativeValidation&&!c,$);if(D&&y.validatingFields&&Q([d.name]),X[d.name]&&(l.valid=!1,c))break;!c&&(g(X,d.name)?$?ln(r.errors,X,d.name):E(r.errors,d.name,X[d.name]):U(r.errors,d.name))}!q(w)&&await ee(w,c,l)}}return l.valid},de=()=>{for(const u of a.unMount){const c=g(n,u);c&&(c._f.refs?c._f.refs.every(l=>!ot(l)):!ot(c._f.ref))&&Qe(u)}a.unMount=new Set},ne=(u,c)=>!t.disabled&&(u&&c&&E(s,u,c),!le(Ve(),o)),Z=(u,c,l)=>Gr(u,a,{...i.mount?s:R(c)?o:G(u)?{[u]:c}:c},l,c),A=u=>ft(g(i.mount?s:o,u,t.shouldUnregister?g(o,u,[]):[])),C=(u,c,l={})=>{const p=g(n,u);let h=c;if(p){const d=p._f;d&&(!d.disabled&&E(s,u,hr(c,d)),h=Ue(d.ref)&&K(c)?"":c,lr(d.ref)?[...d.ref.options].forEach(w=>w.selected=h.includes(w.value)):d.refs?Se(d.ref)?d.refs.forEach(w=>{(!w.defaultChecked||!w.disabled)&&(Array.isArray(h)?w.checked=!!h.find($=>$===w.value):w.checked=h===w.value||!!h)}):d.refs.forEach(w=>w.checked=w.value===h):ht(d.ref)?d.ref.value="":(d.ref.value=h,d.ref.type||m.state.next({name:u,values:M(s)})))}(l.shouldDirty||l.shouldTouch)&&O(u,h,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ve(u)},W=(u,c,l)=>{for(const p in c){if(!c.hasOwnProperty(p))return;const h=c[p],d=u+"."+p,w=g(n,d);(a.array.has(u)||j(h)||w&&!w._f)&&!he(h)?W(d,h,l):C(d,h,l)}},J=(u,c,l={})=>{const p=g(n,u),h=a.array.has(u),d=M(c);E(s,u,d),h?(m.array.next({name:u,values:M(s)}),(y.isDirty||y.dirtyFields||k.isDirty||k.dirtyFields)&&l.shouldDirty&&m.state.next({name:u,dirtyFields:we(o,s),isDirty:ne(u,d)})):p&&!p._f&&!K(d)?W(u,d,l):C(u,d,l),Rt(u,a)&&m.state.next({...r,name:u}),m.state.next({name:i.mount?u:void 0,values:M(s)})},oe=async u=>{i.mount=!0;const c=u.target;let l=c.name,p=!0;const h=g(n,l),d=D=>{p=Number.isNaN(D)||he(D)&&isNaN(D.getTime())||le(D,g(s,l,D))},w=It(t.mode),$=It(t.reValidateMode);if(h){let D,X;const Pe=c.type?Tt(h._f):Mr(u),ae=u.type===Ot.BLUR||u.type===Ot.FOCUS_OUT,jr=!on(h._f)&&!t.resolver&&!g(r.errors,l)&&!h._f.deps||cn(ae,g(r.touchedFields,l),r.isSubmitted,$,w),rt=Rt(l,a,ae);E(s,l,Pe),ae?(!c||!c.readOnly)&&(h._f.onBlur&&h._f.onBlur(u),_&&_(0)):h._f.onChange&&h._f.onChange(u);const nt=O(l,Pe,ae),Lr=!q(nt)||rt;if(!ae&&m.state.next({name:l,type:u.type,values:M(s)}),jr)return(y.isValid||k.isValid)&&(t.mode==="onBlur"?ae&&V():ae||V()),Lr&&m.state.next({name:l,...rt?{}:nt});if(!ae&&rt&&m.state.next({...r}),t.resolver){const{errors:Dt}=await ce([l]);if(d(Pe),p){const Nr=Ut(r.errors,n,l),Ft=Ut(Dt,n,Nr.name||l);D=Ft.error,l=Ft.name,X=q(Dt)}}else Q([l],!0),D=(await Lt(h,a.disabled,s,S,t.shouldUseNativeValidation))[l],Q([l]),d(Pe),p&&(D?X=!1:(y.isValid||k.isValid)&&(X=await ee(n,!0)));p&&(h._f.deps&&(!Array.isArray(h._f.deps)||h._f.deps.length>0)&&ve(h._f.deps),xe(l,X,D,nt))}},$e=(u,c)=>{if(g(r.errors,c)&&u.focus)return u.focus(),1},ve=async(u,c={})=>{let l,p;const h=Ee(u);if(t.resolver){const d=await Ye(R(u)?u:h);l=q(d),p=u?!h.some(w=>g(d,w)):l}else u?(p=(await Promise.all(h.map(async d=>{const w=g(n,d);return await ee(w&&w._f?{[d]:w}:w)}))).every(Boolean),!(!p&&!r.isValid)&&V()):p=l=await ee(n);return m.state.next({...!G(u)||(y.isValid||k.isValid)&&l!==r.isValid?{}:{name:u},...t.resolver||!u?{isValid:l}:{},errors:r.errors}),c.shouldFocus&&!p&&De(n,$e,u?h:a.mount),p},Ve=(u,c)=>{let l={...i.mount?s:o};return c&&(l=ar(c.dirtyFields?r.dirtyFields:r.touchedFields,l)),R(u)?l:G(u)?g(l,u):u.map(p=>g(l,p))},wt=(u,c)=>({invalid:!!g((c||r).errors,u),isDirty:!!g((c||r).dirtyFields,u),error:g((c||r).errors,u),isValidating:!!g(r.validatingFields,u),isTouched:!!g((c||r).touchedFields,u)}),Vr=u=>{u&&Ee(u).forEach(c=>U(r.errors,c)),m.state.next({errors:u?r.errors:{}})},bt=(u,c,l)=>{const p=(g(n,u,{_f:{}})._f||{}).ref,h=g(r.errors,u)||{},{ref:d,message:w,type:$,...D}=h;E(r.errors,u,{...D,...c,ref:p}),m.state.next({name:u,errors:r.errors,isValid:!1}),l&&l.shouldFocus&&p&&p.focus&&p.focus()},Pr=(u,c)=>re(u)?m.state.subscribe({next:l=>"values"in l&&u(Z(void 0,c),l)}):Z(u,c,!0),kt=u=>m.state.subscribe({next:c=>{un(u.name,c.name,u.exact)&&sn(c,u.formState||y,Ur,u.reRenderRoot)&&u.callback({values:{...s},...r,...c,defaultValues:o})}}).unsubscribe,Tr=u=>(i.mount=!0,k={...k,...u.formState},kt({...u,formState:k})),Qe=(u,c={})=>{for(const l of u?Ee(u):a.mount)a.mount.delete(l),a.array.delete(l),c.keepValue||(U(n,l),U(s,l)),!c.keepError&&U(r.errors,l),!c.keepDirty&&U(r.dirtyFields,l),!c.keepTouched&&U(r.touchedFields,l),!c.keepIsValidating&&U(r.validatingFields,l),!t.shouldUnregister&&!c.keepDefaultValue&&U(o,l);m.state.next({values:M(s)}),m.state.next({...r,...c.keepDirty?{isDirty:ne()}:{}}),!c.keepIsValid&&V()},zt=({disabled:u,name:c})=>{(se(u)&&i.mount||u||a.disabled.has(c))&&(u?a.disabled.add(c):a.disabled.delete(c))},et=(u,c={})=>{let l=g(n,u);const p=se(c.disabled)||se(t.disabled);return E(n,u,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:u}},name:u,mount:!0,...c}}),a.mount.add(u),l?zt({disabled:se(c.disabled)?c.disabled:t.disabled,name:u}):I(u,!0,c.value),{...p?{disabled:c.disabled||t.disabled}:{},...t.progressive?{required:!!c.required,min:Ae(c.min),max:Ae(c.max),minLength:Ae(c.minLength),maxLength:Ae(c.maxLength),pattern:Ae(c.pattern)}:{},name:u,onChange:oe,onBlur:oe,ref:h=>{if(h){et(u,c),l=g(n,u);const d=R(h.value)&&h.querySelectorAll&&h.querySelectorAll("input,select,textarea")[0]||h,w=Yr(d),$=l._f.refs||[];if(w?$.find(D=>D===d):d===l._f.ref)return;E(n,u,{_f:{...l._f,...w?{refs:[...$.filter(ot),d,...Array.isArray(g(o,u))?[{}]:[]],ref:{type:d.type,name:u}}:{ref:d}}}),I(u,!1,void 0,d)}else l=g(n,u,{}),l._f&&(l._f.mount=!1),(t.shouldUnregister||c.shouldUnregister)&&!(Wr(a.array,u)&&i.action)&&a.unMount.add(u)}}},tt=()=>t.shouldFocusError&&De(n,$e,a.mount),Ir=u=>{se(u)&&(m.state.next({disabled:u}),De(n,(c,l)=>{const p=g(n,l);p&&(c.disabled=p._f.disabled||u,Array.isArray(p._f.refs)&&p._f.refs.forEach(h=>{h.disabled=p._f.disabled||u}))},0,!1))},Zt=(u,c)=>async l=>{let p;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let h=M(s);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:d,values:w}=await ce();r.errors=d,h=M(w)}else await ee(n);if(a.disabled.size)for(const d of a.disabled)U(h,d);if(U(r.errors,"root"),q(r.errors)){m.state.next({errors:{}});try{await u(h,l)}catch(d){p=d}}else c&&await c({...r.errors},l),tt(),setTimeout(tt);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:q(r.errors)&&!p,submitCount:r.submitCount+1,errors:r.errors}),p)throw p},Cr=(u,c={})=>{g(n,u)&&(R(c.defaultValue)?J(u,M(g(o,u))):(J(u,c.defaultValue),E(o,u,M(c.defaultValue))),c.keepTouched||U(r.touchedFields,u),c.keepDirty||(U(r.dirtyFields,u),r.isDirty=c.defaultValue?ne(u,M(g(o,u))):ne()),c.keepError||(U(r.errors,u),y.isValid&&V()),m.state.next({...r}))},$t=(u,c={})=>{const l=u?M(u):o,p=M(l),h=q(u),d=h?o:p;if(c.keepDefaultValues||(o=l),!c.keepValues){if(c.keepDirtyValues){const w=new Set([...a.mount,...Object.keys(we(o,s))]);for(const $ of Array.from(w))g(r.dirtyFields,$)?E(d,$,g(s,$)):J($,g(d,$))}else{if(lt&&R(u))for(const w of a.mount){const $=g(n,w);if($&&$._f){const D=Array.isArray($._f.refs)?$._f.refs[0]:$._f.ref;if(Ue(D)){const X=D.closest("form");if(X){X.reset();break}}}}if(c.keepFieldsRef)for(const w of a.mount)J(w,g(d,w));else n={}}s=t.shouldUnregister?c.keepDefaultValues?M(o):{}:M(d),m.array.next({values:{...d}}),m.state.next({values:{...d}})}a={mount:c.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!y.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!q(d),i.watch=!!t.shouldUnregister,i.action=!1,c.keepErrors||(r.errors={}),m.state.next({submitCount:c.keepSubmitCount?r.submitCount:0,isDirty:h?!1:c.keepDirty?r.isDirty:!!(c.keepDefaultValues&&!le(u,o)),isSubmitted:c.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:h?{}:c.keepDirtyValues?c.keepDefaultValues&&s?we(o,s):r.dirtyFields:c.keepDefaultValues&&u?we(o,u):c.keepDirty?r.dirtyFields:{},touchedFields:c.keepTouched?r.touchedFields:{},errors:c.keepErrors?r.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},At=(u,c)=>$t(re(u)?u(s):u,c),Rr=(u,c={})=>{const l=g(n,u),p=l&&l._f;if(p){const h=p.refs?p.refs[0]:p.ref;h.focus&&(h.focus(),c.shouldSelect&&re(h.select)&&h.select())}},Ur=u=>{r={...r,...u}},Et={control:{register:et,unregister:Qe,getFieldState:wt,handleSubmit:Zt,setError:bt,_subscribe:kt,_runSchema:ce,_focusError:tt,_getWatch:Z,_getDirty:ne,_setValid:V,_setFieldArray:Ze,_setDisabledField:zt,_setErrors:L,_getFieldArray:A,_reset:$t,_resetDefaultValues:()=>re(t.defaultValues)&&t.defaultValues().then(u=>{At(u,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:de,_disableForm:Ir,_subjects:m,_proxyFormState:y,get _fields(){return n},get _formValues(){return s},get _state(){return i},set _state(u){i=u},get _defaultValues(){return o},get _names(){return a},set _names(u){a=u},get _formState(){return r},get _options(){return t},set _options(u){t={...t,...u}}},subscribe:Tr,trigger:ve,register:et,handleSubmit:Zt,watch:Pr,setValue:J,getValues:Ve,reset:At,resetField:Cr,clearErrors:Vr,unregister:Qe,setError:bt,setFocus:Rr,getFieldState:wt};return{...Et,formControl:Et}}function _u(e={}){const t=H.useRef(void 0),r=H.useRef(void 0),[n,o]=H.useState({isDirty:!1,isValidating:!1,isLoading:re(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:re(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!re(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=dn(e);t.current={...a,formState:n}}const s=t.current.control;return s._options=e,Hr(()=>{const i=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),s._formState.isReady=!0,i},[s]),H.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),H.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),H.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),H.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),H.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==n.isDirty&&s._subjects.state.next({isDirty:i})}},[s,n.isDirty]),H.useEffect(()=>{var i;e.values&&!le(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((i=s._options.resetOptions)===null||i===void 0)&&i.keepIsValid||s._setValid(),r.current=e.values,o(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),H.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=Kr(n,s),t.current}const Nt=(e,t,r)=>{if(e&&"reportValidity"in e){const n=g(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},hn=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Nt(n.ref,r,e):n&&n.refs&&n.refs.forEach(o=>Nt(o,r,e))}},gu=(e,t)=>{t.shouldUseNativeValidation&&hn(e,t);const r={};for(const n in e){const o=g(t.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(pn(t.names||Object.keys(e),n)){const i=Object.assign({},g(r,n));E(i,"root",s),E(r,n,i)}else E(r,n,s)}return r},pn=(e,t)=>{const r=Mt(t);return e.some(n=>Mt(n).match(`^${r}\\.\\d+`))};function Mt(e){return e.replace(/\]|\[/g,"")}function f(e,t,r){function n(a,_){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:_,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,_);const v=i.prototype,y=Object.keys(v);for(let k=0;k<y.length;k++){const m=y[k];m in a||(a[m]=v[m].bind(a))}}const o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var _;const v=r?.Parent?new s:this;n(v,a),(_=v._zod).deferred??(_.deferred=[]);for(const y of v._zod.deferred)y();return v}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class ke extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _r extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const gr={};function pe(e){return gr}function _n(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function ut(e,t){return typeof t=="bigint"?t.toString():t}function _t(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function gt(e){return e==null}function mt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Bt=Symbol("evaluating");function F(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Bt)return n===void 0&&(n=Bt,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function ge(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Wt(e){return JSON.stringify(e)}function gn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Le(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const mn=_t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Fe(e){if(Le(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Le(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function vr(e){return Fe(e)?{...e}:Array.isArray(e)?[...e]:e}const vn=new Set(["string","number","symbol"]);function We(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function b(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function yn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function wn(e,t){const r=e._zod.def,n=me(e._zod.def,{get shape(){const o={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=r.shape[s])}return ge(this,"shape",o),o},checks:[]});return fe(e,n)}function bn(e,t){const r=e._zod.def,n=me(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return ge(this,"shape",o),o},checks:[]});return fe(e,n)}function kn(e,t){if(!Fe(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=me(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ge(this,"shape",s),s},checks:[]});return fe(e,o)}function zn(e,t){if(!Fe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return ge(this,"shape",n),n},checks:e._zod.def.checks};return fe(e,r)}function Zn(e,t){const r=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return ge(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return fe(e,r)}function $n(e,t,r){const n=me(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(const i in o)s[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return ge(this,"shape",s),s},checks:[]});return fe(t,n)}function An(e,t,r){const n=me(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return ge(this,"shape",s),s},checks:[]});return fe(t,n)}function be(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function yr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Te(e){return typeof e=="string"?e:e?.message}function _e(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=Te(e.inst?._zod.def?.error?.(e))??Te(t?.error?.(e))??Te(r.customError?.(e))??Te(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function vt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Oe(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const wr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ut,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},br=f("$ZodError",wr),qe=f("$ZodError",wr,{Parent:Error});function En(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Dn(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>n({issues:i}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let i=r,a=0;for(;a<s.path.length;){const _=s.path[a];a===s.path.length-1?(i[_]=i[_]||{_errors:[]},i[_]._errors.push(t(s))):i[_]=i[_]||{_errors:[]},i=i[_],a++}}};return n(e),r}const Je=e=>(t,r,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new ke;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(_=>_e(_,s,pe())));throw mr(a,o?.callee),a}return i.value},mu=Je(qe),Ke=e=>async(t,r,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(_=>_e(_,s,pe())));throw mr(a,o?.callee),a}return i.value},vu=Ke(qe),He=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ke;return s.issues.length?{success:!1,error:new(e??br)(s.issues.map(i=>_e(i,o,pe())))}:{success:!0,data:s.value}},Fn=He(qe),Ge=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>_e(i,o,pe())))}:{success:!0,data:s.value}},On=Ge(qe),Sn=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Je(e)(t,r,o)},xn=e=>(t,r,n)=>Je(e)(t,r,n),Vn=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,r,o)},Pn=e=>async(t,r,n)=>Ke(e)(t,r,n),Tn=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return He(e)(t,r,o)},In=e=>(t,r,n)=>He(e)(t,r,n),Cn=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ge(e)(t,r,o)},Rn=e=>async(t,r,n)=>Ge(e)(t,r,n),Un=/^[cC][^\s-]{8,}$/,jn=/^[0-9a-z]+$/,Ln=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Nn=/^[0-9a-vA-V]{20}$/,Mn=/^[A-Za-z0-9]{27}$/,Bn=/^[a-zA-Z0-9_-]{21}$/,Wn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Jn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Hn(){return new RegExp(Kn,"u")}const Gn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Yn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Qn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kr=/^[A-Za-z0-9_-]*$/,to=/^\+(?:[0-9]){6,14}[0-9]$/,zr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ro=new RegExp(`^${zr}$`);function Zr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function no(e){return new RegExp(`^${Zr(e)}$`)}function oo(e){const t=Zr({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${zr}T(?:${n})$`)}const so=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},io=/^[^A-Z]*$/,uo=/^[^a-z]*$/,ie=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),co=f("$ZodCheckMaxLength",(e,t)=>{var r;ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!gt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const i=vt(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ao=f("$ZodCheckMinLength",(e,t)=>{var r;ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!gt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=vt(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lo=f("$ZodCheckLengthEquals",(e,t)=>{var r;ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!gt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const i=vt(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Xe=f("$ZodCheckStringFormat",(e,t)=>{var r,n;ie.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),fo=f("$ZodCheckRegex",(e,t)=>{Xe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ho=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=io),Xe.init(e,t)}),po=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=uo),Xe.init(e,t)}),_o=f("$ZodCheckIncludes",(e,t)=>{ie.init(e,t);const r=We(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),go=f("$ZodCheckStartsWith",(e,t)=>{ie.init(e,t);const r=new RegExp(`^${We(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mo=f("$ZodCheckEndsWith",(e,t)=>{ie.init(e,t);const r=new RegExp(`.*${We(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),vo=f("$ZodCheckOverwrite",(e,t)=>{ie.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class yo{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
2
|
+
`).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
|
|
3
|
+
`))}}const wo={major:4,minor:1,patch:13},N=f("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wo;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,_)=>{let v=be(i),y;for(const k of a){if(k._zod.def.when){if(!k._zod.def.when(i))continue}else if(v)continue;const m=i.issues.length,S=k._zod.check(i);if(S instanceof Promise&&_?.async===!1)throw new ke;if(y||S instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await S,i.issues.length!==m&&(v||(v=be(i,m)))});else{if(i.issues.length===m)continue;v||(v=be(i,m))}}return y?y.then(()=>i):i},s=(i,a,_)=>{if(be(i))return i.aborted=!0,i;const v=o(a,n,_);if(v instanceof Promise){if(_.async===!1)throw new ke;return v.then(y=>e._zod.parse(y,_))}return e._zod.parse(v,_)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const v=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return v instanceof Promise?v.then(y=>s(y,i,a)):s(v,i,a)}const _=e._zod.parse(i,a);if(_ instanceof Promise){if(a.async===!1)throw new ke;return _.then(v=>o(v,n,a))}return o(_,n,a)}}e["~standard"]={validate:o=>{try{const s=Fn(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return On(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),yt=f("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??so(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),x=f("$ZodStringFormat",(e,t)=>{Xe.init(e,t),yt.init(e,t)}),bo=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qn),x.init(e,t)}),ko=f("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=qt(n))}else t.pattern??(t.pattern=qt());x.init(e,t)}),zo=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Jn),x.init(e,t)}),Zo=f("$ZodURL",(e,t)=>{x.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),$o=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hn()),x.init(e,t)}),Ao=f("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Bn),x.init(e,t)}),Eo=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Un),x.init(e,t)}),Do=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=jn),x.init(e,t)}),Fo=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ln),x.init(e,t)}),Oo=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Nn),x.init(e,t)}),So=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Mn),x.init(e,t)}),xo=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=oo(t)),x.init(e,t)}),Vo=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ro),x.init(e,t)}),Po=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=no(t)),x.init(e,t)}),To=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Wn),x.init(e,t)}),Io=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gn),x.init(e,t),e._zod.bag.format="ipv4"}),Co=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Xn),x.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Ro=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Yn),x.init(e,t)}),Uo=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Qn),x.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,s]=n;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function $r(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jo=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=eo),x.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{$r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Lo(e){if(!kr.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return $r(r)}const No=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=kr),x.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Lo(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Mo=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=to),x.init(e,t)});function Bo(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Wo=f("$ZodJWT",(e,t)=>{x.init(e,t),e._zod.check=r=>{Bo(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),qo=f("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=r=>r}),Jo=f("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Jt(e,t,r){e.issues.length&&t.issues.push(...yr(r,e.issues)),t.value[r]=e.value}const Ko=f("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],_=t.element._zod.run({value:a,issues:[]},n);_ instanceof Promise?s.push(_.then(v=>Jt(v,r,i))):Jt(_,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function Ne(e,t,r,n){e.issues.length&&t.issues.push(...yr(r,e.issues)),e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Ar(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=yn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Er(e,t,r,n,o,s){const i=[],a=o.keySet,_=o.catchall._zod,v=_.def.type;for(const y in t){if(a.has(y))continue;if(v==="never"){i.push(y);continue}const k=_.run({value:t[y],issues:[]},n);k instanceof Promise?e.push(k.then(m=>Ne(m,r,y,t))):Ne(k,r,y,t)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const Ho=f("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const _={...a};return Object.defineProperty(t,"shape",{value:_}),_}})}const n=_t(()=>Ar(t));F(e._zod,"propValues",()=>{const a=t.shape,_={};for(const v in a){const y=a[v]._zod;if(y.values){_[v]??(_[v]=new Set);for(const k of y.values)_[v].add(k)}}return _});const o=Le,s=t.catchall;let i;e._zod.parse=(a,_)=>{i??(i=n.value);const v=a.value;if(!o(v))return a.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),a;a.value={};const y=[],k=i.shape;for(const m of i.keys){const T=k[m]._zod.run({value:v[m],issues:[]},_);T instanceof Promise?y.push(T.then(V=>Ne(V,a,m,v))):Ne(T,a,m,v)}return s?Er(y,v,a,_,n.value,e):y.length?Promise.all(y).then(()=>a):a}}),Go=f("$ZodObjectJIT",(e,t)=>{Ho.init(e,t);const r=e._zod.parse,n=_t(()=>Ar(t)),o=m=>{const S=new yo(["shape","payload","ctx"]),T=n.value,V=L=>{const I=Wt(L);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};S.write("const input = payload.value;");const Q=Object.create(null);let Ze=0;for(const L of T.keys)Q[L]=`key_${Ze++}`;S.write("const newResult = {};");for(const L of T.keys){const I=Q[L],O=Wt(L);S.write(`const ${I} = ${V(L)};`),S.write(`
|
|
4
|
+
if (${I}.issues.length) {
|
|
5
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
6
|
+
...iss,
|
|
7
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
8
|
+
})));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if (${I}.value === undefined) {
|
|
13
|
+
if (${O} in input) {
|
|
14
|
+
newResult[${O}] = undefined;
|
|
15
|
+
}
|
|
16
|
+
} else {
|
|
17
|
+
newResult[${O}] = ${I}.value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
`)}S.write("payload.value = newResult;"),S.write("return payload;");const z=S.compile();return(L,I)=>z(m,L,I)};let s;const i=Le,a=!gr.jitless,v=a&&mn.value,y=t.catchall;let k;e._zod.parse=(m,S)=>{k??(k=n.value);const T=m.value;return i(T)?a&&v&&S?.async===!1&&S.jitless!==!0?(s||(s=o(t.shape)),m=s(m,S),y?Er([],T,m,S,k,e):m):r(m,S):(m.issues.push({expected:"object",code:"invalid_type",input:T,inst:e}),m)}});function Kt(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!be(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>_e(i,n,pe())))}),t)}const Xo=f("$ZodUnion",(e,t)=>{N.init(e,t),F(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),F(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),F(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),F(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>mt(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let i=!1;const a=[];for(const _ of t.options){const v=_._zod.run({value:o.value,issues:[]},s);if(v instanceof Promise)a.push(v),i=!0;else{if(v.issues.length===0)return v;a.push(v)}}return i?Promise.all(a).then(_=>Kt(_,o,e,s)):Kt(a,o,e,s)}}),Yo=f("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([_,v])=>Ht(r,_,v)):Ht(r,s,i)}});function ct(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Fe(e)&&Fe(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const i=ct(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i=ct(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ht(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),be(e))return e;const n=ct(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Qo=f("$ZodEnum",(e,t)=>{N.init(e,t);const r=_n(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>vn.has(typeof o)).map(o=>typeof o=="string"?We(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),es=f("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new _r(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new ke;return r.value=o,r}});function Gt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ts=f("$ZodOptional",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.optout="optional",F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Gt(s,r.value)):Gt(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),rs=f("$ZodNullable",(e,t)=>{N.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mt(r.source)}|null)$`):void 0}),F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),ns=f("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Xt(s,t)):Xt(o,t)}});function Xt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const os=f("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ss=f("$ZodNonOptional",(e,t)=>{N.init(e,t),F(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Yt(s,e)):Yt(o,e)}});function Yt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const is=f("$ZodCatch",(e,t)=>{N.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>_e(i,n,pe()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>_e(s,n,pe()))},input:r.value}),r.issues=[]),r)}}),us=f("$ZodPipe",(e,t)=>{N.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),F(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(i=>Ie(i,t.in,n)):Ie(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Ie(s,t.out,n)):Ie(o,t.out,n)}});function Ie(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const cs=f("$ZodReadonly",(e,t)=>{N.init(e,t),F(e._zod,"propValues",()=>t.innerType._zod.propValues),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"optin",()=>t.innerType?._zod?.optin),F(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Qt):Qt(o)}});function Qt(e){return e.value=Object.freeze(e.value),e}const as=f("$ZodCustom",(e,t)=>{ie.init(e,t),N.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>er(s,r,n,e));er(o,r,n,e)}});function er(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Oe(o))}}var tr;class ls{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fs(){return new ls}(tr=globalThis).__zod_globalRegistry??(tr.__zod_globalRegistry=fs());const Ce=globalThis.__zod_globalRegistry;function ds(e,t){return new e({type:"string",...b(t)})}function hs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(t)})}function rr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(t)})}function ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(t)})}function vs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(t)})}function ys(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(t)})}function ws(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(t)})}function bs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(t)})}function ks(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(t)})}function zs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(t)})}function Zs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(t)})}function $s(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(t)})}function As(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(t)})}function Es(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(t)})}function Ds(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(t)})}function Fs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(t)})}function Os(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(t)})}function Ss(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(t)})}function xs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(t)})}function Vs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(t)})}function Ps(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(t)})}function Ts(e,t){return new e({type:"string",format:"date",check:"string_format",...b(t)})}function Is(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(t)})}function Cs(e,t){return new e({type:"string",format:"duration",check:"string_format",...b(t)})}function Rs(e){return new e({type:"unknown"})}function Us(e,t){return new e({type:"never",...b(t)})}function Dr(e,t){return new co({check:"max_length",...b(t),maximum:e})}function Me(e,t){return new ao({check:"min_length",...b(t),minimum:e})}function Fr(e,t){return new lo({check:"length_equals",...b(t),length:e})}function js(e,t){return new fo({check:"string_format",format:"regex",...b(t),pattern:e})}function Ls(e){return new ho({check:"string_format",format:"lowercase",...b(e)})}function Ns(e){return new po({check:"string_format",format:"uppercase",...b(e)})}function Ms(e,t){return new _o({check:"string_format",format:"includes",...b(t),includes:e})}function Bs(e,t){return new go({check:"string_format",format:"starts_with",...b(t),prefix:e})}function Ws(e,t){return new mo({check:"string_format",format:"ends_with",...b(t),suffix:e})}function ze(e){return new vo({check:"overwrite",tx:e})}function qs(e){return ze(t=>t.normalize(e))}function Js(){return ze(e=>e.trim())}function Ks(){return ze(e=>e.toLowerCase())}function Hs(){return ze(e=>e.toUpperCase())}function Gs(){return ze(e=>gn(e))}function Xs(e,t,r){return new e({type:"array",element:t,...b(r)})}function Ys(e,t,r){return new e({type:"custom",check:"custom",fn:t,...b(r)})}function Qs(e){const t=ei(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Oe(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Oe(o))}},e(r.value,r)));return t}function ei(e,t){const r=new ie({check:"custom",...b(t)});return r._zod.check=e,r}const ti=f("ZodISODateTime",(e,t)=>{xo.init(e,t),P.init(e,t)});function ri(e){return Ps(ti,e)}const ni=f("ZodISODate",(e,t)=>{Vo.init(e,t),P.init(e,t)});function oi(e){return Ts(ni,e)}const si=f("ZodISOTime",(e,t)=>{Po.init(e,t),P.init(e,t)});function ii(e){return Is(si,e)}const ui=f("ZodISODuration",(e,t)=>{To.init(e,t),P.init(e,t)});function ci(e){return Cs(ui,e)}const ai=(e,t)=>{br.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Dn(e,r)},flatten:{value:r=>En(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ut,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ut,2)}},isEmpty:{get(){return e.issues.length===0}}})},Y=f("ZodError",ai,{Parent:Error}),li=Je(Y),fi=Ke(Y),di=He(Y),hi=Ge(Y),pi=Sn(Y),_i=xn(Y),gi=Vn(Y),mi=Pn(Y),vi=Tn(Y),yi=In(Y),wi=Cn(Y),bi=Rn(Y),B=f("ZodType",(e,t)=>(N.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(me(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>fe(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>li(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>di(e,r,n),e.parseAsync=async(r,n)=>fi(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>hi(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>pi(e,r,n),e.decode=(r,n)=>_i(e,r,n),e.encodeAsync=async(r,n)=>gi(e,r,n),e.decodeAsync=async(r,n)=>mi(e,r,n),e.safeEncode=(r,n)=>vi(e,r,n),e.safeDecode=(r,n)=>yi(e,r,n),e.safeEncodeAsync=async(r,n)=>wi(e,r,n),e.safeDecodeAsync=async(r,n)=>bi(e,r,n),e.refine=(r,n)=>e.check(fu(r,n)),e.superRefine=r=>e.check(du(r)),e.overwrite=r=>e.check(ze(r)),e.optional=()=>sr(e),e.nullable=()=>ir(e),e.nullish=()=>sr(ir(e)),e.nonoptional=r=>ou(e,r),e.array=()=>Bi(e),e.or=r=>Ji([e,r]),e.and=r=>Hi(e,r),e.transform=r=>ur(e,Yi(r)),e.default=r=>tu(e,r),e.prefault=r=>nu(e,r),e.catch=r=>iu(e,r),e.pipe=r=>ur(e,r),e.readonly=()=>au(e),e.describe=r=>{const n=e.clone();return Ce.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ce.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ce.get(e);const n=e.clone();return Ce.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Or=f("_ZodString",(e,t)=>{yt.init(e,t),B.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(js(...n)),e.includes=(...n)=>e.check(Ms(...n)),e.startsWith=(...n)=>e.check(Bs(...n)),e.endsWith=(...n)=>e.check(Ws(...n)),e.min=(...n)=>e.check(Me(...n)),e.max=(...n)=>e.check(Dr(...n)),e.length=(...n)=>e.check(Fr(...n)),e.nonempty=(...n)=>e.check(Me(1,...n)),e.lowercase=n=>e.check(Ls(n)),e.uppercase=n=>e.check(Ns(n)),e.trim=()=>e.check(Js()),e.normalize=(...n)=>e.check(qs(...n)),e.toLowerCase=()=>e.check(Ks()),e.toUpperCase=()=>e.check(Hs()),e.slugify=()=>e.check(Gs())}),ki=f("ZodString",(e,t)=>{yt.init(e,t),Or.init(e,t),e.email=r=>e.check(hs(zi,r)),e.url=r=>e.check(vs(Zi,r)),e.jwt=r=>e.check(Vs(Ui,r)),e.emoji=r=>e.check(ys($i,r)),e.guid=r=>e.check(rr(nr,r)),e.uuid=r=>e.check(ps(Re,r)),e.uuidv4=r=>e.check(_s(Re,r)),e.uuidv6=r=>e.check(gs(Re,r)),e.uuidv7=r=>e.check(ms(Re,r)),e.nanoid=r=>e.check(ws(Ai,r)),e.guid=r=>e.check(rr(nr,r)),e.cuid=r=>e.check(bs(Ei,r)),e.cuid2=r=>e.check(ks(Di,r)),e.ulid=r=>e.check(zs(Fi,r)),e.base64=r=>e.check(Os(Ii,r)),e.base64url=r=>e.check(Ss(Ci,r)),e.xid=r=>e.check(Zs(Oi,r)),e.ksuid=r=>e.check($s(Si,r)),e.ipv4=r=>e.check(As(xi,r)),e.ipv6=r=>e.check(Es(Vi,r)),e.cidrv4=r=>e.check(Ds(Pi,r)),e.cidrv6=r=>e.check(Fs(Ti,r)),e.e164=r=>e.check(xs(Ri,r)),e.datetime=r=>e.check(ri(r)),e.date=r=>e.check(oi(r)),e.time=r=>e.check(ii(r)),e.duration=r=>e.check(ci(r))});function yu(e){return ds(ki,e)}const P=f("ZodStringFormat",(e,t)=>{x.init(e,t),Or.init(e,t)}),zi=f("ZodEmail",(e,t)=>{zo.init(e,t),P.init(e,t)}),nr=f("ZodGUID",(e,t)=>{bo.init(e,t),P.init(e,t)}),Re=f("ZodUUID",(e,t)=>{ko.init(e,t),P.init(e,t)}),Zi=f("ZodURL",(e,t)=>{Zo.init(e,t),P.init(e,t)}),$i=f("ZodEmoji",(e,t)=>{$o.init(e,t),P.init(e,t)}),Ai=f("ZodNanoID",(e,t)=>{Ao.init(e,t),P.init(e,t)}),Ei=f("ZodCUID",(e,t)=>{Eo.init(e,t),P.init(e,t)}),Di=f("ZodCUID2",(e,t)=>{Do.init(e,t),P.init(e,t)}),Fi=f("ZodULID",(e,t)=>{Fo.init(e,t),P.init(e,t)}),Oi=f("ZodXID",(e,t)=>{Oo.init(e,t),P.init(e,t)}),Si=f("ZodKSUID",(e,t)=>{So.init(e,t),P.init(e,t)}),xi=f("ZodIPv4",(e,t)=>{Io.init(e,t),P.init(e,t)}),Vi=f("ZodIPv6",(e,t)=>{Co.init(e,t),P.init(e,t)}),Pi=f("ZodCIDRv4",(e,t)=>{Ro.init(e,t),P.init(e,t)}),Ti=f("ZodCIDRv6",(e,t)=>{Uo.init(e,t),P.init(e,t)}),Ii=f("ZodBase64",(e,t)=>{jo.init(e,t),P.init(e,t)}),Ci=f("ZodBase64URL",(e,t)=>{No.init(e,t),P.init(e,t)}),Ri=f("ZodE164",(e,t)=>{Mo.init(e,t),P.init(e,t)}),Ui=f("ZodJWT",(e,t)=>{Wo.init(e,t),P.init(e,t)}),ji=f("ZodUnknown",(e,t)=>{qo.init(e,t),B.init(e,t)});function or(){return Rs(ji)}const Li=f("ZodNever",(e,t)=>{Jo.init(e,t),B.init(e,t)});function Ni(e){return Us(Li,e)}const Mi=f("ZodArray",(e,t)=>{Ko.init(e,t),B.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Me(r,n)),e.nonempty=r=>e.check(Me(1,r)),e.max=(r,n)=>e.check(Dr(r,n)),e.length=(r,n)=>e.check(Fr(r,n)),e.unwrap=()=>e.element});function Bi(e,t){return Xs(Mi,e,t)}const Wi=f("ZodObject",(e,t)=>{Go.init(e,t),B.init(e,t),F(e,"shape",()=>t.shape),e.keyof=()=>Gi(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:or()}),e.loose=()=>e.clone({...e._zod.def,catchall:or()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ni()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>kn(e,r),e.safeExtend=r=>zn(e,r),e.merge=r=>Zn(e,r),e.pick=r=>wn(e,r),e.omit=r=>bn(e,r),e.partial=(...r)=>$n(Sr,e,r[0]),e.required=(...r)=>An(xr,e,r[0])});function wu(e,t){const r={type:"object",shape:e??{},...b(t)};return new Wi(r)}const qi=f("ZodUnion",(e,t)=>{Xo.init(e,t),B.init(e,t),e.options=t.options});function Ji(e,t){return new qi({type:"union",options:e,...b(t)})}const Ki=f("ZodIntersection",(e,t)=>{Yo.init(e,t),B.init(e,t)});function Hi(e,t){return new Ki({type:"intersection",left:e,right:t})}const at=f("ZodEnum",(e,t)=>{Qo.init(e,t),B.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new at({...t,checks:[],...b(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new at({...t,checks:[],...b(o),entries:s})}});function Gi(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new at({type:"enum",entries:r,...b(t)})}const Xi=f("ZodTransform",(e,t)=>{es.init(e,t),B.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new _r(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Oe(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Oe(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function Yi(e){return new Xi({type:"transform",transform:e})}const Sr=f("ZodOptional",(e,t)=>{ts.init(e,t),B.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sr(e){return new Sr({type:"optional",innerType:e})}const Qi=f("ZodNullable",(e,t)=>{rs.init(e,t),B.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new Qi({type:"nullable",innerType:e})}const eu=f("ZodDefault",(e,t)=>{ns.init(e,t),B.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tu(e,t){return new eu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vr(t)}})}const ru=f("ZodPrefault",(e,t)=>{os.init(e,t),B.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nu(e,t){return new ru({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vr(t)}})}const xr=f("ZodNonOptional",(e,t)=>{ss.init(e,t),B.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ou(e,t){return new xr({type:"nonoptional",innerType:e,...b(t)})}const su=f("ZodCatch",(e,t)=>{is.init(e,t),B.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function iu(e,t){return new su({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const uu=f("ZodPipe",(e,t)=>{us.init(e,t),B.init(e,t),e.in=t.in,e.out=t.out});function ur(e,t){return new uu({type:"pipe",in:e,out:t})}const cu=f("ZodReadonly",(e,t)=>{cs.init(e,t),B.init(e,t),e.unwrap=()=>e._zod.def.innerType});function au(e){return new cu({type:"readonly",innerType:e})}const lu=f("ZodCustom",(e,t)=>{as.init(e,t),B.init(e,t)});function fu(e,t={}){return Ys(lu,e,t)}function du(e){return Qs(e)}export{br as $,vu as a,Xr as b,wu as c,yu as d,hn as o,mu as p,gu as s,_u as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DAH8Vq_G.js";import{c as l,t as p,B as g,A as w,E as y,F as k,d as z,S as h}from"./index-P2CKOdyd.js";import{a as R,u as E,b as M}from"./tanstack-DAI1tKxf.js";import{r as j}from"./react-vendor-CjrBBxxX.js";import{N as v,a as W,T as C,i as S,Z as O,d as P,U as $,S as T,O as I,I as F,Q as H,R as A}from"./icons-ByUiVGTN.js";import"./form-utils-CSa50xnO.js";const B={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},D={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function L({passed:s,total:t,status:a,size:o="md"}){const n=B[o],d=D[a],i=t>0?Math.round(s/t*100):0,r=(n.dimension-n.strokeWidth)/2,c=2*Math.PI*r,f=c-i/100*c,x=n.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:n.dimension,height:n.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${d.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:"currentColor",strokeWidth:n.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:d.stroke,strokeWidth:n.strokeWidth,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),i>0&&e.jsx("circle",{cx:x+r*Math.cos(i/100*2*Math.PI-Math.PI/2),cy:x+r*Math.sin(i/100*2*Math.PI-Math.PI/2),r:n.strokeWidth/2,fill:d.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${d.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",n.fontSize),children:i}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",n.labelSize),children:"health"})]})]})}function b({label:s,value:t,color:a,bgColor:o}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",o)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",a),children:t})]})}function q({total:s,passed:t,warnings:a,errors:o,info:n}){const d=t/s*100,i=a/s*100,r=o/s*100,c=n/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[r>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${r}%`}}),i>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${i}%`}}),c>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${c}%`}}),d>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${d}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Checks"}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:a,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:o,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:n,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function G(){return R({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function K(){const s=E();return M({mutationFn:async t=>{const a=await fetch(`/api/health/fix/${t}`,{method:"POST"}),o=await a.json();if(!a.ok)throw new Error(o.message);return o},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),p.success(t.message)},onError:t=>{p.error(t.message)}})}const Q={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function U({check:s}){const t=K(),a=Q[s.status],[o,n]=j.useState(!1),d=s.details||s.fix,i=r=>{navigator.clipboard.writeText(r),p.success("Copied to clipboard")};return d?e.jsx(w,{open:o,onOpenChange:n,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",o?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),e.jsx(W,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",o&&"rotate-90")})]})}),e.jsx(k,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(C,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>s.fix&&i(s.fix),className:"h-5 w-5 p-0",children:e.jsx(S,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Apply Fix"]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",variant:"ghost",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Fix"]})]})}const Z={Monitor:I,Settings:T,Users:$,Shield:P,Zap:O};function V({group:s,defaultOpen:t=!0}){const[a,o]=j.useState(t),n=Z[s.icon]||I,d=s.checks.filter(m=>m.status==="ok").length,i=s.checks.length,r=s.checks.some(m=>m.status==="error"),c=s.checks.some(m=>m.status==="warning"),f=Math.round(d/i*100),x=r?"text-red-500":c?"text-yellow-500":"text-green-500",u=r?"bg-red-500":c?"bg-yellow-500":"bg-green-500";return e.jsx(w,{open:a,onOpenChange:o,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",r?"border-red-500/30":c?"border-yellow-500/30":"border-border"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",a&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",r?"bg-red-500/10 text-red-500":c?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(n,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",u),style:{width:`${f}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",x),children:[d,"/",i]}),e.jsx(F,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",a&&"rotate-180")})]})}),e.jsx(k,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(U,{check:m},m.id))})})]})})}function J(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function X(s){const t=Math.floor((Date.now()-s)/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const a=Math.floor(t/60);return a<60?`${a}m ago`:`${Math.floor(a/60)}h ago`}function Y(s){return[...s].sort((t,a)=>{const o=t.checks.filter(r=>r.status==="error").length,n=a.checks.filter(r=>r.status==="error").length,d=t.checks.filter(r=>r.status==="warning").length,i=a.checks.filter(r=>r.status==="warning").length;return o!==n?n-o:i-d})}function _(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function ee(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function le(){const{data:s,isLoading:t,refetch:a,dataUpdatedAt:o}=G(),n=o,[d,i]=j.useState(0);j.useEffect(()=>{const u=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(u)},[]);const r=()=>{navigator.clipboard.writeText("ccs doctor"),p.success("Copied to clipboard")},c=()=>{a(),p.info("Refreshing health checks...")};if(t&&!s)return e.jsx(ee,{});const f=s?J(s.summary):"ok",x=s?.groups?Y(s.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[s&&e.jsx("div",{className:"shrink-0",children:e.jsx(L,{passed:s.summary.passed,total:s.summary.total-s.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(_,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:"System Health"}),s?.version&&e.jsxs(z,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:["build ",s.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(H,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Last scan:"}),e.jsx("span",{className:"font-mono",children:n?X(n):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-refresh:"}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:r,className:"gap-2 font-mono text-xs",children:[e.jsx(C,{className:"w-3 h-3"}),"ccs doctor",e.jsx(S,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:c,disabled:t,className:"gap-2",children:[e.jsx(A,{className:l("w-4 h-4",t&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),s&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(q,{total:s.summary.total,passed:s.summary.passed,warnings:s.summary.warnings,errors:s.summary.errors,info:s.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((u,m)=>e.jsx(V,{group:u,defaultOpen:m<2||u.checks.some(N=>N.status==="error"||N.status==="warning")},u.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:["Version ",e.jsx("span",{className:"font-mono",children:s?.version??"--"})]}),e.jsxs("span",{children:["Platform"," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:"Live monitoring active"})]})]})]})}export{le as HealthPage};
|
|
1
|
+
import{j as e}from"./radix-ui-DAH8Vq_G.js";import{c as l,t as p,B as g,v as w,w as y,x as k,d as z,S as h}from"./index-CfJhTNCX.js";import{a as R,u as M,b as W}from"./tanstack-DAI1tKxf.js";import{r as j}from"./react-vendor-CjrBBxxX.js";import{Q as v,a as E,T as C,i as S,Z as P,d as O,U as $,S as T,V as I,N as H,Y as F,R as A}from"./icons-DT8ZzQec.js";import"./form-utils-DKkU3nz7.js";const B={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},D={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function L({passed:s,total:t,status:a,size:o="md"}){const n=B[o],d=D[a],i=t>0?Math.round(s/t*100):0,r=(n.dimension-n.strokeWidth)/2,c=2*Math.PI*r,f=c-i/100*c,x=n.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:n.dimension,height:n.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${d.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:"currentColor",strokeWidth:n.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:d.stroke,strokeWidth:n.strokeWidth,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),i>0&&e.jsx("circle",{cx:x+r*Math.cos(i/100*2*Math.PI-Math.PI/2),cy:x+r*Math.sin(i/100*2*Math.PI-Math.PI/2),r:n.strokeWidth/2,fill:d.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${d.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",n.fontSize),children:i}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",n.labelSize),children:"health"})]})]})}function b({label:s,value:t,color:a,bgColor:o}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",o)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",a),children:t})]})}function q({total:s,passed:t,warnings:a,errors:o,info:n}){const d=t/s*100,i=a/s*100,r=o/s*100,c=n/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[r>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${r}%`}}),i>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${i}%`}}),c>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${c}%`}}),d>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${d}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Checks"}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:a,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:o,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:n,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function G(){return R({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function K(){const s=M();return W({mutationFn:async t=>{const a=await fetch(`/api/health/fix/${t}`,{method:"POST"}),o=await a.json();if(!a.ok)throw new Error(o.message);return o},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),p.success(t.message)},onError:t=>{p.error(t.message)}})}const Q={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function U({check:s}){const t=K(),a=Q[s.status],[o,n]=j.useState(!1),d=s.details||s.fix,i=r=>{navigator.clipboard.writeText(r),p.success("Copied to clipboard")};return d?e.jsx(w,{open:o,onOpenChange:n,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",o?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),e.jsx(E,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",o&&"rotate-90")})]})}),e.jsx(k,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(C,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>s.fix&&i(s.fix),className:"h-5 w-5 p-0",children:e.jsx(S,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Apply Fix"]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",variant:"ghost",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Fix"]})]})}const V={Monitor:I,Settings:T,Users:$,Shield:O,Zap:P};function Z({group:s,defaultOpen:t=!0}){const[a,o]=j.useState(t),n=V[s.icon]||I,d=s.checks.filter(m=>m.status==="ok").length,i=s.checks.length,r=s.checks.some(m=>m.status==="error"),c=s.checks.some(m=>m.status==="warning"),f=Math.round(d/i*100),x=r?"text-red-500":c?"text-yellow-500":"text-green-500",u=r?"bg-red-500":c?"bg-yellow-500":"bg-green-500";return e.jsx(w,{open:a,onOpenChange:o,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",r?"border-red-500/30":c?"border-yellow-500/30":"border-border"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",a&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",r?"bg-red-500/10 text-red-500":c?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(n,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",u),style:{width:`${f}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",x),children:[d,"/",i]}),e.jsx(H,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",a&&"rotate-180")})]})}),e.jsx(k,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(U,{check:m},m.id))})})]})})}function Y(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function J(s){const t=Math.floor((Date.now()-s)/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const a=Math.floor(t/60);return a<60?`${a}m ago`:`${Math.floor(a/60)}h ago`}function X(s){return[...s].sort((t,a)=>{const o=t.checks.filter(r=>r.status==="error").length,n=a.checks.filter(r=>r.status==="error").length,d=t.checks.filter(r=>r.status==="warning").length,i=a.checks.filter(r=>r.status==="warning").length;return o!==n?n-o:i-d})}function _(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function ee(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function le(){const{data:s,isLoading:t,refetch:a,dataUpdatedAt:o}=G(),n=o,[d,i]=j.useState(0);j.useEffect(()=>{const u=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(u)},[]);const r=()=>{navigator.clipboard.writeText("ccs doctor"),p.success("Copied to clipboard")},c=()=>{a(),p.info("Refreshing health checks...")};if(t&&!s)return e.jsx(ee,{});const f=s?Y(s.summary):"ok",x=s?.groups?X(s.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[s&&e.jsx("div",{className:"shrink-0",children:e.jsx(L,{passed:s.summary.passed,total:s.summary.total-s.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(_,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:"System Health"}),s?.version&&e.jsxs(z,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:["build ",s.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(F,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Last scan:"}),e.jsx("span",{className:"font-mono",children:n?J(n):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-refresh:"}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:r,className:"gap-2 font-mono text-xs",children:[e.jsx(C,{className:"w-3 h-3"}),"ccs doctor",e.jsx(S,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:c,disabled:t,className:"gap-2",children:[e.jsx(A,{className:l("w-4 h-4",t&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),s&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(q,{total:s.summary.total,passed:s.summary.passed,warnings:s.summary.warnings,errors:s.summary.errors,info:s.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((u,m)=>e.jsx(Z,{group:u,defaultOpen:m<2||u.checks.some(N=>N.status==="error"||N.status==="warning")},u.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:["Version ",e.jsx("span",{className:"font-mono",children:s?.version??"--"})]}),e.jsxs("span",{children:["Platform"," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:"Live monitoring active"})]})]})]})}export{le as HealthPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as h}from"./react-vendor-CjrBBxxX.js";const M=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,c)=>c?c.toUpperCase():o.toLowerCase()),d=a=>{const t=_(a);return t.charAt(0).toUpperCase()+t.slice(1)},r=(...a)=>a.filter((t,o,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===o).join(" ").trim(),v=a=>{for(const t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var m={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"};const x=h.forwardRef(({color:a="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:n="",children:s,iconNode:k,...y},p)=>h.createElement("svg",{ref:p,...m,width:t,height:t,stroke:a,strokeWidth:c?Number(o)*24/Number(t):o,className:r("lucide",n),...!s&&!v(y)&&{"aria-hidden":"true"},...y},[...k.map(([i,l])=>h.createElement(i,l)),...Array.isArray(s)?s:[s]]));const e=(a,t)=>{const o=h.forwardRef(({className:c,...n},s)=>h.createElement(x,{ref:s,iconNode:t,className:r(`lucide-${M(d(a))}`,`lucide-${a}`,c),...n}));return o.displayName=d(a),o};const f=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],f1=e("activity",f);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],u1=e("arrow-left",u);const N=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],N1=e("arrow-right",N);const $=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],$1=e("book-open",$);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],w1=e("bot",w);const g=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],g1=e("calendar",g);const z=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],z1=e("chart-column",z);const C=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],C1=e("chart-pie",C);const b=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b1=e("check",b);const j=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],j1=e("chevron-down",j);const q=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],q1=e("chevron-left",q);const A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],A1=e("chevron-right",A);const H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],H1=e("circle-alert",H);const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],L1=e("circle-check",L);const V=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],V1=e("circle-x",V);const S=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],S1=e("clock",S);const E=[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]],E1=e("construction",E);const P=[["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"}]],P1=e("copy",P);const O=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],O1=e("cpu",O);const B=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],B1=e("dollar-sign",B);const R=[["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"}]],R1=e("ellipsis",R);const T=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],T1=e("eye-off",T);const U=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],U1=e("eye",U);const W=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],W1=e("file-text",W);const D=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],D1=e("folder-open",D);const F=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],F1=e("house",F);const I=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],I1=e("key",I);const K=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],K1=e("loader-circle",K);const Z=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Z1=e("monitor",Z);const G=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],G1=e("moon",G);const J=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],J1=e("panel-left",J);const Q=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Q1=e("plus",Q);const X=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],X1=e("refresh-cw",X);const Y=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Y1=e("save",Y);const e1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],e0=e("search",e1);const t1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],t0=e("settings",t1);const a1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],a0=e("shield",a1);const o1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],o0=e("sparkles",o1);const c1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],c0=e("square-pen",c1);const s1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],s0=e("star",s1);const h1=[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]],h0=e("stethoscope",h1);const n1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],n0=e("sun",n1);const y1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],y0=e("terminal",y1);const d1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],d0=e("trash-2",d1);const r1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],r0=e("trending-up",r1);const k1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],k0=e("triangle-alert",k1);const p1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],p0=e("user",p1);const i1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],i0=e("users",i1);const l1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],l0=e("wifi-off",l1);const M1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],M0=e("wifi",M1);const _1=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],_0=e("wrench",_1);const v1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],v0=e("x",v1);const m1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],m0=e("zap",m1);export{f1 as A,$1 as B,z1 as C,B1 as D,R1 as E,D1 as F,o0 as G,F1 as H,u1 as I,s0 as J,I1 as K,K1 as L,G1 as M,j1 as N,E1 as O,J1 as P,_0 as Q,X1 as R,t0 as S,y0 as T,i0 as U,Z1 as V,l0 as W,v0 as X,O1 as Y,m0 as Z,w1 as _,A1 as a,n0 as b,M0 as c,a0 as d,V1 as e,H1 as f,L1 as g,b1 as h,P1 as i,k0 as j,Q1 as k,h0 as l,N1 as m,g1 as n,W1 as o,r0 as p,S1 as q,e0 as r,q1 as s,C1 as t,c0 as u,d0 as v,T1 as w,U1 as x,Y1 as y,p0 as z};
|