@vellumai/web 0.12.6-staging.2 → 0.12.6

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 (211) hide show
  1. package/dist/assets/{a2a-invite-DLiMk0tx.js → a2a-invite-BfDyIsBX.js} +1 -1
  2. package/dist/assets/{about-page-CiMOdcNb.js → about-page-BigOjgfp.js} +1 -1
  3. package/dist/assets/{account-page-TK116SOZ.js → account-page-DbP0iNWg.js} +1 -1
  4. package/dist/assets/{account-shell-81SeJquZ.js → account-shell-CkJWoTHP.js} +1 -1
  5. package/dist/assets/{acp-run-detail-panel-CmPXAFIy.js → acp-run-detail-panel-DNMcOAkY.js} +1 -1
  6. package/dist/assets/{activation-list-route-CI0Q1kuF.js → activation-list-route-BbPqJODX.js} +1 -1
  7. package/dist/assets/{activity-redirect-page-C_U_6GGf.js → activity-redirect-page-CTGWJZqK.js} +1 -1
  8. package/dist/assets/{activity-steps-panel-C4gojUTz.js → activity-steps-panel-Dz34WmYH.js} +1 -1
  9. package/dist/assets/add-credits-modal-BtnHnN8V.js +1 -0
  10. package/dist/assets/{add-credits-modal-DckEY84t.js → add-credits-modal-DRBFth5G.js} +1 -1
  11. package/dist/assets/{ai-page-BmHi1DMy.js → ai-page-beQly0My.js} +1 -1
  12. package/dist/assets/{all-chats-page-route-Bar5pmkt.js → all-chats-page-route-DlZUO9J_.js} +1 -1
  13. package/dist/assets/{android-billing-handoff-CBj4G7HW.js → android-billing-handoff-CRfjXp7l.js} +1 -1
  14. package/dist/assets/{animated-stat-square-Dh0clEOc.js → animated-stat-square-B-JargN6.js} +1 -1
  15. package/dist/assets/{api-key-screen-CEZN1wmw.js → api-key-screen-jvDwbC50.js} +1 -1
  16. package/dist/assets/{app-6IVvZ0HU.css → app-CgzFhQCl.css} +1 -1
  17. package/dist/assets/{app-D0NlDYsG.js → app-DbJUeBix.js} +13 -13
  18. package/dist/assets/{app-info-D4RcR6ew.js → app-info-VAqkCXW3.js} +1 -1
  19. package/dist/assets/{archive-redirect-page-BzkHSKVl.js → archive-redirect-page-DZMdx89H.js} +1 -1
  20. package/dist/assets/{assistant-handle-modal-CH_OHdcF.js → assistant-handle-modal-C2RftL0v.js} +1 -1
  21. package/dist/assets/{assistant-inbox-page-route-B6wflkJF.js → assistant-inbox-page-route-DLSz1vYi.js} +1 -1
  22. package/dist/assets/{assistant-status-panel-DwkD7W_2.js → assistant-status-panel-BJpCnYoq.js} +1 -1
  23. package/dist/assets/auth-store-Cd-d1a4K.js +1 -0
  24. package/dist/assets/{auth-welcome-screen-DCozLA-c.js → auth-welcome-screen-Bng5AnvV.js} +1 -1
  25. package/dist/assets/avatar-bundled-components-DqGPWIMe.js +1 -0
  26. package/dist/assets/{avatar-random-DITwNAON.js → avatar-random-CVuabfEZ.js} +2 -2
  27. package/dist/assets/{await-org-header-settled-qqVu2-4K.js → await-org-header-settled-P4ncwaMI.js} +1 -1
  28. package/dist/assets/{background-task-detail-panel-DKAy68TE.js → background-task-detail-panel-BcllAg3N.js} +1 -1
  29. package/dist/assets/{billing-page-CKfb20qY.js → billing-page-D54LLGz1.js} +3 -3
  30. package/dist/assets/{billing-redirect-page-2osoPYFq.js → billing-redirect-page-DBSdrzJ7.js} +1 -1
  31. package/dist/assets/{bookmarks-page-BjXRVnIe.js → bookmarks-page-BQyOw7IR.js} +1 -1
  32. package/dist/assets/{bundle-confirm-page-CrdckyMV.js → bundle-confirm-page-BE0p_xZi.js} +1 -1
  33. package/dist/assets/{channel-transcript-panel-BuZfEA7U.js → channel-transcript-panel-BdL4iejZ.js} +1 -1
  34. package/dist/assets/{channels-page-route-Cg7kY8Ai.js → channels-page-route-BseMMdHV.js} +1 -1
  35. package/dist/assets/{chat-info-panel-DL7X3eOQ.js → chat-info-panel-C6px8Mlo.js} +1 -1
  36. package/dist/assets/{checkout-continuation-CY40TSs-.js → checkout-continuation-BniC3jRe.js} +1 -1
  37. package/dist/assets/{checkout-page-B0xOGseN.js → checkout-page-_P1Km-Pk.js} +1 -1
  38. package/dist/assets/checkout-return-target-B3XAFuN6.js +1 -0
  39. package/dist/assets/{command-palette-CQYESNwG.js → command-palette-BMTSC06x.js} +1 -1
  40. package/dist/assets/command-palette-BgqisOfz.js +1 -0
  41. package/dist/assets/{command-palette-window-page-BB81RrWx.js → command-palette-window-page-BlD7b2cA.js} +1 -1
  42. package/dist/assets/{community-page-BtRNJxo9.js → community-page-dezChmB7.js} +1 -1
  43. package/dist/assets/{companion-accent-DPZ9Nluh.js → companion-accent-C8bpme2H.js} +1 -1
  44. package/dist/assets/{companion-dock-zones-page-U9kZSVxS.js → companion-dock-zones-page-B4iVErZw.js} +1 -1
  45. package/dist/assets/{companion-layout-DjM8056C.js → companion-layout-DdDcoKuc.js} +1 -1
  46. package/dist/assets/{companion-popover-DwgXZsMW.js → companion-popover-BYFhyUGI.js} +1 -1
  47. package/dist/assets/{companion-popover-page-CcdLMpdW.js → companion-popover-page-CvizjjZk.js} +1 -1
  48. package/dist/assets/{companion-surface-Da1cTcgR.js → companion-surface-CjiszIMu.js} +1 -1
  49. package/dist/assets/{companion-surface-page--6xuXTFM.js → companion-surface-page-BIpW__dy.js} +1 -1
  50. package/dist/assets/{companion-tour-entry-GiftNvIY.js → companion-tour-entry-2hR1vArn.js} +1 -1
  51. package/dist/assets/{companion-watch-frame-page-BboeANE6.js → companion-watch-frame-page-LUmlRewI.js} +1 -1
  52. package/dist/assets/{connect-page-BqlDwAok.js → connect-page-uRvPpjMP.js} +1 -1
  53. package/dist/assets/{consent-controls-DtYOOcoG.js → consent-controls-DZEtlgAi.js} +1 -1
  54. package/dist/assets/{contacts-gateway-BUQHi3Rm.js → contacts-gateway-DI64mVLV.js} +1 -1
  55. package/dist/assets/{contacts-page-route-CapX1klb.js → contacts-page-route-C_UApZGi.js} +1 -1
  56. package/dist/assets/{copy-button-5QB6tIZi.js → copy-button-ZsDy0Kvk.js} +1 -1
  57. package/dist/assets/{credential-entry-page-C2yTTqSI.js → credential-entry-page-BeKm3_yM.js} +1 -1
  58. package/dist/assets/{credentials-page-DTZCc_jM.js → credentials-page-CLjmeZw3.js} +1 -1
  59. package/dist/assets/{csv-preview-Dg1E9gcw.js → csv-preview-C2fmutVQ.js} +1 -1
  60. package/dist/assets/{danger-zone-redirect-page-BxnmBzTy.js → danger-zone-redirect-page-D5Xk_8UY.js} +1 -1
  61. package/dist/assets/{debug-page-Cv3_hpaB.js → debug-page-tQ4hqmdO.js} +1 -1
  62. package/dist/assets/deploy-dialogs-BW3wFOZ-.js +1 -0
  63. package/dist/assets/{deploy-dialogs-Dy1YiAUx.js → deploy-dialogs-Hu5UmFuB.js} +1 -1
  64. package/dist/assets/{desktop-preview-content-_hBA655n.js → desktop-preview-content-CoZvaRAg.js} +2 -2
  65. package/dist/assets/{desktop-status-t3wLUynb.js → desktop-status-ZiDkY3z1.js} +1 -1
  66. package/dist/assets/{desktop-viewer-Zm7K7Goi.js → desktop-viewer-zD3tun-C.js} +1 -1
  67. package/dist/assets/{detail-card-BhbwKaee.js → detail-card-WMdjzPA_.js} +1 -1
  68. package/dist/assets/{detail-panel-stop-button-BR-k5Xmc.js → detail-panel-stop-button-CPVsXUuy.js} +1 -1
  69. package/dist/assets/{detail-primitives-Dgh4IUh2.js → detail-primitives-CAZf545a.js} +1 -1
  70. package/dist/assets/{developer-page-BeATC5qR.js → developer-page-DpSngWHa.js} +1 -1
  71. package/dist/assets/{devices-redirect-page-BjQ3ITZg.js → devices-redirect-page-BUydOv62.js} +1 -1
  72. package/dist/assets/{dictation-overlay-page-Dy5vIWxC.js → dictation-overlay-page-Cs5bufLA.js} +1 -1
  73. package/dist/assets/{document-load-Ca8B9f1j.js → document-load-CXdi-UrD.js} +1 -1
  74. package/dist/assets/document-load-Dyyzd-te.js +1 -0
  75. package/dist/assets/{document-viewer-page-BXGQ3JBX.js → document-viewer-page-R3nFa-RR.js} +1 -1
  76. package/dist/assets/{emails-page-DJBdc2in.js → emails-page-BUZyXttB.js} +1 -1
  77. package/dist/assets/{file-diff-view-C6IviiAg.js → file-diff-view-5WOLjbDI.js} +1 -1
  78. package/dist/assets/{file-view-mode-CusGxTrO.js → file-view-mode-D6Wxo-FH.js} +1 -1
  79. package/dist/assets/{general-page-BFn9KhSd.js → general-page-BgczK5kM.js} +1 -1
  80. package/dist/assets/{hatching-screen-BPBDkDXC.js → hatching-screen-DUME_h4W.js} +1 -1
  81. package/dist/assets/{hosting-screen-C_1tvRyn.js → hosting-screen-CQosTH53.js} +1 -1
  82. package/dist/assets/{identity-page-route-CBYR7Ik7.js → identity-page-route-CnUbEnOj.js} +1 -1
  83. package/dist/assets/{inspect-page-C1_GK1MG.js → inspect-page-B4pwuqL9.js} +3 -3
  84. package/dist/assets/{integrations-page-tVNddBNW.js → integrations-page-DfV4AIUY.js} +1 -1
  85. package/dist/assets/{intelligence-layout-B2AmY2BP.js → intelligence-layout-CAtJ8qJB.js} +1 -1
  86. package/dist/assets/{intelligence-layout-slots-store-D6qaMstC.js → intelligence-layout-slots-store-DSIw2NvD.js} +1 -1
  87. package/dist/assets/{keyboard-shortcuts-redirect-page-DCra2iW7.js → keyboard-shortcuts-redirect-page-eiKQBBin.js} +1 -1
  88. package/dist/assets/{latest-assistant-text-BvuWjv7_.js → latest-assistant-text-CU1nEv57.js} +1 -1
  89. package/dist/assets/{library-detail-page-DPas89E0.js → library-detail-page-D5TQdRPW.js} +1 -1
  90. package/dist/assets/{library-page-D9RL3HDn.js → library-page-CQHRf1us.js} +1 -1
  91. package/dist/assets/local-mode-glOMwWKw.js +1 -0
  92. package/dist/assets/{login-page-EuF3D2nA.js → login-page-nEJ8VtCM.js} +1 -1
  93. package/dist/assets/{logout-page-BNacG6Tt.js → logout-page-CRexidth.js} +1 -1
  94. package/dist/assets/{logs-layout-DnsMzvJ_.js → logs-layout-C1WQAyKd.js} +1 -1
  95. package/dist/assets/{markdown-preview-C2Z0FRTc.js → markdown-preview-FMAKqNG5.js} +1 -1
  96. package/dist/assets/{media-preview-BcSPsOfs.js → media-preview-DxyJX5PI.js} +1 -1
  97. package/dist/assets/{memory-page-route-CX33STIW.js → memory-page-route-Bt8cmhxi.js} +1 -1
  98. package/dist/assets/{memory-router-playground-page-DgzlohIX.js → memory-router-playground-page-B5SPYr3X.js} +1 -1
  99. package/dist/assets/{message-files-panel-Dc5JcFJT.js → message-files-panel-DM2OHYKS.js} +1 -1
  100. package/dist/assets/mutation-error-DsmwzTdH.js +1 -0
  101. package/dist/assets/native-attachment-pickers-Caaw_YOU.js +1 -0
  102. package/dist/assets/native-file-DICtaDdr.js +1 -0
  103. package/dist/assets/{notifications-page-BXm0OpJB.js → notifications-page-DRBXLm8k.js} +1 -1
  104. package/dist/assets/{oauth-complete-page-D0ymRcSM.js → oauth-complete-page-DgpDdc3q.js} +1 -1
  105. package/dist/assets/{oauth-popup-complete-page-8iZS6PLm.js → oauth-popup-complete-page-v6Kq8SKs.js} +1 -1
  106. package/dist/assets/paired-platform-identity-u4Q-YPGw.js +1 -0
  107. package/dist/assets/{pairing-page-ClXvlMJw.js → pairing-page-Oj52Prdb.js} +1 -1
  108. package/dist/assets/password-reset-page-D3ksp7Ej.js +1 -0
  109. package/dist/assets/{pdf-file-preview-Bl5mk1_3.js → pdf-file-preview-BhDsUdwQ.js} +1 -1
  110. package/dist/assets/{permission-guide-page-BbHEjtyD.js → permission-guide-page-C72w2Kmj.js} +1 -1
  111. package/dist/assets/{permission-setup-3fJQB-KB.js → permission-setup-CJJV_COn.js} +1 -1
  112. package/dist/assets/{personality-page-BTNI4eG5.js → personality-page-CvTaj6nv.js} +1 -1
  113. package/dist/assets/{personality-page-CFaJc26z.js → personality-page-smzeVdLh.js} +1 -1
  114. package/dist/assets/{personality-sliders-CJrh8-AP.js → personality-sliders-B9dseUZv.js} +1 -1
  115. package/dist/assets/{plans-page-DSDYvUo5.js → plans-page-CdJnxa9Q.js} +1 -1
  116. package/dist/assets/{platform-loopback-page-BDR7i_cY.js → platform-loopback-page-BmFqgelr.js} +1 -1
  117. package/dist/assets/{plugin-detail-page-BJfIO-HZ.js → plugin-detail-page-CFGniBM4.js} +1 -1
  118. package/dist/assets/{plugins-page-b9i4h7rI.js → plugins-page-BuHZ0XlZ.js} +1 -1
  119. package/dist/assets/plugins-surface-CYlZGgus.js +1 -0
  120. package/dist/assets/{preview-error-BKpqKOCK.js → preview-error-DycCFOOO.js} +1 -1
  121. package/dist/assets/{privacy-page-CWwydiKF.js → privacy-page-BTNM3CXN.js} +1 -1
  122. package/dist/assets/{privacy-screen-GBRjX2Y3.js → privacy-screen-BNyV1Jpv.js} +1 -1
  123. package/dist/assets/{profile-card-ClUTN6Rc.js → profile-card-CCv7LkYu.js} +1 -1
  124. package/dist/assets/{provider-callback-page-0z-aomMf.js → provider-callback-page-BiI5YuU7.js} +1 -1
  125. package/dist/assets/{provider-key-DTk8I67Q.js → provider-key-mKVB6Qhq.js} +1 -1
  126. package/dist/assets/{provider-signup-page-BKlREM_2.js → provider-signup-page-Dj_CGQAF.js} +1 -1
  127. package/dist/assets/{quick-input-page-Ddg_UlmO.js → quick-input-page-jYydiJfm.js} +1 -1
  128. package/dist/assets/referral-modal-CfWPpnvV.js +1 -0
  129. package/dist/assets/{referral-modal-DZObiadq.js → referral-modal-DgZAlouF.js} +1 -1
  130. package/dist/assets/{research-mock-page-CutRQF5f.js → research-mock-page-CDpXk7ca.js} +1 -1
  131. package/dist/assets/{research-onboarding-route-DBQZHDC7.js → research-onboarding-route-Se5ksePw.js} +1 -1
  132. package/dist/assets/{review-terms-screen-dBbWlnXP.js → review-terms-screen-Cy9FX3yC.js} +1 -1
  133. package/dist/assets/routes-Df2libs9.js +1 -0
  134. package/dist/assets/{schedules-page-BvbL-8N9.js → schedules-page-O2ueZz6n.js} +1 -1
  135. package/dist/assets/{schedules-0KQuWZ-V.js → schedules-rvMiqGp0.js} +1 -1
  136. package/dist/assets/{security-redirect-page-CH4u9S3v.js → security-redirect-page-B00kAvrV.js} +1 -1
  137. package/dist/assets/{select-assistant-screen-C5892FeX.js → select-assistant-screen-GuXyFlAh.js} +1 -1
  138. package/dist/assets/{self-hosted-servers-C__IKdzk.js → self-hosted-servers-B-57ZNA3.js} +1 -1
  139. package/dist/assets/{service-form-controls-CjcwqBZf.js → service-form-controls-DZJcQaNO.js} +1 -1
  140. package/dist/assets/{setting-row-oSonbOdy.js → setting-row-BuBlxds2.js} +1 -1
  141. package/dist/assets/{settings-layout-Cf0NuysH.js → settings-layout-B_sC3oOX.js} +1 -1
  142. package/dist/assets/{share-feedback-modal-C7IjV0PW.js → share-feedback-modal-Dg6x94HR.js} +1 -1
  143. package/dist/assets/share-feedback-modal-n7ZgtNxB.js +1 -0
  144. package/dist/assets/{sidebar-tree-BLqbyk5v.js → sidebar-tree-BLMAqL8a.js} +1 -1
  145. package/dist/assets/{signup-page-BTkcbn24.js → signup-page-CF6CvKYm.js} +1 -1
  146. package/dist/assets/{signup-shell-DrGfLGsz.js → signup-shell-BUn2lHTO.js} +1 -1
  147. package/dist/assets/{skill-detail-page-DZ_FXWFT.js → skill-detail-page-B7oLoGRE.js} +1 -1
  148. package/dist/assets/{skill-detail-panel-xL20TJgL.js → skill-detail-panel-BgTf3-Jj.js} +1 -1
  149. package/dist/assets/{skill-removal-dialog-C4WF7sn9.js → skill-removal-dialog-DwT8ZoB9.js} +1 -1
  150. package/dist/assets/{skills-page-C0ikFeI-.js → skills-page-hxGLH0Yi.js} +1 -1
  151. package/dist/assets/{sounds-page-BYZulvt8.js → sounds-page-C1u9YUVJ.js} +1 -1
  152. package/dist/assets/{start-screen-CjIOV9Ig.js → start-screen-DfzPyvUq.js} +1 -1
  153. package/dist/assets/{step-detail-header-BsK4vZvH.js → step-detail-header-CdUCWAlu.js} +1 -1
  154. package/dist/assets/{stt-language-picker-modal-ArB52Kbp.js → stt-language-picker-modal-0IKnLGpu.js} +1 -1
  155. package/dist/assets/{subagent-detail-panel-Cqr5RNAr.js → subagent-detail-panel-CtkJH9-r.js} +1 -1
  156. package/dist/assets/{superpowers-page-CM-_gkRq.js → superpowers-page-C0V-BVj9.js} +1 -1
  157. package/dist/assets/{system-events-page-q1CCjaae.js → system-events-page-B13dkMsH.js} +1 -1
  158. package/dist/assets/{system-events-redirect-page-D0nYClwA.js → system-events-redirect-page-ayoYsUNU.js} +1 -1
  159. package/dist/assets/{tabular-grid-ClRQmbrS.js → tabular-grid-DkyI1XY2.js} +1 -1
  160. package/dist/assets/{teleport-gateway-client-BCQlm0IG.js → teleport-gateway-client-C3wmILxC.js} +1 -1
  161. package/dist/assets/{text-preview-DisLM6Ix.js → text-preview-BGQO4VRv.js} +1 -1
  162. package/dist/assets/{theme-stage-page-B4lCVU0g.js → theme-stage-page-9l6G0GQD.js} +1 -1
  163. package/dist/assets/{tiptap-document-editor-NU9u7Q3B.js → tiptap-document-editor-6J6u0gMB.js} +1 -1
  164. package/dist/assets/tool-detail-panel-B267q93W.js +1 -0
  165. package/dist/assets/{tool-detail-panel-BgULoaCP.js → tool-detail-panel-D29OCtjo.js} +1 -1
  166. package/dist/assets/{trait-cycle-row-h6tNq4lj.js → trait-cycle-row-C76P92r3.js} +1 -1
  167. package/dist/assets/{upgrade-cancel-page-CSFfsg3T.js → upgrade-cancel-page-CsIYnmSq.js} +1 -1
  168. package/dist/assets/{upgrade-success-page-Bb9vkeFS.js → upgrade-success-page-Ba_xpT9b.js} +1 -1
  169. package/dist/assets/{usage-redirect-page-DxSTmtpM.js → usage-redirect-page-C7pPUdxP.js} +1 -1
  170. package/dist/assets/{use-app-delete-CyCUfXGp.js → use-app-delete-2je5dBpX.js} +1 -1
  171. package/dist/assets/{use-assistant-identity-details-ft05GaL-.js → use-assistant-identity-details-S74x7sbE.js} +1 -1
  172. package/dist/assets/{use-channel-trust-floors-DeIos7Sw.js → use-channel-trust-floors-fBDQnvgz.js} +1 -1
  173. package/dist/assets/{use-checkout-dismiss-refresh-CVLzCRhG.js → use-checkout-dismiss-refresh-DB31reZx.js} +1 -1
  174. package/dist/assets/{use-edge-swipe-back-kH1IWvhn.js → use-edge-swipe-back-DeHKMrh8.js} +1 -1
  175. package/dist/assets/{use-hotkey-recorder-B0ho6P1Q.js → use-hotkey-recorder-BKycBMhe.js} +1 -1
  176. package/dist/assets/{use-invite-link-dialog-BWTyTo38.js → use-invite-link-dialog-BdHG4b3u.js} +1 -1
  177. package/dist/assets/{use-plugins-list-Dg7cmWWy.js → use-plugins-list-B9d39t5k.js} +1 -1
  178. package/dist/assets/{use-return-to-short-circuit-DZLF2zb8.js → use-return-to-short-circuit-D82kSfEB.js} +1 -1
  179. package/dist/assets/{use-side-list-room-Bm4W05s8.js → use-side-list-room-CMVDwjej.js} +1 -1
  180. package/dist/assets/{use-skill-actions-BDB6OPDL.js → use-skill-actions-BkSsu_a-.js} +1 -1
  181. package/dist/assets/{use-skill-detail-files-DOJu82AO.js → use-skill-detail-files-DRDxliP2.js} +1 -1
  182. package/dist/assets/use-supports-credentials-settings-DXa8eid1.js +1 -0
  183. package/dist/assets/{use-transcript-message-by-id-ImJNR0ZS.js → use-transcript-message-by-id-DVnOyFfP.js} +1 -1
  184. package/dist/assets/{voice-page-D6iJnwpE.js → voice-page-DoYjxDlf.js} +1 -1
  185. package/dist/assets/{wake-detail-panel-BBCXrrwt.js → wake-detail-panel-PQ5V9JtN.js} +1 -1
  186. package/dist/assets/{weather-forecast-display-D38nUHK1.js → weather-forecast-display-BWS4MRRa.js} +1 -1
  187. package/dist/assets/{welcome-screen-CUh7JIoK.js → welcome-screen-BKY6SHne.js} +1 -1
  188. package/dist/assets/{workflow-detail-panel-Cle_xFav.js → workflow-detail-panel-N8CV0RrQ.js} +1 -1
  189. package/dist/assets/{workspace-page-BhdFaoFV.js → workspace-page-B7cCk3SZ.js} +1 -1
  190. package/dist/assets/{xlsx-preview-DVein85j.js → xlsx-preview-DaCmEr4c.js} +1 -1
  191. package/dist/index.html +2 -2
  192. package/package.json +1 -1
  193. package/dist/assets/add-credits-modal-Cx2D0qMT.js +0 -1
  194. package/dist/assets/auth-store-MTbC_MGl.js +0 -1
  195. package/dist/assets/avatar-bundled-components-BzBQbsbk.js +0 -1
  196. package/dist/assets/checkout-return-target-gl5H9x5u.js +0 -1
  197. package/dist/assets/command-palette-BLiF3fyX.js +0 -1
  198. package/dist/assets/deploy-dialogs-7jGhK4l2.js +0 -1
  199. package/dist/assets/document-load-B7bN8N4u.js +0 -1
  200. package/dist/assets/local-mode-BM0aWB6A.js +0 -1
  201. package/dist/assets/mutation-error-Bpj2rO9W.js +0 -1
  202. package/dist/assets/native-attachment-pickers-BEdhcWFZ.js +0 -1
  203. package/dist/assets/native-file-uymdgwvc.js +0 -1
  204. package/dist/assets/paired-platform-identity-BumKYxOS.js +0 -1
  205. package/dist/assets/password-reset-page-C4ulvC0x.js +0 -1
  206. package/dist/assets/plugins-surface-5VJsSvrd.js +0 -1
  207. package/dist/assets/referral-modal-Bx__UjCU.js +0 -1
  208. package/dist/assets/routes-DEGM-k2Y.js +0 -1
  209. package/dist/assets/share-feedback-modal-DjrtiKSJ.js +0 -1
  210. package/dist/assets/tool-detail-panel-BZPy9LTd.js +0 -1
  211. package/dist/assets/use-supports-credentials-settings-VPsbB7QL.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$u as t,AC as n,Ai as r,Bd as i,Bu as a,DS as o,Dv as s,FC as c,Fd as l,Fu as u,GC as d,Ic as f,Id as p,Ii as m,JC as h,Ld as g,Nd as _,Oi as v,Pd as y,Qo as b,Rd as x,SC as S,Vd as C,Vu as w,Wd as T,Xn as E,Xy as D,Yy as O,__ as k,au as A,aw as j,bC as M,b_ as ee,cd as te,ea as N,fb as P,jC as ne,ki as re,mb as ie,nf as ae,rd as oe,tf as F,uh as I,vC as se,xC as L,zd as ce}from"./app-D0NlDYsG.js";import{$n as R,E as z,Xn as le,cr as ue,j as de,nr as B,or as fe}from"./vendor-CtXGFqsu.js";import{f as pe,t as me,x as he}from"./react-B9IgSVeK.js";import{D as V,Ji as ge,Ra as _e,Ui as ve,Vn as ye,Ya as be,fr as H,pi as xe,xr as U,zi as W}from"./icons-C0wyat6T.js";import{c as Se,i as G,l as K,n as Ce,r as we,t as Te}from"./machine-sizes-qp9khCYo.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./provisioning-targets-CHlEOzsV.js";var q=be(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),J=e(he(),1),Y=me();function je({icon:e}){return(0,Y.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,Y.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var Me={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function Ne({title:e,subtitle:t}){return(0,Y.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,Y.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:Me,children:e}),t&&(0,Y.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Pe=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1},{bodyShape:`stack`,eyeStyle:`gentle`,color:`purple`,size:110,position:`-left-[39px] top-[74%]`,rotate:0},{bodyShape:`urchin`,eyeStyle:`goofy`,color:`pink`,size:137,position:`-right-[42px] -bottom-[40px]`,rotate:180},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[37%] -bottom-[22px] -translate-x-1/2`,rotate:0}],Fe=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1}];function Ie({variant:e=`full`}){let t=v();return t?(0,Y.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?Fe:Pe).map((e,n)=>(0,Y.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,Y.jsx)(E,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}var Le={waitingStatus:`Upgrading your assistant…`,snagStatus:`We hit a snag upgrading your assistant`,snagCaption:`Retry in the background and we'll keep working on your upgrade.`,confirmingStatus:`Confirming your upgrade…`,confirmTimeoutStatus:`Still confirming your upgrade`,confirmTimeoutCaption:`Your payment went through safely. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still upgrading. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your upgrade continues in the background.`,backgroundRetryToast:`We'll retry your upgrade in the background.`,completeSubtitle:`Enjoy the new found power.`,fetchErrorBody:`We hit a problem checking your subscription. Your upgrade may still be processing. Return to billing to refresh.`},Re={waitingStatus:`Updating your assistant…`,snagStatus:`We hit a snag updating your assistant`,snagCaption:`Retry in the background and we'll keep working on your plan change.`,confirmingStatus:`Confirming your plan change…`,confirmTimeoutStatus:`Still confirming your plan change`,confirmTimeoutCaption:`Your plan change was submitted. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still updating. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your plan change continues in the background.`,backgroundRetryToast:`We'll retry your plan change in the background.`,completeSubtitle:`Your plan changes are live.`,fetchErrorBody:`We hit a problem checking your subscription. Your plan change may still be processing. Return to billing to refresh.`},X={upgrade:Le,downgrade:Re,change:Re};function Z(e=`upgrade`){return X[e]}function ze(e,t=!0){let{data:n}=R({...u(),enabled:t&&e==null}),{data:r}=R({...te({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Be({assistantId:e,direction:t}){let n=pe(),{t:r}=z(`settings`),i=ze(e,I())?.name||r(`completeState.assistantFallbackName`);return(0,Y.jsxs)(`div`,{className:`relative flex min-h-[320px] flex-col items-center justify-center overflow-hidden px-8 pb-16 [animation:onboarding-step-in_350ms_ease-out] motion-reduce:[animation:none]`,children:[(0,Y.jsx)(Ie,{variant:`full`}),(0,Y.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,Y.jsx)(Ne,{title:r(`completeState.title`),subtitle:Z(t).completeSubtitle}),(0,Y.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&k(e),n(o.assistant,{replace:!0})},children:r(`completeState.returnTo`,{assistantName:i})})})]})]})}function Ve(e=!0,t){let n=ze(t,e),r=t??n?.id,{data:i,isError:o,isFetching:s,dataUpdatedAt:c,errorUpdatedAt:l}=R({...a({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:o,domainsFetching:s,domainsUpdatedAt:c,domainsErrorUpdatedAt:l}}var He=1e3,Ue=1e4,Q=2500,We=2e3,Ge=1e4,Ke=[`machine_size`,`subdomain`,`non_field_errors`],qe={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to upgrade yet. Try again in a moment.`},Je={provisioning_submission_failed:`We couldn't queue your plan change just now. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to update yet. Try again in a moment.`};function Ye(e,t,n=`upgrade`){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=(n===`upgrade`?void 0:Je[t.error])??qe[t.error];if(e)return e}for(let e of Ke){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var Xe=`h-8 rounded-lg border border-[var(--border-element)] bg-[var(--field-bg)] px-2.5 text-[14px] text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-[border-color] duration-150 focus:border-[var(--border-active)] disabled:cursor-not-allowed disabled:opacity-60`,Ze=`text-[11px] font-medium text-[var(--content-secondary)]`;function Qe({onExit:e,machineBusy:n=!1,assistantId:r}){let{t:i}=z(`settings`),a=B(),o=m.use.emailRootDomain(),{assistant:s,assistantId:c,domains:l}=Ve(!0,r),u=l?.results[0],[f,h]=(0,J.useState)(``),[g,_]=(0,J.useState)(`hi`),[v,y]=(0,J.useState)(!1);(0,J.useEffect)(()=>{if(!v){if(u){h(u.subdomain),y(!0);return}!s?.handle||f||(h(s.handle),y(!0))}},[s?.handle,u,v,f]);let[b,x]=(0,J.useState)(null),[C,T]=(0,J.useState)(!1),E=le(p()),D=!!u||C,O=E.isPending||C;return(0,J.useEffect)(()=>{if(!C)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[C,e]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(S.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,Y.jsx)(Ie,{variant:`top`}),(0,Y.jsx)(Ne,{title:i(`domainStep.title`),subtitle:i(`domainStep.subtitle`)}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:Ze,children:i(`domainStep.prefixLabel`)}),(0,Y.jsx)(`input`,{id:`onboarding-email-prefix`,value:g,onChange:e=>_(e.target.value.toLowerCase().trim()),disabled:O||D,readOnly:D,placeholder:i(`domainStep.emailUsernamePlaceholder`),className:`${Xe} w-24`})]}),(0,Y.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Y.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:Ze,children:i(`domainStep.handleLabel`)}),(0,Y.jsx)(`input`,{id:`onboarding-email-handle`,value:f,onChange:e=>{h(e.target.value.toLowerCase().trim()),b&&x(null)},disabled:O||D,readOnly:D,autoFocus:!0,placeholder:i(`domainStep.subdomainExamplePlaceholder`),"aria-invalid":!!b,className:`${Xe} w-full min-w-0`})]}),(0,Y.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,o]})]}),b&&(0,Y.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:b}),D&&(0,Y.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:i(`domainStep.domainLockedMessage`)})]}),n&&!D&&(0,Y.jsx)(d,{tone:`neutral`,children:i(`domainStep.machineBusyNotice`)}),!D&&(0,Y.jsx)(d,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,Y.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:i(`domainStep.handleImmutableNotice`)})}),C?(0,Y.jsx)(d,{tone:`success`,children:i(`domainStep.domainSetRedirecting`)}):null]}),(0,Y.jsx)(S.Footer,{className:`items-center pt-6`,children:D?(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:i(`domainStep.continue`)}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(j,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:O,onClick:()=>{O||E.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:i(`domainStep.skip`)}),(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!f||O||n,onClick:()=>{O||n||!f||E.mutate({body:{subdomain:f,...g?{email_username:g}:{}}},{onSuccess:()=>{x(null),T(!0),a.invalidateQueries({queryKey:t()}),a.invalidateQueries({queryKey:w({path:{assistant_id:c??``}})}),a.invalidateQueries({queryKey:ce()})},onError:e=>{x(Ye(e,i(`domainStep.registerSubdomainFailed`)))}})},children:i(`domainStep.next`)})]})})]})}function $e({onGoToBilling:e,direction:t}){let{t:n}=z(`settings`);return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,Y.jsx)(je,{icon:ve}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(h,{variant:`title-small`,as:`h1`,children:n(`errorStates.fetchErrorTitle`)}),(0,Y.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:Z(t).fetchErrorBody})]}),(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:n(`errorStates.goToBilling`)})]})}function et(e){let{targets:t,fromSnapshot:n,machineFloor:r,credits:i}=e,a=[];return t.machineSize==null?r!=null&&n.machineSize!=null&&n.machineSize!==r&&a.push({key:`machine`,label:`Machine`,from:G[n.machineSize],to:G[r]}):n.machineSize!==t.machineSize&&a.push({key:`machine`,label:`Machine`,from:n.machineSize==null?void 0:G[n.machineSize],to:G[t.machineSize]}),t.storageGib!=null&&(n.storageGib==null||t.storageGib>n.storageGib)&&a.push({key:`storage`,label:`Storage`,from:n.storageGib==null?void 0:`${n.storageGib} GB`,to:`${t.storageGib} GB`}),i!=null&&a.push({key:`credits`,label:i.label??`Credits`,from:i.from,to:i.to}),a}var tt=220;function nt({items:e,visible:t=!0,toWord:n,className:r=``,testId:i=`upgrade-metrics`}){let[a,o]=(0,J.useState)(!1);(0,J.useEffect)(()=>{let e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)},[]);let s=t&&a;return(0,Y.jsx)(`div`,{"aria-hidden":!t,"data-testid":i,"data-visible":t?`true`:`false`,className:`flex flex-col items-center gap-3 md:flex-row md:items-stretch md:gap-0 ${r}`,children:e.map((e,t)=>(0,Y.jsxs)(`div`,{"data-testid":e.key?`chip-${e.key}`:void 0,className:`flex flex-col items-center gap-1 px-6 transition-[opacity,transform] duration-500 ease-out motion-reduce:transition-none ${s?`translate-y-0 opacity-100`:`translate-y-2 opacity-0`} ${t>0?`md:border-l md:border-[var(--border-subtle)]`:``}`,style:{transitionDelay:s?`${t*tt}ms`:`0ms`},children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-[0.08em] text-[var(--content-tertiary)]`,children:e.label}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 whitespace-nowrap text-[var(--content-emphasised)]`,style:{fontFamily:`var(--font-serif)`,fontSize:`20px`,lineHeight:1.2},children:[e.from!=null&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:e.from}),n&&(0,Y.jsx)(`span`,{className:`sr-only`,children:n}),(0,Y.jsx)(_e,{className:`size-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,Y.jsx)(`span`,{children:e.to}),e.landed&&(0,Y.jsx)(ge,{"data-testid":`chip-check`,className:`size-3.5 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}),e.status&&(0,Y.jsx)(`span`,{className:`sr-only`,children:e.status})]})]},e.key??e.label))})}var $=48;function rt(e,t,n,r,i){let a=i*i,o=a*i;return .5*(2*t+(-e+n)*i+(2*e-5*t+4*n-r)*a+(-e+3*t-3*n+r)*o)}function it(e,t,n){let r=e.map(e=>({x:e.fx*t,y:e.fy*n,size:e.fs*n})),i=[],a=[],o=[],s=[],c=[],l=[],u=0;for(let e=0;e<r.length-1;e++){let t=r[Math.max(0,e-1)],n=r[e],c=r[e+1],l=r[Math.min(r.length-1,e+2)],d=e===r.length-2?$+1:$;for(let e=0;e<d;e++){let r=e/$,d=rt(t.x,n.x,c.x,l.x,r),f=rt(t.y,n.y,c.y,l.y,r);i.length>0&&(u+=Math.hypot(d-i[i.length-1],f-a[a.length-1])),i.push(d),a.push(f),o.push(n.size+(c.size-n.size)*r),s.push(u)}}for(let e=0;e<i.length;e++){let t=Math.max(0,e-1),n=Math.min(i.length-1,e+1),r=i[n]-i[t],o=a[n]-a[t],s=Math.hypot(r,o)||1;c.push(r/s),l.push(o/s)}return{length:u,at:e=>{let t=Math.min(u,Math.max(0,e)),n=0,r=s.length-1;for(;n<r;){let e=n+r>>1;s[e]<t?n=e+1:r=e}let d=Math.max(1,n),f=d-1,p=s[d]-s[f]||1,m=(t-s[f])/p,h=c[f]+(c[d]-c[f])*m,g=l[f]+(l[d]-l[f])*m,_=Math.hypot(h,g)||1;return{x:i[f]+(i[d]-i[f])*m,y:a[f]+(a[d]-a[f])*m,tx:h/_,ty:g/_,size:o[f]+(o[d]-o[f])*m}}}}function at(e,t){if(t<=0)return 0;let n=e%t;return n<0?n+t:n}function ot(e,t){let n=[],r=0;for(;r<e.length;)n.push(r),r+=Math.max(1,e.at(r).size*t);return n}var st={around:[{fx:.2,fy:-.16,fs:.02},{fx:.23,fy:0,fs:.024},{fx:.34,fy:.12,fs:.03},{fx:.52,fy:.19,fs:.037},{fx:.7,fy:.26,fs:.046},{fx:.85,fy:.4,fs:.058},{fx:.88,fy:.56,fs:.074},{fx:.76,fy:.71,fs:.095},{fx:.56,fy:.82,fs:.12},{fx:.4,fy:.93,fs:.15},{fx:.3,fy:1.08,fs:.185},{fx:.24,fy:1.28,fs:.22}],below:[{fx:1.16,fy:0,fs:.03},{fx:.95,fy:.06,fs:.036},{fx:.68,fy:.16,fs:.048},{fx:.4,fy:.3,fs:.065},{fx:.22,fy:.47,fs:.09},{fx:.32,fy:.64,fs:.125},{fx:.56,fy:.8,fs:.17},{fx:.58,fy:.98,fs:.22},{fx:.46,fy:1.22,fs:.27},{fx:.36,fy:1.5,fs:.3}]},ct={around:.24,below:.32},lt=.95,ut=.95,dt=1,ft=8,pt=20260922,mt=50;function ht({className:e=``,layout:t=`around`,flow:n=`down`,speed:i=1,lanes:a=3,paused:o=!1}){let s=v(),c=(0,J.useRef)(null),l=(0,J.useRef)({flow:n,speed:i,paused:o});return(0,J.useEffect)(()=>{l.current={flow:n,speed:i,paused:o}},[n,i,o]),(0,J.useEffect)(()=>{let e=c.current;if(!e||!s)return;let n=e.getContext(`2d`);if(!n)return;let i=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,o=0,u=0,d=null,f=1/0,p=[],m=0,h=new Map,g=(e,t)=>{let n=Math.max(1,Math.round(t/ft))*ft,r=`${e.bodyIdx}-${e.eyeIdx}-${e.colorIdx}-${n}`,i=h.get(r);if(i!==void 0)return i;let a=re(s,e.bodyIdx,e.eyeIdx,e.colorIdx,n);return h.set(r,a),a},_=()=>{let i=e.getBoundingClientRect();if(i.width===0||i.height===0||Math.abs(i.width-o)<1&&Math.abs(i.height-u)<1)return;let c=d,l=p.map(e=>e.distance);o=i.width,u=i.height;let m=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(o*m),e.height=Math.round(u*m),n.setTransform(m,0,0,m,0,0),d=it(st[t],o,u),f=u*ct[t];let h=r(pt),g=e=>(h()*2-1)*e,_=-1;if(p=[],ot(d,lt).forEach((e,t)=>{let n=t%2==0?0:.5;for(let t=0;t<a;t++){let r=Math.floor(h()*s.colors.length);r===_&&(r=(r+1)%s.colors.length),_=r,p.push({distance:e,lane:t-(a-1)/2+n,jitterAlong:g(.08),jitterAcross:g(.12),sizeScale:.85+h()*.3,rotate:g(10)*Math.PI/180,phase:h()*Math.PI*2,bodyIdx:Math.floor(h()*s.bodyShapes.length),eyeIdx:Math.floor(h()*s.eyeStyles.length),colorIdx:r})}}),c&&c.length>0){let e=d.length/c.length;p.forEach((t,n)=>{let r=l[n];r!==void 0&&(t.distance=at(r*e,d.length))})}},v=e=>{if(!d)return;let t=m?Math.min(mt,e-m):0;m=e;let{flow:r,speed:a,paused:s}=l.current,c=i||s?0:(r===`down`?1:-1)*a*dt*(t/1e3);n.clearRect(0,0,o,u);for(let t of p){if(c!==0){let e=d.at(t.distance).size;t.distance=at(t.distance+c*e,d.length)}let r=d.at(t.distance),a=Math.min(f,r.size*t.sizeScale),o=(t.lane*ut+t.jitterAcross)*r.size,s=t.jitterAlong*r.size,l=r.x+r.ty*o+r.tx*s,u=r.y-r.tx*o+r.ty*s,p=g(t,a);if(!p)continue;let m=i?0:Math.sin(e*.001+t.phase)*1.4,h=i?0:Math.sin(e*8e-4+t.phase*2)*.025;n.save(),n.translate(l,u+m),n.rotate(t.rotate+h),n.drawImage(p,-a/2,-a/2,a,a),n.restore()}};_();let y=new ResizeObserver(()=>{_(),i&&v(performance.now())});y.observe(e);let b=0;if(i)v(performance.now());else{let e=t=>{v(t),b=requestAnimationFrame(e)};b=requestAnimationFrame(e)}return()=>{cancelAnimationFrame(b),y.disconnect()}},[s,a,t]),(0,Y.jsx)(`canvas`,{ref:c,"aria-hidden":`true`,"data-testid":`upgrade-stream`,className:`pointer-events-none block h-full w-full ${e}`})}function gt(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function _t(e){let t=e?.match(/^credits_(\d+)$/)?.[1];return t==null?null:Number(t)}function vt(e){let t=I(),{data:n}=R({..._(),enabled:t&&e});return n?.plans.find(e=>e.id===`pro`)}function yt(e,t){return t==null?0:gt(e,t)?.credits_usd??_t(t)}function bt(e,t){return t==null?null:gt(e,t)?.label}function xt(e){let t=vt(e!=null);if(e==null||t==null)return null;let n,r;if(e.kind===`package`){let i=t.packages.find(t=>t.key===e.packageKey),a=gt(t,i?.credit_tier);n=i?.credits_usd??a?.credits_usd,r=i?.usage_label??a?.label??void 0}else{let i=gt(t,e.creditTier);n=i?.credits_usd,r=i?.label}return n==null?null:{fromLabel:null,toLabel:r}}function St(e){let t=vt(e!=null);return e==null||yt(t,e.fromTier)==null||yt(t,e.toTier)==null?null:{fromLabel:bt(t,e.fromTier),toLabel:bt(t,e.toTier)}}function Ct(e,t){let[n,r]=(0,J.useState)(e),i=(0,J.useRef)(0);return(0,J.useEffect)(()=>{i.current=performance.now()},[]),(0,J.useEffect)(()=>{if(t<=0||e===n)return;let a=t-(performance.now()-i.current);if(a<=0){i.current=performance.now(),r(e);return}let o=setTimeout(()=>{i.current=performance.now(),r(e)},a);return()=>clearTimeout(o)},[e,n,t]),t<=0?e:n}var wt=`#ffffff`;function Tt({status:e,caption:t}){return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,Y.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:Me,children:e}),t&&(0,Y.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Et(e,t){return e===`credits`?!0:t?.[e]===!0}function Dt(e,t){if(e==null)return null;let n=t(`provisioningState.noExtraUsage`),r=e.toLabel===null?n:e.toLabel;return r==null?null:{label:t(`provisioningState.usageLabel`),from:e.fromLabel===null?n:e.fromLabel,to:r}}function Ot({intent:e,creditsChange:t,targets:n,fromSnapshot:r,machineFloor:i,landed:a,allDone:o=!1,creditsOnly:s=!1}){let{t:c}=z(`settings`),l=xt(e),u=St(t),d=et({targets:n,fromSnapshot:r,machineFloor:i,credits:Dt(l??u,c)}),f=s?d.filter(e=>e.key===`credits`):d,p=f.filter(e=>o||Et(e.key,a)).map(e=>e.label).join(`, `),[m]=(0,J.useState)(p),h=p===m?``:c(`provisioningState.dimensionsComplete`,{dimensions:p});return f.length===0?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(nt,{items:f.map(e=>{let t=o||Et(e.key,a);return{key:e.key,label:e.label,from:e.from??null,to:e.to,landed:t,status:c(t?`provisioningState.statusComplete`:`provisioningState.statusPending`)}}),testId:`resource-chips`,toWord:c(`provisioningState.srOnlyTo`)}),(0,Y.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`chip-announcement`,children:h})]})}function kt({intent:e}){let{t}=z(`settings`),n=xt(e.kind===`custom`?e:null);if(e.kind===`package`){let n=e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1);return(0,Y.jsx)(nt,{testId:`resource-chips`,items:[{key:`package`,label:t(`provisioningState.packageLabel`),from:null,to:n}]})}let r=[];return e.machineTier!=null&&r.push({key:`machine`,label:t(`provisioningState.machineLabel`),from:null,to:Ce[e.machineTier]??e.machineTier}),e.storageTier!=null&&r.push({key:`storage`,label:t(`provisioningState.storageLabel`),from:null,to:e.storageTier.toUpperCase()}),e.creditTier!=null&&n?.toLabel!=null&&r.push({key:`credits`,label:t(`provisioningState.usageLabel`),from:null,to:n.toLabel}),r.length===0?null:(0,Y.jsx)(nt,{testId:`resource-chips`,items:r})}function At({state:e,direction:t,softWaiting:n,intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:s,landed:c,celebrating:l,onCelebrationEnd:u,escapeAvailable:d,onEscape:f,onPhaseChange:p,kickError:m,confirm:h,dwellMs:g=Q,phaseMinMs:_=900}){let{t:v}=z(`settings`),y=Z(t),b=(0,J.useRef)(u);(0,J.useEffect)(()=>{b.current=u},[u]);let x=Ct(e,_),S=x===`DONE`||x===`NOT_APPLICABLE`,C=x===`RESIZING`?`WAITING`:x,w=(0,J.useRef)(p);(0,J.useEffect)(()=>{w.current=p},[p]),(0,J.useEffect)(()=>{w.current?.(x)},[x]);let T=l&&S;(0,J.useEffect)(()=>{if(!T)return;let e=setTimeout(()=>b.current(),g);return()=>clearTimeout(e)},[T,g]);let E=A(),D=x===`STALLED`,O=(0,Y.jsx)(`div`,{className:`relative z-10 flex w-full flex-col items-center gap-6 [animation:onboarding-step-in_420ms_ease-out] motion-reduce:[animation:none]`,children:ee()},C);if(E)return(0,Y.jsxs)(`div`,{"data-testid":`provisioning-takeover`,"data-theme":`light`,className:`relative flex h-full min-h-[420px] w-full flex-col overflow-hidden text-center`,style:{backgroundColor:wt},children:[(0,Y.jsx)(`div`,{className:`px-6 pb-8 pt-16`,children:O}),(0,Y.jsx)(`div`,{className:`relative min-h-0 flex-1`,children:(0,Y.jsx)(ht,{className:`absolute inset-0`,layout:`below`,paused:D})})]});return(0,Y.jsxs)(`div`,{"data-testid":`provisioning-takeover`,"data-theme":`light`,className:`relative flex h-full min-h-[420px] w-full flex-col items-center justify-center overflow-hidden px-6 py-10 text-center`,style:{backgroundColor:wt},children:[(0,Y.jsx)(ht,{className:`absolute inset-0`,layout:`around`,paused:D}),(0,Y.jsx)(`div`,{className:`relative z-10 mr-[16%] flex w-full max-w-2xl flex-col items-center`,children:O})]});function k(e=v(`provisioningState.continueInBackground`)){return d?(0,Y.jsx)(j,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:f,children:e}):null}function M({allDone:e=!1,creditsOnly:t=!1}={}){return(0,Y.jsx)(Ot,{intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:s,landed:c,allDone:e,creditsOnly:t})}function ee(){if(x===`CONFIRMING`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:y.confirmingStatus,caption:v(`provisioningState.confirmingCaption`)}),r&&(0,Y.jsx)(kt,{intent:r}),k()]});if(x===`WAITING`||x===`RESIZING`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:y.waitingStatus,caption:v(n?`provisioningState.waitingCaptionLong`:`provisioningState.waitingCaptionShort`)}),M(),k()]});if(x===`DONE`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:v(`provisioningState.allDoneStatus`)}),M({allDone:!0})]});if(x===`NOT_APPLICABLE`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:v(`provisioningState.planReadyStatus`)}),M({allDone:!0,creditsOnly:!0})]});if(x===`STALLED`){let e=m!=null;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:e?y.snagStatus:v(`provisioningState.takingLongerStatus`),caption:e?Ye(m,y.snagCaption,t):v(`provisioningState.stalledCaption`)}),M(),e?k(v(`provisioningState.retryInBackground`)):k()]})}return x===`CONFIRM_TIMEOUT`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:y.confirmTimeoutStatus,caption:y.confirmTimeoutCaption}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,Y.jsx)(j,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:h.onGoToBilling,children:v(`provisioningState.goToBilling`)}),(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:h.onRetry,children:v(`provisioningState.tryAgain`)})]})]}):null}}function jt(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0,targetsProveNoop:d=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let f=o||a,p=l===`started`||l===`in_progress`,m=o||d&&u;if(!a){let e=p?m:f||l===`already_done`||i!=null&&!Ee(n,i);if(Ee(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!p&&(d||l===`not_applicable`))return{state:`NOT_APPLICABLE`,softWaiting:!1}}else{if(l===`already_done`)return{state:`DONE`,softWaiting:!1};if(l===`not_applicable`)return{state:`NOT_APPLICABLE`,softWaiting:!1}}}return s!=null&&s>=9e4?{state:`STALLED`,softWaiting:!1}:f||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Mt=2e3,Nt=1e3,Pt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`],Ft={assistantId:null,machine:null,storage:null};function It({open:e,canLowerResources:t=!1,verdictRecheckMs:n=Ge}){let r=B(),a=I(),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(0),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)(null),[h,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[b,S]=(0,J.useState)(null),[w,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(Ft),[O,k]=(0,J.useState)(null),[A,j]=(0,J.useState)(!1),M=(0,J.useRef)(!1),N=(0,J.useRef)(!1),P=(0,J.useRef)(0),[ne,re]=(0,J.useState)(!1),[ie,ae]=(0,J.useState)(null),[F,se]=(0,J.useState)(null),[L,z]=(0,J.useState)(null),[de,pe]=(0,J.useState)(()=>Date.now()),[me,he]=(0,J.useState)(!0);(0,J.useEffect)(()=>{e||(s(!1),l(0),f(null),m(null),_(null),re(!1),ae(null),se(null),z(null),he(!0),y(null),S(null),T(null),D(Ft),k(null),j(!1),M.current=!1,N.current=!1,P.current+=1)},[e]),(0,J.useEffect)(()=>{e&&(f(Date.now()),r.invalidateQueries({queryKey:C()}),r.invalidateQueries({queryKey:ce()}))},[e,r]);let V=p!=null,ge=R({...i(),refetchInterval:e=>e.state.data?.plan_id===`pro`||o?!1:He,refetchIntervalInBackground:!1,enabled:e&&a&&!V}),_e=(d!=null&&ge.dataUpdatedAt>=d?ge.data?.plan_id:null)??null;(0,J.useEffect)(()=>{if(!e||V||_e!==`pro`)return;let t=Date.now();m(t),pe(t)},[e,V,_e]),(0,J.useEffect)(()=>{if(!e||V)return;let t=setTimeout(()=>s(!0),Ue);return()=>clearTimeout(t)},[e,V,c]);let ve=(0,J.useCallback)(()=>{s(!1),l(e=>e+1),ee.getState().fetchOrganizations(),r.invalidateQueries({queryKey:C()})},[r]),ye=(0,J.useCallback)(()=>{let e=Date.now();_(e),pe(e)},[]),{mutate:be}=le(g()),H=(0,J.useCallback)(e=>{let t=P.current;be({},{onSuccess:n=>{t===P.current&&(k(null),Oe(n)?N.current?k({error:n.reason??`no_active_pro`}):(N.current=!0,j(!0),e===`escape`&&ye()):(y(n.state),e===`escape`&&ye()))},onError:e=>{t===P.current&&k(e)}})},[be,ye]);(0,J.useEffect)(()=>{!e||!a||!V||M.current||(M.current=!0,H(`auto`))},[e,a,V,H]),(0,J.useEffect)(()=>{if(!A)return;let e=P.current,t=setTimeout(()=>{j(!1),e===P.current&&H(`auto`)},We);return()=>clearTimeout(t)},[A,H]);let xe=(0,J.useCallback)(()=>H(`escape`),[H]),U=R({...x(),enabled:e&&a&&V}),W=me?Mt:!1,G=R({...u(),enabled:e&&a&&V,refetchInterval:e=>e.state.data?.id==null?W:!1,retry:!1}),Ce=V&&d!=null&&U.dataUpdatedAt>=d,we=Ce&&!U.isPending&&!U.isFetching,q=(Ce?U.data?.primary_assistant_id:null)??(U.isPending?null:G.data?.id??null),Y=R({...te({path:{id:q??`unresolved`}}),enabled:e&&a&&V&&q!=null,refetchInterval:W,retry:!1}),je=oe({path:{id:q??`unresolved`}}),Me=R({...je,enabled:e&&a&&V&&q!=null,refetchInterval:W,retry:!1}),Ne=(0,J.useRef)(0),[Pe,Fe]=(0,J.useState)(0),Ie=ue(je.queryKey);(0,J.useEffect)(()=>r.getQueryCache().subscribe(t=>{if(!(t.type!==`updated`||t.query.queryHash!==Ie)){if(t.action.type===`fetch`)Ne.current+=1;else if(t.action.type===`success`&&!t.action.manual){let n=Ne.current,r=e&&ke(t.action.data);fe.schedule(()=>{Fe(n),r&&(re(!0),ae(q))})}}}),[r,Ie,e,q]);let Le=ke(Me.data),Re=ie===q,X=U.data,Z=(0,J.useMemo)(()=>X?{machineSize:Se(X.max_machine_tier),storageGib:X.selected_storage_gib??null}:null,[X]),ze=X!=null&&X.max_machine_tier==null?Te:null,Be=X?X.domain_setup_available&&X.primary_assistant_id!=null:void 0,Ve=Y.data,Q=(0,J.useMemo)(()=>Ve?{machineSize:Ve.machine_size??null,storageGib:Ve.provisioned_storage_gib??null}:null,[Ve]),Ke=L===q,qe=(0,J.useMemo)(()=>{let e=Ae(Z,Q),t=Z?.machineSize??ze;if(t==null)return e;let n=Q?.machineSize??null;if(n==null)return{...e,machine:!1};let r=(Ke?F?.machineSize:null)??n,i=K(t)<K(r);return{...e,machine:i?K(n)<=K(t):K(n)>=K(t)}},[Z,Q,F,Ke,ze]),Je=Ee(Z,Q),Ye=w===q;(0,J.useEffect)(()=>{e&&(Je?(S(e=>e!=null&&Ye?e:Date.now()),T(q)):(S(null),T(null)))},[e,Je,q,Ye]);let Xe=E.assistantId===q;(0,J.useEffect)(()=>{if(!e)return;let t=Ne.current;D(e=>{let n=e.assistantId===q?e:Ft,r=qe.machine?n.machine??t:null,i=qe.storage?n.storage??t:null;return e.assistantId===q&&e.machine===r&&e.storage===i?e:{assistantId:q,machine:r,storage:i}})},[e,qe,q]);let Ze=(0,J.useMemo)(()=>{let e=De(Me.data),t=e=>e!=null&&Xe&&Pe>e;return{machine:qe.machine&&!e.machine&&t(E.machine),storage:qe.storage&&!e.storage&&t(E.storage)}},[qe,E,Xe,Pe,Me.data]);(0,J.useEffect)(()=>{!e||!Q||F!=null&&Ke||(se(Q),z(q))},[e,Q,q,F,Ke]);let Qe=h??p,$e=Qe==null?null:Math.max(0,de-Qe),et=!t,{state:tt,softWaiting:nt}=jt({planId:V?`pro`:_e,targets:Z,actuals:Q,initialActuals:Ke?F:null,resizeOperationInFlight:Le,sawOperation:ne&&Re,msSinceWatchStart:$e,confirmExpired:o,serverVerdict:v,statusObservedSinceTargetsMet:b!=null&&Ye&&Me.dataUpdatedAt>b,targetsProveNoop:et}),$=Pt.includes(tt),rt=e&&V&&!$;(0,J.useEffect)(()=>{he(rt)},[rt]),(0,J.useEffect)(()=>{if(!e||!V||$)return;let t=setInterval(()=>pe(Date.now()),Nt);return()=>clearInterval(t)},[e,V,$]);let it=!et&&(v===`started`||v===`in_progress`)&&!(ne&&Re);return(0,J.useEffect)(()=>{if(!e||!V||$||!it)return;let t=setInterval(()=>H(`auto`),n);return()=>clearInterval(t)},[e,V,$,it,n,H]),{state:tt,softWaiting:nt,targets:Z,actualsSnapshot:F,machineFloor:ze,landed:Ze,assistantId:q,domainStepAvailable:Be,onboardingSettled:we,confirmError:!V&&ge.isError,targetsError:V&&U.isError&&(!X||!Ce),escapeEligible:$e!=null&&$e>=6e4,retryConfirm:ve,kickProvisioning:xe,kickError:O}}var Lt=200,Rt=380;function zt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var Bt=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,Vt=e=>e===`DONE`||e===`NOT_APPLICABLE`,Ht={machineSize:null,storageGib:null};function Ut({open:e,onClose:t,dwellMs:n,phaseMinMs:r,mode:i=`checkout`,resizeContext:a}){let{t:c}=z(`settings`),l=i===`resize`,u=B(),d=pe(),f=s.use.assistantInbox(),[p,m]=(0,J.useState)(`provisioning`),[h,g]=(0,J.useState)(`idle`),_=(0,J.useRef)([]),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(null),[C,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(!1),O=l?a?.direction:void 0,k=Z(O),A=It({open:e,canLowerResources:l?a?.canLowerResources===!0:!1});(0,J.useEffect)(()=>{if(e){y(l?null:ie()),T(e=>e??Date.now());return}_.current.forEach(clearTimeout),_.current=[],m(`provisioning`),g(`idle`),x(null),T(null),D(!1)},[e,l]),(0,J.useEffect)(()=>()=>{_.current.forEach(clearTimeout)},[]),(0,J.useEffect)(()=>{p===`complete`&&P()},[p]);let j=Bt(A.state),ee=Vt(b??A.state),{targets:te,assistantId:N,domainStepAvailable:ne,onboardingSettled:re}=A,ae=l?a?.fromSnapshot:void 0,oe=A.actualsSnapshot,F={machineSize:ae?.machineSize??oe?.machineSize??null,storageGib:ae?.storageGib??oe?.storageGib??null},I=l&&ne===!0,{domains:se,domainsError:ce,domainsFetching:R,domainsUpdatedAt:le,domainsErrorUpdatedAt:ue}=Ve(e&&I,N),de=(se?.results.length??0)>0,fe=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!e){fe.current=null;return}!I||N==null||fe.current!==N&&(fe.current=N,u.invalidateQueries({queryKey:w({path:{assistant_id:N}})}))},[e,I,N,u]);let me=!R&&(C!=null&&le>=C||C!=null&&!!ce&&ue>=C),[he,V]=(0,J.useState)(!1),ge=re&&(!I||me);(0,J.useEffect)(()=>{if(!e){V(!1);return}ge&&V(!0)},[e,ge]);let _e=(0,J.useCallback)(()=>{P(),t(),d(o.assistantInbox,{replace:!0})},[d,t]),ve=(0,J.useCallback)(()=>{let e=l?ne===!0&&!de?`domain`:`complete`:ne===!1?`complete`:`domain`;if(e===`domain`&&f){_e();return}if(zt()){m(e);return}g(`covering`),_.current.push(setTimeout(()=>{m(e),g(`revealing`),_.current.push(setTimeout(()=>g(`idle`),Rt))},Lt))},[ne,l,de,f,_e]),ye=(0,J.useCallback)(()=>{D(!0)},[]),be=(0,J.useCallback)(()=>{A.kickProvisioning(),L.info(A.kickError==null?k.backgroundExitToast:k.backgroundRetryToast),D(!1),t()},[A,t,k]),H=(0,J.useCallback)(()=>{D(!1)},[]),xe=p===`provisioning`&&(A.confirmError||A.targetsError),U=p===`provisioning`&&!xe,W=U&&!ee,Se=`transition-[background-color] duration-300 ease-out${U?` bg-white p-0`:``}`,G=U?`[animation:fadeIn_0.45s_ease-out_both]`:h===`revealing`?`[animation:fadeInUp_0.42s_ease-out_0.12s_both]`:`[animation:fadeIn_0.25s_ease-out_both]`;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(S.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Y.jsxs)(S.Content,{size:`md`,hideCloseButton:p!==`complete`,dismissOnOverlayClick:!W,onEscapeKeyDown:W?e=>e.preventDefault():void 0,onInteractOutside:W?e=>e.preventDefault():void 0,overlayClassName:Se,className:U?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,children:[(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${G}`,children:K()},p),h!==`idle`&&(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`takeover-exit-sheet`,className:`pointer-events-none fixed inset-0 z-50 ${h===`covering`?`[animation:fadeIn_200ms_ease-in_both]`:`[animation:fadeIn_380ms_ease-out_both_reverse]`}`,style:{backgroundColor:`#ffffff`}})]})}),(0,Y.jsx)(M,{open:E&&j,title:c(`billingOnboardingModal.backgroundConfirmTitle`),message:k.backgroundConfirmMessage,confirmLabel:c(`billingOnboardingModal.backgroundConfirmContinue`),cancelLabel:c(`billingOnboardingModal.backgroundConfirmKeepWaiting`),onConfirm:be,onCancel:H})]});function K(){return p===`provisioning`?A.confirmError||A.targetsError?(0,Y.jsx)($e,{onGoToBilling:t,direction:O}):(0,Y.jsx)(At,{state:A.state,direction:O,softWaiting:A.softWaiting,intent:v,creditsChange:l?a?.credits:void 0,targets:te??Ht,fromSnapshot:F,machineFloor:A.machineFloor,landed:A.landed,celebrating:he,onCelebrationEnd:ve,escapeAvailable:j&&A.escapeEligible,onEscape:ye,onPhaseChange:x,kickError:A.kickError,confirm:{onRetry:A.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:r}):p===`domain`?(0,Y.jsx)(Qe,{machineBusy:j,assistantId:N,onExit:()=>m(`complete`)}):(0,Y.jsx)(Be,{assistantId:N,direction:O})}}function Wt(e){return e!=null&&!e.customized}function Gt(e){return Wt(e)?e.name:`Custom`}var Kt=[`mighty`,`super`,`ultra`],qt=[`free`,...Kt];function Jt(e){return qt.indexOf(e)}function Yt(e,t){if(e===null)return`upgrade`;let n=Jt(e),r=Jt(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function Xt(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>Kt.indexOf(e.key)-Kt.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var Zt=[`too_expensive`,`missing_features`,`switched_service`,`unused`,`too_complex`,`low_quality`,`customer_service`,`other`],Qt={too_expensive:`cancelReasonSurvey.optionTooExpensive`,missing_features:`cancelReasonSurvey.optionMissingFeatures`,switched_service:`cancelReasonSurvey.optionSwitchedService`,unused:`cancelReasonSurvey.optionUnused`,too_complex:`cancelReasonSurvey.optionTooComplex`,low_quality:`cancelReasonSurvey.optionLowQuality`,customer_service:`cancelReasonSurvey.optionCustomerService`,other:`cancelReasonSurvey.optionOther`},$t=1e3,en={feedback:null,comment:``};function tn(e){return e.feedback!=null}function nn(e){let t=e.feedback===`other`?e.comment.trim():``;return{feedback:e.feedback,comment:t||null}}function rn({value:e,onChange:t,disabled:r}){let{t:i}=z(`settings`);return(0,Y.jsxs)(`div`,{className:`mt-5 space-y-3`,"data-testid":`cancel-reason-survey`,children:[(0,Y.jsx)(h,{as:`p`,variant:`body-medium-default`,children:i(`cancelReasonSurvey.title`)}),(0,Y.jsx)(ne,{value:e.feedback??``,onValueChange:n=>t({...e,feedback:n===``?null:n}),name:`cancel-reason`,disabled:r,"aria-label":i(`cancelReasonSurvey.title`),children:Zt.map(e=>(0,Y.jsx)(n,{value:e,label:i(Qt[e])},e))}),e.feedback===`other`?(0,Y.jsx)(c,{label:i(`cancelReasonSurvey.otherLabel`),placeholder:i(`cancelReasonSurvey.otherPlaceholder`),value:e.comment,onChange:n=>t({...e,comment:n.target.value}),maxLength:$t,rows:3,disabled:r,fullWidth:!0,"data-testid":`cancel-reason-comment`}):null]})}var an={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`cloud`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function on({tier:e,size:t=40}){let n=an[e]??an.free,r=v();return(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,Y.jsx)(E,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,Y.jsx)(`div`,{style:{width:t,height:t}})})}var sn={free:{tagline:`Get to know your assistant.`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`More capacity for consistent use.`,cta:`Power Up`,priceCaption:`Billed monthly`,recommended:!0},super:{tagline:`Do more, think less about the how.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Your second brain, running full speed.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function cn(e){return sn[e]}function ln(e){return`Downgrade to ${e}`}function un(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function dn(e){return`${un(e)}/mo`}function fn(e){return`${un(e)}/month`}function pn(e){return`${e>0?`+`:`−`}${un(Math.abs(e))}/mo`}function mn(e){return`${e} GB storage`}function hn(e){return`${un(e*100)} of bundled credits`}var gn=`Small`;function _n(e){return e?.machine_size?G[e.machine_size]??e.machine_size:gn}function vn(e,t){let n=cn(e.key)?.extraFeatures??[];return[{icon:q,label:`${_n(e)} Machine`},{icon:U,label:`${e.storage_gib} GB Storage`},{icon:xe,label:t},...n.map(e=>({icon:ye,label:e}))]}function yn(){return[{icon:q,label:`${gn} Machine`},{icon:U,label:`4 GB Storage`},{icon:xe,label:`Pay as you go credits`}]}function bn(e,t=[]){let n=e?.credits_usd??0,r=e?.storage_gib??4,i=we[e?.machine_size??`small`];return[`${_n(e)} machine${i?` (${i})`:``}`,mn(r),e?.usage_label??hn(n),...t]}var xn={machine:`Configurable machine size`,storage:`Configurable storage`,credits:`Pay-as-you-go and bundled credits`};function Sn(e,t){let n=[`${e.machineTier?Ce[e.machineTier]??t.machine_tiers.find(t=>t.tier===e.machineTier)?.label??e.machineTier:gn} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=gt(t,e.creditTier)?.label,i=_t(e.creditTier);n.push(r??(i==null?`Credit bundle`:`${i} credits/mo`))}return n}function Cn(e,t){let n=new Set([xn.machine]);return e.storageGib!=null&&n.add(xn.storage),e.creditTier!=null&&n.add(xn.credits),[...Sn(e,t),...t.included_features.filter(e=>!n.has(e))]}function wn(e){return e.disabled===!0}function Tn({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let{t:c}=z(`settings`),l=(0,J.useMemo)(()=>e.map(e=>{let t=Ce[e.tier]??e.label,n=o==null?c(`tierPicker.priceAddon`,{price:dn(e.price_cents)}):e.price_cents===o?c(`tierPicker.priceCurrent`,{price:dn(e.price_cents)}):pn(e.price_cents-o);return{value:e.tier,label:c(`tierPicker.machineOption`,{label:t,priceLabel:n}),disabled:wn(e)}}),[e,o,c]),u=(0,J.useMemo)(()=>t.map(e=>{let t=s==null?c(`tierPicker.priceAddon`,{price:dn(e.price_cents)}):e.price_cents===s?c(`tierPicker.priceCurrent`,{price:dn(e.price_cents)}):pn(e.price_cents-s);return{value:e.tier,label:c(`tierPicker.storageOption`,{gib:e.storage_gib,priceLabel:t}),disabled:wn(e)}}),[t,s,c]);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(h,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.machineLabel`)}),(0,Y.jsx)(`span`,{title:c(`tierPicker.machineTooltip`),children:(0,Y.jsx)(H,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,Y.jsx)(se,{"aria-label":c(`tierPicker.machineAriaLabel`),placeholder:c(`tierPicker.machinePlaceholder`),value:n??``,onChange:i,options:l})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(h,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.storageLabel`)}),(0,Y.jsx)(`span`,{title:c(`tierPicker.storageTooltip`),children:(0,Y.jsx)(H,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,Y.jsx)(se,{"aria-label":c(`tierPicker.storageAriaLabel`),placeholder:c(`tierPicker.storagePlaceholder`),value:r??``,onChange:a,options:u})]})]})}var En=new Set([`active`,`trialing`,`past_due`]);function Dn(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&En.has(e.status)}function On(e){return e?.status!=null&&En.has(e.status)}var kn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function An(e,t){if(e&&typeof e==`object`){for(let t of kn)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function jn(e,t){let n=e.filter(e=>!wn(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Mn(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function Nn(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function Pn(){let e=B();return async t=>{try{let n=await t.mutateAsync();return await e.invalidateQueries({queryKey:C()}),t.onSuccess(n),n}catch(e){return L.error(An(e,t.errorFallback()),{id:t.errorToastId}),null}}}var Fn=`billing-portal-return-snapshot`;function In(e){try{sessionStorage.removeItem(Fn),sessionStorage.setItem(Fn,JSON.stringify(e))}catch{}}function Ln(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(Fn);if(!e)return null;let t=JSON.parse(e);return typeof t.cancel_at_period_end!=`boolean`||typeof t.plan_id!=`string`?null:{cancel_at_period_end:t.cancel_at_period_end,cancel_at:t.cancel_at??null,plan_id:t.plan_id}}catch{return null}}function Rn(){try{sessionStorage.removeItem(Fn)}catch{}}function zn(e){return e?{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at??null,plan_id:e.plan_id}:null}function Bn(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function Vn(e){return e?e.cancel_at??e.current_period_end??null:null}function Hn(e){let t=B();return(0,J.useEffect)(()=>D(()=>{t.invalidateQueries(i())}),[t]),F({onSuccess:t=>{e&&In(e),O(t.portal_url)},onError:()=>{L.error(de(`settings:useBillingPortalSession.openError`),{id:`billing-portal-session-error`})}})}function Un(){let e=ae(),t=Pn();return{cancelSubscription:n=>t({mutateAsync:()=>e.mutateAsync({body:n}),onSuccess:e=>{let t=e.cancel_at?Bn(e.cancel_at):de(`settings:useCancelSubscription.endOfBillingPeriod`);L.info(de(`settings:useCancelSubscription.canceledToast`,{date:t}),{id:`subscription-cancel`})},errorToastId:`subscription-cancel-error`,errorFallback:()=>de(`settings:useCancelSubscription.cancelFailedToast`)}),isPending:e.isPending}}function Wn(e){return Promise.all([e.invalidateQueries({queryKey:C()}),e.invalidateQueries({queryKey:y()}),e.invalidateQueries({queryKey:ce()}),e.invalidateQueries({queryKey:T()})])}function Gn({enabled:e=!0}={}){let t=B(),{t:n}=z(`settings`),[r,a]=(0,J.useState)(null),o=(0,J.useRef)(!1),[s,c]=(0,J.useState)(!1),u=I(),d=e&&u,f=R({...i(),enabled:d}),p=f.data,m=p!=null&&p.plan_id!==`base`,h=R({...x(),enabled:d&&m}),g=R({..._(),enabled:d&&m}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],v=e=>g.find(t=>t.tier===e)?.price_cents??null,y=le(l()),b={machineTier:h.data?.max_machine_tier??null,storageTier:h.data?.selected_storage_tier??null,storageGib:h.data?.selected_storage_gib??null,creditTier:p?.selected_credit_tier??null,hasPlatformFee:p?.has_platform_fee??!0},S=p!=null&&p.plan_id!==`base`&&p.status!=null&&En.has(p.status)&&p.cancel_at_period_end!==!0&&!p.cancel_at,C=!m||!h.isPending,w=!m||h.isSuccess&&h.data!=null&&!h.isFetching&&h.dataUpdatedAt>=f.dataUpdatedAt,T=s||y.isPending,E=async(e,t=b)=>{if(o.current)return null;o.current=!0,c(!0);try{return await D(e,t)}finally{o.current=!1,c(!1)}},D=async(e,r)=>{a(null);let i=e=>(a(e),L.error(e),null),[o,s]=await Promise.all([f.refetch(),h.refetch()]),c=o.data,l=s.data;if(o.isError||s.isError||c==null||l==null)return i(n(`customPlanModal.changeFailed`));let u={machineTier:l.max_machine_tier??null,storageTier:l.selected_storage_tier??null,storageGib:l.selected_storage_gib??null,creditTier:c.selected_credit_tier??null,hasPlatformFee:c.has_platform_fee??!0},d={machineTier:e.machineTier===r.machineTier?u.machineTier:e.machineTier,storageTier:e.storageTier===r.storageTier&&u.storageTier!=null?u.storageTier:e.storageTier,creditTier:e.creditTier===r.creditTier?u.creditTier:e.creditTier},p=d.machineTier!==u.machineTier,m=d.storageTier!==u.storageTier,g=d.creditTier!==u.creditTier,_=!u.hasPlatformFee,b=v(d.machineTier),x=v(u.machineTier),S=p&&b!=null&&x!=null&&b<x;if(!p&&!m&&!g&&!_)return{needsResize:!1,creditChanged:!1};let C;try{C=(await y.mutateAsync({body:{machine_tier:d.machineTier,storage_tier:d.storageTier,credit_tier:d.creditTier}})).status}catch(e){return i(An(e,n(`customPlanModal.changeFailed`)))}return await Wn(t),C===`no_op`?{needsResize:!1,creditChanged:!1}:{needsResize:m||p&&!S,creditChanged:g}};return{changeTiers:E,isPending:T,error:r,current:b,eligible:S,currentReady:C,currentKnown:w,primaryAssistantId:w?h.data?.primary_assistant_id??null:null}}function Kn(){let e=B(),{t}=z(`settings`),n=le(l());return{changePackage:async r=>{try{let t=await n.mutateAsync({body:{package:r}});return await Wn(e),t}catch(e){return L.error(An(e,t(`customPlanModal.changeFailed`))),null}},isPending:n.isPending}}function qn({className:e,"data-testid":t,children:n}){return(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":t,className:b(`flex size-[52px] shrink-0 items-center justify-center rounded-xl`,e),children:n})}var Jn=32;function Yn(){let{ready:e,components:t,traits:n,customImageUrl:r}=f();return(0,Y.jsx)(qn,{"data-testid":`assistant-avatar-tile`,className:`bg-[var(--surface-active)]`,children:e?(0,Y.jsx)(N,{components:t,traits:n,customImageUrl:r,size:Jn}):null})}var Xn=`Billed monthly · prorated difference charged today`,Zn=`Billed monthly · prorated difference charged today or credited next invoice`,Qn=`Billed monthly · prorated credit on your next invoice`,$n=`Your machine downsizes now and your storage stays. No refund.`,er=`Continue`,tr=`The plan includes`,nr=`Your plan will include`;function rr(e,t,n){let r=n?cn(n)?.tagline??``:``;switch(e){case`downgrade`:return{title:ln(t),subtitle:``,priceCaption:Qn,checklistHeading:nr,note:$n,confirmLabel:ln(t),destructive:!0};case`switch`:return{title:`Switch to ${t}`,subtitle:r,priceCaption:Zn,checklistHeading:tr,note:``,confirmLabel:er,destructive:!1};default:return{title:`Upgrade to ${t}`,subtitle:r,priceCaption:Xn,checklistHeading:tr,note:``,confirmLabel:er,destructive:!1}}}function ir({open:e,relation:t,packageName:n,targetPackage:r,pending:i,onCancel:a,onConfirm:o}){let{t:s}=z(`settings`),c=(0,J.useRef)(null),l=(0,J.useId)(),u=rr(t,n,r?.key??null),d=r?{price:dn(r.total_price_cents),highlights:bn(r,cn(r.key)?.extraFeatures??[])}:null,f=u.subtitle,p=u.note?{"aria-describedby":l}:f?{}:{"aria-describedby":void 0};return(0,Y.jsx)(S.Root,{open:e,onOpenChange:e=>{!e&&!i&&a()},children:(0,Y.jsxs)(S.Content,{size:`sm`,hideCloseButton:!0,className:`gap-4 p-4 max-w-[421px]`,onOpenAutoFocus:e=>{e.preventDefault(),c.current?.focus()},...p,children:[(0,Y.jsxs)(S.Header,{className:`flex-row items-center gap-3 p-0 pb-2`,children:[u.destructive?(0,Y.jsx)(qn,{"data-testid":`package-switch-warning-tile`,className:`bg-[var(--system-negative-weak)]`,children:(0,Y.jsx)(V,{className:`size-6 text-[var(--system-negative-strong)]`})}):(0,Y.jsx)(Yn,{}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Y.jsx)(S.Title,{className:`text-title-small text-[var(--content-emphasised)] [&>span]:whitespace-normal`,children:u.title}),f?(0,Y.jsx)(S.Description,{className:`mt-0 text-body-medium-default text-[var(--content-tertiary)]`,children:f}):null]})]}),d?(0,Y.jsxs)(S.Body,{className:`flex flex-col gap-4 p-0`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(h,{as:`p`,variant:`title-large`,className:`text-[var(--content-default)]`,children:d.price}),(0,Y.jsx)(h,{as:`p`,variant:`label-medium-default`,className:`leading-[15px] text-[var(--content-tertiary)]`,children:u.priceCaption})]}),(0,Y.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,Y.jsx)(h,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:u.checklistHeading}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-2`,children:d.highlights.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(W,{className:`size-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,Y.jsx)(h,{as:`span`,variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]},e))})]}):null,u.note?(0,Y.jsx)(h,{id:l,as:`p`,variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:u.note}):null,(0,Y.jsxs)(S.Footer,{className:`flex-col gap-4 p-0`,children:[(0,Y.jsx)(j,{fullWidth:!0,variant:u.destructive?`danger`:`primary`,onClick:o,disabled:i,"data-testid":`confirm-package-switch-button`,children:u.confirmLabel}),(0,Y.jsx)(j,{ref:c,fullWidth:!0,variant:`ghost`,onClick:a,disabled:i,children:s(`packageSwitchConfirmModal.cancel`)})]})]})})}function ar(){let e=B();(0,J.useEffect)(()=>D(()=>{Wn(e)}),[e])}export{dn as A,Wt as B,Cn as C,vn as D,_n as E,rn as F,Ve as G,Gt as H,en as I,ze as K,tn as L,mn as M,cn as N,pn as O,on as P,nn as R,wn as S,yn as T,Yt as U,Xt as V,Ut as W,Dn as _,Wn as a,jn as b,Rn as c,Ln as d,Hn as f,On as g,An as h,Gn as i,fn as j,un as k,Bn as l,En as m,ir as n,Un as o,Pn as p,q,Kn as r,zn as s,ar as t,Vn as u,Nn as v,Sn as w,Tn as x,Mn as y,Kt as z};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$u as t,AC as n,Ai as r,Bd as i,Bu as a,DS as o,Dv as s,FC as c,Fd as l,Fu as u,GC as d,Ic as f,Id as p,Ii as m,JC as h,Ld as g,Nd as _,Oi as v,Pd as y,Qo as b,Rd as x,SC as S,Vd as C,Vu as w,Wd as T,Xn as E,Xy as D,Yy as O,__ as k,au as A,aw as j,bC as M,b_ as ee,cd as te,ea as N,fb as P,jC as ne,ki as re,mb as ie,nf as ae,rd as oe,tf as F,uh as I,vC as se,xC as L,zd as ce}from"./app-DbJUeBix.js";import{$n as R,E as z,Xn as le,cr as ue,j as de,nr as B,or as fe}from"./vendor-CtXGFqsu.js";import{f as pe,t as me,x as he}from"./react-B9IgSVeK.js";import{D as V,Ji as ge,Ra as _e,Ui as ve,Vn as ye,Ya as be,fr as H,pi as xe,xr as U,zi as W}from"./icons-C0wyat6T.js";import{c as Se,i as G,l as K,n as Ce,r as we,t as Te}from"./machine-sizes-qp9khCYo.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./provisioning-targets-CHlEOzsV.js";var q=be(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),J=e(he(),1),Y=me();function je({icon:e}){return(0,Y.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,Y.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var Me={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function Ne({title:e,subtitle:t}){return(0,Y.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,Y.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:Me,children:e}),t&&(0,Y.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Pe=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1},{bodyShape:`stack`,eyeStyle:`gentle`,color:`purple`,size:110,position:`-left-[39px] top-[74%]`,rotate:0},{bodyShape:`urchin`,eyeStyle:`goofy`,color:`pink`,size:137,position:`-right-[42px] -bottom-[40px]`,rotate:180},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[37%] -bottom-[22px] -translate-x-1/2`,rotate:0}],Fe=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1}];function Ie({variant:e=`full`}){let t=v();return t?(0,Y.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?Fe:Pe).map((e,n)=>(0,Y.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,Y.jsx)(E,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}var Le={waitingStatus:`Upgrading your assistant…`,snagStatus:`We hit a snag upgrading your assistant`,snagCaption:`Retry in the background and we'll keep working on your upgrade.`,confirmingStatus:`Confirming your upgrade…`,confirmTimeoutStatus:`Still confirming your upgrade`,confirmTimeoutCaption:`Your payment went through safely. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still upgrading. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your upgrade continues in the background.`,backgroundRetryToast:`We'll retry your upgrade in the background.`,completeSubtitle:`Enjoy the new found power.`,fetchErrorBody:`We hit a problem checking your subscription. Your upgrade may still be processing. Return to billing to refresh.`},Re={waitingStatus:`Updating your assistant…`,snagStatus:`We hit a snag updating your assistant`,snagCaption:`Retry in the background and we'll keep working on your plan change.`,confirmingStatus:`Confirming your plan change…`,confirmTimeoutStatus:`Still confirming your plan change`,confirmTimeoutCaption:`Your plan change was submitted. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still updating. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your plan change continues in the background.`,backgroundRetryToast:`We'll retry your plan change in the background.`,completeSubtitle:`Your plan changes are live.`,fetchErrorBody:`We hit a problem checking your subscription. Your plan change may still be processing. Return to billing to refresh.`},X={upgrade:Le,downgrade:Re,change:Re};function Z(e=`upgrade`){return X[e]}function ze(e,t=!0){let{data:n}=R({...u(),enabled:t&&e==null}),{data:r}=R({...te({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Be({assistantId:e,direction:t}){let n=pe(),{t:r}=z(`settings`),i=ze(e,I())?.name||r(`completeState.assistantFallbackName`);return(0,Y.jsxs)(`div`,{className:`relative flex min-h-[320px] flex-col items-center justify-center overflow-hidden px-8 pb-16 [animation:onboarding-step-in_350ms_ease-out] motion-reduce:[animation:none]`,children:[(0,Y.jsx)(Ie,{variant:`full`}),(0,Y.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,Y.jsx)(Ne,{title:r(`completeState.title`),subtitle:Z(t).completeSubtitle}),(0,Y.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&k(e),n(o.assistant,{replace:!0})},children:r(`completeState.returnTo`,{assistantName:i})})})]})]})}function Ve(e=!0,t){let n=ze(t,e),r=t??n?.id,{data:i,isError:o,isFetching:s,dataUpdatedAt:c,errorUpdatedAt:l}=R({...a({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:o,domainsFetching:s,domainsUpdatedAt:c,domainsErrorUpdatedAt:l}}var He=1e3,Ue=1e4,Q=2500,We=2e3,Ge=1e4,Ke=[`machine_size`,`subdomain`,`non_field_errors`],qe={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to upgrade yet. Try again in a moment.`},Je={provisioning_submission_failed:`We couldn't queue your plan change just now. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to update yet. Try again in a moment.`};function Ye(e,t,n=`upgrade`){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=(n===`upgrade`?void 0:Je[t.error])??qe[t.error];if(e)return e}for(let e of Ke){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var Xe=`h-8 rounded-lg border border-[var(--border-element)] bg-[var(--field-bg)] px-2.5 text-[14px] text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-[border-color] duration-150 focus:border-[var(--border-active)] disabled:cursor-not-allowed disabled:opacity-60`,Ze=`text-[11px] font-medium text-[var(--content-secondary)]`;function Qe({onExit:e,machineBusy:n=!1,assistantId:r}){let{t:i}=z(`settings`),a=B(),o=m.use.emailRootDomain(),{assistant:s,assistantId:c,domains:l}=Ve(!0,r),u=l?.results[0],[f,h]=(0,J.useState)(``),[g,_]=(0,J.useState)(`hi`),[v,y]=(0,J.useState)(!1);(0,J.useEffect)(()=>{if(!v){if(u){h(u.subdomain),y(!0);return}!s?.handle||f||(h(s.handle),y(!0))}},[s?.handle,u,v,f]);let[b,x]=(0,J.useState)(null),[C,T]=(0,J.useState)(!1),E=le(p()),D=!!u||C,O=E.isPending||C;return(0,J.useEffect)(()=>{if(!C)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[C,e]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(S.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,Y.jsx)(Ie,{variant:`top`}),(0,Y.jsx)(Ne,{title:i(`domainStep.title`),subtitle:i(`domainStep.subtitle`)}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:Ze,children:i(`domainStep.prefixLabel`)}),(0,Y.jsx)(`input`,{id:`onboarding-email-prefix`,value:g,onChange:e=>_(e.target.value.toLowerCase().trim()),disabled:O||D,readOnly:D,placeholder:i(`domainStep.emailUsernamePlaceholder`),className:`${Xe} w-24`})]}),(0,Y.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Y.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:Ze,children:i(`domainStep.handleLabel`)}),(0,Y.jsx)(`input`,{id:`onboarding-email-handle`,value:f,onChange:e=>{h(e.target.value.toLowerCase().trim()),b&&x(null)},disabled:O||D,readOnly:D,autoFocus:!0,placeholder:i(`domainStep.subdomainExamplePlaceholder`),"aria-invalid":!!b,className:`${Xe} w-full min-w-0`})]}),(0,Y.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,o]})]}),b&&(0,Y.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:b}),D&&(0,Y.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:i(`domainStep.domainLockedMessage`)})]}),n&&!D&&(0,Y.jsx)(d,{tone:`neutral`,children:i(`domainStep.machineBusyNotice`)}),!D&&(0,Y.jsx)(d,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,Y.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:i(`domainStep.handleImmutableNotice`)})}),C?(0,Y.jsx)(d,{tone:`success`,children:i(`domainStep.domainSetRedirecting`)}):null]}),(0,Y.jsx)(S.Footer,{className:`items-center pt-6`,children:D?(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:i(`domainStep.continue`)}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(j,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:O,onClick:()=>{O||E.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:i(`domainStep.skip`)}),(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!f||O||n,onClick:()=>{O||n||!f||E.mutate({body:{subdomain:f,...g?{email_username:g}:{}}},{onSuccess:()=>{x(null),T(!0),a.invalidateQueries({queryKey:t()}),a.invalidateQueries({queryKey:w({path:{assistant_id:c??``}})}),a.invalidateQueries({queryKey:ce()})},onError:e=>{x(Ye(e,i(`domainStep.registerSubdomainFailed`)))}})},children:i(`domainStep.next`)})]})})]})}function $e({onGoToBilling:e,direction:t}){let{t:n}=z(`settings`);return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,Y.jsx)(je,{icon:ve}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(h,{variant:`title-small`,as:`h1`,children:n(`errorStates.fetchErrorTitle`)}),(0,Y.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:Z(t).fetchErrorBody})]}),(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:n(`errorStates.goToBilling`)})]})}function et(e){let{targets:t,fromSnapshot:n,machineFloor:r,credits:i}=e,a=[];return t.machineSize==null?r!=null&&n.machineSize!=null&&n.machineSize!==r&&a.push({key:`machine`,label:`Machine`,from:G[n.machineSize],to:G[r]}):n.machineSize!==t.machineSize&&a.push({key:`machine`,label:`Machine`,from:n.machineSize==null?void 0:G[n.machineSize],to:G[t.machineSize]}),t.storageGib!=null&&(n.storageGib==null||t.storageGib>n.storageGib)&&a.push({key:`storage`,label:`Storage`,from:n.storageGib==null?void 0:`${n.storageGib} GB`,to:`${t.storageGib} GB`}),i!=null&&a.push({key:`credits`,label:i.label??`Credits`,from:i.from,to:i.to}),a}var tt=220;function nt({items:e,visible:t=!0,toWord:n,className:r=``,testId:i=`upgrade-metrics`}){let[a,o]=(0,J.useState)(!1);(0,J.useEffect)(()=>{let e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)},[]);let s=t&&a;return(0,Y.jsx)(`div`,{"aria-hidden":!t,"data-testid":i,"data-visible":t?`true`:`false`,className:`flex flex-col items-center gap-3 md:flex-row md:items-stretch md:gap-0 ${r}`,children:e.map((e,t)=>(0,Y.jsxs)(`div`,{"data-testid":e.key?`chip-${e.key}`:void 0,className:`flex flex-col items-center gap-1 px-6 transition-[opacity,transform] duration-500 ease-out motion-reduce:transition-none ${s?`translate-y-0 opacity-100`:`translate-y-2 opacity-0`} ${t>0?`md:border-l md:border-[var(--border-subtle)]`:``}`,style:{transitionDelay:s?`${t*tt}ms`:`0ms`},children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-[0.08em] text-[var(--content-tertiary)]`,children:e.label}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 whitespace-nowrap text-[var(--content-emphasised)]`,style:{fontFamily:`var(--font-serif)`,fontSize:`20px`,lineHeight:1.2},children:[e.from!=null&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:e.from}),n&&(0,Y.jsx)(`span`,{className:`sr-only`,children:n}),(0,Y.jsx)(_e,{className:`size-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,Y.jsx)(`span`,{children:e.to}),e.landed&&(0,Y.jsx)(ge,{"data-testid":`chip-check`,className:`size-3.5 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}),e.status&&(0,Y.jsx)(`span`,{className:`sr-only`,children:e.status})]})]},e.key??e.label))})}var $=48;function rt(e,t,n,r,i){let a=i*i,o=a*i;return .5*(2*t+(-e+n)*i+(2*e-5*t+4*n-r)*a+(-e+3*t-3*n+r)*o)}function it(e,t,n){let r=e.map(e=>({x:e.fx*t,y:e.fy*n,size:e.fs*n})),i=[],a=[],o=[],s=[],c=[],l=[],u=0;for(let e=0;e<r.length-1;e++){let t=r[Math.max(0,e-1)],n=r[e],c=r[e+1],l=r[Math.min(r.length-1,e+2)],d=e===r.length-2?$+1:$;for(let e=0;e<d;e++){let r=e/$,d=rt(t.x,n.x,c.x,l.x,r),f=rt(t.y,n.y,c.y,l.y,r);i.length>0&&(u+=Math.hypot(d-i[i.length-1],f-a[a.length-1])),i.push(d),a.push(f),o.push(n.size+(c.size-n.size)*r),s.push(u)}}for(let e=0;e<i.length;e++){let t=Math.max(0,e-1),n=Math.min(i.length-1,e+1),r=i[n]-i[t],o=a[n]-a[t],s=Math.hypot(r,o)||1;c.push(r/s),l.push(o/s)}return{length:u,at:e=>{let t=Math.min(u,Math.max(0,e)),n=0,r=s.length-1;for(;n<r;){let e=n+r>>1;s[e]<t?n=e+1:r=e}let d=Math.max(1,n),f=d-1,p=s[d]-s[f]||1,m=(t-s[f])/p,h=c[f]+(c[d]-c[f])*m,g=l[f]+(l[d]-l[f])*m,_=Math.hypot(h,g)||1;return{x:i[f]+(i[d]-i[f])*m,y:a[f]+(a[d]-a[f])*m,tx:h/_,ty:g/_,size:o[f]+(o[d]-o[f])*m}}}}function at(e,t){if(t<=0)return 0;let n=e%t;return n<0?n+t:n}function ot(e,t){let n=[],r=0;for(;r<e.length;)n.push(r),r+=Math.max(1,e.at(r).size*t);return n}var st={around:[{fx:.2,fy:-.16,fs:.02},{fx:.23,fy:0,fs:.024},{fx:.34,fy:.12,fs:.03},{fx:.52,fy:.19,fs:.037},{fx:.7,fy:.26,fs:.046},{fx:.85,fy:.4,fs:.058},{fx:.88,fy:.56,fs:.074},{fx:.76,fy:.71,fs:.095},{fx:.56,fy:.82,fs:.12},{fx:.4,fy:.93,fs:.15},{fx:.3,fy:1.08,fs:.185},{fx:.24,fy:1.28,fs:.22}],below:[{fx:1.16,fy:0,fs:.03},{fx:.95,fy:.06,fs:.036},{fx:.68,fy:.16,fs:.048},{fx:.4,fy:.3,fs:.065},{fx:.22,fy:.47,fs:.09},{fx:.32,fy:.64,fs:.125},{fx:.56,fy:.8,fs:.17},{fx:.58,fy:.98,fs:.22},{fx:.46,fy:1.22,fs:.27},{fx:.36,fy:1.5,fs:.3}]},ct={around:.24,below:.32},lt=.95,ut=.95,dt=1,ft=8,pt=20260922,mt=50;function ht({className:e=``,layout:t=`around`,flow:n=`down`,speed:i=1,lanes:a=3,paused:o=!1}){let s=v(),c=(0,J.useRef)(null),l=(0,J.useRef)({flow:n,speed:i,paused:o});return(0,J.useEffect)(()=>{l.current={flow:n,speed:i,paused:o}},[n,i,o]),(0,J.useEffect)(()=>{let e=c.current;if(!e||!s)return;let n=e.getContext(`2d`);if(!n)return;let i=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,o=0,u=0,d=null,f=1/0,p=[],m=0,h=new Map,g=(e,t)=>{let n=Math.max(1,Math.round(t/ft))*ft,r=`${e.bodyIdx}-${e.eyeIdx}-${e.colorIdx}-${n}`,i=h.get(r);if(i!==void 0)return i;let a=re(s,e.bodyIdx,e.eyeIdx,e.colorIdx,n);return h.set(r,a),a},_=()=>{let i=e.getBoundingClientRect();if(i.width===0||i.height===0||Math.abs(i.width-o)<1&&Math.abs(i.height-u)<1)return;let c=d,l=p.map(e=>e.distance);o=i.width,u=i.height;let m=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(o*m),e.height=Math.round(u*m),n.setTransform(m,0,0,m,0,0),d=it(st[t],o,u),f=u*ct[t];let h=r(pt),g=e=>(h()*2-1)*e,_=-1;if(p=[],ot(d,lt).forEach((e,t)=>{let n=t%2==0?0:.5;for(let t=0;t<a;t++){let r=Math.floor(h()*s.colors.length);r===_&&(r=(r+1)%s.colors.length),_=r,p.push({distance:e,lane:t-(a-1)/2+n,jitterAlong:g(.08),jitterAcross:g(.12),sizeScale:.85+h()*.3,rotate:g(10)*Math.PI/180,phase:h()*Math.PI*2,bodyIdx:Math.floor(h()*s.bodyShapes.length),eyeIdx:Math.floor(h()*s.eyeStyles.length),colorIdx:r})}}),c&&c.length>0){let e=d.length/c.length;p.forEach((t,n)=>{let r=l[n];r!==void 0&&(t.distance=at(r*e,d.length))})}},v=e=>{if(!d)return;let t=m?Math.min(mt,e-m):0;m=e;let{flow:r,speed:a,paused:s}=l.current,c=i||s?0:(r===`down`?1:-1)*a*dt*(t/1e3);n.clearRect(0,0,o,u);for(let t of p){if(c!==0){let e=d.at(t.distance).size;t.distance=at(t.distance+c*e,d.length)}let r=d.at(t.distance),a=Math.min(f,r.size*t.sizeScale),o=(t.lane*ut+t.jitterAcross)*r.size,s=t.jitterAlong*r.size,l=r.x+r.ty*o+r.tx*s,u=r.y-r.tx*o+r.ty*s,p=g(t,a);if(!p)continue;let m=i?0:Math.sin(e*.001+t.phase)*1.4,h=i?0:Math.sin(e*8e-4+t.phase*2)*.025;n.save(),n.translate(l,u+m),n.rotate(t.rotate+h),n.drawImage(p,-a/2,-a/2,a,a),n.restore()}};_();let y=new ResizeObserver(()=>{_(),i&&v(performance.now())});y.observe(e);let b=0;if(i)v(performance.now());else{let e=t=>{v(t),b=requestAnimationFrame(e)};b=requestAnimationFrame(e)}return()=>{cancelAnimationFrame(b),y.disconnect()}},[s,a,t]),(0,Y.jsx)(`canvas`,{ref:c,"aria-hidden":`true`,"data-testid":`upgrade-stream`,className:`pointer-events-none block h-full w-full ${e}`})}function gt(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function _t(e){let t=e?.match(/^credits_(\d+)$/)?.[1];return t==null?null:Number(t)}function vt(e){let t=I(),{data:n}=R({..._(),enabled:t&&e});return n?.plans.find(e=>e.id===`pro`)}function yt(e,t){return t==null?0:gt(e,t)?.credits_usd??_t(t)}function bt(e,t){return t==null?null:gt(e,t)?.label}function xt(e){let t=vt(e!=null);if(e==null||t==null)return null;let n,r;if(e.kind===`package`){let i=t.packages.find(t=>t.key===e.packageKey),a=gt(t,i?.credit_tier);n=i?.credits_usd??a?.credits_usd,r=i?.usage_label??a?.label??void 0}else{let i=gt(t,e.creditTier);n=i?.credits_usd,r=i?.label}return n==null?null:{fromLabel:null,toLabel:r}}function St(e){let t=vt(e!=null);return e==null||yt(t,e.fromTier)==null||yt(t,e.toTier)==null?null:{fromLabel:bt(t,e.fromTier),toLabel:bt(t,e.toTier)}}function Ct(e,t){let[n,r]=(0,J.useState)(e),i=(0,J.useRef)(0);return(0,J.useEffect)(()=>{i.current=performance.now()},[]),(0,J.useEffect)(()=>{if(t<=0||e===n)return;let a=t-(performance.now()-i.current);if(a<=0){i.current=performance.now(),r(e);return}let o=setTimeout(()=>{i.current=performance.now(),r(e)},a);return()=>clearTimeout(o)},[e,n,t]),t<=0?e:n}var wt=`#ffffff`;function Tt({status:e,caption:t}){return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,Y.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:Me,children:e}),t&&(0,Y.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Et(e,t){return e===`credits`?!0:t?.[e]===!0}function Dt(e,t){if(e==null)return null;let n=t(`provisioningState.noExtraUsage`),r=e.toLabel===null?n:e.toLabel;return r==null?null:{label:t(`provisioningState.usageLabel`),from:e.fromLabel===null?n:e.fromLabel,to:r}}function Ot({intent:e,creditsChange:t,targets:n,fromSnapshot:r,machineFloor:i,landed:a,allDone:o=!1,creditsOnly:s=!1}){let{t:c}=z(`settings`),l=xt(e),u=St(t),d=et({targets:n,fromSnapshot:r,machineFloor:i,credits:Dt(l??u,c)}),f=s?d.filter(e=>e.key===`credits`):d,p=f.filter(e=>o||Et(e.key,a)).map(e=>e.label).join(`, `),[m]=(0,J.useState)(p),h=p===m?``:c(`provisioningState.dimensionsComplete`,{dimensions:p});return f.length===0?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(nt,{items:f.map(e=>{let t=o||Et(e.key,a);return{key:e.key,label:e.label,from:e.from??null,to:e.to,landed:t,status:c(t?`provisioningState.statusComplete`:`provisioningState.statusPending`)}}),testId:`resource-chips`,toWord:c(`provisioningState.srOnlyTo`)}),(0,Y.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`chip-announcement`,children:h})]})}function kt({intent:e}){let{t}=z(`settings`),n=xt(e.kind===`custom`?e:null);if(e.kind===`package`){let n=e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1);return(0,Y.jsx)(nt,{testId:`resource-chips`,items:[{key:`package`,label:t(`provisioningState.packageLabel`),from:null,to:n}]})}let r=[];return e.machineTier!=null&&r.push({key:`machine`,label:t(`provisioningState.machineLabel`),from:null,to:Ce[e.machineTier]??e.machineTier}),e.storageTier!=null&&r.push({key:`storage`,label:t(`provisioningState.storageLabel`),from:null,to:e.storageTier.toUpperCase()}),e.creditTier!=null&&n?.toLabel!=null&&r.push({key:`credits`,label:t(`provisioningState.usageLabel`),from:null,to:n.toLabel}),r.length===0?null:(0,Y.jsx)(nt,{testId:`resource-chips`,items:r})}function At({state:e,direction:t,softWaiting:n,intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:s,landed:c,celebrating:l,onCelebrationEnd:u,escapeAvailable:d,onEscape:f,onPhaseChange:p,kickError:m,confirm:h,dwellMs:g=Q,phaseMinMs:_=900}){let{t:v}=z(`settings`),y=Z(t),b=(0,J.useRef)(u);(0,J.useEffect)(()=>{b.current=u},[u]);let x=Ct(e,_),S=x===`DONE`||x===`NOT_APPLICABLE`,C=x===`RESIZING`?`WAITING`:x,w=(0,J.useRef)(p);(0,J.useEffect)(()=>{w.current=p},[p]),(0,J.useEffect)(()=>{w.current?.(x)},[x]);let T=l&&S;(0,J.useEffect)(()=>{if(!T)return;let e=setTimeout(()=>b.current(),g);return()=>clearTimeout(e)},[T,g]);let E=A(),D=x===`STALLED`,O=(0,Y.jsx)(`div`,{className:`relative z-10 flex w-full flex-col items-center gap-6 [animation:onboarding-step-in_420ms_ease-out] motion-reduce:[animation:none]`,children:ee()},C);if(E)return(0,Y.jsxs)(`div`,{"data-testid":`provisioning-takeover`,"data-theme":`light`,className:`relative flex h-full min-h-[420px] w-full flex-col overflow-hidden text-center`,style:{backgroundColor:wt},children:[(0,Y.jsx)(`div`,{className:`px-6 pb-8 pt-16`,children:O}),(0,Y.jsx)(`div`,{className:`relative min-h-0 flex-1`,children:(0,Y.jsx)(ht,{className:`absolute inset-0`,layout:`below`,paused:D})})]});return(0,Y.jsxs)(`div`,{"data-testid":`provisioning-takeover`,"data-theme":`light`,className:`relative flex h-full min-h-[420px] w-full flex-col items-center justify-center overflow-hidden px-6 py-10 text-center`,style:{backgroundColor:wt},children:[(0,Y.jsx)(ht,{className:`absolute inset-0`,layout:`around`,paused:D}),(0,Y.jsx)(`div`,{className:`relative z-10 mr-[16%] flex w-full max-w-2xl flex-col items-center`,children:O})]});function k(e=v(`provisioningState.continueInBackground`)){return d?(0,Y.jsx)(j,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:f,children:e}):null}function M({allDone:e=!1,creditsOnly:t=!1}={}){return(0,Y.jsx)(Ot,{intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:s,landed:c,allDone:e,creditsOnly:t})}function ee(){if(x===`CONFIRMING`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:y.confirmingStatus,caption:v(`provisioningState.confirmingCaption`)}),r&&(0,Y.jsx)(kt,{intent:r}),k()]});if(x===`WAITING`||x===`RESIZING`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:y.waitingStatus,caption:v(n?`provisioningState.waitingCaptionLong`:`provisioningState.waitingCaptionShort`)}),M(),k()]});if(x===`DONE`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:v(`provisioningState.allDoneStatus`)}),M({allDone:!0})]});if(x===`NOT_APPLICABLE`)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:v(`provisioningState.planReadyStatus`)}),M({allDone:!0,creditsOnly:!0})]});if(x===`STALLED`){let e=m!=null;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:e?y.snagStatus:v(`provisioningState.takingLongerStatus`),caption:e?Ye(m,y.snagCaption,t):v(`provisioningState.stalledCaption`)}),M(),e?k(v(`provisioningState.retryInBackground`)):k()]})}return x===`CONFIRM_TIMEOUT`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{status:y.confirmTimeoutStatus,caption:y.confirmTimeoutCaption}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,Y.jsx)(j,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:h.onGoToBilling,children:v(`provisioningState.goToBilling`)}),(0,Y.jsx)(j,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:h.onRetry,children:v(`provisioningState.tryAgain`)})]})]}):null}}function jt(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0,targetsProveNoop:d=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let f=o||a,p=l===`started`||l===`in_progress`,m=o||d&&u;if(!a){let e=p?m:f||l===`already_done`||i!=null&&!Ee(n,i);if(Ee(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!p&&(d||l===`not_applicable`))return{state:`NOT_APPLICABLE`,softWaiting:!1}}else{if(l===`already_done`)return{state:`DONE`,softWaiting:!1};if(l===`not_applicable`)return{state:`NOT_APPLICABLE`,softWaiting:!1}}}return s!=null&&s>=9e4?{state:`STALLED`,softWaiting:!1}:f||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Mt=2e3,Nt=1e3,Pt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`],Ft={assistantId:null,machine:null,storage:null};function It({open:e,canLowerResources:t=!1,verdictRecheckMs:n=Ge}){let r=B(),a=I(),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(0),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)(null),[h,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[b,S]=(0,J.useState)(null),[w,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(Ft),[O,k]=(0,J.useState)(null),[A,j]=(0,J.useState)(!1),M=(0,J.useRef)(!1),N=(0,J.useRef)(!1),P=(0,J.useRef)(0),[ne,re]=(0,J.useState)(!1),[ie,ae]=(0,J.useState)(null),[F,se]=(0,J.useState)(null),[L,z]=(0,J.useState)(null),[de,pe]=(0,J.useState)(()=>Date.now()),[me,he]=(0,J.useState)(!0);(0,J.useEffect)(()=>{e||(s(!1),l(0),f(null),m(null),_(null),re(!1),ae(null),se(null),z(null),he(!0),y(null),S(null),T(null),D(Ft),k(null),j(!1),M.current=!1,N.current=!1,P.current+=1)},[e]),(0,J.useEffect)(()=>{e&&(f(Date.now()),r.invalidateQueries({queryKey:C()}),r.invalidateQueries({queryKey:ce()}))},[e,r]);let V=p!=null,ge=R({...i(),refetchInterval:e=>e.state.data?.plan_id===`pro`||o?!1:He,refetchIntervalInBackground:!1,enabled:e&&a&&!V}),_e=(d!=null&&ge.dataUpdatedAt>=d?ge.data?.plan_id:null)??null;(0,J.useEffect)(()=>{if(!e||V||_e!==`pro`)return;let t=Date.now();m(t),pe(t)},[e,V,_e]),(0,J.useEffect)(()=>{if(!e||V)return;let t=setTimeout(()=>s(!0),Ue);return()=>clearTimeout(t)},[e,V,c]);let ve=(0,J.useCallback)(()=>{s(!1),l(e=>e+1),ee.getState().fetchOrganizations(),r.invalidateQueries({queryKey:C()})},[r]),ye=(0,J.useCallback)(()=>{let e=Date.now();_(e),pe(e)},[]),{mutate:be}=le(g()),H=(0,J.useCallback)(e=>{let t=P.current;be({},{onSuccess:n=>{t===P.current&&(k(null),Oe(n)?N.current?k({error:n.reason??`no_active_pro`}):(N.current=!0,j(!0),e===`escape`&&ye()):(y(n.state),e===`escape`&&ye()))},onError:e=>{t===P.current&&k(e)}})},[be,ye]);(0,J.useEffect)(()=>{!e||!a||!V||M.current||(M.current=!0,H(`auto`))},[e,a,V,H]),(0,J.useEffect)(()=>{if(!A)return;let e=P.current,t=setTimeout(()=>{j(!1),e===P.current&&H(`auto`)},We);return()=>clearTimeout(t)},[A,H]);let xe=(0,J.useCallback)(()=>H(`escape`),[H]),U=R({...x(),enabled:e&&a&&V}),W=me?Mt:!1,G=R({...u(),enabled:e&&a&&V,refetchInterval:e=>e.state.data?.id==null?W:!1,retry:!1}),Ce=V&&d!=null&&U.dataUpdatedAt>=d,we=Ce&&!U.isPending&&!U.isFetching,q=(Ce?U.data?.primary_assistant_id:null)??(U.isPending?null:G.data?.id??null),Y=R({...te({path:{id:q??`unresolved`}}),enabled:e&&a&&V&&q!=null,refetchInterval:W,retry:!1}),je=oe({path:{id:q??`unresolved`}}),Me=R({...je,enabled:e&&a&&V&&q!=null,refetchInterval:W,retry:!1}),Ne=(0,J.useRef)(0),[Pe,Fe]=(0,J.useState)(0),Ie=ue(je.queryKey);(0,J.useEffect)(()=>r.getQueryCache().subscribe(t=>{if(!(t.type!==`updated`||t.query.queryHash!==Ie)){if(t.action.type===`fetch`)Ne.current+=1;else if(t.action.type===`success`&&!t.action.manual){let n=Ne.current,r=e&&ke(t.action.data);fe.schedule(()=>{Fe(n),r&&(re(!0),ae(q))})}}}),[r,Ie,e,q]);let Le=ke(Me.data),Re=ie===q,X=U.data,Z=(0,J.useMemo)(()=>X?{machineSize:Se(X.max_machine_tier),storageGib:X.selected_storage_gib??null}:null,[X]),ze=X!=null&&X.max_machine_tier==null?Te:null,Be=X?X.domain_setup_available&&X.primary_assistant_id!=null:void 0,Ve=Y.data,Q=(0,J.useMemo)(()=>Ve?{machineSize:Ve.machine_size??null,storageGib:Ve.provisioned_storage_gib??null}:null,[Ve]),Ke=L===q,qe=(0,J.useMemo)(()=>{let e=Ae(Z,Q),t=Z?.machineSize??ze;if(t==null)return e;let n=Q?.machineSize??null;if(n==null)return{...e,machine:!1};let r=(Ke?F?.machineSize:null)??n,i=K(t)<K(r);return{...e,machine:i?K(n)<=K(t):K(n)>=K(t)}},[Z,Q,F,Ke,ze]),Je=Ee(Z,Q),Ye=w===q;(0,J.useEffect)(()=>{e&&(Je?(S(e=>e!=null&&Ye?e:Date.now()),T(q)):(S(null),T(null)))},[e,Je,q,Ye]);let Xe=E.assistantId===q;(0,J.useEffect)(()=>{if(!e)return;let t=Ne.current;D(e=>{let n=e.assistantId===q?e:Ft,r=qe.machine?n.machine??t:null,i=qe.storage?n.storage??t:null;return e.assistantId===q&&e.machine===r&&e.storage===i?e:{assistantId:q,machine:r,storage:i}})},[e,qe,q]);let Ze=(0,J.useMemo)(()=>{let e=De(Me.data),t=e=>e!=null&&Xe&&Pe>e;return{machine:qe.machine&&!e.machine&&t(E.machine),storage:qe.storage&&!e.storage&&t(E.storage)}},[qe,E,Xe,Pe,Me.data]);(0,J.useEffect)(()=>{!e||!Q||F!=null&&Ke||(se(Q),z(q))},[e,Q,q,F,Ke]);let Qe=h??p,$e=Qe==null?null:Math.max(0,de-Qe),et=!t,{state:tt,softWaiting:nt}=jt({planId:V?`pro`:_e,targets:Z,actuals:Q,initialActuals:Ke?F:null,resizeOperationInFlight:Le,sawOperation:ne&&Re,msSinceWatchStart:$e,confirmExpired:o,serverVerdict:v,statusObservedSinceTargetsMet:b!=null&&Ye&&Me.dataUpdatedAt>b,targetsProveNoop:et}),$=Pt.includes(tt),rt=e&&V&&!$;(0,J.useEffect)(()=>{he(rt)},[rt]),(0,J.useEffect)(()=>{if(!e||!V||$)return;let t=setInterval(()=>pe(Date.now()),Nt);return()=>clearInterval(t)},[e,V,$]);let it=!et&&(v===`started`||v===`in_progress`)&&!(ne&&Re);return(0,J.useEffect)(()=>{if(!e||!V||$||!it)return;let t=setInterval(()=>H(`auto`),n);return()=>clearInterval(t)},[e,V,$,it,n,H]),{state:tt,softWaiting:nt,targets:Z,actualsSnapshot:F,machineFloor:ze,landed:Ze,assistantId:q,domainStepAvailable:Be,onboardingSettled:we,confirmError:!V&&ge.isError,targetsError:V&&U.isError&&(!X||!Ce),escapeEligible:$e!=null&&$e>=6e4,retryConfirm:ve,kickProvisioning:xe,kickError:O}}var Lt=200,Rt=380;function zt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var Bt=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,Vt=e=>e===`DONE`||e===`NOT_APPLICABLE`,Ht={machineSize:null,storageGib:null};function Ut({open:e,onClose:t,dwellMs:n,phaseMinMs:r,mode:i=`checkout`,resizeContext:a}){let{t:c}=z(`settings`),l=i===`resize`,u=B(),d=pe(),f=s.use.assistantInbox(),[p,m]=(0,J.useState)(`provisioning`),[h,g]=(0,J.useState)(`idle`),_=(0,J.useRef)([]),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(null),[C,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(!1),O=l?a?.direction:void 0,k=Z(O),A=It({open:e,canLowerResources:l?a?.canLowerResources===!0:!1});(0,J.useEffect)(()=>{if(e){y(l?null:ie()),T(e=>e??Date.now());return}_.current.forEach(clearTimeout),_.current=[],m(`provisioning`),g(`idle`),x(null),T(null),D(!1)},[e,l]),(0,J.useEffect)(()=>()=>{_.current.forEach(clearTimeout)},[]),(0,J.useEffect)(()=>{p===`complete`&&P()},[p]);let j=Bt(A.state),ee=Vt(b??A.state),{targets:te,assistantId:N,domainStepAvailable:ne,onboardingSettled:re}=A,ae=l?a?.fromSnapshot:void 0,oe=A.actualsSnapshot,F={machineSize:ae?.machineSize??oe?.machineSize??null,storageGib:ae?.storageGib??oe?.storageGib??null},I=l&&ne===!0,{domains:se,domainsError:ce,domainsFetching:R,domainsUpdatedAt:le,domainsErrorUpdatedAt:ue}=Ve(e&&I,N),de=(se?.results.length??0)>0,fe=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!e){fe.current=null;return}!I||N==null||fe.current!==N&&(fe.current=N,u.invalidateQueries({queryKey:w({path:{assistant_id:N}})}))},[e,I,N,u]);let me=!R&&(C!=null&&le>=C||C!=null&&!!ce&&ue>=C),[he,V]=(0,J.useState)(!1),ge=re&&(!I||me);(0,J.useEffect)(()=>{if(!e){V(!1);return}ge&&V(!0)},[e,ge]);let _e=(0,J.useCallback)(()=>{P(),t(),d(o.assistantInbox,{replace:!0})},[d,t]),ve=(0,J.useCallback)(()=>{let e=l?ne===!0&&!de?`domain`:`complete`:ne===!1?`complete`:`domain`;if(e===`domain`&&f){_e();return}if(zt()){m(e);return}g(`covering`),_.current.push(setTimeout(()=>{m(e),g(`revealing`),_.current.push(setTimeout(()=>g(`idle`),Rt))},Lt))},[ne,l,de,f,_e]),ye=(0,J.useCallback)(()=>{D(!0)},[]),be=(0,J.useCallback)(()=>{A.kickProvisioning(),L.info(A.kickError==null?k.backgroundExitToast:k.backgroundRetryToast),D(!1),t()},[A,t,k]),H=(0,J.useCallback)(()=>{D(!1)},[]),xe=p===`provisioning`&&(A.confirmError||A.targetsError),U=p===`provisioning`&&!xe,W=U&&!ee,Se=`transition-[background-color] duration-300 ease-out${U?` bg-white p-0`:``}`,G=U?`[animation:fadeIn_0.45s_ease-out_both]`:h===`revealing`?`[animation:fadeInUp_0.42s_ease-out_0.12s_both]`:`[animation:fadeIn_0.25s_ease-out_both]`;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(S.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Y.jsxs)(S.Content,{size:`md`,hideCloseButton:p!==`complete`,dismissOnOverlayClick:!W,onEscapeKeyDown:W?e=>e.preventDefault():void 0,onInteractOutside:W?e=>e.preventDefault():void 0,overlayClassName:Se,className:U?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,children:[(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${G}`,children:K()},p),h!==`idle`&&(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`takeover-exit-sheet`,className:`pointer-events-none fixed inset-0 z-50 ${h===`covering`?`[animation:fadeIn_200ms_ease-in_both]`:`[animation:fadeIn_380ms_ease-out_both_reverse]`}`,style:{backgroundColor:`#ffffff`}})]})}),(0,Y.jsx)(M,{open:E&&j,title:c(`billingOnboardingModal.backgroundConfirmTitle`),message:k.backgroundConfirmMessage,confirmLabel:c(`billingOnboardingModal.backgroundConfirmContinue`),cancelLabel:c(`billingOnboardingModal.backgroundConfirmKeepWaiting`),onConfirm:be,onCancel:H})]});function K(){return p===`provisioning`?A.confirmError||A.targetsError?(0,Y.jsx)($e,{onGoToBilling:t,direction:O}):(0,Y.jsx)(At,{state:A.state,direction:O,softWaiting:A.softWaiting,intent:v,creditsChange:l?a?.credits:void 0,targets:te??Ht,fromSnapshot:F,machineFloor:A.machineFloor,landed:A.landed,celebrating:he,onCelebrationEnd:ve,escapeAvailable:j&&A.escapeEligible,onEscape:ye,onPhaseChange:x,kickError:A.kickError,confirm:{onRetry:A.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:r}):p===`domain`?(0,Y.jsx)(Qe,{machineBusy:j,assistantId:N,onExit:()=>m(`complete`)}):(0,Y.jsx)(Be,{assistantId:N,direction:O})}}function Wt(e){return e!=null&&!e.customized}function Gt(e){return Wt(e)?e.name:`Custom`}var Kt=[`mighty`,`super`,`ultra`],qt=[`free`,...Kt];function Jt(e){return qt.indexOf(e)}function Yt(e,t){if(e===null)return`upgrade`;let n=Jt(e),r=Jt(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function Xt(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>Kt.indexOf(e.key)-Kt.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var Zt=[`too_expensive`,`missing_features`,`switched_service`,`unused`,`too_complex`,`low_quality`,`customer_service`,`other`],Qt={too_expensive:`cancelReasonSurvey.optionTooExpensive`,missing_features:`cancelReasonSurvey.optionMissingFeatures`,switched_service:`cancelReasonSurvey.optionSwitchedService`,unused:`cancelReasonSurvey.optionUnused`,too_complex:`cancelReasonSurvey.optionTooComplex`,low_quality:`cancelReasonSurvey.optionLowQuality`,customer_service:`cancelReasonSurvey.optionCustomerService`,other:`cancelReasonSurvey.optionOther`},$t=1e3,en={feedback:null,comment:``};function tn(e){return e.feedback!=null}function nn(e){let t=e.feedback===`other`?e.comment.trim():``;return{feedback:e.feedback,comment:t||null}}function rn({value:e,onChange:t,disabled:r}){let{t:i}=z(`settings`);return(0,Y.jsxs)(`div`,{className:`mt-5 space-y-3`,"data-testid":`cancel-reason-survey`,children:[(0,Y.jsx)(h,{as:`p`,variant:`body-medium-default`,children:i(`cancelReasonSurvey.title`)}),(0,Y.jsx)(ne,{value:e.feedback??``,onValueChange:n=>t({...e,feedback:n===``?null:n}),name:`cancel-reason`,disabled:r,"aria-label":i(`cancelReasonSurvey.title`),children:Zt.map(e=>(0,Y.jsx)(n,{value:e,label:i(Qt[e])},e))}),e.feedback===`other`?(0,Y.jsx)(c,{label:i(`cancelReasonSurvey.otherLabel`),placeholder:i(`cancelReasonSurvey.otherPlaceholder`),value:e.comment,onChange:n=>t({...e,comment:n.target.value}),maxLength:$t,rows:3,disabled:r,fullWidth:!0,"data-testid":`cancel-reason-comment`}):null]})}var an={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`cloud`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function on({tier:e,size:t=40}){let n=an[e]??an.free,r=v();return(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,Y.jsx)(E,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,Y.jsx)(`div`,{style:{width:t,height:t}})})}var sn={free:{tagline:`Get to know your assistant.`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`More capacity for consistent use.`,cta:`Power Up`,priceCaption:`Billed monthly`,recommended:!0},super:{tagline:`Do more, think less about the how.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Your second brain, running full speed.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function cn(e){return sn[e]}function ln(e){return`Downgrade to ${e}`}function un(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function dn(e){return`${un(e)}/mo`}function fn(e){return`${un(e)}/month`}function pn(e){return`${e>0?`+`:`−`}${un(Math.abs(e))}/mo`}function mn(e){return`${e} GB storage`}function hn(e){return`${un(e*100)} of bundled credits`}var gn=`Small`;function _n(e){return e?.machine_size?G[e.machine_size]??e.machine_size:gn}function vn(e,t){let n=cn(e.key)?.extraFeatures??[];return[{icon:q,label:`${_n(e)} Machine`},{icon:U,label:`${e.storage_gib} GB Storage`},{icon:xe,label:t},...n.map(e=>({icon:ye,label:e}))]}function yn(){return[{icon:q,label:`${gn} Machine`},{icon:U,label:`4 GB Storage`},{icon:xe,label:`Pay as you go credits`}]}function bn(e,t=[]){let n=e?.credits_usd??0,r=e?.storage_gib??4,i=we[e?.machine_size??`small`];return[`${_n(e)} machine${i?` (${i})`:``}`,mn(r),e?.usage_label??hn(n),...t]}var xn={machine:`Configurable machine size`,storage:`Configurable storage`,credits:`Pay-as-you-go and bundled credits`};function Sn(e,t){let n=[`${e.machineTier?Ce[e.machineTier]??t.machine_tiers.find(t=>t.tier===e.machineTier)?.label??e.machineTier:gn} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=gt(t,e.creditTier)?.label,i=_t(e.creditTier);n.push(r??(i==null?`Credit bundle`:`${i} credits/mo`))}return n}function Cn(e,t){let n=new Set([xn.machine]);return e.storageGib!=null&&n.add(xn.storage),e.creditTier!=null&&n.add(xn.credits),[...Sn(e,t),...t.included_features.filter(e=>!n.has(e))]}function wn(e){return e.disabled===!0}function Tn({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let{t:c}=z(`settings`),l=(0,J.useMemo)(()=>e.map(e=>{let t=Ce[e.tier]??e.label,n=o==null?c(`tierPicker.priceAddon`,{price:dn(e.price_cents)}):e.price_cents===o?c(`tierPicker.priceCurrent`,{price:dn(e.price_cents)}):pn(e.price_cents-o);return{value:e.tier,label:c(`tierPicker.machineOption`,{label:t,priceLabel:n}),disabled:wn(e)}}),[e,o,c]),u=(0,J.useMemo)(()=>t.map(e=>{let t=s==null?c(`tierPicker.priceAddon`,{price:dn(e.price_cents)}):e.price_cents===s?c(`tierPicker.priceCurrent`,{price:dn(e.price_cents)}):pn(e.price_cents-s);return{value:e.tier,label:c(`tierPicker.storageOption`,{gib:e.storage_gib,priceLabel:t}),disabled:wn(e)}}),[t,s,c]);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(h,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.machineLabel`)}),(0,Y.jsx)(`span`,{title:c(`tierPicker.machineTooltip`),children:(0,Y.jsx)(H,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,Y.jsx)(se,{"aria-label":c(`tierPicker.machineAriaLabel`),placeholder:c(`tierPicker.machinePlaceholder`),value:n??``,onChange:i,options:l})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(h,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.storageLabel`)}),(0,Y.jsx)(`span`,{title:c(`tierPicker.storageTooltip`),children:(0,Y.jsx)(H,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,Y.jsx)(se,{"aria-label":c(`tierPicker.storageAriaLabel`),placeholder:c(`tierPicker.storagePlaceholder`),value:r??``,onChange:a,options:u})]})]})}var En=new Set([`active`,`trialing`,`past_due`]);function Dn(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&En.has(e.status)}function On(e){return e?.status!=null&&En.has(e.status)}var kn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function An(e,t){if(e&&typeof e==`object`){for(let t of kn)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function jn(e,t){let n=e.filter(e=>!wn(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Mn(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function Nn(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function Pn(){let e=B();return async t=>{try{let n=await t.mutateAsync();return await e.invalidateQueries({queryKey:C()}),t.onSuccess(n),n}catch(e){return L.error(An(e,t.errorFallback()),{id:t.errorToastId}),null}}}var Fn=`billing-portal-return-snapshot`;function In(e){try{sessionStorage.removeItem(Fn),sessionStorage.setItem(Fn,JSON.stringify(e))}catch{}}function Ln(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(Fn);if(!e)return null;let t=JSON.parse(e);return typeof t.cancel_at_period_end!=`boolean`||typeof t.plan_id!=`string`?null:{cancel_at_period_end:t.cancel_at_period_end,cancel_at:t.cancel_at??null,plan_id:t.plan_id}}catch{return null}}function Rn(){try{sessionStorage.removeItem(Fn)}catch{}}function zn(e){return e?{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at??null,plan_id:e.plan_id}:null}function Bn(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function Vn(e){return e?e.cancel_at??e.current_period_end??null:null}function Hn(e){let t=B();return(0,J.useEffect)(()=>D(()=>{t.invalidateQueries(i())}),[t]),F({onSuccess:t=>{e&&In(e),O(t.portal_url)},onError:()=>{L.error(de(`settings:useBillingPortalSession.openError`),{id:`billing-portal-session-error`})}})}function Un(){let e=ae(),t=Pn();return{cancelSubscription:n=>t({mutateAsync:()=>e.mutateAsync({body:n}),onSuccess:e=>{let t=e.cancel_at?Bn(e.cancel_at):de(`settings:useCancelSubscription.endOfBillingPeriod`);L.info(de(`settings:useCancelSubscription.canceledToast`,{date:t}),{id:`subscription-cancel`})},errorToastId:`subscription-cancel-error`,errorFallback:()=>de(`settings:useCancelSubscription.cancelFailedToast`)}),isPending:e.isPending}}function Wn(e){return Promise.all([e.invalidateQueries({queryKey:C()}),e.invalidateQueries({queryKey:y()}),e.invalidateQueries({queryKey:ce()}),e.invalidateQueries({queryKey:T()})])}function Gn({enabled:e=!0}={}){let t=B(),{t:n}=z(`settings`),[r,a]=(0,J.useState)(null),o=(0,J.useRef)(!1),[s,c]=(0,J.useState)(!1),u=I(),d=e&&u,f=R({...i(),enabled:d}),p=f.data,m=p!=null&&p.plan_id!==`base`,h=R({...x(),enabled:d&&m}),g=R({..._(),enabled:d&&m}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],v=e=>g.find(t=>t.tier===e)?.price_cents??null,y=le(l()),b={machineTier:h.data?.max_machine_tier??null,storageTier:h.data?.selected_storage_tier??null,storageGib:h.data?.selected_storage_gib??null,creditTier:p?.selected_credit_tier??null,hasPlatformFee:p?.has_platform_fee??!0},S=p!=null&&p.plan_id!==`base`&&p.status!=null&&En.has(p.status)&&p.cancel_at_period_end!==!0&&!p.cancel_at,C=!m||!h.isPending,w=!m||h.isSuccess&&h.data!=null&&!h.isFetching&&h.dataUpdatedAt>=f.dataUpdatedAt,T=s||y.isPending,E=async(e,t=b)=>{if(o.current)return null;o.current=!0,c(!0);try{return await D(e,t)}finally{o.current=!1,c(!1)}},D=async(e,r)=>{a(null);let i=e=>(a(e),L.error(e),null),[o,s]=await Promise.all([f.refetch(),h.refetch()]),c=o.data,l=s.data;if(o.isError||s.isError||c==null||l==null)return i(n(`customPlanModal.changeFailed`));let u={machineTier:l.max_machine_tier??null,storageTier:l.selected_storage_tier??null,storageGib:l.selected_storage_gib??null,creditTier:c.selected_credit_tier??null,hasPlatformFee:c.has_platform_fee??!0},d={machineTier:e.machineTier===r.machineTier?u.machineTier:e.machineTier,storageTier:e.storageTier===r.storageTier&&u.storageTier!=null?u.storageTier:e.storageTier,creditTier:e.creditTier===r.creditTier?u.creditTier:e.creditTier},p=d.machineTier!==u.machineTier,m=d.storageTier!==u.storageTier,g=d.creditTier!==u.creditTier,_=!u.hasPlatformFee,b=v(d.machineTier),x=v(u.machineTier),S=p&&b!=null&&x!=null&&b<x;if(!p&&!m&&!g&&!_)return{needsResize:!1,creditChanged:!1};let C;try{C=(await y.mutateAsync({body:{machine_tier:d.machineTier,storage_tier:d.storageTier,credit_tier:d.creditTier}})).status}catch(e){return i(An(e,n(`customPlanModal.changeFailed`)))}return await Wn(t),C===`no_op`?{needsResize:!1,creditChanged:!1}:{needsResize:m||p&&!S,creditChanged:g}};return{changeTiers:E,isPending:T,error:r,current:b,eligible:S,currentReady:C,currentKnown:w,primaryAssistantId:w?h.data?.primary_assistant_id??null:null}}function Kn(){let e=B(),{t}=z(`settings`),n=le(l());return{changePackage:async r=>{try{let t=await n.mutateAsync({body:{package:r}});return await Wn(e),t}catch(e){return L.error(An(e,t(`customPlanModal.changeFailed`))),null}},isPending:n.isPending}}function qn({className:e,"data-testid":t,children:n}){return(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":t,className:b(`flex size-[52px] shrink-0 items-center justify-center rounded-xl`,e),children:n})}var Jn=32;function Yn(){let{ready:e,components:t,traits:n,customImageUrl:r}=f();return(0,Y.jsx)(qn,{"data-testid":`assistant-avatar-tile`,className:`bg-[var(--surface-active)]`,children:e?(0,Y.jsx)(N,{components:t,traits:n,customImageUrl:r,size:Jn}):null})}var Xn=`Billed monthly · prorated difference charged today`,Zn=`Billed monthly · prorated difference charged today or credited next invoice`,Qn=`Billed monthly · prorated credit on your next invoice`,$n=`Your machine downsizes now and your storage stays. No refund.`,er=`Continue`,tr=`The plan includes`,nr=`Your plan will include`;function rr(e,t,n){let r=n?cn(n)?.tagline??``:``;switch(e){case`downgrade`:return{title:ln(t),subtitle:``,priceCaption:Qn,checklistHeading:nr,note:$n,confirmLabel:ln(t),destructive:!0};case`switch`:return{title:`Switch to ${t}`,subtitle:r,priceCaption:Zn,checklistHeading:tr,note:``,confirmLabel:er,destructive:!1};default:return{title:`Upgrade to ${t}`,subtitle:r,priceCaption:Xn,checklistHeading:tr,note:``,confirmLabel:er,destructive:!1}}}function ir({open:e,relation:t,packageName:n,targetPackage:r,pending:i,onCancel:a,onConfirm:o}){let{t:s}=z(`settings`),c=(0,J.useRef)(null),l=(0,J.useId)(),u=rr(t,n,r?.key??null),d=r?{price:dn(r.total_price_cents),highlights:bn(r,cn(r.key)?.extraFeatures??[])}:null,f=u.subtitle,p=u.note?{"aria-describedby":l}:f?{}:{"aria-describedby":void 0};return(0,Y.jsx)(S.Root,{open:e,onOpenChange:e=>{!e&&!i&&a()},children:(0,Y.jsxs)(S.Content,{size:`sm`,hideCloseButton:!0,className:`gap-4 p-4 max-w-[421px]`,onOpenAutoFocus:e=>{e.preventDefault(),c.current?.focus()},...p,children:[(0,Y.jsxs)(S.Header,{className:`flex-row items-center gap-3 p-0 pb-2`,children:[u.destructive?(0,Y.jsx)(qn,{"data-testid":`package-switch-warning-tile`,className:`bg-[var(--system-negative-weak)]`,children:(0,Y.jsx)(V,{className:`size-6 text-[var(--system-negative-strong)]`})}):(0,Y.jsx)(Yn,{}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Y.jsx)(S.Title,{className:`text-title-small text-[var(--content-emphasised)] [&>span]:whitespace-normal`,children:u.title}),f?(0,Y.jsx)(S.Description,{className:`mt-0 text-body-medium-default text-[var(--content-tertiary)]`,children:f}):null]})]}),d?(0,Y.jsxs)(S.Body,{className:`flex flex-col gap-4 p-0`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(h,{as:`p`,variant:`title-large`,className:`text-[var(--content-default)]`,children:d.price}),(0,Y.jsx)(h,{as:`p`,variant:`label-medium-default`,className:`leading-[15px] text-[var(--content-tertiary)]`,children:u.priceCaption})]}),(0,Y.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,Y.jsx)(h,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:u.checklistHeading}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-2`,children:d.highlights.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(W,{className:`size-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,Y.jsx)(h,{as:`span`,variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]},e))})]}):null,u.note?(0,Y.jsx)(h,{id:l,as:`p`,variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:u.note}):null,(0,Y.jsxs)(S.Footer,{className:`flex-col gap-4 p-0`,children:[(0,Y.jsx)(j,{fullWidth:!0,variant:u.destructive?`danger`:`primary`,onClick:o,disabled:i,"data-testid":`confirm-package-switch-button`,children:u.confirmLabel}),(0,Y.jsx)(j,{ref:c,fullWidth:!0,variant:`ghost`,onClick:a,disabled:i,children:s(`packageSwitchConfirmModal.cancel`)})]})]})})}function ar(){let e=B();(0,J.useEffect)(()=>D(()=>{Wn(e)}),[e])}export{dn as A,Wt as B,Cn as C,vn as D,_n as E,rn as F,Ve as G,Gt as H,en as I,ze as K,tn as L,mn as M,cn as N,pn as O,on as P,nn as R,wn as S,yn as T,Yt as U,Xt as V,Ut as W,Dn as _,Wn as a,jn as b,Rn as c,Ln as d,Hn as f,On as g,An as h,Gn as i,fn as j,un as k,Bn as l,En as m,ir as n,Un as o,Pn as p,q,Kn as r,zn as s,ar as t,Vn as u,Nn as v,Sn as w,Tn as x,Mn as y,Kt as z};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bi as t,Qa as n,Ya as r,Za as i,no as a}from"./app-D0NlDYsG.js";import{x as o}from"./react-B9IgSVeK.js";var s=e(o(),1),c=.25;function l(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function u({containerRef:e,onBack:o,enabled:u,navKey:d,prefetchHref:f}){let p=(0,s.useRef)(o);(0,s.useLayoutEffect)(()=>{p.current=o},[o]);let m=(0,s.useRef)(f);(0,s.useLayoutEffect)(()=>{m.current=f},[f]);let h=(0,s.useRef)(!1),g=(0,s.useRef)(new Set),_=(0,s.useRef)(!1),v=r.use.registerBackOwner(),y=r.use.unregisterBackOwner();(0,s.useEffect)(()=>{if(u)return v(),y},[u,v,y]),(0,s.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&l(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform 200ms ${a}`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),l(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>l(e),250)},C=e=>{e.style.transition=`transform 150ms ${a}`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*c);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,p.current(),b(()=>{h.current&&(h.current=!1,l(e))},400)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,200)};n({enabled:u,onConfirm:()=>{t(m.current);let n=e.current;n&&(n.style.transition=`none`,n.style.willChange=`transform`)},onMove:(t,n)=>{let r=e.current;r&&x(r,i(t,n))},onCommit:()=>{let t=e.current;if(!t){p.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):l(n))}}),(0,s.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),l(t))};t.style.transition=`transform 200ms ${a}, opacity 200ms ${a}`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,250);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),l(t)}},[d,e])}export{u as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bi as t,Qa as n,Ya as r,Za as i,no as a}from"./app-DbJUeBix.js";import{x as o}from"./react-B9IgSVeK.js";var s=e(o(),1),c=.25;function l(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function u({containerRef:e,onBack:o,enabled:u,navKey:d,prefetchHref:f}){let p=(0,s.useRef)(o);(0,s.useLayoutEffect)(()=>{p.current=o},[o]);let m=(0,s.useRef)(f);(0,s.useLayoutEffect)(()=>{m.current=f},[f]);let h=(0,s.useRef)(!1),g=(0,s.useRef)(new Set),_=(0,s.useRef)(!1),v=r.use.registerBackOwner(),y=r.use.unregisterBackOwner();(0,s.useEffect)(()=>{if(u)return v(),y},[u,v,y]),(0,s.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&l(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform 200ms ${a}`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),l(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>l(e),250)},C=e=>{e.style.transition=`transform 150ms ${a}`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*c);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,p.current(),b(()=>{h.current&&(h.current=!1,l(e))},400)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,200)};n({enabled:u,onConfirm:()=>{t(m.current);let n=e.current;n&&(n.style.transition=`none`,n.style.willChange=`transform`)},onMove:(t,n)=>{let r=e.current;r&&x(r,i(t,n))},onCommit:()=>{let t=e.current;if(!t){p.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):l(n))}}),(0,s.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),l(t))};t.style.transition=`transform 200ms ${a}, opacity 200ms ${a}`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,250);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),l(t)}},[d,e])}export{u as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Og as t,Sa as n,ba as r,xa as i}from"./app-D0NlDYsG.js";import{x as a}from"./react-B9IgSVeK.js";var o=e(a(),1),s={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`,Enter:`Return`,NumpadEnter:`Return`,Space:`Space`,Tab:`Tab`,Escape:`Escape`,Backspace:`Backspace`,Delete:`Delete`,Insert:`Insert`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`,Minus:`-`,Equal:`=`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Semicolon:`;`,Quote:`'`,Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`},c=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`ShiftLeft`,`ShiftRight`]),l=e=>{let t=e.code;return c.has(t)?null:/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^Numpad[0-9]$/.test(t)?`num${t.slice(6)}`:/^F[0-9]{1,2}$/.test(t)?t:s[t]??null},u=(e,t=`macos`)=>{let n=l(e);if(n===null)return null;let r=[];return t===`windows`||t===`linux`?(e.ctrlKey&&r.push(`CmdOrCtrl`),e.metaKey&&r.push(`Super`)):(e.metaKey&&r.push(`CmdOrCtrl`),e.ctrlKey&&r.push(`Control`)),e.altKey&&r.push(`Alt`),e.shiftKey&&r.push(`Shift`),[...r,n].join(`+`)},d={macos:new Set([`Command`,`Cmd`,`CommandOrControl`]),windows:new Set([`Control`,`Ctrl`,`CommandOrControl`]),linux:new Set([`Control`,`Ctrl`,`CommandOrControl`])},f=(e,t=`macos`)=>{let n=d[t],r=e.split(`+`).map(e=>n.has(e)?`CmdOrCtrl`:e),i=r.pop()??``;return[...new Set(r)].sort().concat(i).join(`+`)},p=(e,t,n,r=`macos`)=>{if(n===``)return null;let i=f(n,r);return e.find(e=>e.key!==t&&e.accelerator!==``&&f(e.accelerator,r)===i)??null};function m(e){let a=e?.onBound,[s,c]=(0,o.useState)([]),[l,d]=(0,o.useState)(null),[f,m]=(0,o.useState)(null),h=(0,o.useCallback)(()=>{r().then(c)},[]);(0,o.useEffect)(()=>(h(),i(c)),[h]);let g=(0,o.useCallback)(()=>{d(null),m(null)},[]);return(0,o.useEffect)(()=>{if(l===null)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.code===`Escape`){g();return}let r=t()??`macos`,i=u(e,r);if(i===null)return;let o=p(s,l,i,r);if(o!==null){m({key:l,label:o.label});return}n(l,i).then(()=>{a?.(l),h()}).catch(()=>{h()}),g()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[l,s,a,h,g]),{catalog:s,recordingKey:l,conflict:f,startRecording:(0,o.useCallback)(e=>{m(null),d(e)},[]),stopRecording:g,resetHotkey:(0,o.useCallback)(e=>{let r=p(s,e,s.find(t=>t.key===e)?.defaultAccelerator??``,t()??`macos`);if(r!==null){d(null),m({key:e,label:r.label});return}g(),n(e,null).then(h)},[s,h,g]),removeHotkey:(0,o.useCallback)(e=>{g(),n(e,``).then(h)},[h,g])}}export{m as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Og as t,Sa as n,ba as r,xa as i}from"./app-DbJUeBix.js";import{x as a}from"./react-B9IgSVeK.js";var o=e(a(),1),s={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`,Enter:`Return`,NumpadEnter:`Return`,Space:`Space`,Tab:`Tab`,Escape:`Escape`,Backspace:`Backspace`,Delete:`Delete`,Insert:`Insert`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`,Minus:`-`,Equal:`=`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Semicolon:`;`,Quote:`'`,Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`},c=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`ShiftLeft`,`ShiftRight`]),l=e=>{let t=e.code;return c.has(t)?null:/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^Numpad[0-9]$/.test(t)?`num${t.slice(6)}`:/^F[0-9]{1,2}$/.test(t)?t:s[t]??null},u=(e,t=`macos`)=>{let n=l(e);if(n===null)return null;let r=[];return t===`windows`||t===`linux`?(e.ctrlKey&&r.push(`CmdOrCtrl`),e.metaKey&&r.push(`Super`)):(e.metaKey&&r.push(`CmdOrCtrl`),e.ctrlKey&&r.push(`Control`)),e.altKey&&r.push(`Alt`),e.shiftKey&&r.push(`Shift`),[...r,n].join(`+`)},d={macos:new Set([`Command`,`Cmd`,`CommandOrControl`]),windows:new Set([`Control`,`Ctrl`,`CommandOrControl`]),linux:new Set([`Control`,`Ctrl`,`CommandOrControl`])},f=(e,t=`macos`)=>{let n=d[t],r=e.split(`+`).map(e=>n.has(e)?`CmdOrCtrl`:e),i=r.pop()??``;return[...new Set(r)].sort().concat(i).join(`+`)},p=(e,t,n,r=`macos`)=>{if(n===``)return null;let i=f(n,r);return e.find(e=>e.key!==t&&e.accelerator!==``&&f(e.accelerator,r)===i)??null};function m(e){let a=e?.onBound,[s,c]=(0,o.useState)([]),[l,d]=(0,o.useState)(null),[f,m]=(0,o.useState)(null),h=(0,o.useCallback)(()=>{r().then(c)},[]);(0,o.useEffect)(()=>(h(),i(c)),[h]);let g=(0,o.useCallback)(()=>{d(null),m(null)},[]);return(0,o.useEffect)(()=>{if(l===null)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.code===`Escape`){g();return}let r=t()??`macos`,i=u(e,r);if(i===null)return;let o=p(s,l,i,r);if(o!==null){m({key:l,label:o.label});return}n(l,i).then(()=>{a?.(l),h()}).catch(()=>{h()}),g()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[l,s,a,h,g]),{catalog:s,recordingKey:l,conflict:f,startRecording:(0,o.useCallback)(e=>{m(null),d(e)},[]),stopRecording:g,resetHotkey:(0,o.useCallback)(e=>{let r=p(s,e,s.find(t=>t.key===e)?.defaultAccelerator??``,t()??`macos`);if(r!==null){d(null),m({key:e,label:r.label});return}g(),n(e,null).then(h)},[s,h,g]),removeHotkey:(0,o.useCallback)(e=>{g(),n(e,``).then(h)},[h,g])}}export{m as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$a as t,Fp as n,JC as r,PC as i,SC as a,Uy as o,Xa as s,Zp as c,aw as l}from"./app-D0NlDYsG.js";import{E as u,Xn as d,nr as f}from"./vendor-CtXGFqsu.js";import{t as p,x as m}from"./react-B9IgSVeK.js";import{Fn as h,Ji as g,Yn as _,i as v,li as y,tr as b}from"./icons-C0wyat6T.js";import{t as x}from"./a2a-invite-DLiMk0tx.js";var S=e(m(),1),C=p(),w=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function T({open:e,onClose:n,children:r,title:i}){let{t:a}=u(),o=(0,S.useRef)(null),c=(0,S.useRef)(null),d=(0,S.useRef)(n);(0,S.useEffect)(()=>{d.current=n});let{dragOffset:f,isDragging:p,onTouchStart:m,onTouchMove:h,onTouchEnd:g,onTouchCancel:_}=s({enabled:e,onSwipeLeft:n});return t(e),(0,S.useEffect)(()=>{if(!e)return;c.current?.focus();let t=e=>{if(e.key===`Escape`&&!e.defaultPrevented){e.preventDefault(),d.current();return}if(e.key!==`Tab`||!o.current)return;let t=o.current.querySelectorAll(w),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,a=o.current.contains(i);e.shiftKey?(!a||i===n)&&(e.preventDefault(),r.focus()):(!a||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e]),e?(0,C.jsxs)(`div`,{ref:o,className:`fixed inset-0`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":i,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":a(`sideListDrawer.closeSidebarAria`),className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:n}),(0,C.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,transform:`translateX(${f}px)`,transition:p?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onTouchStart:m,onTouchMove:h,onTouchEnd:g,onTouchCancel:_,children:[(0,C.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,C.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:i}),(0,C.jsx)(l,{ref:c,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,C.jsx)(v,{"aria-hidden":!0}),onClick:n,"aria-label":a(`sideListDrawer.closeAria`),tintColor:`var(--content-tertiary)`})]}),(0,C.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:r})]})]}):null}function E({onClick:e}){let{t}=u();return(0,C.jsx)(l,{type:`button`,variant:`ghost`,iconOnly:(0,C.jsx)(h,{"aria-hidden":!0}),onClick:e,"aria-label":t(`sideListDrawer.openSidebarAria`),tintColor:`var(--content-secondary)`})}function D(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function O({open:e,assistantId:t,onClose:n}){let{t:s}=u(),{copy:f,copied:p,reset:m}=o({errorMessage:`Couldn't copy the invite link.`}),h=(0,S.useRef)(!1),v=d({...c({path:{assistant_id:t}})}),b=(0,S.useRef)(v.mutate);(0,S.useLayoutEffect)(()=>{b.current=v.mutate});let w=(0,S.useRef)(v.reset);(0,S.useLayoutEffect)(()=>{w.current=v.reset}),(0,S.useEffect)(()=>{e&&!h.current&&b.current({path:{assistant_id:t}}),h.current=e},[e,t]);let T=(0,S.useCallback)(()=>{w.current(),m(),n()},[n,m]),E=v.isSuccess&&v.data.token?x({senderAssistantId:t,token:v.data.token}):``;return(0,C.jsx)(a.Root,{open:e,onOpenChange:e=>{e||T()},children:(0,C.jsxs)(a.Content,{size:`sm`,children:[(0,C.jsx)(a.Header,{children:(0,C.jsx)(a.Title,{children:s(`generateInviteLinkDialog.title`)})}),(0,C.jsx)(a.Body,{children:v.isPending?(0,C.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,C.jsx)(_,{className:`h-4 w-4 animate-spin`}),s(`generateInviteLinkDialog.creating`)]}):v.isError?(0,C.jsxs)(`div`,{className:`space-y-3`,children:[(0,C.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:s(`generateInviteLinkDialog.createFailed`)}),(0,C.jsx)(l,{variant:`outlined`,onClick:()=>v.mutate({path:{assistant_id:t}}),children:s(`generateInviteLinkDialog.tryAgain`)})]}):v.isSuccess?(0,C.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,C.jsx)(r,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:s(`generateInviteLinkDialog.shareHint`)}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(i,{type:`text`,readOnly:!0,value:E,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,C.jsx)(l,{variant:`outlined`,iconOnly:p?(0,C.jsx)(g,{}):(0,C.jsx)(y,{}),iconOnlyGlyphClassName:`[&_svg]:size-4`,expandOnMobile:!1,onClick:()=>f(E),"aria-label":s(`generateInviteLinkDialog.copyAriaLabel`),className:`h-9 w-9 shrink-0`})]}),v.data.expiresAt!=null&&(0,C.jsx)(r,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:D(v.data.expiresAt)})]}):null}),(0,C.jsx)(a.Footer,{children:(0,C.jsx)(l,{variant:`outlined`,onClick:T,children:s(`generateInviteLinkDialog.done`)})})]})})}function k({onClick:e}){let{t}=u();return(0,C.jsx)(l,{variant:`outlined`,size:`compact`,leftIcon:(0,C.jsx)(b,{className:`h-3.5 w-3.5`}),onClick:e,children:t(`shareConnectionLinkButton.label`)})}function A(e){let t=f(),[r,i]=(0,S.useState)(!1);return{isOpen:r,open:(0,S.useCallback)(()=>{i(!0)},[]),close:(0,S.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:n({path:{assistant_id:e}})})},[t,e])}}export{E as a,T as i,k as n,O as r,A as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$a as t,Fp as n,JC as r,PC as i,SC as a,Uy as o,Xa as s,Zp as c,aw as l}from"./app-DbJUeBix.js";import{E as u,Xn as d,nr as f}from"./vendor-CtXGFqsu.js";import{t as p,x as m}from"./react-B9IgSVeK.js";import{Fn as h,Ji as g,Yn as _,i as v,li as y,tr as b}from"./icons-C0wyat6T.js";import{t as x}from"./a2a-invite-BfDyIsBX.js";var S=e(m(),1),C=p(),w=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function T({open:e,onClose:n,children:r,title:i}){let{t:a}=u(),o=(0,S.useRef)(null),c=(0,S.useRef)(null),d=(0,S.useRef)(n);(0,S.useEffect)(()=>{d.current=n});let{dragOffset:f,isDragging:p,onTouchStart:m,onTouchMove:h,onTouchEnd:g,onTouchCancel:_}=s({enabled:e,onSwipeLeft:n});return t(e),(0,S.useEffect)(()=>{if(!e)return;c.current?.focus();let t=e=>{if(e.key===`Escape`&&!e.defaultPrevented){e.preventDefault(),d.current();return}if(e.key!==`Tab`||!o.current)return;let t=o.current.querySelectorAll(w),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,a=o.current.contains(i);e.shiftKey?(!a||i===n)&&(e.preventDefault(),r.focus()):(!a||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e]),e?(0,C.jsxs)(`div`,{ref:o,className:`fixed inset-0`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":i,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":a(`sideListDrawer.closeSidebarAria`),className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:n}),(0,C.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,transform:`translateX(${f}px)`,transition:p?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onTouchStart:m,onTouchMove:h,onTouchEnd:g,onTouchCancel:_,children:[(0,C.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,C.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:i}),(0,C.jsx)(l,{ref:c,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,C.jsx)(v,{"aria-hidden":!0}),onClick:n,"aria-label":a(`sideListDrawer.closeAria`),tintColor:`var(--content-tertiary)`})]}),(0,C.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:r})]})]}):null}function E({onClick:e}){let{t}=u();return(0,C.jsx)(l,{type:`button`,variant:`ghost`,iconOnly:(0,C.jsx)(h,{"aria-hidden":!0}),onClick:e,"aria-label":t(`sideListDrawer.openSidebarAria`),tintColor:`var(--content-secondary)`})}function D(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function O({open:e,assistantId:t,onClose:n}){let{t:s}=u(),{copy:f,copied:p,reset:m}=o({errorMessage:`Couldn't copy the invite link.`}),h=(0,S.useRef)(!1),v=d({...c({path:{assistant_id:t}})}),b=(0,S.useRef)(v.mutate);(0,S.useLayoutEffect)(()=>{b.current=v.mutate});let w=(0,S.useRef)(v.reset);(0,S.useLayoutEffect)(()=>{w.current=v.reset}),(0,S.useEffect)(()=>{e&&!h.current&&b.current({path:{assistant_id:t}}),h.current=e},[e,t]);let T=(0,S.useCallback)(()=>{w.current(),m(),n()},[n,m]),E=v.isSuccess&&v.data.token?x({senderAssistantId:t,token:v.data.token}):``;return(0,C.jsx)(a.Root,{open:e,onOpenChange:e=>{e||T()},children:(0,C.jsxs)(a.Content,{size:`sm`,children:[(0,C.jsx)(a.Header,{children:(0,C.jsx)(a.Title,{children:s(`generateInviteLinkDialog.title`)})}),(0,C.jsx)(a.Body,{children:v.isPending?(0,C.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,C.jsx)(_,{className:`h-4 w-4 animate-spin`}),s(`generateInviteLinkDialog.creating`)]}):v.isError?(0,C.jsxs)(`div`,{className:`space-y-3`,children:[(0,C.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:s(`generateInviteLinkDialog.createFailed`)}),(0,C.jsx)(l,{variant:`outlined`,onClick:()=>v.mutate({path:{assistant_id:t}}),children:s(`generateInviteLinkDialog.tryAgain`)})]}):v.isSuccess?(0,C.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,C.jsx)(r,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:s(`generateInviteLinkDialog.shareHint`)}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(i,{type:`text`,readOnly:!0,value:E,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,C.jsx)(l,{variant:`outlined`,iconOnly:p?(0,C.jsx)(g,{}):(0,C.jsx)(y,{}),iconOnlyGlyphClassName:`[&_svg]:size-4`,expandOnMobile:!1,onClick:()=>f(E),"aria-label":s(`generateInviteLinkDialog.copyAriaLabel`),className:`h-9 w-9 shrink-0`})]}),v.data.expiresAt!=null&&(0,C.jsx)(r,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:D(v.data.expiresAt)})]}):null}),(0,C.jsx)(a.Footer,{children:(0,C.jsx)(l,{variant:`outlined`,onClick:T,children:s(`generateInviteLinkDialog.done`)})})]})})}function k({onClick:e}){let{t}=u();return(0,C.jsx)(l,{variant:`outlined`,size:`compact`,leftIcon:(0,C.jsx)(b,{className:`h-3.5 w-3.5`}),onClick:e,children:t(`shareConnectionLinkButton.label`)})}function A(e){let t=f(),[r,i]=(0,S.useState)(!1);return{isOpen:r,open:(0,S.useCallback)(()=>{i(!0)},[]),close:(0,S.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:n({path:{assistant_id:e}})})},[t,e])}}export{E as a,T as i,k as n,O as r,A as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Gg as t,Qo as n,Yc as r,_y as i,gm as a,hm as o,or as s,rh as c,th as l,vy as u,xC as d}from"./app-D0NlDYsG.js";import{$n as f,E as p,j as m,nr as h}from"./vendor-CtXGFqsu.js";import{t as g,x as _}from"./react-B9IgSVeK.js";var v=e(_(),1),y=g(),b={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function x({external:e=!1,icon:t,iconUrl:r,iconSrc:i,size:a=`sm`,className:o}){let[s,c]=(0,v.useState)(!1),l=i??r;(0,v.useEffect)(()=>{c(!1)},[l]);let u=t||(e?`📦`:`🧩`),d=!!l&&!s;return(0,y.jsx)(`span`,{className:n(`flex shrink-0 items-center justify-center`,b[a],o),children:d?(0,y.jsx)(`img`,{src:l,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>c(!0)}):u})}function S(e){return e!==void 0&&e.startsWith(`https://`)}function C(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path,...S(e.icon)?{iconUrl:e.icon}:{icon:e.icon}}));return[...n,...i]}function w(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function T(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function E(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function D(e){return e?e.slice(0,7):`unknown`}var O=`plugin.uninstall.mcp_oauth_credentials_unchecked`;function k(e,t){for(let n of e??[])d.warning(t(n===O?`pluginToast.mcpOAuthCredentialsUnchecked`:`pluginToast.cleanupWarning`))}function A(e,t){let{t:n}=p(`intelligence`),i=h(),a=l({onSuccess:(a,o)=>{let s=o.path.name;r(i,e,s),t?.onRemoved?.(s),t?.announceWarnings!==!1&&k(a?.warnings,n)},onError:(e,n)=>{t?.onRemoveError?.(n.path.name,e)}}),o=a.mutate;return{remove:(0,v.useCallback)(t=>{o({path:{assistant_id:e,name:t}})},[e,o]),isRemoving:a.isPending,isRemoveError:a.isError}}function j(e,t,n){let{t:i}=p(`intelligence`),a=h(),o=c({onSuccess:()=>{r(a,e,t),n?.onInstalled?.(),n?.announceInstall!==!1&&d.success(i(`pluginToast.installed`,{name:t||i(`pluginToast.pluginFallback`)}))}}),s=A(e,{onRemoved:()=>n?.onRemoved?.()});return{install:()=>{o.mutate({path:{assistant_id:e},body:{name:t}})},installAsync:()=>o.mutateAsync({path:{assistant_id:e},body:{name:t}}),remove:()=>{s.remove(t)},isInstalling:o.isPending,isRemoving:s.isRemoving,isInstallError:o.isError,isRemoveError:s.isRemoveError}}var M=`0.10.5`;function N(){return t(M)}function P(e,t,n,r){let a=N(),{data:o}=f({queryKey:[`pluginIcon`,e,t,r],queryFn:async()=>{let{data:n,error:r}=await i({path:{assistant_id:e,name:t},parseAs:`blob`,throwOnError:!1});if(r||!(n instanceof Blob))throw Error(`Failed to load plugin icon`);return n},enabled:!!(a&&n&&r),staleTime:1/0,retry:!1}),[s,c]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{if(!o){c(void 0);return}let e=URL.createObjectURL(o);return c(e),()=>{URL.revokeObjectURL(e)}},[o]),s}var F=300*1e3,I=[],L=[],R=`system`;async function z(e,t,n){let r=await u({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(m(`usePluginsList.failureMessage`,{ns:`intelligence`}));return r.data??{plugins:[]}}function B(e,t){let[n,r]=(0,v.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,v.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function V(e,t=null,n=!0){let r=t??void 0,i=f({queryKey:o({path:{assistant_id:e},query:{q:void 0,category:r}}),queryFn:({signal:t})=>z(e,r,t),enabled:!!e&&n,staleTime:F}),c=f({...s(e),enabled:!!e&&n&&t!==null}),l=f({...a({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e&&n,staleTime:F}),u=(0,v.useMemo)(()=>{let e=t===null?i.data?.plugins:c.data?.plugins??i.data?.plugins;return new Set((e??I).map(e=>e.name))},[t,c.data?.plugins,i.data?.plugins]),d=(0,v.useMemo)(()=>{let e=i.data?.plugins??I,n=l.data?.matches??L;return T(C(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!u.has(e.name))))},[i.data?.plugins,l.data?.matches,t,u]),p=t===null?i.data:c.data,m=B(e,p?.categoryCounts!==void 0),g=B(e,(p?.plugins??I).some(e=>e.enabled!==void 0)),_=h(),y=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(y.current===e||!l.isSuccess)return;let t=p?.plugins;if(!t?.length)return;let n=new Map((l.data?.matches??L).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(y.current=e,_.invalidateQueries({queryKey:o({path:{assistant_id:e},query:{q:void 0}})}))},[e,l.isSuccess,l.data?.matches,p?.plugins,_]),{items:d,isLoading:i.isLoading,catalogLoading:l.isLoading,isError:i.isError,installedLoaded:i.data!==void 0,isFetching:i.isFetching||l.isFetching,catalogError:l.isError,categorySupported:m,pluginToggleSupported:g,installedCategoryCounts:p?.categoryCounts,installedPlugins:p?.plugins??I,installedTotal:p?.totalCount,catalogMatches:l.data?.matches??L,unfilteredInstalledNames:u}}export{A as a,w as c,j as i,D as l,V as n,k as o,P as r,E as s,R as t,x as u};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Gg as t,Qo as n,Yc as r,_y as i,gm as a,hm as o,or as s,rh as c,th as l,vy as u,xC as d}from"./app-DbJUeBix.js";import{$n as f,E as p,j as m,nr as h}from"./vendor-CtXGFqsu.js";import{t as g,x as _}from"./react-B9IgSVeK.js";var v=e(_(),1),y=g(),b={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function x({external:e=!1,icon:t,iconUrl:r,iconSrc:i,size:a=`sm`,className:o}){let[s,c]=(0,v.useState)(!1),l=i??r;(0,v.useEffect)(()=>{c(!1)},[l]);let u=t||(e?`📦`:`🧩`),d=!!l&&!s;return(0,y.jsx)(`span`,{className:n(`flex shrink-0 items-center justify-center`,b[a],o),children:d?(0,y.jsx)(`img`,{src:l,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>c(!0)}):u})}function S(e){return e!==void 0&&e.startsWith(`https://`)}function C(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path,...S(e.icon)?{iconUrl:e.icon}:{icon:e.icon}}));return[...n,...i]}function w(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function T(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function E(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function D(e){return e?e.slice(0,7):`unknown`}var O=`plugin.uninstall.mcp_oauth_credentials_unchecked`;function k(e,t){for(let n of e??[])d.warning(t(n===O?`pluginToast.mcpOAuthCredentialsUnchecked`:`pluginToast.cleanupWarning`))}function A(e,t){let{t:n}=p(`intelligence`),i=h(),a=l({onSuccess:(a,o)=>{let s=o.path.name;r(i,e,s),t?.onRemoved?.(s),t?.announceWarnings!==!1&&k(a?.warnings,n)},onError:(e,n)=>{t?.onRemoveError?.(n.path.name,e)}}),o=a.mutate;return{remove:(0,v.useCallback)(t=>{o({path:{assistant_id:e,name:t}})},[e,o]),isRemoving:a.isPending,isRemoveError:a.isError}}function j(e,t,n){let{t:i}=p(`intelligence`),a=h(),o=c({onSuccess:()=>{r(a,e,t),n?.onInstalled?.(),n?.announceInstall!==!1&&d.success(i(`pluginToast.installed`,{name:t||i(`pluginToast.pluginFallback`)}))}}),s=A(e,{onRemoved:()=>n?.onRemoved?.()});return{install:()=>{o.mutate({path:{assistant_id:e},body:{name:t}})},installAsync:()=>o.mutateAsync({path:{assistant_id:e},body:{name:t}}),remove:()=>{s.remove(t)},isInstalling:o.isPending,isRemoving:s.isRemoving,isInstallError:o.isError,isRemoveError:s.isRemoveError}}var M=`0.10.5`;function N(){return t(M)}function P(e,t,n,r){let a=N(),{data:o}=f({queryKey:[`pluginIcon`,e,t,r],queryFn:async()=>{let{data:n,error:r}=await i({path:{assistant_id:e,name:t},parseAs:`blob`,throwOnError:!1});if(r||!(n instanceof Blob))throw Error(`Failed to load plugin icon`);return n},enabled:!!(a&&n&&r),staleTime:1/0,retry:!1}),[s,c]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{if(!o){c(void 0);return}let e=URL.createObjectURL(o);return c(e),()=>{URL.revokeObjectURL(e)}},[o]),s}var F=300*1e3,I=[],L=[],R=`system`;async function z(e,t,n){let r=await u({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(m(`usePluginsList.failureMessage`,{ns:`intelligence`}));return r.data??{plugins:[]}}function B(e,t){let[n,r]=(0,v.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,v.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function V(e,t=null,n=!0){let r=t??void 0,i=f({queryKey:o({path:{assistant_id:e},query:{q:void 0,category:r}}),queryFn:({signal:t})=>z(e,r,t),enabled:!!e&&n,staleTime:F}),c=f({...s(e),enabled:!!e&&n&&t!==null}),l=f({...a({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e&&n,staleTime:F}),u=(0,v.useMemo)(()=>{let e=t===null?i.data?.plugins:c.data?.plugins??i.data?.plugins;return new Set((e??I).map(e=>e.name))},[t,c.data?.plugins,i.data?.plugins]),d=(0,v.useMemo)(()=>{let e=i.data?.plugins??I,n=l.data?.matches??L;return T(C(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!u.has(e.name))))},[i.data?.plugins,l.data?.matches,t,u]),p=t===null?i.data:c.data,m=B(e,p?.categoryCounts!==void 0),g=B(e,(p?.plugins??I).some(e=>e.enabled!==void 0)),_=h(),y=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(y.current===e||!l.isSuccess)return;let t=p?.plugins;if(!t?.length)return;let n=new Map((l.data?.matches??L).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(y.current=e,_.invalidateQueries({queryKey:o({path:{assistant_id:e},query:{q:void 0}})}))},[e,l.isSuccess,l.data?.matches,p?.plugins,_]),{items:d,isLoading:i.isLoading,catalogLoading:l.isLoading,isError:i.isError,installedLoaded:i.data!==void 0,isFetching:i.isFetching||l.isFetching,catalogError:l.isError,categorySupported:m,pluginToggleSupported:g,installedCategoryCounts:p?.categoryCounts,installedPlugins:p?.plugins??I,installedTotal:p?.totalCount,catalogMatches:l.data?.matches??L,unfilteredInstalledNames:u}}export{A as a,w as c,j as i,D as l,V as n,k as o,P as r,E as s,R as t,x as u};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{DS as t,Eh as n,Nh as r,dl as i,hl as a,jh as o,kb as s,ul as c}from"./app-D0NlDYsG.js";import{E as l}from"./vendor-CtXGFqsu.js";import{_ as u,r as d,t as f,x as p}from"./react-B9IgSVeK.js";import{Yn as m}from"./icons-C0wyat6T.js";var h=f();function g(){let{t:e}=l(`account`);return(0,h.jsx)(m,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":e(`authWaitSpinner.loading`)})}var _=e(p(),1);function v({to:e}){let t=c(e);return(0,_.useEffect)(()=>{t&&a(e)},[t,e]),t?null:(0,h.jsx)(d,{to:e,replace:!0})}function y(){let[e]=u(),a=o(),c=r(),l=n(),d=e.get(`returnTo`),f=s(d,t.assistant);if(!d)return{kind:`proceed`,returnTo:null};if(c)return{kind:`wait`};if(!a)return{kind:`proceed`,returnTo:f};if(i(f)){if(l===`pending`)return{kind:`wait`};if(l===`disabled`)return{kind:`proceed`,returnTo:f}}return{kind:`redirect`,node:(0,h.jsx)(v,{to:f})}}export{g as n,y as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{DS as t,Eh as n,Nh as r,dl as i,hl as a,jh as o,kb as s,ul as c}from"./app-DbJUeBix.js";import{E as l}from"./vendor-CtXGFqsu.js";import{_ as u,r as d,t as f,x as p}from"./react-B9IgSVeK.js";import{Yn as m}from"./icons-C0wyat6T.js";var h=f();function g(){let{t:e}=l(`account`);return(0,h.jsx)(m,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":e(`authWaitSpinner.loading`)})}var _=e(p(),1);function v({to:e}){let t=c(e);return(0,_.useEffect)(()=>{t&&a(e)},[t,e]),t?null:(0,h.jsx)(d,{to:e,replace:!0})}function y(){let[e]=u(),a=o(),c=r(),l=n(),d=e.get(`returnTo`),f=s(d,t.assistant);if(!d)return{kind:`proceed`,returnTo:null};if(c)return{kind:`wait`};if(!a)return{kind:`proceed`,returnTo:f};if(i(f)){if(l===`pending`)return{kind:`wait`};if(l===`disabled`)return{kind:`proceed`,returnTo:f}}return{kind:`redirect`,node:(0,h.jsx)(v,{to:f})}}export{g as n,y as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{La as t,Ra as n}from"./app-D0NlDYsG.js";import{x as r}from"./react-B9IgSVeK.js";var i=e(r(),1),a=640;function o(){let{ref:e,size:r}=t(),o=r.w<=0,s=n(o),c=(o?s.w:r.w)>=a,[l,u]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{c&&u(!1)},[c]),{paneRef:e,hasRoomForList:c,drawerOpen:l,openDrawer:(0,i.useCallback)(()=>u(!0),[]),closeDrawer:(0,i.useCallback)(()=>u(!1),[])}}export{o as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{La as t,Ra as n}from"./app-DbJUeBix.js";import{x as r}from"./react-B9IgSVeK.js";var i=e(r(),1),a=640;function o(){let{ref:e,size:r}=t(),o=r.w<=0,s=n(o),c=(o?s.w:r.w)>=a,[l,u]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{c&&u(!1)},[c]),{paneRef:e,hasRoomForList:c,drawerOpen:l,openDrawer:(0,i.useCallback)(()=>u(!0),[]),closeDrawer:(0,i.useCallback)(()=>u(!1),[])}}export{o as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,BS as n,KC as r,My as i,US as a,VS as o,h as s,ih as c}from"./app-D0NlDYsG.js";import{E as l,Xn as u,j as d,nr as f}from"./vendor-CtXGFqsu.js";import{t as p,x as m}from"./react-B9IgSVeK.js";import{Cr as h,P as g,Pt as _,Ya as v,b as y,ha as b}from"./icons-C0wyat6T.js";var x=v(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),S=e(m(),1),C=p(),w={vellum:x,clawhub:h,skillssh:g,custom:y,"assistant-memory":b};function T(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`custom`:return t(`skillOriginBadge.custom`);case`assistant-memory`:return t(`skillOriginBadge.assistantMemory`)}}function E({origin:e}){let{t:n}=l(`intelligence`),r=e in w?{label:T(e,n),icon:w[e]}:{label:e.replace(/-/g,` `),icon:_};return(0,C.jsx)(t,{tone:`neutral`,leftIcon:(0,S.createElement)(r.icon),className:`capitalize`,children:r.label})}function D(e){return e.kind===`installed`||e.kind===`bundled`}function O(e){return e.kind===`catalog`}function k({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:i,children:a}){return(0,C.jsx)(r.Root,{children:(0,C.jsxs)(r.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,C.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,C.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,C.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:i}),a]})})}async function A(e,t,r){let{data:s,error:c,response:l}=await i({path:{assistant_id:e},body:r?{slug:t,version:r}:{slug:t},throwOnError:!1}),u=d(`installSkill.failureMessage`,{ns:`intelligence`});if(o(l,c,u),!l.ok)throw new n(l.status,a(c,l,u));return s??{ok:!0}}function j(e,{onRemoved:t}={}){let n=f(),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null),[l,d]=(0,S.useState)(null),p=(0,S.useCallback)(()=>{s(n,e)},[e,n]),m=u({mutationFn:t=>A(e,t),onMutate:e=>i(e),onSettled:()=>{i(null),p()}}),h=c({onMutate:e=>o(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{o(null),p()}}),g=(0,S.useCallback)(e=>{m.mutate(e.slug??e.id)},[m]),_=(0,S.useCallback)(e=>{d(e)},[]),v=(0,S.useCallback)(()=>{l&&(h.mutate({path:{assistant_id:e,id:l.id}}),d(null))},[e,l,h]),y=(0,S.useCallback)(()=>{d(null)},[]);return{handleInstall:g,handleRemove:_,isInstallingSkill:(0,S.useCallback)(e=>r===(e.slug??e.id),[r]),isRemovingSkill:(0,S.useCallback)(e=>a===e.id,[a]),skillPendingRemoval:l,confirmRemove:v,cancelRemove:y}}export{E as a,D as i,k as n,x as o,O as r,j as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,BS as n,KC as r,My as i,US as a,VS as o,h as s,ih as c}from"./app-DbJUeBix.js";import{E as l,Xn as u,j as d,nr as f}from"./vendor-CtXGFqsu.js";import{t as p,x as m}from"./react-B9IgSVeK.js";import{Cr as h,P as g,Pt as _,Ya as v,b as y,ha as b}from"./icons-C0wyat6T.js";var x=v(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),S=e(m(),1),C=p(),w={vellum:x,clawhub:h,skillssh:g,custom:y,"assistant-memory":b};function T(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`custom`:return t(`skillOriginBadge.custom`);case`assistant-memory`:return t(`skillOriginBadge.assistantMemory`)}}function E({origin:e}){let{t:n}=l(`intelligence`),r=e in w?{label:T(e,n),icon:w[e]}:{label:e.replace(/-/g,` `),icon:_};return(0,C.jsx)(t,{tone:`neutral`,leftIcon:(0,S.createElement)(r.icon),className:`capitalize`,children:r.label})}function D(e){return e.kind===`installed`||e.kind===`bundled`}function O(e){return e.kind===`catalog`}function k({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:i,children:a}){return(0,C.jsx)(r.Root,{children:(0,C.jsxs)(r.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,C.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,C.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,C.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:i}),a]})})}async function A(e,t,r){let{data:s,error:c,response:l}=await i({path:{assistant_id:e},body:r?{slug:t,version:r}:{slug:t},throwOnError:!1}),u=d(`installSkill.failureMessage`,{ns:`intelligence`});if(o(l,c,u),!l.ok)throw new n(l.status,a(c,l,u));return s??{ok:!0}}function j(e,{onRemoved:t}={}){let n=f(),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null),[l,d]=(0,S.useState)(null),p=(0,S.useCallback)(()=>{s(n,e)},[e,n]),m=u({mutationFn:t=>A(e,t),onMutate:e=>i(e),onSettled:()=>{i(null),p()}}),h=c({onMutate:e=>o(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{o(null),p()}}),g=(0,S.useCallback)(e=>{m.mutate(e.slug??e.id)},[m]),_=(0,S.useCallback)(e=>{d(e)},[]),v=(0,S.useCallback)(()=>{l&&(h.mutate({path:{assistant_id:e,id:l.id}}),d(null))},[e,l,h]),y=(0,S.useCallback)(()=>{d(null)},[]);return{handleInstall:g,handleRemove:_,isInstallingSkill:(0,S.useCallback)(e=>r===(e.slug??e.id),[r]),isRemovingSkill:(0,S.useCallback)(e=>a===e.id,[a]),skillPendingRemoval:l,confirmRemove:v,cancelRemove:y}}export{E as a,D as i,k as n,x as o,O as r,j as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{DS as t,Em as n,Qo as r,RC as i,Tm as a}from"./app-D0NlDYsG.js";import{$n as o,E as s}from"./vendor-CtXGFqsu.js";import{n as c,t as l,x as u}from"./react-B9IgSVeK.js";import{Ra as d}from"./icons-C0wyat6T.js";var f=l();function p({skill:e,className:n,onNavigate:a}){let{t:o}=s();return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,f.jsxs)(c,{to:t.conversation(e.sourceConversationId),onClick:a,className:r(i({tone:`quiet`}),`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)]`,n),children:[o(`skillLineageLink.label`),(0,f.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var m=e(u(),1);function h(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function g(e,t){let[r,i]=(0,m.useState)(null),s=o({...n({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,m.useMemo)(()=>s.data?.files??[],[s.data]),l=(0,m.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=h(c,r),d=o({...a({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:r,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:s.isLoading,isFilesPending:s.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{p as n,g as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{DS as t,Em as n,Qo as r,RC as i,Tm as a}from"./app-DbJUeBix.js";import{$n as o,E as s}from"./vendor-CtXGFqsu.js";import{n as c,t as l,x as u}from"./react-B9IgSVeK.js";import{Ra as d}from"./icons-C0wyat6T.js";var f=l();function p({skill:e,className:n,onNavigate:a}){let{t:o}=s();return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,f.jsxs)(c,{to:t.conversation(e.sourceConversationId),onClick:a,className:r(i({tone:`quiet`}),`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)]`,n),children:[o(`skillLineageLink.label`),(0,f.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var m=e(u(),1);function h(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function g(e,t){let[r,i]=(0,m.useState)(null),s=o({...n({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,m.useMemo)(()=>s.data?.files??[],[s.data]),l=(0,m.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=h(c,r),d=o({...a({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:r,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:s.isLoading,isFilesPending:s.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{p as n,g as t};
@@ -0,0 +1 @@
1
+ import{Wg as e}from"./app-DbJUeBix.js";var t=`0.10.8`;function n(n){return e(t,n)}export{n as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bh as t,kr as n}from"./app-D0NlDYsG.js";import{x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(e){let r=n();return(0,i.useMemo)(()=>{if(e)return r.find(n=>t(n).includes(e))},[r,e])}export{a as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bh as t,kr as n}from"./app-DbJUeBix.js";import{x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(e){let r=n();return(0,i.useMemo)(()=>{if(e)return r.find(n=>t(n).includes(e))},[r,e])}export{a as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$t as t,Au as n,CC as r,Cl as i,Cp as a,DS as o,FS as s,Fm as c,Lv as l,NC as u,NS as d,No as f,OS as p,RC as m,SC as h,Sp as g,_l as _,_s as v,as as y,aw as b,bs as x,df as S,en as C,es as w,ff as T,gl as E,gs as D,hs as O,is as k,it as A,jS as j,ju as M,ms as ee,nn as te,ns as ne,nt as N,ot as re,pC as ie,pf as ae,rs as oe,rt as se,ts as ce,tw as le,uS as ue,uh as de,uw as fe,vC as pe,vl as me,vs as P,wC as he,xC as ge,xs as F,yl as _e,ys as I}from"./app-D0NlDYsG.js";import{$n as L,E as R,nr as ve}from"./vendor-CtXGFqsu.js";import{_ as ye,n as be,r as z,t as xe,x as Se}from"./react-B9IgSVeK.js";import{La as Ce,fr as B}from"./icons-C0wyat6T.js";import{t as V}from"./detail-card-BhbwKaee.js";import{t as we}from"./stt-language-picker-modal-ArB52Kbp.js";import{t as Te}from"./use-hotkey-recorder-B0ho6P1Q.js";var H=e(Se(),1),U=xe();function W({label:e,selected:t,recording:n=!1,onClick:r}){return(0,U.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,U.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,U.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function Ee(){let{t:e}=R(`settings`),{available:t,currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:a}=A(N()),[o,s]=(0,H.useState)(!1);return t?(0,U.jsxs)(V,{title:e(`listeningLanguageCard.title`),subtitle:e(`listeningLanguageCard.subtitle`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`,children:re(n,r)}),(0,U.jsx)(b,{variant:`outlined`,onClick:()=>s(!0),className:`shrink-0`,children:e(`listeningLanguageCard.change`)})]}),(0,U.jsx)(we,{open:o,onOpenChange:s,title:e(`listeningLanguageCard.title`),currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:a})]}):null}var G=`flux`;function De(e){return e===`vellum`}function Oe(e,t){let n=e?.trim().toLowerCase();return!n||n===`multi`||t===void 0?!0:t.includes(n.split(`-`)[0]??n)}function ke(){let{t:e}=R(`settings`),t=ve(),n=de(),r=N(),[i,o]=(0,H.useState)(!1),{data:s}=L({...g({path:{assistant_id:r}}),enabled:n,staleTime:3e4}),d=s?.services?.stt,{data:f}=L({...c({path:{assistant_id:r}}),enabled:n,staleTime:5*6e4}),p=d?.roles?.liveVoice?.provider??d?.provider,m=f?.providers?.find(e=>e.id===p),h=m?.modelFamilies?.includes(G)??!1;if(!p||!h)return null;let _=Oe(d?.language,m?.turnDetectionLanguages),v=d?.roles?.liveVoice,y=v?v.model:d?.providers?.[p]?.model,b=y===void 0?De(p)&&_:y===G,x=async n=>{o(!0);try{let{response:e}=await l({path:{assistant_id:r},body:{services:{stt:{roles:{liveVoice:{provider:p,model:n?G:m?.baseModelFamily}}}}},throwOnError:!1});if(!e?.ok)throw Error(String(e?.status??``));await t.invalidateQueries({queryKey:a({path:{assistant_id:r}})})}catch{ge.error(e(`voicePage.turnDetectionFailed`))}finally{o(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`voicePage.turnDetectionLabel`)}),(0,U.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(_?`voicePage.turnDetectionDescription`:`voicePage.turnDetectionLanguageUnsupported`)}),(0,U.jsx)(u,{checked:b,disabled:i||!_&&!b,onChange:e=>void x(e),"aria-label":e(`voicePage.turnDetectionLabel`)})]})}function K(){return!j(`voiceStartConfirmationSkipped`,!1)}function Ae(){let{t:e}=R(`settings`),[t,n]=(0,H.useState)(K);return(0,H.useEffect)(()=>s(`voiceStartConfirmationSkipped`,()=>{n(K())}),[]),(0,U.jsx)(u,{checked:t,onChange:e=>{n(e),d(`voiceStartConfirmationSkipped`,!e)},label:e(`voiceStartConfirmationToggle.label`),helperText:e(`voiceStartConfirmationToggle.description`)})}var q=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,J=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--system-negative-strong)]`,je=2;function Me(e){let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),F(t)}function Ne(){let{t:e}=R(`settings`),t=D(),n=w(e=>e.registered)===!1,[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)([]),[l,u]=(0,H.useState)(!1),d=(0,H.useRef)(null),f=(0,H.useCallback)(async()=>{i((await S())?.inputMonitoring.status??null)},[]);(0,H.useEffect)(()=>{f();let e=setInterval(()=>{f()},2e3);return()=>{clearInterval(e)}},[f]);let p=(0,H.useCallback)(()=>{ae(`inputMonitoring`).then(f)},[f]),m=(0,H.useCallback)(()=>{T(`inputMonitoring`).then(f)},[f]),h=(0,H.useCallback)(e=>{v(e),o(!1),c([]),u(!1),e.kind!==`off`&&p()},[p]),g=(0,H.useCallback)(()=>{o(!0),c([]),u(!1),requestAnimationFrame(()=>{d.current?.focus()})},[]),_=(0,H.useCallback)(()=>{o(!1),c([]),u(!1)},[]),y=(0,H.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){_();return}c(Me(e))},[_]),C=(0,H.useCallback)(e=>{if(a&&!(Me(e).length>0)){if(s.length>=je){h({kind:`modifierOnly`,modifiers:s});return}c([]),u(!0)}},[h,s,a]);(0,H.useEffect)(()=>{if(!a)return;let e=e=>{d.current&&!d.current.contains(e.target)&&_()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[_,a]);let E=O(t),k=t.kind===`modifierOnly`&&!E,A=t.kind!==`off`,j=t.kind===`modifierOnly`&&t.modifiers.includes(`control`)&&t.modifiers.includes(`option`),M=r===`granted`;return(0,U.jsx)(V,{title:e(`voiceKeyCard.title`),subtitle:e(`voiceKeyCard.subtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{ref:d,tabIndex:a?0:-1,onKeyDown:a?y:void 0,onKeyUp:a?C:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[(0,U.jsx)(W,{label:e(`voiceKeyCard.fnLabel`),selected:E,onClick:()=>h(ee)}),a?(0,U.jsx)(W,{label:s.length>0?x(s):e(`voiceKeyCard.recordingPrompt`),selected:!0,recording:!0,onClick:_}):(0,U.jsx)(W,{label:t.kind===`modifierOnly`&&!E?x(t.modifiers):e(`voiceKeyCard.customLabel`),selected:k,onClick:g}),(0,U.jsx)(W,{label:e(`voiceKeyCard.offLabel`),selected:!A,onClick:()=>h({kind:`off`})})]}),l&&(0,U.jsxs)(`div`,{className:q,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.customHint`)})]}),A&&r!==null&&!M&&(0,U.jsxs)(`div`,{className:`flex flex-col items-start gap-2 pt-1`,children:[(0,U.jsxs)(`div`,{className:J,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.needsInputMonitoring`)})]}),(0,U.jsx)(b,{variant:`outlined`,onClick:m,children:e(`voiceKeyCard.allowInputMonitoring`)})]}),A&&M&&n&&(0,U.jsxs)(`div`,{className:J,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.refusedNote`)})]}),E&&(0,U.jsxs)(`div`,{className:q,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.fnDictationNote`)})]}),j&&(0,U.jsxs)(`div`,{className:q,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.voiceOverNote`)})]}),A&&(0,U.jsx)(`div`,{className:`pt-2`,children:(0,U.jsx)(Ae,{})})]})})}function Pe({assistantId:e,open:t,onOpenChange:n}){return(0,U.jsx)(h.Root,{open:t,onOpenChange:n,children:(0,U.jsx)(h.Content,{size:`md`,children:(0,U.jsx)(Fe,{assistantId:e,onDone:()=>n(!1)})})})}function Fe({assistantId:e,onDone:t}){let{t:n}=R(),{available:r,currentModel:i,selectModel:a,selecting:o}=f(e);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(h.Header,{children:[(0,U.jsx)(h.Title,{children:n(`voicePickerModal.title`)}),r&&(0,U.jsx)(h.Description,{children:`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`})]}),(0,U.jsx)(h.Body,{children:(0,U.jsx)(C,{assistantId:e,filterBySource:!0,value:i,onChange:a,autoScrollToSelected:!0})}),(0,U.jsxs)(h.Footer,{className:`items-center justify-between gap-3`,children:[(0,U.jsx)(se,{}),(0,U.jsx)(b,{variant:`primary`,onClick:t,disabled:o,className:`shrink-0`,children:n(`voicePickerModal.done`)})]})]})}function Ie(){let{t:e}=R(`settings`),n=N(),{available:r,settled:i,voices:a,currentModel:o}=f(n),s=a.find(e=>e.model===o)??a[0],[c,l]=(0,H.useState)(!1),u=ue.use.name(),d=u?e(`voicePickerCard.titleWithName`,{name:u}):e(`voicePickerCard.title`);return i?r&&s?(0,U.jsxs)(V,{title:d,subtitle:e(`voicePickerCard.creditsNote`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(t,{description:s.description,className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`}),(0,U.jsx)(b,{variant:`outlined`,onClick:()=>l(!0),className:`shrink-0`,children:e(`voicePickerCard.changeButton`)})]}),(0,U.jsx)(Pe,{assistantId:n,open:c,onOpenChange:l})]}):(0,U.jsx)(V,{title:d,children:(0,U.jsx)(te,{})}):(0,U.jsx)(V,{title:d,children:(0,U.jsx)(ie,{as:`span`,role:`status`,"aria-label":e(`voicePickerCard.loadingAria`),className:`block h-9 w-48`})})}var Le=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],Re=`We recommend keeping both off to start. It feels more like a real conversation.`;function ze(){let{t:e}=R();return(0,U.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:e(`voiceTranscriptToggles.recommendedOff`)})}function Be({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,U.jsx)(ze,{}):null]}),t?(0,U.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,U.jsx)(u,{checked:r,onChange:i,"aria-label":e})]})}function Ve({showDescription:e=!1,showRecommendedBadge:t=!1}){let{t:n}=R(),r=M.use.showUserTranscript(),i=M.use.showAssistantTranscript(),a=M.use.setShowUserTranscript(),o=M.use.setShowAssistantTranscript(),s={showUserTranscript:{checked:r,onChange:a},showAssistantTranscript:{checked:i,onChange:o}},c=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptLabel`:`voiceTranscriptToggles.assistantTranscriptLabel`,t),l=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptDescription`:`voiceTranscriptToggles.assistantTranscriptDescription`,t);return(0,U.jsx)(U.Fragment,{children:Le.map(n=>{let r=s[n.prefKey];return(0,U.jsx)(Be,{label:c(n.prefKey,n.label),description:e?l(n.prefKey,n.description):void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var Y=`text-body-small-default text-[var(--content-tertiary)]`;function He(){let[e]=ye(),t=e.get(`tab`);return t===`sounds`?(0,U.jsx)(z,{replace:!0,to:o.settings.sounds}):t===`services`?(0,U.jsx)(z,{replace:!0,to:o.settings.ai}):(0,U.jsx)(Ue,{})}function Ue(){let{t:e}=R(`settings`);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,U.jsxs)(X,{heading:e(`voicePage.sectionOutputHeading`),description:e(`voicePage.sectionOutputDescription`),children:[(0,U.jsx)(Ie,{}),(0,U.jsx)(We,{})]}),(0,U.jsxs)(X,{heading:e(`voicePage.sectionInputHeading`),description:e(`voicePage.sectionInputDescription`),children:[(0,U.jsx)(Ke,{}),(0,U.jsx)(Ee,{}),i()?(0,U.jsx)(Ne,{}):(0,U.jsx)(Ye,{}),(0,U.jsx)(Xe,{})]}),(0,U.jsx)(X,{heading:e(`voicePage.sectionCaptionsHeading`),children:(0,U.jsx)(Ge,{})})]})}function We(){let{t:e}=R(`settings`),{available:t}=f(N());return t?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 text-body-small-lighter text-[var(--content-tertiary)]`,children:[(0,U.jsx)(B,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-quiet)]`}),(0,U.jsx)(`span`,{children:e(`voicePage.speechServicesBannerPrompt`)}),(0,U.jsxs)(be,{to:`${o.settings.ai}#text-to-speech`,className:fe(m({tone:`quiet`}),`inline-flex items-center gap-1 text-[var(--content-secondary)] decoration-[var(--border-element)] underline-offset-2`),children:[e(`voicePage.speechServicesBannerLink`),(0,U.jsx)(Ce,{className:`h-3 w-3`})]})]}):null}function X({heading:e,description:t,children:n}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t&&(0,U.jsx)(`p`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:t})]}),n]})}function Ge(){let{t:e}=R(`settings`);return(0,U.jsx)(V,{title:e(`voicePage.captionsTitle`),subtitle:e(`voicePage.captionsSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(Ve,{showDescription:!0}),(0,U.jsx)(`p`,{className:`${Y} pt-1`,children:e(`voicePage.captionsRecommendation`,Re)})]})})}var Z=``;function Ke(){let{t:e}=R(`settings`),[t,n]=(0,H.useState)([]),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(()=>E()),l=(0,H.useCallback)(async()=>{if(!navigator.mediaDevices?.enumerateDevices)return;let e=await _();i(e.needsPermission),n(e.devices),o(e.known)},[]),u=(0,H.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,H.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,H.useMemo)(()=>{let n=t.map((t,n)=>({value:t.deviceId,label:t.label||e(`voicePage.microphoneFallbackLabel`,{index:n+1})})),r=s!==Z&&!n.some(e=>e.value===s);return[{value:null,label:e(`voicePage.systemDefault`)},...n,...r?[{value:s,label:e(a?`voicePage.savedMicrophoneNotConnected`:`voicePage.savedMicrophone`)}]:[]]},[t,s,a,e]),f=(0,H.useCallback)(e=>{c(e),me(e)},[]);(0,H.useEffect)(()=>_e(()=>{c(E())}),[]);let p=s===Z?null:s;return(0,U.jsx)(V,{title:e(`voicePage.microphoneTitle`),subtitle:e(`voicePage.microphoneSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(`div`,{className:`max-w-xs`,children:(0,U.jsx)(pe,{options:d,value:p,onChange:f,onSelectNone:()=>f(Z),"aria-label":e(`voicePage.microphoneAriaLabel`)})}),r&&(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(b,{variant:`outlined`,onClick:u,children:e(`voicePage.allowMicrophoneAccess`)}),(0,U.jsx)(`span`,{className:Y,children:e(`voicePage.grantMicrophoneAccessHint`)})]})]})})}var qe=new Set([`Control`,`Alt`,`Shift`,`Meta`]),Q=`toggleVoice`,Je=[{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}}];function Ye(){let{t:e}=R(`settings`),t=p(),[n,r]=(0,H.useState)(()=>oe()),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)([]),[c,l]=(0,H.useState)(!1),d=(0,H.useRef)(null),f=(0,H.useMemo)(()=>{let e=ne();return[{label:P(e),activator:e}]},[]),m=n.kind!==`off`,h=(0,H.useCallback)(e=>{r(e),y(e),a(!1),s([]),l(!1)},[]),g=Te({onBound:()=>h({kind:`off`})}),_=g.catalog.find(e=>e.key===Q)?.accelerator??``,v=g.recordingKey===Q,b=k()?Je:[],S=(0,H.useCallback)(e=>{h(e),g.removeHotkey(Q)},[g,h]),C=(0,H.useCallback)(()=>{h({kind:`off`}),g.removeHotkey(Q)},[g,h]),w=(0,H.useCallback)(()=>{a(!0),s([]),l(!1),requestAnimationFrame(()=>{d.current?.focus()})},[]),T=(0,H.useCallback)(()=>{a(!1),s([]),l(!1)},[]),E=(0,H.useCallback)(e=>{let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),t},[]),D=(0,H.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){T();return}let t=E(e);if(qe.has(e.key)){l(!1),s(F(t));return}if(t.length===0){l(!0);return}h({kind:`key`,label:e.key.length===1?e.key.toUpperCase():e.key,modifiers:F(t)})},[T,E,h]),O=(0,H.useCallback)(e=>{i&&E(e).length===0&&o.length>0&&(s([]),l(!0))},[E,i,o]);(0,H.useEffect)(()=>{if(!i)return;let e=e=>{d.current&&!d.current.contains(e.target)&&T()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[T,i]);let A=m&&!f.some(e=>I(e.activator,n));return t?(0,U.jsx)(V,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitleDesktop`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[b.map(e=>(0,U.jsx)(W,{label:e.label,selected:I(e.activator,n),onClick:()=>S(e.activator)},e.label)),(0,U.jsx)(W,{label:v?e(`voicePage.recordingPrompt`):_?(0,U.jsx)(le,{accelerator:_}):e(`voicePage.customKey`),selected:_!==``,recording:v,onClick:v?g.stopRecording:()=>g.startRecording(Q)}),(0,U.jsx)(W,{label:e(`voicePage.offKeyLabel`),selected:n.kind===`off`&&!_&&!v,onClick:C})]}),g.conflict?.key===Q&&(0,U.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voicePage.shortcutConflict`,{command:g.conflict.label})})]})]})}):(0,U.jsx)(V,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsx)(u,{checked:m,onChange:e=>{h(e?ce():{kind:`off`})},label:e(`voicePage.enableVoiceShortcut`)}),m&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`span`,{className:Y,children:e(`voicePage.activationKeyLabel`)}),(0,U.jsxs)(`div`,{ref:d,tabIndex:i?0:-1,onKeyDown:i?D:void 0,onKeyUp:i?O:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[f.map(e=>(0,U.jsx)(W,{label:e.label,selected:I(e.activator,n),onClick:()=>h(e.activator)},e.label)),i?(0,U.jsx)(W,{label:o.length>0?x(o):e(`voicePage.pressShortcut`),selected:!0,recording:!0,onClick:T}):(0,U.jsx)(W,{label:A?P(n):e(`voicePage.customKey`),selected:A,onClick:w})]}),c&&(0,U.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voicePage.shortcutChordHint`)})]}),m&&(0,U.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voicePage.focusedTabNote`)})]})]})]})})}function Xe(){let{t:e}=R(`settings`),t=M.use.pauseBeforeReplyMs(),i=M.use.setPauseBeforeReplyMs(),a=M.use.interruptSensitivity(),o=M.use.setInterruptSensitivity(),s=(0,H.useMemo)(()=>[{value:`low`,label:e(`voicePage.interruptSensitivityLow`)},{value:`medium`,label:e(`voicePage.interruptSensitivityMedium`)},{value:`high`,label:e(`voicePage.interruptSensitivityHigh`)}],[e]),c=t!==null||a!==null;return(0,U.jsx)(V,{title:e(`voicePage.turnTakingTitle`),subtitle:e(`voicePage.turnTakingSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,U.jsx)(ke,{}),(0,U.jsx)($,{label:e(`voicePage.pauseBeforeReplyLabel`),description:e(`voicePage.pauseBeforeReplyDescription`),isDefault:t===null,children:(0,U.jsx)(`div`,{className:`max-w-xs`,children:(0,U.jsx)(r,{value:(t??1200)/1e3,onValueChange:e=>{typeof e==`number`&&i(Math.round(e*1e3))},min:500/1e3,max:n/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":e(`voicePage.pauseBeforeReplyAriaLabel`)})})}),(0,U.jsx)($,{label:e(`voicePage.interruptSensitivityLabel`),description:e(`voicePage.interruptSensitivityDescription`),isDefault:a===null,children:(0,U.jsx)(`div`,{className:`max-w-xs`,children:(0,U.jsx)(he,{items:s,value:a??`medium`,onChange:o,ariaLabel:e(`voicePage.interruptSensitivityAriaLabel`)})})}),c&&(0,U.jsx)(`div`,{children:(0,U.jsx)(b,{variant:`outlined`,onClick:()=>{i(null),o(null)},children:e(`voicePage.resetToDefaults`)})})]})})}function $({label:e,description:t,isDefault:n,children:r}){let{t:i}=R(`settings`);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),n&&(0,U.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:i(`voicePage.defaultBadge`)})]}),(0,U.jsx)(`p`,{className:Y,children:t}),r]})}export{He as VoicePage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$t as t,Au as n,CC as r,Cl as i,Cp as a,DS as o,FS as s,Fm as c,Lv as l,NC as u,NS as d,No as f,OS as p,RC as m,SC as h,Sp as g,_l as _,_s as v,as as y,aw as b,bs as x,df as S,en as C,es as w,ff as T,gl as E,gs as D,hs as O,is as k,it as A,jS as j,ju as M,ms as ee,nn as te,ns as ne,nt as N,ot as re,pC as ie,pf as ae,rs as oe,rt as se,ts as ce,tw as le,uS as ue,uh as de,uw as fe,vC as pe,vl as me,vs as P,wC as he,xC as ge,xs as F,yl as _e,ys as I}from"./app-DbJUeBix.js";import{$n as L,E as R,nr as ve}from"./vendor-CtXGFqsu.js";import{_ as ye,n as be,r as z,t as xe,x as Se}from"./react-B9IgSVeK.js";import{La as Ce,fr as B}from"./icons-C0wyat6T.js";import{t as V}from"./detail-card-WMdjzPA_.js";import{t as we}from"./stt-language-picker-modal-0IKnLGpu.js";import{t as Te}from"./use-hotkey-recorder-BKycBMhe.js";var H=e(Se(),1),U=xe();function W({label:e,selected:t,recording:n=!1,onClick:r}){return(0,U.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,U.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,U.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function Ee(){let{t:e}=R(`settings`),{available:t,currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:a}=A(N()),[o,s]=(0,H.useState)(!1);return t?(0,U.jsxs)(V,{title:e(`listeningLanguageCard.title`),subtitle:e(`listeningLanguageCard.subtitle`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`,children:re(n,r)}),(0,U.jsx)(b,{variant:`outlined`,onClick:()=>s(!0),className:`shrink-0`,children:e(`listeningLanguageCard.change`)})]}),(0,U.jsx)(we,{open:o,onOpenChange:s,title:e(`listeningLanguageCard.title`),currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:a})]}):null}var G=`flux`;function De(e){return e===`vellum`}function Oe(e,t){let n=e?.trim().toLowerCase();return!n||n===`multi`||t===void 0?!0:t.includes(n.split(`-`)[0]??n)}function ke(){let{t:e}=R(`settings`),t=ve(),n=de(),r=N(),[i,o]=(0,H.useState)(!1),{data:s}=L({...g({path:{assistant_id:r}}),enabled:n,staleTime:3e4}),d=s?.services?.stt,{data:f}=L({...c({path:{assistant_id:r}}),enabled:n,staleTime:5*6e4}),p=d?.roles?.liveVoice?.provider??d?.provider,m=f?.providers?.find(e=>e.id===p),h=m?.modelFamilies?.includes(G)??!1;if(!p||!h)return null;let _=Oe(d?.language,m?.turnDetectionLanguages),v=d?.roles?.liveVoice,y=v?v.model:d?.providers?.[p]?.model,b=y===void 0?De(p)&&_:y===G,x=async n=>{o(!0);try{let{response:e}=await l({path:{assistant_id:r},body:{services:{stt:{roles:{liveVoice:{provider:p,model:n?G:m?.baseModelFamily}}}}},throwOnError:!1});if(!e?.ok)throw Error(String(e?.status??``));await t.invalidateQueries({queryKey:a({path:{assistant_id:r}})})}catch{ge.error(e(`voicePage.turnDetectionFailed`))}finally{o(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`voicePage.turnDetectionLabel`)}),(0,U.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(_?`voicePage.turnDetectionDescription`:`voicePage.turnDetectionLanguageUnsupported`)}),(0,U.jsx)(u,{checked:b,disabled:i||!_&&!b,onChange:e=>void x(e),"aria-label":e(`voicePage.turnDetectionLabel`)})]})}function K(){return!j(`voiceStartConfirmationSkipped`,!1)}function Ae(){let{t:e}=R(`settings`),[t,n]=(0,H.useState)(K);return(0,H.useEffect)(()=>s(`voiceStartConfirmationSkipped`,()=>{n(K())}),[]),(0,U.jsx)(u,{checked:t,onChange:e=>{n(e),d(`voiceStartConfirmationSkipped`,!e)},label:e(`voiceStartConfirmationToggle.label`),helperText:e(`voiceStartConfirmationToggle.description`)})}var q=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,J=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--system-negative-strong)]`,je=2;function Me(e){let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),F(t)}function Ne(){let{t:e}=R(`settings`),t=D(),n=w(e=>e.registered)===!1,[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)([]),[l,u]=(0,H.useState)(!1),d=(0,H.useRef)(null),f=(0,H.useCallback)(async()=>{i((await S())?.inputMonitoring.status??null)},[]);(0,H.useEffect)(()=>{f();let e=setInterval(()=>{f()},2e3);return()=>{clearInterval(e)}},[f]);let p=(0,H.useCallback)(()=>{ae(`inputMonitoring`).then(f)},[f]),m=(0,H.useCallback)(()=>{T(`inputMonitoring`).then(f)},[f]),h=(0,H.useCallback)(e=>{v(e),o(!1),c([]),u(!1),e.kind!==`off`&&p()},[p]),g=(0,H.useCallback)(()=>{o(!0),c([]),u(!1),requestAnimationFrame(()=>{d.current?.focus()})},[]),_=(0,H.useCallback)(()=>{o(!1),c([]),u(!1)},[]),y=(0,H.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){_();return}c(Me(e))},[_]),C=(0,H.useCallback)(e=>{if(a&&!(Me(e).length>0)){if(s.length>=je){h({kind:`modifierOnly`,modifiers:s});return}c([]),u(!0)}},[h,s,a]);(0,H.useEffect)(()=>{if(!a)return;let e=e=>{d.current&&!d.current.contains(e.target)&&_()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[_,a]);let E=O(t),k=t.kind===`modifierOnly`&&!E,A=t.kind!==`off`,j=t.kind===`modifierOnly`&&t.modifiers.includes(`control`)&&t.modifiers.includes(`option`),M=r===`granted`;return(0,U.jsx)(V,{title:e(`voiceKeyCard.title`),subtitle:e(`voiceKeyCard.subtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{ref:d,tabIndex:a?0:-1,onKeyDown:a?y:void 0,onKeyUp:a?C:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[(0,U.jsx)(W,{label:e(`voiceKeyCard.fnLabel`),selected:E,onClick:()=>h(ee)}),a?(0,U.jsx)(W,{label:s.length>0?x(s):e(`voiceKeyCard.recordingPrompt`),selected:!0,recording:!0,onClick:_}):(0,U.jsx)(W,{label:t.kind===`modifierOnly`&&!E?x(t.modifiers):e(`voiceKeyCard.customLabel`),selected:k,onClick:g}),(0,U.jsx)(W,{label:e(`voiceKeyCard.offLabel`),selected:!A,onClick:()=>h({kind:`off`})})]}),l&&(0,U.jsxs)(`div`,{className:q,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.customHint`)})]}),A&&r!==null&&!M&&(0,U.jsxs)(`div`,{className:`flex flex-col items-start gap-2 pt-1`,children:[(0,U.jsxs)(`div`,{className:J,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.needsInputMonitoring`)})]}),(0,U.jsx)(b,{variant:`outlined`,onClick:m,children:e(`voiceKeyCard.allowInputMonitoring`)})]}),A&&M&&n&&(0,U.jsxs)(`div`,{className:J,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.refusedNote`)})]}),E&&(0,U.jsxs)(`div`,{className:q,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.fnDictationNote`)})]}),j&&(0,U.jsxs)(`div`,{className:q,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voiceKeyCard.voiceOverNote`)})]}),A&&(0,U.jsx)(`div`,{className:`pt-2`,children:(0,U.jsx)(Ae,{})})]})})}function Pe({assistantId:e,open:t,onOpenChange:n}){return(0,U.jsx)(h.Root,{open:t,onOpenChange:n,children:(0,U.jsx)(h.Content,{size:`md`,children:(0,U.jsx)(Fe,{assistantId:e,onDone:()=>n(!1)})})})}function Fe({assistantId:e,onDone:t}){let{t:n}=R(),{available:r,currentModel:i,selectModel:a,selecting:o}=f(e);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(h.Header,{children:[(0,U.jsx)(h.Title,{children:n(`voicePickerModal.title`)}),r&&(0,U.jsx)(h.Description,{children:`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`})]}),(0,U.jsx)(h.Body,{children:(0,U.jsx)(C,{assistantId:e,filterBySource:!0,value:i,onChange:a,autoScrollToSelected:!0})}),(0,U.jsxs)(h.Footer,{className:`items-center justify-between gap-3`,children:[(0,U.jsx)(se,{}),(0,U.jsx)(b,{variant:`primary`,onClick:t,disabled:o,className:`shrink-0`,children:n(`voicePickerModal.done`)})]})]})}function Ie(){let{t:e}=R(`settings`),n=N(),{available:r,settled:i,voices:a,currentModel:o}=f(n),s=a.find(e=>e.model===o)??a[0],[c,l]=(0,H.useState)(!1),u=ue.use.name(),d=u?e(`voicePickerCard.titleWithName`,{name:u}):e(`voicePickerCard.title`);return i?r&&s?(0,U.jsxs)(V,{title:d,subtitle:e(`voicePickerCard.creditsNote`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(t,{description:s.description,className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`}),(0,U.jsx)(b,{variant:`outlined`,onClick:()=>l(!0),className:`shrink-0`,children:e(`voicePickerCard.changeButton`)})]}),(0,U.jsx)(Pe,{assistantId:n,open:c,onOpenChange:l})]}):(0,U.jsx)(V,{title:d,children:(0,U.jsx)(te,{})}):(0,U.jsx)(V,{title:d,children:(0,U.jsx)(ie,{as:`span`,role:`status`,"aria-label":e(`voicePickerCard.loadingAria`),className:`block h-9 w-48`})})}var Le=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],Re=`We recommend keeping both off to start. It feels more like a real conversation.`;function ze(){let{t:e}=R();return(0,U.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:e(`voiceTranscriptToggles.recommendedOff`)})}function Be({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,U.jsx)(ze,{}):null]}),t?(0,U.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,U.jsx)(u,{checked:r,onChange:i,"aria-label":e})]})}function Ve({showDescription:e=!1,showRecommendedBadge:t=!1}){let{t:n}=R(),r=M.use.showUserTranscript(),i=M.use.showAssistantTranscript(),a=M.use.setShowUserTranscript(),o=M.use.setShowAssistantTranscript(),s={showUserTranscript:{checked:r,onChange:a},showAssistantTranscript:{checked:i,onChange:o}},c=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptLabel`:`voiceTranscriptToggles.assistantTranscriptLabel`,t),l=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptDescription`:`voiceTranscriptToggles.assistantTranscriptDescription`,t);return(0,U.jsx)(U.Fragment,{children:Le.map(n=>{let r=s[n.prefKey];return(0,U.jsx)(Be,{label:c(n.prefKey,n.label),description:e?l(n.prefKey,n.description):void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var Y=`text-body-small-default text-[var(--content-tertiary)]`;function He(){let[e]=ye(),t=e.get(`tab`);return t===`sounds`?(0,U.jsx)(z,{replace:!0,to:o.settings.sounds}):t===`services`?(0,U.jsx)(z,{replace:!0,to:o.settings.ai}):(0,U.jsx)(Ue,{})}function Ue(){let{t:e}=R(`settings`);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,U.jsxs)(X,{heading:e(`voicePage.sectionOutputHeading`),description:e(`voicePage.sectionOutputDescription`),children:[(0,U.jsx)(Ie,{}),(0,U.jsx)(We,{})]}),(0,U.jsxs)(X,{heading:e(`voicePage.sectionInputHeading`),description:e(`voicePage.sectionInputDescription`),children:[(0,U.jsx)(Ke,{}),(0,U.jsx)(Ee,{}),i()?(0,U.jsx)(Ne,{}):(0,U.jsx)(Ye,{}),(0,U.jsx)(Xe,{})]}),(0,U.jsx)(X,{heading:e(`voicePage.sectionCaptionsHeading`),children:(0,U.jsx)(Ge,{})})]})}function We(){let{t:e}=R(`settings`),{available:t}=f(N());return t?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 text-body-small-lighter text-[var(--content-tertiary)]`,children:[(0,U.jsx)(B,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-quiet)]`}),(0,U.jsx)(`span`,{children:e(`voicePage.speechServicesBannerPrompt`)}),(0,U.jsxs)(be,{to:`${o.settings.ai}#text-to-speech`,className:fe(m({tone:`quiet`}),`inline-flex items-center gap-1 text-[var(--content-secondary)] decoration-[var(--border-element)] underline-offset-2`),children:[e(`voicePage.speechServicesBannerLink`),(0,U.jsx)(Ce,{className:`h-3 w-3`})]})]}):null}function X({heading:e,description:t,children:n}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t&&(0,U.jsx)(`p`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:t})]}),n]})}function Ge(){let{t:e}=R(`settings`);return(0,U.jsx)(V,{title:e(`voicePage.captionsTitle`),subtitle:e(`voicePage.captionsSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(Ve,{showDescription:!0}),(0,U.jsx)(`p`,{className:`${Y} pt-1`,children:e(`voicePage.captionsRecommendation`,Re)})]})})}var Z=``;function Ke(){let{t:e}=R(`settings`),[t,n]=(0,H.useState)([]),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(()=>E()),l=(0,H.useCallback)(async()=>{if(!navigator.mediaDevices?.enumerateDevices)return;let e=await _();i(e.needsPermission),n(e.devices),o(e.known)},[]),u=(0,H.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,H.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,H.useMemo)(()=>{let n=t.map((t,n)=>({value:t.deviceId,label:t.label||e(`voicePage.microphoneFallbackLabel`,{index:n+1})})),r=s!==Z&&!n.some(e=>e.value===s);return[{value:null,label:e(`voicePage.systemDefault`)},...n,...r?[{value:s,label:e(a?`voicePage.savedMicrophoneNotConnected`:`voicePage.savedMicrophone`)}]:[]]},[t,s,a,e]),f=(0,H.useCallback)(e=>{c(e),me(e)},[]);(0,H.useEffect)(()=>_e(()=>{c(E())}),[]);let p=s===Z?null:s;return(0,U.jsx)(V,{title:e(`voicePage.microphoneTitle`),subtitle:e(`voicePage.microphoneSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(`div`,{className:`max-w-xs`,children:(0,U.jsx)(pe,{options:d,value:p,onChange:f,onSelectNone:()=>f(Z),"aria-label":e(`voicePage.microphoneAriaLabel`)})}),r&&(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(b,{variant:`outlined`,onClick:u,children:e(`voicePage.allowMicrophoneAccess`)}),(0,U.jsx)(`span`,{className:Y,children:e(`voicePage.grantMicrophoneAccessHint`)})]})]})})}var qe=new Set([`Control`,`Alt`,`Shift`,`Meta`]),Q=`toggleVoice`,Je=[{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}}];function Ye(){let{t:e}=R(`settings`),t=p(),[n,r]=(0,H.useState)(()=>oe()),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)([]),[c,l]=(0,H.useState)(!1),d=(0,H.useRef)(null),f=(0,H.useMemo)(()=>{let e=ne();return[{label:P(e),activator:e}]},[]),m=n.kind!==`off`,h=(0,H.useCallback)(e=>{r(e),y(e),a(!1),s([]),l(!1)},[]),g=Te({onBound:()=>h({kind:`off`})}),_=g.catalog.find(e=>e.key===Q)?.accelerator??``,v=g.recordingKey===Q,b=k()?Je:[],S=(0,H.useCallback)(e=>{h(e),g.removeHotkey(Q)},[g,h]),C=(0,H.useCallback)(()=>{h({kind:`off`}),g.removeHotkey(Q)},[g,h]),w=(0,H.useCallback)(()=>{a(!0),s([]),l(!1),requestAnimationFrame(()=>{d.current?.focus()})},[]),T=(0,H.useCallback)(()=>{a(!1),s([]),l(!1)},[]),E=(0,H.useCallback)(e=>{let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),t},[]),D=(0,H.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){T();return}let t=E(e);if(qe.has(e.key)){l(!1),s(F(t));return}if(t.length===0){l(!0);return}h({kind:`key`,label:e.key.length===1?e.key.toUpperCase():e.key,modifiers:F(t)})},[T,E,h]),O=(0,H.useCallback)(e=>{i&&E(e).length===0&&o.length>0&&(s([]),l(!0))},[E,i,o]);(0,H.useEffect)(()=>{if(!i)return;let e=e=>{d.current&&!d.current.contains(e.target)&&T()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[T,i]);let A=m&&!f.some(e=>I(e.activator,n));return t?(0,U.jsx)(V,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitleDesktop`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[b.map(e=>(0,U.jsx)(W,{label:e.label,selected:I(e.activator,n),onClick:()=>S(e.activator)},e.label)),(0,U.jsx)(W,{label:v?e(`voicePage.recordingPrompt`):_?(0,U.jsx)(le,{accelerator:_}):e(`voicePage.customKey`),selected:_!==``,recording:v,onClick:v?g.stopRecording:()=>g.startRecording(Q)}),(0,U.jsx)(W,{label:e(`voicePage.offKeyLabel`),selected:n.kind===`off`&&!_&&!v,onClick:C})]}),g.conflict?.key===Q&&(0,U.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voicePage.shortcutConflict`,{command:g.conflict.label})})]})]})}):(0,U.jsx)(V,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsx)(u,{checked:m,onChange:e=>{h(e?ce():{kind:`off`})},label:e(`voicePage.enableVoiceShortcut`)}),m&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`span`,{className:Y,children:e(`voicePage.activationKeyLabel`)}),(0,U.jsxs)(`div`,{ref:d,tabIndex:i?0:-1,onKeyDown:i?D:void 0,onKeyUp:i?O:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[f.map(e=>(0,U.jsx)(W,{label:e.label,selected:I(e.activator,n),onClick:()=>h(e.activator)},e.label)),i?(0,U.jsx)(W,{label:o.length>0?x(o):e(`voicePage.pressShortcut`),selected:!0,recording:!0,onClick:T}):(0,U.jsx)(W,{label:A?P(n):e(`voicePage.customKey`),selected:A,onClick:w})]}),c&&(0,U.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voicePage.shortcutChordHint`)})]}),m&&(0,U.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,U.jsx)(B,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,U.jsx)(`span`,{children:e(`voicePage.focusedTabNote`)})]})]})]})})}function Xe(){let{t:e}=R(`settings`),t=M.use.pauseBeforeReplyMs(),i=M.use.setPauseBeforeReplyMs(),a=M.use.interruptSensitivity(),o=M.use.setInterruptSensitivity(),s=(0,H.useMemo)(()=>[{value:`low`,label:e(`voicePage.interruptSensitivityLow`)},{value:`medium`,label:e(`voicePage.interruptSensitivityMedium`)},{value:`high`,label:e(`voicePage.interruptSensitivityHigh`)}],[e]),c=t!==null||a!==null;return(0,U.jsx)(V,{title:e(`voicePage.turnTakingTitle`),subtitle:e(`voicePage.turnTakingSubtitle`),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,U.jsx)(ke,{}),(0,U.jsx)($,{label:e(`voicePage.pauseBeforeReplyLabel`),description:e(`voicePage.pauseBeforeReplyDescription`),isDefault:t===null,children:(0,U.jsx)(`div`,{className:`max-w-xs`,children:(0,U.jsx)(r,{value:(t??1200)/1e3,onValueChange:e=>{typeof e==`number`&&i(Math.round(e*1e3))},min:500/1e3,max:n/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":e(`voicePage.pauseBeforeReplyAriaLabel`)})})}),(0,U.jsx)($,{label:e(`voicePage.interruptSensitivityLabel`),description:e(`voicePage.interruptSensitivityDescription`),isDefault:a===null,children:(0,U.jsx)(`div`,{className:`max-w-xs`,children:(0,U.jsx)(he,{items:s,value:a??`medium`,onChange:o,ariaLabel:e(`voicePage.interruptSensitivityAriaLabel`)})})}),c&&(0,U.jsx)(`div`,{children:(0,U.jsx)(b,{variant:`outlined`,onClick:()=>{i(null),o(null)},children:e(`voicePage.resetToDefaults`)})})]})})}function $({label:e,description:t,isDefault:n,children:r}){let{t:i}=R(`settings`);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),n&&(0,U.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:i(`voicePage.defaultBadge`)})]}),(0,U.jsx)(`p`,{className:Y,children:t}),r]})}export{He as VoicePage};
@@ -1 +1 @@
1
- import{Nn as e,Pn as t,er as n}from"./app-D0NlDYsG.js";import{E as r}from"./vendor-CtXGFqsu.js";import{t as i}from"./react-B9IgSVeK.js";import{$ as a}from"./icons-C0wyat6T.js";var o=i();function s({payload:e,onClose:i}){let{t:s}=r(`chat`),u=t(e.body);return(0,o.jsx)(n,{Glyph:a,title:e.title||s(`wakeDetailPanel.title`),closeLabel:s(`wakeDetailPanel.closeAria`),closeVariant:`outlined`,onClose:i,children:(0,o.jsxs)(`dl`,{className:`flex flex-col gap-5`,children:[u.workflow&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.workflow`),children:u.workflow}),u.runStatus&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.runStatus`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.runStatus})}),u.result&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.result`),children:(0,o.jsx)(c,{result:u.result})}),u.rest&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.details`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.rest})}),e.metadata.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-5`,children:e.metadata.map(e=>(0,o.jsx)(l,{label:e.label,children:e.value},e.label))})]})})}function c({result:t}){let n=e(t);return n?(0,o.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map((e,t)=>(0,o.jsx)(`div`,{className:t>0?`flex flex-col gap-2 border-t border-[var(--border-hover)] pt-4`:`flex flex-col gap-2`,children:e.map(e=>(0,o.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,o.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:e.key}),(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e.value})]},e.key))},t))}):(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:t})}function l({label:e,children:t}){return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`dt`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:e}),(0,o.jsx)(`dd`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t})]})}export{s as WakeDetailPanel};
1
+ import{Nn as e,Pn as t,er as n}from"./app-DbJUeBix.js";import{E as r}from"./vendor-CtXGFqsu.js";import{t as i}from"./react-B9IgSVeK.js";import{$ as a}from"./icons-C0wyat6T.js";var o=i();function s({payload:e,onClose:i}){let{t:s}=r(`chat`),u=t(e.body);return(0,o.jsx)(n,{Glyph:a,title:e.title||s(`wakeDetailPanel.title`),closeLabel:s(`wakeDetailPanel.closeAria`),closeVariant:`outlined`,onClose:i,children:(0,o.jsxs)(`dl`,{className:`flex flex-col gap-5`,children:[u.workflow&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.workflow`),children:u.workflow}),u.runStatus&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.runStatus`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.runStatus})}),u.result&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.result`),children:(0,o.jsx)(c,{result:u.result})}),u.rest&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.details`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.rest})}),e.metadata.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-5`,children:e.metadata.map(e=>(0,o.jsx)(l,{label:e.label,children:e.value},e.label))})]})})}function c({result:t}){let n=e(t);return n?(0,o.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map((e,t)=>(0,o.jsx)(`div`,{className:t>0?`flex flex-col gap-2 border-t border-[var(--border-hover)] pt-4`:`flex flex-col gap-2`,children:e.map(e=>(0,o.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,o.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:e.key}),(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e.value})]},e.key))},t))}):(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:t})}function l({label:e,children:t}){return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`dt`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:e}),(0,o.jsx)(`dd`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t})]})}export{s as WakeDetailPanel};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Qo as t,an as n,cn as r,on as i,sn as a}from"./app-D0NlDYsG.js";import{E as o}from"./vendor-CtXGFqsu.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{Ci as l,Si as u,V as d,_i as f,bi as p,c as m,ni as h,tt as g,vi as _,vn as v,xi as y}from"./icons-C0wyat6T.js";var b=e(c(),1),x={"sun.max.fill":{icon:d,className:`text-orange-500`},"cloud.sun.fill":{icon:_,className:`text-amber-400`},"moon.fill":{icon:v,className:`text-blue-400`},"cloud.moon.fill":{icon:y,className:`text-blue-400`},"cloud.fill":{icon:f,className:`text-stone-400`},"cloud.rain.fill":{icon:p,className:`text-blue-400`},snowflake:{icon:g,className:`text-blue-300`},"cloud.bolt.fill":{icon:u,className:`text-orange-500`},"cloud.fog.fill":{icon:l,className:`text-stone-400`}},S={sunny:{icon:d,className:`text-orange-500`},clear:{icon:d,className:`text-orange-500`},"partly cloudy":{icon:_,className:`text-amber-400`},"mostly sunny":{icon:_,className:`text-amber-400`},cloudy:{icon:f,className:`text-stone-400`},overcast:{icon:f,className:`text-stone-400`},rainy:{icon:p,className:`text-blue-400`},rain:{icon:p,className:`text-blue-400`},drizzle:{icon:p,className:`text-blue-400`},snow:{icon:g,className:`text-blue-300`},snowy:{icon:g,className:`text-blue-300`},thunderstorm:{icon:u,className:`text-orange-500`},thunder:{icon:u,className:`text-orange-500`},foggy:{icon:l,className:`text-stone-400`},fog:{icon:l,className:`text-stone-400`},mist:{icon:l,className:`text-stone-400`},hazy:{icon:l,className:`text-stone-400`},night:{icon:v,className:`text-blue-400`},"mainly clear":{icon:d,className:`text-orange-500`},"mostly cloudy":{icon:f,className:`text-stone-400`},breezy:{icon:m,className:`text-stone-400`},windy:{icon:m,className:`text-stone-400`},cool:{icon:f,className:`text-stone-400`},warm:{icon:d,className:`text-orange-500`},hot:{icon:d,className:`text-orange-500`},cold:{icon:g,className:`text-blue-300`},"cold snap":{icon:g,className:`text-blue-300`},"warm, mostly sunny":{icon:_,className:`text-amber-400`},"cooler, breezy":{icon:m,className:`text-stone-400`}},C={icon:f,className:`text-stone-400`};function w(e){let t=x[e];if(t)return t;let n=e.toLowerCase(),r=S[n];if(r)return r;for(let[e,t]of Object.entries(S))if(n.includes(e))return t;return C}function T(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function E(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=a(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let o=a(e.current),s=i(o?.temp)??i(e.currentTemp)??i(e.temperature)??i(e.temp),c=i(o?.feelsLike)??i(o?.feels_like)??i(o?.apparentTemperature)??i(e.feelsLike)??i(e.feels_like)??i(e.apparentTemperature),l=r(o?.condition)??r(e.condition),u=i(o?.humidity)??i(e.humidity),d=T(o?.wind??e.wind),f=i(o?.windSpeed)??i(o?.wind_speed)??i(e.windSpeed)??i(e.wind_speed)??d.speed,p=r(o?.windDirection)??r(o?.wind_direction)??r(e.windDirection)??r(e.wind_direction)??d.direction,m=a(e.units),h=r(m?.temperature)??r(o?.unit)??r(e.unit)??`F`,g=r(m?.speed)??r(e.windUnit)??r(e.wind_unit),_=n(e.hourly).map((e,t)=>({id:r(e.id)??String(t),time:r(e.time)??``,icon:r(e.icon)??r(e.condition)??`cloud.fill`,temp:i(e.tempC)??i(e.temp)??i(e.temperature),tempC:i(e.tempC)})),v=n([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:r(e.id)??String(t),day:r(e.day)??r(e.date),dayLabel:r(e.dayLabel)??r(e.date),icon:r(e.icon)??r(e.condition)??`cloud.fill`,low:i(e.low),high:i(e.high),lowC:i(e.lowC),highC:i(e.highC),precip:i(e.precip)??i(e.precipitation)??i(e.precipitationProbability),condition:r(e.condition)}));return{location:t,currentTemp:s,feelsLike:c,condition:l,humidity:u,windSpeed:f,windDirection:p,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function D(e){return e*9/5+32}function O(e){return(e-32)*5/9}function k(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=O(e)),!t&&n&&(r=D(e)),`${Math.round(r)}`}function A(e,t,n){return e.tempC===void 0?e.temp===void 0?null:k(e.temp,t,n):k(e.tempC,!1,n)}function j(e,t,n){return e.lowC===void 0?k(e.low,t,n):k(e.lowC,!1,n)}function M(e,t,n){return e.highC===void 0?k(e.high,t,n):k(e.highC,!1,n)}var N=s();function P({icon:e,size:t=20}){let{icon:n,className:r}=w(e);return(0,N.jsx)(n,{width:t,height:t,className:r})}function F({useFahrenheit:e,onToggle:n}){let{t:r}=o(`chat`);return(0,N.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>n(!0),className:t(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:r(`weatherForecastDisplay.fahrenheit`)}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:t(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:r(`weatherForecastDisplay.celsius`)})]})}function I({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let{t:i}=o(`chat`),a=e.location,s=k(e.currentTemp,t,n),c=k(e.feelsLike,t,n),l=n?`F`:`C`,u=e.forecast?.[0],d=u?M(u,t,n):null,f=u?j(u,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:a}),s!==null&&(0,N.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[s,`°`,l]}),e.condition&&(0,N.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,N.jsx)(F,{useFahrenheit:n,onToggle:r})]}),(0,N.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[c!==null&&(0,N.jsx)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:i(`weatherForecastDisplay.feelsLike`,{temp:c})}),d!==null&&f!==null&&(0,N.jsx)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:i(`weatherForecastDisplay.highLow`,{high:d,low:f})}),p&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,N.jsx)(m,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,N.jsx)(h,{width:12,height:12}),e.humidity,`%`]})]})]})}function L({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){let{t:r}=o(`chat`);return(0,N.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,N.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,i)=>{let a=e.time.toLowerCase()===`now`,o=A(e,t,n);return(0,N.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,N.jsx)(`span`,{className:a?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:a?r(`weatherForecastDisplay.now`):e.time}),(0,N.jsx)(P,{icon:e.icon,size:18}),o!==null&&(0,N.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[o,`°`]})]},e.id??i)})})})}function R({forecast:e,currentTemp:n,sourceIsFahrenheit:r,useFahrenheit:i}){let{globalMin:a,globalMax:o}=(0,b.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,N.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,N.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=j(e,r,i),f=M(e,r,i),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&n!==void 0){let t=(e.lowC!==void 0||e.highC!==void 0)&&r?(n-32)*5/9:n;y=h===m?50:(Math.max(m,Math.min(h,t))-m)/(h-m)*100}return(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:t(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,N.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,N.jsx)(P,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,N.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,N.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,N.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,N.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,N.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,N.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function z({templateData:e,fallback:t}){let n=(0,b.useMemo)(()=>E(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,b.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,N.jsxs)(`div`,{className:`mt-3`,children:[(0,N.jsx)(I,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,N.jsx)(L,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,N.jsx)(R,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{z as WeatherForecastDisplay};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Qo as t,an as n,cn as r,on as i,sn as a}from"./app-DbJUeBix.js";import{E as o}from"./vendor-CtXGFqsu.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{Ci as l,Si as u,V as d,_i as f,bi as p,c as m,ni as h,tt as g,vi as _,vn as v,xi as y}from"./icons-C0wyat6T.js";var b=e(c(),1),x={"sun.max.fill":{icon:d,className:`text-orange-500`},"cloud.sun.fill":{icon:_,className:`text-amber-400`},"moon.fill":{icon:v,className:`text-blue-400`},"cloud.moon.fill":{icon:y,className:`text-blue-400`},"cloud.fill":{icon:f,className:`text-stone-400`},"cloud.rain.fill":{icon:p,className:`text-blue-400`},snowflake:{icon:g,className:`text-blue-300`},"cloud.bolt.fill":{icon:u,className:`text-orange-500`},"cloud.fog.fill":{icon:l,className:`text-stone-400`}},S={sunny:{icon:d,className:`text-orange-500`},clear:{icon:d,className:`text-orange-500`},"partly cloudy":{icon:_,className:`text-amber-400`},"mostly sunny":{icon:_,className:`text-amber-400`},cloudy:{icon:f,className:`text-stone-400`},overcast:{icon:f,className:`text-stone-400`},rainy:{icon:p,className:`text-blue-400`},rain:{icon:p,className:`text-blue-400`},drizzle:{icon:p,className:`text-blue-400`},snow:{icon:g,className:`text-blue-300`},snowy:{icon:g,className:`text-blue-300`},thunderstorm:{icon:u,className:`text-orange-500`},thunder:{icon:u,className:`text-orange-500`},foggy:{icon:l,className:`text-stone-400`},fog:{icon:l,className:`text-stone-400`},mist:{icon:l,className:`text-stone-400`},hazy:{icon:l,className:`text-stone-400`},night:{icon:v,className:`text-blue-400`},"mainly clear":{icon:d,className:`text-orange-500`},"mostly cloudy":{icon:f,className:`text-stone-400`},breezy:{icon:m,className:`text-stone-400`},windy:{icon:m,className:`text-stone-400`},cool:{icon:f,className:`text-stone-400`},warm:{icon:d,className:`text-orange-500`},hot:{icon:d,className:`text-orange-500`},cold:{icon:g,className:`text-blue-300`},"cold snap":{icon:g,className:`text-blue-300`},"warm, mostly sunny":{icon:_,className:`text-amber-400`},"cooler, breezy":{icon:m,className:`text-stone-400`}},C={icon:f,className:`text-stone-400`};function w(e){let t=x[e];if(t)return t;let n=e.toLowerCase(),r=S[n];if(r)return r;for(let[e,t]of Object.entries(S))if(n.includes(e))return t;return C}function T(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function E(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=a(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let o=a(e.current),s=i(o?.temp)??i(e.currentTemp)??i(e.temperature)??i(e.temp),c=i(o?.feelsLike)??i(o?.feels_like)??i(o?.apparentTemperature)??i(e.feelsLike)??i(e.feels_like)??i(e.apparentTemperature),l=r(o?.condition)??r(e.condition),u=i(o?.humidity)??i(e.humidity),d=T(o?.wind??e.wind),f=i(o?.windSpeed)??i(o?.wind_speed)??i(e.windSpeed)??i(e.wind_speed)??d.speed,p=r(o?.windDirection)??r(o?.wind_direction)??r(e.windDirection)??r(e.wind_direction)??d.direction,m=a(e.units),h=r(m?.temperature)??r(o?.unit)??r(e.unit)??`F`,g=r(m?.speed)??r(e.windUnit)??r(e.wind_unit),_=n(e.hourly).map((e,t)=>({id:r(e.id)??String(t),time:r(e.time)??``,icon:r(e.icon)??r(e.condition)??`cloud.fill`,temp:i(e.tempC)??i(e.temp)??i(e.temperature),tempC:i(e.tempC)})),v=n([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:r(e.id)??String(t),day:r(e.day)??r(e.date),dayLabel:r(e.dayLabel)??r(e.date),icon:r(e.icon)??r(e.condition)??`cloud.fill`,low:i(e.low),high:i(e.high),lowC:i(e.lowC),highC:i(e.highC),precip:i(e.precip)??i(e.precipitation)??i(e.precipitationProbability),condition:r(e.condition)}));return{location:t,currentTemp:s,feelsLike:c,condition:l,humidity:u,windSpeed:f,windDirection:p,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function D(e){return e*9/5+32}function O(e){return(e-32)*5/9}function k(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=O(e)),!t&&n&&(r=D(e)),`${Math.round(r)}`}function A(e,t,n){return e.tempC===void 0?e.temp===void 0?null:k(e.temp,t,n):k(e.tempC,!1,n)}function j(e,t,n){return e.lowC===void 0?k(e.low,t,n):k(e.lowC,!1,n)}function M(e,t,n){return e.highC===void 0?k(e.high,t,n):k(e.highC,!1,n)}var N=s();function P({icon:e,size:t=20}){let{icon:n,className:r}=w(e);return(0,N.jsx)(n,{width:t,height:t,className:r})}function F({useFahrenheit:e,onToggle:n}){let{t:r}=o(`chat`);return(0,N.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>n(!0),className:t(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:r(`weatherForecastDisplay.fahrenheit`)}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:t(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:r(`weatherForecastDisplay.celsius`)})]})}function I({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let{t:i}=o(`chat`),a=e.location,s=k(e.currentTemp,t,n),c=k(e.feelsLike,t,n),l=n?`F`:`C`,u=e.forecast?.[0],d=u?M(u,t,n):null,f=u?j(u,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:a}),s!==null&&(0,N.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[s,`°`,l]}),e.condition&&(0,N.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,N.jsx)(F,{useFahrenheit:n,onToggle:r})]}),(0,N.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[c!==null&&(0,N.jsx)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:i(`weatherForecastDisplay.feelsLike`,{temp:c})}),d!==null&&f!==null&&(0,N.jsx)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:i(`weatherForecastDisplay.highLow`,{high:d,low:f})}),p&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,N.jsx)(m,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,N.jsx)(h,{width:12,height:12}),e.humidity,`%`]})]})]})}function L({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){let{t:r}=o(`chat`);return(0,N.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,N.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,i)=>{let a=e.time.toLowerCase()===`now`,o=A(e,t,n);return(0,N.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,N.jsx)(`span`,{className:a?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:a?r(`weatherForecastDisplay.now`):e.time}),(0,N.jsx)(P,{icon:e.icon,size:18}),o!==null&&(0,N.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[o,`°`]})]},e.id??i)})})})}function R({forecast:e,currentTemp:n,sourceIsFahrenheit:r,useFahrenheit:i}){let{globalMin:a,globalMax:o}=(0,b.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,N.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,N.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=j(e,r,i),f=M(e,r,i),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&n!==void 0){let t=(e.lowC!==void 0||e.highC!==void 0)&&r?(n-32)*5/9:n;y=h===m?50:(Math.max(m,Math.min(h,t))-m)/(h-m)*100}return(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:t(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,N.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,N.jsx)(P,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,N.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,N.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,N.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,N.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,N.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,N.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function z({templateData:e,fallback:t}){let n=(0,b.useMemo)(()=>E(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,b.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,N.jsxs)(`div`,{className:`mt-3`,children:[(0,N.jsx)(I,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,N.jsx)(L,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,N.jsx)(R,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{z as WeatherForecastDisplay};
@@ -1 +1 @@
1
- import{DS as e,Ex as t,ji as n}from"./app-D0NlDYsG.js";import{E as r}from"./vendor-CtXGFqsu.js";import{f as i,t as a}from"./react-B9IgSVeK.js";import{t as o}from"./auth-welcome-screen-DCozLA-c.js";var s=a();function c(){let{t:a}=r(`onboarding`),c=i();return(0,s.jsx)(o,{secondary:{label:a(`welcome.continueWithoutAccount`),onSelect:()=>{t()?c(e.selectAssistant,n):c(e.onboarding.hosting,n)}}})}export{c as WelcomeScreen};
1
+ import{DS as e,Ex as t,ji as n}from"./app-DbJUeBix.js";import{E as r}from"./vendor-CtXGFqsu.js";import{f as i,t as a}from"./react-B9IgSVeK.js";import{t as o}from"./auth-welcome-screen-Bng5AnvV.js";var s=a();function c(){let{t:a}=r(`onboarding`),c=i();return(0,s.jsx)(o,{secondary:{label:a(`welcome.continueWithoutAccount`),onSelect:()=>{t()?c(e.selectAssistant,n):c(e.onboarding.hosting,n)}}})}export{c as WelcomeScreen};