1import{j as e,U as F,r as u,W as r}from"./vendor-DEZMEr9l.js";import{c as l,d as I,w as U,x as D,y as T,C as p,m as g,n as f,z as m,o as x,B as N,D as w}from"./index-M-p6Hmfh.js";import{L as o}from"./label-C0egkTqT.js";import{k as R,L,l as $,m as V}from"./ui-lib-CUCVhCgZ.js";import{a as Z}from"./upload-RCYeCZk8.js";import{P as _,a as q}from"./PageMetadata-0q7_CMqW.js";import{a as B}from"./query-CHsQj_ED.js";import{D as K,n as Q}from"./icons-D27EeKJF.js";import"./three-DQ3O7-sJ.js";import"./redux-BZEuQggb.js";function A({className:s,orientation:t="horizontal",...n}){return e.jsx(R,{"data-slot":"tabs","data-orientation":t,orientation:t,className:l("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",s),...n})}const M=F("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function H({className:s,variant:t="default",...n}){return e.jsx(L,{"data-slot":"tabs-list","data-variant":t,className:l(M({variant:t}),s),...n})}function h({className:s,...t}){return e.jsx($,{"data-slot":"tabs-trigger",className:l("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",s),...t})}function b({className:s,...t}){return e.jsx(V,{"data-slot":"tabs-content",className:l("flex-1 outline-none",s),...t})}function ie(){const s=B(),{data:t}=I(),n=U(),d=D(),c=T(),[v,j]=u.useState(!1),[C,y]=u.useState(!1);u.useEffect(()=>{t&&j(t.signupEnabled)},[t]);async function S(){try{await n.mutateAsync({signupEnabled:v}),r.success("Site settings saved")}catch{r.error("Failed to save settings")}}async function z(i){y(!0);try{await Z(i),r.success("Resume updated"),await s.invalidateQueries({queryKey:w.settings})}catch{r.error("Failed to upload resume")}finally{y(!1)}}function P(){d.mutate(void 0,{onSuccess:()=>r.success("Configuration exported"),onError:()=>r.error("Failed to export configuration")})}function E(i){c.mutate(i,{onSuccess:a=>{r.success(`Imported: ${String(a.counts.skills)} skills, ${String(a.counts.projects)} projects, ${String(a.counts.collaborators)} collaborators, ${String(a.counts.organizations)} organizations, ${String(a.counts.media)} media`),s.invalidateQueries({queryKey:w.settings})},onError:()=>r.error("Failed to import configuration")})}const k=t?.resumeUrl??null;return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:q("Settings"),description:"Sign-up toggle, resume (PDF), and configuration backup.",noIndex:!0}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Settings"}
1),e.jsxs(A,{defaultValue:"site",children:[e.jsxs(H,{children:[e.jsx(h,{value:"site",children:"Site"}),e.jsx(h,{value:"resume",children:"Resume"}),e.jsx(h,{value:"backup",children:"Backup"})]}),e.jsx(b,{value:"site",className:"space-y-4",children:e.jsxs(p,{children:[e.jsxs(g,{children:[e.jsx(f,{children:"Site"}),e.jsx(m,{children:"Control whether new users can register."})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",id:"signupEnabled",checked:v,onChange:i=>{j(i.target.checked)}}),e.jsx(o,{htmlFor:"signupEnabled",children:"Allow new user registration (sign up)"})]}),e.jsx(N,{onClick:()=>{S()},disabled:n.isPending,children:"Save site settings"})]})]})}),e.jsx(b,{value:"resume",className:"space-y-4",children:e.jsxs(p,{children:[e.jsxs(g,{children:[e.jsx(f,{children:"Resume"}),e.jsx(m,{children:"PDF (or doc) stored as media and linked for the hero download and 3D asset. Upload replaces the previous file."})]}),e.jsxs(x,{className:"space-y-4",children:[k?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Current:"," ",e.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"View resume"})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No resume uploaded yet."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"resumeFile",children:"Upload resume"}),e.jsx("input",{id:"resumeFile",type:"file",accept:".pdf,.doc,.docx",disabled:C,onChange:i=>{const a=i.target.files?.[0];a&&z(a),i.target.value=""},className:"block w-full text-sm file:mr-4 file:rounded file:border-0 file:bg-primary file:px-4 file:py-2 file:text-sm file:font-semibold file:text-primary-foreground hover:file:bg-primary/90"})]})]})]})}),e.jsx(b,{value:"backup",className:"space-y-4",children:e.jsxs(p,{children:[e.jsxs(g,{children:[e.jsx(f,{children:"Configuration backup"}),e.jsx(m,{children:"Export or import the full portfolio (settings store signup + resume media id; resume file is in the ZIP media set)."})]}),e.jsxs(x,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{children:"Download configuration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ZIP with skills, projects, collaborators, organizations, media, and slim settings."}),e.jsxs(N,{onClick:P,disabled:d.isPending,variant:"outline",children:[e.jsx(K,{className:"size-4"}),d.isPending?"Exporting...":"Download configuration"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{children:"Import configuration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Upload a previously exported ZIP. This replaces existing data."}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"file",accept:".zip","aria-label":"Import configuration ZIP",onChange:i=>{const a=i.target.files?.[0];a&&E(a)},disabled:c.isPending,className:"block w-full text-sm file:mr-4 file:rounded file:border-0 file:bg-primary file:px-4 file:py-2 file:text-sm file:font-semibold file:text-primary-foreground hover:file:bg-primary/90"}),c.isPending&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:[e.jsx(Q,{className:"inline size-4 animate-pulse"})," Importing..."]})]})]})]})]})})]})]})]})}export{ie as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.