better-auth-studio 1.0.78 → 1.0.79-beta.1
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/package.json
CHANGED
|
@@ -925,7 +925,7 @@ export const auth = betterAuth({
|
|
|
925
925
|
},
|
|
926
926
|
}),
|
|
927
927
|
],
|
|
928
|
-
});`}[de]||""},be=de=>{navigator.clipboard.writeText(de),V.success("Copied to clipboard")},Ue=Object.values(aa).filter(de=>c==="all"||de.category===c);return r.jsxs("div",{className:"h-full flex flex-col bg-black",children:[r.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:r.jsxs("div",{className:"pb-8",children:[r.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Emails"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Customize your email templates with a visual editor"})]})}),r.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsx("hr",{className:"w-full border-white/15 h-px"})]}),r.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[r.jsxs("div",{className:"w-[340px] border-r border-dashed border-white/15 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-dashed border-white/15 flex-shrink-0",children:[r.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider mb-4",children:"Templates"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:["all","authentication","organization","notification"].map(de=>r.jsx("button",{onClick:()=>u(de),className:`px-2 py-1 text-[10px] font-mono uppercase border border-dashed rounded-none transition-colors ${c===de?"border-white/30 bg-white/5 text-white":"border-white/10 bg-black/40 text-gray-300 hover:border-white/20"}`,children:de},de))})]}),r.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-2",style:{overscrollBehavior:"contain"},children:Ue.map(de=>r.jsxs("button",{onClick:()=>W(de.id),className:`w-full text-left p-3 border border-dashed rounded-none transition-colors ${e===de.id?"border-white/30 bg-white/5 text-white":"border-white/15 bg-black/40 text-gray-300 hover:border-white/20 hover:bg-white/5"}`,children:[r.jsx("div",{className:"text-sm uppercase font-mono",children:de.name}),r.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[de.fields.length," fields"]})]},de.id))})]}),r.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:e?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"border-b border-dashed border-white/15 p-4 flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-light text-white uppercase tracking-wider",children:(Be=aa[e])==null?void 0:Be.name}),r.jsx("p",{className:"text-xs text-gray-400 font-mono mt-1",children:($e=aa[e])==null?void 0:$e.category})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs($,{variant:"outline",onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(c3,{className:"w-4 h-4 mr-2"}),"Test Email"]}),r.jsxs($,{variant:"outline",onClick:()=>{ge(e)&&l(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(hi,{className:"w-4 h-4 mr-2"}),"Export Code"]}),r.jsxs($,{variant:"outline",onClick:()=>be(n),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(Nc,{className:"w-4 h-4 mr-2"}),"Copy HTML"]})]})]}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"p-4 border-b border-dashed border-white/10 bg-black/40",children:r.jsxs("div",{className:"flex items-end gap-4",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Subject"}),r.jsx(Ne,{value:s,onChange:de=>ae(de.target.value),placeholder:"Email subject",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-sm"})]}),r.jsxs($,{variant:"outline",onClick:()=>m(!f),className:"h-10 border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[f?"Hide":"Show"," Fields"]})]})}),f&&e&&r.jsxs("div",{className:"p-4 border-b overflow-hidden border-dashed border-white/10 bg-black/30",children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Fields"}),r.jsx("div",{className:"grid grid-cols-2 gap-3 max-h-full overflow-y-hidden",children:(Ye=aa[e])==null?void 0:Ye.fields.map(de=>r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs font-mono text-gray-400 mb-1 block",children:de}),r.jsx(Ne,{value:h[de]||"",onChange:Fe=>d(Ie=>({...Ie,[de]:Fe.target.value})),placeholder:`{{${de}}}`,className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"})]},de))}),r.jsx("div",{className:"mt-4 flex justify-end",children:r.jsx($,{variant:"outline",onClick:ye,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Apply Changes"})})]}),e&&r.jsxs("div",{className:"p-4 border-b border-dashed border-white/10 bg-black/40",children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Dynamic Fields"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:(mt=aa[e])==null?void 0:mt.fields.map(de=>r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx($,{variant:"ghost",size:"sm",onClick:()=>be(`{{${de}}}`),className:"text-xs rounded-none border border-dashed border-white/20 hover:bg-white/10",children:de}),r.jsx("span",{className:"text-xs text-gray-500 font-mono",children:`{{${de}}}`})]},de))})]}),r.jsx("div",{className:"flex-1 overflow-hidden",children:r.jsx(ffe,{html:se,onChange:Y})})]})]}):r.jsx("div",{className:"flex-1 flex items-center justify-center min-h-0",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Sc,{className:"w-16 h-16 text-white/20 mx-auto mb-4"}),r.jsx("p",{className:"text-gray-400 font-mono uppercase text-sm",children:"Select a template to start editing"})]})})})]}),o&&e&&r.jsx("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 overflow-hidden",onClick:de=>{de.target===de.currentTarget&&l(!1)},children:r.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-0 w-full max-w-5xl max-h-[90vh] overflow-hidden flex flex-col",onClick:de=>de.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-0 pt-2 border-white/15 border-b-0 bg-black/50",children:[r.jsx("div",{className:"flex items-center justify-between p-2 pt-2",children:r.jsxs("div",{className:"pb-2",children:[r.jsx("h1",{className:"text-xl font-normal uppercase text-white tracking-tight",children:"Export"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Export the code for the selected template"})]})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"flex flex-col items-center justify-center",children:[r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsx("div",{className:"relative z-20 h-8 w-[calc(100%)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#e0f2fe,#e0f2fe_1px,transparent_1px,transparent_6px)] opacity-[8%]"}),r.jsx("hr",{className:"w-full border-white/15 h-px"})]}),r.jsx("div",{className:"flex-1 overflow-auto p-6 bg-black",children:r.jsx(m6,{code:ge(e),language:"typescript",fileName:"auth.ts"})}),r.jsx("div",{className:"flex items-center justify-end p-6 border-t border-white/15 bg-black/50",children:r.jsx($,{onClick:ne,disabled:N,className:"bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs px-6 py-2",children:N?"Applying...":"Apply to auth config"})})]})}),y&&e&&r.jsx("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 overflow-hidden",onClick:de=>{de.target===de.currentTarget&&g(!1)},children:r.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-0 w-full max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",onClick:de=>de.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-white/15 border-b bg-black/50",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-normal uppercase text-white tracking-tight",children:"Setup Required"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Install Resend before applying email template"})]})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"flex-1 overflow-auto p-8 bg-black",children:r.jsx("div",{className:"space-y-6",children:r.jsxs("div",{children:[r.jsx("h2",{className:"text-md font-mono uppercase font-normal text-white mb-3",children:"Install Resend"}),r.jsx("p",{className:"text-gray-300 mb-4 font-sans leading-relaxed",children:"You need to install the Resend package to send emails. Run the following command in your terminal:"}),r.jsx("div",{className:"bg-black/80 border border-dashed border-white/20 p-2 pl-3 rounded-none font-mono text-sm relative group",children:r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsxs("code",{className:"text-gray-200",children:[r.jsx("span",{className:"text-white",children:"$"})," ",r.jsx("span",{className:"text-blue-600",children:"pnpm"})," ",r.jsx("span",{className:"text-white",children:"install"})," ",r.jsx("span",{className:"text-white",children:"resend"})]}),r.jsx("button",{onClick:()=>{navigator.clipboard.writeText("pnpm install resend"),S(!0),setTimeout(()=>S(!1),2e3)},className:"flex items-center gap-2 px-2 py-1.5 rounded-none transition-colors text-gray-300 hover:text-white",title:"Copy command",children:w?r.jsx(r.Fragment,{children:r.jsx(Td,{className:"w-4 h-4"})}):r.jsx(r.Fragment,{children:r.jsx(Nc,{className:"w-4 h-4"})})})]})})]})})}),r.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/15 bg-black/50",children:[r.jsx($,{variant:"ghost",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none font-mono uppercase text-xs px-6 py-2",children:"Cancel"}),r.jsx($,{onClick:()=>X(e),disabled:N,className:"bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs px-6 py-2",children:N?"Applying...":"Continue"})]})]})}),E&&e&&r.jsx("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 overflow-hidden",onClick:de=>{de.target===de.currentTarget&&j(!1)},children:r.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-0 w-full max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",onClick:de=>de.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-white/15 border-b bg-black/50",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-normal uppercase text-white tracking-tight",children:"Test Email"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Send a test email with dynamic values"})]})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"flex-1 overflow-auto p-8 bg-black",children:r.jsxs("div",{className:"space-y-6",children:[A==="checking"&&r.jsx("div",{className:"bg-black/90 flex border p-4 rounded-none border-dashed border-white/20",children:r.jsxs("p",{className:"text-white text-sm font-sans flex items-center gap-2 leading-relaxed",children:[r.jsx(Ja,{className:"w-4 h-4 animate-spin mr-1"})," Checking for RESEND_API_KEY..."]})}),A==="missing"&&r.jsxs("div",{className:"bg-red-900/20 border border-red-500/30 border-dashed p-4 rounded-none",children:[r.jsx("p",{className:"text-red-200 text-sm font-sans leading-relaxed mb-2",children:r.jsx("strong",{className:"font-normal uppercase font-mono",children:"RESEND_API_KEY not found"})}),r.jsxs("p",{className:"text-red-200 text-sm font-sans leading-relaxed",children:["Please add"," ",r.jsx("code",{className:"bg-black/50 px-1 py-0.5 rounded font-mono text-xs",children:"RESEND_API_KEY"})," ","to your"," ",r.jsx("code",{className:"bg-black/50 px-1 py-0.5 rounded font-mono text-xs",children:".env"})," ","file."]})]}),A==="found"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"From Email (Verified Sender) *"}),R.length>0?r.jsx("select",{value:T,onChange:de=>D(de.target.value),className:"w-full bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs p-2 focus:outline-none focus:border-white/40",children:R.map(de=>r.jsx("option",{value:de,children:de},de))}):r.jsx(Ne,{type:"email",value:T,onChange:de=>D(de.target.value),placeholder:"noreply@yourdomain.com",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:R.length>0?"Select a verified sender email from your Resend account":"Enter a verified sender email address from your Resend account"})]}),r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Subject *"}),r.jsx(Ne,{type:"text",value:q,onChange:de=>C(de.target.value),placeholder:"Email subject",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:"Email subject line (supports dynamic placeholders)"})]}),r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"To Email Address *"}),r.jsx(Ne,{type:"email",value:_,onChange:de=>M(de.target.value),placeholder:"recipient@example.com",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:"Any email address to receive the test email"})]}),((Ke=aa[e])==null?void 0:Ke.fields)&&aa[e].fields.length>0&&r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Dynamic Values"}),r.jsx("div",{className:"space-y-3",children:aa[e].fields.map(de=>r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-500 mb-1 block",children:de}),r.jsx(Ne,{value:U[de]||"",onChange:Fe=>L({...U,[de]:Fe.target.value}),placeholder:`Enter ${de}`,className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"})]},de))})]})]})]})}),r.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/15 bg-black/50",children:[r.jsx($,{variant:"ghost",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none font-mono uppercase text-xs px-6 py-2",children:"Cancel"}),r.jsx($,{onClick:z,disabled:F||A!=="found"||!_||!T||!q,className:"bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs px-6 py-2 disabled:opacity-50 disabled:cursor-not-allowed",children:F?"Sending...":"Send Test Email"})]})]})})]})}const mfe=P5("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-white text-black hover:bg-white",secondary:"border-transparent bg-gray-800 text-white hover:bg-gray-800 border border-gray-600",destructive:"border-transparent bg-red-500 text-white hover:bg-red-600",outline:"text-gray-300 border-gray-600",success:"border-transparent bg-green-900 text-green-300",warning:"border-transparent bg-yellow-900 text-yellow-300",error:"border-transparent bg-red-900 text-red-300",info:"border-transparent bg-gray-800 text-white border border-gray-600"}},defaultVariants:{variant:"default"}});function Bt({className:e,variant:t,...n}){return r.jsx("div",{className:Ge(mfe({variant:t}),e),...n})}function gfe(){const{orgId:e}=Q1(),t=vr(),[n,a]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState([]),[h,d]=p.useState(!0),[f,m]=p.useState("details"),[v,x]=p.useState(!1),[N,b]=p.useState(!1),[y,g]=p.useState(!1),[w,S]=p.useState(!1),[E,j]=p.useState(!1),[_,M]=p.useState(!1),[U,L]=p.useState(!1),[F,G]=p.useState(!1),[A,P]=p.useState(!1),[R,k]=p.useState(null),[T,D]=p.useState({name:"",slug:""}),[q,C]=p.useState(""),[I,z]=p.useState(""),[W,Y]=p.useState([]),[ae,ne]=p.useState({name:""}),[X,ie]=p.useState(!1),[ye,se]=p.useState([]),[ge,be]=p.useState(!1),[Ue,Be]=p.useState([]),[$e,Ye]=p.useState(!1);p.useEffect(()=>{e&&(Ke(),Fe(),de(),_e(),We(),Ie());const Q=setInterval(()=>{!N&&e&&Fe()},2e3);return()=>clearInterval(Q)},[e,N]),p.useEffect(()=>{v&&e&&Ie()},[]),p.useEffect(()=>{f==="members"&&e&&We()},[f,e]),p.useEffect(()=>{f==="invitations"&&e&&_e()},[f,e]);const mt=Q=>{ne({name:Q})},Ke=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}`)).json();Z.success&&Z.organization||Z.organization?a(Z.organization):V.error("Organization not found")}catch(Q){console.error("Failed to fetch organization:",Q),V.error("Failed to load organization")}finally{d(!1)}},de=async()=>{try{const Z=await(await fetch("/api/plugins/teams/status")).json();x(Z.enabled)}catch(Q){console.error("Failed to check teams status:",Q),x(!1)}},Fe=async()=>{try{const Z=await(await fetch("/api/plugins/organization/status")).json();b(Z.enabled)}catch(Q){console.error("Failed to check organization status:",Q),b(!1)}},Ie=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}/teams`)).json();Z.success&&i(Z.teams||[])}catch(Q){console.error("Failed to fetch teams:",Q),V.error("Failed to load teams")}},_e=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}/invitations`)).json();Z.success&&l(Z.invitations||[])}catch(Q){console.error("Failed to fetch invitations:",Q),V.error("Failed to load invitations")}},We=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}/members`)).json();Z.success&&u(Z.members||[])}catch(Q){console.error("Failed to fetch members:",Q),V.error("Failed to load members")}},at=async Q=>{se([]),be(!0),se([{id:"start",type:"info",message:`Starting member seeding process for ${Q} members...`,timestamp:new Date}]);try{const je=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Q})})).json();if(je.success){const Qe=je.results.map((ct,it)=>ct.success?{id:`member-${it}`,type:"progress",message:`Adding member: ${ct.member.user.name} (${ct.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${it}`,type:"error",message:`Failed to add member ${it+1}: ${ct.error}`,timestamp:new Date});se(ct=>[...ct,...Qe]);const st=je.results.filter(ct=>ct.success).length;se(ct=>[...ct,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${st}/${Q} members successfully`,timestamp:new Date}]),await We(),V.success(`Successfully added ${st} members!`)}else se(Qe=>[...Qe,{id:"error",type:"error",message:`❌ Seeding failed: ${je.error||"Unknown error"}`,timestamp:new Date}]),V.error(je.error||"Failed to seed members")}catch(Z){se(je=>[...je,{id:"error",type:"error",message:`❌ Network error: ${Z}`,timestamp:new Date}]),V.error("Failed to seed members")}finally{be(!1)}},ft=async Q=>{Be([]),Ye(!0),Be([{id:"start",type:"info",message:`Starting team seeding process for ${Q} teams...`,timestamp:new Date}]);try{const je=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Q})})).json();if(je.success){const Qe=je.results.map((ct,it)=>ct.success?{id:`team-${it}`,type:"progress",message:`Creating team: ${ct.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${it}`,type:"error",message:`Failed to create team ${it+1}: ${ct.error}`,timestamp:new Date});Be(ct=>[...ct,...Qe]);const st=je.results.filter(ct=>ct.success).length;Be(ct=>[...ct,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${st}/${Q} teams successfully`,timestamp:new Date}]),await Ie(),V.success(`Successfully created ${st} teams!`)}else Be(Qe=>[...Qe,{id:"error",type:"error",message:`❌ Seeding failed: ${je.error||"Unknown error"}`,timestamp:new Date}]),V.error(je.error||"Failed to seed teams")}catch(Z){Be(je=>[...je,{id:"error",type:"error",message:`❌ Network error: ${Z}`,timestamp:new Date}]),V.error("Failed to seed teams")}finally{Ye(!1)}},Yt=async()=>{try{const Z=await(await fetch("/api/users/all")).json();Z.success&&Y(Z.users||[])}catch(Q){console.error("Failed to fetch users:",Q)}},Wt=Q=>Q.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),oe=()=>{n&&(D({name:n.name,slug:n.slug}),P(!0))},ke=Q=>{const Z=Wt(Q);D({name:Q,slug:Z})},Ze=Q=>{D(Z=>({...Z,slug:Wt(Q)}))},K=async()=>{if(!n){V.error("No organization selected");return}if(!T.name){V.error("Please fill in the organization name");return}const Q=V.loading("Updating organization...");try{const je=await(await fetch(`/api/organizations/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T.name,slug:T.slug})})).json();je.success?(await Ke(),P(!1),D({name:"",slug:""}),V.success("Organization updated successfully!",{id:Q})):V.error(`Error updating organization: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error updating organization:",Z),V.error("Error updating organization",{id:Q})}},pe=()=>{Yt(),g(!0)},ve=async()=>{if(!q){V.error("Please enter an email address");return}if(!I){V.error("Please select an inviter");return}ie(!0);const Q=V.loading("Sending invitation...");try{const je=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:q,role:"member",inviterId:I})})).json();je.success?(await _e(),g(!1),C(""),z(""),V.success("Invitation sent successfully!",{id:Q})):V.error(`Error sending invitation: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error sending invitation:",Z),V.error("Error sending invitation",{id:Q})}finally{ie(!1)}},Te=async Q=>{const Z=V.loading("Cancelling invitation...");try{const Qe=await(await fetch(`/api/invitations/${Q}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Qe.success?(await _e(),V.success("Invitation cancelled successfully!",{id:Z})):V.error(`Error cancelling invitation: ${Qe.error||"Unknown error"}`,{id:Z})}catch(je){console.error("Error cancelling invitation:",je),V.error("Error cancelling invitation",{id:Z})}},ze=async(Q,Z)=>{const je=V.loading("Resending invitation...");try{const st=await(await fetch(`/api/invitations/${Q}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();st.success?(await _e(),V.success(`Invitation resent to ${Z}!`,{id:je})):V.error(`Error resending invitation: ${st.error||"Unknown error"}`,{id:je})}catch(Qe){console.error("Error resending invitation:",Qe),V.error("Error resending invitation",{id:je})}},tt=async(Q,Z)=>{const je=V.loading(`Removing ${Z}...`);try{const st=await(await fetch(`/api/members/${Q}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();st.success?(await We(),V.success(`${Z} removed from organization!`,{id:je})):V.error(`Error removing member: ${st.error||"Unknown error"}`,{id:je})}catch(Qe){console.error("Error removing member:",Qe),V.error("Error removing member",{id:je})}},ee=async()=>{if(!ae.name){V.error("Please enter a team name");return}const Q=V.loading("Creating team...");try{const je=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ae.name,organizationId:e})})).json();je.success?(await Ie(),M(!1),ne({name:""}),V.success("Team created successfully!",{id:Q})):V.error(`Error creating team: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error creating team:",Z),V.error("Error creating team",{id:Q})}},ue=async()=>{if(!R||!ae.name){V.error("Please enter a team name");return}const Q=V.loading("Updating team...");try{const je=await(await fetch(`/api/teams/${R.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ae.name})})).json();je.success?(await Ie(),L(!1),k(null),ne({name:""}),V.success("Team updated successfully!",{id:Q})):V.error(`Error updating team: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error updating team:",Z),V.error("Error updating team",{id:Q})}},Oe=async()=>{if(!R){V.error("No team selected");return}const Q=V.loading("Deleting team...");try{const je=await(await fetch(`/api/teams/${R.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();je.success?(await Ie(),G(!1),k(null),V.success("Team deleted successfully!",{id:Q})):V.error(`Error deleting team: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error deleting team:",Z),V.error("Error deleting team",{id:Q})}},xe=Q=>{k(Q),ne({name:Q.name}),L(!0)},Pe=Q=>{k(Q),G(!0)};return h?r.jsx("div",{className:"flex items-center justify-center h-32",children:r.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[r.jsx(rn,{className:"w-6 h-6 text-white animate-spin"}),r.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[r.jsx(Ot,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),r.jsxs($,{onClick:pe,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Invite User"]}),r.jsxs($,{onClick:oe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Po,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ca,{className:"w-6 h-6 text-white"})}),r.jsx("div",{children:r.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,r.jsx(on,{id:n.slug,nonSliced:!0,variant:"subscript"})]})})]}),r.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[r.jsx("div",{className:"border-b border-dashed border-white/20",children:r.jsxs("nav",{className:"flex space-x-8 px-6",children:[r.jsxs("button",{onClick:()=>m("details"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ca,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Details",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:0,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),r.jsxs("button",{onClick:()=>m("members"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Members",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),r.jsxs("button",{onClick:()=>m("invitations"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(vs,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Invitations",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),r.jsxs("button",{onClick:()=>m("teams"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Teams",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:s.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),r.jsxs("div",{className:"p-6",children:[f==="details"&&r.jsxs("div",{className:"space-y-6 overflow-x-hidden",children:[r.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"ORGANIZATION INFORMATION"}),r.jsx("hr",{className:"border-white/15 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),r.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),r.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),r.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ot,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:c.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ot,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:s.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(vs,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:o.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(cr,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:Math.ceil((new Date().getTime()-new Date(n.createdAt).getTime())/(1e3*60*60*24)),format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-xs",children:s.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[r.jsx(Rs,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),r.jsxs($,{onClick:()=>M(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),v?s.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:s.map(Q=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${Q.id}`),children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-light",children:Q.name}),r.jsx(on,{id:Q.id,label:"Team ID"})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:Q.memberCount||0}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(Q.createdAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:Z=>{Z.stopPropagation(),xe(Q)},children:[r.jsx(Po,{className:"w-4 h-4 mr-1"}),"Edit"]}),r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:Z=>{Z.stopPropagation(),Pe(Q)},children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},Q.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),r.jsxs($,{onClick:()=>M(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:r.jsxs("div",{className:"flex items-start space-x-4",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx(Ot,{className:"w-12 h-12 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),r.jsx("p",{className:"text-gray-300 mb-6",children:"To use Teams in Better Auth Studio, you need to enable the teams feature in your organization plugin configuration."}),r.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[r.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),r.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:r.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),r.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:r.jsxs("pre",{className:"text-sm text-gray-300",children:[r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth/plugins"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"export const"})," ",r.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",r.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",r.jsx("br",{}),r.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",r.jsx("br",{}),r.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",r.jsx("span",{className:"text-blue-400",children:"true"})," ",r.jsx("br",{}),r.jsx("span",{className:"pl-16",children:"}"})," ",r.jsx("br",{}),r.jsx("span",{className:"pl-12",children:"})"})," ",r.jsx("br",{}),r.jsx("span",{className:"pl-10",children:"]"})," ",r.jsx("br",{}),"}",") ",r.jsx("br",{})]})}),r.jsx("div",{className:"mt-4",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),r.jsx("div",{className:"mt-2",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),r.jsx($,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),r.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",r.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}),f==="members"&&r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage organization members and their roles"})]})}),c.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:c.map(Q=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 group",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("img",{src:Q.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Q.user.id}`,alt:Q.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light inline-flex items-center gap-2",children:[r.jsx("span",{children:Q.user.name}),r.jsx("button",{onClick:Z=>{Z.stopPropagation(),t(`/users/${Q.user.id}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View user details",children:r.jsx(yu,{className:"w-4 h-4"})})]}),r.jsx(on,{id:Q.user.id})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:Q.user.email}),r.jsx("td",{className:"py-4 px-4",children:r.jsx(Bt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:Q.role})}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(Q.joinedAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsx("div",{className:"flex items-center justify-end space-x-2",children:r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>tt(Q.id,Q.user.name),children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},Q.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),r.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[r.jsxs($,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[r.jsx(Ot,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),r.jsxs($,{onClick:pe,className:"bg-white text-black hover:bg-white/90 border border-white/20 rounded-none",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage pending invitations to this organization"})]})}),o.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:o.map(Q=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(vs,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-light",children:Q.email}),r.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(Q.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white capitalize",children:Q.role}),r.jsx("td",{className:"py-4 px-4",children:r.jsxs(Bt,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${Q.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":Q.status==="accepted"?"bg-green-900/10 border border-green-500/30 text-green-400/70":"bg-red-900/10 border border-red-500/30 text-red-400/70"}`,children:[Q.status==="pending"&&r.jsx(jU,{className:"w-3 h-3"}),Q.status==="accepted"&&r.jsx(wp,{className:"w-3 h-3"}),Q.status==="expired"&&r.jsx(dt,{className:"w-3 h-3"}),Q.status]})}),r.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(Q.expiresAt).toLocaleDateString(),r.jsx("br",{}),r.jsx("span",{className:"text-xs text-gray-400",children:new Date(Q.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>ze(Q.id,Q.email),children:[r.jsx(EC,{className:"w-4 h-4 mr-1"}),"Resend"]}),r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>Te(Q.id),children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},Q.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(vs,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),r.jsxs($,{onClick:pe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]})]})]}),y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{g(!1),C(""),z("")},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),r.jsx(Ne,{id:"invite-email",type:"email",value:q,onChange:Q=>C(Q.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),r.jsxs(hn,{value:I,onValueChange:z,children:[r.jsx(fn,{children:r.jsx(Bn,{placeholder:"Select an inviter..."})}),r.jsx(pn,{children:W.map(Q=>r.jsx(Le,{value:Q.id,children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("img",{src:Q.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Q.id}`,alt:Q.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),r.jsxs("span",{children:[Q.name," (",Q.email,")"]})]})},Q.id))})]})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{g(!1),C(""),z("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsxs($,{onClick:ve,disabled:X,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[X?r.jsx(rn,{className:"w-3 h-3 mr-2 animate-spin"}):r.jsx(EC,{className:"w-4 h-4 mr-2"}),X?"Sending...":"Send Invitation"]})]})]})}),_&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{M(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),r.jsx(Ne,{id:"team-name",value:ae.name,onChange:Q=>mt(Q.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{M(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),U&&R&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{L(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-8 h-8 text-white"})}),r.jsx("div",{children:r.jsxs("div",{className:"text-white font-light",children:[R.name,r.jsx(on,{id:R.id,variant:"subscript",nonSliced:!0})]})})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),r.jsx(Ne,{id:"edit-team-name",value:ae.name,onChange:Q=>mt(Q.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{L(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:ue,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),F&&R&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>G(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white inline-flex font-light",children:[R.name,r.jsx(on,{id:R.id,variant:"subscript",nonSliced:!0})]}),r.jsx(on,{id:R.id,label:"Team ID",variant:"detail"})]})]}),r.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>G(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:Oe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),w&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Ot,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),r.jsx(Ne,{id:"member-count",type:"number",min:"1",max:"50",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var Z;const Q=parseInt(((Z=document.getElementById("member-count"))==null?void 0:Z.value)||"5");at(Q)},disabled:ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ge?r.jsxs(r.Fragment,{children:[r.jsx(rn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Ot,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),ye.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(Xi,{title:"Member Seeding Terminal",lines:ye,isRunning:ge,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:r.jsx($,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),E&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Ca,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),r.jsx(Ne,{id:"team-count",type:"number",min:"1",max:"20",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var Z;const Q=parseInt(((Z=document.getElementById("team-count"))==null?void 0:Z.value)||"3");ft(Q)},disabled:$e,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:$e?r.jsxs(r.Fragment,{children:[r.jsx(rn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Ca,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),Ue.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(Xi,{title:"Team Seeding Terminal",lines:Ue,isRunning:$e,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:r.jsx($,{variant:"outline",onClick:()=>j(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),A&&n&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:Q=>{Q.target===Q.currentTarget&&(P(!1),D({name:"",slug:""}))},children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",onClick:Q=>Q.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{P(!1),D({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Ca,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white inline-flex font-light",children:[n.name,r.jsx(on,{id:n.id,variant:"subscript",nonSliced:!0})]}),r.jsx("div",{className:"text-sm text-gray-400",children:n.slug})]})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),r.jsx(Ne,{id:"edit-name",value:T.name,onChange:Q=>ke(Q.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),r.jsx(Ne,{id:"edit-slug",value:T.slug,onChange:Q=>Ze(Q.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{P(!1),D({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:K,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})})]}):r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx(J1,{to:"/organizations",children:r.jsxs($,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[r.jsx(fae,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),r.jsx("br",{}),r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ca,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),r.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function bfe(){const[e,t]=p.useState([]),[n,a]=p.useState(!0),[s,i]=p.useState(""),[o,l]=p.useState("all"),[c,u]=p.useState(!1),[h,d]=p.useState(!1),[f,m]=p.useState(!1),[v,x]=p.useState(!1),[N,b]=p.useState(!1),[y,g]=p.useState(null),[w,S]=p.useState([]),[E,j]=p.useState(!1),_=p.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{a(!1)}},[]);p.useEffect(()=>{_()},[_]);const M=async T=>{S([]),j(!0),S([{id:"start",type:"info",message:`Starting session seeding process for ${T} sessions...`,timestamp:new Date}]);try{const q=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:T})})).json();if(q.success){const C=q.results.map((z,W)=>z.success?{id:`session-${W}`,type:"progress",message:`Creating session: ${z.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${W}`,type:"error",message:`Failed to create session ${W+1}: ${z.error}`,timestamp:new Date});S(z=>[...z,...C]);const I=q.results.filter(z=>z.success).length;S(z=>[...z,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${I}/${T} sessions successfully`,timestamp:new Date}]),await _()}else S(C=>[...C,{id:"error",type:"error",message:`❌ Seeding failed: ${q.error||"Unknown error"}`,timestamp:new Date}])}catch(D){S(q=>[...q,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{j(!1)}},U=async T=>{S([]),j(!0),S([{id:"start",type:"info",message:`Starting account seeding process for ${T} accounts...`,timestamp:new Date}]);try{const q=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:T})})).json();if(q.success){const C=q.results.map((z,W)=>z.success?{id:`account-${W}`,type:"progress",message:`Creating account: ${z.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${W}`,type:"error",message:`Failed to create account ${W+1}: ${z.error}`,timestamp:new Date});S(z=>[...z,...C]);const I=q.results.filter(z=>z.success).length;S(z=>[...z,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${I}/${T} accounts successfully`,timestamp:new Date}]),await _()}else S(C=>[...C,{id:"error",type:"error",message:`❌ Seeding failed: ${q.error||"Unknown error"}`,timestamp:new Date}])}catch(D){S(q=>[...q,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{j(!1)}},L=T=>{g(T),x(!0)},F=T=>{g(T),d(!0)},G=T=>{g(T),m(!0)},A=async T=>{u(!1)},P=async T=>{d(!1)},R=async()=>{m(!1)},k=e.filter(T=>{const D=T.id.toLowerCase().includes(s.toLowerCase())||T.userId.toLowerCase().includes(s.toLowerCase()),q=o==="all"||o==="active"&&new Date(T.expiresAt)>new Date||o==="expired"&&new Date(T.expiresAt)<=new Date;return D&&q});return n?r.jsx("div",{className:"flex items-center justify-center h-32",children:r.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[r.jsx(Ja,{className:"w-6 h-6 text-white animate-spin"}),r.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>b(!0),children:[r.jsx(Jt,{className:"w-4 h-4 mr-2"}),"Seed"]}),r.jsxs($,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>u(!0),children:[r.jsx(Pi,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Fo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),r.jsx(Ne,{placeholder:"Search sessions...",value:s,onChange:T=>i(T.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(xS,{className:"w-4 h-4 text-gray-400"}),r.jsxs(hn,{value:o,onValueChange:l,children:[r.jsx(fn,{children:r.jsx(Bn,{})}),r.jsxs(pn,{children:[r.jsx(Le,{value:"all",children:"All"}),r.jsx(Le,{value:"active",children:"Active"}),r.jsx(Le,{value:"expired",children:"Expired"})]})]})]})]}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:k.map(T=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",T.id.slice(0,8),"..."]}),r.jsx(on,{id:T.id})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:T.userId}),r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(T.expiresAt)>new Date?r.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):r.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),r.jsx("span",{className:"text-sm text-gray-400",children:new Date(T.expiresAt)>new Date?"Active":"Expired"})]})}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(T.expiresAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsx($,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>L(T),children:r.jsx(Ms,{className:"w-4 h-4"})}),r.jsx($,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>F(T),children:r.jsx(Po,{className:"w-4 h-4"})}),r.jsx($,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>G(T),children:r.jsx(Qu,{className:"w-4 h-4"})})]})})]},T.id))})]})})}),N&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),r.jsx(Ne,{id:"session-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var D;const T=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);M(T)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?r.jsxs(r.Fragment,{children:[r.jsx(Ja,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Jt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(kT,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),r.jsx(Ne,{id:"account-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var D;const T=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);U(T)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?r.jsxs(r.Fragment,{children:[r.jsx(Ja,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(kT,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),w.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(Xi,{title:"Session Seeding Terminal",lines:w,isRunning:E,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:r.jsx($,{variant:"outline",onClick:()=>b(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),r.jsx(Ne,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),r.jsx(Ne,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:()=>A(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),r.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),r.jsx(Ne,{id:"edit-user-id",defaultValue:y.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),r.jsx(Ne,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(y.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:()=>P(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>m(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),r.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),r.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>m(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:R,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),v&&y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),r.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(on,{id:y.id,variant:"detail"}),r.jsx(on,{id:y.userId,label:"User ID",variant:"detail"}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Status:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt)>new Date?"Active":"Expired"})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Expires:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt).toLocaleString()})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Created:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.createdAt).toLocaleString()})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Updated:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.updatedAt).toLocaleString()})]})]})]}),r.jsx("div",{className:"flex justify-end mt-6",children:r.jsx($,{onClick:()=>x(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function xfe(){var y,g,w,S,E,j,_,M,U,L,F,G,A,P,R,k,T,D,q,C,I,z,W,Y,ae,ne,X,ie,ye;const[e,t]=p.useState(null),[n,a]=p.useState(null),[s,i]=p.useState(null),[o,l]=p.useState(null),[c,u]=p.useState(!0),[h,d]=p.useState(null);e5(se=>{se.type==="config_changed"?setTimeout(()=>{f(),m(),v(),x()},500):se.type});const f=p.useCallback(async()=>{var se;try{const be=await(await fetch("/api/config")).json();(se=be.studio)!=null&&se.version&&d(`v${be.studio.version}`),t(be)}catch{}finally{u(!1)}},[]),m=p.useCallback(async()=>{try{const ge=await(await fetch("/api/health")).json();a(ge.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform})}catch{a({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS"})}},[h]),v=p.useCallback(async()=>{try{const ge=await(await fetch("/api/plugins")).json();i(ge)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),x=p.useCallback(async()=>{try{const ge=await(await fetch("/api/db")).json();l(ge)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),N=se=>{switch(se==null?void 0:se.toLowerCase()){case"postgresql":case"postgres":return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Connected"]});case"mysql":return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Pl,{className:"w-3 h-3"}),"Local"]});default:return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Or,{className:"w-3 h-3"}),"Unknown"]})}};p.useEffect(()=>{f(),m(),v(),x()},[f,x,v,m]);const b=se=>{switch(se.toLowerCase()){case"google":return r.jsx(la,{className:"w-5 h-5 text-white"});case"github":return r.jsx(Mn,{className:"w-5 h-5 text-white"});case"discord":return r.jsx(la,{className:"w-5 h-5 text-white"});case"twitter":return r.jsx(la,{className:"w-5 h-5 text-white"});default:return r.jsx(la,{className:"w-5 h-5 text-white"})}};return c?r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx(Ja,{className:"w-6 h-6 text-white animate-spin"})}):r.jsxs("div",{className:"space-y-8",children:[r.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Zl,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Application"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Basic application configuration"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"space-y-0 px-0 pb-0 border-b-none",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(la,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(yo,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-mono font-light text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Kl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-mono font-light text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Jt,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Database"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Database connection and configuration"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"space-y-0 px-0 pb-0 border-b-none",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((y=e==null?void 0:e.database)==null?void 0:y.type)&&((g=e==null?void 0:e.database)==null?void 0:g.type.charAt(0).toUpperCase())+((w=e==null?void 0:e.database)==null?void 0:w.type.slice(1))||"Unknown"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((S=e==null?void 0:e.database)==null?void 0:S.type))&&N((o==null?void 0:o.name)||((E=e==null?void 0:e.database)==null?void 0:E.type)||"")]}),((o==null?void 0:o.dialect)||((j=e==null?void 0:e.database)==null?void 0:j.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:((_=e==null?void 0:e.database)==null?void 0:_.dialect)||(o==null?void 0:o.dialect)})})]}),((M=e==null?void 0:e.database)==null?void 0:M.url)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(yo,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Configured"]})]}),((U=e==null?void 0:e.database)==null?void 0:U.casing)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Zl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(TN,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:e.database.debugLogs?r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Or,{className:"w-5 h-5 text-yellow-400"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Mn,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Providers"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Configured authentication providers"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsx(Na,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((se,ge)=>r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[b(se.type),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:se.type}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:se.clientId?"Configured":"Not configured"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:se.clientId?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Active"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Setup Required"]})})]},ge)):r.jsxs("div",{className:"text-center py-8",children:[r.jsx(Mn,{className:"w-8 h-8 text-white mx-auto mb-2"}),r.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Sc,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Email & Password"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Email authentication settings"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Sc,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(L=e==null?void 0:e.emailAndPassword)!=null&&L.enabled?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]})})]}),((F=e==null?void 0:e.emailAndPassword)==null?void 0:F.enabled)&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Bo,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(G=e==null?void 0:e.emailAndPassword)!=null&&G.disableSignUp?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(A=e==null?void 0:e.emailAndPassword)!=null&&A.requireEmailVerification?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Required"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Optional"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Kl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),r.jsx("div",{className:"text-right",children:r.jsxs("p",{className:"text-sm font-medium text-white",children:[((P=e==null?void 0:e.emailAndPassword)==null?void 0:P.minPasswordLength)||8," -"," ",((R=e==null?void 0:e.emailAndPassword)==null?void 0:R.maxPasswordLength)||128]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ql,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(k=e==null?void 0:e.emailAndPassword)!=null&&k.autoSignIn?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(_g,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Session"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Session management settings"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(_g,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(T=e==null?void 0:e.session)!=null&&T.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(TN,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ql,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(q=e==null?void 0:e.session)!=null&&q.disableSessionRefresh?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(C=e==null?void 0:e.session)!=null&&C.storeSessionInDatabase?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Pl,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Mn,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Rate Limiting"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"API rate limiting configuration"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(I=e==null?void 0:e.rateLimit)!=null&&I.enabled?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Disabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(_g,{className:"w-5 h-5 text-red-400"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(z=e==null?void 0:e.rateLimit)!=null&&z.window?`${e.rateLimit.window} seconds`:"10 seconds"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:((W=e==null?void 0:e.rateLimit)==null?void 0:W.max)||100}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((Y=e==null?void 0:e.rateLimit)==null?void 0:Y.storage)||"memory"})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Zl,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Advanced"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Advanced configuration options"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Kl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ae=e==null?void 0:e.advanced)!=null&&ae.useSecureCookies?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Disabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ne=e==null?void 0:e.advanced)!=null&&ne.disableCSRFCheck?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ms,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ie=(X=e==null?void 0:e.advanced)==null?void 0:X.ipAddress)!=null&&ie.disableIpTracking?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(IY,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ye=e==null?void 0:e.telemetry)!=null&&ye.enabled?r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Pl,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"System Info"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth Studio system information"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ql,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Pl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(la,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none lg:col-span-2",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(jT,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Plugins"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth plugins enabled in your configuration"]})]}),r.jsxs("div",{className:"pr-6",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(s==null?void 0:s.totalPlugins)||0}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsx(Na,{className:"space-y-0 px-0 pb-0 border-b-none",children:s!=null&&s.plugins&&s.plugins.length>0?r.jsxs(r.Fragment,{children:[s.plugins.map((se,ge)=>r.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${ge<s.plugins.length-1?"border-b border-white/15":""}`,children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(jT,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:se.name.slice(0,1).toUpperCase()+se.name.slice(1).replace("-"," ")}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:se.description})]})]}),r.jsx("div",{className:"text-right flex items-center space-x-2",children:r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400 flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]},se.id)),s.configPath&&r.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:r.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",r.jsx("span",{className:"text-white font-mono",children:s.configPath})]})})]}):r.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Or,{className:"w-5 h-5 text-yellow-400"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),r.jsx("p",{className:"text-xs text-gray-400",children:(s==null?void 0:s.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}const r4=e=>{if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":Yn(t,"dd MMM yyyy; HH:mm")};function s4(){var R,k;const{orgId:e,teamId:t}=Q1(),n=vr(),[a,s]=p.useState(null),[i,o]=p.useState([]),[l,c]=p.useState(!0),[u,h]=p.useState("details"),[d,f]=p.useState(!1),[m,v]=p.useState(!1),[x,N]=p.useState(""),[b,y]=p.useState([]),[g,w]=p.useState([]),[S,E]=p.useState({name:""}),j=p.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(s(D.team),E({name:D.team.name})):D.team?(s(D.team),E({name:D.team.name})):V.error("Team not found")}catch{V.error("Failed to load team")}finally{c(!1)}},[t]),_=p.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{V.error("Failed to load team members")}},[t]),M=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),q=i.map(I=>I.userId),C=(D.users||[]).filter(I=>!q.includes(I.id));y(C)}catch{V.error("Failed to load users")}};p.useEffect(()=>{t&&(j(),_())},[t,j,_]);const U=async()=>{if(!S.name){V.error("Please enter a team name");return}const T=V.loading("Updating team...");try{const q=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S.name})})).json();q.success?(await j(),v(!1),V.success("Team updated successfully!",{id:T})):V.error(`Error updating team: ${q.error||"Unknown error"}`,{id:T})}catch{V.error("Error updating team",{id:T})}},L=async()=>{if(g.length===0){V.error("Please select at least one user");return}const T=V.loading(`Adding ${g.length} members...`);try{const q=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:g})})).json();q.success?(await _(),f(!1),w([]),N(""),V.success(`Successfully added ${g.length} members!`,{id:T})):V.error(`Error adding members: ${q.error||"Unknown error"}`,{id:T})}catch{V.error("Error adding members",{id:T})}},F=async(T,D)=>{const q=V.loading(`Removing ${D}...`);try{const I=await(await fetch(`/api/team-members/${T}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();I.success?(await _(),V.success(`${D} removed from team!`,{id:q})):V.error(`Error removing member: ${I.error||"Unknown error"}`,{id:q})}catch{V.error("Error removing team member",{id:q})}},G=()=>{M(),f(!0)},A=T=>{w(D=>D.includes(T)?D.filter(q=>q!==T):[...D,T])},P=b.filter(T=>T.name.toLowerCase().includes(x.toLowerCase())||T.email.toLowerCase().includes(x.toLowerCase()));return l?r.jsx("div",{className:"flex items-center justify-center h-32",children:r.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[r.jsx(rn,{className:"w-6 h-6 text-white animate-spin"}),r.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):a?r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>n(`/organizations/${a.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{onClick:G,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Add Members"]}),r.jsxs($,{onClick:()=>v(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Po,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[a.name,r.jsx(on,{id:t,variant:"subscript",nonSliced:!0})]}),r.jsx("div",{className:"flex items-center space-x-2 mt-1",children:a.organization&&r.jsxs(J1,{to:`/organizations/${a.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[r.jsx(Ca,{className:"w-4 h-4 inline mr-1"}),a.organization.name]})})]})]}),r.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[r.jsx("div",{className:"border-b border-dashed border-white/20",children:r.jsxs("nav",{className:"flex space-x-8 px-6",children:[r.jsxs("button",{onClick:()=>h("details"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${u==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsx("span",{className:"font-mono uppercase text-xs font-normal",children:"Details"})]}),r.jsxs("button",{onClick:()=>h("members"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${u==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Members",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),r.jsxs("div",{className:"p-6",children:[u==="details"&&r.jsxs("div",{className:"space-y-6 overflow-x-hidden",children:[r.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"TEAM INFORMATION"}),r.jsx("hr",{className:"border-white/15 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),r.jsx("p",{className:"text-white font-sans mt-1",children:a.name})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),r.jsx("p",{className:"text-white font-sans mt-1",children:((R=a.organization)==null?void 0:R.name)||"Unknown"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),r.jsx("p",{className:"text-white font-sans mt-1",children:r4(a.createdAt)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),r.jsx("p",{className:"text-white font-sans mt-1",children:r4(a.updatedAt)})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ot,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:i.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(cr,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:Math.ceil((Date.now()-new Date(a.createdAt).getTime())/(1e3*60*60*24)),format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ca,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:1,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),u==="members"&&r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",r.jsx(An,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})]}),r.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:i.map(T=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 group",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("img",{src:T.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${T.user.id}`,alt:T.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light inline-flex items-center gap-2",children:[r.jsx("span",{children:T.user.name}),r.jsx("button",{onClick:D=>{D.stopPropagation(),n(`/users/${T.user.id}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View user details",children:r.jsx(yu,{className:"w-4 h-4"})})]}),r.jsx(on,{id:T.user.id})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:T.user.email}),r.jsx("td",{className:"py-4 px-4",children:r.jsx(Bt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:T.role})}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(T.joinedAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsx("div",{className:"flex items-center justify-end space-x-2",children:r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>F(T.id,T.user.name),children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},T.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),r.jsxs($,{onClick:G,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]})]})]}),d&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{f(!1),w([]),N("")},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(EU,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),r.jsx(Ne,{placeholder:"Search users by name or email...",value:x,onChange:T=>N(T.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),g.length>0&&r.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:r.jsxs("p",{className:"text-blue-400 text-sm",children:[g.length," user",g.length!==1?"s":""," selected"]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:P.length>0?r.jsx("div",{className:"divide-y divide-white/5",children:P.map(T=>r.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${g.includes(T.id)?"bg-blue-900/20":""}`,onClick:()=>A(T.id),children:[r.jsx("input",{type:"checkbox",checked:g.includes(T.id),onChange:()=>A(T.id),className:"rounded border-gray-300"}),r.jsx("img",{src:T.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${T.id}`,alt:T.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-white font-light",children:T.name}),r.jsx("div",{className:"text-sm text-gray-400",children:T.email})]})]},T.id))}):r.jsx("div",{className:"p-8 text-center",children:r.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{f(!1),w([]),N("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsxs($,{onClick:L,disabled:g.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Add ",g.length," Member",g.length!==1?"s":""]})]})]})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white inline-flex font-light",children:[a.name,r.jsx(on,{id:a.id,variant:"subscript"})]}),r.jsx("div",{className:"text-sm text-gray-400",children:(k=a.organization)==null?void 0:k.name})]})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),r.jsx(Ne,{id:"edit-team-name",value:S.name,onChange:T=>E({name:T.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:U,disabled:S.name===a.name,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),r.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function yfe(){const e=vr(),[t,n]=p.useState([]),[a,s]=p.useState(!0),[i,o]=p.useState(null),[l,c]=p.useState(""),[u,h]=p.useState("all"),[d,f]=p.useState(1),[m]=p.useState(20);p.useEffect(()=>{v();const S=setInterval(()=>{i!=null&&i.enabled||v()},2e3);return()=>clearInterval(S)},[i==null?void 0:i.enabled]);const v=async()=>{try{const E=await(await fetch("/api/plugins")).json(),j=(E==null?void 0:E.plugins).find(_=>_.id==="teams");o({enabled:!!j,availablePlugins:(E==null?void 0:E.plugins).map(_=>_.id),configPath:E.configPath,teamsPlugin:(E==null?void 0:E.plugins).find(_=>_.id==="teams")}),j?await x():s(!1)}catch(S){console.error("Failed to check teams plugin status:",S),o({enabled:!1,error:"Failed to check plugin status"}),s(!1)}},x=async()=>{try{const E=await(await fetch("/api/teams")).json();E.success&&n(E.teams||[])}catch(S){console.error("Failed to fetch teams:",S),V.error("Failed to load teams")}finally{s(!1)}},N=t.filter(S=>{var j;const E=S.name.toLowerCase().includes(l.toLowerCase())||((j=S.organization)==null?void 0:j.name.toLowerCase().includes(l.toLowerCase()));if(u==="all")return E;if(u==="recent"){const _=new Date;return _.setDate(_.getDate()-7),E&&new Date(S.createdAt)>_}return E}),b=d*m,y=b-m,g=N.slice(y,b),w=Math.ceil(N.length/m);return a?r.jsx("div",{className:"flex items-center justify-center min-h-screen",children:r.jsx(Ja,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:r.jsx(An,{value:N.length,className:"text-white font-mono text-sm",prefix:r.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),r.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[r.jsx(An,{value:N.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),r.jsxs("span",{children:["team",N.length!==1?"s":""," found"]})]})]}),r.jsx("div",{className:"flex items-center space-x-3",children:r.jsxs($,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[r.jsx(Pi,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsxs("div",{className:"relative flex-1 max-w-md",children:[r.jsx(Fo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),r.jsx(Ne,{type:"text",placeholder:"Search teams...",value:l,onChange:S=>c(S.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx($,{variant:u==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:u==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),r.jsx($,{variant:u==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:u==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),g.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Bo,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),r.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&r.jsxs($,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[r.jsx(Pi,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):r.jsx("div",{className:"grid gap-4",children:g.map(S=>{var E;return r.jsx("div",{className:"bg-black/30 border border-white/15 rounded-none p-4 hover:bg-black/40 transition-colors cursor-pointer",onClick:()=>e(`/teams/${S.id}`),children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:r.jsx(Bo,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-white font-medium",children:S.name}),r.jsxs("p",{className:"text-gray-400 text-sm",children:[(E=S.organization)==null?void 0:E.name," • ",S.memberCount||0," members"]})]})]}),r.jsx("div",{className:"flex items-center space-x-2",children:r.jsx(Bt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},S.id)})}),w>1&&r.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[r.jsx($,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,d-1)),disabled:d===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),r.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",d," of ",w]}),r.jsx($,{variant:"outline",size:"sm",onClick:()=>f(Math.min(w,d+1)),disabled:d===w,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),r.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:r.jsxs("div",{className:"flex items-start space-x-4",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx(Mr,{className:"w-12 h-12 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),r.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),r.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[r.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),r.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:r.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&r.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),r.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:r.jsxs("pre",{className:"text-sm text-gray-300",children:[r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth/plugins"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"export const"})," ",r.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",r.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",r.jsx("br",{}),r.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",r.jsx("br",{}),r.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),r.jsx("br",{}),r.jsx("span",{className:"pl-10",children:"]"})," ",r.jsx("br",{}),"}",") ",r.jsx("br",{})]})}),r.jsx("div",{className:"mt-4",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),r.jsx("div",{className:"mt-2",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),(i==null?void 0:i.availablePlugins)&&i.availablePlugins.length>0&&r.jsx("div",{className:"mb-4",children:r.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),r.jsx($,{onClick:v,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),r.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",r.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]})}function Ep(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}function g6(e,t,n){let a="",s=0,i=0;for(const o of e)for(s=s<<8|o,i+=8;i>=6;)i-=6,a+=t[s>>i&63];if(i>0&&(a+=t[s<<6-i&63]),n){const o=(4-a.length%4)%4;a+="=".repeat(o)}return a}function b6(e,t){const n=new Map;for(let o=0;o<t.length;o++)n.set(t[o],o);const a=[];let s=0,i=0;for(const o of e){if(o==="=")break;const l=n.get(o);if(l===void 0)throw new Error(`Invalid Base64 character: ${o}`);s=s<<6|l,i+=6,i>=8&&(i-=8,a.push(s>>i&255))}return Uint8Array.from(a)}const vfe={encode(e,t={}){const n=Ep(!1),a=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return g6(a,n,t.padding??!0)},decode(e){typeof e!="string"&&(e=new TextDecoder().decode(e));const t=e.includes("-")||e.includes("_"),n=Ep(t);return b6(e,n)}},wfe={encode(e,t={}){const n=Ep(!0),a=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return g6(a,n,t.padding??!0)},decode(e){const t=e.includes("-")||e.includes("_"),n=Ep(t);return b6(e,n)}};function Nfe(){const e=typeof globalThis<"u"&&globalThis.crypto;if(e&&typeof e.subtle=="object"&&e.subtle!=null)return e.subtle;throw new Error("crypto.subtle must be defined")}function Sfe(e,t){return{digest:async n=>{const a=new TextEncoder,s=typeof n=="string"?a.encode(n):n,i=await Nfe().digest(e,s);return t==="hex"?Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join(""):t==="base64"||t==="base64url"||t==="base64urlnopad"?t.includes("url")?wfe.encode(i,{padding:t!=="base64urlnopad"}):vfe.encode(i):i}}}function lw({value:e,onChange:t,language:n="typescript",placeholder:a="",className:s=""}){const i=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(e||a);p.useEffect(()=>{c(e||a)},[e,a]),p.useEffect(()=>{const x=i.current,N=o.current;if(x&&N){const b=()=>{N&&(N.scrollTop=x.scrollTop,N.scrollLeft=x.scrollLeft)};return x.addEventListener("scroll",b),()=>x.removeEventListener("scroll",b)}},[]);const u="12px",h="1.5",d="0.75rem",f='ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',m={...nc,'pre[class*="language-"]':{...nc['pre[class*="language-"]'],background:"transparent",padding:0,margin:0,borderRadius:0,overflow:"visible"},'code[class*="language-"]':{...nc['code[class*="language-"]'],background:"transparent",fontSize:u,lineHeight:h,fontFamily:f}},v={fontFamily:f,fontSize:u,lineHeight:h,padding:d,margin:0,border:"none",outline:"none",resize:"none",color:"transparent",caretColor:"#fff",background:"transparent",width:"100%",minHeight:"200px",overflow:"auto",tabSize:2};return r.jsxs("div",{className:`relative border border-dashed border-white/20 rounded-none focus-within:border-white/40 ${s}`,children:[r.jsx("div",{ref:o,className:"absolute inset-0 pointer-events-none overflow-auto",style:{padding:d,boxSizing:"border-box"},children:r.jsx(mE,{language:n,style:m,customStyle:{margin:0,padding:0,background:"transparent",minHeight:"200px"},codeTagProps:{style:{fontFamily:f,fontSize:u,lineHeight:h,display:"block"}},PreTag:({children:x,...N})=>r.jsx("pre",{...N,style:{margin:0,padding:0,background:"transparent",fontSize:u,lineHeight:h,fontFamily:f},children:x}),children:l})}),r.jsx("textarea",{ref:i,value:e,onChange:x=>t(x.target.value),placeholder:a,className:"relative w-full min-h-[200px] bg-transparent text-white font-mono text-xs rounded-none focus:outline-none resize-none",style:{...v,boxSizing:"border-box",position:"relative",zIndex:1},spellCheck:!1})]})}function x6(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Tm="Checkbox",[Efe]=Gs(Tm),[jfe,gE]=Efe(Tm);function Tfe(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:s,disabled:i,form:o,name:l,onCheckedChange:c,required:u,value:h="on",internal_do_not_use_render:d}=e,[f,m]=Bc({prop:n,defaultProp:s??!1,onChange:c,caller:Tm}),[v,x]=p.useState(null),[N,b]=p.useState(null),y=p.useRef(!1),g=v?!!o||!!v.closest("form"):!0,w={checked:f,disabled:i,setChecked:m,control:v,setControl:x,name:l,form:o,value:h,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Bi(s)?!1:s,isFormControl:g,bubbleInput:N,setBubbleInput:b};return r.jsx(jfe,{scope:t,...w,children:Cfe(d)?d(w):a})}var y6="CheckboxTrigger",v6=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},s)=>{const{control:i,value:o,disabled:l,checked:c,required:u,setControl:h,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:m,bubbleInput:v}=gE(y6,e),x=ln(s,h),N=p.useRef(c);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const y=()=>d(N.current);return b.addEventListener("reset",y),()=>b.removeEventListener("reset",y)}},[i,d]),r.jsx($t.button,{type:"button",role:"checkbox","aria-checked":Bi(c)?"mixed":c,"aria-required":u,"data-state":j6(c),"data-disabled":l?"":void 0,disabled:l,value:o,...a,ref:x,onKeyDown:St(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:St(n,b=>{d(y=>Bi(y)?!0:!y),v&&m&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});v6.displayName=y6;var bE=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:s,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:u,form:h,...d}=e;return r.jsx(Tfe,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:l,required:o,onCheckedChange:u,name:a,form:h,value:c,internal_do_not_use_render:({isFormControl:f})=>r.jsxs(r.Fragment,{children:[r.jsx(v6,{...d,ref:t,__scopeCheckbox:n}),f&&r.jsx(E6,{__scopeCheckbox:n})]})})});bE.displayName=Tm;var w6="CheckboxIndicator",N6=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...s}=e,i=gE(w6,n);return r.jsx(Vs,{present:a||Bi(i.checked)||i.checked===!0,children:r.jsx($t.span,{"data-state":j6(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});N6.displayName=w6;var S6="CheckboxBubbleInput",E6=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:l,disabled:c,name:u,value:h,form:d,bubbleInput:f,setBubbleInput:m}=gE(S6,e),v=ln(n,m),x=x6(i),N=TS(a);p.useEffect(()=>{const y=f;if(!y)return;const g=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(g,"checked").set,E=!s.current;if(x!==i&&S){const j=new Event("click",{bubbles:E});y.indeterminate=Bi(i),S.call(y,Bi(i)?!1:i),y.dispatchEvent(j)}},[f,x,i,s]);const b=p.useRef(Bi(i)?!1:i);return r.jsx($t.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:c,name:u,value:h,form:d,...t,tabIndex:-1,ref:v,style:{...t.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});E6.displayName=S6;function Cfe(e){return typeof e=="function"}function Bi(e){return e==="indeterminate"}function j6(e){return Bi(e)?"indeterminate":e?"checked":"unchecked"}const wf=p.forwardRef(({className:e,...t},n)=>r.jsx(bE,{ref:n,className:Ge("peer h-4 w-4 shrink-0 rounded-none border border-white/20 bg-black ring-offset-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-white data-[state=checked]:text-black data-[state=checked]:border-white",e),...t,children:r.jsx(N6,{className:Ge("flex items-center justify-center text-current"),children:r.jsx(vu,{className:"h-4 w-4"})})}));wf.displayName=bE.displayName;function kfe(e){const t=e+"CollectionProvider",[n,a]=Gs(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:N,children:b}=x,y=te.useRef(null),g=te.useRef(new Map).current;return r.jsx(s,{scope:N,itemMap:g,collectionRef:y,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=wu(l),u=te.forwardRef((x,N)=>{const{scope:b,children:y}=x,g=i(l,b),w=ln(N,g.collectionRef);return r.jsx(c,{ref:w,children:y})});u.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",f=wu(h),m=te.forwardRef((x,N)=>{const{scope:b,children:y,...g}=x,w=te.useRef(null),S=ln(N,w),E=i(h,b);return te.useEffect(()=>(E.itemMap.set(w,{ref:w,...g}),()=>void E.itemMap.delete(w))),r.jsx(f,{[d]:"",ref:S,children:y})});m.displayName=h;function v(x){const N=i(e+"CollectionConsumer",x);return te.useCallback(()=>{const y=N.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(N.itemMap.values()).sort((E,j)=>g.indexOf(E.ref.current)-g.indexOf(j.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},v,a]}var Afe=p.createContext(void 0);function T6(e){const t=p.useContext(Afe);return e||t||"ltr"}var cw="rovingFocusGroup.onEntryFocus",_fe={bubbles:!1,cancelable:!0},lh="RovingFocusGroup",[WN,C6,Rfe]=kfe(lh),[Ofe,k6]=Gs(lh,[Rfe]),[Dfe,Ife]=Ofe(lh),A6=p.forwardRef((e,t)=>r.jsx(WN.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(WN.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Mfe,{...e,ref:t})})}));A6.displayName=lh;var Mfe=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...d}=e,f=p.useRef(null),m=ln(t,f),v=T6(i),[x,N]=Bc({prop:o,defaultProp:l??null,onChange:c,caller:lh}),[b,y]=p.useState(!1),g=zo(u),w=C6(n),S=p.useRef(!1),[E,j]=p.useState(0);return p.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(cw,g),()=>_.removeEventListener(cw,g)},[g]),r.jsx(Dfe,{scope:n,orientation:a,dir:v,loop:s,currentTabStopId:x,onItemFocus:p.useCallback(_=>N(_),[N]),onItemShiftTab:p.useCallback(()=>y(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(_=>_+1),[]),onFocusableItemRemove:p.useCallback(()=>j(_=>_-1),[]),children:r.jsx($t.div,{tabIndex:b||E===0?-1:0,"data-orientation":a,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:St(e.onMouseDown,()=>{S.current=!0}),onFocus:St(e.onFocus,_=>{const M=!S.current;if(_.target===_.currentTarget&&M&&!b){const U=new CustomEvent(cw,_fe);if(_.currentTarget.dispatchEvent(U),!U.defaultPrevented){const L=w().filter(R=>R.focusable),F=L.find(R=>R.active),G=L.find(R=>R.id===x),P=[F,G,...L].filter(Boolean).map(R=>R.ref.current);O6(P,h)}}S.current=!1}),onBlur:St(e.onBlur,()=>y(!1))})})}),_6="RovingFocusGroupItem",R6=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:s=!1,tabStopId:i,children:o,...l}=e,c=er(),u=i||c,h=Ife(_6,n),d=h.currentTabStopId===u,f=C6(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:x}=h;return p.useEffect(()=>{if(a)return m(),()=>v()},[a,m,v]),r.jsx(WN.ItemSlot,{scope:n,id:u,focusable:a,active:s,children:r.jsx($t.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:St(e.onMouseDown,N=>{a?h.onItemFocus(u):N.preventDefault()}),onFocus:St(e.onFocus,()=>h.onItemFocus(u)),onKeyDown:St(e.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){h.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const b=Pfe(N,h.orientation,h.dir);if(b!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let g=f().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")g.reverse();else if(b==="prev"||b==="next"){b==="prev"&&g.reverse();const w=g.indexOf(N.currentTarget);g=h.loop?Ffe(g,w+1):g.slice(w+1)}setTimeout(()=>O6(g))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:x!=null}):o})})});R6.displayName=_6;var Lfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ufe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pfe(e,t,n){const a=Ufe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return Lfe[a]}function O6(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function Ffe(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var Bfe=A6,zfe=R6,xE="Radio",[$fe,D6]=Gs(xE),[Hfe,qfe]=$fe(xE),I6=p.forwardRef((e,t)=>{const{__scopeRadio:n,name:a,checked:s=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...h}=e,[d,f]=p.useState(null),m=ln(t,N=>f(N)),v=p.useRef(!1),x=d?u||!!d.closest("form"):!0;return r.jsxs(Hfe,{scope:n,checked:s,disabled:o,children:[r.jsx($t.button,{type:"button",role:"radio","aria-checked":s,"data-state":P6(s),"data-disabled":o?"":void 0,disabled:o,value:l,...h,ref:m,onClick:St(e.onClick,N=>{s||c==null||c(),x&&(v.current=N.isPropagationStopped(),v.current||N.stopPropagation())})}),x&&r.jsx(U6,{control:d,bubbles:!v.current,name:a,value:l,checked:s,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});I6.displayName=xE;var M6="RadioIndicator",L6=p.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:a,...s}=e,i=qfe(M6,n);return r.jsx(Vs,{present:a||i.checked,children:r.jsx($t.span,{"data-state":P6(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});L6.displayName=M6;var Gfe="RadioBubbleInput",U6=p.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:a=!0,...s},i)=>{const o=p.useRef(null),l=ln(o,i),c=x6(n),u=TS(t);return p.useEffect(()=>{const h=o.current;if(!h)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&m){const v=new Event("click",{bubbles:a});m.call(h,n),h.dispatchEvent(v)}},[c,n,a]),r.jsx($t.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});U6.displayName=Gfe;function P6(e){return e?"checked":"unchecked"}var Vfe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Cm="RadioGroup",[Yfe]=Gs(Cm,[k6,D6]),F6=k6(),B6=D6(),[Wfe,Xfe]=Yfe(Cm),z6=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:h=!0,onValueChange:d,...f}=e,m=F6(n),v=T6(u),[x,N]=Bc({prop:i,defaultProp:s??null,onChange:d,caller:Cm});return r.jsx(Wfe,{scope:n,name:a,required:o,disabled:l,value:x,onValueChange:N,children:r.jsx(Bfe,{asChild:!0,...m,orientation:c,dir:v,loop:h,children:r.jsx($t.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:v,...f,ref:t})})})});z6.displayName=Cm;var $6="RadioGroupItem",H6=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:a,...s}=e,i=Xfe($6,n),o=i.disabled||a,l=F6(n),c=B6(n),u=p.useRef(null),h=ln(t,u),d=i.value===s.value,f=p.useRef(!1);return p.useEffect(()=>{const m=x=>{Vfe.includes(x.key)&&(f.current=!0)},v=()=>f.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",v)}},[]),r.jsx(zfe,{asChild:!0,...l,focusable:!o,active:d,children:r.jsx(I6,{disabled:o,required:i.required,checked:d,...c,...s,name:i.name,ref:h,onCheck:()=>i.onValueChange(s.value),onKeyDown:St(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:St(s.onFocus,()=>{var m;f.current&&((m=u.current)==null||m.click())})})})});H6.displayName=$6;var Kfe="RadioGroupIndicator",q6=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...a}=e,s=B6(n);return r.jsx(L6,{...s,...a,ref:t})});q6.displayName=Kfe;var G6=z6,V6=H6,Zfe=q6;const XN=p.forwardRef(({className:e,...t},n)=>r.jsx(G6,{className:Ge("grid gap-2",e),...t,ref:n}));XN.displayName=G6.displayName;const Nl=p.forwardRef(({className:e,...t},n)=>r.jsx(V6,{ref:n,className:Ge("aspect-square h-4 w-4 rounded-none border border-white/20 bg-black text-white ring-offset-black focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-white data-[state=checked]:border-white",e),...t,children:r.jsx(Zfe,{className:"flex items-center justify-center",children:r.jsx("div",{className:"h-2 w-2 rounded-none bg-black"})})}));Nl.displayName=V6.displayName;const Y6=e=>{if(!e)return r.jsx(la,{className:"w-6 h-6 text-white"});const t=e.toLowerCase(),n="w-6 h-6 text-white";switch(t){case"github":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 15 15",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M7.5.25a7.25 7.25 0 0 0-2.292 14.13c.363.066.495-.158.495-.35c0-.172-.006-.628-.01-1.233c-2.016.438-2.442-.972-2.442-.972c-.33-.838-.805-1.06-.805-1.06c-.658-.45.05-.441.05-.441c.728.051 1.11.747 1.11.747c.647 1.108 1.697.788 2.11.602c.066-.468.254-.788.46-.969c-1.61-.183-3.302-.805-3.302-3.583a2.8 2.8 0 0 1 .747-1.945c-.075-.184-.324-.92.07-1.92c0 0 .61-.194 1.994.744A6.963 6.963 0 0 1 7.5 3.756A6.97 6.97 0 0 1 9.315 4c1.384-.938 1.992-.743 1.992-.743c.396.998.147 1.735.072 1.919c.465.507.745 1.153.745 1.945c0 2.785-1.695 3.398-3.31 3.577c.26.224.492.667.492 1.343c0 .97-.009 1.751-.009 1.989c0 .194.131.42.499.349A7.25 7.25 0 0 0 7.499.25",clipRule:"evenodd"})});case"google":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 56 56",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M28.458 5c6.167 0 11.346 2.2 15.368 5.804l.323.295l-6.62 6.464c-1.695-1.59-4.666-3.493-9.07-3.493c-6.204 0-11.47 4.093-13.372 9.749c-.47 1.46-.756 3.023-.756 4.64c0 1.615.287 3.18.782 4.639c1.877 5.656 7.142 9.748 13.345 9.748c3.347 0 5.928-.886 7.881-2.176l.251-.17l.307-.222c2.813-2.108 4.144-5.084 4.46-7.169l.03-.22h-12.93v-8.705h22.025c.339 1.46.495 2.867.495 4.795c0 7.142-2.554 13.163-6.985 17.255c-3.884 3.597-9.201 5.682-15.535 5.682c-9.031 0-16.85-5.102-20.772-12.57l-.184-.358l-.222-.457A23.45 23.45 0 0 1 5 28.458c0-3.6.827-7.01 2.28-10.073l.222-.457l.184-.357C11.608 10.1 19.426 5 28.458 5"})});case"apple":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M14.122 4.682c1.35 0 2.781.743 3.8 2.028c-3.34 1.851-2.797 6.674.578 7.963c-.465 1.04-.687 1.505-1.285 2.426c-.835 1.284-2.01 2.884-3.469 2.898c-1.295.012-1.628-.853-3.386-.843c-1.758.01-2.125.858-3.42.846c-1.458-.014-2.573-1.458-3.408-2.743C1.198 13.665.954 9.45 2.394 7.21C3.417 5.616 5.03 4.683 6.548 4.683c1.545 0 2.516.857 3.794.857c1.24 0 1.994-.858 3.78-.858M13.73 0c.18 1.215-.314 2.405-.963 3.247c-.695.902-1.892 1.601-3.05 1.565c-.21-1.163.332-2.36.99-3.167C11.43.755 12.67.074 13.73 0"})});case"discord":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M18.59 5.89c-1.23-.57-2.54-.99-3.92-1.23c-.17.3-.37.71-.5 1.04c-1.46-.22-2.91-.22-4.34 0c-.14-.33-.34-.74-.51-1.04c-1.38.24-2.69.66-3.92 1.23c-2.48 3.74-3.15 7.39-2.82 10.98c1.65 1.23 3.24 1.97 4.81 2.46c.39-.53.73-1.1 1.03-1.69c-.57-.21-1.11-.48-1.62-.79c.14-.1.27-.21.4-.31c3.13 1.46 6.52 1.46 9.61 0c.13.11.26.21.4.31c-.51.31-1.06.57-1.62.79c.3.59.64 1.16 1.03 1.69c1.57-.49 3.17-1.23 4.81-2.46c.39-4.17-.67-7.78-2.82-10.98Zm-9.75 8.78c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94s1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94m6.31 0c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94s1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94"})});case"facebook":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 64 64",fill:"#888888",children:r.jsx("path",{d:"M59.5 1h-55C2.5 1 1 2.6 1 4.5v55c0 2 1.6 3.5 3.5 3.5h29.6V38.9h-8v-9.3h8v-6.9c0-8 4.8-12.4 12-12.4c2.4 0 4.8.1 7.2.4V19h-4.8c-3.8 0-4.6 1.8-4.6 4.5v5.9H53l-1.3 9.4h-8v23.8h15.8c2 0 3.5-1.5 3.5-3.5V4.5c-.1-2-1.7-3.5-3.5-3.5"})});case"microsoft":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M2 3h9v9H2zm9 19H2v-9h9zM21 3v9h-9V3zm0 19h-9v-9h9z"})});case"twitter":case"x":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 448 512",fill:"currentColor",children:r.jsx("path",{d:"M64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64zm297.1 84L257.3 234.6L379.4 396h-95.6L209 298.1L123.3 396H75.8l111-126.9L69.7 116h98l67.7 89.5l78.2-89.5zm-37.8 251.6L153.4 142.9h-28.3l171.8 224.7h26.3z"})});case"linkedin":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 448 512",fill:"currentColor",children:r.jsx("path",{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"})});case"gitlab":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 32 32",fill:"currentColor",children:r.jsx("path",{d:"M28.568 12.893l-.037-.094l-3.539-9.235a.92.92 0 0 0-.364-.439a.95.95 0 0 0-1.083.058a.95.95 0 0 0-.314.477l-2.39 7.31h-9.675l-2.39-7.31a.93.93 0 0 0-.313-.478a.95.95 0 0 0-1.083-.058a.93.93 0 0 0-.365.438L3.47 12.794l-.035.093a6.57 6.57 0 0 0 2.18 7.595l.011.01l.033.022l5.39 4.037l2.668 2.019l1.624 1.226c.39.297.931.297 1.322 0l1.624-1.226l2.667-2.019l5.424-4.061l.013-.01a6.574 6.574 0 0 0 2.177-7.588Z"})});case"reddit":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 32 32",fill:"currentColor",children:r.jsx("path",{d:"M16 0C7.164 0 0 7.164 0 16s7.164 16 16 16s16-7.164 16-16S24.836 0 16 0m8.5 10.5a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m-17 0a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m1.5 6.5c0 1.5 1.5 2.5 3 2.5c.5 0 1-.1 1.5-.3c.5.6 1.2 1 2 1c.8 0 1.5-.4 2-1c.5.2 1 .3 1.5.3c1.5 0 3-1 3-2.5c0-1.5-1.5-2.5-3-2.5c-.5 0-1 .1-1.5.3c-.5-.6-1.2-1-2-1c-.8 0-1.5.4-2 1c-.5-.2-1-.3-1.5-.3c-1.5 0-3 1-3 2.5"})});case"spotify":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 256 256",fill:"currentColor",children:r.jsx("path",{d:"M128 0C57.308 0 0 57.309 0 128c0 70.696 57.309 128 128 128 70.697 0 128-57.304 128-32.3C256 57.314 198.697.007 127.998.007l.001-.006Zm58.699 184.614c-2.293 3.76-7.215 4.952-10.975 2.644c-30.053-18.357-67.885-22.515-112.44-12.335a7.981 7.981 0 0 1-9.552-6.007 7.968 7.968 0 0 1 6-9.553c48.76-11.14 90.583-6.344 124.323 14.276 3.76 2.308 4.952 7.215 2.644 10.975Zm15.667-34.853c-2.89 4.695-9.034 6.178-13.726 3.289c-34.406-21.148-86.853-27.273-127.548-14.92c-5.278 1.594-10.852-1.38-12.454-6.649c-1.59-5.278 1.386-10.842 6.655-12.446c46.485-14.106 104.275-7.273 143.787 17.007c4.692 2.89 6.175 9.034 3.286 13.72v-.001Zm1.345-36.293C162.457 88.964 94.394 86.71 55.007 98.666c-6.325 1.918-13.014-1.653-14.93-7.978c-1.917-6.328 1.65-13.012 7.98-14.935C93.27 62.027 168.434 64.68 215.929 92.876c5.702 3.376 7.566 10.724 4.188 16.405c-3.362 5.69-10.73 7.565-16.4 4.187h-.006Z"})});case"slack":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2447.6 2452.5",className:n,fill:"currentColor",children:r.jsxs("g",{fill:"currentColor",children:[r.jsx("path",{d:"m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z"}),r.jsx("path",{d:"m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2c-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2c-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z"}),r.jsx("path",{d:"m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z"}),r.jsx("path",{d:"M0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3c-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0"})]})});case"notion":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.28c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514c-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933z"})});case"tiktok":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M19.589 6.686a4.793 4.793 0 0 1-3.77-4.245V2h-3.445v13.672a2.896 2.896 0 0 1-5.201 1.743l-.002-.001.002.001a2.895 2.895 0 0 1 3.183-4.51v-3.5a6.329 6.329 0 0 0-5.394 10.692 6.33 6.33 0 0 0 10.857-4.424V8.687a8.182 8.182 0 0 0 4.773 1.526V6.79a4.831 4.831 0 0 1-1.003-.104z"})});case"twitch":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M3.9 2.5a.9.9 0 0 0-.9.9v14.194a.9.9 0 0 0 .9.9h4.116v3.03a.7.7 0 0 0 1.194.494l3.525-3.524h4.643a.9.9 0 0 0 .636-.264l2.722-2.722a.9.9 0 0 0 .264-.636V3.4a.9.9 0 0 0-.9-.9zm7.319 5.2a.75.75 0 0 0-1.5 0v4.272a.75.75 0 1 0 1.5 0zm5.016 0a.75.75 0 0 0-1.5 0v4.272a.75.75 0 1 0 1.5 0z",clipRule:"evenodd"})});case"dropbox":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 528 512",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M264.4 116.3l-132 84.3 132 84.3-132 84.3L0 284.1l132.3-84.3L0 116.3 132.3 32l132.1 84.3zM131.6 395.7l132-84.3 132 84.3-132 84.3-132-84.3zm132.8-111.6l132-84.3-132-83.6L395.7 32 528 116.3l-132.3 84.3L528 284.8l-132.3 84.3-131.3-85z"})});case"linear":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"1.2em",height:"1.2em",viewBox:"0 0 100 100",children:r.jsx("path",{fill:"currentColor",d:"M1.22541 61.5228c-.2225-.9485.90748-1.5459 1.59638-.857L39.3342 97.1782c.6889.6889.0915 1.8189-.857 1.5964C20.0515 94.4522 5.54779 79.9485 1.22541 61.5228ZM.00189135 46.8891c-.01764375.2833.08887215.5599.28957165.7606L52.3503 99.7085c.2007.2007.4773.3075.7606.2896 2.3692-.1476 4.6938-.46 6.9624-.9259c.7645-.157 1.0301-1.0963.4782-1.6481L2.57595 39.4485c-.55186-.5519-1.49117-.2863-1.648174.4782-.465915 2.2686-.77832 4.5932-.92588465 6.9624ZM4.21093 29.7054c-.16649.3738-.08169.8106.20765 1.1l64.77602 64.776c.2894.2894.7262.3742 1.1.2077 1.7861-.7956 3.5171-1.6927 5.1855-2.684c.5521-.328.6373-1.0867.1832-1.5407L8.43566 24.3367c-.45409-.4541-1.21271-.3689-1.54074.1832-.99132 1.6684-1.88843 3.3994-2.68399 5.1855ZM12.6587 18.074c-.3701-.3701-.393-.9637-.0443-1.3541C21.7795 6.45931 35.1114 0 49.9519 0 77.5927 0 100 22.4073 100 50.0481c0 14.8405-6.4593 28.1724-16.7199 37.3375-.3903.3487-.984.3258-1.3542-.0443L12.6587 18.074Z"})});case"huggingface":case"hugging face":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378c0 1.112.178 2.181.503 3.185c.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284c.278.173.48.408.71.694c.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542c.01.026.653 1.552 1.657 2.54c.616.605 1.01 1.223 1.082 1.912c.055.537-.096 1.059-.38 1.572c.637.121 1.294.187 1.967.187c.657 0 1.298-.063 1.921-.178c-.287-.517-.44-1.041-.384-1.581c.07-.69.465-1.307 1.081-1.913c1.004-.987 1.647-2.513 1.657-2.539c.021-.074.083-.285.233-.542c.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952c.23-.286.432-.52.71-.694c.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174a1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094c-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71c-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013a1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921a.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164c1.607-.007 2.984-1.155 3.572-1.164c.196-.003.305.12.305.454c0 .886-.424 2.328-1.563 3.202c-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026l-.01.008l-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116a1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243a1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444c-.034-.016-.104-.008-.2.022q-.094.03-.216.087q-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096a3 3 0 0 0-.26.219a2 2 0 0 0-.12.121a2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203c0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194c-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858s-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64c-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647s2.822 2.813 2.562 3.244s-1.176-.506-1.176-.506s-2.866-2.567-3.49-1.898s.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405c-.238.839-2.71-1.587-3.216-.642c-.506.946 3.49 2.056 3.522 2.064c1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194c1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858s.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64c.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647s-2.822 2.813-2.562 3.244s1.176-.506 1.176-.506s2.866-2.567 3.49-1.898s-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405c.238.839 2.71-1.587 3.216-.642c.506.946-3.49 2.056-3.522 2.064c-1.29.33-4.568 1.028-5.713-.624"})});case"kick":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"#888888",children:r.jsx("path",{d:"M9 3a1 1 0 0 1 1 1v3h1V6a1 1 0 0 1 .883-.993L12 5h1V4a1 1 0 0 1 .883-.993L14 3h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-1v1a1 1 0 0 1-.883.993L18 11h-1v2h1a1 1 0 0 1 .993.883L19 14v1h1a1 1 0 0 1 .993.883L21 16v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1h-1a1 1 0 0 1-.993-.883L11 18v-1h-1v3a1 1 0 0 1-.883.993L9 21H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"})});case"zoom":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M1.45 3.334C.648 3.334 0 3.982 0 4.783v4.986c0 1.6 1.298 2.898 2.898 2.898h6.986c.8 0 1.45-.649 1.45-1.45V6.233a2.9 2.9 0 0 0-2.899-2.899zM16 4.643v6.715c0 .544-.618.86-1.059.539l-2.059-1.498a1.33 1.33 0 0 1-.549-1.078V6.679c0-.427.204-.827.55-1.078l2.058-1.498a.667.667 0 0 1 1.059.54",clipRule:"evenodd"})});case"vk":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M17.802 12.298s1.617 1.597 2.017 2.336a.1.1 0 0 1 .018.035q.244.409.123.645c-.135.261-.592.392-.747.403h-2.858c-.199 0-.613-.052-1.117-.4c-.385-.269-.768-.712-1.139-1.145c-.554-.643-1.033-1.201-1.518-1.201a.6.6 0 0 0-.18.03c-.367.116-.833.639-.833 2.032c0 .436-.344.684-.585.684H9.674c-.446 0-2.768-.156-4.827-2.327C2.324 10.732.058 5.4.036 5.353c-.141-.345.155-.533.475-.533h2.886c.387 0 .513.234.601.444c.102.241.48 1.205 1.1 2.288c1.004 1.762 1.621 2.479 2.114 2.479a.53.53 0 0 0 .264-.07c.644-.354.524-2.654.494-3.128c0-.092-.001-1.027-.331-1.479c-.236-.324-.638-.45-.881-.496c.065-.094.203-.238.38-.323c.441-.22 1.238-.252 2.029-.252h.439c.858.012 1.08.067 1.392.146c.628.15.64.557.585 1.943c-.016.396-.033.842-.033 1.367c0 .112-.005.237-.005.364c-.019.711-.044 1.512.458 1.841a.4.4 0 0 0 .217.062c.174 0 .695 0 2.108-2.425c.62-1.071 1.1-2.334 1.133-2.429c.028-.053.112-.202.214-.262a.5.5 0 0 1 .236-.056h3.395c.37 0 .621.056.67.196c.082.227-.016.92-1.566 3.016c-.261.349-.49.651-.691.915c-1.405 1.844-1.405 1.937.083 3.337",clipRule:"evenodd"})});case"roblox":return r.jsx("svg",{version:"1.1",id:"svg10",x:"0px",y:"0px",viewBox:"0 0 302.7 302.7",width:"1.2em",height:"1.2em",fill:"currentColor",children:r.jsx("path",{id:"path20",d:"M120.5,271.7c-110.9-28.6-120-31-119.9-31.5C0.7,239.6,62.1,0.5,62.2,0.4c0,0,54,13.8,119.9,30.8S302.1,62,302.2,62c0.2,0,0.2,0.4,0.1,0.9c-0.2,1.5-61.5,239.3-61.7,239.5C240.6,302.5,186.5,288.7,120.5,271.7z M174.9,158c3.2-12.6,5.9-23.1,6-23.4c0.1-0.5-2.3-1.2-23.2-6.6c-12.8-3.3-23.5-5.9-23.6-5.8c-0.3,0.3-12.1,46.6-12,46.7c0.2,0.2,46.7,12.2,46.8,12.1C168.9,180.9,171.6,170.6,174.9,158L174.9,158z"})});default:return r.jsx(la,{className:"w-6 h-6 text-white"})}},dw=`// Example custom migration script
|
|
928
|
+
});`}[de]||""},be=de=>{navigator.clipboard.writeText(de),V.success("Copied to clipboard")},Ue=Object.values(aa).filter(de=>c==="all"||de.category===c);return r.jsxs("div",{className:"h-full flex flex-col bg-black",children:[r.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:r.jsxs("div",{className:"pb-8",children:[r.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Emails"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Customize your email templates with a visual editor"})]})}),r.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsx("hr",{className:"w-full border-white/15 h-px"})]}),r.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[r.jsxs("div",{className:"w-[340px] border-r border-dashed border-white/15 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-dashed border-white/15 flex-shrink-0",children:[r.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider mb-4",children:"Templates"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:["all","authentication","organization","notification"].map(de=>r.jsx("button",{onClick:()=>u(de),className:`px-2 py-1 text-[10px] font-mono uppercase border border-dashed rounded-none transition-colors ${c===de?"border-white/30 bg-white/5 text-white":"border-white/10 bg-black/40 text-gray-300 hover:border-white/20"}`,children:de},de))})]}),r.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-2",style:{overscrollBehavior:"contain"},children:Ue.map(de=>r.jsxs("button",{onClick:()=>W(de.id),className:`w-full text-left p-3 border border-dashed rounded-none transition-colors ${e===de.id?"border-white/30 bg-white/5 text-white":"border-white/15 bg-black/40 text-gray-300 hover:border-white/20 hover:bg-white/5"}`,children:[r.jsx("div",{className:"text-sm uppercase font-mono",children:de.name}),r.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[de.fields.length," fields"]})]},de.id))})]}),r.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:e?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"border-b border-dashed border-white/15 p-4 flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-light text-white uppercase tracking-wider",children:(Be=aa[e])==null?void 0:Be.name}),r.jsx("p",{className:"text-xs text-gray-400 font-mono mt-1",children:($e=aa[e])==null?void 0:$e.category})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs($,{variant:"outline",onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(c3,{className:"w-4 h-4 mr-2"}),"Test Email"]}),r.jsxs($,{variant:"outline",onClick:()=>{ge(e)&&l(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(hi,{className:"w-4 h-4 mr-2"}),"Export Code"]}),r.jsxs($,{variant:"outline",onClick:()=>be(n),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(Nc,{className:"w-4 h-4 mr-2"}),"Copy HTML"]})]})]}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"p-4 border-b border-dashed border-white/10 bg-black/40",children:r.jsxs("div",{className:"flex items-end gap-4",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Subject"}),r.jsx(Ne,{value:s,onChange:de=>ae(de.target.value),placeholder:"Email subject",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-sm"})]}),r.jsxs($,{variant:"outline",onClick:()=>m(!f),className:"h-10 border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[f?"Hide":"Show"," Fields"]})]})}),f&&e&&r.jsxs("div",{className:"p-4 border-b overflow-hidden border-dashed border-white/10 bg-black/30",children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Fields"}),r.jsx("div",{className:"grid grid-cols-2 gap-3 max-h-full overflow-y-hidden",children:(Ye=aa[e])==null?void 0:Ye.fields.map(de=>r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs font-mono text-gray-400 mb-1 block",children:de}),r.jsx(Ne,{value:h[de]||"",onChange:Fe=>d(Ie=>({...Ie,[de]:Fe.target.value})),placeholder:`{{${de}}}`,className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"})]},de))}),r.jsx("div",{className:"mt-4 flex justify-end",children:r.jsx($,{variant:"outline",onClick:ye,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Apply Changes"})})]}),e&&r.jsxs("div",{className:"p-4 border-b border-dashed border-white/10 bg-black/40",children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Dynamic Fields"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:(mt=aa[e])==null?void 0:mt.fields.map(de=>r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx($,{variant:"ghost",size:"sm",onClick:()=>be(`{{${de}}}`),className:"text-xs rounded-none border border-dashed border-white/20 hover:bg-white/10",children:de}),r.jsx("span",{className:"text-xs text-gray-500 font-mono",children:`{{${de}}}`})]},de))})]}),r.jsx("div",{className:"flex-1 overflow-hidden",children:r.jsx(ffe,{html:se,onChange:Y})})]})]}):r.jsx("div",{className:"flex-1 flex items-center justify-center min-h-0",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Sc,{className:"w-16 h-16 text-white/20 mx-auto mb-4"}),r.jsx("p",{className:"text-gray-400 font-mono uppercase text-sm",children:"Select a template to start editing"})]})})})]}),o&&e&&r.jsx("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 overflow-hidden",onClick:de=>{de.target===de.currentTarget&&l(!1)},children:r.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-0 w-full max-w-5xl max-h-[90vh] overflow-hidden flex flex-col",onClick:de=>de.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-0 pt-2 border-white/15 border-b-0 bg-black/50",children:[r.jsx("div",{className:"flex items-center justify-between p-2 pt-2",children:r.jsxs("div",{className:"pb-2",children:[r.jsx("h1",{className:"text-xl font-normal uppercase text-white tracking-tight",children:"Export"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Export the code for the selected template"})]})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"flex flex-col items-center justify-center",children:[r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsx("div",{className:"relative z-20 h-8 w-[calc(100%)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#e0f2fe,#e0f2fe_1px,transparent_1px,transparent_6px)] opacity-[8%]"}),r.jsx("hr",{className:"w-full border-white/15 h-px"})]}),r.jsx("div",{className:"flex-1 overflow-auto p-6 bg-black",children:r.jsx(m6,{code:ge(e),language:"typescript",fileName:"auth.ts"})}),r.jsx("div",{className:"flex items-center justify-end p-6 border-t border-white/15 bg-black/50",children:r.jsx($,{onClick:ne,disabled:N,className:"bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs px-6 py-2",children:N?"Applying...":"Apply to auth config"})})]})}),y&&e&&r.jsx("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 overflow-hidden",onClick:de=>{de.target===de.currentTarget&&g(!1)},children:r.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-0 w-full max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",onClick:de=>de.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-white/15 border-b bg-black/50",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-normal uppercase text-white tracking-tight",children:"Setup Required"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Install Resend before applying email template"})]})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"flex-1 overflow-auto p-8 bg-black",children:r.jsx("div",{className:"space-y-6",children:r.jsxs("div",{children:[r.jsx("h2",{className:"text-md font-mono uppercase font-normal text-white mb-3",children:"Install Resend"}),r.jsx("p",{className:"text-gray-300 mb-4 font-sans leading-relaxed",children:"You need to install the Resend package to send emails. Run the following command in your terminal:"}),r.jsx("div",{className:"bg-black/80 border border-dashed border-white/20 p-2 pl-3 rounded-none font-mono text-sm relative group",children:r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsxs("code",{className:"text-gray-200",children:[r.jsx("span",{className:"text-white",children:"$"})," ",r.jsx("span",{className:"text-blue-600",children:"pnpm"})," ",r.jsx("span",{className:"text-white",children:"install"})," ",r.jsx("span",{className:"text-white",children:"resend"})]}),r.jsx("button",{onClick:()=>{navigator.clipboard.writeText("pnpm install resend"),S(!0),setTimeout(()=>S(!1),2e3)},className:"flex items-center gap-2 px-2 py-1.5 rounded-none transition-colors text-gray-300 hover:text-white",title:"Copy command",children:w?r.jsx(r.Fragment,{children:r.jsx(Td,{className:"w-4 h-4"})}):r.jsx(r.Fragment,{children:r.jsx(Nc,{className:"w-4 h-4"})})})]})})]})})}),r.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/15 bg-black/50",children:[r.jsx($,{variant:"ghost",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none font-mono uppercase text-xs px-6 py-2",children:"Cancel"}),r.jsx($,{onClick:()=>X(e),disabled:N,className:"bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs px-6 py-2",children:N?"Applying...":"Continue"})]})]})}),E&&e&&r.jsx("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 overflow-hidden",onClick:de=>{de.target===de.currentTarget&&j(!1)},children:r.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-0 w-full max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",onClick:de=>de.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-white/15 border-b bg-black/50",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-normal uppercase text-white tracking-tight",children:"Test Email"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Send a test email with dynamic values"})]})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"flex-1 overflow-auto p-8 bg-black",children:r.jsxs("div",{className:"space-y-6",children:[A==="checking"&&r.jsx("div",{className:"bg-black/90 flex border p-4 rounded-none border-dashed border-white/20",children:r.jsxs("p",{className:"text-white text-sm font-sans flex items-center gap-2 leading-relaxed",children:[r.jsx(Ja,{className:"w-4 h-4 animate-spin mr-1"})," Checking for RESEND_API_KEY..."]})}),A==="missing"&&r.jsxs("div",{className:"bg-red-900/20 border border-red-500/30 border-dashed p-4 rounded-none",children:[r.jsx("p",{className:"text-red-200 text-sm font-sans leading-relaxed mb-2",children:r.jsx("strong",{className:"font-normal uppercase font-mono",children:"RESEND_API_KEY not found"})}),r.jsxs("p",{className:"text-red-200 text-sm font-sans leading-relaxed",children:["Please add"," ",r.jsx("code",{className:"bg-black/50 px-1 py-0.5 rounded font-mono text-xs",children:"RESEND_API_KEY"})," ","to your"," ",r.jsx("code",{className:"bg-black/50 px-1 py-0.5 rounded font-mono text-xs",children:".env"})," ","file."]})]}),A==="found"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"From Email (Verified Sender) *"}),R.length>0?r.jsx("select",{value:T,onChange:de=>D(de.target.value),className:"w-full bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs p-2 focus:outline-none focus:border-white/40",children:R.map(de=>r.jsx("option",{value:de,children:de},de))}):r.jsx(Ne,{type:"email",value:T,onChange:de=>D(de.target.value),placeholder:"noreply@yourdomain.com",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:R.length>0?"Select a verified sender email from your Resend account":"Enter a verified sender email address from your Resend account"})]}),r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Subject *"}),r.jsx(Ne,{type:"text",value:q,onChange:de=>C(de.target.value),placeholder:"Email subject",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:"Email subject line (supports dynamic placeholders)"})]}),r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"To Email Address *"}),r.jsx(Ne,{type:"email",value:_,onChange:de=>M(de.target.value),placeholder:"recipient@example.com",className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:"Any email address to receive the test email"})]}),((Ke=aa[e])==null?void 0:Ke.fields)&&aa[e].fields.length>0&&r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Dynamic Values"}),r.jsx("div",{className:"space-y-3",children:aa[e].fields.map(de=>r.jsxs("div",{children:[r.jsx(ce,{className:"text-xs uppercase font-mono text-gray-500 mb-1 block",children:de}),r.jsx(Ne,{value:U[de]||"",onChange:Fe=>L({...U,[de]:Fe.target.value}),placeholder:`Enter ${de}`,className:"bg-black border border-dashed border-white/20 text-white rounded-none font-mono text-xs"})]},de))})]})]})]})}),r.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-white/15 bg-black/50",children:[r.jsx($,{variant:"ghost",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none font-mono uppercase text-xs px-6 py-2",children:"Cancel"}),r.jsx($,{onClick:z,disabled:F||A!=="found"||!_||!T||!q,className:"bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs px-6 py-2 disabled:opacity-50 disabled:cursor-not-allowed",children:F?"Sending...":"Send Test Email"})]})]})})]})}const mfe=P5("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-white text-black hover:bg-white",secondary:"border-transparent bg-gray-800 text-white hover:bg-gray-800 border border-gray-600",destructive:"border-transparent bg-red-500 text-white hover:bg-red-600",outline:"text-gray-300 border-gray-600",success:"border-transparent bg-green-900 text-green-300",warning:"border-transparent bg-yellow-900 text-yellow-300",error:"border-transparent bg-red-900 text-red-300",info:"border-transparent bg-gray-800 text-white border border-gray-600"}},defaultVariants:{variant:"default"}});function Bt({className:e,variant:t,...n}){return r.jsx("div",{className:Ge(mfe({variant:t}),e),...n})}function gfe(){const{orgId:e}=Q1(),t=vr(),[n,a]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState([]),[h,d]=p.useState(!0),[f,m]=p.useState("details"),[v,x]=p.useState(!1),[N,b]=p.useState(!1),[y,g]=p.useState(!1),[w,S]=p.useState(!1),[E,j]=p.useState(!1),[_,M]=p.useState(!1),[U,L]=p.useState(!1),[F,G]=p.useState(!1),[A,P]=p.useState(!1),[R,k]=p.useState(null),[T,D]=p.useState({name:"",slug:""}),[q,C]=p.useState(""),[I,z]=p.useState(""),[W,Y]=p.useState([]),[ae,ne]=p.useState({name:""}),[X,ie]=p.useState(!1),[ye,se]=p.useState([]),[ge,be]=p.useState(!1),[Ue,Be]=p.useState([]),[$e,Ye]=p.useState(!1);p.useEffect(()=>{e&&(Ke(),Fe(),de(),_e(),We(),Ie());const Q=setInterval(()=>{!N&&e&&Fe()},2e3);return()=>clearInterval(Q)},[e,N]),p.useEffect(()=>{v&&e&&Ie()},[]),p.useEffect(()=>{f==="members"&&e&&We()},[f,e]),p.useEffect(()=>{f==="invitations"&&e&&_e()},[f,e]);const mt=Q=>{ne({name:Q})},Ke=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}`)).json();Z.success&&Z.organization||Z.organization?a(Z.organization):V.error("Organization not found")}catch(Q){console.error("Failed to fetch organization:",Q),V.error("Failed to load organization")}finally{d(!1)}},de=async()=>{try{const Z=await(await fetch("/api/plugins/teams/status")).json();x(Z.enabled)}catch(Q){console.error("Failed to check teams status:",Q),x(!1)}},Fe=async()=>{try{const Z=await(await fetch("/api/plugins/organization/status")).json();b(Z.enabled)}catch(Q){console.error("Failed to check organization status:",Q),b(!1)}},Ie=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}/teams`)).json();Z.success&&i(Z.teams||[])}catch(Q){console.error("Failed to fetch teams:",Q),V.error("Failed to load teams")}},_e=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}/invitations`)).json();Z.success&&l(Z.invitations||[])}catch(Q){console.error("Failed to fetch invitations:",Q),V.error("Failed to load invitations")}},We=async()=>{try{const Z=await(await fetch(`/api/organizations/${e}/members`)).json();Z.success&&u(Z.members||[])}catch(Q){console.error("Failed to fetch members:",Q),V.error("Failed to load members")}},at=async Q=>{se([]),be(!0),se([{id:"start",type:"info",message:`Starting member seeding process for ${Q} members...`,timestamp:new Date}]);try{const je=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Q})})).json();if(je.success){const Qe=je.results.map((ct,it)=>ct.success?{id:`member-${it}`,type:"progress",message:`Adding member: ${ct.member.user.name} (${ct.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${it}`,type:"error",message:`Failed to add member ${it+1}: ${ct.error}`,timestamp:new Date});se(ct=>[...ct,...Qe]);const st=je.results.filter(ct=>ct.success).length;se(ct=>[...ct,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${st}/${Q} members successfully`,timestamp:new Date}]),await We(),V.success(`Successfully added ${st} members!`)}else se(Qe=>[...Qe,{id:"error",type:"error",message:`❌ Seeding failed: ${je.error||"Unknown error"}`,timestamp:new Date}]),V.error(je.error||"Failed to seed members")}catch(Z){se(je=>[...je,{id:"error",type:"error",message:`❌ Network error: ${Z}`,timestamp:new Date}]),V.error("Failed to seed members")}finally{be(!1)}},ft=async Q=>{Be([]),Ye(!0),Be([{id:"start",type:"info",message:`Starting team seeding process for ${Q} teams...`,timestamp:new Date}]);try{const je=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Q})})).json();if(je.success){const Qe=je.results.map((ct,it)=>ct.success?{id:`team-${it}`,type:"progress",message:`Creating team: ${ct.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${it}`,type:"error",message:`Failed to create team ${it+1}: ${ct.error}`,timestamp:new Date});Be(ct=>[...ct,...Qe]);const st=je.results.filter(ct=>ct.success).length;Be(ct=>[...ct,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${st}/${Q} teams successfully`,timestamp:new Date}]),await Ie(),V.success(`Successfully created ${st} teams!`)}else Be(Qe=>[...Qe,{id:"error",type:"error",message:`❌ Seeding failed: ${je.error||"Unknown error"}`,timestamp:new Date}]),V.error(je.error||"Failed to seed teams")}catch(Z){Be(je=>[...je,{id:"error",type:"error",message:`❌ Network error: ${Z}`,timestamp:new Date}]),V.error("Failed to seed teams")}finally{Ye(!1)}},Yt=async()=>{try{const Z=await(await fetch("/api/users/all")).json();Z.success&&Y(Z.users||[])}catch(Q){console.error("Failed to fetch users:",Q)}},Wt=Q=>Q.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),oe=()=>{n&&(D({name:n.name,slug:n.slug}),P(!0))},ke=Q=>{const Z=Wt(Q);D({name:Q,slug:Z})},Ze=Q=>{D(Z=>({...Z,slug:Wt(Q)}))},K=async()=>{if(!n){V.error("No organization selected");return}if(!T.name){V.error("Please fill in the organization name");return}const Q=V.loading("Updating organization...");try{const je=await(await fetch(`/api/organizations/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T.name,slug:T.slug})})).json();je.success?(await Ke(),P(!1),D({name:"",slug:""}),V.success("Organization updated successfully!",{id:Q})):V.error(`Error updating organization: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error updating organization:",Z),V.error("Error updating organization",{id:Q})}},pe=()=>{Yt(),g(!0)},ve=async()=>{if(!q){V.error("Please enter an email address");return}if(!I){V.error("Please select an inviter");return}ie(!0);const Q=V.loading("Sending invitation...");try{const je=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:q,role:"member",inviterId:I})})).json();je.success?(await _e(),g(!1),C(""),z(""),V.success("Invitation sent successfully!",{id:Q})):V.error(`Error sending invitation: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error sending invitation:",Z),V.error("Error sending invitation",{id:Q})}finally{ie(!1)}},Te=async Q=>{const Z=V.loading("Cancelling invitation...");try{const Qe=await(await fetch(`/api/invitations/${Q}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Qe.success?(await _e(),V.success("Invitation cancelled successfully!",{id:Z})):V.error(`Error cancelling invitation: ${Qe.error||"Unknown error"}`,{id:Z})}catch(je){console.error("Error cancelling invitation:",je),V.error("Error cancelling invitation",{id:Z})}},ze=async(Q,Z)=>{const je=V.loading("Resending invitation...");try{const st=await(await fetch(`/api/invitations/${Q}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();st.success?(await _e(),V.success(`Invitation resent to ${Z}!`,{id:je})):V.error(`Error resending invitation: ${st.error||"Unknown error"}`,{id:je})}catch(Qe){console.error("Error resending invitation:",Qe),V.error("Error resending invitation",{id:je})}},tt=async(Q,Z)=>{const je=V.loading(`Removing ${Z}...`);try{const st=await(await fetch(`/api/members/${Q}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();st.success?(await We(),V.success(`${Z} removed from organization!`,{id:je})):V.error(`Error removing member: ${st.error||"Unknown error"}`,{id:je})}catch(Qe){console.error("Error removing member:",Qe),V.error("Error removing member",{id:je})}},ee=async()=>{if(!ae.name){V.error("Please enter a team name");return}const Q=V.loading("Creating team...");try{const je=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ae.name,organizationId:e})})).json();je.success?(await Ie(),M(!1),ne({name:""}),V.success("Team created successfully!",{id:Q})):V.error(`Error creating team: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error creating team:",Z),V.error("Error creating team",{id:Q})}},ue=async()=>{if(!R||!ae.name){V.error("Please enter a team name");return}const Q=V.loading("Updating team...");try{const je=await(await fetch(`/api/teams/${R.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ae.name})})).json();je.success?(await Ie(),L(!1),k(null),ne({name:""}),V.success("Team updated successfully!",{id:Q})):V.error(`Error updating team: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error updating team:",Z),V.error("Error updating team",{id:Q})}},Oe=async()=>{if(!R){V.error("No team selected");return}const Q=V.loading("Deleting team...");try{const je=await(await fetch(`/api/teams/${R.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();je.success?(await Ie(),G(!1),k(null),V.success("Team deleted successfully!",{id:Q})):V.error(`Error deleting team: ${je.error||"Unknown error"}`,{id:Q})}catch(Z){console.error("Error deleting team:",Z),V.error("Error deleting team",{id:Q})}},xe=Q=>{k(Q),ne({name:Q.name}),L(!0)},Pe=Q=>{k(Q),G(!0)};return h?r.jsx("div",{className:"flex items-center justify-center h-32",children:r.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[r.jsx(rn,{className:"w-6 h-6 text-white animate-spin"}),r.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[r.jsx(Ot,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),r.jsxs($,{onClick:pe,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Invite User"]}),r.jsxs($,{onClick:oe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Po,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ca,{className:"w-6 h-6 text-white"})}),r.jsx("div",{children:r.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,r.jsx(on,{id:n.slug,nonSliced:!0,variant:"subscript"})]})})]}),r.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[r.jsx("div",{className:"border-b border-dashed border-white/20",children:r.jsxs("nav",{className:"flex space-x-8 px-6",children:[r.jsxs("button",{onClick:()=>m("details"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ca,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Details",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:0,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),r.jsxs("button",{onClick:()=>m("members"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Members",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),r.jsxs("button",{onClick:()=>m("invitations"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(vs,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Invitations",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),r.jsxs("button",{onClick:()=>m("teams"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Teams",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:s.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),r.jsxs("div",{className:"p-6",children:[f==="details"&&r.jsxs("div",{className:"space-y-6 overflow-x-hidden",children:[r.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"ORGANIZATION INFORMATION"}),r.jsx("hr",{className:"border-white/15 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),r.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),r.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),r.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ot,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:c.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ot,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:s.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(vs,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:o.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(cr,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:Math.ceil((new Date().getTime()-new Date(n.createdAt).getTime())/(1e3*60*60*24)),format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-xs",children:s.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[r.jsx(Rs,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),r.jsxs($,{onClick:()=>M(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),v?s.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:s.map(Q=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${Q.id}`),children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-light",children:Q.name}),r.jsx(on,{id:Q.id,label:"Team ID"})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:Q.memberCount||0}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(Q.createdAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:Z=>{Z.stopPropagation(),xe(Q)},children:[r.jsx(Po,{className:"w-4 h-4 mr-1"}),"Edit"]}),r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:Z=>{Z.stopPropagation(),Pe(Q)},children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},Q.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),r.jsxs($,{onClick:()=>M(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:r.jsxs("div",{className:"flex items-start space-x-4",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx(Ot,{className:"w-12 h-12 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),r.jsx("p",{className:"text-gray-300 mb-6",children:"To use Teams in Better Auth Studio, you need to enable the teams feature in your organization plugin configuration."}),r.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[r.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),r.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:r.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),r.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:r.jsxs("pre",{className:"text-sm text-gray-300",children:[r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth/plugins"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"export const"})," ",r.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",r.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",r.jsx("br",{}),r.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",r.jsx("br",{}),r.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",r.jsx("span",{className:"text-blue-400",children:"true"})," ",r.jsx("br",{}),r.jsx("span",{className:"pl-16",children:"}"})," ",r.jsx("br",{}),r.jsx("span",{className:"pl-12",children:"})"})," ",r.jsx("br",{}),r.jsx("span",{className:"pl-10",children:"]"})," ",r.jsx("br",{}),"}",") ",r.jsx("br",{})]})}),r.jsx("div",{className:"mt-4",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),r.jsx("div",{className:"mt-2",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),r.jsx($,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),r.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",r.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}),f==="members"&&r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage organization members and their roles"})]})}),c.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:c.map(Q=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 group",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("img",{src:Q.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Q.user.id}`,alt:Q.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light inline-flex items-center gap-2",children:[r.jsx("span",{children:Q.user.name}),r.jsx("button",{onClick:Z=>{Z.stopPropagation(),t(`/users/${Q.user.id}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View user details",children:r.jsx(yu,{className:"w-4 h-4"})})]}),r.jsx(on,{id:Q.user.id})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:Q.user.email}),r.jsx("td",{className:"py-4 px-4",children:r.jsx(Bt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:Q.role})}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(Q.joinedAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsx("div",{className:"flex items-center justify-end space-x-2",children:r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>tt(Q.id,Q.user.name),children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},Q.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),r.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[r.jsxs($,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[r.jsx(Ot,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),r.jsxs($,{onClick:pe,className:"bg-white text-black hover:bg-white/90 border border-white/20 rounded-none",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage pending invitations to this organization"})]})}),o.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:o.map(Q=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(vs,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-light",children:Q.email}),r.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(Q.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white capitalize",children:Q.role}),r.jsx("td",{className:"py-4 px-4",children:r.jsxs(Bt,{variant:"secondary",className:`text-xs font-normal font-mono uppercase rounded-none border-dashed flex items-center gap-1 w-fit ${Q.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":Q.status==="accepted"?"bg-green-900/10 border border-green-500/30 text-green-400/70":"bg-red-900/10 border border-red-500/30 text-red-400/70"}`,children:[Q.status==="pending"&&r.jsx(jU,{className:"w-2 h-2"}),Q.status==="accepted"&&r.jsx(wp,{className:"w-3 h-3"}),Q.status==="expired"&&r.jsx(dt,{className:"w-2 h-2"}),Q.status]})}),r.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(Q.expiresAt).toLocaleDateString(),r.jsx("br",{}),r.jsx("span",{className:"text-xs text-gray-400",children:new Date(Q.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>ze(Q.id,Q.email),children:[r.jsx(EC,{className:"w-4 h-4 mr-1"}),"Resend"]}),r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>Te(Q.id),children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},Q.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(vs,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),r.jsxs($,{onClick:pe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]})]})]}),y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{g(!1),C(""),z("")},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),r.jsx(Ne,{id:"invite-email",type:"email",value:q,onChange:Q=>C(Q.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),r.jsxs(hn,{value:I,onValueChange:z,children:[r.jsx(fn,{children:r.jsx(Bn,{placeholder:"Select an inviter..."})}),r.jsx(pn,{children:W.map(Q=>r.jsx(Le,{value:Q.id,children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("img",{src:Q.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Q.id}`,alt:Q.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),r.jsxs("span",{children:[Q.name," (",Q.email,")"]})]})},Q.id))})]})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{g(!1),C(""),z("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsxs($,{onClick:ve,disabled:X,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[X?r.jsx(rn,{className:"w-3 h-3 mr-2 animate-spin"}):r.jsx(EC,{className:"w-4 h-4 mr-2"}),X?"Sending...":"Send Invitation"]})]})]})}),_&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{M(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),r.jsx(Ne,{id:"team-name",value:ae.name,onChange:Q=>mt(Q.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{M(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),U&&R&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{L(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-8 h-8 text-white"})}),r.jsx("div",{children:r.jsxs("div",{className:"text-white font-light",children:[R.name,r.jsx(on,{id:R.id,variant:"subscript",nonSliced:!0})]})})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),r.jsx(Ne,{id:"edit-team-name",value:ae.name,onChange:Q=>mt(Q.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{L(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:ue,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),F&&R&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>G(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white inline-flex font-light",children:[R.name,r.jsx(on,{id:R.id,variant:"subscript",nonSliced:!0})]}),r.jsx(on,{id:R.id,label:"Team ID",variant:"detail"})]})]}),r.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>G(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:Oe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),w&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Ot,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),r.jsx(Ne,{id:"member-count",type:"number",min:"1",max:"50",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var Z;const Q=parseInt(((Z=document.getElementById("member-count"))==null?void 0:Z.value)||"5");at(Q)},disabled:ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ge?r.jsxs(r.Fragment,{children:[r.jsx(rn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Ot,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),ye.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(Xi,{title:"Member Seeding Terminal",lines:ye,isRunning:ge,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:r.jsx($,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),E&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Ca,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),r.jsx(Ne,{id:"team-count",type:"number",min:"1",max:"20",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var Z;const Q=parseInt(((Z=document.getElementById("team-count"))==null?void 0:Z.value)||"3");ft(Q)},disabled:$e,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:$e?r.jsxs(r.Fragment,{children:[r.jsx(rn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Ca,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),Ue.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(Xi,{title:"Team Seeding Terminal",lines:Ue,isRunning:$e,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:r.jsx($,{variant:"outline",onClick:()=>j(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),A&&n&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:Q=>{Q.target===Q.currentTarget&&(P(!1),D({name:"",slug:""}))},children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",onClick:Q=>Q.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{P(!1),D({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Ca,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white inline-flex font-light",children:[n.name,r.jsx(on,{id:n.id,variant:"subscript",nonSliced:!0})]}),r.jsx("div",{className:"text-sm text-gray-400",children:n.slug})]})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),r.jsx(Ne,{id:"edit-name",value:T.name,onChange:Q=>ke(Q.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),r.jsx(Ne,{id:"edit-slug",value:T.slug,onChange:Q=>Ze(Q.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{P(!1),D({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:K,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})})]}):r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx(J1,{to:"/organizations",children:r.jsxs($,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[r.jsx(fae,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),r.jsx("br",{}),r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ca,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),r.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function bfe(){const[e,t]=p.useState([]),[n,a]=p.useState(!0),[s,i]=p.useState(""),[o,l]=p.useState("all"),[c,u]=p.useState(!1),[h,d]=p.useState(!1),[f,m]=p.useState(!1),[v,x]=p.useState(!1),[N,b]=p.useState(!1),[y,g]=p.useState(null),[w,S]=p.useState([]),[E,j]=p.useState(!1),_=p.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{a(!1)}},[]);p.useEffect(()=>{_()},[_]);const M=async T=>{S([]),j(!0),S([{id:"start",type:"info",message:`Starting session seeding process for ${T} sessions...`,timestamp:new Date}]);try{const q=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:T})})).json();if(q.success){const C=q.results.map((z,W)=>z.success?{id:`session-${W}`,type:"progress",message:`Creating session: ${z.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${W}`,type:"error",message:`Failed to create session ${W+1}: ${z.error}`,timestamp:new Date});S(z=>[...z,...C]);const I=q.results.filter(z=>z.success).length;S(z=>[...z,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${I}/${T} sessions successfully`,timestamp:new Date}]),await _()}else S(C=>[...C,{id:"error",type:"error",message:`❌ Seeding failed: ${q.error||"Unknown error"}`,timestamp:new Date}])}catch(D){S(q=>[...q,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{j(!1)}},U=async T=>{S([]),j(!0),S([{id:"start",type:"info",message:`Starting account seeding process for ${T} accounts...`,timestamp:new Date}]);try{const q=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:T})})).json();if(q.success){const C=q.results.map((z,W)=>z.success?{id:`account-${W}`,type:"progress",message:`Creating account: ${z.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${W}`,type:"error",message:`Failed to create account ${W+1}: ${z.error}`,timestamp:new Date});S(z=>[...z,...C]);const I=q.results.filter(z=>z.success).length;S(z=>[...z,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${I}/${T} accounts successfully`,timestamp:new Date}]),await _()}else S(C=>[...C,{id:"error",type:"error",message:`❌ Seeding failed: ${q.error||"Unknown error"}`,timestamp:new Date}])}catch(D){S(q=>[...q,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{j(!1)}},L=T=>{g(T),x(!0)},F=T=>{g(T),d(!0)},G=T=>{g(T),m(!0)},A=async T=>{u(!1)},P=async T=>{d(!1)},R=async()=>{m(!1)},k=e.filter(T=>{const D=T.id.toLowerCase().includes(s.toLowerCase())||T.userId.toLowerCase().includes(s.toLowerCase()),q=o==="all"||o==="active"&&new Date(T.expiresAt)>new Date||o==="expired"&&new Date(T.expiresAt)<=new Date;return D&&q});return n?r.jsx("div",{className:"flex items-center justify-center h-32",children:r.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[r.jsx(Ja,{className:"w-6 h-6 text-white animate-spin"}),r.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",r.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>b(!0),children:[r.jsx(Jt,{className:"w-4 h-4 mr-2"}),"Seed"]}),r.jsxs($,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>u(!0),children:[r.jsx(Pi,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Fo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),r.jsx(Ne,{placeholder:"Search sessions...",value:s,onChange:T=>i(T.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(xS,{className:"w-4 h-4 text-gray-400"}),r.jsxs(hn,{value:o,onValueChange:l,children:[r.jsx(fn,{children:r.jsx(Bn,{})}),r.jsxs(pn,{children:[r.jsx(Le,{value:"all",children:"All"}),r.jsx(Le,{value:"active",children:"Active"}),r.jsx(Le,{value:"expired",children:"Expired"})]})]})]})]}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:k.map(T=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",T.id.slice(0,8),"..."]}),r.jsx(on,{id:T.id})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:T.userId}),r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(T.expiresAt)>new Date?r.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):r.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),r.jsx("span",{className:"text-sm text-gray-400",children:new Date(T.expiresAt)>new Date?"Active":"Expired"})]})}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(T.expiresAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsx($,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>L(T),children:r.jsx(Ms,{className:"w-4 h-4"})}),r.jsx($,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>F(T),children:r.jsx(Po,{className:"w-4 h-4"})}),r.jsx($,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>G(T),children:r.jsx(Qu,{className:"w-4 h-4"})})]})})]},T.id))})]})})}),N&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),r.jsx(Ne,{id:"session-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var D;const T=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);M(T)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?r.jsxs(r.Fragment,{children:[r.jsx(Ja,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Jt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(kT,{className:"w-5 h-5 text-white"}),r.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ce,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),r.jsx(Ne,{id:"account-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var D;const T=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);U(T)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?r.jsxs(r.Fragment,{children:[r.jsx(Ja,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(kT,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),w.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(Xi,{title:"Session Seeding Terminal",lines:w,isRunning:E,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:r.jsx($,{variant:"outline",onClick:()=>b(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),r.jsx(Ne,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),r.jsx(Ne,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:()=>A(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),r.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),r.jsx(Ne,{id:"edit-user-id",defaultValue:y.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),r.jsx(Ne,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(y.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:()=>P(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>m(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),r.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),r.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>m(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:R,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),v&&y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(en,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:r.jsx(Jt,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),r.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(on,{id:y.id,variant:"detail"}),r.jsx(on,{id:y.userId,label:"User ID",variant:"detail"}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Status:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt)>new Date?"Active":"Expired"})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Expires:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt).toLocaleString()})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Created:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.createdAt).toLocaleString()})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-gray-400",children:"Updated:"}),r.jsx("span",{className:"text-white text-sm",children:new Date(y.updatedAt).toLocaleString()})]})]})]}),r.jsx("div",{className:"flex justify-end mt-6",children:r.jsx($,{onClick:()=>x(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function xfe(){var y,g,w,S,E,j,_,M,U,L,F,G,A,P,R,k,T,D,q,C,I,z,W,Y,ae,ne,X,ie,ye;const[e,t]=p.useState(null),[n,a]=p.useState(null),[s,i]=p.useState(null),[o,l]=p.useState(null),[c,u]=p.useState(!0),[h,d]=p.useState(null);e5(se=>{se.type==="config_changed"?setTimeout(()=>{f(),m(),v(),x()},500):se.type});const f=p.useCallback(async()=>{var se;try{const be=await(await fetch("/api/config")).json();(se=be.studio)!=null&&se.version&&d(`v${be.studio.version}`),t(be)}catch{}finally{u(!1)}},[]),m=p.useCallback(async()=>{try{const ge=await(await fetch("/api/health")).json();a(ge.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform})}catch{a({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS"})}},[h]),v=p.useCallback(async()=>{try{const ge=await(await fetch("/api/plugins")).json();i(ge)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),x=p.useCallback(async()=>{try{const ge=await(await fetch("/api/db")).json();l(ge)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),N=se=>{switch(se==null?void 0:se.toLowerCase()){case"postgresql":case"postgres":return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Connected"]});case"mysql":return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Pl,{className:"w-3 h-3"}),"Local"]});default:return r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Or,{className:"w-3 h-3"}),"Unknown"]})}};p.useEffect(()=>{f(),m(),v(),x()},[f,x,v,m]);const b=se=>{switch(se.toLowerCase()){case"google":return r.jsx(la,{className:"w-5 h-5 text-white"});case"github":return r.jsx(Mn,{className:"w-5 h-5 text-white"});case"discord":return r.jsx(la,{className:"w-5 h-5 text-white"});case"twitter":return r.jsx(la,{className:"w-5 h-5 text-white"});default:return r.jsx(la,{className:"w-5 h-5 text-white"})}};return c?r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx(Ja,{className:"w-6 h-6 text-white animate-spin"})}):r.jsxs("div",{className:"space-y-8",children:[r.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Zl,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Application"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Basic application configuration"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"space-y-0 px-0 pb-0 border-b-none",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(la,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(yo,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-mono font-light text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Kl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-mono font-light text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Jt,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Database"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Database connection and configuration"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"space-y-0 px-0 pb-0 border-b-none",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((y=e==null?void 0:e.database)==null?void 0:y.type)&&((g=e==null?void 0:e.database)==null?void 0:g.type.charAt(0).toUpperCase())+((w=e==null?void 0:e.database)==null?void 0:w.type.slice(1))||"Unknown"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((S=e==null?void 0:e.database)==null?void 0:S.type))&&N((o==null?void 0:o.name)||((E=e==null?void 0:e.database)==null?void 0:E.type)||"")]}),((o==null?void 0:o.dialect)||((j=e==null?void 0:e.database)==null?void 0:j.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:((_=e==null?void 0:e.database)==null?void 0:_.dialect)||(o==null?void 0:o.dialect)})})]}),((M=e==null?void 0:e.database)==null?void 0:M.url)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(yo,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Configured"]})]}),((U=e==null?void 0:e.database)==null?void 0:U.casing)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Zl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(TN,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:e.database.debugLogs?r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&r.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Or,{className:"w-5 h-5 text-yellow-400"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Mn,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Providers"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Configured authentication providers"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsx(Na,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((se,ge)=>r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[b(se.type),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:se.type}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:se.clientId?"Configured":"Not configured"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:se.clientId?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Active"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Setup Required"]})})]},ge)):r.jsxs("div",{className:"text-center py-8",children:[r.jsx(Mn,{className:"w-8 h-8 text-white mx-auto mb-2"}),r.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Sc,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Email & Password"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Email authentication settings"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Sc,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(L=e==null?void 0:e.emailAndPassword)!=null&&L.enabled?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]})})]}),((F=e==null?void 0:e.emailAndPassword)==null?void 0:F.enabled)&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Bo,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(G=e==null?void 0:e.emailAndPassword)!=null&&G.disableSignUp?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(A=e==null?void 0:e.emailAndPassword)!=null&&A.requireEmailVerification?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Required"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Optional"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Kl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),r.jsx("div",{className:"text-right",children:r.jsxs("p",{className:"text-sm font-medium text-white",children:[((P=e==null?void 0:e.emailAndPassword)==null?void 0:P.minPasswordLength)||8," -"," ",((R=e==null?void 0:e.emailAndPassword)==null?void 0:R.maxPasswordLength)||128]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ql,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(k=e==null?void 0:e.emailAndPassword)!=null&&k.autoSignIn?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(_g,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Session"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Session management settings"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(_g,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(T=e==null?void 0:e.session)!=null&&T.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(TN,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ql,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(q=e==null?void 0:e.session)!=null&&q.disableSessionRefresh?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(C=e==null?void 0:e.session)!=null&&C.storeSessionInDatabase?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Pl,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Mn,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Rate Limiting"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"API rate limiting configuration"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(I=e==null?void 0:e.rateLimit)!=null&&I.enabled?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Disabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(_g,{className:"w-5 h-5 text-red-400"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(z=e==null?void 0:e.rateLimit)!=null&&z.window?`${e.rateLimit.window} seconds`:"10 seconds"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:((W=e==null?void 0:e.rateLimit)==null?void 0:W.max)||100}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Jt,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),r.jsx("div",{className:"text-right",children:r.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((Y=e==null?void 0:e.rateLimit)==null?void 0:Y.storage)||"memory"})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Zl,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Advanced"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Advanced configuration options"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Kl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ae=e==null?void 0:e.advanced)!=null&&ae.useSecureCookies?r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Disabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Mn,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ne=e==null?void 0:e.advanced)!=null&&ne.disableCSRFCheck?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ms,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ie=(X=e==null?void 0:e.advanced)==null?void 0:X.ipAddress)!=null&&ie.disableIpTracking?r.jsxs(r.Fragment,{children:[r.jsx(Ns,{className:"w-3 h-3"}),"Disabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]}),r.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(IY,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ye=e==null?void 0:e.telemetry)!=null&&ye.enabled?r.jsxs(r.Fragment,{children:[r.jsx(Or,{className:"w-3 h-3"}),"Enabled"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nn,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(Pl,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"System Info"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth Studio system information"]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsxs(Na,{className:"p-0",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ql,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Pl,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(la,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]})]})]}),r.jsxs(ya,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none lg:col-span-2",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs(va,{className:"space-y-0",children:[r.jsxs(wa,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[r.jsx(jT,{className:"w-4 h-4 text-white"}),r.jsx("span",{children:"Plugins"})]}),r.jsxs(Dr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[r.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",r.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth plugins enabled in your configuration"]})]}),r.jsxs("div",{className:"pr-6",children:[r.jsx("p",{className:"text-sm font-medium text-white",children:(s==null?void 0:s.totalPlugins)||0}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),r.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),r.jsx(Na,{className:"space-y-0 px-0 pb-0 border-b-none",children:s!=null&&s.plugins&&s.plugins.length>0?r.jsxs(r.Fragment,{children:[s.plugins.map((se,ge)=>r.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${ge<s.plugins.length-1?"border-b border-white/15":""}`,children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(jT,{className:"w-5 h-5 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-light uppercase text-white",children:se.name.slice(0,1).toUpperCase()+se.name.slice(1).replace("-"," ")}),r.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:se.description})]})]}),r.jsx("div",{className:"text-right flex items-center space-x-2",children:r.jsxs(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light text-gray-400 bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400 flex items-center gap-1",children:[r.jsx(Nn,{className:"w-3 h-3"}),"Enabled"]})})]},se.id)),s.configPath&&r.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:r.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",r.jsx("span",{className:"text-white font-mono",children:s.configPath})]})})]}):r.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Or,{className:"w-5 h-5 text-yellow-400"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),r.jsx("p",{className:"text-xs text-gray-400",children:(s==null?void 0:s.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),r.jsx(Bt,{variant:"secondary",className:"text-xs font-mono uppercase font-light bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}const r4=e=>{if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":Yn(t,"dd MMM yyyy; HH:mm")};function s4(){var R,k;const{orgId:e,teamId:t}=Q1(),n=vr(),[a,s]=p.useState(null),[i,o]=p.useState([]),[l,c]=p.useState(!0),[u,h]=p.useState("details"),[d,f]=p.useState(!1),[m,v]=p.useState(!1),[x,N]=p.useState(""),[b,y]=p.useState([]),[g,w]=p.useState([]),[S,E]=p.useState({name:""}),j=p.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(s(D.team),E({name:D.team.name})):D.team?(s(D.team),E({name:D.team.name})):V.error("Team not found")}catch{V.error("Failed to load team")}finally{c(!1)}},[t]),_=p.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{V.error("Failed to load team members")}},[t]),M=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),q=i.map(I=>I.userId),C=(D.users||[]).filter(I=>!q.includes(I.id));y(C)}catch{V.error("Failed to load users")}};p.useEffect(()=>{t&&(j(),_())},[t,j,_]);const U=async()=>{if(!S.name){V.error("Please enter a team name");return}const T=V.loading("Updating team...");try{const q=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S.name})})).json();q.success?(await j(),v(!1),V.success("Team updated successfully!",{id:T})):V.error(`Error updating team: ${q.error||"Unknown error"}`,{id:T})}catch{V.error("Error updating team",{id:T})}},L=async()=>{if(g.length===0){V.error("Please select at least one user");return}const T=V.loading(`Adding ${g.length} members...`);try{const q=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:g})})).json();q.success?(await _(),f(!1),w([]),N(""),V.success(`Successfully added ${g.length} members!`,{id:T})):V.error(`Error adding members: ${q.error||"Unknown error"}`,{id:T})}catch{V.error("Error adding members",{id:T})}},F=async(T,D)=>{const q=V.loading(`Removing ${D}...`);try{const I=await(await fetch(`/api/team-members/${T}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();I.success?(await _(),V.success(`${D} removed from team!`,{id:q})):V.error(`Error removing member: ${I.error||"Unknown error"}`,{id:q})}catch{V.error("Error removing team member",{id:q})}},G=()=>{M(),f(!0)},A=T=>{w(D=>D.includes(T)?D.filter(q=>q!==T):[...D,T])},P=b.filter(T=>T.name.toLowerCase().includes(x.toLowerCase())||T.email.toLowerCase().includes(x.toLowerCase()));return l?r.jsx("div",{className:"flex items-center justify-center h-32",children:r.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[r.jsx(rn,{className:"w-6 h-6 text-white animate-spin"}),r.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):a?r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>n(`/organizations/${a.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs($,{onClick:G,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Add Members"]}),r.jsxs($,{onClick:()=>v(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Po,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[a.name,r.jsx(on,{id:t,variant:"subscript",nonSliced:!0})]}),r.jsx("div",{className:"flex items-center space-x-2 mt-1",children:a.organization&&r.jsxs(J1,{to:`/organizations/${a.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[r.jsx(Ca,{className:"w-4 h-4 inline mr-1"}),a.organization.name]})})]})]}),r.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[r.jsx("div",{className:"border-b border-dashed border-white/20",children:r.jsxs("nav",{className:"flex space-x-8 px-6",children:[r.jsxs("button",{onClick:()=>h("details"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${u==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsx("span",{className:"font-mono uppercase text-xs font-normal",children:"Details"})]}),r.jsxs("button",{onClick:()=>h("members"),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${u==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(Ot,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start font-mono uppercase text-xs font-normal",children:["Members",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(An,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),r.jsxs("div",{className:"p-6",children:[u==="details"&&r.jsxs("div",{className:"space-y-6 overflow-x-hidden",children:[r.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"TEAM INFORMATION"}),r.jsx("hr",{className:"border-white/15 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),r.jsx("p",{className:"text-white font-sans mt-1",children:a.name})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),r.jsx("p",{className:"text-white font-sans mt-1",children:((R=a.organization)==null?void 0:R.name)||"Unknown"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),r.jsx("p",{className:"text-white font-sans mt-1",children:r4(a.createdAt)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),r.jsx("p",{className:"text-white font-sans mt-1",children:r4(a.updatedAt)})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ot,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:i.length,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(cr,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:Math.ceil((Date.now()-new Date(a.createdAt).getTime())/(1e3*60*60*24)),format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(Ca,{className:"w-8 h-8 text-white"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.jsx(An,{value:1,format:{notation:"standard",maximumFractionDigits:0}})}),r.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),u==="members"&&r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",r.jsx(An,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})]}),r.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),r.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),r.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),r.jsx("tbody",{children:i.map(T=>r.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 group",children:[r.jsx("td",{className:"py-4 px-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("img",{src:T.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${T.user.id}`,alt:T.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-light inline-flex items-center gap-2",children:[r.jsx("span",{children:T.user.name}),r.jsx("button",{onClick:D=>{D.stopPropagation(),n(`/users/${T.user.id}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View user details",children:r.jsx(yu,{className:"w-4 h-4"})})]}),r.jsx(on,{id:T.user.id})]})]})}),r.jsx("td",{className:"py-4 px-4 text-white",children:T.user.email}),r.jsx("td",{className:"py-4 px-4",children:r.jsx(Bt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:T.role})}),r.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(T.joinedAt).toLocaleDateString()}),r.jsx("td",{className:"py-4 px-4 text-right",children:r.jsx("div",{className:"flex items-center justify-end space-x-2",children:r.jsxs($,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>F(T.id,T.user.name),children:[r.jsx(yf,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},T.id))})]})})}):r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),r.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),r.jsxs($,{onClick:G,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]})]})]}),d&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{f(!1),w([]),N("")},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(EU,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),r.jsx(Ne,{placeholder:"Search users by name or email...",value:x,onChange:T=>N(T.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),g.length>0&&r.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:r.jsxs("p",{className:"text-blue-400 text-sm",children:[g.length," user",g.length!==1?"s":""," selected"]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:P.length>0?r.jsx("div",{className:"divide-y divide-white/5",children:P.map(T=>r.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${g.includes(T.id)?"bg-blue-900/20":""}`,onClick:()=>A(T.id),children:[r.jsx("input",{type:"checkbox",checked:g.includes(T.id),onChange:()=>A(T.id),className:"rounded border-gray-300"}),r.jsx("img",{src:T.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${T.id}`,alt:T.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-white font-light",children:T.name}),r.jsx("div",{className:"text-sm text-gray-400",children:T.email})]})]},T.id))}):r.jsx("div",{className:"p-8 text-center",children:r.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{f(!1),w([]),N("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsxs($,{onClick:L,disabled:g.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[r.jsx(Vd,{className:"w-4 h-4 mr-2"}),"Add ",g.length," Member",g.length!==1?"s":""]})]})]})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-lg rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(dt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:r.jsx(Ot,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white inline-flex font-light",children:[a.name,r.jsx(on,{id:a.id,variant:"subscript"})]}),r.jsx("div",{className:"text-sm text-gray-400",children:(k=a.organization)==null?void 0:k.name})]})]}),r.jsxs("div",{children:[r.jsx(ce,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),r.jsx(Ne,{id:"edit-team-name",value:S.name,onChange:T=>E({name:T.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:U,disabled:S.name===a.name,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsx("div",{className:"flex items-center space-x-4",children:r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ot,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),r.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function yfe(){const e=vr(),[t,n]=p.useState([]),[a,s]=p.useState(!0),[i,o]=p.useState(null),[l,c]=p.useState(""),[u,h]=p.useState("all"),[d,f]=p.useState(1),[m]=p.useState(20);p.useEffect(()=>{v();const S=setInterval(()=>{i!=null&&i.enabled||v()},2e3);return()=>clearInterval(S)},[i==null?void 0:i.enabled]);const v=async()=>{try{const E=await(await fetch("/api/plugins")).json(),j=(E==null?void 0:E.plugins).find(_=>_.id==="teams");o({enabled:!!j,availablePlugins:(E==null?void 0:E.plugins).map(_=>_.id),configPath:E.configPath,teamsPlugin:(E==null?void 0:E.plugins).find(_=>_.id==="teams")}),j?await x():s(!1)}catch(S){console.error("Failed to check teams plugin status:",S),o({enabled:!1,error:"Failed to check plugin status"}),s(!1)}},x=async()=>{try{const E=await(await fetch("/api/teams")).json();E.success&&n(E.teams||[])}catch(S){console.error("Failed to fetch teams:",S),V.error("Failed to load teams")}finally{s(!1)}},N=t.filter(S=>{var j;const E=S.name.toLowerCase().includes(l.toLowerCase())||((j=S.organization)==null?void 0:j.name.toLowerCase().includes(l.toLowerCase()));if(u==="all")return E;if(u==="recent"){const _=new Date;return _.setDate(_.getDate()-7),E&&new Date(S.createdAt)>_}return E}),b=d*m,y=b-m,g=N.slice(y,b),w=Math.ceil(N.length/m);return a?r.jsx("div",{className:"flex items-center justify-center min-h-screen",children:r.jsx(Ja,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",r.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:r.jsx(An,{value:N.length,className:"text-white font-mono text-sm",prefix:r.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),r.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[r.jsx(An,{value:N.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),r.jsxs("span",{children:["team",N.length!==1?"s":""," found"]})]})]}),r.jsx("div",{className:"flex items-center space-x-3",children:r.jsxs($,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[r.jsx(Pi,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsxs("div",{className:"relative flex-1 max-w-md",children:[r.jsx(Fo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),r.jsx(Ne,{type:"text",placeholder:"Search teams...",value:l,onChange:S=>c(S.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx($,{variant:u==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:u==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),r.jsx($,{variant:u==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:u==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),g.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Bo,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),r.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&r.jsxs($,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[r.jsx(Pi,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):r.jsx("div",{className:"grid gap-4",children:g.map(S=>{var E;return r.jsx("div",{className:"bg-black/30 border border-white/15 rounded-none p-4 hover:bg-black/40 transition-colors cursor-pointer",onClick:()=>e(`/teams/${S.id}`),children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:r.jsx(Bo,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-white font-medium",children:S.name}),r.jsxs("p",{className:"text-gray-400 text-sm",children:[(E=S.organization)==null?void 0:E.name," • ",S.memberCount||0," members"]})]})]}),r.jsx("div",{className:"flex items-center space-x-2",children:r.jsx(Bt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},S.id)})}),w>1&&r.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[r.jsx($,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,d-1)),disabled:d===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),r.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",d," of ",w]}),r.jsx($,{variant:"outline",size:"sm",onClick:()=>f(Math.min(w,d+1)),disabled:d===w,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),r.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),r.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:r.jsxs("div",{className:"flex items-start space-x-4",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx(Mr,{className:"w-12 h-12 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),r.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),r.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[r.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),r.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:r.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&r.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),r.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:r.jsxs("pre",{className:"text-sm text-gray-300",children:[r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",r.jsx("span",{className:"text-blue-400",children:"from"})," ",r.jsx("span",{className:"text-green-400",children:'"better-auth/plugins"'})," ",r.jsx("br",{}),r.jsx("span",{className:"text-blue-400",children:"export const"})," ",r.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",r.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",r.jsx("br",{}),r.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",r.jsx("br",{}),r.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",r.jsx("br",{}),r.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),r.jsx("br",{}),r.jsx("span",{className:"pl-10",children:"]"})," ",r.jsx("br",{}),"}",") ",r.jsx("br",{})]})}),r.jsx("div",{className:"mt-4",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),r.jsx("div",{className:"mt-2",children:r.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),(i==null?void 0:i.availablePlugins)&&i.availablePlugins.length>0&&r.jsx("div",{className:"mb-4",children:r.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),r.jsx($,{onClick:v,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),r.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",r.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]})}function Ep(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}function g6(e,t,n){let a="",s=0,i=0;for(const o of e)for(s=s<<8|o,i+=8;i>=6;)i-=6,a+=t[s>>i&63];if(i>0&&(a+=t[s<<6-i&63]),n){const o=(4-a.length%4)%4;a+="=".repeat(o)}return a}function b6(e,t){const n=new Map;for(let o=0;o<t.length;o++)n.set(t[o],o);const a=[];let s=0,i=0;for(const o of e){if(o==="=")break;const l=n.get(o);if(l===void 0)throw new Error(`Invalid Base64 character: ${o}`);s=s<<6|l,i+=6,i>=8&&(i-=8,a.push(s>>i&255))}return Uint8Array.from(a)}const vfe={encode(e,t={}){const n=Ep(!1),a=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return g6(a,n,t.padding??!0)},decode(e){typeof e!="string"&&(e=new TextDecoder().decode(e));const t=e.includes("-")||e.includes("_"),n=Ep(t);return b6(e,n)}},wfe={encode(e,t={}){const n=Ep(!0),a=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return g6(a,n,t.padding??!0)},decode(e){const t=e.includes("-")||e.includes("_"),n=Ep(t);return b6(e,n)}};function Nfe(){const e=typeof globalThis<"u"&&globalThis.crypto;if(e&&typeof e.subtle=="object"&&e.subtle!=null)return e.subtle;throw new Error("crypto.subtle must be defined")}function Sfe(e,t){return{digest:async n=>{const a=new TextEncoder,s=typeof n=="string"?a.encode(n):n,i=await Nfe().digest(e,s);return t==="hex"?Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join(""):t==="base64"||t==="base64url"||t==="base64urlnopad"?t.includes("url")?wfe.encode(i,{padding:t!=="base64urlnopad"}):vfe.encode(i):i}}}function lw({value:e,onChange:t,language:n="typescript",placeholder:a="",className:s=""}){const i=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(e||a);p.useEffect(()=>{c(e||a)},[e,a]),p.useEffect(()=>{const x=i.current,N=o.current;if(x&&N){const b=()=>{N&&(N.scrollTop=x.scrollTop,N.scrollLeft=x.scrollLeft)};return x.addEventListener("scroll",b),()=>x.removeEventListener("scroll",b)}},[]);const u="12px",h="1.5",d="0.75rem",f='ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',m={...nc,'pre[class*="language-"]':{...nc['pre[class*="language-"]'],background:"transparent",padding:0,margin:0,borderRadius:0,overflow:"visible"},'code[class*="language-"]':{...nc['code[class*="language-"]'],background:"transparent",fontSize:u,lineHeight:h,fontFamily:f}},v={fontFamily:f,fontSize:u,lineHeight:h,padding:d,margin:0,border:"none",outline:"none",resize:"none",color:"transparent",caretColor:"#fff",background:"transparent",width:"100%",minHeight:"200px",overflow:"auto",tabSize:2};return r.jsxs("div",{className:`relative border border-dashed border-white/20 rounded-none focus-within:border-white/40 ${s}`,children:[r.jsx("div",{ref:o,className:"absolute inset-0 pointer-events-none overflow-auto",style:{padding:d,boxSizing:"border-box"},children:r.jsx(mE,{language:n,style:m,customStyle:{margin:0,padding:0,background:"transparent",minHeight:"200px"},codeTagProps:{style:{fontFamily:f,fontSize:u,lineHeight:h,display:"block"}},PreTag:({children:x,...N})=>r.jsx("pre",{...N,style:{margin:0,padding:0,background:"transparent",fontSize:u,lineHeight:h,fontFamily:f},children:x}),children:l})}),r.jsx("textarea",{ref:i,value:e,onChange:x=>t(x.target.value),placeholder:a,className:"relative w-full min-h-[200px] bg-transparent text-white font-mono text-xs rounded-none focus:outline-none resize-none",style:{...v,boxSizing:"border-box",position:"relative",zIndex:1},spellCheck:!1})]})}function x6(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Tm="Checkbox",[Efe]=Gs(Tm),[jfe,gE]=Efe(Tm);function Tfe(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:s,disabled:i,form:o,name:l,onCheckedChange:c,required:u,value:h="on",internal_do_not_use_render:d}=e,[f,m]=Bc({prop:n,defaultProp:s??!1,onChange:c,caller:Tm}),[v,x]=p.useState(null),[N,b]=p.useState(null),y=p.useRef(!1),g=v?!!o||!!v.closest("form"):!0,w={checked:f,disabled:i,setChecked:m,control:v,setControl:x,name:l,form:o,value:h,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Bi(s)?!1:s,isFormControl:g,bubbleInput:N,setBubbleInput:b};return r.jsx(jfe,{scope:t,...w,children:Cfe(d)?d(w):a})}var y6="CheckboxTrigger",v6=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},s)=>{const{control:i,value:o,disabled:l,checked:c,required:u,setControl:h,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:m,bubbleInput:v}=gE(y6,e),x=ln(s,h),N=p.useRef(c);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const y=()=>d(N.current);return b.addEventListener("reset",y),()=>b.removeEventListener("reset",y)}},[i,d]),r.jsx($t.button,{type:"button",role:"checkbox","aria-checked":Bi(c)?"mixed":c,"aria-required":u,"data-state":j6(c),"data-disabled":l?"":void 0,disabled:l,value:o,...a,ref:x,onKeyDown:St(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:St(n,b=>{d(y=>Bi(y)?!0:!y),v&&m&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});v6.displayName=y6;var bE=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:s,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:u,form:h,...d}=e;return r.jsx(Tfe,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:l,required:o,onCheckedChange:u,name:a,form:h,value:c,internal_do_not_use_render:({isFormControl:f})=>r.jsxs(r.Fragment,{children:[r.jsx(v6,{...d,ref:t,__scopeCheckbox:n}),f&&r.jsx(E6,{__scopeCheckbox:n})]})})});bE.displayName=Tm;var w6="CheckboxIndicator",N6=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...s}=e,i=gE(w6,n);return r.jsx(Vs,{present:a||Bi(i.checked)||i.checked===!0,children:r.jsx($t.span,{"data-state":j6(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});N6.displayName=w6;var S6="CheckboxBubbleInput",E6=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:l,disabled:c,name:u,value:h,form:d,bubbleInput:f,setBubbleInput:m}=gE(S6,e),v=ln(n,m),x=x6(i),N=TS(a);p.useEffect(()=>{const y=f;if(!y)return;const g=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(g,"checked").set,E=!s.current;if(x!==i&&S){const j=new Event("click",{bubbles:E});y.indeterminate=Bi(i),S.call(y,Bi(i)?!1:i),y.dispatchEvent(j)}},[f,x,i,s]);const b=p.useRef(Bi(i)?!1:i);return r.jsx($t.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:c,name:u,value:h,form:d,...t,tabIndex:-1,ref:v,style:{...t.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});E6.displayName=S6;function Cfe(e){return typeof e=="function"}function Bi(e){return e==="indeterminate"}function j6(e){return Bi(e)?"indeterminate":e?"checked":"unchecked"}const wf=p.forwardRef(({className:e,...t},n)=>r.jsx(bE,{ref:n,className:Ge("peer h-4 w-4 shrink-0 rounded-none border border-white/20 bg-black ring-offset-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-white data-[state=checked]:text-black data-[state=checked]:border-white",e),...t,children:r.jsx(N6,{className:Ge("flex items-center justify-center text-current"),children:r.jsx(vu,{className:"h-4 w-4"})})}));wf.displayName=bE.displayName;function kfe(e){const t=e+"CollectionProvider",[n,a]=Gs(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:N,children:b}=x,y=te.useRef(null),g=te.useRef(new Map).current;return r.jsx(s,{scope:N,itemMap:g,collectionRef:y,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=wu(l),u=te.forwardRef((x,N)=>{const{scope:b,children:y}=x,g=i(l,b),w=ln(N,g.collectionRef);return r.jsx(c,{ref:w,children:y})});u.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",f=wu(h),m=te.forwardRef((x,N)=>{const{scope:b,children:y,...g}=x,w=te.useRef(null),S=ln(N,w),E=i(h,b);return te.useEffect(()=>(E.itemMap.set(w,{ref:w,...g}),()=>void E.itemMap.delete(w))),r.jsx(f,{[d]:"",ref:S,children:y})});m.displayName=h;function v(x){const N=i(e+"CollectionConsumer",x);return te.useCallback(()=>{const y=N.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(N.itemMap.values()).sort((E,j)=>g.indexOf(E.ref.current)-g.indexOf(j.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},v,a]}var Afe=p.createContext(void 0);function T6(e){const t=p.useContext(Afe);return e||t||"ltr"}var cw="rovingFocusGroup.onEntryFocus",_fe={bubbles:!1,cancelable:!0},lh="RovingFocusGroup",[WN,C6,Rfe]=kfe(lh),[Ofe,k6]=Gs(lh,[Rfe]),[Dfe,Ife]=Ofe(lh),A6=p.forwardRef((e,t)=>r.jsx(WN.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(WN.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Mfe,{...e,ref:t})})}));A6.displayName=lh;var Mfe=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...d}=e,f=p.useRef(null),m=ln(t,f),v=T6(i),[x,N]=Bc({prop:o,defaultProp:l??null,onChange:c,caller:lh}),[b,y]=p.useState(!1),g=zo(u),w=C6(n),S=p.useRef(!1),[E,j]=p.useState(0);return p.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(cw,g),()=>_.removeEventListener(cw,g)},[g]),r.jsx(Dfe,{scope:n,orientation:a,dir:v,loop:s,currentTabStopId:x,onItemFocus:p.useCallback(_=>N(_),[N]),onItemShiftTab:p.useCallback(()=>y(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(_=>_+1),[]),onFocusableItemRemove:p.useCallback(()=>j(_=>_-1),[]),children:r.jsx($t.div,{tabIndex:b||E===0?-1:0,"data-orientation":a,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:St(e.onMouseDown,()=>{S.current=!0}),onFocus:St(e.onFocus,_=>{const M=!S.current;if(_.target===_.currentTarget&&M&&!b){const U=new CustomEvent(cw,_fe);if(_.currentTarget.dispatchEvent(U),!U.defaultPrevented){const L=w().filter(R=>R.focusable),F=L.find(R=>R.active),G=L.find(R=>R.id===x),P=[F,G,...L].filter(Boolean).map(R=>R.ref.current);O6(P,h)}}S.current=!1}),onBlur:St(e.onBlur,()=>y(!1))})})}),_6="RovingFocusGroupItem",R6=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:s=!1,tabStopId:i,children:o,...l}=e,c=er(),u=i||c,h=Ife(_6,n),d=h.currentTabStopId===u,f=C6(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:x}=h;return p.useEffect(()=>{if(a)return m(),()=>v()},[a,m,v]),r.jsx(WN.ItemSlot,{scope:n,id:u,focusable:a,active:s,children:r.jsx($t.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:St(e.onMouseDown,N=>{a?h.onItemFocus(u):N.preventDefault()}),onFocus:St(e.onFocus,()=>h.onItemFocus(u)),onKeyDown:St(e.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){h.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const b=Pfe(N,h.orientation,h.dir);if(b!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let g=f().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")g.reverse();else if(b==="prev"||b==="next"){b==="prev"&&g.reverse();const w=g.indexOf(N.currentTarget);g=h.loop?Ffe(g,w+1):g.slice(w+1)}setTimeout(()=>O6(g))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:x!=null}):o})})});R6.displayName=_6;var Lfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ufe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pfe(e,t,n){const a=Ufe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return Lfe[a]}function O6(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function Ffe(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var Bfe=A6,zfe=R6,xE="Radio",[$fe,D6]=Gs(xE),[Hfe,qfe]=$fe(xE),I6=p.forwardRef((e,t)=>{const{__scopeRadio:n,name:a,checked:s=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...h}=e,[d,f]=p.useState(null),m=ln(t,N=>f(N)),v=p.useRef(!1),x=d?u||!!d.closest("form"):!0;return r.jsxs(Hfe,{scope:n,checked:s,disabled:o,children:[r.jsx($t.button,{type:"button",role:"radio","aria-checked":s,"data-state":P6(s),"data-disabled":o?"":void 0,disabled:o,value:l,...h,ref:m,onClick:St(e.onClick,N=>{s||c==null||c(),x&&(v.current=N.isPropagationStopped(),v.current||N.stopPropagation())})}),x&&r.jsx(U6,{control:d,bubbles:!v.current,name:a,value:l,checked:s,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});I6.displayName=xE;var M6="RadioIndicator",L6=p.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:a,...s}=e,i=qfe(M6,n);return r.jsx(Vs,{present:a||i.checked,children:r.jsx($t.span,{"data-state":P6(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});L6.displayName=M6;var Gfe="RadioBubbleInput",U6=p.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:a=!0,...s},i)=>{const o=p.useRef(null),l=ln(o,i),c=x6(n),u=TS(t);return p.useEffect(()=>{const h=o.current;if(!h)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&m){const v=new Event("click",{bubbles:a});m.call(h,n),h.dispatchEvent(v)}},[c,n,a]),r.jsx($t.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});U6.displayName=Gfe;function P6(e){return e?"checked":"unchecked"}var Vfe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Cm="RadioGroup",[Yfe]=Gs(Cm,[k6,D6]),F6=k6(),B6=D6(),[Wfe,Xfe]=Yfe(Cm),z6=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:h=!0,onValueChange:d,...f}=e,m=F6(n),v=T6(u),[x,N]=Bc({prop:i,defaultProp:s??null,onChange:d,caller:Cm});return r.jsx(Wfe,{scope:n,name:a,required:o,disabled:l,value:x,onValueChange:N,children:r.jsx(Bfe,{asChild:!0,...m,orientation:c,dir:v,loop:h,children:r.jsx($t.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:v,...f,ref:t})})})});z6.displayName=Cm;var $6="RadioGroupItem",H6=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:a,...s}=e,i=Xfe($6,n),o=i.disabled||a,l=F6(n),c=B6(n),u=p.useRef(null),h=ln(t,u),d=i.value===s.value,f=p.useRef(!1);return p.useEffect(()=>{const m=x=>{Vfe.includes(x.key)&&(f.current=!0)},v=()=>f.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",v)}},[]),r.jsx(zfe,{asChild:!0,...l,focusable:!o,active:d,children:r.jsx(I6,{disabled:o,required:i.required,checked:d,...c,...s,name:i.name,ref:h,onCheck:()=>i.onValueChange(s.value),onKeyDown:St(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:St(s.onFocus,()=>{var m;f.current&&((m=u.current)==null||m.click())})})})});H6.displayName=$6;var Kfe="RadioGroupIndicator",q6=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...a}=e,s=B6(n);return r.jsx(L6,{...s,...a,ref:t})});q6.displayName=Kfe;var G6=z6,V6=H6,Zfe=q6;const XN=p.forwardRef(({className:e,...t},n)=>r.jsx(G6,{className:Ge("grid gap-2",e),...t,ref:n}));XN.displayName=G6.displayName;const Nl=p.forwardRef(({className:e,...t},n)=>r.jsx(V6,{ref:n,className:Ge("aspect-square h-4 w-4 rounded-none border border-white/20 bg-black text-white ring-offset-black focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-white data-[state=checked]:border-white",e),...t,children:r.jsx(Zfe,{className:"flex items-center justify-center",children:r.jsx("div",{className:"h-2 w-2 rounded-none bg-black"})})}));Nl.displayName=V6.displayName;const Y6=e=>{if(!e)return r.jsx(la,{className:"w-6 h-6 text-white"});const t=e.toLowerCase(),n="w-6 h-6 text-white";switch(t){case"github":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 15 15",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M7.5.25a7.25 7.25 0 0 0-2.292 14.13c.363.066.495-.158.495-.35c0-.172-.006-.628-.01-1.233c-2.016.438-2.442-.972-2.442-.972c-.33-.838-.805-1.06-.805-1.06c-.658-.45.05-.441.05-.441c.728.051 1.11.747 1.11.747c.647 1.108 1.697.788 2.11.602c.066-.468.254-.788.46-.969c-1.61-.183-3.302-.805-3.302-3.583a2.8 2.8 0 0 1 .747-1.945c-.075-.184-.324-.92.07-1.92c0 0 .61-.194 1.994.744A6.963 6.963 0 0 1 7.5 3.756A6.97 6.97 0 0 1 9.315 4c1.384-.938 1.992-.743 1.992-.743c.396.998.147 1.735.072 1.919c.465.507.745 1.153.745 1.945c0 2.785-1.695 3.398-3.31 3.577c.26.224.492.667.492 1.343c0 .97-.009 1.751-.009 1.989c0 .194.131.42.499.349A7.25 7.25 0 0 0 7.499.25",clipRule:"evenodd"})});case"google":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 56 56",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M28.458 5c6.167 0 11.346 2.2 15.368 5.804l.323.295l-6.62 6.464c-1.695-1.59-4.666-3.493-9.07-3.493c-6.204 0-11.47 4.093-13.372 9.749c-.47 1.46-.756 3.023-.756 4.64c0 1.615.287 3.18.782 4.639c1.877 5.656 7.142 9.748 13.345 9.748c3.347 0 5.928-.886 7.881-2.176l.251-.17l.307-.222c2.813-2.108 4.144-5.084 4.46-7.169l.03-.22h-12.93v-8.705h22.025c.339 1.46.495 2.867.495 4.795c0 7.142-2.554 13.163-6.985 17.255c-3.884 3.597-9.201 5.682-15.535 5.682c-9.031 0-16.85-5.102-20.772-12.57l-.184-.358l-.222-.457A23.45 23.45 0 0 1 5 28.458c0-3.6.827-7.01 2.28-10.073l.222-.457l.184-.357C11.608 10.1 19.426 5 28.458 5"})});case"apple":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M14.122 4.682c1.35 0 2.781.743 3.8 2.028c-3.34 1.851-2.797 6.674.578 7.963c-.465 1.04-.687 1.505-1.285 2.426c-.835 1.284-2.01 2.884-3.469 2.898c-1.295.012-1.628-.853-3.386-.843c-1.758.01-2.125.858-3.42.846c-1.458-.014-2.573-1.458-3.408-2.743C1.198 13.665.954 9.45 2.394 7.21C3.417 5.616 5.03 4.683 6.548 4.683c1.545 0 2.516.857 3.794.857c1.24 0 1.994-.858 3.78-.858M13.73 0c.18 1.215-.314 2.405-.963 3.247c-.695.902-1.892 1.601-3.05 1.565c-.21-1.163.332-2.36.99-3.167C11.43.755 12.67.074 13.73 0"})});case"discord":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M18.59 5.89c-1.23-.57-2.54-.99-3.92-1.23c-.17.3-.37.71-.5 1.04c-1.46-.22-2.91-.22-4.34 0c-.14-.33-.34-.74-.51-1.04c-1.38.24-2.69.66-3.92 1.23c-2.48 3.74-3.15 7.39-2.82 10.98c1.65 1.23 3.24 1.97 4.81 2.46c.39-.53.73-1.1 1.03-1.69c-.57-.21-1.11-.48-1.62-.79c.14-.1.27-.21.4-.31c3.13 1.46 6.52 1.46 9.61 0c.13.11.26.21.4.31c-.51.31-1.06.57-1.62.79c.3.59.64 1.16 1.03 1.69c1.57-.49 3.17-1.23 4.81-2.46c.39-4.17-.67-7.78-2.82-10.98Zm-9.75 8.78c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94s1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94m6.31 0c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94s1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94"})});case"facebook":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 64 64",fill:"#888888",children:r.jsx("path",{d:"M59.5 1h-55C2.5 1 1 2.6 1 4.5v55c0 2 1.6 3.5 3.5 3.5h29.6V38.9h-8v-9.3h8v-6.9c0-8 4.8-12.4 12-12.4c2.4 0 4.8.1 7.2.4V19h-4.8c-3.8 0-4.6 1.8-4.6 4.5v5.9H53l-1.3 9.4h-8v23.8h15.8c2 0 3.5-1.5 3.5-3.5V4.5c-.1-2-1.7-3.5-3.5-3.5"})});case"microsoft":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M2 3h9v9H2zm9 19H2v-9h9zM21 3v9h-9V3zm0 19h-9v-9h9z"})});case"twitter":case"x":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 448 512",fill:"currentColor",children:r.jsx("path",{d:"M64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64zm297.1 84L257.3 234.6L379.4 396h-95.6L209 298.1L123.3 396H75.8l111-126.9L69.7 116h98l67.7 89.5l78.2-89.5zm-37.8 251.6L153.4 142.9h-28.3l171.8 224.7h26.3z"})});case"linkedin":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 448 512",fill:"currentColor",children:r.jsx("path",{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"})});case"gitlab":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 32 32",fill:"currentColor",children:r.jsx("path",{d:"M28.568 12.893l-.037-.094l-3.539-9.235a.92.92 0 0 0-.364-.439a.95.95 0 0 0-1.083.058a.95.95 0 0 0-.314.477l-2.39 7.31h-9.675l-2.39-7.31a.93.93 0 0 0-.313-.478a.95.95 0 0 0-1.083-.058a.93.93 0 0 0-.365.438L3.47 12.794l-.035.093a6.57 6.57 0 0 0 2.18 7.595l.011.01l.033.022l5.39 4.037l2.668 2.019l1.624 1.226c.39.297.931.297 1.322 0l1.624-1.226l2.667-2.019l5.424-4.061l.013-.01a6.574 6.574 0 0 0 2.177-7.588Z"})});case"reddit":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 32 32",fill:"currentColor",children:r.jsx("path",{d:"M16 0C7.164 0 0 7.164 0 16s7.164 16 16 16s16-7.164 16-16S24.836 0 16 0m8.5 10.5a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m-17 0a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m1.5 6.5c0 1.5 1.5 2.5 3 2.5c.5 0 1-.1 1.5-.3c.5.6 1.2 1 2 1c.8 0 1.5-.4 2-1c.5.2 1 .3 1.5.3c1.5 0 3-1 3-2.5c0-1.5-1.5-2.5-3-2.5c-.5 0-1 .1-1.5.3c-.5-.6-1.2-1-2-1c-.8 0-1.5.4-2 1c-.5-.2-1-.3-1.5-.3c-1.5 0-3 1-3 2.5"})});case"spotify":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 256 256",fill:"currentColor",children:r.jsx("path",{d:"M128 0C57.308 0 0 57.309 0 128c0 70.696 57.309 128 128 128 70.697 0 128-57.304 128-32.3C256 57.314 198.697.007 127.998.007l.001-.006Zm58.699 184.614c-2.293 3.76-7.215 4.952-10.975 2.644c-30.053-18.357-67.885-22.515-112.44-12.335a7.981 7.981 0 0 1-9.552-6.007 7.968 7.968 0 0 1 6-9.553c48.76-11.14 90.583-6.344 124.323 14.276 3.76 2.308 4.952 7.215 2.644 10.975Zm15.667-34.853c-2.89 4.695-9.034 6.178-13.726 3.289c-34.406-21.148-86.853-27.273-127.548-14.92c-5.278 1.594-10.852-1.38-12.454-6.649c-1.59-5.278 1.386-10.842 6.655-12.446c46.485-14.106 104.275-7.273 143.787 17.007c4.692 2.89 6.175 9.034 3.286 13.72v-.001Zm1.345-36.293C162.457 88.964 94.394 86.71 55.007 98.666c-6.325 1.918-13.014-1.653-14.93-7.978c-1.917-6.328 1.65-13.012 7.98-14.935C93.27 62.027 168.434 64.68 215.929 92.876c5.702 3.376 7.566 10.724 4.188 16.405c-3.362 5.69-10.73 7.565-16.4 4.187h-.006Z"})});case"slack":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2447.6 2452.5",className:n,fill:"currentColor",children:r.jsxs("g",{fill:"currentColor",children:[r.jsx("path",{d:"m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z"}),r.jsx("path",{d:"m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2c-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2c-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z"}),r.jsx("path",{d:"m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z"}),r.jsx("path",{d:"M0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3c-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0"})]})});case"notion":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.28c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514c-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933z"})});case"tiktok":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M19.589 6.686a4.793 4.793 0 0 1-3.77-4.245V2h-3.445v13.672a2.896 2.896 0 0 1-5.201 1.743l-.002-.001.002.001a2.895 2.895 0 0 1 3.183-4.51v-3.5a6.329 6.329 0 0 0-5.394 10.692 6.33 6.33 0 0 0 10.857-4.424V8.687a8.182 8.182 0 0 0 4.773 1.526V6.79a4.831 4.831 0 0 1-1.003-.104z"})});case"twitch":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M3.9 2.5a.9.9 0 0 0-.9.9v14.194a.9.9 0 0 0 .9.9h4.116v3.03a.7.7 0 0 0 1.194.494l3.525-3.524h4.643a.9.9 0 0 0 .636-.264l2.722-2.722a.9.9 0 0 0 .264-.636V3.4a.9.9 0 0 0-.9-.9zm7.319 5.2a.75.75 0 0 0-1.5 0v4.272a.75.75 0 1 0 1.5 0zm5.016 0a.75.75 0 0 0-1.5 0v4.272a.75.75 0 1 0 1.5 0z",clipRule:"evenodd"})});case"dropbox":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 528 512",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M264.4 116.3l-132 84.3 132 84.3-132 84.3L0 284.1l132.3-84.3L0 116.3 132.3 32l132.1 84.3zM131.6 395.7l132-84.3 132 84.3-132 84.3-132-84.3zm132.8-111.6l132-84.3-132-83.6L395.7 32 528 116.3l-132.3 84.3L528 284.8l-132.3 84.3-131.3-85z"})});case"linear":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"1.2em",height:"1.2em",viewBox:"0 0 100 100",children:r.jsx("path",{fill:"currentColor",d:"M1.22541 61.5228c-.2225-.9485.90748-1.5459 1.59638-.857L39.3342 97.1782c.6889.6889.0915 1.8189-.857 1.5964C20.0515 94.4522 5.54779 79.9485 1.22541 61.5228ZM.00189135 46.8891c-.01764375.2833.08887215.5599.28957165.7606L52.3503 99.7085c.2007.2007.4773.3075.7606.2896 2.3692-.1476 4.6938-.46 6.9624-.9259c.7645-.157 1.0301-1.0963.4782-1.6481L2.57595 39.4485c-.55186-.5519-1.49117-.2863-1.648174.4782-.465915 2.2686-.77832 4.5932-.92588465 6.9624ZM4.21093 29.7054c-.16649.3738-.08169.8106.20765 1.1l64.77602 64.776c.2894.2894.7262.3742 1.1.2077 1.7861-.7956 3.5171-1.6927 5.1855-2.684c.5521-.328.6373-1.0867.1832-1.5407L8.43566 24.3367c-.45409-.4541-1.21271-.3689-1.54074.1832-.99132 1.6684-1.88843 3.3994-2.68399 5.1855ZM12.6587 18.074c-.3701-.3701-.393-.9637-.0443-1.3541C21.7795 6.45931 35.1114 0 49.9519 0 77.5927 0 100 22.4073 100 50.0481c0 14.8405-6.4593 28.1724-16.7199 37.3375-.3903.3487-.984.3258-1.3542-.0443L12.6587 18.074Z"})});case"huggingface":case"hugging face":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378c0 1.112.178 2.181.503 3.185c.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284c.278.173.48.408.71.694c.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542c.01.026.653 1.552 1.657 2.54c.616.605 1.01 1.223 1.082 1.912c.055.537-.096 1.059-.38 1.572c.637.121 1.294.187 1.967.187c.657 0 1.298-.063 1.921-.178c-.287-.517-.44-1.041-.384-1.581c.07-.69.465-1.307 1.081-1.913c1.004-.987 1.647-2.513 1.657-2.539c.021-.074.083-.285.233-.542c.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952c.23-.286.432-.52.71-.694c.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174a1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094c-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71c-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013a1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921a.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164c1.607-.007 2.984-1.155 3.572-1.164c.196-.003.305.12.305.454c0 .886-.424 2.328-1.563 3.202c-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026l-.01.008l-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116a1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243a1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444c-.034-.016-.104-.008-.2.022q-.094.03-.216.087q-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096a3 3 0 0 0-.26.219a2 2 0 0 0-.12.121a2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203c0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194c-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858s-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64c-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647s2.822 2.813 2.562 3.244s-1.176-.506-1.176-.506s-2.866-2.567-3.49-1.898s.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405c-.238.839-2.71-1.587-3.216-.642c-.506.946 3.49 2.056 3.522 2.064c1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194c1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858s.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64c.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647s-2.822 2.813-2.562 3.244s1.176-.506 1.176-.506s2.866-2.567 3.49-1.898s-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405c.238.839 2.71-1.587 3.216-.642c.506.946-3.49 2.056-3.522 2.064c-1.29.33-4.568 1.028-5.713-.624"})});case"kick":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"#888888",children:r.jsx("path",{d:"M9 3a1 1 0 0 1 1 1v3h1V6a1 1 0 0 1 .883-.993L12 5h1V4a1 1 0 0 1 .883-.993L14 3h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-1v1a1 1 0 0 1-.883.993L18 11h-1v2h1a1 1 0 0 1 .993.883L19 14v1h1a1 1 0 0 1 .993.883L21 16v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1h-1a1 1 0 0 1-.993-.883L11 18v-1h-1v3a1 1 0 0 1-.883.993L9 21H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"})});case"zoom":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M1.45 3.334C.648 3.334 0 3.982 0 4.783v4.986c0 1.6 1.298 2.898 2.898 2.898h6.986c.8 0 1.45-.649 1.45-1.45V6.233a2.9 2.9 0 0 0-2.899-2.899zM16 4.643v6.715c0 .544-.618.86-1.059.539l-2.059-1.498a1.33 1.33 0 0 1-.549-1.078V6.679c0-.427.204-.827.55-1.078l2.058-1.498a.667.667 0 0 1 1.059.54",clipRule:"evenodd"})});case"vk":return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M17.802 12.298s1.617 1.597 2.017 2.336a.1.1 0 0 1 .018.035q.244.409.123.645c-.135.261-.592.392-.747.403h-2.858c-.199 0-.613-.052-1.117-.4c-.385-.269-.768-.712-1.139-1.145c-.554-.643-1.033-1.201-1.518-1.201a.6.6 0 0 0-.18.03c-.367.116-.833.639-.833 2.032c0 .436-.344.684-.585.684H9.674c-.446 0-2.768-.156-4.827-2.327C2.324 10.732.058 5.4.036 5.353c-.141-.345.155-.533.475-.533h2.886c.387 0 .513.234.601.444c.102.241.48 1.205 1.1 2.288c1.004 1.762 1.621 2.479 2.114 2.479a.53.53 0 0 0 .264-.07c.644-.354.524-2.654.494-3.128c0-.092-.001-1.027-.331-1.479c-.236-.324-.638-.45-.881-.496c.065-.094.203-.238.38-.323c.441-.22 1.238-.252 2.029-.252h.439c.858.012 1.08.067 1.392.146c.628.15.64.557.585 1.943c-.016.396-.033.842-.033 1.367c0 .112-.005.237-.005.364c-.019.711-.044 1.512.458 1.841a.4.4 0 0 0 .217.062c.174 0 .695 0 2.108-2.425c.62-1.071 1.1-2.334 1.133-2.429c.028-.053.112-.202.214-.262a.5.5 0 0 1 .236-.056h3.395c.37 0 .621.056.67.196c.082.227-.016.92-1.566 3.016c-.261.349-.49.651-.691.915c-1.405 1.844-1.405 1.937.083 3.337",clipRule:"evenodd"})});case"roblox":return r.jsx("svg",{version:"1.1",id:"svg10",x:"0px",y:"0px",viewBox:"0 0 302.7 302.7",width:"1.2em",height:"1.2em",fill:"currentColor",children:r.jsx("path",{id:"path20",d:"M120.5,271.7c-110.9-28.6-120-31-119.9-31.5C0.7,239.6,62.1,0.5,62.2,0.4c0,0,54,13.8,119.9,30.8S302.1,62,302.2,62c0.2,0,0.2,0.4,0.1,0.9c-0.2,1.5-61.5,239.3-61.7,239.5C240.6,302.5,186.5,288.7,120.5,271.7z M174.9,158c3.2-12.6,5.9-23.1,6-23.4c0.1-0.5-2.3-1.2-23.2-6.6c-12.8-3.3-23.5-5.9-23.6-5.8c-0.3,0.3-12.1,46.6-12,46.7c0.2,0.2,46.7,12.2,46.8,12.1C168.9,180.9,171.6,170.6,174.9,158L174.9,158z"})});default:return r.jsx(la,{className:"w-6 h-6 text-white"})}},dw=`// Example custom migration script
|
|
929
929
|
import { migrateUser } from '@better-auth/migration';
|
|
930
930
|
|
|
931
931
|
async function run() {
|
package/public/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Better Auth Studio</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-S8anH3U1.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/main-Du6zwcd_.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|