@vellumai/web 0.10.1-staging.1 → 0.10.1-staging.2
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-DcjAe3ze.js → account-page-va3jsKG3.js} +1 -1
- package/dist/assets/{add-credits-modal-BRZVeZOI.js → add-credits-modal-BJQfpHmv.js} +1 -1
- package/dist/assets/{advanced-page-axzblMww.js → advanced-page-BQEEMqUJ.js} +1 -1
- package/dist/assets/{ai-page-DrDDpvgG.js → ai-page-C2gOM0fO.js} +1 -1
- package/dist/assets/{api-key-screen-CM-BLcGz.js → api-key-screen-D3pD0rPG.js} +1 -1
- package/dist/assets/{archive-page-DabK-GNm.js → archive-page-CDaGKTY2.js} +1 -1
- package/dist/assets/{assistant-status-panel-Cm8ComZV.js → assistant-status-panel-Byd6c2GD.js} +1 -1
- package/dist/assets/auth-store-Cc0c0sQk.js +7 -0
- package/dist/assets/billing-page-GeeUd8nR.js +3 -0
- package/dist/assets/{bookmarks-page-CvfOEvF0.js → bookmarks-page-vJb4HXNp.js} +1 -1
- package/dist/assets/{build-state-CjVnPOtQ.js → build-state-WKs9Ht8_.js} +1 -1
- package/dist/assets/{command-palette-AsmJHeEk.js → command-palette-K6nK6F7f.js} +1 -1
- package/dist/assets/{command-palette-window-page-DrgvLRov.js → command-palette-window-page-BTGDdcg4.js} +1 -1
- package/dist/assets/{community-page-sWODbqYS.js → community-page-UxhAQFV9.js} +1 -1
- package/dist/assets/{connect-page-DsRXJyfd.js → connect-page-BgPgIb-F.js} +1 -1
- package/dist/assets/contacts-page-route-CM06poQB.js +1 -0
- package/dist/assets/{conversation-queries-Hwr6Ce8U.js → conversation-queries-Bm61s1He.js} +1 -1
- package/dist/assets/{debug-page-BeqbpC6w.js → debug-page-BVMoMpUg.js} +1 -1
- package/dist/assets/{deploy-dialogs-CDE1JAyP.js → deploy-dialogs-BJI2X201.js} +1 -1
- package/dist/assets/{developer-page-Bh9POaRZ.js → developer-page-9X_iqAuN.js} +1 -1
- package/dist/assets/{devices-page-br5aQnJ6.js → devices-page-Byr7kUNa.js} +1 -1
- package/dist/assets/{dictation-overlay-page-D_kPOJmY.js → dictation-overlay-page-CN6yGveG.js} +1 -1
- package/dist/assets/{document-viewer-page-BWNgq5A7.js → document-viewer-page-CRnBN1cE.js} +1 -1
- package/dist/assets/{earn-credits-modal-BQlDvHQX.js → earn-credits-modal-DevPS5jN.js} +1 -1
- package/dist/assets/{emails-page-DCEa8uJF.js → emails-page-B0dZDuR-.js} +1 -1
- package/dist/assets/{file-editor-D0SuRz-y.js → file-editor-DqNMJEa4.js} +1 -1
- package/dist/assets/general-page-B83wb3Tj.js +1 -0
- package/dist/assets/hatching-screen-Cok0yK9s.js +1 -0
- package/dist/assets/{home-page-route-CAziCmHd.js → home-page-route-C_dx1nVl.js} +1 -1
- package/dist/assets/{hosting-screen-DVJZyhOt.js → hosting-screen-CsavWom3.js} +1 -1
- package/dist/assets/identity-page-route-Bly29wqM.js +1 -0
- package/dist/assets/index-DhxGhfwI.js +155 -0
- package/dist/assets/{inspect-page-CBpmIz3n.js → inspect-page-C_hXwcho.js} +3 -3
- package/dist/assets/install-Gyq-nEic.js +1 -0
- package/dist/assets/integrations-page-Dz67PdC8.js +1 -0
- package/dist/assets/{intelligence-layout-BzBg1Kci.js → intelligence-layout-CgcnfjDK.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-CfAeD2Ca.js → keyboard-shortcuts-page-BhTucwGW.js} +1 -1
- package/dist/assets/{library-detail-page-D6RDZtML.js → library-detail-page-DK89d-u4.js} +1 -1
- package/dist/assets/{library-page-CrI--_3N.js → library-page-vrFk-Rt1.js} +1 -1
- package/dist/assets/{login-flow-sr2DI9LC.js → login-flow-CzPVmpoB.js} +1 -1
- package/dist/assets/{login-page-JTaRfldA.js → login-page-Csy9gwOa.js} +1 -1
- package/dist/assets/{logout-page-DjT8j4Lw.js → logout-page-Dz800OIa.js} +1 -1
- package/dist/assets/{logs-layout-DsCE83mN.js → logs-layout-BwgQ_S4K.js} +1 -1
- package/dist/assets/{mcp-page-BgOwigD-.js → mcp-page-5PXJCl5X.js} +1 -1
- package/dist/assets/{memory-router-playground-page-BFeqOyw_.js → memory-router-playground-page-BVhLOinh.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-ChpPfZ8u.js → mobile-sidebar-drawer-rYD2VIdb.js} +1 -1
- package/dist/assets/{notifications-page-Bg_7pXfR.js → notifications-page-CVB7NSmc.js} +1 -1
- package/dist/assets/{oauth-complete-page-BuJCcg8E.js → oauth-complete-page-CzvAQxVm.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-Cfh_5DAx.js → oauth-popup-complete-page-e67O6LPS.js} +1 -1
- package/dist/assets/{pairing-page-Jt95f3cN.js → pairing-page-B6gfw_Dk.js} +1 -1
- package/dist/assets/{platform-loopback-page-B3Q7OUNO.js → platform-loopback-page-BtfoD3mE.js} +1 -1
- package/dist/assets/{plugin-detail-page-C4bk1LvY.js → plugin-detail-page-CTQIvdhJ.js} +1 -1
- package/dist/assets/{plugins-page-CtHfLqtX.js → plugins-page-CVnC0QSh.js} +1 -1
- package/dist/assets/prechat-route-y6KNH7Qp.js +1 -0
- package/dist/assets/{prefs-CrgkSe-_.js → prefs-BQY2Hl9H.js} +1 -1
- package/dist/assets/privacy-page-Bbc8BtbS.js +1 -0
- package/dist/assets/{privacy-screen-CXDDLFzO.js → privacy-screen-CEH2JNQv.js} +1 -1
- package/dist/assets/{provider-callback-page-D2guKVyJ.js → provider-callback-page-C7misZDP.js} +1 -1
- package/dist/assets/{provider-signup-page-DiyM7dV8.js → provider-signup-page-PWsQh0Yg.js} +1 -1
- package/dist/assets/{research-mock-page-DB4eGyYW.js → research-mock-page-C9A3-fDP.js} +1 -1
- package/dist/assets/{research-onboarding-route-BCepmvL-.js → research-onboarding-route-efpyR7DJ.js} +2 -2
- package/dist/assets/resolved-assistants-store-lkSgU__i.js +1 -0
- package/dist/assets/{review-terms-screen-BdGybDri.js → review-terms-screen-CDfWU0ZO.js} +1 -1
- package/dist/assets/{select-assistant-screen-CHBqN3LE.js → select-assistant-screen-ZJ9IYyUk.js} +1 -1
- package/dist/assets/{settings-layout-CLYztcN0.js → settings-layout-Cp1jKtid.js} +1 -1
- package/dist/assets/{share-feedback-modal-CRvX8jqz.js → share-feedback-modal-pEDXaPEK.js} +1 -1
- package/dist/assets/{sidebar-tree-CLtH7ULI.js → sidebar-tree-B24zaatU.js} +1 -1
- package/dist/assets/{signup-page-Bh-8V-o6.js → signup-page-Bf1Etxe9.js} +1 -1
- package/dist/assets/skills-page-A9JPglEX.js +1 -0
- package/dist/assets/{sounds-page-wAXxaGjk.js → sounds-page-D9PLU10T.js} +1 -1
- package/dist/assets/{step-indicator-dots-JQQwRvNU.js → step-indicator-dots-CE4dEV3k.js} +1 -1
- package/dist/assets/{subagent-detail-panel-Csn2eZm-.js → subagent-detail-panel-DdynnGgr.js} +2 -2
- package/dist/assets/{system-events-page-CY9869ly.js → system-events-page-CapsfcLj.js} +1 -1
- package/dist/assets/{tiptap-document-editor-B-jptvl0.js → tiptap-document-editor-Bmxs-PZ9.js} +2 -2
- package/dist/assets/{tool-detail-panel-TULCfc-h.js → tool-detail-panel-BqCxmSox.js} +2 -2
- package/dist/assets/trace-page-CniuHbEK.js +1 -0
- package/dist/assets/{upgrade-cancel-page-DDp_V51G.js → upgrade-cancel-page-DBjzADY1.js} +1 -1
- package/dist/assets/{upgrade-success-page-jXr4wakw.js → upgrade-success-page-VewnS1PS.js} +1 -1
- package/dist/assets/{usage-page-giUgsD1Z.js → usage-page-XZramSoz.js} +1 -1
- package/dist/assets/{use-active-assistant-id-DOx36WGk.js → use-active-assistant-id-DTsVl8b7.js} +1 -1
- package/dist/assets/use-is-org-ready-BL-GcZZw.js +1 -0
- package/dist/assets/{use-onboarding-login-Bp9jhDR4.js → use-onboarding-login-vAFdm7Pu.js} +1 -1
- package/dist/assets/{voice-page-BV-46kzi.js → voice-page-DiP4QkZU.js} +1 -1
- package/dist/assets/{weather-forecast-display-CdImQdck.js → weather-forecast-display-3wTH0LJ0.js} +1 -1
- package/dist/assets/{welcome-screen-TWxcbCdx.js → welcome-screen-DVEKTxnJ.js} +1 -1
- package/dist/assets/{workflow-detail-panel-FzbZ4bE5.js → workflow-detail-panel-Djzb5VDE.js} +1 -1
- package/dist/assets/workspace-page-DvdkgVub.js +1 -0
- package/dist/index.html +9 -9
- package/package.json +1 -1
- package/dist/assets/auth-store-6CnXVIAL.js +0 -7
- package/dist/assets/billing-page-CvQeoBjS.js +0 -3
- package/dist/assets/contacts-page-route-eK-_KwLV.js +0 -1
- package/dist/assets/general-page-Cxl-qtRp.js +0 -1
- package/dist/assets/hatching-screen-CHqDiHaW.js +0 -1
- package/dist/assets/identity-page-route-DmpOhvmv.js +0 -1
- package/dist/assets/index-Chr1kHBM.js +0 -155
- package/dist/assets/install-CFvX5wtl.js +0 -1
- package/dist/assets/integrations-page-C2AgksrD.js +0 -1
- package/dist/assets/prechat-route-CEPNmia4.js +0 -1
- package/dist/assets/privacy-page-BX4CkH3k.js +0 -1
- package/dist/assets/resolved-assistants-store-IMxY1_w9.js +0 -1
- package/dist/assets/skills-page-B5SANwyR.js +0 -1
- package/dist/assets/trace-page-CHASnwBH.js +0 -1
- package/dist/assets/use-is-org-ready-D3HBLwJJ.js +0 -1
- package/dist/assets/workspace-page-C4tstjYv.js +0 -1
package/dist/assets/{research-onboarding-route-BCepmvL-.js → research-onboarding-route-efpyR7DJ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CN7ObyIk.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-D7s2Q_uG.js";import{d as i,r as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./cn-DvW5mxZR.js";import{t as c}from"./tag-CE_o2aao.js";import{t as l}from"./input-Ch7OC6ME.js";import{n as u,t as d}from"./create-selectors-BE0_e_Ed.js";import{t as f}from"./arrow-left-CEu7Dsda.js";import{t as p}from"./chevron-left-BFX62ERI.js";import{t as m}from"./chevron-right-Cc3NZhAF.js";import{t as h}from"./loader-circle-YAV9sMh_.js";import{t as g}from"./pencil-Cyrr5VNX.js";import{t as _}from"./sparkles-BoIJjAXt.js";import{t as v}from"./x-b3o2p6YU.js";import{X as y,en as b,tn as x}from"./sdk.gen-W0KlW-sG.js";import{r as S}from"./api-errors-C3sAdlZQ.js";import{Y as C,at as w,it as T,n as E,nt as D,rt as O}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CN7ObyIk.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-D7s2Q_uG.js";import{d as i,r as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./cn-DvW5mxZR.js";import{t as c}from"./tag-CE_o2aao.js";import{t as l}from"./input-Ch7OC6ME.js";import{n as u,t as d}from"./create-selectors-BE0_e_Ed.js";import{t as f}from"./arrow-left-CEu7Dsda.js";import{t as p}from"./chevron-left-BFX62ERI.js";import{t as m}from"./chevron-right-Cc3NZhAF.js";import{t as h}from"./loader-circle-YAV9sMh_.js";import{t as g}from"./pencil-Cyrr5VNX.js";import{t as _}from"./sparkles-BoIJjAXt.js";import{t as v}from"./x-b3o2p6YU.js";import{X as y,en as b,tn as x}from"./sdk.gen-W0KlW-sG.js";import{r as S}from"./api-errors-C3sAdlZQ.js";import{Y as C,at as w,it as T,n as E,nt as D,rt as O}from"./auth-store-Cc0c0sQk.js";import{a as k,o as ee,r as A}from"./api-kMnfZUPa.js";import{a as te}from"./routes-BLyehs4B.js";import{t as ne}from"./client-feature-flag-store-DjN8fxHA.js";import{a as j,l as re,o as M,s as N,t as P,u as ie}from"./proxy-l3iqYpig.js";import{t as F}from"./use-reduced-motion-DgX4o6QR.js";import{E as I,Q as L,Z as R,_t as ae,bt as oe,jt as z,sa as B,st as se,vt as ce,yn as le}from"./index-DhxGhfwI.js";import{t as ue}from"./prechat-names-CkLrL-Jh.js";function de(e){e.values.forEach(e=>e.stop())}function V(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&M(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{V(e,t)})})}function fe(e,t){if(Array.isArray(t))return V(e,t);if(typeof t==`string`)return V(e,[t]);M(e,t)}function pe(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){N(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(j(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return N(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{fe(e,n)})},stop(){t.forEach(e=>{de(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function me(){let e=ie(pe);return re(e.mount,[]),e}var H=e(n(),1);function he({firstName:e,lastName:t,occupation:n,hobby:r}){let i=[e.trim(),t.trim()].filter(Boolean).join(` `),a=n.trim(),o=r?.trim()??``;return`${[i?`My name is ${i}.`:``,a?`I work as ${a}.`:``,o?`My hobby is ${o}.`:``].filter(Boolean).join(` `)||`I'd like you to get to know me before we start working together.`}
|
|
2
2
|
|
|
3
3
|
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.
|
|
4
4
|
|
|
@@ -27,4 +27,4 @@ Life admin (always present). Target the home and personal side. Anchor on the ap
|
|
|
27
27
|
Each suggestion should be spoken in your voice, offering a service. First-person "I" in the suggestion refers to you, regardless of your name. Core sentence pattern: "I'll [verb] [specific artifact]" or "Connect me to [integration] and I'll [verb] [artifact]." An intake question can lead ("Tell me about your next trip. I'll build a training plan") as long as the offer is preserved. Suggestions render as clickable; clicking indicates the user wants to proceed. Refinement happens in follow-up conversation, not through the click itself.
|
|
28
28
|
Use what you learned about me during research to make each suggestion feel specific to my stack, role, and industry, not generic LLM-assistant stuff. Avoid "summarize" or "draft a post" as standalone suggestions. Favor the surprising, specific capabilities (apps, monitors, doc editor, integrations).
|
|
29
29
|
Don't include anything sensitive or private. If you found very little, lean on "guessing" claims and broadly useful suggestions for my role. Output ONLY the JSON object. No code fence, no extra text.`}var ge=3e3,_e=3e5,ve=`Failed to start your assistant. Please try again.`,ye=`Your assistant is taking longer than expected. Please try again.`,be=e=>new Promise(t=>setTimeout(t,e));function xe(){let[e,n]=(0,H.useState)(!1),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(null),s=(0,H.useRef)(!1),c=(0,H.useRef)([]),l=(0,H.useRef)(null),u=(0,H.useCallback)(e=>{if(!l.current){l.current={kind:`ready`,id:e},n(!0);for(let t of c.current)t.resolve(e);c.current=[]}},[]),d=(0,H.useCallback)(e=>{if(l.current)return;l.current={kind:`error`,message:e},o(e);let t=Error(e);for(let e of c.current)e.reject(t);c.current=[]},[]);return{start:(0,H.useCallback)(()=>{if(s.current)return;s.current=!0;let e=Date.now(),n=()=>Date.now()-e>=_e;(async()=>{let e;try{let t=await ee();if(t.ok)e=t.data.id,i(t.data.id);else{if(O(t.status,t.error)){d(D);return}if(!w(t.status)){d(S(t.error,void 0,ve));return}}}catch(e){t(e,{context:`research_background_hatch`})}let r;for(;!r;){if(n()){d(ye);return}try{let t=await A(e);e&&!t.ok&&t.status===404&&(e=void 0,t=await A());let n=T(t);if(n.kind===`active`&&t.ok){r=t.data.id,i(r);break}if(n.kind===`error`){d(n.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await be(ge)}for(;;){try{if((await k(r)).ok)break}catch{}if(n()){d(ye);return}await be(ge)}u(r)})()},[d,u]),ready:e,assistantId:r,error:a,awaitReady:(0,H.useCallback)(()=>{let e=l.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{c.current.push({resolve:e,reject:t})})},[])}}var Se=1500,Ce=12e4,we=2,Te=e=>new Promise(t=>setTimeout(t,e));function Ee(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(`
|
|
30
|
-
`).trim();if(e)return e}return(n.content??``).trim()}return``}function De(){let[e,n]=(0,H.useState)({status:`idle`,claims:[],suggestions:[]}),r=(0,H.useRef)(0),i=(0,H.useRef)(null),a=(0,H.useCallback)(({awaitAssistantId:e,subject:a,conversationTitle:o})=>{let s=JSON.stringify(a);if(i.current===s)return;i.current=s;let c=r.current+1;r.current=c;let l=()=>r.current!==c;n({status:`running`,claims:[],suggestions:[]}),(async()=>{try{let t=await e();if(l())return;let r=await y({path:{assistant_id:t},body:{conversationType:`standard`,...o?{title:o}:{}},throwOnError:!1});if(l())return;let i=r.data?.id;if(!r.response?.ok||!i){n(e=>({...e,status:`error`}));return}let s={conversationId:i,content:he(a),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(s.clientTimezone=e)}catch{}let c=await x({path:{assistant_id:t},body:s,throwOnError:!1});if(l())return;if(!c.response?.ok){n(e=>({...e,status:`error`}));return}let u=Date.now()+Ce,d=``,f=0;for(;Date.now()<u;){if(await Te(Se),l())return;let e=await b({path:{assistant_id:t},query:{conversationId:i},throwOnError:!1});if(l())return;let r=Ee(e.data?.messages??[]);if(r){let{claims:e,suggestions:t}=oe(r);if(n({status:`running`,claims:e,suggestions:t}),f=r===d?f+1:0,d=r,f>=we)break}}if(l())return;n(e=>({...e,status:`done`}))}catch(e){if(l())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}})()},[]);return{...e,start:a}}var U=o(),Oe={x:.5,y:.4},W=[-8,6,9,0,7,-6,5,0,-7,4];function ke(e){return W[e%W.length]??0}function Ae(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function G(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function je(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}]}function Me(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 Ne(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Pe({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=Ne(),u=F(),d=Ae(c,l),f=d/2,p=d/2,m=G(c,l)/d,h=G(c,l),g=(0,H.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),_=Oe.x*c,v=Oe.y*l,y=_-f,b=v-f,x=(0,H.useMemo)(()=>je(c,l,p),[c,l,p]);return(0,U.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-0 overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:h*.62,height:16,left:_-h*.31,top:v+h*.4}}),t.map((t,r)=>{let p=r===n,h=!u&&i?.char===r,S=!u&&a?.char===r;if(h){let n=x[i.fromSlot],a=Me(n,_,v,c,l);return(0,U.jsx)(P.div,{className:`absolute left-0 top-0`,style:{width:d,height:d},initial:!1,animate:{x:[n.x-f,a.x-f,a.x-f,y,y,y],y:[n.y-f,a.y-f,a.y-f,b,b,b],scale:[1,1,1,m*.7,m*1.08,m],opacity:[1,1,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,U.jsx)(z,{components:e,traits:t,size:d})},r)}if(S){let n=x[a.toSlot],i=Me(n,_,v,c,l);return(0,U.jsx)(P.div,{className:`absolute left-0 top-0`,style:{width:d,height:d},initial:!1,animate:{x:[y,y,i.x-f,i.x-f,n.x-f,n.x-f],y:[b,b,i.y-f,i.y-f,n.y-f,n.y-f],scale:[m,m*.6,1,1,1.1,1],opacity:[1,0,0,1,1,1]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,U.jsx)(`div`,{style:{transform:`rotate(${ke(a.toSlot)}deg)`},children:(0,U.jsx)(z,{components:e,traits:t,size:d,breathe:!1})})},r)}let C=p?{x:_,y:v}:x[g.get(r)??0];return(0,U.jsx)(P.div,{className:`absolute left-0 top-0 ${p?``:`pointer-events-auto cursor-pointer`}`,style:{width:d,height:d},initial:!1,animate:{x:C.x-f,y:C.y-f,scale:p?m:1,opacity:1},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:p?void 0:()=>s(r),children:(0,U.jsx)(`div`,{style:{transform:p?void 0:`rotate(${ke(g.get(r)??0)}deg)`},children:(0,U.jsx)(z,{components:e,traits:t,size:d,breathe:p})})},r)})]})}var Fe=[{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`},{bodyShape:`star`,eyeStyle:`goofy`,color:`orange`},{bodyShape:`blob`,eyeStyle:`goofy`,color:`pink`},{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},{bodyShape:`urchin`,eyeStyle:`curious`,color:`pink`},{bodyShape:`burst`,eyeStyle:`angry`,color:`orange`},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`green`},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`},{bodyShape:`star`,eyeStyle:`dazed`,color:`teal`}],K=d(u((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:Fe,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 Ie(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Le(){let e=L(),t=K.use.characters(),n=K.use.ensureGenerated(),r=F(),{w:i,h:a}=Ie();(0,H.useEffect)(()=>{e&&n(e)},[e,n]);let o=Ae(i,a),s=(0,H.useMemo)(()=>je(i,a,o/2),[i,a,o]);return!e||t.length===0?null:(0,U.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,a=s[i];if(!a)return null;let c=W[i%W.length]??0;return(0,U.jsx)(`div`,{className:`absolute`,style:{left:a.x-o/2,top:a.y-o/2,width:o,height:o,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,U.jsx)(`div`,{style:{transform:`rotate(${c}deg)`},children:(0,U.jsx)(z,{components:e,traits:t,size:o,breathe:!1})})},n)})})}var Re=s(`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)]`),ze=s(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`);function q(e){return e.trim().toLowerCase()}function Be(e,t,n=[],r=8){let i=q(t),a=new Set(n.map(q)),o=[];for(let t of e)if(!a.has(q(t))&&((i.length===0||q(t).includes(i))&&o.push(t),o.length>=r))break;return o}function Ve({id:e,items:t,highlighted:n,onPick:r,onHover:i}){return(0,U.jsx)(`ul`,{id:e,role:`listbox`,className:s(`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,a)=>(0,U.jsx)(`li`,{id:`${e}-opt-${a}`,role:`option`,"aria-selected":a===n,onMouseDown:e=>{e.preventDefault(),r(t)},onMouseEnter:()=>i(a),className:s(`cursor-pointer rounded-md px-2.5 py-1.5 text-body-medium-lighter`,`text-[var(--content-default)]`,a===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t},t))})}function He({htmlFor:e,children:t}){return(0,U.jsx)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:t})}function Ue(e,t){(0,H.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function We({label:e,placeholder:t,value:n,onChange:r,suggestions:i,autoFocus:a}){let o=(0,H.useId)(),c=`ac-${o}`,l=`ac-list-${o}`,u=(0,H.useRef)(null),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(-1),h=(0,H.useMemo)(()=>Be(i,n),[i,n]);Ue(u,()=>f(!1)),(0,H.useEffect)(()=>{m(e=>e>=h.length?h.length-1:e)},[h.length]);let g=d&&h.length>0;function _(e){r(e),f(!1),m(-1)}function v(e){e.key===`ArrowDown`?(e.preventDefault(),f(!0),m(e=>Math.min(e+1,h.length-1))):e.key===`ArrowUp`?(e.preventDefault(),m(e=>Math.max(e-1,0))):e.key===`Enter`&&g&&p>=0?(e.preventDefault(),_(h[p])):e.key===`Escape`&&f(!1)}return(0,U.jsxs)(`div`,{ref:u,className:`relative flex flex-col gap-1.5`,children:[(0,U.jsx)(He,{htmlFor:c,children:e}),(0,U.jsx)(`div`,{className:s(Re,`h-9`),children:(0,U.jsx)(`input`,{id:c,role:`combobox`,"aria-expanded":g,"aria-controls":l,"aria-autocomplete":`list`,"aria-activedescendant":p>=0?`${l}-opt-${p}`:void 0,autoComplete:`off`,autoFocus:a,className:ze,placeholder:t,value:n,onChange:e=>{r(e.target.value),f(!0)},onFocus:()=>f(!0),onKeyDown:v})}),g&&(0,U.jsx)(Ve,{id:l,items:h,highlighted:p,onPick:_,onHover:m})]})}function Ge({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,H.useId)(),o=`tac-${a}`,l=`tac-list-${a}`,u=(0,H.useRef)(null),[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(-1),_=(0,H.useMemo)(()=>Be(i,d,n),[i,d,n]);Ue(u,()=>m(!1)),(0,H.useEffect)(()=>{g(e=>e>=_.length?_.length-1:e)},[_.length]);let v=p&&_.length>0;function y(e){let t=e.trim();t&&(n.some(e=>q(e)===q(t))||r([...n,t]),f(``),g(-1))}function b(e){r(n.filter(t=>t!==e))}function x(e){e.key===`ArrowDown`?(e.preventDefault(),m(!0),g(e=>Math.min(e+1,_.length-1))):e.key===`ArrowUp`?(e.preventDefault(),g(e=>Math.max(e-1,0))):e.key===`Enter`?v&&h>=0?(e.preventDefault(),y(_[h])):d.trim()&&(e.preventDefault(),y(d)):e.key===`,`?(e.preventDefault(),y(d)):e.key===`Backspace`&&d.length===0&&n.length>0?b(n[n.length-1]):e.key===`Escape`&&m(!1)}return(0,U.jsxs)(`div`,{ref:u,className:`relative flex flex-col gap-1.5`,children:[(0,U.jsx)(He,{htmlFor:o,children:e}),(0,U.jsxs)(`div`,{className:s(Re,`min-h-9 flex-wrap py-1.5`),children:[n.map(e=>(0,U.jsx)(c,{onRemove:()=>b(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,U.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":v,"aria-controls":l,"aria-autocomplete":`list`,"aria-activedescendant":h>=0?`${l}-opt-${h}`:void 0,autoComplete:`off`,className:s(ze,`h-6 w-24`),placeholder:n.length===0?t:``,value:d,onChange:e=>{f(e.target.value),m(!0)},onFocus:()=>m(!0),onKeyDown:x})]}),v&&(0,U.jsx)(Ve,{id:l,items:_,highlighted:h,onPick:y,onHover:g})]})}var Ke=`Software Engineer.Product Manager.Product Designer.Founder / CEO.Engineering Manager.Data Scientist.Marketing Manager.Growth Marketer.Content Writer.Sales Representative.Account Executive.Customer Success Manager.Operations Manager.Project Manager.Program Manager.Business Analyst.Data Engineer.Machine Learning Engineer.DevOps Engineer.Solutions Architect.UX Researcher.Graphic Designer.Recruiter.HR Manager.Financial Analyst.Accountant.Consultant.Investor / VC.Lawyer.Teacher.Professor.Researcher.Doctor / Physician.Nurse.Real Estate Agent.Executive Assistant.Entrepreneur.Freelancer.Student`.split(`.`),qe=`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 J(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Je({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[i,a]=(0,H.useState)(e),[o,s]=(0,H.useState)(t),[c,u]=(0,H.useState)(``),[d,f]=(0,H.useState)([]),p=i.trim().length>0&&c.trim().length>0;function m(){p&&n({firstName:i,lastName:o,role:c,hobbies:d})}return(0,U.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,U.jsxs)(ae,{showCreatureFooter:!1,children:[(0,U.jsx)(Le,{}),(0,U.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(),m()},children:[(0,U.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:J(.05),children:`Let's start with you.`}),(0,U.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:J(.12),children:`A few details so I can get to know you.`}),(0,U.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,U.jsx)(`div`,{style:J(.2,40),children:(0,U.jsx)(l,{label:`What should I call you?`,placeholder:`Your name`,value:i,onChange:e=>a(e.target.value),autoFocus:!0,fullWidth:!0})}),(0,U.jsx)(`div`,{style:J(.27,30),children:(0,U.jsx)(l,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),fullWidth:!0})}),(0,U.jsx)(`div`,{style:J(.34,20),children:(0,U.jsx)(We,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:u,suggestions:Ke})}),(0,U.jsx)(`div`,{style:J(.41,10),children:(0,U.jsx)(Ge,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:d,onChange:f,suggestions:qe})})]}),(0,U.jsx)(`div`,{className:`mt-10 w-full`,style:J(.5),children:(0,U.jsx)(r,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,U.jsx)(B,{size:16}),fullWidth:!0,disabled:!p,className:`h-11 text-base`,children:`Continue`})})]})]})})}var Ye=`#1A1A1A`,Xe=`#FFFFFF`;function Ze(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 Qe(e){let t=Ze(e)>.6;return{bg:e,isLight:t,fg:t?Ye:Xe,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 Y(){let e=L(),t=K.use.characters(),n=K.use.selectedIndex();return(0,H.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return Qe(i??`var(--surface-base)`)},[e,t,n])}function X({onBack:e,onNext:t,tone:n}){let r=Y(),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,U.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex 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,U.jsx)(p,{className:`h-5 w-5`})}),t?(0,U.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex 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,U.jsx)(m,{className:`h-5 w-5`})}):null]})}var $e=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function et(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function tt({onContinue:e,onBack:t,onForward:n}){let i=L(),a=K.use.characters(),o=K.use.ensureGenerated(),s=K.use.selectedIndex(),c=K.use.setSelectedIndex();(0,H.useEffect)(()=>{i&&o(i)},[i,o]);let l=a.length,[u,d]=(0,H.useState)(null),[p,m]=(0,H.useState)(``),[h,_]=(0,H.useState)(!1),v=(0,H.useRef)(null),[y,b]=(0,H.useState)(null);(0,H.useEffect)(()=>{l>0&&u===null&&d(et(l,s))},[l,s,u]),(0,H.useEffect)(()=>{u&&c(u.centerChar)},[u,c]);let x=u?.centerChar;(0,H.useEffect)(()=>{x!=null&&m($e[x%$e.length])},[x]),(0,H.useEffect)(()=>{h&&(v.current?.focus(),v.current?.select())},[h]);function S(e){if(!u||e===u.centerChar)return;let t=u.edgeOrder.indexOf(e);if(t<0)return;let n=[...u.edgeOrder];n[t]=u.centerChar,b({entering:{char:e,fromSlot:t},exiting:{char:u.centerChar,toSlot:t}}),d({centerChar:e,edgeOrder:n})}let C=()=>u&&S((u.centerChar+1)%l),w=()=>u&&S((u.centerChar-1+l)%l),T=(0,H.useMemo)(()=>u?a[u.centerChar]:void 0,[u,a]),E=!!i&&!!u&&!!T;function D(){T&&e({traits:T,name:p.trim()})}let O=`pointer-events-auto z-10 flex 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,U.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:[E&&(0,U.jsx)(Pe,{components:i,characters:a,centerChar:u.centerChar,edgeOrder:u.edgeOrder,entering:y?.entering??null,exiting:y?.exiting??null,onEnterComplete:e=>b(t=>t?.entering.char===e?null:t),onSelectChar:S}),(0,U.jsx)(X,{tone:`light`,onBack:t,onNext:n?D:void 0}),(0,U.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,U.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:w,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${O}`,children:(0,U.jsx)(f,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:C,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${O}`,children:(0,U.jsx)(B,{className:`h-4 w-4`})}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[h?(0,U.jsx)(`input`,{ref:v,value:p,onChange:e=>m(e.target.value),onBlur:()=>_(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_(!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,U.jsxs)(`button`,{type:`button`,onClick:()=>_(!0),"aria-label":`Edit name`,className:`flex items-center gap-2.5`,children:[(0,U.jsx)(`span`,{className:`text-3xl font-medium ${p?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:p||`Name your assistant`}),(0,U.jsx)(g,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,U.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,U.jsx)(B,{size:16}),disabled:!E,onClick:D,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})}function nt(e){let t=1/0,n=1/0,r=-1/0,i=-1/0,a=e.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)?.map(Number)??[];for(let e=0;e+1<a.length;e+=2){let o=a[e],s=a[e+1];o<t&&(t=o),s<n&&(n=s),o>r&&(r=o),s>i&&(i=s)}return{x:t,y:n,w:r-t,h:i-n}}function rt(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 it=.25,at=.46,ot=.3,st=.85,ct=40,lt=14,ut=8;function dt(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function ft({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0}){let r=L(),i=K.use.characters(),a=K.use.selectedIndex(),o=F(),{w:s,h:c}=dt(),[l,u]=(0,H.useState)({x:0,y:0});(0,H.useEffect)(()=>{if(o)return;let e=e=>{u({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[o]);let d=e&&!o,f=me();(0,H.useEffect)(()=>{n>0&&!o&&f.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,o,f]);let[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!e);(0,H.useEffect)(()=>{if(o||!h)return;let e=!1,t,n=n=>{e||(m(!0),t=setTimeout(()=>{e||(m(!1),t=setTimeout(n,140))},140))},r=()=>{t=setTimeout(()=>n(r),2500+Math.random()*4e3)};return n(()=>n(r)),()=>{e=!0,clearTimeout(t)}},[o,h]);let _=i.length>0?i[a]:void 0,v=(0,H.useMemo)(()=>{if(!r||!_)return null;let e=r.eyeStyles.find(e=>e.id===_.eyeStyle);return e?{paths:e.paths,bbox:rt(e.paths.map(e=>nt(e.svgPath)))}:null},[r,_]);if(!v)return null;let y=s*st,b=Math.min(Math.min(s,c)*ot,y*v.bbox.h/v.bbox.w),x=b*v.bbox.w/v.bbox.h,S=(s-x)/2,C=c-(1-it)*b,w=ct/100*c-(C+b/2),T=(at-it)*b,E=v.bbox.x+v.bbox.w/2,D=v.bbox.y+v.bbox.h/2;return(0,U.jsx)(P.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:S,top:C,width:x,height:b,transformOrigin:`center`},initial:d?{y:w,scale:.35}:!1,animate:d?{y:[w,T,0],scale:[.35,1,1]}:{y:0,scale:1},transition:d?{duration:1,delay:t,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>g(!0),children:(0,U.jsx)(P.div,{animate:f,children:(0,U.jsx)(`div`,{style:{transform:`translate(${l.x*lt}px, ${l.y*ut}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,U.jsx)(`svg`,{viewBox:`${v.bbox.x} ${v.bbox.y} ${v.bbox.w} ${v.bbox.h}`,width:x,height:b,style:{overflow:`visible`,display:`block`},children:(0,U.jsx)(`g`,{style:{transform:p?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${E}px ${D}px`,transition:`transform 0.14s ease-in-out`},children:v.paths.map((e,t)=>(0,U.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}function pt(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)}`}var mt=200,ht=40;function gt(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function _t({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:i}){let a=L(),o=K.use.characters(),s=K.use.selectedIndex(),c=F(),{w:l,h:u}=gt(),d=Y(),f=o.length>0?o[s]:void 0,p=(0,H.useMemo)(()=>{if(!a||!f)return null;let e=a.bodyShapes.find(e=>e.id===f.bodyShape),t=a.colors.find(e=>e.id===f.color);return!e||!t?null:{body:e,color:t.hex}},[a,f]),m=e.trim()?`Hey, ${e.trim()}!`:`Hey!`,h=t?.trim()?`I’m ${t.trim()}, your new AI assistant`:`I’m your new AI assistant`;if(!p)return(0,U.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,style:{backgroundColor:`var(--surface-base)`}});let g=pt(p.color,.6),_=1.25*Math.max(l,u),v=_*p.body.viewBox.height/p.body.viewBox.width,y=(l-_)/2,b=(u-v)/2,x=mt/_,S=(ht/100-.5)*u;return(0,U.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:[(0,U.jsx)(P.div,{className:`absolute inset-0 z-0`,style:{backgroundColor:p.color},initial:c?!1:{opacity:0},animate:{opacity:1},transition:c?{duration:0}:{duration:.6,delay:.35}}),(0,U.jsx)(P.svg,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,viewBox:`0 0 ${p.body.viewBox.width} ${p.body.viewBox.height}`,width:_,height:v,style:{left:y,top:b,transformOrigin:`center`},initial:c?!1:{scale:x,y:S},animate:{scale:1,y:0},transition:c?{duration:0}:{type:`spring`,stiffness:78,damping:18,mass:1},children:(0,U.jsx)(`path`,{d:p.body.svgPath,fill:p.color})}),(0,U.jsx)(ft,{entrance:!0}),(0,U.jsx)(P.div,{initial:c?!1:{opacity:0},animate:{opacity:1},transition:c?{duration:0}:{duration:.4,delay:1},children:(0,U.jsx)(X,{onBack:r,onNext:i})}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[30%] z-10 flex -translate-x-1/2 flex-col items-center gap-8`,children:[(0,U.jsxs)(P.h1,{className:`text-center leading-[1.05]`,style:{fontFamily:`var(--font-serif)`},initial:c?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,U.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:g},children:m}),(0,U.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:d.fg},children:h})]}),(0,U.jsxs)(P.button,{type:`button`,onClick:n,className:`flex h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] bg-black text-body-medium-default text-white transition-transform duration-150 active:scale-[0.97]`,initial:c?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:c?{duration:0}:{duration:.4,delay:1.15},children:[`Continue`,(0,U.jsx)(B,{className:`h-4 w-4`})]})]})]})}function vt(e,{speed:t,enabled:n}){let[r,i]=(0,H.useState)(n?0:e.length);return(0,H.useEffect)(()=>{if(!n){i(e.length);return}i(0);let r=0,a=setInterval(()=>{r+=1,i(r),r>=e.length&&clearInterval(a)},t);return()=>clearInterval(a)},[e,t,n]),e.slice(0,r)}var yt=`You’ve seen AI that answers.`,bt=`I’m different...`;function xt({onDone:e,onBack:t,onForward:n}){let r=Y(),i=F(),a=vt(yt,{speed:55,enabled:!i}),o=a.length>=28,[s,c]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{if(i){if(!o)return;let t=setTimeout(e,2e3);return()=>clearTimeout(t)}if(!s)return;let t=setTimeout(e,1400);return()=>clearTimeout(t)},[i,o,s,e]),(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:r.fg},children:[(0,U.jsx)(X,{onBack:t,onNext:n}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[32%] w-full max-w-3xl -translate-x-1/2 px-6 text-center`,children:[(0,U.jsxs)(`h1`,{className:`text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.1]`,style:{fontFamily:`var(--font-serif)`,color:r.fgMuted},children:[a,!o&&(0,U.jsx)(`span`,{className:`ml-1 inline-block animate-pulse`,"aria-hidden":`true`,children:`▍`})]}),o&&(0,U.jsx)(P.h1,{className:`mt-2 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.1]`,style:{fontFamily:`var(--font-serif)`,color:r.fg},initial:i?!1:{opacity:0,x:140,scale:.85},animate:{opacity:1,x:0,scale:1},transition:i?{duration:0}:{type:`spring`,stiffness:320,damping:17,delay:1.3},onAnimationComplete:()=>c(!0),children:bt})]})]})}var St=[`The smarter my instincts get`,`The faster I can take things off your plate`];function Ct({onContinue:e,onBack:t,onForward:n}){let r=Y(),i=F();return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:r.fg},children:[(0,U.jsx)(X,{onBack:t,onNext:n}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[24%] flex w-full max-w-4xl -translate-x-1/2 flex-col items-center gap-10 px-6 text-center`,children:[(0,U.jsx)(P.h1,{className:`whitespace-nowrap text-[clamp(2.25rem,5.5vw,4.25rem)] leading-[1.1]`,style:{fontFamily:`var(--font-serif)`},initial:i?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.5},children:`The more we collaborate,`}),(0,U.jsx)(`ul`,{className:`flex w-full flex-col gap-4 text-center`,children:St.map((e,t)=>(0,U.jsxs)(P.li,{className:`text-[clamp(1.75rem,3.4vw,2.75rem)] leading-snug`,style:{fontFamily:`var(--font-serif)`},initial:i?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.5,delay:.5+t*.55},children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`mr-3`,style:{color:r.fgMuted},children:`•`}),e]},e))}),(0,U.jsxs)(P.button,{type:`button`,onClick:e,className:`flex h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] bg-black text-body-medium-default text-white transition-transform duration-150 active:scale-[0.97]`,initial:i?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.4,delay:.6+St.length*.55},children:[`Continue`,(0,U.jsx)(B,{className:`h-4 w-4`})]})]})]})}var Z=24;function wt({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cv-${e}`,a=`cs-${e}`;return(0,U.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,U.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,U.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,U.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,U.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,U.jsx)(`stop`,{offset:`82%`,stopColor:`#000000`,stopOpacity:`0`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#9A6E0E`,stopOpacity:`0.22`})]}),(0,U.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,U.jsxs)(`radialGradient`,{id:a,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,U.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,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${i})`}),(0,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,U.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,dominantBaseline:`central`,children:[(0,U.jsx)(`text`,{x:`50`,y:`52`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,U.jsx)(`text`,{x:`50`,y:`52`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,U.jsx)(`text`,{x:`50`,y:`52`,fill:`#F4C12A`,children:`$`})]}),(0,U.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,U.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${a})`})]})}function Tt({size:e,depthRatio:t=.22,tiltX:n=8,tiltY:r=-22,shadow:i=!0,spinning:a=!1,className:o}){let s=e*t,c=s/(Z-1);return(0,U.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[i&&(0,U.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,U.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,U.jsxs)(P.div,{className:o,style:{width:e,height:e,position:`relative`,transformStyle:`preserve-3d`},initial:!1,animate:{rotateX:n,rotateY:a?[r,r+360,r+760,r+1180]:r},transition:a?{duration:.95,times:[0,.32,.62,1],ease:`easeInOut`}:{duration:0},children:[Array.from({length:Z},(e,t)=>{let n=t/(Z-1),r=44+(1-Math.abs(n-.5)*2)*22;return(0,U.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`50%`,background:`linear-gradient(to bottom, hsl(45 92% ${Math.min(r+10,82)}%), hsl(42 90% ${r-8}%))`,transform:`translateZ(${-s/2+t*c}px)`}},t)}),(0,U.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(${s/2}px)`},children:(0,U.jsx)(wt,{idSuffix:`front`})}),(0,U.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(${-s/2}px) rotateY(180deg)`},children:(0,U.jsx)(wt,{idSuffix:`back`})})]})})]})}var Et={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 Dt(e,t){let n=Et[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var Ot=new Set([`orange`,`pink`,`red`]);function kt(e,t){return Ot.has(e)&&Ot.has(t)}function At(e,t,n){let r=Dt(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>kt(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var jt=.3,Mt=.95,Nt=5e3;function Pt({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=F(),a=Y(),o=L(),s=K.use.characters(),c=K.use.selectedIndex(),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),p=(0,H.useMemo)(()=>{let e=s.length>0?s[c]:void 0;return{bodyShape:`blob`,eyeStyle:`quirky`,color:(o&&e?At(e.color,o.colors.map(e=>e.id),1)[0]:void 0)??`yellow`}},[o,s,c]);(0,H.useEffect)(()=>{if(l)return;let e=window.setTimeout(()=>f(!0),Nt);return()=>window.clearTimeout(e)},[l]);function m(){if(!l){if(u(!0),f(!1),i){e();return}window.setTimeout(t,jt*1e3)}}let h=typeof window>`u`?800:window.innerHeight,g=h*.42,_=-h*.08,v=h*.9;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,U.jsx)(X,{onBack:n,onNext:r}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex -translate-x-1/2 flex-col items-center gap-3 px-6 text-center`,children:[(0,U.jsx)(`h1`,{className:`max-w-[640px] text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:`Here’s 10 free credits to get started!`}),(0,U.jsx)(`div`,{className:`mt-10 flex flex-col items-center gap-4`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(P.button,{type:`button`,onClick:m,disabled:l,"aria-label":`Claim your 10 free credits`,className:`rounded-full outline-none focus-visible:ring-2 focus-visible:ring-white/70 disabled:cursor-default enabled:cursor-pointer`,animate:l&&!i?{y:[0,g,_,v],scale:[1,1,1,.2],opacity:[1,1,1,0]}:i?{}:{y:[0,-9,0]},transition:l?{duration:Mt,times:[0,jt/Mt,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]}:{duration:2.2,repeat:1/0,ease:`easeInOut`},onAnimationComplete:()=>{l&&e()},children:(0,U.jsx)(Tt,{size:88,spinning:l&&!i})}),d&&!l&&(0,U.jsxs)(P.div,{className:`pointer-events-none absolute left-full top-1/2 ml-20 flex -translate-y-1/2 flex-col items-center`,initial:i?!1:{opacity:0,x:120},animate:{opacity:1,x:0},transition:i?{duration:0}:{type:`spring`,stiffness:220,damping:22},children:[(0,U.jsxs)(`div`,{className:`relative mb-1.5 whitespace-nowrap rounded-2xl bg-white px-3.5 py-1.5 text-[15px] font-medium text-[#1A1A1A] shadow-md`,children:[`click it!`,(0,U.jsx)(`span`,{className:`absolute -bottom-1 left-1/2 h-3 w-3 -translate-x-1/2 rotate-45 bg-white`})]}),o&&(0,U.jsx)(z,{components:o,traits:p,size:76})]})]})})]})]})}function Ft({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a}){let o=Y(),{handleConnect:s,oauthInProgress:c}=se({assistantId:e??``,onConnect:n}),l=!e||!t||c;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,U.jsx)(X,{onBack:i,onNext:a}),(0,U.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,U.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:`I’ll also check in with you`}),(0,U.jsx)(`p`,{className:`text-[16px]`,style:{color:o.fgMuted},children:`I’ll add a quick check-in to your calendar to follow up tomorrow.`}),(0,U.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-3`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:s,disabled:l,className:`flex h-11 w-full items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97] disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):`Add to Google Calendar`}),(0,U.jsx)(`button`,{type:`button`,onClick:r,disabled:c,className:`text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:o.fgMuted},children:`Skip for now`})]})]})]})}function It(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Lt(){let e=L(),t=K.use.characters(),n=K.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Q({size:e=48}){let{components:t,chosen:n}=Lt();return!t||!n?(0,U.jsx)(`div`,{style:{width:e,height:e}}):(0,U.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,U.jsx)(z,{components:t,traits:n,size:e})})}var $=48;function Rt({onDone:e,onBack:t,onForward:n}){let{components:r,chosen:i}=Lt(),a=F(),{w:o,h:s}=It();(0,H.useEffect)(()=>{let t=setTimeout(e,2600);return()=>clearTimeout(t)},[e]);let c=o/2-170,l=c+$/2,u=s*.26+$/2,d=1.3*Math.max(o,s)/$,f=o/2-l,p=s*.88-u,m=s*.05;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,U.jsx)(X,{onBack:t,onNext:n,tone:`light`}),(0,U.jsxs)(`div`,{className:`absolute flex items-center gap-4`,style:{left:c,top:s*.26},children:[(0,U.jsx)(`div`,{className:`relative`,style:{width:$,height:$},children:r&&i&&(0,U.jsx)(P.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:a?!1:{scale:d,x:f,y:p},animate:{x:[f,f,0,0],y:[p,p+m,0,0],scale:[d,d,1.07,1]},transition:a?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,U.jsx)(z,{components:r,traits:i,size:$})})}),(0,U.jsx)(P.span,{className:`whitespace-nowrap text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:a?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:a?{duration:0}:{duration:.4,delay:.9},children:`Meeting Created!`})]})]})}var zt=[`Searching the web to get to know you…`,`Reading public profiles…`,`Connecting the dots…`,`Almost there…`];function Bt({onDone:e,onBack:t,onAdvance:n,onForward:r}){let i=Y(),[a,o]=(0,H.useState)(0);return(0,H.useEffect)(()=>{if(n?.(a),a>=zt.length-1){let t=setTimeout(e,1500);return()=>clearTimeout(t)}let t=setTimeout(()=>o(e=>e+1),1500);return()=>clearTimeout(t)},[a,e,n]),(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:i.fg},children:[(0,U.jsx)(X,{onBack:t,onNext:r}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-full max-w-xl -translate-x-1/2 items-center gap-3 px-6`,children:[(0,U.jsx)(Q,{}),(0,U.jsx)(R,{mode:`wait`,children:(0,U.jsx)(P.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:zt[a]},a)})]})]})}function Vt({claims:e,loading:t,onContinue:n,onBack:r,onForward:i}){let a=Y(),o=F(),[s,c]=(0,H.useState)(()=>new Set),l=e.filter(e=>!s.has(e.claim)),u=l.length>0;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,U.jsx)(X,{onBack:r,onNext:i}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Q,{}),(0,U.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Alright, this is what I got:`})]}),(0,U.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:a.fgMuted},children:u?`Feel free to remove anything that’s not true`:t?`Still putting this together…`:`I didn’t turn up much — we can fill it in as we chat.`}),(0,U.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,U.jsx)(R,{children:l.map(e=>(0,U.jsxs)(P.div,{layout:!0,initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},exit:o?void 0:{opacity:0,scale:.95},className:`flex items-center justify-between gap-3 rounded-2xl px-5 py-4 text-[15px]`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,U.jsx)(`span`,{children:e.claim}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Remove "${e.claim}"`,onClick:()=>c(t=>new Set(t).add(e.claim)),className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full transition-opacity hover:opacity-100`,style:{color:a.fgMuted},children:(0,U.jsx)(v,{className:`h-4 w-4`})})]},e.claim))})}),(0,U.jsxs)(`button`,{type:`button`,onClick:n,className:`mt-8 flex h-11 w-[200px] 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:[`Continue`,(0,U.jsx)(B,{className:`h-4 w-4`})]})]})]})}var Ht=[{suggestion:`I'll build you a live dashboard to track what matters to you`,prompt:`Build me a live dashboard to track what matters to me.`},{suggestion:`I'll send a weekly briefing on news in your space`,prompt:`Set up a weekly briefing on news in my space.`},{suggestion:`I'll help you get on top of your week`,prompt:`Help me get on top of my week.`},{suggestion:`I'll draft something from a few rough notes`,prompt:`Draft something from a few rough notes I'll give you.`}];function Ut({suggestions:e,loading:t,onSuggestionClick:n,onBack:r,onForward:i}){let a=Y(),o=F(),s=e.length>0?e:t?[]:Ht;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,U.jsx)(X,{onBack:r,onNext:i}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Q,{}),(0,U.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here’s what we could do first`})]}),(0,U.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:a.fgMuted},children:s.length>0?`Pick one to jump in — or start your own thing.`:`Putting together a few ideas…`}),(0,U.jsx)(`div`,{className:`flex flex-col gap-3`,children:s.map((e,t)=>(0,U.jsxs)(P.button,{type:`button`,onClick:()=>n(e.prompt),initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:o?{duration:0}:{duration:.3,delay:t*.06},className:`flex items-center gap-3 rounded-2xl px-5 py-4 text-left text-[15px] transition-transform duration-150 hover:scale-[1.01] active:scale-[0.99]`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,U.jsx)(_,{className:`h-4 w-4 shrink-0`,style:{color:a.fgMuted}}),(0,U.jsx)(`span`,{children:e.suggestion})]},`${t}-${e.suggestion}`))})]})]})}function Wt(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var Gt=[{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:0,base:300,pos:e=>({left:`6%`,top:-e*.46})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:1,base:260,pos:e=>({right:`6%`,top:-e*.46})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:240,pos:e=>({left:`42%`,top:-e*.52})},{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.34,top:`42%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.34,top:`54%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:220,pos:e=>({right:-e*.26,bottom:-e*.18})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:220,pos:e=>({left:-e*.2,bottom:-e*.22})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:250,pos:e=>({left:`24%`,top:-e*.5})}],Kt=`#17191C`;function qt({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0}){let i=L(),a=K.use.characters(),o=K.use.selectedIndex(),s=F(),{w:c}=Wt(),l=Math.max(.42,Math.min(c/1100,1)),u=a.length>0?a[o]:void 0,{bg:d,peekColors:f}=(0,H.useMemo)(()=>!i||!u?{bg:`var(--surface-base)`,peekColors:[]}:{bg:i.colors.find(e=>e.id===u.color)?.hex??`var(--surface-base)`,peekColors:At(u.color,i.colors.map(e=>e.id),3)},[i,u]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(P.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?Kt:d},transition:s?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,U.jsx)(ft,{bumpNonce:t}),i&&(0,U.jsx)(R,{children:Gt.slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*l);return(0,U.jsx)(P.div,{"aria-hidden":`true`,className:`pointer-events-none fixed z-[1]`,style:{...e.pos(n),width:n,height:n},initial:s?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:s?void 0:{scale:0,opacity:0},transition:s?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,U.jsx)(z,{components:i,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:f[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}function Jt(){let e=i(),t=E.use.user(),n=I.use.enterFocus(),r=I.use.exitFocus(),o=I.use.setPendingAvatarTraits(),s=ne.use.researchOnboarding(),c=ne.use.hydrated(),[l,u]=(0,H.useState)(`form`),[d,f]=(0,H.useState)([]);function p(e){f([]),u(e)}function m(e){f(e=>[...e,l]),u(e)}function h(){let e=d[d.length-1];e&&(f(e=>e.slice(0,-1)),u(e))}let g=d.length>0?h:void 0,[_,v]=(0,H.useState)(null),[y,b]=(0,H.useState)(null),[x,S]=(0,H.useState)(0),[w,T]=(0,H.useState)(0),{start:D,ready:O,assistantId:k,awaitReady:ee}=xe(),A=De(),j=A.status===`idle`||A.status===`running`;(0,H.useEffect)(()=>{r(),s&&c&&D()},[r,D,s,c]);function re(t,r,i){let{firstName:a,lastName:s,role:c,hobbies:l}=t,u=[a.trim(),s.trim()].filter(Boolean).join(` `),d=a.trim();ce({tools:[],tasks:[],tone:ue,...u?{userName:u}:{},...c.trim()?{occupation:c.trim()}:{},initialMessage:i??he({firstName:a,lastName:s,occupation:c,hobby:l.join(`, `)}),...i?{}:{title:d?`Getting to know ${d}`:`Getting to know you`},...r?.name?.trim()?{assistantName:r.name.trim()}:{}}),o(r?.traits??null),i||n(),C.markExpectingFirstMessage(),C.checkAssistant(k??void 0).finally(()=>{e(`${te.assistant}?onboarding=1`,{replace:!0})})}function M(e){v(e);let t=e.firstName.trim();A.start({awaitAssistantId:ee,subject:{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `)},conversationTitle:t?`Getting to know ${t}`:`Getting to know you`}),p(`face`)}function N(){k&&_&&le({assistantId:k,userName:[_.firstName.trim(),_.lastName.trim()].filter(Boolean).join(` `)||void 0,assistantName:y?.name?.trim()||void 0}),p(`meeting`)}if(!s)return c?(0,U.jsx)(a,{to:te.assistant,replace:!0}):null;let P=[`different`,`together`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`];if(P.includes(l)&&_){let e=[`meeting`,`looking`,`results`,`suggestions`].includes(l);return(0,U.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:[(0,U.jsx)(qt,{eyesBumpNonce:x,peekLevel:P.indexOf(l)+1+w,darkBg:e,showBottomEyes:!e}),l===`different`&&(0,U.jsx)(xt,{onDone:()=>p(`together`),onBack:()=>m(`intro`),onForward:g}),l===`together`&&(0,U.jsx)(Ct,{onContinue:()=>p(`integration`),onBack:()=>m(`different`),onForward:g}),l===`integration`&&(0,U.jsx)(Pt,{onClaim:()=>p(`letschat`),onBumpEyes:()=>S(e=>e+1),onBack:()=>m(`together`),onForward:g}),l===`letschat`&&(0,U.jsx)(Ft,{assistantId:k,assistantReady:O,onConnected:N,onSkip:()=>p(`looking`),onBack:()=>m(`integration`),onForward:g}),l===`meeting`&&(0,U.jsx)(Rt,{onDone:()=>p(`looking`),onBack:()=>m(`letschat`),onForward:g}),l===`looking`&&(0,U.jsx)(Bt,{onDone:()=>p(`results`),onBack:()=>m(`letschat`),onAdvance:e=>T(Math.min(e+1,4)),onForward:g}),l===`results`&&(0,U.jsx)(Vt,{claims:A.claims,loading:j,onContinue:()=>p(`suggestions`),onBack:()=>m(`looking`),onForward:g}),l===`suggestions`&&(0,U.jsx)(Ut,{suggestions:A.suggestions,loading:j,onSuggestionClick:e=>re(_,y,e),onBack:()=>m(`results`),onForward:g})]})}return l===`intro`&&_?(0,U.jsx)(_t,{firstName:_.firstName,assistantName:y?.name,onContinue:()=>p(`different`),onBack:()=>m(`face`),onForward:g}):l===`face`&&_?(0,U.jsx)(tt,{onContinue:e=>{b(e),p(`intro`)},onBack:()=>m(`form`),onForward:g}):(0,U.jsx)(Je,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:M})}export{Jt as ResearchOnboardingRoute};
|
|
30
|
+
`).trim();if(e)return e}return(n.content??``).trim()}return``}function De(){let[e,n]=(0,H.useState)({status:`idle`,claims:[],suggestions:[]}),r=(0,H.useRef)(0),i=(0,H.useRef)(null),a=(0,H.useCallback)(({awaitAssistantId:e,subject:a,conversationTitle:o})=>{let s=JSON.stringify(a);if(i.current===s)return;i.current=s;let c=r.current+1;r.current=c;let l=()=>r.current!==c;n({status:`running`,claims:[],suggestions:[]}),(async()=>{try{let t=await e();if(l())return;let r=await y({path:{assistant_id:t},body:{conversationType:`standard`,...o?{title:o}:{}},throwOnError:!1});if(l())return;let i=r.data?.id;if(!r.response?.ok||!i){n(e=>({...e,status:`error`}));return}let s={conversationId:i,content:he(a),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(s.clientTimezone=e)}catch{}let c=await x({path:{assistant_id:t},body:s,throwOnError:!1});if(l())return;if(!c.response?.ok){n(e=>({...e,status:`error`}));return}let u=Date.now()+Ce,d=``,f=0;for(;Date.now()<u;){if(await Te(Se),l())return;let e=await b({path:{assistant_id:t},query:{conversationId:i},throwOnError:!1});if(l())return;let r=Ee(e.data?.messages??[]);if(r){let{claims:e,suggestions:t}=oe(r);if(n({status:`running`,claims:e,suggestions:t}),f=r===d?f+1:0,d=r,f>=we)break}}if(l())return;n(e=>({...e,status:`done`}))}catch(e){if(l())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}})()},[]);return{...e,start:a}}var U=o(),Oe={x:.5,y:.4},W=[-8,6,9,0,7,-6,5,0,-7,4];function ke(e){return W[e%W.length]??0}function Ae(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function G(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function je(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}]}function Me(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 Ne(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Pe({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=Ne(),u=F(),d=Ae(c,l),f=d/2,p=d/2,m=G(c,l)/d,h=G(c,l),g=(0,H.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),_=Oe.x*c,v=Oe.y*l,y=_-f,b=v-f,x=(0,H.useMemo)(()=>je(c,l,p),[c,l,p]);return(0,U.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-0 overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:h*.62,height:16,left:_-h*.31,top:v+h*.4}}),t.map((t,r)=>{let p=r===n,h=!u&&i?.char===r,S=!u&&a?.char===r;if(h){let n=x[i.fromSlot],a=Me(n,_,v,c,l);return(0,U.jsx)(P.div,{className:`absolute left-0 top-0`,style:{width:d,height:d},initial:!1,animate:{x:[n.x-f,a.x-f,a.x-f,y,y,y],y:[n.y-f,a.y-f,a.y-f,b,b,b],scale:[1,1,1,m*.7,m*1.08,m],opacity:[1,1,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,U.jsx)(R,{components:e,traits:t,size:d})},r)}if(S){let n=x[a.toSlot],i=Me(n,_,v,c,l);return(0,U.jsx)(P.div,{className:`absolute left-0 top-0`,style:{width:d,height:d},initial:!1,animate:{x:[y,y,i.x-f,i.x-f,n.x-f,n.x-f],y:[b,b,i.y-f,i.y-f,n.y-f,n.y-f],scale:[m,m*.6,1,1,1.1,1],opacity:[1,0,0,1,1,1]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,U.jsx)(`div`,{style:{transform:`rotate(${ke(a.toSlot)}deg)`},children:(0,U.jsx)(R,{components:e,traits:t,size:d,breathe:!1})})},r)}let C=p?{x:_,y:v}:x[g.get(r)??0];return(0,U.jsx)(P.div,{className:`absolute left-0 top-0 ${p?``:`pointer-events-auto cursor-pointer`}`,style:{width:d,height:d},initial:!1,animate:{x:C.x-f,y:C.y-f,scale:p?m:1,opacity:1},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:p?void 0:()=>s(r),children:(0,U.jsx)(`div`,{style:{transform:p?void 0:`rotate(${ke(g.get(r)??0)}deg)`},children:(0,U.jsx)(R,{components:e,traits:t,size:d,breathe:p})})},r)})]})}var Fe=[{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`},{bodyShape:`star`,eyeStyle:`goofy`,color:`orange`},{bodyShape:`blob`,eyeStyle:`goofy`,color:`pink`},{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},{bodyShape:`urchin`,eyeStyle:`curious`,color:`pink`},{bodyShape:`burst`,eyeStyle:`angry`,color:`orange`},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`green`},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`},{bodyShape:`star`,eyeStyle:`dazed`,color:`teal`}],K=d(u((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:Fe,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 Ie(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Le(){let e=I(),t=K.use.characters(),n=K.use.ensureGenerated(),r=F(),{w:i,h:a}=Ie();(0,H.useEffect)(()=>{e&&n(e)},[e,n]);let o=Ae(i,a),s=(0,H.useMemo)(()=>je(i,a,o/2),[i,a,o]);return!e||t.length===0?null:(0,U.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,a=s[i];if(!a)return null;let c=W[i%W.length]??0;return(0,U.jsx)(`div`,{className:`absolute`,style:{left:a.x-o/2,top:a.y-o/2,width:o,height:o,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,U.jsx)(`div`,{style:{transform:`rotate(${c}deg)`},children:(0,U.jsx)(R,{components:e,traits:t,size:o,breathe:!1})})},n)})})}var Re=s(`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)]`),ze=s(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`);function q(e){return e.trim().toLowerCase()}function Be(e,t,n=[],r=8){let i=q(t),a=new Set(n.map(q)),o=[];for(let t of e)if(!a.has(q(t))&&((i.length===0||q(t).includes(i))&&o.push(t),o.length>=r))break;return o}function Ve({id:e,items:t,highlighted:n,onPick:r,onHover:i}){return(0,U.jsx)(`ul`,{id:e,role:`listbox`,className:s(`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,a)=>(0,U.jsx)(`li`,{id:`${e}-opt-${a}`,role:`option`,"aria-selected":a===n,onMouseDown:e=>{e.preventDefault(),r(t)},onMouseEnter:()=>i(a),className:s(`cursor-pointer rounded-md px-2.5 py-1.5 text-body-medium-lighter`,`text-[var(--content-default)]`,a===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t},t))})}function He({htmlFor:e,children:t}){return(0,U.jsx)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:t})}function Ue(e,t){(0,H.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function We({label:e,placeholder:t,value:n,onChange:r,suggestions:i,autoFocus:a}){let o=(0,H.useId)(),c=`ac-${o}`,l=`ac-list-${o}`,u=(0,H.useRef)(null),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(-1),h=(0,H.useMemo)(()=>Be(i,n),[i,n]);Ue(u,()=>f(!1)),(0,H.useEffect)(()=>{m(e=>e>=h.length?h.length-1:e)},[h.length]);let g=d&&h.length>0;function _(e){r(e),f(!1),m(-1)}function v(e){e.key===`ArrowDown`?(e.preventDefault(),f(!0),m(e=>Math.min(e+1,h.length-1))):e.key===`ArrowUp`?(e.preventDefault(),m(e=>Math.max(e-1,0))):e.key===`Enter`&&g&&p>=0?(e.preventDefault(),_(h[p])):e.key===`Escape`&&f(!1)}return(0,U.jsxs)(`div`,{ref:u,className:`relative flex flex-col gap-1.5`,children:[(0,U.jsx)(He,{htmlFor:c,children:e}),(0,U.jsx)(`div`,{className:s(Re,`h-9`),children:(0,U.jsx)(`input`,{id:c,role:`combobox`,"aria-expanded":g,"aria-controls":l,"aria-autocomplete":`list`,"aria-activedescendant":p>=0?`${l}-opt-${p}`:void 0,autoComplete:`off`,autoFocus:a,className:ze,placeholder:t,value:n,onChange:e=>{r(e.target.value),f(!0)},onFocus:()=>f(!0),onKeyDown:v})}),g&&(0,U.jsx)(Ve,{id:l,items:h,highlighted:p,onPick:_,onHover:m})]})}function Ge({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,H.useId)(),o=`tac-${a}`,l=`tac-list-${a}`,u=(0,H.useRef)(null),[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(-1),_=(0,H.useMemo)(()=>Be(i,d,n),[i,d,n]);Ue(u,()=>m(!1)),(0,H.useEffect)(()=>{g(e=>e>=_.length?_.length-1:e)},[_.length]);let v=p&&_.length>0;function y(e){let t=e.trim();t&&(n.some(e=>q(e)===q(t))||r([...n,t]),f(``),g(-1))}function b(e){r(n.filter(t=>t!==e))}function x(e){e.key===`ArrowDown`?(e.preventDefault(),m(!0),g(e=>Math.min(e+1,_.length-1))):e.key===`ArrowUp`?(e.preventDefault(),g(e=>Math.max(e-1,0))):e.key===`Enter`?v&&h>=0?(e.preventDefault(),y(_[h])):d.trim()&&(e.preventDefault(),y(d)):e.key===`,`?(e.preventDefault(),y(d)):e.key===`Backspace`&&d.length===0&&n.length>0?b(n[n.length-1]):e.key===`Escape`&&m(!1)}return(0,U.jsxs)(`div`,{ref:u,className:`relative flex flex-col gap-1.5`,children:[(0,U.jsx)(He,{htmlFor:o,children:e}),(0,U.jsxs)(`div`,{className:s(Re,`min-h-9 flex-wrap py-1.5`),children:[n.map(e=>(0,U.jsx)(c,{onRemove:()=>b(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,U.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":v,"aria-controls":l,"aria-autocomplete":`list`,"aria-activedescendant":h>=0?`${l}-opt-${h}`:void 0,autoComplete:`off`,className:s(ze,`h-6 w-24`),placeholder:n.length===0?t:``,value:d,onChange:e=>{f(e.target.value),m(!0)},onFocus:()=>m(!0),onKeyDown:x})]}),v&&(0,U.jsx)(Ve,{id:l,items:_,highlighted:h,onPick:y,onHover:g})]})}var Ke=`Software Engineer.Product Manager.Product Designer.Founder / CEO.Engineering Manager.Data Scientist.Marketing Manager.Growth Marketer.Content Writer.Sales Representative.Account Executive.Customer Success Manager.Operations Manager.Project Manager.Program Manager.Business Analyst.Data Engineer.Machine Learning Engineer.DevOps Engineer.Solutions Architect.UX Researcher.Graphic Designer.Recruiter.HR Manager.Financial Analyst.Accountant.Consultant.Investor / VC.Lawyer.Teacher.Professor.Researcher.Doctor / Physician.Nurse.Real Estate Agent.Executive Assistant.Entrepreneur.Freelancer.Student`.split(`.`),qe=`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 J(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Je({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[i,a]=(0,H.useState)(e),[o,s]=(0,H.useState)(t),[c,u]=(0,H.useState)(``),[d,f]=(0,H.useState)([]),p=i.trim().length>0&&c.trim().length>0;function m(){p&&n({firstName:i,lastName:o,role:c,hobbies:d})}return(0,U.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,U.jsxs)(ae,{showCreatureFooter:!1,children:[(0,U.jsx)(Le,{}),(0,U.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(),m()},children:[(0,U.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:J(.05),children:`Let's start with you.`}),(0,U.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:J(.12),children:`A few details so I can get to know you.`}),(0,U.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,U.jsx)(`div`,{style:J(.2,40),children:(0,U.jsx)(l,{label:`What should I call you?`,placeholder:`Your name`,value:i,onChange:e=>a(e.target.value),autoFocus:!0,fullWidth:!0})}),(0,U.jsx)(`div`,{style:J(.27,30),children:(0,U.jsx)(l,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),fullWidth:!0})}),(0,U.jsx)(`div`,{style:J(.34,20),children:(0,U.jsx)(We,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:u,suggestions:Ke})}),(0,U.jsx)(`div`,{style:J(.41,10),children:(0,U.jsx)(Ge,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:d,onChange:f,suggestions:qe})})]}),(0,U.jsx)(`div`,{className:`mt-10 w-full`,style:J(.5),children:(0,U.jsx)(r,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,U.jsx)(B,{size:16}),fullWidth:!0,disabled:!p,className:`h-11 text-base`,children:`Continue`})})]})]})})}var Ye=`#1A1A1A`,Xe=`#FFFFFF`;function Ze(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 Qe(e){let t=Ze(e)>.6;return{bg:e,isLight:t,fg:t?Ye:Xe,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 Y(){let e=I(),t=K.use.characters(),n=K.use.selectedIndex();return(0,H.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return Qe(i??`var(--surface-base)`)},[e,t,n])}function X({onBack:e,onNext:t,tone:n}){let r=Y(),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,U.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex 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,U.jsx)(p,{className:`h-5 w-5`})}),t?(0,U.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex 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,U.jsx)(m,{className:`h-5 w-5`})}):null]})}var $e=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function et(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function tt({onContinue:e,onBack:t,onForward:n}){let i=I(),a=K.use.characters(),o=K.use.ensureGenerated(),s=K.use.selectedIndex(),c=K.use.setSelectedIndex();(0,H.useEffect)(()=>{i&&o(i)},[i,o]);let l=a.length,[u,d]=(0,H.useState)(null),[p,m]=(0,H.useState)(``),[h,_]=(0,H.useState)(!1),v=(0,H.useRef)(null),[y,b]=(0,H.useState)(null);(0,H.useEffect)(()=>{l>0&&u===null&&d(et(l,s))},[l,s,u]),(0,H.useEffect)(()=>{u&&c(u.centerChar)},[u,c]);let x=u?.centerChar;(0,H.useEffect)(()=>{x!=null&&m($e[x%$e.length])},[x]),(0,H.useEffect)(()=>{h&&(v.current?.focus(),v.current?.select())},[h]);function S(e){if(!u||e===u.centerChar)return;let t=u.edgeOrder.indexOf(e);if(t<0)return;let n=[...u.edgeOrder];n[t]=u.centerChar,b({entering:{char:e,fromSlot:t},exiting:{char:u.centerChar,toSlot:t}}),d({centerChar:e,edgeOrder:n})}let C=()=>u&&S((u.centerChar+1)%l),w=()=>u&&S((u.centerChar-1+l)%l),T=(0,H.useMemo)(()=>u?a[u.centerChar]:void 0,[u,a]),E=!!i&&!!u&&!!T;function D(){T&&e({traits:T,name:p.trim()})}let O=`pointer-events-auto z-10 flex 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,U.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:[E&&(0,U.jsx)(Pe,{components:i,characters:a,centerChar:u.centerChar,edgeOrder:u.edgeOrder,entering:y?.entering??null,exiting:y?.exiting??null,onEnterComplete:e=>b(t=>t?.entering.char===e?null:t),onSelectChar:S}),(0,U.jsx)(X,{tone:`light`,onBack:t,onNext:n?D:void 0}),(0,U.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,U.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:w,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${O}`,children:(0,U.jsx)(f,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:C,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${O}`,children:(0,U.jsx)(B,{className:`h-4 w-4`})}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[h?(0,U.jsx)(`input`,{ref:v,value:p,onChange:e=>m(e.target.value),onBlur:()=>_(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_(!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,U.jsxs)(`button`,{type:`button`,onClick:()=>_(!0),"aria-label":`Edit name`,className:`flex items-center gap-2.5`,children:[(0,U.jsx)(`span`,{className:`text-3xl font-medium ${p?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:p||`Name your assistant`}),(0,U.jsx)(g,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,U.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,U.jsx)(B,{size:16}),disabled:!E,onClick:D,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})}function nt(e){let t=1/0,n=1/0,r=-1/0,i=-1/0,a=e.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)?.map(Number)??[];for(let e=0;e+1<a.length;e+=2){let o=a[e],s=a[e+1];o<t&&(t=o),s<n&&(n=s),o>r&&(r=o),s>i&&(i=s)}return{x:t,y:n,w:r-t,h:i-n}}function rt(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 it=.25,at=.46,ot=.3,st=.85,ct=40,lt=14,ut=8;function dt(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function ft({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0}){let r=I(),i=K.use.characters(),a=K.use.selectedIndex(),o=F(),{w:s,h:c}=dt(),[l,u]=(0,H.useState)({x:0,y:0});(0,H.useEffect)(()=>{if(o)return;let e=e=>{u({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[o]);let d=e&&!o,f=me();(0,H.useEffect)(()=>{n>0&&!o&&f.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,o,f]);let[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!e);(0,H.useEffect)(()=>{if(o||!h)return;let e=!1,t,n=n=>{e||(m(!0),t=setTimeout(()=>{e||(m(!1),t=setTimeout(n,140))},140))},r=()=>{t=setTimeout(()=>n(r),2500+Math.random()*4e3)};return n(()=>n(r)),()=>{e=!0,clearTimeout(t)}},[o,h]);let _=i.length>0?i[a]:void 0,v=(0,H.useMemo)(()=>{if(!r||!_)return null;let e=r.eyeStyles.find(e=>e.id===_.eyeStyle);return e?{paths:e.paths,bbox:rt(e.paths.map(e=>nt(e.svgPath)))}:null},[r,_]);if(!v)return null;let y=s*st,b=Math.min(Math.min(s,c)*ot,y*v.bbox.h/v.bbox.w),x=b*v.bbox.w/v.bbox.h,S=(s-x)/2,C=c-(1-it)*b,w=ct/100*c-(C+b/2),T=(at-it)*b,E=v.bbox.x+v.bbox.w/2,D=v.bbox.y+v.bbox.h/2;return(0,U.jsx)(P.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:S,top:C,width:x,height:b,transformOrigin:`center`},initial:d?{y:w,scale:.35}:!1,animate:d?{y:[w,T,0],scale:[.35,1,1]}:{y:0,scale:1},transition:d?{duration:1,delay:t,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>g(!0),children:(0,U.jsx)(P.div,{animate:f,children:(0,U.jsx)(`div`,{style:{transform:`translate(${l.x*lt}px, ${l.y*ut}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,U.jsx)(`svg`,{viewBox:`${v.bbox.x} ${v.bbox.y} ${v.bbox.w} ${v.bbox.h}`,width:x,height:b,style:{overflow:`visible`,display:`block`},children:(0,U.jsx)(`g`,{style:{transform:p?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${E}px ${D}px`,transition:`transform 0.14s ease-in-out`},children:v.paths.map((e,t)=>(0,U.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}function pt(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)}`}var mt=200,ht=40;function gt(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function _t({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:i}){let a=I(),o=K.use.characters(),s=K.use.selectedIndex(),c=F(),{w:l,h:u}=gt(),d=Y(),f=o.length>0?o[s]:void 0,p=(0,H.useMemo)(()=>{if(!a||!f)return null;let e=a.bodyShapes.find(e=>e.id===f.bodyShape),t=a.colors.find(e=>e.id===f.color);return!e||!t?null:{body:e,color:t.hex}},[a,f]),m=e.trim()?`Hey, ${e.trim()}!`:`Hey!`,h=t?.trim()?`I’m ${t.trim()}, your new AI assistant`:`I’m your new AI assistant`;if(!p)return(0,U.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,style:{backgroundColor:`var(--surface-base)`}});let g=pt(p.color,.6),_=1.25*Math.max(l,u),v=_*p.body.viewBox.height/p.body.viewBox.width,y=(l-_)/2,b=(u-v)/2,x=mt/_,S=(ht/100-.5)*u;return(0,U.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:[(0,U.jsx)(P.div,{className:`absolute inset-0 z-0`,style:{backgroundColor:p.color},initial:c?!1:{opacity:0},animate:{opacity:1},transition:c?{duration:0}:{duration:.6,delay:.35}}),(0,U.jsx)(P.svg,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,viewBox:`0 0 ${p.body.viewBox.width} ${p.body.viewBox.height}`,width:_,height:v,style:{left:y,top:b,transformOrigin:`center`},initial:c?!1:{scale:x,y:S},animate:{scale:1,y:0},transition:c?{duration:0}:{type:`spring`,stiffness:78,damping:18,mass:1},children:(0,U.jsx)(`path`,{d:p.body.svgPath,fill:p.color})}),(0,U.jsx)(ft,{entrance:!0}),(0,U.jsx)(P.div,{initial:c?!1:{opacity:0},animate:{opacity:1},transition:c?{duration:0}:{duration:.4,delay:1},children:(0,U.jsx)(X,{onBack:r,onNext:i})}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[30%] z-10 flex -translate-x-1/2 flex-col items-center gap-8`,children:[(0,U.jsxs)(P.h1,{className:`text-center leading-[1.05]`,style:{fontFamily:`var(--font-serif)`},initial:c?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,U.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:g},children:m}),(0,U.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:d.fg},children:h})]}),(0,U.jsxs)(P.button,{type:`button`,onClick:n,className:`flex h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] bg-black text-body-medium-default text-white transition-transform duration-150 active:scale-[0.97]`,initial:c?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:c?{duration:0}:{duration:.4,delay:1.15},children:[`Continue`,(0,U.jsx)(B,{className:`h-4 w-4`})]})]})]})}function vt(e,{speed:t,enabled:n}){let[r,i]=(0,H.useState)(n?0:e.length);return(0,H.useEffect)(()=>{if(!n){i(e.length);return}i(0);let r=0,a=setInterval(()=>{r+=1,i(r),r>=e.length&&clearInterval(a)},t);return()=>clearInterval(a)},[e,t,n]),e.slice(0,r)}var yt=`You’ve seen AI that answers.`,bt=`I’m different...`;function xt({onDone:e,onBack:t,onForward:n}){let r=Y(),i=F(),a=vt(yt,{speed:55,enabled:!i}),o=a.length>=28,[s,c]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{if(i){if(!o)return;let t=setTimeout(e,2e3);return()=>clearTimeout(t)}if(!s)return;let t=setTimeout(e,1400);return()=>clearTimeout(t)},[i,o,s,e]),(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:r.fg},children:[(0,U.jsx)(X,{onBack:t,onNext:n}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[32%] w-full max-w-3xl -translate-x-1/2 px-6 text-center`,children:[(0,U.jsxs)(`h1`,{className:`text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.1]`,style:{fontFamily:`var(--font-serif)`,color:r.fgMuted},children:[a,!o&&(0,U.jsx)(`span`,{className:`ml-1 inline-block animate-pulse`,"aria-hidden":`true`,children:`▍`})]}),o&&(0,U.jsx)(P.h1,{className:`mt-2 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.1]`,style:{fontFamily:`var(--font-serif)`,color:r.fg},initial:i?!1:{opacity:0,x:140,scale:.85},animate:{opacity:1,x:0,scale:1},transition:i?{duration:0}:{type:`spring`,stiffness:320,damping:17,delay:1.3},onAnimationComplete:()=>c(!0),children:bt})]})]})}var St=[`The smarter my instincts get`,`The faster I can take things off your plate`];function Ct({onContinue:e,onBack:t,onForward:n}){let r=Y(),i=F();return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:r.fg},children:[(0,U.jsx)(X,{onBack:t,onNext:n}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[24%] flex w-full max-w-4xl -translate-x-1/2 flex-col items-center gap-10 px-6 text-center`,children:[(0,U.jsx)(P.h1,{className:`whitespace-nowrap text-[clamp(2.25rem,5.5vw,4.25rem)] leading-[1.1]`,style:{fontFamily:`var(--font-serif)`},initial:i?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.5},children:`The more we collaborate,`}),(0,U.jsx)(`ul`,{className:`flex w-full flex-col gap-4 text-center`,children:St.map((e,t)=>(0,U.jsxs)(P.li,{className:`text-[clamp(1.75rem,3.4vw,2.75rem)] leading-snug`,style:{fontFamily:`var(--font-serif)`},initial:i?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.5,delay:.5+t*.55},children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`mr-3`,style:{color:r.fgMuted},children:`•`}),e]},e))}),(0,U.jsxs)(P.button,{type:`button`,onClick:e,className:`flex h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] bg-black text-body-medium-default text-white transition-transform duration-150 active:scale-[0.97]`,initial:i?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.4,delay:.6+St.length*.55},children:[`Continue`,(0,U.jsx)(B,{className:`h-4 w-4`})]})]})]})}var Z=24;function wt({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cv-${e}`,a=`cs-${e}`;return(0,U.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,U.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,U.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,U.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,U.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,U.jsx)(`stop`,{offset:`82%`,stopColor:`#000000`,stopOpacity:`0`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#9A6E0E`,stopOpacity:`0.22`})]}),(0,U.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,U.jsxs)(`radialGradient`,{id:a,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,U.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,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${i})`}),(0,U.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,U.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,dominantBaseline:`central`,children:[(0,U.jsx)(`text`,{x:`50`,y:`52`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,U.jsx)(`text`,{x:`50`,y:`52`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,U.jsx)(`text`,{x:`50`,y:`52`,fill:`#F4C12A`,children:`$`})]}),(0,U.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,U.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${a})`})]})}function Tt({size:e,depthRatio:t=.22,tiltX:n=8,tiltY:r=-22,shadow:i=!0,spinning:a=!1,className:o}){let s=e*t,c=s/(Z-1);return(0,U.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[i&&(0,U.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,U.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,U.jsxs)(P.div,{className:o,style:{width:e,height:e,position:`relative`,transformStyle:`preserve-3d`},initial:!1,animate:{rotateX:n,rotateY:a?[r,r+360,r+760,r+1180]:r},transition:a?{duration:.95,times:[0,.32,.62,1],ease:`easeInOut`}:{duration:0},children:[Array.from({length:Z},(e,t)=>{let n=t/(Z-1),r=44+(1-Math.abs(n-.5)*2)*22;return(0,U.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`50%`,background:`linear-gradient(to bottom, hsl(45 92% ${Math.min(r+10,82)}%), hsl(42 90% ${r-8}%))`,transform:`translateZ(${-s/2+t*c}px)`}},t)}),(0,U.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(${s/2}px)`},children:(0,U.jsx)(wt,{idSuffix:`front`})}),(0,U.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(${-s/2}px) rotateY(180deg)`},children:(0,U.jsx)(wt,{idSuffix:`back`})})]})})]})}var Et={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 Dt(e,t){let n=Et[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var Ot=new Set([`orange`,`pink`,`red`]);function kt(e,t){return Ot.has(e)&&Ot.has(t)}function At(e,t,n){let r=Dt(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>kt(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var jt=.3,Mt=.95,Nt=5e3;function Pt({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=F(),a=Y(),o=I(),s=K.use.characters(),c=K.use.selectedIndex(),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),p=(0,H.useMemo)(()=>{let e=s.length>0?s[c]:void 0;return{bodyShape:`blob`,eyeStyle:`quirky`,color:(o&&e?At(e.color,o.colors.map(e=>e.id),1)[0]:void 0)??`yellow`}},[o,s,c]);(0,H.useEffect)(()=>{if(l)return;let e=window.setTimeout(()=>f(!0),Nt);return()=>window.clearTimeout(e)},[l]);function m(){if(!l){if(u(!0),f(!1),i){e();return}window.setTimeout(t,jt*1e3)}}let h=typeof window>`u`?800:window.innerHeight,g=h*.42,_=-h*.08,v=h*.9;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,U.jsx)(X,{onBack:n,onNext:r}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex -translate-x-1/2 flex-col items-center gap-3 px-6 text-center`,children:[(0,U.jsx)(`h1`,{className:`max-w-[640px] text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:`Here’s 10 free credits to get started!`}),(0,U.jsx)(`div`,{className:`mt-10 flex flex-col items-center gap-4`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(P.button,{type:`button`,onClick:m,disabled:l,"aria-label":`Claim your 10 free credits`,className:`rounded-full outline-none focus-visible:ring-2 focus-visible:ring-white/70 disabled:cursor-default enabled:cursor-pointer`,animate:l&&!i?{y:[0,g,_,v],scale:[1,1,1,.2],opacity:[1,1,1,0]}:i?{}:{y:[0,-9,0]},transition:l?{duration:Mt,times:[0,jt/Mt,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]}:{duration:2.2,repeat:1/0,ease:`easeInOut`},onAnimationComplete:()=>{l&&e()},children:(0,U.jsx)(Tt,{size:88,spinning:l&&!i})}),d&&!l&&(0,U.jsxs)(P.div,{className:`pointer-events-none absolute left-full top-1/2 ml-20 flex -translate-y-1/2 flex-col items-center`,initial:i?!1:{opacity:0,x:120},animate:{opacity:1,x:0},transition:i?{duration:0}:{type:`spring`,stiffness:220,damping:22},children:[(0,U.jsxs)(`div`,{className:`relative mb-1.5 whitespace-nowrap rounded-2xl bg-white px-3.5 py-1.5 text-[15px] font-medium text-[#1A1A1A] shadow-md`,children:[`click it!`,(0,U.jsx)(`span`,{className:`absolute -bottom-1 left-1/2 h-3 w-3 -translate-x-1/2 rotate-45 bg-white`})]}),o&&(0,U.jsx)(R,{components:o,traits:p,size:76})]})]})})]})]})}function Ft({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a}){let o=Y(),{handleConnect:s,oauthInProgress:c}=se({assistantId:e??``,onConnect:n}),l=!e||!t||c;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,U.jsx)(X,{onBack:i,onNext:a}),(0,U.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,U.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:`I’ll also check in with you`}),(0,U.jsx)(`p`,{className:`text-[16px]`,style:{color:o.fgMuted},children:`I’ll add a quick check-in to your calendar to follow up tomorrow.`}),(0,U.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-3`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:s,disabled:l,className:`flex h-11 w-full items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97] disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):`Add to Google Calendar`}),(0,U.jsx)(`button`,{type:`button`,onClick:r,disabled:c,className:`text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:o.fgMuted},children:`Skip for now`})]})]})]})}function It(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Lt(){let e=I(),t=K.use.characters(),n=K.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Q({size:e=48}){let{components:t,chosen:n}=Lt();return!t||!n?(0,U.jsx)(`div`,{style:{width:e,height:e}}):(0,U.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,U.jsx)(R,{components:t,traits:n,size:e})})}var $=48;function Rt({onDone:e,onBack:t,onForward:n}){let{components:r,chosen:i}=Lt(),a=F(),{w:o,h:s}=It();(0,H.useEffect)(()=>{let t=setTimeout(e,2600);return()=>clearTimeout(t)},[e]);let c=o/2-170,l=c+$/2,u=s*.26+$/2,d=1.3*Math.max(o,s)/$,f=o/2-l,p=s*.88-u,m=s*.05;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,U.jsx)(X,{onBack:t,onNext:n,tone:`light`}),(0,U.jsxs)(`div`,{className:`absolute flex items-center gap-4`,style:{left:c,top:s*.26},children:[(0,U.jsx)(`div`,{className:`relative`,style:{width:$,height:$},children:r&&i&&(0,U.jsx)(P.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:a?!1:{scale:d,x:f,y:p},animate:{x:[f,f,0,0],y:[p,p+m,0,0],scale:[d,d,1.07,1]},transition:a?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,U.jsx)(R,{components:r,traits:i,size:$})})}),(0,U.jsx)(P.span,{className:`whitespace-nowrap text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:a?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:a?{duration:0}:{duration:.4,delay:.9},children:`Meeting Created!`})]})]})}var zt=[`Searching the web to get to know you…`,`Reading public profiles…`,`Connecting the dots…`,`Almost there…`];function Bt({onDone:e,onBack:t,onAdvance:n,onForward:r}){let i=Y(),[a,o]=(0,H.useState)(0);return(0,H.useEffect)(()=>{if(n?.(a),a>=zt.length-1){let t=setTimeout(e,1500);return()=>clearTimeout(t)}let t=setTimeout(()=>o(e=>e+1),1500);return()=>clearTimeout(t)},[a,e,n]),(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:i.fg},children:[(0,U.jsx)(X,{onBack:t,onNext:r}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-full max-w-xl -translate-x-1/2 items-center gap-3 px-6`,children:[(0,U.jsx)(Q,{}),(0,U.jsx)(L,{mode:`wait`,children:(0,U.jsx)(P.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:zt[a]},a)})]})]})}function Vt({claims:e,loading:t,onContinue:n,onBack:r,onForward:i}){let a=Y(),o=F(),[s,c]=(0,H.useState)(()=>new Set),l=e.filter(e=>!s.has(e.claim)),u=l.length>0;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,U.jsx)(X,{onBack:r,onNext:i}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Q,{}),(0,U.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Alright, this is what I got:`})]}),(0,U.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:a.fgMuted},children:u?`Feel free to remove anything that’s not true`:t?`Still putting this together…`:`I didn’t turn up much — we can fill it in as we chat.`}),(0,U.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,U.jsx)(L,{children:l.map(e=>(0,U.jsxs)(P.div,{layout:!0,initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},exit:o?void 0:{opacity:0,scale:.95},className:`flex items-center justify-between gap-3 rounded-2xl px-5 py-4 text-[15px]`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,U.jsx)(`span`,{children:e.claim}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Remove "${e.claim}"`,onClick:()=>c(t=>new Set(t).add(e.claim)),className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full transition-opacity hover:opacity-100`,style:{color:a.fgMuted},children:(0,U.jsx)(v,{className:`h-4 w-4`})})]},e.claim))})}),(0,U.jsxs)(`button`,{type:`button`,onClick:n,className:`mt-8 flex h-11 w-[200px] 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:[`Continue`,(0,U.jsx)(B,{className:`h-4 w-4`})]})]})]})}var Ht=[{suggestion:`I'll build you a live dashboard to track what matters to you`,prompt:`Build me a live dashboard to track what matters to me.`},{suggestion:`I'll send a weekly briefing on news in your space`,prompt:`Set up a weekly briefing on news in my space.`},{suggestion:`I'll help you get on top of your week`,prompt:`Help me get on top of my week.`},{suggestion:`I'll draft something from a few rough notes`,prompt:`Draft something from a few rough notes I'll give you.`}];function Ut({suggestions:e,loading:t,onSuggestionClick:n,onBack:r,onForward:i}){let a=Y(),o=F(),s=e.length>0?e:t?[]:Ht;return(0,U.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,U.jsx)(X,{onBack:r,onNext:i}),(0,U.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Q,{}),(0,U.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here’s what we could do first`})]}),(0,U.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:a.fgMuted},children:s.length>0?`Pick one to jump in — or start your own thing.`:`Putting together a few ideas…`}),(0,U.jsx)(`div`,{className:`flex flex-col gap-3`,children:s.map((e,t)=>(0,U.jsxs)(P.button,{type:`button`,onClick:()=>n(e.prompt),initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:o?{duration:0}:{duration:.3,delay:t*.06},className:`flex items-center gap-3 rounded-2xl px-5 py-4 text-left text-[15px] transition-transform duration-150 hover:scale-[1.01] active:scale-[0.99]`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,U.jsx)(_,{className:`h-4 w-4 shrink-0`,style:{color:a.fgMuted}}),(0,U.jsx)(`span`,{children:e.suggestion})]},`${t}-${e.suggestion}`))})]})]})}function Wt(){let[e,t]=(0,H.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,H.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var Gt=[{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:0,base:300,pos:e=>({left:`6%`,top:-e*.46})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:1,base:260,pos:e=>({right:`6%`,top:-e*.46})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:240,pos:e=>({left:`42%`,top:-e*.52})},{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.34,top:`42%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.34,top:`54%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:220,pos:e=>({right:-e*.26,bottom:-e*.18})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:220,pos:e=>({left:-e*.2,bottom:-e*.22})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:250,pos:e=>({left:`24%`,top:-e*.5})}],Kt=`#17191C`;function qt({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0}){let i=I(),a=K.use.characters(),o=K.use.selectedIndex(),s=F(),{w:c}=Wt(),l=Math.max(.42,Math.min(c/1100,1)),u=a.length>0?a[o]:void 0,{bg:d,peekColors:f}=(0,H.useMemo)(()=>!i||!u?{bg:`var(--surface-base)`,peekColors:[]}:{bg:i.colors.find(e=>e.id===u.color)?.hex??`var(--surface-base)`,peekColors:At(u.color,i.colors.map(e=>e.id),3)},[i,u]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(P.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?Kt:d},transition:s?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,U.jsx)(ft,{bumpNonce:t}),i&&(0,U.jsx)(L,{children:Gt.slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*l);return(0,U.jsx)(P.div,{"aria-hidden":`true`,className:`pointer-events-none fixed z-[1]`,style:{...e.pos(n),width:n,height:n},initial:s?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:s?void 0:{scale:0,opacity:0},transition:s?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,U.jsx)(R,{components:i,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:f[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}function Jt(){let e=i(),t=E.use.user(),n=z.use.enterFocus(),r=z.use.exitFocus(),o=z.use.setPendingAvatarTraits(),s=ne.use.researchOnboarding(),c=ne.use.hydrated(),[l,u]=(0,H.useState)(`form`),[d,f]=(0,H.useState)([]);function p(e){f([]),u(e)}function m(e){f(e=>[...e,l]),u(e)}function h(){let e=d[d.length-1];e&&(f(e=>e.slice(0,-1)),u(e))}let g=d.length>0?h:void 0,[_,v]=(0,H.useState)(null),[y,b]=(0,H.useState)(null),[x,S]=(0,H.useState)(0),[w,T]=(0,H.useState)(0),{start:D,ready:O,assistantId:k,awaitReady:ee}=xe(),A=De(),j=A.status===`idle`||A.status===`running`;(0,H.useEffect)(()=>{r(),s&&c&&D()},[r,D,s,c]);function re(t,r,i){let{firstName:a,lastName:s,role:c,hobbies:l}=t,u=[a.trim(),s.trim()].filter(Boolean).join(` `),d=a.trim();le({tools:[],tasks:[],tone:ue,...u?{userName:u}:{},...c.trim()?{occupation:c.trim()}:{},initialMessage:i??he({firstName:a,lastName:s,occupation:c,hobby:l.join(`, `)}),...i?{}:{title:d?`Getting to know ${d}`:`Getting to know you`},...r?.name?.trim()?{assistantName:r.name.trim()}:{}}),o(r?.traits??null),i||n(),C.markExpectingFirstMessage(),C.checkAssistant(k??void 0).finally(()=>{e(`${te.assistant}?onboarding=1`,{replace:!0})})}function M(e){v(e);let t=e.firstName.trim();A.start({awaitAssistantId:ee,subject:{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `)},conversationTitle:t?`Getting to know ${t}`:`Getting to know you`}),p(`face`)}function N(){k&&_&&ce({assistantId:k,userName:[_.firstName.trim(),_.lastName.trim()].filter(Boolean).join(` `)||void 0,assistantName:y?.name?.trim()||void 0}),p(`meeting`)}if(!s)return c?(0,U.jsx)(a,{to:te.assistant,replace:!0}):null;let P=[`different`,`together`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`];if(P.includes(l)&&_){let e=[`meeting`,`looking`,`results`,`suggestions`].includes(l);return(0,U.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:[(0,U.jsx)(qt,{eyesBumpNonce:x,peekLevel:P.indexOf(l)+1+w,darkBg:e,showBottomEyes:!e}),l===`different`&&(0,U.jsx)(xt,{onDone:()=>p(`together`),onBack:()=>m(`intro`),onForward:g}),l===`together`&&(0,U.jsx)(Ct,{onContinue:()=>p(`integration`),onBack:()=>m(`different`),onForward:g}),l===`integration`&&(0,U.jsx)(Pt,{onClaim:()=>p(`letschat`),onBumpEyes:()=>S(e=>e+1),onBack:()=>m(`together`),onForward:g}),l===`letschat`&&(0,U.jsx)(Ft,{assistantId:k,assistantReady:O,onConnected:N,onSkip:()=>p(`looking`),onBack:()=>m(`integration`),onForward:g}),l===`meeting`&&(0,U.jsx)(Rt,{onDone:()=>p(`looking`),onBack:()=>m(`letschat`),onForward:g}),l===`looking`&&(0,U.jsx)(Bt,{onDone:()=>p(`results`),onBack:()=>m(`letschat`),onAdvance:e=>T(Math.min(e+1,4)),onForward:g}),l===`results`&&(0,U.jsx)(Vt,{claims:A.claims,loading:j,onContinue:()=>p(`suggestions`),onBack:()=>m(`looking`),onForward:g}),l===`suggestions`&&(0,U.jsx)(Ut,{suggestions:A.suggestions,loading:j,onSuggestionClick:e=>re(_,y,e),onBack:()=>m(`results`),onForward:g})]})}return l===`intro`&&_?(0,U.jsx)(_t,{firstName:_.firstName,assistantName:y?.name,onContinue:()=>p(`different`),onBack:()=>m(`face`),onForward:g}):l===`face`&&_?(0,U.jsx)(tt,{onContinue:e=>{b(e),p(`intro`)},onBack:()=>m(`form`),onForward:g}):(0,U.jsx)(Je,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:M})}export{Jt as ResearchOnboardingRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./create-selectors-BE0_e_Ed.js";import{W as n,at as r,d as i,f as a,it as o,p as s,rt as c}from"./local-mode-Bg6wpc5q.js";function l(e,t){return e.filter(e=>e.isLocal||e.organizationId==null||e.organizationId===t)}var u=e((e,t)=>({assistants:[],activeAssistantId:null,selectedAssistantId:o(),assistantsHydrated:!1,setFromLockfile:n=>{let r=m(n),a=new Map(t().assistants.map(e=>[e.id,e]));e({assistants:n.assistants.map(e=>({id:e.assistantId,name:e.name,hatchedAt:e.hatchedAt,cloud:e.cloud,runtimeVersion:e.resources?.runtimeVersion,currentReleaseVersion:a.get(e.assistantId)?.currentReleaseVersion,releaseChannel:a.get(e.assistantId)?.releaseChannel,isActiveLockfileAssistant:r===e.assistantId,isLocal:i(e),isPlatformHosted:s(e),organizationId:e.organizationId})),assistantsHydrated:!0}),d(t,e)},setFromApi:t=>e({assistantsHydrated:!0,assistants:t.map(e=>{let t=p(e.id);return{id:e.id,name:e.name,hatchedAt:e.created,cloud:t.cloud,runtimeVersion:t.runtimeVersion,currentReleaseVersion:e.current_release_version,releaseChannel:e.release_channel,isActiveLockfileAssistant:t.isActiveLockfileAssistant,isLocal:e.is_local,isPlatformHosted:!e.is_local}})}),upsertFromApi:t=>e(e=>{let n={id:t.id,name:t.name,hatchedAt:t.created,currentReleaseVersion:t.current_release_version,releaseChannel:t.release_channel,isLocal:t.is_local,isPlatformHosted:!t.is_local},r=e.assistants.findIndex(e=>e.id===t.id);if(r>=0){let i=[...e.assistants],a=p(t.id);return i[r]={...n,cloud:a.cloud??i[r].cloud,organizationId:i[r].organizationId,runtimeVersion:a.runtimeVersion??i[r].runtimeVersion,isActiveLockfileAssistant:a.isActiveLockfileAssistant??i[r].isActiveLockfileAssistant},{assistants:i}}let i=p(t.id);return{assistants:[...e.assistants,{...n,cloud:i.cloud,organizationId:i.organizationId,runtimeVersion:i.runtimeVersion,isActiveLockfileAssistant:i.isActiveLockfileAssistant}]}}),remove:t=>e(e=>({assistants:e.assistants.filter(e=>e.id!==t)})),clear:()=>e({assistants:[]}),setActiveAssistantId:t=>e({activeAssistantId:t}),setSelectedAssistant:t=>{t==null?c():r(t),e({selectedAssistantId:t})}}));function d(e,t){let{assistants:n,selectedAssistantId:r,assistantsHydrated:i}=e();!i||r==null||n.some(e=>e.id===r)||(c(),t({selectedAssistantId:null}))}var f=t(u);function p(e){let t=n.getState().lockfile,r=t?.assistants.find(t=>t.assistantId===e),i=t?m(t):null;return{cloud:r?.cloud,organizationId:r?.organizationId,runtimeVersion:r?.resources?.runtimeVersion,isActiveLockfileAssistant:t?i===e:void 0}}function m(e){return e.activeAssistant&&e.assistants.some(t=>t.assistantId===e.activeAssistant)?e.activeAssistant:e.assistants.length===1?e.assistants[0]?.assistantId??null:null}a()&&n.subscribe(e=>{e.lockfile&&e.committed&&u.getState().setFromLockfile(e.lockfile)}),typeof window<`u`&&window.addEventListener(`storage`,e=>{(e.key===null||e.key===`vellum:selectedAssistantId`)&&u.setState({selectedAssistantId:o()})});export{f as n,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.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"./is-electron-CcgCla1v.js";import{i as s,m as c,n as l}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.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"./is-electron-CcgCla1v.js";import{i as s,m as c,n as l}from"./auth-store-Cc0c0sQk.js";import{t as u}from"./return-to-BcgKmS7W.js";import{a as d}from"./routes-BLyehs4B.js";import{c as f,d as p,f as m,l as h,s as g,u as _}from"./prefs-BQY2Hl9H.js";import{Hr as v,Nn as y,_t as b}from"./index-DhxGhfwI.js";import{n as x,t as S}from"./consent-controls-Bk8etO5C.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=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=s(),[A,j]=m(),[M,N]=h(),[P,F]=_(),[I,L]=p(),[R]=g(),[z]=f(),[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(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),y(d.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(b,{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)(v,{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};
|
package/dist/assets/{select-assistant-screen-CHBqN3LE.js → select-assistant-screen-ZJ9IYyUk.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-D7s2Q_uG.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"./confirm-dialog-SpCsmAdG.js";import{t as s}from"./modal-CHuPOsJJ.js";import{E as c,J as l,O as u,et as d,j as f,t as p,u as m}from"./local-mode-Bg6wpc5q.js";import{t as h}from"./is-electron-CcgCla1v.js";import{n as ee}from"./resolved-assistants-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.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"./confirm-dialog-SpCsmAdG.js";import{t as s}from"./modal-CHuPOsJJ.js";import{E as c,J as l,O as u,et as d,j as f,t as p,u as m}from"./local-mode-Bg6wpc5q.js";import{t as h}from"./is-electron-CcgCla1v.js";import{n as ee}from"./resolved-assistants-store-lkSgU__i.js";import{i as g,l as _,n as v,q as te}from"./auth-store-Cc0c0sQk.js";import{a as y}from"./routes-BLyehs4B.js";import{t as ne}from"./use-onboarding-login-vAFdm7Pu.js";import{Ut as b,Vi as x,Wt as S,_t as C,na as w,xi as T}from"./index-DhxGhfwI.js";import{r as E}from"./format-date-Cx9GZ7-D.js";var D=e(t(),1),O=a();function k({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:c,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)(o,{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:c,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,O.jsx)(b,{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=h(),b=g(),x=ee.use.assistants(),w=_.use.currentOrganizationId(),{loading:T,error:E,login:j,cancel:M}=ne(),P=e=>e.isLocal||b,F=x.filter(P),I=x.some(e=>e.isPlatformHosted)&&!b,[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=te(w);R(F.find(t=>t.id===e)?.id??F[0].id)},[L,F,w]);let Z=async t=>{B(!0),W(null);try{t.isLocal?await v.getState().connectLocalAssistant(t.id):await v.getState().connectPlatformAssistant(t.id),e(y.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&c()&&(u(e)||d(e)||e instanceof p)&&m(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 f(G.id,{repairGuardian:!0});if(e.ok){l(),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 S(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||x.length!==0&&x.length===1&&F.length===1&&(H(!0),Z(F[0]))},[x.length,F.length]);let ae=()=>{let e=x.find(e=>e.id===L);e&&Z(e)},oe=()=>{e(y.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(C,{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)(C,{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:x.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(`${y.onboarding.hosting}?from=select-assistant`),disabled:z||T,children:`Create New Assistant`}),I&&(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:T?M:()=>void j(),disabled:z,children:T?`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||T,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),o=h();return(0,O.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,o?`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`,o?`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)(T,{className:`h-5 w-5`}):(0,O.jsx)(x,{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)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,O.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${o?`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)(w,{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"./is-electron-CcgCla1v.js";import{t as s}from"./log-in-BPJxI98d.js";import{i as c}from"./auth-store-
|
|
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"./is-electron-CcgCla1v.js";import{t as s}from"./log-in-BPJxI98d.js";import{i as c}from"./auth-store-Cc0c0sQk.js";import{a as l}from"./routes-BLyehs4B.js";import{t as u}from"./client-feature-flag-store-DjN8fxHA.js";import{t as d}from"./use-onboarding-login-vAFdm7Pu.js";import{t as f}from"./assistant-feature-flag-store-BD9zTDcP.js";import{Jt as p,Mn as m,hi as h,tt as g}from"./index-DhxGhfwI.js";import{n as _,t as v}from"./sidebar-tree-B24zaatU.js";var y=e(t(),1),b=a();function x(){let e=f.use.settingsDeveloperNav(),t=f.use.mcpSettings(),a=u.use.platformNotifications(),x=u.use.bookmarks(),S=p({platformHostedOnly:!0}),C=p(),{pathname:w}=i(),T=n(),E=c(),{login:D}=d(),O=(0,y.useMemo)(()=>g.filter(e=>!(e.id===`notifications`&&(!a||S===`gated`)||e.id===`billing`&&C!==`full`||e.id===`bookmarks`&&!x||e.id===`devices`&&S===`gated`||e.id===`keyboard-shortcuts`&&!o()||e.id===`mcp`&&!t||e.id===`developer`)),[a,S,C,x,t]),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:h,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===l.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:l.assistant,sidebar:(0,b.jsx)(v,{items:O,bottomItems:k,indexPath:l.settings.root}),title:A,children:(0,b.jsx)(r,{})})}export{x as SettingsLayout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{O as r,n as i,t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-yOV5eJnU.js";import{t as l}from"./notice-CynJKEow.js";import{n as u,t as d}from"./input-Ch7OC6ME.js";import{t as f}from"./toggle-95p73HGd.js";import{t as p}from"./is-electron-CcgCla1v.js";import{t as m}from"./bug-Dyqld0Aa.js";import{t as h}from"./info-CUuJWmsF.js";import{t as g}from"./loader-circle-YAV9sMh_.js";import{t as _}from"./x-b3o2p6YU.js";import{Jt as v}from"./sdk.gen-W0KlW-sG.js";import{n as y}from"./auth-store-6CnXVIAL.js";import{t as b}from"./dist-3i_EPbLt.js";import{t as x}from"./impersonate-version-flag-BksY65Mo.js";import{L as ee}from"./react-query.gen-CRARj4mG.js";import{Pn as S,Wr as te,ai as C,di as w,pi as ne,vi as T}from"./index-Chr1kHBM.js";var E=e(n(),1),re=e(r(),1),D=`vellum:debug:`;function O(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function k(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:x()},overrides:O()}}var A=t({ShareFeedbackModal:()=>B}),j=s(),M=[{value:`bug_report`,label:`Bug Report`,icon:m,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:T,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:w,includesLogsByDefault:!1}],N=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],ie=N.map(e=>({value:e.value,label:e.label})),P=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),F=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),I=10,L=50*1024*1024,ae={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function oe(){return p()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function se(e){if(e.size>L)return!1;if(e.type&&P.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?F.has(t):!1}return!1}function R(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function z(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await v({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function ce(e,t,n,r){if(typeof CompressionStream>`u`)return null;let i=new Date,a=N.find(t=>t.value===e),o=i.getTime(),s=a?.cutoffMs==null?null:o-a.cutoffMs,c=s==null?null:new Date(s).toISOString(),l=null;try{l=r?.()??null}catch{l=null}let u=S(l),d={collected_at:i.toISOString(),time_range:e,cutoff:c,log_window:{start_time_ms:s,end_time_ms:o},assistant_id:t,active_conversation_id:n,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},f=new TextEncoder().encode(JSON.stringify(d,null,2)),m=new TextEncoder().encode(JSON.stringify(u,null,2)),h=[R(`web-client-context.json`,f),R(`web-chat-diagnostics.json`,m)],g=new TextEncoder().encode(JSON.stringify(k(),null,2));h.push(R(`web-debug-flags.json`,g));try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(R(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(R(`web-sse-liveness-triage.json`,n))}}catch{}if(p()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));h.push(R(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);h.push(R(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await z(t,{window:{startTime:s,endTime:o},activeConversationId:n});e&&h.push(R(`platform-logs.tar.gz`,e))}h.push(new Uint8Array(1024));let _=h.reduce((e,t)=>e+t.length,0),v=new Uint8Array(_),y=0;for(let e of h)v.set(e,y),y+=e.length;let b=new Blob([v.buffer]),x=await new Response(b.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([x],`web-client-logs-${i.getTime()}.tar.gz`,{type:`application/gzip`})}function B({open:e,onClose:t,initialReason:n,onSubmitted:r,assistantId:s,assistantVersion:m,activeConversationId:v,getDiagnosticsSnapshot:b}){let x=y.use.user()?.email,S=(0,E.useId)(),w=(0,E.useRef)(null),T=(0,E.useRef)(null),D=(0,E.useRef)(null),O=(0,E.useRef)(null),[k,A]=(0,E.useState)(n??`bug_report`),[N,P]=(0,E.useState)(``),[F,L]=(0,E.useState)(``),[R,z]=(0,E.useState)(M.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[B,V]=(0,E.useState)(!1),[H,U]=(0,E.useState)(`past_hour`),[W,G]=(0,E.useState)([]),[K,q]=(0,E.useState)(null),[de,J]=(0,E.useState)(!1),[Y,X]=(0,E.useState)(!1),Z=o(ee()),[fe,Q]=(0,E.useState)(!1),$=Z.isPending||fe,pe=!x,me=(0,E.useMemo)(()=>N.trim().length>0&&F.trim().length>0,[N,F]);(0,E.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;A(t),P(``),L(x??``),z(M.find(e=>e.value===t)?.includesLogsByDefault??!0),V(!1),U(`past_hour`),G([]),X(!1),q(null),Q(!1),Z.reset();let r=setTimeout(()=>{x?D.current?.focus():O.current?.focus()},50);return()=>clearTimeout(r)},[e]),(0,E.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let he=e=>{A(e),B||z(M.find(t=>t.value===e)?.includesLogsByDefault??!1)},ge=()=>{z(e=>!e),V(!0)},_e=(0,E.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),ve=(0,E.useCallback)(e=>{e.target===w.current&&!$&&t()},[t,$]),ye=(0,E.useCallback)(e=>{G(t=>{let n=I-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!se(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),be=e=>{e.target.files&&ye(Array.from(e.target.files)),e.target.value=``},xe=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&ye(Array.from(e.dataTransfer.files))},Se=e=>{e.preventDefault(),J(!0)},Ce=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},we=e=>{G(t=>t.filter((t,n)=>n!==e))};return e?(0,re.createPortal)((0,j.jsx)(`div`,{ref:w,role:`dialog`,"aria-modal":`true`,"aria-labelledby":S,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:_e,onClick:ve,onDrop:xe,onDragOver:Se,onDragLeave:Ce,children:(0,j.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,j.jsx)(`h2`,{id:S,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,j.jsx)(a,{variant:`ghost`,iconOnly:(0,j.jsx)(_,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[pe&&(0,j.jsx)(d,{id:`${S}-email`,ref:O,label:`Email`,type:`email`,placeholder:`you@example.com`,value:F,onChange:e=>L(e.target.value),leftIcon:(0,j.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,j.jsx)(`div`,{className:`flex gap-2`,children:M.map(e=>(0,j.jsx)(le,{option:e,isSelected:k===e.value,onSelect:()=>he(e.value)},e.value))})]}),(0,j.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),k===`bug_report`&&(0,j.jsxs)(l,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,j.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),k===`feature_request`&&(0,j.jsxs)(l,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,j.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,j.jsx)(u,{id:`${S}-message`,ref:D,label:k===`bug_report`?`What went wrong?`:k===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:k===`bug_report`?`What did you expect to happen, and what happened instead?`:k===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:N,onChange:e=>P(e.target.value),fullWidth:!0}),k!==`feature_request`&&(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,j.jsx)(f,{checked:R,onChange:ge,"aria-label":`Include browser diagnostics`}),(0,j.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,j.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,j.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,j.jsx)(h,{className:`h-3.5 w-3.5`})})})]}),R&&(0,j.jsx)(c,{options:ie,value:H,onChange:U,"aria-label":`Diagnostics time range`})]}),p()&&v&&k!==`feature_request`&&(0,j.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,j.jsx)(f,{checked:Y,onChange:()=>X(e=>!e),"aria-label":`Include the most recent conversation`}),(0,j.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,W.length>0&&(0,j.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,W.length,`/`,I]})]}),(0,j.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,j.jsx)(C,{}),onClick:()=>T.current?.click(),disabled:W.length>=I,children:`Add files`}),(0,j.jsx)(`input`,{ref:T,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:be,className:`hidden`})]}),W.length>0&&(0,j.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:W.map((e,t)=>(0,j.jsx)(ue,{file:e,onRemove:()=>we(t)},`${e.name}-${t}`))}),de&&(0,j.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]}),K&&(0,j.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:K})]}),(0,j.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,j.jsx)(g,{className:`h-4 w-4 animate-spin`}),`Sending feedback…`]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,j.jsx)(a,{variant:`primary`,leftIcon:(0,j.jsx)(te,{}),onClick:async()=>{if(!(!me||$)){q(null),Q(!0);try{let e=R&&k!==`feature_request`?await ce(H,s??null,p()?Y?v??null:null:v??null,b):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:N.trim(),classification:ae[k],email:F.trim(),client:oe(),client_version:void 0,...s?{assistant_id:s}:{},...m?{assistant_version:m}:{},...e?{logs_file:e}:{},...W.length?{attachments:W}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),r?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!me,children:`Submit`})]})})]})}),document.body):null}function le({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,j.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,j.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,j.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function ue({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,E.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,E.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,j.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,j.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,j.jsx)(C,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,j.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,j.jsx)(_,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{A as n,B as t};
|
|
1
|
+
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{O as r,n as i,t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-yOV5eJnU.js";import{t as l}from"./notice-CynJKEow.js";import{n as u,t as d}from"./input-Ch7OC6ME.js";import{t as f}from"./toggle-95p73HGd.js";import{t as p}from"./is-electron-CcgCla1v.js";import{t as m}from"./bug-Dyqld0Aa.js";import{t as h}from"./info-CUuJWmsF.js";import{t as g}from"./loader-circle-YAV9sMh_.js";import{t as _}from"./x-b3o2p6YU.js";import{Jt as v}from"./sdk.gen-W0KlW-sG.js";import{n as y}from"./auth-store-Cc0c0sQk.js";import{t as b}from"./dist-3i_EPbLt.js";import{t as x}from"./impersonate-version-flag-BksY65Mo.js";import{L as ee}from"./react-query.gen-CRARj4mG.js";import{Fn as S,Gr as te,fi as C,mi as ne,oi as w,yi as T}from"./index-DhxGhfwI.js";var E=e(n(),1),re=e(r(),1),D=`vellum:debug:`;function O(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function k(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:x()},overrides:O()}}var A=t({ShareFeedbackModal:()=>B}),j=s(),M=[{value:`bug_report`,label:`Bug Report`,icon:m,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:T,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:C,includesLogsByDefault:!1}],N=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],ie=N.map(e=>({value:e.value,label:e.label})),P=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),F=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),I=10,L=50*1024*1024,ae={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function oe(){return p()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function se(e){if(e.size>L)return!1;if(e.type&&P.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?F.has(t):!1}return!1}function R(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function z(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await v({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function ce(e,t,n,r){if(typeof CompressionStream>`u`)return null;let i=new Date,a=N.find(t=>t.value===e),o=i.getTime(),s=a?.cutoffMs==null?null:o-a.cutoffMs,c=s==null?null:new Date(s).toISOString(),l=null;try{l=r?.()??null}catch{l=null}let u=S(l),d={collected_at:i.toISOString(),time_range:e,cutoff:c,log_window:{start_time_ms:s,end_time_ms:o},assistant_id:t,active_conversation_id:n,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},f=new TextEncoder().encode(JSON.stringify(d,null,2)),m=new TextEncoder().encode(JSON.stringify(u,null,2)),h=[R(`web-client-context.json`,f),R(`web-chat-diagnostics.json`,m)],g=new TextEncoder().encode(JSON.stringify(k(),null,2));h.push(R(`web-debug-flags.json`,g));try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(R(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(R(`web-sse-liveness-triage.json`,n))}}catch{}if(p()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));h.push(R(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);h.push(R(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await z(t,{window:{startTime:s,endTime:o},activeConversationId:n});e&&h.push(R(`platform-logs.tar.gz`,e))}h.push(new Uint8Array(1024));let _=h.reduce((e,t)=>e+t.length,0),v=new Uint8Array(_),y=0;for(let e of h)v.set(e,y),y+=e.length;let b=new Blob([v.buffer]),x=await new Response(b.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([x],`web-client-logs-${i.getTime()}.tar.gz`,{type:`application/gzip`})}function B({open:e,onClose:t,initialReason:n,onSubmitted:r,assistantId:s,assistantVersion:m,activeConversationId:v,getDiagnosticsSnapshot:b}){let x=y.use.user()?.email,S=(0,E.useId)(),C=(0,E.useRef)(null),T=(0,E.useRef)(null),D=(0,E.useRef)(null),O=(0,E.useRef)(null),[k,A]=(0,E.useState)(n??`bug_report`),[N,P]=(0,E.useState)(``),[F,L]=(0,E.useState)(``),[R,z]=(0,E.useState)(M.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[B,V]=(0,E.useState)(!1),[H,U]=(0,E.useState)(`past_hour`),[W,G]=(0,E.useState)([]),[K,q]=(0,E.useState)(null),[de,J]=(0,E.useState)(!1),[Y,X]=(0,E.useState)(!1),Z=o(ee()),[fe,Q]=(0,E.useState)(!1),$=Z.isPending||fe,pe=!x,me=(0,E.useMemo)(()=>N.trim().length>0&&F.trim().length>0,[N,F]);(0,E.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;A(t),P(``),L(x??``),z(M.find(e=>e.value===t)?.includesLogsByDefault??!0),V(!1),U(`past_hour`),G([]),X(!1),q(null),Q(!1),Z.reset();let r=setTimeout(()=>{x?D.current?.focus():O.current?.focus()},50);return()=>clearTimeout(r)},[e]),(0,E.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let he=e=>{A(e),B||z(M.find(t=>t.value===e)?.includesLogsByDefault??!1)},ge=()=>{z(e=>!e),V(!0)},_e=(0,E.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),ve=(0,E.useCallback)(e=>{e.target===C.current&&!$&&t()},[t,$]),ye=(0,E.useCallback)(e=>{G(t=>{let n=I-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!se(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),be=e=>{e.target.files&&ye(Array.from(e.target.files)),e.target.value=``},xe=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&ye(Array.from(e.dataTransfer.files))},Se=e=>{e.preventDefault(),J(!0)},Ce=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},we=e=>{G(t=>t.filter((t,n)=>n!==e))};return e?(0,re.createPortal)((0,j.jsx)(`div`,{ref:C,role:`dialog`,"aria-modal":`true`,"aria-labelledby":S,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:_e,onClick:ve,onDrop:xe,onDragOver:Se,onDragLeave:Ce,children:(0,j.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,j.jsx)(`h2`,{id:S,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,j.jsx)(a,{variant:`ghost`,iconOnly:(0,j.jsx)(_,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[pe&&(0,j.jsx)(d,{id:`${S}-email`,ref:O,label:`Email`,type:`email`,placeholder:`you@example.com`,value:F,onChange:e=>L(e.target.value),leftIcon:(0,j.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,j.jsx)(`div`,{className:`flex gap-2`,children:M.map(e=>(0,j.jsx)(le,{option:e,isSelected:k===e.value,onSelect:()=>he(e.value)},e.value))})]}),(0,j.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),k===`bug_report`&&(0,j.jsxs)(l,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,j.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),k===`feature_request`&&(0,j.jsxs)(l,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,j.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,j.jsx)(u,{id:`${S}-message`,ref:D,label:k===`bug_report`?`What went wrong?`:k===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:k===`bug_report`?`What did you expect to happen, and what happened instead?`:k===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:N,onChange:e=>P(e.target.value),fullWidth:!0}),k!==`feature_request`&&(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,j.jsx)(f,{checked:R,onChange:ge,"aria-label":`Include browser diagnostics`}),(0,j.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,j.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,j.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,j.jsx)(h,{className:`h-3.5 w-3.5`})})})]}),R&&(0,j.jsx)(c,{options:ie,value:H,onChange:U,"aria-label":`Diagnostics time range`})]}),p()&&v&&k!==`feature_request`&&(0,j.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,j.jsx)(f,{checked:Y,onChange:()=>X(e=>!e),"aria-label":`Include the most recent conversation`}),(0,j.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,W.length>0&&(0,j.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,W.length,`/`,I]})]}),(0,j.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,j.jsx)(w,{}),onClick:()=>T.current?.click(),disabled:W.length>=I,children:`Add files`}),(0,j.jsx)(`input`,{ref:T,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:be,className:`hidden`})]}),W.length>0&&(0,j.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:W.map((e,t)=>(0,j.jsx)(ue,{file:e,onRemove:()=>we(t)},`${e.name}-${t}`))}),de&&(0,j.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]}),K&&(0,j.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:K})]}),(0,j.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,j.jsx)(g,{className:`h-4 w-4 animate-spin`}),`Sending feedback…`]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,j.jsx)(a,{variant:`primary`,leftIcon:(0,j.jsx)(te,{}),onClick:async()=>{if(!(!me||$)){q(null),Q(!0);try{let e=R&&k!==`feature_request`?await ce(H,s??null,p()?Y?v??null:null:v??null,b):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:N.trim(),classification:ae[k],email:F.trim(),client:oe(),client_version:void 0,...s?{assistant_id:s}:{},...m?{assistant_version:m}:{},...e?{logs_file:e}:{},...W.length?{attachments:W}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),r?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!me,children:`Submit`})]})})]})}),document.body):null}function le({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,j.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,j.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,j.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function ue({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,E.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,E.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,j.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,j.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,j.jsx)(w,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,j.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,j.jsx)(_,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{A as n,B as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-BscuIPxA.js";import{r as c}from"./src-BJj2O5XB.js";import{t as l}from"./is-electron-CcgCla1v.js";import{t as u}from"./arrow-left-CEu7Dsda.js";import{t as d}from"./chevron-right-Cc3NZhAF.js";import{a as f}from"./routes-BLyehs4B.js";import{n as p}from"./use-is-mobile-D_0cze0t.js";import{t as m}from"./haptics-BCTVEX6s.js";import{Et as h,
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-BscuIPxA.js";import{r as c}from"./src-BJj2O5XB.js";import{t as l}from"./is-electron-CcgCla1v.js";import{t as u}from"./arrow-left-CEu7Dsda.js";import{t as d}from"./chevron-right-Cc3NZhAF.js";import{a as f}from"./routes-BLyehs4B.js";import{n as p}from"./use-is-mobile-D_0cze0t.js";import{t as m}from"./haptics-BCTVEX6s.js";import{Et as h,Gt as g,ln as _}from"./index-DhxGhfwI.js";var v=e(t(),1),y=20,b=100,x=.3,S=.7,C=10,w=.3,T=200,E=180,D=200,O=.25,k=50;function A(e){return Math.min(b,e*x)}function j(e,t){return Math.abs(t)>Math.abs(e)*S}function M(e,t){return Math.abs(e)<C&&Math.abs(t)<C?`pending`:j(e,t)||e<=0?`cancel`:`confirm`}function N(e,t){return e<=t?e:t+(e-t)*w}function P(e,t){return e>=t}function F(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function I({containerRef:e,onBack:t,enabled:n,navKey:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(t),o=(0,v.useRef)(n),s=(0,v.useRef)(!1);(0,v.useLayoutEffect)(()=>{a.current=t,o.current=n},[t,n]),(0,v.useEffect)(()=>{if(!_())return;let t=e.current;if(!t)return;let n=new Set,r=!1,c=(e,t)=>{let i=setTimeout(()=>{n.delete(i),r||e()},t);n.add(i)},l=()=>F(t),u=()=>A(window.innerWidth),d=e=>{t.style.transform=e===0?``:`translateX(${e}px)`},f=(e,t)=>{for(let n=0;n<e.length;n+=1){let r=e[n];if(r&&r.identifier===t)return r}return null},p=e=>{if(i.current=null,e){t.style.transition=`transform ${T}ms ease-out`,d(0);let e=()=>{t.removeEventListener(`transitionend`,e),l()};t.addEventListener(`transitionend`,e,{once:!0}),c(l,T+k)}else l()},h=()=>{t.style.transition=`transform ${E}ms ease-in`,d(window.innerWidth);let e=!1,n=()=>{if(e||r)return;e=!0,t.removeEventListener(`transitionend`,n);let i=-(window.innerWidth*O);t.style.transition=`none`,t.style.transform=`translateX(${i}px)`,t.style.opacity=`0`,t.offsetWidth,s.current=!0,a.current(),c(()=>{s.current&&(s.current=!1,l())},D*2)};t.addEventListener(`transitionend`,n,{once:!0}),c(n,E+k)},g=e=>{if(!o.current||i.current||e.touches.length!==1)return;let t=e.touches[0];t&&(t.clientX>y||(i.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1}))},v=e=>{let n=i.current;if(!n)return;if(e.touches.length>1){p(!1);return}let r=f(e.touches,n.touchId);if(!r)return;let a=r.clientX-n.startX,o=r.clientY-n.startY;if(!n.confirmed){let e=M(a,o);if(e===`pending`)return;if(e===`cancel`){p(!1);return}n.confirmed=!0,t.style.transition=`none`,t.style.willChange=`transform`}let s=u();if(j(a,o)&&a<s){p(!0);return}let c=N(a,s);a>=s&&!n.hasFiredHaptic&&(n.hasFiredHaptic=!0,m.light()),d(c)},b=e=>{let t=i.current;if(!t)return;let n=f(e.changedTouches,t.touchId),r=n?n.clientX-t.startX:0;t.confirmed&&P(r,u())?(i.current=null,h()):t.confirmed?p(!0):p(!1)},x=()=>{i.current?.confirmed?p(!0):p(!1)};return document.addEventListener(`touchstart`,g,{passive:!0}),document.addEventListener(`touchmove`,v,{passive:!0}),document.addEventListener(`touchend`,b,{passive:!0}),document.addEventListener(`touchcancel`,x,{passive:!0}),()=>{r=!0;for(let e of n)clearTimeout(e);n.clear(),i.current=null,document.removeEventListener(`touchstart`,g),document.removeEventListener(`touchmove`,v),document.removeEventListener(`touchend`,b),document.removeEventListener(`touchcancel`,x),l()}},[e]),(0,v.useLayoutEffect)(()=>{if(!s.current)return;s.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),F(t))};t.style.transition=`transform ${D}ms ease-out, opacity ${D}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,D+k);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),F(t)}},[r,e])}var L=o();function R({sidebar:e,children:t,actions:o,backHref:c,title:d=`Settings`,menuRoute:m=f.settings.root}){let{pathname:_}=a(),y=r(),b=_===m,x=p(),S=(0,v.useRef)(null),C=b?c:m;I({containerRef:S,onBack:(0,v.useCallback)(()=>{y(C)},[y,C]),enabled:x&&!b,navKey:_});let w=l(),T=b?`Back from ${d}`:`Back to ${d} menu`,E=(0,L.jsx)(n,{variant:`ghost`,iconOnly:(0,L.jsx)(u,{}),"aria-label":T,tintColor:`var(--content-secondary)`,onClick:()=>y(C)}),D=(0,L.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${d}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,L.jsx)(i,{to:c,className:`flex items-center justify-center no-underline`,children:(0,L.jsx)(u,{size:16,"aria-hidden":`true`})})});return(0,L.jsxs)(`div`,{ref:S,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:w?`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 3.75rem)`:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`},children:[(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[E,(0,L.jsx)(s,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:d}),(0,L.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),w?(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,L.jsx)(g,{placement:`electron`,className:`px-0 pt-0`}),(0,L.jsx)(h,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,L.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[D,(0,L.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:d})]}),(0,L.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,L.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${d} navigation`,children:e}),b?(0,L.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto pb-6 md:hidden`,children:e}):null,(0,L.jsx)(`main`,{className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto pb-6 md:flex md:px-6 md:pt-0 ${b?`hidden`:`flex`}`,children:t})]})]})]})}function z({items:e,bottomItems:t,indexPath:n}){let{pathname:i}=a(),o=r(),s=(e,t,r)=>{let{href:a,onSelect:s}=e,l=a!=null&&(i===a||i.startsWith(a+`/`)||r&&n!=null&&i===n);return(0,L.jsxs)(v.Fragment,{children:[(0,L.jsx)(c.Item,{icon:e.icon,label:e.label,active:l,trailingIcon:a==null?void 0:d,trailingIconClassName:a==null?void 0:`md:hidden`,href:a,onSelect:s,onClick:a==null?void 0:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),o(a))}}),!t&&(0,L.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,L.jsxs)(`nav`,{"aria-label":`Sidebar navigation`,className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>s(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>s(e,n===t.length-1,!1))]})]})}export{R as n,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./is-electron-CcgCla1v.js";import{M as o,N as s}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./is-electron-CcgCla1v.js";import{M as o,N as s}from"./auth-store-Cc0c0sQk.js";import{a as c}from"./routes-BLyehs4B.js";import{n as l,r as u}from"./login-flow-CzPVmpoB.js";import{t as d}from"./proxy-l3iqYpig.js";import{t as f}from"./google-logo-DNkI-jCf.js";import{Q as p,q as m}from"./index-DhxGhfwI.js";import{t as h}from"./signup-shell-CEJE1QSw.js";var g=e(t(),1),_=i();function v({words:e}){let[t,n]=(0,g.useState)(0),r=(0,g.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,g.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,_.jsxs)(`span`,{className:`signup__rotating`,children:[(0,_.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,_.jsx)(p,{mode:`wait`,children:(0,_.jsxs)(d.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var y=[`Personal Intelligence`,`Software Engineer`,`Finance Ops`,`Household Manager`,`GTM Engineer`,`Product Lead`],b=[{icon:(0,_.jsx)(f,{size:18}),label:`Continue with Google`,providerHint:`GoogleOAuth`},{icon:(0,_.jsx)(m,{size:18}),label:`Continue with Apple`,providerHint:`AppleOAuth`},{icon:(0,_.jsxs)(`svg`,{width:18,height:18,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,_.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,_.jsx)(`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`})]}),label:`Continue with Email`}];function x({returnTo:e}){let[t,n]=(0,g.useState)(null),i=u(e,{authIntent:`signup`}),d=t=>{n(null);let r=!!t&&!o()&&!a();s(l,i,{returnTo:e,...t?{providerHint:t}:{},...r?{}:{intent:`signup`}}).catch(e=>{console.error(`[signup] auth flow failed:`,e),n(`Something went wrong. Please try again.`)})};return(0,_.jsxs)(h,{children:[(0,_.jsxs)(`h1`,{className:`signup__title`,children:[`Meet your new`,(0,_.jsx)(`br`,{}),(0,_.jsx)(v,{words:y})]}),(0,_.jsx)(`p`,{className:`signup__subtitle`,children:`The most powerful assistant that can handle your work and life admin tasks.`}),(0,_.jsx)(`div`,{className:`signup__buttons`,children:b.map((e,t)=>(0,_.jsxs)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>d(e.providerHint),children:[t===0&&(0,_.jsx)(`span`,{className:`signup__tag`,children:`Most used`}),e.icon,e.label]},e.label))}),t&&(0,_.jsx)(`p`,{className:`signup__error`,children:t}),(0,_.jsxs)(`p`,{className:`signup__footer`,children:[`Already have an account?`,` `,(0,_.jsx)(r,{to:c.account.login,className:`signup__link`,children:`Sign in`})]}),(0,_.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,_.jsx)(m,{size:16}),`Download for macOS`]})]})}function S(){let[e]=n();return(0,_.jsx)(x,{returnTo:e.get(`returnTo`)})}export{S as SignupPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,t as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{O as i,t as a}from"./button-D7s2Q_uG.js";import{h as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-BibIM9x3.js";import{t as f}from"./menu-CdoNX1qx.js";import"./src-BJj2O5XB.js";import{t as p}from"./confirm-dialog-SpCsmAdG.js";import{t as m}from"./popover-BsF65jZY.js";import{t as h}from"./input-Ch7OC6ME.js";import{n as g}from"./stat-square-CraPxMcl.js";import{n as _,t as v}from"./panel-item-BLQE_l-g.js";import{t as y}from"./createLucideIcon-KBgJOpms.js";import{t as b}from"./arrow-left-CEu7Dsda.js";import{a as x,c as S,i as C,n as w,o as T,r as E,s as D,t as ee}from"./install-Gyq-nEic.js";import{t as O}from"./calendar-DUv7hzHD.js";import{t as k}from"./cloud-off-DfVAWu4D.js";import{t as A}from"./code-CfKv4BKJ.js";import{t as j}from"./globe-CiNEZj-J.js";import{t as te}from"./link-2-C6BJ3RH_.js";import{t as M}from"./loader-circle-YAV9sMh_.js";import{t as N}from"./sparkles-BoIJjAXt.js";import{t as P}from"./triangle-alert-CoIDviBm.js";import{t as F}from"./x-b3o2p6YU.js";import{Gt as ne,_t as re,gt as ie,ht as I,mt as L,pt as ae}from"./react-query.gen-DfnbKPpc.js";import{n as oe}from"./use-is-mobile-D_0cze0t.js";import{$i as R,A as z,Ai as B,Ar as V,Br as H,Kr as U,Ni as W,Nr as G,Oi as se,Pr as ce,Ti as le,Wr as ue,bi as K,ca as q,fi as de,j as J,li as fe,mi as pe,na as me,si as he,ta as ge,wr as _e}from"./index-DhxGhfwI.js";import{t as ve}from"./use-active-assistant-id-DTsVl8b7.js";var ye=y(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),be=y(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Y=e(r(),1),xe={mail:pe,calendar:O,"message-circle":de,globe:j,zap:_e,code:A,mic:fe,"shopping-cart":H,palette:be,heart:le,settings:ue,"link-2":te};function Se(e){return xe[e]}var X=u();function Ce({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a}){let o=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,X.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":`Skill categories`,children:[(0,X.jsx)(we,{icon:K,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),o.map(r=>(0,X.jsx)(we,{icon:Se(r.icon)??K,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function we({icon:e,label:t,count:n,isActive:r,showCount:i,onClick:o}){return(0,X.jsxs)(a,{variant:`ghost`,onClick:o,"aria-pressed":r,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:r?`var(--surface-active)`:void 0,color:r?`var(--content-default)`:`var(--content-secondary)`},children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),i&&(0,X.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}var Te=e(i(),1);function Ee(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function De(e,t){let[n,r]=(0,Y.useState)(null),i=c({...L({path:{assistant_id:e,id:t}}),select:e=>e??null}),a=(0,Y.useMemo)(()=>i.data?.files??[],[i.data]),o=(0,Y.useMemo)(()=>a.find(e=>e.name===`SKILL.md`),[a]),s=Ee(a,n),l=c({...ae({path:{assistant_id:e,id:t},query:{path:s??``}}),select:e=>e??null,enabled:!!s});return{fileEntries:a,skillMd:o,selectedPath:n,setSelectedPath:r,activePath:s,activeFile:a.find(e=>e.path===s),isFilesLoading:i.isLoading,fileContent:l.data?.content??null,isBinary:!!l.data?.isBinary,isContentLoading:l.isLoading}}function Oe({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,X.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,X.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):J(e,void 0)&&r===`preview`?(0,X.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,X.jsx)(z,{content:t})}):(0,X.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function ke({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:i,isInstalling:o=!1,isRemoving:s=!1}){let c=E(t),l=x(t),{fileEntries:u,setSelectedPath:f,activePath:p,activeFile:m,isFilesLoading:h,fileContent:_,isBinary:v,isContentLoading:y}=De(e,t.id),[S,C]=(0,Y.useState)(`preview`);(0,Y.useEffect)(()=>{C(`preview`)},[p]);let[w,ee]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{ee(document.getElementById(`viewport-overlays`))},[]);let O=m?J(m.name,void 0):!1,k=O?S:`raw`,j=(0,X.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(a,{variant:`ghost`,iconOnly:(0,X.jsx)(b,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,X.jsx)(Ae,{available:c,removable:l,isInstalling:o,isRemoving:s,onInstall:r,onRemove:i})]}),(0,X.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(D,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,X.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,X.jsx)(T,{origin:t.origin})]}),(0,X.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description})]}),(0,X.jsx)(d.Root,{asChild:!0,noPadding:!0,children:(0,X.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,X.jsx)(Me,{fileEntries:u,activePath:p,activeName:m?.name??null,onSelect:f}),(0,X.jsx)(g,{iconOnly:!0,ariaLabel:`File view mode`,value:k,onChange:C,items:[{value:`preview`,label:`Preview`,icon:(0,X.jsx)(W,{"aria-hidden":!0}),disabled:!O},{value:`raw`,label:`Source`,icon:(0,X.jsx)(A,{"aria-hidden":!0})}]})]}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:h||y?(0,X.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,X.jsx)(M,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):m?(0,X.jsx)(Oe,{fileName:m.name,content:_,isBinary:v,viewMode:k}):(0,X.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return w?(0,Te.createPortal)(j,w):j}function Ae({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:i,onRemove:o}){return n||r?(0,X.jsx)(a,{variant:`ghost`,iconOnly:(0,X.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,X.jsx)(a,{variant:`ghost`,iconOnly:(0,X.jsx)(q,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:i,disabled:!i,className:`max-md:bg-[var(--surface-active)]`}):t?(0,X.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,X.jsx)(G,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,X.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,X.jsx)(G,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function je(e){return(e??``).endsWith(`/directory`)}function Me({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,X.jsx)(Ne,{}),(0,X.jsx)(`span`,{className:`truncate`,children:i})]}):(0,X.jsxs)(f.Root,{children:[(0,X.jsx)(f.Trigger,{children:(0,X.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,X.jsx)(Ne,{}),(0,X.jsx)(`span`,{className:`truncate`,children:i}),(0,X.jsx)(ge,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,X.jsx)(f.Content,{align:`start`,children:e.map(e=>{let n=je(e.mimeType);return(0,X.jsx)(f.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,X.jsx)(se,{}):(0,X.jsx)(B,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Ne(){return(0,X.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,X.jsx)(B,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}var Z=[{value:`all`,label:`All`,icon:K},{value:`installed`,label:`Installed`,icon:R},{value:`available`,label:`Available`,icon:q}],Pe=[{value:`vellum`,label:`Vellum`,icon:S},{value:`clawhub`,label:`Clawhub`,icon:j},{value:`skillssh`,label:`skills.sh`,icon:ce},{value:`custom`,label:`Custom`,icon:V}];function Fe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(h,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,X.jsx)(U,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,X.jsx)(M,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,X.jsx)(Ie,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function Ie(e){let t=oe(),[n,r]=(0,Y.useState)(!1),i=(0,X.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,X.jsx)(ye,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,X.jsx)(Le,{...e,open:n,onOpenChange:r,trigger:i}):(0,X.jsxs)(m.Root,{open:n,onOpenChange:r,children:[(0,X.jsx)(m.Trigger,{asChild:!0,children:i}),(0,X.jsx)(m.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,X.jsxs)(`ul`,{role:`listbox`,children:[(0,X.jsx)(Re,{label:`Status`,options:Z,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,X.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,X.jsx)(Re,{label:`Source`,options:Pe,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})]})})]})}function Le({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:i,counts:o,totalCount:s,showCounts:c,open:l,onOpenChange:u,trigger:d}){let f=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,X.jsxs)(_.Root,{open:l,onOpenChange:u,children:[(0,X.jsx)(_.Trigger,{asChild:!0,children:d}),(0,X.jsxs)(_.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,X.jsx)(_.Header,{children:(0,X.jsx)(_.Title,{children:`Filters`})}),(0,X.jsxs)(_.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,X.jsx)(Q,{label:`Status`,children:Z.map(n=>(0,X.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,X.jsx)(Q,{label:`Source`,children:Pe.map(n=>(0,X.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,X.jsxs)(Q,{label:`Categories`,children:[(0,X.jsx)($,{icon:K,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),f.map(e=>(0,X.jsx)($,{icon:Se(e.icon)??K,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,X.jsx)(_.Footer,{children:(0,X.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Q({label:e,children:t}){return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function $({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,X.jsx)(v,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,X.jsx)(me,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function Re({label:e,options:t,selected:n,onSelect:r}){return(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,X.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,X.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,X.jsx)(R,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function ze({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:i=!1,isRemoving:o=!1}){let s=E(e),c=x(e);return(0,X.jsx)(d.Root,{asChild:!0,children:(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,X.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,X.jsx)(D,{skill:e,className:`h-7 w-7`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,X.jsx)(T,{origin:e.origin})]}),(0,X.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?i?(0,X.jsx)(a,{type:`button`,iconOnly:(0,X.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,X.jsx)(a,{type:`button`,iconOnly:(0,X.jsx)(q,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,X.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,X.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}):(0,X.jsx)(G,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}function Be(e){return c({...I({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}function Ve(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:return{origin:e};default:return{}}}function He(e){return[...e].sort((e,t)=>{let n=C(e);return n===C(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function Ue(e,t){let[n,r]=(0,Y.useState)(e);return(0,Y.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var We=300,Ge=`vellum:skills:tipDismissed`;function Ke({assistantId:e,initialSkillId:r}){let i=s(),a=oe(),[o,u]=(0,Y.useState)(``),d=Ue(o.trim(),We),[f,m]=(0,Y.useState)(`all`),[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(r??null),[y,b]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(null),[C,T]=(0,Y.useState)(null),[E,D]=(0,Y.useState)(()=>n(Ge,!1)),{data:O=[]}=Be(e),{origin:k,kind:A}=(0,Y.useMemo)(()=>Ve(f),[f]),j=c({...ie({path:{assistant_id:e},query:{include:`catalog`,origin:k,kind:A,q:d||void 0,category:h??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e}),te=c({...ie({path:{assistant_id:e},query:{include:`catalog`,origin:k,kind:A,q:d||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&h!==null}),M=(0,Y.useCallback)(()=>{i.invalidateQueries({queryKey:re({path:{assistant_id:e}})})},[e,i]),N=l({mutationFn:t=>ee(e,t),onMutate:e=>b(e),onSettled:()=>{b(null),M()}}),P=ne({onMutate:e=>S(e.path.id),onSettled:()=>{S(null),M()}}),F=(0,Y.useCallback)(e=>{N.mutate(e.slug??e.id)},[N]),I=(0,Y.useCallback)(e=>{T(e)},[]),L=(0,Y.useCallback)(()=>{C&&(P.mutate({path:{assistant_id:e,id:C.id}}),T(null))},[e,C,P]),ae=(0,Y.useCallback)(()=>{D(!0),t(Ge,!0)},[]),R=(0,Y.useMemo)(()=>j.data?.skills??[],[j.data?.skills]),z=h===null?j.data:te.data,{counts:B,totalCount:V}=qe(z?.skills??R,z?.categoryCounts,z?.totalCount),H=(0,Y.useMemo)(()=>He(R),[R]),U=(0,Y.useMemo)(()=>_?R.find(e=>e.id===_)??null:null,[R,_]),W=(0,X.jsx)(p,{open:C!==null,title:`Remove skill`,message:C?`Remove "${C.name}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:L,onCancel:()=>T(null)});if(U){let t={assistantId:e,skill:U,onBack:()=>v(null),onInstall:()=>F(U),onRemove:()=>I(U),isInstalling:y===(U.slug??U.id),isRemoving:x===U.id};return(0,X.jsxs)(X.Fragment,{children:[a?(0,X.jsx)(ke,{...t}):(0,X.jsx)(w,{...t}),W]})}let G=j.isFetching&&!!d;return(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!E&&(0,X.jsx)(Je,{onDismiss:ae}),(0,X.jsx)(Fe,{search:o,onSearchChange:u,filter:f,onFilterChange:m,isSearching:G,categories:O,category:h,onCategoryChange:g,counts:B,totalCount:V,showCounts:!G}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,X.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,X.jsx)(Ce,{selected:h,onSelect:g,counts:B,totalCount:V,showCounts:!G,categories:O})}),(0,X.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:j.isLoading?(0,X.jsx)(Ye,{}):j.isError?(0,X.jsx)(Xe,{}):H.length===0?(0,X.jsx)(Ze,{filter:f,category:h}):(0,X.jsx)(`ul`,{className:`flex flex-col gap-2`,children:H.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(ze,{skill:e,onSelect:()=>v(e.id),onInstall:()=>F(e),onRemove:()=>I(e),isInstalling:y===(e.slug??e.id),isRemoving:x===e.id})},e.id))})})]}),W]})}function qe(e,t,n){return(0,Y.useMemo)(()=>{if(t&&Object.keys(t).length>0)return{counts:t,totalCount:n??e.length};let r={};for(let t of e){let e=t.category??`system`;r[e]=(r[e]??0)+1}return{counts:r,totalCount:n??e.length}},[e,t,n])}function Je({onDismiss:e}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,X.jsx)(N,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,X.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,X.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,X.jsx)(F,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Ye(){return(0,X.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,X.jsx)(M,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Xe(){return(0,X.jsx)(d.Root,{children:(0,X.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,X.jsx)(P,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,X.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load skills`}),(0,X.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function Ze({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=Qe(e,t);return(0,X.jsx)(d.Root,{children:(0,X.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,X.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,X.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,X.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function Qe(e,t){if(t)return{title:`No skills in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:K};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:_e};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:R};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:he};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:j};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:ce};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:V};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:k}}}function $e(){let e=ve(),[t]=o();return(0,X.jsx)(Ke,{assistantId:e,initialSkillId:t.get(`skill`)??void 0})}export{$e as SkillsPage};
|