@vellumai/web 0.10.0-staging.2 → 0.10.0-staging.3

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.
Files changed (76) hide show
  1. package/dist/assets/{account-page-D5qDx37o.js → account-page-B5rB7loj.js} +1 -1
  2. package/dist/assets/{add-credits-modal-DpHTkxV2.js → add-credits-modal-BEX4_5jj.js} +1 -1
  3. package/dist/assets/{advanced-page-DWX9qbxa.js → advanced-page-9RUi4YCF.js} +1 -1
  4. package/dist/assets/{ai-page-Cp6X0S2W.js → ai-page-CZj92XF4.js} +1 -1
  5. package/dist/assets/{api-key-screen-DvV4RiY0.js → api-key-screen-CUKjlF2C.js} +1 -1
  6. package/dist/assets/{archive-page-B7i9-bc2.js → archive-page-YsBlmevd.js} +1 -1
  7. package/dist/assets/{billing-page-CMhUfBBf.js → billing-page-DgX2YBSA.js} +1 -1
  8. package/dist/assets/{bookmarks-page-BBlx8L6h.js → bookmarks-page-DRcIBBva.js} +1 -1
  9. package/dist/assets/{command-palette-yIWk_niH.js → command-palette-BXEAR93M.js} +1 -1
  10. package/dist/assets/{command-palette-window-page-CHu_bF8J.js → command-palette-window-page-5SP_Ft4Y.js} +1 -1
  11. package/dist/assets/{community-page-CiartSQX.js → community-page-D5-exeNr.js} +1 -1
  12. package/dist/assets/{contacts-page-route-C9IaBKKe.js → contacts-page-route-C9T-8Sdr.js} +1 -1
  13. package/dist/assets/{debug-page-DGQMqihK.js → debug-page-ClQetFUa.js} +1 -1
  14. package/dist/assets/{deploy-dialogs-DWIqIDdv.js → deploy-dialogs-BtpYB7B8.js} +1 -1
  15. package/dist/assets/{developer-page-ClPMK7n8.js → developer-page-DQs8SZ8K.js} +1 -1
  16. package/dist/assets/{devices-page-N9s-okC5.js → devices-page-VsRsz6XP.js} +1 -1
  17. package/dist/assets/{dictation-overlay-page-D_eJHI6R.js → dictation-overlay-page-C5HFJIsY.js} +1 -1
  18. package/dist/assets/{document-viewer-page-CmSYAtEc.js → document-viewer-page-BLBwWqM4.js} +1 -1
  19. package/dist/assets/{earn-credits-modal-OFm9gF2_.js → earn-credits-modal-Dig03UD-.js} +1 -1
  20. package/dist/assets/{emails-page-psWdsGCD.js → emails-page-D9R72EQW.js} +1 -1
  21. package/dist/assets/{file-editor-CKotrZYQ.js → file-editor-HQXiGdH-.js} +1 -1
  22. package/dist/assets/{general-page-CaAos_hp.js → general-page-CMr5RhNh.js} +1 -1
  23. package/dist/assets/{hatching-screen-CtgkoJwM.js → hatching-screen-BAzE4aGD.js} +1 -1
  24. package/dist/assets/{home-page-route-syOFwCBN.js → home-page-route-JenDSLBl.js} +1 -1
  25. package/dist/assets/{hosting-screen-Duoz3ECF.js → hosting-screen-dPfTLCnv.js} +1 -1
  26. package/dist/assets/{identity-page-route-gCgQUpAC.js → identity-page-route-r9ZgIw8g.js} +1 -1
  27. package/dist/assets/{index-LP2PV_QY.js → index-BiN-6kWM.js} +23 -23
  28. package/dist/assets/{inspect-page-CYszP4kv.js → inspect-page-2cNMjT4e.js} +1 -1
  29. package/dist/assets/{install-BK1MtTfb.js → install-CHMiF_Hw.js} +1 -1
  30. package/dist/assets/{integrations-page-8RrTqdmS.js → integrations-page-BiLM3QyR.js} +1 -1
  31. package/dist/assets/{intelligence-layout-DMxSxRZX.js → intelligence-layout-CjDxFKQO.js} +1 -1
  32. package/dist/assets/{keyboard-shortcuts-page-q_QkRUkC.js → keyboard-shortcuts-page-DIhG1FK_.js} +1 -1
  33. package/dist/assets/{library-detail-page-_lrynJRj.js → library-detail-page-CjeBxuMc.js} +1 -1
  34. package/dist/assets/{library-page-CKh1x82Q.js → library-page-BFIPthR_.js} +1 -1
  35. package/dist/assets/{login-page-CDtyRiaq.js → login-page-KDH0IZ6y.js} +1 -1
  36. package/dist/assets/{logout-page-vdgRWyPg.js → logout-page-DI7i4Hok.js} +1 -1
  37. package/dist/assets/{logs-layout-btcFTD4i.js → logs-layout-BEMQQY7S.js} +1 -1
  38. package/dist/assets/{mcp-page-DdG8hp_Z.js → mcp-page-B7tUTzT0.js} +1 -1
  39. package/dist/assets/{memory-router-playground-page-Bt_KJsxN.js → memory-router-playground-page-JdkTEwPy.js} +1 -1
  40. package/dist/assets/{mobile-sidebar-drawer-Cd68jgRD.js → mobile-sidebar-drawer-DuJUmy0b.js} +1 -1
  41. package/dist/assets/{notifications-page-BilkBeoP.js → notifications-page-CmOvbV59.js} +1 -1
  42. package/dist/assets/{oauth-complete-page-BC7UElNs.js → oauth-complete-page-R_1ODIIi.js} +1 -1
  43. package/dist/assets/{oauth-popup-complete-page-CiTNEvfk.js → oauth-popup-complete-page-YECuZtPs.js} +1 -1
  44. package/dist/assets/{pairing-page-Dc-5wQmY.js → pairing-page-BtaFWq0w.js} +1 -1
  45. package/dist/assets/{plugin-detail-page-CtWtIYBW.js → plugin-detail-page-D6Gve0qx.js} +1 -1
  46. package/dist/assets/{plugins-page-1vkkdBfG.js → plugins-page-DA-JrehF.js} +1 -1
  47. package/dist/assets/{prechat-route-CG8Qo2Tq.js → prechat-route-BhzvRsw3.js} +1 -1
  48. package/dist/assets/{privacy-page-rNHkqHfs.js → privacy-page-Yex5OJjZ.js} +1 -1
  49. package/dist/assets/{privacy-screen-Cck6z5wu.js → privacy-screen-ccjT4S0F.js} +1 -1
  50. package/dist/assets/{provider-callback-page-CrZXFWM7.js → provider-callback-page-BS-DqV_M.js} +1 -1
  51. package/dist/assets/{research-mock-page-D7-VpSBh.js → research-mock-page-D0-sKBpu.js} +1 -1
  52. package/dist/assets/{research-onboarding-route-DAPVTFHs.js → research-onboarding-route-ZTgUGnrN.js} +1 -1
  53. package/dist/assets/{review-terms-screen-C8XTIUYc.js → review-terms-screen-DLWgKysx.js} +1 -1
  54. package/dist/assets/{select-assistant-screen-PZqDGbI2.js → select-assistant-screen-LNX6PpzR.js} +1 -1
  55. package/dist/assets/{settings-layout-ByZKbs5J.js → settings-layout-BA0suokL.js} +1 -1
  56. package/dist/assets/{share-feedback-modal-CuxFlSR6.js → share-feedback-modal-CFgHvfgR.js} +1 -1
  57. package/dist/assets/{sidebar-tree-BZUv9ggX.js → sidebar-tree-DALLHIeG.js} +1 -1
  58. package/dist/assets/{signup-page-BWnAp0Bw.js → signup-page-13TRI3CC.js} +1 -1
  59. package/dist/assets/{skills-page-BAodqgt1.js → skills-page-DiopOlcy.js} +1 -1
  60. package/dist/assets/{sounds-page-hDPPoEEQ.js → sounds-page-DE47aZrz.js} +1 -1
  61. package/dist/assets/{step-indicator-dots-CwbobrxS.js → step-indicator-dots-BOKv1I4C.js} +1 -1
  62. package/dist/assets/{subagent-detail-panel-Db9feY1I.js → subagent-detail-panel-BdPp2LMK.js} +1 -1
  63. package/dist/assets/{system-events-page-DYi0jI1g.js → system-events-page-DcaF2EuX.js} +1 -1
  64. package/dist/assets/{tiptap-document-editor-DD5B0bf0.js → tiptap-document-editor-DjIQ9tCC.js} +1 -1
  65. package/dist/assets/{tool-detail-panel-DZf8WIS6.js → tool-detail-panel-C6uFi3_6.js} +1 -1
  66. package/dist/assets/{trace-page-DSDi-YYp.js → trace-page-4MU66DDM.js} +1 -1
  67. package/dist/assets/{upgrade-cancel-page-DHzkb9An.js → upgrade-cancel-page-D2-xTACq.js} +1 -1
  68. package/dist/assets/{upgrade-success-page-CIooZvxn.js → upgrade-success-page-DLjl6978.js} +1 -1
  69. package/dist/assets/{usage-page-XWL-WFaq.js → usage-page-CCBqWkRU.js} +1 -1
  70. package/dist/assets/{voice-page-BwA-ETwe.js → voice-page-VrJ7AZrg.js} +1 -1
  71. package/dist/assets/{weather-forecast-display-tzc5l6oR.js → weather-forecast-display-DKMPxDv5.js} +1 -1
  72. package/dist/assets/{welcome-screen-BkL_1qYq.js → welcome-screen-DVeLGZKg.js} +1 -1
  73. package/dist/assets/{workflow-detail-panel-DYQvTG3m.js → workflow-detail-panel-BgDWu3_4.js} +1 -1
  74. package/dist/assets/{workspace-page-t_8JOOXv.js → workspace-page-BlVlfXIt.js} +1 -1
  75. package/dist/index.html +1 -1
  76. package/package.json +1 -1
