@vellumai/web 0.12.2-staging.6 → 0.12.2-staging.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/dist/assets/{a2a-invite-BOdHy8O9.js → a2a-invite-K_LszpwN.js} +1 -1
  2. package/dist/assets/{about-page-COxmu2oQ.js → about-page-C2ZvX_F-.js} +1 -1
  3. package/dist/assets/{account-page-CYNbvuWs.js → account-page-e0PceRpg.js} +1 -1
  4. package/dist/assets/{account-shell-CbiWTAQP.js → account-shell-C6z7Vrdr.js} +1 -1
  5. package/dist/assets/{acp-run-detail-panel-B5vKfWQN.js → acp-run-detail-panel-B2O0UZTM.js} +3 -3
  6. package/dist/assets/activation-list-route-C5G8yEUf.js +1 -0
  7. package/dist/assets/{activity-redirect-page-BWj7yOid.js → activity-redirect-page-DE1iuEIc.js} +1 -1
  8. package/dist/assets/activity-steps-panel-DIclL9Tz.js +1 -0
  9. package/dist/assets/add-credits-modal-6gK5H4L1.js +1 -0
  10. package/dist/assets/{add-credits-modal-B0DI6Rs_.js → add-credits-modal-NTVA50Mb.js} +1 -1
  11. package/dist/assets/ai-page-BKChlGuu.js +1 -0
  12. package/dist/assets/android-billing-handoff-DzlmB2oT.js +1 -0
  13. package/dist/assets/{api-key-screen-fY9JjhTe.js → api-key-screen-PLpXk-Bj.js} +1 -1
  14. package/dist/assets/app-DKzyKjOQ.css +2 -0
  15. package/dist/assets/app-DVwAB8n7.js +392 -0
  16. package/dist/assets/{app-info-B8Mqmeak.js → app-info-reMTZ2pt.js} +1 -1
  17. package/dist/assets/{archive-redirect-page-De-Keegk.js → archive-redirect-page-Cr_Venij.js} +1 -1
  18. package/dist/assets/{assistant-status-panel-BALzwsAc.js → assistant-status-panel-CvQuUFvM.js} +1 -1
  19. package/dist/assets/auth-store-BKA7qeyc.js +1 -0
  20. package/dist/assets/{auth-welcome-screen-D2mxoZEG.js → auth-welcome-screen-B2tyrMPg.js} +1 -1
  21. package/dist/assets/avatar-bundled-components-CfJ4yCfG.js +1 -0
  22. package/dist/assets/avatar-random-Dpf2HGEt.js +2 -0
  23. package/dist/assets/{await-org-header-settled-CYxBtSPa.js → await-org-header-settled-B9PHlwR4.js} +1 -1
  24. package/dist/assets/{background-task-detail-panel-D4CYPLDN.js → background-task-detail-panel-GPr2jleb.js} +1 -1
  25. package/dist/assets/billing-page-Cryn2tS8.js +3 -0
  26. package/dist/assets/{billing-redirect-page-nGTPWHMN.js → billing-redirect-page-_M75fYSt.js} +1 -1
  27. package/dist/assets/{bookmarks-page-CGd4Okx8.js → bookmarks-page-DNY0ctx1.js} +1 -1
  28. package/dist/assets/{bundle-confirm-page-BuQ9wfYw.js → bundle-confirm-page-DH--yDFi.js} +1 -1
  29. package/dist/assets/channel-transcript-panel-DRxsCwgF.js +1 -0
  30. package/dist/assets/channels-page-route-5Wzd9sdm.js +1 -0
  31. package/dist/assets/{chat-k0ASlCf6.js → chat-CaPTWqrU.js} +2 -2
  32. package/dist/assets/{chat-8C19KXOV.js → chat-DDWpVL31.js} +2 -2
  33. package/dist/assets/chat-IAmPP3KS.js +3 -0
  34. package/dist/assets/chat-info-panel-jVdi1Ymk.js +1 -0
  35. package/dist/assets/{chat-BMyAegHU.js → chat-rQTkjE9-.js} +2 -2
  36. package/dist/assets/{checkout-continuation-ATko7N-k.js → checkout-continuation-B5Hqp0Qm.js} +1 -1
  37. package/dist/assets/{checkout-page-CVp2T6mP.js → checkout-page-CmxMePoe.js} +1 -1
  38. package/dist/assets/checkout-return-target-Tp8s053l.js +1 -0
  39. package/dist/assets/command-palette-B0GwCVSG.js +1 -0
  40. package/dist/assets/{command-palette-BuaJlwlj.js → command-palette-tg_jmCvj.js} +1 -1
  41. package/dist/assets/{command-palette-window-page-UeoQHE-2.js → command-palette-window-page-OdXwcHOe.js} +1 -1
  42. package/dist/assets/common-84oKDglL.js +1 -0
  43. package/dist/assets/common-Bd7JWmbm.js +1 -0
  44. package/dist/assets/common-Bvc-Ql-Q.js +1 -0
  45. package/dist/assets/common-W_BUmTCE.js +1 -0
  46. package/dist/assets/{community-page-rNFPZE2f.js → community-page-N7xnmLtP.js} +1 -1
  47. package/dist/assets/{companion-accent-C3xBrXHO.js → companion-accent-CC2T6DTD.js} +1 -1
  48. package/dist/assets/{companion-dock-zones-page-plFxxNVK.js → companion-dock-zones-page-BWRTUjFh.js} +1 -1
  49. package/dist/assets/{companion-layout-Cu_j-nKV.js → companion-layout-Ctf-oiUu.js} +1 -1
  50. package/dist/assets/{companion-popover-STvrRaku.js → companion-popover-CvuIHsxr.js} +1 -1
  51. package/dist/assets/{companion-popover-page-Dvft1iSc.js → companion-popover-page-COtTpxBf.js} +1 -1
  52. package/dist/assets/companion-surface-page-B4KKIFMX.js +1 -0
  53. package/dist/assets/{companion-watch-frame-page-DLTwthiI.js → companion-watch-frame-page-DdY-sEvj.js} +1 -1
  54. package/dist/assets/{connect-page-BtvEUJj6.js → connect-page-mviArXG0.js} +1 -1
  55. package/dist/assets/{consent-controls-CjyXQ2Ju.js → consent-controls-CGZ9hRD9.js} +1 -1
  56. package/dist/assets/contacts-gateway-D3D6BcYj.js +1 -0
  57. package/dist/assets/contacts-page-route-CnXN1b9Q.js +1 -0
  58. package/dist/assets/copy-button-BokGIgJY.js +1 -0
  59. package/dist/assets/{credential-entry-page-CvXfQZPl.js → credential-entry-page-BcOtgzDZ.js} +1 -1
  60. package/dist/assets/{credentials-page-DsxuB0Ui.js → credentials-page-C-5wNF1Z.js} +1 -1
  61. package/dist/assets/{csv-preview-TFV8b1Dq.js → csv-preview-BujPteS4.js} +1 -1
  62. package/dist/assets/{danger-zone-redirect-page-C23hsdDS.js → danger-zone-redirect-page-BD_UQW3d.js} +1 -1
  63. package/dist/assets/debug-page-DnMnJB9J.js +4 -0
  64. package/dist/assets/{deploy-dialogs-C0gFbHA2.js → deploy-dialogs-CveUjjv7.js} +1 -1
  65. package/dist/assets/deploy-dialogs-pR2YX6w3.js +1 -0
  66. package/dist/assets/desktop-preview-content-CtoOBBq1.js +2 -0
  67. package/dist/assets/{desktop-status-CPR10G_B.js → desktop-status-xKP11IwI.js} +1 -1
  68. package/dist/assets/{desktop-viewer-Cm09cFMg.js → desktop-viewer-0OAUh_Hn.js} +2 -2
  69. package/dist/assets/{detail-card-pT0agbKq.js → detail-card-CH7nCTwL.js} +1 -1
  70. package/dist/assets/{detail-panel-stop-button-DWoO-nJN.js → detail-panel-stop-button-CCMYv91a.js} +1 -1
  71. package/dist/assets/detail-primitives-BHSuCinp.js +1 -0
  72. package/dist/assets/developer-page-B0eQkOPk.js +1 -0
  73. package/dist/assets/{devices-redirect-page-Bxu6ZvQb.js → devices-redirect-page-76YGuivM.js} +1 -1
  74. package/dist/assets/{dictation-overlay-page-CG8S4p0x.js → dictation-overlay-page-CNKyNY4_.js} +1 -1
  75. package/dist/assets/document-load-Drr0n43P.js +1 -0
  76. package/dist/assets/{document-load-DShQChFM.js → document-load-ZTOhaes3.js} +1 -1
  77. package/dist/assets/document-viewer-page-C3QkSuJO.js +1 -0
  78. package/dist/assets/emails-page-BcIyo_vg.js +1 -0
  79. package/dist/assets/environment-store-2DxNubrI.js +1 -0
  80. package/dist/assets/esm-BQ7nByB7.js +2 -0
  81. package/dist/assets/esm-BQzpPH7j.js +2 -0
  82. package/dist/assets/{esm-BfMa-HX2.js → esm-Bd00Z0XS.js} +2 -2
  83. package/dist/assets/esm-C9U16T0B.js +2 -0
  84. package/dist/assets/esm-CIA53Y2C.js +1 -0
  85. package/dist/assets/{esm-BRap8C09.js → esm-CJc5XaQ-.js} +1 -1
  86. package/dist/assets/esm-Cw8fKFJk.js +2 -0
  87. package/dist/assets/{esm-C8i-Nf3-.js → esm-Ddi5QueG.js} +1 -1
  88. package/dist/assets/esm-Ijlkodih.js +2 -0
  89. package/dist/assets/esm-xXsIdL3G.js +1 -0
  90. package/dist/assets/{file-diff-view-CO2QJdSQ.js → file-diff-view-DrEc_ARh.js} +1 -1
  91. package/dist/assets/file-editor-Dm434b4v.js +1 -0
  92. package/dist/assets/general-page-Dg2tgz5k.js +2 -0
  93. package/dist/assets/hatching-screen-ZSoxM5tf.js +1 -0
  94. package/dist/assets/{hosting-screen-nVYKldkt.js → hosting-screen-BrJitjCp.js} +1 -1
  95. package/dist/assets/identity-page-route-DkzYAjGT.js +7 -0
  96. package/dist/assets/inspect-page-D_TZU3Hd.js +9 -0
  97. package/dist/assets/integrations-page-B3CDxIc7.js +1 -0
  98. package/dist/assets/intelligence-layout-De5u_8iO.js +1 -0
  99. package/dist/assets/intelligence-layout-slots-store-N3obF-c5.js +1 -0
  100. package/dist/assets/{keyboard-shortcuts-redirect-page-UFsztRh3.js → keyboard-shortcuts-redirect-page-P0KU4lAH.js} +1 -1
  101. package/dist/assets/{latest-assistant-text-CaZrfk6l.js → latest-assistant-text-B1LKWEQo.js} +1 -1
  102. package/dist/assets/library-detail-page-DZtYl2_5.js +1 -0
  103. package/dist/assets/{library-page-CK7LA8to.js → library-page-BMa93acf.js} +1 -1
  104. package/dist/assets/local-mode-BEXEOOD-.js +1 -0
  105. package/dist/assets/{login-page-Cw14hc03.js → login-page-D3ob1Kbr.js} +1 -1
  106. package/dist/assets/logout-page-Di8TrFPN.js +1 -0
  107. package/dist/assets/{logs-layout-BqrW_P--.js → logs-layout-_xsmgYT_.js} +1 -1
  108. package/dist/assets/markdown-preview-bFFtI7RX.js +1 -0
  109. package/dist/assets/{media-preview-DvdWd4rA.js → media-preview-NpZgZ2UX.js} +1 -1
  110. package/dist/assets/{memory-page-route-B98b_k6V.js → memory-page-route-FjsBP3DB.js} +2 -2
  111. package/dist/assets/{memory-router-playground-page-BmST7_Kw.js → memory-router-playground-page-BB2ac5OC.js} +1 -1
  112. package/dist/assets/{message-files-panel-B4KcGaTu.js → message-files-panel-DHpvQ5fY.js} +1 -1
  113. package/dist/assets/{metric-card-BLErTI6M.js → metric-card-BPzasLzN.js} +1 -1
  114. package/dist/assets/native-attachment-pickers-CpYVjv9a.js +1 -0
  115. package/dist/assets/native-file-Dsfi4Mv0.js +1 -0
  116. package/dist/assets/{notifications-page-wjJIxJdC.js → notifications-page-DPIJPx5l.js} +1 -1
  117. package/dist/assets/{oauth-complete-page-DMvGhbPg.js → oauth-complete-page-BOf0k715.js} +1 -1
  118. package/dist/assets/{oauth-popup-complete-page-BjtYXKTi.js → oauth-popup-complete-page-Coq4E2NT.js} +1 -1
  119. package/dist/assets/paired-platform-identity-Dcv6Ntac.js +1 -0
  120. package/dist/assets/{pairing-page-BfrUX_YA.js → pairing-page-vg713Xyw.js} +1 -1
  121. package/dist/assets/password-reset-page-B3_GA-20.js +1 -0
  122. package/dist/assets/{pdf-file-preview-Cv30v3e_.js → pdf-file-preview-KeniHhVt.js} +1 -1
  123. package/dist/assets/{peeking-eyes-DJkKQl-G.js → peeking-eyes-CKdOXnSg.js} +1 -1
  124. package/dist/assets/{personality-page-CUwdmzId.js → personality-page-DKqJb-lv.js} +1 -1
  125. package/dist/assets/{personality-page-D03UdQms.js → personality-page-IzKy17q_.js} +1 -1
  126. package/dist/assets/{personality-sliders-BZ5p3Svp.js → personality-sliders-9gPglDwE.js} +1 -1
  127. package/dist/assets/plans-page-Db7a4r_j.js +1 -0
  128. package/dist/assets/{platform-loopback-page-C3a-am1y.js → platform-loopback-page-CQdKbXKL.js} +1 -1
  129. package/dist/assets/{plugin-detail-page-D52frrTx.js → plugin-detail-page-DmBHeQHu.js} +1 -1
  130. package/dist/assets/{plugins-page-RrhNT7og.js → plugins-page-Bif90SI6.js} +1 -1
  131. package/dist/assets/plugins-surface-BxUa-wvt.js +1 -0
  132. package/dist/assets/{preview-error-BlHGLqgj.js → preview-error-Cg-tO0Wq.js} +1 -1
  133. package/dist/assets/privacy-page-BZEfySAp.js +1 -0
  134. package/dist/assets/{privacy-screen-Bkjr2dIv.js → privacy-screen-D5GLfoae.js} +1 -1
  135. package/dist/assets/{provider-callback-page-DGAy5DvE.js → provider-callback-page-CuFRpWdm.js} +1 -1
  136. package/dist/assets/{provider-key-CHOBBf9E.js → provider-key-m64urt9F.js} +1 -1
  137. package/dist/assets/{provider-signup-page-BG1mhVYr.js → provider-signup-page-B2Z1mPXg.js} +1 -1
  138. package/dist/assets/{provisioning-targets-B5flnyHy.js → provisioning-targets-sLxTAFYS.js} +1 -1
  139. package/dist/assets/{quick-input-page-CCDzeBSI.js → quick-input-page-Dnrp-_VP.js} +1 -1
  140. package/dist/assets/referral-modal-DO65gxwh.js +1 -0
  141. package/dist/assets/referral-modal-DOb0dvou.js +1 -0
  142. package/dist/assets/{rehype-katex-Bp74Wkmo.js → rehype-katex-BS9QC2Z6.js} +1 -1
  143. package/dist/assets/{research-mock-page-CHfDwifi.js → research-mock-page-fY6l0nIr.js} +1 -1
  144. package/dist/assets/research-onboarding-route-BKQuNKPZ.js +50 -0
  145. package/dist/assets/{review-terms-screen-C2vdbHvu.js → review-terms-screen-BsYKQ0lM.js} +1 -1
  146. package/dist/assets/routes-BpedycpL.js +1 -0
  147. package/dist/assets/{schedules-AMG6VEfS.js → schedules-CLZyrSz5.js} +1 -1
  148. package/dist/assets/schedules-page-Cma0_6MM.js +1 -0
  149. package/dist/assets/{security-redirect-page-C8sxzPnV.js → security-redirect-page-CJWekLgN.js} +1 -1
  150. package/dist/assets/select-assistant-screen-BXsiUnpH.js +1 -0
  151. package/dist/assets/{self-hosted-servers-CsZVedz3.js → self-hosted-servers-C8mQpYG6.js} +1 -1
  152. package/dist/assets/{service-form-controls-DTfO4j3O.js → service-form-controls-BaN3WJ77.js} +1 -1
  153. package/dist/assets/{setting-row-B9yebbEq.js → setting-row-C5HG2She.js} +1 -1
  154. package/dist/assets/{settings-C-QPO0as.js → settings-Bc3yDJDa.js} +1 -1
  155. package/dist/assets/{settings-D9OIWncF.js → settings-BoNVVpiz.js} +1 -1
  156. package/dist/assets/settings-DI5uzcZ7.js +3 -0
  157. package/dist/assets/settings-Jd2dLYIY.js +3 -0
  158. package/dist/assets/{settings-divider-BkQcvD1N.js → settings-divider-BUvXsYUP.js} +1 -1
  159. package/dist/assets/settings-layout-eaFhHddb.js +1 -0
  160. package/dist/assets/share-feedback-modal-BHI_Kl78.js +1 -0
  161. package/dist/assets/share-feedback-modal-DudAfY4T.js +2 -0
  162. package/dist/assets/{sidebar-tree-C-XVAOgc.js → sidebar-tree-CbUtC4FM.js} +1 -1
  163. package/dist/assets/{signup-page-DdiJpBz3.js → signup-page-Vgdjl9WE.js} +1 -1
  164. package/dist/assets/{signup-shell-_mEn5UNl.js → signup-shell-BLEdn8FZ.js} +1 -1
  165. package/dist/assets/{skill-detail-page-bMQCOgEU.js → skill-detail-page-o9Zz9AGe.js} +2 -2
  166. package/dist/assets/skill-detail-panel-CipMYJDL.js +1 -0
  167. package/dist/assets/{skill-removal-dialog-CWQDV20Q.js → skill-removal-dialog-D0oZz4CN.js} +1 -1
  168. package/dist/assets/{skills-page-CkHlkDe4.js → skills-page-EbwJm4TW.js} +1 -1
  169. package/dist/assets/{sounds-page-DZ9H_Uhf.js → sounds-page-Dwy-_g4j.js} +1 -1
  170. package/dist/assets/{start-screen-CPuK_kcL.js → start-screen-XRBqWzDl.js} +1 -1
  171. package/dist/assets/{stt-language-picker-modal-vTox8Zp8.js → stt-language-picker-modal-B-sdjfM-.js} +1 -1
  172. package/dist/assets/subagent-detail-panel-t1cMMnPg.js +1 -0
  173. package/dist/assets/superpowers-page-C890W40w.js +1 -0
  174. package/dist/assets/{system-events-page-CxJryFCX.js → system-events-page-BkzUESQ7.js} +1 -1
  175. package/dist/assets/{system-events-redirect-page-CORiS4Xr.js → system-events-redirect-page-BEsc07gc.js} +1 -1
  176. package/dist/assets/{text-preview-BZ7GgUAU.js → text-preview-DZXMfpbF.js} +1 -1
  177. package/dist/assets/{theme-stage-page-BBUhsE2D.js → theme-stage-page-C-tAdsOO.js} +1 -1
  178. package/dist/assets/{tiptap-document-editor-DR6f403A.js → tiptap-document-editor-DKMoKoh8.js} +1 -1
  179. package/dist/assets/tool-detail-panel-42l_9PIi.js +15 -0
  180. package/dist/assets/tool-detail-panel-DPUg7OdL.js +1 -0
  181. package/dist/assets/{trait-cycle-row-BRsd1qDW.js → trait-cycle-row-CEjLtk4k.js} +1 -1
  182. package/dist/assets/{upgrade-cancel-page-Cb2Knf6m.js → upgrade-cancel-page-DiBBCbGz.js} +1 -1
  183. package/dist/assets/{upgrade-success-page-5FOrQc3B.js → upgrade-success-page-vRKNt1oK.js} +1 -1
  184. package/dist/assets/{usage-redirect-page-DmacFGtX.js → usage-redirect-page-Townvqx7.js} +1 -1
  185. package/dist/assets/use-app-delete--tLzs8qO.js +1 -0
  186. package/dist/assets/use-assistant-identity-details-DbPNLHHf.js +1 -0
  187. package/dist/assets/use-checkout-dismiss-refresh-R9LDgMHM.js +1 -0
  188. package/dist/assets/use-debounced-value-DF3v-L7L.js +1 -0
  189. package/dist/assets/{use-edge-swipe-back-DMaMp9xI.js → use-edge-swipe-back-DfMnwl0d.js} +1 -1
  190. package/dist/assets/{use-hotkey-recorder-CVYKioKK.js → use-hotkey-recorder-D_1QmHir.js} +1 -1
  191. package/dist/assets/use-invite-link-dialog-B5zQpepB.js +1 -0
  192. package/dist/assets/{use-platform-assistant-id-CPNM_Svc.js → use-platform-assistant-id-C38cqSx8.js} +1 -1
  193. package/dist/assets/use-return-to-short-circuit-uUCP2mmo.js +1 -0
  194. package/dist/assets/{use-side-list-room-XknEC6_F.js → use-side-list-room-DzKpL0NC.js} +1 -1
  195. package/dist/assets/{use-skill-actions-B7qsFEjO.js → use-skill-actions-CKqj7Lex.js} +1 -1
  196. package/dist/assets/{use-skill-detail-files-Caa0kAOC.js → use-skill-detail-files-B2V57QXl.js} +1 -1
  197. package/dist/assets/use-supports-credentials-settings-QqPznGxI.js +1 -0
  198. package/dist/assets/use-transcript-message-by-id-vZ9vFhLM.js +1 -0
  199. package/dist/assets/{vendor-DYOeoIwg.js → vendor-Bb38ZAP8.js} +2 -2
  200. package/dist/assets/voice-page-8O_m2iz4.js +1 -0
  201. package/dist/assets/{wake-detail-panel-JG7TyKGn.js → wake-detail-panel-BGhS36s_.js} +1 -1
  202. package/dist/assets/{weather-forecast-display-CZYQX4n1.js → weather-forecast-display-I9ZtiVK8.js} +1 -1
  203. package/dist/assets/{web-ZV0_2EZ9.js → web-41u0plob.js} +1 -1
  204. package/dist/assets/{web-Bb3bM_rE.js → web-BX2ShQf7.js} +1 -1
  205. package/dist/assets/{web-B_ZkQa17.js → web-BtCscj_5.js} +1 -1
  206. package/dist/assets/{web-CQyztjRg.js → web-Cn4ht-7M.js} +1 -1
  207. package/dist/assets/{web-ocPGQzbv.js → web-CoanRUCz.js} +1 -1
  208. package/dist/assets/{web-DpFmNxr1.js → web-D2gsz8Ak.js} +1 -1
  209. package/dist/assets/{web-7w3Y8MVH.js → web-DaV6ODqC.js} +1 -1
  210. package/dist/assets/{web-CkN0uo01.js → web-DfaIhdEx.js} +1 -1
  211. package/dist/assets/{web-DZd0e2iR.js → web-Du0h1dfg.js} +1 -1
  212. package/dist/assets/welcome-screen-Byi-1I4U.js +1 -0
  213. package/dist/assets/workflow-detail-panel-CCE4QmaM.js +1 -0
  214. package/dist/assets/workspace-B4454wwE.js +1 -0
  215. package/dist/assets/{workspace-DOerIby3.js → workspace-CeqSeJWC.js} +1 -1
  216. package/dist/assets/workspace-D1tA-3bz.js +1 -0
  217. package/dist/assets/workspace-PUZSBWH4.js +1 -0
  218. package/dist/assets/workspace-page-BWfU9wct.js +1 -0
  219. package/dist/index.html +3 -3
  220. package/package.json +1 -1
  221. package/dist/assets/activation-list-route-BOb-rtBa.js +0 -1
  222. package/dist/assets/activity-steps-panel-DmC1H7g8.js +0 -1
  223. package/dist/assets/add-credits-modal-Clg9vuy6.js +0 -1
  224. package/dist/assets/ai-page-CUKc_nmb.js +0 -1
  225. package/dist/assets/android-billing-handoff-CpzR7JDr.js +0 -1
  226. package/dist/assets/app-BNL3dwNm.css +0 -2
  227. package/dist/assets/app-Tg6YU_tZ.js +0 -392
  228. package/dist/assets/auth-store-D-6LI7o_.js +0 -1
  229. package/dist/assets/avatar-bundled-components-Bo-wVBBE.js +0 -1
  230. package/dist/assets/avatar-random-ZUs-wFAP.js +0 -2
  231. package/dist/assets/billing-page-CqDMGSHe.js +0 -3
  232. package/dist/assets/channel-transcript-panel-Ca2IqSxd.js +0 -1
  233. package/dist/assets/channels-page-route-BrkM9cD0.js +0 -1
  234. package/dist/assets/chat-B8bCjQZ1.js +0 -3
  235. package/dist/assets/chat-info-panel-CFHg5G5C.js +0 -1
  236. package/dist/assets/checkout-return-target-BM6j8E5w.js +0 -1
  237. package/dist/assets/command-palette-DkTYuZU8.js +0 -1
  238. package/dist/assets/common-Bj2G8_g5.js +0 -1
  239. package/dist/assets/common-CaTw6iFT.js +0 -1
  240. package/dist/assets/common-DvY3wB2D.js +0 -1
  241. package/dist/assets/common-HddDknEB.js +0 -1
  242. package/dist/assets/companion-surface-page-DHxOTQOL.js +0 -1
  243. package/dist/assets/contacts-gateway-CZ3fJfK5.js +0 -1
  244. package/dist/assets/contacts-page-route-CNXEHOrf.js +0 -1
  245. package/dist/assets/debug-page-6PKrAjce.js +0 -4
  246. package/dist/assets/deploy-dialogs-BXYdSkVL.js +0 -1
  247. package/dist/assets/desktop-preview-content-Cc9hlQ4Q.js +0 -2
  248. package/dist/assets/detail-primitives-ue4wzzCx.js +0 -1
  249. package/dist/assets/developer-page-DcZbWcLH.js +0 -1
  250. package/dist/assets/document-load-B8iTfjYL.js +0 -1
  251. package/dist/assets/document-viewer-page-BStfu3jJ.js +0 -1
  252. package/dist/assets/emails-page-BlP1KP70.js +0 -1
  253. package/dist/assets/environment-store-rH-YdiqT.js +0 -1
  254. package/dist/assets/esm-BarLUlPV.js +0 -2
  255. package/dist/assets/esm-C19uvbek.js +0 -2
  256. package/dist/assets/esm-CI79f_VT.js +0 -2
  257. package/dist/assets/esm-CtAM062C.js +0 -1
  258. package/dist/assets/esm-DGqMBGum.js +0 -1
  259. package/dist/assets/esm-DYrMpsGJ.js +0 -2
  260. package/dist/assets/esm-Y7e1KRCK.js +0 -2
  261. package/dist/assets/file-editor-EZsnOrB1.js +0 -1
  262. package/dist/assets/general-page-DjmqGNEh.js +0 -2
  263. package/dist/assets/hatching-screen-Vx631ARz.js +0 -1
  264. package/dist/assets/identity-page-route-B4R5hI3l.js +0 -7
  265. package/dist/assets/inspect-page-CYYIbGHx.js +0 -9
  266. package/dist/assets/integrations-page-BjXxWGKz.js +0 -1
  267. package/dist/assets/intelligence-layout-BUGM35jP.js +0 -1
  268. package/dist/assets/intelligence-layout-slots-store-nrEU1pdD.js +0 -1
  269. package/dist/assets/library-detail-page-BcqVyl-x.js +0 -1
  270. package/dist/assets/local-mode-B63ogN2h.js +0 -1
  271. package/dist/assets/logout-page-DpNGL-t4.js +0 -1
  272. package/dist/assets/markdown-preview-DsAfiAyB.js +0 -1
  273. package/dist/assets/native-attachment-pickers-DXW2YF-J.js +0 -1
  274. package/dist/assets/native-file-DIYnpRix.js +0 -1
  275. package/dist/assets/paired-platform-identity-DyA-oZ1a.js +0 -1
  276. package/dist/assets/password-reset-page-DyCdaLlT.js +0 -1
  277. package/dist/assets/plans-page-Bt7rWPBi.js +0 -1
  278. package/dist/assets/plugins-surface-f4dAI31U.js +0 -1
  279. package/dist/assets/privacy-page-CKEUMx1C.js +0 -1
  280. package/dist/assets/referral-modal-BTG7IbD5.js +0 -1
  281. package/dist/assets/referral-modal-BWGbrPeD.js +0 -1
  282. package/dist/assets/research-onboarding-route-DvnsATHR.js +0 -50
  283. package/dist/assets/routes-64wTPHX3.js +0 -1
  284. package/dist/assets/schedules-page-DQ0p71wD.js +0 -1
  285. package/dist/assets/select-assistant-screen-B57uDK4U.js +0 -1
  286. package/dist/assets/settings-DGQfZ51D.js +0 -3
  287. package/dist/assets/settings-gxBTr-j9.js +0 -3
  288. package/dist/assets/settings-layout-D6972VFH.js +0 -1
  289. package/dist/assets/share-feedback-modal-CYWA8ArT.js +0 -1
  290. package/dist/assets/share-feedback-modal-DwmVNIDD.js +0 -2
  291. package/dist/assets/skill-detail-panel-jkm8mNzk.js +0 -1
  292. package/dist/assets/subagent-detail-panel-p9ahsacR.js +0 -1
  293. package/dist/assets/superpowers-page-BiVUrsDa.js +0 -1
  294. package/dist/assets/tool-detail-panel-Bia85tXo.js +0 -15
  295. package/dist/assets/tool-detail-panel-CEtClwDC.js +0 -1
  296. package/dist/assets/use-app-delete-C6E5CTp4.js +0 -1
  297. package/dist/assets/use-assistant-identity-details-BqNoC_Po.js +0 -1
  298. package/dist/assets/use-checkout-dismiss-refresh-DFYkYYpp.js +0 -1
  299. package/dist/assets/use-invite-link-dialog-ChgRhNyN.js +0 -1
  300. package/dist/assets/use-return-to-short-circuit-dsa2YMci.js +0 -1
  301. package/dist/assets/use-supports-credentials-settings-CxEHVJ-e.js +0 -1
  302. package/dist/assets/use-transcript-message-by-id-Bnbe06RA.js +0 -1
  303. package/dist/assets/voice-page-D237ka3h.js +0 -1
  304. package/dist/assets/welcome-screen-CQo-_cIi.js +0 -1
  305. package/dist/assets/workflow-detail-panel-rYCgZeUb.js +0 -1
  306. package/dist/assets/workspace-CrT6IjXz.js +0 -1
  307. package/dist/assets/workspace-D-j7Q1o1.js +0 -1
  308. package/dist/assets/workspace-Db-P5zkL.js +0 -1
  309. package/dist/assets/workspace-page-Bx0l3azH.js +0 -1
  310. /package/dist/assets/{account-n9xXc949.js → account-CmPU5JUK.js} +0 -0
  311. /package/dist/assets/{account-DV-tB0oh.js → account-D_kQgEd7.js} +0 -0
  312. /package/dist/assets/{account-BBvlSFcW.js → account-DzYvyyF-.js} +0 -0
  313. /package/dist/assets/{account-1POZPT9m.js → account-Dz_iEfvV.js} +0 -0
  314. /package/dist/assets/{activation-BtZhlZ_s.js → activation-BRxQYbI8.js} +0 -0
  315. /package/dist/assets/{activation-CaYos65l.js → activation-BaZMLD3R.js} +0 -0
  316. /package/dist/assets/{activation-B2g-Oe-r.js → activation-BtusZYzQ.js} +0 -0
  317. /package/dist/assets/{activation-dc_gRGWQ.js → activation-DbiSlIjg.js} +0 -0
  318. /package/dist/assets/{activation-tasks-CzjUeEj1.js → activation-tasks-BdYlW_us.js} +0 -0
  319. /package/dist/assets/{activation-tasks-D057dozu.js → activation-tasks-DQf05sGO.js} +0 -0
  320. /package/dist/assets/{activation-tasks-C5NV7wu7.js → activation-tasks-YiuCfTtp.js} +0 -0
  321. /package/dist/assets/{activation-tasks-CvYLTc0s.js → activation-tasks-bRtYLLFo.js} +0 -0
  322. /package/dist/assets/{app-types-2kvircdH.js → app-types-CjoGEGYN.js} +0 -0
  323. /package/dist/assets/{build.umd-BWfbInTw.js → build.umd-D1DxkJZ3.js} +0 -0
  324. /package/dist/assets/{channels-BnJWh26Z.js → channels-4CR6ZJMQ.js} +0 -0
  325. /package/dist/assets/{channels-itxMVi8q.js → channels-B2rZPdSw.js} +0 -0
  326. /package/dist/assets/{channels-QZtdATsC.js → channels-BOKJeCXb.js} +0 -0
  327. /package/dist/assets/{channels-LgPH3TQp.js → channels-DOLXdJkc.js} +0 -0
  328. /package/dist/assets/{contacts-D6N3gRLL.js → contacts-BBLvI5Uj.js} +0 -0
  329. /package/dist/assets/{contacts-yIhQlpq2.js → contacts-BbBOEeer.js} +0 -0
  330. /package/dist/assets/{contacts-X4REeAsN.js → contacts-C0C_BJUk.js} +0 -0
  331. /package/dist/assets/{contacts-DP3Crat5.js → contacts-DpvUSU_B.js} +0 -0
  332. /package/dist/assets/{credential-requests-DKbR-6qV.js → credential-requests-BA09bqb0.js} +0 -0
  333. /package/dist/assets/{credential-requests-1WDcifE6.js → credential-requests-C0i6NSn6.js} +0 -0
  334. /package/dist/assets/{credential-requests-DrJdsdeJ.js → credential-requests-DvWfZlaG.js} +0 -0
  335. /package/dist/assets/{credential-requests-D6SU6G2Z.js → credential-requests-S4K-P7h7.js} +0 -0
  336. /package/dist/assets/{definitions-DhwHuMC5.js → definitions-B_hI7hUU.js} +0 -0
  337. /package/dist/assets/{definitions-Qg1-j0J7.js → definitions-yE7PUCf5.js} +0 -0
  338. /package/dist/assets/{emoji-catalog-data-Yyjk_IDu.js → emoji-catalog-data-DMFEL5YE.js} +0 -0
  339. /package/dist/assets/{format-countdown-BEyU91h0.js → format-countdown-BwaE898Q.js} +0 -0
  340. /package/dist/assets/{home-CQRYKQ5-.js → home-BKXSP2ga.js} +0 -0
  341. /package/dist/assets/{home-jvtY7w4T.js → home-BajVD9Qe.js} +0 -0
  342. /package/dist/assets/{home-DQz-gw5J.js → home-BiZNhI7w.js} +0 -0
  343. /package/dist/assets/{home-uZ5Qvj6E.js → home-CQ09sKqx.js} +0 -0
  344. /package/dist/assets/{intelligence-C2fySq4l.js → intelligence-BaO9LsAs.js} +0 -0
  345. /package/dist/assets/{intelligence-DFMbHITq.js → intelligence-CDSWEGS8.js} +0 -0
  346. /package/dist/assets/{intelligence-8J0ZD9Ph.js → intelligence-CIXn9-lA.js} +0 -0
  347. /package/dist/assets/{intelligence-dNqws_vC.js → intelligence-lNYsQVZz.js} +0 -0
  348. /package/dist/assets/{library-BXLScXI1.js → library-B2Pzmtjc.js} +0 -0
  349. /package/dist/assets/{library-IMXA70AZ.js → library-Bjt3XhDx.js} +0 -0
  350. /package/dist/assets/{library-D7tisF9R.js → library-C0kiQgQ3.js} +0 -0
  351. /package/dist/assets/{library-gTJv7Oz7.js → library-D6O09spl.js} +0 -0
  352. /package/dist/assets/{link-click-BYgcUBN3.js → link-click-v-LNbHFB.js} +0 -0
  353. /package/dist/assets/{logs-ji3E1A5W.js → logs-BzQGcqNO.js} +0 -0
  354. /package/dist/assets/{logs-gUmqmCAe.js → logs-C95Xf28N.js} +0 -0
  355. /package/dist/assets/{logs-itULWBC4.js → logs-bmXePsd8.js} +0 -0
  356. /package/dist/assets/{logs-DV_rbeyU.js → logs-eIJmFRmK.js} +0 -0
  357. /package/dist/assets/{machine-sizes-Cyr9sICv.js → machine-sizes-CrcROrDy.js} +0 -0
  358. /package/dist/assets/{onboarding-C9uVVsD1.js → onboarding--Wy4m10C.js} +0 -0
  359. /package/dist/assets/{onboarding-4AB8OdqK.js → onboarding-CS6Mi_F1.js} +0 -0
  360. /package/dist/assets/{onboarding-Bv6Vw7rT.js → onboarding-D69I4hvD.js} +0 -0
  361. /package/dist/assets/{onboarding-CFxxcqra.js → onboarding-f5n3lMje.js} +0 -0
  362. /package/dist/assets/{onboarding-step-layout-XiwLE8P3.js → onboarding-step-layout-ChzVnOKw.js} +0 -0
  363. /package/dist/assets/{pdf-DZqed7HH.js → pdf-CujX6bxw.js} +0 -0
  364. /package/dist/assets/{plugin-attribution-B2jD5Q1N.js → plugin-attribution-D1IJgqV1.js} +0 -0
  365. /package/dist/assets/{radio-card-nav-BtZq6gZp.js → radio-card-nav-3U2u720-.js} +0 -0
  366. /package/dist/assets/{remote-web-Cy9y7nTE.js → remote-web-C7EUNITU.js} +0 -0
  367. /package/dist/assets/{remote-web-BClKYDvU.js → remote-web-CWtk0LM4.js} +0 -0
  368. /package/dist/assets/{remote-web-BqE5HtVx.js → remote-web-DpKl3oDz.js} +0 -0
  369. /package/dist/assets/{remote-web-BTqxQIZY.js → remote-web-NA9EGY-O.js} +0 -0
  370. /package/dist/assets/{schedules-Capmqn71.js → schedules-BCIm7ddC.js} +0 -0
  371. /package/dist/assets/{schedules-DDJ36QQM.js → schedules-DQxwwm_W.js} +0 -0
  372. /package/dist/assets/{schedules-DO26F1mH.js → schedules-Dkqr0Dxl.js} +0 -0
  373. /package/dist/assets/{schedules-BZCt6hXe.js → schedules-Domzk98q.js} +0 -0
  374. /package/dist/assets/{skill-icon-DLqnaRMf.js → skill-icon-B7ALU8Ca.js} +0 -0
  375. /package/dist/assets/{terminal-1uiH9Lk0.js → terminal-BWP7MJfi.js} +0 -0
  376. /package/dist/assets/{terminal-DHtM2WSE.js → terminal-c5W6MjVz.js} +0 -0
  377. /package/dist/assets/{terminal-CWSI_cvE.js → terminal-fRZqMWcv.js} +0 -0
  378. /package/dist/assets/{terminal-BKHabeoN.js → terminal-rCr_x_K0.js} +0 -0
  379. /package/dist/assets/{usage-window-DA_JAjjs.js → usage-window-nB8J9zGt.js} +0 -0
  380. /package/dist/assets/{use-truncated-blob-text-BArL-keL.js → use-truncated-blob-text-BnZS-VRC.js} +0 -0
  381. /package/dist/assets/{xterm-DuUTQzS6.js → xterm-Cf-2wol9.js} +0 -0
  382. /package/dist/assets/{xterm-addon-fit-DuSb5pvT.js → xterm-addon-fit-BdGbxecv.js} +0 -0
