@vellumai/web 0.8.8 → 0.8.9-staging.1

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 (278) hide show
  1. package/dist/assets/BundleConfirmPage-p6PoFo-P.js +1 -0
  2. package/dist/assets/{QueryClientProvider-DBAeGN3q.js → QueryClientProvider-DNHWXaGq.js} +1 -1
  3. package/dist/assets/{about-page-C4tN0hSY.js → about-page-COonOOTU.js} +1 -1
  4. package/dist/assets/{account-page-e-4zB_8t.js → account-page-CXZMoObS.js} +1 -1
  5. package/dist/assets/{account-shell-BZu7oVl3.js → account-shell-mWbkdjh7.js} +1 -1
  6. package/dist/assets/add-credits-modal-COZFg6LO.js +1 -0
  7. package/dist/assets/{advanced-page-Du0vGXNL.js → advanced-page-BcEt2J3g.js} +1 -1
  8. package/dist/assets/ai-page-DYFuxo_7.js +1 -0
  9. package/dist/assets/api-D_w9HGm1.js +39 -0
  10. package/dist/assets/{api-key-screen-Bgk6XGC1.js → api-key-screen-DbyDsrCh.js} +1 -1
  11. package/dist/assets/{app-html-cache-BsFOfI0R.js → app-html-cache-DZyE8zzT.js} +1 -1
  12. package/dist/assets/{archive-yWA8_b2E.js → archive-CeE0yzQG.js} +1 -1
  13. package/dist/assets/archive-page-D2PmzZlQ.js +1 -0
  14. package/dist/assets/arrow-up-BfbWaCwD.js +1 -0
  15. package/dist/assets/{assistant-feature-flag-store-CNdFPRBD.js → assistant-feature-flag-store-BiEkLFvf.js} +1 -1
  16. package/dist/assets/{assistant-identity-store-Y4grVs1H.js → assistant-identity-store-CdxvXGiq.js} +1 -1
  17. package/dist/assets/assistant-status-panel-DpDMJx-N.js +1 -0
  18. package/dist/assets/auth-store-RIjuTM3X.js +1 -0
  19. package/dist/assets/{avatar-api-BfDoaCjw.js → avatar-api-CWZvvL87.js} +1 -1
  20. package/dist/assets/{bell-BFRXSoMR.js → bell-NxrwR0Jo.js} +1 -1
  21. package/dist/assets/billing-page-Boeh64OU.js +34 -0
  22. package/dist/assets/{bug-wSdnBKWO.js → bug-B4KAU7DN.js} +1 -1
  23. package/dist/assets/button-DdEh-9f_.js +1 -0
  24. package/dist/assets/{calendar-xwiYi6y2.js → calendar-B2_jTx01.js} +1 -1
  25. package/dist/assets/capture-error-Di3WCQrq.js +4 -0
  26. package/dist/assets/card-CL5iEMJO.js +1 -0
  27. package/dist/assets/check-CW0KmV0o.js +1 -0
  28. package/dist/assets/checkbox-qlcBvCFW.js +1 -0
  29. package/dist/assets/chevron-right-DF2EzMUB.js +1 -0
  30. package/dist/assets/{chevron-up-C-4xJEr7.js → chevron-up-cXyM5mu2.js} +1 -1
  31. package/dist/assets/{chunk-5KNZJZUH-BpLAEZ0-.js → chunk-5KNZJZUH-B4b1m-Ya.js} +1 -1
  32. package/dist/assets/cn-DFqQkJlk.js +1 -0
  33. package/dist/assets/command-palette-Ddl69DKF.js +1 -0
  34. package/dist/assets/{community-page-BWc9-V5m.js → community-page-COMe3TOq.js} +1 -1
  35. package/dist/assets/confirm-dialog-DsrjEJ8n.js +1 -0
  36. package/dist/assets/{connect-page-DLP-KRIF.js → connect-page-jZJ6gRVr.js} +1 -1
  37. package/dist/assets/{contacts-gateway-BF6L_WJp.js → contacts-gateway-Dzzr2RB0.js} +1 -1
  38. package/dist/assets/contacts-page-route-lxxkveBK.js +1 -0
  39. package/dist/assets/{conversation-store-D8-qWog8.js → conversation-store-BB-CCPz4.js} +1 -1
  40. package/dist/assets/createLucideIcon-Bjb-Kuq7.js +1 -0
  41. package/dist/assets/danger-zone-redirect-page-qLWyglUT.js +1 -0
  42. package/dist/assets/debug-page-wZauraKd.js +3 -0
  43. package/dist/assets/{deploy-dialogs-Ddx6WsXp.js → deploy-dialogs-DEaPwU4I.js} +1 -1
  44. package/dist/assets/{detail-card-Y8InXOgy.js → detail-card-B-us8iM5.js} +1 -1
  45. package/dist/assets/developer-page-YiIciPaV.js +1 -0
  46. package/dist/assets/{devices-page-4yNwXw0J.js → devices-page-C1EjgTdX.js} +1 -1
  47. package/dist/assets/dist-B1Fpj7hg.js +1 -0
  48. package/dist/assets/dist-BagEH8Xp.js +153 -0
  49. package/dist/assets/dist-D6LVk88Z.js +45 -0
  50. package/dist/assets/document-viewer-page-BbNZ_Hav.js +1 -0
  51. package/dist/assets/{dollar-sign-D_9hooHL.js → dollar-sign-DjJlJMJx.js} +1 -1
  52. package/dist/assets/{domain-field-CyNgwvDW.js → domain-field-DiimaXlx.js} +1 -1
  53. package/dist/assets/dropdown-CocFV5yi.js +1 -0
  54. package/dist/assets/{earn-credits-modal-BfVEDIqn.js → earn-credits-modal-CWJ3z13E.js} +1 -1
  55. package/dist/assets/{ellipsis-vertical-f27t2xXb.js → ellipsis-vertical-BYI2M0Y_.js} +1 -1
  56. package/dist/assets/{emails-page-VM8fJ5kb.js → emails-page-HAwU0PG9.js} +1 -1
  57. package/dist/assets/{esm-BesMJi2r.js → esm-BuFsuxJb.js} +1 -1
  58. package/dist/assets/{esm-B9MFZJ_e.js → esm-CqsAL_eV.js} +1 -1
  59. package/dist/assets/{esm-BAXpcEfg.js → esm-D_3mHrKn.js} +1 -1
  60. package/dist/assets/{esm-BBKnACgF.js → esm-g5en09UW.js} +1 -1
  61. package/dist/assets/{esm-Dlx5ghIf.js → esm-t46uzkal.js} +1 -1
  62. package/dist/assets/{external-link-CcV79Arv.js → external-link-CYugXYpk.js} +1 -1
  63. package/dist/assets/feature-flag-catalog-OHgjjRa5.js +1 -0
  64. package/dist/assets/file-markdown-CNb-AHAO.js +2 -0
  65. package/dist/assets/format-file-size-Cikb_8y_.js +1 -0
  66. package/dist/assets/general-page-C0EPZJvL.js +1 -0
  67. package/dist/assets/{globe-B6unPYdp.js → globe-DZ63eZbH.js} +1 -1
  68. package/dist/assets/{google-logo-NlVU0R23.js → google-logo-uJcTP3BJ.js} +1 -1
  69. package/dist/assets/{hard-drive-C5ssi802.js → hard-drive-wO6bPcoA.js} +1 -1
  70. package/dist/assets/hatching-screen-B2hk7GXP.js +1 -0
  71. package/dist/assets/home-page-route-Dr56dr0q.js +1 -0
  72. package/dist/assets/hosting-screen-DgRRwkuU.js +1 -0
  73. package/dist/assets/identity-page-route-OErxaFHE.js +1 -0
  74. package/dist/assets/index-BKvehXUt.css +2 -0
  75. package/dist/assets/index-DTWPgS5K.js +124 -0
  76. package/dist/assets/input-Cu3PPVCq.js +1 -0
  77. package/dist/assets/{inspect-page-CsvH5Rih.js → inspect-page-Y-3HQoro.js} +2 -2
  78. package/dist/assets/{install-OHIUtZSu.js → install-aIAefgSX.js} +1 -1
  79. package/dist/assets/integrations-page-B7Tul8x3.js +1 -0
  80. package/dist/assets/{intelligence-layout-Onjx6_Xb.js → intelligence-layout-DYIK-GwZ.js} +1 -1
  81. package/dist/assets/keyboard-shortcuts-page-nlhuxBKZ.js +1 -0
  82. package/dist/assets/lib-Bq3kPGq-.js +29 -0
  83. package/dist/assets/{lib-B020BIem.js → lib-CyTHAhFX.js} +1 -1
  84. package/dist/assets/{library-detail-page-PP_bf3mt.js → library-detail-page-DkG1qTGp.js} +1 -1
  85. package/dist/assets/library-page-Cb9eaPfO.js +1 -0
  86. package/dist/assets/{link-2-B0QONFsy.js → link-2-DFhelG7P.js} +1 -1
  87. package/dist/assets/loader-circle-B9sFQ7nF.js +1 -0
  88. package/dist/assets/local-mode-Cx_DqCMC.js +1 -0
  89. package/dist/assets/{login-flow-BbsypWKa.js → login-flow-E2FJkpFg.js} +1 -1
  90. package/dist/assets/login-page-DLNq7ol2.js +1 -0
  91. package/dist/assets/{logout-page-BkzePxva.js → logout-page-CcNgLKFy.js} +1 -1
  92. package/dist/assets/{logs-layout-Cs8hHTTu.js → logs-layout-Dd6YucHg.js} +1 -1
  93. package/dist/assets/{memory-router-playground-page-4uw1uIhg.js → memory-router-playground-page-C9Bunjup.js} +1 -1
  94. package/dist/assets/menu-B79-l6IU.js +1 -0
  95. package/dist/assets/{minimize-2-H-zinYcX.js → minimize-2-BEDsyPze.js} +1 -1
  96. package/dist/assets/{mobile-sidebar-drawer-CSQF2rSV.js → mobile-sidebar-drawer-BMjmzJIM.js} +1 -1
  97. package/dist/assets/modal-BhuCoLJX.js +1 -0
  98. package/dist/assets/native-biometric-CfMWTyzx.js +6 -0
  99. package/dist/assets/{native-file-C2WSS7-h.js → native-file-uqYhUlky.js} +2 -2
  100. package/dist/assets/notice-CF2pptne.js +1 -0
  101. package/dist/assets/{notifications-page-DRppz7Ms.js → notifications-page-BQVUPJrc.js} +1 -1
  102. package/dist/assets/{oauth-complete-page-aT6QAfCd.js → oauth-complete-page-GCeZ7H70.js} +1 -1
  103. package/dist/assets/{oauth-popup-complete-page-ClfKIV61.js → oauth-popup-complete-page-v7G3PUyR.js} +2 -2
  104. package/dist/assets/{octagon-x-Bze4QGjG.js → octagon-x-DV9qasaC.js} +1 -1
  105. package/dist/assets/{onboarding-layout-DMOume9Z.js → onboarding-layout-CAwJlju5.js} +1 -1
  106. package/dist/assets/{page-shell-C4yGVVNa.js → page-shell-DHcdwoAZ.js} +1 -1
  107. package/dist/assets/panel-item-FzMfzMJA.js +1 -0
  108. package/dist/assets/password-reset-page-qJLxcjME.js +1 -0
  109. package/dist/assets/{pdf-BbxrOchE.js → pdf-BrYaENqn.js} +1 -1
  110. package/dist/assets/{pencil-CESg1M7c.js → pencil-ulB7Z-e-.js} +1 -1
  111. package/dist/assets/platform-loopback-page-Dh4Fk6vZ.js +1 -0
  112. package/dist/assets/plugin-detail-page-T0e3dY-Z.js +1 -0
  113. package/dist/assets/plugins-page-ynhoZs-n.js +1 -0
  114. package/dist/assets/portal-container-DIXEBWUe.js +1 -0
  115. package/dist/assets/pre-chat-flow-CuvP36-0.js +1 -0
  116. package/dist/assets/privacy-page-e7nbmXwD.js +1 -0
  117. package/dist/assets/privacy-screen-JbcO_xgm.js +1 -0
  118. package/dist/assets/progress-bar-BxeXgLhp.js +1 -0
  119. package/dist/assets/provider-callback-page-Cdtz4Epz.js +1 -0
  120. package/dist/assets/{provider-key-DiyETKhK.js → provider-key-BittA9TY.js} +1 -1
  121. package/dist/assets/{provider-signup-page-BpqjcKpY.js → provider-signup-page-CATLdFQn.js} +1 -1
  122. package/dist/assets/{query-tags-yOSQTht4.js → query-tags-CXf0mBKU.js} +1 -1
  123. package/dist/assets/quick-input-page-5mI3RTsv.js +1 -0
  124. package/dist/assets/react-query.gen-Cj6WQdON.js +1 -0
  125. package/dist/assets/{resize-errors-C_vO4oid.js → resize-errors-qjdyi4GX.js} +1 -1
  126. package/dist/assets/resolved-assistants-store-em3zt7_3.js +1 -0
  127. package/dist/assets/routes-DminYfDX.js +1 -0
  128. package/dist/assets/{save-CBzZvuPl.js → save-Cg454LRm.js} +1 -1
  129. package/dist/assets/{schedules-mjx6ouZ2.js → schedules-BTZchh0D.js} +1 -1
  130. package/dist/assets/schedules-page-BdaO92vz.js +1 -0
  131. package/dist/assets/{sdk.gen-BO4vbMAj.js → sdk.gen-BnTFwWLf.js} +1 -1
  132. package/dist/assets/{sdk.gen-up8j0_uF.js → sdk.gen-govMfbgX.js} +1 -1
  133. package/dist/assets/select-assistant-screen-C0EP-6wf.js +1 -0
  134. package/dist/assets/settings-layout-D402PkLd.js +1 -0
  135. package/dist/assets/share-feedback-modal-Ct3bOmhU.js +1 -0
  136. package/dist/assets/shortcut-keys-FXO7qQjX.js +1 -0
  137. package/dist/assets/{sidebar-tree-D9JFk5pQ.js → sidebar-tree-Dduanhwq.js} +1 -1
  138. package/dist/assets/{signup-page-CI7xziFt.js → signup-page-1C3Lfl0s.js} +1 -1
  139. package/dist/assets/skills-page-BB1Ne-8V.js +1 -0
  140. package/dist/assets/sounds-page-BmRneQW4.js +1 -0
  141. package/dist/assets/{src-Bah0_lDG.js → src-BqiaDQPO.js} +3 -3
  142. package/dist/assets/stat-square-sRJmexc-.js +1 -0
  143. package/dist/assets/step-indicator-dots-DpYYCL7E.js +1 -0
  144. package/dist/assets/{subagent-detail-panel-BcUQAemM.js → subagent-detail-panel-DCmHp5r5.js} +2 -2
  145. package/dist/assets/{system-events-page-BC0hWcTo.js → system-events-page-BOZOscuS.js} +1 -1
  146. package/dist/assets/system-events-redirect-page-Dq1fO1WL.js +1 -0
  147. package/dist/assets/tag-Ccr7Quy6.js +1 -0
  148. package/dist/assets/{target-B8JHLfTN.js → target-3RiNSDOr.js} +1 -1
  149. package/dist/assets/{tiptap-document-editor-CIVPtfOQ.js → tiptap-document-editor-DSeOYXTN.js} +2 -2
  150. package/dist/assets/toast-3Fi9QU7z.js +1 -0
  151. package/dist/assets/toggle-CEm3M86o.js +1 -0
  152. package/dist/assets/{tool-detail-panel-y2CN1PtJ.js → tool-detail-panel-DvZGjmRf.js} +1 -1
  153. package/dist/assets/{trace-page-BX5w9eln.js → trace-page-OVXfT7ig.js} +1 -1
  154. package/dist/assets/typography-Czgs_2w_.js +1 -0
  155. package/dist/assets/{upgrade-cancel-page-KQ4EN_I1.js → upgrade-cancel-page-CbjsDz_I.js} +1 -1
  156. package/dist/assets/{upgrade-success-page-Bmv-ncJ6.js → upgrade-success-page-BT3slnw3.js} +1 -1
  157. package/dist/assets/usage-page-GlfQOrlv.js +1 -0
  158. package/dist/assets/use-active-assistant-id--1Ick1YC.js +1 -0
  159. package/dist/assets/use-current-platform-assistant-D-5r_x8u.js +1 -0
  160. package/dist/assets/use-is-org-ready-okrWrmTt.js +1 -0
  161. package/dist/assets/{use-oauth-complete-deep-link-listener-BkbO4kZ1.js → use-oauth-complete-deep-link-listener-DxjdcVr0.js} +1 -1
  162. package/dist/assets/{use-reduced-motion-GQ_HVFpK.js → use-reduced-motion-DVYTox9p.js} +1 -1
  163. package/dist/assets/{useMutation-DTb3lMvF.js → useMutation-BuofVRHk.js} +1 -1
  164. package/dist/assets/{useQuery-DAtrV0RI.js → useQuery-D2zf6Uhu.js} +1 -1
  165. package/dist/assets/{utils-DfoBtDfL.js → utils-BQby93tO.js} +1 -1
  166. package/dist/assets/viewer-store-DIa3mbc-.js +1 -0
  167. package/dist/assets/{voice-page-D3jl6Uq8.js → voice-page-DBuSoStd.js} +1 -1
  168. package/dist/assets/{wand-sparkles-CIV_5Oi6.js → wand-sparkles-CEPQLm45.js} +1 -1
  169. package/dist/assets/{weather-forecast-display-BA-3Q5jY.js → weather-forecast-display-FVtVZmTZ.js} +1 -1
  170. package/dist/assets/welcome-screen-bOpdZmIK.js +1 -0
  171. package/dist/assets/workspace-page-DoXLAgOy.js +1 -0
  172. package/dist/assets/x-CaVViVFn.js +1 -0
  173. package/dist/assets/x-D0wgTl3V.js +1 -0
  174. package/dist/assets/zwitch-qcFX26Jh.js +1 -0
  175. package/dist/index.html +78 -78
  176. package/package.json +1 -1
  177. package/dist/assets/add-credits-modal-p0gkX1yC.js +0 -1
  178. package/dist/assets/ai-page-BQOcmKeW.js +0 -1
  179. package/dist/assets/api-8hqpGaif.js +0 -39
  180. package/dist/assets/archive-page-DhDeJH4l.js +0 -1
  181. package/dist/assets/arrow-up-Cev-d0qQ.js +0 -1
  182. package/dist/assets/assistant-status-panel-C3CvCBVl.js +0 -1
  183. package/dist/assets/auth-store-CYbo7naZ.js +0 -1
  184. package/dist/assets/billing-page-CyTcQ9ki.js +0 -34
  185. package/dist/assets/button-Cs9tc8OR.js +0 -1
  186. package/dist/assets/capture-error-1Tr5aMfq.js +0 -1
  187. package/dist/assets/card-BcKGvsaa.js +0 -1
  188. package/dist/assets/check-DqeyrftF.js +0 -1
  189. package/dist/assets/checkbox-hJlRqWtn.js +0 -1
  190. package/dist/assets/chevron-right-CJ0Oykrn.js +0 -1
  191. package/dist/assets/cn-DIX4PZch.js +0 -1
  192. package/dist/assets/command-palette-CTF-tqv7.js +0 -1
  193. package/dist/assets/confirm-dialog-DavdF-L4.js +0 -1
  194. package/dist/assets/contacts-page-route-ziTjDj3t.js +0 -1
  195. package/dist/assets/createLucideIcon-CSvzx8tc.js +0 -1
  196. package/dist/assets/danger-zone-redirect-page-BlS6Bao4.js +0 -1
  197. package/dist/assets/debug-page-B38HF3wu.js +0 -3
  198. package/dist/assets/developer-page-CVcwOCG9.js +0 -1
  199. package/dist/assets/dist-3bWmqQYy.js +0 -45
  200. package/dist/assets/dist-Cb2Epurm.js +0 -1
  201. package/dist/assets/dist-Ck9KSeuV.js +0 -153
  202. package/dist/assets/document-viewer-page-BZqF90o0.js +0 -1
  203. package/dist/assets/dropdown-PPtOL9bp.js +0 -1
  204. package/dist/assets/exports-B_RC9sMS.js +0 -4
  205. package/dist/assets/feature-flag-catalog-CRgdQmMF.js +0 -1
  206. package/dist/assets/file-markdown-DjJ2NSmS.js +0 -1
  207. package/dist/assets/gateway-session-CaFk8wfN.js +0 -1
  208. package/dist/assets/general-page-m_m-DrX4.js +0 -1
  209. package/dist/assets/hatching-screen-CI8iOd8-.js +0 -1
  210. package/dist/assets/home-page-route-ePg1Cu2z.js +0 -1
  211. package/dist/assets/hosting-screen-CA6XnVWn.js +0 -1
  212. package/dist/assets/identity-page-route-BcE8OAJ6.js +0 -1
  213. package/dist/assets/index-Cb930VA2.css +0 -2
  214. package/dist/assets/index-DUwiZuxe.js +0 -124
  215. package/dist/assets/input-DwAJUlac.js +0 -1
  216. package/dist/assets/integrations-page-B54hIoCi.js +0 -1
  217. package/dist/assets/lib-h5KT63h9.js +0 -29
  218. package/dist/assets/library-page-Cg1IA3a6.js +0 -1
  219. package/dist/assets/loader-circle-FEkI0Am4.js +0 -1
  220. package/dist/assets/login-page-BVX4fr6R.js +0 -1
  221. package/dist/assets/loopback-auth-Dclf8zKT.js +0 -1
  222. package/dist/assets/menu-0h93UDZw.js +0 -1
  223. package/dist/assets/modal-C7CS3Y_X.js +0 -1
  224. package/dist/assets/native-biometric-B4t4zElu.js +0 -6
  225. package/dist/assets/notice-BWm2kHlI.js +0 -1
  226. package/dist/assets/panel-item-BPosLg5Y.js +0 -1
  227. package/dist/assets/password-reset-page-CugjFViT.js +0 -1
  228. package/dist/assets/platform-loopback-page-DSAaBS5p.js +0 -1
  229. package/dist/assets/plugins-page-CYcKA2Ai.js +0 -1
  230. package/dist/assets/portal-container-CKtYcZfP.js +0 -1
  231. package/dist/assets/pre-chat-flow-BLHHoHka.js +0 -1
  232. package/dist/assets/privacy-page-HiOgrDR9.js +0 -1
  233. package/dist/assets/privacy-screen-Ca0oGFo0.js +0 -1
  234. package/dist/assets/progress-bar-CgQMQ_UR.js +0 -1
  235. package/dist/assets/provider-callback-page-DpGReURP.js +0 -1
  236. package/dist/assets/react-query.gen-CfXF72qo.js +0 -1
  237. package/dist/assets/routes-C-DwSCj0.js +0 -1
  238. package/dist/assets/schedules-page-zyXnmD3U.js +0 -1
  239. package/dist/assets/selection-store-BCKoLRDh.js +0 -1
  240. package/dist/assets/settings-layout-Bsi8NeES.js +0 -1
  241. package/dist/assets/share-feedback-modal-BgfMO7ED.js +0 -1
  242. package/dist/assets/skills-page-DrpHzObX.js +0 -1
  243. package/dist/assets/sounds-page-Dw_ASs77.js +0 -1
  244. package/dist/assets/stat-square-CMFH3mHq.js +0 -1
  245. package/dist/assets/step-indicator-dots-ClKaa4nc.js +0 -1
  246. package/dist/assets/system-events-redirect-page-BrzAhJZT.js +0 -1
  247. package/dist/assets/tag-BkZB4euH.js +0 -1
  248. package/dist/assets/toast-Cii5pffK.js +0 -1
  249. package/dist/assets/toggle-DGzEs0L1.js +0 -1
  250. package/dist/assets/typography-PN7B1rrW.js +0 -1
  251. package/dist/assets/usage-page-CXNTUrjR.js +0 -1
  252. package/dist/assets/use-active-assistant-id-kjFL4dWB.js +0 -1
  253. package/dist/assets/use-current-platform-assistant-BXRU4B3R.js +0 -1
  254. package/dist/assets/use-debounced-value-DK0n_BKN.js +0 -1
  255. package/dist/assets/use-is-org-ready-Dtde_1TT.js +0 -1
  256. package/dist/assets/viewer-store-BIIKltsh.js +0 -1
  257. package/dist/assets/welcome-screen-B3oZjIVb.js +0 -1
  258. package/dist/assets/workspace-page-CUxLMyKc.js +0 -1
  259. package/dist/assets/x-2OoTSOWJ.js +0 -1
  260. package/dist/assets/x-CwP6G6OK.js +0 -1
  261. /package/dist/assets/{api-errors-DhNZwQy5.js → api-errors-DApr8J5Z.js} +0 -0
  262. /package/dist/assets/{avatar-bundled-components-BKb8hhzM.js → avatar-bundled-components-DC9a0Ily.js} +0 -0
  263. /package/dist/assets/{client.gen-BKAMS0D0.js → client.gen-CsQeNtuq.js} +0 -0
  264. /package/dist/assets/{create-selectors-LbkU9b0a.js → create-selectors-CDULelrw.js} +0 -0
  265. /package/dist/assets/{createLucideIcon-D8wUFCt3.js → createLucideIcon-BjZY5k1w.js} +0 -0
  266. /package/dist/assets/{emoji-catalog-data-B2dzgy2b.js → emoji-catalog-data-DvyOWL-F.js} +0 -0
  267. /package/dist/assets/{format-B2Cl9naL.js → format-Bbxbyy7J.js} +0 -0
  268. /package/dist/assets/{format-date-C_j5UjES.js → format-date-CdAgBadL.js} +0 -0
  269. /package/dist/assets/{is-electron-1CyUiqR4.js → is-electron-CavSPgmY.js} +0 -0
  270. /package/dist/assets/{jsx-runtime-XSukodg_.js → jsx-runtime-CVSDxk6A.js} +0 -0
  271. /package/dist/assets/{llm-dimension-DPVignMk.js → llm-dimension-CBhYSW7t.js} +0 -0
  272. /package/dist/assets/{preload-helper-CS_K7l1U.js → preload-helper-BewR0kVT.js} +0 -0
  273. /package/dist/assets/{queryOptions-C_ypb2wA.js → queryOptions-BtNi-_9H.js} +0 -0
  274. /package/dist/assets/{usage-window-CsjC43Gn.js → usage-window-COo_tIlP.js} +0 -0
  275. /package/dist/assets/{wasm-CGZ0ykRa.js → wasm-D-aQj7M_.js} +0 -0
  276. /package/dist/assets/{with-selector-CZyYmUFz.js → with-selector-NDiUwRRR.js} +0 -0
  277. /package/dist/assets/{xterm-AXHTOo82.js → xterm-EejPUdmw.js} +0 -0
  278. /package/dist/assets/{xterm-addon-fit-CfpfPbfB.js → xterm-addon-fit-BRL8IZ7N.js} +0 -0
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./misc-BllImtEn.js";import{t as i}from"./format-file-size-Cikb_8y_.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-XSukodg_.js";var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},a=new class{#e=i;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function o(e){setTimeout(e,0)}var s=typeof window>`u`||`Deno`in globalThis;function c(){}function l(e,t){return typeof e==`function`?e(t):e}function u(e){return typeof e==`number`&&e>=0&&e!==1/0}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function f(e,t){return typeof e==`function`?e(t):e}function p(e,t){return typeof e==`function`?e(t):e}function m(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==g(o,t.options))return!1}else if(!v(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function h(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_(t.options.mutationKey)!==_(a))return!1}else if(!v(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function g(e,t){return(t?.queryKeyHashFn||_)(e)}function _(e){return JSON.stringify(e,(e,t)=>C(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function v(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>v(e[n],t[n])):!1}var y=Object.prototype.hasOwnProperty;function b(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=S(e)&&S(t);if(!r&&!(C(e)&&C(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:y.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=b(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function x(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function S(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C(e){if(!w(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!w(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function w(e){return Object.prototype.toString.call(e)===`[object Object]`}function T(e){return new Promise(t=>{a.setTimeout(t,e)})}function E(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:b(e,t)}function D(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function O(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function M(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var N=new class extends r{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!s&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function P(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var F=o;function I(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=F,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=I(),R=new class extends r{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!s&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function z(e){return Math.min(1e3*2**e,3e4)}function B(e){return(e??`online`)===`online`?R.isOnline():!0}var V=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function H(e){let t=!1,n=0,r,i=P(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new V(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>N.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),d=()=>B(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(s?0:3),o=e.retryDelay??z,c=typeof o==`function`?o(n,r):o,l=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!l){p(r);return}n++,e.onFail?.(n,r),T(c).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var U=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u(this.gcTime)&&(this.#e=a.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(s?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(a.clearTimeout(this.#e),void 0)}},W=e(t(),1),G=n(),K=W.createContext(void 0),q=e=>{let t=W.useContext(K);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},J=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(K.Provider,{value:e,children:t}));export{d as A,v as C,x as D,f as E,r as M,j as O,c as S,p as T,g as _,B as a,h as b,L as c,M as d,D as f,_ as g,l as h,V as i,a as j,k,P as l,A as m,q as n,H as o,O as p,U as r,R as s,J as t,N as u,s as v,E as w,m as x,u as y};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},a=new class{#e=i;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function o(e){setTimeout(e,0)}var s=typeof window>`u`||`Deno`in globalThis;function c(){}function l(e,t){return typeof e==`function`?e(t):e}function u(e){return typeof e==`number`&&e>=0&&e!==1/0}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function f(e,t){return typeof e==`function`?e(t):e}function p(e,t){return typeof e==`function`?e(t):e}function m(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==g(o,t.options))return!1}else if(!v(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function h(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_(t.options.mutationKey)!==_(a))return!1}else if(!v(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function g(e,t){return(t?.queryKeyHashFn||_)(e)}function _(e){return JSON.stringify(e,(e,t)=>C(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function v(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>v(e[n],t[n])):!1}var y=Object.prototype.hasOwnProperty;function b(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=S(e)&&S(t);if(!r&&!(C(e)&&C(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:y.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=b(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function x(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function S(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C(e){if(!w(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!w(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function w(e){return Object.prototype.toString.call(e)===`[object Object]`}function T(e){return new Promise(t=>{a.setTimeout(t,e)})}function E(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:b(e,t)}function D(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function O(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function M(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var N=new class extends r{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!s&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function P(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var F=o;function I(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=F,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=I(),R=new class extends r{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!s&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function z(e){return Math.min(1e3*2**e,3e4)}function B(e){return(e??`online`)===`online`?R.isOnline():!0}var V=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function H(e){let t=!1,n=0,r,i=P(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new V(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>N.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),d=()=>B(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(s?0:3),o=e.retryDelay??z,c=typeof o==`function`?o(n,r):o,l=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!l){p(r);return}n++,e.onFail?.(n,r),T(c).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var U=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u(this.gcTime)&&(this.#e=a.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(s?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(a.clearTimeout(this.#e),void 0)}},W=e(t(),1),G=n(),K=W.createContext(void 0),q=e=>{let t=W.useContext(K);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},J=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(K.Provider,{value:e,children:t}));export{d as A,v as C,x as D,f as E,r as M,j as O,c as S,p as T,g as _,B as a,h as b,L as c,M as d,D as f,_ as g,l as h,V as i,a as j,k,P as l,A as m,q as n,H as o,O as p,U as r,R as s,J as t,N as u,s as v,E as w,m as x,u as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-XSukodg_.js";import{t as r}from"./is-electron-1CyUiqR4.js";var i=e(t(),1);async function a(){return r()?await window.vellum?.app.versionInfo()??null:null}async function o(){r()&&await window.vellum?.app.openWebsite()}var s=n();function c(){let[e,t]=(0,i.useState)(null);(0,i.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),o())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-CavSPgmY.js";var i=e(t(),1);async function a(){return r()?await window.vellum?.app.versionInfo()??null:null}async function o(){r()&&await window.vellum?.app.openWebsite()}var s=n();function c(){let[e,t]=(0,i.useState)(null);(0,i.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),o())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-BpLAEZ0-.js";import{t as r}from"./jsx-runtime-XSukodg_.js";import{a as i,i as a,n as o}from"./auth-store-CYbo7naZ.js";import{d as s}from"./native-biometric-B4t4zElu.js";import{i as c}from"./routes-C-DwSCj0.js";import{ut as l}from"./index-DUwiZuxe.js";import{r as u,t as d}from"./account-shell-BZu7oVl3.js";import{n as f,t as p}from"./login-flow-BbsypWKa.js";var m=e(t(),1),h=r();function g(){let e=a(),t=i(),r=o.use.user(),g=o.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(f,p)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(d,{children:(0,h.jsx)(u,{title:`Loading...`})}):e?(0,h.jsxs)(d,{children:[(0,h.jsx)(u,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),l(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-stone-400 transition-colors hover:text-stone-300`,children:`Sign out`})]})]}):(0,h.jsxs)(d,{children:[(0,h.jsx)(u,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{a as i,i as a,n as o}from"./auth-store-RIjuTM3X.js";import{d as s}from"./native-biometric-CfMWTyzx.js";import{i as c}from"./routes-DminYfDX.js";import{nr as l}from"./index-DTWPgS5K.js";import{r as u,t as d}from"./account-shell-mWbkdjh7.js";import{n as f,t as p}from"./login-flow-E2FJkpFg.js";var m=e(t(),1),h=r();function g(){let e=a(),t=i(),r=o.use.user(),g=o.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(f,p)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(d,{children:(0,h.jsx)(u,{title:`Loading...`})}):e?(0,h.jsxs)(d,{children:[(0,h.jsx)(u,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),l(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-stone-400 transition-colors hover:text-stone-300`,children:`Sign out`})]})]}):(0,h.jsxs)(d,{children:[(0,h.jsx)(u,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-XSukodg_.js";import"./src-Bah0_lDG.js";import{t}from"./notice-BWm2kHlI.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-sm text-white outline-none placeholder:text-stone-500 focus:border-forest-600/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-white`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-stone-400`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[#0d0d0d]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
1
+ import{t as e}from"./jsx-runtime-CVSDxk6A.js";import"./src-BqiaDQPO.js";import{t}from"./notice-CF2pptne.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-white/10 bg-white/5 px-4 py-3 text-sm text-white outline-none placeholder:text-stone-500 focus:border-forest-600/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-white`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-stone-400`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[#0d0d0d]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
@@ -0,0 +1 @@
1
+ import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{m as r,t as i,u as a}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{n as o}from"./QueryClientProvider-DNHWXaGq.js";import{t as s}from"./useQuery-D2zf6Uhu.js";import{t as c}from"./useMutation-BuofVRHk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./button-DdEh-9f_.js";import{t as d}from"./dropdown-CocFV5yi.js";import{t as f}from"./modal-BhuCoLJX.js";import{t as p}from"./loader-circle-B9sFQ7nF.js";import{Ha as m,Q as h,Z as g,hn as _,pn as v,so as y}from"./index-DTWPgS5K.js";var b=t({AddCreditsModal:()=>E}),x=e(n(),1),S=l(),C=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function w(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function T(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function E({open:e,onOpenChange:t}){let n=o(),{pathname:l}=a(),[b]=r(),E=b.toString()?`${l}?${b.toString()}`:l,{data:D,isLoading:O}=s(v()),k=D?.allowed_top_up_amounts?.length?D.allowed_top_up_amounts:C,[A,j]=(0,x.useState)(null),M=A&&k.includes(A)?A:k[0]??C[0],N=c(_());return(0,x.useEffect)(()=>h(()=>{t(!1),n.invalidateQueries(v())}),[t,n]),(0,S.jsx)(f.Root,{open:e,onOpenChange:t,children:(0,S.jsxs)(f.Content,{size:`sm`,children:[(0,S.jsxs)(f.Header,{children:[(0,S.jsx)(f.Title,{icon:m,children:`Add Credits`}),(0,S.jsx)(f.Description,{children:`Purchase credits to continue using the assistant. You'll be redirected to Stripe to complete the payment.`})]}),(0,S.jsx)(f.Body,{children:(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,S.jsx)(d,{id:`add-credits-amount`,value:M,onChange:e=>{j(e),N.isError&&N.reset()},disabled:O||!D,options:k.map(e=>({value:e,label:w(e)}))})]}),N.isError&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,S.jsx)(y,{className:`h-3.5 w-3.5 shrink-0`}),T(N.error)]}),(0,S.jsx)(i,{to:`/assistant/settings/billing`,className:`text-body-small-default text-[var(--content-tertiary)] underline hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:`Configure Automatic Top-Ups →`})]})}),(0,S.jsxs)(f.Footer,{children:[(0,S.jsx)(f.Close,{asChild:!0,children:(0,S.jsx)(u,{variant:`outlined`,children:`Cancel`})}),(0,S.jsx)(u,{variant:`primary`,leftIcon:N.isPending?(0,S.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{N.isPending||N.mutate({body:{amount:M,return_path:E}},{onSuccess:e=>{g(e.checkout_url)}})},disabled:N.isPending||O||!D,children:`Add credits`})]})]})})}export{b as n,E as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DBAeGN3q.js";import{t as r}from"./useQuery-DAtrV0RI.js";import{t as i}from"./useMutation-DTb3lMvF.js";import{t as a}from"./jsx-runtime-XSukodg_.js";import{t as o}from"./button-Cs9tc8OR.js";import{t as s}from"./notice-BWm2kHlI.js";import{t as c}from"./input-DwAJUlac.js";import{t as l}from"./toggle-DGzEs0L1.js";import{n as u}from"./stat-square-CMFH3mHq.js";import{t as d}from"./toast-Cii5pffK.js";import{t as f}from"./loader-circle-FEkI0Am4.js";import{W as p}from"./sdk.gen-BO4vbMAj.js";import{Jt as m,Yt as h,pt as g}from"./index-DUwiZuxe.js";import{t as _}from"./detail-card-Y8InXOgy.js";import{r as v}from"./assistant-status-panel-C3CvCBVl.js";var y=e(t(),1),b=a(),x=[[`Mon`,0],[`Tue`,1],[`Wed`,2],[`Thu`,3],[`Fri`,4],[`Sat`,5],[`Sun`,6]];function S(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 C(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 w(){return Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}function T(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:S(t),windowEnd:S(n)}}function E({assistantId:e}){let t=n(),{data:a,isLoading:s,isError:g}=r(m({path:{id:e}})),_=(0,y.useMemo)(()=>T(a),[a]),[v,S]=(0,y.useState)(null),E=v??_,D=v!==null,O=(0,y.useMemo)(()=>w(),[]),[k,A]=(0,y.useState)(null),j=k??E.daysOfMonth.join(`, `),M=i({mutationFn:async t=>{let{data:n}=await p({path:{id:e},body:t,throwOnError:!0});return n}}),N=e=>{S(t=>({...t??_,...e}))},P=e=>{N({daysOfWeek:E.daysOfWeek.includes(e)?E.daysOfWeek.filter(t=>t!==e):[...E.daysOfWeek,e].sort((e,t)=>e-t)})},F=e=>e.split(`,`).map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)&&e>=1&&e<=31);return s?(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,b.jsx)(f,{className:`h-4 w-4 animate-spin`}),`Loading update window settings...`]}):g?(0,b.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load update window policy. Refresh the page to try again.`}):(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(l,{checked:E.enabled,onChange:e=>N({enabled:e}),label:`Automatic updates`,helperText:`Update automatically during a configured time window`}),E.enabled&&(0,b.jsxs)(`div`,{className:`space-y-5`,children:[(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Frequency`}),(0,b.jsx)(`div`,{className:`max-w-[400px]`,children:(0,b.jsx)(u,{ariaLabel:`Frequency`,value:E.frequency,onChange:e=>{e!==`monthly`&&A(null),N({frequency:e})},items:[{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}]})})]}),E.frequency===`weekly`&&(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Day(s) of week`}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:x.map(([e,t])=>(0,b.jsx)(o,{variant:`outlined`,size:`compact`,active:E.daysOfWeek.includes(t),onClick:()=>P(t),children:e},t))})]}),E.frequency===`monthly`&&(0,b.jsx)(c,{label:`Day(s) of month`,type:`text`,value:j,onChange:e=>A(e.target.value),onBlur:e=>{let t=F(e.target.value);N({daysOfMonth:t}),A(t.join(`, `))},placeholder:`e.g. 1, 15`,helperText:`Comma-separated day numbers (1–31)`,className:`w-48`}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:[`Update window`,O?` (${O})`:``]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsx)(c,{type:`time`,value:E.windowStart,onChange:e=>N({windowStart:e.target.value})}),(0,b.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`to`}),(0,b.jsx)(c,{type:`time`,value:E.windowEnd,onChange:e=>N({windowEnd:e.target.value})})]})]})]}),(0,b.jsx)(o,{variant:`primary`,leftIcon:M.isPending?(0,b.jsx)(f,{className:`animate-spin`}):void 0,onClick:async()=>{let n=E.frequency===`monthly`&&k!==null?F(k):E.daysOfMonth;try{await M.mutateAsync({enabled:E.enabled,timezone:`UTC`,schedule:{frequency:E.frequency,days_of_week:E.frequency===`weekly`?E.daysOfWeek:[],days_of_month:E.frequency===`monthly`?n:[],window:{start:C(E.windowStart),end:C(E.windowEnd)}}}),d.success(`Auto-update policy saved.`),S(null),A(null),t.invalidateQueries({queryKey:h({path:{id:e}})})}catch{d.error(`Failed to save policy. Please try again.`)}},disabled:M.isPending||!D,children:`Save policy`})]})}function D(){let{assistant:e}=v(),t=g({platformHostedOnly:!0}),n=e?.is_local?null:e;return(0,b.jsxs)(`div`,{className:`space-y-4`,children:[t===`full`&&n&&(0,b.jsx)(_,{title:`Update Window`,subtitle:`Configure when automatic updates are applied.`,children:(0,b.jsx)(E,{assistantId:n.id})}),t===`disabled`&&(0,b.jsx)(_,{title:`Update Window`,subtitle:`Configure when automatic updates are applied.`,children:(0,b.jsx)(s,{tone:`info`,children:`Log in to the Vellum platform to manage update window policy.`})})]})}export{D as AdvancedPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DNHWXaGq.js";import{t as r}from"./useQuery-D2zf6Uhu.js";import{t as i}from"./useMutation-BuofVRHk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./button-DdEh-9f_.js";import{t as s}from"./notice-CF2pptne.js";import{t as c}from"./input-Cu3PPVCq.js";import{t as l}from"./toggle-CEm3M86o.js";import{n as u}from"./stat-square-sRJmexc-.js";import{t as d}from"./toast-3Fi9QU7z.js";import{t as f}from"./loader-circle-B9sFQ7nF.js";import{W as p}from"./sdk.gen-BnTFwWLf.js";import{Gt as m,Wt as h,lt as g}from"./index-DTWPgS5K.js";import{t as _}from"./detail-card-B-us8iM5.js";import{r as v}from"./assistant-status-panel-DpDMJx-N.js";var y=e(t(),1),b=a(),x=[[`Mon`,0],[`Tue`,1],[`Wed`,2],[`Thu`,3],[`Fri`,4],[`Sat`,5],[`Sun`,6]];function S(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 C(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 w(){return Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}function T(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:S(t),windowEnd:S(n)}}function E({assistantId:e}){let t=n(),{data:a,isLoading:s,isError:g}=r(h({path:{id:e}})),_=(0,y.useMemo)(()=>T(a),[a]),[v,S]=(0,y.useState)(null),E=v??_,D=v!==null,O=(0,y.useMemo)(()=>w(),[]),[k,A]=(0,y.useState)(null),j=k??E.daysOfMonth.join(`, `),M=i({mutationFn:async t=>{let{data:n}=await p({path:{id:e},body:t,throwOnError:!0});return n}}),N=e=>{S(t=>({...t??_,...e}))},P=e=>{N({daysOfWeek:E.daysOfWeek.includes(e)?E.daysOfWeek.filter(t=>t!==e):[...E.daysOfWeek,e].sort((e,t)=>e-t)})},F=e=>e.split(`,`).map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)&&e>=1&&e<=31);return s?(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,b.jsx)(f,{className:`h-4 w-4 animate-spin`}),`Loading update window settings...`]}):g?(0,b.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load update window policy. Refresh the page to try again.`}):(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(l,{checked:E.enabled,onChange:e=>N({enabled:e}),label:`Automatic updates`,helperText:`Update automatically during a configured time window`}),E.enabled&&(0,b.jsxs)(`div`,{className:`space-y-5`,children:[(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Frequency`}),(0,b.jsx)(`div`,{className:`max-w-[400px]`,children:(0,b.jsx)(u,{ariaLabel:`Frequency`,value:E.frequency,onChange:e=>{e!==`monthly`&&A(null),N({frequency:e})},items:[{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}]})})]}),E.frequency===`weekly`&&(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Day(s) of week`}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:x.map(([e,t])=>(0,b.jsx)(o,{variant:`outlined`,size:`compact`,active:E.daysOfWeek.includes(t),onClick:()=>P(t),children:e},t))})]}),E.frequency===`monthly`&&(0,b.jsx)(c,{label:`Day(s) of month`,type:`text`,value:j,onChange:e=>A(e.target.value),onBlur:e=>{let t=F(e.target.value);N({daysOfMonth:t}),A(t.join(`, `))},placeholder:`e.g. 1, 15`,helperText:`Comma-separated day numbers (1–31)`,className:`w-48`}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:[`Update window`,O?` (${O})`:``]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsx)(c,{type:`time`,value:E.windowStart,onChange:e=>N({windowStart:e.target.value})}),(0,b.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`to`}),(0,b.jsx)(c,{type:`time`,value:E.windowEnd,onChange:e=>N({windowEnd:e.target.value})})]})]})]}),(0,b.jsx)(o,{variant:`primary`,leftIcon:M.isPending?(0,b.jsx)(f,{className:`animate-spin`}):void 0,onClick:async()=>{let n=E.frequency===`monthly`&&k!==null?F(k):E.daysOfMonth;try{await M.mutateAsync({enabled:E.enabled,timezone:`UTC`,schedule:{frequency:E.frequency,days_of_week:E.frequency===`weekly`?E.daysOfWeek:[],days_of_month:E.frequency===`monthly`?n:[],window:{start:C(E.windowStart),end:C(E.windowEnd)}}}),d.success(`Auto-update policy saved.`),S(null),A(null),t.invalidateQueries({queryKey:m({path:{id:e}})})}catch{d.error(`Failed to save policy. Please try again.`)}},disabled:M.isPending||!D,children:`Save policy`})]})}function D(){let{assistant:e}=v(),t=g({platformHostedOnly:!0}),n=e?.is_local?null:e;return(0,b.jsxs)(`div`,{className:`space-y-4`,children:[t===`full`&&n&&(0,b.jsx)(_,{title:`Update Window`,subtitle:`Configure when automatic updates are applied.`,children:(0,b.jsx)(E,{assistantId:n.id})}),t===`disabled`&&(0,b.jsx)(_,{title:`Update Window`,subtitle:`Configure when automatic updates are applied.`,children:(0,b.jsx)(s,{tone:`info`,children:`Log in to the Vellum platform to manage update window policy.`})})]})}export{D as AdvancedPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{r as i,t as a}from"./capture-error-Di3WCQrq.js";import{t as o}from"./react-DJZBPgpf.js";import{d as s,m as c}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{n as l}from"./QueryClientProvider-DNHWXaGq.js";import{t as u}from"./useQuery-D2zf6Uhu.js";import{t as d}from"./useMutation-BuofVRHk.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./button-DdEh-9f_.js";import{t as m}from"./typography-Czgs_2w_.js";import{t as h}from"./dropdown-CocFV5yi.js";import{t as g}from"./confirm-dialog-DsrjEJ8n.js";import{t as _}from"./notice-CF2pptne.js";import{t as v}from"./tag-Ccr7Quy6.js";import{t as y}from"./input-Cu3PPVCq.js";import{t as b}from"./toggle-CEm3M86o.js";import{n as x}from"./stat-square-sRJmexc-.js";import{t as S}from"./modal-BhuCoLJX.js";import{t as C}from"./toast-3Fi9QU7z.js";import{t as w}from"./createLucideIcon-BjZY5k1w.js";import{n as T,t as E}from"./domain-field-DiimaXlx.js";import{t as D}from"./external-link-CYugXYpk.js";import{t as O}from"./loader-circle-B9sFQ7nF.js";import{C as k,Et as A,Jt as j,Sn as M,Tt as N,Y as P,b as F}from"./sdk.gen-govMfbgX.js";import{C as I,R as L,S as R,s as ee}from"./react-query.gen-Cj6WQdON.js";import{r as z}from"./api-errors-DApr8J5Z.js";import{i as te}from"./routes-DminYfDX.js";import{t as B}from"./use-is-org-ready-okrWrmTt.js";import{r as V}from"./query-tags-CXf0mBKU.js";import{t as H}from"./assistant-feature-flag-store-BiEkLFvf.js";import{t as U}from"./assistant-identity-store-CdxvXGiq.js";import{$r as W,Ar as G,Br as ne,Ca as K,Cr as q,Ct as re,Dr as J,Dt as ie,Er as ae,Fr as oe,Gi as Y,Gr as se,Hr as ce,Ir as le,Jr as ue,Kr as de,Lr as fe,Mr as pe,Nr as me,Or as he,Ot as ge,Pr as _e,Qr as ve,Rr as ye,Sr as be,St as xe,Tr as Se,Tt as Ce,Ur as we,Vr as Te,Wr as Ee,Xr as De,Yr as Oe,Zr as ke,_t as Ae,ai as je,ao as Me,bt as Ne,ci as Pe,di as Fe,ei as Ie,fi as Le,gi as Re,gt as ze,hi as Be,ht as Ve,ii as He,jr as Ue,ki as We,kr as Ge,li as Ke,ln as qe,lt as Je,mi as Ye,ni as Xe,oi as Ze,qr as Qe,ri as $e,si as et,so as tt,ti as nt,to as rt,tr as it,ui as at,uo as ot,vt as st,wr as ct,wt as lt,xr as ut,xt as dt,yt as ft,zr as pt}from"./index-DTWPgS5K.js";import{t as mt}from"./use-active-assistant-id--1Ick1YC.js";import{t as ht}from"./detail-card-B-us8iM5.js";var gt=w(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),X=e(o(),1),Z=f();function _t({mode:e,onChange:t}){return(0,Z.jsx)(`div`,{className:`max-w-[280px]`,children:(0,Z.jsx)(x,{ariaLabel:`Service mode`,value:e,onChange:t,items:[{value:`managed`,label:`Managed`},{value:`your-own`,label:`Your Own`}]})})}function vt({id:e,title:t,subtitle:n,mode:r,onModeChange:i,children:a}){return(0,Z.jsxs)(ht,{id:e,title:t,subtitle:n,accessory:(0,Z.jsx)(_t,{mode:r,onChange:i}),children:[(0,Z.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Z.jsx)(`div`,{className:`mt-4`,children:a})]})}function Q({onClick:e,disabled:t}){return(0,Z.jsx)(p,{onClick:e,disabled:t,children:`Save`})}function yt({onClick:e,filled:t=!1}){return(0,Z.jsx)(p,{variant:t?`danger`:`dangerGhost`,onClick:e,children:`Reset`})}function bt({id:e,title:t,subtitle:n,children:r}){return(0,Z.jsxs)(ht,{id:e,title:t,subtitle:n,children:[(0,Z.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Z.jsx)(`div`,{className:`mt-4`,children:r})]})}function xt({guide:e}){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(K,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:e.description}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,Z.jsx)(D,{className:`h-3 w-3`})]})]})]})}function St({status:e,message:t,isLoading:n}){return n?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,children:[(0,Z.jsx)(O,{className:`h-3 w-3 animate-spin`}),`Checking domain…`]}):e?e===`verified`?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-positive-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,title:`DNS records have been verified. Your domain is ready to send and receive email.`,children:[(0,Z.jsx)(ot,{className:`h-3 w-3`}),`Domain verified`]}):e===`pending`||e===`not_started`?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-mid-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-mid-strong)]`,title:`DNS records have been provisioned. Waiting for the email provider to verify them — this usually takes a few minutes.`,children:[(0,Z.jsx)(rt,{className:`h-3 w-3`}),`Verifying domain…`]}):(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-negative-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,title:`Domain verification failed. DNS records may not have propagated correctly. You could try releasing and re-registering the domain.`,children:[(0,Z.jsx)(tt,{className:`h-3 w-3`}),`Verification failed`]}):(0,Z.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,title:`Unable to retrieve domain verification status.`,children:`Unknown status`})}var Ct=`__custom__`;function $(e){return e?!!(e.profile||e.provider||e.model):!1}function wt(e,t){let n=$(e);return n===$(t)?n?(e?.profile??null)===(t?.profile??null)&&(e?.provider??null)===(t?.provider??null)&&(e?.model??null)===(t?.model??null):!0:!1}function Tt({id:e,displayName:t,description:n,defaultProfileLabel:r,draft:i,profileOptions:a,onDraftChange:o,onToggle:s}){let c=$(i),l=!i||!c?``:i.provider||i.model?Ct:i.profile??``,u=l===Ct,d=i?.provider??ve[0],f=Be(d??`anthropic`).map(e=>({value:e.id,label:e.displayName})),p=!!i?.provider&&!i?.model;function m(t){if(t===`__custom__`){let t=ve[0];o(e,{profile:null,provider:t,model:Ye(t)??``})}else t===``?o(e,null):o(e,{profile:t,provider:null,model:null})}function g(t){let n=Ye(t)??``;o(e,{...i??{},profile:null,provider:t,model:n})}function _(t){o(e,{...i??{},model:t})}return(0,Z.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:t}),n&&(0,Z.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[n,r&&(0,Z.jsxs)(`span`,{className:`ml-1.5 text-body-small-default text-[var(--content-tertiary)] opacity-60`,children:[`· Default: `,r]})]})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c&&(0,Z.jsx)(h,{value:l,onChange:m,options:a,className:`w-36`}),(0,Z.jsx)(b,{checked:c,onChange:t=>s(e,t),"aria-label":`Override ${t}`})]})]}),c&&u&&(0,Z.jsxs)(`div`,{className:`mt-3 space-y-2 border-t border-[var(--border-base)] pt-3`,children:[(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex-1`,children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(h,{value:d??``,onChange:g,options:ve.map(e=>({value:e,label:W[e]??e}))})]}),(0,Z.jsxs)(`div`,{className:`flex-1`,children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,Z.jsx)(h,{value:i?.model??``,onChange:_,options:f})]})]}),p&&(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:`Pick a model`})]})]})}function Et(){let e=mt();return{assistantId:e,resolveAssistantId:(0,X.useCallback)(async()=>e,[e])}}function Dt(){let{assistantId:e}=Et(),{data:t}=u({queryKey:V(e),queryFn:async()=>{let{data:t}=await F({path:{assistant_id:e},throwOnError:!0});return t},enabled:!!e,staleTime:3e4,refetchOnWindowFocus:!1}),n=(0,X.useMemo)(()=>t?.llm?.profiles??{},[t?.llm?.profiles]),r=(0,X.useMemo)(()=>t?.llm?.profileOrder??[],[t?.llm?.profileOrder]),i=(0,X.useMemo)(()=>t?.llm?.activeProfile??null,[t?.llm?.activeProfile]),a=(0,X.useMemo)(()=>t?.llm?.callSites??{},[t?.llm?.callSites]);return{assistantId:e,config:t,profiles:n,profileOrder:r,orderedProfiles:(0,X.useMemo)(()=>ce(n,r),[n,r]),activeProfile:i,callSites:a}}function Ot(){let e=l(),{assistantId:t,resolveAssistantId:n}=Et();return d({mutationFn:async e=>{let t=await n(),{data:r}=await k({path:{assistant_id:t},body:e,throwOnError:!0});return{data:r,resolvedId:t}},onMutate:async n=>{if(!t)return;let r=V(t);await e.cancelQueries({queryKey:r});let i=e.getQueryData(r),a=i?Ee(i,n):void 0;return e.setQueryData(r,e=>e&&ne(e,n)),{rollback:a,queryKey:r}},onError:(t,n,r)=>{let{queryKey:i,rollback:a}=r??{};i&&a&&e.setQueryData(i,e=>e&&ne(e,a))},onSettled:n=>{let r=n?.resolvedId??t;e.invalidateQueries({queryKey:V(r)})}})}function kt(){let{resolveAssistantId:e}=Et();return(0,X.useCallback)(async(t,n)=>{try{let{data:r}=await M({path:{assistant_id:await e()},body:{value:n,type:`api_key`,name:t},throwOnError:!0});Te(r)}catch(e){throw e instanceof Error&&e.message===`No assistant found`?C.error(`Assistant not ready. Please try again.`):C.error(`Failed to save ${t} API key. Please try again.`),a(e,{context:`provision_provider_key`}),e}},[e])}function At({isOpen:e,onClose:t,assistantId:n}){let r=(0,X.useRef)(!1);return(0,Z.jsx)(S.Root,{open:e,onOpenChange:e=>{!e&&!r.current&&t()},children:e?(0,Z.jsx)(jt,{assistantId:n,onClose:t,onSavingChange:e=>{r.current=e}}):null})}function jt({assistantId:e,onClose:t,onSavingChange:n}){let{orderedProfiles:r,callSites:i,config:o}=Dt(),s=Ot(),[c,l]=(0,X.useState)(``),[d,f]=(0,X.useState)({}),[m,h]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),b=H.use.analyzeConversation(),{data:x,isLoading:w,isError:T,refetch:E}=u({...ee({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1}),D=(0,X.useMemo)(()=>{let e=(x?.callSites??[]).filter(e=>e.id!==`mainAgent`);return b?e:e.filter(e=>e.id!==`analyzeConversation`)},[x,b]),k=!w&&!T&&!!x&&!!o,A=(0,X.useMemo)(()=>D.map(e=>e.id),[D]),j=(0,X.useMemo)(()=>{if(!k)return{};let e={};for(let t of A)if(t in d)e[t]=d[t];else{let n=i[t];e[t]=n?{...n}:{}}return e},[k,A,i,d]),M=(0,X.useMemo)(()=>new Set(A),[A]),N=(0,X.useMemo)(()=>Object.entries(i).some(([e,t])=>M.has(e)&&(t?.profile!=null||t?.provider!=null||t?.model!=null)),[i,M]),P=(0,X.useMemo)(()=>{if(!k)return!1;for(let e of Object.keys(j))if(!wt(j[e],i[e]))return!0;return!1},[k,j,i]),F=(0,X.useMemo)(()=>Object.values(j).some(e=>$(e)&&!!e?.provider&&!e?.model),[j]),I=H.use.queryComplexityRouting(),L=(0,X.useCallback)(e=>[...le(pt(r,[e]),I).map(e=>({value:e.name,label:fe(e)})),{value:Ct,label:`Custom`}],[r,I]),R=(0,X.useMemo)(()=>{if(!c.trim())return D;let e=c.toLowerCase();return D.filter(t=>(t.displayName??``).toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e)||(t.domain??``).toLowerCase().includes(e))},[D,c]),z=(0,X.useMemo)(()=>{if(!x)return[];let e=x.domains.map(e=>e.id),t=new Map(x.domains.map(e=>[e.id,e])),n=[];for(let r of e){let e=R.filter(e=>e.domain===r);e.length>0&&n.push({domain:t.get(r),sites:e})}let r=new Set(e),i=R.filter(e=>!r.has(e.domain));return i.length>0&&n.push({domain:{id:`other`,displayName:`Other`},sites:i}),n},[x,R]),te=(0,X.useCallback)((e,t)=>{f(n=>({...n,[e]:t}))},[]),B=(0,X.useCallback)((e,t)=>{if(!t){f(t=>({...t,[e]:null}));return}let n=ye(r,D.find(t=>t.id===e)?.defaultProfile,I);if(n)f(t=>({...t,[e]:{profile:n}}));else{let t=ve[0],n=Ye(t)??``;f(r=>({...r,[e]:{provider:t,model:n}}))}},[D,r,I]),V=(0,X.useCallback)(async()=>{h(!0),n?.(!0);try{let e={};for(let t of Object.keys(j)){let n=j[t]??null;e[t]=$(n)?{profile:n?.profile??null,provider:n?.provider??null,model:n?.model??null}:null}await s.mutateAsync({llm:{callSites:e}}),t(),C.success(`Overrides saved.`)}catch(e){C.error(`Failed to save overrides. Please try again.`),a(e,{context:`call_site_overrides_save`})}finally{h(!1),n?.(!1)}},[j,t,s,n]),U=(0,X.useCallback)(async()=>{h(!0),n?.(!0);try{let e={};for(let t of Object.keys(j))e[t]=null;await s.mutateAsync({llm:{callSites:e}}),t(),C.success(`Overrides reset.`)}catch(e){C.error(`Failed to reset overrides. Please try again.`),a(e,{context:`call_site_overrides_reset`})}finally{h(!1),n?.(!1)}},[j,t,s,n]);return(0,Z.jsxs)(S.Content,{size:`lg`,hideCloseButton:!0,children:[(0,Z.jsxs)(S.Header,{children:[(0,Z.jsx)(S.Title,{children:`Action Overrides`}),(0,Z.jsx)(S.Description,{children:`Customize which model profile specific actions should use. Uses your default profile if no override is set.`})]}),(0,Z.jsxs)(S.Body,{children:[(0,Z.jsx)(`div`,{className:`mb-4`,children:(0,Z.jsx)(y,{type:`search`,value:c,onChange:e=>l(e.target.value),placeholder:`Search actions…`,leftIcon:(0,Z.jsx)(Y,{className:`h-4 w-4`}),fullWidth:!0})}),w&&(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Z.jsx)(O,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}),T&&(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Couldn't load actions`}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Make sure your assistant is running`}),(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:()=>void E(),children:`Retry`})]}),!w&&!T&&x&&(0,Z.jsx)(`div`,{className:`space-y-4`,children:z.length===0?(0,Z.jsx)(`p`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No actions match your search.`}):z.map(({domain:e,sites:t})=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:e.displayName}),(0,Z.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>{let t=(()=>{let t=j[e.id]??null;return!t||!$(t)?``:t.provider||t.model?`__custom__`:t.profile??``})(),n=e.defaultProfile?r.find(t=>t.name===e.defaultProfile)?.label??e.defaultProfile:null;return(0,Z.jsx)(Tt,{id:e.id,displayName:e.displayName,description:e.description,defaultProfileLabel:n,draft:j[e.id]??null,profileOptions:L(t===``||t===`__custom__`?null:t),onDraftChange:te,onToggle:B},e.id)})})]},e.id))})]}),(0,Z.jsxs)(S.Footer,{children:[N&&(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:()=>v(!0),disabled:m||!k,tintColor:`var(--system-negative-strong)`,className:`mr-auto`,children:`Reset to Defaults`}),(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:t,disabled:m,children:`Cancel`}),(0,Z.jsx)(p,{variant:`primary`,size:`compact`,onClick:()=>void V(),disabled:!P||F||m,children:m?(0,Z.jsx)(O,{className:`h-4 w-4 animate-spin`}):`Save`})]}),(0,Z.jsx)(g,{open:_,title:`Reset to Defaults`,message:`Every task override will be reset and will follow your active profile. This cannot be undone.`,confirmLabel:`Reset to Defaults`,destructive:!0,onConfirm:()=>{v(!1),U()},onCancel:()=>v(!1)})]})}function Mt({blocked:e,availableReplacements:t,replacement:n,onReplacementChange:r,error:i,saving:a,onClose:o,onConfirm:s}){let c=``;if(e){let t=e.label||e.name;c=e.isActive&&e.callSiteIds.length>0?`"${t}" is the active profile and is used by ${e.callSiteIds.length} call site(s). Pick a replacement profile.`:e.isActive?`"${t}" is the active profile. Pick a different active profile before deleting, or select a replacement below.`:`"${t}" is used by ${e.callSiteIds.length} call site(s). Select a replacement profile to reassign them before deleting.`}return(0,Z.jsx)(S.Root,{open:e!==null,onOpenChange:e=>{e||o()},children:(0,Z.jsxs)(S.Content,{size:`sm`,children:[(0,Z.jsx)(S.Header,{children:(0,Z.jsx)(S.Title,{children:`Can't Delete Profile`})}),(0,Z.jsxs)(S.Body,{className:`space-y-4`,children:[(0,Z.jsx)(m,{variant:`body-medium-default`,as:`p`,children:c}),e&&e.callSiteIds.length>0&&(0,Z.jsx)(`ul`,{className:`space-y-1 pl-1`,children:e.callSiteIds.map(e=>(0,Z.jsxs)(`li`,{className:`text-body-small-default text-(--content-secondary)`,children:[`• `,(0,Z.jsx)(`code`,{children:e})]},e))}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Replacement profile`}),(0,Z.jsx)(h,{"aria-label":`Replacement profile`,value:n,onChange:r,options:[{value:``,label:`Select a replacement…`},...t.map(e=>({value:e.name,label:e.label??e.name}))]})]}),i&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:i})]}),(0,Z.jsxs)(S.Footer,{children:[(0,Z.jsx)(p,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,Z.jsx)(p,{variant:`primary`,size:`compact`,disabled:!n||a,onClick:s,children:a?`Saving…`:`Reassign and Delete`})]})]})})}function Nt({profile:e,isDragging:t,dropTarget:n,isDeleting:r,deleteError:i,isToggling:a,onDragStart:o,onDragEnd:s,onDragOver:c,onDragLeave:l,onDrop:u,onEditClick:d,onDeleteClick:f,onStatusToggle:h}){let g=e.source===`managed`,_=e.status!==`disabled`,y=e.name===oe;return(0,Z.jsxs)(`div`,{className:`relative`,children:[n?.name===e.name&&!n.after&&(0,Z.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg pr-2 py-2${t?` opacity-50`:``}`,draggable:!g,onDragStart:o,onDragEnd:s,onDragOver:c,onDragLeave:l,onDrop:u,children:[(0,Z.jsx)(gt,{className:`h-4 w-4 shrink-0 ${g?`invisible`:`cursor-grab text-[var(--content-tertiary)]`}`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1${_?``:` opacity-55`}`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(m,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:e.label??e.name}),g&&e.name!==`auto`&&(0,Z.jsx)(v,{tone:`positive`,title:`Managed by Platform — auth is locked, but you can rename or disable this profile.`,children:`Platform`})]}),e.description?(0,Z.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:e.description}):null,e.model??e.provider?(0,Z.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:e.model??e.provider}):null]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,Z.jsx)(`div`,{className:`flex shrink-0 items-center`,title:_?`Active — toggle to hide from pickers`:`Disabled — toggle to show in pickers`,children:(0,Z.jsx)(b,{checked:_,onChange:e=>h(e),disabled:a,"aria-label":`${_?`Disable`:`Enable`} ${e.label??e.name}`})}),(0,Z.jsxs)(`div`,{className:`flex w-[92px] items-center justify-end gap-2${y?` invisible`:``}`,children:[(0,Z.jsx)(p,{variant:`ghost`,size:`compact`,onClick:d,children:g?`View`:`Edit`}),(0,Z.jsx)(p,{variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(We,{}),"aria-label":`Delete ${e.label??e.name}`,disabled:g||r,title:g?`Managed profiles cannot be deleted`:void 0,onClick:f,tintColor:`var(--system-negative-strong)`})]})]})]}),n?.name===e.name&&n.after&&(0,Z.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),i?(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:i}):null,e.name===`auto`&&(0,Z.jsx)(`div`,{className:`mx-2 mt-1 border-b border-[var(--border-subtle)]`})]})}function Pt({isOpen:e,assistantId:t,onClose:n}){let{profiles:r,profileOrder:i,orderedProfiles:o,activeProfile:s,callSites:c}=Dt(),l=Ot(),d=H.use.openAICompatibleEndpoints(),f=H.use.chatgptSubscriptionAuth(),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(null),{data:_}=u({...R({path:{assistant_id:t}}),enabled:e}),v=(0,X.useMemo)(()=>_?pe(_.connections,d):void 0,[_,d]),y=Object.keys(r);async function b(e,t,n){let o=n?.mode??`replace`,s=!(e in r);if(o===`merge`&&!s){await l.mutateAsync({llm:{profiles:{[e]:t}}}),m(!1),g(null);return}let c={profiles:{[e]:t}};if(s&&(c.profileOrder=i.includes(e)?i:[...i,e]),s)await l.mutateAsync({llm:c});else{let t=r[e];await l.mutateAsync({llm:{profiles:{[e]:null}}});try{await l.mutateAsync({llm:c})}catch(n){throw a(n,{context:`settings-ai-profile-edit-recreate`}),t!=null&&await l.mutateAsync({llm:{profiles:{[e]:t}}}).catch(()=>{}),n}}s&&C.success(`Profile "${t.label??e}" created`),m(!1),g(null)}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,Z.jsx)(Ft,{profiles:r,profileOrder:i,orderedProfiles:o,activeProfile:s,callSiteOverrides:c,onClose:n,onEditClick:e=>{g(e),m(!0)},onNewClick:()=>{g(null),m(!0)}}):null}),(0,Z.jsx)(ut,{isOpen:p,mode:h?h.source===`managed`?`view`:`edit`:`create`,profileName:h?.name,initialValues:h??void 0,existingNames:y,connections:v,openAICompatibleEndpointsEnabled:d,assistantId:t,chatgptSubscriptionEnabled:f,onSave:b,onCancel:()=>{m(!1),g(null)}})]})}function Ft({profiles:e,profileOrder:t,orderedProfiles:n,activeProfile:r,callSiteOverrides:i,onClose:o,onEditClick:s,onNewClick:c}){let l=Ot(),[u,d]=(0,X.useState)({}),[f,h]=(0,X.useState)({}),[g,_]=(0,X.useState)(new Set),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[C,w]=(0,X.useState)(null),[T,E]=(0,X.useState)(null),D=(0,X.useRef)(null),O=(0,X.useRef)(null),[k,A]=(0,X.useState)(null),[j,M]=(0,X.useState)(null),[N,P]=(0,X.useState)(``),[F,I]=(0,X.useState)(!1),L=H.use.queryComplexityRouting(),R=(0,X.useMemo)(()=>le(n,L),[n,L]);async function ee(t,n){if(g.has(t.name))return!1;_(e=>new Set(e).add(t.name)),y(null);let r=n?`active`:`disabled`;if(!e[t.name])return _(e=>{let n=new Set(e);return n.delete(t.name),n}),!1;try{return await l.mutateAsync({llm:{profiles:{[t.name]:{status:r}}}}),!0}catch(e){return a(e,{context:`settings-ai-profile-toggle`}),y(`Couldn't update "${t.label??t.name}". Please try again.`),!1}finally{_(e=>{let n=new Set(e);return n.delete(t.name),n})}}async function z(e){h(t=>({...t,[e]:!0})),d(t=>{let n={...t};return delete n[e],n});try{let n=t.filter(t=>t!==e);await l.mutateAsync({llm:{profiles:{[e]:null},profileOrder:n}})}catch(t){a(t,{context:`settings-ai-profile-delete`}),d(t=>({...t,[e]:`Failed to delete profile. Please try again.`}))}finally{h(t=>{let n={...t};return delete n[e],n})}}function te(e){let t=R.find(t=>t.name===e)?.label??e,n=e===r,a=Object.entries(i).filter(([t,n])=>t!==`mainAgent`&&n?.profile===e).map(([e])=>e);if(n||a.length>0){A({name:e,label:t,isActive:n,callSiteIds:a}),P(``),M(null);return}z(e)}async function B(){if(!k||!N)return;I(!0),M(null);let e={};if(k.isActive&&(e.activeProfile=N),k.callSiteIds.length>0){let t={};for(let e of k.callSiteIds)t[e]={profile:N};e.callSites=t}if(Object.keys(e).length>0)try{await l.mutateAsync({llm:e})}catch(e){a(e,{context:`settings-ai-profile-reassign-delete`}),M(`Failed to reassign references. Please try again.`),I(!1);return}let t=k.name;A(null),I(!1),z(t)}async function V(e,n){if(e===n.name)return;E(null);let r=t.filter(t=>t!==e),i=r.indexOf(n.name);if(i===-1)return;n.after&&(i+=1);let o=[...r.slice(0,i),e,...r.slice(i)];try{await l.mutateAsync({llm:{profileOrder:o}})}catch(e){a(e,{context:`settings-ai-profile-reorder`}),E(`Failed to reorder profiles. Please try again.`)}}let U=R.filter(e=>e.name!==k?.name&&e.source!==`managed`),W=U.length>0?U:R.filter(e=>e.name!==k?.name);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(S.Content,{size:`md`,children:[(0,Z.jsxs)(S.Header,{children:[(0,Z.jsx)(S.Title,{children:`Model Profiles`}),(0,Z.jsx)(S.Description,{children:`Bundle a provider and model into a named profile. Assign profiles to specific actions or swap between them when chatting.`})]}),(0,Z.jsxs)(S.Body,{children:[R.length===0?(0,Z.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No profiles yet. Create one to get started.`}):(0,Z.jsx)(`div`,{className:`space-y-1`,children:R.map(e=>(0,Z.jsx)(Nt,{profile:e,isDragging:b===e.name,dropTarget:C,isDeleting:f[e.name]??!1,deleteError:u[e.name],isToggling:g.has(e.name),onDragStart:t=>{D.current=e.name,x(e.name),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`)},onDragEnd:()=>{D.current=null,O.current=null,x(null),w(null)},onDragOver:t=>{t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=t.clientY>n.top+n.height/2,i={name:e.name,after:r};O.current=i,w(i)},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||(O.current=null,w(t=>t?.name===e.name?null:t))},onDrop:e=>{e.preventDefault();let t=D.current,n=O.current;D.current=null,O.current=null,x(null),w(null),t&&n&&V(t,n)},onEditClick:()=>s(e),onDeleteClick:()=>te(e.name),onStatusToggle:t=>void ee(e,t)},e.name))}),T&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:T}),v&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:v})]}),(0,Z.jsxs)(S.Footer,{className:`justify-between`,children:[(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:c,children:`+ New Profile`}),(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:o,children:`Done`})]})]}),(0,Z.jsx)(Mt,{blocked:k,availableReplacements:W,replacement:N,onReplacementChange:P,error:j,saving:F,onClose:()=>{A(null),M(null)},onConfirm:()=>void B()})]})}function It({mode:e,connection:t,assistantId:n,existingNames:r,openAICompatibleEndpointsEnabled:i=!1,chatgptSubscriptionEnabled:a=!1,onSave:o,onCancel:s}){let[c,u]=(0,X.useState)(e),[d,f]=(0,X.useState)(void 0),g=c===`managed-edit`,[_,v]=(0,X.useState)(t?.label??``),[b,x]=(0,X.useState)(t?.name??``),[C,w]=(0,X.useState)(t?.provider??`anthropic`),[T,E]=(0,X.useState)(()=>t?t.auth.type:`platform`),[D,O]=(0,X.useState)(()=>t?.auth.type===`api_key`?t.auth.credential:t?``:`credential/anthropic/api_key`),[k,j]=(0,X.useState)(t?.baseUrl??``),[N,P]=(0,X.useState)(()=>t?.models?t.models.map(e=>e.id).join(`, `):``),[F,I]=(0,X.useState)(!1),[L,R]=(0,X.useState)(null),ee=C===`openai-compatible`,z=(0,X.useMemo)(()=>{let e=i?J:J.filter(e=>e!==`openai-compatible`);return C&&!e.includes(C)?[...e,C]:e},[i,C]),{handleLabelChange:te,resetDirty:B}=ct(c,v,x),[V,H]=(0,X.useState)(``),[U,W]=(0,X.useState)(!1),ne=l(),K=(0,X.useMemo)(()=>Ge(D),[D]),re=T===`api_key`&&K!==null,{hasStoredCredential:ie,isLoading:oe,queryKey:Y}=_e({assistantId:n,credentialKind:`credential`,credentialName:K?`${K.service}:${K.field}`:``,enabled:re,errorContext:`settings-provider-editor-credential-presence`}),{credentials:se,queryKey:ce}=q({assistantId:n,enabled:T===`api_key`});(0,X.useEffect)(()=>{let e=t?.provider??`anthropic`;v(t?.label??``),x(t?.name??``),w(e),E(t?t.auth.type:`platform`),t?.auth.type===`api_key`?O(t.auth.credential):O(t?``:`credential/${e}/api_key`),B(),R(null),j(t?.baseUrl??``),P(t?.models?t.models.map(e=>e.id).join(`, `):``),H(``),W(!1)},[t,B]);function le(){u(`create`),f(C===`ollama`?`none`:`api_key`)}let ue=b.trim().length>0;async function de(){if(ue){I(!0),R(null);try{let e;if(T===`api_key`){let t=D.trim()||`credential/${C}/api_key`,r=V.trim();if(r){W(!0);try{let e=Ge(t);await M({path:{assistant_id:n},body:e?{type:`credential`,name:`${e.service}:${e.field}`,value:r}:{type:`api_key`,name:C,value:r},throwOnError:!0}),ne.setQueryData(Y,!0),ne.invalidateQueries({queryKey:ce})}catch{R(`Failed to save API key. Please try again.`);return}finally{W(!1)}}e={type:`api_key`,credential:t}}else if(T===`oauth_subscription`)if(t?.auth.type===`oauth_subscription`)e=t.auth;else{R(`Use the "Sign in with ChatGPT" button to connect your subscription.`);return}else e=T===`none`?{type:`none`}:{type:`platform`};let r=_.trim()||null,i={auth:e,label:r,...ee&&{base_url:k.trim()||null,models:N.trim()?N.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):null}},{data:a,response:s}=await A({path:{assistant_id:n,name:t?.name??b.trim()},body:i});if(!s?.ok){R(he(s?.status,b.trim()));return}if(!a){R(`Server returned an empty response. Please try again.`);return}o(a)}catch{R(`Failed to save connection. Please try again.`)}finally{I(!1)}}}let fe=se.filter(e=>e.service===C),pe=c!==`create`&&t?.auth.type===`api_key`,ge=fe.length>0||pe,ve=Se(`Enter your API key`,ie);return c===`create`?(0,Z.jsx)(be,{variant:`modal`,assistantId:n,existingNames:r,openAICompatibleEndpointsEnabled:i,chatgptSubscriptionEnabled:a,defaultProviderType:C,defaultAuthType:d,onCreated:o,onCancel:s},C):(0,Z.jsxs)(S.Content,{size:`md`,children:[(0,Z.jsxs)(S.Header,{children:[(0,Z.jsx)(S.Title,{children:`Edit Connection`}),(0,Z.jsx)(S.Description,{children:g?`Managed by Vellum — auth is locked, but you can rename "${t?.name}".`:`Editing "${t?.name}".`})]}),(0,Z.jsxs)(S.Body,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[`Display Name`,` `,(0,Z.jsx)(`span`,{className:`text-[var(--content-disabled)]`,children:`(optional)`})]}),(0,Z.jsx)(y,{value:_,onChange:e=>te(e.target.value),placeholder:`e.g. My Anthropic Key`,fullWidth:!0})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Key`}),(0,Z.jsx)(y,{value:b,placeholder:`e.g. anthropic-personal`,disabled:!0,fullWidth:!0})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(h,{"aria-label":`Provider`,value:C,onChange:e=>w(e),disabled:!0,options:z.map(e=>({value:e,label:Ue[e]}))})]}),ee&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,Z.jsx)(y,{value:k,onChange:e=>j(e.target.value),placeholder:`https://api.example.com/v1`,disabled:g,fullWidth:!0})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,Z.jsx)(y,{value:N,onChange:e=>P(e.target.value),placeholder:`model-1, model-2`,disabled:g,fullWidth:!0}),(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Auth Type`}),(0,Z.jsx)(h,{"aria-label":`Auth type`,value:T,onChange:e=>{E(e),R(null)},disabled:g||C===`ollama`,options:(()=>{let e;return e=C===`ollama`?[`none`]:Re(C)?[`api_key`,`platform`]:[`api_key`],T&&!e.includes(T)&&e.push(T),e.map(e=>({value:e,label:ae[e]}))})()})]}),T===`api_key`&&(0,Z.jsx)(G,{apiKeyValue:V,onApiKeyChange:H,credential:D,onCredentialChange:O,isAuthLocked:g,isLoadingCredential:oe,apiKeyPlaceholder:ve,provider:C,providerCredentials:fe,showAdvancedSection:ge,onError:R}),T===`oauth_subscription`&&(0,Z.jsx)(me,{assistantId:n,onConnected:o}),L&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:L})]}),(0,Z.jsxs)(S.Footer,{children:[(0,Z.jsx)(p,{variant:`ghost`,size:`compact`,onClick:s,children:`Cancel`}),c===`managed-edit`&&(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:le,disabled:F||U,children:`Save as New`}),(0,Z.jsx)(p,{variant:`primary`,size:`compact`,disabled:!ue||F||U,onClick:()=>void de(),children:F?`Saving…`:`Save`})]})]})}function Lt(e){switch(e.type){case`api_key`:return`API key · ${e.credential}`;case`oauth_subscription`:return`ChatGPT Subscription`;case`platform`:return`Managed proxy`;case`none`:return`None (local)`;default:return e.type}}function Rt({isOpen:e,assistantId:t,onClose:n}){let r=H.use.openAICompatibleEndpoints(),i=H.use.chatgptSubscriptionAuth(),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(null),d=l(),{data:f,isLoading:p,isError:m}=u({...R({path:{assistant_id:t}}),enabled:e}),h=(0,X.useMemo)(()=>pe(f?.connections??[],r),[f,r]);function g(e){d.invalidateQueries({queryKey:I({path:{assistant_id:t}})}),o(!1),c(null)}let _=h.map(e=>e.name),v=()=>{o(!1),c(null)};return(0,Z.jsx)(S.Root,{open:e,onOpenChange:e=>{e||(a?v():n())},children:e?a?(0,Z.jsx)(It,{mode:s?s.isManaged?`managed-edit`:`edit`:`create`,connection:s??void 0,assistantId:t,existingNames:_,openAICompatibleEndpointsEnabled:r,chatgptSubscriptionEnabled:i,onSave:g,onCancel:v}):(0,Z.jsx)(zt,{connections:h,loading:p,isError:m,assistantId:t,onClose:n,onEditClick:e=>{c(e),o(!0)},onNewClick:()=>{c(null),o(!0)},onConnectionDeleted:()=>{d.invalidateQueries({queryKey:I({path:{assistant_id:t}})})}}):null})}function zt({connections:e,loading:t,isError:n,assistantId:r,onClose:i,onEditClick:a,onNewClick:o,onConnectionDeleted:s}){let[c,l]=(0,X.useState)({}),[u,d]=(0,X.useState)({});async function f(e){d(t=>({...t,[e]:!0})),l(t=>{let n={...t};return delete n[e],n});try{let{response:t}=await N({path:{assistant_id:r,name:e}});t?.ok||t?.status===404?s(e):t?.status===409?l(t=>({...t,[e]:`Connection is in use by one or more profiles. Remove those references first.`})):l(t=>({...t,[e]:`Failed to delete connection. Please try again.`}))}catch{l(t=>({...t,[e]:`Failed to delete connection. Please try again.`}))}finally{d(t=>{let n={...t};return delete n[e],n})}}return(0,Z.jsxs)(S.Content,{size:`md`,children:[(0,Z.jsxs)(S.Header,{children:[(0,Z.jsx)(S.Title,{children:`Provider Connections`}),(0,Z.jsx)(S.Description,{children:`Manage inference provider connections. Each connection binds a name to a provider and auth configuration.`})]}),(0,Z.jsx)(S.Body,{children:t?(0,Z.jsx)(`div`,{className:`space-y-2 py-2`,children:[1,2,3].map(e=>(0,Z.jsx)(`div`,{className:`h-10 animate-pulse rounded-lg bg-[var(--surface-active)]`},e))}):n?(0,Z.jsx)(m,{variant:`body-medium-default`,as:`p`,className:`py-4 text-center text-(--system-negative-strong)`,children:`Failed to load connections. Please try again.`}):e.length===0?(0,Z.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No connections yet. Create one to get started.`}):(0,Z.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>{let t=u[e.name]??!1,n=c[e.name],r=e.isManaged??!1;return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg px-2 py-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(m,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:e.label??e.name}),r&&(0,Z.jsx)(v,{tone:`positive`,title:`Managed by Platform — auth is locked, but you can rename this connection.`,children:`Platform`})]}),(0,Z.jsxs)(m,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:[e.label?`${e.name} · `:``,Ue[e.provider]??e.provider,` · `,Lt(e.auth)]})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,Z.jsx)(p,{variant:`ghost`,size:`compact`,onClick:()=>a(e),children:`Edit`}),(0,Z.jsx)(p,{variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(We,{}),"aria-label":`Delete ${e.name}`,disabled:r||t,title:r?`Managed connections cannot be deleted`:void 0,onClick:()=>void f(e.name),tintColor:`var(--system-negative-strong)`})]})]}),n?(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:n}):null]},e.name)})})}),(0,Z.jsxs)(S.Footer,{className:`justify-between`,children:[(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:o,children:`+ New Connection`}),(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:i,children:`Done`})]})]})}function Bt(e){let[t,n]=(0,X.useState)(void 0);return(0,X.useEffect)(()=>{t!==void 0&&e===t.value&&n(void 0)},[e,t]),[t===void 0?e:t.value,(0,X.useCallback)(e=>n(e===void 0?void 0:{value:e}),[])]}function Vt(){let{assistantId:e,orderedProfiles:t,activeProfile:n,callSites:r}=Dt(),i=Ot(),[o,s]=Bt(n),[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(!1),[f,g]=(0,X.useState)(!1),_=H.use.queryComplexityRouting(),v=(0,X.useMemo)(()=>le(pt(t,[o]),_),[t,o,_]),y=Object.entries(r).filter(([e,t])=>e!==`mainAgent`&&(t?.profile!=null||t?.provider!=null||t?.model!=null)).length,b=y===1?`1 Override`:y>0?`${y} Overrides`:`Overrides`,x=o!==n,S=(0,X.useCallback)(async()=>{try{await i.mutateAsync({llm:{activeProfile:o}}),C.success(`Profile saved.`)}catch(e){C.error(`Failed to switch profile. Please try again.`),a(e,{context:`settings-ai-language-model-save`})}},[o,i]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bt,{title:`Language Model`,subtitle:`Configure the LLMs that power your assistant`,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Default Profile`}),(0,Z.jsx)(h,{value:o??``,onChange:e=>{s(e===``?null:e)},placeholder:`Select a default profile…`,options:v.map(e=>({value:e.name,label:e.name===`auto`?`Automatically switch between profiles`:fe(e)}))}),_&&o===`auto`&&(0,Z.jsx)(`div`,{className:`flex items-center gap-2 rounded-lg bg-[var(--surface-warning-subtle)] px-3 py-2`,children:(0,Z.jsx)(`span`,{className:`text-body-small-default text-[var(--content-warning)]`,children:`Auto may use more powerful models when needed, which can increase costs.`})}),v.length===0?(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`No profiles yet. Click Profiles below to create one.`}):null]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:()=>g(!0),children:`Providers`}),(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:()=>l(!0),children:`Profiles`}),(0,Z.jsx)(p,{variant:`outlined`,size:`compact`,onClick:()=>d(!0),children:b})]}),x&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:S,disabled:i.isPending}),i.isPending&&(0,Z.jsx)(O,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]})}),e&&(0,Z.jsx)(Pt,{isOpen:c,assistantId:e,onClose:()=>l(!1)}),e&&(0,Z.jsx)(At,{isOpen:u,onClose:()=>d(!1),assistantId:e}),e&&(0,Z.jsx)(Rt,{isOpen:f,assistantId:e,onClose:()=>g(!1)})]})}function Ht(){let{assistantId:e,config:i}=Dt(),o=Ot(),s=kt(),c=l(),{serverWebSearchMode:u,serverWebSearchProvider:d}=(0,X.useMemo)(()=>{if(!i)return{serverWebSearchMode:n(Ke,`your-own`),serverWebSearchProvider:n(at,`inference-provider-native`)};let e=i.services?.[`web-search`],t=e?.mode;return{serverWebSearchMode:t===`managed`||t===`your-own`?t:n(Ke,`your-own`),serverWebSearchProvider:e?.provider||n(`vellum:ai:webSearchProvider`,`inference-provider-native`)}},[i]),[f,p]=(0,X.useState)(!1),[m,g]=Bt(u),[_,v]=Bt(d),[b,x]=(0,X.useState)(``),S=se.has(_),{hasStoredCredential:w,queryKey:T}=_e({assistantId:e,credentialKind:`api_key`,credentialName:_,enabled:S,errorContext:`settings-ai-web-search-read-credential`}),E=b.trim().length>0,D=f||m===`your-own`&&S&&!w&&!E||!(m!==u||(m===`managed`?`inference-provider-native`:_)!==d)&&!E,k=Se(ue[_]??`Enter your API key`,w),A=(0,X.useCallback)(async()=>{p(!0);let e=b.trim(),t=m===`managed`?`inference-provider-native`:_,n=we(t),i=m===`your-own`&&S&&e.length>0;try{i&&await s(t,e),await o.mutateAsync({services:{"web-search":{mode:m,provider:t}}}).catch(e=>{throw C.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{p(!1);return}p(!1);try{r(Ke,m),r(at,t),i&&(n&&r(n,e),c.setQueryData(T,!0),c.invalidateQueries({queryKey:T}),x(``)),C.success(`Web search settings saved.`)}catch(e){a(e,{context:`settings-ai-web-search-persist-local`}),C.error(`Saved, but local preferences could not be written.`)}},[S,o,s,c,T,b,m,_]),j=(0,X.useCallback)(()=>{let e=we(_);e&&t(e),x(``),v(`inference-provider-native`),r(at,`inference-provider-native`)},[_,v]);return(0,Z.jsx)(vt,{title:`Web Search`,subtitle:`Configure how your assistant should search the web`,mode:m,onModeChange:e=>g(e),children:m===`managed`?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Web search is included with managed inference.`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:A,disabled:D}),f&&(0,Z.jsx)(O,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(h,{value:_,onChange:v,options:Qe.map(e=>({value:e,label:de[e]??e}))})]}),S&&(0,Z.jsx)(y,{label:`API Key`,type:`password`,value:b,onChange:e=>x(e.target.value),placeholder:k,fullWidth:!0}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:A,disabled:D}),f&&(0,Z.jsx)(O,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),S&&(0,Z.jsx)(yt,{onClick:j,filled:!0})]})]})})}function Ut({assistantId:e,assistantHandle:t,emailRootDomain:n}){let r=l(),i=s(),[o,f]=c(),[m,h]=(0,X.useState)(``),[v,y]=(0,X.useState)(!1),[b,x]=(0,X.useState)(null),[S,w]=(0,X.useState)(``),[D,k]=(0,X.useState)(null),[A,j]=(0,X.useState)(!1),[M,N]=(0,X.useState)(!1),[P,F]=(0,X.useState)(!1);(0,X.useEffect)(()=>{v||!t||m||(h(t),y(!0))},[t,v,m]);let I=u({...qe(),enabled:!0}),L=I.data,R=L?.entitlements,ee=R?.managed_email===!0,B=!!R&&!ee,V=!L&&I.isError&&!I.isFetching,H=u({...Ae({path:{assistant_id:e}}),enabled:!B}),U=u({...xe({path:{assistant_id:e}}),enabled:!B}),W=H.data?.results?.[0],G=U.data?.results?.[0],ne=W?`${W.subdomain}.${n}`:null,K=u({...lt({path:{assistant_id:e,id:G?.id??``}}),enabled:!!G?.id,refetchOnWindowFocus:!1}),q=u({...ft({path:{assistant_id:e,id:W?.id??``}}),enabled:!!W?.id,refetchInterval:e=>{let t=e.state.data?.status;return t===`verified`||t===`failed`?!1:1e4},refetchOnWindowFocus:!0});(0,X.useEffect)(()=>{o.get(`release`)!==`1`||!W||G||(N(!0),f(e=>{let t=new URLSearchParams(e);return t.delete(`release`),t},{replace:!0}))},[G,W,o,f]);let J=d(Ve()),ie=d(ze()),ae=d(Ne()),oe=d(dt()),Y=(0,X.useCallback)(()=>{let t={assistant_id:e};r.invalidateQueries({queryKey:st({path:t})}),r.invalidateQueries({queryKey:re({path:t})}),G?.id&&r.invalidateQueries({queryKey:Ce({path:{...t,id:G.id}})}),r.invalidateQueries({queryKey:ge()})},[G?.id,e,r]),se=(0,X.useCallback)(async()=>{let t=m.trim().toLowerCase();if(!t){x(`Enter a subdomain.`);return}j(!1);try{await J.mutateAsync({path:{assistant_id:e},body:{subdomain:t}}),h(``),x(null),Y(),C.success(`Domain ${t}.${n} registered.`)}catch(e){x(z(e,void 0,`Failed to register domain.`))}},[e,n,Y,J,m]),ce=(0,X.useCallback)(async()=>{let t=S.trim().toLowerCase();if(!t){k(`Enter an email username.`);return}try{await ae.mutateAsync({path:{assistant_id:e},body:{username:t}}),w(``),k(null),Y(),C.success(`Email address created.`)}catch(e){k(z(e,void 0,`Failed to create email address.`))}},[e,Y,ae,S]),le=(0,X.useCallback)(async()=>{if(G?.id){F(!1);try{await oe.mutateAsync({path:{assistant_id:e,id:G.id}}),Y(),C.success(`Email address removed.`)}catch(e){a(e,{context:`email_address_delete`}),C.error(`Failed to remove email address.`)}}},[G?.id,e,oe,Y]),ue=(0,X.useCallback)(async()=>{if(!W?.id)return;if(G){C.error(`Remove the email address first.`);return}N(!1);let t=W.subdomain;try{await ie.mutateAsync({path:{assistant_id:e,id:W.id}}),h(t),Y(),C.success(`Domain released.`)}catch(e){a(e,{context:`email_domain_release`}),C.error(`Failed to release domain.`)}},[G,e,ie,W?.id,W?.subdomain,Y]);if(I.isLoading)return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(O,{className:`h-4 w-4 animate-spin`}),`Checking subscription…`]});if(B)return(0,Z.jsxs)(_,{tone:`info`,icon:(0,Z.jsx)(T,{className:`h-4 w-4`,"aria-hidden":!0}),title:`Get a dedicated email address for your assistant`,actions:(0,Z.jsx)(p,{size:`compact`,onClick:()=>i(`${te.settings.billing}?adjust_plan`),children:`Upgrade to Pro`}),children:[`Pro plans include a managed`,` `,`<your-subdomain>.${n}`,` inbox — no provider setup required. Or switch to `,(0,Z.jsx)(`strong`,{children:`Your Own`}),` to bring an existing provider.`]});let de=V?(0,Z.jsx)(_,{tone:`warning`,title:`Couldn't verify subscription status`,actions:(0,Z.jsx)(p,{size:`compact`,variant:`outlined`,onClick:()=>I.refetch(),children:`Retry`}),children:`We couldn't reach the billing service. The form below assumes managed email is enabled for your org — if it isn't, registering a domain will fail.`}):null;return W?G?(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[de,(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Address`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:G.address}),(0,Z.jsx)(St,{status:q.data?.status,message:q.data?.message,isLoading:q.isLoading}),(0,Z.jsx)(p,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Z.jsx)(We,{}),onClick:()=>F(!0),disabled:oe.isPending,"aria-label":`Remove email address`})]}),(0,Z.jsx)(g,{open:P,title:`Remove Email Address`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to remove `,(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:G.address}),`? Your assistant will no longer be able to send or receive email at this address.`]}),confirmLabel:`Remove`,destructive:!0,onConfirm:le,onCancel:()=>F(!1)})]}),K.data?.usage&&(0,Z.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[K.data.usage.sent_today,` /`,` `,K.data.usage.daily_limit,` sent today ·`,` `,K.data.usage.received_today,` received`]})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[de,(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Domain`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:[W.subdomain,`.`,n]}),(0,Z.jsx)(St,{status:q.data?.status,message:q.data?.message,isLoading:q.isLoading}),(0,Z.jsx)(p,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Z.jsx)(We,{}),onClick:()=>N(!0),disabled:ie.isPending,"aria-label":`Release domain`})]}),(0,Z.jsx)(g,{open:M,title:`Release Domain`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to release `,(0,Z.jsxs)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:[W.subdomain,`.`,n]}),`? The subdomain will become available for others to claim.`]}),confirmLabel:`Release`,destructive:!0,onConfirm:ue,onCancel:()=>N(!1)})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Email address`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex h-9 min-w-0 flex-1 items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${D?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[(0,Z.jsx)(`input`,{value:S,onChange:e=>{w(e.target.value.toLowerCase()),D&&k(null)},placeholder:`hi`,"aria-label":`Email username`,"aria-invalid":!!D,className:`h-full min-w-0 flex-1 bg-transparent pl-3 pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,Z.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`@`,ne]})]}),(0,Z.jsx)(p,{onClick:ce,disabled:ae.isPending||!S.trim(),children:ae.isPending?`Creating…`:`Create`})]}),D&&(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:D})]})]}):(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[de,(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Subdomain`}),(0,Z.jsx)(E,{subdomain:m,onSubdomainChange:e=>{h(e),b&&x(null)},domainSuffix:n,subdomainPlaceholder:`my-assistant`,error:b}),(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Each assistant gets its own subdomain. Lowercase letters, numbers, and hyphens only.`}),(0,Z.jsx)(p,{onClick:()=>j(!0),disabled:J.isPending||!m.trim(),children:J.isPending?`Registering…`:`Register`}),(0,Z.jsx)(g,{open:A,title:`Set Subdomain`,message:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:m.trim().toLowerCase()||`subdomain`}),` will also become your assistant's public handle. You won't be able to change it once set.`]}),confirmLabel:`Confirm`,onConfirm:se,onCancel:()=>j(!1)})]})}function Wt(){let e=mt(),{data:t}=u(ie()),o=t?.results?.[0]?.handle,s=it.use.emailRootDomain(),c=Je(),[l,d]=(0,X.useState)(()=>c===`gated`?`your-own`:n(nt,`managed`)),[f,p]=(0,X.useState)(()=>n(Ie,`resend`)),m=u({queryKey:[`byoEmailCredential`,e,f],queryFn:async()=>{let{data:t}=await P({path:{assistant_id:e},body:{service:f,field:`api_key`},throwOnError:!0});return t},enabled:l===`your-own`||c===`gated`,staleTime:6e4,retry:i,meta:{errorContext:`byo_email_credential_check`}});(0,X.useEffect)(()=>{m.error&&a(m.error,{context:`byo_email_credential_check`,bestEffort:!0})},[m.error]);let g=m.data?.hasSecret===!0,v=(0,X.useCallback)(e=>{d(e),r(nt,e)},[]),y=(0,X.useCallback)(()=>{r(Ie,f),C.success(`Email settings saved.`)},[f]),b=(0,X.useMemo)(()=>De.find(e=>e.id===f)??De[0],[f]),x=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(K,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{children:[`Configure `,b.displayName,` via the assistant CLI: ask the assistant to run the`,` `,(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:b.setupSkill}),` `,`skill. It walks you through storing the API key, detecting the domain, and (optionally) wiring up an inbound webhook.`]}),(0,Z.jsxs)(`a`,{href:b.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,b.displayName,(0,Z.jsx)(D,{className:`h-3 w-3`})]})]})]}),S=(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(h,{value:f,onChange:e=>p(e),options:De.map(e=>({value:e.id,label:e.displayName}))})]}),g?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--system-positive-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-default)]`,children:[(0,Z.jsx)(Me,{className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,Z.jsxs)(`span`,{children:[b.displayName,` API key configured. To reconfigure, run the`,` `,(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:b.setupSkill}),` `,`skill.`]})]}),(0,Z.jsxs)(`a`,{href:b.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-body-small-default text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,b.displayName,(0,Z.jsx)(D,{className:`h-3 w-3`})]})]}):x,(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(Q,{onClick:y,disabled:!1})})]});return c===`gated`?(0,Z.jsx)(bt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,children:S}):(0,Z.jsx)(vt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,mode:l,onModeChange:v,children:l===`managed`?(0,Z.jsx)(`div`,{className:`space-y-4`,children:c===`disabled`?(0,Z.jsx)(_,{tone:`info`,children:`Log in to the Vellum platform to manage email settings.`}):(0,Z.jsx)(Ut,{assistantId:e,assistantHandle:o,emailRootDomain:s})}):S})}function Gt(){let{config:e}=Dt(),{resolveAssistantId:t}=Et(),i=l(),o=Ot(),s=kt(),[c,u]=Bt((0,X.useMemo)(()=>{if(!e)return n(Xe,`your-own`);let t=e.services?.[`image-generation`]?.mode;return t===`managed`||t===`your-own`?t:n(Xe,`your-own`)},[e])),[d,f]=(0,X.useState)(()=>n($e,`gemini-3.1-flash-image-preview`)),[p,m]=(0,X.useState)(``),[g,_]=(0,X.useState)(!1),v=(0,X.useCallback)(async()=>{_(!0);let e=p.trim(),n=c===`your-own`&&e.length>0;try{n&&await s(`gemini`,e),await o.mutateAsync({services:{"image-generation":{mode:c}}}).catch(e=>{throw C.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e});let r=await t();try{await j({path:{assistant_id:r},body:{modelId:d},throwOnError:!0})}catch(e){throw C.error(`Failed to update image generation model. Please try again.`),a(e,{context:`set_image_gen_model`}),e}finally{i.invalidateQueries({queryKey:V(r)})}}catch{_(!1);return}_(!1);try{r(Xe,c),r($e,d),n&&m(``),C.success(`Image generation settings saved.`)}catch(e){a(e,{context:`settings-ai-image-gen-persist-local`}),C.error(`Saved, but local preferences could not be written.`)}},[p,c,d,o,s,t,i]),b=(0,X.useCallback)(()=>{m(``),f(`gemini-3.1-flash-image-preview`),r($e,`gemini-3.1-flash-image-preview`)},[]);return(0,Z.jsx)(vt,{title:`Image Generation`,subtitle:`Configure which model your assistant uses to generate images`,mode:c,onModeChange:e=>u(e),children:c===`managed`?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Z.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,Z.jsx)(h,{className:`flex-1`,value:d,onChange:f,options:Oe.map(e=>({value:e,label:ke[e]??e}))}),(0,Z.jsx)(Q,{onClick:v,disabled:g}),g&&(0,Z.jsx)(O,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsx)(y,{label:`API Key`,type:`password`,value:p,onChange:e=>m(e.target.value),placeholder:`Enter your Gemini API key`,fullWidth:!0}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Z.jsx)(h,{value:d,onChange:f,options:Oe.map(e=>({value:e,label:ke[e]??e}))})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:v,disabled:g}),g&&(0,Z.jsx)(O,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),(0,Z.jsx)(yt,{onClick:b})]})]})})}async function Kt(e){let{provider:t,apiKey:n,voiceId:r,text:i}=e;if(n.trim().length===0)return{kind:`error`,message:`Save an API key for this provider first.`};try{return t===`elevenlabs`?await qt(n,r,i):t===`deepgram`?await Jt(n,i):t===`fish-audio`?{kind:`unsupported`,message:`Fish Audio TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:t===`xai`?{kind:`unsupported`,message:`xAI TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:{kind:`unsupported`,message:`TTS testing for "${t}" is not supported from the browser yet.`}}catch(e){return{kind:`error`,message:e instanceof Error?e.message:`Failed to reach the TTS provider.`}}}async function qt(e,t,n){let r=t.trim();if(r.length===0)return{kind:`error`,message:`Enter and save a Voice ID before testing ElevenLabs.`};let i=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(r)}?output_format=mp3_44100_128`,{method:`POST`,headers:{"xi-api-key":e,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:n,model_id:`eleven_turbo_v2_5`})});return i.ok?{kind:`audio`,blob:await i.blob()}:{kind:`error`,message:await Yt(i,`ElevenLabs rejected the request.`)}}async function Jt(e,t){let n=await fetch(`https://api.deepgram.com/v1/speak?model=aura-2-thalia-en`,{method:`POST`,headers:{Authorization:`Token ${e}`,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:t})});return n.ok?{kind:`audio`,blob:await n.blob()}:{kind:`error`,message:await Yt(n,`Deepgram rejected the request.`)}}async function Yt(e,t){try{let n=await e.text();if(n.length===0)return`${t} (HTTP ${e.status})`;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`detail`in e&&typeof e.detail==`string`)return e.detail;if(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`)return e.message}catch{}return n.slice(0,200)}catch{return`${t} (HTTP ${e.status})`}}function Xt(){let e=mt(),t=U.use.name()??`your assistant`,i=B(),{data:a}=u({...L({path:{assistant_id:e}}),enabled:i,staleTime:1/0}),o=a?.providers??Le,s=o[0]?.id??`elevenlabs`,[c,l]=(0,X.useState)(()=>n(et,s)),[d,f]=(0,X.useState)(c),[m,g]=(0,X.useState)(``),[_,v]=(0,X.useState)(``),[b,x]=(0,X.useState)(``),[S,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(!1),D=(0,X.useMemo)(()=>o.find(e=>e.id===c)??o[0],[c,o]),O=(0,X.useCallback)(e=>{let t=n(Ze+e,``),r=n(Pe+e,``);w(t.length>0),v(r),x(r),g(``)},[]);(0,X.useEffect)(()=>{O(c)},[c,O]);let k=(0,X.useMemo)(()=>{let e=c!==d,t=m.trim().length>0,n=_.trim()!==b;return e||t||n},[c,d,m,_,b]),A=(0,X.useCallback)(()=>{r(et,c);let e=m.trim();e.length>0&&(r(Ze+c,e),w(!0));let t=_.trim();r(Pe+c,t),f(c),x(t),g(``)},[c,m,_]),j=(0,X.useCallback)(()=>{r(Ze+c,``),w(!1),g(``)},[c]),M=(0,X.useCallback)(async()=>{E(!0);try{let e=n(Ze+c,``),r=m.trim(),i=r.length>0?r:e;if(i.length===0){C.error(`Save an API key for this provider before testing.`);return}let a=n(Pe+c,``),o=_.trim(),s=await Kt({provider:c,apiKey:i,voiceId:o.length>0?o:a,text:`Hey! It's ${t}. How does this sound?`});if(s.kind!==`audio`){C.error(s.message);return}let l=URL.createObjectURL(s.blob);try{let e=new Audio(l);await e.play(),await new Promise(t=>{e.onended=()=>t(),e.onerror=()=>t()})}finally{URL.revokeObjectURL(l)}}finally{E(!1)}},[t,m,c,_]),N=S?`•••••••• (Enter a new key to replace)`:D.apiKeyPlaceholder;return(0,Z.jsx)(bt,{title:`Text-to-Speech`,subtitle:D.subtitle,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(h,{value:c,onChange:l,options:o.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Z.jsx)(y,{type:`password`,value:m,onChange:e=>g(e.target.value),placeholder:N,fullWidth:!0})]}),D.supportsVoiceSelection&&(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,Z.jsx)(y,{type:`text`,value:_,onChange:e=>v(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),(0,Z.jsx)(xt,{guide:D.credentialsGuide}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(p,{variant:`outlined`,onClick:M,disabled:T,children:T?`Testing…`:`Test`}),(0,Z.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:A,disabled:!k}),S&&(0,Z.jsx)(yt,{onClick:j})]})]})]})})}function Zt(){let e=Fe[0]?.id??`deepgram`,[t,i]=(0,X.useState)(()=>n(je,e)),[a,o]=(0,X.useState)(t),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1),d=(0,X.useMemo)(()=>Fe.find(e=>e.id===t)??Fe[0],[t]);(0,X.useEffect)(()=>{u(n(He+t,``).length>0),c(``)},[t]);let f=(0,X.useMemo)(()=>{let e=t!==a,n=s.trim().length>0;return e||n},[t,a,s]),p=(0,X.useCallback)(()=>{r(je,t);let e=s.trim();e.length>0&&(r(He+t,e),u(!0)),o(t),c(``)},[t,s]),m=(0,X.useCallback)(()=>{r(He+t,``),u(!1),c(``)},[t]),g=l?`•••••••• (Enter a new key to replace)`:d.apiKeyPlaceholder;return(0,Z.jsx)(bt,{title:`Speech-to-Text`,subtitle:d.subtitle,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(h,{value:t,onChange:i,options:Fe.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Z.jsx)(y,{type:`password`,value:s,onChange:e=>c(e.target.value),placeholder:g,fullWidth:!0})]}),(0,Z.jsx)(xt,{guide:d.credentialsGuide}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,Z.jsx)(Q,{onClick:p,disabled:!f}),l&&(0,Z.jsx)(yt,{onClick:m})]})]})})}function Qt(){return(0,X.useEffect)(()=>{let e=window.location.hash.slice(1);e&&requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:`start`})})},[]),(0,Z.jsxs)(`div`,{className:`space-y-5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-4 py-2.5`,children:[(0,Z.jsx)(K,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:[`Managed services are metered and deducted from your Vellum account balance.`,` `,(0,Z.jsxs)(`a`,{href:`https://www.vellum.ai/docs/pricing`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--primary-base)] hover:underline`,children:[`View pricing`,(0,Z.jsx)(D,{className:`h-3.5 w-3.5`})]})]})]}),(0,Z.jsx)(Vt,{}),(0,Z.jsx)(Ht,{}),(0,Z.jsx)(Wt,{}),(0,Z.jsx)(Gt,{}),(0,Z.jsx)(Xt,{}),(0,Z.jsx)(Zt,{})]})}export{Qt as AiPage};
@@ -0,0 +1,39 @@
1
+ import{r as e}from"./chunk-jRWAZmH_.js";import{A as t,C as n,c as r}from"./local-mode-Cx_DqCMC.js";import{Q as i,Z as a,_ as o,ft as s,g as c,h as l}from"./sdk.gen-govMfbgX.js";import{i as u,n as d}from"./api-errors-DApr8J5Z.js";import{M as f,N as p,P as ee,a as te,b as ne,i as re,o as ie,x as ae}from"./sdk.gen-BnTFwWLf.js";Object.freeze({status:`aborted`});function m(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var h=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},oe=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},se={};function g(e){return e&&Object.assign(se,e),se}function ce(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function le(e,t){return typeof t==`bigint`?t.toString():t}function _(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function ue(e){return e==null}function de(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function fe(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var pe=Symbol(`evaluating`);function v(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==pe)return r===void 0&&(r=pe,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function b(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function me(e){return JSON.stringify(e)}function he(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ge=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _e=_(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function S(e){if(x(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(x(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ve(e){return S(e)?{...e}:Array.isArray(e)?[...e]:e}var ye=new Set([`string`,`number`,`symbol`]);function C(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function w(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function T(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function be(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Se(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return w(e,b(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return y(this,`shape`,e),e},checks:[]}))}function Ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return w(e,b(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return y(this,`shape`,r),r},checks:[]}))}function we(e,t){if(!S(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function Te(e,t){if(!S(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function Ee(e,t){return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return y(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function De(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return w(t,b(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return y(this,`shape`,i),i},checks:[]}))}function Oe(e,t,n){return w(t,b(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return y(this,`shape`,i),i}}))}function E(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function D(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function O(e){return typeof e==`string`?e:e?.message}function k(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ke(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function A(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ae=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,le,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},je=m(`$ZodError`,Ae),Me=m(`$ZodError`,Ae,{Parent:Error});function Ne(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Pe(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var Fe=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new h;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>k(e,a,g())));throw ge(t,i?.callee),t}return o.value},Ie=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>k(e,a,g())));throw ge(t,i?.callee),t}return o.value},Le=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new h;return a.issues.length?{success:!1,error:new(e??je)(a.issues.map(e=>k(e,i,g())))}:{success:!0,data:a.value}},Re=Le(Me),ze=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>k(e,i,g())))}:{success:!0,data:a.value}},Be=ze(Me),Ve=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Fe(e)(t,n,i)},He=e=>(t,n,r)=>Fe(e)(t,n,r),Ue=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ie(e)(t,n,i)},We=e=>async(t,n,r)=>Ie(e)(t,n,r),Ge=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Le(e)(t,n,i)},Ke=e=>(t,n,r)=>Le(e)(t,n,r),qe=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ze(e)(t,n,i)},Je=e=>async(t,n,r)=>ze(e)(t,n,r),Ye=/^[cC][^\s-]{8,}$/,Xe=/^[0-9a-z]+$/,Ze=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qe=/^[0-9a-vA-V]{20}$/,$e=/^[A-Za-z0-9]{27}$/,et=/^[a-zA-Z0-9_-]{21}$/,tt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,it=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,at=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function ot(){return new RegExp(at,`u`)}var st=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ct=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,lt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ut=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ft=/^[A-Za-z0-9_-]*$/,pt=/^\+[1-9]\d{6,14}$/,mt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ht=RegExp(`^${mt}$`);function gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _t(e){return RegExp(`^${gt(e)}$`)}function vt(e){let t=gt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${mt}T(?:${r})$`)}var yt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},bt=/^-?\d+$/,xt=/^-?\d+(?:\.\d+)?$/,St=/^(?:true|false)$/i,Ct=/^null$/i,wt=/^[^A-Z]*$/,Tt=/^[^a-z]*$/,j=m(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Et={number:`number`,bigint:`bigint`,object:`date`},Dt=m(`$ZodCheckLessThan`,(e,t)=>{j.init(e,t);let n=Et[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ot=m(`$ZodCheckGreaterThan`,(e,t)=>{j.init(e,t);let n=Et[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kt=m(`$ZodCheckMultipleOf`,(e,t)=>{j.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):fe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),At=m(`$ZodCheckNumberFormat`,(e,t)=>{j.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xe[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=bt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),jt=m(`$ZodCheckMaxLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ue(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=ke(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mt=m(`$ZodCheckMinLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ue(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ke(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Nt=m(`$ZodCheckLengthEquals`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ue(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=ke(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Pt=m(`$ZodCheckStringFormat`,(e,t)=>{var n,r;j.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ft=m(`$ZodCheckRegex`,(e,t)=>{Pt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),It=m(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=wt,Pt.init(e,t)}),Lt=m(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Tt,Pt.init(e,t)}),Rt=m(`$ZodCheckIncludes`,(e,t)=>{j.init(e,t);let n=C(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),zt=m(`$ZodCheckStartsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`^${C(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Bt=m(`$ZodCheckEndsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`.*${C(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Vt=m(`$ZodCheckOverwrite`,(e,t)=>{j.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ht=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
3
+ `))}},Ut={major:4,minor:3,patch:6},M=m(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ut;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=E(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new h;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=E(e,t))});else{if(e.issues.length===t)continue;r||=E(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(E(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new h;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new h;return o.then(e=>t(e,r,a))}return t(o,r,a)}}v(e,`~standard`,()=>({validate:t=>{try{let n=Re(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Be(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Wt=m(`$ZodString`,(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??yt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),N=m(`$ZodStringFormat`,(e,t)=>{Pt.init(e,t),Wt.init(e,t)}),Gt=m(`$ZodGUID`,(e,t)=>{t.pattern??=nt,N.init(e,t)}),Kt=m(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=rt(e)}else t.pattern??=rt();N.init(e,t)}),qt=m(`$ZodEmail`,(e,t)=>{t.pattern??=it,N.init(e,t)}),Jt=m(`$ZodURL`,(e,t)=>{N.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Yt=m(`$ZodEmoji`,(e,t)=>{t.pattern??=ot(),N.init(e,t)}),Xt=m(`$ZodNanoID`,(e,t)=>{t.pattern??=et,N.init(e,t)}),Zt=m(`$ZodCUID`,(e,t)=>{t.pattern??=Ye,N.init(e,t)}),Qt=m(`$ZodCUID2`,(e,t)=>{t.pattern??=Xe,N.init(e,t)}),$t=m(`$ZodULID`,(e,t)=>{t.pattern??=Ze,N.init(e,t)}),en=m(`$ZodXID`,(e,t)=>{t.pattern??=Qe,N.init(e,t)}),tn=m(`$ZodKSUID`,(e,t)=>{t.pattern??=$e,N.init(e,t)}),nn=m(`$ZodISODateTime`,(e,t)=>{t.pattern??=vt(t),N.init(e,t)}),rn=m(`$ZodISODate`,(e,t)=>{t.pattern??=ht,N.init(e,t)}),an=m(`$ZodISOTime`,(e,t)=>{t.pattern??=_t(t),N.init(e,t)}),on=m(`$ZodISODuration`,(e,t)=>{t.pattern??=tt,N.init(e,t)}),sn=m(`$ZodIPv4`,(e,t)=>{t.pattern??=st,N.init(e,t),e._zod.bag.format=`ipv4`}),cn=m(`$ZodIPv6`,(e,t)=>{t.pattern??=ct,N.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),ln=m(`$ZodCIDRv4`,(e,t)=>{t.pattern??=lt,N.init(e,t)}),un=m(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ut,N.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function dn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var fn=m(`$ZodBase64`,(e,t)=>{t.pattern??=dt,N.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{dn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function pn(e){if(!ft.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return dn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var mn=m(`$ZodBase64URL`,(e,t)=>{t.pattern??=ft,N.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{pn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),hn=m(`$ZodE164`,(e,t)=>{t.pattern??=pt,N.init(e,t)});function gn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var _n=m(`$ZodJWT`,(e,t)=>{N.init(e,t),e._zod.check=n=>{gn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),vn=m(`$ZodNumber`,(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??xt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),yn=m(`$ZodNumberFormat`,(e,t)=>{At.init(e,t),vn.init(e,t)}),bn=m(`$ZodBoolean`,(e,t)=>{M.init(e,t),e._zod.pattern=St,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),xn=m(`$ZodNull`,(e,t)=>{M.init(e,t),e._zod.pattern=Ct,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Sn=m(`$ZodUnknown`,(e,t)=>{M.init(e,t),e._zod.parse=e=>e}),Cn=m(`$ZodNever`,(e,t)=>{M.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function wn(e,t,n){e.issues.length&&t.issues.push(...D(n,e.issues)),t.value[n]=e.value}var Tn=m(`$ZodArray`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>wn(t,n,e))):wn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function P(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...D(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function En(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=be(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Dn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>P(e,n,i,t,u))):P(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var On=m(`$ZodObject`,(e,t)=>{if(M.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=_(()=>En(t));v(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=x,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>P(n,t,e,s,r))):P(i,t,e,s,r)}return i?Dn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),kn=m(`$ZodObjectJIT`,(e,t)=>{On.init(e,t);let n=e._zod.parse,r=_(()=>En(t)),i=e=>{let t=new Ht([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=me(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=me(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
4
+ if (${n}.issues.length) {
5
+ if (${o} in input) {
6
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${n}.value === undefined) {
14
+ if (${o} in input) {
15
+ newResult[${o}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${o}] = ${n}.value;
19
+ }
20
+
21
+ `):t.write(`
22
+ if (${n}.issues.length) {
23
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
26
+ })));
27
+ }
28
+
29
+ if (${n}.value === undefined) {
30
+ if (${o} in input) {
31
+ newResult[${o}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${o}] = ${n}.value;
35
+ }
36
+
37
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=x,s=!se.jitless,c=s&&_e.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Dn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function An(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!E(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>k(e,r,g())))}),t)}var jn=m(`$ZodUnion`,(e,t)=>{M.init(e,t),v(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),v(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),v(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),v(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>de(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>An(t,i,e,a)):An(s,i,e,a)}}),Mn=m(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,jn.init(e,t);let n=e._zod.parse;v(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=_(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!x(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Nn=m(`$ZodIntersection`,(e,t)=>{M.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Fn(e,t,n)):Fn(e,i,a)}});function Pn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(S(e)&&S(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Pn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Pn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),E(e))return e;let o=Pn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var In=m(`$ZodRecord`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!S(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...D(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...D(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&xt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>k(e,r,g())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...D(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...D(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ln=m(`$ZodEnum`,(e,t)=>{M.init(e,t);let n=ce(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ye.has(typeof e)).map(e=>typeof e==`string`?C(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Rn=m(`$ZodLiteral`,(e,t)=>{if(M.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?C(e):e?C(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),zn=m(`$ZodTransform`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new oe(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new h;return n.value=i,n}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Vn=m(`$ZodOptional`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${de(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Bn(t,e.value)):Bn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hn=m(`$ZodExactOptional`,(e,t)=>{Vn.init(e,t),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Un=m(`$ZodNullable`,(e,t)=>{M.init(e,t),v(e._zod,`optin`,()=>t.innerType._zod.optin),v(e._zod,`optout`,()=>t.innerType._zod.optout),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${de(e.source)}|null)$`):void 0}),v(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Wn=m(`$ZodDefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Gn(e,t)):Gn(r,t)}});function Gn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Kn=m(`$ZodPrefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),qn=m(`$ZodNonOptional`,(e,t)=>{M.init(e,t),v(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Jn(t,e)):Jn(i,e)}});function Jn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Yn=m(`$ZodCatch`,(e,t)=>{M.init(e,t),v(e._zod,`optin`,()=>t.innerType._zod.optin),v(e._zod,`optout`,()=>t.innerType._zod.optout),v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>k(e,n,g()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>k(e,n,g()))},input:e.value}),e.issues=[]),e)}}),Xn=m(`$ZodPipe`,(e,t)=>{M.init(e,t),v(e._zod,`values`,()=>t.in._zod.values),v(e._zod,`optin`,()=>t.in._zod.optin),v(e._zod,`optout`,()=>t.out._zod.optout),v(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>F(e,t.in,n)):F(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>F(e,t.out,n)):F(r,t.out,n)}});function F(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Zn=m(`$ZodReadonly`,(e,t)=>{M.init(e,t),v(e._zod,`propValues`,()=>t.innerType._zod.propValues),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`optin`,()=>t.innerType?._zod?.optin),v(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Qn):Qn(r)}});function Qn(e){return e.value=Object.freeze(e.value),e}var $n=m(`$ZodCustom`,(e,t)=>{j.init(e,t),M.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>er(t,n,r,e));er(i,n,r,e)}});function er(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(A(e))}}var tr,nr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function rr(){return new nr}(tr=globalThis).__zod_globalRegistry??(tr.__zod_globalRegistry=rr());var I=globalThis.__zod_globalRegistry;function ir(e,t){return new e({type:`string`,...T(t)})}function ar(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...T(t)})}function or(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...T(t)})}function sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...T(t)})}function cr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...T(t)})}function lr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...T(t)})}function ur(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...T(t)})}function dr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...T(t)})}function fr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...T(t)})}function pr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...T(t)})}function mr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...T(t)})}function hr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...T(t)})}function gr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...T(t)})}function _r(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...T(t)})}function vr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...T(t)})}function yr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...T(t)})}function br(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...T(t)})}function xr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...T(t)})}function Sr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...T(t)})}function Cr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...T(t)})}function wr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...T(t)})}function Tr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...T(t)})}function Er(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...T(t)})}function Dr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...T(t)})}function Or(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...T(t)})}function kr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...T(t)})}function Ar(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...T(t)})}function jr(e,t){return new e({type:`number`,checks:[],...T(t)})}function Mr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...T(t)})}function Nr(e,t){return new e({type:`boolean`,...T(t)})}function Pr(e,t){return new e({type:`null`,...T(t)})}function Fr(e){return new e({type:`unknown`})}function Ir(e,t){return new e({type:`never`,...T(t)})}function Lr(e,t){return new Dt({check:`less_than`,...T(t),value:e,inclusive:!1})}function Rr(e,t){return new Dt({check:`less_than`,...T(t),value:e,inclusive:!0})}function zr(e,t){return new Ot({check:`greater_than`,...T(t),value:e,inclusive:!1})}function Br(e,t){return new Ot({check:`greater_than`,...T(t),value:e,inclusive:!0})}function Vr(e,t){return new kt({check:`multiple_of`,...T(t),value:e})}function Hr(e,t){return new jt({check:`max_length`,...T(t),maximum:e})}function L(e,t){return new Mt({check:`min_length`,...T(t),minimum:e})}function Ur(e,t){return new Nt({check:`length_equals`,...T(t),length:e})}function Wr(e,t){return new Ft({check:`string_format`,format:`regex`,...T(t),pattern:e})}function Gr(e){return new It({check:`string_format`,format:`lowercase`,...T(e)})}function Kr(e){return new Lt({check:`string_format`,format:`uppercase`,...T(e)})}function qr(e,t){return new Rt({check:`string_format`,format:`includes`,...T(t),includes:e})}function Jr(e,t){return new zt({check:`string_format`,format:`starts_with`,...T(t),prefix:e})}function Yr(e,t){return new Bt({check:`string_format`,format:`ends_with`,...T(t),suffix:e})}function R(e){return new Vt({check:`overwrite`,tx:e})}function Xr(e){return R(t=>t.normalize(e))}function Zr(){return R(e=>e.trim())}function Qr(){return R(e=>e.toLowerCase())}function $r(){return R(e=>e.toUpperCase())}function ei(){return R(e=>he(e))}function ti(e,t,n){return new e({type:`array`,element:t,...T(n)})}function ni(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...T(n)})}function ri(e){let t=ii(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(A(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(A(r))}},e(n.value,n)));return t}function ii(e,t){let n=new j({check:`custom`,...T(t)});return n._zod.check=e,n}function ai(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??I,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function z(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,z(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&B(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function oi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
38
+
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function si(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:V(t,`input`,e.processors),output:V(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function B(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return B(r.element,n);if(r.type===`set`)return B(r.valueType,n);if(r.type===`lazy`)return B(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return B(r.innerType,n);if(r.type===`intersection`)return B(r.left,n)||B(r.right,n);if(r.type===`record`||r.type===`map`)return B(r.keyType,n)||B(r.valueType,n);if(r.type===`pipe`)return B(r.in,n)||B(r.out,n);if(r.type===`object`){for(let e in r.shape)if(B(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(B(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(B(e,n))return!0;return!!(r.rest&&B(r.rest,n))}return!1}var ci=(e,t={})=>n=>{let r=ai({...n,processors:t});return z(e,r),oi(r,e),si(r,e)},V=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ai({...i??{},target:a,io:t,processors:n});return z(e,o),oi(o,e),si(o,e)},li={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ui=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=li[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},di=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},fi=(e,t,n,r)=>{n.type=`boolean`},pi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mi=(e,t,n,r)=>{n.not={}},hi=(e,t,n,r)=>{let i=e._zod.def,a=ce(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},gi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},_i=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},vi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},yi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=z(a.element,t,{...r,path:[...r.path,`items`]})},bi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=z(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Si=(e,t,n,r)=>{let i=e._zod.def,a=z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ci=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=z(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=z(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=z(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},wi=(e,t,n,r)=>{let i=e._zod.def,a=z(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ti=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Di=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Oi=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ki=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;z(a,t,r);let o=t.seen.get(e);o.ref=a},Ai=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ji=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mi=m(`ZodISODateTime`,(e,t)=>{nn.init(e,t),G.init(e,t)});function Ni(e){return Dr(Mi,e)}var Pi=m(`ZodISODate`,(e,t)=>{rn.init(e,t),G.init(e,t)});function Fi(e){return Or(Pi,e)}var Ii=m(`ZodISOTime`,(e,t)=>{an.init(e,t),G.init(e,t)});function Li(e){return kr(Ii,e)}var Ri=m(`ZodISODuration`,(e,t)=>{on.init(e,t),G.init(e,t)});function zi(e){return Ar(Ri,e)}var Bi=(e,t)=>{je.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Pe(e,t)},flatten:{value:t=>Ne(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,le,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,le,2)}},isEmpty:{get(){return e.issues.length===0}}})};m(`ZodError`,Bi);var H=m(`ZodError`,Bi,{Parent:Error}),Vi=Fe(H),Hi=Ie(H),Ui=Le(H),Wi=ze(H),Gi=Ve(H),Ki=He(H),qi=Ue(H),Ji=We(H),Yi=Ge(H),Xi=Ke(H),Zi=qe(H),Qi=Je(H),U=m(`ZodType`,(e,t)=>(M.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:V(e,`input`),output:V(e,`output`)}}),e.toJSONSchema=ci(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(b(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>w(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Vi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ui(e,t,n),e.parseAsync=async(t,n)=>Hi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gi(e,t,n),e.decode=(t,n)=>Ki(e,t,n),e.encodeAsync=async(t,n)=>qi(e,t,n),e.decodeAsync=async(t,n)=>Ji(e,t,n),e.safeEncode=(t,n)=>Yi(e,t,n),e.safeDecode=(t,n)=>Xi(e,t,n),e.safeEncodeAsync=async(t,n)=>Zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Qi(e,t,n),e.refine=(t,n)=>e.check(so(t,n)),e.superRefine=t=>e.check(co(t)),e.overwrite=t=>e.check(R(t)),e.optional=()=>Ua(e),e.exactOptional=()=>Ga(e),e.nullable=()=>qa(e),e.nullish=()=>Ua(qa(e)),e.nonoptional=t=>$a(e,t),e.array=()=>Y(e),e.or=t=>Ma([e,t]),e.and=t=>Ia(e,t),e.transform=t=>ro(e,Va(t)),e.default=t=>Ya(e,t),e.prefault=t=>Za(e,t),e.catch=t=>to(e,t),e.pipe=t=>ro(e,t),e.readonly=()=>ao(e),e.describe=t=>{let n=e.clone();return I.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return I.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return I.get(e);let n=e.clone();return I.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),$i=m(`_ZodString`,(e,t)=>{Wt.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Wr(...t)),e.includes=(...t)=>e.check(qr(...t)),e.startsWith=(...t)=>e.check(Jr(...t)),e.endsWith=(...t)=>e.check(Yr(...t)),e.min=(...t)=>e.check(L(...t)),e.max=(...t)=>e.check(Hr(...t)),e.length=(...t)=>e.check(Ur(...t)),e.nonempty=(...t)=>e.check(L(1,...t)),e.lowercase=t=>e.check(Gr(t)),e.uppercase=t=>e.check(Kr(t)),e.trim=()=>e.check(Zr()),e.normalize=(...t)=>e.check(Xr(...t)),e.toLowerCase=()=>e.check(Qr()),e.toUpperCase=()=>e.check($r()),e.slugify=()=>e.check(ei())}),ea=m(`ZodString`,(e,t)=>{Wt.init(e,t),$i.init(e,t),e.email=t=>e.check(ar(ta,t)),e.url=t=>e.check(dr(ia,t)),e.jwt=t=>e.check(Er(ya,t)),e.emoji=t=>e.check(fr(aa,t)),e.guid=t=>e.check(or(na,t)),e.uuid=t=>e.check(sr(ra,t)),e.uuidv4=t=>e.check(cr(ra,t)),e.uuidv6=t=>e.check(lr(ra,t)),e.uuidv7=t=>e.check(ur(ra,t)),e.nanoid=t=>e.check(pr(oa,t)),e.guid=t=>e.check(or(na,t)),e.cuid=t=>e.check(mr(sa,t)),e.cuid2=t=>e.check(hr(ca,t)),e.ulid=t=>e.check(gr(la,t)),e.base64=t=>e.check(Cr(ga,t)),e.base64url=t=>e.check(wr(_a,t)),e.xid=t=>e.check(_r(ua,t)),e.ksuid=t=>e.check(vr(da,t)),e.ipv4=t=>e.check(yr(fa,t)),e.ipv6=t=>e.check(br(pa,t)),e.cidrv4=t=>e.check(xr(ma,t)),e.cidrv6=t=>e.check(Sr(ha,t)),e.e164=t=>e.check(Tr(va,t)),e.datetime=t=>e.check(Ni(t)),e.date=t=>e.check(Fi(t)),e.time=t=>e.check(Li(t)),e.duration=t=>e.check(zi(t))});function W(e){return ir(ea,e)}var G=m(`ZodStringFormat`,(e,t)=>{N.init(e,t),$i.init(e,t)}),ta=m(`ZodEmail`,(e,t)=>{qt.init(e,t),G.init(e,t)}),na=m(`ZodGUID`,(e,t)=>{Gt.init(e,t),G.init(e,t)}),ra=m(`ZodUUID`,(e,t)=>{Kt.init(e,t),G.init(e,t)}),ia=m(`ZodURL`,(e,t)=>{Jt.init(e,t),G.init(e,t)}),aa=m(`ZodEmoji`,(e,t)=>{Yt.init(e,t),G.init(e,t)}),oa=m(`ZodNanoID`,(e,t)=>{Xt.init(e,t),G.init(e,t)}),sa=m(`ZodCUID`,(e,t)=>{Zt.init(e,t),G.init(e,t)}),ca=m(`ZodCUID2`,(e,t)=>{Qt.init(e,t),G.init(e,t)}),la=m(`ZodULID`,(e,t)=>{$t.init(e,t),G.init(e,t)}),ua=m(`ZodXID`,(e,t)=>{en.init(e,t),G.init(e,t)}),da=m(`ZodKSUID`,(e,t)=>{tn.init(e,t),G.init(e,t)}),fa=m(`ZodIPv4`,(e,t)=>{sn.init(e,t),G.init(e,t)}),pa=m(`ZodIPv6`,(e,t)=>{cn.init(e,t),G.init(e,t)}),ma=m(`ZodCIDRv4`,(e,t)=>{ln.init(e,t),G.init(e,t)}),ha=m(`ZodCIDRv6`,(e,t)=>{un.init(e,t),G.init(e,t)}),ga=m(`ZodBase64`,(e,t)=>{fn.init(e,t),G.init(e,t)}),_a=m(`ZodBase64URL`,(e,t)=>{mn.init(e,t),G.init(e,t)}),va=m(`ZodE164`,(e,t)=>{hn.init(e,t),G.init(e,t)}),ya=m(`ZodJWT`,(e,t)=>{_n.init(e,t),G.init(e,t)}),ba=m(`ZodNumber`,(e,t)=>{vn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e.gt=(t,n)=>e.check(zr(t,n)),e.gte=(t,n)=>e.check(Br(t,n)),e.min=(t,n)=>e.check(Br(t,n)),e.lt=(t,n)=>e.check(Lr(t,n)),e.lte=(t,n)=>e.check(Rr(t,n)),e.max=(t,n)=>e.check(Rr(t,n)),e.int=t=>e.check(Sa(t)),e.safe=t=>e.check(Sa(t)),e.positive=t=>e.check(zr(0,t)),e.nonnegative=t=>e.check(Br(0,t)),e.negative=t=>e.check(Lr(0,t)),e.nonpositive=t=>e.check(Rr(0,t)),e.multipleOf=(t,n)=>e.check(Vr(t,n)),e.step=(t,n)=>e.check(Vr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function K(e){return jr(ba,e)}var xa=m(`ZodNumberFormat`,(e,t)=>{yn.init(e,t),ba.init(e,t)});function Sa(e){return Mr(xa,e)}var Ca=m(`ZodBoolean`,(e,t)=>{bn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r)});function q(e){return Nr(Ca,e)}var wa=m(`ZodNull`,(e,t)=>{xn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r)});function Ta(e){return Pr(wa,e)}var Ea=m(`ZodUnknown`,(e,t)=>{Sn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function J(){return Fr(Ea)}var Da=m(`ZodNever`,(e,t)=>{Cn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function Oa(e){return Ir(Da,e)}var ka=m(`ZodArray`,(e,t)=>{Tn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(L(t,n)),e.nonempty=t=>e.check(L(1,t)),e.max=(t,n)=>e.check(Hr(t,n)),e.length=(t,n)=>e.check(Ur(t,n)),e.unwrap=()=>e.element});function Y(e,t){return ti(ka,e,t)}var Aa=m(`ZodObject`,(e,t)=>{kn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),v(e,`shape`,()=>t.shape),e.keyof=()=>Q(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:J()}),e.loose=()=>e.clone({...e._zod.def,catchall:J()}),e.strict=()=>e.clone({...e._zod.def,catchall:Oa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>we(e,t),e.safeExtend=t=>Te(e,t),e.merge=t=>Ee(e,t),e.pick=t=>Se(e,t),e.omit=t=>Ce(e,t),e.partial=(...t)=>De(Ha,e,t[0]),e.required=(...t)=>Oe(Qa,e,t[0])});function X(e,t){return new Aa({type:`object`,shape:e??{},...T(t)})}var ja=m(`ZodUnion`,(e,t)=>{jn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.options=t.options});function Ma(e,t){return new ja({type:`union`,options:e,...T(t)})}var Na=m(`ZodDiscriminatedUnion`,(e,t)=>{ja.init(e,t),Mn.init(e,t)});function Pa(e,t,n){return new Na({type:`union`,options:t,discriminator:e,...T(n)})}var Fa=m(`ZodIntersection`,(e,t)=>{Nn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function Ia(e,t){return new Fa({type:`intersection`,left:e,right:t})}var La=m(`ZodRecord`,(e,t)=>{In.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Z(e,t,n){return new La({type:`record`,keyType:e,valueType:t,...T(n)})}var Ra=m(`ZodEnum`,(e,t)=>{Ln.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ra({...t,checks:[],...T(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ra({...t,checks:[],...T(r),entries:i})}});function Q(e,t){return new Ra({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...T(t)})}var za=m(`ZodLiteral`,(e,t)=>{Rn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(e,t){return new za({type:`literal`,values:Array.isArray(e)?e:[e],...T(t)})}var Ba=m(`ZodTransform`,(e,t)=>{zn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new oe(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(A(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(A(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Va(e){return new Ba({type:`transform`,transform:e})}var Ha=m(`ZodOptional`,(e,t)=>{Vn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ua(e){return new Ha({type:`optional`,innerType:e})}var Wa=m(`ZodExactOptional`,(e,t)=>{Hn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ga(e){return new Wa({type:`optional`,innerType:e})}var Ka=m(`ZodNullable`,(e,t)=>{Un.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qa(e){return new Ka({type:`nullable`,innerType:e})}var Ja=m(`ZodDefault`,(e,t)=>{Wn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ya(e,t){return new Ja({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var Xa=m(`ZodPrefault`,(e,t)=>{Kn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e,t){return new Xa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var Qa=m(`ZodNonOptional`,(e,t)=>{qn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e,t){return new Qa({type:`nonoptional`,innerType:e,...T(t)})}var eo=m(`ZodCatch`,(e,t)=>{Yn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function to(e,t){return new eo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var no=m(`ZodPipe`,(e,t)=>{Xn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.in=t.in,e.out=t.out});function ro(e,t){return new no({type:`pipe`,in:e,out:t})}var io=m(`ZodReadonly`,(e,t)=>{Zn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new io({type:`readonly`,innerType:e})}var oo=m(`ZodCustom`,(e,t)=>{$n.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function so(e,t={}){return ni(oo,e,t)}function co(e){return ri(e)}var lo=Q([`idle`,`thinking`,`streaming`,`tool_running`,`awaiting_confirmation`]),uo=Q([`assistant_turn`,`user_turn`,`global`]),fo=Q([`message_dequeued`,`thinking_delta`,`first_text_delta`,`tool_use_start`,`preview_start`,`tool_result_received`,`confirmation_requested`,`confirmation_resolved`,`context_compacting`,`message_complete`,`generation_cancelled`,`error_terminal`]),po=X({type:$(`assistant_activity_state`),conversationId:W(),activityVersion:K(),phase:lo,anchor:uo,reason:fo,requestId:W().optional(),statusText:W().optional()}),mo=X({type:$(`assistant_text_delta`),text:W(),messageId:W().optional(),conversationId:W().optional()}),ho=X({type:$(`assistant_thinking_delta`),thinking:W(),messageId:W().optional(),conversationId:W().optional()}),go=X({type:$(`assistant_turn_start`),messageId:W(),conversationId:W().optional()}),_o=X({type:$(`avatar_updated`),avatarPath:W()}),vo=X({type:$(`compaction_circuit_closed`),conversationId:W()}),yo=X({type:$(`compaction_circuit_open`),conversationId:W(),reason:$(`3_consecutive_failures`),openUntil:K()}),bo=X({label:W(),description:W(),pattern:W()}),xo=X({label:W(),scope:W()}),So=X({label:W(),scope:W()}),Co=X({filePath:W(),oldContent:W(),newContent:W(),isNewFile:q()}),wo=Q([`allow_once`,`allow_always`,`reject_once`,`reject_always`]),To=X({optionId:W(),name:W(),kind:wo}),Eo=Q([`sandbox`,`host`]),Do=X({type:$(`confirmation_request`),requestId:W(),toolName:W(),input:Z(W(),J()),riskLevel:W(),riskReason:W().optional(),isContainerized:q().optional(),executionTarget:Eo.optional(),allowlistOptions:Y(bo),scopeOptions:Y(xo),directoryScopeOptions:Y(So).optional(),diff:Co.optional(),conversationId:W().optional(),persistentDecisionsAllowed:q().optional(),toolUseId:W().optional(),acpToolKind:W().optional(),acpOptions:Y(To).optional()}),Oo=X({type:$(`contact_request`),requestId:W(),channel:W().optional(),placeholder:W().optional(),label:W().optional(),description:W().optional(),role:W().optional()}),ko=Q([`PROVIDER_NETWORK`,`PROVIDER_RATE_LIMIT`,`MANAGED_USAGE_LIMIT`,`PROVIDER_OVERLOADED`,`PROVIDER_API`,`IMAGE_TOO_LARGE`,`PROVIDER_BILLING`,`PROVIDER_ORDERING`,`PROVIDER_WEB_SEARCH`,`PROVIDER_NOT_CONFIGURED`,`PROVIDER_INVALID_KEY`,`MANAGED_KEY_INVALID`,`CONTEXT_TOO_LARGE`,`BUDGET_YIELD_UNRECOVERED`,`MAX_TOKENS_REACHED`,`CONVERSATION_ABORTED`,`CONVERSATION_PROCESSING_FAILED`,`DISK_SPACE_CRITICAL`,`REGENERATE_FAILED`,`UNKNOWN`]),Ao=X({type:$(`conversation_error`),conversationId:W(),code:ko,userMessage:W(),retryable:q(),debugDetails:W().optional(),errorCategory:W().optional(),connectionName:W().optional(),profileName:W().optional()}),jo=Q([`created`,`renamed`,`deleted`,`reordered`,`seen_changed`]),Mo=X({type:$(`conversation_list_invalidated`),reason:jo}),No=X({type:$(`conversation_title_updated`),conversationId:W(),title:W()}),Po=Q([`disabled`,`ok`,`warning`,`critical`,`unknown`]),Fo=Q([`agent-turns`,`background-work`,`remote-ingress`]),Io=X({enabled:q(),state:Po,locked:q(),acknowledged:q(),overrideActive:q(),effectivelyLocked:q(),lockId:W().nullable(),usagePercent:K().nullable(),thresholdPercent:K(),path:W().nullable(),lastCheckedAt:W().nullable(),blockedCapabilities:Y(Fo),error:W().nullable()}),Lo=X({type:$(`disk_pressure_status_changed`),status:Io}),Ro=X({id:W(),surfaceId:W(),author:W(),content:W(),anchorStart:K().optional(),anchorEnd:K().optional(),anchorText:W().optional(),parentCommentId:W().optional(),status:W(),createdAt:K(),updatedAt:K()}),zo=X({type:$(`document_comment_created`),conversationId:W(),surfaceId:W(),comment:Ro}),Bo=X({type:$(`document_comment_deleted`),conversationId:W(),surfaceId:W(),commentId:W()}),Vo=X({type:$(`document_comment_reopened`),conversationId:W(),surfaceId:W(),commentId:W()}),Ho=X({type:$(`document_comment_resolved`),conversationId:W(),surfaceId:W(),commentId:W(),resolvedBy:W()}),Uo=X({type:$(`document_editor_update`),conversationId:W(),surfaceId:W(),markdown:W(),mode:W()}),Wo=X({type:$(`error`),message:W(),code:W().optional(),category:W().optional(),errorCategory:W().optional(),requestId:W().optional(),conversationId:W().optional()}),Go=X({type:$(`generation_cancelled`),conversationId:W().optional()}),Ko=X({id:W().optional(),filename:W(),mimeType:W(),data:W(),sourceType:Q([`sandbox_file`,`host_file`,`tool_block`]).optional(),sizeBytes:K().optional(),thumbnailData:W().optional(),fileBacked:q().optional(),filePath:W().optional()}),qo=X({type:$(`generation_handoff`),conversationId:W().optional(),requestId:W().optional(),queuedCount:K(),messageId:W().optional(),attachments:Y(Ko).optional(),attachmentWarnings:Y(W()).optional()}),Jo=X({type:$(`home_feed_updated`),updatedAt:W(),newItemCount:K()}),Yo=X({type:$(`identity_changed`),name:W(),role:W(),personality:W(),emoji:W(),home:W()}),Xo=Q([`approved`,`rejected`,`answered`,`cancelled`,`superseded`]),Zo=X({type:$(`interaction_resolved`),requestId:W(),conversationId:W(),state:Xo,kind:W()}),Qo=X({type:$(`message_complete`),messageId:W().optional(),conversationId:W().optional(),source:Q([`main`,`aux`]).optional(),attachments:Y(Ko).optional(),attachmentWarnings:Y(W()).optional()}),$o=X({type:$(`message_dequeued`),conversationId:W(),requestId:W()}),es=X({type:$(`message_queued`),conversationId:W(),requestId:W(),position:K()}),ts=X({type:$(`message_queued_deleted`),conversationId:W(),requestId:W()}),ns=X({type:$(`message_request_complete`),conversationId:W(),requestId:W(),runStillActive:q().optional()}),rs=X({type:$(`navigate_settings`),tab:W()}),is=X({type:$(`notification_intent`),sourceEventName:W(),title:W(),body:W(),deliveryId:W().optional(),deepLinkMetadata:Z(W(),J()).optional(),targetGuardianPrincipalId:W().optional(),silent:q().optional()}),as=X({type:$(`open_url`),url:W().min(1),title:W().optional(),conversationId:W().optional()}),os=X({id:W(),label:W(),description:W().optional()}),ss=X({id:W(),question:W(),description:W().optional(),options:Y(os),freeTextPlaceholder:W().optional()}),cs=X({type:$(`question_request`),requestId:W(),questions:Y(ss),question:W(),description:W().optional(),options:Y(os),freeTextPlaceholder:W().optional(),conversationId:W().optional(),toolUseId:W().optional()}),ls=X({type:$(`relationship_state_updated`),updatedAt:W()}),us=X({type:$(`secret_request`),requestId:W(),service:W(),field:W(),label:W(),description:W().optional(),placeholder:W().optional(),conversationId:W().optional(),purpose:W().optional(),allowedTools:Y(W()).optional(),allowedDomains:Y(W()).optional(),allowOneTimeSend:q().optional()}),ds=X({type:W(),content:W().optional(),text:W().optional(),result:W().optional(),input:Z(W(),J()).optional(),toolName:W().optional(),isError:q().optional(),toolUseId:W().optional()}).passthrough(),fs=X({type:$(`subagent_event`),conversationId:W(),subagentId:W(),event:ds}).strict(),ps=X({type:$(`subagent_spawned`),subagentId:W(),parentConversationId:W(),label:W(),objective:W(),isFork:q().optional(),parentToolUseId:W().optional()}).strict(),ms=Q([`pending`,`running`,`awaiting_input`,`completed`,`failed`,`aborted`]),hs=X({inputTokens:K(),outputTokens:K(),estimatedCost:K()}).strict(),gs=X({type:$(`subagent_status_changed`),subagentId:W(),status:ms,error:W().optional(),usage:hs.optional()}).strict(),_s=X({type:$(`sync_changed`),tags:Y(W().min(1)).min(1),originClientId:W().min(1).optional()}),vs=Q([`tool_start`,`tool_complete`,`status`]),ys=X({type:$(`tool_output_chunk`),chunk:W(),conversationId:W().optional(),toolUseId:W().optional(),subType:vs.optional(),subToolName:W().optional(),subToolInput:W().optional(),subToolIsError:q().optional(),subToolId:W().optional(),messageId:W().optional()}),bs=X({pattern:W(),label:W()}),xs=Q([`anthropic-native`,`brave`,`perplexity`,`tavily`]),Ss=X({rank:K(),title:W(),url:W(),domain:W(),faviconUrl:W().optional(),snippet:W().optional(),age:W().optional(),score:K().optional()}),Cs=X({query:W(),provider:xs,resultCount:K(),durationMs:K(),results:Y(Ss),errorMessage:W().optional()}),ws=X({url:W(),finalUrl:W(),status:K(),contentType:W().optional(),byteCount:K(),charCount:K(),truncated:q(),title:W().optional(),domain:W(),faviconUrl:W().optional(),redirectCount:K(),durationMs:K(),errorMessage:W().optional(),mayRequireJavaScript:q().optional()}),Ts=X({webSearch:Cs.optional(),webFetch:ws.optional()}),Es=X({type:$(`tool_result`),toolName:W(),result:W(),isError:q().optional(),diff:Co.optional(),status:W().optional(),conversationId:W().optional(),imageData:W().optional(),imageDataList:Y(W()).optional(),toolUseId:W().optional(),messageId:W().optional(),riskLevel:W().optional(),riskReason:W().optional(),matchedTrustRuleId:W().optional(),isContainerized:q().optional(),riskScopeOptions:Y(bs).optional(),riskAllowlistOptions:Y(bo).optional(),riskDirectoryScopeOptions:Y(So).optional(),approvalMode:W().optional(),approvalReason:W().optional(),riskThreshold:W().optional(),activityMetadata:Ts.optional()}),Ds=X({type:$(`tool_use_preview_start`),toolUseId:W(),toolName:W(),conversationId:W().optional(),messageId:W().optional()}),Os=X({type:$(`tool_use_start`),toolName:W(),input:Z(W(),J()),toolUseId:W().optional(),messageId:W().optional(),conversationId:W().optional()}),ks=Q([`request_received`,`request_queued`,`request_dequeued`,`llm_call_started`,`llm_call_finished`,`assistant_message`,`tool_started`,`tool_permission_requested`,`tool_permission_decided`,`tool_finished`,`tool_failed`,`generation_handoff`,`message_complete`,`generation_cancelled`,`request_error`,`tool_profiling_summary`]),As=Q([`info`,`success`,`warning`,`error`]),js=X({type:$(`trace_event`),eventId:W(),conversationId:W(),requestId:W().optional(),timestampMs:K(),sequence:K(),kind:ks,status:As.optional(),summary:W(),attributes:Z(W(),Ma([W(),K(),q(),Ta()])).optional()}),Ms=X({type:$(`turn_profile_auto_routed`),conversationId:W(),profile:W(),profileLabel:W()}),Ns=X({type:$(`ui_surface_complete`),conversationId:W(),surfaceId:W(),summary:W(),submittedData:Z(W(),J()).optional()}),Ps=X({type:$(`ui_surface_dismiss`),conversationId:W(),surfaceId:W()}),Fs=X({id:W(),label:W(),style:Q([`primary`,`secondary`,`destructive`]).optional(),data:Z(W(),J()).optional()}),Is=X({type:$(`ui_surface_show`),conversationId:W(),surfaceId:W(),surfaceType:W(),title:W().optional(),data:Z(W(),J()),actions:Y(Fs).optional(),display:Q([`inline`,`panel`]).optional(),messageId:W().optional(),persistent:q().optional(),toolCallId:W().optional()}),Ls=X({type:$(`ui_surface_update`),conversationId:W(),surfaceId:W(),data:Z(W(),J())}),Rs=X({type:$(`usage_update`),conversationId:W(),inputTokens:K(),outputTokens:K(),totalInputTokens:K(),totalOutputTokens:K(),estimatedCost:K(),model:W(),contextWindowTokens:K().optional(),contextWindowMaxTokens:K().optional()}),zs=X({type:$(`user_message_echo`),text:W(),conversationId:W().optional(),messageId:W().optional(),requestId:W().optional(),clientMessageId:W().optional()}).strict(),Bs=`syntheticAgentErrorMessage`,Vs=X({cursorInTextField:q().optional().describe(`Whether the cursor is in an editable text field when dictation started`)}).passthrough().describe(`Dictation context (app name, window title, bundle ID, cursor state, selected text)`),Hs=X({transcription:W().describe(`Raw speech transcription`),context:Vs,profileId:W().describe(`Optional dictation profile ID`).optional()}),Us=X({id:W(),filename:W(),mimeType:W(),sizeBytes:K(),kind:W(),data:W().optional(),thumbnailData:W().optional(),fileBacked:q().optional()}),Ws=X({pattern:W(),label:W()}),Gs=X({label:W(),description:W(),pattern:W()}),Ks=X({scope:W(),label:W()}),qs=X({requestId:W(),title:W().optional(),description:W().optional(),toolName:W().optional(),riskLevel:W().optional(),riskReason:W().optional(),input:Z(W(),J()).optional(),allowlistOptions:Y(bo).optional(),scopeOptions:Y(xo).optional(),directoryScopeOptions:Y(So).optional(),persistentDecisionsAllowed:q().optional()}),Js=Q([`approved`,`denied`,`timed_out`]),Ys=X({id:W().optional(),name:W(),input:Z(W(),J()),result:W().optional(),isError:q().optional(),imageData:W().optional(),imageDataList:Y(W()).optional(),startedAt:K().optional(),completedAt:K().optional(),confirmationDecision:Js.optional(),confirmationLabel:W().optional(),riskLevel:W().optional(),riskReason:W().optional(),matchedTrustRuleId:W().optional(),autoApproved:q().optional(),approvalMode:W().optional(),approvalReason:W().optional(),riskThreshold:W().optional(),riskScopeOptions:Y(Ws).optional(),riskAllowlistOptions:Y(Gs).optional(),riskDirectoryScopeOptions:Y(Ks).optional(),activityMetadata:Ts.optional(),scopeOptions:Y(xo).optional(),pendingConfirmation:qs.optional()}),Xs=X({id:W(),label:W(),style:W().optional(),data:Z(W(),J()).optional()}),Zs=X({surfaceId:W(),surfaceType:W(),title:W().optional(),data:Z(W(),J()),actions:Y(Xs).optional(),display:W().optional(),persistent:q().optional(),completed:q().optional(),completionSummary:W().optional(),toolCallId:W().optional()}),Qs=X({subagentId:W(),label:W(),status:W(),error:W().optional(),conversationId:W().optional(),objective:W().optional()}),$s=X({appUrl:W().optional(),webUrl:W().optional()}),ec=X({channelId:W(),channelName:W().optional(),channelTs:W(),threadTs:W().optional(),sender:X({displayName:W().optional(),externalUserId:W().optional()}).optional(),messageLink:$s.optional(),threadLink:$s.optional()}),tc=Pa(`type`,[X({type:$(`text`),text:W()}),X({type:$(`thinking`),thinking:W()}),X({type:$(`tool_use`),toolCall:Ys}),X({type:$(`surface`),surface:Zs}),X({type:$(`attachment`),attachment:Us})]),nc=X({id:W(),mergedMessageIds:Y(W()).optional(),clientMessageId:W().optional(),role:Q([`user`,`assistant`]),content:W().optional(),timestamp:W(),attachments:Y(Us),toolCalls:Y(Ys).optional(),surfaces:Y(Zs).optional(),textSegments:Y(W()).optional(),thinkingSegments:Y(W()).optional(),contentOrder:Y(W()).optional(),contentBlocks:Y(tc).optional(),subagentNotification:Qs.optional(),slackMessage:ec.optional()}),rc=X({status:Io}),ic=$(`notification`),ac=Q([`new`,`seen`,`acted_on`,`dismissed`]),oc=Q([`low`,`medium`,`high`,`critical`]),sc=Q([`security`,`scheduling`,`background`,`email`,`system`]),cc=X({id:W(),label:W(),prompt:W()}),lc=Q([`emailDraft`,`documentPreview`,`permissionChat`,`paymentAuth`,`toolPermission`,`updatesList`]),uc=X({kind:lc}),dc=X({id:W(),type:ic,priority:K().int().min(0).max(100),title:W().optional(),summary:W(),timestamp:W(),status:ac.default(`new`),expiresAt:W().optional(),actions:Y(cc).optional(),urgency:oc.optional(),conversationId:W().optional(),detailPanel:uc.optional(),category:sc.optional(),noteworthy:q().optional(),fromAssistant:q().optional(),metadata:Z(W(),J()).optional(),createdAt:W()}),fc=Q([`deterministic`,`assistant`]),pc=X({id:W(),label:W(),icon:W().optional(),prompt:W(),source:fc}),mc=X({greeting:W(),timeAwayLabel:W(),newCount:K().int().min(0)}),hc=X({items:Y(dc),updatedAt:W(),contextBanner:mc,suggestedPrompts:Y(pc)}),gc=X({id:W(),category:Q([`voice`,`world`,`priorities`]),text:W(),confidence:Q([`strong`,`uncertain`]),source:Q([`onboarding`,`inferred`])}),_c=X({id:W(),name:W(),description:W(),tier:Q([`unlocked`,`next-up`,`earned`]),gate:W(),unlockHint:W().optional(),ctaLabel:W().optional()}),vc=X({version:$(1),assistantId:W(),tier:Ma([$(1),$(2),$(3),$(4)]),progressPercent:K(),facts:Y(gc),capabilities:Y(_c),conversationCount:K(),hatchedDate:W(),assistantName:W(),userName:W().optional(),updatedAt:W()}),yc=X({provider:W().nullish(),model:W().nullish(),status:W().nullish(),inputTokens:K().nullish(),outputTokens:K().nullish(),cacheCreationInputTokens:K().nullish(),cacheReadInputTokens:K().nullish(),stopReason:W().nullish(),requestMessageCount:K().nullish(),requestToolCount:K().nullish(),responseMessageCount:K().nullish(),responseToolCallCount:K().nullish(),responsePreview:W().nullish(),toolCallNames:Y(W()).nullish(),estimatedCostUsd:K().nullish(),durationMs:K().nullish()}),bc=X({kind:W(),label:W().nullish(),role:W().nullish(),text:W().nullish(),toolName:W().nullish(),data:J().optional(),language:W().nullish()}),xc=X({id:W(),createdAt:K(),requestPayload:Ta(),responsePayload:Ta(),provider:W().nullish(),summary:yc.nullish(),requestSections:Y(bc).nullish(),responseSections:Y(bc).nullish(),agentLoopExitReason:W().nullish(),callSite:W().nullish()}),Sc=X({nodeId:W(),score:K(),semanticSimilarity:K(),recencyBoost:K(),type:W().optional()}),Cc=X({reason:W(),semanticUnavailable:q(),fallbackSources:Y(W())}),wc=X({enabled:q(),degraded:q(),provider:W().nullable(),model:W().nullable(),degradation:Cc.nullable(),semanticHits:K().nullish(),mergedCount:K().nullish(),selectedCount:K().nullish(),tier1Count:K().nullish(),tier2Count:K().nullish(),hybridSearchLatencyMs:K().nullish(),sparseVectorUsed:q().nullish(),injectedTokens:K().nullish(),latencyMs:K().nullish(),topCandidates:Y(Sc),injectedText:W().nullable(),reason:W().nullable(),queryContext:W().nullable()}),Tc=X({slug:W(),finalActivation:K(),ownActivation:K(),priorActivation:K(),simUser:K(),simAssistant:K(),simNow:K(),simUserRerankBoost:K().optional(),simAssistantRerankBoost:K().optional(),inRerankPool:q().optional(),spreadContribution:K(),source:W(),status:W()}),Ec=X({d:K(),c_user:K(),c_assistant:K(),c_now:K(),k:K(),hops:K(),top_k:K(),epsilon:K()}),Dc=X({turn:K(),mode:W(),concepts:Y(Tc),config:Ec}),Oc=X({slug:W(),source:W(),pinned:q()}),kc=X({turn:K(),live:q(),shadow:q(),selections:Y(Oc),injectedText:W()}),Ac=X({messageId:W().nullish(),conversationKey:W().nullish(),conversationId:W().nullish(),conversationKind:W(),conversationTotalEstimatedCostUsd:K().nullish(),logs:Y(xc),memoryRecall:wc.nullable(),memoryV2Activation:Dc.nullable(),memoryV3Selection:kc.nullish()}),jc=X({type:W(),content:W(),toolName:W().optional(),isError:q().optional(),messageId:W().optional()}),Mc=X({subagentId:W(),objective:W().optional(),status:ms.optional(),usage:hs.optional(),events:Y(jc)}),Nc=e({ACPOptionKindSchema:()=>wo,ACPOptionSchema:()=>To,AllowlistOptionSchema:()=>bo,AssistantActivityAnchorSchema:()=>uo,AssistantActivityPhaseSchema:()=>lo,AssistantActivityReasonSchema:()=>fo,AssistantActivityStateEventSchema:()=>po,AssistantEventEnvelopeSchema:()=>Fc,AssistantEventSchema:()=>Pc,AssistantOutboundAttachmentSchema:()=>Ko,AssistantTextDeltaEventSchema:()=>mo,AssistantThinkingDeltaEventSchema:()=>ho,AssistantTurnStartEventSchema:()=>go,AvatarUpdatedEventSchema:()=>_o,CALL_SITE_SYNTHETIC_AGENT_ERROR_MESSAGE:()=>Bs,CapabilitySchema:()=>_c,CompactionCircuitClosedEventSchema:()=>vo,CompactionCircuitOpenEventSchema:()=>yo,ConfirmationDiffSchema:()=>Co,ConfirmationExecutionTargetSchema:()=>Eo,ConfirmationRequestEventSchema:()=>Do,ContactRequestEventSchema:()=>Oo,ContextBannerSchema:()=>mc,ConversationContentBlockSchema:()=>tc,ConversationErrorCodeSchema:()=>ko,ConversationErrorEventSchema:()=>Ao,ConversationListInvalidatedEventSchema:()=>Mo,ConversationListInvalidatedReasonSchema:()=>jo,ConversationMessageAttachmentSchema:()=>Us,ConversationMessageSchema:()=>nc,ConversationMessageSurfaceSchema:()=>Zs,ConversationMessageToolCallSchema:()=>Ys,ConversationSlackMessageSchema:()=>ec,ConversationSubagentNotificationSchema:()=>Qs,ConversationTitleUpdatedEventSchema:()=>No,DEFAULT_TOOL_EXECUTION_TIMEOUT_SEC:()=>120,DictationContextSchema:()=>Vs,DictationRequestSchema:()=>Hs,DirectoryScopeOptionSchema:()=>So,DiskPressureBlockedCapabilitySchema:()=>Fo,DiskPressureStateSchema:()=>Po,DiskPressureStatusChangedEventSchema:()=>Lo,DiskPressureStatusResponseSchema:()=>rc,DiskPressureStatusSchema:()=>Io,DocumentCommentCreatedEventSchema:()=>zo,DocumentCommentDeletedEventSchema:()=>Bo,DocumentCommentReopenedEventSchema:()=>Vo,DocumentCommentResolvedEventSchema:()=>Ho,DocumentEditorUpdateEventSchema:()=>Uo,ErrorEventSchema:()=>Wo,FactSchema:()=>gc,FeedActionSchema:()=>cc,FeedItemCategorySchema:()=>sc,FeedItemDetailPanelKindSchema:()=>lc,FeedItemDetailPanelSchema:()=>uc,FeedItemSchema:()=>dc,FeedItemStatusSchema:()=>ac,FeedItemTypeSchema:()=>ic,FeedItemUrgencySchema:()=>oc,GenerationCancelledEventSchema:()=>Go,GenerationHandoffEventSchema:()=>qo,HomeFeedResponseSchema:()=>hc,HomeFeedUpdatedEventSchema:()=>Jo,IdentityChangedEventSchema:()=>Yo,InteractionResolutionStateSchema:()=>Xo,InteractionResolvedEventSchema:()=>Zo,LLMCallSummarySchema:()=>yc,LLMContextSectionSchema:()=>bc,LLMRequestLogEntrySchema:()=>xc,LlmContextResponseSchema:()=>Ac,MemoryCandidateSchema:()=>Sc,MemoryDegradationSchema:()=>Cc,MemoryRecallLogSchema:()=>wc,MemoryV2ActivationLogSchema:()=>Dc,MemoryV2ConceptRowSchema:()=>Tc,MemoryV2ConfigSnapshotSchema:()=>Ec,MemoryV3SelectionLogSchema:()=>kc,MemoryV3SelectionRowSchema:()=>Oc,MessageCompleteEventSchema:()=>Qo,MessageDequeuedEventSchema:()=>$o,MessageQueuedDeletedEventSchema:()=>ts,MessageQueuedEventSchema:()=>es,MessageRequestCompleteEventSchema:()=>ns,NavigateSettingsEventSchema:()=>rs,NotificationIntentEventSchema:()=>is,OpenUrlEventSchema:()=>as,PendingToolConfirmationSchema:()=>qs,QuestionEntrySchema:()=>ss,QuestionOptionSchema:()=>os,QuestionRequestEventSchema:()=>cs,RelationshipStateSchema:()=>vc,RelationshipStateUpdatedEventSchema:()=>ls,RiskScopeOptionSchema:()=>bs,ScopeOptionSchema:()=>xo,SecretRequestEventSchema:()=>us,SubagentDetailEventSchema:()=>jc,SubagentDetailResponseSchema:()=>Mc,SubagentEventEventSchema:()=>fs,SubagentInnerEventSchema:()=>ds,SubagentSpawnedEventSchema:()=>ps,SubagentStatusChangedEventSchema:()=>gs,SubagentStatusSchema:()=>ms,SubagentUsageStatsSchema:()=>hs,SuggestedPromptSchema:()=>pc,SuggestedPromptSourceSchema:()=>fc,SurfaceActionSchema:()=>Fs,SyncChangedEventSchema:()=>_s,ToolActivityMetadataSchema:()=>Ts,ToolOutputChunkEventSchema:()=>ys,ToolOutputChunkSubTypeSchema:()=>vs,ToolResultEventSchema:()=>Es,ToolUsePreviewStartEventSchema:()=>Ds,ToolUseStartEventSchema:()=>Os,TraceEventKindSchema:()=>ks,TraceEventSchema:()=>js,TraceEventStatusSchema:()=>As,TurnProfileAutoRoutedEventSchema:()=>Ms,UISurfaceCompleteEventSchema:()=>Ns,UISurfaceDismissEventSchema:()=>Ps,UISurfaceShowEventSchema:()=>Is,UISurfaceUpdateEventSchema:()=>Ls,UsageUpdateEventSchema:()=>Rs,UserMessageEchoEventSchema:()=>zs,WebFetchMetadataSchema:()=>ws,WebSearchMetadataSchema:()=>Cs,WebSearchProviderIdSchema:()=>xs,WebSearchResultItemSchema:()=>Ss}),Pc=Pa(`type`,[po,mo,ho,go,_o,vo,yo,Do,Oo,Ao,Mo,No,Lo,zo,Bo,Vo,Ho,Uo,Wo,Go,qo,Jo,Yo,Zo,Qo,$o,es,ts,ns,rs,is,as,cs,ls,us,fs,ps,gs,_s,ys,Es,Ds,Os,js,Ms,Ns,Ps,Is,Ls,Rs,zs]),Fc=X({id:W(),conversationId:W().optional(),seq:K().int().optional(),emittedAt:W(),message:Pc});async function Ic(e,t){let{data:n,error:r,response:i}=await ne({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return d(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:u(r,i)}}async function Lc(e){if(t()){let e=r();if(e)return{ok:!0,status:200,data:{id:e.assistantId,name:e.name??e.assistantId,status:`active`,is_local:!0,created:e.hatchedAt??``}}}if(e){let{data:t,error:n,response:r}=await ee({path:{id:e},throwOnError:!1});return d(r,n,`Failed to get assistant.`),r.ok?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:u(n,r)}}let n=await ae({query:{hosting:`platform`},throwOnError:!1});if(d(n.response,n.error,`Failed to get assistant.`),!n.response.ok)return{ok:!1,status:n.response.status,error:u(n.error,n.response)};let i=n.data?.results??[];if(i.length>0)return{ok:!0,status:n.response.status,data:i[0]};let a=await ae({query:{hosting:`local`},throwOnError:!1});if(d(a.response,a.error,`Failed to get assistant.`),a.response.ok){let e=a.data?.results??[];if(e.length>0)return{ok:!0,status:a.response.status,data:e[0]}}return a.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:a.response.status,error:u(a.error,a.response)}}async function Rc(e){let{data:t,error:n,response:r}=await s({path:{assistant_id:e},throwOnError:!1});return d(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:u(n,r)}}async function zc(e){let{data:t,error:n,response:r}=await i({path:{assistant_id:e},throwOnError:!1});if(d(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=rc.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:u(e.error.message,r)}}return{ok:!1,status:r.status,error:u(n,r)}}async function Bc(e){let{data:t,error:n,response:r}=await a({path:{assistant_id:e},throwOnError:!1});if(d(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=rc.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:u(e.error.message,r)}}return{ok:!1,status:r.status,error:u(n,r)}}function Vc(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function Hc(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function Uc(e){let t=!n(),[r,i]=await Promise.all([c({path:{assistant_id:e},throwOnError:!1}),t?ie({path:{assistant_id:e},throwOnError:!1}):null]);if(d(r.response,r.error,`Failed to list assistant backups.`),!r.response.ok)return{ok:!1,status:r.response.status,error:u(r.error,r.response)};let a=Vc(r.data);if(i){if(i.response?.ok){let e=Hc(i.data);return{ok:!0,status:r.response.status,data:[...e,...a]}}if(a.length===0&&i.response)return{ok:!1,status:i.response.status,error:u(i.error,i.response)}}return{ok:!0,status:r.response.status,data:a}}async function Wc(e){let{data:t,error:r,response:i}=n()?await l({path:{assistant_id:e},throwOnError:!1}):await re({path:{assistant_id:e},throwOnError:!1});if(d(i,r,`Failed to create assistant backup.`),i.ok){let e=t&&typeof t==`object`&&!Array.isArray(t)?t:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:u(r,i)}}async function Gc(e,t){let{data:r,error:i,response:a}=n()?await o({path:{assistant_id:e},body:{path:t.path??t.snapshot_name},throwOnError:!1}):await te({path:{assistant_id:e,snapshot_name:t.snapshot_name},throwOnError:!1});if(d(a,i,`Failed to restore assistant backup.`),a.ok){let e=r&&typeof r==`object`&&!Array.isArray(r)?r:{};return{ok:!0,status:a.status,data:e}}return{ok:!1,status:a.status,error:u(i,a)}}async function Kc(e){let{data:t,error:n,response:r}=await f({path:{id:e},throwOnError:!1});return d(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:u(n,r)}}async function qc(e){let{error:t,response:n}=await p({path:{id:e},throwOnError:!1});return d(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:u(t,n)}}async function Jc(){let{data:e,error:t,response:n}=await ae({query:{hosting:`all`},throwOnError:!1});return d(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:u(t,n)}}export{Rc as a,Jc as c,qc as d,Fc as f,Bs as g,Mc as h,zc as i,Kc as l,Nc as m,Wc as n,Ic as o,Pc as p,Lc as r,Uc as s,Bc as t,Gc as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,m as r}from"./chunk-5KNZJZUH-BpLAEZ0-.js";import{t as i}from"./jsx-runtime-XSukodg_.js";import{t as a}from"./button-Cs9tc8OR.js";import{t as o}from"./dropdown-PPtOL9bp.js";import{t as s}from"./input-DwAJUlac.js";import{i as c}from"./routes-C-DwSCj0.js";import{t as l}from"./onboarding-layout-DMOume9Z.js";import{n as u,r as d}from"./provider-key-DiyETKhK.js";var f=e(t(),1),p=[{id:`anthropic`,displayName:`Anthropic`,apiKeyPlaceholder:`sk-ant-api03-...`,docsUrl:`https://console.anthropic.com/settings/keys`,requiresKey:!0},{id:`openai`,displayName:`OpenAI`,apiKeyPlaceholder:`sk-proj-...`,docsUrl:`https://platform.openai.com/api-keys`,requiresKey:!0},{id:`gemini`,displayName:`Google Gemini`,apiKeyPlaceholder:`AIza...`,docsUrl:`https://aistudio.google.com/apikey`,requiresKey:!0},{id:`ollama`,displayName:`Ollama`,apiKeyPlaceholder:null,docsUrl:`https://ollama.com/download`,requiresKey:!1},{id:`fireworks`,displayName:`Fireworks`,apiKeyPlaceholder:`fw_...`,docsUrl:`https://fireworks.ai/account/api-keys`,requiresKey:!0},{id:`openrouter`,displayName:`OpenRouter`,apiKeyPlaceholder:`sk-or-v1-...`,docsUrl:`https://openrouter.ai/keys`,requiresKey:!0},{id:`openai-compatible`,displayName:`OpenAI-compatible`,apiKeyPlaceholder:`Your provider's API key`,docsUrl:null,requiresKey:!0}],m=p[0];function h(e){return p.find(t=>t.id===e)}var g=i();function _(){let e=n(),[t]=r(),i=t.get(`hosting`),[_,v]=(0,f.useState)(()=>u()?.provider??m.id),[y,b]=(0,f.useState)(()=>u()?.key??``),x=h(_)??m,S=x.requiresKey,C=!S||y.trim().length>0;return(0,g.jsx)(l,{children:(0,g.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center px-6 py-16 text-[var(--content-default)]`,children:[(0,g.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,g.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Enter an API key to connect your model provider.`}),(0,g.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-4`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,g.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,g.jsx)(o,{"aria-label":`Provider`,value:_,onChange:e=>{let t=h(e);t&&(v(t.id),b(``))},options:p.map(e=>({value:e.id,label:e.displayName}))})]}),S&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,g.jsx)(s,{type:`password`,label:`${x.displayName} API Key`,placeholder:x.apiKeyPlaceholder??`Enter your API key`,value:y,onChange:e=>b(e.target.value),fullWidth:!0}),x.docsUrl&&(0,g.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,g.jsx)(`a`,{href:x.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,g.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,g.jsx)(a,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!C,onClick:()=>{C&&(d({provider:_,key:S?y.trim():``}),e(i?`${c.onboarding.privacy}?hosting=${i}`:c.onboarding.privacy))},className:`h-11 text-base`,children:`Continue`}),(0,g.jsx)(a,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(c.onboarding.hosting)},className:`h-11 text-base`,children:`Back`})]})]})})}export{_ as ApiKeyScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,m as r}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./button-DdEh-9f_.js";import{t as o}from"./dropdown-CocFV5yi.js";import{t as s}from"./input-Cu3PPVCq.js";import{i as c}from"./routes-DminYfDX.js";import{t as l}from"./onboarding-layout-CAwJlju5.js";import{n as u,r as d}from"./provider-key-BittA9TY.js";var f=e(t(),1),p=[{id:`anthropic`,displayName:`Anthropic`,apiKeyPlaceholder:`sk-ant-api03-...`,docsUrl:`https://console.anthropic.com/settings/keys`,requiresKey:!0},{id:`openai`,displayName:`OpenAI`,apiKeyPlaceholder:`sk-proj-...`,docsUrl:`https://platform.openai.com/api-keys`,requiresKey:!0},{id:`gemini`,displayName:`Google Gemini`,apiKeyPlaceholder:`AIza...`,docsUrl:`https://aistudio.google.com/apikey`,requiresKey:!0},{id:`ollama`,displayName:`Ollama`,apiKeyPlaceholder:null,docsUrl:`https://ollama.com/download`,requiresKey:!1},{id:`fireworks`,displayName:`Fireworks`,apiKeyPlaceholder:`fw_...`,docsUrl:`https://fireworks.ai/account/api-keys`,requiresKey:!0},{id:`openrouter`,displayName:`OpenRouter`,apiKeyPlaceholder:`sk-or-v1-...`,docsUrl:`https://openrouter.ai/keys`,requiresKey:!0},{id:`openai-compatible`,displayName:`OpenAI-compatible`,apiKeyPlaceholder:`Your provider's API key`,docsUrl:null,requiresKey:!0}],m=p[0];function h(e){return p.find(t=>t.id===e)}var g=i();function _(){let e=n(),[t]=r(),i=t.get(`hosting`),[_,v]=(0,f.useState)(()=>u()?.provider??m.id),[y,b]=(0,f.useState)(()=>u()?.key??``),x=h(_)??m,S=x.requiresKey,C=!S||y.trim().length>0;return(0,g.jsx)(l,{children:(0,g.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center px-6 py-16 text-[var(--content-default)]`,children:[(0,g.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,g.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Enter an API key to connect your model provider.`}),(0,g.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-4`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,g.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,g.jsx)(o,{"aria-label":`Provider`,value:_,onChange:e=>{let t=h(e);t&&(v(t.id),b(``))},options:p.map(e=>({value:e.id,label:e.displayName}))})]}),S&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,g.jsx)(s,{type:`password`,label:`${x.displayName} API Key`,placeholder:x.apiKeyPlaceholder??`Enter your API key`,value:y,onChange:e=>b(e.target.value),fullWidth:!0}),x.docsUrl&&(0,g.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,g.jsx)(`a`,{href:x.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,g.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,g.jsx)(a,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!C,onClick:()=>{C&&(d({provider:_,key:S?y.trim():``}),e(i?`${c.onboarding.privacy}?hosting=${i}`:c.onboarding.privacy))},className:`h-11 text-base`,children:`Continue`}),(0,g.jsx)(a,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(c.onboarding.hosting)},className:`h-11 text-base`,children:`Back`})]})]})})}export{_ as ApiKeyScreen};
@@ -1 +1 @@
1
- import{n as e}from"./sdk.gen-up8j0_uF.js";var t=new Map;function n(e,t){return`${e}::${t}`}function r(r,i){let a=n(r,i),o=t.get(a);return o??(o=e({path:{assistant_id:r,id:i},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw t.delete(a),e}),t.set(a,o)),o}function i(e,r,i){t.set(n(e,r),Promise.resolve(i))}function a(e,r){t.delete(n(e,r))}export{r as n,i as r,a as t};
1
+ import{n as e}from"./sdk.gen-govMfbgX.js";var t=new Map;function n(e,t){return`${e}::${t}`}function r(r,i){let a=n(r,i),o=t.get(a);return o??(o=e({path:{assistant_id:r,id:i},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw t.delete(a),e}),t.set(a,o)),o}function i(e,r,i){t.set(n(e,r),Promise.resolve(i))}function a(e,r){t.delete(n(e,r))}export{r as n,i as r,a as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-D8wUFCt3.js";var t=e(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-BjZY5k1w.js";var t=e(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]);export{t};