@vellumai/web 0.10.7-staging.3 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{account-page-B23E40JO.js → account-page-s8JvT8Ly.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-Bdh94yKC.js → acp-run-detail-panel-7SM2s3JT.js} +1 -1
- package/dist/assets/{advanced-page-Dnr932Wm.js → advanced-page-Ct7QbjS_.js} +1 -1
- package/dist/assets/{ai-page-b6Mj-Zsu.js → ai-page-BcgdcD4e.js} +1 -1
- package/dist/assets/{api-key-screen-DQki1W-A.js → api-key-screen-DCT4UgG9.js} +1 -1
- package/dist/assets/{archive-page-Cvsyjezf.js → archive-page-Ct96gKer.js} +1 -1
- package/dist/assets/{background-task-detail-panel-CGMvMXCQ.js → background-task-detail-panel-CfEFRK9m.js} +1 -1
- package/dist/assets/{billing-page-TEa10hdg.js → billing-page-7z-qyk7R.js} +1 -1
- package/dist/assets/{bookmarks-page-DIgg1D-T.js → bookmarks-page-BPDCi7Fj.js} +1 -1
- package/dist/assets/{channels-page-route-C2Nl219Z.js → channels-page-route-CpAKC7Ny.js} +1 -1
- package/dist/assets/{command-palette-CqsAk2bk.js → command-palette-DzGSKQit.js} +1 -1
- package/dist/assets/{command-palette-window-page-CQDfNUg8.js → command-palette-window-page-DBnL5TIj.js} +1 -1
- package/dist/assets/{community-page-CRatE8lU.js → community-page-pr5Nq-N8.js} +1 -1
- package/dist/assets/{contacts-page-route-iOxZAEmX.js → contacts-page-route-CRf2kU0k.js} +1 -1
- package/dist/assets/{debug-page-DM5fCe8s.js → debug-page-CAXWUmxw.js} +1 -1
- package/dist/assets/{deploy-dialogs-DeMCbajh.js → deploy-dialogs-C5LDby59.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-BG30B_ut.js → detail-panel-stop-button-BGbnqhbl.js} +1 -1
- package/dist/assets/{developer-page-6TD98AEn.js → developer-page-Bgo4T1LR.js} +1 -1
- package/dist/assets/{devices-page-DLgZZPc_.js → devices-page-CsqBToSK.js} +1 -1
- package/dist/assets/{dictation-overlay-page-n3MFdISz.js → dictation-overlay-page-DVlL606t.js} +1 -1
- package/dist/assets/{document-viewer-page-vn_TkMOu.js → document-viewer-page-BaGYg7Jy.js} +1 -1
- package/dist/assets/{earn-credits-modal-Kiy_BLRA.js → earn-credits-modal-5kY_ZmHS.js} +1 -1
- package/dist/assets/{emails-page-2P4G4vHs.js → emails-page-BSlc4IyH.js} +1 -1
- package/dist/assets/{file-editor-jo80Wq__.js → file-editor-CiduanJg.js} +1 -1
- package/dist/assets/{general-page-Do2j5n3g.js → general-page-Cx_BeDy7.js} +1 -1
- package/dist/assets/{hatching-screen-jdA6SwLT.js → hatching-screen-DGWclpGa.js} +1 -1
- package/dist/assets/{home-page-route-Bq63JIqL.js → home-page-route-B6axS8Xb.js} +1 -1
- package/dist/assets/{hosting-screen-DXgKZFDW.js → hosting-screen-BQCZiStC.js} +1 -1
- package/dist/assets/{identity-page-route-m9rSTuhG.js → identity-page-route-Ck6yFc4b.js} +1 -1
- package/dist/assets/{index-hPtT-g8P.js → index-CoobbyzR.js} +7 -7
- package/dist/assets/{inspect-page-BB_BDpyb.js → inspect-page-CKGEq0sL.js} +1 -1
- package/dist/assets/{install-B0y4Za_w.js → install-BfTQMx11.js} +1 -1
- package/dist/assets/{integrations-page-B4f_FfRo.js → integrations-page-vewUMHCO.js} +1 -1
- package/dist/assets/{intelligence-layout-Cht_lJjU.js → intelligence-layout-Y0MnzPhq.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-BOL4nm9p.js → keyboard-shortcuts-page-CONirTbD.js} +1 -1
- package/dist/assets/{library-detail-page-BROKiBFk.js → library-detail-page-nV2EKiXc.js} +1 -1
- package/dist/assets/{library-page-BQR2bw2F.js → library-page-B9_dVu66.js} +1 -1
- package/dist/assets/{logout-page-CCiv4jPy.js → logout-page-CD2DJ8cb.js} +1 -1
- package/dist/assets/{logs-layout-TrRGbANp.js → logs-layout-Cp0hu2KO.js} +1 -1
- package/dist/assets/{memory-router-playground-page-BMOuJsvP.js → memory-router-playground-page-CP8awc0-.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-BktATKVj.js → mobile-sidebar-drawer-qLk01r-p.js} +1 -1
- package/dist/assets/{notifications-page-BeqePrLc.js → notifications-page-C32A7t8f.js} +1 -1
- package/dist/assets/{oauth-complete-page-DH7pCmlr.js → oauth-complete-page-DLsLw4Ai.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-Da7ImlPf.js → oauth-popup-complete-page-Bzch_dtU.js} +1 -1
- package/dist/assets/{pairing-page-D8XMJrBG.js → pairing-page-Chm98xKO.js} +1 -1
- package/dist/assets/{plugins-page-BOO7bvSx.js → plugins-page-_hVmUOdU.js} +1 -1
- package/dist/assets/{prechat-route-CCoHvaFl.js → prechat-route-FwhIKBwh.js} +1 -1
- package/dist/assets/{privacy-page-RTX4Yjha.js → privacy-page-Dgk9eUIc.js} +1 -1
- package/dist/assets/{privacy-screen-jgtQ3V2q.js → privacy-screen-BWMJTqw0.js} +1 -1
- package/dist/assets/{provider-callback-page-CmuikMVk.js → provider-callback-page-DrIkf6Qx.js} +1 -1
- package/dist/assets/{research-mock-page-1FdA6SAs.js → research-mock-page-pa9X5DVr.js} +1 -1
- package/dist/assets/research-onboarding-route-DMNYFP95.js +61 -0
- package/dist/assets/{review-terms-screen-DKFm11RI.js → review-terms-screen-Dhzjmovc.js} +1 -1
- package/dist/assets/{security-page-D1-EXDrD.js → security-page-Cp2s0T8l.js} +1 -1
- package/dist/assets/{select-assistant-screen-kQk8uctH.js → select-assistant-screen-BznHV3KW.js} +1 -1
- package/dist/assets/{settings-layout-DPioVvay.js → settings-layout-u1k_Rsdf.js} +1 -1
- package/dist/assets/{share-feedback-modal-CMe4QKoz.js → share-feedback-modal-D1-RcW6F.js} +1 -1
- package/dist/assets/{sidebar-tree-7hYjAyQU.js → sidebar-tree-CMREzbfC.js} +1 -1
- package/dist/assets/{signup-page-hMLiafSA.js → signup-page-DdEr8yFN.js} +1 -1
- package/dist/assets/{skills-page-BqbMes03.js → skills-page-DEyycwld.js} +1 -1
- package/dist/assets/{sounds-page-DpqaPXCf.js → sounds-page-1emqNnJy.js} +1 -1
- package/dist/assets/{subagent-detail-panel-DQPnR7H9.js → subagent-detail-panel-Akqnt7ec.js} +1 -1
- package/dist/assets/{system-events-page-BOfz-dXO.js → system-events-page-ww0hAGYR.js} +1 -1
- package/dist/assets/{tiptap-document-editor-DDIDmvxH.js → tiptap-document-editor-EQIK5AAg.js} +1 -1
- package/dist/assets/{tool-detail-panel-BA3Tqjgh.js → tool-detail-panel-C_g0wGNh.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CgI3Yfry.js → upgrade-cancel-page-BJH7716k.js} +1 -1
- package/dist/assets/{upgrade-success-page-CiUKobQQ.js → upgrade-success-page-1PlVik4u.js} +1 -1
- package/dist/assets/{usage-page-D775iVDn.js → usage-page-jkBMfAr8.js} +1 -1
- package/dist/assets/{use-setup-channel-param-DYp2D5Aq.js → use-setup-channel-param-CRMdNnM_.js} +1 -1
- package/dist/assets/{use-skill-categories-BMB8RYj0.js → use-skill-categories-q-Ih2uSR.js} +1 -1
- package/dist/assets/{voice-page-B96S3t9v.js → voice-page-DIpdPRDT.js} +1 -1
- package/dist/assets/{weather-forecast-display-B1XUbjO6.js → weather-forecast-display-CJ_ZT_-B.js} +1 -1
- package/dist/assets/{welcome-screen-ey2NEDai.js → welcome-screen-C_JlT5id.js} +1 -1
- package/dist/assets/{workflow-detail-panel-igh-JGcf.js → workflow-detail-panel-BIZ8culE.js} +1 -1
- package/dist/assets/{workspace-page-W_z8ob2z.js → workspace-page-8DC4PiAA.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/research-onboarding-route-xNHY8vID.js +0 -61
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./react-DJZBPgpf.js";import{F as s,t as c}from"./button-D1p5nVKJ.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./cn-C36Yvcac.js";import{t as m}from"./card-Bv5O5juh.js";import{t as h}from"./chevron-down-qD-re7AW.js";import{t as g}from"./chevron-right-DqqmezXC.js";import{t as _}from"./loader-circle-D1pLQlMh.js";import{t as v}from"./pencil-rKUVpppO.js";import{t as y}from"./shield-check-DFzO4cEd.js";import{t as b}from"./x-CwzRJv9J.js";import{t as x}from"./notice-Dh3mnM_U.js";import{t as S}from"./tag-BizaosUX.js";import{t as C}from"./input-DR1eB4a1.js";import{t as w}from"./toggle-D7S110RM.js";import{n as T}from"./toast-DowcpN7g.js";import{t as E}from"./confirm-dialog-DW84Cxfq.js";import{t as D}from"./dropdown-BsftIzw-.js";import{f as O,n as k,r as A}from"./auth-store-CI4EhvE5.js";import{t as j}from"./sdk.gen-B3bmXhSv.js";import{c as M,i as ee,m as N,n as te,o as P,r as ne,s as re,t as ie}from"./native-biometric-uwPAd9lh.js";import{a as ae,o as F}from"./routes-iUGoIqW2.js";import{n as oe,t as se}from"./react-query.gen-DVZyPw6H.js";import{Fn as ce,G as le,In as ue,Lr as de,On as fe,Pn as pe,Rr as I,T as L,U as R,W as z,_ as B,b as me,mi as he,v as V,y as ge,zr as H}from"./index-hPtT-g8P.js";import{t as U}from"./use-active-assistant-id-BBHOMQFe.js";import{t as W}from"./detail-card-CnahmiAd.js";import{t as G}from"./setting-row-D9Jbc5pM.js";var K=e(o(),1),q=f(),J=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],_e=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ve(){let[e,t]=(0,K.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function ye(){let[e,r]=(0,K.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,K.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||fe(0)}]}function be({row:e,onToggle:t}){return(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(w,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,q.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,q.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=ue(),{pendingKind:o,run:s}=ve(),[c,l]=ye(),u=(0,K.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of J){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,K.useMemo)(()=>{let e=J.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=_e.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await pe(e.sourceKind):await ce(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,q.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,q.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,q.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,q.jsx)(xe,{}),`Checking permissions...`]}):(0,q.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,q.jsx)(be,{row:e,onToggle:p},e.id))}),r&&(0,q.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Ce(){let e=H({platformHostedOnly:!0}),t=de(),n=I(),r=l(),{data:i,isLoading:a,isError:o}=u({...se(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await j({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{oe(r,void 0,e),T.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{T.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,q.jsxs)(q.Fragment,{children:[(s.isPending||c)&&(0,q.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,q.jsx)(w,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,q.jsx)(L,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=N(),[t,n]=(0,K.useState)(()=>ee()),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(`Face ID`),[s,c]=(0,K.useState)(!1);if((0,K.useEffect)(()=>{e&&(ne().then(i),te().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)P(!1),await ie(),n(!1);else{let e=M();e&&await re(e),P(!0),n(!0)}}finally{c(!1)}};return(0,q.jsx)(W,{title:`Security`,children:(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,q.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,q.jsx)(w,{checked:t,onChange:()=>void l(),disabled:s})]})})}function Y(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=B.map(e=>({value:e.id,label:e.label,icon:(0,q.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=U(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,K.useState)(`relaxed`),[o,s]=(0,K.useState)(`conservative`),[c,d]=(0,K.useState)(`strict`),[f,p]=(0,K.useState)(!1),_=(0,K.useRef)(!1),[v,y]=(0,K.useState)(!1),b=(0,K.useRef)(null),x=(0,K.useRef)(null);(0,K.useEffect)(()=>{!n||_.current||(a(V(n.interactive).id),s(V(n.autonomous).id),d(V(n.headless).id),y(!0))},[n]),(0,K.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,K.useCallback)((n,r,i)=>{if(!e||!v)return;let a=B.find(e=>e.id===n)?.riskThreshold,o=B.find(e=>e.id===r)?.riskThreshold,s=B.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||me(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,v,t]),C=(0,K.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,K.useCallback)(e=>{_.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,K.useCallback)(e=>{_.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,K.useCallback)(e=>{_.current=!0,d(e),C(i,o,e)},[i,o,C]),O=B.find(e=>e.id===i),k=B.find(e=>e.id===o),A=B.find(e=>e.id===c),j=!e||!v;return(0,q.jsxs)(m,{children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your tolerance determines which levels auto-approve.`}),r&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:i,onChange:w,options:X,disabled:j})}),O&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,q.jsx)(h,{className:`h-4 w-4`}):(0,q.jsx)(g,{className:`h-4 w-4`}),(0,q.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,q.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:o,onChange:T,options:X,disabled:j})}),k&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:c,onChange:E,options:X,disabled:j})}),A&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:A.description})]})]})]})]})]})}var Z=e(s(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,K.useRef)(null),[a,o]=(0,K.useState)(t.tool),[s,c]=(0,K.useState)(t.pattern),[l,u]=(0,K.useState)(t.risk),[d,f]=(0,K.useState)(t.description??``),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,K.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await le(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,Z.createPortal)((0,q.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,K.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,K.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,q.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,q.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,q.jsx)(b,{className:`h-4 w-4`})})]}),(0,q.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,q.jsx)(x,{tone:`error`,children:h}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,q.jsx)(`div`,{className:`mt-1`,children:(0,q.jsx)(D,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,q.jsx)(C,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,q.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,q.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`div`,{children:e.label}),(0,q.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,q.jsx)(C,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function ke(e){return e.origin===`default`&&!e.userModified}function Ae(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function je(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me({assistantId:e,onClose:t}){let n=(0,K.useRef)(null),[r,i]=(0,K.useState)([]),[a,o]=(0,K.useState)(!0),[s,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1),g=(0,K.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([z(e),z(e,{origin:`default`})]);return Ae(t,n)}return z(e)},[e]),_=(0,K.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,K.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let b=(0,K.useCallback)(async()=>{if(f)try{await R(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,Z.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,K.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,K.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,q.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(w,{checked:m,onChange:h,label:`Show all defaults`}),(0,q.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,q.jsx)(`div`,{className:`mb-3`,children:(0,q.jsx)(x,{tone:`error`,children:s})}),a?(0,q.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,q.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,q.jsx)(y,{className:`h-8 w-8`}),(0,q.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,q.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,q.jsx)(S,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,q.jsx)(S,{tone:`neutral`,children:`Default`}),e.userModified&&(0,q.jsx)(S,{tone:`warning`,children:`Modified`})]}),(0,q.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,q.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,q.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,q.jsx)(v,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,q.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,q.jsx)(he,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,q.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,q.jsx)(E,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void b(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=U(),[t,n]=(0,K.useState)(!1);return(0,q.jsxs)(m,{children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(y,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,q.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,q.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Fe=`thirtyDays`;function $(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=H({platformHostedOnly:!0}),t=A(),a=t,o=k.use.user()?.id??null,[s,c]=(0,K.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,K.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,K.useState)(()=>i(`llmLogRetention`,Fe));return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(we,{}),(0,q.jsx)(Se,{}),(0,q.jsx)(Ne,{}),(0,q.jsx)(Te,{}),(0,q.jsx)(W,{title:`Privacy`,subtitle:t?(0,q.jsxs)(q.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,q.jsx)(`a`,{href:ae(F.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),O(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{}),(0,q.jsx)(G,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),O(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{})]}),(0,q.jsx)(Ce,{}),e!==`gated`&&(0,q.jsx)($,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{Ie as PrivacyPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./react-DJZBPgpf.js";import{F as s,t as c}from"./button-D1p5nVKJ.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./cn-C36Yvcac.js";import{t as m}from"./card-Bv5O5juh.js";import{t as h}from"./chevron-down-qD-re7AW.js";import{t as g}from"./chevron-right-DqqmezXC.js";import{t as _}from"./loader-circle-D1pLQlMh.js";import{t as v}from"./pencil-rKUVpppO.js";import{t as y}from"./shield-check-DFzO4cEd.js";import{t as b}from"./x-CwzRJv9J.js";import{t as x}from"./notice-Dh3mnM_U.js";import{t as S}from"./tag-BizaosUX.js";import{t as C}from"./input-DR1eB4a1.js";import{t as w}from"./toggle-D7S110RM.js";import{n as T}from"./toast-DowcpN7g.js";import{t as E}from"./confirm-dialog-DW84Cxfq.js";import{t as D}from"./dropdown-BsftIzw-.js";import{f as O,n as k,r as A}from"./auth-store-CI4EhvE5.js";import{t as j}from"./sdk.gen-B3bmXhSv.js";import{c as M,i as ee,m as N,n as te,o as P,r as ne,s as re,t as ie}from"./native-biometric-uwPAd9lh.js";import{a as ae,o as F}from"./routes-iUGoIqW2.js";import{n as oe,t as se}from"./react-query.gen-DVZyPw6H.js";import{Fn as ce,G as le,In as ue,Lr as de,On as fe,Pn as pe,Rr as I,T as L,U as R,W as z,_ as B,b as me,mi as he,v as V,y as ge,zr as H}from"./index-CoobbyzR.js";import{t as U}from"./use-active-assistant-id-BBHOMQFe.js";import{t as W}from"./detail-card-CnahmiAd.js";import{t as G}from"./setting-row-D9Jbc5pM.js";var K=e(o(),1),q=f(),J=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],_e=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ve(){let[e,t]=(0,K.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function ye(){let[e,r]=(0,K.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,K.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||fe(0)}]}function be({row:e,onToggle:t}){return(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(w,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,q.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,q.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=ue(),{pendingKind:o,run:s}=ve(),[c,l]=ye(),u=(0,K.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of J){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,K.useMemo)(()=>{let e=J.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=_e.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await pe(e.sourceKind):await ce(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,q.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,q.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,q.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,q.jsx)(xe,{}),`Checking permissions...`]}):(0,q.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,q.jsx)(be,{row:e,onToggle:p},e.id))}),r&&(0,q.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Ce(){let e=H({platformHostedOnly:!0}),t=de(),n=I(),r=l(),{data:i,isLoading:a,isError:o}=u({...se(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await j({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{oe(r,void 0,e),T.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{T.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,q.jsxs)(q.Fragment,{children:[(s.isPending||c)&&(0,q.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,q.jsx)(w,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,q.jsx)(L,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=N(),[t,n]=(0,K.useState)(()=>ee()),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(`Face ID`),[s,c]=(0,K.useState)(!1);if((0,K.useEffect)(()=>{e&&(ne().then(i),te().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)P(!1),await ie(),n(!1);else{let e=M();e&&await re(e),P(!0),n(!0)}}finally{c(!1)}};return(0,q.jsx)(W,{title:`Security`,children:(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,q.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,q.jsx)(w,{checked:t,onChange:()=>void l(),disabled:s})]})})}function Y(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=B.map(e=>({value:e.id,label:e.label,icon:(0,q.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=U(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,K.useState)(`relaxed`),[o,s]=(0,K.useState)(`conservative`),[c,d]=(0,K.useState)(`strict`),[f,p]=(0,K.useState)(!1),_=(0,K.useRef)(!1),[v,y]=(0,K.useState)(!1),b=(0,K.useRef)(null),x=(0,K.useRef)(null);(0,K.useEffect)(()=>{!n||_.current||(a(V(n.interactive).id),s(V(n.autonomous).id),d(V(n.headless).id),y(!0))},[n]),(0,K.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,K.useCallback)((n,r,i)=>{if(!e||!v)return;let a=B.find(e=>e.id===n)?.riskThreshold,o=B.find(e=>e.id===r)?.riskThreshold,s=B.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||me(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,v,t]),C=(0,K.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,K.useCallback)(e=>{_.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,K.useCallback)(e=>{_.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,K.useCallback)(e=>{_.current=!0,d(e),C(i,o,e)},[i,o,C]),O=B.find(e=>e.id===i),k=B.find(e=>e.id===o),A=B.find(e=>e.id===c),j=!e||!v;return(0,q.jsxs)(m,{children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your tolerance determines which levels auto-approve.`}),r&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:i,onChange:w,options:X,disabled:j})}),O&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,q.jsx)(h,{className:`h-4 w-4`}):(0,q.jsx)(g,{className:`h-4 w-4`}),(0,q.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,q.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:o,onChange:T,options:X,disabled:j})}),k&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:c,onChange:E,options:X,disabled:j})}),A&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:A.description})]})]})]})]})]})}var Z=e(s(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,K.useRef)(null),[a,o]=(0,K.useState)(t.tool),[s,c]=(0,K.useState)(t.pattern),[l,u]=(0,K.useState)(t.risk),[d,f]=(0,K.useState)(t.description??``),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,K.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await le(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,Z.createPortal)((0,q.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,K.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,K.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,q.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,q.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,q.jsx)(b,{className:`h-4 w-4`})})]}),(0,q.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,q.jsx)(x,{tone:`error`,children:h}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,q.jsx)(`div`,{className:`mt-1`,children:(0,q.jsx)(D,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,q.jsx)(C,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,q.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,q.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`div`,{children:e.label}),(0,q.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,q.jsx)(C,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function ke(e){return e.origin===`default`&&!e.userModified}function Ae(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function je(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me({assistantId:e,onClose:t}){let n=(0,K.useRef)(null),[r,i]=(0,K.useState)([]),[a,o]=(0,K.useState)(!0),[s,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1),g=(0,K.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([z(e),z(e,{origin:`default`})]);return Ae(t,n)}return z(e)},[e]),_=(0,K.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,K.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let b=(0,K.useCallback)(async()=>{if(f)try{await R(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,Z.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,K.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,K.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,q.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(w,{checked:m,onChange:h,label:`Show all defaults`}),(0,q.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,q.jsx)(`div`,{className:`mb-3`,children:(0,q.jsx)(x,{tone:`error`,children:s})}),a?(0,q.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,q.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,q.jsx)(y,{className:`h-8 w-8`}),(0,q.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,q.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,q.jsx)(S,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,q.jsx)(S,{tone:`neutral`,children:`Default`}),e.userModified&&(0,q.jsx)(S,{tone:`warning`,children:`Modified`})]}),(0,q.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,q.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,q.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,q.jsx)(v,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,q.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,q.jsx)(he,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,q.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,q.jsx)(E,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void b(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=U(),[t,n]=(0,K.useState)(!1);return(0,q.jsxs)(m,{children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(y,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,q.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,q.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Fe=`thirtyDays`;function $(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=H({platformHostedOnly:!0}),t=A(),a=t,o=k.use.user()?.id??null,[s,c]=(0,K.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,K.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,K.useState)(()=>i(`llmLogRetention`,Fe));return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(we,{}),(0,q.jsx)(Se,{}),(0,q.jsx)(Ne,{}),(0,q.jsx)(Te,{}),(0,q.jsx)(W,{title:`Privacy`,subtitle:t?(0,q.jsxs)(q.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,q.jsx)(`a`,{href:ae(F.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),O(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{}),(0,q.jsx)(G,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),O(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{})]}),(0,q.jsx)(Ce,{}),e!==`gated`&&(0,q.jsx)($,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(D,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{Ie as PrivacyPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{p as o}from"./local-mode-YoUYEn7C.js";import{t as s}from"./is-electron-LEymSS4C.js";import{d as c,i as l,n as u}from"./auth-store-CI4EhvE5.js";import{m as d}from"./native-biometric-uwPAd9lh.js";import{o as f}from"./routes-iUGoIqW2.js";import{d as p,f as m,p as h,u as g}from"./prefs-Bo9fZ56w.js";import{t as _}from"./client-feature-flag-store-C0Tjm-Hl.js";import{Ct as v,Et as y,Ot as b,Tt as x,bt as S,in as C}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{p as o}from"./local-mode-YoUYEn7C.js";import{t as s}from"./is-electron-LEymSS4C.js";import{d as c,i as l,n as u}from"./auth-store-CI4EhvE5.js";import{m as d}from"./native-biometric-uwPAd9lh.js";import{o as f}from"./routes-iUGoIqW2.js";import{d as p,f as m,p as h,u as g}from"./prefs-Bo9fZ56w.js";import{t as _}from"./client-feature-flag-store-C0Tjm-Hl.js";import{Ct as v,Et as y,Ot as b,Tt as x,bt as S,in as C}from"./index-CoobbyzR.js";import{t as w}from"./step-indicator-dots-DzT4WVOT.js";import{n as T,t as E}from"./consent-controls-J9UujLtO.js";var D=e(t(),1);function O({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}var k=a();function A(){let e=r(),[t]=i(),a=u.use.user()?.id??null,A=s(),j=d(),M=y(_.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[N,P]=p(),[F,I]=m(),[L,R]=h(),[z,B]=g(),V=l();(0,D.useEffect)(()=>{j||x()},[j]);let H=t.get(`preview`)===`true`,U=(0,D.useCallback)(e=>{},[]),W=H?U:P,G=H?U:I,K=H?U:R,q=H?U:B,J=(0,D.useCallback)(()=>{if(H){e(`${f.onboarding.prechat}?preview=true`);return}if(c({userId:a,tos:L,privacy:z,shareAnalytics:N,shareDiagnostics:F,hasPlatformSession:V}),!j){let e=b(M);v(S.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${O({isNative:j,isLocalHatch:o()&&n!==null&&n!==`vellum-cloud`})}${i?`?${i}`:``}`)},[z,V,j,H,e,M,t,N,F,L,a]);return(0,k.jsx)(C,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:N,shareDiagnostics:F,onShareAnalyticsChange:W,onShareDiagnosticsChange:G,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:z,tosAccepted:L,onPrivacyChange:q,onTosChange:K,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!L||!z,onClick:J,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
|
package/dist/assets/{provider-callback-page-CmuikMVk.js → provider-callback-page-DrIkf6Qx.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CmeVLfq0.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s,w as c}from"./local-mode-YoUYEn7C.js";import{D as l,n as u}from"./auth-store-CI4EhvE5.js";import{c as d}from"./api-DXLi4DU7.js";import{S as f,_ as p}from"./native-biometric-uwPAd9lh.js";import{o as m}from"./routes-iUGoIqW2.js";import{a as h,i as g}from"./login-flow-CFhW2AHB.js";import{n as _}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CmeVLfq0.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s,w as c}from"./local-mode-YoUYEn7C.js";import{D as l,n as u}from"./auth-store-CI4EhvE5.js";import{c as d}from"./api-DXLi4DU7.js";import{S as f,_ as p}from"./native-biometric-uwPAd9lh.js";import{o as m}from"./routes-iUGoIqW2.js";import{a as h,i as g}from"./login-flow-CFhW2AHB.js";import{n as _}from"./index-CoobbyzR.js";import{r as v,t as y}from"./account-shell-BSwEFNTM.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=u.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await f(),r=p(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),s())try{let e=await d();if(e.ok&&e.data.length>0&&(await c(e.data,l.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{o}from"./routes-iUGoIqW2.js";import{t as s}from"./client-feature-flag-store-C0Tjm-Hl.js";import{t as c}from"./conversation-store-COUX81g-.js";import{t as l}from"./conversation-selection-oLES1vkM.js";import{on as u}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{o}from"./routes-iUGoIqW2.js";import{t as s}from"./client-feature-flag-store-C0Tjm-Hl.js";import{t as c}from"./conversation-store-COUX81g-.js";import{t as l}from"./conversation-selection-oLES1vkM.js";import{on as u}from"./index-CoobbyzR.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CmeVLfq0.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-D1p5nVKJ.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-C36Yvcac.js";import{t as l}from"./arrow-left-DI9551VI.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{n as f,t as p}from"./animated-avatar-KEsxQUWX.js";import{t as m}from"./loader-circle-D1pLQlMh.js";import{t as h}from"./pencil-rKUVpppO.js";import{t as g}from"./x-CwzRJv9J.js";import{t as _}from"./tag-BizaosUX.js";import{t as v}from"./input-DR1eB4a1.js";import{i as y,r as b,t as x}from"./dist-CAIL9R6N.js";import{n as S,t as C}from"./create-selectors-DxrPZQND.js";import{b as w,ct as T,o as E,p as D}from"./local-mode-YoUYEn7C.js";import{$ as O,An as ee,B as k,cn as A,jn as j,sn as M}from"./sdk.gen-Bz2u5Wv3.js";import{r as te}from"./api-errors-DZ6ckXtC.js";import{A as ne,B as re,L as ie,R as ae,n as oe,z as se}from"./auth-store-CI4EhvE5.js";import{a as N,o as ce,r as P}from"./api-DXLi4DU7.js";import{o as le}from"./routes-iUGoIqW2.js";import{n as ue}from"./platform-detection-CY-O-Rjc.js";import{c as de,l as fe}from"./prechat-UQXfXf5i.js";import{i as pe,n as me,r as he,t as ge}from"./research-onboarding-persistence-DBhBmIGA.js";import{A as _e,B as F,C as ve,D as ye,E as be,F as xe,I,L as Se,M as Ce,N as L,O as we,P as R,R as z,S as Te,T as Ee,V as B,_ as De,a as Oe,b as ke,d as V,f as Ae,g as je,i as Me,j as Ne,k as Pe,m as Fe,o as Ie,p as Le,r as Re,s as ze,t as H,v as Be,w as Ve,x as He,y as Ue}from"./proxy-CheNMUr6.js";import{t as We}from"./AnimatePresence-Oxz4BTMX.js";import{t as U}from"./use-reduced-motion-DUPDDLHh.js";import{Da as W,Jt as Ge,St as Ke,Ti as qe,an as Je,cn as Ye,in as Xe,ji as Ze,nr as Qe,ot as $e,sn as et,st as G,vn as tt,wt as nt}from"./index-CoobbyzR.js";import{n as rt,t as it}from"./onboarding-step-layout-QhoZ4RKu.js";import{t as at}from"./prechat-names-BX9ToPj8.js";var ot=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function st(e,t){return Ce(e)?e[ot(0,e.length,t)]:e}var ct=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return lt(this.animations,`duration`)}get iterationDuration(){return lt(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function lt(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ut=class extends ct{then(e,t){return this.finished.finally(e).then(()=>{})}};function dt(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=be(i,a,o);return t?s(r):s}function ft(e,t){return e in t}var pt=class extends ze{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(ft(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Ae()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},K=e(n(),1);function mt(e){let t=B(()=>Te(e)),{isStatic:n}=(0,K.useContext)(Re);if(n){let[,n]=(0,K.useState)(e);(0,K.useEffect)(()=>t.on(`change`,n),[])}return t}function ht(e,t){let n=mt(t()),r=()=>n.set(t());return r(),F(()=>{let t=()=>Ne.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),_e(r)}}),n}function gt(e){He.current=[],e();let t=ht(He.current,e);return He.current=void 0,t}function _t(e,t,n,r){if(typeof e==`function`)return gt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return yt(e,t,n,r);let i=typeof t==`function`?t:dt(t,n,r),a=Array.isArray(e)?vt(e,i):vt([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function vt(e,t){let n=B(()=>[]);return ht(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function yt(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=_t(e,t,n[o],r);return a}function bt(e){e.values.forEach(e=>e.stop())}function xt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&ke(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{xt(e,t)})})}function St(e,t){if(Array.isArray(t))return xt(e,t);if(typeof t==`string`)return xt(e,[t]);ke(e,t)}function Ct(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){I(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(De(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return I(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{St(e,n)})},stop(){t.forEach(e=>{bt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function wt(e){return typeof e==`object`&&!Array.isArray(e)}function Tt(e,t,n,r){return e==null?[]:typeof e==`string`&&wt(t)?je(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Et(e,t,n){return e*(t+1)+n*t}function Dt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Ot(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(z(e,i),r--)}}function kt(e,t,n,r,i,a){Ot(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Pe(i,a,r[o]),easing:st(n,o)})}function At(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function jt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Mt=`easeInOut`,Nt=20;function Pt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Dt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Dt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Lt(e),{delay:l=0,times:u=Ve(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=ve(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Bt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=R(b));let r=we(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Ee(u,T),c.length===1&&c.unshift(null),m&&Se(m<Nt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Nt} or apply repeat at the sequence level instead.`),m&&m<Nt){let e=b>0?_/b:0;b=Et(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?L(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:st(f,e-1))}At(u,m,e)}let E=w+b;kt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ue(p)){let e=Ft(p,s);_(m,h,It(`default`,e))}else{let e=Tt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Ft(r,s);for(let e in m)_(m[e],Rt(h,e),It(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(jt);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(xe(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Mt)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Ft(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function It(e,t){return t[e]||(t[e]=[]),t[e]}function Lt(e){return Array.isArray(e)?e:[e]}function Rt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var zt=e=>typeof e==`number`,Bt=e=>e.every(zt);function Vt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Fe(e)&&!Le(e)?new Oe(t):new Ie(t);n.mount(e),V.set(e,n)}function Ht(e){let t=new pt({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function Ut(e,t){return Ue(e)||typeof e==`number`||typeof e==`string`&&!wt(t)}function Wt(e,t,n,r){let i=[];if(Ut(e,t))i.push(Me(e,wt(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Tt(e,t,r),o=a.length;I(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Vt:Ht;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Be(c,{...t,transition:l},{}))}}return i}function Gt(e,t,n){let r=[];return Pt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Te(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:ye}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Wt(n,e,t))}),r}function Kt(e){return Array.isArray(e)&&e.some(Array.isArray)}function qt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Kt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Gt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Wt(e,i,{...c,...r},t)}let l=new ut(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{z(t.animations,l)})),l}return i}var Jt=qt();function Yt(){let e=B(Ct);return F(e.mount,[]),e}var Xt=12;function Zt(e,t){let n=e.slice(0,Xt).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
2
|
+
`);return n?`
|
|
3
|
+
Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
|
|
4
|
+
${n}
|
|
5
|
+
|
|
6
|
+
Add a "plugins" array as the FIRST key in your JSON object, ${t?`before "claims" and "suggestions"`:`before "claims"`}: the 1-2 capabilities from the list above (exact names) that best fit who I am — judged by what you researched about my real role, stack, and day-to-day work. (Emit it first so setup can start while you finish the rest.) These get set up for me automatically as part of getting started, so pick by overall fit to ME, not to any single suggestion. Prefer fewer over forcing a match; use [] if nothing clearly fits. Example: "plugins": ["<exact name from the list above>"]. ${t?`Don't reference the setup in the claims or suggestions text.`:`Don't reference the setup in the claims text.`}
|
|
7
|
+
`:``}function Qt({firstName:e,lastName:t,occupation:n,hobby:r},i=[],{includeSuggestions:a=!0}={}){let o=[e.trim(),t.trim()].filter(Boolean).join(` `),s=n.trim(),c=r?.trim()??``,l=Zt(i,a),u=l?`"plugins": ["<exact name from the list above>"], `:``,d=[o?`My name is ${o}.`:``,s?`I work as ${s}.`:``,c?`My hobby is ${c}.`:``].filter(Boolean).join(` `)||`I'd like you to get to know me before we start working together.`,f=a?` "suggestions": [ { "suggestion": "I'll find the 3 newest arXiv eval papers worth your time", "prompt": "Find me the 3 newest arXiv eval papers worth reading." }, { "suggestion": "I'll draft a crisp summary of the latest model-serving trade-offs", "prompt": "Draft me a short summary of the latest model-serving trade-offs." }, { "suggestion": "Connect GitHub and I'll triage your stalest issues", "prompt": "Connect to GitHub and triage my oldest open issues." }, { "suggestion": "I'll plan a weekend climbing trip near Boulder", "prompt": "Plan me a weekend climbing trip near Boulder." } ]`:``,p=`{ ${u}"claims": [ { "claim": "Senior engineer at an AI infra startup", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Based in Boulder, CO", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Active climber on Mountain Project", "confidence": "maybe", "sources": [] }, { "claim": "Focused on evals or model serving infrastructure", "confidence": "guessing", "sources": ["https://github.com/example-user"] } ]${f?`,${f}`:``} }`;return`${d}
|
|
8
|
+
|
|
9
|
+
Get to know me. Search the web for what's publicly known about the person matching my name and role, and infer a handful of things about who I am: what I do, my role, where I'm based, what I'm into, anything that would help you assist me better. Lean on public sources (LinkedIn, company pages, social profiles, articles, personal sites, GitHub). It's fine to make reasonable inferences and label them honestly.
|
|
10
|
+
|
|
11
|
+
Treat the name, role, and hobby I provided above as first-party context from me. Use public sources to enrich that context, not to override or correct it. If public sources use a different title or omit part of my stated role, do not frame my stated role as wrong; mention the public title only as supporting nuance when it is useful, and keep ${a?`claims and suggestions`:`claims`} aligned with my stated role.
|
|
12
|
+
|
|
13
|
+
CRITICAL: your final reply must be ONLY a JSON object. No preamble, no explanation, no prose, nothing before or after it. Do your thinking and searching, then respond with exactly this shape and nothing else:
|
|
14
|
+
|
|
15
|
+
${p}
|
|
16
|
+
|
|
17
|
+
Rules for "claims":
|
|
18
|
+
|
|
19
|
+
AT MOST 5 claims, typically 3 to 4. Aim for at least one "confident" and at least one "guessing"; the rest "maybe".
|
|
20
|
+
Phrase each claim in third person as a short headline ("Senior engineer at an AI infra startup", "Based in Boulder, CO", "Active climber on Mountain Project"). No multi-clause sentences, no em-dash asides, no explanations. Good: "Contributed to Chirps (vector-DB security)". Bad: "You've done real work in vector database security. You contributed to Chirps, a tool for scanning vector DBs for sensitive data".
|
|
21
|
+
Each claim must be independently true-or-false so I can remove the ones that are wrong.
|
|
22
|
+
"confidence" is one of: "confident" (well supported by what you found), "maybe" (plausible but unverified), "guessing" (a hunch from limited signal).
|
|
23
|
+
"sources": 0 to 3 URLs you actually used as evidence for that specific claim. Use [] for pure inferences.
|
|
24
|
+
${a?`Rules for "suggestions":
|
|
25
|
+
|
|
26
|
+
Each suggestion is an object with two fields:
|
|
27
|
+
"suggestion": the offer in YOUR voice (the assistant), exactly as it appears on the clickable card — first-person "I" refers to you (whatever your name). Pattern: "I'll [verb] [specific artifact]" or "Connect me to [integration] and I'll [verb] [artifact]." Lead with the offer; no intake question in front of it — you gather the details in the follow-up conversation after the click.
|
|
28
|
+
"prompt": the same offer re-voiced as the message sent on the user's behalf when they click, in the USER's first person ("I"/"my" = the user) — what they'd say to take you up on it (suggestion "I'll find you 3 papers" → prompt "Find me 3 papers worth reading"). State the request; don't echo the assistant-voiced wording and don't ask a question back.
|
|
29
|
+
|
|
30
|
+
Generate EXACTLY 4 suggestions covering four DIFFERENT capabilities, each making me think "wait, you can do that?" Draw on your range — a quick researched answer, a recurring brief or monitor, a doc drafted in a live editor, an integration (GitHub, Gmail, Calendar, Slack, Linear) connected with a first action, or a hobby hook if research surfaced one — but pick what genuinely fits; don't force a fixed set.
|
|
31
|
+
Ground every suggestion in what you actually learned about me — my real role, stack, industry, and (if given) hobby. Specific to me, not generic assistant stuff; skip bare "summarize" or "draft a post."
|
|
32
|
+
CRITICAL: every suggestion must be a fast win you can deliver in the first reply, never a long-running build. NEVER suggest building an app, dashboard, tool, site, or tracker, or any multi-step "build me a ___" project — those kill the first impression. The ambitious build can come later in the conversation, never on the first card.
|
|
33
|
+
Keep each SHORT and skimmable: under 10 words, ONE clause, ONE artifact, no lists of three ("X, Y, and Z"). The reader scans four cards in seconds — a long line loses them.
|
|
34
|
+
`:``}${l}
|
|
35
|
+
${a?`Don't include anything sensitive or private. If you found very little, lean on "guessing" claims and broadly useful suggestions for my role.`:`Don't include anything sensitive or private. If you found very little, lean on "guessing" claims.`}
|
|
36
|
+
Keep every string value simple so the JSON always parses: one line, no line breaks inside a value, and NO double-quote characters inside a value — use single quotes (or none) for emphasis, quoted names, or tool names. Output ONLY the JSON object. No code fence, no extra text.`}function $t({hostingParam:e,localMode:t,gatewayAuthSession:n}){return t?e===null?n:e!==`vellum-cloud`:!1}var en=3e3,tn=3e5,nn=`Failed to start your assistant. Please try again.`,rn=`Your assistant is taking longer than expected. Please try again.`,an=e=>new Promise(t=>setTimeout(t,e));function on({adoptExisting:e=!1,adoptAssistantId:n}={}){let[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),l=(0,K.useRef)(!1),u=(0,K.useRef)([]),d=(0,K.useRef)(null),f=(0,K.useCallback)(e=>{if(!d.current){d.current={kind:`ready`,id:e},i(!0);for(let t of u.current)t.resolve(e);u.current=[]}},[]),p=(0,K.useCallback)(e=>{if(d.current)return;d.current={kind:`error`,message:e},c(e);let t=Error(e);for(let e of u.current)e.reject(t);u.current=[]},[]);return{start:(0,K.useCallback)(()=>{if(l.current)return;l.current=!0;let r=Date.now(),i=()=>Date.now()-r>=tn;(async()=>{if(e&&n){let e=E(n);if(e){o(e.assistantId),f(e.assistantId);return}}let r=e?n:void 0;if(!e)try{let e=await ce();if(e.ok)r=e.data.id,o(e.data.id);else{if(ae(e.status,e.error)){p(ie);return}if(!re(e.status)){p(te(e.error,void 0,nn));return}}}catch(e){t(e,{context:`research_background_hatch`})}let a;for(;!a;){if(i()){p(rn);return}try{let e=await P(r);r&&!e.ok&&e.status===404&&(r=void 0,e=await P());let t=se(e);if(t.kind===`active`&&e.ok){a=e.data.id,o(a);break}if(t.kind===`error`){p(t.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await an(en)}if(e)for(;!await w();){if(i()){p(rn);return}await an(en)}else for(;;){try{if((await N(a)).ok)break}catch{}if(i()){p(rn);return}await an(en)}f(a)})()},[p,f,e,n]),ready:r,assistantId:a,error:s,awaitReady:(0,K.useCallback)(()=>{let e=d.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{u.current.push({resolve:e,reject:t})})},[])}}async function sn(e,n){try{await k({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}var cn=[`admin-copilot`],ln=[{plugin:`marketing-expert`,keywords:[`founder`,`cofounder`,`co founder`,`ceo`,`cmo`,`chief executive`,`chief marketing`,`entrepreneur`,`marketing`,`marketer`,`growth`,`brand`,`content`,`copywriter`,`copywriting`,`seo`,`demand gen`,`demand generation`,`sales`,`account executive`,`business development`,`creator`,`social media`,`community manager`]},{plugin:`git-workflow`,keywords:`developer.swe.programmer.coder.devops.dev ops.sre.site reliability.software engineer.software architect.backend engineer.back end engineer.frontend engineer.front end engineer.full stack engineer.fullstack engineer.platform engineer.infrastructure engineer.data engineer.machine learning engineer.ml engineer.qa engineer.embedded engineer.security engineer.staff engineer.principal engineer.solutions architect.tech lead.technical lead.engineering manager.engineering lead.head of engineering.director of engineering.vp of engineering.vp engineering.cto`.split(`.`)}];function un(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function dn(e,t){return e.includes(` ${t} `)}function fn(e){let t=un(e),n=[];for(let{plugin:e,keywords:r}of ln)r.some(e=>dn(t,e))&&n.push(e);return n}function pn(e,t){let n=[...cn,...fn(e)],r=new Set,i=[];for(let e of n)!t.has(e)||r.has(e)||(r.add(e),i.push(e));return i}var mn=1500,hn=12e4,gn=2;function _n({complete:e,stableReads:t}){return e&&t>=gn}function vn({sawCompletePayload:e}){return e?`done`:`error`}function yn({sawCompletePayload:e}){return e}var bn=`vellum-ai`,xn=new Set([`simple-memory`,`level-up`]);function Sn(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function Cn(e){return e?.split(`/`)[0]?.trim()??``}function wn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||Cn(r.source?.repo)===bn&&(xn.has(e)||(n.add(e),t.push({name:e,description:Sn(i)})))}return{capabilities:t,validNames:n}}async function Tn(e){try{return wn((await j({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function En(e,n){try{await ee({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var Dn=e=>new Promise(t=>setTimeout(t,e));function On({role:e,validNames:t,modelPlugins:n}){return[...new Set([...pn(e,t),...n.filter(e=>t.has(e))])]}function kn(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!==`assistant`)continue;let r=n.contentBlocks;if(r&&r.length>0){let e=r.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
37
|
+
`).trim();if(e)return e}return(n.content??``).trim()}return``}function An(){let[e,n]=(0,K.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,K.useRef)(0),i=(0,K.useRef)(null),a=(0,K.useRef)(new Map),s=(0,K.useRef)(Promise.resolve()),c=o(),l=(0,K.useCallback)(({awaitAssistantId:e,subject:o,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(o);if(i.current===p)return;i.current=p;let m=r.current+1;r.current=m;let h=()=>r.current!==m,g=()=>{};s.current=new Promise(e=>{g=e}),a.current.clear(),n({status:`running`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,s=!1;try{let t=await e();if(r=t,h())return;let{capabilities:c,validNames:p}=await Tn(t);if(h())return;let m=Object.fromEntries(c.map(e=>[e.name,e.description]));n(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=pn(o.occupation,p);for(let e of v)_.has(e)||_.set(e,En(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:Qt(o,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:ue(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(n.clientTimezone=e)}catch{}return!!(await A({path:{assistant_id:t},body:n,throwOnError:!1})).response?.ok},b=async()=>{let e=await O({path:{assistant_id:t},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let n=e.data?.id;if(!(!e.response?.ok||!n))return d?.(n),n},x;if(u){let e=await M({path:{assistant_id:t},query:{conversationId:u},throwOnError:!1});if(h())return;if(e.response?.ok&&(x=u,i=u,!(e.data?.messages??[]).some(e=>e.role===`user`))){if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){n(e=>({...e,status:`error`}));return}if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}let S=Date.now()+hn,C=``,w=0;for(;Date.now()<S;){if(await Dn(mn),h())return;let e=await M({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=kn(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:c,complete:l}=et(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,En(t,e));if(c&&g(),n({status:`running`,claims:e,suggestions:i,installedPlugins:On({role:o.occupation,validNames:p,modelPlugins:u}),pluginCatalog:m}),l&&(s=!0),w=r===C?w+1:0,C=r,_n({complete:l,stableReads:w}))break}}if(h())return;n(e=>({...e,status:vn({sawCompletePayload:s})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),yn({sawCompletePayload:s})&&r&&i&&(await sn(r,i),Qe(c,r))}})()},[c]),u=(0,K.useCallback)(async()=>{await s.current,await Promise.all([...a.current.values()])},[]),d=(0,K.useCallback)((e,t)=>{if(r.current+=1,n(e),t&&e.installedPlugins.length>0){let n=a.current;n.clear();for(let r of e.installedPlugins)n.set(r,(async()=>{try{await En(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function jn({removedClaims:e,rejectedAll:t}){if(t)return[`Correction: none of what you found in that web search is actually me —`,`it looks like you matched someone else with a similar name. Please`,`disregard everything from that search and don't remember any of it as`,`true about me. We'll build up what you actually know about me from here,`,`as we talk.`].join(` `);let n=e.map(e=>e.trim()).filter(Boolean);return n.length===0?null:[`Quick correction on what you found about me — these aren't true, so please`,`disregard them and don't remember them as facts about me:`,``,...n.map(e=>`- ${e}`)].join(`
|
|
38
|
+
`)}async function Mn({assistantId:e,conversationId:n,removedClaims:r,rejectedAll:i}){let a=jn({removedClaims:r,rejectedAll:i});if(a){try{let t={conversationId:n,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:ue(),clientMessageId:crypto.randomUUID()};await A({path:{assistant_id:e},body:t,throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_correction`})}await sn(e,n)}}var Nn={companionCoworker:`companion-coworker`,genzBoomer:`genz-boomer`,executeCollaborate:`execute-collaborate`,playfulSerious:`playful-serious`,politeUnfiltered:`polite-unfiltered`},Pn=1500,Fn=12e4,In=2;function Ln({processing:e,sawProcessing:t,hasReply:n,stableReads:r}){return e===void 0?n&&r>=In:!e&&(n||t)}var Rn=e=>new Promise(t=>setTimeout(t,e)),zn=e=>Math.max(0,Math.min(100,Math.round(e)));function Bn(e,t,n){let r=t=>zn(e[t]??50),i=r(Nn.companionCoworker),a=r(Nn.executeCollaborate),o=r(Nn.playfulSerious),s=r(Nn.politeUnfiltered),c=t?.trim()||`The user`,l=n?.trim(),u=l?`Your name is ${l}. Write exactly \`- **Name:** ${l}\` in IDENTITY.md — do not rename yourself or invent a different name, even if the file currently shows a placeholder or a different name. This changes your personality, not who you are.`:"Keep your existing name exactly as it is — this changes your personality, not who you are. Do not rename yourself, and if your name is already set, carry it through verbatim (don't treat it as a placeholder to fill). Whatever the name ends up being, keep it on IDENTITY.md's `- **Name:** …` line.";return`<system-message>
|
|
39
|
+
${c} wants to customize your personality.
|
|
40
|
+
This is what they want you to be:
|
|
41
|
+
Companion (0-100): ${100-i}
|
|
42
|
+
Coworker (0-100): ${i}
|
|
43
|
+
Voice Style (0 = Gen Z, 100 = Boomer): ${r(Nn.genzBoomer)}
|
|
44
|
+
Execute Independently (0 - 100): ${100-a}
|
|
45
|
+
Collaborative (0 - 100): ${a}
|
|
46
|
+
Playfulness (0 - 100): ${100-o}
|
|
47
|
+
Seriousness (0 - 100): ${o}
|
|
48
|
+
Politeness (0 - 100): ${100-s}
|
|
49
|
+
Unfiltered Rawness/Crassness (0 - 100): ${s}
|
|
50
|
+
|
|
51
|
+
Rewrite your own identity files (IDENTITY.md and SOUL.md) to reflect your new personality — first person, in a voice and style that matches it. Do not touch users/guardian.md or anything else under users/: that is your user's profile (their name, work, preferences), not your identity.
|
|
52
|
+
|
|
53
|
+
Overwrite each file completely with file_write: write the whole file fresh in one pass. This is a from-scratch rewrite, not an edit — do not append to what's already there, do not patch individual lines, and leave none of the current default wording behind. Fill in every IDENTITY.md placeholder (the _(not yet chosen)_ / _(not yet established)_ fields).
|
|
54
|
+
|
|
55
|
+
${u}
|
|
56
|
+
|
|
57
|
+
Each rewritten file must still be complete: SOUL.md keeps everything you operate by — how you use memory, your boundaries, your compliance stance — re-expressed in your new voice rather than dropped. When you finish, both files should read top-to-bottom as this new personality, with nothing left in the generic default voice.
|
|
58
|
+
</system-message>`}function Vn(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!==`assistant`)continue;let r=n.contentBlocks;if(r&&r.length>0){let e=r.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
59
|
+
`).trim();if(e)return e}return(n.content??``).trim()}return``}async function Hn({awaitAssistantId:e,values:n,userName:r,assistantName:i}){let a,o;try{a=await e();let t=await O({path:{assistant_id:a},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(o=t.data?.id,!t.response?.ok||!o)return;let s={conversationId:o,content:Bn(n,r,i),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await A({path:{assistant_id:a},body:s,throwOnError:!1})).response?.ok)return;let c=Date.now()+Fn,l=``,u=0,d=!1;for(;Date.now()<c;){await Rn(Pn);let e=await M({path:{assistant_id:a},query:{conversationId:o},throwOnError:!1}),t=Vn(e.data?.messages??[]);if(t&&(u=t===l?u+1:0,l=t),e.data?.processing===!0&&(d=!0),Ln({processing:e.data?.processing,sawProcessing:d,hasReply:t.length>0,stableReads:u}))break}}catch(e){t(e,{context:`research_onboarding_personality`})}finally{if(a&&o)try{await k({path:{assistant_id:a,id:o},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_personality_archive`})}}}function Un(e){let t=e?.trim();return`You're about to begin your first conversation.${t?`\nYour name is ${t} — introduce yourself as ${t}.`:``}
|
|
60
|
+
Respond with a warm and engaging greeting. Be interesting, be real. This is your chance to get to know and impress the user.
|
|
61
|
+
Keep it short! For this opening greeting only, don't use \`recall\` or read any files — just say hello. (This applies to the greeting alone; use your tools normally for everything the user asks afterward.)`}function Wn(e,t){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,...t?{timeZone:t}:{}}).format(n)}catch{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n)}}var q=s(),Gn={w:1280,h:800};function Kn(){return typeof window>`u`?Gn:{w:window.innerWidth,h:window.innerHeight}}function qn(){let[e,t]=(0,K.useState)(null),[n,r]=(0,K.useState)(()=>Kn());return(0,K.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let t=e.getBoundingClientRect();r({w:t.width,h:t.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),{ref:t,size:n}}var Jn=(0,K.createContext)(null);function Yn({size:e,children:t}){return(0,q.jsx)(Jn.Provider,{value:e,children:t})}function Xn(){let e=(0,K.useContext)(Jn),[t,n]=(0,K.useState)(()=>Kn());return(0,K.useEffect)(()=>{if(e)return;let t=()=>n(Kn());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var Zn={x:.5,y:.4},Qn=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function $n(e){return Qn[e%Qn.length]??0}var er=[1,0,1,0,1,0,1,0,1,0,0],tr=[.72,1],nr=[.4,1],rr=[10,20],ir=50;function ar(e){return tr[er[e]??1]??1}function or(e){return nr[er[e]??1]??1}function sr(e){return rr[er[e]??1]??20}function cr(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function lr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function ur(e,t,n){let r=n*.4,i=n*.48;return[{x:i,y:i},{x:e*.3,y:r},{x:e*.72,y:r},{x:e-i,y:i},{x:e-r,y:t*.72},{x:e-i,y:t-i},{x:i,y:t-i},{x:r,y:t*.5},{x:e-r,y:t*.3},{x:e*.38,y:t-r},{x:e*.62,y:t-r}]}function dr(e,t,n,r,i){let a=e.x-t,o=e.y-n,s=Math.hypot(a,o)||1,c=Math.max(r,i);return{x:e.x+a/s*c,y:e.y+o/s*c}}function fr({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=Xn(),u=U(),d=c<640,f=new Set([4,7,8,9,10]),m=e=>d&&f.has(e),h=cr(c,l),g=h/2,_=h/2,v=lr(c,l)/h,y=lr(c,l),b=(0,K.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=Zn.x*c,S=Zn.y*l,C=x-g,w=S-g,T=(0,K.useMemo)(()=>ur(c,l,_),[c,l,_]);return(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:y*.62,height:16,left:x-y*.31,top:S+y*.4}}),t.map((t,r)=>{let d=r===n,f=!u&&i?.char===r,_=!u&&a?.char===r;if(f){let n=T[i.fromSlot],a=dr(n,x,S,c,l),s=ar(i.fromSlot),u=or(i.fromSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:ir},initial:!1,animate:{x:[n.x-g,a.x-g,a.x-g,C,C,C],y:[n.y-g,a.y-g,a.y-g,w,w,w],scale:[s,s,s,v*.7,v*1.08,v],opacity:[u,u,0,0,1,1]},transition:{duration:.85,times:[0,.28,.34,.42,.72,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},onAnimationComplete:()=>o(r),children:(0,q.jsx)(p,{components:e,traits:t,size:h})},r)}if(_){if(m(a.toSlot))return null;let n=T[a.toSlot],i=dr(n,x,S,c,l),o=ar(a.toSlot),s=or(a.toSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:sr(a.toSlot)},initial:!1,animate:{x:[C,C,i.x-g,i.x-g,n.x-g,n.x-g],y:[w,w,i.y-g,i.y-g,n.y-g,n.y-g],scale:[v,v*.6,o,o,o*1.1,o],opacity:[1,0,0,s,s,s]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,q.jsx)(`div`,{style:{transform:`rotate(${$n(a.toSlot)}deg)`},children:(0,q.jsx)(p,{components:e,traits:t,size:h,breathe:!1})})},r)}let y=b.get(r)??0;if(!d&&m(y))return null;let E=d?{x,y:S}:T[y];return(0,q.jsx)(H.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:h,height:h,zIndex:d?ir:sr(y)},initial:!1,animate:{x:E.x-g,y:E.y-g,scale:d?v:ar(y),opacity:d?1:or(y)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,q.jsx)(`div`,{style:{transform:d?void 0:`rotate(${$n(b.get(r)??0)}deg)`},children:(0,q.jsx)(p,{components:e,traits:t,size:h,breathe:d})})},r)})]})}var pr=[{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`},{bodyShape:`star`,eyeStyle:`surprised`,color:`orange`},{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},{bodyShape:`urchin`,eyeStyle:`curious`,color:`pink`},{bodyShape:`burst`,eyeStyle:`quirky`,color:`orange`},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`green`},{bodyShape:`sprout`,eyeStyle:`dazed`,color:`orange`},{bodyShape:`star`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`flower`,eyeStyle:`angry`,color:`pink`},{bodyShape:`cloud`,eyeStyle:`curious`,color:`yellow`}],J=C(S((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:pr,selectedIndex:0})},setSelectedIndex:t=>e({selectedIndex:t}),selectNext:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex+1)%e.characters.length})),selectPrev:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex-1+e.characters.length)%e.characters.length}))})));function mr(){let[e,t]=(0,K.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,K.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function hr(){let e=G(),t=J.use.characters(),n=J.use.ensureGenerated(),r=U(),{w:i,h:a}=mr();(0,K.useEffect)(()=>{e&&n(e)},[e,n]);let o=cr(i,a),s=(0,K.useMemo)(()=>ur(i,a,o/2),[i,a,o]),c=i<640,l=new Set([4,7,8,9,10]);return!e||t.length===0?null:(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-0 overflow-hidden`,children:t.map((t,n)=>{if(n===0)return null;let i=n-1;if(c&&l.has(i))return null;let a=s[i];if(!a)return null;let u=Qn[i%Qn.length]??0,d=o*ar(i),f=or(i),m=sr(i);return(0,q.jsx)(`div`,{className:`absolute`,style:{left:a.x-d/2,top:a.y-d/2,width:d,height:d,zIndex:m,animation:r?void 0:`character-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) ${.1+n*.05}s both`},children:(0,q.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,q.jsx)(p,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var gr=c(`flex w-full items-center gap-1.5 rounded-md border bg-[var(--field-bg)] px-3`,`border-[var(--field-border)] transition-[border-color,background-color] duration-150 ease-out`,`focus-within:border-[var(--border-active)]`),_r=c(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,it);function Y(e){return e.trim().toLowerCase()}function vr(e,t,n=[],r=8){let i=Y(t),a=new Set(n.map(Y)),o=[];for(let t of e)if(!a.has(Y(t))&&((i.length===0||Y(t).includes(i))&&o.push(t),o.length>=r))break;return o}function yr({id:e,options:t,highlighted:n,showAddHint:r,onPick:i,onHover:a}){return(0,q.jsxs)(`ul`,{id:e,role:`listbox`,className:c(`absolute left-0 right-0 top-full z-50 mt-1.5 max-h-60 overflow-auto`,`rounded-lg bg-[var(--surface-lift)] p-1 shadow-[var(--shadow-popover)]`,`animate-[fadeInUp_0.12s_ease-out]`),children:[t.map((t,r)=>(0,q.jsx)(`li`,{id:`${e}-opt-${r}`,role:`option`,"aria-selected":r===n,onMouseDown:e=>{e.preventDefault(),i(t.value)},onMouseEnter:()=>a(r),className:c(`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5`,`text-body-medium-lighter text-[var(--content-default)]`,r===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t.isAdd?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ze,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:`↵ Enter`})]}):t.value},t.isAdd?`__add__${t.value}`:t.value)),r&&(0,q.jsx)(`li`,{role:`presentation`,className:`mt-0.5 border-t border-[var(--border-base)] px-2.5 pb-0.5 pt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Type anything and press ↵ to add your own`})]})}function br({htmlFor:e,required:t,children:n}){return(0,q.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function xr(e,t){(0,K.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function Sr({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,K.useId)(),o=`tac-${a}`,s=`tac-list-${a}`,l=(0,K.useRef)(null),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(-1),g=(0,K.useMemo)(()=>vr(i,u,n),[i,u,n]),v=u.trim(),y=(0,K.useMemo)(()=>{if(!v)return!1;let e=Y(v);return!(n.some(t=>Y(t)===e)||g.some(t=>Y(t)===e))},[v,n,g]),b=(0,K.useMemo)(()=>{let e=g.map(e=>({value:e,isAdd:!1}));return y?[...e,{value:v,isAdd:!0}]:e},[g,y,v]);xr(l,()=>p(!1)),(0,K.useEffect)(()=>{h(e=>e>=b.length?b.length-1:e)},[b.length]);let x=f&&b.length>0,S=!y;function C(e){let t=e.trim();t&&(n.some(e=>Y(e)===Y(t))||r([...n,t]),d(``),h(-1))}function w(e){r(n.filter(t=>t!==e))}function T(e){e.key===`ArrowDown`?(e.preventDefault(),p(!0),h(e=>Math.min(e+1,b.length-1))):e.key===`ArrowUp`?(e.preventDefault(),h(e=>Math.max(e-1,0))):e.key===`Enter`?x&&m>=0?(e.preventDefault(),C(b[m].value)):u.trim()&&(e.preventDefault(),C(u)):e.key===`,`?(e.preventDefault(),C(u)):e.key===`Backspace`&&u.length===0&&n.length>0?w(n[n.length-1]):e.key===`Escape`&&p(!1)}return(0,q.jsxs)(`div`,{ref:l,className:`relative flex flex-col gap-1.5`,children:[(0,q.jsx)(br,{htmlFor:o,children:e}),(0,q.jsxs)(`div`,{className:c(gr,`min-h-9 flex-wrap py-1.5`),children:[(0,q.jsx)(qe,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,q.jsx)(_,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,q.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":x,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":m>=0?`${s}-opt-${m}`:void 0,autoComplete:`off`,className:c(_r,`h-6 w-24`),placeholder:n.length===0?t:``,value:u,onChange:e=>{d(e.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:T})]}),x&&(0,q.jsx)(yr,{id:s,options:b,highlighted:m,showAddHint:S,onPick:C,onHover:h})]})}var Cr=`Reading.Writing.Cooking.Baking.Gardening.Photography.Painting.Drawing.Hiking.Running.Cycling.Swimming.Yoga.Climbing.Weightlifting.Gaming.Board games.Chess.Traveling.Cars.Woodworking.Knitting.Playing guitar.Playing piano.Singing.Dancing.Fishing.Camping.Surfing.Skiing.Snowboarding.Coffee.Wine.Birdwatching.Pottery.Investing.Podcasts.Movies.Soccer.Basketball.Tennis.Golf.Meditation.Volunteering.Astronomy.3D printing`.split(`.`);function X(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function wr({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[i,a]=(0,K.useState)(e),[o,s]=(0,K.useState)(t),[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)([]),f=i.trim().length>0&&c.trim().length>0;function p(){f&&n({firstName:i,lastName:o,role:c,hobbies:u})}return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,q.jsxs)(Xe,{showCreatureFooter:!1,children:[(0,q.jsx)(hr,{}),(0,q.jsxs)(`form`,{className:`relative z-10 mx-auto flex min-h-screen w-full max-w-sm flex-col items-center justify-center px-6 py-16 text-[var(--content-default)]`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,q.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:X(.05),children:`Let's start with you.`}),(0,q.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:X(.12),children:`A few details so I can get to know you.`}),(0,q.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,q.jsx)(`div`,{style:X(.2,40),children:(0,q.jsx)(v,{label:(0,q.jsxs)(q.Fragment,{children:[`What should I call you?`,(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:i,onChange:e=>a(e.target.value),className:it,autoFocus:!0,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.27,30),children:(0,q.jsx)(v,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:it,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.34,20),children:(0,q.jsx)(v,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:it,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.41,10),children:(0,q.jsx)(Sr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:d,suggestions:Cr})})]}),(0,q.jsx)(`div`,{className:`mt-10 w-full`,style:X(.5),children:(0,q.jsx)(r,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),fullWidth:!0,disabled:!f,className:`h-11 text-base`,children:`Continue`})})]})]})})}var Tr=`#1A1A1A`,Er=`#FFFFFF`;function Dr(e){let t=/^#?([0-9a-f]{6})$/i.exec(e);if(!t)return 0;let n=parseInt(t[1],16),r=n>>16&255,i=n>>8&255,a=n&255;return(r*299+i*587+a*114)/1e3/255}function Or(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e);if(!n)return e;let r=parseInt(n[1],16),i=e=>Math.max(0,Math.min(255,Math.round((r>>e&255)*t)));return`#${(1<<24|i(16)<<16|i(8)<<8|i(0)).toString(16).slice(1)}`}function kr(e){let t=Dr(e)>.6;return{bg:e,isLight:t,fg:t?Tr:Er,fgDeep:Or(e,.6),fgMuted:t?`rgba(0,0,0,0.6)`:`rgba(255,255,255,0.65)`,wash:t?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`}}function Ar(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex();return(0,K.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return kr(i??`var(--surface-base)`)},[e,t,n])}function Z({onBack:e,onNext:t,tone:n}){let r=Ar(),i=n?n===`dark`?`#1A1A1A`:`#FFFFFF`:r.fg,a=n?n===`dark`?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`:r.wash;return(0,q.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(u,{className:`h-5 w-5`})}),t?(0,q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(d,{className:`h-5 w-5`})}):null]})}var jr=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Mr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Nr({onContinue:e,onBack:t,onForward:n}){let i=G(),a=J.use.characters(),o=J.use.ensureGenerated(),s=J.use.selectedIndex(),c=J.use.setSelectedIndex();(0,K.useEffect)(()=>{i&&o(i)},[i,o]);let u=a.length,[d,p]=(0,K.useState)(null),[m,g]=(0,K.useState)(``),[_,v]=(0,K.useState)(!1),y=(0,K.useRef)(!1),b=(0,K.useRef)(null),{ref:x,size:S}=qn(),[C,w]=(0,K.useState)(null);(0,K.useEffect)(()=>{u>0&&d===null&&p(Mr(u,s))},[u,s,d]),(0,K.useEffect)(()=>{d&&c(d.centerChar)},[d,c]);let T=d?.centerChar;(0,K.useEffect)(()=>{T!=null&&!y.current&&g(jr[T%jr.length])},[T]),(0,K.useEffect)(()=>{_&&(b.current?.focus(),b.current?.select())},[_]);function E(e){if(!d||e===d.centerChar)return;let t=d.edgeOrder.indexOf(e);if(t<0)return;let n=[...d.edgeOrder];n[t]=d.centerChar,w({entering:{char:e,fromSlot:t},exiting:{char:d.centerChar,toSlot:t}}),p({centerChar:e,edgeOrder:n})}let D=()=>d&&E((d.centerChar+1)%u),O=()=>d&&E((d.centerChar-1+u)%u),ee=(0,K.useMemo)(()=>d?a[d.centerChar]:void 0,[d,a]),k=!!i&&!!d&&!!ee;function A(){ee&&e({traits:ee,name:m.trim()})}function j(){y.current=!0,g(e=>{let t=jr.filter(t=>t!==e),n=t.length>0?t:jr;return n[Math.floor(Math.random()*n.length)]})}let M=`pointer-events-auto z-10 flex cursor-pointer h-10 w-10 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_18%,transparent)]`;return(0,q.jsx)(`div`,{ref:x,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,q.jsxs)(Yn,{size:S,children:[k&&(0,q.jsx)(fr,{components:i,characters:a,centerChar:d.centerChar,edgeOrder:d.edgeOrder,entering:C?.entering??null,exiting:C?.exiting??null,onEnterComplete:e=>w(t=>t?.entering.char===e?null:t),onSelectChar:E}),(0,q.jsx)(Z,{tone:`light`,onBack:t,onNext:n?A:void 0}),(0,q.jsx)(`h1`,{className:`absolute left-1/2 top-[19%] z-10 -translate-x-1/2 whitespace-nowrap text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.4s ease-out both`},children:`Give me a face and a name`}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:O,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${M}`,children:(0,q.jsx)(l,{className:`h-4 w-4`})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:D,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${M}`,children:(0,q.jsx)(W,{className:`h-4 w-4`})}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[_?(0,q.jsx)(`input`,{ref:b,value:m,onChange:e=>{y.current=!0,g(e.target.value)},onBlur:()=>v(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v(!1))},placeholder:`Name your assistant`,"aria-label":`Assistant name`,className:`w-[234px] rounded-2xl border border-[var(--border-element)] bg-transparent px-4 py-2.5 text-center text-lg text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-colors duration-150 focus:border-[var(--border-active)]`}):(0,q.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>v(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,q.jsx)(`span`,{className:`text-3xl font-medium ${m?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:m||`Name your assistant`}),(0,q.jsx)(h,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,q.jsx)(`button`,{type:`button`,onClick:j,"aria-label":`Shuffle name`,title:`Shuffle name`,className:`cursor-pointer text-[var(--content-tertiary)] transition-[transform,color] duration-300 hover:rotate-180 hover:text-[var(--content-default)]`,children:(0,q.jsx)(f,{className:`h-5 w-5`})})]}),(0,q.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),disabled:!k,onClick:A,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var Pr=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,Fr=/[MmLlHhVvCcSsQqTtAaZz][^MmLlHhVvCcSsQqTtAaZz]*/g;function Ir(e){let t=1/0,n=1/0,r=-1/0,i=-1/0,a=0,o=0,s=(e,a)=>{e<t&&(t=e),a<n&&(n=a),e>r&&(r=e),a>i&&(i=a)},c=e.match(Fr)??[];for(let e of c){let t=e[0],n=t.toUpperCase();if(n===`Z`)continue;let r=t!==n,i=(e.slice(1).match(Pr)??[]).map(Number);if(n===`H`)for(let e of i)a=r?a+e:e,s(a,o);else if(n===`V`)for(let e of i)o=r?o+e:e,s(a,o);else if(n===`A`)for(let e=0;e+7<=i.length;e+=7){let t=i[e+5],n=i[e+6];a=r?a+t:t,o=r?o+n:n,s(a,o)}else{let e=a,t=o;for(let n=0;n+2<=i.length;n+=2){let c=r?e+i[n]:i[n],l=r?t+i[n+1]:i[n+1];s(c,l),n+2>=i.length-i.length%2&&(a=c,o=l)}}}return t===1/0?{x:0,y:0,w:0,h:0}:{x:t,y:n,w:r-t,h:i-n}}function Lr(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}var Rr=.25,zr=.46,Br=.3,Vr=.85,Hr=40,Ur=14,Wr=8;function Gr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=G(),a=J.use.characters(),o=J.use.selectedIndex(),s=U(),{w:c,h:l}=Xn(),[u,d]=(0,K.useState)({x:0,y:0});(0,K.useEffect)(()=>{if(s)return;let e=e=>{d({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[s]);let f=e&&!s,p=Yt();(0,K.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(!e);(0,K.useEffect)(()=>{if(s||!g)return;let e=!1,t,n=n=>{e||(h(!0),t=setTimeout(()=>{e||(h(!1),t=setTimeout(n,140))},140))},i=()=>{t=setTimeout(()=>n(i),2500+Math.random()*4e3)};return r?n(()=>n(i)):i(),()=>{e=!0,clearTimeout(t)}},[s,g,r]);let v=a.length>0?a[o]:void 0,y=(0,K.useMemo)(()=>{if(!i||!v)return null;let e=i.eyeStyles.find(e=>e.id===v.eyeStyle);return e?{paths:e.paths,bbox:Lr(e.paths.map(e=>Ir(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Vr,x=Math.min(Math.min(c,l)*Br,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-Rr)*x,T=Hr/100*l-(w+x/2),E=(zr-Rr)*x,D=y.bbox.x+y.bbox.w/2,O=y.bbox.y+y.bbox.h/2;return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:C,top:w,width:S,height:x,transformOrigin:`center`},initial:f?{y:T,scale:.35}:!1,animate:f?{y:[T,E,0],scale:[.35,1,1]}:{y:0,scale:1},transition:f?{duration:1,delay:t,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>_(!0),children:(0,q.jsx)(H.div,{animate:p,children:(0,q.jsx)(`div`,{style:{transform:`translate(${u.x*Ur}px, ${u.y*Wr}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,q.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:S,height:x,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${O}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var Kr=200,qr=40;function Jr({firstName:e,assistantName:t,onContinue:n,onBack:i,onForward:a}){let o=G(),s=J.use.characters(),c=J.use.selectedIndex(),l=U(),{ref:u,size:{w:d,h:f}}=qn(),p=Ar(),m=s.length>0?s[c]:void 0,h=(0,K.useMemo)(()=>{if(!o||!m)return null;let e=o.bodyShapes.find(e=>e.id===m.bodyShape),t=o.colors.find(e=>e.id===m.color);return!e||!t?null:{body:e,color:t.hex}},[o,m]),g=e.trim()?`Hey, ${e.trim()}!`:`Hey!`,_=t?.trim()?`I’m ${t.trim()}, your new AI assistant`:`I’m your new AI assistant`;if(!h)return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,style:{backgroundColor:`var(--surface-base)`}});let v=1.25*Math.max(d,f),y=v*h.body.viewBox.height/h.body.viewBox.width,b=(d-v)/2,x=(f-y)/2,S=Kr/v,C=(qr/100-.5)*f;return(0,q.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,q.jsxs)(Yn,{size:{w:d,h:f},children:[(0,q.jsx)(H.div,{className:`absolute inset-0 z-0`,style:{backgroundColor:h.color},initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.6,delay:.35}}),(0,q.jsx)(H.svg,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,viewBox:`0 0 ${h.body.viewBox.width} ${h.body.viewBox.height}`,width:v,height:y,style:{left:b,top:x,transformOrigin:`center`},initial:l?!1:{scale:S,y:C},animate:{scale:1,y:0},transition:l?{duration:0}:{type:`spring`,stiffness:78,damping:18,mass:1},children:(0,q.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,q.jsx)(Gr,{entrance:!0}),(0,q.jsx)(H.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,q.jsx)(Z,{onBack:i,onNext:a})}),(0,q.jsxs)(`div`,{className:rt,children:[(0,q.jsxs)(H.h1,{className:`text-center leading-[1.05]`,style:{fontFamily:`var(--font-serif)`},initial:l?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:l?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,q.jsx)(H.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,q.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Yr=.3,Xr=.85,Zr=.25;function Qr(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=Xn(),o=(0,K.useMemo)(()=>{if(!e||!r)return null;let t=e.eyeStyles.find(e=>e.id===r.eyeStyle);return t?{paths:t.paths,bbox:Lr(t.paths.map(e=>Ir(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Yr,i*Xr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-Zr*s,centerX:i/2,w:i,h:a}}function $r({art:e,eyesW:t,eyesH:n,centerX:r,eyeCy:i,eyeScale:a,eyeX:o,blinking:s,className:c=`pointer-events-none absolute top-0 z-0`}){let l=_t(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:c,style:{left:r-t/2,top:0,x:o,y:l,width:t,height:n,scale:a,transformOrigin:`center`},children:(0,q.jsx)(`svg`,{viewBox:`${e.bbox.x} ${e.bbox.y} ${e.bbox.w} ${e.bbox.h}`,width:t,height:n,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:s?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${u}px ${d}px`,transition:`transform 0.13s ease-in-out`},children:e.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var ei={green:[`pink`,`purple`,`orange`,`yellow`],orange:[`teal`,`purple`,`green`,`yellow`],pink:[`teal`,`green`,`yellow`,`purple`],purple:[`yellow`,`teal`,`green`,`orange`],teal:[`pink`,`orange`,`yellow`,`purple`],yellow:[`purple`,`teal`,`pink`,`green`]};function ti(e,t){let n=ei[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var ni=new Set([`orange`,`pink`,`red`]);function ri(e,t){return ni.has(e)&&ni.has(t)}function ii(e,t,n){let r=ti(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>ri(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var ai=`You’ve used AI that just answers questions`,oi=`The more I help`,si=`I’m different`,ci=`The better I get`,li=`and the less you have to do`,ui=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],di=290;function fi({firstH:e,secondH:t,color:n,firstText:r,secondText:i,revealed:a,carouseled:o,revealFrom:s,revealDuration:c,reduce:l}){let u=s===`bottom`?`inset(100% 0 0 0)`:`inset(0 0 100% 0)`;return!e||!t?null:(0,q.jsx)(H.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,q.jsxs)(H.div,{className:`flex flex-col`,style:{color:n},initial:!1,animate:{y:o?-e:0},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:[(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,q.jsx)(H.span,{className:`block`,initial:!1,animate:{clipPath:a?`inset(0% 0 0% 0)`:u},transition:l?{duration:0}:{duration:c,ease:`easeOut`},children:r})}),(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,q.jsx)(`span`,{className:`block`,children:i})})]})})}function pi({onContinue:e,onBack:t,onForward:n}){let i=Ar(),a=U(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=Qr(),m=G(),h=J.use.characters(),g=J.use.selectedIndex(),_=h.length>0?h[g]:void 0,v=f>0&&f<=800,y=v?.17:.22,b=v?`top-[17%]`:`top-[22%]`,x=mt(0),S=mt(1),C=(0,K.useMemo)(()=>!m||!_?`orange`:ii(_.color,m.colors.map(e=>e.id),1)[0]??`orange`,[m,_]),w=Math.min(220,Math.max(150,d*.16)),T=-w,E=-w*.4,D=mt(-220),O=(0,K.useMemo)(()=>!m||!_?[]:ii(_.color,m.colors.map(e=>e.id),3),[m,_]),ee=Math.max(.42,Math.min(d/1100,1)),k=Math.round(di*ee),A=-k*1.1,j=-k*.42,M=mt(-320),[te,ne]=(0,K.useState)(!!a),[re,ie]=(0,K.useState)(!!a),[ae,oe]=(0,K.useState)(!1),[se,N]=(0,K.useState)(!1),[ce,P]=(0,K.useState)(!1),[le,ue]=(0,K.useState)(!1),[de,fe]=(0,K.useState)(!!a),pe=Math.min(d,768)-48,me=(0,K.useRef)(null),he=(0,K.useRef)(null),ge=(0,K.useRef)(null),_e=(0,K.useRef)(null),F=(0,K.useRef)(null),[ve,ye]=(0,K.useState)(0),[be,xe]=(0,K.useState)(0),[I,Se]=(0,K.useState)(0),[Ce,L]=(0,K.useState)(0),[we,R]=(0,K.useState)(0);return(0,K.useLayoutEffect)(()=>{me.current?.offsetHeight&&ye(me.current.offsetHeight),he.current?.offsetHeight&&xe(he.current.offsetHeight),ge.current?.offsetHeight&&Se(ge.current.offsetHeight),_e.current?.offsetHeight&&L(_e.current.offsetHeight),F.current?.offsetHeight&&R(F.current.offsetHeight)},[pe]),(0,K.useEffect)(()=>{x.set(l),ue(!0)},[l,x]),(0,K.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{oe(!0),N(!0),P(!0)},1400);return()=>clearTimeout(e)},[a]),(0,K.useEffect)(()=>{if(a||!o)return;x.set(l),S.set(1),D.set(T),M.set(A),ne(!1),ie(!1),oe(!1),N(!1);let e=Math.max(c*.5,f*y-36),t=[],n=[],r=!1,i=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(ne(!0),await Promise.all([i(Jt(x,e,{duration:.55,ease:`easeOut`})),i(Jt(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(ie(!0),await Promise.all([i(Jt(x,l,{type:`spring`,stiffness:210,damping:15})),i(Jt(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(oe(!0),N(!0),await i(Jt(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;P(!0);let t=i(Jt(M,[A,j,j,A],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(fe(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[a,o,f,y,c,l,x,S,D,T,E,M,A,j]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:i.fg},children:[(0,q.jsx)(Z,{onBack:t,onNext:n}),(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none invisible absolute -left-[9999px] top-0 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{width:pe,fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(`span`,{ref:me,className:`block`,children:ai}),(0,q.jsx)(`span`,{ref:he,className:`block`,children:oi}),(0,q.jsx)(`span`,{ref:ge,className:`block`,children:si}),(0,q.jsx)(`span`,{ref:_e,className:`block`,children:ci}),(0,q.jsx)(`span`,{ref:F,className:`block`,children:li})]}),le&&o&&(0,q.jsx)($r,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!a&&m&&(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{left:Math.max(16,d*.05),top:0,y:D,width:w,height:w},children:(0,q.jsx)(p,{components:m,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!a&&m&&(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(k*.12),y:M},children:ui.map((e,t)=>(0,q.jsx)(`div`,{style:{width:k,height:k,marginLeft:t===0?0:-k*.34,zIndex:ui.length-t},children:(0,q.jsx)(p,{components:m,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:O[t]??`teal`},size:k,breathe:!1})},e.bodyShape))}),(0,q.jsxs)(`div`,{className:`${rt.replace(`top-[30%]`,b)} max-w-3xl`,children:[(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(fi,{firstH:ve,secondH:be,color:i.fgDeep,firstText:ai,secondText:oi,revealed:te,carouseled:ae,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,q.jsx)(fi,{firstH:I,secondH:Ce,color:i.fg,firstText:si,secondText:ci,revealed:re,carouseled:se,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,q.jsx)(H.div,{className:`relative w-full overflow-hidden`,style:{color:i.fg},initial:!1,animate:{height:ce?we:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:we>0&&(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:we},children:(0,q.jsx)(H.span,{className:`block`,initial:!1,animate:{clipPath:ce?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:li})})})]}),de&&(0,q.jsx)(H.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,q.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function mi({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,q.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,q.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,q.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,q.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,q.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,q.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`45.5`,fill:`none`,stroke:`#FFF6CF`,strokeOpacity:`0.6`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeDasharray:`70 210`,transform:`rotate(-128 50 50)`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,q.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,q.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,q.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function hi({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,q.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,q.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,left:`50%`,bottom:-e*.14,width:e*.74,height:e*.16,transform:`translateX(-50%)`,background:`radial-gradient(ellipse at center, rgba(0,0,0,0.22), rgba(0,0,0,0) 70%)`,filter:`blur(2px)`}}),(0,q.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,q.jsxs)(H.div,{className:a,style:{width:e,height:e,position:`relative`,transformStyle:`preserve-3d`},initial:!1,animate:{rotateX:t,rotateY:i?[n,n+360,n+760,n+1180]:n},transition:i?{duration:.95,times:[0,.32,.62,1],ease:`easeInOut`}:{duration:0},children:[(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,q.jsx)(mi,{idSuffix:`front`})}),(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,q.jsx)(mi,{idSuffix:`back`})})]})})]})}var gi=.3,_i=.95;function vi({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=U(),a=Ar(),{h:o}=Xn(),[s,c]=(0,K.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,gi*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:n,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-full max-w-xl -translate-x-1/2 flex-col items-center gap-3 px-6 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,q.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,q.jsx)(H.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:_i,times:[0,gi/_i,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,q.jsx)(hi,{size:88,spinning:s&&!i})})}),!s&&(0,q.jsxs)(`button`,{type:`button`,onClick:l,className:`mt-6 flex cursor-pointer h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Claim`,(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}$e();var yi=640,bi=[{id:`companion-coworker`,left:`Companion`,right:`Coworker`,leftAvatar:{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},rightAvatar:{bodyShape:`ninja`,eyeStyle:`curious`,color:`purple`}},{id:`genz-boomer`,left:`Gen Z`,right:`Baby Boomer`,leftAvatar:{bodyShape:`burst`,eyeStyle:`quirky`,color:`yellow`},rightAvatar:{bodyShape:`cloud`,eyeStyle:`dazed`,color:`green`}},{id:`execute-collaborate`,left:`Independent`,right:`Collaborative`,leftAvatar:{bodyShape:`star`,eyeStyle:`angry`,color:`orange`},rightAvatar:{bodyShape:`flower`,eyeStyle:`goofy`,color:`teal`}},{id:`playful-serious`,left:`Playful`,right:`Serious`,leftAvatar:{bodyShape:`star`,eyeStyle:`goofy`,color:`yellow`},rightAvatar:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`}},{id:`polite-unfiltered`,left:`Polite`,right:`Unfiltered`,leftAvatar:{bodyShape:`sprout`,eyeStyle:`bashful`,color:`green`},rightAvatar:{bodyShape:`urchin`,eyeStyle:`surprised`,color:`orange`}}],xi=[`9%`,`27%`,`45%`,`62%`,`79%`],Q=50,Si=`rgba(36, 41, 46, 0.2)`,Ci=`#FDFDFC`,wi=.16;function Ti(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=r[i-1],o=e[i+1],s=e[i]??``,c=e=>e===t||e===a;if(!c(s)){r.push(s);continue}let l=n.find(e=>!c(e)&&e!==o)??n.find(e=>!c(e))??s;r.push(l)}return r}function Ei(){let[e,t]=(0,K.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,K.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Di({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+wi*100,c=n===`left`?-100+s*o:100-s*o;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute`,style:{[n]:`calc(50% - 50vw)`,top:r,width:i,height:i,opacity:Math.min(1,o*1.6),transform:`translate(${c}%, -50%) scale(${.8+.2*o})`,transformOrigin:`${n} center`,transition:`transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease`,willChange:`transform, opacity`},children:(0,q.jsx)(p,{components:e,traits:t,size:i,breathe:!1})})}function Oi({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,children:[(0,q.jsx)(`span`,{className:`order-1 flex-1 text-left text-base sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:r},children:e.left}),(0,q.jsx)(`span`,{className:`order-2 flex-1 text-right text-base sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r},children:e.right}),(0,q.jsxs)(x,{className:`relative order-3 flex h-6 w-full touch-none items-center select-none sm:order-2 sm:w-auto sm:flex-1`,value:[t],onValueChange:e=>n(e[0]??Q),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,q.jsx)(y,{className:`relative h-3 w-full grow rounded-full`,style:{backgroundColor:Si}}),(0,q.jsx)(b,{className:`block h-6 w-6 cursor-grab rounded-full shadow-sm transition-transform active:scale-95 active:cursor-grabbing keyboard-focus:outline-none keyboard-focus:ring-2 keyboard-focus:ring-white/70 data-[disabled]:cursor-not-allowed data-[disabled]:active:scale-100`,style:{backgroundColor:Ci}})]})]})}function ki({components:e,values:t,sideAvatars:n,size:r}){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:bi.map((i,a)=>{let o=t[i.id]??Q,s=Math.max(0,(Q-o)/Q),c=Math.max(0,(o-Q)/Q),l=xi[a]??`50%`,u=n[a];return u?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Di,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,q.jsx)(Di,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function Ai({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=Ar(),s=G(),c=Ei(),l=c>=yi,u=J.use.characters()[J.use.selectedIndex()]?.color,d=Math.round(Math.min(300,Math.max(160,c*.16))),f=(0,K.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=Ti(bi.map(e=>e.leftAvatar.color),u,e),n=Ti(bi.map(e=>e.rightAvatar.color),u,e);return bi.map((e,r)=>({left:{...e.leftAvatar,color:t[r]??e.leftAvatar.color},right:{...e.rightAvatar,color:n[r]??e.rightAvatar.color}}))},[s,u]);return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),l&&s&&(0,q.jsx)(ki,{components:s,values:e,sideAvatars:f,size:d}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] flex w-full max-w-2xl -translate-x-1/2 flex-col items-center gap-10 px-6`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,q.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):(0,q.jsx)(`p`,{className:`max-w-md text-center text-[15px]`,style:{color:o.fgMuted},children:`How do you want me to talk to you? You can always ask me to change my personality later.`})]}),(0,q.jsx)(`div`,{className:`flex w-full flex-col gap-8 sm:gap-11`,style:{opacity:n?.7:1},children:bi.map(r=>(0,q.jsx)(Oi,{axis:r,value:e[r.id]??Q,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n},r.id))}),(0,q.jsxs)(`button`,{type:`button`,onClick:r,className:`mt-4 flex h-11 w-[234px] cursor-pointer items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Continue`,(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}function ji({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=Ar(),{handleConnect:u,oauthInProgress:d}=Ge({assistantId:e??``,onConnect:n}),f=()=>{s?.(),u()},p=!e||!t,h=p||d;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-[360px] -translate-x-1/2 flex-col items-center gap-5 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:p?`Waking up`:o?`Access not enabled`:`Let me make this easy`}),(0,q.jsx)(`p`,{className:`text-[16px]`,style:{color:l.fgMuted},children:p?`Your assistant is getting ready`:o?`Check the box next to the Google Calendar permission so I can book the check-in.`:`Connect your Google Calendar so I can find time to check in and start helping.`}),(0,q.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:f,disabled:h,className:`flex cursor-pointer h-11 w-full items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:l.isLight?`#1A1A1A`:`#FFFFFF`,color:l.isLight?`#FFFFFF`:`#1A1A1A`},children:p?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(m,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(m,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!p||c)&&(0,q.jsx)(`button`,{type:`button`,onClick:r,disabled:d,className:`cursor-pointer text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:l.fgMuted},children:`Skip for now`})]})]})]})}var Mi=kr(`#17191C`);function Ni(){let[e,t]=(0,K.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,K.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Pi(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Fi({size:e=64,isStreaming:t=!1}){let{components:n,chosen:r}=Pi();return!n||!r?(0,q.jsx)(`div`,{style:{width:e,height:e}}):(0,q.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,q.jsx)(p,{components:n,traits:r,size:e,isStreaming:t})})}var Ii=64,Li=4500,Ri=7e3;function zi({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Pi(),s=U(),{w:c,h:l}=Ni(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,K.useEffect)(()=>{let t=setTimeout(e,i&&!r?Ri:Li);return()=>clearTimeout(t)},[e,i,r]);let d=(0,K.useRef)(null),[f,m]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=d.current?.getBoundingClientRect();e&&m({cx:e.left+e.width/2,cy:e.top+e.height/2})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u]);let h=1.3*Math.max(c,l)/Ii,g=f?c/2-f.cx:0,_=f?l*.88-f.cy:0,v=l*.05;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,q.jsx)(Z,{onBack:t,onNext:n,tone:`light`}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Ii,height:Ii},children:a&&o&&f&&(0,q.jsx)(H.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:s?!1:{scale:h,x:g,y:_},animate:{x:[g,g,0,0],y:[_,_+v,0,0],scale:[h,h,1.07,1]},transition:s?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,q.jsx)(p,{components:a,traits:o,size:Ii})})}),(0,q.jsx)(H.span,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:s?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:s?{duration:0}:{duration:.4,delay:.9},children:u})]})]})}var Bi=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Vi=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Hi=`Almost there…`,Ui=[...Bi,Hi],Wi=[...Vi,Hi],Gi=2800;function Ki({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Mi,[o,s]=(0,K.useState)(0);return(0,K.useEffect)(()=>{n?.(o);let t=o>=Ui.length-1;if(i&&t){let t=setTimeout(e,Gi);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Ui.length),Gi);return()=>clearTimeout(r)},[o,i,e,n]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:t,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(Fi,{isStreaming:!0}),(0,q.jsx)(We,{mode:`wait`,children:(0,q.jsx)(H.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Ui[o]},o)})]})]})}function qi({onDone:e,ready:t}){let n=Mi,[r,i]=(0,K.useState)(0);return(0,K.useEffect)(()=>{let n=Wi.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,Gi);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%Wi.length),Gi);return()=>clearTimeout(a)},[r,t,e]),(0,q.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(Fi,{isStreaming:!0}),(0,q.jsx)(We,{mode:`wait`,children:(0,q.jsx)(H.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Wi[r]},r)})]})})}function Ji({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Mi,s=U(),[c,l]=(0,K.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(Fi,{}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,q.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:o.fgMuted},children:d?t?`Still checking the rest. You can review these as they come in.`:`I searched the web. Feel free to remove anything that isn’t true`:t?`Still putting this together…`:`I didn’t turn up much — we can fill it in as we chat.`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,q.jsx)(We,{children:u.map(e=>(0,q.jsxs)(H.div,{layout:!0,initial:s?!1:{opacity:0,y:10},animate:{opacity:1,y:0},exit:s?void 0:{opacity:0,scale:.95},className:`flex items-center justify-between gap-3 rounded-2xl px-5 py-4 text-[15px]`,style:{backgroundColor:o.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,q.jsx)(`span`,{children:e.claim}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove "${e.claim}"`,onClick:()=>l(t=>new Set(t).add(e.claim)),className:`flex cursor-pointer h-6 w-6 shrink-0 items-center justify-center rounded-full transition-opacity hover:opacity-100`,style:{color:o.fgMuted},children:(0,q.jsx)(g,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,q.jsx)(`button`,{type:`button`,onClick:r,className:`mt-5 self-start cursor-pointer text-[14px] underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:o.fgMuted},children:`This is not me`}),(0,q.jsxs)(`button`,{type:`button`,onClick:()=>n([...c]),disabled:!f,className:`mt-8 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[f?`Continue`:`Still searching…`,f&&(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}var $=64,Yi=$;function Xi({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Pi();if(!a||!o)return null;let s=$/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,q.jsx)(H.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:$,height:$,transformOrigin:`center`},initial:!1,animate:l,transition:r?{duration:0}:n&&t?{type:`spring`,duration:.9,bounce:.45}:{duration:.4},onAnimationComplete:()=>{n&&t&&i()},children:(0,q.jsx)(p,{components:a,traits:o,size:$})})}function Zi({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=Mi,o=U(),[s,c]=(0,K.useState)(!1),l=e.map(e=>({name:e,displayName:Ye(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),u=l.length>0,d=(0,K.useRef)(null),f=(0,K.useRef)(null),p=(0,K.useRef)(null),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(!1);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=d.current,t=f.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=p.current;h({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[l.length]);let b=m?.note?.y;return(0,K.useEffect)(()=>{b===void 0||g||_(!0)},[b,g]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:r,onNext:i}),(0,q.jsxs)(`div`,{ref:d,className:`absolute left-1/2 top-1/2 z-10 flex w-full max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(H.div,{ref:f,className:`shrink-0`,style:{height:$},initial:!1,animate:g?{width:0,marginRight:0}:{width:$,marginRight:12},transition:o?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),u&&(0,q.jsx)(`div`,{className:`mt-4 flex flex-col gap-3`,children:l.map((e,t)=>(0,q.jsxs)(H.div,{initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:o?{duration:0}:{duration:.3,delay:t*.06},className:`rounded-2xl px-5 py-4`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,q.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,q.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:a.fgMuted},children:e.description})]},e.name))}),(0,q.jsxs)(`div`,{className:`mt-16 flex items-center gap-3`,children:[(0,q.jsx)(`div`,{ref:p,className:`shrink-0`,style:{width:Yi}}),(0,q.jsx)(H.p,{className:`text-[15px]`,style:{color:a.fg},initial:!1,animate:{opacity:+!!v,x:v?0:-6},transition:o?{duration:0}:{duration:.35},children:`I’ve set myself up with plugins around who you are.`})]}),(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{s||(c(!0),Promise.resolve().then(n).catch(()=>c(!1)))},disabled:s,className:`mt-16 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[s?`Starting…`:`Let's chat`,!s&&(0,q.jsx)(W,{className:`h-4 w-4`})]}),m&&(0,q.jsx)(Xi,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var Qi=[{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.32,top:`40%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.32,top:`40%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:240,mobile:!0,pos:e=>({left:`16%`,bottom:-e*.42}),mobilePos:e=>({left:-e*.3,bottom:-e*.3})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:240,mobile:!0,pos:e=>({right:`16%`,bottom:-e*.42}),mobilePos:e=>({right:-e*.3,bottom:-e*.3})},{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:1,base:220,pos:e=>({left:`42%`,bottom:-e*.5})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:220,mobile:!0,pos:e=>({left:-e*.28,bottom:`16%`}),mobilePos:e=>({left:-e*.3,top:-e*.3})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:0,base:220,mobile:!0,pos:e=>({right:-e*.28,bottom:`16%`}),mobilePos:e=>({right:-e*.3,top:-e*.3})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:230,pos:e=>({left:`30%`,bottom:-e*.4})}],$i=`#17191C`,ea=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ta=290;function na({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=G(),o=J.use.characters(),s=J.use.selectedIndex(),c=U(),{w:l}=Xn(),u=Math.max(.42,Math.min(l/1100,1)),d=l<640,f=o.length>0?o[s]:void 0,{bg:m,peekColors:h}=(0,K.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:ii(f.color,a.colors.map(e=>e.id),3)},[a,f]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?$i:m},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,q.jsx)(Gr,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,q.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(ta*u)*.42,right:-Math.round(ta*u)*.12},children:ea.map((e,t)=>{let n=Math.round(ta*u);return(0,q.jsx)(H.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:ea.length-t},initial:c?!1:{y:-140,opacity:0},animate:{y:0,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:200,damping:18,delay:t*.1},children:(0,q.jsx)(p,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,q.jsx)(We,{children:(d?Qi.filter(e=>e.mobile):Qi).slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*u),r=d&&e.mobilePos?e.mobilePos(n):e.pos(n);return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{...r,width:n,height:n},initial:c?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:c?void 0:{scale:0,opacity:0},transition:c?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,q.jsx)(p,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}function ra(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `)}}function ia(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}$e();function aa(){let e=i(),t=oe.use.user(),n=t?.id??null,r=tt.use.enterFocus(),o=tt.use.exitFocus(),s=tt.use.setPendingAvatarTraits(),c=tt.use.requestSidebarCollapse(),[l,u]=(0,K.useState)(`form`),{ref:d,size:f}=qn(),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(!1);function _(e){u(e)}function v(e,t=`completed`){nt(Ke[l],{userId:n,outcome:t}),m([]),_(e)}function y(e){m(e=>[...e,l]),_(e)}function b(){let e=p[p.length-1];e&&(m(e=>e.slice(0,-1)),_(e))}let x=p.length>0?b:void 0,[S,C]=(0,K.useState)(null),[w,E]=(0,K.useState)(null),[O,ee]=(0,K.useState)({}),[k,A]=(0,K.useState)(!1),[j,M]=(0,K.useState)(null),[te,re]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(!1),[se,N]=(0,K.useState)(!1),[ce,P]=(0,K.useState)(!1),[ue,_e]=(0,K.useState)(0),[F,ve]=(0,K.useState)(0),[ye]=a(),be=$t({hostingParam:ye.get(`hosting`),localMode:D(),gatewayAuthSession:T()}),xe=ye.get(`assistant`)??void 0,I=be,{start:Se,ready:Ce,assistantId:L,error:we,awaitReady:R}=on({adoptExisting:be,adoptAssistantId:xe}),z=An(),{start:Te,hydrate:Ee}=z,B=(0,K.useRef)(Promise.resolve()),De=(0,K.useRef)(Promise.resolve()),[Oe,ke]=(0,K.useState)(!1),V=z.status===`idle`||z.status===`running`,Ae=!V&&z.claims.length===0;(0,K.useEffect)(()=>{o(),s(null),Se()},[o,s,Se]),(0,K.useLayoutEffect)(()=>{if(h||!n)return;let e=me(n);if(e?.formValues){C(e.formValues),E(e.faceValues),re(e.checkinTime),N(e.checkinBooked),M(e.researchConversationId??null),e.research&&Ee({...e.research,pluginCatalog:e.research.pluginCatalog??{}},R);let t=he(e);u(I&&(t===`letschat`||t===`meeting`)?`looking`:t),m([])}g(!0)},[h,n,Ee,R,I]),(0,K.useEffect)(()=>{!h||!S||pe(n,{step:l,formValues:S,faceValues:w,checkinTime:te,checkinBooked:se,research:z.status===`done`?{status:`done`,claims:z.claims,suggestions:z.suggestions,installedPlugins:z.installedPlugins,pluginCatalog:z.pluginCatalog}:null,...j?{researchConversationId:j}:{}})},[h,n,l,S,w,te,se,j,z.status,z.claims,z.suggestions,z.installedPlugins,z.pluginCatalog]),(0,K.useEffect)(()=>{h&&(!S||z.status!==`idle`||Te({awaitAssistantId:R,subject:ra(S),conversationTitle:ia(S),...j?{resumeConversationId:j}:{},onConversationCreated:M,includeSuggestions:!1}))},[h,S,j,z.status,Te,R,!0]),(0,K.useEffect)(()=>{l===`results`&&Ae&&(m([]),u(`suggestions`))},[l,Ae]);function je(t,i,a,{skip:o=!1,hidden:l=!1}={}){ge(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!o&&a===void 0;fe({tools:[],tasks:[],tone:at,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??Qt({firstName:u,lastName:d,occupation:f,hobby:p.join(`, `)}),...l?{initialMessageHidden:!0}:{}},...g?{title:h?`Getting to know ${h}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{}});let _=i?.name?.trim();_&&de(_),s(i?.traits??null),g&&r(),o||ne.markExpectingFirstMessage(),c(),ne.checkAssistant(L??void 0).finally(()=>{e(`${le.assistant}?onboarding=1`,{replace:!0})})}async function Me(){S&&(await Promise.all([z.awaitPluginInstalls(),B.current,De.current]),je(S,w,Un(w?.name),{hidden:!0}))}function Ne(e){C(e),z.start({awaitAssistantId:R,subject:ra(e),conversationTitle:ia(e),onConversationCreated:M,includeSuggestions:!1}),v(`face`)}function Pe(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){P(!0);return}if(P(!1),L&&S){let e=[S.firstName.trim(),S.lastName.trim()].filter(Boolean).join(` `);re(null),N(!1),ae(!0),Je({assistantId:L,userName:e||void 0,assistantName:w?.name?.trim()||void 0}).then(e=>{e.scheduled&&(N(!0),re(Wn(e.start,e.timeZone)))}).finally(()=>ae(!1))}v(`meeting`)}if([`different`,`personality`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l)&&S){let e=[`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l);return(0,q.jsx)(`div`,{ref:d,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,q.jsxs)(Yn,{size:f,children:[(0,q.jsx)(na,{eyesBumpNonce:ue,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(l)?F:0,darkBg:e,showBottomEyes:!e&&l!==`different`}),l===`different`&&(0,q.jsx)(pi,{onContinue:()=>v(`personality`),onBack:()=>y(`intro`),onForward:x}),l===`personality`&&(0,q.jsx)(Ai,{values:O,onValueChange:(e,t)=>ee(n=>({...n,[e]:t})),locked:k,onContinue:()=>{k||(ke(!0),De.current=Hn({awaitAssistantId:R,values:O,userName:S?.firstName?.trim()||void 0,assistantName:w?.name?.trim()||void 0}).finally(()=>ke(!1)),A(!0)),v(`integration`)},onBack:()=>y(`different`),onForward:x}),l===`integration`&&(0,q.jsx)(vi,{onClaim:()=>v(I?`looking`:`letschat`),onBumpEyes:()=>_e(e=>e+1),onBack:()=>y(`personality`),onForward:x}),l===`letschat`&&(0,q.jsx)(ji,{assistantId:L,assistantReady:Ce,hatchError:we,onConnected:Pe,missingCalendarScope:ce,onRetry:()=>P(!1),onSkip:()=>{P(!1),v(`looking`,`skipped`)},onBack:()=>y(`integration`),onForward:x}),l===`meeting`&&(0,q.jsx)(zi,{scheduledTime:te??void 0,awaitingTime:ie,onDone:()=>v(`looking`),onBack:()=>y(`letschat`),onForward:x}),l===`looking`&&(0,q.jsx)(Ki,{onDone:()=>v(Ae?`suggestions`:`results`),onBack:()=>y(I?`integration`:`letschat`),onAdvance:e=>ve(Math.min(e+1,4)),onForward:x,ready:!V}),l===`results`&&(0,q.jsx)(Ji,{claims:z.claims,loading:V,onContinue:e=>{j&&L&&e.length>0&&(B.current=Mn({assistantId:L,conversationId:j,removedClaims:e,rejectedAll:!1})),v(`suggestions`)},onRejectAll:()=>{j&&L&&(B.current=Mn({assistantId:L,conversationId:j,removedClaims:z.claims.map(e=>e.claim),rejectedAll:!0})),v(`suggestions`,`skipped`)},onBack:()=>y(`looking`),onForward:x}),l===`suggestions`&&(0,q.jsx)(Zi,{installedPlugins:z.installedPlugins,pluginCatalog:z.pluginCatalog,onStart:async()=>{if(nt(Ke.suggestions,{userId:n,outcome:`completed`}),Oe){m([]),u(`finishing`);return}await Me()},onBack:()=>y(Ae?`looking`:`results`),onForward:x}),l===`suggestions`&&!1,l===`finishing`&&(0,q.jsx)(qi,{ready:!Oe,onDone:()=>void Me()})]})})}return l===`intro`&&S?(0,q.jsx)(Jr,{firstName:S.firstName,assistantName:w?.name,onContinue:()=>v(`different`),onBack:()=>y(`face`),onForward:x}):l===`face`&&S?(0,q.jsx)(Nr,{onContinue:e=>{E(e),v(`intro`)},onBack:()=>y(`form`),onForward:x}):(0,q.jsx)(wr,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ne})}export{aa as ResearchOnboardingRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./shield-check-DFzO4cEd.js";import{t as s}from"./is-electron-LEymSS4C.js";import{d as c,i as l,n as u}from"./auth-store-CI4EhvE5.js";import{t as d}from"./return-to-BbdJZupb.js";import{o as f}from"./routes-iUGoIqW2.js";import{c as p,d as m,f as h,l as g,p as _,u as v}from"./prefs-Bo9fZ56w.js";import{in as y,pr as b}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./shield-check-DFzO4cEd.js";import{t as s}from"./is-electron-LEymSS4C.js";import{d as c,i as l,n as u}from"./auth-store-CI4EhvE5.js";import{t as d}from"./return-to-BbdJZupb.js";import{o as f}from"./routes-iUGoIqW2.js";import{c as p,d as m,f as h,l as g,p as _,u as v}from"./prefs-Bo9fZ56w.js";import{in as y,pr as b}from"./index-CoobbyzR.js";import{n as x,t as S}from"./consent-controls-J9UujLtO.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=r(),[t]=i(),a=u.use.user()?.id??null,w=u.use.logout(),T=s(),k=l(),[A,j]=_(),[M,N]=v(),[P,F]=m(),[I,L]=h(),[R]=p(),[z]=g(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{c({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(d(t.get(`returnTo`),f.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),b(f.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(y,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(o,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:X}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./copy-CytZjq76.js";import{t as c}from"./loader-circle-D1pLQlMh.js";import{t as l}from"./notice-Dh3mnM_U.js";import{t as u}from"./input-DR1eB4a1.js";import{t as d}from"./modal-cdtdc8dA.js";import{n as f}from"./toast-DowcpN7g.js";import{t as p}from"./confirm-dialog-DW84Cxfq.js";import{Pt as m}from"./sdk.gen-B3bmXhSv.js";import{o as h}from"./routes-iUGoIqW2.js";import{t as g}from"./client-feature-flag-store-C0Tjm-Hl.js";import{At as _,Mt as v,Nt as y,jt as b,kt as x}from"./react-query.gen-DVZyPw6H.js";import{T as S,bi as C,zr as w}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./copy-CytZjq76.js";import{t as c}from"./loader-circle-D1pLQlMh.js";import{t as l}from"./notice-Dh3mnM_U.js";import{t as u}from"./input-DR1eB4a1.js";import{t as d}from"./modal-cdtdc8dA.js";import{n as f}from"./toast-DowcpN7g.js";import{t as p}from"./confirm-dialog-DW84Cxfq.js";import{Pt as m}from"./sdk.gen-B3bmXhSv.js";import{o as h}from"./routes-iUGoIqW2.js";import{t as g}from"./client-feature-flag-store-C0Tjm-Hl.js";import{At as _,Mt as v,Nt as y,jt as b,kt as x}from"./react-query.gen-DVZyPw6H.js";import{T as S,bi as C,zr as w}from"./index-CoobbyzR.js";import{t as T}from"./detail-card-CnahmiAd.js";var E=e(t(),1);function D(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}var O=o();function k({open:e,onOpenChange:t}){let r=i(),[a,o]=(0,E.useState)(null),[l,p]=(0,E.useState)(``),[h,g]=(0,E.useState)(null),_=(0,E.useRef)(!1),v=(0,E.useRef)(e),S=()=>r.invalidateQueries({queryKey:y()}),C=e=>{m({path:{id:e}}).catch(()=>void 0).finally(()=>void S())},w=x({onSuccess:e=>{if(!v.current){C(e.factor_id);return}o(e)},onError:e=>{let n=D(e);n===`no_workos_account`?f.error(`Two-factor authentication is only available for Vellum platform accounts.`):n===`throttled`||n===`workos_rate_limited`?f.error(`Too many attempts. Try again in a minute.`):n===`factor_limit_reached`?f.error(`An authenticator app is already set up. Remove it before adding another.`):f.error(`Failed to start setup. Please try again.`),t(!1)}}),T=b({onSuccess:e=>{e.valid?(_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1)):g(`That code didn't match. Check your authenticator app and try again.`)},onError:e=>{let n=D(e);if(n===`challenge_already_verified`){_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1);return}if(n===`challenge_expired`||n===`challenge_not_found`){a&&C(a.factor_id),o(null),p(``),g(`This setup session expired. Scan the new QR code and try again.`),w.mutate({});return}if(n===`throttled`||n===`workos_rate_limited`){g(`Too many attempts. Wait a minute and try again.`);return}g(`Couldn't verify the code. Wait a moment and try again.`)}});(0,E.useEffect)(()=>{v.current=e,e&&(_.current=!1,o(null),p(``),g(null),w.mutate({}))},[e]);let k=e=>{!e&&T.isPending||(!e&&a&&!_.current&&C(a.factor_id),t(e))},A=()=>{a&&navigator.clipboard.writeText(a.secret).then(()=>f.success(`Setup key copied.`)).catch(()=>f.error(`Couldn't copy the setup key.`))},j=()=>{!a||l.length!==6||T.isPending||(g(null),T.mutate({body:{challenge_id:a.challenge_id,code:l}}))};return(0,O.jsx)(d.Root,{open:e,onOpenChange:k,children:(0,O.jsxs)(d.Content,{size:`sm`,children:[(0,O.jsxs)(d.Header,{children:[(0,O.jsx)(d.Title,{children:`Set up authenticator app`}),(0,O.jsx)(d.Description,{children:`Scan the QR code with an authenticator app such as Google Authenticator or 1Password, then enter the 6-digit code it shows.`})]}),(0,O.jsx)(d.Body,{children:a===null?(0,O.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,O.jsx)(c,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,O.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,O.jsx)(`img`,{src:a.qr_code,alt:`QR code for your authenticator app`,className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Can't scan it? Enter this setup key manually:`}),(0,O.jsxs)(`button`,{type:`button`,onClick:A,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,O.jsx)(`span`,{className:`break-all text-left`,children:a.secret}),(0,O.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:`6-digit code`}),(0,O.jsx)(u,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:`123456`,value:l,onChange:e=>p(e.target.value.replace(/\D/g,``).slice(0,6))}),h&&(0,O.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:h})]})]})}),(0,O.jsxs)(d.Footer,{children:[(0,O.jsx)(n,{variant:`outlined`,onClick:()=>k(!1),disabled:T.isPending,children:`Cancel`}),(0,O.jsx)(n,{onClick:j,disabled:a===null||l.length!==6||T.isPending,children:T.isPending?`Verifying…`:`Verify`})]})]})})}function A(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function j(){let e=i(),[t,r]=(0,E.useState)(!1),[o,s]=(0,E.useState)(null),u=a({...v()}),d=u.data??[],m=()=>e.invalidateQueries({queryKey:y()}),h=_({onSuccess:()=>{f.success(`Authenticator app removed.`),m()},onError:e=>{if(D(e)===`factor_not_found`){m();return}f.error(`Failed to remove the authenticator app. Please try again.`)}});return(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u.isPending?(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,O.jsx)(c,{className:`h-4 w-4 animate-spin`}),(0,O.jsx)(`span`,{className:`text-body-medium-default`,children:`Loading authenticator apps…`})]}):u.isError?(0,O.jsxs)(l,{tone:`error`,children:[`Couldn't load your authenticator apps.`,` `,(0,O.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void u.refetch(),children:`Try again`})]}):d.length===0?(0,O.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`No authenticator app is set up. Add one to require a one-time code at sign-in.`}):(0,O.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:d.map(e=>(0,O.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,O.jsx)(C,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Authenticator app`}),(0,O.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[e.user,e.created_at?` · Added ${A(e.created_at)}`:``]})]})]}),(0,O.jsx)(n,{variant:`dangerOutline`,onClick:()=>s(e),disabled:h.isPending,children:`Remove`})]},e.id))}),!u.isPending&&!u.isError&&d.length===0&&(0,O.jsx)(n,{onClick:()=>r(!0),className:`self-start`,children:`Add authenticator app`}),(0,O.jsx)(k,{open:t,onOpenChange:r}),(0,O.jsx)(p,{open:o!==null,title:`Remove authenticator app`,message:`Signing in will no longer ask for a code from this app. You can set up a new authenticator app at any time.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{o&&h.mutate({path:{id:o.id}}),s(null)},onCancel:()=>s(null)})]})}function M(){let e=g.use.accountMfa(),t=g.use.hydrated(),n=w();return t&&!e?(0,O.jsx)(r,{replace:!0,to:h.settings.general}):!e||n===`gated`?null:(0,O.jsx)(`div`,{className:`space-y-4`,children:(0,O.jsx)(T,{title:`Two-Factor Authentication`,subtitle:`Require a code from an authenticator app when you sign in.`,children:n===`disabled`?(0,O.jsx)(S,{children:`Log in to the Vellum platform to manage two-factor authentication.`}):(0,O.jsx)(j,{})})})}export{M as SecurityPage};
|
package/dist/assets/{select-assistant-screen-kQk8uctH.js → select-assistant-screen-BznHV3KW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./check-DFNrQERi.js";import{t as s}from"./modal-cdtdc8dA.js";import{t as c}from"./confirm-dialog-DW84Cxfq.js";import{A as l,F as u,M as d,d as f,lt as p,rt as ee,t as te}from"./local-mode-YoUYEn7C.js";import{t as m}from"./is-electron-LEymSS4C.js";import{n as h}from"./resolved-assistants-store-DccydJ5N.js";import{D as g,O as _,i as v,n as y}from"./auth-store-CI4EhvE5.js";import{o as b}from"./routes-iUGoIqW2.js";import{t as x}from"./use-onboarding-login-9378MpEq.js";import{An as S,Yi as C,da as w,in as T,jn as ne}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./check-DFNrQERi.js";import{t as s}from"./modal-cdtdc8dA.js";import{t as c}from"./confirm-dialog-DW84Cxfq.js";import{A as l,F as u,M as d,d as f,lt as p,rt as ee,t as te}from"./local-mode-YoUYEn7C.js";import{t as m}from"./is-electron-LEymSS4C.js";import{n as h}from"./resolved-assistants-store-DccydJ5N.js";import{D as g,O as _,i as v,n as y}from"./auth-store-CI4EhvE5.js";import{o as b}from"./routes-iUGoIqW2.js";import{t as x}from"./use-onboarding-login-9378MpEq.js";import{An as S,Yi as C,da as w,in as T,jn as ne}from"./index-CoobbyzR.js";import{r as E}from"./format-date-CLlHK5gl.js";var D=e(t(),1),O=a();function k({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:o,onRetire:l}){let[u,d]=(0,D.useState)(`menu`);(0,D.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,O.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,O.jsx)(c,{open:e,title:`Repair Assistant?`,message:(0,O.jsxs)(O.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:o,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,O.jsx)(S,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,O.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,O.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,O.jsx)(s.Header,{children:(0,O.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,O.jsxs)(s.Body,{children:[(0,O.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,O.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,O.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,O.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,O.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function A(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function j(e){if(e.hatchedAt)return`Created ${E(e.hatchedAt)}`}function M(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=m(),c=v(),S=h.use.assistants(),C=g.use.currentOrganizationId(),{loading:w,error:E,login:j,cancel:M}=x(),P=e=>e.isLocal||c,F=S.filter(P),I=S.some(e=>e.isPlatformHosted)&&!c,[L,R]=(0,D.useState)(null),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1),[U,W]=(0,D.useState)(null),[G,K]=(0,D.useState)(null),[q,J]=(0,D.useState)(!1),[Y,X]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(L!=null||F.length===0)return;let e=_(C);R(F.find(t=>t.id===e)?.id??F[0].id)},[L,F,C]);let Z=async t=>{B(!0),W(null);try{t.isLocal?await y.getState().connectLocalAssistant(t.id):await y.getState().connectPlatformAssistant(t.id),e(b.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&l()&&(d(e)||p(e)||e instanceof te)&&f(t.id)?K(t):W(`Failed to connect. Please try again.`),B(!1)}},Q=()=>{K(null),J(!1),X(null),H(!1)},re=async()=>{if(!(!G||q)){J(!0),X(null);try{let e=await u(G.id,{repairGuardian:!0});if(e.ok){ee(),Q(),Z(G);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}J(!1)}},ie=async()=>{if(!(!G||q)){J(!0),X(null);try{let t=await ne(G.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}J(!1)}};(0,D.useEffect)(()=>{a||o||z||V||S.length!==0&&S.length===1&&F.length===1&&(H(!0),Z(F[0]))},[S.length,F.length]);let ae=()=>{let e=S.find(e=>e.id===L);e&&Z(e)},oe=()=>{e(b.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(T,{children:(0,O.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,O.jsxs)(T,{children:[(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,O.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,O.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:S.map(e=>{let t=P(e);return(0,O.jsx)(N,{assistant:e,selected:L===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&R(e.id)}},e.id)})}),(0,O.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[F.length>0&&(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!L||z,children:z?`Connecting…`:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${b.onboarding.hosting}?from=select-assistant`),disabled:z||w,children:`Create New Assistant`}),I&&(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:w?M:()=>void j(),disabled:z,children:w?`Cancel`:`Log In`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:z||w,children:`Back`})]})]}),(0,O.jsx)(k,{open:G!=null,assistantName:G?A(G):``,isPending:q,errorMessage:Y??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function N({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=j(e),s=m();return(0,O.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,s?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,O.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,s?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,O.jsx)(C,{className:`h-5 w-5`}):(0,O.jsx)(w,{className:`h-5 w-5`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:A(e)}),r&&(0,O.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,O.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,O.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,O.jsx)(o,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{M as SelectAssistantScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./log-out-CCanFuT_.js";import{t as s}from"./log-in-BQonRVoo.js";import{t as c}from"./is-electron-LEymSS4C.js";import{i as l}from"./auth-store-CI4EhvE5.js";import{o as u}from"./routes-iUGoIqW2.js";import{t as d}from"./client-feature-flag-store-C0Tjm-Hl.js";import{t as f}from"./use-onboarding-login-9378MpEq.js";import{t as p}from"./assistant-feature-flag-store-BRGydSRn.js";import{fr as m,zr as h,zt as g}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./log-out-CCanFuT_.js";import{t as s}from"./log-in-BQonRVoo.js";import{t as c}from"./is-electron-LEymSS4C.js";import{i as l}from"./auth-store-CI4EhvE5.js";import{o as u}from"./routes-iUGoIqW2.js";import{t as d}from"./client-feature-flag-store-C0Tjm-Hl.js";import{t as f}from"./use-onboarding-login-9378MpEq.js";import{t as p}from"./assistant-feature-flag-store-BRGydSRn.js";import{fr as m,zr as h,zt as g}from"./index-CoobbyzR.js";import{n as _,t as v}from"./sidebar-tree-CMREzbfC.js";var y=e(t(),1),b=a();function x(){let e=p.use.settingsDeveloperNav(),t=d.use.platformNotifications(),a=d.use.bookmarks(),x=d.use.accountMfa(),S=h({platformHostedOnly:!0}),C=h(),{pathname:w}=i(),T=n(),E=l(),{login:D}=f(),O=(0,y.useMemo)(()=>g.filter(e=>!(e.id===`notifications`&&(!t||S===`gated`)||e.id===`billing`&&C!==`full`||e.id===`security`&&(!x||C===`gated`)||e.id===`bookmarks`&&!a||e.id===`devices`&&S===`gated`||e.id===`keyboard-shortcuts`&&!c()||e.id===`developer`)),[t,S,C,a,x]),k=(0,y.useMemo)(()=>{let t=[];return e&&t.push(...g.filter(e=>e.id===`developer`)),t.push(E?{id:`logout`,label:`Log Out`,icon:o,onSelect:()=>void m(T)}:{id:`login`,label:`Log In`,icon:s,onSelect:()=>void D()}),t},[e,E,T,D]),A=(0,y.useMemo)(()=>{if(w===u.settings.root)return`Settings`;let e=g.find(e=>w===e.href||w.startsWith(e.href+`/`));return e?e.label:`Settings`},[w]);return(0,b.jsx)(_,{backHref:u.assistant,sidebar:(0,b.jsx)(v,{items:O,bottomItems:k,indexPath:u.settings.root}),title:A,children:(0,b.jsx)(r,{})})}export{x as SettingsLayout};
|