Files
doormile_crm_build/dist/assets/Settings-CoHSkUIw.js
2026-07-08 18:53:29 +05:30

60 lines
23 KiB
JavaScript

import{r as d,j as e,s as $,t as W,v as L,m as fe,y as he,c as N,B as T,T as q,H as ae,Q as me,R as ye,V as ge}from"./index-TNj5auBr.js";import{P as be,B as O}from"./PageHeader-B9Ytwo9b.js";import{C as D}from"./Card-Cvh0wiAW.js";import{L as ie,E as je}from"./lock-8veRwQu6.js";import{C as Q}from"./circle-check-DCMZ9tv4.js";import{f as we,h as ke,T as H}from"./TextInput-DL-5979h.js";import{S as X}from"./Selector-D-0RMSQ0.js";const _=d.createContext(null);_.displayName="ListContext";const R={list:{kogj98:"x1ghz6dp",kZCmMZ:"x1c1uobl",kH6xsr:"x3ct3a4",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1lsbc85",$$css:!0},withDividers:{kOIVth:"xxhr3t",$$css:!0},withCounter:{kt6KFK:"xif0320",$$css:!0}},ve={kt6KFK:"x1khind5",$$css:!0},ze={counterStart:s=>[ve,{"--x-counterReset":`astryx-list ${s}`!=null?`astryx-list ${s}`:void 0}]};function ne({children:s,density:t="balanced",hasDividers:l=!1,header:i,listStyle:x="none",start:n,xstyle:c,className:p,style:j,"data-testid":w,ref:o}){const g=d.useId(),f=x==="decimal",k=f?"ol":"ul",m=d.useMemo(()=>({density:t,hasDividers:l,listStyle:x}),[t,l,x]),r=e.jsx(k,{ref:o,"data-testid":w,"aria-labelledby":i!=null?g:void 0,...f&&n!=null&&n!==1?{start:n}:{},...x==="none"&&!f?{role:"list"}:{},...$(L("list",{density:t,listStyle:x}),W(R.list,l&&R.withDividers,x!=="none"&&(n!=null&&n!==1?ze.counterStart(n-1):R.withCounter),c),p,j),children:s});return i==null?e.jsx(_,{value:m,children:r}):e.jsx(_,{value:m,children:e.jsxs("div",{className:"x78zum5 xdt5ytf",children:[e.jsx("div",{id:g,className:"x1p37lm5",children:i}),r]})})}ne.displayName="List";const Y={withCounter:{kAmcRD:"xfrknyr",$$css:!0},withDivider:{kt9PQ7:"x92x3c3",kfdmCh:"x1q0q8m5",kL6WhQ:"xw8gpjh",$$css:!0}},Ne={noRadius:{kaIpWk:"x2u8bby",$$css:!0}};function le({label:s,description:t,startContent:l,endContent:i,onClick:x,href:n,target:c,rel:p,isDisabled:j=!1,isSelected:w=!1,xstyle:o,className:g,style:f,ref:k,...m}){const r=d.use(_),u=(r==null?void 0:r.density)??"balanced",v=(r==null?void 0:r.hasDividers)??!1,b=(r==null?void 0:r.listStyle)??"none",I=b!=="none",a=b==="disc"?e.jsx("span",{className:"xoi2r2e x9f619 x78zum5 x6s0dn4 xl56j7k x2lah0s x12xnipv x1233pnv",children:e.jsx("span",{className:"x1v4s8kt xols6we x16rqkct x19aspcf"})}):b==="circle"?e.jsx("span",{className:"xoi2r2e x9f619 x78zum5 x6s0dn4 xl56j7k x2lah0s x12xnipv x1233pnv",children:e.jsx("span",{className:"x1v4s8kt xols6we x16rqkct xmkeg23 x1y0btm7 xqcx1ss xjbqb8w"})}):b==="decimal"?e.jsx("span",{className:"xoi2r2e x2lah0s x1tgivj0 xjm74w1 xw6l6zx x12xnipv xc2ndz5"}):null;return e.jsx(fe,{as:"li",ref:k,marker:a,startContent:l,label:s,description:t,endContent:i,onClick:x,href:n,target:c,rel:p,isDisabled:j,isSelected:w,density:u,xstyle:[I&&Y.withCounter,v&&Y.withDivider,v&&Ne.noRadius,o],...$(L("list-item"),{className:g,style:f}),...m})}le.displayName="ListItem";const Ce={x1iwu4tg:"x1iwu4tg",$$css:!0},J={container:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1txdalj",$$css:!0},containerSpread:{kjj79g:"x1qughib",kzqmXN:"xh8yej3",$$css:!0}},Se={width:s=>[{kzqmXN:s!=null?"x5lhr3w":s,$$css:!0},{"--x-width":(t=>typeof t=="number"?t+"px":t??void 0)(s)}]};function A({label:s,isLabelHidden:t=!1,description:l,onChange:i,changeAction:x,isLoading:n=!1,value:c,isDisabled:p=!1,isOptional:j=!1,isRequired:w=!1,onFocus:o,onBlur:g,labelIcon:f,labelTooltip:k,labelPosition:m="end",labelSpacing:r="default",status:u,width:v,xstyle:b,className:I,style:a,ref:y}){const z=d.useId(),G=d.useId(),B=d.useId(),[,ce]=d.useTransition(),[U,pe]=d.useOptimistic(c),M=n||U!==c,C=U===!0,P=[];l&&!t&&P.push(G),u!=null&&u.message&&P.push(B);const ue=P.length>0?P.join(" "):void 0,Z=e.jsxs("div",{className:"x1n2onr6 x78zum5 x6s0dn4 x2lah0s x100vrsf xxk0z11 xc8icb0",children:[e.jsx("input",{ref:y,id:z,type:"checkbox",role:"switch",checked:C,disabled:p,required:w,onChange:E=>{if(M)return;const F=E.target.checked;i==null||i(F,E),x&&!E.defaultPrevented&&ce(async()=>{pe(F),await x(F,E)})},onFocus:o,onBlur:g,"aria-describedby":ue,"aria-invalid":(u==null?void 0:u.type)==="error"?!0:void 0,"aria-busy":M||void 0,...{0:{className:"x10l6tqk x1ghz6dp x1717udv xg01cxk x1ypdohk x1vjfegm x100vrsf xxk0z11"},2:{className:"x10l6tqk x1ghz6dp x1717udv xg01cxk x1vjfegm x100vrsf xxk0z11 x1h6gzvc"},1:{className:"x10l6tqk x1ghz6dp x1717udv xg01cxk x1ypdohk x1vjfegm x100vrsf xxk0z11 x47corl"},3:{className:"x10l6tqk x1ghz6dp x1717udv xg01cxk x1vjfegm x100vrsf xxk0z11 x1h6gzvc x47corl"}}[!!p<<1|!!M<<0]}),e.jsx("div",{"aria-hidden":"true",...$(L("switch",{checked:C?"checked":null,disabled:p?"disabled":null}),{0:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xspzpui x13wei8l"},8:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1ewilqj x11ppjs"},4:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xspzpui x13wei8l x1a2a7pz x1gj1ihy x1edzap1"},12:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1ewilqj x11ppjs x1a2a7pz x1gj1ihy x1edzap1"},2:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xspzpui x13wei8l xbyyjgo"},10:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1ewilqj x11ppjs xbyyjgo"},6:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xspzpui x13wei8l x1a2a7pz x1gj1ihy x1edzap1 xbyyjgo"},14:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1ewilqj x11ppjs x1a2a7pz x1gj1ihy x1edzap1 xbyyjgo"},1:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xspzpui"},9:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xspzpui"},5:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1a2a7pz x1gj1ihy x1edzap1 xspzpui"},13:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1a2a7pz x1gj1ihy x1edzap1 xspzpui"},3:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xbyyjgo xspzpui"},11:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 xbyyjgo xspzpui"},7:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1a2a7pz x1gj1ihy x1edzap1 xbyyjgo xspzpui"},15:{className:"x78zum5 x6s0dn4 x100vrsf xxk0z11 xfawy5m xjspbzw x15406qy xuedmi6 x12w9bfk xlr8y92 x9f619 x1a2a7pz x1gj1ihy x1edzap1 xbyyjgo xspzpui"}}[!!C<<3|!p<<2|!!p<<1|!!(p&&!C)<<0]),children:e.jsx("div",{...$(L("switch-thumb",{checked:C?"checked":null}),{0:{className:"x78zum5 x6s0dn4 xl56j7k xjspbzw x10xzikg xh3q6i0 xuedmi6 x12w9bfk xlr8y92 x1kky2od xlup9mm xbryuvx"},1:{className:"x78zum5 x6s0dn4 xl56j7k xjspbzw x10xzikg xh3q6i0 xuedmi6 x12w9bfk xlr8y92 xw4jnvo x1qx5ct2 x15481yp"}}[!!C<<0]),children:M&&e.jsx(he,{size:"sm"})})}),M&&e.jsx("span",{className:"x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km",role:"status",children:"Loading"})]}),K=e.jsx("div",{className:"x78zum5 xdt5ytf x1lsbc85 xl56j7k xjwf9q1",children:e.jsx(ke,{label:s,inputID:z,isLabelHidden:t,isDisabled:p,isOptional:j,isRequired:w,labelIcon:f,labelTooltip:k,description:l,descriptionID:G})});return e.jsxs("div",{...$(L("switch-field",{labelPosition:m!=="end"?m:void 0,labelSpacing:r!=="default"?r:void 0}),W(v!=null&&Se.width(v),b),I,a),children:[e.jsxs("div",{...W(J.container,r==="spread"&&J.containerSpread,!p&&Ce),children:[" ",m==="start"?e.jsxs(e.Fragment,{children:[K,Z]}):e.jsxs(e.Fragment,{children:[Z,K]})]}),(u==null?void 0:u.message)&&e.jsx("div",{className:"xtbrsbv",children:e.jsx(we,{type:u.type,message:u.message,id:B,variant:"detached"})})]})}A.displayName="Switch";/**
* @license lucide-react v1.22.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qe=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],re=N("bell",qe);/**
* @license lucide-react v1.22.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ie=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],Me=N("building",Ie);/**
* @license lucide-react v1.22.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Te=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ae=N("circle-question-mark",Te);/**
* @license lucide-react v1.22.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $e=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],Le=N("megaphone",$e);/**
* @license lucide-react v1.22.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pe=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Ee=N("save",Pe);/**
* @license lucide-react v1.22.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const De=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],He=N("shield",De);/**
* @license lucide-react v1.22.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _e=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],xe=N("sliders-vertical",_e),oe=["Asia/Kolkata (IST)","Asia/Dubai (GST)","UTC","America/New_York (EST)"],de=["English","हिन्दी (Hindi)","العربية (Arabic)"],ee={orgName:"Doormile Technologies",supportEmail:"support@doormile.in",contact:"+91 63749 46729",timezone:oe[0],language:de[0]},se={newClient:!0,contractStatus:!0,teamAccess:!1,databaseSync:!0,emailAlerts:!0,smsAlerts:!1},te={currentPassword:"",newPassword:"",confirmPassword:"",twoFactor:!1},Fe=[{icon:xe,label:"General",desc:"Organisation profile"},{icon:re,label:"Notifications",desc:"Alerts & channels"},{icon:ie,label:"Security",desc:"Password & 2FA"}],Oe=[{k:"newClient",t:"New client onboarded",d:"Notify when a new client is added to the system"},{k:"contractStatus",t:"Contract status",d:"When a client contract becomes active or expires"},{k:"teamAccess",t:"Team access",d:"When a new team member is granted or revoked access"},{k:"databaseSync",t:"Database sync",d:"Alerts for vector database synchronization events"}],Re=[{label:"Too weak",color:"#ef4444"},{label:"Weak",color:"#ef4444"},{label:"Fair",color:"#f59e0b"},{label:"Good",color:"#3b82f6"},{label:"Strong",color:"#10b981"}],Ve=s=>{let t=0;return s.length>=8&&t++,/[a-z]/.test(s)&&/[A-Z]/.test(s)&&t++,/\d/.test(s)&&t++,/[^A-Za-z0-9]/.test(s)&&t++,t};function S({icon:s,title:t,subtitle:l,danger:i=!1,children:x}){return e.jsxs(D,{style:{padding:"0",borderRadius:"16px",border:i?"1px solid #fca5a5":"1px solid rgba(5, 54, 89, 0.08)",backgroundColor:"#ffffff",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",padding:"18px 24px",borderBottom:"1px solid rgba(5, 54, 89, 0.06)",background:i?"linear-gradient(90deg, rgba(239, 68, 68, 0.04) 0%, #ffffff 72%)":"linear-gradient(90deg, rgba(192, 18, 39, 0.04) 0%, #ffffff 72%)",gap:"12px"},children:[e.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i?"rgba(239, 68, 68, 0.08)":"rgba(192, 18, 39, 0.08)",color:i?"#ef4444":"#C01227"},children:e.jsx(s,{size:18})}),e.jsxs("div",{children:[e.jsx(ae,{level:5,children:t}),l&&e.jsx(q,{type:"supporting",color:"secondary",children:l})]})]}),e.jsx("div",{style:{padding:"4px 24px"},children:x})]})}function h({label:s,description:t,controlAlign:l="stretch",children:i}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"16px 0",borderBottom:"1px solid #f1f5f9",flexWrap:"wrap",gap:"12px"},className:"settings-row",children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px",width:"240px",flexShrink:0},children:[e.jsx(q,{type:"body",weight:"semibold",children:s}),t&&e.jsx(q,{type:"supporting",color:"secondary",children:t})]}),e.jsx("div",{style:{flexGrow:1,minWidth:"220px",display:l==="end"?"flex":"block",justifyContent:l==="end"?"flex-end":void 0},children:i})]})}function V({label:s,value:t,onChange:l}){const[i,x]=d.useState(!1);return e.jsxs("div",{style:{position:"relative",width:"100%"},children:[e.jsx(H,{label:s,isLabelHidden:!0,type:i?"text":"password",placeholder:s,value:t,onChange:l}),e.jsx("button",{type:"button",onClick:()=>x(n=>!n),"aria-label":i?"Hide password":"Show password",style:{position:"absolute",right:"10px",bottom:0,height:"32px",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",color:"#64748b",padding:0,zIndex:5},children:i?e.jsx(ge,{size:16}):e.jsx(je,{size:16})})]})}function Xe(){const[s,t]=d.useState(0),[l,i]=d.useState(!1),[x,n]=d.useState(!1),[c,p]=d.useState(ee),[j,w]=d.useState(se),[o,g]=d.useState(te),f=a=>y=>{p(z=>({...z,[a]:y})),n(!0)},k=a=>y=>{w(z=>({...z,[a]:y})),n(!0)},m=a=>y=>{g(z=>({...z,[a]:y})),n(!0)},r=()=>{i(!0),n(!1),setTimeout(()=>i(!1),2500)},u=()=>{p(ee),w(se),g(te),n(!1)},v=Ve(o.newPassword),b=Re[v],I=o.confirmPassword&&o.newPassword!==o.confirmPassword;return e.jsxs("div",{style:{fontFamily:"system-ui, sans-serif"},children:[e.jsx(be,{title:"Settings",action:e.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[x&&e.jsx(O,{variant:"warning",label:"Unsaved changes"}),e.jsx(T,{variant:"ghost",onClick:u,label:"Discard"}),e.jsx(T,{variant:"primary",icon:e.jsx(Ee,{size:14}),onClick:r,label:"Save Changes"})]})}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr",lg:"repeat(12, 1fr)",gap:"24px",marginTop:"24px"},className:"responsive-row",children:[e.jsx("div",{style:{gridColumn:"span 3"},className:"col-span-3",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[e.jsx(D,{style:{padding:"8px"},children:e.jsx(ne,{density:"spacious",children:Fe.map((a,y)=>e.jsx(le,{label:a.label,description:a.desc,startContent:e.jsx(a.icon,{size:16}),isSelected:s===y,onClick:()=>t(y)},a.label))})}),e.jsx(D,{style:{padding:"20px",backgroundColor:"rgba(192, 18, 39, 0.05)",border:"1px solid rgba(192, 18, 39, 0.1)"},children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsx("div",{style:{width:"38px",height:"38px",borderRadius:"8px",backgroundColor:"#C01227",color:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Ae,{size:16})}),e.jsxs("div",{children:[e.jsx(q,{type:"body",weight:"bold",color:"accent",children:"Need a hand?"}),e.jsx("div",{style:{marginTop:"2px"},children:e.jsx(q,{type:"supporting",color:"accent",children:"Our team is available 24/7 for operational support."})})]}),e.jsx(T,{size:"sm",variant:"primary",label:"Contact support"})]})})]})}),e.jsxs("div",{style:{gridColumn:"span 9"},className:"col-span-9",children:[s===0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[e.jsx(D,{style:{padding:"0",overflow:"hidden"},children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"20px",alignItems:"center",padding:"24px",background:"linear-gradient(90deg, rgba(192, 18, 39, 0.05) 0%, #ffffff 75%)",flexWrap:"wrap"},children:[e.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"8px",backgroundColor:"#C01227",color:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(Me,{size:32})}),e.jsxs("div",{style:{flexGrow:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",flexWrap:"wrap"},children:[e.jsx(ae,{level:4,children:c.orgName}),e.jsx(O,{variant:"success",icon:e.jsx(Q,{size:12}),label:"Verified"})]}),e.jsxs(q,{type:"supporting",color:"secondary",children:[c.supportEmail," · ",c.contact]})]}),e.jsx(T,{variant:"secondary",size:"sm",label:"Change logo"})]})}),e.jsxs(S,{icon:xe,title:"Organisation",subtitle:"Profile and regional preferences",children:[e.jsx(h,{label:"Organisation name",description:"Shown on invoices and exports",children:e.jsx(H,{label:"Organisation name",isLabelHidden:!0,width:"100%",value:c.orgName,onChange:f("orgName")})}),e.jsx(h,{label:"Support email",description:"Where customer replies are routed",children:e.jsx(H,{label:"Support email",isLabelHidden:!0,width:"100%",type:"email",value:c.supportEmail,onChange:f("supportEmail")})}),e.jsx(h,{label:"Contact number",description:"Primary operations line",children:e.jsx(H,{label:"Contact number",isLabelHidden:!0,width:"100%",value:c.contact,onChange:f("contact")})}),e.jsx(h,{label:"Timezone",description:"Used for schedules and reports",children:e.jsx("div",{style:{width:"100%"},children:e.jsx(X,{label:"Timezone",isLabelHidden:!0,options:oe,value:c.timezone,onChange:a=>f("timezone")(a||"")})})}),e.jsx(h,{label:"Language",description:"Console display language",children:e.jsx("div",{style:{width:"100%"},children:e.jsx(X,{label:"Language",isLabelHidden:!0,options:de,value:c.language,onChange:a=>f("language")(a||"")})})})]})]}),s===1&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[e.jsx(S,{icon:re,title:"Notification Preferences",subtitle:"Choose what you get alerted about",children:Oe.map(a=>e.jsx(h,{label:a.t,description:a.d,controlAlign:"end",children:e.jsx(A,{label:a.t,isLabelHidden:!0,value:j[a.k],onChange:k(a.k)})},a.k))}),e.jsxs(S,{icon:Le,title:"Delivery Channels",subtitle:"How alerts reach your team",children:[e.jsx(h,{label:"Email alerts",description:"Send notifications to the support inbox",controlAlign:"end",children:e.jsx(A,{label:"Email alerts",isLabelHidden:!0,value:j.emailAlerts,onChange:k("emailAlerts")})}),e.jsx(h,{label:"SMS alerts",description:"Send notifications to the registered mobile",controlAlign:"end",children:e.jsx(A,{label:"SMS alerts",isLabelHidden:!0,value:j.smsAlerts,onChange:k("smsAlerts")})})]})]}),s===2&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[e.jsxs(S,{icon:ie,title:"Change Password",subtitle:"Use 8+ characters with a mix of letters, numbers & symbols",children:[e.jsx(h,{label:"Current password",description:"Enter your existing password",children:e.jsx(V,{label:"Current password",value:o.currentPassword,onChange:m("currentPassword")})}),e.jsx(h,{label:"New password",description:"Choose a strong, unique password",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[e.jsx(V,{label:"New password",value:o.newPassword,onChange:m("newPassword")}),o.newPassword&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginTop:"4px"},children:[e.jsx("div",{style:{flexGrow:1,height:"6px",borderRadius:"3px",backgroundColor:"#f1f5f9",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",backgroundColor:b.color,width:`${v/4*100}%`}})}),e.jsx("span",{style:{fontSize:"0.75rem",fontWeight:700,color:b.color,minWidth:"56px"},children:b.label})]})]})}),e.jsx(h,{label:"Confirm new password",description:"Re-enter the new password",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:[e.jsx(V,{label:"Confirm new password",value:o.confirmPassword,onChange:m("confirmPassword")}),I&&e.jsx("span",{style:{fontSize:"0.75rem",color:"#ef4444",display:"block",marginTop:"4px"},children:"Passwords do not match"})]})})]}),e.jsx(S,{icon:He,title:"Two-Factor Authentication",subtitle:"Add an extra layer of security to your account",children:e.jsx(h,{label:"Authenticator app",description:"Require a one-time code at sign-in for extra security",controlAlign:"end",children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(O,{variant:o.twoFactor?"success":"neutral",label:o.twoFactor?"Enabled":"Disabled"}),e.jsx(A,{label:"Two-factor authentication",isLabelHidden:!0,value:o.twoFactor,onChange:a=>{g(y=>({...y,twoFactor:a})),n(!0)}})]})})}),e.jsx(S,{icon:me,title:"Danger Zone",subtitle:"Irreversible and high-impact actions",danger:!0,children:e.jsx(h,{label:"Sign out of all sessions",description:"End every active session on all devices",controlAlign:"end",children:e.jsx(T,{variant:"destructive",onClick:()=>{localStorage.removeItem("auth_token"),window.location.href="/login"},label:"Sign out everywhere",icon:e.jsx(ye,{size:14})})})})]})]})]}),l&&e.jsxs("div",{style:{position:"fixed",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#0f172a",color:"#ffffff",padding:"12px 24px",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1)",zIndex:3e3,display:"flex",alignItems:"center",gap:"8px",fontSize:"0.875rem"},children:[e.jsx(Q,{size:16,style:{color:"#10b981"}}),"Settings saved successfully."]}),e.jsx("style",{children:`
@media (min-width: 1024px) {
.responsive-row {
grid-template-columns: repeat(12, 1fr) !important;
}
.col-span-3 {
grid-column: span 3 !important;
}
.col-span-9 {
grid-column: span 9 !important;
}
}
@media (max-width: 1023px) {
.responsive-row {
grid-template-columns: 1fr !important;
}
.col-span-3, .col-span-9 {
grid-column: span 1 !important;
}
}
.settings-row:last-child {
border-bottom: none !important;
}
`})]})}export{Xe as default};