@@ -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-BuSDabCt.js";import{N as s,f as c,i as l,n as u}from"./auth-store-CrTf0uWL.js";import{a as d}from"./routes-BKwsRssF.js";import{d as f,f as p,l as m,u as h}from"./prefs-Mrqh1A7Y.js";import{t as g}from"./client-feature-flag-store-ivPVcKfH.js";import{ft as _}from"./index-LP2PV_QY.js";import{a as v,c as y,i as b,n as x,o as S,t as C}from"./step-indicator-dots-CwbobrxS.js";import{n as w,t as T}from"./consent-controls-cNdj_gb8.js";var E=e(t(),1),D=a();function O(){let e=r(),[t]=i(),a=u.use.user()?.id??null,O=o(),k=s(),A=S(g.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[j,M]=h(),[N,P]=f(),[F,I]=p(),[L,R]=m(),z=l();(0,E.useEffect)(()=>{k||v()},[k]);let B=t.get(`preview`)===`true`,V=(0,E.useCallback)(e=>{},[]),H=B?V:M,U=B?V:P,W=B?V:I,G=B?V:R,K=(0,E.useCallback)(()=>{if(B){e(`${d.onboarding.prechat}?preview=true`);return}if(c({userId:a,tos:F,privacy:L,shareAnalytics:j,shareDiagnostics:N,hasPlatformSession:z}),!k){let e=y(A);b(x.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${d.onboarding.hatching}${i?`?${i}`:``}`)},[L,z,k,B,e,A,t,j,N,F,a]);return(0,D.jsx)(_,{children:(0,D.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${O?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[k&&(0,D.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,D.jsx)(C,{current:2,total:3})}),(0,D.jsx)(`h1`,{className:O?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,D.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${O?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,D.jsx)(w,{electron:O,shareAnalytics:j,shareDiagnostics:N,onShareAnalyticsChange:H,onShareDiagnosticsChange:U,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,D.jsx)(T,{electron:O,privacyConsent:L,tosAccepted:F,onPrivacyChange:G,onTosChange:W,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,D.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${O?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,D.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!F||!L,onClick:K,className:O?void 0:`h-11 text-base`,children:`Start`}),(0,D.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:O?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{O as PrivacyScreen};
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-BuSDabCt.js";import{N as s,f as c,i as l,n as u}from"./auth-store-CrTf0uWL.js";import{a as d}from"./routes-BKwsRssF.js";import{d as f,f as p,l as m,u as h}from"./prefs-Mrqh1A7Y.js";import{t as g}from"./client-feature-flag-store-ivPVcKfH.js";import{ft as _}from"./index-BiN-6kWM.js";import{a as v,c as y,i as b,n as x,o as S,t as C}from"./step-indicator-dots-BOKv1I4C.js";import{n as w,t as T}from"./consent-controls-cNdj_gb8.js";var E=e(t(),1),D=a();function O(){let e=r(),[t]=i(),a=u.use.user()?.id??null,O=o(),k=s(),A=S(g.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[j,M]=h(),[N,P]=f(),[F,I]=p(),[L,R]=m(),z=l();(0,E.useEffect)(()=>{k||v()},[k]);let B=t.get(`preview`)===`true`,V=(0,E.useCallback)(e=>{},[]),H=B?V:M,U=B?V:P,W=B?V:I,G=B?V:R,K=(0,E.useCallback)(()=>{if(B){e(`${d.onboarding.prechat}?preview=true`);return}if(c({userId:a,tos:F,privacy:L,shareAnalytics:j,shareDiagnostics:N,hasPlatformSession:z}),!k){let e=y(A);b(x.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${d.onboarding.hatching}${i?`?${i}`:``}`)},[L,z,k,B,e,A,t,j,N,F,a]);return(0,D.jsx)(_,{children:(0,D.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${O?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[k&&(0,D.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,D.jsx)(C,{current:2,total:3})}),(0,D.jsx)(`h1`,{className:O?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,D.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${O?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,D.jsx)(w,{electron:O,shareAnalytics:j,shareDiagnostics:N,onShareAnalyticsChange:H,onShareDiagnosticsChange:U,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,D.jsx)(T,{electron:O,privacyConsent:L,tosAccepted:F,onPrivacyChange:G,onTosChange:W,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,D.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${O?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,D.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!F||!L,onClick:K,className:O?void 0:`h-11 text-base`,children:`Start`}),(0,D.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:O?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{O as PrivacyScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-B0wqOYKY.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{S as s,f as c}from"./local-mode-9ZkSq1Fr.js";import{I as l,V as u,l as d,n as f}from"./auth-store-CrTf0uWL.js";import{c as p}from"./api-BSHLYsxJ.js";import{a as m}from"./routes-BKwsRssF.js";import{a as h,i as g}from"./login-flow-BMwbZfKA.js";import{n as _}from"./index-LP2PV_QY.js";import{r as v,t as y}from"./account-shell-oWV1wIYb.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await u(),r=l(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await p();if(e.ok&&e.data.length>0&&(await s(e.data,d.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-B0wqOYKY.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{S as s,f as c}from"./local-mode-9ZkSq1Fr.js";import{I as l,V as u,l as d,n as f}from"./auth-store-CrTf0uWL.js";import{c as p}from"./api-BSHLYsxJ.js";import{a as m}from"./routes-BKwsRssF.js";import{a as h,i as g}from"./login-flow-BMwbZfKA.js";import{n as _}from"./index-BiN-6kWM.js";import{r as v,t as y}from"./account-shell-oWV1wIYb.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await u(),r=l(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await p();if(e.ok&&e.data.length>0&&(await s(e.data,d.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-BKwsRssF.js";import{t as s}from"./client-feature-flag-store-ivPVcKfH.js";import{t as c}from"./conversation-store-BSxi0r0X.js";import{t as l}from"./conversation-selection-BMndnV1U.js";import{pt as u}from"./index-LP2PV_QY.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[`Summarize this week's AI model releases for me`,`Draft a technical blog post from your latest notes`,`Build a tracker for competitor product launches`,`Analyze a CSV of metrics and surface the trends`];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),[y,b]=(0,d.useState)(!1),x=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:x,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showDeeperDiveCard:!y,showSuggestions:y,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onDeeperDive:()=>b(!0),onGoodForNow:()=>b(!0),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
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,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-BKwsRssF.js";import{t as s}from"./client-feature-flag-store-ivPVcKfH.js";import{t as c}from"./conversation-store-BSxi0r0X.js";import{t as l}from"./conversation-selection-BMndnV1U.js";import{pt as u}from"./index-BiN-6kWM.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[`Summarize this week's AI model releases for me`,`Draft a technical blog post from your latest notes`,`Build a tracker for competitor product launches`,`Analyze a CSV of metrics and surface the trends`];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),[y,b]=(0,d.useState)(!1),x=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:x,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showDeeperDiveCard:!y,showSuggestions:y,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onDeeperDive:()=>b(!0),onGoodForNow:()=>b(!0),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
@@ -1,4 +1,4 @@
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,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./input-CwdmSRlD.js";import{n as s,q as c}from"./auth-store-CrTf0uWL.js";import{a as l}from"./routes-BKwsRssF.js";import{t as u}from"./client-feature-flag-store-ivPVcKfH.js";import{an as d,ft as f,yt as p}from"./index-LP2PV_QY.js";import{t as m}from"./prechat-names-BZIP2Y-H.js";var h=e(t(),1);function g({firstName:e,lastName:t,occupation:n}){let r=[e.trim(),t.trim()].filter(Boolean).join(` `),i=n.trim();return`${[r?`My name is ${r}.`:``,i?`I work as ${i}.`:``].filter(Boolean).join(` `)||`I'd like you to get to know me before we start working together.`}
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,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./input-CwdmSRlD.js";import{n as s,q as c}from"./auth-store-CrTf0uWL.js";import{a as l}from"./routes-BKwsRssF.js";import{t as u}from"./client-feature-flag-store-ivPVcKfH.js";import{an as d,ft as f,yt as p}from"./index-BiN-6kWM.js";import{t as m}from"./prechat-names-BZIP2Y-H.js";var h=e(t(),1);function g({firstName:e,lastName:t,occupation:n}){let r=[e.trim(),t.trim()].filter(Boolean).join(` `),i=n.trim();return`${[r?`My name is ${r}.`:``,i?`I work as ${i}.`:``].filter(Boolean).join(` `)||`I'd like you to get to know me before we start working together.`}
2
2
 
3
3
  Before we dive in, 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). It's fine to make reasonable inferences and label them honestly.
4
4
 
@@ -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-BuSDabCt.js";import{f as s,i as c,n as l}from"./auth-store-CrTf0uWL.js";import{t as u}from"./return-to-Bc7amvZZ.js";import{a as d}from"./routes-BKwsRssF.js";import{c as f,d as p,f as m,l as h,s as g,u as _}from"./prefs-Mrqh1A7Y.js";import{Vr as v,ft as y,ta as b}from"./index-LP2PV_QY.js";import{n as x,t as S}from"./consent-controls-cNdj_gb8.js";var C=e(t(),1),w=a();function T(){let e=r(),[t]=i(),a=l.use.user()?.id??null,T=l.use.logout(),E=o(),D=c(),[O,k]=m(),[A,j]=h(),[M,N]=_(),[P,F]=p(),[I]=g(),[L]=f(),[R]=(0,C.useState)(()=>!O),[z]=(0,C.useState)(()=>!A),[B]=(0,C.useState)(()=>!I),[V]=(0,C.useState)(()=>!L),H=!R&&!z&&!B&&!V,U=R||H,W=z||H,G=B||H,K=V||H,q=!H&&!R&&!z,J=H?`Terms & privacy`:q?`Review your privacy preferences`:`Updated terms`,Y=H?`Review your terms and privacy preferences anytime.`:q?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,X=(0,C.useCallback)(()=>{s({userId:a,tos:O,privacy:A,shareAnalytics:M,shareDiagnostics:P,hasPlatformSession:D}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[A,D,e,t,M,P,O,a]),Z=(0,C.useCallback)(async()=>{await T(),v(d.account.login)},[T]);return(0,w.jsx)(y,{showCreatureFooter:!1,children:(0,w.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${E?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,w.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,w.jsx)(b,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,w.jsx)(`h1`,{className:`mt-5 ${E?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:J}),(0,w.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${E?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Y}),(G||K)&&(0,w.jsx)(x,{electron:E,showAnalytics:G,showDiagnostics:K,shareAnalytics:M,shareDiagnostics:P,onShareAnalyticsChange:N,onShareDiagnosticsChange:F,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(W||U)&&(0,w.jsx)(S,{electron:E,showPrivacy:W,showTos:U,privacyConsent:A,tosAccepted:O,onPrivacyChange:j,onTosChange:k,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,w.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${E?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,w.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:U&&!O||W&&!A,onClick:X,className:E?void 0:`h-11 text-base`,children:`Continue`}),(0,w.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:Z,className:E?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{T as ReviewTermsScreen};
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-BuSDabCt.js";import{f as s,i as c,n as l}from"./auth-store-CrTf0uWL.js";import{t as u}from"./return-to-Bc7amvZZ.js";import{a as d}from"./routes-BKwsRssF.js";import{c as f,d as p,f as m,l as h,s as g,u as _}from"./prefs-Mrqh1A7Y.js";import{Vr as v,ft as y,ta as b}from"./index-BiN-6kWM.js";import{n as x,t as S}from"./consent-controls-cNdj_gb8.js";var C=e(t(),1),w=a();function T(){let e=r(),[t]=i(),a=l.use.user()?.id??null,T=l.use.logout(),E=o(),D=c(),[O,k]=m(),[A,j]=h(),[M,N]=_(),[P,F]=p(),[I]=g(),[L]=f(),[R]=(0,C.useState)(()=>!O),[z]=(0,C.useState)(()=>!A),[B]=(0,C.useState)(()=>!I),[V]=(0,C.useState)(()=>!L),H=!R&&!z&&!B&&!V,U=R||H,W=z||H,G=B||H,K=V||H,q=!H&&!R&&!z,J=H?`Terms & privacy`:q?`Review your privacy preferences`:`Updated terms`,Y=H?`Review your terms and privacy preferences anytime.`:q?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,X=(0,C.useCallback)(()=>{s({userId:a,tos:O,privacy:A,shareAnalytics:M,shareDiagnostics:P,hasPlatformSession:D}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[A,D,e,t,M,P,O,a]),Z=(0,C.useCallback)(async()=>{await T(),v(d.account.login)},[T]);return(0,w.jsx)(y,{showCreatureFooter:!1,children:(0,w.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${E?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,w.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,w.jsx)(b,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,w.jsx)(`h1`,{className:`mt-5 ${E?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:J}),(0,w.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${E?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Y}),(G||K)&&(0,w.jsx)(x,{electron:E,showAnalytics:G,showDiagnostics:K,shareAnalytics:M,shareDiagnostics:P,onShareAnalyticsChange:N,onShareDiagnosticsChange:F,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(W||U)&&(0,w.jsx)(S,{electron:E,showPrivacy:W,showTos:U,privacyConsent:A,tosAccepted:O,onPrivacyChange:j,onTosChange:k,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,w.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${E?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,w.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:U&&!O||W&&!A,onClick:X,className:E?void 0:`h-11 text-base`,children:`Continue`}),(0,w.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:Z,className:E?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{T as ReviewTermsScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-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-DbNUkFt6.js";import{t as s}from"./modal-DX6UN7b0.js";import{E as c,N as l,O as u,u as d,z as f}from"./local-mode-9ZkSq1Fr.js";import{t as p}from"./is-electron-BuSDabCt.js";import{n as m}from"./resolved-assistants-store-DMuRxkZC.js";import{G as h,i as g,l as _,n as v}from"./auth-store-CrTf0uWL.js";import{a as y}from"./routes-BKwsRssF.js";import{t as ee}from"./use-onboarding-login-CxXV3Iue.js";import{Fa as b,Mt as x,ft as S,ho as C,jt as w,to as T}from"./index-LP2PV_QY.js";import{r as E}from"./format-date-B6hTwbOM.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)(w,{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(`fromSettings`)===`1`,s=p(),b=g(),C=m.use.assistants(),w=_.use.currentOrganizationId(),{loading:T,error:E,login:j,cancel:M}=ee(),P=e=>e.isLocal||b,F=C.filter(P),I=C.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=h(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(e)||f(e))&&d(t.id)?K(t):W(`Failed to connect. Please try again.`),B(!1)}},Q=()=>{K(null),J(!1),X(null),H(!1)},te=async()=>{if(!(!G||q)){J(!0),X(null);try{let e=await u(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)}},ne=async()=>{if(!(!G||q)){J(!0),X(null);try{let t=await x(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||C.length!==0&&C.length===1&&F.length===1&&(H(!0),Z(F[0]))},[C.length,F.length]);let re=()=>{let e=C.find(e=>e.id===L);e&&Z(e)},ie=()=>{e(y.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(S,{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)(S,{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:C.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:re,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:ie,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 te(),onRetire:()=>void ne()})]})}function N({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=j(e),o=p();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)(b,{className:`h-5 w-5`}):(0,O.jsx)(T,{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)(C,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{M as SelectAssistantScreen};
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-DbNUkFt6.js";import{t as s}from"./modal-DX6UN7b0.js";import{E as c,N as l,O as u,u as d,z as f}from"./local-mode-9ZkSq1Fr.js";import{t as p}from"./is-electron-BuSDabCt.js";import{n as m}from"./resolved-assistants-store-DMuRxkZC.js";import{G as h,i as g,l as _,n as v}from"./auth-store-CrTf0uWL.js";import{a as y}from"./routes-BKwsRssF.js";import{t as ee}from"./use-onboarding-login-CxXV3Iue.js";import{Fa as b,Mt as x,ft as S,ho as C,jt as w,to as T}from"./index-BiN-6kWM.js";import{r as E}from"./format-date-B6hTwbOM.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)(w,{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(`fromSettings`)===`1`,s=p(),b=g(),C=m.use.assistants(),w=_.use.currentOrganizationId(),{loading:T,error:E,login:j,cancel:M}=ee(),P=e=>e.isLocal||b,F=C.filter(P),I=C.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=h(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(e)||f(e))&&d(t.id)?K(t):W(`Failed to connect. Please try again.`),B(!1)}},Q=()=>{K(null),J(!1),X(null),H(!1)},te=async()=>{if(!(!G||q)){J(!0),X(null);try{let e=await u(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)}},ne=async()=>{if(!(!G||q)){J(!0),X(null);try{let t=await x(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||C.length!==0&&C.length===1&&F.length===1&&(H(!0),Z(F[0]))},[C.length,F.length]);let re=()=>{let e=C.find(e=>e.id===L);e&&Z(e)},ie=()=>{e(y.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(S,{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)(S,{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:C.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:re,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:ie,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 te(),onRetire:()=>void ne()})]})}function N({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=j(e),o=p();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)(b,{className:`h-5 w-5`}):(0,O.jsx)(T,{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)(C,{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-BuSDabCt.js";import{t as s}from"./log-in-DOSWwTiS.js";import{i as c}from"./auth-store-CrTf0uWL.js";import{a as l}from"./routes-BKwsRssF.js";import{t as u}from"./client-feature-flag-store-ivPVcKfH.js";import{t as d}from"./use-onboarding-login-CxXV3Iue.js";import{t as f}from"./assistant-feature-flag-store-D2CUHsmL.js";import{Br as p,It as m,Z as h,ka as g}from"./index-LP2PV_QY.js";import{n as _,t as v}from"./sidebar-tree-BZUv9ggX.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=m({platformHostedOnly:!0}),C=m(),{pathname:w}=i(),T=n(),E=c(),{login:D}=d(),O=(0,y.useMemo)(()=>h.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(...h.filter(e=>e.id===`developer`)),t.push(E?{id:`logout`,label:`Log Out`,icon:g,onSelect:()=>void p(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=h.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
+ 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-BuSDabCt.js";import{t as s}from"./log-in-DOSWwTiS.js";import{i as c}from"./auth-store-CrTf0uWL.js";import{a as l}from"./routes-BKwsRssF.js";import{t as u}from"./client-feature-flag-store-ivPVcKfH.js";import{t as d}from"./use-onboarding-login-CxXV3Iue.js";import{t as f}from"./assistant-feature-flag-store-D2CUHsmL.js";import{Br as p,It as m,Z as h,ka as g}from"./index-BiN-6kWM.js";import{n as _,t as v}from"./sidebar-tree-DALLHIeG.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=m({platformHostedOnly:!0}),C=m(),{pathname:w}=i(),T=n(),E=c(),{login:D}=d(),O=(0,y.useMemo)(()=>h.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(...h.filter(e=>e.id===`developer`)),t.push(E?{id:`logout`,label:`Log Out`,icon:g,onSelect:()=>void p(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=h.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-G5Imd5pC.js";import{n as u,t as d}from"./input-CwdmSRlD.js";import{t as f}from"./toggle-_vZlLDBV.js";import{t as p}from"./is-electron-BuSDabCt.js";import{t as m}from"./bug-BIPj7Nbx.js";import{t as h}from"./info-BJtskZc-.js";import{t as g}from"./loader-circle-CTs38Ovl.js";import{t as _}from"./x-Dz7msELe.js";import{Jt as v}from"./sdk.gen-Bew9wO5C.js";import{n as y}from"./auth-store-CrTf0uWL.js";import{t as b}from"./dist-nMnxT9pm.js";import{t as x}from"./impersonate-version-flag-ZdQOgpO3.js";import{Ea as S,Na as C,Oa as ee,Ur as w,Wn as te,ba as T,ia as ne}from"./index-LP2PV_QY.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:C,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:S,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=w(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),w=(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(te()),[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)(ee,{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)(T,{}),onClick:()=>w.current?.click(),disabled:W.length>=I,children:`Add files`}),(0,j.jsx)(`input`,{ref:w,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)(ne,{}),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)(T,{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-G5Imd5pC.js";import{n as u,t as d}from"./input-CwdmSRlD.js";import{t as f}from"./toggle-_vZlLDBV.js";import{t as p}from"./is-electron-BuSDabCt.js";import{t as m}from"./bug-BIPj7Nbx.js";import{t as h}from"./info-BJtskZc-.js";import{t as g}from"./loader-circle-CTs38Ovl.js";import{t as _}from"./x-Dz7msELe.js";import{Jt as v}from"./sdk.gen-Bew9wO5C.js";import{n as y}from"./auth-store-CrTf0uWL.js";import{t as b}from"./dist-nMnxT9pm.js";import{t as x}from"./impersonate-version-flag-ZdQOgpO3.js";import{Ea as S,Na as C,Oa as ee,Ur as w,Wn as te,ba as T,ia as ne}from"./index-BiN-6kWM.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:C,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:S,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=w(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),w=(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(te()),[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)(ee,{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)(T,{}),onClick:()=>w.current?.click(),disabled:W.length>=I,children:`Add files`}),(0,j.jsx)(`input`,{ref:w,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)(ne,{}),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)(T,{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-D6Nu2Lol.js";import{t as l}from"./is-electron-BuSDabCt.js";import{t as u}from"./arrow-left-DpZuwfUr.js";import{t as d}from"./chevron-right-HpmykQ8I.js";import{a as f}from"./routes-BKwsRssF.js";import{n as p}from"./use-is-mobile-CvT53Qs1.js";import{t as m}from"./haptics-BtSYrQNK.js";import{Nt as h,Zt as g}from"./index-LP2PV_QY.js";var _=e(t(),1),v=20,y=100,b=.3,x=.7,S=10,C=.3,w=200,T=180,E=200,D=.25,O=50;function k(e){return Math.min(y,e*b)}function A(e,t){return Math.abs(t)>Math.abs(e)*x}function j(e,t){return Math.abs(e)<S&&Math.abs(t)<S?`pending`:A(e,t)||e<=0?`cancel`:`confirm`}function M(e,t){return e<=t?e:t+(e-t)*C}function N(e,t){return e>=t}function P(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function F({containerRef:e,onBack:t,enabled:n,navKey:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(t),o=(0,_.useRef)(n),s=(0,_.useRef)(!1);(0,_.useLayoutEffect)(()=>{a.current=t,o.current=n},[t,n]),(0,_.useEffect)(()=>{if(!g())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=()=>P(t),u=()=>k(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 ${w}ms ease-out`,d(0);let e=()=>{t.removeEventListener(`transitionend`,e),l()};t.addEventListener(`transitionend`,e,{once:!0}),c(l,w+O)}else l()},h=()=>{t.style.transition=`transform ${T}ms ease-in`,d(window.innerWidth);let e=!1,n=()=>{if(e||r)return;e=!0,t.removeEventListener(`transitionend`,n);let i=-(window.innerWidth*D);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())},E*2)};t.addEventListener(`transitionend`,n,{once:!0}),c(n,T+O)},_=e=>{if(!o.current||i.current||e.touches.length!==1)return;let t=e.touches[0];t&&(t.clientX>v||(i.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1}))},y=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=j(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(A(a,o)&&a<s){p(!0);return}let c=M(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&&N(r,u())?(i.current=null,h()):t.confirmed?p(!0):p(!1)},x=()=>{i.current?.confirmed?p(!0):p(!1)};return document.addEventListener(`touchstart`,_,{passive:!0}),document.addEventListener(`touchmove`,y,{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`,_),document.removeEventListener(`touchmove`,y),document.removeEventListener(`touchend`,b),document.removeEventListener(`touchcancel`,x),l()}},[e]),(0,_.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),P(t))};t.style.transition=`transform ${E}ms ease-out, opacity ${E}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,E+O);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),P(t)}},[r,e])}var I=o();function L({sidebar:e,children:t,actions:o,backHref:c,title:d=`Settings`,menuRoute:m=f.settings.root}){let{pathname:g}=a(),v=r(),y=g===m,b=p(),x=(0,_.useRef)(null),S=y?c:m;F({containerRef:x,onBack:(0,_.useCallback)(()=>{v(S)},[v,S]),enabled:b&&!y,navKey:g});let C=l(),w=y?`Back from ${d}`:`Back to ${d} menu`,T=(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(u,{}),"aria-label":w,tintColor:`var(--content-secondary)`,onClick:()=>v(S)}),E=(0,I.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${d}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,I.jsx)(i,{to:c,className:`flex items-center justify-center no-underline`,children:(0,I.jsx)(u,{size:16,"aria-hidden":`true`})})});return(0,I.jsxs)(`div`,{ref:x,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:C?`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,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[T,(0,I.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,I.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),C?(0,I.jsx)(`div`,{className:`shrink-0 pb-4 empty:hidden`,children:(0,I.jsx)(h,{placement:`electron`,className:`px-0 pt-0`})}):null,(0,I.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,I.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[E,(0,I.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:d})]}),(0,I.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,I.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${d} navigation`,children:e}),y?(0,I.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,I.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 ${y?`hidden`:`flex`}`,children:t})]})]})]})}function R({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,I.jsxs)(_.Fragment,{children:[(0,I.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,I.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,I.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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.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{L as n,R as t};
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-D6Nu2Lol.js";import{t as l}from"./is-electron-BuSDabCt.js";import{t as u}from"./arrow-left-DpZuwfUr.js";import{t as d}from"./chevron-right-HpmykQ8I.js";import{a as f}from"./routes-BKwsRssF.js";import{n as p}from"./use-is-mobile-CvT53Qs1.js";import{t as m}from"./haptics-BtSYrQNK.js";import{Nt as h,Zt as g}from"./index-BiN-6kWM.js";var _=e(t(),1),v=20,y=100,b=.3,x=.7,S=10,C=.3,w=200,T=180,E=200,D=.25,O=50;function k(e){return Math.min(y,e*b)}function A(e,t){return Math.abs(t)>Math.abs(e)*x}function j(e,t){return Math.abs(e)<S&&Math.abs(t)<S?`pending`:A(e,t)||e<=0?`cancel`:`confirm`}function M(e,t){return e<=t?e:t+(e-t)*C}function N(e,t){return e>=t}function P(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function F({containerRef:e,onBack:t,enabled:n,navKey:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(t),o=(0,_.useRef)(n),s=(0,_.useRef)(!1);(0,_.useLayoutEffect)(()=>{a.current=t,o.current=n},[t,n]),(0,_.useEffect)(()=>{if(!g())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=()=>P(t),u=()=>k(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 ${w}ms ease-out`,d(0);let e=()=>{t.removeEventListener(`transitionend`,e),l()};t.addEventListener(`transitionend`,e,{once:!0}),c(l,w+O)}else l()},h=()=>{t.style.transition=`transform ${T}ms ease-in`,d(window.innerWidth);let e=!1,n=()=>{if(e||r)return;e=!0,t.removeEventListener(`transitionend`,n);let i=-(window.innerWidth*D);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())},E*2)};t.addEventListener(`transitionend`,n,{once:!0}),c(n,T+O)},_=e=>{if(!o.current||i.current||e.touches.length!==1)return;let t=e.touches[0];t&&(t.clientX>v||(i.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1}))},y=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=j(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(A(a,o)&&a<s){p(!0);return}let c=M(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&&N(r,u())?(i.current=null,h()):t.confirmed?p(!0):p(!1)},x=()=>{i.current?.confirmed?p(!0):p(!1)};return document.addEventListener(`touchstart`,_,{passive:!0}),document.addEventListener(`touchmove`,y,{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`,_),document.removeEventListener(`touchmove`,y),document.removeEventListener(`touchend`,b),document.removeEventListener(`touchcancel`,x),l()}},[e]),(0,_.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),P(t))};t.style.transition=`transform ${E}ms ease-out, opacity ${E}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,E+O);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),P(t)}},[r,e])}var I=o();function L({sidebar:e,children:t,actions:o,backHref:c,title:d=`Settings`,menuRoute:m=f.settings.root}){let{pathname:g}=a(),v=r(),y=g===m,b=p(),x=(0,_.useRef)(null),S=y?c:m;F({containerRef:x,onBack:(0,_.useCallback)(()=>{v(S)},[v,S]),enabled:b&&!y,navKey:g});let C=l(),w=y?`Back from ${d}`:`Back to ${d} menu`,T=(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(u,{}),"aria-label":w,tintColor:`var(--content-secondary)`,onClick:()=>v(S)}),E=(0,I.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${d}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,I.jsx)(i,{to:c,className:`flex items-center justify-center no-underline`,children:(0,I.jsx)(u,{size:16,"aria-hidden":`true`})})});return(0,I.jsxs)(`div`,{ref:x,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:C?`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,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[T,(0,I.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,I.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),C?(0,I.jsx)(`div`,{className:`shrink-0 pb-4 empty:hidden`,children:(0,I.jsx)(h,{placement:`electron`,className:`px-0 pt-0`})}):null,(0,I.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,I.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[E,(0,I.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:d})]}),(0,I.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,I.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${d} navigation`,children:e}),y?(0,I.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,I.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 ${y?`hidden`:`flex`}`,children:t})]})]})]})}function R({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,I.jsxs)(_.Fragment,{children:[(0,I.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,I.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,I.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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.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{L as n,R 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-BuSDabCt.js";import{A as o,j as s}from"./auth-store-CrTf0uWL.js";import{a as c}from"./routes-BKwsRssF.js";import{n as l,r as u}from"./login-flow-BMwbZfKA.js";import{t as d}from"./proxy-CQsxT9tJ.js";import{J as f,R as p,W as m}from"./index-LP2PV_QY.js";import{t as h}from"./signup-shell-D6LXKfGy.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)(f,{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)(p,{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};
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-BuSDabCt.js";import{A as o,j as s}from"./auth-store-CrTf0uWL.js";import{a as c}from"./routes-BKwsRssF.js";import{n as l,r as u}from"./login-flow-BMwbZfKA.js";import{t as d}from"./proxy-CQsxT9tJ.js";import{J as f,R as p,W as m}from"./index-BiN-6kWM.js";import{t as h}from"./signup-shell-D6LXKfGy.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)(f,{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)(p,{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};
@@ -1 +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-BvyV91Np.js";import"./src-D6Nu2Lol.js";import{t as p}from"./confirm-dialog-DbNUkFt6.js";import{t as m}from"./popover-PnyzuDx3.js";import{t as h}from"./input-CwdmSRlD.js";import{n as g}from"./stat-square-B5tBfA4w.js";import{n as _,t as v}from"./panel-item-BFOUNXY1.js";import{t as y}from"./createLucideIcon-DIlBzeWM.js";import{t as b}from"./arrow-left-DpZuwfUr.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-BK1MtTfb.js";import{t as O}from"./calendar-Dm2Jn-zV.js";import{t as k}from"./cloud-off-DJomNBuZ.js";import{t as A}from"./code-CXddtaOh.js";import{t as j}from"./globe-BV8ouh66.js";import{t as te}from"./link-2-BedDg97D.js";import{t as M}from"./loader-circle-CTs38Ovl.js";import{t as N}from"./sparkles-B9QIWdq0.js";import{t as P}from"./triangle-alert-M_S_Pe8C.js";import{t as F}from"./x-Dz7msELe.js";import{Gt as ne,_t as re,gt as ie,ht as I,mt as ae,pt as oe}from"./react-query.gen-DdB0sQgj.js";import{n as se}from"./use-is-mobile-CvT53Qs1.js";import{$i as L,Ca as R,Ea as z,H as B,Ha as V,Ki as H,Li as U,Oa as W,Pa as G,U as K,Ui as ce,Wa as q,aa as le,fo as J,ho as ue,mo as de,qa as fe,qi as pe,ra as me,xa as he,xo as Y,za as ge}from"./index-LP2PV_QY.js";import{t as _e}from"./use-active-assistant-id-512RohBL.js";var ve=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`}]]),ye=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`}]]),X=e(r(),1),be={mail:W,calendar:O,"message-circle":z,globe:j,zap:U,code:A,mic:R,"shopping-cart":L,palette:ye,heart:ge,settings:me,"link-2":te};function xe(e){return be[e]}var Z=u();function Se({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,Z.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":`Skill categories`,children:[(0,Z.jsx)(Ce,{icon:G,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),o.map(r=>(0,Z.jsx)(Ce,{icon:xe(r.icon)??G,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function Ce({icon:e,label:t,count:n,isActive:r,showCount:i,onClick:o}){return(0,Z.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,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,Z.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),i&&(0,Z.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}var we=e(i(),1);function Te(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function Ee(e,t){let[n,r]=(0,X.useState)(null),i=c({...ae({path:{assistant_id:e,id:t}}),select:e=>e??null}),a=(0,X.useMemo)(()=>i.data?.files??[],[i.data]),o=(0,X.useMemo)(()=>a.find(e=>e.name===`SKILL.md`),[a]),s=Te(a,n),l=c({...oe({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 De({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.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,Z.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,`.`]}):K(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(B,{content:t})}):(0,Z.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 Oe({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}=Ee(e,t.id),[S,C]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{C(`preview`)},[p]);let[w,ee]=(0,X.useState)(null);(0,X.useEffect)(()=>{ee(document.getElementById(`viewport-overlays`))},[]);let O=m?K(m.name,void 0):!1,k=O?S:`raw`,j=(0,Z.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,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(b,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.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,Z.jsx)(ke,{available:c,removable:l,isInstalling:o,isRemoving:s,onInstall:r,onRemove:i})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(D,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(T,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description})]}),(0,Z.jsx)(d.Root,{asChild:!0,noPadding:!0,children:(0,Z.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,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(je,{fileEntries:u,activePath:p,activeName:m?.name??null,onSelect:f}),(0,Z.jsx)(g,{iconOnly:!0,ariaLabel:`File view mode`,value:k,onChange:C,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(fe,{"aria-hidden":!0}),disabled:!O},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(A,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:h||y?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(M,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):m?(0,Z.jsx)(De,{fileName:m.name,content:_,isBinary:v,viewMode:k}):(0,Z.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,we.createPortal)(j,w):j}function ke({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:i,onRemove:o}){return n||r?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(Y,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:i,disabled:!i,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(H,{"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,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(H,{"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 Ae(e){return(e??``).endsWith(`/directory`)}function je({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(f.Root,{children:[(0,Z.jsx)(f.Trigger,{children:(0,Z.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,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(de,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(f.Content,{align:`start`,children:e.map(e=>{let n=Ae(e.mimeType);return(0,Z.jsx)(f.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(V,{}):(0,Z.jsx)(q,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Me(){return(0,Z.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,Z.jsx)(q,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}var Ne=[{value:`all`,label:`All`,icon:G},{value:`installed`,label:`Installed`,icon:J},{value:`available`,label:`Available`,icon:Y}],Pe=[{value:`vellum`,label:`Vellum`,icon:S},{value:`clawhub`,label:`Clawhub`,icon:j},{value:`skillssh`,label:`skills.sh`,icon:pe},{value:`custom`,label:`Custom`,icon:ce}];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,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(h,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,Z.jsx)(le,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,Z.jsx)(M,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Z.jsx)(Ie,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function Ie(e){let t=se(),[n,r]=(0,X.useState)(!1),i=(0,Z.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(ve,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,Z.jsx)(Le,{...e,open:n,onOpenChange:r,trigger:i}):(0,Z.jsxs)(m.Root,{open:n,onOpenChange:r,children:[(0,Z.jsx)(m.Trigger,{asChild:!0,children:i}),(0,Z.jsx)(m.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,Z.jsxs)(`ul`,{role:`listbox`,children:[(0,Z.jsx)(Re,{label:`Status`,options:Ne,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,Z.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,Z.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,Z.jsxs)(_.Root,{open:l,onOpenChange:u,children:[(0,Z.jsx)(_.Trigger,{asChild:!0,children:d}),(0,Z.jsxs)(_.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,Z.jsx)(_.Header,{children:(0,Z.jsx)(_.Title,{children:`Filters`})}),(0,Z.jsxs)(_.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,Z.jsx)(Q,{label:`Status`,children:Ne.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsx)(Q,{label:`Source`,children:Pe.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsxs)(Q,{label:`Categories`,children:[(0,Z.jsx)($,{icon:G,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),f.map(e=>(0,Z.jsx)($,{icon:xe(e.icon)??G,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,Z.jsx)(_.Footer,{children:(0,Z.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Q({label:e,children:t}){return(0,Z.jsxs)(`div`,{children:[(0,Z.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,Z.jsx)(v,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,Z.jsx)(ue,{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,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,Z.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,Z.jsx)(`li`,{children:(0,Z.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,Z.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,Z.jsx)(J,{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,Z.jsx)(d.Root,{asChild:!0,children:(0,Z.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,Z.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,Z.jsx)(D,{skill:e,className:`h-7 w-7`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,Z.jsx)(T,{origin:e.origin})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?i?(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(Y,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,Z.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(H,{"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,X.useState)(e);return(0,X.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=se(),[o,u]=(0,X.useState)(``),d=Ue(o.trim(),We),[f,m]=(0,X.useState)(`all`),[h,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(r??null),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(null),[C,T]=(0,X.useState)(null),[E,D]=(0,X.useState)(()=>n(Ge,!1)),{data:O=[]}=Be(e),{origin:k,kind:A}=(0,X.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,X.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,X.useCallback)(e=>{N.mutate(e.slug??e.id)},[N]),I=(0,X.useCallback)(e=>{T(e)},[]),ae=(0,X.useCallback)(()=>{C&&(P.mutate({path:{assistant_id:e,id:C.id}}),T(null))},[e,C,P]),oe=(0,X.useCallback)(()=>{D(!0),t(Ge,!0)},[]),L=(0,X.useMemo)(()=>j.data?.skills??[],[j.data?.skills]),R=h===null?j.data:te.data,{counts:z,totalCount:B}=qe(R?.skills??L,R?.categoryCounts,R?.totalCount),V=(0,X.useMemo)(()=>He(L),[L]),H=(0,X.useMemo)(()=>_?L.find(e=>e.id===_)??null:null,[L,_]),U=(0,Z.jsx)(p,{open:C!==null,title:`Remove skill`,message:C?`Remove "${C.name}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:ae,onCancel:()=>T(null)});if(H){let t={assistantId:e,skill:H,onBack:()=>v(null),onInstall:()=>F(H),onRemove:()=>I(H),isInstalling:y===(H.slug??H.id),isRemoving:x===H.id};return(0,Z.jsxs)(Z.Fragment,{children:[a?(0,Z.jsx)(Oe,{...t}):(0,Z.jsx)(w,{...t}),U]})}let W=j.isFetching&&!!d;return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!E&&(0,Z.jsx)(Je,{onDismiss:oe}),(0,Z.jsx)(Fe,{search:o,onSearchChange:u,filter:f,onFilterChange:m,isSearching:W,categories:O,category:h,onCategoryChange:g,counts:z,totalCount:B,showCounts:!W}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,Z.jsx)(Se,{selected:h,onSelect:g,counts:z,totalCount:B,showCounts:!W,categories:O})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:j.isLoading?(0,Z.jsx)(Ye,{}):j.isError?(0,Z.jsx)(Xe,{}):V.length===0?(0,Z.jsx)(Ze,{filter:f,category:h}):(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:V.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.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))})})]}),U]})}function qe(e,t,n){return(0,X.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,Z.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,Z.jsx)(N,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,Z.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(F,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Ye(){return(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Z.jsx)(M,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Xe(){return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(P,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load skills`}),(0,Z.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,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,Z.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:G};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:U};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:J};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:pe};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:ce};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:k}}}function $e(){let e=_e(),[t]=o();return(0,Z.jsx)(Ke,{assistantId:e,initialSkillId:t.get(`skill`)??void 0})}export{$e as SkillsPage};
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-BvyV91Np.js";import"./src-D6Nu2Lol.js";import{t as p}from"./confirm-dialog-DbNUkFt6.js";import{t as m}from"./popover-PnyzuDx3.js";import{t as h}from"./input-CwdmSRlD.js";import{n as g}from"./stat-square-B5tBfA4w.js";import{n as _,t as v}from"./panel-item-BFOUNXY1.js";import{t as y}from"./createLucideIcon-DIlBzeWM.js";import{t as b}from"./arrow-left-DpZuwfUr.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-CHMiF_Hw.js";import{t as O}from"./calendar-Dm2Jn-zV.js";import{t as k}from"./cloud-off-DJomNBuZ.js";import{t as A}from"./code-CXddtaOh.js";import{t as j}from"./globe-BV8ouh66.js";import{t as te}from"./link-2-BedDg97D.js";import{t as M}from"./loader-circle-CTs38Ovl.js";import{t as N}from"./sparkles-B9QIWdq0.js";import{t as P}from"./triangle-alert-M_S_Pe8C.js";import{t as F}from"./x-Dz7msELe.js";import{Gt as ne,_t as re,gt as ie,ht as I,mt as ae,pt as oe}from"./react-query.gen-DdB0sQgj.js";import{n as se}from"./use-is-mobile-CvT53Qs1.js";import{$i as L,Ca as R,Ea as z,H as B,Ha as V,Ki as H,Li as U,Oa as W,Pa as G,U as K,Ui as ce,Wa as q,aa as le,fo as J,ho as ue,mo as de,qa as fe,qi as pe,ra as me,xa as he,xo as Y,za as ge}from"./index-BiN-6kWM.js";import{t as _e}from"./use-active-assistant-id-512RohBL.js";var ve=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`}]]),ye=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`}]]),X=e(r(),1),be={mail:W,calendar:O,"message-circle":z,globe:j,zap:U,code:A,mic:R,"shopping-cart":L,palette:ye,heart:ge,settings:me,"link-2":te};function xe(e){return be[e]}var Z=u();function Se({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,Z.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":`Skill categories`,children:[(0,Z.jsx)(Ce,{icon:G,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),o.map(r=>(0,Z.jsx)(Ce,{icon:xe(r.icon)??G,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function Ce({icon:e,label:t,count:n,isActive:r,showCount:i,onClick:o}){return(0,Z.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,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,Z.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),i&&(0,Z.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}var we=e(i(),1);function Te(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function Ee(e,t){let[n,r]=(0,X.useState)(null),i=c({...ae({path:{assistant_id:e,id:t}}),select:e=>e??null}),a=(0,X.useMemo)(()=>i.data?.files??[],[i.data]),o=(0,X.useMemo)(()=>a.find(e=>e.name===`SKILL.md`),[a]),s=Te(a,n),l=c({...oe({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 De({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.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,Z.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,`.`]}):K(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(B,{content:t})}):(0,Z.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 Oe({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}=Ee(e,t.id),[S,C]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{C(`preview`)},[p]);let[w,ee]=(0,X.useState)(null);(0,X.useEffect)(()=>{ee(document.getElementById(`viewport-overlays`))},[]);let O=m?K(m.name,void 0):!1,k=O?S:`raw`,j=(0,Z.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,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(b,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.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,Z.jsx)(ke,{available:c,removable:l,isInstalling:o,isRemoving:s,onInstall:r,onRemove:i})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(D,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(T,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description})]}),(0,Z.jsx)(d.Root,{asChild:!0,noPadding:!0,children:(0,Z.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,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(je,{fileEntries:u,activePath:p,activeName:m?.name??null,onSelect:f}),(0,Z.jsx)(g,{iconOnly:!0,ariaLabel:`File view mode`,value:k,onChange:C,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(fe,{"aria-hidden":!0}),disabled:!O},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(A,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:h||y?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(M,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):m?(0,Z.jsx)(De,{fileName:m.name,content:_,isBinary:v,viewMode:k}):(0,Z.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,we.createPortal)(j,w):j}function ke({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:i,onRemove:o}){return n||r?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(Y,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:i,disabled:!i,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(H,{"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,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(H,{"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 Ae(e){return(e??``).endsWith(`/directory`)}function je({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(f.Root,{children:[(0,Z.jsx)(f.Trigger,{children:(0,Z.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,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(de,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(f.Content,{align:`start`,children:e.map(e=>{let n=Ae(e.mimeType);return(0,Z.jsx)(f.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(V,{}):(0,Z.jsx)(q,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Me(){return(0,Z.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,Z.jsx)(q,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}var Ne=[{value:`all`,label:`All`,icon:G},{value:`installed`,label:`Installed`,icon:J},{value:`available`,label:`Available`,icon:Y}],Pe=[{value:`vellum`,label:`Vellum`,icon:S},{value:`clawhub`,label:`Clawhub`,icon:j},{value:`skillssh`,label:`skills.sh`,icon:pe},{value:`custom`,label:`Custom`,icon:ce}];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,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(h,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,Z.jsx)(le,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,Z.jsx)(M,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Z.jsx)(Ie,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function Ie(e){let t=se(),[n,r]=(0,X.useState)(!1),i=(0,Z.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(ve,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,Z.jsx)(Le,{...e,open:n,onOpenChange:r,trigger:i}):(0,Z.jsxs)(m.Root,{open:n,onOpenChange:r,children:[(0,Z.jsx)(m.Trigger,{asChild:!0,children:i}),(0,Z.jsx)(m.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,Z.jsxs)(`ul`,{role:`listbox`,children:[(0,Z.jsx)(Re,{label:`Status`,options:Ne,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,Z.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,Z.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,Z.jsxs)(_.Root,{open:l,onOpenChange:u,children:[(0,Z.jsx)(_.Trigger,{asChild:!0,children:d}),(0,Z.jsxs)(_.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,Z.jsx)(_.Header,{children:(0,Z.jsx)(_.Title,{children:`Filters`})}),(0,Z.jsxs)(_.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,Z.jsx)(Q,{label:`Status`,children:Ne.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsx)(Q,{label:`Source`,children:Pe.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsxs)(Q,{label:`Categories`,children:[(0,Z.jsx)($,{icon:G,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),f.map(e=>(0,Z.jsx)($,{icon:xe(e.icon)??G,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,Z.jsx)(_.Footer,{children:(0,Z.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Q({label:e,children:t}){return(0,Z.jsxs)(`div`,{children:[(0,Z.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,Z.jsx)(v,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,Z.jsx)(ue,{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,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,Z.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,Z.jsx)(`li`,{children:(0,Z.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,Z.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,Z.jsx)(J,{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,Z.jsx)(d.Root,{asChild:!0,children:(0,Z.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,Z.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,Z.jsx)(D,{skill:e,className:`h-7 w-7`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,Z.jsx)(T,{origin:e.origin})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?i?(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(Y,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,Z.jsx)(M,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(H,{"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,X.useState)(e);return(0,X.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=se(),[o,u]=(0,X.useState)(``),d=Ue(o.trim(),We),[f,m]=(0,X.useState)(`all`),[h,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(r??null),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(null),[C,T]=(0,X.useState)(null),[E,D]=(0,X.useState)(()=>n(Ge,!1)),{data:O=[]}=Be(e),{origin:k,kind:A}=(0,X.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,X.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,X.useCallback)(e=>{N.mutate(e.slug??e.id)},[N]),I=(0,X.useCallback)(e=>{T(e)},[]),ae=(0,X.useCallback)(()=>{C&&(P.mutate({path:{assistant_id:e,id:C.id}}),T(null))},[e,C,P]),oe=(0,X.useCallback)(()=>{D(!0),t(Ge,!0)},[]),L=(0,X.useMemo)(()=>j.data?.skills??[],[j.data?.skills]),R=h===null?j.data:te.data,{counts:z,totalCount:B}=qe(R?.skills??L,R?.categoryCounts,R?.totalCount),V=(0,X.useMemo)(()=>He(L),[L]),H=(0,X.useMemo)(()=>_?L.find(e=>e.id===_)??null:null,[L,_]),U=(0,Z.jsx)(p,{open:C!==null,title:`Remove skill`,message:C?`Remove "${C.name}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:ae,onCancel:()=>T(null)});if(H){let t={assistantId:e,skill:H,onBack:()=>v(null),onInstall:()=>F(H),onRemove:()=>I(H),isInstalling:y===(H.slug??H.id),isRemoving:x===H.id};return(0,Z.jsxs)(Z.Fragment,{children:[a?(0,Z.jsx)(Oe,{...t}):(0,Z.jsx)(w,{...t}),U]})}let W=j.isFetching&&!!d;return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!E&&(0,Z.jsx)(Je,{onDismiss:oe}),(0,Z.jsx)(Fe,{search:o,onSearchChange:u,filter:f,onFilterChange:m,isSearching:W,categories:O,category:h,onCategoryChange:g,counts:z,totalCount:B,showCounts:!W}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,Z.jsx)(Se,{selected:h,onSelect:g,counts:z,totalCount:B,showCounts:!W,categories:O})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:j.isLoading?(0,Z.jsx)(Ye,{}):j.isError?(0,Z.jsx)(Xe,{}):V.length===0?(0,Z.jsx)(Ze,{filter:f,category:h}):(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:V.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.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))})})]}),U]})}function qe(e,t,n){return(0,X.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,Z.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,Z.jsx)(N,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,Z.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(F,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Ye(){return(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Z.jsx)(M,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Xe(){return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(P,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load skills`}),(0,Z.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,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,Z.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:G};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:U};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:J};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:pe};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:ce};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:k}}}function $e(){let e=_e(),[t]=o();return(0,Z.jsx)(Ke,{assistantId:e,initialSkillId:t.get(`skill`)??void 0})}export{$e as SkillsPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DKhXIxGb.js";import{t as r}from"./useQuery-B45lW1Kk.js";import{t as i}from"./useMutation-Lj4VunQV.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-BibIM9x3.js";import{t as s}from"./toggle-_vZlLDBV.js";import{Ct as c,St as l,bt as u,vt as d}from"./react-query.gen-DdB0sQgj.js";import{a as f,i as p,n as m,r as h,t as g}from"./sound-manager-CC2af7bI.js";import{Ki as _,ha as v,mo as y}from"./index-LP2PV_QY.js";import{t as b}from"./use-active-assistant-id-512RohBL.js";var x=e(t(),1),S=a();function C({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(s,{checked:n,disabled:r,onChange:i,label:e})]})}function w(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function T({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:c}){let[l,u]=(0,x.useState)(!1),d=n.filter(e=>!t.sounds.includes(e.filename)),p=n.length>0&&d.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:m[e]}),(0,S.jsx)(s,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${m[e]}`})]}),t.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:f(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,S.jsx)(v,{className:`h-3 w-3`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,S.jsx)(_,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):p?(0,S.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,S.jsx)(y,{className:`h-3 w-3`})]}),l&&(0,S.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>u(!1),children:d.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),u(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function E(){let e=n(),t=b(),a=(0,x.useMemo)(()=>u({path:{assistant_id:t}}),[t]),s=(0,x.useMemo)(()=>d({path:{assistant_id:t}}),[t]),{data:f}=r(a),{data:m}=r(s),_=f??p(),y=m?.sounds??[],E=(0,x.useMemo)(()=>({path:{assistant_id:t}}),[t]),D=i({...c(E),onMutate:async t=>{await e.cancelQueries({queryKey:a.queryKey});let n=e.getQueryData(a.queryKey);return l(e,E,t.body),{previous:n}},onError:(t,n,r)=>{r?.previous!==void 0&&l(e,E,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:a.queryKey})}}),O=(0,x.useCallback)(n=>{let r=n(e.getQueryData(a.queryKey)??p());D.mutate({path:{assistant_id:t},body:r})},[t,a.queryKey,e,D]),k=e=>{O(t=>({...t,globalEnabled:e}))},A=e=>{O(t=>({...t,volume:e}))},[j,M]=(0,x.useState)(null),N=j??_.volume,P=(e,t)=>{O(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},F=(e,t)=>{O(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},I=(e,t)=>{O(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},L=()=>{g().previewFallbackBlip(_.volume)},R=e=>{g().previewSound(e,_.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(C,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:_.globalEnabled,onChange:k}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:N,onChange:e=>M(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},className:`h-1 w-48 cursor-pointer`,disabled:!_.globalEnabled,"aria-label":`Sound effect volume`}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(N*100),`%`]})]}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,S.jsxs)(`button`,{type:`button`,onClick:L,disabled:!_.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(v,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,S.jsxs)(o,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:h.map(e=>(0,S.jsx)(T,{event:e,eventConfig:_.events[e]??{enabled:!1,sounds:[]},availableSounds:y,globalEnabled:_.globalEnabled,onToggle:t=>P(e,t),onAddSound:t=>F(e,t),onRemoveSound:t=>I(e,t),onPreview:e=>R(e)},e))})]})]})}export{E as SoundsPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DKhXIxGb.js";import{t as r}from"./useQuery-B45lW1Kk.js";import{t as i}from"./useMutation-Lj4VunQV.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-BibIM9x3.js";import{t as s}from"./toggle-_vZlLDBV.js";import{Ct as c,St as l,bt as u,vt as d}from"./react-query.gen-DdB0sQgj.js";import{a as f,i as p,n as m,r as h,t as g}from"./sound-manager-CC2af7bI.js";import{Ki as _,ha as v,mo as y}from"./index-BiN-6kWM.js";import{t as b}from"./use-active-assistant-id-512RohBL.js";var x=e(t(),1),S=a();function C({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(s,{checked:n,disabled:r,onChange:i,label:e})]})}function w(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function T({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:c}){let[l,u]=(0,x.useState)(!1),d=n.filter(e=>!t.sounds.includes(e.filename)),p=n.length>0&&d.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:m[e]}),(0,S.jsx)(s,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${m[e]}`})]}),t.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:f(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,S.jsx)(v,{className:`h-3 w-3`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,S.jsx)(_,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):p?(0,S.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,S.jsx)(y,{className:`h-3 w-3`})]}),l&&(0,S.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>u(!1),children:d.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),u(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function E(){let e=n(),t=b(),a=(0,x.useMemo)(()=>u({path:{assistant_id:t}}),[t]),s=(0,x.useMemo)(()=>d({path:{assistant_id:t}}),[t]),{data:f}=r(a),{data:m}=r(s),_=f??p(),y=m?.sounds??[],E=(0,x.useMemo)(()=>({path:{assistant_id:t}}),[t]),D=i({...c(E),onMutate:async t=>{await e.cancelQueries({queryKey:a.queryKey});let n=e.getQueryData(a.queryKey);return l(e,E,t.body),{previous:n}},onError:(t,n,r)=>{r?.previous!==void 0&&l(e,E,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:a.queryKey})}}),O=(0,x.useCallback)(n=>{let r=n(e.getQueryData(a.queryKey)??p());D.mutate({path:{assistant_id:t},body:r})},[t,a.queryKey,e,D]),k=e=>{O(t=>({...t,globalEnabled:e}))},A=e=>{O(t=>({...t,volume:e}))},[j,M]=(0,x.useState)(null),N=j??_.volume,P=(e,t)=>{O(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},F=(e,t)=>{O(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},I=(e,t)=>{O(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},L=()=>{g().previewFallbackBlip(_.volume)},R=e=>{g().previewSound(e,_.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(C,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:_.globalEnabled,onChange:k}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:N,onChange:e=>M(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},className:`h-1 w-48 cursor-pointer`,disabled:!_.globalEnabled,"aria-label":`Sound effect volume`}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(N*100),`%`]})]}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,S.jsxs)(`button`,{type:`button`,onClick:L,disabled:!_.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(v,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,S.jsxs)(o,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:h.map(e=>(0,S.jsx)(T,{event:e,eventConfig:_.events[e]??{enabled:!1,sounds:[]},availableSounds:y,globalEnabled:_.globalEnabled,onToggle:t=>P(e,t),onAddSound:t=>F(e,t),onRemoveSound:t=>I(e,t),onPreview:e=>R(e)},e))})]})]})}export{E as SoundsPage};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{a as t}from"./prefs-Mrqh1A7Y.js";import{Wr as n}from"./index-LP2PV_QY.js";var r=`onboarding_v3_2026_05`,i=`onboarding.funnelSessionId`,a=`onboarding.funnelVariant`,o={control:`control`,paredDown:`pared_down`};function s(e){return e===`variant-a`?o.paredDown:o.control}var c={privacyTos:{stepName:`privacy_tos`,stepIndex:0},nameVibe:{stepName:`name_vibe`,stepIndex:1},controlWorkType:{stepName:`work_type`,stepIndex:2},controlTools:{stepName:`tools`,stepIndex:3},controlPriorAssistants:{stepName:`prior_assistants`,stepIndex:4},controlGmailConnect:{stepName:`gmail_connect`,stepIndex:5},controlGetApp:{stepName:`get_app`,stepIndex:6},gmailConnect:{stepName:`gmail_connect`,stepIndex:2}};function l(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function u(){if(typeof window>`u`)return crypto.randomUUID();let e=``;try{e=sessionStorage.getItem(i)??``}catch{e=``}if(e)return e;let t=crypto.randomUUID();try{sessionStorage.setItem(i,t)}catch{}return t}function d(e){return e===o.control||e===o.paredDown}function f(){if(typeof window>`u`)return null;try{let e=sessionStorage.getItem(a);return d(e)?e:null}catch{return null}}function p(e){let t=f();if(t)return t;if(typeof window>`u`)return e;try{sessionStorage.setItem(a,e)}catch{}return e}function m(e,t={}){let n=Date.now(),i=t.variant??f()??o.control;return{type:`onboarding`,daemon_event_id:crypto.randomUUID(),recorded_at:n,screen:e.stepName,session_id:u(),step_name:e.stepName,step_index:e.stepIndex,completed_at:new Date(n).toISOString(),user_id:t.userId??null,funnel_version:r,ab_variant:i}}function h(e,r={}){if(typeof window>`u`||!t())return;let i=l(m(e,r)),a=JSON.stringify({device_id:n(),assistant_version:`web-dev`,events:[i]});fetch(`/v1/telemetry/ingest/`,{method:`POST`,headers:{"Content-Type":`application/json`},body:a,keepalive:!0}).catch(()=>{})}var g=e();function _({current:e,total:t}){return(0,g.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Step ${e+1} of ${t}`,children:Array.from({length:t},(t,n)=>(0,g.jsx)(`div`,{"aria-hidden":`true`,className:`h-[3px] w-8 rounded-full transition-colors ${n<=e?`bg-[var(--content-default)]`:`bg-[var(--content-default)] opacity-20`}`},n))})}export{u as a,p as c,h as i,c as n,s as o,o as r,f as s,_ as t};
1
+ import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{a as t}from"./prefs-Mrqh1A7Y.js";import{Wr as n}from"./index-BiN-6kWM.js";var r=`onboarding_v3_2026_05`,i=`onboarding.funnelSessionId`,a=`onboarding.funnelVariant`,o={control:`control`,paredDown:`pared_down`};function s(e){return e===`variant-a`?o.paredDown:o.control}var c={privacyTos:{stepName:`privacy_tos`,stepIndex:0},nameVibe:{stepName:`name_vibe`,stepIndex:1},controlWorkType:{stepName:`work_type`,stepIndex:2},controlTools:{stepName:`tools`,stepIndex:3},controlPriorAssistants:{stepName:`prior_assistants`,stepIndex:4},controlGmailConnect:{stepName:`gmail_connect`,stepIndex:5},controlGetApp:{stepName:`get_app`,stepIndex:6},gmailConnect:{stepName:`gmail_connect`,stepIndex:2}};function l(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function u(){if(typeof window>`u`)return crypto.randomUUID();let e=``;try{e=sessionStorage.getItem(i)??``}catch{e=``}if(e)return e;let t=crypto.randomUUID();try{sessionStorage.setItem(i,t)}catch{}return t}function d(e){return e===o.control||e===o.paredDown}function f(){if(typeof window>`u`)return null;try{let e=sessionStorage.getItem(a);return d(e)?e:null}catch{return null}}function p(e){let t=f();if(t)return t;if(typeof window>`u`)return e;try{sessionStorage.setItem(a,e)}catch{}return e}function m(e,t={}){let n=Date.now(),i=t.variant??f()??o.control;return{type:`onboarding`,daemon_event_id:crypto.randomUUID(),recorded_at:n,screen:e.stepName,session_id:u(),step_name:e.stepName,step_index:e.stepIndex,completed_at:new Date(n).toISOString(),user_id:t.userId??null,funnel_version:r,ab_variant:i}}function h(e,r={}){if(typeof window>`u`||!t())return;let i=l(m(e,r)),a=JSON.stringify({device_id:n(),assistant_version:`web-dev`,events:[i]});fetch(`/v1/telemetry/ingest/`,{method:`POST`,headers:{"Content-Type":`application/json`},body:a,keepalive:!0}).catch(()=>{})}var g=e();function _({current:e,total:t}){return(0,g.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Step ${e+1} of ${t}`,children:Array.from({length:t},(t,n)=>(0,g.jsx)(`div`,{"aria-hidden":`true`,className:`h-[3px] w-8 rounded-full transition-colors ${n<=e?`bg-[var(--content-default)]`:`bg-[var(--content-default)] opacity-20`}`},n))})}export{u as a,p as c,h as i,c as n,s as o,o as r,f as s,_ as t};