PageSourceSearch

https://cellcog.ai/static/js/1537.520648f6.chunk.js

js cellcog.ai collected 2026-10-02 15:36:55 UTC 36,760 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkcellcog_ui=self.webpackChunkcellcog_ui||[]).push([[1537],{15885:()=>{},51537:(e,s,t)=>{t.r(s),t.d(s,{default:()=>P});var n=t(89379),a=t(65043),i=t(62751),l=t(22019),o=t(12624),r=t(65512),d=t(32513),c=t(14459),m=t(75088),u=t(7118),h=t(9333),p=t(91286),g=t(58280),v=t(88306),b=t(37719),y=t(19340),x=t(64830),j=t(73216),f=t(66456),N=t(91686),w=t(99472),k=t(45964),_=t(50167),A=t(70579);const C=e=>{let{open:s,onClose:t,employee:n,onUpdated:o}=e;const[r,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[h,p]=(0,a.useState)([]),[g,v]=(0,a.useState)(new Set),[b,y]=(0,a.useState)(!0),x=null===n||void 0===n?void 0:n.employee_id,j=(null===n||void 0===n?void 0:n.name)||"Your employee",[f,C]=(0,a.useState)(!1),S=(0,a.useCallback)(async()=>{if(x){c(!0);try{const{data:e}=await(0,_.T9)(x);y(Boolean(e.organization_id)),p(e.org_members||[]),v(new Set(e.shared_with||[])),C(Boolean(e.works_on_computer))}catch(t){var e,s;l.Ay.error((null===(e=t.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Failed to load team members.")}finally{c(!1)}}},[x]);(0,a.useEffect)(()=>{s&&S()},[s,S]);const T=e=>{const s=(e.name||e.email||"?").trim();return s.slice(0,2).charAt(0).toUpperCase()+s.slice(1,2).toLowerCase()};return(0,A.jsx)(i.A,{title:"Share ".concat(j," with your team"),open:s,onCancel:t,onOk:async()=>{u(!0);try{await(0,_.iG)(x,Array.from(g)),l.Ay.success(g.size?"".concat(j," is shared with ").concat(g.size," team member").concat(1===g.size?"":"s","."):"".concat(j," is no longer shared.")),t(),o&&o()}catch(n){var e,s;l.Ay.error((null===(e=n.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Failed to update sharing.")}finally{u(!1)}},confirmLoading:m,okText:"Save",width:480,destroyOnClose:!0,children:r?(0,A.jsx)("div",{className:"emp-share-loading",children:(0,A.jsx)(N.A,{})}):b?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("p",{className:"emp-share-note",children:["Team members get full access and act as you \u2014 ",j," only knows one supervisor: you."]}),f&&(0,A.jsxs)("p",{className:"emp-share-note emp-share-note-feature",children:[j," works on your computer \u2014 team members can collaborate on work that lives there and approve commands."]}),0===h.length?(0,A.jsx)(w.A,{image:w.A.PRESENTED_IMAGE_SIMPLE,description:"No other members in your organization yet."}):(0,A.jsx)("div",{className:"emp-share-list",children:h.map(e=>(0,A.jsxs)("label",{className:"emp-share-row",children:[(0,A.jsx)(d.A,{checked:g.has(e.user_id),onChange:()=>{return s=e.user_id,void v(e=>{const t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t});var s}}),(0,A.jsx)(k.A,{size:28,className:"emp-share-avatar",children:T(e)}),(0,A.jsx)("span",{className:"emp-share-name",children:e.name||e.email}),e.name&&(0,A.jsx)("span",{className:"emp-share-email",children:e.email})]},e.user_id))})]}):(0,A.jsx)(w.A,{image:w.A.PRESENTED_IMAGE_SIMPLE,description:"This employee isn't part of an organization, so it can't be shared."})})};var S=t(37915),T=t(35016),I=t(62042),E=t(49534),M=t(25049),R=t(83076);t(15885);const L=e=>{let{employeeId:s,empName:t,modal:i,Row:r,sectionRef:d}=e;const[c,m]=(0,a.useState)(null),[u,h]=(0,a.useState)(!1),[p,g]=(0,a.useState)(""),[v,b]=(0,a.useState)(""),[y,x]=(0,a.useState)("idle"),[j,f]=(0,a.useState)(null),N=(0,a.useCallback)(async()=>{if(s)try{const e=await(0,M.DZ)(s);m(e.data||{number:null})}catch(e){m({unavailable:!0})}},[s]);(0,a.useEffect)(()=>{m(null),x("idle"),N()},[N]);const w=(0,a.useCallback)(async()=>{try{const e=await(0,M.RH)();f(e&&e.data||{status:"not_started"})}catch(e){f({unavailable:!0})}},[]);(0,a.useEffect)(()=>{f(null),w()},[w]);const k=async()=>{const e=p.trim();if(e){h(!0);try{await(0,M.Wn)(e),x("code"),l.Ay.success("A code is on its way to that number.")}catch(n){var s,t;l.Ay.error((null===(s=n.response)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.detail)||"Could not send the code.")}finally{h(!1)}}},_=async()=>{const e=v.trim();if(e){h(!0);try{await(0,M.MK)(e),x("idle"),g(""),b(""),l.Ay.success("Your number is verified for every employee."),N(),w()}catch(n){var s,t;l.Ay.error((null===(s=n.response)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.detail)||"That code did not match. Try again.")}finally{h(!1)}}},C=()=>{i.confirm({title:"Remove your number?",content:"".concat(t," and your other employees can no longer transfer a caller to you, and a call from that number is treated like any caller's."),okText:"Remove",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:async()=>{try{await(0,M.j2)(),l.Ay.success("Your number is removed."),N()}catch(t){var e,s;l.Ay.error((null===(e=t.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Could not remove the number.")}}})}
1,S=j&&!j.unavailable?R.V0.hintByStatus[j.status]||R.V0.hintByStatus.not_started:"";return(0,A.jsxs)("section",{className:"empsettings-sec",ref:d,"data-section":"phone",children:[(0,A.jsx)("div",{className:"empsettings-sec-head",children:(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Phone"})}),(0,A.jsx)("div",{className:"empsettings-card",children:c?c.unavailable?(0,A.jsx)("div",{className:"empsettings-card-note",children:(0,A.jsx)("span",{children:"The phone is not available right now. It shows here as soon as it is back."})}):(0,R.yn)(c)?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(r,{label:"".concat(t,"'s number"),hint:[(0,R._j)(c.iso_country,c.number_type),[c.locality,c.region].filter(Boolean).join(", ")].filter(Boolean).join(" \xb7 ")||"Calls to it reach the voice, with the brain behind it.",children:[(0,A.jsx)("span",{className:"empsettings-value empsettings-phone-number",children:(0,R.Ie)(c.number,c.display)}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn empsettings-btn--danger",disabled:u,onClick:()=>{i.confirm({title:"Release ".concat(t,"'s number?"),content:R.hu,okText:"Release number",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:async()=>{try{await(0,M.eN)(s),l.Ay.success("The number is released."),N()}catch(n){var e,t;l.Ay.error((null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Could not release the number.")}}})},children:"Release"})]}),(0,A.jsx)(r,{label:"Phone",hint:!1===c.enabled?'Off: callers hear a decline and the call shows as missed with "phone off".':"On: ".concat(t," answers every call to its number."),children:(0,A.jsx)(o.A,{checked:!1!==c.enabled,loading:u,onChange:async e=>{h(!0);try{const a=await(0,M.v7)(s,{enabled:e});m(s=>(0,n.A)((0,n.A)((0,n.A)({},s||{}),a.data||{}),{},{enabled:a.data&&void 0!==a.data.enabled?a.data.enabled:e})),l.Ay.success("".concat(t,e?" answers calls again.":"'s phone is off. Callers hear a decline; the calls show as missed."))}catch(o){var a,i;l.Ay.error((null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.detail)||"Could not update the phone settings.")}finally{h(!1)}},"aria-label":"Phone on or off"})}),(0,A.jsxs)("div",{className:"empsettings-row empsettings-row--stack",children:[(0,A.jsxs)("div",{className:"empsettings-row-main",children:[(0,A.jsx)("div",{className:"empsettings-row-label",children:"Your number"}),(0,A.jsx)("div",{className:"empsettings-row-hint",children:(0,R.eJ)(t)})]}),(()=>{if(!c)return null;const e=c.owner_number_masked,s=Boolean(c.owner_number_verified);return"code"===y?(0,A.jsxs)("div",{className:"empsettings-add",children:[(0,A.jsx)("input",{className:"empsettings-input",value:v,inputMode:"numeric",maxLength:8,placeholder:"The 6-digit code",disabled:u,onChange:e=>b(e.target.value),onKeyDown:e=>{"Enter"===e.key&&_()},"aria-label":"Verification code"}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn empsettings-btn--primary",disabled:u||!v.trim(),onClick:_,children:"Verify"}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn",disabled:u,onClick:()=>x("idle"),children:"Cancel"})]}):"editing"!==y&&e?(0,A.jsxs)("div",{className:"empsettings-add empsettings-phone-owner",children:[(0,A.jsx)("span",{className:"empsettings-value empsettings-phone-masked",children:e}),(0,A.jsx)("span",{className:"empsettings-tag",children:s?"Verified":"Not verified yet"}),!s&&(0,A.jsx)("button",{type:"button",className:"empsettings-btn",disabled:u,onClick:()=>x("editing"),children:"Verify"}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn",disabled:u,onClick:()=>x("editing"),children:"Change"}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn empsettings-btn--danger",disabled:u,onClick:C,children:"Remove"})]}):(0,A.jsxs)("div",{className:"empsettings-add",children:[(0,A.jsx)("input",{className:"empsettings-input",value:p,inputMode:"tel",maxLength:20,placeholder:"+1 415 555 0123",disabled:u,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"===e.key&&k()},"aria-label":"Your phone number"}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn empsettings-btn--primary",disabled:u||!p.trim(),onClick:k,children:"Send code"}),e&&(0,A.jsx)("button",{type:"button",className:"empsettings-btn",disabled:u,onClick:()=>x("idle"),children:"Cancel"})]})})()]}),(0,A.jsxs)("div",{className:"empsettings-row empsettings-row--stack","data-section":"outbound-calling",children:[(0,A.jsxs)("div",{className:"empsettings-row-main",children:[(0,A.jsx)("div",{className:"empsettings-row-label",children:R.V0.title}),S?(0,A.jsx)("div",{className:"empsettings-row-hint",children:S}):null]}),(()=>{if(!j)return(0,A.jsx)("div",{className:"empsettings-card-note",children:(0,A.jsx)("span",{children:"Loading outbound calling\u2026"})});if(j.unavailable)return(0,A.jsx)("div",{className:"empsettings-card-note",children:(0,A.jsx)("span",{children:R.V0.unavailable})});const e=j.status||"not_started",s=j.prefill||{},t=j.legal_name||s.legal_name||"your business",n=(0,A.jsx)("a",{className:"empsettings-link",href:R.V0.phonesHref,children:R.V0.phonesLink[e]||R.V0.phonesLink.not_started});return"approved"===e?(0,A.jsxs)("div",{className:"empsettings-outboun
1d","data-identity-status":"approved",children:[(0,A.jsx)("div",{className:"empsettings-outbound-status empsettings-outbound-status--approved",children:R.V0.approved(t)}),j.cnam_name&&(0,A.jsx)("p",{className:"empsettings-outbound-hint",children:R.V0.callerName(j.cnam_name)}),(0,A.jsx)("p",{className:"empsettings-outbound-hint",children:n})]}):"submitted"===e?(0,A.jsxs)("div",{className:"empsettings-outbound","data-identity-status":"submitted",children:[(0,A.jsx)("div",{className:"empsettings-outbound-status",children:R.V0.submitted}),(0,A.jsxs)("p",{className:"empsettings-outbound-hint",children:[t," \xb7 ",n]})]}):"rejected"===e?(0,A.jsxs)("div",{className:"empsettings-outbound","data-identity-status":"rejected",children:[(0,A.jsx)("p",{className:"empsettings-outbound-p",children:R.V0.rejected(j.rejection_reason)}),(0,A.jsx)("p",{className:"empsettings-outbound-hint",children:n})]}):"draft"===e?(0,A.jsxs)("div",{className:"empsettings-outbound","data-identity-status":"draft",children:[(0,A.jsx)("p",{className:"empsettings-outboun
1d-p",children:R.V0.draftHint}),(0,A.jsx)("p",{className:"empsettings-outbound-hint",children:n})]}):(0,A.jsxs)("div",{className:"empsettings-outbound","data-identity-status":"not_started",children:[(0,A.jsx)("p",{className:"empsettings-outbound-p",children:R.V0.intro}),(0,A.jsx)("p",{className:"empsettings-outbound-hint",children:R.V0.einHint}),(0,A.jsx)("p",{className:"empsettings-outbound-hint",children:n})]})})()]})]}):(0,A.jsx)(r,{label:(0,R.BL)(t),hint:"".concat(t," gets one in chat, on your yes."),children:(0,A.jsx)("button",{type:"button",className:"empsettings-btn empsettings-btn--primary",onClick:()=>{(0,R.ct)(s,R.Wy)||l.Ay.info("In the chat, ask ".concat(t,': "').concat(R.Wy,'".'))},children:(0,R.VT)(t)})}):(0,A.jsx)("div",{className:"empsettings-card-note",children:(0,A.jsx)("span",{children:"Loading phone settings\u2026"})})})]})},V=e=>{const s=(e||"").trim();if(!s)return"AI";const t=s.slice(0,2);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},z=e=>e?e.charAt(0).toUpperCase()+e.slice(1):e,D=e=>{let{label:s,hint:t,children:n,danger:a}=e;return(0,A.jsxs)("div",{className:"empsettings-row ".concat(a?"empsettings-row--danger":""),children:[(0,A.jsxs)("div",{className:"empsettings-row-main",children:[(0,A.jsx)("div",{className:"empsettings-row-label",children:s}),t?(0,A.jsx)("div",{className:"empsettings-row-hint",children:t}):null]}),n?(0,A.jsx)("div",{className:"empsettings-row-ctl",children:n}):null]})},B=e=>{let{value:s,options:t,onChange:n,disabled:a,ariaLabel:i}=e;return(0,A.jsx)("div",{className:"empsettings-seg",role:"radiogroup","aria-label":i,children:t.map(e=>(0,A.jsx)("button",{type:"button",role:"radio","aria-checked":s===e.value,"aria-disabled":e.disabled||void 0,className:"empsettings-seg-opt",disabled:a||e.disabled,onClick:()=>n(e.value),children:e.label},e.value))})},P=e=>{var s;let{employeeId:t,intent:N}=e;const[w,k]=i.A.useModal(),{data:M,refresh:R}=(0,I.wJ)(),{employees:P,orgTree:F}=(0,E.YJ)(),{userProfile:W}=(0,T.A)(),[H,O]=(0,a.useState)(null),Y=(0,a.useCallback)(()=>{(0,_.do)(t).then(e=>O(e.data)).catch(()=>{})},[t]);(0,a.useEffect)(()=>{O(null),Y()},[Y]);const U=M?M.employee:null,q=(0,a.useMemo)(()=>U?H?(0,n.A)((0,n.A)({},U),{},{access:H.access,model_mode:H.model_mode,model_tier:H.model_tier}):U:H,[U,H]),G=M?M.shift_state:null,K=P.find(e=>(e.employee_id||e.id)===t),J=(null===H||void 0===H?void 0:H.access)||(null===K||void 0===K?void 0:K.access)||null,Z=!!J&&"team"!==J,$=Boolean(null===q||void 0===q?void 0:q.organization_id),Q="paused"===(null===q||void 0===q?void 0:q.status),X=(null===q||void 0===q?void 0:q.name)||"Your employee",ee=(0,a.useCallback)(()=>{R({silent:!0}),Y()},[R,Y]),se=(0,j.Zp)(),[te,ne]=(0,a.useState)(!1),[ae,ie]=(0,a.useState)(!1),[le,oe]=(0,a.useState)(!1),re=P.filter(e=>(e.employee_id||e.id)!==(null===q||void 0===q?void 0:q.employee_id)&&"team"!==e.access),de=null!==W&&void 0!==W&&W.id?String(W.id):"",ce=(0,a.useMemo)(()=>{const e=[],s=new Set;return function t(n){n&&((n.members||[]).forEach(t=>{"human"!==t.kind||t.id===de||s.has(t.id)||(s.add(t.id),e.push({id:t.id,name:t.name}))}),(n.children||[]).forEach(t))}(F),e},[F,de]),me=(0,a.useMemo)(()=>{const e=null===q||void 0===q?void 0:q.employee_id;if(!F||!e)return(null===q||void 0===q?void 0:q.supervisor_employee_id)||"";let s=null;if(function t(n){!s&&n&&((n.members||[]).some(s=>"employee"===s.kind&&s.employee_id===e)?s=n:(n.children||[]).forEach(t))}(F),!s)return(null===q||void 0===q?void 0:q.supervisor_employee_id)||"";if("human"===s.leader_kind)return s.leader_user_id&&s.leader_user_id!==de?"human:".concat(s.leader_user_id):"";let t="";return function e(n){if(t||!n)return;const a=(n.members||[]).find(e=>"employee"===e.kind&&e.id===s.leader_employee_id);a?t=a.employee_id||"":(n.children||[]).forEach(e)}(F),t||(null===q||void 0===q?void 0:q.supervisor_employee_id)||""},[F,q,de]),ue=e=>{if(!e)return"You (direct)";if(e.startsWith("human:")){const s=ce.find(s=>"human:".concat(s.id)===e);return(null===s||void 0===s?void 0:s.name)||"a colleague"}const s=P.find(s=>(s.employee_id||s.id)===e);return(null===s||void 0===s?void 0:s.name)||"Unknown"},he=null!==q&&void 0!==q&&q.last_shift_at?new Date(q.last_shift_at).toLocaleStr
1ing():"\u2014",pe=null!==q&&void 0!==q&&q.hired_at?new Date(q.hired_at).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):"\u2014",ge=async()=>{ne(!0);try{if(Q){var e;const s=await(0,_.iq)(t,"settings");l.Ay.success(null!==(e=s.data)&&void 0!==e&&e.woken?"".concat(X," resumed and is picking up the mailbox."):"".concat(X," resumed."))}else await(0,_.LW)(t),l.Ay.success("".concat(X," paused. Nothing wakes ").concat(X," until you resume."));ee()}catch(a){var s,n;l.Ay.error((null===(s=a.response)||void 0===s||null===(n=s.data)||void 0===n?void 0:n.detail)||"Failed to update status.")}finally{ne(!1)}},ve=Boolean(null===G||void 0===G?void 0:G.can_start_now),[be,ye]=(0,a.useState)(!1),xe=(null===H||void 0===H?void 0:H.model_mode)||null,je=(null===H||void 0===H?void 0:H.model_tier)||null,fe="agent_creative"===xe,[Ne,we]=(0,a.useState)(!1),ke=async(e,s)=>{we(!0);try{const a=await(0,_.YT)(t,{chat_mode:e,chat_tier:s});O(e=>(0,n.A)((0,n.A)({},e||{}),{},{model_mode:a.data.model_mode,model_tier:a.data.model_tier})),l.Ay.success("Model updated. Applies from the next shift."),R({silent:!0})}catch(o){var a,i;l.Ay.error((null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.detail)||"Failed to update model.")}finally{we(!1)}},_e=xe?"".concat(fe?"Creative":"Agent"," \xb7 ").concat((je||"core").charAt(0).toUpperCase()).concat((je||"core").slice(1)):null,[Ae,Ce]=(0,a.useState)(!1),[Se,Te]=(0,a.useState)(null),[Ie,Ee]=(0,a.useState)(void 0),[Me,Re]=(0,a.useState)(!1),[Le,Ve]=(0,a.useState)(!1),[ze,De]=(0,a.useState)(!1),Be=(0,a.useMemo)(()=>{if(!F||null===q||void 0===q||!q.id)return[];let e=null;return function s(t){!e&&t&&("employee"!==t.leader_kind||t.leader_employee_id!==q.id?(t.children||[]).forEach(s):e=t)}(F),e?(e.members||[]).filter(e=>!("employee"===e.kind&&e.employee_id===q.employee_id)).map(e=>e.name).filter(Boolean):[]},[F,q]),[Pe,Fe]=(0,a.useState)(null),[We,He]=(0,a.useState)(!1),[Oe,Ye]=(0,a.useState)("");(0,a.useEffect)(()=>{if(!t)return;let e=!0;return Fe(null),(0,_.pS)(t).then(s=>{e&&Fe(s.data)}).catch(()=>{e&&Fe(null)}),()=>{e=!1}},[t]);const Ue=(null===Pe||void 0===Pe?void 0:Pe.settings)||null,qe=async(e,s)=>{if(t){He(!0);try{const n=await(0,_.ym)(t,e);Fe(n.data),s&&l.Ay.success(s)}catch(i){var n,a;l.Ay.error((null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.detail)||"Failed to update meeting settings.")}finally{He(!1)}}},Ge=(0,a.useMemo)(()=>{const e=(null===Pe||void 0===Pe?void 0:Pe.voices)||[],s=(null===Pe||void 0===Pe?void 0:Pe.voice_labels)||{},t=e=>{const t=s[e];return{value:e,label:null!==t&&void 0!==t&&t.influence?"".concat(z(e)," \xb7 ").concat(t.influence):z(e)}};return[{label:"Default",options:[{value:"",label:"Default (".concat(z((null===Pe||void 0===Pe?void 0:Pe.default_voice)||"cedar"),")")}]},{label:"Feminine",options:e.filter(e=>{var t;return"Feminine"===(null===(t=s[e])||void 0===t?void 0:t.presentation)}).map(t)},{label:"Masculine",options:e.filter(e=>{var t;return"Masculine"===(null===(t=s[e])||void 0===t?void 0:t.presentation)}).map(t)},{label:"Unlabeled",options:e.filter(e=>!s[e]).map(t)}].filter(e=>e.options.length>0)},[Pe]),Ke=(null===Ue||void 0===Ue?void 0:Ue.do_not_say)||[],Je=()=>{const e=Oe.trim();e&&(qe({do_not_say:[...Ke,e]}),Ye(""))},Ze=(null===Pe||void 0===Pe?void 0:Pe.gender)||(null===q||void 0===q?void 0:q.gender)||null,$e=(0,a.useMemo)(()=>[{id:"identity",label:"Identity",Icon:c.default},{id:"shifts",label:"Shifts",Icon:m.default},{id:"reporting",label:"Reporting",Icon:u.default},{id:"meetings",label:"Meetings",Icon:h.default},{id:"phone",label:"Phone",Icon:p.default},...Z?[{id:"model",label:"Model",Icon:g.default}]:[],...$?[{id:"sharing",label:"Sharing",Icon:v.default}]:[],{id:"danger",label:"Danger zone",Icon:b.default,danger:!0}],[Z,$]),Qe=(0,a.useRef)(null),Xe=(0,a.useRef)({}),es=(0,a.useRef)(0),[ss,ts]=(0,a.useState)("identity"),ns=(0,a.useRef)(0);(0,a.useEffect)(()=>()=>{es.current&&cancelAnimationFrame(es.current)},[]);const as=e=>{ts(e),ns.current=Date.now()+600;const s=Xe.current[e];if(!s)return;const t="undefined"!==typeof window&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;s.scrollIntoView({behavior:t?"auto":"smooth",block:"start"})},is=e=>s=>{Xe.current[e]=s},ls=(0,a.useRef)(null);if((0,a.useEffect)(()=>
1{if(!N||!N.section||!q||ls.current===N)return;const e=requestAnimationFrame(()=>{Xe.current[N.section]&&(ls.current=N,as(N.section))});return()=>cancelAnimationFrame(e)},[N,q]),!q)return(0,A.jsxs)("div",{className:"empc-app-fill",children:[(0,A.jsx)("div",{className:"empsettings-loading",children:"Loading\u2026"}),k]});const os=(0,S.r)(G,q),rs=(q.shared_with_user_ids||[]).length,ds=rs?"Shared with ".concat(rs," team member").concat(1===rs?"":"s"):"Not shared";return(0,A.jsx)("div",{className:"empc-app-fill",children:(0,A.jsxs)("div",{className:"empsettings-root",children:[k,(0,A.jsxs)("nav",{className:"empsettings-rail","aria-label":"Settings sections",children:[(0,A.jsxs)("div",{className:"empsettings-rail-id",children:[(0,A.jsx)("span",{className:"empsettings-avatar empsettings-avatar--sm","aria-hidden":"true",children:V(q.name)}),(0,A.jsxs)("span",{className:"empsettings-rail-idtext",children:[(0,A.jsx)("span",{className:"empsettings-rail-name",children:q.name||"Setting up\u2026"}),q.business_name?(0,A.jsx)("span",{className:"empsettings-rail-role",children:q.business_name}):null]})]}),(0,A.jsxs)("div",{className:"empsettings-rail-nav",children:[$e.filter(e=>!e.danger).map(e=>(0,A.jsxs)("button",{type:"button",className:"empsettings-navitem","aria-current":ss===e.id?"true":void 0,title:e.label,onClick:()=>as(e.id),children:[(0,A.jsx)(e.Icon,{size:16,strokeWidth:1.5}),(0,A.jsx)("span",{className:"empsettings-navitem-label",children:e.label})]},e.id)),(0,A.jsx)("div",{className:"empsettings-rail-spacer"}),$e.filter(e=>e.danger).map(e=>(0,A.jsxs)("button",{type:"button",className:"empsettings-navitem","aria-current":ss===e.id?"true":void 0,title:e.label,onClick:()=>as(e.id),children:[(0,A.jsx)(e.Icon,{size:16,strokeWidth:1.5}),(0,A.jsx)("span",{className:"empsettings-navitem-label",children:e.label})]},e.id))]}),(0,A.jsx)("div",{className:"empsettings-rail-foot",children:(0,A.jsxs)("span",{className:"empsettings-status",title:os.label,"aria-label":os.label,children:[(0,A.jsx)("i",{className:"empsettings-dot ".concat(os.live?"is-live":""),"aria-hidden":"true"}),(0,A.jsx)("span",{className:"empsettings-status-label",children:os.label})]})})]}),(0,A.jsxs)("div",{className:"empsettings-pane",children:[(0,A.jsxs)("header",{className:"empsettings-pane-head",children:[(0,A.jsx)("h1",{className:"empsettings-pane-title",children:"Settings"}),(0,A.jsx)("span",{className:"empsettings-pane-spacer"}),(0,A.jsx)("span",{className:"empsettings-pane-meta",children:"Changes save automatically"})]}),(0,A.jsx)("div",{className:"empsettings-pane-body",ref:Qe,onScroll:()=>{es.current||(es.current=requestAnimationFrame(()=>{if(es.current=0,Date.now()<ns.current)return;const e=Qe.current;if(!e)return;const s=e.scrollTop+24;let t=$e.length?$e[0].id:null;$e.forEach(e=>{const n=Xe.current[e.id];n&&n.offsetTop<=s&&(t=e.id)}),e.scrollHeight-e.scrollTop-e.clientHeight<=2&&$e.length&&(t=$e[$e.length-1].id),t&&ts(t)}))},children:(0,A.jsxs)("div",{className:"empsettings-sheet",children:[Q?(0,A.jsxs)("div",{className:"empsettings-banner",role:"status",children:[(0,A.jsx)("span",{className:"empsettings-banner-icon","aria-hidden":"true",children:(0,A.jsx)(y.default,{size:16,strokeWidth:1.5})}),(0,A.jsxs)("span",{className:"empsettings-banner-main",children:[(0,A.jsxs)("span",{className:"empsettings-banner-title",children:[X," is paused"]}),(0,A.jsxs)("span",{className:"empsettings-banner-sub",children:["Nothing wakes ",X," until you resume. Messages, emails and tasks wait in the mailbox."]})]}),(0,A.jsxs)("button",{type:"button",className:"empsettings-btn empsettings-btn--primary",disabled:te,onClick:ge,children:["Resume ",X]})]}):null,(0,A.jsxs)("section",{className:"empsettings-sec",ref:is("identity"),children:[(0,A.jsxs)("div",{className:"empsettings-sec-head",children:[(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Identity"}),(0,A.jsx)("span",{className:"empsettings-tag",children:"Read-only"})]}),(0,A.jsxs)("div",{className:"empsettings-card",children:[(0,A.jsxs)("div",{className:"empsettings-idcard",children:[(0,A.jsx)("span",{className:"empsettings-avatar","aria-hidden":"true",children:V(q.name)}
1),(0,A.jsxs)("div",{className:"empsettings-idcard-main",children:[(0,A.jsx)("div",{className:"empsettings-idcard-name",children:q.name||"Setting up\u2026"}),(0,A.jsx)("div",{className:"empsettings-idcard-role",children:[q.title,q.business_name].filter(Boolean).join(" \xb7 ")||"Finishing onboarding\u2026"}),q.email_address?(0,A.jsx)("div",{className:"empsettings-idcard-mail empsettings-mono",children:q.email_address}):null]})]}),(0,A.jsx)(D,{label:"Employee ID",children:(0,A.jsx)("span",{className:"empsettings-mono empsettings-muted",children:q.employee_id})}),(0,A.jsx)(D,{label:"Hired",children:(0,A.jsx)("span",{className:"empsettings-value",children:pe})})]})]}),(0,A.jsxs)("section",{className:"empsettings-sec",ref:is("shifts"),children:[(0,A.jsx)("div",{className:"empsettings-sec-head",children:(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Shifts"})}),(0,A.jsxs)("div",{className:"empsettings-card",children:[(0,A.jsx)(D,{label:"Routines",hint:"Named schedules with standing briefs decide when they wake.",children:(0,A.jsx)("button",{type:"button",className:"empsettings-btn",onClick:()=>se("/routines"),children:"Manage routines"})}),(0,A.jsx)(D,{label:"Last shift",children:(0,A.jsx)("span",{className:"empsettings-value",children:he})}),(0,A.jsx)(D,{label:"Start a shift now",hint:"".concat(X," picks up their queue immediately, outside the schedule."),children:(0,A.jsxs)("button",{type:"button",className:"empsettings-btn empsettings-btn--primary",disabled:!ve||be,title:ve?void 0:"Available once the current shift concludes.",onClick:async()=>{ye(!0);try{await(0,_.$W)(t),l.Ay.success("Starting a new shift now\u2026"),setTimeout(()=>R({silent:!0}),1500)}catch(n){var e,s;l.Ay.error((null===n||void 0===n||null===(e=n.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Could not start a shift right now.")}finally{ye(!1)}},children:[(0,A.jsx)(x.default,{size:14,strokeWidth:2}),be?"Starting\u2026":"Start shift now"]})})]})]}),(0,A.jsxs)("section",{className:"empsettings-sec",ref:is("reporting"),children:[(0,A.jsx)("div",{className:"empsettings-sec-head",children:(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Reporting"})}),(0,A.jsxs)("div",{className:"empsettings-card",children:[Z?(0,A.jsx)(D,{label:"Supervisor",hint:"Gets their shift reports and anything they escalate.",children:(0,A.jsx)(f.A,{size:"small",employees:re,humans:ce,value:me,onChange:e=>{const s=me;(e||"")!==s&&w.confirm({title:"Change who ".concat(X," reports to?"),content:(0,A.jsxs)("div",{children:[(0,A.jsxs)("p",{style:{marginBottom:8},children:[(0,A.jsx)("strong",{children:ue(s)})," \u2192 ",(0,A.jsx)("strong",{children:ue(e)})]}),(0,A.jsxs)("p",{style:{marginBottom:0},children:[X," will wake up, greet ",e?"their new manager":"you",", and reorganize how they coordinate work. This starts a shift."]})]}),okText:"Change supervisor",cancelText:"Cancel",onOk:()=>(async e=>{oe(!0);try{e&&e.startsWith("human:")?await(0,_.qb)(t,"human",e.slice(6)):await(0,_.V8)(t,e||null),l.Ay.success(e?"Supervisor updated \u2014 the employee will greet and align with their new manager.":"Supervisor cleared \u2014 the employee now reports directly to you."),ee()}catch(a){var s,n;l.Ay.error((null===(s=a.response)||void 0===s||null===(n=s.data)||void 0===n?void 0:n.detail)||"Failed to update supervisor.")}finally{oe(!1)}})(e)})},disabled:le})}):null,(0,A.jsx)(D,{label:"Direct reports",children:Be.length?(0,A.jsx)("span",{className:"empsettings-value",children:Be.join(", ")}):(0,A.jsxs)("span",{className:"empsettings-empty",children:["No one reports to ",X," yet."]})})]})]}),(0,A.jsxs)("section",{className:"empsettings-sec",ref:is("meetings"),children:[(0,A.jsx)("div",{className:"empsettings-sec-head",children:(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Meetings"})}),(0,A.jsx)("div",{className:"empsettings-card",children:Ue?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(D,{label:"Attend meetings",hint:null!==Pe&&void 0!==Pe&&Pe.employee_email?"Add ".concat(Pe.employee_email," to a calendar invite and ").concat(X," shows up. It joins meetings 
1you, your team or people it has emailed with invite it to, and uses its judgment for anyone else."):"Add ".concat(X,"'s email to a calendar invite and it shows up. It joins meetings you, your team or people it has emailed with invite it to, and uses its judgment for anyone else."),children:(0,A.jsx)(o.A,{checked:!!Ue.enabled,loading:We,onChange:e=>qe({enabled:e},"".concat(X,e?" will attend meetings.":" will decline meeting invites.")),"aria-label":"Attend meetings"})}),(0,A.jsx)(D,{label:"Record meetings",hint:"When on, ".concat(X," says so at the start of the meeting."),children:(0,A.jsx)(o.A,{checked:!!Ue.recording_default,disabled:We||!Ue.enabled,onChange:e=>qe({recording_default:e}),"aria-label":"Record meetings"})}),(0,A.jsx)(D,{label:"Voice",hint:Ze?"".concat(X," presents as ").concat(Ze,". Voices are grouped the way their maker labels them."):"Voices are grouped the way their maker labels them.",children:(0,A.jsx)(r.A,{className:"empsettings-select",value:Ue.live_voice||"",options:Ge,disabled:We||!Ue.enabled,onChange:e=>qe({live_voice:e}),popupMatchSelectWidth:!1,"aria-label":"Voice"})}),(0,A.jsxs)("div",{className:"empsettings-row empsettings-row--stack",children:[(0,A.jsxs)("div",{className:"empsettings-row-main",children:[(0,A.jsx)("div",{className:"empsettings-row-label",children:"Never say"}),(0,A.jsxs)("div",{className:"empsettings-row-hint",children:["Lines ",X," keeps out of every meeting, whatever it is asked."]})]}),Ke.length>0?(0,A.jsx)("ul",{className:"empsettings-list",children:Ke.map((e,s)=>(0,A.jsxs)("li",{children:[(0,A.jsx)("span",{children:e}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn",disabled:We,onClick:()=>qe({do_not_say:Ke.filter((e,t)=>t!==s)}),children:"Remove"})]},"".concat(s,"-").concat(e)))}):null,(0,A.jsxs)("div",{className:"empsettings-add",children:[(0,A.jsx)("input",{className:"empsettings-input",value:Oe,maxLength:200,placeholder:"e.g. Pricing beyond the published page",disabled:We||!Ue.enabled,onChange:e=>Ye(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Je()},"aria-label":"Add a never-say line"}),(0,A.jsx)("button",{type:"button",className:"empsettings-btn",disabled:We||!Ue.enabled||!Oe.trim(),onClick:Je,children:"Add"})]})]}),(0,A.jsx)("div",{className:"empsettings-card-note",children:(0,A.jsxs)("span",{children:["Joins as ",(0,A.jsx)("strong",{children:(null===Pe||void 0===Pe||null===(s=Pe.disclosure)||void 0===s?void 0:s.display_name)||"".concat(X," (AI)")})," and says plainly that it is an AI employee when asked. Anyone in the meeting can ask it to leave."]})})]}):(0,A.jsx)("div",{className:"empsettings-card-note",children:(0,A.jsx)("span",{children:"Loading meeting settings\u2026"})})})]}),(0,A.jsx)(L,{employeeId:t,empName:X,modal:w,Row:D,sectionRef:is("phone")}),Z?(0,A.jsxs)("section",{className:"empsettings-sec",ref:is("model"),children:[(0,A.jsx)("div",{className:"empsettings-sec-head",children:(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Model"})}),(0,A.jsxs)("div",{className:"empsettings-card",children:[(0,A.jsx)(D,{label:"Mode",hint:"Agent is the fast, iterative worker. Creative trades speed for taste.",children:(0,A.jsx)(B,{ariaLabel:"Mode",value:fe?"agent_creative":"human_in_the_loop",onChange:e=>{if(!xe||e===xe)return;ke(e,je||"core")},disabled:Ne||!xe,options:[{label:"Agent",value:"human_in_the_loop"},{label:"Creative",value:"agent_creative"}]})}),(0,A.jsx)(D,{label:"Tier",hint:"How much thinking they put into each task.",children:(0,A.jsx)(B,{ariaLabel:"Tier",value:je||"",onChange:e=>{xe&&je&&e!==je&&ke(xe,e)},disabled:Ne||!je,options:[{label:"Flash",value:"flash"},{label:"Core",value:"core"},{label:"Max",value:"max"}]})}),(0,A.jsx)("div",{className:"empsettings-card-note",children:_e?(0,A.jsxs)("span",{children:[X," runs at ",(0,A.jsx)("strong",{children:_e}),". Changes apply from the next shift; the live shift keeps its model."]}):(0,A.jsx)("span",{children:"Loading current model\u2026"})})]})]}):null,$?(0,A.jsxs)("section",{className:"empsettings-sec",ref:is("sharing"),children:[(0,A.jsx)("div",{className:"empsettings-sec-head",children:(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Sharing"})}),(0,A.jsx)("div",{className:"empsettings-card",children:(0,A.jsx)(D,{label:ds,hint:"Team members get full access and act as you \u2014 ".concat(X," only knows one supervisor."),children:(0,A.jsx)("button",{type:"button",className:"empsettings-btn",onClick:()=>ie(!0),children:"Manage"})})})]}):null,(0,A.jsxs)("section",{className:"empsettings-sec empsettings-sec--danger",ref:is("danger"),children:[(0,A.jsx)("div",{className:"empsettings-sec-head",children:(0,A.jsx)("h2",{className:"empsettings-sec-title",children:"Danger zone"})}),(0,A.jsxs)("div",{className:"empsettings-card empsettings-card--danger",children:[(0,A.jsx)(D,{danger:!0,label:Q?"Resume employee":"Pause employee",hint:Q?"".concat(X," wakes up if anything is waiting in the mailbox and follows routines again."):"Nothing wakes ".concat(X,": routines, emails, tasks and your messages wait in the mailbox. Work, files and history stay exactly as they are."),children:(0,A.jsxs)("button",{type:"button",className:"empsettings-btn empsettings-btn--primary",disabled:te,onClick:ge,children:[Q?(0,A.jsx)(x.default,{size:14,strokeWidth:2}):(0,A.jsx)(y.default,{size:14,strokeWidth:2}),Q?"Resume employee":"Pause employee"]})}),Z&&$?(0,A.jsx)(D,{danger:!0,label:"Hand over employee",hint:"Give ".concat(X," to someone else in this organization. Your connectors, triggers, Cowork, Browse and approvals reset;
1 memory, workspace, tasks, email and phone stay."),children:(0,A.jsx)("button",{type:"button",className:"empsettings-btn",onClick:async()=>{Ee(void 0),Re(!1),Te(null),Ce(!0);try{const e=await(0,_.T9)(t);Te(e.data&&e.data.org_members||[])}catch(n){var e,s;Te([]),l.Ay.error((null===(e=n.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Could not load your organization members.")}},children:"Hand over to\u2026"})}):null,Z?(0,A.jsx)(D,{danger:!0,label:"Delete employee",hint:"Removes ".concat(X,", their computer and everything they have made. This can't be undone."),children:(0,A.jsx)("button",{type:"button",className:"empsettings-btn empsettings-btn--danger",disabled:ze,onClick:()=>{w.confirm({title:"\u26a0\ufe0f Delete AI Employee?",icon:null,content:(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{children:"This action cannot be undone. The following will be permanently deleted:"}),(0,A.jsxs)("ul",{style:{paddingLeft:"20px",marginTop:"12px"},children:[(0,A.jsx)("li",{children:"Every shift and its full conversation history"}),(0,A.jsx)("li",{children:"The shared workspace, files, and dashboard app"}),(0,A.jsx)("li",{children:"All tasks, saved credentials, and email threads"})]}),(0,A.jsxs)("p",{style:{marginTop:"16px"},children:[(0,A.jsx)("strong",{children:"Employee:"}),' "',X,'"']})]}),okText:"Delete Permanently",okType:"danger",cancelText:"Cancel",width:500,onOk:async()=>{De(!0);try{await(0,_.IP)(t)}catch(n){var e,s;l.Ay.error((null===(e=n.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Failed to delete employee. Please try again."),De(!1)}}})},children:ze?"Deleting\u2026":"Delete employee\u2026"})}):null]})]})]})})]}),(0,A.jsx)(i.A,{open:Ae,title:"Hand over ".concat(X),onCancel:()=>Ce(!1),onOk:async()=>{if(Ie){Ve(!0);try{await(0,_.at)(t,Ie,Me);const e=(Se||[]).find(e=>e.user_id===Ie);l.Ay.success("".concat(X," now belongs to ").concat((null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.email)||"the new owner",".")),Ce(!1),Me?ee():se("/")}catch(n){var e,s;l.Ay.error((null===(e=n.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Hand-over failed. Please try again.")}finally{Ve(!1)}}},okText:"Hand over",okButtonProps:{danger:!0,disabled:!Ie,loading:Le},cancelText:"Cancel",destroyOnClose:!0,children:null===Se?(0,A.jsx)("p",{children:"Loading members\u2026"}):0===Se.length?(0,A.jsx)("p",{children:"No one else is in this organization yet. Invite them from the Organization page first."}):(0,A.jsxs)("div",{children:[(0,A.jsx)(r.A,{style:{width:"100%"},placeholder:"Choose the new owner",value:Ie,onChange:Ee,showSearch:!0,optionFilterProp:"label",options:Se.map(e=>({value:e.user_id,label:e.name?"".concat(e.name," (").concat(e.email,")"):e.email}))}),(0,A.jsxs)("p",{style:{marginTop:16,marginBottom:6},children:[(0,A.jsx)("strong",{children:"Resets"})," (they are yours): connectors and keys, triggers on your apps, Cowork, Browse and standing approvals."]}),(0,A.jsxs)("p",{style:{marginBottom:16},children:[(0,A.jsx)("strong",{children:"Stays"}),": memory, workspace, tasks, email address and phone number. The new owner pays from now on, and ",X," asks them to reconnect what it needs."]}),(0,A.jsx)(d.A,{checked:Me,onChange:e=>Re(e.target.checked),children:"Keep me as a shared member"})]})}),(0,A.jsx)(C,{open:ae,onClose:()=>ie(!1),employee:q,onUpdated:ee})]})})}}}]);
2//# sourceMappingURL=1537.520648f6.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.