@@ -1 +1 @@
1
- import{Hx as e,qx as t}from"./app-Tg6YU_tZ.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({id:n,title:i,subtitle:a,accessory:o,compactAccessory:s=!1,children:c,showBorder:l=!0,variant:u=`default`,className:d}){let f=!!(i||a||o),p=(0,r.jsxs)(r.Fragment,{children:[f&&(0,r.jsxs)(`div`,{className:s?`flex flex-row items-start justify-between gap-4`:`flex flex-col items-start gap-3 md:flex-row md:items-start md:justify-between md:gap-4`,children:[(0,r.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[i&&(0,r.jsx)(`h2`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:i}),a&&(0,r.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:a})]}),o&&(0,r.jsx)(`div`,{className:`shrink-0`,children:o})]}),c!=null&&(0,r.jsx)(`div`,{className:f?`mt-4`:``,children:c})]});return l?(0,r.jsx)(e,{asChild:!0,className:t(u===`danger`&&`border-[var(--system-negative-weak)] bg-[var(--surface-lift)]`,d),children:(0,r.jsx)(`section`,{id:n,children:p})}):(0,r.jsx)(`section`,{id:n,className:t(`space-y-4`,d),children:p})}export{i as t};
1
+ import{Hx as e,qx as t}from"./app-DVwAB8n7.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({id:n,title:i,subtitle:a,accessory:o,compactAccessory:s=!1,children:c,showBorder:l=!0,variant:u=`default`,className:d}){let f=!!(i||a||o),p=(0,r.jsxs)(r.Fragment,{children:[f&&(0,r.jsxs)(`div`,{className:s?`flex flex-row items-start justify-between gap-4`:`flex flex-col items-start gap-3 md:flex-row md:items-start md:justify-between md:gap-4`,children:[(0,r.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[i&&(0,r.jsx)(`h2`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:i}),a&&(0,r.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:a})]}),o&&(0,r.jsx)(`div`,{className:`shrink-0`,children:o})]}),c!=null&&(0,r.jsx)(`div`,{className:f?`mt-4`:``,children:c})]});return l?(0,r.jsx)(e,{asChild:!0,className:t(u===`danger`&&`border-[var(--system-negative-weak)] bg-[var(--surface-lift)]`,d),children:(0,r.jsx)(`section`,{id:n,children:p})}):(0,r.jsx)(`section`,{id:n,className:t(`space-y-4`,d),children:p})}export{i as t};
@@ -1 +1 @@
1
- import{Wx as e}from"./app-Tg6YU_tZ.js";import{j as t}from"./vendor-DYOeoIwg.js";import{t as n}from"./react-B9IgSVeK.js";import{W as r}from"./icons-QG1KAFmx.js";var i=n();function a({onStop:n,ariaLabel:a,disabled:o}){let{t:s}=t();return(0,i.jsx)(e,{variant:`dangerOutline`,iconOnly:(0,i.jsx)(r,{}),"aria-label":a,tooltip:s(`detailPanelStopButton.tooltip`),onClick:n,disabled:o,className:`shrink-0 hover:border-[var(--system-negative-strong)] hover:bg-[var(--system-negative-weak)] hover:[--vbtn-fg:var(--system-negative-strong)]`})}export{a as t};
1
+ import{Wx as e}from"./app-DVwAB8n7.js";import{j as t}from"./vendor-Bb38ZAP8.js";import{t as n}from"./react-B9IgSVeK.js";import{W as r}from"./icons-QG1KAFmx.js";var i=n();function a({onStop:n,ariaLabel:a,disabled:o}){let{t:s}=t();return(0,i.jsx)(e,{variant:`dangerOutline`,iconOnly:(0,i.jsx)(r,{}),"aria-label":a,tooltip:s(`detailPanelStopButton.tooltip`),onClick:n,disabled:o,className:`shrink-0 hover:border-[var(--system-negative-strong)] hover:bg-[var(--system-negative-weak)] hover:[--vbtn-fg:var(--system-negative-strong)]`})}export{a as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ux as t,Wa as n}from"./app-DVwAB8n7.js";import{j as r}from"./vendor-Bb38ZAP8.js";import{t as i,x as a}from"./react-B9IgSVeK.js";import{t as o}from"./copy-button-BokGIgJY.js";var s=e(a(),1),c=i(),l=700,u=260;function d({length:e,children:n}){let{t:i}=r(),[a,o]=(0,s.useState)(!1),d=e>l,f=d&&!a;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`div`,{className:`relative overflow-hidden`,style:f?{maxHeight:u}:void 0,children:[n,f&&(0,c.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-[var(--surface-overlay)] to-transparent`})]}),d&&(0,c.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`mt-2 w-full border-t border-[var(--border-base)] pt-2 text-left`,children:(0,c.jsx)(t,{variant:`body-medium-default`,as:`span`,className:`text-[var(--content-default)]`,children:i(a?`detailPrimitives.showLess`:`detailPrimitives.showMore`)})})]})}var f={outlined:`rounded-lg border border-[var(--border-base)]`,filled:`rounded-xl`};function p({variant:e=`outlined`,length:t,copyText:i,children:a}){let{t:s}=r(),l=i!==void 0;return(0,c.jsxs)(`div`,{className:n(`relative bg-[var(--surface-overlay)] p-3`,f[e],l&&`pr-10 touch-mobile:min-h-14 touch-mobile:pr-14`),children:[(0,c.jsx)(d,{length:t,children:a}),l&&(0,c.jsx)(o,{text:i,ariaLabel:s(`detailPrimitives.copy`),className:`absolute right-2 top-2`})]})}function m({text:e,tone:t=`default`}){return(0,c.jsx)(p,{length:e.length,copyText:e,children:(0,c.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap break-words ${t===`error`?`text-[var(--system-negative-strong)]`:`text-[var(--content-default)]`}`,children:e})})}function h({children:e,className:n=`mb-2`}){return(0,c.jsx)(t,{variant:`label-small-default`,as:`div`,className:`uppercase leading-4 tracking-wider text-[var(--content-tertiary)] ${n}`,children:e})}export{p as n,h as r,m as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Cx as t,Dd as n,Eb as r,Fb as i,Hf as a,Jh as o,Kh as s,Lx as c,Mg as l,Ng as u,Nx as d,Oh as f,Pg as p,Qy as m,Td as h,Tg as g,Wx as _,Xf as v,Zf as y,ad as b,et as x,jg as S,kx as C,ky as ee,mx as w,of as T,pl as E,qx as D,rl as O,sf as te,wx as k,xm as A}from"./app-DVwAB8n7.js";import{Zn as j,dr as M,er as N,j as P,pr as ne,ur as re}from"./vendor-Bb38ZAP8.js";import{_ as ie,r as ae,t as oe,x as se}from"./react-B9IgSVeK.js";import{A as ce,Ai as le,E as F,Nr as I,_t as L,fa as R,qn as z,ur as B}from"./icons-QG1KAFmx.js";import{t as V}from"./detail-card-CH7nCTwL.js";import{t as H}from"./environment-store-2DxNubrI.js";import{n as U}from"./assistant-status-panel-CvQuUFvM.js";var W=e(se(),1),G=oe();function ue({memoryEnabled:e,retrospectiveEnabled:t}){let{t:r}=P(`settings`),o=x(),s=N(),c=a({onSuccess:e=>{n(s,{path:{assistant_id:o}},e)}}),l=async e=>{try{await c.mutateAsync({path:{assistant_id:o},body:{memory:{retrospective:{enabled:e}}}}),k.success(r(e?`memoryRetrospectiveToggle.toastEnabled`:`memoryRetrospectiveToggle.toastPaused`))}catch(e){i(e,{context:`settings-memory-retrospective-toggle`}),k.error(r(`memoryRetrospectiveToggle.toastFailed`))}};return(0,G.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4 border-t border-[var(--border-subtle)] pt-4`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,G.jsx)(`h3`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:r(`memoryRetrospectiveToggle.title`)}),(0,G.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:r(`memoryRetrospectiveToggle.description`)})]}),(0,G.jsx)(d,{checked:t,onChange:e=>void l(e),"aria-label":r(`memoryRetrospectiveToggle.ariaLabel`),disabled:!e||c.isPending})]})}function de({memoryEnabled:e}){let{t}=P(`settings`),n=x(),r=N(),{data:a}=j({...T({path:{assistant_id:n}}),staleTime:3e4}),o=e=>{te(r,{path:{assistant_id:n}},t=>t&&{...t,status:e?`running`:`not_running`})},s=v({onSuccess:()=>o(!0)}),c=y({onSuccess:()=>o(!1)}),l=async e=>{try{e?(await s.mutateAsync({path:{assistant_id:n}}),k.success(t(`memoryWorkerToggle.toastStarted`))):(await c.mutateAsync({path:{assistant_id:n}}),k.success(t(`memoryWorkerToggle.toastStopped`)))}catch(e){i(e,{context:`settings-memory-worker-toggle`}),k.error(t(`memoryWorkerToggle.toastFailed`))}};if(!a)return null;let u=s.isPending||c.isPending;return(0,G.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4 border-t border-[var(--border-subtle)] pt-4`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,G.jsx)(`h3`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:t(`memoryWorkerToggle.title`)}),(0,G.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:t(`memoryWorkerToggle.description`)})]}),(0,G.jsx)(d,{checked:a.status===`running`,onChange:e=>void l(e),"aria-label":t(`memoryWorkerToggle.ariaLabel`),disabled:!e||u})]})}function fe(){let{t:e}=P(`settings`),{healthz:t}=U(),r=x(),o=N(),s=t?.capabilities?.memoryOptOut===!0,{data:c}=j({...h({path:{assistant_id:r}}),staleTime:3e4,enabled:s}),l=a({onSuccess:e=>{n(o,{path:{assistant_id:r}},e)}}),u=c?.memory?.enabled!==!1,f=c?.memory?.retrospective?.enabled!==!1,p=async t=>{try{await l.mutateAsync({path:{assistant_id:r},body:{memory:{enabled:t}}}),k.success(e(t?`memoryCard.enabledToast`:`memoryCard.disabledToast`))}catch(t){i(t,{context:`settings-memory-toggle`}),k.error(e(`memoryCard.updateFailedToast`))}};return s?(0,G.jsxs)(V,{title:e(`memoryCard.title`),subtitle:e(`memoryCard.subtitle`),accessory:(0,G.jsx)(d,{checked:u,onChange:e=>void p(e),"aria-label":e(`memoryCard.enableAriaLabel`),disabled:l.isPending}),compactAccessory:!0,children:[(0,G.jsx)(ue,{memoryEnabled:u,retrospectiveEnabled:f}),(0,G.jsx)(de,{memoryEnabled:u})]}):null}function pe(){let{t:e}=P(`settings`),n=N(),[r,i]=(0,W.useState)(!1),[a,c]=(0,W.useState)(!1),l=A(),u=x(),{data:d,isLoading:p}=j({...E({path:{id:u}}),enabled:l}),{data:h,isLoading:g}=j({...O({query:{hosting:`all`}}),enabled:l}),v=p||g,y=h?.results??[];return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(me,{assistant:d??null,loading:v}),(0,G.jsx)(he,{assistants:y,activeAssistantId:u,loading:v}),(0,G.jsxs)(V,{title:e(`assistantLifecyclePanel.hatchTitle`),subtitle:e(`assistantLifecyclePanel.hatchSubtitle`),children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`assistantLifecyclePanel.hatchDescription`)}),(0,G.jsx)(_,{variant:`outlined`,leftIcon:r?(0,G.jsx)(z,{className:`animate-spin`}):void 0,onClick:()=>c(!0),disabled:r,className:`shrink-0`,children:e(`assistantLifecyclePanel.hatch`)})]}),(0,G.jsx)(t,{open:a,title:e(`assistantLifecyclePanel.hatchConfirmTitle`),message:e(`assistantLifecyclePanel.hatchConfirmMessage`),confirmLabel:e(`assistantLifecyclePanel.hatch`),onConfirm:async()=>{c(!1),i(!0);try{let t=await s(void 0,`create`);if(t.ok){if(ee())try{let e=await o();e.ok&&await m(e.data,f.getState().currentOrganizationId??void 0)}catch{}k.success(t.status===201?e(`assistantLifecyclePanel.hatchSuccessToast`):e(`assistantLifecyclePanel.hatchExistingToast`)),n.invalidateQueries({queryKey:[{_id:`assistantsRetrieve`}]}),n.invalidateQueries({queryKey:O({query:{hosting:`all`}}).queryKey})}else{let n=typeof t.error?.detail==`string`?t.error.detail:e(`assistantLifecyclePanel.hatchFailedToast`);k.error(n)}}catch{k.error(e(`assistantLifecyclePanel.hatchFailedToast`))}finally{i(!1)}},onCancel:()=>c(!1)})]})]})}function me({assistant:e,loading:t}){let{t:n}=P(`settings`);return t?(0,G.jsx)(V,{title:n(`assistantLifecyclePanel.infoTitle`),children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(z,{className:`h-4 w-4 animate-spin`}),n(`assistantLifecyclePanel.infoLoading`)]})}):e?(0,G.jsx)(V,{title:n(`assistantLifecyclePanel.infoTitle`),subtitle:n(`assistantLifecyclePanel.infoSubtitle`),children:(0,G.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.name`)}),(0,G.jsx)(q,{children:e.name??n(`assistantLifecyclePanel.unnamed`)}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.status`)}),(0,G.jsx)(`div`,{children:(0,G.jsx)(c,{tone:e.status===`active`?`positive`:`neutral`,children:e.status})}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.assistantId`)}),(0,G.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id}),e.machine_id&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.machineId`)}),(0,G.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.machine_id})]}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.created`)}),(0,G.jsx)(q,{children:new Date(e.created).toLocaleDateString()}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.lastModified`)}),(0,G.jsx)(q,{children:new Date(e.modified).toLocaleDateString()}),e.current_release_version&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.version`)}),(0,G.jsx)(q,{children:e.current_release_version})]})]})}):(0,G.jsx)(V,{title:n(`assistantLifecyclePanel.infoTitle`),children:(0,G.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`assistantLifecyclePanel.infoEmpty`)})})}function he({assistants:e,activeAssistantId:t,loading:n}){let{t:r}=P(`settings`);return n||e.length===0?null:(0,G.jsx)(V,{title:r(`assistantLifecyclePanel.allAssistantsTitle`),subtitle:r(`assistantLifecyclePanel.allAssistantsSubtitle`,{count:e.length}),children:(0,G.jsx)(`div`,{className:`max-h-[300px] space-y-2 overflow-y-auto`,children:e.map(e=>{let n=e.id===t;return(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e.name||r(`assistantLifecyclePanel.unnamed`)}),(0,G.jsx)(c,{tone:e.status===`active`?`positive`:`neutral`,children:e.status}),n&&(0,G.jsx)(c,{tone:`warning`,children:r(`assistantLifecyclePanel.current`)})]}),(0,G.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id})]})},e.id)})})})}function K({children:e}){return(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e})}function q({children:e}){return(0,G.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e})}function ge(){let{t:e}=P(`settings`),t=H.use.emailRootDomain(),n=H.use.isNonProduction(),r=H.use.setEnvironment();return(0,G.jsx)(V,{title:e(`environmentConfigPanel.title`),subtitle:e(`environmentConfigPanel.subtitle`),children:(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,G.jsx)(d,{checked:n,onChange:e=>r({isNonProduction:e}),"aria-label":e(n?`environmentConfigPanel.nonProductionOnAriaLabel`:`environmentConfigPanel.nonProductionOffAriaLabel`)})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`environmentConfigPanel.nonProduction`)}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e(`environmentConfigPanel.nonProductionDescription`)})]})]}),(0,G.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,G.jsx)(c,{tone:`neutral`,children:t})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`environmentConfigPanel.emailRootDomain`)}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e(`environmentConfigPanel.emailRootDomainDescription`)})]})]})]})})}async function _e(){let{data:e,response:t}=await g.get({url:`/v1/feature-flags/`,throwOnError:!1});return t?.ok?e?.flags??[]:[]}var J={client:`warning`,assistant:`positive`};function ve(){let{t:e}=P(`settings`),t=x(),{data:n}=j({queryKey:[`feature-flag-definitions`],queryFn:_e,enabled:A(),staleTime:300*1e3}),r=(0,W.useMemo)(()=>{let e=new Map;if(!n)return e;for(let t of n)t.type===`string`&&t.values?.length&&e.set(t.key,t.values);return e},[n]),[i,a]=(0,W.useState)(``),o=S(),s=b(),c=(0,W.useMemo)(()=>{let e=[];for(let t of u){let n=l(t.key);if(typeof t.defaultEnabled==`boolean`){let r=o[n],i=s[n],a=t.scope===`both`?r===!0||i===!0:t.scope===`assistant`?i:r;if(typeof a!=`boolean`)continue;e.push({kind:`boolean`,storeKey:n,scope:t.scope,label:t.label,description:t.description,value:a,defaultValue:t.defaultEnabled})}else if(typeof t.defaultEnabled==`string`){let i=o.stringFlags?.[n],a=s.stringFlags?.[n],c=t.scope===`assistant`?a??t.defaultEnabled:i??t.defaultEnabled;e.push({kind:`string`,storeKey:n,scope:t.scope,label:t.label,description:t.description,value:c,defaultValue:t.defaultEnabled,values:r.get(t.key)??t.values})}}return e.sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:`base`}))},[o,s,r]),d=(0,W.useMemo)(()=>{if(!i.trim())return c;let e=i.trim().toLowerCase();return c.filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.storeKey.toLowerCase().includes(e)||t.scope.includes(e)||t.scope===`both`&&(`client`.includes(e)||`assistant`.includes(e)))},[c,i]);return(0,G.jsx)(V,{title:e(`featureFlagsPanel.title`),subtitle:e(`featureFlagsPanel.subtitle`),children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(L,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--content-tertiary)]`}),(0,G.jsx)(`input`,{type:`text`,placeholder:e(`featureFlagsPanel.searchPlaceholder`),value:i,onChange:e=>a(e.target.value),className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-default)] py-2 pl-9 pr-3 text-body-medium-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:border-[var(--border-focus)] focus:outline-none`})]}),d.length===0&&(0,G.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`featureFlagsPanel.noMatching`)}),d.length>0&&(0,G.jsx)(`div`,{className:`max-h-[500px] space-y-2 overflow-y-auto`,children:d.map(e=>(0,G.jsx)(be,{flag:e,assistantId:t},e.storeKey))})]})})}function Y({scope:e}){let{t}=P(`settings`);return e===`both`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(c,{tone:J.client,children:t(`featureFlagsPanel.scopeClient`)}),(0,G.jsx)(c,{tone:J.assistant,children:t(`featureFlagsPanel.scopeAssistant`)})]}):(0,G.jsx)(c,{tone:J[e],children:t(e===`client`?`featureFlagsPanel.scopeClient`:`featureFlagsPanel.scopeAssistant`)})}function ye({flag:e,assistantId:t}){let{t:n}=P(`settings`),r=S.use.setFlag(),i=b.use.setFlag();return(0,G.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,G.jsx)(d,{checked:e.value,onChange:n=>{p(e.scope,`client`)&&r(e.storeKey,n),p(e.scope,`assistant`)&&i(e.storeKey,n,t)},"aria-label":e.value?n(`featureFlagsPanel.flagOnAriaLabel`,{label:e.label}):n(`featureFlagsPanel.flagOffAriaLabel`,{label:e.label})})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,G.jsx)(Y,{scope:e.scope})]}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`featureFlagsPanel.defaultLabel`)}),(0,G.jsx)(c,{tone:`neutral`,children:e.defaultValue?n(`featureFlagsPanel.on`):n(`featureFlagsPanel.off`)})]})]})]})}function X({flag:e,assistantId:t}){let{t:n}=P(`settings`),r=S.use.setStringFlag(),i=b.use.setStringFlag(),[a,o]=(0,W.useState)(e.value);(0,W.useEffect)(()=>{o(e.value)},[e.value]);let s=n=>{n!==e.value&&(p(e.scope,`client`)&&r(e.storeKey,n),p(e.scope,`assistant`)&&i(e.storeKey,n,t))},l=a!==e.value,u=e.values&&e.values.length>0?e.values:null,d=l&&u!=null&&!u.includes(a),f=()=>{d||s(a)},m=e=>{e.key===`Enter`&&e.currentTarget.blur()},h=u!=null&&u.includes(e.value);return(0,G.jsx)(`div`,{className:`flex items-start gap-3 py-3`,children:(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,G.jsx)(Y,{scope:e.scope})]}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),h?(0,G.jsx)(w,{value:e.value,onChange:e=>{o(e),s(e)},options:u.map(e=>({value:e,label:e})),className:`w-48`,"aria-label":n(`featureFlagsPanel.valueAriaLabel`,{label:e.label})}):(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),onBlur:f,onKeyDown:m,className:D(`w-full rounded-lg border bg-[var(--surface-default)] px-3 py-1.5 text-body-small-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:outline-none`,d?`border-[var(--system-negative-strong)]`:`border-[var(--border-base)] focus:border-[var(--border-focus)]`),placeholder:e.defaultValue||n(`featureFlagsPanel.enterValue`)}),d&&(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--system-negative-strong)]`,children:n(`featureFlagsPanel.expectedOneOf`,{values:u.join(`, `)})})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`featureFlagsPanel.defaultLabel`)}),(0,G.jsx)(c,{tone:`neutral`,children:e.defaultValue||n(`featureFlagsPanel.empty`)})]})]})})}function be({flag:e,assistantId:t}){return e.kind===`string`?(0,G.jsx)(X,{flag:e,assistantId:t}):(0,G.jsx)(ye,{flag:e,assistantId:t})}function xe(){let{t:e}=P(`settings`),t=(0,W.useCallback)(()=>{re(Error(`[Dev Settings] Test error event`)),k.success(e(`sentryTestingPanel.errorSentToast`))},[e]),n=(0,W.useCallback)(()=>{M(`[Dev Settings] Test warning event`,`warning`),k.success(e(`sentryTestingPanel.warningSentToast`))},[e]),r=(0,W.useCallback)(()=>{M(`[Dev Settings] Test info event`,`info`),k.success(e(`sentryTestingPanel.infoSentToast`))},[e]),i=(0,W.useCallback)(()=>{M(`[Dev Settings] Test fatal event`,`fatal`),k.success(e(`sentryTestingPanel.fatalSentToast`))},[e]),a=(0,W.useCallback)(()=>{ne({name:`[Dev Settings] Test transaction`,op:`test.transaction`,forceTransaction:!0}).end(),k.success(e(`sentryTestingPanel.transactionSentToast`))},[e]);return(0,G.jsx)(V,{title:e(`sentryTestingPanel.title`),subtitle:e(`sentryTestingPanel.subtitle`),children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(Z,{icon:(0,G.jsx)(I,{className:`h-4 w-4 text-[var(--system-negative-strong)]`}),label:e(`sentryTestingPanel.fatalLabel`),description:e(`sentryTestingPanel.fatalDescription`),onClick:i}),(0,G.jsx)(Z,{icon:(0,G.jsx)(le,{className:`h-4 w-4 text-[var(--system-negative-default)]`}),label:e(`sentryTestingPanel.errorLabel`),description:e(`sentryTestingPanel.errorDescription`),onClick:t}),(0,G.jsx)(Z,{icon:(0,G.jsx)(F,{className:`h-4 w-4 text-[var(--system-warning-default)]`}),label:e(`sentryTestingPanel.warningLabel`),description:e(`sentryTestingPanel.warningDescription`),onClick:n}),(0,G.jsx)(Z,{icon:(0,G.jsx)(B,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),label:e(`sentryTestingPanel.infoLabel`),description:e(`sentryTestingPanel.infoDescription`),onClick:r}),(0,G.jsx)(Z,{icon:(0,G.jsx)(ce,{className:`h-4 w-4 text-[var(--system-positive-default)]`}),label:e(`sentryTestingPanel.performanceLabel`),description:e(`sentryTestingPanel.performanceDescription`),onClick:a})]})})}function Z({icon:e,label:t,description:n,onClick:r}){let{t:i}=P(`settings`);return(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-[var(--border-base)] px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0`,children:e}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]}),(0,G.jsxs)(_,{variant:`outlined`,size:`compact`,onClick:r,children:[(0,G.jsx)(R,{className:`h-4 w-4`}),i(`sentryTestingPanel.send`)]})]})}var Q=[{id:`feature-flags`,labelKey:`developerPage.tabFeatureFlags`},{id:`lifecycle`,labelKey:`developerPage.tabLifecycle`},{id:`sentry`,labelKey:`developerPage.tabSentry`},{id:`memory`,labelKey:`developerPage.tabMemory`}],$=`flex min-h-0 flex-1 flex-col pt-6`;function Se(){let{t:e}=P(`settings`),[t,n]=ie(),i=b.use.settingsDeveloperNav(),a=b.use.hasHydrated(),o=(0,W.useMemo)(()=>{let e=t.get(`tab`);return Q.find(t=>t.id===e)?.id??`feature-flags`},[t]);return a&&!i?(0,G.jsx)(ae,{replace:!0,to:r.settings.general}):(0,G.jsx)(`div`,{"data-slot":`developer-page`,className:`flex min-h-0 flex-1 flex-col`,children:(0,G.jsxs)(C.Root,{value:o,onValueChange:e=>{let r=new URLSearchParams(t.toString());e===`feature-flags`?r.delete(`tab`):r.set(`tab`,e),n(r,{replace:!0})},className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsx)(C.List,{className:`shrink-0`,"aria-label":e(`developerPage.sectionsAriaLabel`),children:Q.map(t=>(0,G.jsx)(C.Trigger,{value:t.id,children:e(t.labelKey)},t.id))}),(0,G.jsx)(C.Panel,{value:`feature-flags`,className:$,children:(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(ve,{}),(0,G.jsx)(ge,{})]})}),(0,G.jsx)(C.Panel,{value:`lifecycle`,className:$,children:(0,G.jsx)(pe,{})}),(0,G.jsx)(C.Panel,{value:`sentry`,className:$,children:(0,G.jsx)(xe,{})}),(0,G.jsx)(C.Panel,{value:`memory`,className:$,children:(0,G.jsx)(`div`,{className:`space-y-4`,children:(0,G.jsx)(fe,{})})})]})})}export{Se as DeveloperPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Eb as t}from"./app-Tg6YU_tZ.js";import{f as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(t.settings.general,{replace:!0})},[e]),null}export{a as DevicesRedirectPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Eb as t}from"./app-DVwAB8n7.js";import{f as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(t.settings.general,{replace:!0})},[e]),null}export{a as DevicesRedirectPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$a as t,Qa as n,eo as r,no as i,to as a}from"./app-Tg6YU_tZ.js";import{j as o}from"./vendor-DYOeoIwg.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{E as l,Mi as u,qi as d,qn as f}from"./icons-QG1KAFmx.js";import{n as p}from"./companion-layout-Cu_j-nKV.js";var m=e(c(),1),h=s();function g(){let[e,o]=(0,m.useState)(null),s=(0,m.useRef)(null),c=(0,m.useRef)(!1);if((0,m.useEffect)(()=>{let e=i(o);return n().then(e=>{e&&o(t=>t??e)}),e},[]),(0,m.useEffect)(()=>()=>{a(!1)},[]),(0,m.useEffect)(()=>{e?.kind===`recording`||!c.current||(c.current=!1,a(!1))},[e?.kind]),(0,m.useEffect)(()=>{if(e?.kind!==`recording`)return;let t=s.current;if(!t)return;let n=()=>{let e=t.getBoundingClientRect();r({x:e.left,y:e.top,width:e.width,height:e.height})};n();let i=new ResizeObserver(n);return i.observe(document.documentElement),i.observe(t),()=>{i.disconnect(),r(null)}},[e?.kind]),!e)return null;let l=e.kind===`recording`?e.transcription.trim():``,u=e.kind===`recording`?e.audioLevel??0:0,d=e=>{c.current!==e&&(c.current=e,a(e))};return(0,h.jsx)(`div`,{className:`flex h-screen w-screen items-start justify-center bg-transparent p-4`,onMouseMove:t=>{if(e.kind!==`recording`){d(!1);return}let n=s.current;if(!n){d(!1);return}d(p(n.getBoundingClientRect(),t.clientX,t.clientY))},onMouseLeave:()=>d(!1),children:(0,h.jsxs)(`div`,{className:`flex w-[min(28rem,calc(100vw-2rem))] flex-col gap-1 rounded-xl border border-[var(--border-element)] bg-[var(--surface-base)] px-4 py-2.5 shadow-lg`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(b,{state:e}),(0,h.jsx)(`span`,{className:`truncate text-[11px] font-medium text-[var(--content-secondary)]`,children:y(e)}),e.kind===`recording`&&(0,h.jsx)(_,{level:u,stopButtonRef:s,onInteractiveChange:d,onStop:()=>{t(),d(!1)}})]}),l&&(0,h.jsx)(`div`,{className:`flex max-h-7 flex-col justify-end overflow-hidden`,children:(0,h.jsx)(`p`,{className:`break-words text-[10px] leading-snug text-[var(--content-tertiary)]`,children:l})})]})})}function _({level:e,stopButtonRef:t,onInteractiveChange:n,onStop:r}){let{t:i}=o();return(0,h.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,h.jsx)(v,{level:e}),(0,h.jsx)(`button`,{ref:t,type:`button`,className:`flex size-5 items-center justify-center rounded-full text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-overlay)] hover:text-[var(--system-negative-strong)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--system-negative-strong)]`,"aria-label":i(`dictationOverlayPage.stopRecording`),title:i(`dictationOverlayPage.stopRecording`),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),onClick:r,children:(0,h.jsx)(u,{className:`size-4`,strokeWidth:2,"aria-hidden":!0})})]})}function v({level:e}){let t=Math.max(0,Math.min(1,e));return(0,h.jsx)(`div`,{className:`flex h-4 w-16 shrink-0 items-end gap-0.5`,"aria-hidden":!0,children:[.16,.32,.48,.64,.8,.96].map((e,n)=>(0,h.jsx)(`span`,{className:`w-1 rounded-full bg-[var(--system-negative-strong)] transition-[height,opacity] duration-75`,style:{height:`${6+n*1.5}px`,opacity:t>=e?1:.22}},e))})}function y(e){switch(e.kind){case`recording`:return`Recording…`;case`processing`:return`Processing…`;case`done`:return`Done`;case`error`:return e.message}}function b({state:e}){switch(e.kind){case`recording`:return(0,h.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-[var(--system-negative-strong)]`,"aria-hidden":!0});case`processing`:return(0,h.jsx)(f,{className:`size-4 shrink-0 animate-spin text-[var(--content-secondary)]`,"aria-hidden":!0});case`done`:return(0,h.jsx)(d,{className:`size-4 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":!0});case`error`:return(0,h.jsx)(l,{className:`size-4 shrink-0 text-[var(--system-negative-strong)]`,"aria-hidden":!0})}}export{g as DictationOverlayPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{eo as t,io as n,no as r,ro as i,to as a}from"./app-DVwAB8n7.js";import{j as o}from"./vendor-Bb38ZAP8.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{E as l,Mi as u,qi as d,qn as f}from"./icons-QG1KAFmx.js";import{n as p}from"./companion-layout-Ctf-oiUu.js";var m=e(c(),1),h=s();function g(){let[e,o]=(0,m.useState)(null),s=(0,m.useRef)(null),c=(0,m.useRef)(!1);if((0,m.useEffect)(()=>{let e=n(o);return t().then(e=>{e&&o(t=>t??e)}),e},[]),(0,m.useEffect)(()=>()=>{i(!1)},[]),(0,m.useEffect)(()=>{e?.kind===`recording`||!c.current||(c.current=!1,i(!1))},[e?.kind]),(0,m.useEffect)(()=>{if(e?.kind!==`recording`)return;let t=s.current;if(!t)return;let n=()=>{let e=t.getBoundingClientRect();r({x:e.left,y:e.top,width:e.width,height:e.height})};n();let i=new ResizeObserver(n);return i.observe(document.documentElement),i.observe(t),()=>{i.disconnect(),r(null)}},[e?.kind]),!e)return null;let l=e.kind===`recording`?e.transcription.trim():``,u=e.kind===`recording`?e.audioLevel??0:0,d=e=>{c.current!==e&&(c.current=e,i(e))};return(0,h.jsx)(`div`,{className:`flex h-screen w-screen items-start justify-center bg-transparent p-4`,onMouseMove:t=>{if(e.kind!==`recording`){d(!1);return}let n=s.current;if(!n){d(!1);return}d(p(n.getBoundingClientRect(),t.clientX,t.clientY))},onMouseLeave:()=>d(!1),children:(0,h.jsxs)(`div`,{className:`flex w-[min(28rem,calc(100vw-2rem))] flex-col gap-1 rounded-xl border border-[var(--border-element)] bg-[var(--surface-base)] px-4 py-2.5 shadow-lg`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(b,{state:e}),(0,h.jsx)(`span`,{className:`truncate text-[11px] font-medium text-[var(--content-secondary)]`,children:y(e)}),e.kind===`recording`&&(0,h.jsx)(_,{level:u,stopButtonRef:s,onInteractiveChange:d,onStop:()=>{a(),d(!1)}})]}),l&&(0,h.jsx)(`div`,{className:`flex max-h-7 flex-col justify-end overflow-hidden`,children:(0,h.jsx)(`p`,{className:`break-words text-[10px] leading-snug text-[var(--content-tertiary)]`,children:l})})]})})}function _({level:e,stopButtonRef:t,onInteractiveChange:n,onStop:r}){let{t:i}=o();return(0,h.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,h.jsx)(v,{level:e}),(0,h.jsx)(`button`,{ref:t,type:`button`,className:`flex size-5 items-center justify-center rounded-full text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-overlay)] hover:text-[var(--system-negative-strong)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--system-negative-strong)]`,"aria-label":i(`dictationOverlayPage.stopRecording`),title:i(`dictationOverlayPage.stopRecording`),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),onClick:r,children:(0,h.jsx)(u,{className:`size-4`,strokeWidth:2,"aria-hidden":!0})})]})}function v({level:e}){let t=Math.max(0,Math.min(1,e));return(0,h.jsx)(`div`,{className:`flex h-4 w-16 shrink-0 items-end gap-0.5`,"aria-hidden":!0,children:[.16,.32,.48,.64,.8,.96].map((e,n)=>(0,h.jsx)(`span`,{className:`w-1 rounded-full bg-[var(--system-negative-strong)] transition-[height,opacity] duration-75`,style:{height:`${6+n*1.5}px`,opacity:t>=e?1:.22}},e))})}function y(e){switch(e.kind){case`recording`:return`Recording…`;case`processing`:return`Processing…`;case`done`:return`Done`;case`error`:return e.message}}function b({state:e}){switch(e.kind){case`recording`:return(0,h.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-[var(--system-negative-strong)]`,"aria-hidden":!0});case`processing`:return(0,h.jsx)(f,{className:`size-4 shrink-0 animate-spin text-[var(--content-secondary)]`,"aria-hidden":!0});case`done`:return(0,h.jsx)(d,{className:`size-4 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":!0});case`error`:return(0,h.jsx)(l,{className:`size-4 shrink-0 text-[var(--system-negative-strong)]`,"aria-hidden":!0})}}export{g as DictationOverlayPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./document-load-ZTOhaes3.js";export{e as loadDocumentContent};
@@ -1 +1 @@
1
- import{Zg as e,_n as t}from"./app-Tg6YU_tZ.js";async function n({assistantId:n,surfaceId:r,isCurrent:i}){if(await t({assistantId:n,surfaceId:r},i),!i())return null;let{data:a}=await e({path:{assistant_id:n,id:r},throwOnError:!0});return i()?a:null}export{n as t};
1
+ import{Zg as e,vn as t}from"./app-DVwAB8n7.js";async function n({assistantId:n,surfaceId:r,isCurrent:i}){if(await t({assistantId:n,surfaceId:r},i),!i())return null;let{data:a}=await e({path:{assistant_id:n,id:r},throwOnError:!0});return i()?a:null}export{n as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$i as t,Du as n,Eb as r,Fb as i,Gp as a,Ji as o,Mc as s,Qi as c,Sm as l,Ux as u,Wp as d,Wx as f,Xi as p,Yi as m,Zi as h,cy as g,ea as _,gc as v,gn as y,hn as b,mn as x,na as S,oa as C,ra as w,ta as ee,vc as te,wx as ne}from"./app-DVwAB8n7.js";import{j as re}from"./vendor-Bb38ZAP8.js";import{d as ie,f as T,h as E,t as D,x as O}from"./react-B9IgSVeK.js";import{qn as k}from"./icons-QG1KAFmx.js";import{t as A}from"./document-load-ZTOhaes3.js";import{t as j}from"./use-edge-swipe-back-DfMnwl0d.js";var M=e(O(),1),N=D();function P(){let{t:e}=re(`chat`),{surfaceId:D}=E(),O=T(),{pathname:P,search:F,state:I}=ie(),L=te(),[R]=(0,M.useState)(L?`conversation`:`standalone`),z=g.use.activeAssistantId(),B=g.use.assistantsHydrated(),V=l(),H=C(new URLSearchParams(F).get(w)),U=(0,M.useRef)(null),W=(0,M.useRef)(null),G=(0,M.useRef)(null),[K,q]=(0,M.useState)({kind:`loading`}),[J,ae]=(0,M.useState)(0),[oe,Y]=(0,M.useState)(!1),X=(0,M.useRef)(!1),Z=K.kind===`ready`?K.doc:null,se=x(z,Z?.surfaceId??null,W);(0,M.useEffect)(()=>{if(q({kind:`loading`}),X.current=!1,Y(!1),!D||!z&&B||V===`unavailable`){q({kind:`error`});return}if(!z||V!==`ready`)return;let e=c(z);return G.current=e,(async()=>{try{let t=(e,t)=>{if(R===`conversation`&&t){m(O,e,t,z,H,!0,I);return}a.getState().clearDocumentEverywhere(D),q({kind:`ready`,doc:e,needsConversation:R===`conversation`})},n={assistantId:z,surfaceId:D,isCurrent:e.isCurrent};if(R===`conversation`)await _({...n,onReady:t});else{let r=await A(n);r&&e.isCurrent()&&t(r,null)}}catch(t){e.isCurrent()&&(i(t,{context:`document_viewer_page`}),q({kind:`error`}))}})(),e.dispose},[D,z,B,V,R,O,H,J,I]);let ce=(0,M.useCallback)(()=>{W.current?.refreshComments()},[]);n(`sse.event`,b({surfaceId:D??``,enabled:!!D,onCommentsChanged:ce}));let Q=(0,M.useCallback)(()=>{G.current?.dispose(),p(O,D??``,H,I)},[O,D,H,I]);j({containerRef:U,onBack:Q,enabled:L,navKey:P});let $=(0,M.useCallback)(async n=>{if(!Z||!z||X.current||!W.current)return;let a=G.current;if(!a?.isCurrent())return;X.current=!0,Y(!0);let c=W.current.beginSendPreparation();try{let e=await c.flush();if(!a.isCurrent()||!c.isCurrent())return;let i={...Z,...e},l={assistantId:z,document:i,isCurrent:a.isCurrent},u=await ee(l)??await S(l);if(!u||!a.isCurrent()||!c.isCurrent())return;n?(h(i,u,z),v(O,u,{silent:!0,...L?{replace:!0}:{},state:s(L?I:void 0),destination:L?o(u,Z.surfaceId,H,`chat`,t(i.title)):r.conversationWithPrompt(u,t(i.title))}),L||d.getState().setMainView(`document`)):m(O,i,u,z,H,!0,I)}catch(t){a.isCurrent()&&(i(t,{context:`document_prepare_conversation`}),ne.error(e(`documentConversation.prepareFailed`)))}finally{c.release(),a.isCurrent()&&(X.current=!1,Y(!1))}},[Z,z,O,H,L,e,I]),le=(0,M.useCallback)(()=>$(!0),[$]),ue=(0,M.useCallback)(()=>$(!1),[$]);return K.kind===`loading`?(0,N.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,N.jsx)(k,{size:24,className:`animate-spin text-[var(--content-tertiary)]`})}):K.kind===`error`||!Z||!z?(0,N.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,N.jsx)(u,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e(`documentViewerPage.notFound`)}),(0,N.jsx)(f,{onClick:()=>ae(e=>e+1),children:e(`documentConversation.retry`)}),(0,N.jsx)(f,{variant:`ghost`,onClick:Q,children:e(`documentConversation.back`)})]}):(0,N.jsxs)(`div`,{ref:U,className:`flex min-h-0 flex-1 flex-col`,children:[K.needsConversation&&(0,N.jsxs)(`div`,{role:`status`,className:`flex shrink-0 flex-col gap-2 border-b border-[var(--border-default)] p-3`,children:[(0,N.jsx)(u,{variant:`body-small-default`,children:e(`documentConversation.missing`)}),(0,N.jsx)(f,{disabled:oe,onClick:ue,children:e(`documentConversation.start`)})]}),(0,N.jsx)(y,{source:`document`,surfaceId:Z.surfaceId,assistantId:z,conversationId:Z.conversationId,documentName:Z.title,content:Z.content,onClose:Q,onRenamed:e=>q(t=>t.kind===`ready`?{...t,doc:{...t.doc,title:e}}:t),onExport:se,onSubmitFeedback:le,handleRef:W},z+`:`+Z.surfaceId)]})}export{P as DocumentViewerPage};
@@ -0,0 +1 @@
1
+ import{Eb as e,Lx as t,Qc as n,dn as r,el as i,et as a,nl as o,xp as s}from"./app-DVwAB8n7.js";import{Zn as c,j as l}from"./vendor-Bb38ZAP8.js";import{n as u,r as d,t as f}from"./react-B9IgSVeK.js";import{Ci as p,E as m,dr as h,gt as g,qn as _}from"./icons-QG1KAFmx.js";var v=f();function y(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function b({title:e,children:t}){return(0,v.jsxs)(`div`,{className:`space-y-3`,children:[(0,v.jsx)(`h2`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:e}),t]})}function x({tone:e=`info`,children:t}){let n=e===`error`;return(0,v.jsx)(`div`,{className:`rounded-md border px-4 py-3 text-body-medium-lighter`,style:{background:n?`var(--surface-negative-subtle, var(--surface-lift))`:`var(--surface-lift)`,borderColor:n?`var(--border-negative, var(--border-base))`:`var(--border-base)`,color:n?`var(--content-negative, var(--content-default))`:`var(--content-default)`},children:(0,v.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n&&(0,v.jsx)(m,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,v.jsx)(`div`,{className:`flex-1`,children:t})]})})}function S({message:e,onRetry:t,retrying:n}){let{t:r}=l(`logs`);return(0,v.jsx)(x,{tone:`error`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,v.jsx)(`span`,{children:e}),(0,v.jsx)(`button`,{type:`button`,onClick:t,disabled:n,className:`text-body-small-default underline disabled:opacity-50`,style:{color:`var(--content-default)`},children:r(n?`errorRetryRow.retrying`:`errorRetryRow.retry`)})]})})}function C({label:e,value:t,sub:n}){return(0,v.jsxs)(`div`,{className:`rounded-xl border p-3`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,v.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e}),(0,v.jsx)(`p`,{className:`mt-1 text-title-large tabular-nums`,style:{color:`var(--content-default)`},children:t??`—`}),n&&(0,v.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-disabled)`},children:n})]})}function w({email:e}){let{t:n}=l(`logs`),r=e.direction===`inbound`;return(0,v.jsx)(`div`,{className:`rounded-xl border p-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:(0,v.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(t,{tone:r?`positive`:`neutral`,leftIcon:r?(0,v.jsx)(h,{}):(0,v.jsx)(g,{}),children:n(r?`emailsTab.inbound`:`emailsTab.outbound`)}),(0,v.jsx)(`span`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.from_address})]}),(0,v.jsx)(`p`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.subject||n(`emailsTab.noSubject`)})]}),(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[(0,v.jsx)(p,{className:`h-3 w-3`}),(0,v.jsx)(`span`,{children:y(e.created_at)})]})]})})}function T({assistantId:t,platformGate:r}){let{t:a}=l(`logs`),s=r===`full`,d=c({...n({path:{assistant_id:t}}),enabled:s}),f=d.data?.results?.[0],p=c({...i({path:{assistant_id:t,id:f?.id??``}}),enabled:s&&!!f?.id}),m=c({...o({path:{assistant_id:t},query:{limit:10}}),enabled:s}),h=p.data?.usage,g=m.data?.results??[];return d.isLoading?(0,v.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,v.jsx)(_,{className:`h-8 w-8 animate-spin`,style:{color:`var(--content-tertiary)`}})}):d.isError?(0,v.jsx)(S,{message:a(`emailsTab.addressesLoadFailed`),onRetry:()=>{d.refetch()},retrying:d.isFetching}):f?(0,v.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,v.jsx)(b,{title:a(`emailsTab.totals`),children:(0,v.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,v.jsx)(C,{label:a(`emailsTab.sentToday`),value:h?.sent_today,sub:h?a(`emailsTab.dailyLimitSub`,{limit:h.daily_limit}):void 0}),(0,v.jsx)(C,{label:a(`emailsTab.receivedToday`),value:h?.received_today}),(0,v.jsx)(C,{label:a(`emailsTab.sentThisMonth`),value:h?.sent_this_month}),(0,v.jsx)(C,{label:a(`emailsTab.receivedThisMonth`),value:h?.received_this_month})]})}),(0,v.jsx)(b,{title:a(`emailsTab.recentEmails`),children:m.isLoading?(0,v.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[(0,v.jsx)(_,{className:`h-4 w-4 animate-spin`}),a(`emailsTab.loading`)]}):m.isError?(0,v.jsx)(S,{message:a(`emailsTab.emailsLoadFailed`),onRetry:()=>{m.refetch()},retrying:m.isFetching}):g.length===0?(0,v.jsx)(x,{children:a(`emailsTab.noEmails`)}):(0,v.jsx)(`div`,{className:`space-y-2`,children:g.map(e=>(0,v.jsx)(w,{email:e},e.id))})})]}):(0,v.jsxs)(x,{children:[a(`emailsTab.noAddress`),` `,(0,v.jsx)(u,{to:`${e.channels}?setup=email`,className:`underline`,style:{color:`var(--content-tertiary)`},children:a(`emailsTab.setUpLink`)})]})}function E(){let{t}=l(`logs`),n=s(),i=a();return n===`gated`?(0,v.jsx)(d,{replace:!0,to:e.logs.root}):n===`disabled`?(0,v.jsx)(r,{children:t(`emailsPage.platformLoginNotice`)}):(0,v.jsx)(T,{assistantId:i,platformGate:n})}export{E as EmailsPage};
@@ -0,0 +1 @@
1
+ import{nx as e}from"./app-DVwAB8n7.js";import{Q as t}from"./vendor-Bb38ZAP8.js";function n(){return{emailRootDomain:`local.vellum.me`,isNonProduction:!0}}var r=e(t()(e=>({...n(),setEnvironment:t=>e(t)})));export{r as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-D2gsz8Ak.js","assets/vendor-Bb38ZAP8.js","assets/rolldown-runtime-BM3Ffeng.js","assets/react-B9IgSVeK.js","assets/definitions-B_hI7hUU.js"])))=>i.map(i=>d[i]);
2
+ import{k as e}from"./vendor-Bb38ZAP8.js";import{v as t}from"./react-B9IgSVeK.js";import{n,t as r}from"./definitions-B_hI7hUU.js";var i=e(`Haptics`,{web:()=>t(()=>import(`./web-D2gsz8Ak.js`).then(e=>new e.HapticsWeb),__vite__mapDeps([0,1,2,3,4]))});export{i as Haptics,r as ImpactStyle,n as NotificationType};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-Du0h1dfg.js","assets/vendor-Bb38ZAP8.js","assets/rolldown-runtime-BM3Ffeng.js","assets/react-B9IgSVeK.js"])))=>i.map(i=>d[i]);
2
+ import{k as e}from"./vendor-Bb38ZAP8.js";import{v as t}from"./react-B9IgSVeK.js";var n=e(`App`,{web:()=>t(()=>import(`./web-Du0h1dfg.js`).then(e=>new e.AppWeb),__vite__mapDeps([0,1,2,3]))});export{n as App};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-ocPGQzbv.js","assets/vendor-DYOeoIwg.js","assets/rolldown-runtime-BM3Ffeng.js","assets/react-B9IgSVeK.js","assets/definitions-Qg1-j0J7.js"])))=>i.map(i=>d[i]);
2
- import{k as e}from"./vendor-DYOeoIwg.js";import{v as t}from"./react-B9IgSVeK.js";import{t as n}from"./definitions-Qg1-j0J7.js";function r(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return new Proxy({},{get(t,r){return(t,i,a)=>{let o=e.Capacitor.Plugins[n];if(o===void 0){a(Error(`Capacitor plugin ${n} not found`));return}if(typeof o[r]!=`function`){a(Error(`Method ${r} not found in Capacitor plugin ${n}`));return}(async()=>{try{i(await o[r](t))}catch(e){a(e)}})()}}})}})}function i(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return e.cordova.plugins[n]}})}function a(e=!1){typeof window>`u`||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!e?r(window):window.cordova!==void 0&&i(window))}var o=e(`Filesystem`,{web:()=>t(()=>import(`./web-ocPGQzbv.js`).then(e=>new e.FilesystemWeb),__vite__mapDeps([0,1,2,3,4]))});a();export{n as Directory,o as Filesystem};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-CoanRUCz.js","assets/vendor-Bb38ZAP8.js","assets/rolldown-runtime-BM3Ffeng.js","assets/react-B9IgSVeK.js","assets/definitions-yE7PUCf5.js"])))=>i.map(i=>d[i]);
2
+ import{k as e}from"./vendor-Bb38ZAP8.js";import{v as t}from"./react-B9IgSVeK.js";import{t as n}from"./definitions-yE7PUCf5.js";function r(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return new Proxy({},{get(t,r){return(t,i,a)=>{let o=e.Capacitor.Plugins[n];if(o===void 0){a(Error(`Capacitor plugin ${n} not found`));return}if(typeof o[r]!=`function`){a(Error(`Method ${r} not found in Capacitor plugin ${n}`));return}(async()=>{try{i(await o[r](t))}catch(e){a(e)}})()}}})}})}function i(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return e.cordova.plugins[n]}})}function a(e=!1){typeof window>`u`||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!e?r(window):window.cordova!==void 0&&i(window))}var o=e(`Filesystem`,{web:()=>t(()=>import(`./web-CoanRUCz.js`).then(e=>new e.FilesystemWeb),__vite__mapDeps([0,1,2,3,4]))});a();export{n as Directory,o as Filesystem};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-DaV6ODqC.js","assets/vendor-Bb38ZAP8.js","assets/rolldown-runtime-BM3Ffeng.js","assets/react-B9IgSVeK.js"])))=>i.map(i=>d[i]);
2
+ import{k as e}from"./vendor-Bb38ZAP8.js";import{v as t}from"./react-B9IgSVeK.js";var n=e(`Share`,{web:()=>t(()=>import(`./web-DaV6ODqC.js`).then(e=>new e.ShareWeb),__vite__mapDeps([0,1,2,3]))});export{n as Share};
@@ -0,0 +1 @@
1
+ import{k as e}from"./vendor-Bb38ZAP8.js";var t=e(`PushNotifications`,{});export{t as PushNotifications};
@@ -1 +1 @@
1
- import{k as e}from"./vendor-DYOeoIwg.js";var t;(function(e){e.Dark=`DARK`,e.Light=`LIGHT`,e.Default=`DEFAULT`})(t||={});var n;(function(e){e.Body=`body`,e.Ionic=`ionic`,e.Native=`native`,e.None=`none`})(n||={});var r=e(`Keyboard`);export{r as Keyboard};
1
+ import{k as e}from"./vendor-Bb38ZAP8.js";var t;(function(e){e.Dark=`DARK`,e.Light=`LIGHT`,e.Default=`DEFAULT`})(t||={});var n;(function(e){e.Body=`body`,e.Ionic=`ionic`,e.Native=`native`,e.None=`none`})(n||={});var r=e(`Keyboard`);export{r as Keyboard};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-Cn4ht-7M.js","assets/vendor-Bb38ZAP8.js","assets/rolldown-runtime-BM3Ffeng.js","assets/react-B9IgSVeK.js"])))=>i.map(i=>d[i]);
2
+ import{k as e}from"./vendor-Bb38ZAP8.js";import{v as t}from"./react-B9IgSVeK.js";var n=e(`Browser`,{web:()=>t(()=>import(`./web-Cn4ht-7M.js`).then(e=>new e.BrowserWeb),__vite__mapDeps([0,1,2,3]))});export{n as Browser};
@@ -1 +1 @@
1
- import{D as e,k as t}from"./vendor-DYOeoIwg.js";var n=class extends e{constructor(){super(...arguments),this.ERROR_PICK_FILE_CANCELED=`pickFiles canceled.`}async checkPermissions(){throw this.unimplemented(`Not implemented on web.`)}async convertHeicToJpeg(e){throw this.unimplemented(`Not implemented on web.`)}async copyFile(e){throw this.unimplemented(`Not implemented on web.`)}async pickFiles(e){let t=await this.openFilePicker(e);if(!t)throw Error(this.ERROR_PICK_FILE_CANCELED);let n={files:[]};for(let r of t){let t={blob:r,modifiedAt:r.lastModified,mimeType:this.getMimeTypeFromUrl(r),name:this.getNameFromUrl(r),path:void 0,size:this.getSizeFromUrl(r)};e?.readData&&(t.data=await this.getDataFromFile(r)),n.files.push(t)}return n}async pickDirectory(){throw this.unimplemented(`Not implemented on web.`)}async pickImages(e){return this.pickFiles(Object.assign({types:[`image/*`]},e))}async pickMedia(e){return this.pickFiles(Object.assign({types:[`image/*`,`video/*`]},e))}async pickVideos(e){return this.pickFiles(Object.assign({types:[`video/*`]},e))}async requestPermissions(e){throw this.unimplemented(`Not implemented on web.`)}async openFilePicker(e){let t=(e?.types)?.join(`,`)||``,n=e?.limit===void 0?0:e.limit;return new Promise(e=>{let r=!1,i=document.createElement(`input`);i.type=`file`,i.accept=t,i.multiple=n===0;let a=`oncancel`in i,o=()=>{r=!0,l(),e(Array.from(i.files||[]))},s=()=>{l(),e(void 0)},c=async()=>{await this.wait(500),!r&&(l(),e(void 0))},l=()=>{i.removeEventListener(`change`,o),a?i.removeEventListener(`cancel`,s):window.removeEventListener(`focus`,c)};i.addEventListener(`change`,o,{once:!0}),a?i.addEventListener(`cancel`,s,{once:!0}):window.addEventListener(`focus`,c,{once:!0}),i.click()})}async getDataFromFile(e){return new Promise((t,n)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{t((typeof r.result==`string`?r.result:``).split(`base64,`)[1]||``)},r.onerror=e=>{n(e)}})}getNameFromUrl(e){return e.name}getMimeTypeFromUrl(e){return e.type}getSizeFromUrl(e){return e.size}async wait(e){return new Promise(t=>setTimeout(t,e))}},r=t(`FilePicker`,{web:()=>new n});export{r as FilePicker};
1
+ import{D as e,k as t}from"./vendor-Bb38ZAP8.js";var n=class extends e{constructor(){super(...arguments),this.ERROR_PICK_FILE_CANCELED=`pickFiles canceled.`}async checkPermissions(){throw this.unimplemented(`Not implemented on web.`)}async convertHeicToJpeg(e){throw this.unimplemented(`Not implemented on web.`)}async copyFile(e){throw this.unimplemented(`Not implemented on web.`)}async pickFiles(e){let t=await this.openFilePicker(e);if(!t)throw Error(this.ERROR_PICK_FILE_CANCELED);let n={files:[]};for(let r of t){let t={blob:r,modifiedAt:r.lastModified,mimeType:this.getMimeTypeFromUrl(r),name:this.getNameFromUrl(r),path:void 0,size:this.getSizeFromUrl(r)};e?.readData&&(t.data=await this.getDataFromFile(r)),n.files.push(t)}return n}async pickDirectory(){throw this.unimplemented(`Not implemented on web.`)}async pickImages(e){return this.pickFiles(Object.assign({types:[`image/*`]},e))}async pickMedia(e){return this.pickFiles(Object.assign({types:[`image/*`,`video/*`]},e))}async pickVideos(e){return this.pickFiles(Object.assign({types:[`video/*`]},e))}async requestPermissions(e){throw this.unimplemented(`Not implemented on web.`)}async openFilePicker(e){let t=(e?.types)?.join(`,`)||``,n=e?.limit===void 0?0:e.limit;return new Promise(e=>{let r=!1,i=document.createElement(`input`);i.type=`file`,i.accept=t,i.multiple=n===0;let a=`oncancel`in i,o=()=>{r=!0,l(),e(Array.from(i.files||[]))},s=()=>{l(),e(void 0)},c=async()=>{await this.wait(500),!r&&(l(),e(void 0))},l=()=>{i.removeEventListener(`change`,o),a?i.removeEventListener(`cancel`,s):window.removeEventListener(`focus`,c)};i.addEventListener(`change`,o,{once:!0}),a?i.addEventListener(`cancel`,s,{once:!0}):window.addEventListener(`focus`,c,{once:!0}),i.click()})}async getDataFromFile(e){return new Promise((t,n)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{t((typeof r.result==`string`?r.result:``).split(`base64,`)[1]||``)},r.onerror=e=>{n(e)}})}getNameFromUrl(e){return e.name}getMimeTypeFromUrl(e){return e.type}getSizeFromUrl(e){return e.size}async wait(e){return new Promise(t=>setTimeout(t,e))}},r=t(`FilePicker`,{web:()=>new n});export{r as FilePicker};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-DfaIhdEx.js","assets/vendor-Bb38ZAP8.js","assets/rolldown-runtime-BM3Ffeng.js","assets/react-B9IgSVeK.js"])))=>i.map(i=>d[i]);
2
+ import{k as e}from"./vendor-Bb38ZAP8.js";import{v as t}from"./react-B9IgSVeK.js";var n;(function(e){e.Light=`light`,e.Dark=`dark`})(n||={});var r=e(`SafeArea`,{web:()=>t(()=>import(`./web-DfaIhdEx.js`).then(e=>new e.SafeAreaWeb),__vite__mapDeps([0,1,2,3]))});export{r as SafeArea};
@@ -0,0 +1 @@
1
+ import{b as e}from"./vendor-Bb38ZAP8.js";export{e as LocalNotifications};
@@ -1,3 +1,3 @@
1
- import"./app-Tg6YU_tZ.js";import{j as e}from"./vendor-DYOeoIwg.js";import{t}from"./react-B9IgSVeK.js";import{t as n}from"./diff-rows-Bf-wMfUA.js";var r=2e3;function i(e){if(e===``)return[];let t=e.split(`
1
+ import"./app-DVwAB8n7.js";import{j as e}from"./vendor-Bb38ZAP8.js";import{t}from"./react-B9IgSVeK.js";import{t as n}from"./diff-rows-Bf-wMfUA.js";var r=2e3;function i(e){if(e===``)return[];let t=e.split(`
2
2
  `);return e.endsWith(`
3
3
  `)&&t.pop(),t}function a(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a]===t[n]?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push({type:`ctx`,text:e[o],oldNo:o+1,newNo:s+1}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,text:e[o],oldNo:o+1}),o++):(a.push({type:`add`,text:t[s],newNo:s+1}),s++);for(;o<n;)a.push({type:`del`,text:e[o],oldNo:o+1}),o++;for(;s<r;)a.push({type:`add`,text:t[s],newNo:s+1}),s++;return a}function o(e,t){let n=i(e),o=i(t);return n.length>r||o.length>r?[{type:`too-large`,text:`Diff too large to render (over ${r.toLocaleString()} lines)`}]:n.length===0?o.map((e,t)=>({type:`add`,text:e,newNo:t+1})):o.length===0?n.map((e,t)=>({type:`del`,text:e,oldNo:t+1})):a(n,o)}var s=t();function c(e){return e.type!==`too-large`}function l({path:t,oldText:r,newText:i}){let{t:a}=e(`chat`),l=o(r??``,i??``),u=l.find(e=>e.type===`too-large`);return(0,s.jsx)(`div`,{"aria-label":a(`fileDiffView.diffForAria`,{path:t}),"data-testid":`file-diff`,className:`flex flex-col overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)]`,children:u?(0,s.jsx)(`div`,{"data-diff-type":`too-large`,className:`px-3 py-2 font-mono text-body-small-lighter whitespace-pre-wrap text-[var(--content-tertiary)] italic`,children:u.text}):(0,s.jsx)(n,{rows:l.filter(c)})})}export{l as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{G_ as t,Wx as n,kr as r}from"./app-DVwAB8n7.js";import{j as i}from"./vendor-Bb38ZAP8.js";import{t as a,x as o}from"./react-B9IgSVeK.js";import{Xt as s,ci as c,ni as l,qi as u}from"./icons-QG1KAFmx.js";var d=e(o(),1),f=a(),p=`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`;function m({content:e,downloadContent:a,fileName:o,mimeType:p=`text/plain`,showEdit:m,isEditing:h,onToggleEdit:g,extraActions:_}){let{t:v}=i(),{copy:y,copied:b}=t({errorMessage:v(`contentActionBar.copyFailed`)}),x=(0,d.useCallback)(()=>y(e),[y,e]),S=a??e,C=(0,d.useCallback)(()=>{r(new Blob([S],{type:p}),o)},[S,o,p]);return h?null:(0,f.jsxs)(`div`,{className:`absolute right-3 top-3 z-10 flex items-center gap-1 rounded-md bg-[var(--surface-primary)] shadow-sm`,children:[m&&g&&(0,f.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:(0,f.jsx)(s,{"aria-hidden":!0}),onClick:g,"aria-label":v(`contentActionBar.editFileAria`),className:`hover:bg-[var(--surface-base)]`}),_,(0,f.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:b?(0,f.jsx)(u,{"aria-hidden":!0}):(0,f.jsx)(c,{"aria-hidden":!0}),onClick:x,"aria-label":v(b?`contentActionBar.copiedAria`:`contentActionBar.copyFileContentsAria`),className:`hover:bg-[var(--surface-base)]`}),(0,f.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:(0,f.jsx)(l,{"aria-hidden":!0}),onClick:C,"aria-label":v(`contentActionBar.downloadFileAria`),className:`hover:bg-[var(--surface-base)]`})]})}function h({value:e,onChange:t,onSave:n}){return(0,f.jsx)(`textarea`,{className:`m-0 h-full w-full resize-none overflow-auto border-none bg-transparent p-4 text-body-medium-lighter leading-relaxed outline-none`,style:{color:`var(--content-default)`,fontFamily:p},value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),n())},spellCheck:!1})}function g({isDirty:e,isSaving:t,error:r,onSave:a,onDiscard:o}){let{t:s}=i();return(0,f.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t px-3 py-2`,style:{borderColor:`var(--border-element)`},children:[r&&(0,f.jsx)(`span`,{className:`mr-auto text-body-small-default`,style:{color:`var(--system-error)`},children:r}),(0,f.jsx)(n,{variant:`ghost`,size:`compact`,disabled:t,onClick:o,children:s(`editFooter.discard`)}),(0,f.jsx)(n,{variant:`primary`,size:`compact`,disabled:!e||t,onClick:a,children:s(t?`editFooter.saving`:`editFooter.save`)})]})}function _({content:e,readOnly:t,whiteSpace:n=`pre-wrap`,onStartEdit:r}){return(0,f.jsx)(`pre`,{className:`m-0 h-full overflow-auto p-4 text-body-medium-lighter leading-relaxed${t?``:` cursor-text`}`,style:{color:`var(--content-default)`,fontFamily:p,whiteSpace:n},onClick:t?void 0:r,children:e})}export{_ as i,g as n,h as r,m as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-BQzpPH7j.js","assets/react-B9IgSVeK.js","assets/rolldown-runtime-BM3Ffeng.js","assets/vendor-Bb38ZAP8.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$h as t,$m as n,A as r,Ax as i,Bb as a,Bm as o,Bx as s,Cx as c,Db as l,Dh as u,Di as d,Dp as f,Du as p,Eb as m,Ei as h,Er as g,Ex as _,Fa as v,Fb as y,Fm as b,G_ as x,Gb as S,Gc as C,Gh as w,Gl as T,Gu as E,Hb as D,Hx as O,Ib as k,Im as A,Iy as j,Jb as M,Jm as N,Jy as ee,K_ as P,Kh as te,Km as F,Ku as I,La as L,Lm as ne,Lx as re,M as ie,Mi as ae,Nb as oe,Ni as se,Nx as ce,Ob as le,Oh as ue,Om as de,Ox as fe,Oy as pe,Pi as me,Pm as he,Px as R,Py as ge,Qa as _e,Qh as ve,Qm as ye,R as be,Rh as xe,Rm as Se,Sy as Ce,Tg as z,Th as we,Ty as Te,Ul as Ee,Uu as De,Vx as B,Wu as Oe,Wx as V,Xb as ke,Xm as Ae,Xy as je,Y_ as Me,Ym as Ne,Zm as Pe,_g as Fe,_n as Ie,_y as Le,ad as Re,ag as ze,ah as Be,an as Ve,au as He,ax as Ue,bb as We,bp as Ge,bx as Ke,ci as qe,cn as Je,cy as Ye,dg as Xe,dl as Ze,dn as Qe,du as $e,ef as et,eh as tt,et as nt,eu as rt,ex as it,fb as at,fl as ot,fu as st,gg as ct,gl as lt,gy as ut,hl as dt,hu as ft,ib as pt,iu as mt,j as ht,jb as gt,jg as H,ji as _t,jm as vt,js as yt,jx as bt,ky as xt,lg as St,lh as Ct,ll as wt,lx as Tt,ml as Et,mu as Dt,mx as Ot,nb as kt,nh as At,nx as jt,og as Mt,oh as Nt,on as Pt,ox as U,pl as Ft,pm as It,pu as Lt,qr as Rt,qx as zt,rl as Bt,sb as Vt,tb as Ht,th as Ut,ug as Wt,uh as Gt,ul as Kt,uu as qt,vl as Jt,wb as Yt,wg as Xt,wi as Zt,wp as Qt,wx as W,wy as $t,xm as en,xp as tn,yl as nn,yp as rn,z as an,zb as on}from"./app-DVwAB8n7.js";import{E as sn,I as G,Jn as cn,N as ln,Q as un,Zn as K,_ as dn,er as q,f as fn,g as pn,j as J,k as mn}from"./vendor-Bb38ZAP8.js";import{_ as hn,f as gn,n as _n,t as vn,v as yn,x as bn}from"./react-B9IgSVeK.js";import{B as xn,Ca as Sn,E as Cn,Et as wn,Hi as Tn,Ja as En,Ki as Dn,Q as On,Ri as kn,Tt as An,_n as jn,ci as Mn,gn as Nn,hr as Pn,i as Fn,kt as In,nt as Ln,qi as Rn,qn as Y,yr as zn}from"./icons-QG1KAFmx.js";import{t as X}from"./detail-card-CH7nCTwL.js";import{t as Bn}from"./environment-store-2DxNubrI.js";import{t as Vn}from"./app-info-reMTZ2pt.js";import{a as Hn,i as Un,l as Wn,o as Gn}from"./machine-sizes-CrcROrDy.js";import{t as Kn}from"./format-countdown-BwaE898Q.js";import{a as qn,i as Jn,n as Yn,r as Xn,t as Zn}from"./assistant-status-panel-CvQuUFvM.js";import{t as Qn}from"./trait-cycle-row-CEjLtk4k.js";import{t as $n}from"./use-hotkey-recorder-D_1QmHir.js";import{t as er}from"./settings-divider-BUvXsYUP.js";var tr=En(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),nr=En(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),rr=En(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Z=e(bn(),1),Q=vn();function ir(){let{t:e}=J(`settings`),t=H.use.velvet(),{theme:n,setThemePreference:r}=qe(),i=[{value:`system`,label:e(`themePicker.system`),icon:(0,Q.jsx)(jn,{className:`h-4 w-4`})},{value:`light`,label:e(`themePicker.light`),icon:(0,Q.jsx)(xn,{className:`h-4 w-4`})},{value:`dark`,label:e(`themePicker.dark`),icon:(0,Q.jsx)(Nn,{className:`h-4 w-4`})},...t?[{value:`velvet`,label:e(`themePicker.velvet`),icon:(0,Q.jsx)(Pn,{className:`h-4 w-4`})}]:[]];return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`themePicker.title`)}),(0,Q.jsx)(`div`,{className:`mt-2 max-w-[360px]`,children:(0,Q.jsx)(fe,{ariaLabel:e(`themePicker.ariaLabel`),value:n,onChange:r,items:i})})]})}var ar=he,or=`Please choose a different handle.`;async function sr(e,t){let{data:n,error:r,response:i}=await Wt({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:D(r,void 0,`Failed to save handle.`)??`Failed to save handle.`};if(i.ok&&n)return{kind:`ok`,data:n};if(i.status===409){let{message:e}=Se(r,`handle`,ar.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=Se(r,`handle`,or);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:D(r,i,`Failed to save handle.`)}}async function cr(e,t,n){let{data:r,error:i,response:o}=await ze({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(a(o,i,`Failed to check handle availability.`),!o.ok||!r)throw new on(o.status,o.status===429?`Too many checks — try again in a moment.`:D(i,o,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function lr(e){return/\d{2,}$/.test(e)}var ur=300,dr=1400;function fr({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:a,onSaved:o,saveSuccessToast:s,fieldId:c}){let{t:l}=J(),[u,d]=(0,Z.useState)(e),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(`idle`),[v,y]=(0,Z.useState)(null),b=fn(),x=(0,Z.useRef)(null),S=(0,Z.useMemo)(()=>u.trim().toLowerCase(),[u]),C=S===e.toLowerCase();(0,Z.useEffect)(()=>{if(C||S.length===0){h(!1),x.current?.abort();return}let e=new AbortController;x.current?.abort(),x.current=e,h(!0);let t=window.setTimeout(async()=>{try{let t=await i(S,e.signal);e.signal.aborted||p(t)}catch(t){e.signal.aborted||y(t instanceof Error?t.message:l(`profileCard.checkAvailabilityFailed`))}finally{e.signal.aborted||h(!1)}},ur);return()=>{window.clearTimeout(t),e.abort()}},[S,C,i,l]);let w=(()=>{if(v)return v;if(f&&!f.available){let e=f.code;return f.message??(e?ar[e]:l(`profileCard.chooseDifferentHandle`))}return null})(),T=w?n:C?r??null:m?l(`profileCard.checkingAvailability`):f?.available?l(`profileCard.availableHelper`):null,E=!C&&!m&&f?.available!==!1&&g!==`saving`,D=(0,Z.useCallback)(async()=>{if(!E)return;_(`saving`),y(null);let e=await a(S);if(e.kind===`ok`){_(`saved`),o(e.data),W.success(s),window.setTimeout(()=>_(`idle`),dr);return}if(e.kind===`taken`){_(`idle`),p({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){_(`idle`),p({available:!1,code:e.code,message:e.message});return}_(`error`),y(e.message),W.error(e.message)},[E,S,o,a,s]),O=(()=>{if(C&&u.length>0||u.length===0)return null;let e=m?`checking`:f?.available?`available`:f?.available===!1?`invalid`:null;return e?(0,Q.jsx)(dn,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(pn.span,{initial:b?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:b?void 0:{opacity:0,scale:.85},transition:{duration:.14,ease:`easeOut`},className:`flex items-center`,"aria-hidden":e!==`available`&&e!==`invalid`,children:[e===`checking`&&(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(Rn,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":l(`profileCard.available`)}),e===`invalid`&&(0,Q.jsx)(Tn,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":l(`profileCard.notAvailable`)})]},e)}):null})(),k=(()=>{switch(g){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(Y,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),l(`profileCard.saving`)]});case`saved`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(Rn,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),l(`profileCard.saved`)]});default:return l(`profileCard.save`)}})();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(R,{label:t,value:u,onChange:e=>{d(e.target.value.replace(/\s+/g,``)),p(null),y(null)},autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,maxLength:30,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),rightIcon:O,errorText:w??void 0,helperText:T??void 0,"aria-invalid":!!w,fullWidth:!0,"data-testid":`${c}-input`}),(!C||g!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(V,{variant:`primary`,size:`compact`,onClick:D,disabled:!E,"aria-live":`polite`,"data-testid":`${c}-save`,children:k})})]})}function pr({initial:e,onSaved:t}){let{t:n}=J(),r=Qt.use.refreshSession(),i=lr(e.username)?n(`profileCard.userHandleIdleAutoGenerated`):void 0,a=(0,Z.useCallback)(async e=>await ne({username:e}),[]),o=(0,Z.useCallback)((e,t)=>b(e,t),[]),s=(0,Z.useCallback)(e=>{t(e),r()},[t,r]);return(0,Q.jsx)(fr,{initialHandle:e.username,inputLabel:n(`profileCard.userHandleLabel`),helperText:n(`profileCard.handleHelper`),idleHelperText:i,checkAvailable:o,save:a,onSaved:s,saveSuccessToast:n(`profileCard.profileUpdated`),fieldId:`user-handle`})}function mr({assistant:e,onSaved:t}){let{t:n}=J(),r=e.handle??``,i=K({...C({path:{assistant_id:e.id}})}).data?.results?.[0],a=!!i&&i.subdomain.toLowerCase()===r.toLowerCase(),o=r.length===0?n(`profileCard.assistantHandleIdleEmpty`):void 0,s=(0,Z.useCallback)(async t=>await sr(e.id,t),[e.id]),c=(0,Z.useCallback)((t,n)=>cr(e.id,t,n),[e.id]);return a?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(R,{label:n(`profileCard.assistantHandleLabel`),value:r,readOnly:!0,disabled:!0,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),fullWidth:!0,"data-testid":`assistant-handle-input`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:(0,Q.jsx)(ln,{i18nKey:`profileCard.handleLocked`,components:{releaseLink:(0,Q.jsx)(_n,{to:`${m.channels}?setup=email&release=1`,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`})}})})]}):(0,Q.jsx)(fr,{initialHandle:r,inputLabel:n(`profileCard.assistantHandleLabel`),helperText:n(`profileCard.handleHelper`),idleHelperText:o,checkAvailable:c,save:s,onSaved:t,saveSuccessToast:n(`profileCard.assistantHandleUpdated`),fieldId:`assistant-handle`})}function hr(){let{t:e}=J();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-busy":!0,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Tt,{className:`h-3 w-16`}),(0,Q.jsx)(Tt,{className:`h-9 w-full rounded-md`}),(0,Q.jsx)(Tt,{className:`h-3 w-72`})]}),(0,Q.jsx)(Tt,{className:`h-9 w-full rounded-md`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(Tt,{className:`h-3 w-60`}),(0,Q.jsx)(Tt,{className:`h-7 w-16 rounded-md`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:e(`profileCard.loading`)})]})}function gr(){return(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`})}function _r({assistant:e,showHandles:t=!0,children:n}={}){let{t:r}=J(),i=Qt.use.user?.()?.email??null;return(0,Q.jsx)(X,{title:r(`profileCard.title`),subtitle:r(`profileCard.subtitle`),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i&&(0,Q.jsx)(`div`,{className:`max-w-[420px]`,children:(0,Q.jsx)(R,{label:r(`profileCard.emailLabel`),value:i,disabled:!0,readOnly:!0})}),t&&(0,Q.jsxs)(Q.Fragment,{children:[i&&(0,Q.jsx)(gr,{}),(0,Q.jsx)(vr,{assistant:e})]}),n!=null&&(0,Q.jsxs)(Q.Fragment,{children:[(i||t)&&(0,Q.jsx)(gr,{}),n]})]})})}function vr({assistant:e}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=fn(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return A().then(t=>{e||n(t)}).catch(t=>{e||i(t instanceof Error?t.message:`Failed to load profile.`)}),()=>{e=!0}},[]),r?(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:r}):t?(0,Q.jsxs)(pn.div,{initial:a?!1:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},className:`flex flex-col gap-6`,children:[(0,Q.jsx)(pr,{initial:t,onSaved:n}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(mr,{assistant:o,onSaved:s})]})]}):(0,Q.jsx)(hr,{})}var yr=.5,br={dazed:.55,bashful:.4},xr=.224,Sr=`var(--surface-sunken)`,Cr=64;function wr(e){return br[e]??yr}function Tr(e,t,n,r){let i=e?.eyeStyles.find(e=>e.id===t);if(!i||i.paths.length===0)return null;let a=d(i.paths.map(e=>h(e.svgPath)));if(a.w<=0||a.h<=0)return null;let o=n*(r?yr:wr(t)),s=Math.min(o/a.w,o/a.h),c=n/2-(a.x+a.w/2)*s,l=n/2-(a.y+a.h/2)*s;return{paths:i.paths,transform:`matrix(${s},0,0,${s},${c},${l})`}}function Er({components:e,eyeStyle:t,color:n,primary:r=!1,fieldColor:i,size:a=Cr,className:o}){let s=(0,Z.useMemo)(()=>Tr(e,t,a,r),[e,t,a,r]),c=e?.colors.find(e=>e.id===n)?.hex,l=i??c,u=a*xr;return(0,Q.jsxs)(`svg`,{"aria-hidden":`true`,"data-testid":`app-icon-preview`,className:o,width:a,height:a,viewBox:`0 0 ${a} ${a}`,style:{display:`block`,flexShrink:0},children:[(0,Q.jsx)(`rect`,{"data-testid":`app-icon-preview-field`,width:a,height:a,rx:u,ry:u,fill:l??Sr}),s?(0,Q.jsx)(`g`,{"data-testid":`app-icon-preview-eyes`,transform:s.transform,children:s.paths.map((e,t)=>(0,Q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))}):null]})}var Dr={production:`#4C9B50`,staging:`#E9C91A`,dev:`#FF88C9`};Zt.eyeStyles.find(e=>e.id===`quirky`);var Or=`avatar-eyes-`,kr={eyeStyle:`quirky`,color:`green`};function Ar(e,t){return`${Or}${e}-${t}`}function jr(e){if(e===null||e.kind!==`character`)return null;let t=e.traits;return de(t)?Ar(t.eyeStyle,t.color):null}function Mr(e){return e!==null&&e.startsWith(Or)}function Nr(e){if(e===null||!Mr(e))return null;let t=e.slice(12),n=t.indexOf(`-`);return n<=0||n===t.length-1?null:{eyeStyle:t.slice(0,n),color:t.slice(n+1)}}function Pr(e,t){let n=jr(e);return{target:n,availableMatch:t.supported&&n!==null&&t.available.includes(n)}}var Fr=160;function Ir(e,t,n){return t<=0?0:(e+n+t)%t}function Lr(e,t){let n=e?.findIndex(e=>e.id===t)??-1;return n>=0?n:0}function Rr({open:e,onClose:t,components:n,currentIcon:r,targetIcon:i,canSyncAvatar:a,availableIcons:o,onApply:s,onReset:c}){let{t:l}=J(`settings`),u=tt(),[d,f]=(0,Z.useState)(0),[p,m]=(0,Z.useState)(0),[h,g]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),b=a?Nr(i):null;(0,Z.useEffect)(()=>{if(!e)return;let t=Nr(r)??Nr(i)??kr;f(Lr(n?.eyeStyles,t.eyeStyle)),m(Lr(n?.colors,t.color)),y(!1)},[e,n,r,i]);let x=n?.eyeStyles[d],S=n?.colors[p],C=x?.id??kr.eyeStyle,w=S?.id??kr.color,T=Ar(C,w),E=T!==r&&o.includes(T),D=async e=>{g(!0),y(!1);try{await e()?t():y(!0)}finally{g(!1)}};return(0,Q.jsx)(_.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Q.jsxs)(_.Content,{size:`sm`,"data-testid":`app-icon-modal`,children:[(0,Q.jsx)(_.Header,{children:(0,Q.jsx)(_.Title,{children:l(`appIcon.title`)})}),(0,Q.jsxs)(_.Body,{className:`space-y-4`,children:[(0,Q.jsx)(`div`,{className:`flex justify-center`,children:(0,Q.jsx)(`div`,{className:`rounded-2xl bg-[var(--surface-sunken)] p-6`,children:(0,Q.jsx)(Er,{components:n,eyeStyle:C,color:w,size:Fr})})}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(Qn,{label:l(`appIcon.eyes`),value:C,onPrev:()=>f(Ir(d,n?.eyeStyles.length??0,-1)),onNext:()=>f(Ir(d,n?.eyeStyles.length??0,1))}),(0,Q.jsx)(Qn,{label:l(`appIcon.color`),value:w,colorHex:S?.hex,onPrev:()=>m(Ir(p,n?.colors.length??0,-1)),onNext:()=>m(Ir(p,n?.colors.length??0,1))})]}),b===null?null:(0,Q.jsx)(V,{type:`button`,variant:`outlined`,fullWidth:!0,disabled:h,onClick:()=>{b!==null&&(f(Lr(n?.eyeStyles,b.eyeStyle)),m(Lr(n?.colors,b.color)),y(!1))},children:l(`appIcon.matchAvatar`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:l(u?`appIcon.androidApplyNote`:`appIcon.note`)}),v?(0,Q.jsx)(`p`,{role:`alert`,className:`text-body-small-lighter text-[color:var(--content-negative)]`,children:l(u?`appIcon.androidError`:`appIcon.error`)}):null]}),(0,Q.jsxs)(_.Footer,{children:[r===null?null:(0,Q.jsx)(V,{type:`button`,variant:`outlined`,disabled:h,onClick:()=>void D(c),children:l(`appIcon.reset`)}),(0,Q.jsx)(V,{type:`button`,variant:`primary`,disabled:h||!E,onClick:()=>void D(()=>s(T)),children:l(`appIcon.apply`)})]})]})})}var zr=`AppIcon`,Br=mn(zr);function Vr(){return{supported:!1,current:null,available:[]}}function Hr(){return N()&&sn.isPluginAvailable(zr)}async function Ur(){if(!Hr())return Vr();try{let{supported:e,current:t,available:n}=await Br.getState();return{supported:e===!0,current:typeof t==`string`?t:null,available:n??[]}}catch(e){return y(e,{context:`app_icon_get_state`,bestEffort:!0}),Vr()}}async function Wr(e){if(!Hr())return!1;try{let{ok:t,error:n}=await Br.set({name:e});return t===!0?!0:(y(Error(n??`setAlternateIconName failed`),{context:`app_icon_set`,bestEffort:!0}),!1)}catch(e){return y(e,{context:`app_icon_set`,bestEffort:!0}),!1}}var Gr={supported:!1,current:null,available:[]};function Kr(e,t){return e.supported===t.supported&&e.current===t.current&&e.available.length===t.available.length&&e.available.every((e,n)=>e===t.available[n])}var qr=jt(un()((e,t)=>({snapshot:Gr,setSnapshot:n=>{Kr(t().snapshot,n)||e({snapshot:n})}}))),Jr=[];function Yr(e){let t=Ut(),n=tt(),r=H.use.androidAvatarAppIcon(),i=t||n&&r,{state:a}=It(e),o=qr.use.snapshot(),s=qr.use.setSnapshot(),c=(0,Z.useCallback)(async()=>{if(!i)return s(Gr),Gr;let e=await Ur();return s(e),e},[i,s]);(0,Z.useEffect)(()=>{c()},[c]),p(`app.resume`,()=>{c()});let l=i&&o.supported,{target:u,availableMatch:d}=Pr(a,o),f=d&&u!==o.current,m=o.available,h=(0,Z.useCallback)(async e=>{if(!l||!m.includes(e))return!1;await Wr(e);let t=await c();return t.supported&&t.current===e},[l,m,c]),g=(0,Z.useCallback)(async()=>{if(!l)return!1;await Wr(null);let e=await c();return e.supported&&e.current===null},[l,c]);return{enabled:l,currentIcon:l?o.current:null,targetIcon:l?u:null,availableIcons:l?m:Jr,canSyncAvatar:f,apply:h,reset:g}}var Xr=[`ai.vocify-inc.vellum-assistant-ios`,`ai.vellum.assistant`],Zr={"":`production`,".staging":`staging`,".dev":`dev`};function Qr(e){for(let t of Xr){if(!e.startsWith(t))continue;let n=Zr[e.slice(t.length)];if(n)return n}return null}async function $r(){try{let{App:e}=await yn(async()=>{let{App:e}=await import(`./esm-BQzpPH7j.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t}=await e.getInfo();return Qr(t)}catch(e){return console.debug(`[shell-environment] no native shell identity:`,e),null}}function ei(){let[e,t]=(0,Z.useState)();return(0,Z.useEffect)(()=>{let e=!0;return $r().then(n=>{e&&t(n)}),()=>{e=!1}},[]),e}var ti=32,ni={dev:{displayP3:`color(display-p3 0.9387 0.55755 0.7777)`,srgb:Dr.dev},staging:{displayP3:`color(display-p3 0.89313 0.79283 0.2841)`,srgb:Dr.staging}},ri={local:`dev`,dev:`dev`,staging:`staging`};function ii(){return typeof CSS>`u`||typeof CSS.supports!=`function`?!1:CSS.supports(`color`,`color(display-p3 1 1 1)`)}function ai(e){if(e)return ii()?e.displayP3:e.srgb}function oi(e){if(e)return e;if(e===null)return ri.local}function si(e,t){let n=oi(e);if(!n)return;let r=ni[n];return t?r?.srgb:ai(r)}function ci(){let e=Ye.use.activeAssistantId(),t=Yr(e);return t.enabled?(0,Q.jsx)(li,{assistantId:e,sync:t}):null}function li({assistantId:e,sync:t}){let{t:n}=J(`settings`),{components:r}=It(e),i=Rt(),a=ei(),o=tt(),[s,c]=(0,Z.useState)(!1),l=r??i,u=Nr(t.currentIcon),d=u??kr,f=u===null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:n(`appIcon.title`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:n(`appIcon.description`)})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,Q.jsx)(Er,{components:l,eyeStyle:d.eyeStyle,color:d.color,primary:f,fieldColor:f?si(a,o):void 0,size:ti}),(0,Q.jsx)(V,{variant:`outlined`,onClick:()=>c(!0),children:n(`appIcon.change`)})]})]}),(0,Q.jsx)(Rr,{open:s,onClose:()=>c(!1),components:l,currentIcon:t.currentIcon,targetIcon:t.targetIcon,canSyncAvatar:t.canSyncAvatar,availableIcons:t.availableIcons,onApply:t.apply,onReset:t.reset})]})}var ui=Bt({query:{hosting:`platform`}});function di(){let{t:e}=J(`settings`),t=nt(),n=K(ui),r=n.data?.results??[];return n.isPending||r.length<2?null:(0,Q.jsx)(X,{title:e(`assistantPicker.title`),subtitle:e(`assistantPicker.subtitle`),children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:r.map(n=>{let r=n.id===t;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${r?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(jn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:n.name||e(`assistantPicker.unnamed`)}),n.status!==`active`&&(0,Q.jsx)(re,{tone:`warning`,children:n.status})]})})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:r?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--system-positive-default)]`,children:[(0,Q.jsx)(Rn,{className:`h-4 w-4`}),e(`assistantPicker.active`)]}):(0,Q.jsx)(V,{variant:`outlined`,size:`compact`,disabled:n.status!==`active`,onClick:()=>{we(n.id),W.success(e(`assistantPicker.switchedToast`))},children:e(`assistantPicker.switch`)})})]},n.id)})})})}var fi=[0,300,600,3600,10800,86400,259200,604800,1209600,2592e3],pi=new Set([300,600]);function mi(e,t){if(e===0)return t(`assistantSleepPolicy.neverSleep`);let n=Math.floor(e/86400),r=Math.floor(e%86400/3600);if(n>0&&r>0)return t(`assistantSleepPolicy.daysHours`,{days:n,hours:r});if(n>0)return t(`assistantSleepPolicy.days`,{days:n});if(r>0)return t(`assistantSleepPolicy.hours`,{hours:r});let i=Math.floor(e/60);return i>0?t(`assistantSleepPolicy.minutes`,{minutes:i}):t(`assistantSleepPolicy.seconds`,{seconds:e})}function hi(e,t){switch(e){case 0:return t(`assistantSleepPolicy.presetNever`);case 300:return t(`assistantSleepPolicy.preset5Min`);case 600:return t(`assistantSleepPolicy.preset10Min`);case 3600:return t(`assistantSleepPolicy.preset1Hour`);case 10800:return t(`assistantSleepPolicy.preset3Hours`);case 86400:return t(`assistantSleepPolicy.preset1Day`);case 259200:return t(`assistantSleepPolicy.preset3Days`);case 604800:return t(`assistantSleepPolicy.preset7Days`);case 1209600:return t(`assistantSleepPolicy.preset14Days`);case 2592e3:return t(`assistantSleepPolicy.preset30Days`);default:return mi(e,t)}}function gi({assistantId:e}){let{t}=J(`settings`),n=q(),r=Bn.use.isNonProduction(),i=(0,Z.useMemo)(()=>fi.filter(e=>!pi.has(e)||r),[r]),{data:a,isLoading:o,isError:s}=K(dt({path:{id:e}})),c=(0,Z.useMemo)(()=>a?.idle_timeout_seconds??259200,[a]),[l,u]=(0,Z.useState)(null),d=l??c,f=l!==null,p=He({onSuccess:()=>{W.success(t(`assistantSleepPolicy.savedToast`)),u(null),n.invalidateQueries({queryKey:lt({path:{id:e}})})},onError:()=>{W.error(t(`assistantSleepPolicy.saveErrorToast`))}});return o?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),t(`assistantSleepPolicy.loading`)]}):s?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:t(`assistantSleepPolicy.loadError`)}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t(`assistantSleepPolicy.idleTimeout`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:t(`assistantSleepPolicy.idleTimeoutDescription`)}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:i.map(e=>(0,Q.jsx)(V,{variant:`outlined`,active:d===e,onClick:()=>u(e),children:hi(e,t)},e))}),(0,Q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:t(`assistantSleepPolicy.current`,{duration:mi(d,t)})})]}),f&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(V,{variant:`primary`,leftIcon:p.isPending?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>p.mutate({path:{id:e},body:{idle_timeout_seconds:d}}),disabled:p.isPending,children:t(`assistantSleepPolicy.save`)}),(0,Q.jsx)(V,{variant:`outlined`,onClick:()=>u(null),disabled:p.isPending,children:t(`assistantSleepPolicy.cancel`)})]})]})}function _i(e,t,n){let r=[e.version];return e.version===n&&r.push(G(`settings:assistantUpgrades.latestSuffix`)),t&&e.version===t&&r.push(G(`settings:assistantUpgrades.currentSuffix`)),r.join(` `)}var vi=3e3;function yi({version:e,assistantId:t}){let{onTap:n,message:r}=Jn(t);return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`block min-w-0 break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:n,children:e??`—`}),r&&(0,Q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:r})]})}function bi({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:r}){let{t:i}=J(`settings`),a=Re.use.rollbackEnabled(),o=H.use.previewChannel(),s=q(),l=ae(n,o),u=l===`preview`,[d,f]=(0,Z.useState)(!1),p=(0,Z.useRef)(null),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),S=e=>e&&p.current&&e===p.current?(queueMicrotask(()=>{x(i(v?`assistantUpgrades.successRolledBack`:`assistantUpgrades.successUpdated`,{version:p.current})),f(!1),p.current=null,h(null),W.success(i(v?`assistantUpgrades.toastRollbackComplete`:`assistantUpgrades.toastUpdateComplete`),{id:`runtime-upgrade-complete`,tone:`strong`}),r?.()}),!1):vi;K({...Ft({path:{id:e}}),refetchInterval:d?e=>S(e.state.data?.current_release_version):!1});let{data:C,isLoading:w}=K(rt({query:{channel:l}})),T=C?.find(e=>e.is_stable!==!1)??C?.[0],E=m??T?.version??null,D=(0,Z.useMemo)(()=>{if(!a||!E||!t)return!1;let e=Gt(E),n=Gt(t);return!e||!n?!1:Ct(e,n)<0},[a,E,t]),O=(0,Z.useMemo)(()=>{if(!E)return!1;if(!t)return!0;let e=Gt(E),n=Gt(t);if(!e||!n)return E!==t;let r=Ct(e,n);return a?r!==0:r>0},[a,E,t]),k=cn({mutationFn:async t=>{let{data:n}=await ct({path:{id:e},body:t,throwOnError:!0});return n}}),A=cn({mutationFn:async t=>{let{data:n}=await Xe({path:{id:e},body:t,throwOnError:!0});return n}}),j=async()=>{_(!1),x(null);let t=a?E??void 0:void 0;try{if(D){let e=await A.mutateAsync({version:t});p.current=e.version??t??null,W.success(e.detail||i(`assistantUpgrades.toastRollbackInitiated`,{version:t}))}else{let e=await k.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){W.warning(e.detail);return}p.current=e.version??t??null,W.success(e.detail||i(`assistantUpgrades.toastUpdateInitiated`,{version:e.version??t??i(`assistantUpgrades.latest`)}))}y(D),f(!0),s.invalidateQueries({queryKey:Et({path:{id:e}})})}catch{W.error(i(D?`assistantUpgrades.toastRollbackFailed`:`assistantUpgrades.toastUpdateFailed`))}},M=i(u?`assistantUpgrades.previewRelease`:O?D?`assistantUpgrades.rollbackTo`:`assistantUpgrades.updateTo`:`assistantUpgrades.selected`);return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i(`assistantUpgrades.current`)}),(0,Q.jsx)(yi,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:M}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 md:flex-row md:items-center md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`block min-w-0 flex-1`,children:w?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`}),i(`assistantUpgrades.loading`)]}):C&&C.length>0?a?(0,Q.jsx)(Ot,{value:E??``,onChange:e=>h(e===T?.version?null:e),disabled:d||k.isPending||A.isPending,options:C.map(e=>({value:e.version,label:_i(e,t,T?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:T?_i(T,t,T.version):`—`}):i(`assistantUpgrades.noReleases`)}),(0,Q.jsx)(V,{variant:D?`outlined`:`primary`,className:`min-w-[160px] shrink-0`,leftIcon:k.isPending||A.isPending||d?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),onClick:()=>_(!0),disabled:!O||k.isPending||A.isPending||d||w||!C?.length,children:i(d?v?`assistantUpgrades.rollingBack`:`assistantUpgrades.updating`:D?`assistantUpgrades.rollback`:u?`assistantUpgrades.updatePreview`:`assistantUpgrades.update`)})]})]})]}),u&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:(0,Q.jsx)(ln,{ns:`settings`,i18nKey:`assistantUpgrades.usingPreviewReleases`,components:{stableLink:(0,Q.jsx)(`a`,{href:`#preview-release-channel`,className:`text-[var(--primary-base)] underline-offset-2 hover:underline`})}})}),!O&&t&&E&&!w&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:b??i(`assistantUpgrades.alreadyOnVersion`)}),(0,Q.jsx)(c,{open:g,title:i(D?`assistantUpgrades.confirmRollbackTitle`:u?`assistantUpgrades.confirmPreviewTitle`:`assistantUpgrades.confirmUpdateTitle`),message:D?i(`assistantUpgrades.confirmRollbackMessage`,{version:E??i(`assistantUpgrades.unknown`)}):i(u?`assistantUpgrades.confirmPreviewMessage`:`assistantUpgrades.confirmUpdateMessage`,{version:E??i(`assistantUpgrades.latest`)}),confirmLabel:i(D?`assistantUpgrades.rollback`:u?`assistantUpgrades.updatePreview`:`assistantUpgrades.update`),onConfirm:j,onCancel:()=>_(!1)})]})}function xi({assistantId:e,currentVersion:t,onUpgradeComplete:n}){let{t:r}=J(`settings`),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),{data:l,isLoading:u}=K(rt({query:{stable:!0,limit:100}})),d=(0,Z.useMemo)(()=>_t(l),[l]),f=d?.version,p=t?se(t,f):!!f,m=me({assistantId:e,targetVersion:f});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:r(`assistantUpgrades.current`)}),(0,Q.jsx)(yi,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:r(`assistantUpgrades.updateTo`)}),(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:u?r(`assistantUpgrades.loading`):f&&d?_i(d,t,f):r(`assistantUpgrades.noReleases`)})]})]}),(0,Q.jsx)(V,{variant:`primary`,className:`min-w-[160px]`,leftIcon:m.isPending?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),onClick:()=>a(!0),disabled:m.isPending||u||!f||!p,children:m.isPending?r(`assistantUpgrades.updating`):f?r(`assistantUpgrades.updateToVersion`,{version:f}):r(`assistantUpgrades.update`)}),o&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:o}),!o&&!p&&f&&!u&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:r(`assistantUpgrades.alreadyOnVersion`)}),(0,Q.jsx)(c,{open:i,title:r(`assistantUpgrades.confirmUpdateTitle`),message:r(`assistantUpgrades.confirmUpdateMessage`,{version:f??r(`assistantUpgrades.latest`)}),confirmLabel:r(`assistantUpgrades.update`),onConfirm:async()=>{a(!1),s(null);try{s(r(`assistantUpgrades.successUpdated`,{version:(await m.upgrade()).version??f??r(`assistantUpgrades.latest`)})),W.success(r(`assistantUpgrades.toastUpdateComplete`),{id:`runtime-upgrade-complete`,tone:`strong`}),n?.()}catch(e){W.error(e instanceof Error?e.message:r(`assistantUpgrades.toastUpdateFailed`))}},onCancel:()=>a(!1)})]})}function Si(){let{t:e}=J(`settings`),t=tn({platformHostedOnly:!0}),n=Ge(),r=Qt.use.user()?.id??null,i=Qt.use.logout(),[a,o]=(0,Z.useState)(!1),s=qt({onSuccess:async()=>{W.success(e(`deleteAccountSection.toastRequested`)),vt(r),await i(),yt(m.account.login)},onError:()=>{W.error(e(`deleteAccountSection.toastFailed`))}}),l=t===`full`&&n;return(0,Z.useEffect)(()=>{l&&a&&o(!1)},[l,a]),t===`gated`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`deleteAccountSection.title`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`deleteAccountSection.description`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:t===`disabled`?(0,Q.jsx)(Qe,{children:e(`deleteAccountSection.platformLoginNotice`)}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(V,{variant:`dangerOutline`,onClick:()=>o(!0),disabled:s.isPending||l,className:`self-start`,children:e(`deleteAccountSection.deleteMyAccount`)}),l&&(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})})]}),(0,Q.jsx)(c,{open:a,title:e(`deleteAccountSection.confirmTitle`),message:e(`deleteAccountSection.confirmMessage`),confirmLabel:e(`deleteAccountSection.confirmLabel`),destructive:!0,onConfirm:()=>{if(l){o(!1);return}o(!1),s.mutate({})},onCancel:()=>o(!1)})]})}function Ci({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:a}){return(0,Q.jsx)(X,{title:e,subtitle:t,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`ul`,{className:`space-y-3`,children:n.map(({icon:e,text:t})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`},children:(0,Q.jsx)(e,{size:14,style:{color:`var(--content-secondary)`},"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]},t))}),(0,Q.jsx)(V,{variant:`primary`,size:`regular`,leftIcon:i,onClick:a,className:`self-start`,children:r})]})})}function wi({promotion:e}){let{t}=J(`settings`),{appName:n,target:i}=e;return(0,Z.useEffect)(()=>{Pt(`settings`,i)},[i]),(0,Q.jsx)(Ci,{title:n===null?t(`nativeAppCard.titleGeneric`):t(`nativeAppCard.title`,{appName:n}),subtitle:n===null?t(`nativeAppCard.subtitleGeneric`):t(`nativeAppCard.subtitle`,{appName:n}),benefits:[{icon:Sn,text:t(`nativeAppCard.benefitPush`)},{icon:tr,text:t(`nativeAppCard.benefitBiometric`)},{icon:rr,text:t(`nativeAppCard.benefitHaptics`)},{icon:Ln,text:t(`nativeAppCard.benefitHomeScreen`)}],ctaLabel:t(`nativeAppCard.download`),ctaLeftIcon:(0,Q.jsx)(Ln,{size:16}),onAction:()=>{Ve(`click`,`settings`,i),ie(i),r(i)}})}function Ti(){let e=ye(),t=Pe(),r=Ae(),i=n();return!e&&!t&&!r&&!i?null:(0,Q.jsx)(wi,{promotion:ht(e||t?`ios`:r?`android`:null)})}var Ei=`0.10.0`;function Di(){return Nt(Ei)}var Oi=`/v1/remote-web/pairing-challenge`,ki=`/v1/remote-web/pairing-verification`,Ai=`/v1/remote-web/pairing-requests`,ji=`${Ai}/approve`,Mi=`${Ai}/deny`;function Ni(){return G(`settings:pairDeviceClient.connectivityHint`)}var Pi=class extends Error{hint;status;code;constructor(e,t={}){super(e),this.name=`PairDeviceError`,this.hint=t.hint,this.status=t.status,this.code=t.code}},Fi=5e3;function Ii(){if(typeof window>`u`)return null;let e=Te(),t=Le(e);return t?{base:`${window.location.origin}${t}`,assistantName:e?.name?.trim()||null,ingressUrl:e?.ingressUrl?.trim()||null}:null}function Li(e){let t=e?.error?.message;return typeof t==`string`&&t.trim()?t:null}function Ri(e){let t=e?.error?.code;return typeof t==`string`&&t?t:void 0}async function zi(e,t,n,r){let i;try{i=await fetch(e,{...t,signal:n})}catch(e){throw k(e)?e:new Pi(G(`settings:pairDeviceClient.networkError`))}let a=await i.json().catch(()=>null);if(!i.ok)throw new Pi(Li(a)??G(`settings:pairDeviceClient.httpError`,{status:i.status}),{hint:r,status:i.status,code:Ri(a)});if(typeof a!=`object`||!a)throw new Pi(G(`settings:pairDeviceClient.unexpectedResponse`));return a}function Bi(e,t,n,r){return zi(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)},n,r)}async function Vi(e){let{base:t,publicBaseUrl:n,signal:r}=e,i=await Bi(`${t}${Oi}`,{publicBaseUrl:n},r,Ni());try{await Bi(`${t}${ki}`,{userCode:i.userCode},r,Ni())}catch(e){let n=AbortSignal.timeout(Fi);throw k(e)?Hi(t,i.userCode,n):await Hi(t,i.userCode,r?AbortSignal.any([r,n]):n),e}return{pairUrl:ke(i),expiresAt:i.expiresAt}}async function Hi(e,t,n){try{let r=(await Ui({base:e,signal:n})).find(e=>e.userCode===t);r&&await Ki({base:e,requestId:r.requestId,signal:n})}catch(e){if(k(e))return;y(e,{context:`pair-device-orphan-cleanup`,bestEffort:!0})}}async function Ui(e){let t=await zi(`${e.base}${Ai}`,{method:`GET`},e.signal);return Array.isArray(t.requests)?t.requests:[]}async function Wi(e,t){await Bi(`${t.base}${e}`,{requestId:t.requestId},t.signal)}function Gi(e){return Wi(ji,e)}function Ki(e){return Wi(Mi,e)}var qi=Object.defineProperty,Ji=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Xi=Object.prototype.propertyIsEnumerable,Zi=(e,t,n)=>t in e?qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qi=(e,t)=>{for(var n in t||={})Yi.call(t,n)&&Zi(e,n,t[n]);if(Ji)for(var n of Ji(t))Xi.call(t,n)&&Zi(e,n,t[n]);return e},$i=(e,t)=>{var n={};for(var r in e)Yi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ji)for(var r of Ji(e))t.indexOf(r)<0&&Xi.call(e,r)&&(n[r]=e[r]);return n},ea;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(ea||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(ea||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(ea||={});var ta=ea,na={L:ta.QrCode.Ecc.LOW,M:ta.QrCode.Ecc.MEDIUM,Q:ta.QrCode.Ecc.QUARTILE,H:ta.QrCode.Ecc.HIGH},ra=128,ia=`L`,aa=`#FFFFFF`,oa=`#000000`,sa=!1,ca=1,la=4,ua=0,da=.1;function fa(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function pa(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function ma(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*da),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function ha(e,t){return t==null?e?la:ua:Math.max(Math.floor(t),0)}function ga({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=Z.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...ta.QrSegment.makeSegments(t)),e),[]);return ta.QrCode.encodeSegments(r,na[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=Z.useMemo(()=>{let e=c.getModules(),t=ha(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:ma(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var _a=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),va=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=ra,level:a=ia,bgColor:o=aa,fgColor:s=oa,includeMargin:c=sa,minVersion:l=ca,boostLevel:u,marginSize:d,imageSettings:f}=n,p=$i(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=$i(p,[`style`]),g=f?.src,_=Z.useRef(null),v=Z.useRef(null),y=Z.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[b,x]=Z.useState(!1),{margin:S,cells:C,numCells:w,calculatedImageSettings:T}=ga({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});Z.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=C,r=v.current,a=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&T.excavation!=null&&(n=pa(C,T.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/w*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,w,w),t.fillStyle=s,_a?t.fill(new Path2D(fa(n,S))):C.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+S,n+S,1,1)})}),T&&(t.globalAlpha=T.opacity),a&&t.drawImage(r,T.x+S,T.y+S,T.w,T.h)}}),Z.useEffect(()=>{x(!1)},[g]);let E=Qi({height:i,width:i},m),D=null;return g!=null&&(D=Z.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{x(!0)},ref:v,crossOrigin:T?.crossOrigin})),Z.createElement(Z.Fragment,null,Z.createElement(`canvas`,Qi({style:E,height:i,width:i,ref:y,role:`img`},h)),D)});va.displayName=`QRCodeCanvas`;var ya=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=ra,level:a=ia,bgColor:o=aa,fgColor:s=oa,includeMargin:c=sa,minVersion:l=ca,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=$i(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:v}=ga({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),y=g,b=null;p!=null&&v!=null&&(v.excavation!=null&&(y=pa(g,v.excavation)),b=Z.createElement(`image`,{href:p.src,height:v.h,width:v.w,x:v.x+h,y:v.y+h,preserveAspectRatio:`none`,opacity:v.opacity,crossOrigin:v.crossOrigin}));let x=fa(y,h);return Z.createElement(`svg`,Qi({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&Z.createElement(`title`,null,d),Z.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),Z.createElement(`path`,{fill:s,d:x,shapeRendering:`crispEdges`}),b)});ya.displayName=`QRCodeSVG`;function ba(e,t){return!Number.isFinite(t)||t<=0?e(`pairDeviceReady.singleUse`):e(`pairDeviceReady.expiresIn`,{time:Kn(t)})}function xa({pairUrl:e,remainingMs:t,expired:n,copied:r,onCopy:i}){let{t:a}=J(`settings`);return n?(0,Q.jsx)(B,{tone:`warning`,title:a(`pairDeviceReady.expiredTitle`),children:a(`pairDeviceReady.expiredBody`)}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`div`,{className:`w-fit rounded-lg bg-white p-3`,children:(0,Q.jsx)(ya,{value:e,size:192,level:`M`,title:a(`pairDeviceReady.qrTitle`)})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`code`,{"data-testid":`pair-device-url`,className:`min-w-0 flex-1 truncate rounded-md bg-[var(--surface-active)] px-2.5 py-1.5 text-body-small-default text-[var(--content-secondary)]`,children:e}),(0,Q.jsx)(V,{variant:`outlined`,size:`compact`,leftIcon:r?(0,Q.jsx)(Rn,{}):(0,Q.jsx)(Mn,{}),onClick:()=>i(e),children:a(r?`pairDeviceReady.copiedButton`:`pairDeviceReady.copyButton`)})]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:ba(a,t)})]})}function Sa(e){return/iPhone|iPod/.test(e)?`iPhone`:/iPad/.test(e)||/Macintosh/.test(e)&&/Mobile/.test(e)?`iPad`:/Android/.test(e)?`Android`:/Macintosh|Mac OS X/.test(e)?`macOS`:/Windows/.test(e)?`Windows`:/CrOS/.test(e)?`ChromeOS`:/Linux/.test(e)?`Linux`:null}function Ca(e){return/Edg\/|EdgA\/|EdgiOS\//.test(e)?`Edge`:/OPR\/|OPiOS\//.test(e)?`Opera`:/Firefox\/|FxiOS\//.test(e)?`Firefox`:/Chrome\/|CriOS\//.test(e)?`Chrome`:/Safari\//.test(e)?`Safari`:null}function wa(e){if(!e||e.trim()===``)return null;let t=Sa(e),n=Ca(e);return t===null&&n===null?null:{browser:n,os:t}}var Ta=3e4;function Ea(e){let[,t]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),Ta);return()=>clearInterval(n)},[e])}function Da(e){return Ie(typeof e==`string`?new Date(e).getTime():e,{locale:le(),minimumUnit:`minute`})}var Oa=5e3,ka=6e4;function Aa({pollWhilePairing:e=!1,revalidateKey:t,isExpanded:n=!1}={}){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(null),d=(0,Z.useRef)(!0),f=(0,Z.useRef)(0);(0,Z.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let p=(0,Z.useCallback)((e=Te()?.assistantId)=>{if(!e)return;i(t=>t&&t.assistantId!==e?null:t);let t=++f.current;pt(e).then(n=>{!d.current||t!==f.current||i(n.ok?{assistantId:e,devices:n.devices}:null)})},[]),m=Ye.use.selectedAssistantId()??Te()?.assistantId;(0,Z.useEffect)(()=>{o(null),u(null),p(m)},[m,p]);let h=(0,Z.useRef)(t);(0,Z.useEffect)(()=>{t!==h.current&&(h.current=t,p(m))},[t,m,p]);let g=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(e&&!s){g.current=!0;let e=setInterval(()=>p(),Oa);return()=>clearInterval(e)}!e&&g.current&&(g.current=!1,p())},[e,s,p]);let _=(r?.devices.length??0)>0;(0,Z.useEffect)(()=>{if(!n||!_||e||s)return;let t=setInterval(()=>p(),ka);return()=>clearInterval(t)},[n,_,e,s,p]);let v=(0,Z.useCallback)(e=>{u(null),o(e)},[]),y=(0,Z.useCallback)(()=>{o(null),u(null)},[]),b=(0,Z.useCallback)(()=>{!r||!a||s||(c(!0),u(null),Vt(r.assistantId,a.hashedDeviceId).then(e=>{d.current&&(c(!1),e.ok?(o(null),p()):u(e.error))}))},[r,a,s,p]);return{devices:r?.devices??null,confirmTarget:a,isRevoking:s,revokeError:l,requestRevoke:v,cancelRevoke:y,confirmRevoke:b}}var ja=600*1e3,Ma=`paired-devices`;function Na(e){return e.slice(0,12)}function Pa(e,t){return t?t.charAt(0).toUpperCase()+t.slice(1):e(`pairedDevicesSection.platformUnknown`)}function Fa(e,t){if(typeof t.clientReportedName==`string`&&t.clientReportedName.trim()!==``)return{name:t.clientReportedName,isRealIdentity:!0};let n=wa(t.pairingUserAgent);if(n!==null){let{browser:t,os:r}=n;return t!==null&&r!==null?{name:e(`pairedDevicesSection.browserOnOs`,{browser:t,os:r}),isRealIdentity:!0}:{name:t??r??``,isRealIdentity:!0}}return{name:Pa(e,t.platform),isRealIdentity:!1}}function Ia(e,t){return t===null?e(`pairedDevicesSection.dateUnknown`):new Date(t).toLocaleDateString(le())}function La(e,t){let n=Ia(e,t.issuedAt);return t.lastUsedAt===null?e(`pairedDevicesSection.pairedLine`,{paired:n}):Date.now()-t.lastUsedAt<=ja?e(`pairedDevicesSection.pairedActiveLine`,{paired:n}):e(`pairedDevicesSection.pairedAndUsedLine`,{paired:n,lastUsed:Da(t.lastUsedAt)})}function Ra({pollWhilePairing:e=!1,revalidateKey:t}={}){let{t:n}=J(`settings`),[r,i]=(0,Z.useState)(!1),a=Aa({pollWhilePairing:e,revalidateKey:t,isExpanded:r}),{devices:o,confirmTarget:s}=a;Ea(o?.some(e=>e.lastUsedAt!==null)??!1);let l=(0,Z.useMemo)(()=>o===null?null:[...o].sort((e,t)=>(t.lastUsedAt??0)-(e.lastUsedAt??0)),[o]);return l===null||l.length===0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U.Root,{type:`multiple`,value:r?[Ma]:[],onValueChange:e=>i(e.includes(Ma)),children:(0,Q.jsxs)(U.Item,{value:Ma,children:[(0,Q.jsxs)(U.Trigger,{className:`group flex w-full items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:n(`pairedDevicesSection.title`,{count:l.length})}),(0,Q.jsx)(Dn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(U.Content,{children:(0,Q.jsx)(`div`,{className:`mt-3 flex flex-col gap-3`,children:l.map(e=>{let t=Fa(n,e);return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,title:t.isRealIdentity?e.hashedDeviceId:void 0,children:t.name}),!t.isRealIdentity&&(0,Q.jsx)(`span`,{className:`shrink-0 font-mono text-[var(--content-tertiary)]`,title:e.hashedDeviceId,children:Na(e.hashedDeviceId)}),e.isCurrentHost&&(0,Q.jsx)(`span`,{className:`shrink-0 text-[var(--content-tertiary)]`,children:`· ${n(`pairedDevicesSection.thisMachine`)}`})]}),(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:La(n,e)})]}),(0,Q.jsx)(V,{variant:`dangerOutline`,size:`compact`,className:`shrink-0`,disabled:e.isCurrentHost===!0,title:e.isCurrentHost?n(`pairedDevicesSection.hostRevokeDisabledTitle`):void 0,onClick:()=>a.requestRevoke(e),children:n(`pairedDevicesSection.revokeButton`)})]},e.hashedDeviceId)})})})]})}),(0,Q.jsx)(c,{open:s!==null,title:n(`pairedDevicesSection.confirmTitle`),message:s&&(0,Q.jsxs)(Q.Fragment,{children:[n(`pairedDevicesSection.confirmMessageNamed`,{name:Fa(n,s).name,hash:Na(s.hashedDeviceId)}),a.revokeError&&(0,Q.jsx)(`span`,{className:`mt-2 block text-[var(--system-negative-strong)]`,children:a.revokeError})]}),confirmLabel:n(`pairedDevicesSection.revokeButton`),destructive:!0,isPending:a.isRevoking,onConfirm:a.confirmRevoke,onCancel:a.cancelRevoke})]})}var za=5e3;function Ba(e,t){return e.length===t.length&&t.every((t,n)=>e[n]?.requestId===t.requestId)}function Va(e,t){let[n,r]=(0,Z.useState)([]),[i,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null),[f,p]=(0,Z.useState)(e);e!==f&&(p(e),r([]),a(null),s(null),l(null)),(0,Z.useEffect)(()=>()=>{d.current?.abort(),d.current=null},[e]),(0,Z.useEffect)(()=>{let t=async()=>{u.current?.abort();let t=new AbortController;u.current=t;try{let n=await Ui({base:e,signal:t.signal});if(t.signal.aborted)return;r(e=>Ba(e,n)?e:n),l(e=>e&&!e.sticky&&!n.some(t=>t.requestId===e.requestId)?null:e),s(null)}catch(e){if(t.signal.aborted)return;if(e instanceof Pi){s(e.message);return}y(e,{context:`pair-device-pending-requests-poll`}),s(G(`settings:usePendingPairingRequests.pollErrorFallback`))}};t();let n=setInterval(()=>void t(),za);return()=>{clearInterval(n),u.current?.abort()}},[e]);let m=(0,Z.useCallback)(async(n,i)=>{if(d.current)return;let o=new AbortController;d.current=o,a({requestId:n,action:i}),l(null);let s=()=>{u.current?.abort(),r(e=>e.filter(e=>e.requestId!==n))};try{if(await(i===`approve`?Gi:Ki)({base:e,requestId:n,signal:o.signal}),o.signal.aborted)return;s(),i===`approve`&&t?.()}catch(e){if(o.signal.aborted)return;e instanceof Pi?i===`deny`&&e.status===409&&e.code===`ALREADY_APPROVED`?(s(),t?.(),l({requestId:n,message:G(`settings:usePendingPairingRequests.denyAlreadyApproved`),sticky:!0})):e.status===404||e.status===410?s():l({requestId:n,message:e.message}):(y(e,{context:`pair-device-pending-request-action`}),l({requestId:n,message:G(`settings:usePendingPairingRequests.actionErrorFallback`)}))}finally{d.current===o&&(d.current=null),o.signal.aborted||a(null)}},[e,t]),h=(0,Z.useCallback)(e=>m(e,`approve`),[m]),g=(0,Z.useCallback)(e=>m(e,`deny`),[m]);return{requests:n,actingOn:i,error:c?.message??o,approve:h,deny:g}}function Ha({base:e,onApproved:t}){let{t:n}=J(`settings`),{requests:r,actingOn:i,error:a,approve:o,deny:s}=Va(e,t);return Ea(r.length>0),r.length===0&&!a?null:(0,Q.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-[var(--border-element)] pt-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:n(`pendingPairingRequests.title`)}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`pendingPairingRequests.instruction`)})]}),a&&(0,Q.jsx)(B,{tone:`error`,title:a}),r.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2`,children:r.map(e=>{let t=i!==null&&i.requestId===e.requestId?i.action:null,r=t===`approve`,a=t===`deny`;return(0,Q.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-lg border border-[var(--border-element)] p-3`,children:[(0,Q.jsx)(`code`,{className:zt(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`w-fit px-2.5 py-1.5 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`),children:e.userCode}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.viaEdgeProxy===!1?n(`pendingPairingRequests.requestedMetaHost`,{when:Da(e.requestedAt)}):n(`pendingPairingRequests.requestedMeta`,{when:Da(e.requestedAt),ip:e.requesterIp})}),e.requesterUserAgent&&(0,Q.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,title:e.requesterUserAgent,children:e.requesterUserAgent})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(V,{variant:`primary`,size:`compact`,disabled:i!==null,"aria-busy":r||void 0,leftIcon:r?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>void o(e.requestId),children:n(`pendingPairingRequests.approveButton`)}),(0,Q.jsx)(V,{variant:`dangerOutline`,size:`compact`,disabled:i!==null,"aria-busy":a||void 0,leftIcon:a?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>void s(e.requestId),children:n(`pendingPairingRequests.denyButton`)})]})]},e.requestId)})})]})}function Ua({onRefresh:e,isRefreshing:t,labelled:n=!1}){let{t:r}=J(`settings`),i=r(`tunnelStatusRow.refreshLabel`),a=(0,Q.jsx)(In,{className:t?`animate-spin`:void 0});return n?(0,Q.jsx)(V,{variant:`outlined`,size:`compact`,leftIcon:a,disabled:t,onClick:e,children:i}):(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,iconOnly:a,"aria-label":i,disabled:t,onClick:e})}function Wa(e){return`publicBaseUrl`in e&&e.publicBaseUrl?e.publicBaseUrl:null}function Ga(e){return`checkedAt`in e&&e.checkedAt?e.checkedAt:null}function Ka(e,t){let n=t?.trim();return n?`vellum tunnel ${Ja(n)} --provider ${e}`:`vellum tunnel --provider ${e}`}var qa=/^[A-Za-z0-9._-]+$/;function Ja(e){return qa.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}var Ya={checking:`var(--content-tertiary)`,stopped:`var(--content-tertiary)`,healthy:`var(--system-positive-strong)`,unpairable:`var(--system-mid-strong)`,unreachable:`var(--system-mid-strong)`,foreign:`var(--system-negative-strong)`},Xa=`text-body-small-default text-[var(--content-tertiary)]`,Za=`truncate ${Xa}`;function Qa({status:e,onRefresh:t,isRefreshing:n,assistantName:r=null}){let{t:i}=J(`settings`);if(e.kind===`unconfigured`||e.kind===`unavailable`)return null;let a=Ga(e),o=Wa(e),s=`provider`in e?e.provider:void 0,c=`detail`in e?e.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg border border-[var(--border-element)] px-3 py-2.5`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`mt-1.5 inline-block h-2 w-2 shrink-0 rounded-full`,style:{backgroundColor:Ya[e.kind]}}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-default)]`,children:$a(e,i)}),c&&(0,Q.jsx)(`p`,{className:Za,title:c,children:c}),s&&(0,Q.jsx)(`p`,{className:Xa,children:(0,Q.jsx)(ln,{i18nKey:e.kind===`stopped`?`tunnelStatusRow.stoppedRestart`:`tunnelStatusRow.restartHint`,ns:`settings`,values:{command:Ka(s,r)},components:{code:(0,Q.jsx)(`code`,{className:zt(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`px-1.5 py-0.5`)})}})}),o&&(0,Q.jsx)(`p`,{className:Za,title:o,children:o}),a&&(0,Q.jsx)(`p`,{className:Xa,children:i(`tunnelStatusRow.checkedAt`,{when:Da(a)})})]}),(0,Q.jsx)(Ua,{onRefresh:t,isRefreshing:n})]})}function $a(e,t){switch(e.kind){case`checking`:return t(`tunnelStatusRow.checkingStatus`);case`stopped`:return t(`tunnelStatusRow.stoppedStatus`);case`healthy`:return t(`tunnelStatusRow.healthyStatus`);case`unpairable`:return t(`tunnelStatusRow.unpairableStatus`);case`unreachable`:return t(`tunnelStatusRow.unreachableStatus`);case`foreign`:return e.servingAssistantName?t(`tunnelStatusRow.foreignStatusNamed`,{name:e.servingAssistantName}):t(`tunnelStatusRow.foreignStatus`)}}var eo=`vellum:pair-device:public-base-url`;function to(e){let t=e?.trim();if(t)return{url:t,source:`tunnel`};let n=S(eo,``).trim();return n?{url:n,source:`stored`}:{url:``,source:`none`}}function no(e,t){let n=(0,Z.useMemo)(()=>to(t),[t]),[r,i]=(0,Z.useState)(null),a=r??n.url,[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)({kind:`idle`}),[u,d]=(0,Z.useState)(()=>Date.now()),f=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>f.current?.abort(),[]),(0,Z.useEffect)(()=>{if(c.kind!==`ready`)return;d(Date.now());let e=setInterval(()=>d(Date.now()),1e3);return()=>clearInterval(e)},[c]);let p=(0,Z.useCallback)(e=>{i(e),s(null)},[]),m=(0,Z.useCallback)(()=>{if(!e)return;let t=a.trim(),n=it(t);if(!n.ok){s(We(n.reason,t));return}s(null),f.current?.abort();let r=new AbortController;f.current=r,l({kind:`minting`}),(async()=>{try{let t=await Vi({base:e,publicBaseUrl:n.url,signal:r.signal});if(r.signal.aborted)return;M(eo,n.url),l({kind:`ready`,pairUrl:t.pairUrl,expiresAtMs:Date.parse(t.expiresAt)})}catch(e){if(r.signal.aborted)return;if(e instanceof Pi){l({kind:`error`,message:e.message,hint:e.hint});return}y(e,{context:`pair-device-mint`}),l({kind:`error`,message:G(`settings:usePairDevice.mintErrorFallback`)})}})()},[e,a]),h=c.kind===`ready`?Math.max(0,c.expiresAtMs-u):0,g=c.kind===`ready`&&h<=0;return{publicBaseUrl:a,setPublicBaseUrl:p,prefillSource:n.source,inputError:o,phase:c,remainingMs:h,expired:g,generate:m}}var ro=`0.11.6`;function io(e){return Be(ro,e)}function ao(e){let t=nt(),n=io(t),r=en(),i=e&&n&&r,{data:a,isFetching:o,refetch:s}=K({...et({path:{assistant_id:t}}),enabled:i,staleTime:0,refetchOnWindowFocus:!1}),c=(0,Z.useCallback)(()=>{i&&s()},[i,s]);return{status:oo(a,o),isRefreshing:o,refresh:c}}function oo(e,t){if(!e)return t?{kind:`checking`}:{kind:`unavailable`};let{lastTunnel:n}=e,r=e.publicBaseUrl??``,i=e.checkedAt??``,a=n?{provider:n.provider}:{};switch(e.state){case`unconfigured`:return{kind:`unconfigured`};case`stopped`:return{kind:`stopped`,...a,...n?{publicBaseUrl:n.publicBaseUrl}:{}};case`healthy`:return{kind:`healthy`,publicBaseUrl:r,checkedAt:i};case`unpairable`:case`unreachable`:return{kind:e.state,publicBaseUrl:r,checkedAt:i,...e.detail?{detail:e.detail}:{},...a};case`foreign`:return{kind:`foreign`,publicBaseUrl:r,checkedAt:i,...e.servingAssistantName?{servingAssistantName:e.servingAssistantName}:{},...a};default:return{kind:`unavailable`}}}var so=`tailscale`,co=`public-url`,lo=new Set([`unpairable`,`unreachable`,`foreign`]),uo=`vellum tunnel --help`,fo=Yt(m.docs.pairADevice);function po(){let{t:e}=J(`settings`),t=Ii(),n=Di(),r=H.use.pairedDevicesUI(),i=ao(n&&t!==null),a=i.status.kind!==`unavailable`;p(`app.resume`,()=>{i.refresh()}),Ea(Ga(i.status)!==null);let o=i.status.kind===`stopped`?null:Wa(i.status),s=no(t?.base??null,a?o:t?.ingressUrl??null),[c,l]=(0,Z.useState)(0),[u,d]=(0,Z.useState)(!1),{copy:f,copied:m}=x({errorMessage:e(`pairDeviceCard.copyError`)});if(!t||!n)return null;let h=t.assistantName??e(`pairDeviceCard.subtitleFallbackName`),{phase:g}=s,_=g.kind===`minting`,v=g.kind===`ready`,y=s.prefillSource===`tunnel`,b=a?i.status.kind===`unconfigured`:s.prefillSource===`none`&&s.publicBaseUrl.trim()===``,S=b&&a,C=a&&lo.has(i.status.kind),w=e(_?`pairDeviceCard.generateButtonMinting`:v?`pairDeviceCard.generateButtonRegenerate`:C?`pairDeviceCard.generateButtonWarned`:`pairDeviceCard.generateButton`),T=a&&o!==null,E=u||s.inputError!==null,D=(0,Q.jsx)(V,{variant:C?`outlined`:`primary`,className:`self-start`,disabled:_||s.publicBaseUrl.trim()===``,onClick:s.generate,children:w}),O=(0,Q.jsx)(R,{label:e(`pairDeviceCard.publicUrlLabel`),fullWidth:!0,placeholder:e(`pairDeviceCard.publicUrlPlaceholder`),helperText:e(y?`pairDeviceCard.publicUrlHelperTunnel`:`pairDeviceCard.publicUrlHelper`),value:s.publicBaseUrl,errorText:s.inputError??void 0,disabled:_,onChange:e=>{d(!0),s.setPublicBaseUrl(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),s.generate())}});return(0,Q.jsx)(X,{title:e(`pairDeviceCard.title`),subtitle:e(`pairDeviceCard.subtitle`,{name:h}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[b&&(0,Q.jsx)(B,{tone:`info`,title:e(`pairDeviceCard.noTunnelTitle`),actions:S?(0,Q.jsx)(Ua,{onRefresh:i.refresh,isRefreshing:i.isRefreshing,labelled:!0}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{children:e(`pairDeviceCard.noTunnelWhy`,{name:h})}),(0,Q.jsx)(`code`,{className:zt(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`w-fit max-w-full overflow-x-auto px-2.5 py-1.5`),children:Ka(so,t.assistantName)}),(0,Q.jsx)(`p`,{children:e(`pairDeviceCard.noTunnelNext`)}),(0,Q.jsx)(`p`,{children:(0,Q.jsx)(ln,{i18nKey:`pairDeviceCard.noTunnelMore`,ns:`settings`,values:{command:uo},components:{code:(0,Q.jsx)(`code`,{className:zt(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`px-1.5 py-0.5`)})}})})]})}),(0,Q.jsx)(Qa,{status:i.status,onRefresh:i.refresh,isRefreshing:i.isRefreshing,assistantName:t.assistantName}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-3`,children:T?(0,Q.jsxs)(Q.Fragment,{children:[D,(0,Q.jsx)(U.Root,{type:`single`,collapsible:!0,value:E?co:``,onValueChange:e=>d(e===co),children:(0,Q.jsxs)(U.Item,{value:co,children:[(0,Q.jsxs)(U.Trigger,{className:`group flex w-full items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:e(`pairDeviceCard.publicUrlDisclosure`)}),(0,Q.jsx)(Dn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(U.Content,{children:(0,Q.jsx)(`div`,{className:`mt-3`,children:O})})]})})]}):(0,Q.jsxs)(Q.Fragment,{children:[O,D]})}),g.kind===`error`&&(0,Q.jsx)(B,{tone:`error`,title:g.message,children:g.hint}),v&&(0,Q.jsx)(xa,{pairUrl:g.pairUrl,remainingMs:s.remainingMs,expired:s.expired,copied:m,onCopy:f}),(0,Q.jsx)(Ha,{base:t.base,onApproved:()=>l(e=>e+1)}),r&&(0,Q.jsx)(Ra,{pollWhilePairing:v&&!s.expired,revalidateKey:c}),(0,Q.jsx)(`a`,{href:fo,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Me(e,fo),className:`self-start text-body-medium-default text-[var(--content-tertiary)] underline hover:text-[var(--content-default)]`,children:e(`pairDeviceCard.learnMore`)})]})})}function mo(e){return[{scope:`global`,title:e(`shortcutsSections.globalTitle`),description:e(`shortcutsSections.globalDescription`)},{scope:`menu`,title:e(`shortcutsSections.appTitle`),description:e(`shortcutsSections.appDescription`)}]}function ho({hotkey:e,recording:t,conflictLabel:n,alternateBinding:r,onStartRecording:i,onCancelRecording:a,onReset:o,onRemove:s}){let{t:c}=J(`settings`),l=e.accelerator===``,u=e.override!==null;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e.label}),n!==null&&(0,Q.jsx)(`div`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:c(`shortcutsSections.alreadyUsedBy`,{label:n})})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[r,t?(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:c(`shortcutsSections.recordingHint`)}):l?(0,Q.jsx)(`span`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:c(`shortcutsSections.none`)}):(0,Q.jsx)(Ke,{accelerator:e.accelerator}),t?(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,onClick:a,children:c(`shortcutsSections.cancel`)}):(0,Q.jsx)(V,{variant:`outlined`,size:`compact`,onClick:i,"aria-label":c(`shortcutsSections.recordShortcutAriaLabel`,{label:e.label}),children:c(`shortcutsSections.record`)}),(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,disabled:!u,leftIcon:(0,Q.jsx)(An,{className:`h-3.5 w-3.5`}),onClick:o,"aria-label":c(`shortcutsSections.resetShortcutAriaLabel`,{label:e.label})}),(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,disabled:l,leftIcon:(0,Q.jsx)(Fn,{className:`h-3.5 w-3.5`}),onClick:s,"aria-label":c(`shortcutsSections.removeBindingAriaLabel`,{label:e.label})})]})]})}function go(){let{t:e}=J(`settings`),{catalog:t,recordingKey:n,conflict:r,startRecording:i,stopRecording:a,resetHotkey:o,removeHotkey:s}=$n(),c=(0,Z.useMemo)(()=>mo(e).map(e=>({...e,commands:t.filter(t=>t.rebindable&&t.scope===e.scope)})).filter(e=>e.commands.length>0),[t,e]);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[r!==null&&(0,Q.jsxs)(B,{tone:`warning`,children:[e(`shortcutsSections.conflictNoticePrefix`,{label:r.label}),` `,e(n===null?`shortcutsSections.conflictResetHint`:`shortcutsSections.conflictRecordingHint`)]}),c.map(e=>(0,Q.jsxs)(O,{bordered:!0,children:[(0,Q.jsxs)(`div`,{className:`mb-2`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.title}),(0,Q.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,Q.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.commands.map(e=>(0,Q.jsx)(ho,{hotkey:e,recording:n===e.key,conflictLabel:r!==null&&r.key===e.key?r.label:null,onStartRecording:()=>i(e.key),onCancelRecording:a,onReset:()=>o(e.key),onRemove:()=>s(e.key)},e.key))})]},e.scope))]})}async function _o(){if(!l())return!1;let e=window.vellum;return e?.launchAtLogin?e.launchAtLogin.get():!1}async function vo(e){if(!l())return;let t=window.vellum;t?.launchAtLogin&&await t.launchAtLogin.set(e)}function yo(){let{t:e}=J(`settings`),t=be.useValue(),n=an.useValue(),r=!_e(),i=F();return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`preferencesModal.composerTitle`)}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-4`,children:[r&&(0,Q.jsx)(ce,{checked:t,onChange:be.save,label:e(i?`preferencesModal.sendWithCmdEnter`:`preferencesModal.sendWithCtrlEnter`),helperText:e(i?`preferencesModal.sendWithCmdEnterHelper`:`preferencesModal.sendWithCtrlEnterHelper`)}),(0,Q.jsx)(ce,{checked:n,onChange:an.save,label:e(`preferencesModal.showContextWindow`),helperText:e(`preferencesModal.showContextWindowHelper`)})]})]})}function bo(){let{t:e}=J(`settings`),[t,n]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{_o().then(n)},[]);let r=async e=>{n(e);try{await vo(e)}catch{n(!e)}};return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`preferencesModal.launchAtLoginTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(Ne()===`windows`?`preferencesModal.launchAtLoginDescriptionWindows`:`preferencesModal.launchAtLoginDescription`)}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(ce,{checked:t,onChange:e=>void r(e),"aria-label":e(`preferencesModal.launchAtLoginAriaLabel`)})})]})}function xo({open:e,onClose:t}){let{t:n}=J(`settings`);return(0,Q.jsx)(_.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Q.jsxs)(_.Content,{size:`lg`,children:[(0,Q.jsxs)(_.Header,{children:[(0,Q.jsx)(_.Title,{children:n(`preferencesModal.title`)}),(0,Q.jsx)(_.Description,{children:n(`preferencesModal.description`)})]}),(0,Q.jsx)(_.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[l()&&(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:n(`preferencesModal.keyboardShortcutsTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:n(`preferencesModal.keyboardShortcutsDescription`)}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(go,{})})]}),(0,Q.jsx)(yo,{}),l()&&(0,Q.jsx)(bo,{})]})})]})})}function So(e){return e===`preview`?`preview`:`stable`}function Co(e,t){if(!e)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:n.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function wo(e){return e.filter(e=>e.ready_to_use)}function To(e){return e?.feature_enabled===!1}function Eo({assistantId:e,onComplete:t}){let{t:n}=J(`settings`),r=H.use.previewChannel(),i=q(),[a,o]=(0,Z.useState)(),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(`restore_backup`),[p,m]=(0,Z.useState)(``),h=Ze({path:{assistant_id:e}}),g=ot({path:{assistant_id:e}}),_=Et({path:{id:e}}),{data:v,isLoading:y,isError:b}=K({...h,enabled:r,retry:!1}),x=(0,Z.useMemo)(()=>wo(v?.preview_backups??[]),[v?.preview_backups]),S=x[0],C=x.find(e=>e.snapshot_name===p)??S,w=()=>{i.invalidateQueries({queryKey:g}),i.invalidateQueries({queryKey:_}),t?.()},T=cn(wt()),E=cn(Kt()),O=So(v?.current_channel),k=T.isPending||E.isPending,A=k||To(v)||!v?.latest_preview_release,j=d===`restore_backup`&&!C;if((0,Z.useEffect)(()=>{o(O===`preview`?`release-channel`:void 0)},[O]),!r)return null;let M=v?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U.Root,{type:`single`,collapsible:!0,value:a,onValueChange:e=>o(e||void 0),className:`mt-5 border-t border-[var(--border-base)] pt-5`,children:(0,Q.jsxs)(U.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(U.Trigger,{className:`group justify-between gap-3`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:n(`previewReleaseChannel.title`)}),v&&(0,Q.jsx)(re,{tone:O===`preview`?`warning`:`neutral`,children:n(O===`preview`?`previewReleaseChannel.preview`:`previewReleaseChannel.stable`)})]}),(0,Q.jsx)(Dn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(U.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[y&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),n(`previewReleaseChannel.loading`)]}),b&&(0,Q.jsx)(B,{tone:`error`,title:n(`previewReleaseChannel.loadErrorTitle`),children:n(`previewReleaseChannel.loadErrorBody`)}),v&&(0,Q.jsxs)(Q.Fragment,{children:[To(v)&&(0,Q.jsx)(B,{tone:`neutral`,title:n(`previewReleaseChannel.unavailableTitle`),children:n(`previewReleaseChannel.unavailableBody`)}),O===`stable`?(0,Q.jsx)(Do,{status:v,isChangingChannel:k,optInDisabled:A,onOptIn:()=>c(!0)}):(0,Q.jsx)(Oo,{status:v,isChangingChannel:k,onOptOut:()=>{let e=S;m(e?.snapshot_name??``),f(e?`restore_backup`:M?`standard_upgrade`:`restore_backup`),u(!0)}})]})]})})]})}),(0,Q.jsx)(Ao,{open:s,isPending:T.isPending,previewVersion:v?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await T.mutateAsync({path:{assistant_id:e}});W.success(t.detail||n(`previewReleaseChannel.previewEnabledToast`)),c(!1),w()}catch(e){W.error(D(e,void 0,n(`previewReleaseChannel.previewEnableFailedToast`)))}},onCancel:()=>c(!1)}),(0,Q.jsx)(jo,{open:l,backups:x,mode:d,selectedSnapshotName:C?.snapshot_name??``,isPending:E.isPending,restoreModeDisabled:j,standardUpgradeAvailable:M,onModeChange:f,onSnapshotChange:m,onConfirm:async()=>{if(!j)try{let t=await E.mutateAsync({path:{assistant_id:e},body:d===`restore_backup`?{mode:`restore_backup`,snapshot_name:C?.snapshot_name}:{mode:`standard_upgrade`}});W.success(t.detail||n(`previewReleaseChannel.stableEnabledToast`)),u(!1),w()}catch(e){W.error(D(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>u(!1)})]})}function Do({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){let{t:i}=J(`settings`);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ko,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(B,{tone:`neutral`,title:i(`previewReleaseChannel.noPreviewTitle`),children:i(`previewReleaseChannel.noPreviewBody`)}),(0,Q.jsx)(V,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(wn,{}),disabled:n,onClick:r,children:i(`previewReleaseChannel.optIn`)})]})}function Oo({status:e,isChangingChannel:t,onOptOut:n}){let{t:r}=J(`settings`);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ko,{status:e}),(0,Q.jsx)(V,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(An,{}),disabled:t,onClick:n,children:r(`previewReleaseChannel.switchBack`)})]})}function ko({status:e}){let{t}=J(`settings`);return(0,Q.jsxs)(`dl`,{className:`grid gap-3 text-body-medium-lighter sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:t(`previewReleaseChannel.latestStable`)}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_stable_release?.version??t(`previewReleaseChannel.none`)})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:t(`previewReleaseChannel.latestPreview`)}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_preview_release?.version??t(`previewReleaseChannel.none`)})]})]})}function Ao({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){let{t:a}=J(`settings`);return(0,Q.jsx)(_.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(_.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(_.Header,{icon:Cn,children:[(0,Q.jsx)(_.Title,{children:a(`previewReleaseChannel.optInTitle`)}),(0,Q.jsx)(_.Description,{children:a(`previewReleaseChannel.optInDescription`)})]}),(0,Q.jsx)(_.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(B,{tone:`warning`,title:a(`previewReleaseChannel.dataLossTitle`),children:a(`previewReleaseChannel.dataLossBody`)}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`li`,{children:a(`previewReleaseChannel.optInStep1`)}),(0,Q.jsx)(`li`,{children:a(`previewReleaseChannel.optInStep2`,{version:n??a(`previewReleaseChannel.latest`)})}),(0,Q.jsx)(`li`,{children:a(`previewReleaseChannel.optInStep3`)})]})]})}),(0,Q.jsxs)(_.Footer,{children:[(0,Q.jsx)(V,{variant:`outlined`,disabled:t,onClick:i,children:a(`previewReleaseChannel.cancel`)}),(0,Q.jsx)(V,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(wn,{}),onClick:r,children:a(t?`previewReleaseChannel.switching`:`previewReleaseChannel.takeBackupAndSwitch`)})]})]})})}function jo({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:a,restoreModeDisabled:o,standardUpgradeAvailable:s,onModeChange:c,onSnapshotChange:l,onConfirm:u,onCancel:d}){let{t:f}=J(`settings`),p=f(`previewReleaseChannel.unknownDate`);return(0,Q.jsx)(_.Root,{open:e,onOpenChange:e=>!e&&d(),children:(0,Q.jsxs)(_.Content,{size:`md`,hideCloseButton:a,children:[(0,Q.jsxs)(_.Header,{icon:Cn,children:[(0,Q.jsx)(_.Title,{children:f(`previewReleaseChannel.optOutTitle`)}),(0,Q.jsx)(_.Description,{children:f(`previewReleaseChannel.optOutDescription`)})]}),(0,Q.jsx)(_.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(bt,{value:n,onValueChange:c,disabled:a,"aria-label":f(`previewReleaseChannel.returnMethodAriaLabel`),children:[(0,Q.jsx)(i,{value:`restore_backup`,disabled:t.length===0,label:f(`previewReleaseChannel.restoreBackupLabel`),helperText:f(`previewReleaseChannel.restoreBackupHelper`)}),(0,Q.jsx)(i,{value:`standard_upgrade`,disabled:!s,label:f(`previewReleaseChannel.standardUpgradeLabel`),helperText:f(s?`previewReleaseChannel.standardUpgradeHelper`:`previewReleaseChannel.standardUpgradeUnavailable`)})]}),n===`restore_backup`&&t.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[f(`previewReleaseChannel.safetyBackup`),(0,Q.jsx)(Ot,{value:r,onChange:l,disabled:a,options:t.map(e=>{let t=e.source_release_version?f(`previewReleaseChannel.stableBackupLabel`,{version:e.source_release_version}):e.snapshot_name;return{value:e.snapshot_name,label:f(`previewReleaseChannel.backupOptionLabel`,{name:t,date:Co(e.created_at,p)})}})})]}),n===`restore_backup`&&t.length===0&&!s&&(0,Q.jsx)(B,{tone:`error`,title:f(`previewReleaseChannel.requiresBackupTitle`),children:f(`previewReleaseChannel.requiresBackupBody`)}),n===`standard_upgrade`&&(0,Q.jsx)(B,{tone:`error`,title:f(`previewReleaseChannel.mayNotSurviveTitle`),children:f(`previewReleaseChannel.mayNotSurviveBody`)})]})}),(0,Q.jsxs)(_.Footer,{children:[(0,Q.jsx)(V,{variant:`outlined`,disabled:a,onClick:d,children:f(`previewReleaseChannel.cancel`)}),(0,Q.jsx)(V,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:a||o||n===`standard_upgrade`&&!s,leftIcon:a?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),onClick:u,children:f(a?`previewReleaseChannel.switching`:`previewReleaseChannel.switchToStable`)})]})]})})}function Mo(){let{t:e}=J(`settings`),t=Qt.use.user(),n=(0,Z.useCallback)(e=>{E(e),window.location.reload()},[]);if(!I(t))return null;let r=Oe(),i=De(),a=i.version??e(`previewUiChannel.versionUnknown`);return(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`previewUiChannel.title`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`previewUiChannel.description`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(i.channel===`preview`?`previewUiChannel.runningPreview`:`previewUiChannel.runningStable`,{version:a})}),r&&i.channel===`stable`&&(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`previewUiChannel.unavailableHint`)})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:(0,Q.jsx)(ce,{checked:r,onChange:n,"aria-label":e(r?`previewUiChannel.onAriaLabel`:`previewUiChannel.offAriaLabel`)})})]})}var No=new Set([`exceeds_machine_tier`,`exceeds_storage_tier`]);function Po(e,t){return e&&typeof e==`object`&&!Array.isArray(e)&&`error`in e&&typeof e.error==`string`&&No.has(e.error)?`That size isn't available on your plan.`:D(e,void 0,t)}function Fo({assistant:e,healthz:t,healthzLoading:n,healthzFetching:r,healthzPolling:i,refetch:a,refetchUntilResized:o}){let{t:s}=J(`settings`),c=gn(),l=K(T()),u=l.data,d=!e.is_local,f=u?.plan_id===`pro`,p=K({...Ee(),enabled:f}),h=e.machine_size||`small`,g=Hn(p.data?.max_machine_tier??null),v=(0,Z.useMemo)(()=>Gn(g,h,(0,Q.jsx)(re,{tone:`positive`,children:s(`resizeCard.current`)})),[g,h,s]),y=p.data?.selected_storage_gib??null,[b,x]=(0,Z.useState)(!1),S=g.length>0?g[g.length-1]:null,[C,w]=(0,Z.useState)(null),E=C??S??h,[D,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(null),j=mt({onSuccess:(e,n)=>{W.success(s(`resizeCard.toastStarted`),{id:`assistant-resize`}),A(null),w(null),x(!1),n.body?.machine_size==null?a():o(t)},onError:e=>{A(Po(e,s(`resizeCard.resizeFailed`)))}});if(l.isError&&u==null)return(0,Q.jsx)(X,{id:`storage-resources`,title:s(`resizeCard.title`),subtitle:s(`resizeCard.subtitle`),children:(0,Q.jsx)(B,{tone:`error`,children:s(`resizeCard.subscriptionLoadError`)})});let M=f&&g.includes(E)&&E!==h?E:null,N=f&&y!=null&&!0,ee=f&&g.length>0&&Wn(h)<Wn(g[g.length-1]),P=j.isPending||i,te=y==null?t?.disk?.totalMb??null:y*1024,F=t?.disk&&te!=null?{value:t.disk.usedMb,max:te,caption:s(`resizeCard.usedOf`,{used:Zn(t.disk.usedMb),total:Zn(te)})}:null,I=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,L=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:s(`resizeCard.usedOf`,{used:Zn(t.memory.currentMb),total:Zn(t.memory.maxMb)})}:null,ne=(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,onClick:()=>O(!0),children:s(`resizeCard.resize`)}),ie=d?f?N?(0,Q.jsxs)(`button`,{type:`button`,disabled:P,onClick:()=>x(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(On,{className:`h-3.5 w-3.5`}),s(`resizeCard.increaseStorage`)]}):(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,disabled:P,onClick:()=>x(!0),children:s(`resizeCard.resize`)}):ne:null,ae=d?f?ee?(0,Q.jsxs)(`button`,{type:`button`,disabled:P,onClick:()=>x(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(On,{className:`h-3.5 w-3.5`}),s(`resizeCard.increaseSize`)]}):(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,disabled:P,onClick:()=>x(!0),children:s(`resizeCard.resize`)}):ne:null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{id:`storage-resources`,title:s(`resizeCard.title`),subtitle:s(`resizeCard.subtitle`),compactAccessory:!0,accessory:(0,Q.jsx)(V,{variant:`ghost`,size:`compact`,iconOnly:r||i?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),tooltip:s(i?`resizeCard.applyingResize`:`resizeCard.refreshMetrics`),"aria-label":s(`resizeCard.refreshMetrics`),disabled:r||i,onClick:()=>void a()}),children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr]`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(zn,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.disk`)})]}),ie]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1 pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.storage`)}),F?(0,Q.jsx)(qn,{value:F.value,max:F.max,caption:F.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.unavailable`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(nr,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.machine`)}),(0,Q.jsx)(re,{tone:`neutral`,children:Un[h]})]}),ae]}),(0,Q.jsxs)(`div`,{className:`mt-auto grid grid-cols-2 gap-3 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.cpu`)}),I?(0,Q.jsx)(qn,{value:I.value,max:I.max,caption:I.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.memory`)}),L?(0,Q.jsx)(qn,{value:L.value,max:L.max,caption:L.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(_.Root,{open:D,onOpenChange:e=>{e||O(!1)},children:(0,Q.jsxs)(_.Content,{size:`sm`,children:[(0,Q.jsxs)(_.Header,{children:[(0,Q.jsx)(_.Title,{children:s(`resizeCard.upgradeTitle`)}),(0,Q.jsx)(_.Description,{children:s(`resizeCard.upgradeDescription`)})]}),(0,Q.jsxs)(_.Footer,{children:[(0,Q.jsx)(V,{variant:`ghost`,onClick:()=>O(!1),children:s(`resizeCard.cancel`)}),(0,Q.jsx)(V,{onClick:()=>{O(!1),c(m.plans)},children:s(`resizeCard.upgrade`)})]})]})}),(0,Q.jsx)(_.Root,{open:b,onOpenChange:e=>{e||(x(!1),w(null),A(null))},children:(0,Q.jsxs)(_.Content,{size:`sm`,children:[(0,Q.jsxs)(_.Header,{icon:nr,children:[(0,Q.jsx)(_.Title,{children:s(`resizeCard.modalTitle`)}),(0,Q.jsx)(_.Description,{children:s(`resizeCard.modalDescription`)})]}),(0,Q.jsx)(_.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g.length===0?(0,Q.jsx)(B,{tone:`warning`,children:s(`resizeCard.noMachineTier`)}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:s(`resizeCard.machineSize`)}),(0,Q.jsx)(Ot,{options:v,value:E,onChange:w,"aria-label":s(`resizeCard.machineSizeAriaLabel`),"data-testid":`resize-machine-size`})]}),N?(0,Q.jsx)(B,{tone:`info`,children:s(`resizeCard.storageExpandTo`,{to:y})}):(0,Q.jsx)(B,{tone:`neutral`,children:s(`resizeCard.storageUnchanged`)}),k&&(0,Q.jsx)(B,{tone:`error`,children:k})]})}),(0,Q.jsxs)(_.Footer,{className:`items-center justify-between`,children:[(0,Q.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:(0,Q.jsx)(ln,{ns:`settings`,i18nKey:`resizeCard.needMore`,components:{upgradeLink:(0,Q.jsx)(_n,{to:m.plans,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>x(!1)})}})}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(V,{variant:`ghost`,onClick:()=>{x(!1),w(null),A(null)},children:s(`resizeCard.cancel`)}),(0,Q.jsx)(V,{disabled:M==null&&!N||P,leftIcon:P?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>{A(null);let t={};M!=null&&(t.machine_size=M),N&&y!=null&&(t.storage_gib=y),j.mutate({path:{id:e.id},body:t})},children:s(k?`resizeCard.retry`:`resizeCard.apply`)})]})]})]})})]})}function Io({assistantId:e}){let{t}=J(`settings`),n=gn(),r=q(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(V,{variant:`dangerOutline`,onClick:()=>a(!0),className:`shrink-0`,children:t(`retireAssistant.button`)}),(0,Q.jsx)(v,{open:i,isPending:o,onConfirm:async()=>{s(!0);let t=await L(r,e);if(t.ok){a(!1),n(t.nextRoute,{replace:!0});return}W.error(t.error),s(!1),a(!1)},onCancel:()=>a(!1)})]})}var Lo=`UTC.Africa/Cairo.Africa/Johannesburg.Africa/Lagos.Africa/Nairobi.America/Anchorage.America/Argentina/Buenos_Aires.America/Bogota.America/Chicago.America/Denver.America/Halifax.America/Lima.America/Los_Angeles.America/Mexico_City.America/New_York.America/Phoenix.America/Santiago.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Jerusalem.Asia/Karachi.Asia/Kolkata.Asia/Kuala_Lumpur.Asia/Manila.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Athens.Europe/Berlin.Europe/Brussels.Europe/Dublin.Europe/Istanbul.Europe/Lisbon.Europe/London.Europe/Madrid.Europe/Moscow.Europe/Paris.Europe/Rome.Europe/Stockholm.Europe/Vienna.Europe/Warsaw.Europe/Zurich.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function Ro(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...Lo].sort()}function zo(e,t,n){let r=parseInt(n??`0`,10);if(r>59)return null;let i=parseInt(t??`0`,10)*60+r;return(e===`-`?-1:1)*i}function Bo(e){let t=e.split(`/`),n=(t[t.length-1]??e).replace(/_/g,` `),r=t.length>1?(t[0]??``).replace(/_/g,` `):``,i=0,a=``;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`;a=t.startsWith(`GMT`)||t.startsWith(`UTC`)?t:`GMT ${t}`;let n=t.match(/([+-])(\d{1,2})(?::(\d{2}))?/);n&&(i=zo(n[1],n[2],n[3])??0)}catch{return null}return{identifier:e,city:n,region:r,offsetLabel:a,offsetMinutes:i}}function Vo(){return Ro().map(e=>Bo(e)).filter(e=>e!==null)}function Ho(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function Uo(e,t){if(!e)return t;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`long`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;if(t)return t}catch{}return e.replace(/_/g,` `)}function Wo(e){if(e===`utc`||e===`gmt`)return 0;let t=e.match(/^(?:utc|gmt)?\s*([+-])(\d{1,2})(?::?(\d{2}))?$/);if(!t)return null;let n=zo(t[1],t[2],t[3]);return n!==null&&Math.abs(n)<=840?n:null}var Go=200,Ko=[];function qo({value:e,onChange:t}){let{t:n}=J(`settings`),[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(!1),s=(0,Z.useMemo)(()=>a?Vo():Ko,[a]),c=r.trim().toLowerCase(),l=(0,Z.useMemo)(()=>{let e=Wo(c);return(c?s.filter(t=>e===null?t.city.toLowerCase().includes(c)||t.region.toLowerCase().includes(c)||t.offsetLabel.toLowerCase().includes(c)||t.identifier.toLowerCase().includes(c):t.offsetMinutes===e):s).slice(0,Go)},[s,c]),u=(0,Z.useMemo)(()=>l.map(e=>e.identifier),[l]),d=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]);return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`timezonePicker.timezone`)}),(0,Q.jsxs)(Ue.Root,{className:`w-full md:max-w-[280px]`,options:u,value:e,onSelect:t,onOpenChange:e=>{if(e){o(!0);return}i(``)},autoActivateFirst:c.length>0,children:[(0,Q.jsx)(Ue.Input,{type:`text`,"aria-label":n(`timezonePicker.timezone`),value:r,placeholder:d||n(`timezonePicker.searchPlaceholder`),onChange:e=>i(e.target.value),fullWidth:!0}),(0,Q.jsx)(Ue.List,{"aria-label":n(`timezonePicker.timezonesAriaLabel`),className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,emptyState:(0,Q.jsx)(`p`,{className:`px-3 py-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`timezonePicker.noMatches`)}),children:l.map(e=>(0,Q.jsxs)(Ue.Option,{value:e.identifier,className:zt(`flex w-full items-center justify-between gap-3 px-3 py-2`,`text-body-medium-lighter text-[var(--content-default)] transition-colors`,`hover:bg-[var(--surface-active)]`,`data-[active]:bg-[var(--surface-active)] aria-selected:bg-[var(--surface-active)]`),children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-default`,children:e.city}),e.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.region})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:Ho(e.identifier)}),(0,Q.jsx)(`span`,{children:e.offsetLabel})]})]},e.identifier))})]})]}),(0,Q.jsx)(er,{}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`timezonePicker.zoneName`)}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:Uo(e,n(`timezonePicker.notSet`))})]})]})}function Jo(){let{t:e}=J(`settings`),t=Ye.use.activeAssistantId(),[n,r]=(0,Z.useState)(()=>gt(`timezone`,``)),i=(0,Z.useRef)(t);(0,Z.useEffect)(()=>{i.current=t},[t]);let a=(0,Z.useRef)(!1),o=(0,Z.useRef)(null),s=(0,Z.useRef)(()=>{}),c=e=>{if(a.current){o.current=e;return}let t=i.current;if(!t){o.current=null;return}a.current=!0,o.current=null,z.patch({url:`/v1/assistants/{assistant_id}/config`,path:{assistant_id:t},body:{ui:{userTimezone:e}},throwOnError:!0}).catch(e=>{y(e,{context:`settings-timezone-override`})}).finally(()=>{a.current=!1;let e=o.current;o.current=null,e!==null&&s.current(e)})};return(0,Z.useEffect)(()=>{s.current=c}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`timezoneSection.title`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`timezoneSection.description`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(0,Q.jsx)(qo,{value:n,onChange:e=>{r(e),oe(`timezone`,e),c(e)}})})]})}var Yo=[0,1,2,3,4,5,6];function Xo(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),t,n));return`${i.getHours().toString().padStart(2,`0`)}:${i.getMinutes().toString().padStart(2,`0`)}`}function Zo(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate(),t,n);return`${i.getUTCHours().toString().padStart(2,`0`)}:${i.getUTCMinutes().toString().padStart(2,`0`)}`}function Qo(){return Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}function $o(e){let t=e?.schedule?.window.start??`06:00`,n=e?.schedule?.window.end??`08:00`;return{enabled:e?.enabled??!0,timezone:`UTC`,frequency:e?.schedule?.frequency??`weekly`,daysOfWeek:e?.schedule?.days_of_week??[0],daysOfMonth:e?.schedule?.days_of_month??[],windowStart:Xo(t),windowEnd:Xo(n)}}function es({assistantId:e}){let{t}=J(`settings`),n=q(),r=[t(`updateWindowPolicy.dayMon`),t(`updateWindowPolicy.dayTue`),t(`updateWindowPolicy.dayWed`),t(`updateWindowPolicy.dayThu`),t(`updateWindowPolicy.dayFri`),t(`updateWindowPolicy.daySat`),t(`updateWindowPolicy.daySun`)],{data:i,isLoading:a,isError:o}=K(Jt({path:{id:e}})),s=(0,Z.useMemo)(()=>$o(i),[i]),[c,l]=(0,Z.useState)(null),u=c??s,d=c!==null,f=(0,Z.useMemo)(()=>Qo(),[]),[p,m]=(0,Z.useState)(null),h=p??u.daysOfMonth.join(`, `),g=cn({mutationFn:async t=>{let{data:n}=await Fe({path:{id:e},body:t,throwOnError:!0});return n}}),_=e=>{l(t=>({...t??s,...e}))},v=e=>{_({daysOfWeek:u.daysOfWeek.includes(e)?u.daysOfWeek.filter(t=>t!==e):[...u.daysOfWeek,e].sort((e,t)=>e-t)})},y=e=>e.split(`,`).map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)&&e>=1&&e<=31);return a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),t(`updateWindowPolicy.loading`)]}):o?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:t(`updateWindowPolicy.loadError`)}):(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(ce,{checked:u.enabled,onChange:e=>_({enabled:e}),label:t(`updateWindowPolicy.automaticUpdates`),helperText:t(`updateWindowPolicy.automaticUpdatesHelper`)}),u.enabled&&(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:t(`updateWindowPolicy.frequency`)}),(0,Q.jsx)(`div`,{className:`max-w-[400px]`,children:(0,Q.jsx)(fe,{ariaLabel:t(`updateWindowPolicy.frequency`),value:u.frequency,onChange:e=>{e!==`monthly`&&m(null),_({frequency:e})},items:[{value:`daily`,label:t(`updateWindowPolicy.daily`)},{value:`weekly`,label:t(`updateWindowPolicy.weekly`)},{value:`monthly`,label:t(`updateWindowPolicy.monthly`)}]})})]}),u.frequency===`weekly`&&(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:t(`updateWindowPolicy.daysOfWeek`)}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Yo.map(e=>(0,Q.jsx)(V,{variant:`outlined`,size:`compact`,active:u.daysOfWeek.includes(e),onClick:()=>v(e),children:r[e]},e))})]}),u.frequency===`monthly`&&(0,Q.jsx)(R,{label:t(`updateWindowPolicy.daysOfMonth`),type:`text`,value:h,onChange:e=>m(e.target.value),onBlur:e=>{let t=y(e.target.value);_({daysOfMonth:t}),m(t.join(`, `))},placeholder:t(`updateWindowPolicy.daysOfMonthPlaceholder`),helperText:t(`updateWindowPolicy.daysOfMonthHelper`),className:`w-48`}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:f?t(`updateWindowPolicy.updateWindowWithTz`,{tz:f}):t(`updateWindowPolicy.updateWindow`)}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(R,{type:`time`,value:u.windowStart,onChange:e=>_({windowStart:e.target.value})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:t(`updateWindowPolicy.to`)}),(0,Q.jsx)(R,{type:`time`,value:u.windowEnd,onChange:e=>_({windowEnd:e.target.value})})]})]})]}),(0,Q.jsx)(V,{variant:`primary`,leftIcon:g.isPending?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:async()=>{let r=u.frequency===`monthly`&&p!==null?y(p):u.daysOfMonth;try{await g.mutateAsync({enabled:u.enabled,timezone:`UTC`,schedule:{frequency:u.frequency,days_of_week:u.frequency===`weekly`?u.daysOfWeek:[],days_of_month:u.frequency===`monthly`?r:[],window:{start:Zo(u.windowStart),end:Zo(u.windowEnd)}}}),W.success(t(`updateWindowPolicy.toastSaved`)),l(null),m(null),n.invalidateQueries({queryKey:nn({path:{id:e}})})}catch{W.error(t(`updateWindowPolicy.toastSaveFailed`))}},disabled:g.isPending||!d,children:t(`updateWindowPolicy.savePolicy`)})]})}function ts({assistantId:e,open:t,onClose:n}){let{t:r}=J(`settings`);return(0,Q.jsx)(_.Root,{open:t,onOpenChange:e=>{e||n()},children:(0,Q.jsxs)(_.Content,{size:`md`,children:[(0,Q.jsxs)(_.Header,{children:[(0,Q.jsx)(_.Title,{children:r(`updateWindowModal.title`)}),(0,Q.jsx)(_.Description,{children:r(`updateWindowModal.description`)})]}),(0,Q.jsx)(_.Body,{children:(0,Q.jsx)(es,{assistantId:e})})]})})}function ns(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}function rs({open:e,onOpenChange:t}){let{t:n}=J(`settings`),r=q(),[i,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(!1),d=(0,Z.useRef)(e),f=()=>r.invalidateQueries({queryKey:ft()}),p=e=>{Xt({path:{id:e}}).catch(()=>void 0).finally(()=>void f())},m=$e({onSuccess:e=>{if(!d.current){p(e.factor_id);return}a(e)},onError:e=>{let r=ns(e);r===`no_workos_account`?W.error(n(`enrollTotpModal.toastNoWorkosAccount`)):r===`throttled`||r===`workos_rate_limited`?W.error(n(`enrollTotpModal.toastThrottled`)):r===`factor_limit_reached`?W.error(n(`enrollTotpModal.toastFactorLimitReached`)):W.error(n(`enrollTotpModal.toastStartFailed`)),t(!1)}}),h=Lt({onSuccess:e=>{e.valid?(u.current=!0,W.success(n(`enrollTotpModal.toastEnabled`)),f(),t(!1)):l(n(`enrollTotpModal.errorCodeMismatch`))},onError:e=>{let r=ns(e);if(r===`challenge_already_verified`){u.current=!0,W.success(n(`enrollTotpModal.toastEnabled`)),f(),t(!1);return}if(r===`challenge_expired`||r===`challenge_not_found`){i&&p(i.factor_id),a(null),s(``),l(n(`enrollTotpModal.errorSessionExpired`)),m.mutate({});return}if(r===`throttled`||r===`workos_rate_limited`){l(n(`enrollTotpModal.errorThrottledInline`));return}l(n(`enrollTotpModal.errorVerifyFailed`))}});(0,Z.useEffect)(()=>{d.current=e,e&&(u.current=!1,a(null),s(``),l(null),m.mutate({}))},[e]);let g=e=>{!e&&h.isPending||(!e&&i&&!u.current&&p(i.factor_id),t(e))},v=()=>{i&&P(i.secret,{successMessage:n(`enrollTotpModal.copySuccess`),errorMessage:n(`enrollTotpModal.copyError`)})},y=()=>{!i||o.length!==6||h.isPending||(l(null),h.mutate({body:{challenge_id:i.challenge_id,code:o}}))};return(0,Q.jsx)(_.Root,{open:e,onOpenChange:g,children:(0,Q.jsxs)(_.Content,{size:`sm`,children:[(0,Q.jsxs)(_.Header,{children:[(0,Q.jsx)(_.Title,{children:n(`enrollTotpModal.title`)}),(0,Q.jsx)(_.Description,{children:n(`enrollTotpModal.description`)})]}),(0,Q.jsx)(_.Body,{children:i===null?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(Y,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,Q.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,Q.jsx)(`img`,{src:i.qr_code,alt:n(`enrollTotpModal.qrCodeAlt`),className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`enrollTotpModal.manualKeyHint`)}),(0,Q.jsxs)(`button`,{type:`button`,onClick:v,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,Q.jsx)(`span`,{className:`break-all text-left`,children:i.secret}),(0,Q.jsx)(Mn,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`enrollTotpModal.codeLabel`)}),(0,Q.jsx)(R,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:n(`enrollTotpModal.codePlaceholder`),value:o,onChange:e=>s(e.target.value.replace(/\D/g,``).slice(0,6))}),c&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:c})]})]})}),(0,Q.jsxs)(_.Footer,{children:[(0,Q.jsx)(V,{variant:`outlined`,onClick:()=>g(!1),disabled:h.isPending,children:n(`enrollTotpModal.cancel`)}),(0,Q.jsx)(V,{onClick:y,disabled:i===null||o.length!==6||h.isPending,children:h.isPending?n(`enrollTotpModal.verifying`):n(`enrollTotpModal.verify`)})]})]})})}function is(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function as(){let{t:e}=J(`settings`),t=q(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(null),o=K({...Dt()}),s=o.data??[],l=()=>t.invalidateQueries({queryKey:ft()}),u=st({onSuccess:()=>{W.success(e(`twoFactorSection.toastRemoved`)),l()},onError:t=>{if(ns(t)===`factor_not_found`){l();return}W.error(e(`twoFactorSection.toastRemoveFailed`))}});return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o.isPending?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default`,children:e(`twoFactorSection.loading`)})]}):o.isError?(0,Q.jsx)(B,{tone:`error`,children:(0,Q.jsx)(ln,{ns:`settings`,i18nKey:`twoFactorSection.loadError`,components:{retryButton:(0,Q.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void o.refetch()})}})}):s.length===0?(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`twoFactorSection.emptyDescription`)}):(0,Q.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:s.map(t=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(Ln,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`twoFactorSection.authenticatorApp`)}),(0,Q.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[t.user,t.created_at?e(`twoFactorSection.addedOn`,{date:is(t.created_at)}):``]})]})]}),(0,Q.jsx)(V,{variant:`dangerOutline`,onClick:()=>a(t),disabled:u.isPending,children:e(`twoFactorSection.remove`)})]},t.id))}),!o.isPending&&!o.isError&&s.length===0&&(0,Q.jsx)(V,{onClick:()=>r(!0),className:`self-start`,children:e(`twoFactorSection.addAuthenticatorApp`)}),(0,Q.jsx)(rs,{open:n,onOpenChange:r}),(0,Q.jsx)(c,{open:i!==null,title:e(`twoFactorSection.removeDialogTitle`),message:e(`twoFactorSection.removeDialogMessage`),confirmLabel:e(`twoFactorSection.removeDialogConfirm`),destructive:!0,onConfirm:()=>{i&&u.mutate({path:{id:i.id}}),a(null)},onCancel:()=>a(null)})]})}var $=class extends Error{code;constructor(e,t){super(t),this.name=`TeleportError`,this.code=e}},os=`local`,ss=`docker`,cs=`vellum`;function ls(e){switch((e??``).toLowerCase()){case os:return`local`;case ss:return`docker`;case cs:return`managed`;default:return`other`}}function us(e){let t=ls(e);return t===`managed`?`local`:t===`local`?`platform`:null}function ds(e){switch(e){case`docker`:return`teleportCard.moveToDocker`;case`platform`:return`teleportCard.moveToPlatform`;case`local`:return`teleportCard.moveToLocal`}}var fs={macos:`Macos`,windows:`Windows`,linux:`Linux`};function ps(e,t=`macos`){switch(e){case`docker`:return`teleportCard.dockerDescription${fs[t]}`;case`platform`:return`teleportCard.platformDescription`;case`local`:return`teleportCard.localDescription${fs[t]}`}}function ms(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.reason!==`version_mismatch`)return null;let n=t.bundle_compat,r=t.target_runtime_version;if(!n||typeof n!=`object`||typeof r!=`string`)return null;let i=n,a=i.min_runtime_version;if(typeof a!=`string`)return null;let o=typeof i.max_runtime_version==`string`?i.max_runtime_version:null;return`Cannot import: bundle requires runtime ${o?`${a}–${o}`:`${a}+`}, but this local runtime is ${r}. Update your local runtime before importing.`}var hs=3600*1e3;function gs(e,t=Date.now(),n=hs){for(let r of e){if(!r)continue;let e=Date.parse(r);if(Number.isNaN(e))continue;let i=t-e;if(i>=0&&i<=n)return!0}return!1}function _s(e){return e.filter(e=>e.ready_to_use!==!1).map(e=>e.created_at)}function vs(e,t){return e.some(e=>e.snapshot_name===t&&e.ready_to_use===!0)}async function ys(e,t){let n=Number(e.headers.get(`Content-Length`)??0);if(!e.body||!t||n<=0){let n=await e.arrayBuffer();return t?.(1),n}let r=e.body.getReader(),i=[],a=0;for(;;){let{done:e,value:o}=await r.read();if(e)break;i.push(o),a+=o.length,t(a/n)}let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.length;return t(1),o.buffer}function bs(e){let t=Le(e);if(!t)throw new $(`local_assistant_not_found`,`Assistant ${e.assistantId} has no resolved local gateway.`);return`${window.location.origin}${t}`}async function xs(e,t){let n=await Ht(e.assistantId),r=await fetch(`${t}/auth/token`,{method:`POST`,headers:{Authorization:`Bearer ${n}`}});if(!r.ok)throw new $(`not_signed_in`,`Gateway token request failed (HTTP ${r.status}).`);let{token:i}=await r.json();return i}async function Ss(e,t){let n=bs(e),r=await xs(e,n),i=await fetch(`${n}/v1/migrations/export`,{method:`POST`,headers:{Authorization:`Bearer ${r}`}});if(!i.ok)throw new $(`export_failed`,`Export failed (HTTP ${i.status}).`);return ys(i,t)}async function Cs(e,t){let n=bs(e),r=await xs(e,n),i=await fetch(`${n}/v1/migrations/import`,{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:new Blob([t],{type:`application/octet-stream`})});if(!i.ok)throw new $(`import_failed`,`Import failed (HTTP ${i.status}).`);let a=await Ds(i);if(a&&a.success===!1)throw new $(`import_failed`,a.error??`Import reported failure`)}async function ws(e){let t=bs(e),n=await xs(e,t),r=await fetch(`${t}/v1/backups/create`,{method:`POST`,headers:{Authorization:`Bearer ${n}`}});if(!r.ok)throw new $(`backup_failed`,G(`settings:teleportCard.backupLocalFailed`,{status:r.status}));let i=await Ds(r);if(i&&i.success===!1)throw new $(`backup_failed`,G(`settings:teleportCard.backupLocalReportedFailure`))}async function Ts(e,t){let{data:n,response:r}=await z.post({url:`/v1/assistants/{assistant_id}/migrations/export-to-gcs/`,path:{assistant_id:e},body:{upload_url:t},throwOnError:!1}),i=r?.status??0;if(!(r?.ok??!1)&&i!==202)throw new $(`export_failed`,`Export failed (HTTP ${i}).`);let a=n?.job_id;if(!a)throw new $(`export_failed`,`Export accepted but no job ID was returned.`);return a}async function Es(e,t){let{data:n,response:r}=await z.get({url:`/v1/assistants/{assistant_id}/migrations/jobs/{job_id}`,path:{assistant_id:e,job_id:t},throwOnError:!1}),i=r?.status??0;if(i>=500)return`processing`;if(!(r?.ok??!1))throw new $(`export_job_failed`,`Job status check failed (HTTP ${i})`);let a=n;if(a?.status===`failed`)throw new $(`export_job_failed`,a.error??`Export job failed`);return a?.status??`processing`}async function Ds(e){try{return await e.json()}catch{return null}}async function Os(e,t={}){let n=ls(e.cloud);if(n===`managed`)return js(e.assistantId,t);if(n===`local`)return ws(e);throw new $(`backup_failed`,G(`settings:teleportCard.backupUnsupported`))}async function ks(e){let n=await t({path:{assistant_id:e},throwOnError:!1});if(!(n.response?.ok??!1))throw new $(`backup_failed`,G(`settings:teleportCard.backupListFailed`,{status:n.response?.status??0}));let r=n.data?.backups;return Array.isArray(r)?r:[]}var As=e=>new Promise(t=>setTimeout(t,e));async function js(e,t){if(gs(_s(await ks(e))))return;let n=await ve({path:{assistant_id:e},throwOnError:!1});if(!(n.response?.ok??!1))throw new $(`backup_failed`,G(`settings:teleportCard.backupCreateFailed`,{status:n.response?.status??0}));let r=n.data,i=r?.snapshot_name;if(!i)throw new $(`backup_failed`,G(`settings:teleportCard.backupNoSnapshotName`));if(r?.ready_to_use===!0)return;let a=t.readyTimeoutMs??6e5,o=t.readyPollIntervalMs??5e3,s=Date.now()+a;for(;Date.now()<s;)if(await As(o),vs(await ks(e),i))return;throw new $(`backup_failed`,G(`settings:teleportCard.backupNotReady`,{snapshot:i,seconds:Math.round(a/1e3)}))}var Ms=new Set([500,502,503,504]),Ns=3,Ps=e=>new Promise(t=>setTimeout(t,e));async function Fs(e,t=new Set){for(let n=0;n<=Ns;n++){let{response:r,data:i,error:a}=await e(),o=r?.status??0;if(n<Ns&&Ms.has(o)&&!t.has(o)){await Ps(2**n*1e3);continue}return{status:o,data:i,error:a}}throw new $(`unknown`,`Unexpected retry loop exit`)}async function Is(e,t){let n={operation:`upload`};e&&(n.min_runtime_version=e,n.max_runtime_version=null),t&&(n.consumer=t);let{status:r,data:i}=await Fs(()=>z.post({url:`/v1/migrations/signed-url/`,body:n,throwOnError:!1}),new Set([404,503]));if(r===503||r===404)throw new $(`export_failed`,`Signed URL uploads are not available — the platform may not support this feature yet.`);if(r!==201)throw new $(`export_failed`,`Migration request failed (HTTP ${r}).`);let a=i;return{url:a.url,bundleKey:a.bundle_key,expiresAt:a.expires_at}}async function Ls(e,t){let{status:n,data:r,error:i}=await Fs(()=>z.post({url:`/v1/migrations/signed-url/`,body:{operation:`download`,bundle_key:e,target_runtime_version:t},throwOnError:!1}),new Set([422]));if(n===422){let e=ms(i);if(e)throw new $(`version_mismatch`,e)}if(n!==200&&n!==201)throw new $(`import_failed`,`Migration request failed (HTTP ${n}).`);return r.url}async function Rs(e,t,n){for(let r=0;r<=Ns;r++){let i=await zs(e,t,n);if(r<Ns&&Ms.has(i)){await Ps(2**r*1e3),n?.(0);continue}if(i<200||i>=300)throw new $(`export_failed`,`Bundle upload failed (HTTP ${i}).`);return}}function zs(e,t,n){return new Promise((r,i)=>{let a=new XMLHttpRequest;a.open(`PUT`,e),a.setRequestHeader(`Content-Type`,`application/octet-stream`),a.timeout=36e5,n&&(a.upload.onprogress=e=>{e.lengthComputable&&n(e.loaded/e.total)}),a.onload=()=>{n?.(1),r(a.status)},a.onerror=()=>i(new $(`export_failed`,`Bundle upload failed.`)),a.ontimeout=()=>i(new $(`export_timed_out`,`Bundle upload timed out.`)),a.send(t)})}async function Bs(e,t){for(let n=0;n<=Ns;n++){let r=await fetch(e,{method:`GET`});if(n<Ns&&Ms.has(r.status)){await Ps(2**n*1e3),t?.(0);continue}if(!r.ok)throw new $(`import_failed`,`Bundle download failed (HTTP ${r.status}).`);return ys(r,t)}throw new $(`import_failed`,`Unexpected retry loop exit`)}async function Vs(e){let{status:t,data:n,error:r}=await Fs(()=>z.post({url:`/v1/migrations/import-from-gcs/`,body:{bundle_key:e},throwOnError:!1}));return{status:t,body:n??r??null}}async function Hs(e){let{status:t,data:n}=await Fs(()=>z.get({url:`/v1/migrations/jobs/{job_id}/`,path:{job_id:e},throwOnError:!1}));if(t!==200)throw new $(`import_failed`,`Job status check failed (HTTP ${t})`);let r=n??{};return{status:typeof r.status==`string`?r.status:`unknown`,jobId:typeof r.job_id==`string`?r.job_id:null,error:typeof r.error==`string`?r.error:null}}var Us=5e3,Ws=36e5,Gs=5*6e4,Ks=30,qs=e=>new Promise(t=>setTimeout(t,e));function Js(){let e=gn(),t=q(),n=Te(),r=us(n?.cloud),[i,a]=(0,Z.useState)({kind:`idle`}),[s,c]=(0,Z.useState)(!1),l=(0,Z.useRef)(null),u=(0,Z.useRef)(null),d=(0,Z.useCallback)(e=>{a({kind:`transferring`,step:e,progress:null})},[]),f=(0,Z.useCallback)(e=>{a(t=>t.kind===`transferring`?{...t,progress:e}:t)},[]),p=(0,Z.useCallback)(async()=>{if(!(!n||!r)){u.current={id:n.assistantId,kind:ls(n.cloud)===`managed`?`managed`:`local`,createdFresh:!1};try{if(d(G(`settings:teleportCard.backupStep`)),await Os(n),r===`platform`)await Ys(n,d,f,l);else if(r===`local`)await Xs(n,d,f,l);else throw new $(`unknown`,G(`settings:teleportCard.unsupportedDestination`));a({kind:`verifying`})}catch(e){a({kind:`failed`,error:G(`settings:teleportCard.teleportFailed`,{message:e instanceof $||e instanceof Error?e.message:G(`settings:teleportCard.teleportFailedUnknown`)})}),y(e,{context:`teleport-execute`}),await Qs(t,l.current,u.current,`teleport-execute-cleanup`),l.current=null}}},[n,r,d,f,t]),h=(0,Z.useCallback)(()=>c(!0),[]),g=(0,Z.useCallback)(()=>c(!1),[]),_=(0,Z.useCallback)(()=>{c(!1),p()},[p]),v=(0,Z.useCallback)(()=>{l.current=null,u.current=null,a({kind:`idle`})},[]);return{destination:r,phase:i,confirmOpen:s,requestTeleport:h,cancelConfirm:g,confirm:_,confirmAndSwitch:(0,Z.useCallback)(()=>{let n=l.current,r=u.current;n&&(async()=>{try{let e=Qt.getState();n.kind===`managed`?await e.connectPlatformAssistant(n.id):(await e.connectLocalAssistant(n.id),o(n.id,{onError:e=>y(e,{context:`teleport-inject-platform-identity`})}))}catch(e){a({kind:`failed`,error:G(`settings:teleportCard.switchFailed`,{message:e instanceof Error?e.message:G(`settings:teleportCard.switchFailedUnknown`)})}),y(e,{context:`teleport-confirm-switch`});return}r&&L(t,r.id).then(e=>{e.ok||y(Error(e.error),{context:`teleport-retire-source`})}),v(),e(m.assistant,{replace:!0})})()},[e,v,t]),cancelTeleport:(0,Z.useCallback)(()=>{let e=l.current,n=u.current;l.current=null,u.current=null,a({kind:`idle`}),Qs(t,e,n,`teleport-cancel-retire-target`)},[t]),reset:v}}async function Ys(e,t,n,r){t(G(`settings:teleportCard.stepExportingLocal`));let i=await Ss(e,n);t(G(`settings:teleportCard.stepResolvingOrganization`));let a=await ec();t(G(`settings:teleportCard.stepCheckingExisting`));let o=(await Mt({query:{hosting:`platform`},throwOnError:!1})).data?.results?.[0];if(o)throw new $(`existing_platform_assistant`,G(`settings:teleportCard.existingPlatformAssistant`,{id:o.id}));t(G(`settings:teleportCard.stepUploading`));let s=await Is(e.resources?.runtimeVersion);await Rs(s.url,i,n),t(G(`settings:teleportCard.stepSettingUpCloud`));let c=await te(void 0,`create`);if(!c.ok)throw new $(`import_failed`,G(`settings:teleportCard.cloudSetupFailed`));if(c.status===200)throw new $(`existing_platform_assistant`,G(`settings:teleportCard.existingPlatformAssistant`,{id:c.data.id}));let l=c.data.id;await ee({assistantId:l,name:c.data.name,cloud:`vellum`,runtimeUrl:at(),hatchedAt:c.data.created??new Date().toISOString(),organizationId:a}),await je(e.assistantId),r.current={id:l,kind:`managed`,createdFresh:!0},t(G(`settings:teleportCard.stepFinalizingCloud`)),await tc(l),t(G(`settings:teleportCard.stepImportingToCloud`));let u=await Vs(s.bundleKey);if(u.status<200||u.status>=300){let e=u.body;throw new $(`import_failed`,e?.error??G(`settings:teleportCard.importFailedHttp`,{status:u.status}))}if(u.status===202){let e=u.body?.job_id;if(!e)throw new $(`import_failed`,G(`settings:teleportCard.importNoJobId`));await nc(e)}else{let e=u.body;if(e&&e.success===!1)throw new $(`import_failed`,e.error??G(`settings:teleportCard.importReportedFailure`))}}async function Xs(e,t,n,r){t(G(`settings:teleportCard.stepPreparingExport`));let i=await Is(await $s(e.assistantId),`runtime`);t(G(`settings:teleportCard.stepExportingCloud`));let a=await Ts(e.assistantId,i.url);await rc(e.assistantId,a),t(G(`settings:teleportCard.stepPreparingLocal`));let{assistant:o,createdFresh:s}=await ic();r.current={id:o.assistantId,kind:`local`,createdFresh:s};let c=await Zs(o,s);if(!c)throw new $(`local_assistant_not_found`,G(`settings:teleportCard.localRuntimeVersionUnknown`));t(G(`settings:teleportCard.stepPreparingImport`));let l=await Ls(i.bundleKey,c);t(G(`settings:teleportCard.stepDownloading`));let u=await Bs(l,n);t(G(`settings:teleportCard.stepImporting`)),await oc(o,u),await je(e.assistantId)}async function Zs(e,t){if(e.resources?.runtimeVersion)return e.resources.runtimeVersion;if(t)return(await Vn())?.version??void 0}async function Qs(e,t,n,r){if(t?.createdFresh){let n=await L(e,t.id);n.ok||y(Error(n.error),{context:r})}n&&await je(n.id)}async function $s(e){let t=await w(e);return t.ok?t.data.version??void 0:void 0}async function ec(){let e=ue.getState();e.organizations.length===0&&await e.fetchOrganizations();let t=ue.getState().organizations,n=u();if(n&&t.some(e=>e.id===n))return n;if(t.length===0)throw new $(`no_organizations`,G(`settings:teleportCard.noOrganizations`));if(t.length>1)throw new $(`multiple_organizations`,G(`settings:teleportCard.multipleOrganizations`));let r=t[0].id;return ue.getState().setCurrentOrganizationId(r),r}async function tc(e){let t=Date.now();for(;Date.now()-t<Gs;){let{data:t,response:n}=await St({path:{id:e},throwOnError:!1});if(n?.ok&&t?.state===`active`)return;await qs(Us)}}async function nc(e){let t=Date.now();for(;Date.now()-t<Ws;){await qs(Us);let t=await Hs(e);if(t.status===`complete`)return;if(t.status===`failed`)throw new $(`import_failed`,t.error??G(`settings:teleportCard.importJobFailed`))}throw new $(`import_failed`,G(`settings:teleportCard.importTimedOut`))}async function rc(e,t){let n=Date.now();for(;Date.now()-n<Ws;)if(await qs(Us),await Es(e,t)===`complete`)return;throw new $(`export_timed_out`,G(`settings:teleportCard.exportTimedOut`))}async function ic(){let e=await kt(void 0,void 0);if(!e.ok)throw new $(`local_assistant_not_found`,e.error??G(`settings:teleportCard.localCreateFailed`));await j();let t=e.assistantId?ut().find(t=>t.assistantId===e.assistantId):ac();if(!t)throw new $(`local_assistant_not_found`,G(`settings:teleportCard.localNotFound`));return{assistant:t,createdFresh:!0}}function ac(){return ut().slice().sort((e,t)=>(t.hatchedAt??``).localeCompare(e.hatchedAt??``))[0]}async function oc(e,t){let n;for(let r=0;r<Ks;r++)try{await Cs(e,t);return}catch(e){n=e,await qs(1e3)}throw n instanceof Error?n:new $(`import_failed`,G(`settings:teleportCard.importFailed`))}function sc(){let{t:e}=J(`settings`),t=Js(),{destination:n,phase:r}=t,i=H.use.teleport(),a=tn();return!n||a===`gated`||r.kind===`idle`&&n===`platform`&&!i?null:(0,Q.jsxs)(X,{title:e(`teleportCard.title`),subtitle:e(`teleportCard.subtitle`),children:[r.kind===`idle`&&a===`disabled`&&(0,Q.jsx)(Qe,{children:e(`teleportCard.loginNotice`)}),r.kind===`idle`&&a===`full`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(ps(n,Ne()))}),(0,Q.jsx)(V,{variant:`outlined`,className:`self-start`,onClick:t.requestTeleport,children:e(ds(n))})]}),r.kind===`transferring`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r.progress==null&&(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:r.step})]}),r.progress!=null&&(0,Q.jsx)(s,{value:r.progress,"aria-label":e(`teleportCard.progressAriaLabel`),className:`max-w-[240px]`})]}),r.kind===`verifying`&&(0,Q.jsx)(B,{tone:`success`,icon:(0,Q.jsx)(kn,{className:`h-4 w-4`}),title:e(`teleportCard.verifyTitle`),actions:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(V,{variant:`primary`,onClick:t.confirmAndSwitch,children:e(`teleportCard.confirmAndSwitch`)}),(0,Q.jsx)(V,{variant:`outlined`,onClick:t.cancelTeleport,children:e(`teleportCard.cancel`)})]})}),r.kind===`failed`&&(0,Q.jsx)(B,{tone:`error`,title:r.error,actions:(0,Q.jsx)(V,{variant:`outlined`,onClick:t.reset,children:e(`teleportCard.tryAgain`)})}),(0,Q.jsx)(c,{open:t.confirmOpen,title:e(ds(n)),message:e(`teleportCard.confirmMessage`),confirmLabel:e(`teleportCard.confirmLabel`),onConfirm:t.confirm,onCancel:t.cancelConfirm})]})}function cc(){let{t:e}=J(`settings`),{assistant:t,healthz:n,healthzLoading:r,healthzFetching:i,healthzPolling:a,refetch:o,refetchUntilResized:s}=Yn(),c=H.use.multiPlatformAssistant(),u=H.use.accountMfa(),d=Re.use.settingsSleepPolicy(),p=f(),h=At(),_=xt()||p||ge()||h,v=gn(),y=tn(),b=tn({platformHostedOnly:!0}),x=rn(),S=g({assistantId:t?.id??null,enabled:b===`full`&&x}),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(!1),[D,O]=hn();(0,Z.useEffect)(()=>{if(D.get(`preferences`)!==`open`)return;let e=new URLSearchParams(D);e.delete(`preferences`),O(e,{replace:!0}),E(!0)},[D,O]);let k=t?.is_local&&!xt()?null:t,A=Te(),j=xt()&&!!t&&!!A&&pe(A),M=j,N=j&&!ge(),ee=b===`full`&&!!k||N&&!!t;(0,Z.useEffect)(()=>{!t||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[t]);let P=n?.version??t?.current_release_version??null,te=()=>{let e=$t();if(ge()&&!h&&e){let t=new URLSearchParams({register:xe()}),n=Ce();n&&t.set(`name`,n);let r=new URL(e).origin;window.location.assign(`${r}${m.selectAssistant}?${t.toString()}`);return}v(`${m.selectAssistant}?noAutoSkip=1`)},F=(y===`full`||M)&&!!k||y===`disabled`&&!M,I=b!==`gated`;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[S.status&&S.mode!==`inactive`&&(0,Q.jsx)(Je,{status:S.status,mode:S.mode,isAcknowledging:S.isAcknowledging,acknowledgeError:S.acknowledgeError?.message??null,onAcknowledge:()=>void S.acknowledge(),onReviewWorkspaceData:()=>void v(`${m.workspace}?sort=size`),onUpgradeStorage:b===`full`?()=>void v(m.plans):null}),(0,Q.jsxs)(_r,{assistant:x?k:null,showHandles:p&&y===`full`,children:[(0,Q.jsx)(Jo,{}),u&&y!==`gated`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`generalPage.twoFactorTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.twoFactorDescription`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:y===`disabled`?(0,Q.jsx)(Qe,{children:e(`generalPage.twoFactorLoginNotice`)}):(0,Q.jsx)(as,{})})]})]})]}),(0,Q.jsx)(X,{title:e(`generalPage.versionTitle`),subtitle:e(`generalPage.versionSubtitle`),accessory:b===`full`&&k?(0,Q.jsx)(V,{variant:`outlined`,onClick:()=>w(!0),children:e(`generalPage.updateWindow`)}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[b===`full`&&k&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(bi,{assistantId:k.id,currentVersion:P,releaseChannel:k.release_channel,onUpgradeComplete:()=>{o()}}),(0,Q.jsx)(Eo,{assistantId:k.id,onComplete:()=>{o()}})]}),N&&t&&(0,Q.jsx)(xi,{assistantId:t.id,currentVersion:P,onUpgradeComplete:()=>{o()}}),!ee&&t&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.current`)}),(0,Q.jsx)(Xn,{version:P,loading:r&&!t.current_release_version,assistantId:t.id??null})]}),b===`disabled`&&!N&&(0,Q.jsx)(Qe,{children:e(`generalPage.updatesLoginNotice`)}),(0,Q.jsx)(Mo,{})]})}),b===`full`&&k&&(0,Q.jsx)(ts,{assistantId:k.id,open:C,onClose:()=>w(!1)}),b===`full`&&t&&(0,Q.jsx)(Fo,{assistant:t,healthz:n,healthzLoading:r,healthzFetching:i,healthzPolling:a,refetch:o,refetchUntilResized:s}),b===`disabled`&&(0,Q.jsx)(X,{id:`storage-resources`,title:e(`generalPage.computeResourcesTitle`),subtitle:e(`generalPage.computeResourcesSubtitle`),children:(0,Q.jsx)(Qe,{children:e(`generalPage.computeResourcesLoginNotice`)})}),(0,Q.jsx)(X,{title:e(`generalPage.preferencesTitle`),subtitle:e(`generalPage.preferencesSubtitle`),accessory:(0,Q.jsx)(V,{variant:`outlined`,onClick:()=>E(!0),children:e(`generalPage.customize`)}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsx)(ir,{}),(0,Q.jsx)(ci,{})]})}),(0,Q.jsx)(xo,{open:T,onClose:()=>E(!1)}),(0,Q.jsx)(Ti,{}),(0,Q.jsx)(po,{}),b===`full`&&k&&d&&(0,Q.jsx)(X,{title:e(`generalPage.sleepPolicyTitle`),subtitle:e(`generalPage.sleepPolicySubtitle`),children:(0,Q.jsx)(gi,{assistantId:k.id})}),b===`disabled`&&d&&(0,Q.jsx)(X,{title:e(`generalPage.sleepPolicyTitle`),subtitle:e(`generalPage.sleepPolicySubtitle`),children:(0,Q.jsx)(Qe,{children:e(`generalPage.sleepPolicyLoginNotice`)})}),c&&!_&&(0,Q.jsx)(di,{}),_&&(0,Q.jsx)(X,{title:e(`generalPage.switchAssistantTitle`),subtitle:e(`generalPage.switchAssistantSubtitle`),accessory:(0,Q.jsx)(V,{variant:`outlined`,onClick:te,children:e(`generalPage.chooseAssistant`)})}),l()&&(0,Q.jsx)(sc,{}),(F||I)&&(0,Q.jsx)(X,{variant:`danger`,title:e(`generalPage.dangerZoneTitle`),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[F&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`generalPage.retireAssistantTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.retireAssistantDescription`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(y===`full`||M)&&k?(0,Q.jsx)(Io,{assistantId:k.id}):(0,Q.jsx)(Qe,{children:e(`generalPage.retireAssistantLoginNotice`)})})]}),F&&I&&(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(Si,{})]})})]})}export{cc as GeneralPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ah as t,Au as n,Bh as r,Bx as i,Db as a,Dh as o,Eb as s,Fb as c,Gh as ee,Hb as te,Hh as ne,Hu as re,Hy as ie,Iy as ae,Kh as oe,Mh as l,Mu as u,Pu as se,Sv as ce,Th as d,Vh as le,Wh as f,Wr as p,Wx as m,Yy as ue,_b as de,cy as fe,gm as h,ku as g,ky as _,nb as pe,pb as v,rh as y,vv as b,wi as x,wp as me,zh as he,zy as ge}from"./app-DVwAB8n7.js";import{dr as S,er as _e,j as C}from"./vendor-Bb38ZAP8.js";import{_ as w,f as ve,t as T,x as E}from"./react-B9IgSVeK.js";import{c as ye,n as be,t as xe}from"./provider-key-m64urt9F.js";import{a as Se,i as D,n as Ce,o as we,r as Te,s as Ee,t as De}from"./avatar-random-Dpf2HGEt.js";import{t as Oe}from"./plugin-attribution-D1IJgqV1.js";var O=e(E(),1),k=T(),ke=800,A=null,j,M=null,N=null;function P(){A=null,j=void 0,M=null,N=null}var Ae={initializing:0,provisioning:.33,connecting:.66,resizing:.85,ready:1},F=1500,je={initializing:`hatchingScreen.phase.initializing`,provisioning:`hatchingScreen.phase.provisioning`,connecting:`hatchingScreen.phase.connecting`,resizing:`hatchingScreen.phase.resizing`,ready:`hatchingScreen.phase.ready`};function Me(e,t,n){if(e>=t)return t;let r=1-(1-Math.min(1,n/F))**3;return e+(t-e)*r}function Ne(){let e=u(g(),{kind:`hatch-gate`});return e.action===`redirect`?{kind:`redirect`,to:e.to}:e.action===`wait`?{kind:`wait`}:{kind:`proceed`}}function I(){let{t:e}=C(`onboarding`),u=y(),g=ve(),T=_e(),[E]=w(),F=E.get(`hosting`),I=E.get(`fail`),Pe=E.get(Oe),L=a(),R=_()&&F!==null&&F!==`vellum-cloud`,z=F===`vellum-cloud`,Fe=E.get(n)===`1`,B=me.use.sessionStatus(),Ie=R?l(B):B,[V]=(0,O.useState)(()=>N??=De(x)),H=(0,O.useMemo)(()=>{let e=h(x,V.bodyShape,V.eyeStyle,V.color,320);return e?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`:``},[V]),[U,W]=(0,O.useState)(`initializing`),[Le,G]=(0,O.useState)(null),[Re,K]=(0,O.useState)(!1),[ze,Be]=(0,O.useState)(!1),[Ve,He]=(0,O.useState)(0),[Ue,q]=(0,O.useState)(0),[We,J]=(0,O.useState)(0),Y=(0,O.useRef)(U),X=(0,O.useRef)(0),Z=(0,O.useRef)(0),Q=(0,O.useRef)(0),$=(0,O.useCallback)(e=>{X.current=Q.current,Z.current=Date.now(),Y.current=e,W(e),J(e=>e+1)},[]);return(0,O.useEffect)(()=>{if(I!==null){G(`Simulated hatch failure (developer menu → Replay Hatch Failure).`);return}let e=Ne();if(e.kind===`redirect`){g(e.to,{replace:!0});return}if(e.kind===`wait`)return;z&&_()&&(v(),de(null)),K(!1),Be(!1);let n=!1,i=null,a=null,l=null,u=Date.now(),p,m=!1,h=!1,y=se(),b=e=>{try{re(``)}catch(e){c(e,{context:`onboarding_mark_completed`})}q(1),Q.current=1,X.current=1,W(`ready`),Y.current=`ready`,a=setTimeout(()=>{n||(P(),(async()=>{if(await t.checkAssistant(),!n){if(ce(E)){we(e),g(`${s.assistant}?onboarding=1`,{replace:!0});return}if(R){let t=new URLSearchParams;F&&t.set(`hosting`,F),e&&t.set(`assistant`,e),Pe&&t.set(Oe,Pe);let n=t.toString();g(`${s.onboarding.research}${n?`?${n}`:``}`,{replace:!0});return}g(s.onboarding.research,{replace:!0})}})())},ke)},x=e=>Ee(e,V,T),_e=async()=>{if($(`provisioning`),!R){try{let e=await f(),t=le(e);if(!n&&e.ok&&t.kind===`active`){_()&&ue(e.data.id,e.data.name,o()??void 0),await w(e.data.id);return}t.kind===`auto_hatch`&&(h=!0)}catch{}if(n)return}if(R){try{let e=F===`docker`?`docker`:void 0;A&&j!==e&&P(),A||=(j=e,pe(void 0,e));let t=await A;if(n)return;if(!t.ok){P(),G(t.error??`Failed to hatch local assistant.`);return}await ae(),t.assistantId&&d(t.assistantId),$(`connecting`);let r=!1;for(;!n&&!r;){if(await ie()){v(),await ge(),r=!0;break}if(Date.now()-u>=3e5){P(),G(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{l=setTimeout(e,D)}),l=null}if(n)return;if(t.assistantId)try{await be(t.assistantId)}catch(e){if(e instanceof xe){if(!n){let t=ye(e.provider)?.displayName??e.provider;Be(!0);let n=`Update your ${t} API key to continue.`;G(e.reason?`${e.reason} ${n}`:n)}return}c(e,{context:`onboarding_apply_provider_key`})}t.assistantId&&await me.getState().connectLocalAssistant(t.assistantId),t.assistantId&&(fe.getState().upsertFromApi({id:t.assistantId,name:t.assistantId,status:`active`,is_local:!0,created:new Date().toISOString()}),d(t.assistantId),x(t.assistantId)),b(t.assistantId)}catch{if(P(),n)return;G(`Failed to hatch local assistant. Check CLI logs for details.`)}return}try{M||=oe(y?{version:y}:void 0);let e=await M;if(M=null,n)return;if(e.ok&&(p=e.data.id),m=e.ok&&e.status===201,!e.ok){if(S(`Onboarding hatch request failed`,{level:`warning`,extra:{status:e.status,error:e.error}}),r(e.status,e.error)){G(he),K(!0);return}if(!ne(e.status)){G(te(e.error,void 0,`Failed to start your assistant. Please try again.`));return}}}catch(e){if(M=null,c(e,{context:`onboarding_hatch_assistant`}),n)return}C(0)},C=e=>{n||(i=setTimeout(ve,e))},w=async e=>{for($(`connecting`);!n;){try{if((await ee(e)).ok)break}catch{}if(Date.now()-u>=3e5){G(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{i=setTimeout(e,D)}),i=null}if(n)return;let t=await Se({assistantId:e,postCheckoutReturn:Fe,managedHatch:z,hatchStartMs:u,isCancelled:()=>n,onResizeWait:()=>$(`resizing`),registerTimer:e=>{i=e}});if(!n){if(t===`health_timeout`){S(`Onboarding hatch wait exceeded timeout`,{level:`warning`,extra:{maxWaitMs:Te,stage:`post_resize_health`}}),G(`Your assistant is taking longer than expected. Please try again.`);return}b(e)}},ve=async()=>{if(!n){if(Date.now()-u>=3e5){S(`Onboarding hatch wait exceeded timeout`,{level:`warning`,extra:{maxWaitMs:Te}}),G(`Your assistant is taking longer than expected. Please try again.`);return}try{let e=await f(p);if(n||p&&!e.ok&&e.status===404&&(p=void 0,e=await f(),n))return;let t=le(e);if(t.kind===`active`){if(e.ok){let t=e.data.id;fe.getState().upsertFromApi(e.data),d(t),(m||h)&&x(t),_()&&ue(t,e.data.name,o()??void 0),await w(t);return}b();return}if(t.kind===`error`){G(t.message);return}t.kind!==`auto_hatch`&&Y.current===`provisioning`&&$(`connecting`),C(D)}catch(e){if(c(e,{context:`onboarding_poll_assistant`}),n)return;C(D)}}};return _e(),()=>{n=!0,i&&clearTimeout(i),a&&clearTimeout(a),l&&clearTimeout(l)}},[Ve,I,V,z,Fe,Ie,g,T,$,R]),(0,O.useEffect)(()=>{Z.current===0&&(Z.current=Date.now());let e,t=()=>{let n=Date.now()-Z.current,r=Ae[Y.current],i=Me(X.current,r,n);Q.current=i,q(i),r-i>1e-6&&(e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[We]),Le?(0,k.jsx)(p,{avatarWave:`beside`,children:(0,k.jsxs)(`div`,{role:`alert`,className:`mx-auto flex w-full max-w-xl flex-col items-center ${L?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40 md:min-h-full md:pb-6`} text-center text-[var(--content-default)]`,children:[(0,k.jsx)(`h1`,{className:L?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:e(ze?`hatchingScreen.apiKeyFailed`:`hatchingScreen.genericFailure`)}),(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${L?`mt-3.5`:`mt-4`}`,children:Le}),Re&&(0,k.jsxs)(`div`,{className:`mt-6 flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,k.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`hatchingScreen.localFallbackPitch`)}),(0,k.jsx)(m,{asChild:!0,variant:`primary`,size:`regular`,fullWidth:!0,className:L?void 0:`h-11 text-base`,children:(0,k.jsx)(`a`,{href:`${window.location.origin}/download`,children:e(Ce(u))})})]}),(0,k.jsx)(`img`,{src:H,alt:``,width:160,height:160,className:`${L?`my-auto py-8`:`my-16`} onboarding-avatar-failed`}),(0,k.jsxs)(`div`,{className:`flex w-full flex-col ${L?`gap-2.5 max-w-[280px]`:`gap-2 max-w-sm`}`,children:[ze?(0,k.jsx)(m,{variant:`primary`,size:`regular`,fullWidth:!0,className:L?void 0:`h-11 text-base`,onClick:()=>void g(F?`${s.onboarding.apiKey}?hosting=${F}`:s.onboarding.apiKey,{replace:!0}),children:e(`hatchingScreen.updateApiKey`)}):(0,k.jsx)(m,{variant:`primary`,size:`regular`,fullWidth:!0,className:L?void 0:`h-11 text-base`,onClick:()=>{X.current=0,Z.current=Date.now(),Y.current=`initializing`,Q.current=0,W(`initializing`),q(0),J(e=>e+1),G(null),K(!1),He(e=>e+1)},children:e(`actions.tryAgain`)}),(0,k.jsx)(m,{variant:`outlined`,size:`regular`,fullWidth:!0,className:L?void 0:`h-11 text-base`,onClick:()=>void g(R?s.onboarding.hosting:`${s.onboarding.privacy}?${b}=1`,{replace:!0}),children:e(`actions.back`)})]})]})}):(0,k.jsx)(p,{avatarWave:`beside`,children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${L?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40 md:min-h-full md:pb-6`} text-center text-[var(--content-default)]`,children:[(0,k.jsx)(`h1`,{className:L?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:e(U===`ready`?`hatchingScreen.ready`:`hatchingScreen.waking`)}),U!==`ready`&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${L?`mt-3.5`:`mt-4`}`,children:e(`hatchingScreen.wakingBody`)}),(0,k.jsx)(`img`,{src:H,alt:``,width:160,height:160,className:`${L?`my-auto py-8`:`my-16`} ${U===`ready`?`onboarding-avatar-awake`:`onboarding-avatar-pulse`}`}),(0,k.jsx)(i,{value:Ue,height:6,className:`w-full ${L?`max-w-[200px]`:`max-w-sm`}`,"aria-label":e(`hatchingScreen.progressAriaLabel`)}),(0,k.jsx)(`p`,{className:`text-[var(--content-tertiary)] ${L?`mt-4 text-label-small-default`:`mt-3 text-body-small-default`}`,children:e(je[U])})]})})}export{I as HatchingScreen};