better-auth-studio 1.0.79-beta.32 → 1.0.79-beta.33

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.
@@ -1152,4 +1152,4 @@ export const authClient = createAuthClient({
1152
1152
 
1153
1153
  }`)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Reset"}),a.jsx(B,{onClick:IP,disabled:Pe,className:"rounded-none",children:Pe?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Token"})]}),ae&&a.jsxs("div",{className:"space-y-4 border border-dashed border-white/15 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400",children:"Generated Token"}),a.jsx("p",{className:"text-white font-mono text-sm break-all mt-1",children:ae.token})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(ae.token),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Type"}),a.jsx("p",{className:"text-white mt-1 capitalize",children:ae.type.replace("_"," ")})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Expires"}),a.jsx("p",{className:"text-white mt-1",children:oP(ae.expiresAt)})]}),ae.url&&a.jsxs("div",{className:"col-span-1",children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"URL"}),a.jsx("p",{className:"text-white mt-1 break-all",children:ae.url})]})]}),ae.metadata&&a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400 mb-2",children:"Metadata"}),a.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto",children:JSON.stringify(ae.metadata,null,2)})]})]})]})]})}),Yc&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60]",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-5xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(mi,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Plugin Generator"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>dh(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Plugin Name *"}),a.jsx(ve,{value:il,onChange:D=>Om(D.target.value),placeholder:"myPlugin",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Must to be filled"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Description (optional)"}),a.jsx(ve,{value:TE,onChange:D=>Dm(D.target.value),placeholder:"Plugin description",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Leave empty to use the default description"})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Tables (optional)"}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Tn([...mn,{name:"",isExtending:!1,fields:[{name:"",type:"string",required:!1,unique:!1}]}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Table"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Tn([...mn,{name:"",isExtending:!0,extendedTableName:"",fields:[{name:"",type:"string",required:!1,unique:!1}]}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Extend Table"})]})]}),mn.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No tables added"}):a.jsx("div",{className:"space-y-2",children:mn.map((D,z)=>a.jsxs("div",{className:"border px-5 border-dashed border-white/15 p-3 relative",children:[a.jsxs("div",{className:"flex items-center space-x-2 relative",children:[D.isExtending?a.jsxs(a.Fragment,{children:[a.jsxs(bn,{value:D.extendedTableName||"",onValueChange:J=>{const re=[...mn];re[z].extendedTableName=J,re[z].name=J,Tn(re)},children:[a.jsx(vn,{className:"bg-black sm:w-40 border border-dashed border-white/20 text-white text-xs rounded-none flex-1",children:a.jsx(Gn,{className:"sm:text-[11px] text-white/90 font-mono uppercase",placeholder:"Select table"})}),a.jsx(yn,{children:Z6.map(J=>a.jsx(Fe,{className:"sm:text-[11px] uppercase font-mono text-white/90 border-b border-dashed last:border-b-0",value:J.name,children:J.displayName},J.name))})]}),a.jsx("span",{className:"text-xs text-gray-400 font-mono uppercase whitespace-nowrap",children:"(Extending)"})]}):a.jsx(ve,{value:D.name,onChange:J=>{const re=[...mn];re[z].name=J.target.value,Tn(re)},placeholder:"Table name",className:"bg-black border border-dashed border-white/20 text-white text-xs rounded-none flex-1"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{Tn(mn.filter((J,re)=>re!==z))},className:"text-red-400 hover:text-red-300 rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),D.fields.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"absolute border border-dashed w-px border-white/30",style:{left:"7px",top:"31px",bottom:"12px"}}),a.jsx("div",{className:"absolute border border-dashed h-px w-[11px] border-white/30",style:{left:"9px",top:"31px",bottom:"12px"}}),a.jsx("div",{className:"mt-3 relative",children:a.jsxs("div",{className:"space-y-0 pl-6",children:[D.fields.map((J,re)=>a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute border border-dashed h-px border-white/30 top-1/2 -translate-y-1/2",style:{left:"-36px",width:"36px"}}),a.jsxs("div",{className:"flex items-center space-x-2 py-1",children:[a.jsx(ve,{value:J.name,onChange:le=>{const he=[...mn];he[z].fields[re].name=le.target.value,Tn(he)},placeholder:"Field name",className:"bg-black border border-dashed border-white/20 text-white text-xs rounded-none flex-1"}),a.jsxs(bn,{value:J.type,onValueChange:le=>{const he=[...mn];he[z].fields[re].type=le,Tn(he)},children:[a.jsx(vn,{className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1",children:a.jsx(Gn,{className:"font-mono uppercase text-[10px] px-0 text-white/90"})}),a.jsxs(yn,{className:"font-mono uppercase text-[10px]",children:[a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"string",children:"string"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"number",children:"number"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"boolean",children:"boolean"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"date",children:"date"})]})]}),J.required&&a.jsxs("div",{className:"flex items-center",children:[J.type==="string"&&a.jsx(ve,{value:J.defaultValue||"",onChange:le=>{const he=[...mn];he[z].fields[re].defaultValue=le.target.value,Tn(he)},placeholder:"Default value",className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1 font-mono uppercase text-[10px]"}),J.type==="boolean"&&a.jsxs(bn,{value:J.defaultValue||"",onValueChange:le=>{const he=[...mn];he[z].fields[re].defaultValue=le,Tn(he)},children:[a.jsx(vn,{className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1",children:a.jsx(Gn,{className:"font-mono uppercase text-[10px] px-0 text-white/90",placeholder:"Default value"})}),a.jsxs(yn,{className:"font-mono uppercase text-[10px]",children:[a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"true",children:"true"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"false",children:"false"})]})]}),J.type==="date"&&a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs(bn,{value:J.defaultValue==="now()"?"now()":J.defaultValue&&J.defaultValue!=="now()"?"custom":"",onValueChange:le=>{const he=[...mn];if(le==="now()")he[z].fields[re].defaultValue="now()";else if(le==="custom"){if(!he[z].fields[re].defaultValue||he[z].fields[re].defaultValue==="now()"){const nt=new Date,kt=nt.getFullYear(),Xn=String(nt.getMonth()+1).padStart(2,"0"),bt=String(nt.getDate()).padStart(2,"0"),At=String(nt.getHours()).padStart(2,"0"),gs=String(nt.getMinutes()).padStart(2,"0");he[z].fields[re].defaultValue=`${kt}-${Xn}-${bt}T${At}:${gs}`}}else he[z].fields[re].defaultValue=void 0;Tn(he)},children:[a.jsx(vn,{className:"sm:h-10 sm:w-40 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1",children:a.jsx(Gn,{className:"font-mono uppercase text-[10px] px-0 text-white/90",placeholder:"Default"})}),a.jsxs(yn,{className:"font-mono uppercase text-[10px]",children:[a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"now()",children:"now()"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"custom",children:"Custom"})]})]}),J.defaultValue&&J.defaultValue!=="now()"&&a.jsx(ve,{type:"datetime-local",value:J.defaultValue,onChange:le=>{const he=[...mn];he[z].fields[re].defaultValue=le.target.value,Tn(he)},className:"sm:h-10 sm:w-40 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1 font-mono uppercase text-[10px]"})]}),J.type==="number"&&a.jsx(ve,{type:"number",value:J.defaultValue||"",onChange:le=>{const he=[...mn];he[z].fields[re].defaultValue=le.target.value,Tn(he)},placeholder:"Default value",className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1 font-mono uppercase text-[10px]"})]}),a.jsxs("div",{className:"h-8 flex items-end space-x-2",children:[a.jsx(Sf,{id:`required-${z}-${re}`,checked:J.required,onCheckedChange:le=>{const he=[...mn];he[z].fields[re].required=le===!0,le===!1&&(he[z].fields[re].defaultValue=void 0),Tn(he)}}),a.jsx(oe,{htmlFor:`required-${z}-${re}`,className:"text-xs text-gray-400 font-mono uppercase cursor-pointer",children:"Required"})]}),a.jsxs("div",{className:"flex h-8 items-end space-x-2",children:[a.jsx(Sf,{id:`unique-${z}-${re}`,checked:J.unique,onCheckedChange:le=>{const he=[...mn];he[z].fields[re].unique=le===!0,Tn(he)}}),a.jsx(oe,{htmlFor:`unique-${z}-${re}`,className:"text-xs text-gray-400 font-mono uppercase cursor-pointer",children:"Unique"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{const le=[...mn];le[z].fields=le[z].fields.filter((he,nt)=>nt!==re),Tn(le)},className:"text-red-400 hover:text-red-300 rounded-none",children:a.jsx(ut,{className:"w-3 h-3"})})]})]},re)),a.jsxs("div",{className:"relative pt-2",children:[a.jsx("div",{className:"absolute border border-dashed h-px border-white/30",style:{left:"-35px",width:"36px",top:"25px"}}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{const J=[...mn];J[z].fields.push({name:"",type:"string",required:!1,unique:!1,defaultValue:void 0}),Tn(J)},className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Field"})]})]})})]}),D.fields.length===0&&a.jsx("div",{className:"mt-3",children:a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{const J=[...mn];J[z].fields.push({name:"",type:"string",required:!1,unique:!1,defaultValue:void 0}),Tn(J)},className:"text-xs text-gray-400 hover:text-white rounded-none",children:"+ Add Field"})})]},z))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Ph,{className:"w-4 h-4 text-white"}),a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Hooks"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>dr([...qa,{name:"",timing:"before",action:"sign-up",hookLogic:"const context = ctx;",expanded:!0}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Hook"})]}),qa.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No hooks added"}):a.jsx("div",{className:"space-y-2",children:qa.map((D,z)=>{const J=`${D.timing} ${D.action==="custom"?"custom":D.action}: ${D.name||`Hook ${z+1}`}`;return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>EP(z),className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsx("span",{className:"text-xs font-mono text-white px-2 py-1 bg-black/40 border border-dashed border-white/20 rounded-none",children:J}),a.jsx(xd,{className:`w-4 h-4 text-white/60 transition-transform ${D.expanded?"rotate-90":""}`})]}),D.expanded&&a.jsxs("div",{className:"border-t border-dashed border-white/10 p-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Hook Name"}),a.jsx(ve,{value:D.name,onChange:re=>{const le=[...qa];le[z].name=re.target.value,dr(le)},placeholder:"e.g., Age Verification, TOS Check",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Timing"}),a.jsxs(t1,{value:D.timing,onValueChange:re=>{const le=[...qa];le[z].timing=re,dr(le)},className:"flex space-x-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Tl,{value:"before",id:`hook-timing-before-${z}`}),a.jsx(oe,{htmlFor:`hook-timing-before-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Before"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Tl,{value:"after",id:`hook-timing-after-${z}`}),a.jsx(oe,{htmlFor:`hook-timing-after-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"After"})]})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Action"}),a.jsxs(t1,{value:D.action,onValueChange:re=>{const le=[...qa];le[z].action=re,dr(le)},className:"flex space-x-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Tl,{value:"sign-up",id:`hook-action-signup-${z}`}),a.jsx(oe,{htmlFor:`hook-action-signup-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Sign-up"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Tl,{value:"sign-in",id:`hook-action-signin-${z}`}),a.jsx(oe,{htmlFor:`hook-action-signin-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Sign-in"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Tl,{value:"custom",id:`hook-action-custom-${z}`}),a.jsx(oe,{htmlFor:`hook-action-custom-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Custom"})]})]})]})]}),D.action==="custom"&&a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Custom Path"}),a.jsx(ve,{value:D.customPath||"",onChange:re=>{const le=[...qa];le[z].customPath=re.target.value,dr(le)},placeholder:"/my-plugin/custom-endpoint",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Custom Matcher (optional)"}),a.jsx(ve,{value:D.customMatcher||"",onChange:re=>{const le=[...qa];le[z].customMatcher=re.target.value,dr(le)},placeholder:"e.g., context.headers.get('x-custom') === 'value'",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Leave empty to use default path matching"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[a.jsx(mi,{className:"w-4 h-4 text-white"}),a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Hook Logic (TypeScript)"})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-2 font-mono",children:"This is the TypeScript code that will be executed when the hook is triggered. This function has properties like ctx so you can access the request context, headers, body, etc. Here is a simple example of a hook logic:"}),a.jsx(hw,{value:D.hookLogic,onChange:re=>{const le=[...qa];le[z].hookLogic=re,dr(le)},language:"typescript",placeholder:"const context = ctx;",className:"w-full"})]}),a.jsxs(B,{variant:"outline",onClick:()=>{dr(qa.filter((re,le)=>le!==z))},className:"w-full border border-dashed border-red-500/50 text-red-400 hover:bg-red-500/10 rounded-none",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Remove Hook"]})]})]},z)})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Fn,{className:"w-4 h-4 text-white"}),a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Middleware"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>fs([...Rr,{name:"",path:"/my-plugin/protected",pathType:"exact",middlewareLogic:"const context = ctx;",expanded:!0}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Middleware"})]}),Rr.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No middleware added"}):a.jsx("div",{className:"space-y-2",children:Rr.map((D,z)=>{const J=`${D.path}: ${D.name||`Middleware ${z+1}`}`;return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>jP(z),className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsx("span",{className:"text-xs font-mono text-white px-2 py-1 bg-black/40 border border-dashed border-white/20 rounded-none",children:J}),a.jsx(xd,{className:`w-4 h-4 text-white/60 transition-transform ${D.expanded?"rotate-90":""}`})]}),D.expanded&&a.jsxs("div",{className:"border-t border-dashed border-white/10 p-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Middleware Name"}),a.jsx(ve,{value:D.name,onChange:re=>{const le=[...Rr];le[z].name=re.target.value,fs(le)},placeholder:"e.g., Auth Check, Rate Limiter",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path"}),a.jsx(ve,{value:D.path,onChange:re=>{const le=[...Rr];le[z].path=re.target.value,fs(le)},placeholder:"/my-plugin/protected",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path Type"}),a.jsxs(bn,{value:D.pathType,onValueChange:re=>{const le=[...Rr];le[z].pathType=re,fs(le)},children:[a.jsx(vn,{className:"bg-black border border-dashed border-white/20 text-white rounded-none",children:a.jsx(Gn,{})}),a.jsxs(yn,{children:[a.jsx(Fe,{value:"exact",children:"Exact Match"}),a.jsx(Fe,{value:"prefix",children:"Prefix Match"}),a.jsx(Fe,{value:"regex",children:"Regex Match"})]})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[a.jsx(mi,{className:"w-4 h-4 text-white"}),a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Middleware Logic (TypeScript)"})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-2 font-mono",children:"This is the TypeScript code that will be executed when the middleware is triggered. You can access the request context, headers, body, etc."}),a.jsx(hw,{value:D.middlewareLogic,onChange:re=>{const le=[...Rr];le[z].middlewareLogic=re,fs(le)},language:"typescript",placeholder:"const context = ctx;",className:"w-full"})]}),a.jsxs(B,{variant:"outline",onClick:()=>{fs(Rr.filter((re,le)=>le!==z))},className:"w-full border border-dashed border-red-500/50 text-red-400 hover:bg-red-500/10 rounded-none",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Remove Middleware"]})]})]},z)})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(nc,{className:"w-4 h-4 text-white"}),a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Endpoints"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{const D="/my-plugin/endpoint",z=Fm(D);co([...ps,{name:z,path:D,method:"POST",handlerLogic:`// Endpoint handler logic here
1154
1154
  return ctx.json({ success: true });`,expanded:!0}])},className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Endpoint"})]}),ps.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No endpoints added"}):a.jsx("div",{className:"space-y-2",children:ps.map((D,z)=>{const J=`${D.method} ${D.path}: ${D.name||Fm(D.path)||`Endpoint ${z+1}`}`;return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>TP(z),className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsx("span",{className:"text-xs font-mono text-white px-2 py-1 bg-black/40 border border-dashed border-white/20 rounded-none",children:J}),a.jsx(xd,{className:`w-4 h-4 text-white/60 transition-transform ${D.expanded?"rotate-90":""}`})]}),D.expanded&&a.jsxs("div",{className:"border-t border-dashed border-white/10 p-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path"}),a.jsx(ve,{value:D.path,onChange:re=>{const le=re.target.value,he=Fm(le),nt=[...ps];nt[z].path=le,nt[z].name=he,co(nt)},placeholder:"/sign-in/anonymous",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Endpoint Name (Auto-generated)"}),a.jsx(ve,{value:D.name,readOnly:!0,className:"bg-black/50 border border-dashed border-white/10 text-white/70 rounded-none cursor-not-allowed"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Generated from path"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Method"}),a.jsxs(bn,{value:D.method,onValueChange:re=>{const le=[...ps];le[z].method=re,co(le)},children:[a.jsx(vn,{className:"bg-black border border-dashed border-white/20 text-white rounded-none",children:a.jsx(Gn,{})}),a.jsxs(yn,{children:[a.jsx(Fe,{value:"GET",children:"GET"}),a.jsx(Fe,{value:"POST",children:"POST"})]})]})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[a.jsx(mi,{className:"w-4 h-4 text-white"}),a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Handler Logic (TypeScript)"})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-2 font-mono",children:"This is the TypeScript code that will be executed when the endpoint is called. You can access the context via ctx parameter."}),a.jsx(hw,{value:D.handlerLogic,onChange:re=>{const le=[...ps];le[z].handlerLogic=re,co(le)},language:"typescript",placeholder:"// Endpoint handler logic here\\nreturn ctx.json({ success: true });",className:"w-full"})]}),a.jsxs(B,{variant:"outline",onClick:()=>{co(ps.filter((re,le)=>le!==z))},className:"w-full border border-dashed border-red-500/50 text-red-400 hover:bg-red-500/10 rounded-none",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Remove Endpoint"]})]})]},z)})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[a.jsx(Sf,{id:"rate-limit",checked:Im,onCheckedChange:D=>Mm(D===!0)}),a.jsx(oe,{htmlFor:"rate-limit",className:"text-xs uppercase font-mono text-gray-400 cursor-pointer",children:"Enable Rate Limiting"})]}),Im&&a.jsxs("div",{className:"border border-dashed border-white/10 p-4 space-y-4 mt-3",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path"}),a.jsx(ve,{value:sa.path,onChange:D=>{ai({...sa,path:D.target.value})},placeholder:"/my-plugin/*",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path Type"}),a.jsxs(bn,{value:sa.pathType,onValueChange:D=>{ai({...sa,pathType:D})},children:[a.jsx(vn,{className:"bg-black border border-dashed border-white/20 text-white rounded-none",children:a.jsx(Gn,{})}),a.jsxs(yn,{children:[a.jsx(Fe,{value:"exact",children:"Exact Match"}),a.jsx(Fe,{value:"prefix",children:"Prefix Match"}),a.jsx(Fe,{value:"regex",children:"Regex Match"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Window (ms)"}),a.jsx(ve,{type:"number",value:sa.window||"",onChange:D=>{const z=D.target.value;ai({...sa,window:z===""?0:parseInt(z,10)||0})},onBlur:D=>{(!D.target.value||parseInt(D.target.value,10)<=0)&&ai({...sa,window:15*60*1e3})},placeholder:"900000",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Time window in milliseconds (e.g., 900000 = 15 minutes)"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Max Requests"}),a.jsx(ve,{type:"number",value:sa.max||"",onChange:D=>{const z=D.target.value;ai({...sa,max:z===""?0:parseInt(z,10)||0})},onBlur:D=>{(!D.target.value||parseInt(D.target.value,10)<=0)&&ai({...sa,max:100})},placeholder:"100",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Maximum requests per window"})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{Om(""),Dm(""),Lm("react"),Tn([]),dr([]),fs([]),co([]),Mm(!1),ai({path:"/my-plugin/*",pathType:"prefix",window:15*60*1e3,max:100}),Wc(null),Xc(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Reset"}),a.jsx(B,{onClick:kP,disabled:kE||!il.trim(),className:"rounded-none",children:kE?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Plugin"})]}),_E&&a.jsx("div",{className:"border border-dashed border-red-500/30 bg-red-500/10 text-red-300 text-xs font-mono p-3 rounded-none",children:_E}),Pt&&a.jsxs("div",{ref:CE,className:"space-y-4 border border-dashed border-white/15 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400",children:"Generated Code"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[ri==="clientSetup"&&a.jsxs("div",{className:"flex items-center space-x-2 mr-2",children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 whitespace-nowrap",children:"Framework:"}),a.jsxs(bn,{value:OE,onValueChange:D=>{Lm(D),CP(D)},children:[a.jsx(vn,{className:"bg-black sm:w-56 border border-dashed border-white/20 text-white rounded-none w-[220px] h-10 text-xs font-mono uppercase px-4 py-2",children:a.jsx(Gn,{className:"font-mono uppercase text-xs text-white"})}),a.jsxs(yn,{className:"font-mono uppercase text-[10px] bg-black border border-dashed border-white/20",children:[a.jsxs(Fe,{value:"react",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","React"]}),a.jsxs(Fe,{value:"svelte",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","Svelte"]}),a.jsxs(Fe,{value:"solid",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","Solid"]}),a.jsxs(Fe,{value:"vue",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","Vue"]})]})]})]}),a.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>{var nt,kt,Xn,bt,At;const D=Pt[ri],z=((At=[{id:"server",path:((nt=Pt.filePaths)==null?void 0:nt.server)||`plugin/${Pt.name}/index.ts`},{id:"client",path:((kt=Pt.filePaths)==null?void 0:kt.client)||`plugin/${Pt.name}/client/index.ts`},{id:"serverSetup",path:((Xn=Pt.filePaths)==null?void 0:Xn.serverSetup)||"auth.ts"},{id:"clientSetup",path:((bt=Pt.filePaths)==null?void 0:bt.clientSetup)||"auth-client.ts"}].find(gs=>gs.id===ri))==null?void 0:At.path)||`${Pt.name}-${ri}.ts`,J=new Blob([D],{type:"text/plain"}),re=window.URL.createObjectURL(J),le=document.createElement("a");le.href=re;const he=z.split("/").pop()||z;le.download=he,document.body.appendChild(le),le.click(),document.body.removeChild(le),window.URL.revokeObjectURL(re)},className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(Bl,{className:"w-4 h-4 mr-1"}),"Download"]})]})]}),a.jsx("div",{className:"flex space-x-2 border-b border-dashed border-white/10",children:[{id:"server",label:"Server Plugin",path:((ME=Pt.filePaths)==null?void 0:ME.server)||`plugin/${Pt.name}/index.ts`},{id:"client",label:"Client Plugin",path:((LE=Pt.filePaths)==null?void 0:LE.client)||`plugin/${Pt.name}/client/index.ts`},{id:"serverSetup",label:"Server Setup",path:((UE=Pt.filePaths)==null?void 0:UE.serverSetup)||"auth.ts"},{id:"clientSetup",label:"Client Setup",path:((PE=Pt.filePaths)==null?void 0:PE.clientSetup)||"auth-client.ts"}].map(D=>a.jsx("button",{onClick:()=>RE(D.id),className:`px-3 py-2 text-xs uppercase font-mono border-b-2 transition-colors ${ri===D.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white"}`,title:D.path,children:D.label},D.id))}),a.jsx("div",{className:"border border-dashed border-white/10",children:a.jsx(b6,{code:Pt[ri],language:"typescript",fileName:((HE=[{id:"server",path:((FE=Pt.filePaths)==null?void 0:FE.server)||`plugin/${Pt.name}/index.ts`},{id:"client",path:((zE=Pt.filePaths)==null?void 0:zE.client)||`plugin/${Pt.name}/client/index.ts`},{id:"serverSetup",path:((BE=Pt.filePaths)==null?void 0:BE.serverSetup)||"auth.ts"},{id:"clientSetup",path:(($E=Pt.filePaths)==null?void 0:$E.clientSetup)||"auth-client.ts"}].find(D=>D.id===ri))==null?void 0:HE.path)||`${Pt.name}-${ri}.ts`})})]})]})]})}),G&&O&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 overflow-hidden",onClick:D=>{D.target===D.currentTarget&&(k(!1),$(null))},children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",onClick:D=>D.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Ep,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Configuration Validator"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{k(!1),$(null)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"mb-6 p-4 border border-dashed border-white/10",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Summary"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.total}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Total Checks"})]}),a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.passes}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Passed"})]}),a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.errors}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Errors"})]}),a.jsxs("div",{className:"text-left",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.warnings}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Warnings"})]})]})]}),a.jsx("div",{className:"space-y-4",children:Object.entries(O.results.reduce((D,z)=>(D[z.category]||(D[z.category]=[]),D[z.category].push(z),D),{})).map(([D,z])=>{if(D==="OAuth Providers"){const J=z.reduce((re,le)=>{const he=le.check.match(/^(.+?)\s*-\s*(.+)$/);if(he){const nt=he[1],kt=he[2];re[nt]||(re[nt]=[]),re[nt].push({...le,check:kt})}else re.General||(re.General=[]),re.General.push(le);return re},{});return a.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[a.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[D,a.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",z.length," check",z.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"space-y-2",children:Object.entries(J).map(([re,le])=>{const he=Y.has(re),nt=le.some(bt=>bt.severity==="error"),kt=le.some(bt=>bt.severity==="warning"),Xn=le.every(bt=>bt.status==="pass");return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>{X(bt=>{const At=new Set(bt);return At.has(re)?At.delete(re):At.add(re),At})},className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(xd,{className:`w-4 h-4 text-white/60 transition-transform ${he?"rotate-90":""}`}),a.jsx("span",{className:"text-white font-mono text-sm",children:re}),a.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["(",le.length," check",le.length!==1?"s":"",")"]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[nt&&a.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Error"}),kt&&!nt&&a.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Warning"}),Xn&&!nt&&!kt&&a.jsx(kd,{className:"w-4 h-4 text-white/60"})]})]}),he&&a.jsx("div",{className:"border-t border-dashed border-white/10 space-y-2 p-2",children:le.map((bt,At)=>a.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${bt.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"mt-0.5",children:bt.severity==="error"?a.jsx(Es,{className:"w-4 h-4 text-white/60"}):bt.severity==="warning"?a.jsx(Nl,{className:"w-4 h-4 text-white/60"}):bt.status==="pass"?a.jsx(kd,{className:"w-4 h-4 text-white/60"}):a.jsx($l,{className:"w-4 h-4 text-white/40"})}),a.jsxs("div",{className:"flex-1 text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:bt.check}),a.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:bt.status.toUpperCase()})]}),a.jsx("p",{className:"text-gray-300 text-sm",children:bt.message}),bt.suggestion&&a.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),a.jsx("p",{className:"text-xs text-gray-300",children:bt.suggestion})]})]})]})},`${re}-${bt.check}-${At}`))})]},re)})})]},D)}return a.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[a.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[D,a.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",z.length," check",z.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"space-y-3",children:z.map((J,re)=>a.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${J.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"mt-0.5",children:J.severity==="error"?a.jsx(Es,{className:"w-4 h-4 text-white/60"}):J.severity==="warning"?a.jsx(Nl,{className:"w-4 h-4 text-white/60"}):J.status==="pass"?a.jsx(kd,{className:"w-4 h-4 text-white/60"}):a.jsx($l,{className:"w-4 h-4 text-white/40"})}),a.jsxs("div",{className:"flex-1 text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:J.check}),a.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:J.status.toUpperCase()})]}),a.jsx("p",{className:"text-gray-300 text-sm",children:J.message}),J.suggestion&&a.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),a.jsx("p",{className:"text-xs text-gray-300",children:J.suggestion})]})]})]})},`${J.category}-${J.check}-${re}`))})]},D)})}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsx(B,{variant:"outline",onClick:()=>{k(!1),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),it&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",onClick:D=>{D.target===D.currentTarget&&ct(!1)},children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",onClick:D=>D.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Ph,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"UUID Generator"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>ct(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generate UUIDs"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Count (1-100)"}),a.jsx(ve,{type:"number",value:ne,onChange:D=>{const z=D.target.value;if(z===""){K("");return}const J=parseInt(z);isNaN(J)||K(z)},onBlur:D=>{const z=D.target.value,J=parseInt(z);isNaN(J)||J<1?K("1"):J>100?K("100"):K(String(J))},min:"1",max:"100",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{K("1"),ge([])},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(B,{onClick:vP,className:"rounded-none",children:"Generate UUIDs"})]})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Validate UUID"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx("div",{children:a.jsx(ve,{value:Ke,onChange:D=>{We(D.target.value)},onBlur:yP,placeholder:"Paste UUID to validate",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"})}),a.jsx("div",{className:"flex items-end justify-end space-x-2",children:a.jsx(B,{variant:"outline",onClick:()=>{We(""),Ct(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"})})]}),De&&a.jsx("div",{className:`mt-2 border border-dashed p-3 rounded-none ${De.isValid?"border-white/10 bg-black/40":"border-red-500/30 bg-red-500/10"}`,children:a.jsxs("div",{className:"text-xs font-mono space-y-1",children:[a.jsx("div",{className:`${De.isValid?"text-green-400":"text-red-300"}`,children:De.isValid?"✓ Valid UUID":"✗ Invalid UUID"}),De.isValid&&De.version&&a.jsxs("div",{className:"text-gray-400",children:["Version: ",De.version]}),De.isValid&&De.variant&&a.jsxs("div",{className:"text-gray-400",children:["Variant: ",De.variant]})]})})]}),de.length>0&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400",children:"Generated UUIDs"}),a.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>Ga(de.join(`
1155
- `)),className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(Sa,{className:"w-4 h-4 mr-1"}),"Copy All"]})]}),a.jsx("div",{className:"border border-dashed border-white/10 p-3",children:a.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:de.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs break-all",children:D}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(D),className:"text-gray-400 hover:text-white rounded-none ml-2",children:a.jsx(Sa,{className:"w-3 h-3"})})]},z))})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Version"}),a.jsx("p",{className:"text-white text-sm",children:"v4 (Random)"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Cryptographically random"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm",children:"8-4-4-4-12"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"36 characters"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Standard"}),a.jsx("p",{className:"text-white text-sm",children:"RFC 4122"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Universally unique"})]})]})]})]})}),Wn&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(tc,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Strength Checker"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>ss(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{type:jr?"text":"password",value:Ks,onChange:D=>$n(D.target.value),placeholder:"Enter password to check",className:"w-full bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>cs(!jr),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:jr?a.jsx(gf,{className:"w-4 h-4"}):a.jsx(Us,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{$n(""),is(null),cs(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(B,{onClick:hP,disabled:os||!Ks.trim(),className:"rounded-none",children:os?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):"Check Strength"})]}),Bt&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Strength"}),a.jsx("p",{className:`text-sm font-medium ${Bt.strength==="very-strong"?"text-green-400":Bt.strength==="strong"?"text-green-300":Bt.strength==="good"?"text-yellow-300":Bt.strength==="fair"?"text-orange-300":"text-red-300"}`,children:Bt.strength.split("-").map(D=>D.charAt(0).toUpperCase()+D.slice(1)).join(" ")}),a.jsx("div",{className:"w-full bg-black/40 h-2 rounded-none",children:a.jsx("div",{className:`h-full transition-all ${Bt.strength==="very-strong"?"bg-green-400 w-full":Bt.strength==="strong"?"bg-green-300 w-4/5":Bt.strength==="good"?"bg-yellow-300 w-3/5":Bt.strength==="fair"?"bg-orange-300 w-2/5":"bg-red-300 w-1/5"}`})})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Score"}),a.jsxs("p",{className:"text-white text-sm",children:[Bt.score," / 5"]}),a.jsx("p",{className:"text-gray-500 text-xs",children:Bt.score===5?"Excellent":Bt.score===4?"Very Good":Bt.score===3?"Good":Bt.score===2?"Fair":"Weak"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Config Match"}),a.jsx("p",{className:`text-sm ${Bt.meetsConfig?"text-green-400":"text-red-300"}`,children:Bt.meetsConfig?"✓ Meets Requirements":"✗ Fails Requirements"}),a.jsxs("p",{className:"text-gray-500 text-xs",children:[Bt.configRequirements.minLength," -"," ",Bt.configRequirements.maxLength," chars"]})]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Checks"}),a.jsx("div",{className:"space-y-2",children:Bt.checks.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs",children:D.name}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:`text-xs font-mono ${D.passed?"text-green-400":"text-red-300"}`,children:D.passed?"✓":"✗"}),a.jsx("span",{className:"text-xs text-gray-400 font-mono",children:D.message})]})]},z))})]})]})]})]})}),Tr&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ha,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"OAuth Credentials"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Zs(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Select Provider"}),a.jsx("div",{className:"flex flex-wrap gap-3",children:["google","github"].map(D=>{const z=f===D;return a.jsx("button",{onClick:()=>m(D),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors ${z?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:D.charAt(0).toUpperCase()+D.slice(1)},D)})})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Origin"}),a.jsx(ve,{value:ba,onChange:D=>na(D.target.value),placeholder:`http://${$a}`,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:["The default will be http://",$a]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{aa(null),na($a)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(B,{onClick:xP,disabled:lr||!f||!ba.trim()&&!$a,className:"rounded-none",children:lr?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Fetching..."]}):"Fetch Credentials"})]}),va&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client ID"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{value:va.clientId,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(va.clientId),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{type:ei?"text":"password",value:va.clientSecret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-20 rounded-none"}),a.jsxs("div",{className:"absolute right-0 top-0 h-full flex items-center",children:[a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>rl(!ei),className:"px-2 text-gray-400 hover:text-white rounded-none",children:ei?a.jsx(gf,{className:"w-4 h-4"}):a.jsx(Us,{className:"w-4 h-4"})}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(va.clientSecret),className:"px-2 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-4 h-4"})})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dashed border-white/10",children:[a.jsx("div",{className:"flex-1",children:St&&a.jsx("div",{className:"text-xs font-mono",children:St.success?a.jsxs("span",{className:"text-green-400 uppercase",children:["✓ ",St.message.toLowerCase(),a.jsxs("span",{className:"block normal-case text-gray-400",children:[a.jsx("span",{className:"text-gray-400 mr-1",children:">"})," ",St.path]})]}):a.jsxs("span",{className:"text-red-300",children:["✗ ",St.message]})})}),a.jsx(B,{onClick:bP,disabled:ti||us,className:"rounded-none",children:us?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):ti?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ph,{className:"w-4 h-4 mr-2"}),"Write to .env"]})})]})]})]})]})}),lo&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(So,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Secret Generator"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>hs(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Length (bytes)"}),a.jsx(ve,{type:"number",value:ra===0?"":ra,onChange:D=>{const z=D.target.value;if(z===""){ya(0);return}const J=parseInt(z,10);isNaN(J)||ya(J)},onBlur:D=>{const z=parseInt(D.target.value,10);isNaN(z)||z<16?ya(32):z>128?ya(128):ya(z)},min:"16",max:"128",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:"Recommended: 32 bytes (256 bits)"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Format"}),a.jsx("div",{className:"flex gap-3",children:[{id:"hex",label:"Hex"},{id:"base64",label:"Base64"}].map(D=>a.jsx("button",{onClick:()=>_r(D.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors flex-1 ${Ar===D.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:D.label},D.id))})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{Ve(null),ya(32),_r("hex")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(B,{onClick:pP,disabled:qt,className:"rounded-none",children:qt?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Secret"})]}),Se&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Length"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.length," bytes"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Entropy"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.entropy," bits"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm uppercase",children:Se.format})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generated Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{value:Se.secret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(Se.secret),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-3 h-3"})})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Environment Variable Format"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{value:Se.envFormat,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(Se.envFormat),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-3 h-3"})})]}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-2",children:["Add this to your ",a.jsx("code",{className:"text-gray-400",children:".env"})," file. Keep it secret and never commit it to version control."]})]}),a.jsx("div",{className:"flex justify-end space-x-2 pt-2",children:a.jsx(B,{variant:"outline",onClick:mP,disabled:fe||Ie,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:fe||Ie?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),Ie?"Writing...":"Checking..."]}):"Write to .env"})}),a.jsx("div",{className:"border border-dashed border-white/20 bg-black text-gray-300 text-xs font-mono p-3 rounded-none",children:a.jsxs("div",{className:"flex items-start space-x-2",children:[a.jsx(Nl,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-400"}),a.jsxs("div",{children:[a.jsx("div",{className:"uppercase font-mono mb-2 text-gray-400 tracking-wider",children:"Security Best Practices"}),a.jsxs("ul",{className:"list-disc list-inside space-y-1 text-[11px] text-gray-300",children:[a.jsx("li",{children:"Use a minimum of 32 bytes (256 bits) for production"}),a.jsx("li",{children:"Store secrets in environment variables, never in code"}),a.jsx("li",{children:"Use different secrets for development and production"}),a.jsx("li",{children:"Rotate secrets periodically for enhanced security"})]})]})]})})]})]})]})}),kr&&ds&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nl,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Credentials?"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{ni(!1),cr(null),Ha(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:["The following"," ",a.jsx("span",{className:"text-white uppercase",children:(f==null?void 0:f.charAt(0).toUpperCase())+(f==null?void 0:f.slice(1))})," ","credentials already exist in"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:ds.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:Object.entries(ds.credentials).map(([D,z])=>a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:D}),a.jsx("span",{className:"text-gray-500",children:z.length>20?`${z.substring(0,20)}...`:z})]},D))})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(B,{variant:"outline",onClick:()=>{ni(!1),cr(null),Ha(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(B,{variant:"outline",onClick:()=>Pm("append"),disabled:ti,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Append"}),a.jsx(B,{onClick:()=>Pm("override"),disabled:ti,className:"rounded-none",children:ti?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})}),sl&&Ne&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nl,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Secret?"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{we(!1),ke(null),je(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:[a.jsx("span",{className:"text-white uppercase",children:"BETTER_AUTH_SECRET"})," already exists in"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:Ne.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:"BETTER_AUTH_SECRET"}),a.jsx("span",{className:"text-gray-500",children:Ne.secret&&Ne.secret.length>20?`${Ne.secret.substring(0,20)}...`:Ne.secret||"***"})]})})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(B,{variant:"outline",onClick:()=>{we(!1),ke(null),je(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(B,{onClick:()=>IE("override"),disabled:Ie,className:"rounded-none",children:Ie?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})})]})}function upe(){const{userId:e}=iS(),t=ga(),[n,r]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState([]),[h,d]=p.useState([]),[f,m]=p.useState(!0),[y,b]=p.useState("details"),[w,x]=p.useState(!1),[v,g]=p.useState(!1),[N,S]=p.useState(!1),[E,j]=p.useState(!1),[R,L]=p.useState(!1),[P,U]=p.useState("random"),[F,q]=p.useState(!1),[A,M]=p.useState(!1),[C,T]=p.useState(!1),[_,I]=p.useState(""),[G,k]=p.useState(),[O,$]=p.useState(!1),[Y,X]=p.useState(""),[ee,Q]=p.useState([]),[W,se]=p.useState(!1),[be,ie]=p.useState(!1),[xe,ye]=p.useState(!1),[Le,He]=p.useState(!1),[ze,$e]=p.useState(!1),[rt,Je]=p.useState(!1),[ue,Ue]=p.useState({}),Re=p.useRef({}),Ce=p.useCallback(async()=>{try{const pe=await(await fetch("/api/admin/status")).json();$(pe.enabled)}catch{$(!1)}},[]),Xe=p.useCallback(async Z=>{try{const pe=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:Z})});if(pe.ok){const ae=await pe.json();if(ae.success&&ae.location)return ae.location}return null}catch{return null}},[]),ot=p.useCallback(async Z=>{const pe=Z.filter(Pe=>!Re.current[Pe.id]);if(pe.length===0)return;const ae=await Promise.all(pe.map(async Pe=>{const Ge=await Xe(Pe.ipAddress);return Ge?{sessionId:Pe.id,location:Ge}:null})),_e={};ae.forEach(Pe=>{Pe&&(_e[Pe.sessionId]=Pe.location)}),Object.keys(_e).length>0&&(Re.current={...Re.current,..._e},Ue(Re.current))},[Xe]),st=Z=>{if(!Z)return"🌍";const pe=Z.toUpperCase().split("").map(ae=>127397+ae.charCodeAt(0));return String.fromCodePoint(...pe)},Ht=Z=>Z?Z.replace(/[_-]/g," ").replace(/\b\w/g,pe=>pe.toUpperCase()):"Unknown Provider",nn=Z=>{if(!Z)return"Unknown";const pe=new Date(Z);return Number.isNaN(pe.getTime())?"Unknown":pe.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},wt=p.useCallback(async()=>{try{const Z=await fetch(`/api/users/${e}`);if(Z.ok){const pe=await Z.json();r(pe.user)}else V.error("Failed to fetch user details"),t("/users")}catch{V.error("Failed to fetch user details"),t("/users")}finally{m(!1)}},[e,t]),xt=p.useCallback(async()=>{try{const[Z,pe,ae]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(Z.ok){const _e=await Z.json();i(_e.memberships||[])}if(pe.ok){const _e=await pe.json();l(_e.memberships||[])}if(ae.ok){const Pe=(await ae.json()).sessions||[];u(Pe),ot(Pe)}}catch{}},[e,ot]),Tt=p.useCallback(async()=>{try{const Z=await fetch(`/api/users/${e}/accounts`);if(Z.ok){const pe=await Z.json();d(pe.accounts||[])}}catch{}},[e]),Nt=async()=>{var _e,Pe;if(!n)return;const Z=(_e=document.getElementById("edit-name"))==null?void 0:_e.value,pe=(Pe=document.getElementById("edit-email"))==null?void 0:Pe.value;if(!Z||!pe){V.error("Please fill in all fields");return}ie(!0);const ae=V.loading("Updating user...");try{const it=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Z,email:pe,role:Y||null})})).json();it.success?(r({...n,name:Z,email:pe,role:Y||void 0}),x(!1),X(""),V.success("User updated successfully!",{id:ae})):V.error(`Error updating user: ${it.error||"Unknown error"}`,{id:ae})}catch{V.error("Error updating user",{id:ae})}finally{ie(!1)}},pn=async()=>{if(!n)return;ye(!0);const Z=V.loading("Deleting user...");try{const ae=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ae.success?(V.success("User deleted successfully!",{id:Z}),t("/users")):V.error(`Error deleting user: ${ae.error||"Unknown error"}`,{id:Z})}catch{V.error("Error deleting user",{id:Z})}finally{ye(!1)}},jn=async()=>{if(!n)return;if(!O){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}He(!0);const Z=V.loading("Banning user...");try{const pe=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:_||"No reason provided",banExpiresIn:G})}),ae=await pe.json();pe.ok?(V.success("User banned successfully!",{id:Z}),g(!1),I(""),k(void 0),wt()):pe.status===403?V.error("You do not have permission to ban users. Admin role required.",{id:Z}):ae.adminPluginEnabled&&ae.instructions?V.error(`${ae.error}`,{id:Z,duration:6e3,description:`Use: ${ae.instructions.example}`}):V.error(`Error banning user: ${ae.error||ae.message||"Unknown error"}`,{id:Z})}catch{V.error("Error banning user",{id:Z})}finally{He(!1)}},ce=async()=>{if(!n)return;if(!O){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}$e(!0);const Z=V.loading("Unbanning user...");try{const pe=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),ae=await pe.json();pe.ok?(V.success("User unbanned successfully!",{id:Z}),S(!1),wt()):pe.status===403?V.error("You do not have permission to unban users. Admin role required.",{id:Z}):ae.adminPluginEnabled&&ae.instructions?V.error(`${ae.error}`,{id:Z,duration:6e3,description:`Use: ${ae.instructions.example}`}):V.error(`Error unbanning user: ${ae.error||ae.message||"Unknown error"}`,{id:Z})}catch{V.error("Error unbanning user",{id:Z})}finally{$e(!1)}},Ae=async Z=>{const pe=V.loading("Removing user from organization...");try{const _e=await(await fetch(`/api/organizations/members/${Z}`,{method:"DELETE"})).json();_e.success?(i(Pe=>Pe.filter(Ge=>Ge.id!==Z)),xt(),V.success("User removed from organization!",{id:pe})):V.error(`Error removing user: ${_e.error||"Unknown error"}`,{id:pe})}catch{V.error("Error removing user from organization",{id:pe})}},at=async Z=>{const pe=V.loading("Removing user from team...");try{const _e=await(await fetch(`/api/teams/members/${Z}`,{method:"DELETE"})).json();_e.success?(l(Pe=>Pe.filter(Ge=>Ge.id!==Z)),xt(),V.success("User removed from team!",{id:pe})):V.error(`Error removing user: ${_e.error||"Unknown error"}`,{id:pe})}catch{V.error("Error removing user from team",{id:pe})}},tt=async Z=>{const pe=V.loading("Deleting session...");try{const _e=await(await fetch(`/api/sessions/${Z}`,{method:"DELETE"})).json();_e.success?(u(Pe=>Pe.filter(Ge=>Ge.id!==Z)),V.success("Session deleted successfully!",{id:pe})):V.error(`Error deleting session: ${_e.error||"Unknown error"}`,{id:pe})}catch{V.error("Error deleting session",{id:pe})}},Oe=async Z=>{if(!e)return;const pe=V.loading("Unlinking account...");try{const ae=await fetch(`/api/users/${e}/accounts/${Z}`,{method:"DELETE"}),_e=await ae.json();ae.ok&&_e.success?(d(Pe=>Pe.filter(Ge=>Ge.id!==Z)),await Tt(),V.success("Account unlinked successfully",{id:pe})):V.error(_e.error||"Failed to unlink account",{id:pe})}catch{V.error("Failed to unlink account",{id:pe})}};p.useEffect(()=>{e&&(wt(),xt(),Tt(),Ce())},[e,Ce,wt,xt,Tt]);const Be=async(Z=3)=>{if(e){Q([]),se(!0),Q([{id:"start",type:"info",message:`Starting session seeding process for ${Z} sessions...`,timestamp:new Date}]);try{const ae=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Z})})).json();if(ae.success){const _e=ae.results.map((Ge,it)=>Ge.success?{id:`session-${it}`,type:"progress",message:`Creating session ${it+1}: ${Ge.session.token.substring(0,20)}... from ${Ge.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${it}`,type:"error",message:`Failed to create session ${it+1}: ${Ge.error}`,timestamp:new Date});Q(Ge=>[...Ge,..._e]);const Pe=ae.results.filter(Ge=>Ge.success).length;Q(Ge=>[...Ge,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${Pe}/${Z} sessions successfully`,timestamp:new Date}]),xt()}else Q(_e=>[..._e,{id:"error",type:"error",message:`❌ Session seeding failed: ${ae.error||"Unknown error"}`,timestamp:new Date}])}catch(pe){Q(ae=>[...ae,{id:"error",type:"error",message:`❌ Network error: ${pe}`,timestamp:new Date}])}finally{se(!1)}}},Ee=async(Z=3,pe="random")=>{if(e){Q([]),se(!0),Q([{id:"start",type:"info",message:`Starting account seeding process for ${Z} accounts...`,timestamp:new Date}]);try{const _e=await(await fetch(`/api/users/${e}/seed-accounts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Z,providerId:pe})})).json();if(_e.success){const Pe=_e.results.map((it,ct)=>{var ne;return it.success?{id:`account-${ct}`,type:"progress",message:`Creating account ${ct+1}: ${it.account.providerId||it.account.provider} (${((ne=it.account.accountId)==null?void 0:ne.substring(0,20))||it.account.id.substring(0,20)}...)`,timestamp:new Date,status:"completed"}:{id:`account-${ct}`,type:"error",message:`Failed to create account ${ct+1}: ${it.error}`,timestamp:new Date}});Q(it=>[...it,...Pe]);const Ge=_e.results.filter(it=>it.success).length;Q(it=>[...it,{id:"complete",type:"success",message:`✅ Account seeding completed! Created ${Ge}/${Z} accounts successfully`,timestamp:new Date}]),Tt()}else Q(Pe=>[...Pe,{id:"error",type:"error",message:`❌ Account seeding failed: ${_e.error||"Unknown error"}`,timestamp:new Date}])}catch(ae){Q(_e=>[..._e,{id:"error",type:"error",message:`❌ Network error: ${ae}`,timestamp:new Date}])}finally{se(!1)}}};return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Mr,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(gt,{id:n.id,nonSliced:!0,variant:"subscript"}),n.role&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:n.role}),n.banned&&a.jsxs("sup",{className:"relative group inline-block ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none cursor-help",children:["Banned",n.banReason&&a.jsxs("span",{className:"absolute lowercase left-1/2 -translate-x-1/2 bottom-full mb-3 px-2 py-2 text-[10px] font-mono text-gray-300 bg-black border border-dashed border-white/20 rounded-none whitespace-nowrap opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-150 pointer-events-none z-50",children:[a.jsx("span",{className:"text-gray-400 font-mono text-xs uppercase mr-1",children:"Banned Reason:"}),n.banReason,a.jsx("span",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0 border-l-[4px] border-r-[4px] border-t-[4px] border-transparent border-t-white/20"})]})]})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs("div",{className:"relative",children:[a.jsx(B,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:Z=>{Z.stopPropagation(),T(!C)},children:a.jsx(u3,{className:"w-4 h-4"})}),C&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:Z=>Z.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),x(!0),X(n.role||"")},children:[a.jsx("span",{children:"Edit User"}),a.jsx(Ho,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),q(!0)},children:[a.jsx("span",{children:"Update Password"}),a.jsx(Fn,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}),O&&(n.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-green-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),S(!0)},children:[a.jsx("span",{children:"Unban User"}),a.jsx(rx,{className:"w-3 h-3 text-green-400/10 group-hover:text-green-400/70 transition-colors"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-yellow-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),g(!0)},children:[a.jsx("span",{children:"Ban User"}),a.jsx(rx,{className:"w-3 h-3 text-yellow-400/10 group-hover:text-yellow-400/70 transition-colors"})]})),a.jsxs("div",{className:"flex flex-col items-center justify-center",children:[a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-2 w-[calc(100%)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-red-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),M(!0)},children:[a.jsx("span",{children:"Delete User"}),a.jsx(Ju,{className:"w-3 h-3 text-red-400/10 group-hover:text-red-400/70 transition-colors"})]})]})]})})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/20",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Mr},{id:"organizations",name:"Organizations",icon:qn,count:s.length},{id:"teams",name:"Teams",icon:Ft,count:o.length},{id:"accounts",name:"Accounts",icon:Hl,count:h.length},{id:"sessions",name:"Sessions",icon:_N,count:c.length}].map(Z=>a.jsxs("button",{onClick:()=>b(Z.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${y===Z.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(Z.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"font-mono uppercase text-xs font-normal",children:Z.name}),Z.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(In,{value:Z.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},Z.id))})}),a.jsxs("div",{className:"p-6",children:[y==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Mr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Ns,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(jae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Eae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(hr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ns,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ds,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),y==="organizations"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Organizations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:s.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Organizations this user belongs to"})]})}),s.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(qn,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):a.jsx("div",{className:"grid gap-4",children:s.map(Z=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:Z.organization.image?a.jsx("img",{src:Z.organization.image,alt:Z.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(qn,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Z.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Z.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in ",Z.organization.slug]}),a.jsx("button",{onClick:pe=>{pe.stopPropagation(),t(`/organizations/${Z.organization.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View organization details",children:a.jsx(wu,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>Ae(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},Z.id))})]}),y==="teams"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Teams this user belongs to"})]})}),o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Ft,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):a.jsx("div",{className:"grid gap-4",children:o.map(Z=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(Ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Z.team.name,a.jsx(gt,{id:Z.team.id,variant:"subscript",nonSliced:!!(Z.team.organizationSlug||Z.team.organizationName)})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in"," ",Z.team.organizationSlug||Z.team.organizationName]}),a.jsx("button",{onClick:pe=>{pe.stopPropagation(),Z.team.organizationId?t(`/organizations/${Z.team.organizationId}/teams/${Z.team.id}`):t(`/teams/${Z.team.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View team details",children:a.jsx(wu,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>at(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},Z.id))})]}),y==="accounts"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Linked Accounts",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:h.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user OAuth account connections"})]}),a.jsxs(B,{variant:"outline",onClick:()=>{Q([]),se(!1),L(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Hl,{className:"w-4 h-4 mr-2"}),"Seed Accounts"]})]}),h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Hl,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),a.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):a.jsx("div",{className:"grid gap-4",children:h.map(Z=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:K6(Z.providerId)}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Ht(Z.providerId),a.jsx(gt,{id:Z.accountId,variant:"subscript",nonSliced:!!(Z.email||n.email)})]}),a.jsx("p",{className:"text-gray-400 tracking-tight uppercase text-xs font-mono mt-1",children:`ID: ${Z.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{className:"uppercase",children:"Linked:"}),a.jsx("span",{className:"text-white",children:nn(Z.createdAt||Z.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>Oe(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},Z.id))})]}),y==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user authentication sessions"})]}),a.jsxs(B,{variant:"outline",onClick:()=>{Q([]),se(!1),j(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Ds,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(_N,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),a.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):a.jsx("div",{className:"grid gap-4",children:c.map(Z=>{var pe,ae,_e,Pe;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(yae,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",Z.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Z.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(Sae,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((pe=ue[Z.id])==null?void 0:pe.city)||"...",","," ",((ae=ue[Z.id])==null?void 0:ae.country)||"..."]}),((_e=ue[Z.id])==null?void 0:_e.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:st((Pe=ue[Z.id])==null?void 0:Pe.countryCode)})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]}),a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Created:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.createdAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>tt(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(rx,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},Z.id)})})]})]})]})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Edit User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{x(!1),X("")},className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n==null?void 0:n.name}),a.jsx(gt,{id:(n==null?void 0:n.id)||"",variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"edit-name",className:"text-xs text-white/80 font-mono uppercase",children:"Name"}),a.jsx(ve,{id:"edit-name",defaultValue:(n==null?void 0:n.name)||"",placeholder:"e.g. John Doe",disabled:be,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"edit-email",className:"text-xs text-white/80 font-mono uppercase",children:"Email"}),a.jsx(ve,{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",placeholder:"e.g. john@example.com",disabled:be,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"edit-role",className:"text-xs text-white/80 font-mono uppercase",children:"Role"}),a.jsxs(bn,{value:Y,onValueChange:X,children:[a.jsx(vn,{id:"edit-role",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",disabled:be,children:a.jsx(Gn,{placeholder:"Select role"})}),a.jsxs(yn,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>{x(!1),X("")},disabled:be,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:Nt,disabled:be,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:be?"Updating...":"Update"})]})]})}),v&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Ban User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{g(!1),I(""),k(void 0)},disabled:Le,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"banReason",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Reason"}),a.jsx(ve,{id:"banReason",value:_,onChange:Z=>I(Z.target.value),placeholder:"Enter reason for ban (optional)",disabled:Le,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"banExpires",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Duration (seconds)"}),a.jsx(ve,{id:"banExpires",type:"number",value:G||"",onChange:Z=>k(Z.target.value?Number(Z.target.value):void 0),placeholder:"Leave empty for permanent ban",disabled:Le,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1 font-mono",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>{g(!1),I(""),k(void 0)},disabled:Le,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:jn,disabled:Le,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:Le?"Banning...":"Ban User"})]})]})}),N&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Unban User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>S(!1),disabled:ze,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to unban this user? This will restore their access to the system."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>S(!1),disabled:ze,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:ce,disabled:ze,className:"bg-green-400 hover:bg-green-500 text-white border border-green-400 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:ze?"Unbanning...":"Unban User"})]})]})}),A&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Delete User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>M(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>M(!1),disabled:xe,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:pn,disabled:xe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:xe?"Deleting...":"Delete"})]})]})}),F&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Update Password"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>q(!1),disabled:rt,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"new-password",className:"text-xs text-white/80 font-mono uppercase",children:"New Password"}),a.jsx(ve,{id:"new-password",type:"password",disabled:rt,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>q(!1),disabled:rt,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:async()=>{var ae;const Z=(ae=document.getElementById("new-password"))==null?void 0:ae.value;if(!Z){V.error("Please enter a password");return}Je(!0);const pe=V.loading("Updating password...");try{const Pe=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:Z})})).json();Pe.success?(q(!1),document.getElementById("new-password").value="",V.success("Password updated successfully!",{id:pe})):V.error(`Error updating password: ${Pe.error||"Unknown error"}`,{id:pe})}catch{V.error("Error updating password",{id:pe})}finally{Je(!1)}},disabled:rt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:rt?"Updating...":"Update Password"})]})]})}),E&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Sessions"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>j(!1),disabled:W,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"session-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Sessions"}),a.jsx(ve,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:W,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),ee.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(Ji,{title:"Session Seeding Terminal",lines:ee,isRunning:W,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>j(!1),disabled:W,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:()=>{var pe;const Z=parseInt(((pe=document.getElementById("session-count"))==null?void 0:pe.value)||"3",10);Be(Z)},disabled:W,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:W?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ds,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]})}),R&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Accounts"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>L(!1),disabled:W,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"account-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Accounts"}),a.jsx(ve,{id:"account-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:W,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"account-provider",className:"text-xs text-white/80 font-mono uppercase",children:"Provider"}),a.jsxs(bn,{value:P,onValueChange:U,children:[a.jsx(vn,{id:"account-provider",disabled:W,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Gn,{placeholder:"Select provider"})}),a.jsxs(yn,{className:"bg-black border border-dashed border-white/20",children:[a.jsx(Fe,{value:"random",children:"Mix (Random)"}),a.jsx(Fe,{value:"github",children:"GitHub"}),a.jsx(Fe,{value:"google",children:"Google"}),a.jsx(Fe,{value:"discord",children:"Discord"}),a.jsx(Fe,{value:"facebook",children:"Facebook"}),a.jsx(Fe,{value:"twitter",children:"Twitter"}),a.jsx(Fe,{value:"linkedin",children:"LinkedIn"}),a.jsx(Fe,{value:"apple",children:"Apple"}),a.jsx(Fe,{value:"microsoft",children:"Microsoft"}),a.jsx(Fe,{value:"gitlab",children:"GitLab"}),a.jsx(Fe,{value:"bitbucket",children:"Bitbucket"}),a.jsx(Fe,{value:"spotify",children:"Spotify"}),a.jsx(Fe,{value:"twitch",children:"Twitch"}),a.jsx(Fe,{value:"reddit",children:"Reddit"}),a.jsx(Fe,{value:"slack",children:"Slack"}),a.jsx(Fe,{value:"notion",children:"Notion"}),a.jsx(Fe,{value:"tiktok",children:"TikTok"}),a.jsx(Fe,{value:"zoom",children:"Zoom"})]})]})]})]}),ee.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(Ji,{title:"Account Seeding Terminal",lines:ee,isRunning:W,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>L(!1),disabled:W,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:()=>{var pe;const Z=parseInt(((pe=document.getElementById("account-count"))==null?void 0:pe.value)||"3",10);Ee(Z,P)},disabled:W,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:W?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Hl,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}const Kh=window.__STUDIO_CONFIG__,kp=(Kh==null?void 0:Kh.basePath)!==void 0?Kh.basePath:"",hpe=!!kp;function fpe({children:e}){const[t,n]=p.useState({loading:!0,authenticated:!1,user:null}),r=ao();if(p.useEffect(()=>{(async()=>{try{const i=kp?`${kp}/auth`:"/api/auth",l=await(await fetch(`${i}/session`,{credentials:"include"})).json();n({loading:!1,authenticated:l.authenticated,user:l.user})}catch{n({loading:!1,authenticated:!1,user:null})}})()},[r.pathname]),t.loading)return a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border border-dashed border-white/30 animate-spin"})});if(!t.authenticated){const s=encodeURIComponent(r.pathname+r.search);return a.jsx(C$,{to:`/login?redirect=${s}`,replace:!0})}return a.jsx(a.Fragment,{children:e})}function cO(){return a.jsx(JK,{children:a.jsx(WQ,{children:a.jsxs(uN,{children:[a.jsx(kn,{path:"/",element:a.jsx(Xae,{})}),a.jsx(kn,{path:"/users",element:a.jsx(UU,{})}),a.jsx(kn,{path:"/users/:userId",element:a.jsx(upe,{})}),a.jsx(kn,{path:"/organizations",element:a.jsx(LU,{})}),a.jsx(kn,{path:"/organizations/:orgId",element:a.jsx(kfe,{})}),a.jsx(kn,{path:"/teams",element:a.jsx(Rfe,{})}),a.jsx(kn,{path:"/teams/:teamId",element:a.jsx(lO,{})}),a.jsx(kn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(lO,{})}),a.jsx(kn,{path:"/sessions",element:a.jsx(Afe,{})}),a.jsx(kn,{path:"/database",element:a.jsx(Qae,{})}),a.jsx(kn,{path:"/database/demo",element:a.jsx(QK,{})}),a.jsx(kn,{path:"/emails",element:a.jsx(jfe,{})}),a.jsx(kn,{path:"/tools",element:a.jsx(dpe,{})}),a.jsx(kn,{path:"/settings",element:a.jsx(_fe,{})})]})})})}function ppe(){return a.jsxs(L$,{basename:kp,children:[hpe?a.jsxs(uN,{children:[a.jsx(kn,{path:"/login",element:a.jsx(Tfe,{})}),a.jsx(kn,{path:"/access-denied",element:a.jsx(XQ,{})}),a.jsx(kn,{path:"/*",element:a.jsx(fpe,{children:a.jsx(cO,{})})})]}):a.jsx(uN,{children:a.jsx(kn,{path:"/*",element:a.jsx(cO,{})})}),a.jsx(h8,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})}const mpe=window.fetch;window.fetch=(e,t)=>{var i;const n=((i=window.__STUDIO_CONFIG__)==null?void 0:i.basePath)||"";let r;return typeof e=="string"?r=e:e instanceof URL?r=e.toString():e instanceof Request?r=e.url:r="",r.startsWith("/api/")&&!r.startsWith("/api/auth/")&&n&&!r.startsWith(n)&&(r=n+r.slice(4),typeof e=="string"?e=r:e instanceof URL?e=new URL(r,window.location.origin):e instanceof Request&&(e=new Request(r,e))),mpe.call(window,e,t)};LB.createRoot(document.getElementById("root")).render(a.jsx(te.StrictMode,{children:a.jsx(ppe,{})}));
1155
+ `)),className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(Sa,{className:"w-4 h-4 mr-1"}),"Copy All"]})]}),a.jsx("div",{className:"border border-dashed border-white/10 p-3",children:a.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:de.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs break-all",children:D}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(D),className:"text-gray-400 hover:text-white rounded-none ml-2",children:a.jsx(Sa,{className:"w-3 h-3"})})]},z))})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Version"}),a.jsx("p",{className:"text-white text-sm",children:"v4 (Random)"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Cryptographically random"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm",children:"8-4-4-4-12"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"36 characters"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Standard"}),a.jsx("p",{className:"text-white text-sm",children:"RFC 4122"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Universally unique"})]})]})]})]})}),Wn&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(tc,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Strength Checker"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>ss(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{type:jr?"text":"password",value:Ks,onChange:D=>$n(D.target.value),placeholder:"Enter password to check",className:"w-full bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>cs(!jr),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:jr?a.jsx(gf,{className:"w-4 h-4"}):a.jsx(Us,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{$n(""),is(null),cs(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(B,{onClick:hP,disabled:os||!Ks.trim(),className:"rounded-none",children:os?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):"Check Strength"})]}),Bt&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Strength"}),a.jsx("p",{className:`text-sm font-medium ${Bt.strength==="very-strong"?"text-green-400":Bt.strength==="strong"?"text-green-300":Bt.strength==="good"?"text-yellow-300":Bt.strength==="fair"?"text-orange-300":"text-red-300"}`,children:Bt.strength.split("-").map(D=>D.charAt(0).toUpperCase()+D.slice(1)).join(" ")}),a.jsx("div",{className:"w-full bg-black/40 h-2 rounded-none",children:a.jsx("div",{className:`h-full transition-all ${Bt.strength==="very-strong"?"bg-green-400 w-full":Bt.strength==="strong"?"bg-green-300 w-4/5":Bt.strength==="good"?"bg-yellow-300 w-3/5":Bt.strength==="fair"?"bg-orange-300 w-2/5":"bg-red-300 w-1/5"}`})})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Score"}),a.jsxs("p",{className:"text-white text-sm",children:[Bt.score," / 5"]}),a.jsx("p",{className:"text-gray-500 text-xs",children:Bt.score===5?"Excellent":Bt.score===4?"Very Good":Bt.score===3?"Good":Bt.score===2?"Fair":"Weak"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Config Match"}),a.jsx("p",{className:`text-sm ${Bt.meetsConfig?"text-green-400":"text-red-300"}`,children:Bt.meetsConfig?"✓ Meets Requirements":"✗ Fails Requirements"}),a.jsxs("p",{className:"text-gray-500 text-xs",children:[Bt.configRequirements.minLength," -"," ",Bt.configRequirements.maxLength," chars"]})]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Checks"}),a.jsx("div",{className:"space-y-2",children:Bt.checks.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs",children:D.name}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:`text-xs font-mono ${D.passed?"text-green-400":"text-red-300"}`,children:D.passed?"✓":"✗"}),a.jsx("span",{className:"text-xs text-gray-400 font-mono",children:D.message})]})]},z))})]})]})]})]})}),Tr&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ha,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"OAuth Credentials"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Zs(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Select Provider"}),a.jsx("div",{className:"flex flex-wrap gap-3",children:["google","github"].map(D=>{const z=f===D;return a.jsx("button",{onClick:()=>m(D),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors ${z?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:D.charAt(0).toUpperCase()+D.slice(1)},D)})})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Origin"}),a.jsx(ve,{value:ba,onChange:D=>na(D.target.value),placeholder:`http://${$a}`,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:["The default will be http://",$a]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{aa(null),na($a)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(B,{onClick:xP,disabled:lr||!f||!ba.trim()&&!$a,className:"rounded-none",children:lr?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Fetching..."]}):"Fetch Credentials"})]}),va&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client ID"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{value:va.clientId,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(va.clientId),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{type:ei?"text":"password",value:va.clientSecret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-20 rounded-none"}),a.jsxs("div",{className:"absolute right-0 top-0 h-full flex items-center",children:[a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>rl(!ei),className:"px-2 text-gray-400 hover:text-white rounded-none",children:ei?a.jsx(gf,{className:"w-4 h-4"}):a.jsx(Us,{className:"w-4 h-4"})}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(va.clientSecret),className:"px-2 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-4 h-4"})})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dashed border-white/10",children:[a.jsx("div",{className:"flex-1",children:St&&a.jsx("div",{className:"text-xs font-mono",children:St.success?a.jsxs("span",{className:"text-green-400 uppercase",children:["✓ ",St.message.toLowerCase(),a.jsxs("span",{className:"block normal-case text-gray-400",children:[a.jsx("span",{className:"text-gray-400 mr-1",children:">"})," ",St.path]})]}):a.jsxs("span",{className:"text-red-300",children:["✗ ",St.message]})})}),a.jsx(B,{onClick:bP,disabled:ti||us,className:"rounded-none",children:us?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):ti?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ph,{className:"w-4 h-4 mr-2"}),"Write to .env"]})})]})]})]})]})}),lo&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(So,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Secret Generator"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>hs(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Length (bytes)"}),a.jsx(ve,{type:"number",value:ra===0?"":ra,onChange:D=>{const z=D.target.value;if(z===""){ya(0);return}const J=parseInt(z,10);isNaN(J)||ya(J)},onBlur:D=>{const z=parseInt(D.target.value,10);isNaN(z)||z<16?ya(32):z>128?ya(128):ya(z)},min:"16",max:"128",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:"Recommended: 32 bytes (256 bits)"})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Format"}),a.jsx("div",{className:"flex gap-3",children:[{id:"hex",label:"Hex"},{id:"base64",label:"Base64"}].map(D=>a.jsx("button",{onClick:()=>_r(D.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors flex-1 ${Ar===D.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:D.label},D.id))})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(B,{variant:"outline",onClick:()=>{Ve(null),ya(32),_r("hex")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(B,{onClick:pP,disabled:qt,className:"rounded-none",children:qt?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Secret"})]}),Se&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Length"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.length," bytes"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Entropy"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.entropy," bits"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm uppercase",children:Se.format})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generated Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{value:Se.secret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(Se.secret),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-3 h-3"})})]})]}),a.jsxs("div",{children:[a.jsx(oe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Environment Variable Format"}),a.jsxs("div",{className:"relative",children:[a.jsx(ve,{value:Se.envFormat,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Ga(Se.envFormat),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Sa,{className:"w-3 h-3"})})]}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-2",children:["Add this to your ",a.jsx("code",{className:"text-gray-400",children:".env"})," file. Keep it secret and never commit it to version control."]})]}),a.jsx("div",{className:"flex justify-end space-x-2 pt-2",children:a.jsx(B,{variant:"outline",onClick:mP,disabled:fe||Ie,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:fe||Ie?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),Ie?"Writing...":"Checking..."]}):"Write to .env"})}),a.jsx("div",{className:"border border-dashed border-white/20 bg-black text-gray-300 text-xs font-mono p-3 rounded-none",children:a.jsxs("div",{className:"flex items-start space-x-2",children:[a.jsx(Nl,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-400"}),a.jsxs("div",{children:[a.jsx("div",{className:"uppercase font-mono mb-2 text-gray-400 tracking-wider",children:"Security Best Practices"}),a.jsxs("ul",{className:"list-disc list-inside space-y-1 text-[11px] text-gray-300",children:[a.jsx("li",{children:"Use a minimum of 32 bytes (256 bits) for production"}),a.jsx("li",{children:"Store secrets in environment variables, never in code"}),a.jsx("li",{children:"Use different secrets for development and production"}),a.jsx("li",{children:"Rotate secrets periodically for enhanced security"})]})]})]})})]})]})]})}),kr&&ds&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nl,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Credentials?"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{ni(!1),cr(null),Ha(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:["The following"," ",a.jsx("span",{className:"text-white uppercase",children:(f==null?void 0:f.charAt(0).toUpperCase())+(f==null?void 0:f.slice(1))})," ","credentials already exist in"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:ds.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:Object.entries(ds.credentials).map(([D,z])=>a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:D}),a.jsx("span",{className:"text-gray-500",children:z.length>20?`${z.substring(0,20)}...`:z})]},D))})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(B,{variant:"outline",onClick:()=>{ni(!1),cr(null),Ha(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(B,{variant:"outline",onClick:()=>Pm("append"),disabled:ti,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Append"}),a.jsx(B,{onClick:()=>Pm("override"),disabled:ti,className:"rounded-none",children:ti?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})}),sl&&Ne&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nl,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Secret?"})]}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{we(!1),ke(null),je(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:[a.jsx("span",{className:"text-white uppercase",children:"BETTER_AUTH_SECRET"})," already exists in"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:Ne.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:"BETTER_AUTH_SECRET"}),a.jsx("span",{className:"text-gray-500",children:Ne.secret&&Ne.secret.length>20?`${Ne.secret.substring(0,20)}...`:Ne.secret||"***"})]})})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(B,{variant:"outline",onClick:()=>{we(!1),ke(null),je(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(B,{onClick:()=>IE("override"),disabled:Ie,className:"rounded-none",children:Ie?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})})]})}function upe(){const{userId:e}=iS(),t=ga(),[n,r]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState([]),[h,d]=p.useState([]),[f,m]=p.useState(!0),[y,b]=p.useState("details"),[w,x]=p.useState(!1),[v,g]=p.useState(!1),[N,S]=p.useState(!1),[E,j]=p.useState(!1),[R,L]=p.useState(!1),[P,U]=p.useState("random"),[F,q]=p.useState(!1),[A,M]=p.useState(!1),[C,T]=p.useState(!1),[_,I]=p.useState(""),[G,k]=p.useState(),[O,$]=p.useState(!1),[Y,X]=p.useState(""),[ee,Q]=p.useState([]),[W,se]=p.useState(!1),[be,ie]=p.useState(!1),[xe,ye]=p.useState(!1),[Le,He]=p.useState(!1),[ze,$e]=p.useState(!1),[rt,Je]=p.useState(!1),[ue,Ue]=p.useState({}),Re=p.useRef({}),Ce=p.useCallback(async()=>{try{const pe=await(await fetch("/api/admin/status")).json();$(pe.enabled)}catch{$(!1)}},[]),Xe=p.useCallback(async Z=>{try{const pe=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:Z})});if(pe.ok){const ae=await pe.json();if(ae.success&&ae.location)return ae.location}return null}catch{return null}},[]),ot=p.useCallback(async Z=>{const pe=Z.filter(Pe=>!Re.current[Pe.id]);if(pe.length===0)return;const ae=await Promise.all(pe.map(async Pe=>{const Ge=await Xe(Pe.ipAddress);return Ge?{sessionId:Pe.id,location:Ge}:null})),_e={};ae.forEach(Pe=>{Pe&&(_e[Pe.sessionId]=Pe.location)}),Object.keys(_e).length>0&&(Re.current={...Re.current,..._e},Ue(Re.current))},[Xe]),st=Z=>{if(!Z)return"🌍";const pe=Z.toUpperCase().split("").map(ae=>127397+ae.charCodeAt(0));return String.fromCodePoint(...pe)},Ht=Z=>Z?Z.replace(/[_-]/g," ").replace(/\b\w/g,pe=>pe.toUpperCase()):"Unknown Provider",nn=Z=>{if(!Z)return"Unknown";const pe=new Date(Z);return Number.isNaN(pe.getTime())?"Unknown":pe.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},wt=p.useCallback(async()=>{try{const Z=await fetch(`/api/users/${e}`);if(Z.ok){const pe=await Z.json();r(pe.user)}else V.error("Failed to fetch user details"),t("/users")}catch{V.error("Failed to fetch user details"),t("/users")}finally{m(!1)}},[e,t]),xt=p.useCallback(async()=>{try{const[Z,pe,ae]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(Z.ok){const _e=await Z.json();i(_e.memberships||[])}if(pe.ok){const _e=await pe.json();l(_e.memberships||[])}if(ae.ok){const Pe=(await ae.json()).sessions||[];u(Pe),ot(Pe)}}catch{}},[e,ot]),Tt=p.useCallback(async()=>{try{const Z=await fetch(`/api/users/${e}/accounts`);if(Z.ok){const pe=await Z.json();d(pe.accounts||[])}}catch{}},[e]),Nt=async()=>{var _e,Pe;if(!n)return;const Z=(_e=document.getElementById("edit-name"))==null?void 0:_e.value,pe=(Pe=document.getElementById("edit-email"))==null?void 0:Pe.value;if(!Z||!pe){V.error("Please fill in all fields");return}ie(!0);const ae=V.loading("Updating user...");try{const it=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Z,email:pe,role:Y||null})})).json();it.success?(r({...n,name:Z,email:pe,role:Y||void 0}),x(!1),X(""),V.success("User updated successfully!",{id:ae})):V.error(`Error updating user: ${it.error||"Unknown error"}`,{id:ae})}catch{V.error("Error updating user",{id:ae})}finally{ie(!1)}},pn=async()=>{if(!n)return;ye(!0);const Z=V.loading("Deleting user...");try{const ae=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ae.success?(V.success("User deleted successfully!",{id:Z}),t("/users")):V.error(`Error deleting user: ${ae.error||"Unknown error"}`,{id:Z})}catch{V.error("Error deleting user",{id:Z})}finally{ye(!1)}},jn=async()=>{if(!n)return;if(!O){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}He(!0);const Z=V.loading("Banning user...");try{const pe=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:_||"No reason provided",banExpiresIn:G})}),ae=await pe.json();pe.ok?(V.success("User banned successfully!",{id:Z}),g(!1),I(""),k(void 0),wt()):pe.status===403?V.error("You do not have permission to ban users. Admin role required.",{id:Z}):ae.adminPluginEnabled&&ae.instructions?V.error(`${ae.error}`,{id:Z,duration:6e3,description:`Use: ${ae.instructions.example}`}):V.error(`Error banning user: ${ae.error||ae.message||"Unknown error"}`,{id:Z})}catch{V.error("Error banning user",{id:Z})}finally{He(!1)}},ce=async()=>{if(!n)return;if(!O){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}$e(!0);const Z=V.loading("Unbanning user...");try{const pe=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),ae=await pe.json();pe.ok?(V.success("User unbanned successfully!",{id:Z}),S(!1),wt()):pe.status===403?V.error("You do not have permission to unban users. Admin role required.",{id:Z}):ae.adminPluginEnabled&&ae.instructions?V.error(`${ae.error}`,{id:Z,duration:6e3,description:`Use: ${ae.instructions.example}`}):V.error(`Error unbanning user: ${ae.error||ae.message||"Unknown error"}`,{id:Z})}catch{V.error("Error unbanning user",{id:Z})}finally{$e(!1)}},Ae=async Z=>{const pe=V.loading("Removing user from organization...");try{const _e=await(await fetch(`/api/organizations/members/${Z}`,{method:"DELETE"})).json();_e.success?(i(Pe=>Pe.filter(Ge=>Ge.id!==Z)),xt(),V.success("User removed from organization!",{id:pe})):V.error(`Error removing user: ${_e.error||"Unknown error"}`,{id:pe})}catch{V.error("Error removing user from organization",{id:pe})}},at=async Z=>{const pe=V.loading("Removing user from team...");try{const _e=await(await fetch(`/api/teams/members/${Z}`,{method:"DELETE"})).json();_e.success?(l(Pe=>Pe.filter(Ge=>Ge.id!==Z)),xt(),V.success("User removed from team!",{id:pe})):V.error(`Error removing user: ${_e.error||"Unknown error"}`,{id:pe})}catch{V.error("Error removing user from team",{id:pe})}},tt=async Z=>{const pe=V.loading("Deleting session...");try{const _e=await(await fetch(`/api/sessions/${Z}`,{method:"DELETE"})).json();_e.success?(u(Pe=>Pe.filter(Ge=>Ge.id!==Z)),V.success("Session deleted successfully!",{id:pe})):V.error(`Error deleting session: ${_e.error||"Unknown error"}`,{id:pe})}catch{V.error("Error deleting session",{id:pe})}},Oe=async Z=>{if(!e)return;const pe=V.loading("Unlinking account...");try{const ae=await fetch(`/api/users/${e}/accounts/${Z}`,{method:"DELETE"}),_e=await ae.json();ae.ok&&_e.success?(d(Pe=>Pe.filter(Ge=>Ge.id!==Z)),await Tt(),V.success("Account unlinked successfully",{id:pe})):V.error(_e.error||"Failed to unlink account",{id:pe})}catch{V.error("Failed to unlink account",{id:pe})}};p.useEffect(()=>{e&&(wt(),xt(),Tt(),Ce())},[e,Ce,wt,xt,Tt]);const Be=async(Z=3)=>{if(e){Q([]),se(!0),Q([{id:"start",type:"info",message:`Starting session seeding process for ${Z} sessions...`,timestamp:new Date}]);try{const ae=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Z})})).json();if(ae.success){const _e=ae.results.map((Ge,it)=>Ge.success?{id:`session-${it}`,type:"progress",message:`Creating session ${it+1}: ${Ge.session.token.substring(0,20)}... from ${Ge.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${it}`,type:"error",message:`Failed to create session ${it+1}: ${Ge.error}`,timestamp:new Date});Q(Ge=>[...Ge,..._e]);const Pe=ae.results.filter(Ge=>Ge.success).length;Q(Ge=>[...Ge,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${Pe}/${Z} sessions successfully`,timestamp:new Date}]),xt()}else Q(_e=>[..._e,{id:"error",type:"error",message:`❌ Session seeding failed: ${ae.error||"Unknown error"}`,timestamp:new Date}])}catch(pe){Q(ae=>[...ae,{id:"error",type:"error",message:`❌ Network error: ${pe}`,timestamp:new Date}])}finally{se(!1)}}},Ee=async(Z=3,pe="random")=>{if(e){Q([]),se(!0),Q([{id:"start",type:"info",message:`Starting account seeding process for ${Z} accounts...`,timestamp:new Date}]);try{const _e=await(await fetch(`/api/users/${e}/seed-accounts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:Z,providerId:pe})})).json();if(_e.success){const Pe=_e.results.map((it,ct)=>{var ne;return it.success?{id:`account-${ct}`,type:"progress",message:`Creating account ${ct+1}: ${it.account.providerId||it.account.provider} (${((ne=it.account.accountId)==null?void 0:ne.substring(0,20))||it.account.id.substring(0,20)}...)`,timestamp:new Date,status:"completed"}:{id:`account-${ct}`,type:"error",message:`Failed to create account ${ct+1}: ${it.error}`,timestamp:new Date}});Q(it=>[...it,...Pe]);const Ge=_e.results.filter(it=>it.success).length;Q(it=>[...it,{id:"complete",type:"success",message:`✅ Account seeding completed! Created ${Ge}/${Z} accounts successfully`,timestamp:new Date}]),Tt()}else Q(Pe=>[...Pe,{id:"error",type:"error",message:`❌ Account seeding failed: ${_e.error||"Unknown error"}`,timestamp:new Date}])}catch(ae){Q(_e=>[..._e,{id:"error",type:"error",message:`❌ Network error: ${ae}`,timestamp:new Date}])}finally{se(!1)}}};return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Mr,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(gt,{id:n.id,nonSliced:!0,variant:"subscript"}),n.role&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:n.role}),n.banned&&a.jsxs("sup",{className:"relative group inline-block ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none cursor-help",children:["Banned",n.banReason&&a.jsxs("span",{className:"absolute lowercase left-1/2 -translate-x-1/2 bottom-full mb-3 px-2 py-2 text-[10px] font-mono text-gray-300 bg-black border border-dashed border-white/20 rounded-none whitespace-nowrap opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-150 pointer-events-none z-50",children:[a.jsx("span",{className:"text-gray-400 font-mono text-xs uppercase mr-1",children:"Banned Reason:"}),n.banReason,a.jsx("span",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0 border-l-[4px] border-r-[4px] border-t-[4px] border-transparent border-t-white/20"})]})]})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs("div",{className:"relative",children:[a.jsx(B,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:Z=>{Z.stopPropagation(),T(!C)},children:a.jsx(u3,{className:"w-4 h-4"})}),C&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:Z=>Z.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),x(!0),X(n.role||"")},children:[a.jsx("span",{children:"Edit User"}),a.jsx(Ho,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),q(!0)},children:[a.jsx("span",{children:"Update Password"}),a.jsx(Fn,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}),O&&(n.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-green-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),S(!0)},children:[a.jsx("span",{children:"Unban User"}),a.jsx(rx,{className:"w-3 h-3 text-green-400/10 group-hover:text-green-400/70 transition-colors"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-yellow-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),g(!0)},children:[a.jsx("span",{children:"Ban User"}),a.jsx(rx,{className:"w-3 h-3 text-yellow-400/10 group-hover:text-yellow-400/70 transition-colors"})]})),a.jsxs("div",{className:"flex flex-col items-center justify-center",children:[a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-2 w-[calc(100%)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-red-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:Z=>{Z.stopPropagation(),T(!1),M(!0)},children:[a.jsx("span",{children:"Delete User"}),a.jsx(Ju,{className:"w-3 h-3 text-red-400/10 group-hover:text-red-400/70 transition-colors"})]})]})]})})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/20",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Mr},{id:"organizations",name:"Organizations",icon:qn,count:s.length},{id:"teams",name:"Teams",icon:Ft,count:o.length},{id:"accounts",name:"Accounts",icon:Hl,count:h.length},{id:"sessions",name:"Sessions",icon:_N,count:c.length}].map(Z=>a.jsxs("button",{onClick:()=>b(Z.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${y===Z.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(Z.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"font-mono uppercase text-xs font-normal",children:Z.name}),Z.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(In,{value:Z.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},Z.id))})}),a.jsxs("div",{className:"p-6",children:[y==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Mr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Ns,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(jae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Eae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(hr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ns,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ds,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),y==="organizations"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Organizations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:s.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Organizations this user belongs to"})]})}),s.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(qn,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):a.jsx("div",{className:"grid gap-4",children:s.map(Z=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:Z.organization.image?a.jsx("img",{src:Z.organization.image,alt:Z.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(qn,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Z.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Z.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in ",Z.organization.slug]}),a.jsx("button",{onClick:pe=>{pe.stopPropagation(),t(`/organizations/${Z.organization.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View organization details",children:a.jsx(wu,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>Ae(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},Z.id))})]}),y==="teams"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Teams this user belongs to"})]})}),o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Ft,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):a.jsx("div",{className:"grid gap-4",children:o.map(Z=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(Ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Z.team.name,a.jsx(gt,{id:Z.team.id,variant:"subscript",nonSliced:!!(Z.team.organizationSlug||Z.team.organizationName)})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in"," ",Z.team.organizationSlug||Z.team.organizationName]}),a.jsx("button",{onClick:pe=>{pe.stopPropagation(),Z.team.organizationId?t(`/organizations/${Z.team.organizationId}/teams/${Z.team.id}`):t(`/teams/${Z.team.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View team details",children:a.jsx(wu,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>at(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},Z.id))})]}),y==="accounts"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Linked Accounts",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:h.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user OAuth account connections"})]}),a.jsxs(B,{variant:"outline",onClick:()=>{Q([]),se(!1),L(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Hl,{className:"w-4 h-4 mr-2"}),"Seed Accounts"]})]}),h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Hl,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),a.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):a.jsx("div",{className:"grid gap-4",children:h.map(Z=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:K6(Z.providerId)}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Ht(Z.providerId),a.jsx(gt,{id:Z.accountId,variant:"subscript",nonSliced:!!(Z.email||n.email)})]}),a.jsx("p",{className:"text-gray-400 tracking-tight uppercase text-xs font-mono mt-1",children:`ID: ${Z.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{className:"uppercase",children:"Linked:"}),a.jsx("span",{className:"text-white",children:nn(Z.createdAt||Z.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>Oe(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},Z.id))})]}),y==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user authentication sessions"})]}),a.jsxs(B,{variant:"outline",onClick:()=>{Q([]),se(!1),j(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Ds,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(_N,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),a.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):a.jsx("div",{className:"grid gap-4",children:c.map(Z=>{var pe,ae,_e,Pe;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(yae,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",Z.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:Z.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(Sae,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((pe=ue[Z.id])==null?void 0:pe.city)||"...",","," ",((ae=ue[Z.id])==null?void 0:ae.country)||"..."]}),((_e=ue[Z.id])==null?void 0:_e.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:st((Pe=ue[Z.id])==null?void 0:Pe.countryCode)})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Created:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(Z.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(Z.createdAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>tt(Z.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(rx,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},Z.id)})})]})]})]})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Edit User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{x(!1),X("")},className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n==null?void 0:n.name}),a.jsx(gt,{id:(n==null?void 0:n.id)||"",variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"edit-name",className:"text-xs text-white/80 font-mono uppercase",children:"Name"}),a.jsx(ve,{id:"edit-name",defaultValue:(n==null?void 0:n.name)||"",placeholder:"e.g. John Doe",disabled:be,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"edit-email",className:"text-xs text-white/80 font-mono uppercase",children:"Email"}),a.jsx(ve,{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",placeholder:"e.g. john@example.com",disabled:be,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"edit-role",className:"text-xs text-white/80 font-mono uppercase",children:"Role"}),a.jsxs(bn,{value:Y,onValueChange:X,children:[a.jsx(vn,{id:"edit-role",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",disabled:be,children:a.jsx(Gn,{placeholder:"Select role"})}),a.jsxs(yn,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>{x(!1),X("")},disabled:be,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:Nt,disabled:be,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:be?"Updating...":"Update"})]})]})}),v&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Ban User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>{g(!1),I(""),k(void 0)},disabled:Le,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"banReason",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Reason"}),a.jsx(ve,{id:"banReason",value:_,onChange:Z=>I(Z.target.value),placeholder:"Enter reason for ban (optional)",disabled:Le,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"banExpires",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Duration (seconds)"}),a.jsx(ve,{id:"banExpires",type:"number",value:G||"",onChange:Z=>k(Z.target.value?Number(Z.target.value):void 0),placeholder:"Leave empty for permanent ban",disabled:Le,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1 font-mono",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>{g(!1),I(""),k(void 0)},disabled:Le,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:jn,disabled:Le,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:Le?"Banning...":"Ban User"})]})]})}),N&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Unban User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>S(!1),disabled:ze,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to unban this user? This will restore their access to the system."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>S(!1),disabled:ze,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:ce,disabled:ze,className:"bg-green-400 hover:bg-green-500 text-white border border-green-400 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:ze?"Unbanning...":"Unban User"})]})]})}),A&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Delete User"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>M(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>M(!1),disabled:xe,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:pn,disabled:xe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:xe?"Deleting...":"Delete"})]})]})}),F&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Update Password"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>q(!1),disabled:rt,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"new-password",className:"text-xs text-white/80 font-mono uppercase",children:"New Password"}),a.jsx(ve,{id:"new-password",type:"password",disabled:rt,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>q(!1),disabled:rt,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:async()=>{var ae;const Z=(ae=document.getElementById("new-password"))==null?void 0:ae.value;if(!Z){V.error("Please enter a password");return}Je(!0);const pe=V.loading("Updating password...");try{const Pe=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:Z})})).json();Pe.success?(q(!1),document.getElementById("new-password").value="",V.success("Password updated successfully!",{id:pe})):V.error(`Error updating password: ${Pe.error||"Unknown error"}`,{id:pe})}catch{V.error("Error updating password",{id:pe})}finally{Je(!1)}},disabled:rt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:rt?"Updating...":"Update Password"})]})]})}),E&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Sessions"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>j(!1),disabled:W,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"session-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Sessions"}),a.jsx(ve,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:W,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),ee.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(Ji,{title:"Session Seeding Terminal",lines:ee,isRunning:W,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>j(!1),disabled:W,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:()=>{var pe;const Z=parseInt(((pe=document.getElementById("session-count"))==null?void 0:pe.value)||"3",10);Be(Z)},disabled:W,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:W?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ds,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]})}),R&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Accounts"}),a.jsx(B,{variant:"ghost",size:"sm",onClick:()=>L(!1),disabled:W,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ut,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Mr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(gt,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"account-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Accounts"}),a.jsx(ve,{id:"account-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:W,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(oe,{htmlFor:"account-provider",className:"text-xs text-white/80 font-mono uppercase",children:"Provider"}),a.jsxs(bn,{value:P,onValueChange:U,children:[a.jsx(vn,{id:"account-provider",disabled:W,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Gn,{placeholder:"Select provider"})}),a.jsxs(yn,{className:"bg-black border border-dashed border-white/20",children:[a.jsx(Fe,{value:"random",children:"Mix (Random)"}),a.jsx(Fe,{value:"github",children:"GitHub"}),a.jsx(Fe,{value:"google",children:"Google"}),a.jsx(Fe,{value:"discord",children:"Discord"}),a.jsx(Fe,{value:"facebook",children:"Facebook"}),a.jsx(Fe,{value:"twitter",children:"Twitter"}),a.jsx(Fe,{value:"linkedin",children:"LinkedIn"}),a.jsx(Fe,{value:"apple",children:"Apple"}),a.jsx(Fe,{value:"microsoft",children:"Microsoft"}),a.jsx(Fe,{value:"gitlab",children:"GitLab"}),a.jsx(Fe,{value:"bitbucket",children:"Bitbucket"}),a.jsx(Fe,{value:"spotify",children:"Spotify"}),a.jsx(Fe,{value:"twitch",children:"Twitch"}),a.jsx(Fe,{value:"reddit",children:"Reddit"}),a.jsx(Fe,{value:"slack",children:"Slack"}),a.jsx(Fe,{value:"notion",children:"Notion"}),a.jsx(Fe,{value:"tiktok",children:"TikTok"}),a.jsx(Fe,{value:"zoom",children:"Zoom"})]})]})]})]}),ee.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(Ji,{title:"Account Seeding Terminal",lines:ee,isRunning:W,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(B,{variant:"outline",onClick:()=>L(!1),disabled:W,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(B,{onClick:()=>{var pe;const Z=parseInt(((pe=document.getElementById("account-count"))==null?void 0:pe.value)||"3",10);Ee(Z,P)},disabled:W,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:W?a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Hl,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}const Kh=window.__STUDIO_CONFIG__,kp=(Kh==null?void 0:Kh.basePath)!==void 0?Kh.basePath:"",hpe=!!kp;function fpe({children:e}){const[t,n]=p.useState({loading:!0,authenticated:!1,user:null}),r=ao();if(p.useEffect(()=>{(async()=>{try{const i=kp?`${kp}/auth`:"/api/auth",l=await(await fetch(`${i}/session`,{credentials:"include"})).json();n({loading:!1,authenticated:l.authenticated,user:l.user})}catch{n({loading:!1,authenticated:!1,user:null})}})()},[r.pathname]),t.loading)return a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border border-dashed border-white/30 animate-spin"})});if(!t.authenticated){const s=encodeURIComponent(r.pathname+r.search);return a.jsx(C$,{to:`/login?redirect=${s}`,replace:!0})}return a.jsx(a.Fragment,{children:e})}function cO(){return a.jsx(JK,{children:a.jsx(WQ,{children:a.jsxs(uN,{children:[a.jsx(kn,{path:"/",element:a.jsx(Xae,{})}),a.jsx(kn,{path:"/users",element:a.jsx(UU,{})}),a.jsx(kn,{path:"/users/:userId",element:a.jsx(upe,{})}),a.jsx(kn,{path:"/organizations",element:a.jsx(LU,{})}),a.jsx(kn,{path:"/organizations/:orgId",element:a.jsx(kfe,{})}),a.jsx(kn,{path:"/teams",element:a.jsx(Rfe,{})}),a.jsx(kn,{path:"/teams/:teamId",element:a.jsx(lO,{})}),a.jsx(kn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(lO,{})}),a.jsx(kn,{path:"/sessions",element:a.jsx(Afe,{})}),a.jsx(kn,{path:"/database",element:a.jsx(Qae,{})}),a.jsx(kn,{path:"/database/demo",element:a.jsx(QK,{})}),a.jsx(kn,{path:"/emails",element:a.jsx(jfe,{})}),a.jsx(kn,{path:"/tools",element:a.jsx(dpe,{})}),a.jsx(kn,{path:"/settings",element:a.jsx(_fe,{})})]})})})}function ppe(){return a.jsxs(L$,{basename:kp,children:[hpe?a.jsxs(uN,{children:[a.jsx(kn,{path:"/login",element:a.jsx(Tfe,{})}),a.jsx(kn,{path:"/access-denied",element:a.jsx(XQ,{})}),a.jsx(kn,{path:"/*",element:a.jsx(fpe,{children:a.jsx(cO,{})})})]}):a.jsx(uN,{children:a.jsx(kn,{path:"/*",element:a.jsx(cO,{})})}),a.jsx(h8,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})}const mpe=window.fetch;window.fetch=(e,t)=>{var i;const n=((i=window.__STUDIO_CONFIG__)==null?void 0:i.basePath)||"";let r;return typeof e=="string"?r=e:e instanceof URL?r=e.toString():e instanceof Request?r=e.url:r="",r.startsWith("/api/")&&!r.startsWith("/api/auth/")&&n&&!r.startsWith(n)&&(r=n+r.slice(4),typeof e=="string"?e=r:e instanceof URL?e=new URL(r,window.location.origin):e instanceof Request&&(e=new Request(r,e))),mpe.call(window,e,t)};LB.createRoot(document.getElementById("root")).render(a.jsx(te.StrictMode,{children:a.jsx(ppe,{})}));
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/png" href="/logo.png" />
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-BF3jnjfy.js"></script>
8
+ <script type="module" crossorigin src="/assets/main-CLQdKjlK.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/main-R1O9iElM.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth-studio",
3
- "version": "1.0.79-beta.32",
3
+ "version": "1.0.79-beta.33",
4
4
  "description": "Studio for Better Auth",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",