@xopcai/xopc 0.0.420 → 0.0.421

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 (324) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-DnqOM8GN.js → activity-store-CKrylgib.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-1UABT2KS.js → agent-avatar-dicebear-Dv5Rda4y.js} +1 -1
  5. package/dist/gateway/static/root/assets/agent-avatar-display-B1ycycx2.js +2 -0
  6. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D285zy0S.js +1 -0
  7. package/dist/gateway/static/root/assets/agent-plugin-dialog-D3yCqVan.js +1 -0
  8. package/dist/gateway/static/root/assets/{agents-O7mago-m.js → agents-DyAuR3rG.js} +5 -5
  9. package/dist/gateway/static/root/assets/{agents-admin-api-CyjykMEh.js → agents-admin-api-CASGzvkW.js} +1 -1
  10. package/dist/gateway/static/root/assets/{api-C1dxxDZx.js → api-C4LxuNzq.js} +1 -1
  11. package/dist/gateway/static/root/assets/{api-Ddrs70xV.js → api-Uk05lF9i.js} +1 -1
  12. package/dist/gateway/static/root/assets/app-management-settings-panel-CDnZNKHt.js +1 -0
  13. package/dist/gateway/static/root/assets/appearance-settings-CmCF7PZ5.js +1 -0
  14. package/dist/gateway/static/root/assets/apps-page-BR9qoA2P.js +1 -0
  15. package/dist/gateway/static/root/assets/{archive-plugin-n5lPr79c.js → archive-plugin-nuHYYVty.js} +1 -1
  16. package/dist/gateway/static/root/assets/automation-api-DtJfd1QM.js +1 -0
  17. package/dist/gateway/static/root/assets/automation-display-BlGt8MAC.js +2 -0
  18. package/dist/gateway/static/root/assets/automation-task-card-Cp3RIw5d.js +2 -0
  19. package/dist/gateway/static/root/assets/{automations-page-oLsNzu_6.js → automations-page-DM4IdUJh.js} +1 -1
  20. package/dist/gateway/static/root/assets/automations-workspace-CXLu04I-.js +9 -0
  21. package/dist/gateway/static/root/assets/{binary-plugins-D9VW7dWP.js → binary-plugins-CHCAr8jt.js} +1 -1
  22. package/dist/gateway/static/root/assets/{block-editor-C477bTtO.js → block-editor-B0v8KxsO.js} +4 -4
  23. package/dist/gateway/static/root/assets/{browser-automation-inputs-CCiYXxmh.js → browser-automation-inputs-DjUW7PEB.js} +1 -1
  24. package/dist/gateway/static/root/assets/browser-automations-page-Cf8AoQz1.js +3 -0
  25. package/dist/gateway/static/root/assets/{browser-control-api-Y3fvmeBk.js → browser-control-api-C6NZgaA1.js} +1 -1
  26. package/dist/gateway/static/root/assets/{browser-settings-page-DjkGahlz.js → browser-settings-page-DV2FNEDf.js} +2 -2
  27. package/dist/gateway/static/root/assets/{capabilities-DAyA681v.js → capabilities-CwdjWz2r.js} +1 -1
  28. package/dist/gateway/static/root/assets/{capabilities-DRVXLssH.js → capabilities-D0-HCZ5J.js} +1 -1
  29. package/dist/gateway/static/root/assets/capabilities-page-DwDkritH.js +2 -0
  30. package/dist/gateway/static/root/assets/capabilities-settings-panel-mme16Fbp.js +8 -0
  31. package/dist/gateway/static/root/assets/channels-lKFLu8p-.js +1 -0
  32. package/dist/gateway/static/root/assets/{chat-agents-api-D5nR_JVe.js → chat-agents-api-l80cvSac.js} +1 -1
  33. package/dist/gateway/static/root/assets/{chat-chart-block-K2t333qv.js → chat-chart-block-BwP5QXEk.js} +1 -1
  34. package/dist/gateway/static/root/assets/chat-page-CT3K7lFT.js +71 -0
  35. package/dist/gateway/static/root/assets/{chat-terminal-dock-CkFG6mA3.js → chat-terminal-dock-D2bV9YUL.js} +2 -2
  36. package/dist/gateway/static/root/assets/{list-filter-COkzTdOz.js → clipboard-copy-DuJk5WD6.js} +1 -1
  37. package/dist/gateway/static/root/assets/{command-palette-api-Do_66X1B.js → command-palette-api-CtapG8ck.js} +1 -1
  38. package/dist/gateway/static/root/assets/composer-payload-handoff-DYuhKZRC.js +1 -0
  39. package/dist/gateway/static/root/assets/{computer-settings-page-DBxOcMko.js → computer-settings-page-DZtMuihL.js} +1 -1
  40. package/dist/gateway/static/root/assets/connected-providers-grid-BQH5k3iC.js +1 -0
  41. package/dist/gateway/static/root/assets/{connector-service-page-rWpnchb3.js → connector-service-page-DrvFdP3G.js} +1 -1
  42. package/dist/gateway/static/root/assets/{connectors-api-DIBG72k4.js → connectors-api-BzkgVBYC.js} +1 -1
  43. package/dist/gateway/static/root/assets/connectors-page-BtRNVCFy.js +1 -0
  44. package/dist/gateway/static/root/assets/{date-picker-CE-cZFCU.js → date-picker-ByTasrfl.js} +1 -1
  45. package/dist/gateway/static/root/assets/{dependency-picker-7SpSfDSg.js → dependency-picker-Dh8hPmsT.js} +1 -1
  46. package/dist/gateway/static/root/assets/desktop-pet-CFz8bqyI.js +1 -0
  47. package/dist/gateway/static/root/assets/desktop-pet-settings-COaboNn1.js +1 -0
  48. package/dist/gateway/static/root/assets/{dev-view-store-57HgVuZ6.js → dev-view-store-D8XYHVqG.js} +1 -1
  49. package/dist/gateway/static/root/assets/device-pairing-wizard-BKMpLdIA.js +1 -0
  50. package/dist/gateway/static/root/assets/{directory-picker-path-field-D4jMhpka.js → directory-picker-path-field-Cjv7rdo3.js} +1 -1
  51. package/dist/gateway/static/root/assets/discussion-annotation-sync-YvlVw17j.js +1 -0
  52. package/dist/gateway/static/root/assets/{dist-DNCdG_qB.js → dist-D3lWNSe7.js} +1 -1
  53. package/dist/gateway/static/root/assets/{extension-debug-page-BsK2LMXQ.js → extension-debug-page-CXx3m5-B.js} +1 -1
  54. package/dist/gateway/static/root/assets/extension-iframe-host-CnOdNwbo.js +1 -0
  55. package/dist/gateway/static/root/assets/{extension-marketplace-api-CVJPqJOB.js → extension-marketplace-api-BABmUY2s.js} +1 -1
  56. package/dist/gateway/static/root/assets/extension-page-C1nGr4DD.js +1 -0
  57. package/dist/gateway/static/root/assets/{extension-provider-Byrd8Sor.js → extension-provider-BA0Y2Rvs.js} +1 -1
  58. package/dist/gateway/static/root/assets/extension-settings-page-QIPI8e7k.js +1 -0
  59. package/dist/gateway/static/root/assets/{file-preview-surface-BlprUrIs.js → file-preview-surface-BsB7bnFH.js} +1 -1
  60. package/dist/gateway/static/root/assets/{gateway-config-swr-BAmUhiP1.js → gateway-config-swr-Bt8w0Iio.js} +1 -1
  61. package/dist/gateway/static/root/assets/{gateway-realtime-CsykKL4l.js → gateway-realtime-CyCCNUxm.js} +1 -1
  62. package/dist/gateway/static/root/assets/gateway-realtime-store-0gmDfPeP.js +1 -0
  63. package/dist/gateway/static/root/assets/gateway-restart-Ty4AzDxa.js +1 -0
  64. package/dist/gateway/static/root/assets/{gateway-settings-BA5-Uuwx.js → gateway-settings-BvKq7vuz.js} +1 -1
  65. package/dist/gateway/static/root/assets/{gateway-startup-retry-CtUB3g6N.js → gateway-startup-retry-N3k-C7c2.js} +1 -1
  66. package/dist/gateway/static/root/assets/{global-defaults-api-CINf-C6a.js → global-defaults-api-D8EB2vfY.js} +1 -1
  67. package/dist/gateway/static/root/assets/home-page-eRuAzi58.js +2 -0
  68. package/dist/gateway/static/root/assets/image-generation-api-C99Fsofm.js +1 -0
  69. package/dist/gateway/static/root/assets/{imports-page-BWShtGRQ.js → imports-page-Cp9RquVb.js} +1 -1
  70. package/dist/gateway/static/root/assets/index-6vVrWfwM.js +11 -0
  71. package/dist/gateway/static/root/assets/index-DDGK6klk.css +1 -0
  72. package/dist/gateway/static/root/assets/install-connector-dialog-CsoAidXp.js +1 -0
  73. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CdM4BQwp.js → keyboard-shortcuts-settings-DFhOP2aD.js} +1 -1
  74. package/dist/gateway/static/root/assets/list-filter-CIPvpfLA.js +1 -0
  75. package/dist/gateway/static/root/assets/local-app-workbench-page-DbtU_A-l.js +1 -0
  76. package/dist/gateway/static/root/assets/{local-apps-page-CxyRVfjD.js → local-apps-page-rjhHfLpe.js} +1 -1
  77. package/dist/gateway/static/root/assets/{local-session-drafts-B9ZPwotC.js → local-session-drafts-DHM4vWDO.js} +1 -1
  78. package/dist/gateway/static/root/assets/{locale-store-lIXD1FMw.js → locale-store-5Hf8J8-_.js} +1 -1
  79. package/dist/gateway/static/root/assets/logs-page-Dx_JIOpF.js +2 -0
  80. package/dist/gateway/static/root/assets/management-settings-CuSzixOw.js +1 -0
  81. package/dist/gateway/static/root/assets/{markdown-view-CJt-i2Dp.js → markdown-view-pzSRu7av.js} +3 -3
  82. package/dist/gateway/static/root/assets/{media-plugins-D_bR23mA.js → media-plugins-3cJuHbO7.js} +1 -1
  83. package/dist/gateway/static/root/assets/messages-uXxg5p54.js +3 -0
  84. package/dist/gateway/static/root/assets/model-selector-ksLo-5B_.js +1 -0
  85. package/dist/gateway/static/root/assets/{models-hub-cache-za2fWJLg.js → models-hub-cache-DhZng2nF.js} +1 -1
  86. package/dist/gateway/static/root/assets/navigation-D62kPsA9.js +1 -0
  87. package/dist/gateway/static/root/assets/note-detail-panel-B6RbjwJq.js +5 -0
  88. package/dist/gateway/static/root/assets/note-image-lightbox-BCjvBqwy.js +1 -0
  89. package/dist/gateway/static/root/assets/{notes-api-C_458rv5.js → notes-api-DocbsBbT.js} +1 -1
  90. package/dist/gateway/static/root/assets/notes-page-B7889s6-.js +8 -0
  91. package/dist/gateway/static/root/assets/{oauth-api-C3X9FLYw.js → oauth-api-CCFIPbA0.js} +1 -1
  92. package/dist/gateway/static/root/assets/{oauth-provider-connect-H81se_3n.js → oauth-provider-connect-GxkF0vWJ.js} +1 -1
  93. package/dist/gateway/static/root/assets/open-capability-settings-Cvb65hQB.js +1 -0
  94. package/dist/gateway/static/root/assets/{page-context-capture-button-BkAlQ7cB.js → page-context-capture-button-CvWLVeRA.js} +1 -1
  95. package/dist/gateway/static/root/assets/{page-context-draft-ClLgaOaD.js → page-context-draft-CMRDNv4d.js} +1 -1
  96. package/dist/gateway/static/root/assets/page-header-store-reh1es-3.js +1 -0
  97. package/dist/gateway/static/root/assets/{personal-avatar-BLtHt8fV.js → personal-avatar-CqNJ48Ge.js} +1 -1
  98. package/dist/gateway/static/root/assets/personal-page-D95FHaw9.js +1 -0
  99. package/dist/gateway/static/root/assets/personal-settings-panel-DAcl8DU4.js +1 -0
  100. package/dist/gateway/static/root/assets/{phone-dependencies-card-DISHarj8.js → phone-dependencies-card-DLWblGj7.js} +1 -1
  101. package/dist/gateway/static/root/assets/phone-model-picker-ugrT9GJu.js +1 -0
  102. package/dist/gateway/static/root/assets/phone-settings-page-DIIt7JOE.js +1 -0
  103. package/dist/gateway/static/root/assets/{phone-workspace-store-fhnZrgy_.js → phone-workspace-store-mawKT5kV.js} +1 -1
  104. package/dist/gateway/static/root/assets/plugin-details-dialog-BdueMT3q.js +1 -0
  105. package/dist/gateway/static/root/assets/popover-select-DD8fmrxH.js +1 -0
  106. package/dist/gateway/static/root/assets/preference-select-fields-CmLZNwbm.js +1 -0
  107. package/dist/gateway/static/root/assets/product-automation-feedback-DYwhL37Y.js +7 -0
  108. package/dist/gateway/static/root/assets/{product-open-page-xn9G4hSI.js → product-open-page-B5G4X71t.js} +1 -1
  109. package/dist/gateway/static/root/assets/{product-preview-content-DcoK-iZe.js → product-preview-content-BUheyLqt.js} +1 -1
  110. package/dist/gateway/static/root/assets/{product-preview-modal-Ruw9WSKK.js → product-preview-modal-Cj_Zxu4G.js} +2 -2
  111. package/dist/gateway/static/root/assets/project-detail-page-CRJb69vP.js +7 -0
  112. package/dist/gateway/static/root/assets/project-understanding-D3w8cZEm.js +1 -0
  113. package/dist/gateway/static/root/assets/projects-page-CkifzKjz.js +1 -0
  114. package/dist/gateway/static/root/assets/{providers-api-CzVkFKFg.js → providers-api-CKFg2PZQ.js} +1 -1
  115. package/dist/gateway/static/root/assets/{recording-upload-0jxahBMo.js → recording-upload-ZkmRf0GR.js} +1 -1
  116. package/dist/gateway/static/root/assets/{registry-api-n8TwtJ_j.js → registry-api-B1Mh3bNo.js} +1 -1
  117. package/dist/gateway/static/root/assets/{remote-access-hub-cZpBi4Rk.js → remote-access-hub-Dw5rG-aA.js} +1 -1
  118. package/dist/gateway/static/root/assets/resource-unavailable-BUWsH3fp.js +1 -0
  119. package/dist/gateway/static/root/assets/route-preload-CRKbVwQ1.js +2 -0
  120. package/dist/gateway/static/root/assets/runtime-impact-DbySfhdp.js +1 -0
  121. package/dist/gateway/static/root/assets/{runtime-tools-api-D-8KjYK6.js → runtime-tools-api-BXvn5ImA.js} +1 -1
  122. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-BALcypHp.js +1 -0
  123. package/dist/gateway/static/root/assets/schema-form-BKeP5G7b.js +1 -0
  124. package/dist/gateway/static/root/assets/service-recommendation-list-CpVUnz89.js +1 -0
  125. package/dist/gateway/static/root/assets/{session-api-CsCoI2im.js → session-api-VquhIBHI.js} +1 -1
  126. package/dist/gateway/static/root/assets/session-manager-DNMosCtW.js +23 -0
  127. package/dist/gateway/static/root/assets/sessions-page-DlvPkE5Y.js +1 -0
  128. package/dist/gateway/static/root/assets/settings-advanced-gate-Ckc1aCLG.js +1 -0
  129. package/dist/gateway/static/root/assets/{settings-advanced-section-BqoVSko2.js → settings-advanced-section-c9_iZ-46.js} +1 -1
  130. package/dist/gateway/static/root/assets/{settings-mode-store-CBsJ-Qg2.js → settings-mode-store-Dem6-TBe.js} +1 -1
  131. package/dist/gateway/static/root/assets/{settings-page-DROUGyJl.js → settings-page-B_wNfFQe.js} +1 -1
  132. package/dist/gateway/static/root/assets/{settings-page-header-Bv-kQFTm.js → settings-page-header-C8a_oOyw.js} +1 -1
  133. package/dist/gateway/static/root/assets/{settings-page-layout-DHP6MrrL.js → settings-page-layout-CTSRWljG.js} +1 -1
  134. package/dist/gateway/static/root/assets/setup-status-panel-BNZoqF40.js +1 -0
  135. package/dist/gateway/static/root/assets/{share-link-dialog-BJHRQVKC.js → share-link-dialog-C5JTTxsy.js} +1 -1
  136. package/dist/gateway/static/root/assets/share-preview-page-D-KxzXgm.js +2 -0
  137. package/dist/gateway/static/root/assets/{shares-api-rtWVHA_d.js → shares-api-CztKbxdd.js} +1 -1
  138. package/dist/gateway/static/root/assets/shares-settings-CzR21j6e.js +1 -0
  139. package/dist/gateway/static/root/assets/skill-api-B7kWl6LK.js +1 -0
  140. package/dist/gateway/static/root/assets/{skill-list-api-BzlKXPsE.js → skill-list-api-Cn07P6qZ.js} +1 -1
  141. package/dist/gateway/static/root/assets/{skill-reload-api-Cff2GgZb.js → skill-reload-api-Bhl0u16_.js} +1 -1
  142. package/dist/gateway/static/root/assets/skills-page-BmkuxHZe.js +2 -0
  143. package/dist/gateway/static/root/assets/{system-settings-panel-BeQeUUMH.js → system-settings-panel-Ce6zIcki.js} +1 -1
  144. package/dist/gateway/static/root/assets/task-detail-page-CysJhG3B.js +2 -0
  145. package/dist/gateway/static/root/assets/task-result-evidence-CGZKMnNo.js +1 -0
  146. package/dist/gateway/static/root/assets/{terminal-panel-store-5Fzctajw.js → terminal-panel-store-YwLUkuyV.js} +1 -1
  147. package/dist/gateway/static/root/assets/{theme-store-DW45fWYQ.js → theme-store-DOJ9tu-j.js} +1 -1
  148. package/dist/gateway/static/root/assets/tracing-settings-page-BplBpTdL.js +1 -0
  149. package/dist/gateway/static/root/assets/tunnel-api-B5-Ypvqa.js +1 -0
  150. package/dist/gateway/static/root/assets/{understanding-activity-store-CTe6TFB0.js → understanding-activity-store-CmwtE8Kd.js} +1 -1
  151. package/dist/gateway/static/root/assets/{understanding-refresh-store-mE9OKG6q.js → understanding-refresh-store-9apSmAVL.js} +1 -1
  152. package/dist/gateway/static/root/assets/usage-page-cPbirpXX.js +1 -0
  153. package/dist/gateway/static/root/assets/{use-autosave-Cs2Ga_Y_.js → use-autosave-B3p2QWaF.js} +1 -1
  154. package/dist/gateway/static/root/assets/use-composer-attachments-D-AEYC85.js +2 -0
  155. package/dist/gateway/static/root/assets/use-file-preview-expanded-CO4SC-LX.js +2 -0
  156. package/dist/gateway/static/root/assets/{use-personal-profile-BHL2AxWU.js → use-personal-profile-DocmhC9I.js} +1 -1
  157. package/dist/gateway/static/root/assets/{use-workspace-tree-CnmPZrpx.js → use-workspace-tree-VraTGKx-.js} +1 -1
  158. package/dist/gateway/static/root/assets/user-model-page-DuRALzhe.js +2 -0
  159. package/dist/gateway/static/root/assets/{voice-api-key-field-3gyc2UV3.js → voice-api-key-field-DbSQHZZW.js} +1 -1
  160. package/dist/gateway/static/root/assets/{voice-config-api-Cda2uBIC.js → voice-config-api-D9iNJSvm.js} +1 -1
  161. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-DtYHsPLF.js → voice-input-shortcut-events-hso9_VvT.js} +1 -1
  162. package/dist/gateway/static/root/assets/voice-transcribe-api-BqIs0jgv.js +1 -0
  163. package/dist/gateway/static/root/assets/{work-discovery-overlay-Dqu5CQCS.js → work-discovery-overlay-fsL9RJqB.js} +1 -1
  164. package/dist/gateway/static/root/assets/work-discovery-page-DAQPKVDs.js +1 -0
  165. package/dist/gateway/static/root/assets/{working-directory-picker-modal-DHl2cZY1.js → working-directory-picker-modal-Ta73QrNw.js} +1 -1
  166. package/dist/gateway/static/root/assets/{workspace-api-CtDbI6T7.js → workspace-api-CgrcNyBc.js} +2 -2
  167. package/dist/gateway/static/root/assets/workspace-editor-agent-store-Dw6wtadX.js +1 -0
  168. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-CTIbUfKb.js → workspace-file-preview-dialog-B7uBuPtA.js} +1 -1
  169. package/dist/gateway/static/root/assets/{workspace-open-location-menu-BwxouqdZ.js → workspace-open-location-menu-Bi2vRvaQ.js} +1 -1
  170. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CFb-23rS.js → xopc-cloud-account-card-CCOOBG-7.js} +1 -1
  171. package/dist/gateway/static/root/index.html +86 -81
  172. package/dist/package.js +1 -1
  173. package/dist/packages/gateway-contract/src/index.js +2 -0
  174. package/dist/packages/gateway-contract/src/task-display.js +14 -0
  175. package/dist/src/agent/agent-manager.js +1 -1
  176. package/dist/src/agent/background-review/run-background-review.js +1 -1
  177. package/dist/src/agent/context/execution-scope.js +10 -5
  178. package/dist/src/agent/external-tools/cliProvider.js +2 -2
  179. package/dist/src/agent/external-tools/composio-provider.js +2 -2
  180. package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
  181. package/dist/src/agent/service.js +1 -1
  182. package/dist/src/agent/skills/index.js +1 -1
  183. package/dist/src/agent/skills/managed-store.js +1 -1
  184. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  185. package/dist/src/agent/tools/automation-tool.d.ts +2 -1
  186. package/dist/src/agent/tools/automation-tool.js +10 -3
  187. package/dist/src/agent/tools/factory.js +1 -0
  188. package/dist/src/agent/tools/personal-read-tool.js +1 -1
  189. package/dist/src/agent/tools/personal-task-tool.js +2 -1
  190. package/dist/src/agent/tools/xopc-use-tool.js +7 -5
  191. package/dist/src/agent-catalog/capabilities.js +2 -2
  192. package/dist/src/agent-catalog/repository.js +1 -1
  193. package/dist/src/automations/api/routes.js +38 -0
  194. package/dist/src/automations/capabilities/drafts.js +1 -1
  195. package/dist/src/automations/capabilities/write.js +25 -9
  196. package/dist/src/automations/configuration-conversation.d.ts +16 -0
  197. package/dist/src/automations/configuration-conversation.js +120 -0
  198. package/dist/src/automations/delivery/delivery-router.d.ts +2 -0
  199. package/dist/src/automations/delivery/delivery-router.js +30 -9
  200. package/dist/src/automations/domain/types.d.ts +1 -0
  201. package/dist/src/automations/index.js +5 -5
  202. package/dist/src/automations/service/action-executor.js +41 -12
  203. package/dist/src/automations/service/automation-service.d.ts +6 -0
  204. package/dist/src/automations/service/automation-service.js +47 -12
  205. package/dist/src/automations/service/index.js +2 -2
  206. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  207. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  208. package/dist/src/capabilities/runtime/product.js +1 -1
  209. package/dist/src/cli/commands/agents.js +1 -1
  210. package/dist/src/cli/commands/models.js +1 -1
  211. package/dist/src/cli/commands/onboard/model.js +1 -1
  212. package/dist/src/cli/utils/init-workspace-core.js +1 -1
  213. package/dist/src/computer/broker.js +16 -3
  214. package/dist/src/computer/diagnostics.js +1 -1
  215. package/dist/src/computer/errors.js +4 -0
  216. package/dist/src/config/agent-profile.js +1 -1
  217. package/dist/src/execution-environments/local-worktree-manager.js +1 -1
  218. package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
  219. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  220. package/dist/src/gateway/agents-admin.js +2 -2
  221. package/dist/src/gateway/automation-completion-delivery.d.ts +4 -0
  222. package/dist/src/gateway/automation-completion-delivery.js +14 -0
  223. package/dist/src/gateway/global-defaults-admin.js +1 -1
  224. package/dist/src/gateway/hono/routes/agents.js +1 -1
  225. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  226. package/dist/src/gateway/hono/routes/notes.js +2 -2
  227. package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
  228. package/dist/src/gateway/hono/routes/projects.js +2 -2
  229. package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
  230. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  231. package/dist/src/gateway/image-generation-setup.js +1 -1
  232. package/dist/src/gateway/respawn.js +2 -1
  233. package/dist/src/gateway/service.js +4 -4
  234. package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
  235. package/dist/src/imports/importService.js +1 -1
  236. package/dist/src/local-apps/service.js +1 -1
  237. package/dist/src/observability/store.d.ts +9 -0
  238. package/dist/src/observability/store.js +77 -32
  239. package/dist/src/personal-agent/communication.d.ts +1 -1
  240. package/dist/src/personal-agent/communication.js +3 -6
  241. package/dist/src/personal-agent/request-service.js +2 -1
  242. package/dist/src/personal-agent/service.js +1 -1
  243. package/dist/src/runtime-tools/archive.js +1 -1
  244. package/dist/src/tasks/capabilities/read.js +2 -2
  245. package/dist/src/tasks/capabilities/write.js +1 -1
  246. package/dist/src/tasks/task-contract-planner.js +2 -1
  247. package/dist/src/tui/backends/embedded-backend.js +1 -1
  248. package/dist/src/voice/realtime/persona-context.js +1 -1
  249. package/package.json +3 -3
  250. package/dist/gateway/static/root/assets/agent-avatar-display-Cy50vjbq.js +0 -2
  251. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-V4NX_cWz.js +0 -1
  252. package/dist/gateway/static/root/assets/agent-plugin-dialog-CQ5LLDMO.js +0 -1
  253. package/dist/gateway/static/root/assets/app-management-settings-panel-C1Zs-eha.js +0 -1
  254. package/dist/gateway/static/root/assets/appearance-settings-lIfGokbz.js +0 -1
  255. package/dist/gateway/static/root/assets/apps-page-CUvtsRYD.js +0 -1
  256. package/dist/gateway/static/root/assets/automation-api-Bld8blNl.js +0 -1
  257. package/dist/gateway/static/root/assets/automation-display-BcfZOQTC.js +0 -2
  258. package/dist/gateway/static/root/assets/automations-workspace-BgtYY2Mm.js +0 -8
  259. package/dist/gateway/static/root/assets/browser-automations-page-DIUNY94X.js +0 -3
  260. package/dist/gateway/static/root/assets/capabilities-page-DFW4Y0x8.js +0 -2
  261. package/dist/gateway/static/root/assets/capabilities-settings-panel-uOHSMQPZ.js +0 -8
  262. package/dist/gateway/static/root/assets/channels-D2a69dSt.js +0 -1
  263. package/dist/gateway/static/root/assets/chat-page-CG38tCHE.js +0 -71
  264. package/dist/gateway/static/root/assets/composer-payload-handoff-BU3B-C26.js +0 -1
  265. package/dist/gateway/static/root/assets/connected-providers-grid-Dmnu2zle.js +0 -1
  266. package/dist/gateway/static/root/assets/connectors-page-DT_WrC1y.js +0 -1
  267. package/dist/gateway/static/root/assets/desktop-pet-lorocS9j.js +0 -1
  268. package/dist/gateway/static/root/assets/desktop-pet-settings-CEcohlZq.js +0 -1
  269. package/dist/gateway/static/root/assets/device-pairing-wizard-CLCPuf4R.js +0 -1
  270. package/dist/gateway/static/root/assets/discussion-annotation-sync-BKjf9gWe.js +0 -1
  271. package/dist/gateway/static/root/assets/extension-iframe-host-Dhkk5JV2.js +0 -1
  272. package/dist/gateway/static/root/assets/extension-page-Brps2XDP.js +0 -1
  273. package/dist/gateway/static/root/assets/extension-settings-page-CHY68DpG.js +0 -1
  274. package/dist/gateway/static/root/assets/gateway-realtime-store-DQqMBruB.js +0 -1
  275. package/dist/gateway/static/root/assets/gateway-restart-Ch128Lrr.js +0 -1
  276. package/dist/gateway/static/root/assets/home-page-DaMFBYo1.js +0 -2
  277. package/dist/gateway/static/root/assets/image-generation-api-I_JgLL_m.js +0 -1
  278. package/dist/gateway/static/root/assets/index-DY2Y83b9.css +0 -1
  279. package/dist/gateway/static/root/assets/index-UCOlAnf-.js +0 -11
  280. package/dist/gateway/static/root/assets/install-connector-dialog-DU1Tz7B3.js +0 -1
  281. package/dist/gateway/static/root/assets/local-app-workbench-page-qPflPuQD.js +0 -1
  282. package/dist/gateway/static/root/assets/logs-page-CbY1N-zi.js +0 -2
  283. package/dist/gateway/static/root/assets/management-settings-Diy12JfQ.js +0 -1
  284. package/dist/gateway/static/root/assets/messages-DRR9N3HC.js +0 -3
  285. package/dist/gateway/static/root/assets/model-selector-DCYA_ntf.js +0 -1
  286. package/dist/gateway/static/root/assets/navigation-BkjnOw30.js +0 -1
  287. package/dist/gateway/static/root/assets/note-detail-panel-DBs1yHLy.js +0 -5
  288. package/dist/gateway/static/root/assets/note-image-lightbox-CivkB6LB.js +0 -1
  289. package/dist/gateway/static/root/assets/notes-page-DL3c-41a.js +0 -8
  290. package/dist/gateway/static/root/assets/page-header-store-DH8K0xii.js +0 -1
  291. package/dist/gateway/static/root/assets/personal-page-B5DP3lO-.js +0 -1
  292. package/dist/gateway/static/root/assets/personal-settings-panel-DjDc5Kaz.js +0 -1
  293. package/dist/gateway/static/root/assets/phone-model-picker-u8YIQCgo.js +0 -1
  294. package/dist/gateway/static/root/assets/phone-settings-page-el3pT0PD.js +0 -1
  295. package/dist/gateway/static/root/assets/plugin-details-dialog-CTBs1Jde.js +0 -1
  296. package/dist/gateway/static/root/assets/popover-select-DniHw2dy.js +0 -1
  297. package/dist/gateway/static/root/assets/preference-select-fields-D7oluyHN.js +0 -1
  298. package/dist/gateway/static/root/assets/product-automation-feedback-DsUSqCOX.js +0 -7
  299. package/dist/gateway/static/root/assets/project-detail-page-BKvWLiMw.js +0 -7
  300. package/dist/gateway/static/root/assets/project-understanding-BCQr0AZ_.js +0 -1
  301. package/dist/gateway/static/root/assets/projects-page-D4g7bB7X.js +0 -1
  302. package/dist/gateway/static/root/assets/route-preload-B5UiReO7.js +0 -2
  303. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-MKlLFuow.js +0 -1
  304. package/dist/gateway/static/root/assets/schema-form-v4N4lawq.js +0 -1
  305. package/dist/gateway/static/root/assets/service-recommendation-list-B1xuVT3N.js +0 -1
  306. package/dist/gateway/static/root/assets/session-manager-5l9q0cd5.js +0 -16
  307. package/dist/gateway/static/root/assets/sessions-page-DsLw2aMD.js +0 -1
  308. package/dist/gateway/static/root/assets/settings-advanced-gate-B5lQeVNi.js +0 -1
  309. package/dist/gateway/static/root/assets/setup-status-panel-MJE3B_LX.js +0 -1
  310. package/dist/gateway/static/root/assets/share-preview-page-Bsrv_zOQ.js +0 -2
  311. package/dist/gateway/static/root/assets/shares-settings-CfIRv4uX.js +0 -1
  312. package/dist/gateway/static/root/assets/skill-api-B_W1K3sv.js +0 -1
  313. package/dist/gateway/static/root/assets/skills-page-DtBloYeU.js +0 -2
  314. package/dist/gateway/static/root/assets/task-detail-page-Drrv-Hp0.js +0 -2
  315. package/dist/gateway/static/root/assets/task-result-evidence-D1Kyskm_.js +0 -1
  316. package/dist/gateway/static/root/assets/tracing-settings-page-B12u5D9A.js +0 -1
  317. package/dist/gateway/static/root/assets/tunnel-api-DGO56LQU.js +0 -1
  318. package/dist/gateway/static/root/assets/usage-page-Ud2U9UG1.js +0 -1
  319. package/dist/gateway/static/root/assets/use-composer-attachments-BCbMj-MN.js +0 -2
  320. package/dist/gateway/static/root/assets/use-file-preview-expanded-DSpCRXUW.js +0 -2
  321. package/dist/gateway/static/root/assets/user-model-page-p5iPfnwl.js +0 -2
  322. package/dist/gateway/static/root/assets/voice-transcribe-api-TInEfIYo.js +0 -1
  323. package/dist/gateway/static/root/assets/work-discovery-page-p-8ciZ0i.js +0 -1
  324. package/dist/gateway/static/root/assets/workspace-editor-agent-store-B94Q2nN8.js +0 -1
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,t as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as s}from"./arrow-left-D880xG-P.js";import{t as c}from"./chevron-down-ccbiQQz_.js";import{t as l}from"./working-directory-picker-modal-DHl2cZY1.js";import{t as ee}from"./circle-alert-BEjgurr2.js";import{t as te}from"./circle-check-C23XjkUj.js";import{t as u}from"./circle-BoO4YvTx.js";import{t as ne}from"./file-archive-DanfQJNe.js";import{t as d}from"./folder-open-CyzJ19I9.js";import{t as re}from"./loader-circle-CifKLtgG.js";import{t as ie}from"./package-wATCyihJ.js";import{t as f}from"./shield-check-BU58siTV.js";import{t as p}from"./upload-rrb46c3c.js";import{t as m}from"./messages-DRR9N3HC.js";import{t as h}from"./cn-0WouolD0.js";import{i as ae,n as g,o as _}from"./locale-store-lIXD1FMw.js";import{a as v}from"./vendor-swr-CdRzEUwF.js";import{t as y}from"./button-CnRSIP6m.js";import{t as oe}from"./skeleton-BI5TyibZ.js";import{a as b,i as x,o as S,r as C,s as w,t as T}from"./dist-DfWfZ9iu.js";import{t as se}from"./capability-links-DzQWK1Fh.js";import{t as E}from"./browser-BLJWD7WI.js";import{t as D}from"./capability-icon-DVoZxEgW.js";var ce=n(),O=e(E(),1),k=e(t(),1),A=r();function j(e){let t=(0,ce.c)(6),{fields:n,values:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=Object.entries(n),t[0]=n,t[1]=a);let o;return t[2]!==i||t[3]!==a||t[4]!==r?(o=(0,A.jsx)(A.Fragment,{children:a.map(e=>{let[t,n]=e;return(0,A.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[(0,A.jsxs)(`span`,{children:[n.title,n.required?` *`:``]}),n.type===`boolean`?(0,A.jsx)(`input`,{type:`checkbox`,checked:r[t]===!0,onChange:e=>i({...r,[t]:e.target.checked})}):(0,A.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2.5`,type:n.sensitive?`password`:n.type===`number`?`number`:`text`,required:n.required,autoComplete:`off`,value:String(r[t]??``),onChange:e=>i({...r,[t]:n.type===`number`?Number(e.target.value):e.target.value})})]},t)})}),t[2]=i,t[3]=a,t[4]=r,t[5]=o):o=t[5],o}function M(e){let t=(0,ce.c)(62),{account:n,fields:r,zh:i,busy:a,attempt:o,initialMethod:c,onBack:l,onConnect:ee,onSave:te,onRedirect:u,onSkip:ne}=e,[d,ie]=(0,k.useState)(c&&n.methods.some(e=>e.id===c)?c:n.methods[0]?.id??``),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={},t[0]=f):f=t[0];let[p,m]=(0,k.useState)(f),[h,ae]=(0,k.useState)(``),[g,_]=(0,k.useState)(),v;t[1]===d?v=t[2]:(v=e=>e.id===d,t[1]=d,t[2]=v);let b=n.methods.find(v),x;t[3]===i?x=t[4]:(x=(e,t)=>i?e:t,t[3]=i,t[4]=x);let S=x,C=o?.challenge?.type===`qr`?o.challenge.url:void 0,w,T;t[5]===C?(w=t[6],T=t[7]):(w=()=>{let e=!1;return _(void 0),C&&O.toDataURL(C,{width:240,margin:2}).then(t=>{e||_(t)}).catch(P),()=>{e=!0}},T=[C],t[5]=C,t[6]=w,t[7]=T),(0,k.useEffect)(w,T);let se;t[8]===o?se=t[9]:(se=o&&![`cancelled`,`error`,`connected`].includes(o.state),t[8]=o,t[9]=se);let E=se,D=o?.authorizationUrl??o?.challenge?.url,M=`连接 ${n.title}`,F=`Connect ${n.title}`,I;t[10]!==S||t[11]!==M||t[12]!==F?(I=S(M,F),t[10]=S,t[11]=M,t[12]=F,t[13]=I):I=t[13];let L;t[14]===S?L=t[15]:(L=S(`返回插件详情`,`Back to plugin details`),t[14]=S,t[15]=L);let R;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,A.jsx)(s,{className:`size-4`}),t[16]=R):R=t[16];let z;t[17]!==l||t[18]!==L?(z=(0,A.jsx)(y,{variant:`ghost`,className:`shrink-0`,onClick:l,"aria-label":L,children:R}),t[17]=l,t[18]=L,t[19]=z):z=t[19];let B;t[20]===S?B=t[21]:(B=S(`连接 `,`Connect `),t[20]=S,t[21]=B);let V;t[22]!==n.title||t[23]!==B?(V=(0,A.jsxs)(`h3`,{className:`text-base font-semibold`,children:[B,n.title]}),t[22]=n.title,t[23]=B,t[24]=V):V=t[24];let H;t[25]!==n.description||t[26]!==S?(H=n.description??S(`完成授权后自动检查连接。也可以稍后在详情页继续。`,`The connection is checked after authorization. You can also continue later in plugin details.`),t[25]=n.description,t[26]=S,t[27]=H):H=t[27];let U;t[28]===H?U=t[29]:(U=(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:H}),t[28]=H,t[29]=U);let W;t[30]!==V||t[31]!==U?(W=(0,A.jsxs)(`div`,{children:[V,U]}),t[30]=V,t[31]=U,t[32]=W):W=t[32];let G;t[33]!==z||t[34]!==W?(G=(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[z,W]}),t[33]=z,t[34]=W,t[35]=G):G=t[35];let K;t[36]!==n.methods||t[37]!==E||t[38]!==a||t[39]!==d||t[40]!==S?(K=n.methods.length>1?(0,A.jsx)(`div`,{role:`tablist`,"aria-label":S(`授权方式`,`Authorization methods`),className:`flex flex-wrap gap-2 rounded-lg bg-surface-inset p-1.5`,children:n.methods.map(e=>(0,A.jsx)(`button`,{role:`tab`,type:`button`,"aria-selected":d===e.id,className:`min-h-10 rounded-md px-3 text-sm ${d===e.id?`bg-surface-panel font-medium text-fg`:`text-fg-muted`}`,disabled:a||!!E,onClick:()=>{ie(e.id),m({})},children:e.title},e.id))}):null,t[36]=n.methods,t[37]=E,t[38]=a,t[39]=d,t[40]=S,t[41]=K):K=t[41];let q=b?.instructions?.length||b?.helpUrl?(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge bg-surface-inset p-4 text-sm text-fg-muted`,children:[b.instructions?.length?(0,A.jsx)(`ol`,{className:`list-decimal space-y-2 pl-5`,children:b.instructions.map(N)}):null,b.helpUrl?(0,A.jsx)(`a`,{className:`text-accent underline`,href:b.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:S(`打开官方配置说明`,`Open setup instructions`)}):null]}):null,J=(b?.type===`form`||b?.fields?.length)&&!E?(0,A.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),te(b.id,p)},children:[(0,A.jsx)(j,{fields:Object.fromEntries((b.fields??[]).filter(e=>r[e]).map(e=>[e,{...r[e],required:!0}])),values:p,onChange:m}),(0,A.jsxs)(y,{type:`submit`,disabled:a||!b.fields?.every(e=>p[e]!==void 0&&p[e]!==``),children:[a?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,S(`保存并连接`,`Save and connect`)]})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[E?null:(0,A.jsx)(y,{disabled:a,onClick:()=>ee(d),children:S(`连接账号`,`Connect account`)}),E?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:o.challenge?.message??(o.state===`preparing`?S(`正在准备登录…`,`Preparing sign-in…`):S(`请完成登录,返回后会自动继续。`,`Finish signing in. Installation continues automatically.`))}):null,C&&E?g?(0,A.jsx)(`img`,{src:g,alt:S(`使用 ${n.title} 扫码授权`,`Scan to authorize ${n.title}`),className:`mx-auto size-60 max-w-full rounded-lg`}):(0,A.jsx)(oe,{className:`mx-auto size-60`}):null,D&&E?(0,A.jsx)(`a`,{href:D,target:`_blank`,rel:`noopener noreferrer`,className:`inline-block text-sm text-accent underline`,children:C?S(`也可以打开授权页面`,`Or open the authorization page`):S(`打开登录页面`,`Open sign-in page`)}):null,o?.expiresAt&&E?(0,A.jsxs)(`p`,{className:`text-center text-xs text-fg-muted`,children:[S(`本次授权有效期至 `,`This sign-in expires at `),new Date(o.expiresAt).toLocaleTimeString()]}):null,o?.error?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:o.error}):null,o?.acceptsRedirect&&E?(0,A.jsxs)(`details`,{className:`text-sm`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:S(`登录后没有自动返回?`,`Did sign-in not return automatically?`)}),(0,A.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:e=>{e.preventDefault(),u(h)},children:[(0,A.jsxs)(`label`,{children:[S(`登录回调地址`,`Sign-in callback URL`),(0,A.jsx)(`input`,{value:h,onChange:e=>ae(e.target.value),className:`mt-1 w-full rounded-lg border border-edge bg-surface-inset p-2`})]}),(0,A.jsx)(y,{type:`submit`,disabled:a||!h,children:S(`继续登录`,`Continue sign-in`)})]})]}):null]}),Y;t[42]===S?Y=t[43]:(Y=S(`暂时跳过`,`Skip for now`),t[42]=S,t[43]=Y);let X;t[44]!==a||t[45]!==ne||t[46]!==Y?(X=(0,A.jsx)(y,{variant:`secondary`,disabled:a,onClick:ne,children:Y}),t[44]=a,t[45]=ne,t[46]=Y,t[47]=X):X=t[47];let Z;t[48]===S?Z=t[49]:(Z=S(`相关功能暂不可用,可随时在插件详情中授权。`,`Features requiring this account stay unavailable. Connect later in plugin details.`),t[48]=S,t[49]=Z);let le;t[50]===Z?le=t[51]:(le=(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Z}),t[50]=Z,t[51]=le);let ue;t[52]!==X||t[53]!==le?(ue=(0,A.jsxs)(`div`,{className:`border-t border-edge pt-4`,children:[X,le]}),t[52]=X,t[53]=le,t[54]=ue):ue=t[54];let Q;return t[55]!==I||t[56]!==G||t[57]!==K||t[58]!==q||t[59]!==J||t[60]!==ue?(Q=(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":I,children:[G,K,q,J,ue]}),t[55]=I,t[56]=G,t[57]=K,t[58]=q,t[59]=J,t[60]=ue,t[61]=Q):Q=t[61],Q}function N(e,t){return(0,A.jsx)(`li`,{children:e},t)}function P(){}async function F(e,t=`GET`,n){let r=await _(ae(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function I({extension:e,zh:t,onChanged:n,onStart:r,onInstalled:i,initialConnect:o=!1}){let s=`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,[c,l]=(0,k.useState)(),[ne,d]=(0,k.useState)({}),[ie,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(``),[h,ae]=(0,k.useState)({}),[g,_]=(0,k.useState)(null),[v,b]=(0,k.useState)(``),[x,S]=(0,k.useState)(null),[C,w]=(0,k.useState)(!1),T=(0,k.useRef)(new Set),se=(0,k.useRef)(new Set),E=(0,k.useRef)(void 0),D=(0,k.useRef)(null),ce=(0,k.useRef)(new Set),O=(e,n)=>t?e:n,N=e.setup?.authorizations??[],P=new Set(N.flatMap(e=>e.servers)),I=[...N,...(c?.connections??[]).filter(t=>!P.has(t.name)&&(e.components?.mcp.find(e=>e.name===t.name)?.type!==`stdio`||t.state===`token_required`)).map(t=>{let n=t.state===`token_required`||e.components?.mcp.find(e=>e.name===t.name)?.connectionAuth?.mode===`api-key`;return{id:t.name,title:t.name,servers:[t.name],methods:[{id:n?`api-key`:`oauth`,title:n?O(`访问令牌`,`Access token`):O(`浏览器登录`,`Browser sign-in`),type:n?`form`:`oauth`,...n?{fields:[`__apiKey`]}:{server:t.name}}]}})],L=e=>e.servers.every(e=>c?.connections.find(t=>t.name===e)?.state===`connected`)&&(!N.some(t=>t.id===e.id)||c?.authorizations?.find(t=>t.id===e.id)?.state===`connected`),R=(c?.authorizations??[]).flatMap(e=>(e.issues??[]).map(t=>({...t,account:I.find(t=>t.id===e.id)}))),z=I.filter(e=>!L(e)),B=c?.installed||c?.state===`completed`,V=e.setup?.userConfig??{},H=new Set(N.flatMap(e=>e.methods.flatMap(e=>e.fields??[]))),U=Object.fromEntries(Object.entries(V).filter(([e])=>!H.has(e))),W=c?.error===`Connection verification failed. Check the credentials or login status and try again.`?O(`连接验证未通过,请检查凭据或登录状态后重试。`,c.error):c?.error,G=Object.fromEntries(Object.entries(V).filter(([e])=>c?.missingConfig?.includes(e))),K=ie||c?.state===`running`,q=I.find(e=>e.id===x);(0,k.useEffect)(()=>{let e=!1;return F(`${s}/setup`).then(t=>{e||l(t)}).catch(t=>{e||(l(null),m(String(t)))}),()=>{e=!0}},[s]),(0,k.useEffect)(()=>{if(c?.state!==`running`)return;let e=!1,t=!1,r=setInterval(()=>{t||(t=!0,F(`${s}/setup`).then(t=>{e||(l(t),t?.state!==`running`&&n())}).catch(t=>{e||m(String(t))}).finally(()=>{t=!1}))},750);return()=>{e=!0,clearInterval(r)}},[s,c?.state]),(0,k.useEffect)(()=>{if(!c||!c.connections.some(e=>[`oauth_required`,`error`].includes(e.state)))return;let e=!1;return F(`${s}/setup/reusable`).then(t=>{e||ae(t)}).catch(()=>{e||ae({})}),()=>{e=!0}},[s,c?.revision]),(0,k.useEffect)(()=>{if(!v||c?.state===`completed`)return;let e=!1,t=!1,n=async()=>{if(!t){t=!0;try{let t=await F(`${s}/setup/auth/${encodeURIComponent(v)}`);e||_(t)}catch(t){e||m(String(t))}finally{t=!1}}};n();let r=setInterval(()=>void n(),1500),i=()=>void n();return window.addEventListener(`focus`,i),()=>{e=!0,clearInterval(r),window.removeEventListener(`focus`,i)}},[s,v,c?.state]),(0,k.useEffect)(()=>{let e=g?.authorizationUrl??(g?.challenge?.type===`url`?g.challenge.url:void 0);if(!g)return;if(g.error||[`cancelled`,`error`,`connected`].includes(g.state)){D.current?.close(),D.current=null;return}if(!e){g.challenge?.type===`qr`&&(D.current?.close(),D.current=null);return}let t=`${g.id}:${e}`;if(ce.current.has(t))return;ce.current.add(t);let n=D.current;D.current=null,n&&!n.closed?n.location.replace(e):window.open(e,`_blank`,`noopener,noreferrer`)},[g]);async function J(e,t={},r=c?.revision){f(!0),m(``);try{let a=await F(`${s}/setup`,`POST`,{action:e,expectedRevision:r,...e===`start`?{}:{idempotencyKey:crypto.randomUUID()},...t}),o=e===`configure`&&N.find(e=>e.id===t.authorization)?.methods.some(e=>e.id===t.method&&e.type===`cli`);return([`reuse`,`start`].includes(e)||e===`configure`&&!o)&&(d({}),w(!1),a=await F(`${s}/setup`,`POST`,{action:`prepare`,expectedRevision:a.revision,idempotencyKey:crypto.randomUUID()})),l(a),await n(),[`complete`,`defer`].includes(e)&&(S(null),_(null),b(``),D.current?.close(),D.current=null,i?.()),a}catch(e){m(e instanceof Error?e.message:String(e));try{l(await F(`${s}/setup`))}catch{}return null}finally{f(!1)}}(0,k.useEffect)(()=>{if(!c||K||p||[`cancelled`,`running`,`failed`].includes(c.state)||c.state===`completed`)return;let e,t=``;if(c.state===`pending`?(e=`prepare`,t=`prepare:${s}:${c.revision}`):g?.state===`connected`&&(e=`prepare`,t=`auth:${s}:${g.id}`),e&&!T.current.has(t)){T.current.add(t),J(e);return}c.resources===`ready`&&!c.missingConfig?.length&&!c.partial&&c.connections.every(e=>e.state===`connected`)&&(c.authorizations??[]).every(e=>e.state===`connected`)&&(t=`complete:${s}:${c.revision}`,T.current.has(t)||(T.current.add(t),J(`complete`)))},[c,g,K,p,s]),(0,k.useEffect)(()=>{K||!c||c.state===`cancelled`||(q&&c.revision!==E.current&&L(q)?(S(null),_(null),b(``)):(!B||o)&&c.resources===`ready`&&(!c.missingConfig?.length||o&&!c.missingConfig.some(e=>e in U))&&!x&&z[0]&&!se.current.has(z[0].id)&&(se.current.add(z[0].id),E.current=c.revision,S(z[0].id)))},[c,K,B,x,o]);function Y(e,t){let n=e.methods.find(e=>e.id===t),r=n?.type===`oauth`||n?.type===`cli`?window.open(`about:blank`,`_blank`):null;r&&(r.opener=null),D.current=r,_(null),J(`authorize`,{server:e.id,...N.some(t=>t.id===e.id)?{method:t}:{}}).then(t=>{t?b(e.id):(r?.close(),D.current=null)})}async function X(t,n,r){if(n===`api-key`&&!N.some(e=>e.id===t.id)){f(!0),m(``);try{let n=e.components?.mcp.find(e=>e.name===t.id);await F(`${s}/mcp/${encodeURIComponent(t.id)}/auth`,`PUT`,{mode:`api-key`,secrets:[{target:n.type===`stdio`?`env`:`headers`,key:n.connectionAuth?.headerName??(n.type===`stdio`?`API_KEY`:`Authorization`),prefix:n.connectionAuth?.prefix??(n.type===`stdio`?``:`Bearer `),value:r.__apiKey}]});let i=await F(`${s}/setup`);l(i),f(!1),await J(`prepare`,{},i.revision);return}catch(e){m(String(e)),f(!1);return}f(!1)}else if(t.methods.find(e=>e.id===n)?.type===`cli`){let e=window.open(`about:blank`,`_blank`);e&&(e.opener=null),D.current=e,_(null);let i=await J(`configure`,{authorization:t.id,method:n,values:r},c?.revision);i&&await J(`authorize`,{server:t.id,method:n},i.revision)?b(t.id):(e?.close(),D.current=null)}else await J(`configure`,{authorization:t.id,method:n,values:r})}if(c===void 0)return(0,A.jsx)(oe,{className:`h-40 w-full`});let Z=()=>{J(`defer`)};return q?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(M,{initialMethod:c?.authorizations?.find(e=>e.id===q.id)?.method,account:q,fields:{...V,__apiKey:{type:`string`,title:O(`访问令牌`,`Access token`),required:!0,sensitive:!0}},zh:t,busy:K,attempt:g,onBack:()=>S(null),onConnect:e=>Y(q,e),onSave:(e,t)=>void X(q,e,t),onRedirect:e=>{f(!0),F(`${s}/setup/auth/${encodeURIComponent(v)}/redirect`,`POST`,{url:e}).catch(e=>m(String(e))).finally(()=>f(!1))},onSkip:Z},`${q.id}:${c?.authorizations?.find(e=>e.id===q.id)?.method??``}`),h[q.id]?.map(e=>(0,A.jsxs)(y,{disabled:K,variant:`secondary`,onClick:()=>void J(`reuse`,{server:q.id,sourceServerId:e.id}),children:[O(`使用已登录账号:`,`Use signed-in account: `),e.name]},e.id)),p||W&&q.servers.some(e=>c?.connections.find(t=>t.name===e)?.state===`error`)?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:p||W}):null]}):(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":O(`插件安装与授权`,`Plugin setup`),children:[B?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:O(`安装完成`,`Installation complete`)}),(0,A.jsx)(`p`,{role:`status`,className:`mt-1 text-sm text-fg-muted`,children:e.activationEligible===!1?O(`插件已停用。`,`Plugin is disabled.`):c?.partial||z.length||R.length||c?.missingConfig?.length?O(`插件已安装,部分功能仍需要授权。`,`Plugin installed. Some features still need authorization.`):O(`所有 Agent 均可使用。可在 Agent 设置中单独调整。`,`Available to all agents. Customize individual agents in Agent settings.`)})]}):(0,A.jsxs)(`div`,{className:`rounded-xl border border-edge p-4`,children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:O(`安装准备`,`Installation setup`)}),(0,A.jsx)(`ol`,{className:`mt-4 space-y-4 text-sm`,"aria-live":`polite`,children:[{name:O(`准备资源`,`Prepare resources`),done:c?.resources===`ready`,running:K&&c?.resources!==`ready`},{name:O(`授权账号`,`Authorize accounts`),done:c?.resources===`ready`&&!c?.missingConfig?.length&&z.length===0,running:!1},{name:O(`加载可用工具`,`Load available tools`),done:!1,running:K&&c?.resources===`ready`}].map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-3`,children:[e.done?(0,A.jsx)(te,{className:`size-5 text-accent`,"aria-hidden":!0}):e.running?(0,A.jsx)(re,{className:`size-5 animate-spin text-accent`,"aria-hidden":!0}):(0,A.jsx)(u,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),e.name]},e.name))}),(0,A.jsx)(`p`,{className:`mt-4 text-xs text-fg-muted`,children:O(`安装后所有 Agent 均可使用,可在各自的设置中调整。`,`Available to all agents after installation. Customize individual agents in Agent settings.`)})]}),!c||c.state===`cancelled`?(0,A.jsx)(y,{disabled:ie||e.readiness===`blocked`,onClick:()=>void J(`start`),children:O(`继续安装`,`Continue installation`)}):(0,A.jsxs)(A.Fragment,{children:[c.missingConfig?.length||C?(0,A.jsxs)(`form`,{className:`space-y-4 rounded-xl border border-edge p-4`,onSubmit:e=>{e.preventDefault(),J(`configure`,{values:ne})},children:[(0,A.jsx)(`h4`,{className:`font-medium`,children:O(`补充配置`,`Required configuration`)}),(0,A.jsx)(j,{fields:C?U:G,values:ne,onChange:d}),(0,A.jsx)(y,{type:`submit`,disabled:K||!Object.keys(ne).length,children:O(`继续`,`Continue`)})]}):null,B&&(z.length||c.missingConfig?.length)?(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(ee,{className:`mt-0.5 size-5 shrink-0`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium`,children:O(`需要授权`,`Authorization required`)}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:O(`授权后即可使用相关功能。已就绪的功能可继续使用。`,`Connect these accounts to use their features. Ready features remain available.`)})]})]}):null,R.length?(0,A.jsx)(`div`,{className:`space-y-3`,"aria-label":O(`需要补充权限`,`Additional permissions required`),children:R.map(e=>(0,A.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`text-fg-muted`,children:O(`账号已连接,以下权限尚未就绪;其他已授权功能可继续使用。`,`Account connected. These permissions are not ready; other authorized features remain available.`)}),e.scopes.length?(0,A.jsx)(`p`,{className:`break-all font-mono text-xs`,children:e.scopes.join(`, `)}):null,(0,A.jsx)(`ol`,{className:`list-inside list-decimal space-y-1 text-fg-muted`,children:e.instructions.map(e=>(0,A.jsx)(`li`,{children:e},e))}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.helpUrl?(0,A.jsx)(y,{variant:`secondary`,asChild:!0,children:(0,A.jsx)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:O(`前往开通应用权限`,`Open application permissions`)})}):null,e.method&&e.account?(0,A.jsx)(y,{disabled:K,onClick:()=>{E.current=c.revision,S(e.account.id),Y(e.account,e.method)},children:O(`补充授权`,`Grant missing permissions`)}):null,(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:()=>void J(`prepare`),children:O(`重新检查权限`,`Check permissions again`)})]})]},`${e.account?.id}:${e.id}`))}):null,I.length?(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h4`,{className:`text-sm font-medium`,children:O(`账号与连接`,`Accounts and connections`)}),I.map(e=>(0,A.jsxs)(`div`,{role:`group`,"aria-label":e.title,className:`flex items-center justify-between gap-3 rounded-lg border border-edge p-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:L(e)?O(`已连接`,`Connected`):O(`需要授权`,`Authorization required`)})]}),(0,A.jsx)(y,{variant:L(e)?`secondary`:`primary`,disabled:K||c.resources!==`ready`,onClick:()=>{_(null),b(``),E.current=c.revision,S(e.id)},children:L(e)?O(`重新授权`,`Reconnect`):O(`连接账号`,`Connect account`)})]},e.id))]}):null,!B&&c.resources===`ready`?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:Z,children:O(`暂时跳过`,`Skip for now`)}),(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:O(`先完成安装,稍后在详情页授权。未授权的功能暂不可用。`,`Finish installation and connect later in plugin details. Unauthenticated features remain unavailable.`)})]}):null,B&&Object.keys(U).length&&!C?(0,A.jsx)(y,{variant:`ghost`,disabled:K,onClick:()=>w(!0),children:O(`修改插件配置`,`Edit plugin configuration`)}):null,B&&!R.length&&N.some(e=>e.methods.some(e=>e.type===`cli`))?(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:()=>void J(`prepare`),children:O(`检查连接与权限`,`Check connection and permissions`)}):null,!K&&(p||[`failed`,`interrupted`].includes(c.state)||c.connections.some(e=>e.state===`error`))?(0,A.jsx)(y,{variant:`secondary`,onClick:()=>void J(`prepare`),children:O(`重试检查`,`Retry checks`)}):null,B?null:(0,A.jsx)(y,{variant:`ghost`,disabled:ie,onClick:()=>void J(`cancel`),children:O(`取消安装`,`Cancel installation`)}),B&&!z.length&&!c.missingConfig?.length?e.setup?.tasks?.map(t=>(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-inset p-4 text-sm`,children:[(0,A.jsx)(`p`,{children:t}),(0,A.jsx)(y,{asChild:!0,disabled:!e.active,children:(0,A.jsx)(a,{to:`/chat/new?${new URLSearchParams({draft:t,projectScope:`none`})}`,state:{forceNewChat:!0},onClick:t=>{e.active?r?.():t.preventDefault()},children:O(`开始这个任务`,`Start this task`)})})]},t)):null]}),K?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:O(`正在准备,可关闭后继续。`,`Preparing. You can close this window and resume.`)}):null,c?.error&&!c.deferred&&!c.missingConfig?.length?(0,A.jsx)(`p`,{className:`text-sm text-fg-muted`,children:W}):null,p?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:p}):null]})}var L=`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;function R(e,t){if(e.startsWith(`content.skills:`)){let n=e.slice(15);return t?`提供技能:${n}`:`Add skill: ${n}`}if(e.startsWith(`runtime.mcp.stdio:`)){let n=e.slice(18).split(`:`,1)[0];return t?`在 Gateway 上运行工具服务:${n}`:`Run a tool service on the Gateway: ${n}`}if(e.startsWith(`network.mcp:`)){let n=e.slice(12).split(`:`,1)[0];return t?`连接外部工具服务:${n}`:`Connect to an external tool service: ${n}`}return e.startsWith(`runtime.capability-access:`)?t?`按账号授权启用相关技能和工具`:`Enable skills and tools according to account authorization`:e.startsWith(`runtime.authorization:`)?t?`在本机运行账号登录程序:${e.split(`:`)[1]}`:`Run account sign-in locally: ${e.split(`:`)[1]}`:e.startsWith(`runtime.resource:`)?t?`下载可执行资源:${e.split(`:`)[1]}`:`Download executable resource: ${e.split(`:`)[1]}`:e.startsWith(`network.resource:`)?t?`下载并校验资源:${e.split(`:`)[1]}`:`Download and verify resource: ${e.split(`:`)[1]}`:e}function z(e,t){return t?.publisher?.verification!==`verified`||t.latestVersion.riskTier&&t.latestVersion.riskTier!==`content`?!0:e.addedCapabilities.some(e=>!e.startsWith(`content.skills:`))}async function B(e,t,n){let r=await _(ae(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function V({extension:e,onClose:t,onUninstalled:n,initialSource:r=``,marketplace:a,autoInstall:s=!1}){let ee=g(e=>e.language),u=ee.startsWith(`zh`),ae=a?.localizations?.[u?`zh-CN`:`en`],_=ae?.displayName??a?.name,oe=ae?.description??a?.description,E=(0,k.useId)(),{mutate:ce}=v(),[O,j]=(0,k.useState)(e),[M,N]=(0,k.useState)(r||e?.installationSource||``),[P,F]=(0,k.useState)(null),[V,H]=(0,k.useState)([]),[U,W]=(0,k.useState)(!1),[G,K]=(0,k.useState)(``),[q,J]=(0,k.useState)(!1),[Y,X]=(0,k.useState)(!1),[Z,le]=(0,k.useState)(!1),[ue,Q]=(0,k.useState)(!1),[de,fe]=(0,k.useState)(!1),[pe,me]=(0,k.useState)(!1),he=o(),ge=i(),[_e,ve]=(0,k.useState)(!1),ye=(0,k.useRef)(!1),be=`/api/extensions/agent-plugins/${encodeURIComponent(O?.pluginId??``)}`,xe=M.trim().startsWith(`store:`),Se=()=>ce(`gateway-extensions-list`);async function $(e){W(!0),K(``);try{await e()}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}}function Ce(e){N(e),F(null),H([]),K(``)}let we=typeof window<`u`?window.electronAPI?.file:void 0,Te=/^(?:\/|[A-Za-z]:[\\/])/.test(M.trim())?M.trim():void 0;async function Ee(){if(!we?.openDirectory){fe(!0);return}let e=await we.openDirectory(Te?{defaultPath:Te}:void 0);e&&Ce(e)}async function De(){if(!we?.openFile){fe(!0);return}let e=await we.openFile({...Te?{defaultPath:Te}:{},extensions:[`zip`]});e&&Ce(e)}function Oe(e){return[...e.dataTransfer.types].some(e=>e===`Files`||e===`text/plain`||e===`text/uri-list`)}function ke(e){if(!Oe(e))return;e.preventDefault(),Q(!1);let t=Array.from(e.dataTransfer.files);if(t.length){if(t.length>1){K(u?`一次只能选择一个插件目录或 ZIP。`:`Choose one plugin directory or ZIP at a time.`);return}let e=we?.getPathForFile?.(t[0]);e?Ce(e):K(u?`浏览器无法读取本机文件路径,请使用“选择文件或目录”选择安装包。`:`The browser cannot read local file paths. Use Choose file or folder to select the package.`);return}let n=e.dataTransfer.getData(`text/uri-list`)||e.dataTransfer.getData(`text/plain`);n.trim()&&Ce(n.trim().split(/\r?\n/)[0])}async function Ae(e){let t=await B(`${be}/activation`,`POST`,{enabled:e});j(t),await Se()}async function je(e){let t=!O,n=await B(t?`/api/extensions/install`:`${be}/update`,`POST`,{source:M,reviewHash:e.reviewHash,...e.layout?{setup:!0}:{}});j(n),await Se(),!e.layout&&t&&!n.activationEligible&&n.readiness!==`blocked`&&n.pluginId&&(n=await B(`/api/extensions/agent-plugins/${encodeURIComponent(n.pluginId)}/activation`,`POST`,{enabled:!0}),j(n),await Se()),F(null),ve(!e.layout&&t&&n.activationEligible===!0)}async function Me(){let e=await B(`/api/extensions/inspect`,`POST`,{source:M});if(z(e,a)){F(e);return}await je(e)}(0,k.useEffect)(()=>{e&&!e.setup&&j(e)},[e]),(0,k.useEffect)(()=>{if(!e?.setup||!e.pluginId)return;let t=!1;return B(`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,`GET`).then(e=>{t||j(e)}).catch(()=>{}),()=>{t=!0}},[e?.pluginId]),(0,k.useEffect)(()=>{!s||O||!xe||ye.current||(ye.current=!0,$(Me))},[s,O,xe]);let Ne=s&&!O&&xe&&!ye.current;return(0,A.jsx)(T,{defaultOpen:!0,onOpenChange:e=>!e&&t(),children:(0,A.jsxs)(S,{children:[(0,A.jsx)(b,{className:`fixed inset-0 z-[130] bg-scrim`}),(0,A.jsxs)(C,{className:`fixed left-1/2 top-1/2 z-[131] flex max-h-[min(42rem,calc(100dvh-2rem))] w-[min(38rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,A.jsx)(D,{iconUrl:O?.branding?.iconUrl??a?.branding?.iconUrl,fallback:ie}),(0,A.jsx)(w,{className:`font-semibold`,children:O?.name??_??(u?`安装插件`:`Install plugin`)})]}),(0,A.jsx)(y,{variant:`ghost`,onClick:t,children:u?`关闭`:`Close`})]}),(0,A.jsx)(x,{className:`sr-only`,children:u?`安装、组件、账号连接和权限`:`Installation, components, connections and permissions`}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-auto space-y-4 overflow-y-auto overscroll-contain p-4`,children:[!O&&xe?(0,A.jsxs)(`section`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:_??P?.manifest.name??M.slice(6)}),oe?(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:oe}):null,(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:a?.publisher?.verification===`verified`?u?`已认证发布者 · 安装后所有 Agent 均可使用`:`Verified publisher · available to all agents after installation`:u?`安装前会检查来源和所需权限`:`Source and required permissions are checked before installation`})]})]}),P?null:(0,A.jsxs)(y,{className:`w-full`,disabled:U||Ne,onClick:()=>void $(Me),children:[U||Ne?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,U||Ne?u?`正在安全检查并安装…`:`Checking and installing…`:u?`一键安装`:`Install`]})]}):null,O?(0,A.jsxs)(A.Fragment,{children:[_e?(0,A.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-4`,children:[(0,A.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:u?`插件已安装并启用`:`Plugin installed and enabled`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u?`现在可以直接在对话中使用它。`:`It is ready to use in your conversations.`})]})]}):null,(!O.setup||O.readiness!==`setup_required`)&&!O.activationEligible?(0,A.jsxs)(`div`,{role:`status`,className:`space-y-3 rounded-lg border border-accent/25 bg-accent-soft p-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-accent-fg`,children:u?`插件已安装,当前尚未启用`:`Plugin installed. It is not enabled yet.`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u?`启用后,Skills 和 MCP 才会加入 Agent 运行时。`:`Enable it to make its skills and MCP servers available to the Agent runtime.`})]}),(0,A.jsx)(y,{disabled:U||O.readiness===`blocked`,onClick:()=>void $(()=>Ae(!0)),children:u?`启用插件`:`Enable plugin`})]}):null,O.setup?(0,A.jsx)(I,{extension:O,zh:u,onStart:t,onInstalled:()=>{t(),he(se(O.pluginId,`installed`,!1,ge.pathname+ge.search))},onChanged:async()=>{let e=await B(`${be}`,`GET`);j(e),await Se()}}):null,(0,A.jsxs)(`details`,{className:`rounded-lg border border-edge p-3`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:u?`插件详情`:`Plugin details`}),(0,A.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[u?`插件`:`Plugin`,` · `,O.version,` · `,O.readiness&&{ready:u?`已就绪`:`Ready`,setup_required:u?`待连接`:`Setup required`,degraded:u?`部分不可用`:`Partially available`,blocked:u?`已阻止`:`Blocked`}[O.readiness]]}),O.provenance?(0,A.jsxs)(`p`,{className:`break-words text-xs text-fg-muted`,children:[O.provenance.publisherVerification===`verified`?u?`已认证发布者`:`Verified publisher`:u?`社区发布者`:`Community publisher`,` · `,O.provenance.packageName,`@`,O.provenance.version,` · SHA-256 `,O.provenance.sha256.slice(0,12),`…`,O.provenance.riskTier?` · ${O.provenance.riskTier}`:``]}):null,(0,A.jsx)(`p`,{className:`text-sm`,children:O.description}),O.installationSource?(0,A.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[u?`来源:`:`Source: `,O.installationSource,O.resolvedCommit?` · ${O.resolvedCommit.slice(0,12)}`:``]}):null,O.activationEligible?(0,A.jsx)(y,{disabled:U,variant:`secondary`,onClick:()=>void $(()=>Ae(!1)),children:u?`停用`:`Disable`}):null,O.canRollback?(0,A.jsx)(y,{disabled:U,variant:`secondary`,onClick:()=>void $(async()=>{j(await B(`${be}/rollback`,`POST`)),await Se()}),children:u?`回滚上一版本`:`Roll back`}):null]})]}),O.diagnostics?.map((e,t)=>(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.component,`: `,e.message]},t))]}):null,O?(0,A.jsxs)(y,{variant:`ghost`,className:`px-0`,"aria-expanded":pe,onClick:()=>me(e=>!e),children:[(0,A.jsx)(c,{className:h(`size-4 transition-transform motion-reduce:transition-none`,pe&&`rotate-180`),"aria-hidden":!0}),u?`高级操作`:`Advanced actions`]}):null,!O&&!xe||pe?(0,A.jsxs)(`form`,{className:h(`space-y-3`,O&&`border-t border-edge pt-4`),onSubmit:e=>{e.preventDefault(),$(async()=>{let e=await B(`/api/extensions/inspect`,`POST`,{source:M});e.candidates?(H(e.candidates),F(null)):(H([]),F(e))})},children:[(0,A.jsxs)(`div`,{"data-testid":`plugin-source-dropzone`,className:h(`rounded-xl border border-dashed p-3 transition-colors`,ue?`border-accent bg-accent-soft`:`border-edge bg-surface-inset/40`),onDragEnter:e=>{Oe(e)&&(e.preventDefault(),Q(!0))},onDragOver:e=>{Oe(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,Q(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Q(!1)},onDrop:ke,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-start gap-2`,children:[(0,A.jsx)(p,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:E,className:`block text-sm font-medium`,children:O?u?`更新包来源`:`Update package source`:u?`安装包来源`:`Package source`}),(0,A.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:u?`输入 github:组织/仓库、Git / ZIP 地址或宿主目录;marketplace 可选择插件。`:`Enter github:owner/repo, a Git / ZIP URL or a Gateway directory. Marketplaces let you choose a plugin.`})]})]}),(0,A.jsx)(`input`,{id:E,className:L,value:M,onChange:e=>Ce(e.target.value),placeholder:u?`/插件目录/或/插件.zip`:`/plugin/folder/or/plugin.zip`,autoComplete:`off`,spellCheck:!1,required:!0}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:we?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>void $(Ee),children:[(0,A.jsx)(d,{className:`size-4`,"aria-hidden":!0}),u?`选择目录`:`Choose directory`]}),(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>void $(De),children:[(0,A.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),u?`选择 ZIP`:`Choose ZIP`]})]}):(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>fe(!0),children:[(0,A.jsx)(d,{className:`size-4`,"aria-hidden":!0}),u?`选择文件或目录`:`Choose file or folder`]})})]}),(0,A.jsx)(y,{type:`submit`,variant:`secondary`,disabled:U||!M,children:u?`检查安装包`:`Inspect package`})]}):null,V.length?(0,A.jsx)(`div`,{className:`space-y-2`,"aria-label":u?`选择插件`:`Choose a plugin`,children:V.map(e=>(0,A.jsx)(y,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>{Ce(e.source),$(async()=>F(await B(`/api/extensions/inspect`,`POST`,{source:e.source})))},children:e.name},e.source))}):null,P?(0,A.jsxs)(`div`,{role:`region`,"aria-labelledby":`plugin-authorization-title`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-amber-700 dark:text-amber-300`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{id:`plugin-authorization-title`,className:`font-medium text-fg`,children:u?`需要你的授权`:`Your authorization is required`}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:u?`此插件需要以下新增能力。确认后自动准备资源,按需登录账号,所有 Agent 均可使用。`:`Review these capabilities. Resources are prepared automatically; sign in if needed. Available to all agents.`})]})]}),(0,A.jsx)(`ul`,{tabIndex:0,"aria-label":u?`插件新增能力`:`Added plugin capabilities`,className:`max-h-[min(28vh,14rem)] space-y-2 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-panel p-3 break-words focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:P.addedCapabilities.map(e=>(0,A.jsxs)(`li`,{className:`flex gap-2`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:`•`}),(0,A.jsx)(`span`,{children:R(e,u)})]},e))}),P.diagnostics.map((e,t)=>(0,A.jsxs)(`p`,{children:[e.component,`: `,e.message]},t))]}):null,O&&pe?(0,A.jsx)(`div`,{className:`border-t border-edge pt-4`,children:Z?(0,A.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,A.jsx)(`p`,{children:u?`卸载保留账号凭据;服务端授权需到相应服务撤销。`:`Credentials are retained. Revoke provider authorization in the service itself.`}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:q,onChange:e=>J(e.target.checked)}),u?`同时删除插件数据`:`Also delete plugin data`]}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:Y,onChange:e=>X(e.target.checked)}),u?`同时删除本地凭据`:`Also delete local credentials`]}),(0,A.jsx)(y,{disabled:U,onClick:()=>void $(async()=>{await B(be,`DELETE`,{removeData:q,removeCredentials:Y}),await Se(),(n??t)()}),children:u?`确认卸载`:`Confirm uninstall`})]}):(0,A.jsx)(y,{variant:`ghost`,disabled:U,onClick:()=>le(!0),children:u?`卸载插件`:`Uninstall`})}):null,G?(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-fg-muted`,children:G}):null]}),P?(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge p-4`,children:[(0,A.jsx)(y,{variant:`ghost`,disabled:U,onClick:()=>F(null),children:u?`取消`:`Cancel`}),(0,A.jsxs)(y,{disabled:U||!!O&&P.manifest.name!==O.name,onClick:()=>void $(()=>je(P)),children:[U?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,u?`授权并安装`:`Authorize and install`]})]}):null]}),we?null:(0,A.jsx)(l,{open:de,onOpenChange:fe,initialAbsolutePath:Te,onConfirm:async e=>Ce(e),wd:m(ee).chat.workingDirectory,selectKind:`file-or-directory`,fileExtensions:[`zip`],title:u?`选择插件安装包`:`Choose plugin package`,description:u?`选择插件目录或 ZIP 文件。`:`Choose a plugin directory or ZIP file.`,confirmLabel:u?`使用此来源`:`Use this source`,nested:!0})]})})}export{I as n,V as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./copy-Dv6d4Dvw.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./package-wATCyihJ.js";import{t as s}from"./messages-DRR9N3HC.js";import{t as c}from"./cn-0WouolD0.js";import{i as l,n as u,o as d}from"./locale-store-lIXD1FMw.js";import{i as f}from"./vendor-swr-CdRzEUwF.js";import{t as p}from"./button-CnRSIP6m.js";import{t as m}from"./skeleton-BI5TyibZ.js";import{a as h,i as g,o as _,r as v,s as y,t as b}from"./dist-DfWfZ9iu.js";import{i as x,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{n as w}from"./interaction-BdhHBbYa.js";import{n as T}from"./electron-env-DHOGevH3.js";import{r as E}from"./settings-form-draft-Dy10ldo8.js";import{t as D}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as O,t as k}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{r as A,t as j}from"./settings-form-section-num14vSv.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,s]=(0,N.useReducer)(E,R),{info:l,loadError:u,actionError:d,copiedField:f,clearDialogOpen:m,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){s({type:`patch`,patch:{loadError:null}});try{let t=await e.getUninstallInfo();s({type:`patch`,patch:{info:t}})}catch(e){s({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await C(e)){s({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>s({type:`patch`,patch:{copiedField:null}}),2e3);return}s({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){s({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||s({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){s({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{s({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){s({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||s({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){s({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{s({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(u)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:u});if(!l)return(0,P.jsx)(D,{rows:2});let U=!l.packaged,W=M||l.pendingUpdate||U,G=!U&&l.uninstallMode!==`unsupported`,K=L(l,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(o,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,d?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:d}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,l.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:l.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:c(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(l.appPath,`app`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),f===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:l.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:c(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(l.dataPath,`data`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),f===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(l.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:c(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,w.press),onClick:()=>{s({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:c(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,w.press),onClick:()=>{s({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(b,{open:m,onOpenChange:e=>{!e&&!M&&s({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(_,{children:[(0,P.jsx)(h,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(v,{className:c(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>s({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:c(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>s({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(p,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{s({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(p,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(a,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(b,{open:k,onOpenChange:e=>{e||s({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(_,{children:[(0,P.jsx)(h,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(v,{className:c(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>s({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(p,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>s({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(p,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await d(l(`/api/migrations/status`))).payload}async function V(){await d(l(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=f(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(m,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(m,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),h=u.filter(e=>e.safety===`auto`&&e.status===`planned`),g=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:g?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(h.length))})]}),h.length>0&&!g?(0,P.jsx)(p,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=u(W),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,a=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!a){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(k,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(O,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let o;e[18]===i.title?o=e[19]:(o=(0,P.jsx)(k,{title:i.title}),e[18]=i.title,e[19]=o);let c;e[20]===i.migrations?c=e[21]:(c=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=c);let l;e[22]===i?l=e[23]:(l=(0,P.jsx)(z,{api:a,messages:i,embedded:!1}),e[22]=i,e[23]=l);let d;return e[24]!==o||e[25]!==c||e[26]!==l?(d=(0,P.jsxs)(O,{gap:`gap-6`,children:[o,c,l]}),e[24]=o,e[25]=c,e[26]=l,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i,r as a}from"./popover-select-DniHw2dy.js";import{t as o}from"./messages-DRR9N3HC.js";import{t as s}from"./cn-0WouolD0.js";import{i as c,n as l,o as u}from"./locale-store-lIXD1FMw.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{n as f}from"./interaction-BdhHBbYa.js";import{n as p,r as m}from"./gateway-config-swr-BAmUhiP1.js";import{t as h}from"./preference-select-fields-D7oluyHN.js";import{i as g}from"./theme-store-DW45fWYQ.js";import{t as _}from"./dev-view-store-57HgVuZ6.js";import{n as v,t as y}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{t as b}from"./settings-advanced-gate-B5lQeVNi.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await u(c(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await p()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=s(`min-w-0`,a),t[0]=a,t[1]=o);let c;t[2]===n?c=t[3]:(c=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=l);let u;t[6]===r?u=t[7]:(u=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=u);let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,E.jsxs)(`section`,{className:o,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e8d9cf`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#493a32`}},dawn:{light:{canvas:`#accdec`,panel:`#f8fbff`,accent:`#34363a`,fg:`#262626`,muted:`#e7ebf4`},dark:{canvas:`#172433`,panel:`#253342`,accent:`#d9dde2`,fg:`#f3f6fa`,muted:`#415264`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=l(F),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=g(P),a=g(N),c;e[2]===r.colorSchemeTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=c);let u;e[4]!==r||e[5]!==i||e[6]!==a?(u=j.map(e=>{let{value:t,labelKey:n}=e,o=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":o,onClick:()=>a(t),className:s(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f.pressCard,o?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:s(`text-xs font-medium leading-none`,o?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=i,e[6]=a,e[7]=u):u=e[7];let d;e[8]===u?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:u}),e[8]=u,e[9]=d);let p;return e[10]!==c||e[11]!==d?(p=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[c,d]}),e[10]=c,e[11]=d,e[12]=p):p=e[12],p}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=l(L),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:c,isLoading:u}=m(!0),f=c?.payload?.config,p;e[2]===f?p=e[3]:(p=w(f),e[2]=f,e[3]=p);let h=p,[g,_]=(0,x.useState)(h),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===h?(D=e[5],O=e[6]):(D=()=>_(h),O=[h],e[4]=h,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==u||e[14]!==g||e[15]!==v?(M=u?(0,E.jsx)(d,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(i,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(a,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(a,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(a,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=u,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:s(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=l(V),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),a=_(z),s;e[2]===r.showRawToolDataTitle?s=e[3]:(s=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=s);let c;e[4]===r.showRawToolDataDescription?c=e[5]:(c=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=c);let u;e[6]!==s||e[7]!==c?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[s,c]}),e[6]=s,e[7]=c,e[8]=u):u=e[8];let d;e[9]===a?d=e[10]:(d=e=>a(e.target.checked),e[9]=a,e[10]=d);let f;e[11]!==i||e[12]!==d?(f=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:d}),e[11]=i,e[12]=d,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f?(p=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,f]})}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=l(U),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]===r.pageTitle?i=e[3]:(i=(0,E.jsx)(y,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=i);let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,E.jsx)(D,{children:(0,E.jsx)(h,{variant:`page`,sections:[`language`]})}),e[4]=a):a=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,E.jsxs)(D,{children:[(0,E.jsx)(h,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=s):s=e[5];let c;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsx)(R,{}),e[6]=c):c=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:c})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==i||e[10]!==u?(d=(0,E.jsxs)(v,{gap:`gap-6`,children:[i,a,s,u]}),e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as c}from"./arrow-left-D880xG-P.js";import{t as l}from"./box-DvYoGszj.js";import{n as u,t as d}from"./extension-paths-DvuaZJuy.js";import{t as f}from"./ellipsis-0k4rZLoy.js";import{t as p}from"./external-link-DjqjBmc3.js";import{t as m}from"./loader-circle-CifKLtgG.js";import{t as h}from"./markdown-view-CJt-i2Dp.js";import{t as g}from"./package-wATCyihJ.js";import{t as _}from"./plus-Q2yW6OE7.js";import{t as v}from"./settings-uiTATseT.js";import{t as y}from"./shield-check-BU58siTV.js";import{t as b}from"./trash-2-DusmjVPV.js";import{t as x}from"./triangle-alert-2JXFNNKU.js";import{t as S}from"./x-B_N4OPjy.js";import{t as C}from"./messages-DRR9N3HC.js";import{t as w}from"./cn-0WouolD0.js";import{l as T,n as E}from"./locale-store-lIXD1FMw.js";import{a as D,i as O}from"./vendor-swr-CdRzEUwF.js";import{t as k}from"./button-CnRSIP6m.js";import{t as A}from"./skeleton-BI5TyibZ.js";import{a as j,i as M,o as N,r as P,s as F,t as I}from"./dist-DfWfZ9iu.js";import{i as L,o as R,r as z,s as B}from"./extension-provider-Byrd8Sor.js";import{n as V}from"./interaction-BdhHBbYa.js";import{o as H}from"./gateway-realtime-CsykKL4l.js";import{t as ee}from"./page-tabs-oeTY7z3_.js";import{t as U}from"./page-header-store-DH8K0xii.js";import{r as W}from"./settings-form-draft-Dy10ldo8.js";import{a as G,c as te,o as ne,r as K,t as q}from"./dist-DNCdG_qB.js";import{n as J,t as Y}from"./capability-links-DzQWK1Fh.js";import{t as re}from"./agent-plugin-dialog-CQ5LLDMO.js";import{t as X}from"./capability-icon-DVoZxEgW.js";import{a as Z,i as ie,n as ae,r as oe,t as se}from"./extension-marketplace-api-CVJPqJOB.js";import{n as ce,t as le}from"./capability-header-actions-CTUCuBlW.js";import{n as ue,r as de,t as fe}from"./plugin-presentation-CO5BFDGW.js";var pe=n(),me=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,he=`relative h-full min-w-0 rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover/30`,ge=`absolute inset-0 cursor-pointer rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,Q=e(t(),1);function _e(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ve(e,t){let n=e.find(e=>e.id===t||e.pluginId===t||e.provenance?.packageName===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var ye={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function be({className:e,query:t}){let n=s(),r=i(),a=E(e=>e.language),o=C(a).extensionsPage,c=T(e=>!!e.conversationId),l=z(),{mutate:d}=D(),[f,p]=(0,Q.useReducer)(W,ye),{debounced:h,detailPkg:_,quickInstallPkg:v,rowBusy:y,actionError:x,restartHint:S}=f,k=c?`marketplace-${h}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>p({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:j,isLoading:M,error:N}=O(k,()=>se(h),{revalidateOnFocus:!1}),P=(0,Q.useCallback)(()=>{d(`gateway-extensions-list`),H()},[d]),F=(0,Q.useCallback)(async(e,t)=>{p({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await oe({name:e,overwrite:t});P(),n.requiresGatewayRestart&&p({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw p({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceInstallFailed}}),e}finally{p({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceInstallFailed,o.marketplaceRestartHint,P]),I=(0,Q.useCallback)(async e=>{p({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await Z(e);P(),t.requiresGatewayRestart&&p({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw p({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceUninstallFailed}}),e}finally{p({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceRestartHint,o.marketplaceUninstallFailed,P]),L=j??[];return(0,$.jsxs)(`div`,{className:w(`flex flex-col gap-4`,e),children:[N?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:N instanceof Error?N.message:o.marketplaceLoadFailed}):null,x?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:x}):null,S?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:S}):null,M&&!j?(0,$.jsx)(`ul`,{className:me,"aria-label":o.marketplaceLoading,children:[0,1,2,3,4,5].map(e=>(0,$.jsxs)(`li`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(A,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(A,{className:`h-5 w-full`}),(0,$.jsx)(A,{className:`h-3 w-2/3`})]}),(0,$.jsx)(A,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(A,{className:`h-4 w-full`}),(0,$.jsx)(A,{className:`h-4 w-full`}),(0,$.jsx)(A,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:me,children:L.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:o.marketplaceEmpty}):L.map(e=>{let t=ve(l,e.id),i=y===e.id,s=l.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[a.startsWith(`zh`)?`zh-CN`:`en`],d=c?.displayName??e.name,f=c?.description??e.description;return(0,$.jsxs)(`li`,{className:he,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${d}, ${o.marketplaceDetailTitle}`,onClick:()=>s?.pluginId?n(Y(s.pluginId,`installed`,!1,r.pathname+r.search)):p({type:`patch`,patch:{detailPkg:e.id}}),className:ge}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:g}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:d,children:d}),e.verified?(0,$.jsx)(u,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null]}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[e.version?(0,$.jsxs)(`span`,{children:[`v`,e.version]}):null,t===`user`?(0,$.jsx)(`span`,{className:s&&de(s)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:s&&de(s)?a.startsWith(`zh`)?`需要授权`:`Authorization required`:o.marketplaceInstalled}):null]})]}),(0,$.jsx)(`div`,{role:`group`,className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:o.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>s?.pluginId&&fe(s)?n(J(d,a.startsWith(`zh`))):s?.pluginId?n(Y(s.pluginId,`installed`,de(s),r.pathname+r.search)):p({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:w(`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:s&&de(s)?a.startsWith(`zh`)?`去授权`:`Connect account`:s&&fe(s)?a.startsWith(`zh`)?`开始使用`:`Start using`:a.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(o.marketplaceUninstallConfirm)&&I(e.id).catch(()=>{})},className:w(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,$.jsx)(m,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(b,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),o.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>p({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:w(`inline-flex min-w-16 items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:e.packageType===`plugin`?a.startsWith(`zh`)?`安装`:`Install`:o.marketplaceReview})})]}),f?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:f}):null,(e.categories?.length??0)>0?(0,$.jsx)(`div`,{className:`pointer-events-none relative mt-3 flex flex-wrap gap-1.5`,children:e.categories?.map(e=>(0,$.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-edge px-2 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]},e.id)})}),_?(0,$.jsx)(xe,{packageName:_,autoInstall:v===_,copy:o,extensions:l,onClose:()=>p({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:F,onUninstall:I}):null]})}function xe(e){let t=(0,pe.c)(98),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:s,onInstall:l,onUninstall:u}=e,[d,f]=(0,Q.useState)(!1),[p,g]=(0,Q.useState)(!1),_=T(Ee)?`ext-mp-detail-${n}`:null,v;t[0]===n?v=t[1]:(v=async()=>ae(n),t[0]=n,t[1]=v);let C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[2]=C):C=t[2];let{data:E,error:D,isLoading:k}=O(_,v,C),M;t[3]!==a||t[4]!==n?(M=ve(a,n),t[3]=a,t[4]=n,t[5]=M):M=t[5];let L=M,R=L===`user`,z=E?.manifest?.permissions,B,V,H,ee,U,W,G,te,ne,K,q,J;if(t[6]!==r||t[7]!==i||t[8]!==E||t[9]!==D||t[10]!==a||t[11]!==L||t[12]!==k||t[13]!==s||t[14]!==n||t[15]!==z||t[16]!==p){W=Symbol.for(`react.early_return_sentinel`);bb0:{let e=z&&typeof z==`object`&&!Array.isArray(z)?Object.entries(z):[],o;t[29]!==i||t[30]!==E?(o=E?.readme?.trim()||(E?.description?.trim()?`### ${E.name}\n\n${E.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=E,t[31]=o):o=t[31];let l=o;if(E?.format===`agent-plugin`){let e;if(t[32]!==E||t[33]!==a||t[34]!==n){let r;t[36]!==E||t[37]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===E.manifest?.name,t[36]=E,t[37]=n,t[38]=r):r=t[38],e=a.find(r),t[32]=E,t[33]=a,t[34]=n,t[35]=e}else e=t[35];let i=`store:${n}`,o;t[39]!==r||t[40]!==E||t[41]!==s||t[42]!==e||t[43]!==i?(o=(0,$.jsx)(re,{extension:e,initialSource:i,marketplace:E,autoInstall:r,onClose:s}),t[39]=r,t[40]=E,t[41]=s,t[42]=e,t[43]=i,t[44]=o):o=t[44],W=o;break bb0}H=I,ee=!0,t[45]===s?U=t[46]:(U=e=>!e&&s(),t[45]=s,t[46]=U),V=N,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(j,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[47]=J):J=t[47],B=P,ne=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,K=Te;let u;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(c,{className:`size-5`}),t[48]=u):u=t[48];let d;t[49]!==i.detailBack||t[50]!==s?(d=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailBack,children:u}),t[49]=i.detailBack,t[50]=s,t[51]=d):d=t[51];let f;t[52]===i.marketplaceDetailTitle?f=t[53]:(f=(0,$.jsx)(F,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[52]=i.marketplaceDetailTitle,t[53]=f);let m;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(S,{className:`size-5`}),t[54]=m):m=t[54];let _;t[55]!==i.detailClose||t[56]!==s?(_=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailClose,children:m}),t[55]=i.detailClose,t[56]=s,t[57]=_):_=t[57],t[58]!==d||t[59]!==f||t[60]!==_?(q=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[d,f,_]}),t[58]=d,t[59]=f,t[60]=_,t[61]=q):q=t[61],G=`min-h-0 flex-1 overflow-y-auto p-5`,te=k&&!E?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(A,{className:`h-6 w-48`}),(0,$.jsx)(A,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(A,{className:`h-12`}),(0,$.jsx)(A,{className:`h-12`})]}),(0,$.jsx)(A,{className:`h-28 w-full`}),(0,$.jsx)(A,{className:`h-36 w-full`})]}):D?(0,$.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,$.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:i.marketplaceDetailLoadFailed}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:D instanceof Error?D.message:i.marketplaceLoadFailed})]}):E?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:E.name}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:E.id})}),(0,$.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceAuthor}),(0,$.jsx)(`dd`,{children:E.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:E.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:E.downloads})]})]}),L===`bundled`?null:(0,$.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[E.installability.available?(0,$.jsx)(y,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(x,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:E.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:E.installability.available?i.marketplaceCodeRisk:E.installability.reason??i.marketplaceUnavailableBody})]})]}),E.installability.available?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceIntegrity}),(0,$.jsx)(`dd`,{children:i.marketplaceIntegrityVerified})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDependencies}),(0,$.jsx)(`dd`,{children:E.packageSummary?.dependencyCount??0})]})]}),(0,$.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.marketplacePermissions}),e.length>0?(0,$.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(we)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(E.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,E.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>g(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),E.readme?.trim()?(0,$.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:i.marketplaceDetailReadmeHeading}):null,(0,$.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,$.jsx)(h,{content:l})})]}):null}t[6]=r,t[7]=i,t[8]=E,t[9]=D,t[10]=a,t[11]=L,t[12]=k,t[13]=s,t[14]=n,t[15]=z,t[16]=p,t[17]=B,t[18]=V,t[19]=H,t[20]=ee,t[21]=U,t[22]=W,t[23]=G,t[24]=te,t[25]=ne,t[26]=K,t[27]=q,t[28]=J}else B=t[17],V=t[18],H=t[19],ee=t[20],U=t[21],W=t[22],G=t[23],te=t[24],ne=t[25],K=t[26],q=t[27],J=t[28];if(W!==Symbol.for(`react.early_return_sentinel`))return W;let Y;t[62]!==G||t[63]!==te?(Y=(0,$.jsx)(`div`,{className:G,children:te}),t[62]=G,t[63]=te,t[64]=Y):Y=t[64];let X;t[65]!==d||t[66]!==i.marketplaceBuiltinGoBuiltin||t[67]!==i.marketplaceBuiltinManageHint||t[68]!==i.marketplaceInstall||t[69]!==i.marketplaceReinstall||t[70]!==i.marketplaceReinstallConfirm||t[71]!==i.marketplaceUninstall||t[72]!==i.marketplaceUninstallConfirm||t[73]!==E||t[74]!==L||t[75]!==s||t[76]!==l||t[77]!==u||t[78]!==n||t[79]!==p||t[80]!==R?(X=E?(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:L===`bundled`?(0,$.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:i.marketplaceBuiltinManageHint}),(0,$.jsx)(o,{to:`/capabilities/extensions?tab=builtin`,onClick:s,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:i.marketplaceBuiltinGoBuiltin})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{type:`button`,disabled:d||!E.installability.available||!p,onClick:()=>{R&&!window.confirm(i.marketplaceReinstallConfirm)||(f(!0),l(n,R).catch(Ce).finally(()=>f(!1)))},className:w(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[d?(0,$.jsx)(m,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,R?i.marketplaceReinstall:i.marketplaceInstall]}),R?(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(f(!0),u(n).then(()=>s()).catch(Se).finally(()=>f(!1)))},className:w(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,$.jsx)(b,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[65]=d,t[66]=i.marketplaceBuiltinGoBuiltin,t[67]=i.marketplaceBuiltinManageHint,t[68]=i.marketplaceInstall,t[69]=i.marketplaceReinstall,t[70]=i.marketplaceReinstallConfirm,t[71]=i.marketplaceUninstall,t[72]=i.marketplaceUninstallConfirm,t[73]=E,t[74]=L,t[75]=s,t[76]=l,t[77]=u,t[78]=n,t[79]=p,t[80]=R,t[81]=X):X=t[81];let Z;t[82]!==B||t[83]!==Y||t[84]!==X||t[85]!==ne||t[86]!==K||t[87]!==q?(Z=(0,$.jsxs)(B,{className:ne,onOpenAutoFocus:K,children:[q,Y,X]}),t[82]=B,t[83]=Y,t[84]=X,t[85]=ne,t[86]=K,t[87]=q,t[88]=Z):Z=t[88];let ie;t[89]!==V||t[90]!==Z||t[91]!==J?(ie=(0,$.jsxs)(V,{children:[J,Z]}),t[89]=V,t[90]=Z,t[91]=J,t[92]=ie):ie=t[92];let oe;return t[93]!==H||t[94]!==ee||t[95]!==U||t[96]!==ie?(oe=(0,$.jsx)(H,{defaultOpen:ee,onOpenChange:U,children:ie}),t[93]=H,t[94]=ee,t[95]=U,t[96]=ie,t[97]=oe):oe=t[97],oe}function Se(){}function Ce(){}function we(e){let[t,n]=e;return(0,$.jsxs)(`li`,{className:`break-words`,children:[(0,$.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function Te(e){return e.preventDefault()}function Ee(e){return!!e.conversationId}function De({embedded:e=!1,onHeaderActionChange:t}){let n=s(),r=i(),c=E(e=>e.language),u=C(c),d=U(e=>e.setPageHeader),p=U(e=>e.clearPageHeader),m=z(),h=L(),[g,v]=a(),y=_e(g.get(`tab`)??(m.some(e=>e.source!==`bundled`)?`user`:null)),b=(0,Q.useRef)(!1),x=g.get(`q`)??``,[S,T]=(0,Q.useState)(y),[D,O]=(0,Q.useState)(x),[A,j]=(0,Q.useState)(null),[M,N]=(0,Q.useState)(!1),P=g.toString(),F=(0,Q.useRef)(P);if(F.current!==P){F.current=P;let e=_e(g.get(`tab`)),t=g.get(`q`)??``;T(t=>t===e?t:e),O(e=>e===t?e:t)}(0,Q.useEffect)(()=>{v(e=>{let t=new URLSearchParams(e),n=D.trim();return n?t.set(`q`,n):t.delete(`q`),S===`marketplace`?t.delete(`tab`):t.set(`tab`,S),t.toString()===e.toString()?e:t},{replace:!0})},[S,D,v]);let I=(0,Q.useMemo)(()=>m.filter(e=>e.source===`bundled`),[m]),R=(0,Q.useMemo)(()=>m.filter(e=>e.source!==`bundled`),[m]);(0,Q.useEffect)(()=>{h||b.current||(b.current=!0,!g.has(`tab`)&&R.length&&T(`user`))},[h,g,R.length]);let B=S===`builtin`?I:R,H=(0,Q.useMemo)(()=>{let e=D.trim().toLowerCase(),t=B;return e&&(t=t.filter(t=>(t.name??``).toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))),t.toSorted((e,t)=>e.hasUi===t.hasUi?(e.name||e.id).localeCompare(t.name||t.id,c):e.hasUi?-1:1)},[B,D,c]);(0,Q.useEffect)(()=>{j(e=>{if(!e)return e;let t=m.find(t=>t.id===e.id);return t?Oe(e)===Oe(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[m]);let W=(0,Q.useMemo)(()=>({searchLabel:S===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder,search:(0,$.jsx)(ce,{value:D,onChange:O,placeholder:S===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(ne,{children:[(0,$.jsx)(te,{asChild:!0,children:(0,$.jsx)(k,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":u.capabilitiesHub.moreActions,title:u.capabilitiesHub.moreActions,children:(0,$.jsx)(f,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(G,{children:(0,$.jsxs)(q,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,$.jsxs)(K,{className:w(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,V.transition),onSelect:()=>N(!0),children:[(0,$.jsx)(_,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),c.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(K,{asChild:!0,children:(0,$.jsxs)(o,{to:`/local-apps`,className:w(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,V.transition),children:[(0,$.jsx)(l,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),u.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(k,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(o,{to:`/local-apps/new`,"aria-label":u.extensionsPage.createLocalApp,children:[(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:u.extensionsPage.createLocalApp})]})})}),[c,u.capabilitiesHub.moreActions,u.extensionsPage,S,D]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(d({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:u.extensionsPage.title})}),end:(0,$.jsx)(le,{contribution:W})}),()=>p()),[p,e,W,u.extensionsPage.title,t,d]);let J=[{id:`user`,label:u.extensionsPage.tabUser,count:h?void 0:R.length},{id:`marketplace`,label:u.extensionsPage.tabMarketplace},{id:`builtin`,label:u.extensionsPage.tabBuiltin,count:h?void 0:I.length}];return(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:w(`mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8`,`pb-7 pt-3 lg:pb-9 lg:pt-4`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(ee,{items:J,activeTab:S,onChange:T,ariaLabel:u.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),S===`marketplace`?(0,$.jsx)(be,{query:D}):h?(0,$.jsx)(Fe,{}):S===`builtin`&&I.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyBuiltin}):S===`user`&&R.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyUser}):H.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:u.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:me,children:H.map(e=>(0,$.jsx)(je,{extension:e,copy:u.extensionsPage,onOpen:()=>e.pluginId?n(Y(e.pluginId,`installed`,!1,r.pathname+r.search)):j(e)},e.id))})]}),A?A.format===`agent-plugin`?(0,$.jsx)(re,{extension:A,onClose:()=>j(null)},A.id):(0,$.jsx)(Ne,{extension:A,copy:u.extensionsPage,onClose:()=>j(null)},A.id):null,M?(0,$.jsx)(re,{onClose:()=>N(!1)}):null]})}function Oe(e){return e.activationEligible??e.active}function ke(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Ae(e,t){let n=Oe(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function je(e){let t=(0,pe.c)(56),{extension:n,copy:r,onOpen:a}=e,o=E(Me),c,d;t[0]!==n||t[1]!==o?(d=o.startsWith(`zh`),c=ue(n,d),t[0]=n,t[1]=o,t[2]=c,t[3]=d):(c=t[2],d=t[3]);let f=c,p;t[4]===n?p=t[5]:(p=de(n),t[4]=n,t[5]=p);let m=p,h=n.localizations?.[d?`zh-CN`:`en`]?.description??n.description,g=s(),_=i(),v;t[6]===n?v=t[7]:(v=!!n.pluginId&&fe(n),t[6]=n,t[7]=v);let y=v,b=m?d?`去授权`:`Connect account`:y?d?`开始使用`:`Start using`:d?`管理插件`:`Manage plugin`,x;t[8]!==y||t[9]!==n.pluginId||t[10]!==_||t[11]!==f||t[12]!==g||t[13]!==m||t[14]!==a||t[15]!==d?(x=()=>{y?g(J(f,d)):m&&n.pluginId?g(Y(n.pluginId,`installed`,!0,_.pathname+_.search)):a()},t[8]=y,t[9]=n.pluginId,t[10]=_,t[11]=f,t[12]=g,t[13]=m,t[14]=a,t[15]=d,t[16]=x):x=t[16];let S=x,C=`${f}, ${r.marketplaceDetailTitle}`,w;t[17]!==a||t[18]!==C?(w=(0,$.jsx)(`button`,{type:`button`,"aria-label":C,onClick:a,className:ge}),t[17]=a,t[18]=C,t[19]=w):w=t[19];let T=n.branding?.iconUrl,D;t[20]===T?D=t[21]:(D=(0,$.jsx)(X,{iconUrl:T,fallback:l}),t[20]=T,t[21]=D);let O;t[22]===f?O=t[23]:(O=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:f,children:f}),t[22]=f,t[23]=O);let k;t[24]===n.provenance?.publisherVerification?k=t[25]:(k=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(u,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,t[24]=n.provenance?.publisherVerification,t[25]=k);let A;t[26]!==O||t[27]!==k?(A=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28];let j;t[29]===n.version?j=t[30]:(j=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=j);let M=m?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,N=m?d?`需要授权`:`Authorization required`:Oe(n)?r.statusEnabled:r.runStateOff,P;t[31]!==M||t[32]!==N?(P=(0,$.jsx)(`span`,{className:M,children:N}),t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;t[34]!==j||t[35]!==P?(F=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[j,P]}),t[34]=j,t[35]=P,t[36]=F):F=t[36];let I;t[37]!==A||t[38]!==F?(I=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[A,F]}),t[37]=A,t[38]=F,t[39]=I):I=t[39];let L;t[40]!==b||t[41]!==S?(L=(0,$.jsx)(`div`,{className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:(0,$.jsx)(`button`,{type:`button`,onClick:S,className:`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg transition-colors hover:bg-surface-hover active:scale-[0.98] active:bg-surface-hover/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:b})}),t[40]=b,t[41]=S,t[42]=L):L=t[42];let R;t[43]!==I||t[44]!==L||t[45]!==D?(R=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[D,I,L]}),t[43]=I,t[44]=L,t[45]=D,t[46]=R):R=t[46];let z;t[47]!==r.cardNoDescription||t[48]!==h?(z=h?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=h,t[49]=z):z=t[49];let B;t[50]===z?B=t[51]:(B=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:z}),t[50]=z,t[51]=B);let V;return t[52]!==R||t[53]!==B||t[54]!==w?(V=(0,$.jsxs)(`article`,{className:he,children:[w,R,B]}),t[52]=R,t[53]=B,t[54]=w,t[55]=V):V=t[55],V}function Me(e){return e.language}function Ne({extension:e,copy:t,onClose:n}){let{mutate:r}=D(),[i,a]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(null),[u,f]=(0,Q.useState)(!1),h=e.activationEligible===!0,g=(0,Q.useCallback)(async()=>{l(null),f(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ie({extensionId:e.id,enabled:!h});await r(`gateway-extensions-list`),H(),f(t)}catch(e){l(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[h,t.extensionToggleFailed,e.id,r]),_=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){l(null),f(!1),a(`uninstall`);try{await Z(e.id),await r(`gateway-extensions-list`),H(),n()}catch(e){l(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),y=e.ui?.contributions?.pages??[],x=e.ui?.contributions?.settingsPanels??[],C=e.ui?.contributions?.chatWidgets??[],T=y.find(e=>e.showInNav)??y[0],E=x[0],O=T?d(e.id,T):null,A=E?`/settings/ext/${e.id}/${E.id}`:e.hasConfigSchema||R(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(I,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(N,{children:[(0,$.jsx)(j,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(P,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,$.jsx)(c,{className:`size-5`})}),(0,$.jsx)(F,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(M,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,$.jsx)(S,{className:`size-5`})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,ke(e,t)]}),e.version?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,$.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Ae(e,t)}),e.source===`bundled`?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}):null,(0,$.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,$.jsx)(k,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void g(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):h?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,u?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null,e.source===`bundled`?null:(0,$.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,$.jsxs)(k,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void _(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(m,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(b,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(y.length>0||x.length>0||C.length>0)?(0,$.jsxs)(`section`,{className:`mt-8`,children:[(0,$.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(Pe,{template:t.badgePages,count:y.length,hidden:y.length===0}),(0,$.jsx)(Pe,{template:t.badgeSettings,count:x.length,hidden:x.length===0}),(0,$.jsx)(Pe,{template:t.badgeWidgets,count:C.length,hidden:C.length===0})]})]}):null,B(e)&&(O||A)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[O?(0,$.jsxs)(o,{to:O,onClick:n,className:w(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(p,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,A?(0,$.jsxs)(o,{to:A,onClick:n,className:w(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(v,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,$.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function Pe(e){let t=(0,pe.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function Fe(){let e=(0,pe.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:me,"aria-busy":`true`,children:Array.from({length:6},Ie)}),e[0]=t):t=e[0],t}function Ie(e,t){return(0,$.jsx)(A,{className:`h-32 rounded-xl`},t)}function Le(e){let t=(0,pe.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{De as ExtensionsPage};
@@ -1 +0,0 @@
1
- import{i as e,o as t}from"./locale-store-lIXD1FMw.js";var n={tasks:()=>t(e(`/api/tasks?limit=200`)),list:n=>{let r=new URLSearchParams;n?.projectId&&r.set(`projectId`,n.projectId);let i=r.toString();return t(e(`/api/automations${i?`?${i}`:``}`))},metrics:()=>t(e(`/api/automations/metrics`)),draft:(n,r=crypto.randomUUID())=>t(e(`/api/automations/draft`),{method:`POST`,headers:{"Idempotency-Key":r},body:JSON.stringify(n)}),simulate:n=>t(e(`/api/automations/simulate`),{method:`POST`,body:JSON.stringify(n)}),create:n=>t(e(`/api/automations`),{method:`POST`,body:JSON.stringify(n)}),update:(n,r)=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)}),remove:n=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`DELETE`}),runNow:n=>t(e(`/api/automations/${encodeURIComponent(n)}/run`),{method:`POST`}),pause:n=>t(e(`/api/automations/${encodeURIComponent(n)}/pause`),{method:`POST`}),resume:n=>t(e(`/api/automations/${encodeURIComponent(n)}/resume`),{method:`POST`}),runs:(n=50,r,i)=>{let a=new URLSearchParams({limit:String(n)});return r&&a.set(`automationId`,r),!r&&i?.projectId&&a.set(`projectId`,i.projectId),t(e(`/api/automation-runs?${a.toString()}`))},productEventRuns:n=>{let r=new URLSearchParams({eventType:n.eventType,limit:String(n.limit??5)});return n.source&&r.set(`source`,n.source),n.payloadKey&&r.set(`payloadKey`,n.payloadKey),n.payloadValue!==void 0&&r.set(`payloadValue`,n.payloadValue),t(e(`/api/automation-runs/product-events?${r.toString()}`))},events:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.type&&r.set(`type`,n.type),n.source&&r.set(`source`,n.source),t(e(`/api/automation-events?${r.toString()}`))},deliveries:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.runId&&r.set(`runId`,n.runId),n.status&&r.set(`status`,n.status),t(e(`/api/automation-deliveries?${r.toString()}`))},runEvents:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/events`)),rerun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/rerun`),{method:`POST`}),repairDraft:(n,r,i=crypto.randomUUID())=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/repair-draft`),{method:`POST`,headers:{"Idempotency-Key":i},body:JSON.stringify(r)}),cancelRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/cancel`),{method:`POST`}),markRunRead:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/read`),{method:`POST`}),markAllRunsRead:n=>t(e(`/api/automation-runs/read-all${n?`?projectId=${encodeURIComponent(n)}`:``}`),{method:`POST`})};export{n as t};
@@ -1,2 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-aKtaBQYM.js";var t=e((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),n=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronField=void 0,e.CronField=class e{#e=!1;#t=!1;#n=!1;#r=[];options={rawValue:``};static get min(){throw Error(`min must be overridden`)}static get max(){throw Error(`max must be overridden`)}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,n={rawValue:``}){if(!Array.isArray(t))throw Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...n,rawValue:n.rawValue??``},this.#r=t.sort(e.sorter),this.#n=this.options.wildcard===void 0?this.#i():this.options.wildcard,this.#e=this.options.rawValue.includes(`L`)||t.includes(`L`),this.#t=this.options.rawValue.includes(`?`)||t.includes(`?`)}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?e-t:!n&&!r?e.localeCompare(t):n?-1:1}static findNearestValueInList(e,t,n=!1){if(n){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null}for(let n=0;n<e.length;n++)if(e[n]>t)return e[n];return null}findNearestValue(e,t=!1){return this.constructor.findNearestValueInList(this.values,e,t)}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e,t=this.chars.length>0?` or chars ${this.chars.join(``)}`:``,n=e=>t=>RegExp(`^\\d{0,2}${t}$`).test(e);if(!this.#r.every(t=>(e=t,typeof t==`number`?t>=this.min&&t<=this.max:this.chars.some(n(t)))))throw Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${t}`);let r=this.#r.find((e,t)=>this.#r.indexOf(e)!==t);if(r)throw Error(`${this.constructor.name} Validation error, duplicate values found: ${r}`)}#i(){return this.options.rawValue.length>0?[`*`,`?`].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).every(e=>this.#r.includes(e))}}})),r=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=n(),r=1,i=31,a=Object.freeze([`L`]);e.CronDayOfMonth=class extends t.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),i=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=n(),r=0,i=7,a=Object.freeze([`L`]);e.CronDayOfWeek=class extends t.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}})),a=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=n(),r=0,i=23,a=Object.freeze([]);e.CronHour=class extends t.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),o=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=n(),r=0,i=59,a=Object.freeze([]);e.CronMinute=class extends t.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),s=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{},n=class extends t{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},r=class extends t{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},i=class extends t{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},a=class extends t{},o=class extends t{constructor(e){super(`Invalid unit ${e}`)}},s=class extends t{},c=class extends t{constructor(){super(`Zone is an abstract class`)}},l=`numeric`,u=`short`,d=`long`,f={year:l,month:l,day:l},p={year:l,month:u,day:l},m={year:l,month:u,day:l,weekday:u},h={year:l,month:d,day:l},g={year:l,month:d,day:l,weekday:d},_={hour:l,minute:l},v={hour:l,minute:l,second:l},y={hour:l,minute:l,second:l,timeZoneName:u},b={hour:l,minute:l,second:l,timeZoneName:d},x={hour:l,minute:l,hourCycle:`h23`},ee={hour:l,minute:l,second:l,hourCycle:`h23`},te={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:u},S={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:d},ne={year:l,month:l,day:l,hour:l,minute:l},re={year:l,month:l,day:l,hour:l,minute:l,second:l},ie={year:l,month:u,day:l,hour:l,minute:l},ae={year:l,month:u,day:l,hour:l,minute:l,second:l},C={year:l,month:u,day:l,weekday:u,hour:l,minute:l},w={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},T={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},E={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},D={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},O=class{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}},oe=null,se=class e extends O{static get instance(){return oe===null&&(oe=new e),oe}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Nt(e,t,n)}formatOffset(e,t){return Lt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},ce=new Map;function le(e){let t=ce.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,era:`short`}),ce.set(e,t)),t}var ue={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function de(e,t){let n=e.format(t).replace(/\u200E/g,``),[,r,i,a,o,s,c,l]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n);return[a,r,i,o,s,c,l]}function fe(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=ue[t];t===`era`?r[a]=i:R(a)||(r[a]=parseInt(i,10))}return r}var pe=new Map,k=class e extends O{static create(t){let n=pe.get(t);return n===void 0&&pe.set(t,n=new e(t)),n}static resetCache(){pe.clear(),ce.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=e.isValidZone(t)}get type(){return`iana`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Nt(e,t,n,this.name)}formatOffset(e,t){return Lt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=le(this.name),[r,i,a,o,s,c,l]=n.formatToParts?fe(n,t):de(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=kt({year:r,month:i,day:a,hour:s===24?0:s,minute:c,second:l,millisecond:0}),d=+t,f=d%1e3;return d-=f>=0?f:1e3+f,(u-d)/(60*1e3)}equals(e){return e.type===`iana`&&e.name===this.name}get isValid(){return this.valid}},me={};function he(e,t={}){let n=JSON.stringify([e,t]),r=me[n];return r||(r=new Intl.ListFormat(e,t),me[n]=r),r}var ge=new Map;function _e(e,t={}){let n=JSON.stringify([e,t]),r=ge.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),ge.set(n,r)),r}var A=new Map;function ve(e,t={}){let n=JSON.stringify([e,t]),r=A.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),A.set(n,r)),r}var ye=new Map;function be(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=ye.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),ye.set(i,a)),a}var xe=null;function Se(){return xe||(xe=new Intl.DateTimeFormat().resolvedOptions().locale,xe)}var Ce=new Map;function we(e){let t=Ce.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Ce.set(e,t)),t}var Te=new Map;function Ee(e){let t=Te.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...Ie,...t}),Te.set(e,t)}return t}function De(e){let t=e.indexOf(`-x-`);t!==-1&&(e=e.substring(0,t));let n=e.indexOf(`-u-`);if(n===-1)return[e];{let t,r;try{t=_e(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=_e(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function Oe(e,t,n){return n||t?(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}function ke(e){let t=[];for(let n=1;n<=12;n++){let r=$.utc(2009,n,1);t.push(e(r))}return t}function Ae(e){let t=[];for(let n=1;n<=7;n++){let r=$.utc(2016,11,13+n);t.push(e(r))}return t}function je(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function Me(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||we(e.locale).numberingSystem===`latn`}var Ne=class{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){let t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=ve(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}else return H(this.floor?Math.floor(e):Tt(e,3),this.padTo)}},Pe=class{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type===`fixed`){let t=-1*(e.offset/60),n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;e.offset!==0&&k.create(n).valid?(r=n,this.dt=e):(r=`UTC`,this.dt=e.offset===0?e:e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type===`system`?this.dt=e:e.zone.type===`iana`?(this.dt=e,r=e.zone.name):(r=`UTC`,this.dt=e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=_e(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(``):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if(e.type===`timeZoneName`){let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}else return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Fe=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&&_t()&&(this.rtf=be(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):nn(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},Ie={firstDay:1,minimalDays:4,weekend:[6,7]},j=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){let o=t||F.defaultLocale,s=o||(a?`en-US`:Se()),c=n||F.defaultNumberingSystem,l=r||F.defaultOutputCalendar,u=St(i)||F.defaultWeekSettings;return new e(s,c,l,u,o)}static resetCache(){xe=null,ge.clear(),A.clear(),ye.clear(),Ce.clear(),Te.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return e.create(t,n,r,i)}constructor(e,t,n,r,i){let[a,o,s]=De(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=Oe(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached??=Me(this),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem===`latn`)&&(this.outputCalendar===null||this.outputCalendar===`gregory`);return e&&t?`en`:`intl`}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,St(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return je(this,e,Ht,()=>{let n=this.intl===`ja`||this.intl.startsWith(`ja-`);t&=!n;let r=t?{month:e,day:`numeric`}:{month:e},i=t?`format`:`standalone`;if(!this.monthsCache[i][e]){let t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,`month`);this.monthsCache[i][e]=ke(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return je(this,e,Kt,()=>{let n=t?{weekday:e,year:`numeric`,month:`long`,day:`numeric`}:{weekday:e},r=t?`format`:`standalone`;return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=Ae(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return je(this,void 0,()=>qt,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[$.utc(2016,11,13,9),$.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return je(this,e,Zt,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[$.utc(-40,1,1),$.utc(2017,1,1)].map(e=>this.extract(e,t,`era`))),this.eraCache[e]})}extract(e,t,n){let r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new Ne(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Pe(e,this.intl,t)}relFormatter(e={}){return new Fe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return he(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||we(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:vt()?Ee(this.locale):Ie}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Le=null,M=class e extends O{static get utcInstance(){return Le===null&&(Le=new e(0)),Le}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new e(Pt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${Lt(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${Lt(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return Lt(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type===`fixed`&&e.fixed===this.fixed}get isValid(){return!0}},Re=class extends O{constructor(e){super(),this.zoneName=e}get type(){return`invalid`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return``}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function N(e,t){if(R(e)||e===null)return t;if(e instanceof O)return e;if(ht(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?se.instance:n===`utc`||n===`gmt`?M.utcInstance:M.parseSpecifier(n)||k.create(e)}else if(z(e))return M.instance(e);else if(typeof e==`object`&&`offset`in e&&typeof e.offset==`function`)return e;else return new Re(e)}var ze={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},Be={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ve=ze.hanidec.replace(/[\[|\]]/g,``).split(``);function He(e){let t=parseInt(e,10);if(isNaN(t)){t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(e[n].search(ze.hanidec)!==-1)t+=Ve.indexOf(e[n]);else for(let e in Be){let[n,i]=Be[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}else return t}var Ue=new Map;function We(){Ue.clear()}function P({numberingSystem:e},t=``){let n=e||`latn`,r=Ue.get(n);r===void 0&&(r=new Map,Ue.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${ze[n]}${t}`),r.set(t,i)),i}var Ge=()=>Date.now(),Ke=`system`,qe=null,Je=null,Ye=null,Xe=60,Ze,Qe=null,F=class{static get now(){return Ge}static set now(e){Ge=e}static set defaultZone(e){Ke=e}static get defaultZone(){return N(Ke,se.instance)}static get defaultLocale(){return qe}static set defaultLocale(e){qe=e}static get defaultNumberingSystem(){return Je}static set defaultNumberingSystem(e){Je=e}static get defaultOutputCalendar(){return Ye}static set defaultOutputCalendar(e){Ye=e}static get defaultWeekSettings(){return Qe}static set defaultWeekSettings(e){Qe=St(e)}static get twoDigitCutoffYear(){return Xe}static set twoDigitCutoffYear(e){Xe=e%100}static get throwOnInvalid(){return Ze}static set throwOnInvalid(e){Ze=e}static resetCaches(){j.resetCache(),k.resetCache(),$.resetCache(),We()}},I=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},$e=[0,31,59,90,120,151,181,212,243,273,304,334],et=[0,31,60,91,121,152,182,213,244,274,305,335];function L(e,t){return new I(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function tt(e,t,n){let r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function nt(e,t,n){return n+(Et(e)?et:$e)[t-1]}function rt(e,t){let n=Et(e)?et:$e,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function it(e,t){return(e-t+7)%7+1}function at(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=nt(r,i,a),s=it(tt(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=jt(l,t,n)):c>jt(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...Rt(e)}}function ot(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=it(tt(r,1,t),n),s=Dt(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=Dt(l)):c>s?(l=r+1,c-=Dt(r)):l=r;let{month:u,day:d}=rt(l,c);return{year:l,month:u,day:d,...Rt(e)}}function st(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:nt(t,n,r),...Rt(e)}}function ct(e){let{year:t,ordinal:n}=e,{month:r,day:i}=rt(t,n);return{year:t,month:r,day:i,...Rt(e)}}function lt(e,t){if(!R(e.localWeekday)||!R(e.localWeekNumber)||!R(e.localWeekYear)){if(!R(e.weekday)||!R(e.weekNumber)||!R(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return R(e.localWeekday)||(e.weekday=e.localWeekday),R(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),R(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ut(e,t=4,n=1){let r=mt(e.weekYear),i=V(e.weekNumber,1,jt(e.weekYear,t,n)),a=V(e.weekday,1,7);return r?i?!a&&L(`weekday`,e.weekday):L(`week`,e.weekNumber):L(`weekYear`,e.weekYear)}function dt(e){let t=mt(e.year),n=V(e.ordinal,1,Dt(e.year));return t?!n&&L(`ordinal`,e.ordinal):L(`year`,e.year)}function ft(e){let t=mt(e.year),n=V(e.month,1,12),r=V(e.day,1,Ot(e.year,e.month));return t?n?!r&&L(`day`,e.day):L(`month`,e.month):L(`year`,e.year)}function pt(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=V(t,0,23)||t===24&&n===0&&r===0&&i===0,o=V(n,0,59),s=V(r,0,59),c=V(i,0,999);return a?o?s?!c&&L(`millisecond`,i):L(`second`,r):L(`minute`,n):L(`hour`,t)}function R(e){return e===void 0}function z(e){return typeof e==`number`}function mt(e){return typeof e==`number`&&e%1==0}function ht(e){return typeof e==`string`}function gt(e){return Object.prototype.toString.call(e)===`[object Date]`}function _t(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function vt(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function yt(e){return Array.isArray(e)?e:[e]}function bt(e,t,n){if(e.length!==0)return e.reduce((e,r)=>{let i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function xt(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function St(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!V(e.firstDay,1,7)||!V(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!V(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function V(e,t,n){return mt(e)&&e>=t&&e<=n}function Ct(e,t){return e-t*Math.floor(e/t)}function H(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function U(e){if(!(R(e)||e===null||e===``))return parseInt(e,10)}function W(e){if(!(R(e)||e===null||e===``))return parseFloat(e)}function wt(e){if(!(R(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function Tt(e,t,n=`round`){let r=10**t;switch(n){case`expand`:return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case`trunc`:return Math.trunc(e*r)/r;case`round`:return Math.round(e*r)/r;case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:throw RangeError(`Value rounding ${n} is out of range`)}}function Et(e){return e%4==0&&(e%100!=0||e%400==0)}function Dt(e){return Et(e)?366:365}function Ot(e,t){let n=Ct(t-1,12)+1,r=e+(t-n)/12;return n===2?Et(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function kt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function At(e,t,n){return-it(tt(e,1,t),n)+t-1}function jt(e,t=4,n=1){let r=At(e,t,n),i=At(e+1,t,n);return(Dt(e)-r+i)/7}function Mt(e){return e>99?e:e>F.twoDigitCutoffYear?1900+e:2e3+e}function Nt(e,t,n,r=null){let i=new Date(e),a={hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`};r&&(a.timeZone=r);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>e.type.toLowerCase()===`timezonename`);return s?s.value:null}function Pt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);let r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Ft(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function It(e,t){let n={};for(let r in e)if(B(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=Ft(i)}return n}function Lt(e,t){let n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?`+`:`-`;switch(t){case`short`:return`${i}${H(n,2)}:${H(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${H(n,2)}${H(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function Rt(e){return xt(e,[`hour`,`minute`,`second`,`millisecond`])}var zt=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Bt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Vt=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`];function Ht(e){switch(e){case`narrow`:return[...Vt];case`short`:return[...Bt];case`long`:return[...zt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`,`12`];case`2-digit`:return[`01`,`02`,`03`,`04`,`05`,`06`,`07`,`08`,`09`,`10`,`11`,`12`];default:return null}}var Ut=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],Wt=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Gt=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Kt(e){switch(e){case`narrow`:return[...Gt];case`short`:return[...Wt];case`long`:return[...Ut];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var qt=[`AM`,`PM`],Jt=[`Before Christ`,`Anno Domini`],Yt=[`BC`,`AD`],Xt=[`B`,`A`];function Zt(e){switch(e){case`narrow`:return[...Xt];case`short`:return[...Yt];case`long`:return[...Jt];default:return null}}function Qt(e){return qt[e.hour<12?0:1]}function $t(e,t){return Kt(t)[e.weekday-1]}function en(e,t){return Ht(t)[e.month-1]}function tn(e,t){return Zt(t)[e.year<0?0:1]}function nn(e,t,n=`always`,r=!1){let i={years:[`year`,`yr.`],quarters:[`quarter`,`qtr.`],months:[`month`,`mo.`],weeks:[`week`,`wk.`],days:[`day`,`day`,`days`],hours:[`hour`,`hr.`],minutes:[`minute`,`min.`],seconds:[`second`,`sec.`]},a=[`hours`,`minutes`,`seconds`].indexOf(e)===-1;if(n===`auto`&&a){let n=e===`days`;switch(t){case 1:return n?`tomorrow`:`next ${i[e][0]}`;case-1:return n?`yesterday`:`last ${i[e][0]}`;case 0:return n?`today`:`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),c=s===1,l=i[e],u=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function rn(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var an={D:f,DD:p,DDD:h,DDDD:g,t:_,tt:v,ttt:y,tttt:b,T:x,TT:ee,TTT:te,TTTT:S,f:ne,ff:ie,fff:w,ffff:E,F:re,FF:ae,FFF:T,FFFF:D},G=class e{static create(t,n={}){return new e(t,n)}static parseFormat(e){let t=null,n=``,r=!1,i=[];for(let a=0;a<e.length;a++){let o=e.charAt(a);o===`'`?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:n===``?`'`:n}),t=null,n=``,r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return an[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return H(e,t);let r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(t,n){let r=this.loc.listingMode()===`en`,i=this.loc.outputCalendar&&this.loc.outputCalendar!==`gregory`,a=(e,n)=>this.loc.extract(t,e,n),o=e=>t.isOffsetFixed&&t.offset===0&&e.allowZ?`Z`:t.isValid?t.zone.formatOffset(t.ts,e.format):``,s=()=>r?Qt(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?en(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?$t(t,e):a(n?{weekday:e}:{weekday:e,month:`long`,day:`numeric`},`weekday`),u=n=>{let r=e.macroTokenToFormatOpts(n);return r?this.formatWithSystemDefault(t,r):n},d=e=>r?tn(t,e):a({era:e},`era`);return rn(e.parseFormat(n),e=>{switch(e){case`S`:return this.num(t.millisecond);case`u`:case`SSS`:return this.num(t.millisecond,3);case`s`:return this.num(t.second);case`ss`:return this.num(t.second,2);case`uu`:return this.num(Math.floor(t.millisecond/10),2);case`uuu`:return this.num(Math.floor(t.millisecond/100));case`m`:return this.num(t.minute);case`mm`:return this.num(t.minute,2);case`h`:return this.num(t.hour%12==0?12:t.hour%12);case`hh`:return this.num(t.hour%12==0?12:t.hour%12,2);case`H`:return this.num(t.hour);case`HH`:return this.num(t.hour,2);case`Z`:return o({format:`narrow`,allowZ:this.opts.allowZ});case`ZZ`:return o({format:`short`,allowZ:this.opts.allowZ});case`ZZZ`:return o({format:`techie`,allowZ:this.opts.allowZ});case`ZZZZ`:return t.zone.offsetName(t.ts,{format:`short`,locale:this.loc.locale});case`ZZZZZ`:return t.zone.offsetName(t.ts,{format:`long`,locale:this.loc.locale});case`z`:return t.zoneName;case`a`:return s();case`d`:return i?a({day:`numeric`},`day`):this.num(t.day);case`dd`:return i?a({day:`2-digit`},`day`):this.num(t.day,2);case`c`:return this.num(t.weekday);case`ccc`:return l(`short`,!0);case`cccc`:return l(`long`,!0);case`ccccc`:return l(`narrow`,!0);case`E`:return this.num(t.weekday);case`EEE`:return l(`short`,!1);case`EEEE`:return l(`long`,!1);case`EEEEE`:return l(`narrow`,!1);case`L`:return i?a({month:`numeric`,day:`numeric`},`month`):this.num(t.month);case`LL`:return i?a({month:`2-digit`,day:`numeric`},`month`):this.num(t.month,2);case`LLL`:return c(`short`,!0);case`LLLL`:return c(`long`,!0);case`LLLLL`:return c(`narrow`,!0);case`M`:return i?a({month:`numeric`},`month`):this.num(t.month);case`MM`:return i?a({month:`2-digit`},`month`):this.num(t.month,2);case`MMM`:return c(`short`,!1);case`MMMM`:return c(`long`,!1);case`MMMMM`:return c(`narrow`,!1);case`y`:return i?a({year:`numeric`},`year`):this.num(t.year);case`yy`:return i?a({year:`2-digit`},`year`):this.num(t.year.toString().slice(-2),2);case`yyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,4);case`yyyyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,6);case`G`:return d(`short`);case`GG`:return d(`long`);case`GGGGG`:return d(`narrow`);case`kk`:return this.num(t.weekYear.toString().slice(-2),2);case`kkkk`:return this.num(t.weekYear,4);case`W`:return this.num(t.weekNumber);case`WW`:return this.num(t.weekNumber,2);case`n`:return this.num(t.localWeekNumber);case`nn`:return this.num(t.localWeekNumber,2);case`ii`:return this.num(t.localWeekYear.toString().slice(-2),2);case`iiii`:return this.num(t.localWeekYear,4);case`o`:return this.num(t.ordinal);case`ooo`:return this.num(t.ordinal,3);case`q`:return this.num(t.quarter);case`qq`:return this.num(t.quarter,2);case`X`:return this.num(Math.floor(t.ts/1e3));case`x`:return this.num(t.ts);default:return u(e)}})}formatDurationFromString(t,n){let r=this.opts.signMode===`negativeLargestOnly`?-1:1,i=e=>{switch(e[0]){case`S`:return`milliseconds`;case`s`:return`seconds`;case`m`:return`minutes`;case`h`:return`hours`;case`d`:return`days`;case`w`:return`weeks`;case`M`:return`months`;case`y`:return`years`;default:return null}},a=(e,t)=>n=>{let a=i(n);if(a){let i=t.isNegativeDuration&&a!==t.largestUnit?r:1,o;return o=this.opts.signMode===`negativeLargestOnly`&&a!==t.largestUnit?`never`:this.opts.signMode===`all`?`always`:`auto`,this.num(e.get(a)*i,n.length,o)}else return n},o=e.parseFormat(n),s=o.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),c=t.shiftTo(...s.map(i).filter(e=>e));return rn(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},on=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function sn(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function cn(...e){return t=>e.reduce(([e,n,r],i)=>{let[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function ln(e,...t){if(e==null)return[null,null];for(let[n,r]of t){let t=n.exec(e);if(t)return r(t)}return[null,null]}function un(...e){return(t,n)=>{let r={},i;for(i=0;i<e.length;i++)r[e[i]]=U(t[n+i]);return[r,null,n+i]}}var dn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,fn=`(?:${dn.source}?(?:\\[(${on.source})\\])?)?`,pn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,mn=RegExp(`${pn.source}${fn}`),hn=RegExp(`(?:[Tt]${mn.source})?`),gn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,_n=/(\d{4})-?W(\d\d)(?:-?(\d))?/,vn=/(\d{4})-?(\d{3})/,yn=un(`weekYear`,`weekNumber`,`weekDay`),bn=un(`year`,`ordinal`),xn=/(\d{4})-(\d\d)-(\d\d)/,Sn=RegExp(`${pn.source} ?(?:${dn.source}|(${on.source}))?`),Cn=RegExp(`(?: ${Sn.source})?`);function wn(e,t,n){let r=e[t];return R(r)?n:U(r)}function Tn(e,t){return[{year:wn(e,t),month:wn(e,t+1,1),day:wn(e,t+2,1)},null,t+3]}function En(e,t){return[{hours:wn(e,t,0),minutes:wn(e,t+1,0),seconds:wn(e,t+2,0),milliseconds:wt(e[t+3])},null,t+4]}function Dn(e,t){let n=!e[t]&&!e[t+1],r=Pt(e[t+1],e[t+2]);return[{},n?null:M.instance(r),t+3]}function On(e,t){return[{},e[t]?k.create(e[t]):null,t+1]}var kn=RegExp(`^T?${pn.source}$`),An=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function jn(e){let[t,n,r,i,a,o,s,c,l]=e,u=t[0]===`-`,d=c&&c[0]===`-`,f=(e,t=!1)=>e!==void 0&&(t||e&&u)?-e:e;return[{years:f(W(n)),months:f(W(r)),weeks:f(W(i)),days:f(W(a)),hours:f(W(o)),minutes:f(W(s)),seconds:f(W(c),c===`-0`),milliseconds:f(wt(l),d)}]}var Mn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Nn(e,t,n,r,i,a,o){let s={year:t.length===2?Mt(U(t)):U(t),month:Bt.indexOf(n)+1,day:U(r),hour:U(i),minute:U(a)};return o&&(s.second=U(o)),e&&(s.weekday=e.length>3?Ut.indexOf(e)+1:Wt.indexOf(e)+1),s}var Pn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Fn(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=Nn(t,i,r,n,a,o,s),p;return p=c?Mn[c]:l?0:Pt(u,d),[f,new M(p)]}function In(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var Ln=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Rn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,zn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Bn(e){let[,t,n,r,i,a,o,s]=e;return[Nn(t,i,r,n,a,o,s),M.utcInstance]}function Vn(e){let[,t,n,r,i,a,o,s]=e;return[Nn(t,s,n,r,i,a,o),M.utcInstance]}var Hn=sn(gn,hn),Un=sn(_n,hn),Wn=sn(vn,hn),Gn=sn(mn),Kn=cn(Tn,En,Dn,On),qn=cn(yn,En,Dn,On),Jn=cn(bn,En,Dn,On),Yn=cn(En,Dn,On);function Xn(e){return ln(e,[Hn,Kn],[Un,qn],[Wn,Jn],[Gn,Yn])}function Zn(e){return ln(In(e),[Pn,Fn])}function Qn(e){return ln(e,[Ln,Bn],[Rn,Bn],[zn,Vn])}function $n(e){return ln(e,[An,jn])}var er=cn(En);function tr(e){return ln(e,[kn,er])}var nr=sn(xn,Cn),rr=sn(Sn),ir=cn(En,Dn,On);function ar(e){return ln(e,[nr,Kn],[rr,ir])}var or=`Invalid Duration`,sr={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cr={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...sr},K=146097/400,lr=146097/4800,ur={years:{quarters:4,months:12,weeks:K/7,days:K,hours:K*24,minutes:K*24*60,seconds:K*24*60*60,milliseconds:K*24*60*60*1e3},quarters:{months:3,weeks:K/28,days:K/4,hours:K*24/4,minutes:K*24*60/4,seconds:K*24*60*60/4,milliseconds:K*24*60*60*1e3/4},months:{weeks:lr/7,days:lr,hours:lr*24,minutes:lr*24*60,seconds:lr*24*60*60,milliseconds:lr*24*60*60*1e3},...sr},q=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],dr=q.slice(0).reverse();function J(e,t,n=!1){return new Y({values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix})}function fr(e,t){let n=t.milliseconds??0;for(let r of dr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function pr(e,t){let n=fr(e,t)<0?-1:1;q.reduceRight((r,i)=>{if(R(t[i]))return r;if(r){let a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),q.reduce((n,r)=>{if(R(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function mr(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var Y=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?ur:cr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||j.create(),this.conversionAccuracy=t?`longterm`:`casual`,this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,n){return e.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(typeof t!=`object`||!t)throw new s(`Duration.fromObject: argument expected to be an object, got ${t===null?`null`:typeof t}`);return new e({values:It(t,e.normalizeUnit),loc:j.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(z(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t==`object`)return e.fromObject(t);throw new s(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){let[r]=$n(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){let[r]=tr(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Duration is invalid`);let r=t instanceof I?t:new I(t,n);if(F.throwOnInvalid)throw new i(r);return new e({invalid:r})}static normalizeUnit(e){let t={year:`years`,years:`years`,quarter:`quarters`,quarters:`quarters`,month:`months`,months:`months`,week:`weeks`,weeks:`weeks`,day:`days`,days:`days`,hour:`hours`,hours:`hours`,minute:`minutes`,minutes:`minutes`,second:`seconds`,seconds:`seconds`,millisecond:`milliseconds`,milliseconds:`milliseconds`}[e&&e.toLowerCase()];if(!t)throw new o(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?G.create(this.loc,n).formatDurationFromString(this,e):or}toHuman(e={}){if(!this.isValid)return or;let t=e.showZeros!==!1,n=q.map(n=>{let r=this.values[n];return R(r)||r===0&&!t?null:this.loc.numberFormatter({style:`unit`,unitDisplay:`long`,...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:`conjunction`,style:e.listStyle||`narrow`,...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e=`P`;return this.years!==0&&(e+=this.years+`Y`),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+`M`),this.weeks!==0&&(e+=this.weeks+`W`),this.days!==0&&(e+=this.days+`D`),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+=`T`),this.hours!==0&&(e+=this.hours+`H`),this.minutes!==0&&(e+=this.minutes+`M`),(this.seconds!==0||this.milliseconds!==0)&&(e+=Tt(this.seconds+this.milliseconds/1e3,3)+`S`),e===`P`&&(e+=`T0S`),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:`extended`,...e,includeOffset:!1},$.fromMillis(t,{zone:`UTC`}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?fr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t),r={};for(let e of q)(B(n.values,e)||B(this.values,e))&&(r[e]=n.get(e)+this.get(e));return J(this,{values:r},!0)}minus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let n of Object.keys(this.values))t[n]=Ft(e(this.values[n],n));return J(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...It(t,e.normalizeUnit)};return J(this,{values:n})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){let i={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return J(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return pr(this.matrix,e),J(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=mr(this.normalize().shiftToAll().toObject());return J(this,{values:e},!0)}shiftTo(...t){if(!this.isValid||t.length===0)return this;t=t.map(t=>e.normalizeUnit(t));let n={},r={},i=this.toObject(),a;for(let e of q)if(t.indexOf(e)>=0){a=e;let t=0;for(let n in r)t+=this.matrix[n][e]*r[n],r[n]=0;z(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else z(i[e])&&(r[e]=i[e]);for(let e in r)r[e]!==0&&(n[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return pr(this.matrix,n),J(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo(`years`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return J(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=mr(this.values);return J(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(e,t){return e===void 0||e===0?t===void 0||t===0:e===t}for(let n of q)if(!t(this.values[n],e.values[n]))return!1;return!0}},hr=`Invalid Interval`;function gr(e,t){return!e||!e.isValid?_r.invalid(`missing or invalid start`):!t||!t.isValid?_r.invalid(`missing or invalid end`):t<e?_r.invalid(`end before start`,`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}var _r=class e{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Interval is invalid`);let i=t instanceof I?t:new I(t,n);if(F.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=_i(t),i=_i(n);return gr(r,i)??new e({start:r,end:i})}static after(t,n){let r=Y.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=Y.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i.minus(r),i)}static fromISO(t,n){let[r,i]=(t||``).split(`/`,2);if(r&&i){let t,a;try{t=$.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=$.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=Y.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=Y.fromISO(r,n);if(t.isValid)return e.before(o,t)}}return e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e=`milliseconds`){return this.isValid?this.toDuration(e).get(e):NaN}count(e=`milliseconds`,t){if(!this.isValid)return NaN;let n=this.start.startOf(e,t),r;return r=t!=null&&t.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:t,end:n}={}){return this.isValid?e.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];let n=t.map(_i).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:i}=this,a=0;for(;i<this.e;){let t=n[a]||this.e,o=+t>+this.e?this.e:t;r.push(e.fromDateTimes(i,o)),i=o,a+=1}return r}splitBy(t){let n=Y.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as(`milliseconds`)===0)return[];let{s:r}=this,i=1,a,o=[];for(;r<this.e;){let t=this.start.plus(n.mapUnits(e=>e*i));a=+t>+this.e?this.e:t,o.push(e.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(t){if(!this.isValid)return this;let n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:e.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;let n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return e.fromDateTimes(n,r)}static merge(e){let[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(t){let n=null,r=0,i=[],a=t.map(e=>[{time:e.s,type:`s`},{time:e.e,type:`e`}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(let t of o)r+=t.type===`s`?1:-1,r===1?n=t.time:(n&&+n!=+t.time&&i.push(e.fromDateTimes(n,t.time)),n=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:hr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?G.create(this.s.loc.clone(t),e).formatInterval(this):hr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:hr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:hr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:hr}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:hr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Y.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},vr=class{static hasDST(e=F.defaultZone){let t=$.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return k.isValidZone(e)}static normalizeZone(e){return N(e,F.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||j.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||j.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||j.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||j.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||j.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||j.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||j.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return j.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return j.create(t,null,`gregory`).eras(e)}static features(){return{relative:_t(),localeWeek:vt()}}};function yr(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(Y.fromMillis(r).as(`days`))}function br(e,t,n){let r=[[`years`,(e,t)=>t.year-e.year],[`quarters`,(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],[`months`,(e,t)=>t.month-e.month+(t.year-e.year)*12],[`weeks`,(e,t)=>{let n=yr(e,t);return(n-n%7)/7}],[`days`,yr]],i={},a=e,o,s;for(let[c,l]of r)n.indexOf(c)>=0&&(o=c,i[c]=l(e,t),s=a.plus(i),s>t?(i[c]--,e=a.plus(i),e>t&&(s=e,i[c]--,e=a.plus(i))):e=s);return[e,i,s,o]}function xr(e,t,n,r){let[i,a,o,s]=br(e,t,n),c=t-i,l=n.filter(e=>[`hours`,`minutes`,`seconds`,`milliseconds`].indexOf(e)>=0);l.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+c/(o-i)));let u=Y.fromObject(a,r);return l.length>0?Y.fromMillis(c,r).shiftTo(...l).plus(u):u}var Sr=`missing Intl.DateTimeFormat.formatToParts support`;function X(e,t=e=>e){return{regex:e,deser:([e])=>t(He(e))}}var Cr=`[ \xA0]`,wr=new RegExp(Cr,`g`);function Tr(e){return e.replace(/\./g,`\\.?`).replace(wr,Cr)}function Er(e){return e.replace(/\./g,``).replace(wr,` `).toLowerCase()}function Z(e,t){return e===null?null:{regex:RegExp(e.map(Tr).join(`|`)),deser:([n])=>e.findIndex(e=>Er(n)===Er(e))+t}}function Dr(e,t){return{regex:e,deser:([,e,t])=>Pt(e,t),groups:t}}function Or(e){return{regex:e,deser:([e])=>e}}function kr(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function Ar(e,t){let n=P(t),r=P(t,`{2}`),i=P(t,`{3}`),a=P(t,`{4}`),o=P(t,`{6}`),s=P(t,`{1,2}`),c=P(t,`{1,3}`),l=P(t,`{1,6}`),u=P(t,`{1,9}`),d=P(t,`{2,4}`),f=P(t,`{4,6}`),p=e=>({regex:RegExp(kr(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return Z(t.eras(`short`),0);case`GG`:return Z(t.eras(`long`),0);case`y`:return X(l);case`yy`:return X(d,Mt);case`yyyy`:return X(a);case`yyyyy`:return X(f);case`yyyyyy`:return X(o);case`M`:return X(s);case`MM`:return X(r);case`MMM`:return Z(t.months(`short`,!0),1);case`MMMM`:return Z(t.months(`long`,!0),1);case`L`:return X(s);case`LL`:return X(r);case`LLL`:return Z(t.months(`short`,!1),1);case`LLLL`:return Z(t.months(`long`,!1),1);case`d`:return X(s);case`dd`:return X(r);case`o`:return X(c);case`ooo`:return X(i);case`HH`:return X(r);case`H`:return X(s);case`hh`:return X(r);case`h`:return X(s);case`mm`:return X(r);case`m`:return X(s);case`q`:return X(s);case`qq`:return X(r);case`s`:return X(s);case`ss`:return X(r);case`S`:return X(c);case`SSS`:return X(i);case`u`:return Or(u);case`uu`:return Or(s);case`uuu`:return X(n);case`a`:return Z(t.meridiems(),0);case`kkkk`:return X(a);case`kk`:return X(d,Mt);case`W`:return X(s);case`WW`:return X(r);case`E`:case`c`:return X(n);case`EEE`:return Z(t.weekdays(`short`,!1),1);case`EEEE`:return Z(t.weekdays(`long`,!1),1);case`ccc`:return Z(t.weekdays(`short`,!0),1);case`cccc`:return Z(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return Dr(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return Dr(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return Or(/[a-z_+-/]{1,256}?/i);case` `:return Or(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:Sr};return m.token=e,m}var jr={year:{"2-digit":`yy`,numeric:`yyyyy`},month:{numeric:`M`,"2-digit":`MM`,short:`MMM`,long:`MMMM`},day:{numeric:`d`,"2-digit":`dd`},weekday:{short:`EEE`,long:`EEEE`},dayperiod:`a`,dayPeriod:`a`,hour12:{numeric:`h`,"2-digit":`hh`},hour24:{numeric:`H`,"2-digit":`HH`},minute:{numeric:`m`,"2-digit":`mm`},second:{numeric:`s`,"2-digit":`ss`},timeZoneName:{long:`ZZZZZ`,short:`ZZZ`}};function Mr(e,t,n){let{type:r,value:i}=e;if(r===`literal`){let e=/^\s+$/.test(i);return{literal:!e,val:e?` `:i}}let a=t[r],o=r;r===`hour`&&(o=t.hour12==null?t.hourCycle==null?n.hour12?`hour12`:`hour24`:t.hourCycle===`h11`||t.hourCycle===`h12`?`hour12`:`hour24`:t.hour12?`hour12`:`hour24`);let s=jr[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function Nr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function Pr(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(B(n,i)){let a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}else return[r,{}]}function Fr(e){let t=e=>{switch(e){case`S`:return`millisecond`;case`s`:return`second`;case`m`:return`minute`;case`h`:case`H`:return`hour`;case`d`:return`day`;case`o`:return`ordinal`;case`L`:case`M`:return`month`;case`y`:return`year`;case`E`:case`c`:return`weekday`;case`W`:return`weekNumber`;case`k`:return`weekYear`;case`q`:return`quarter`;default:return null}},n=null,r;return R(e.z)||(n=k.create(e.z)),R(e.Z)||(n||=new M(e.Z),r=e.Z),R(e.q)||(e.M=(e.q-1)*3+1),R(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),R(e.u)||(e.S=wt(e.u)),[Object.keys(e).reduce((n,r)=>{let i=t(r);return i&&(n[i]=e[r]),n},{}),n,r]}var Ir=null;function Lr(){return Ir||=$.fromMillis(1555555555555),Ir}function Rr(e,t){if(e.literal)return e;let n=Ur(G.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function zr(e,t){return Array.prototype.concat(...e.map(e=>Rr(e,t)))}var Br=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=zr(G.parseFormat(t),e),this.units=this.tokens.map(t=>Ar(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=Nr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=Pr(e,this.regex,this.handlers),[r,i,o]=n?Fr(n):[null,null,void 0];if(B(n,`a`)&&B(n,`H`))throw new a(`Can't include meridiem when specifying 24-hour format`);return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function Vr(e,t,n){return new Br(e,n).explainFromTokens(t)}function Hr(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=Vr(e,t,n);return[r,i,a,o]}function Ur(e,t){if(!e)return null;let n=G.create(t,e).dtFormatter(Lr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>Mr(t,e,i))}var Wr=`Invalid DateTime`,Gr=864e13;function Kr(e){return new I(`unsupported zone`,`the zone "${e.name}" is not supported`)}function qr(e){return e.weekData===null&&(e.weekData=at(e.c)),e.weekData}function Jr(e){return e.localWeekData===null&&(e.localWeekData=at(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Q(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new $({...n,...t,old:n})}function Yr(e,t,n){let r=e-t*60*1e3,i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;let a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Xr(e,t){e+=t*60*1e3;let n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Zr(e,t,n){return Yr(kt(e),t,n)}function Qr(e,t){let n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,Ot(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=Y.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as(`milliseconds`),[s,c]=Yr(kt(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function $r(e,t,n,r,i,a){let{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){let r=t||s,i=$.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}else return $.invalid(new I(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function ei(e,t,n=!0){return e.isValid?G.create(j.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ti(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=H(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=H(e.c.month),n===`month`)return i;i+=`-`}else if(i+=H(e.c.month),n===`month`)return i;return i+=H(e.c.day),i}function ni(e,t,n,r,i,a,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,c=``;switch(o){case`day`:case`month`:case`year`:break;default:if(c+=H(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=H(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=H(e.c.second))}else{if(c+=H(e.c.minute),o===`minute`)break;s&&(c+=H(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=H(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=H(Math.trunc(-e.o/60)),c+=`:`,c+=H(Math.trunc(-e.o%60))):(c+=`+`,c+=H(Math.trunc(e.o/60)),c+=`:`,c+=H(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var ri={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ii={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ai={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oi=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],si=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],ci=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function li(e){let t={year:`year`,years:`year`,month:`month`,months:`month`,day:`day`,days:`day`,hour:`hour`,hours:`hour`,minute:`minute`,minutes:`minute`,quarter:`quarter`,quarters:`quarter`,second:`second`,seconds:`second`,millisecond:`millisecond`,milliseconds:`millisecond`,weekday:`weekday`,weekdays:`weekday`,weeknumber:`weekNumber`,weeksnumber:`weekNumber`,weeknumbers:`weekNumber`,weekyear:`weekYear`,weekyears:`weekYear`,ordinal:`ordinal`}[e.toLowerCase()];if(!t)throw new o(e);return t}function ui(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return li(e)}}function di(e){if(hi===void 0&&(hi=F.now()),e.type!==`iana`)return e.offset(hi);let t=e.name,n=gi.get(t);return n===void 0&&(n=e.offset(hi),gi.set(t,n)),n}function fi(e,t){let n=N(t.zone,F.defaultZone);if(!n.isValid)return $.invalid(Kr(n));let r=j.fromObject(t),i,a;if(R(e.year))i=F.now();else{for(let t of oi)R(e[t])&&(e[t]=ri[t]);let t=ft(e)||pt(e);if(t)return $.invalid(t);let r=di(n);[i,a]=Zr(e,r,n)}return new $({ts:i,zone:n,loc:r,o:a})}function pi(e,t,n){let r=R(n.round)?!0:n.round,i=R(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=Tt(e,r||n.calendary?0:2,n.calendary?`round`:i),t.loc.clone(n).relFormatter(n).format(e,a)),o=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(o(n.unit),n.unit);for(let e of n.units){let t=o(e);if(Math.abs(t)>=1)return a(t,e)}return a(e>t?-0:0,n.units[n.units.length-1])}function mi(e){let t={},n;return e.length>0&&typeof e[e.length-1]==`object`?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var hi,gi=new Map,$=class e{constructor(e){let t=e.zone||F.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new I(`invalid input`):null)||(t.isValid?null:Kr(t));this.ts=R(e.ts)?F.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{let a=z(e.o)&&!e.old?e.o:t.offset(this.ts);r=Xr(this.ts,a),n=Number.isNaN(r.year)?new I(`invalid input`):null,r=n?null:r,i=n?null:a}this._zone=t,this.loc=e.loc||j.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[e,t]=mi(arguments),[n,r,i,a,o,s,c]=t;return fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=mi(arguments),[n,r,i,a,o,s,c]=t;return e.zone=M.utcInstance,fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=gt(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=N(n.zone,F.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:j.fromObject(n)}):e.invalid(Kr(i))}static fromMillis(t,n={}){if(!z(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>Gr?e.invalid(`Timestamp out of range`):new e({ts:t,zone:N(n.zone,F.defaultZone),loc:j.fromObject(n)})}static fromSeconds(t,n={}){if(z(t))return new e({ts:t*1e3,zone:N(n.zone,F.defaultZone),loc:j.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=N(n.zone,F.defaultZone);if(!r.isValid)return e.invalid(Kr(r));let i=j.fromObject(n),o=It(t,ui),{minDaysInFirstWeek:s,startOfWeek:c}=lt(o,i),l=F.now(),u=R(n.specificOffset)?r.offset(l):n.specificOffset,d=!R(o.ordinal),f=!R(o.year),p=!R(o.month)||!R(o.day),m=f||p,h=o.weekYear||o.weekNumber;if((m||d)&&h)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(p&&d)throw new a(`Can't mix ordinal dates with month/day`);let g=h||o.weekday&&!m,_,v,y=Xr(l,u);g?(_=si,v=ii,y=at(y,s,c)):d?(_=ci,v=ai,y=st(y)):(_=oi,v=ri);let b=!1;for(let e of _){let t=o[e];R(t)?b?o[e]=v[e]:o[e]=y[e]:b=!0}let x=(g?ut(o,s,c):d?dt(o):ft(o))||pt(o);if(x)return e.invalid(x);let[ee,te]=Zr(g?ot(o,s,c):d?ct(o):o,u,r),S=new e({ts:ee,zone:r,o:te,loc:i});return o.weekday&&m&&t.weekday!==S.weekday?e.invalid(`mismatched weekday`,`you can't specify both a weekday of ${o.weekday} and a date of ${S.toISO()}`):S.isValid?S:e.invalid(S.invalid)}static fromISO(e,t={}){let[n,r]=Xn(e);return $r(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=Zn(e);return $r(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=Qn(e);return $r(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if(R(t)||R(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=Hr(j.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):$r(o,c,r,`format ${n}`,t,l)}static fromString(t,n,r={}){return e.fromFormat(t,n,r)}static fromSQL(e,t={}){let[n,r]=ar(e);return $r(n,r,t,`SQL`,e)}static invalid(t,r=null){if(!t)throw new s(`need to specify a reason the DateTime is invalid`);let i=t instanceof I?t:new I(t,r);if(F.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=Ur(e,j.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return zr(G.parseFormat(e),j.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){hi=void 0,gi.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?qr(this).weekYear:NaN}get weekNumber(){return this.isValid?qr(this).weekNumber:NaN}get weekday(){return this.isValid?qr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Jr(this).weekday:NaN}get localWeekNumber(){return this.isValid?Jr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Jr(this).weekYear:NaN}get ordinal(){return this.isValid?st(this.c).ordinal:NaN}get monthShort(){return this.isValid?vr.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?vr.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?vr.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?vr.weekdays(`long`,{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:`short`,locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:`long`,locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,t=6e4,n=kt(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];let s=n-a*t,c=n-o*t,l=Xr(s,a),u=Xr(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[Q(this,{ts:s}),Q(this,{ts:c})]:[this]}get isInLeapYear(){return Et(this.year)}get daysInMonth(){return Ot(this.year,this.month)}get daysInYear(){return this.isValid?Dt(this.year):NaN}get weeksInWeekYear(){return this.isValid?jt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?jt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=G.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(M.instance(e),t)}toLocal(){return this.setZone(F.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=N(t,F.defaultZone),t.equals(this.zone))return this;if(t.isValid){let e=this.ts;if(n||r){let n=t.offset(this.ts),r=this.toObject();[e]=Zr(r,n,t)}return Q(this,{ts:e,zone:t})}else return e.invalid(Kr(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return Q(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=It(e,ui),{minDaysInFirstWeek:n,startOfWeek:r}=lt(t,this.loc),i=!R(t.weekYear)||!R(t.weekNumber)||!R(t.weekday),o=!R(t.ordinal),s=!R(t.year),c=!R(t.month)||!R(t.day),l=s||c,u=t.weekYear||t.weekNumber;if((l||o)&&u)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(c&&o)throw new a(`Can't mix ordinal dates with month/day`);let d;i?d=ot({...at(this.c,n,r),...t},n,r):R(t.ordinal)?(d={...this.toObject(),...t},R(t.day)&&(d.day=Math.min(Ot(d.year,d.month),d.day))):d=ct({...st(this.c),...t});let[f,p]=Zr(d,this.o,this.zone);return Q(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=Y.fromDurationLike(e);return Q(this,Qr(this,t))}minus(e){if(!this.isValid)return this;let t=Y.fromDurationLike(e).negate();return Q(this,Qr(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=Y.normalizeUnit(e);switch(r){case`years`:n.month=1;case`quarters`:case`months`:n.day=1;case`weeks`:case`days`:n.hour=0;case`hours`:n.minute=0;case`minutes`:n.second=0;case`seconds`:n.millisecond=0;break}if(r===`weeks`)if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1;return r===`quarters`&&(n.month=(Math.ceil(this.month/3)-1)*3+1),this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?G.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Wr}toLocaleString(e=f,t={}){return this.isValid?G.create(this.loc.clone(t),e).formatDateTime(this):Wr}toLocaleParts(e={}){return this.isValid?G.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e=`extended`,suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:a=`milliseconds`}={}){if(!this.isValid)return null;a=li(a);let o=e===`extended`,s=ti(this,o,a);return oi.indexOf(a)>=3&&(s+=`T`),s+=ni(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?ti(this,e===`extended`,li(t)):null}toISOWeekDate(){return ei(this,`kkkk-'W'WW-c`)}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a=`extended`,precision:o=`milliseconds`}={}){return this.isValid?(o=li(o),(r&&oi.indexOf(o)>=3?`T`:``)+ni(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return ei(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return ei(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?ti(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r=`HH:mm:ss.SSS`;return(t||e)&&(n&&(r+=` `),t?r+=`z`:e&&(r+=`ZZ`)),ei(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Wr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t=`milliseconds`,n={}){if(!this.isValid||!e.isValid)return Y.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=yt(t).map(Y.normalizeUnit),a=e.valueOf()>this.valueOf(),o=xr(a?this:e,a?e:this,i,r);return a?o.negate():o}diffNow(t=`milliseconds`,n={}){return this.diff(e.now(),t,n)}until(e){return this.isValid?_r.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;let r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(t={}){if(!this.isValid)return null;let n=t.base||e.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0,i=[`years`,`months`,`days`,`hours`,`minutes`,`seconds`],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),pi(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?pi(t.base||e.fromObject({},{zone:this.zone}),this,{...t,numeric:`auto`,units:[`years`,`months`,`days`],calendary:!0}):null}static min(...t){if(!t.every(e.isDateTime))throw new s(`min requires all arguments be DateTimes`);return bt(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return bt(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return Vr(j.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(t,n,r={}){return e.fromFormatExplain(t,n,r)}static buildFormatParser(e,t={}){let{locale:n=null,numberingSystem:r=null}=t;return new Br(j.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if(R(t)||R(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=j.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new s(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:c,zone:l,specificOffset:u,invalidReason:d}=n.explainFromTokens(t);return d?e.invalid(d):$r(c,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return f}static get DATE_MED(){return p}static get DATE_MED_WITH_WEEKDAY(){return m}static get DATE_FULL(){return h}static get DATE_HUGE(){return g}static get TIME_SIMPLE(){return _}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return y}static get TIME_WITH_LONG_OFFSET(){return b}static get TIME_24_SIMPLE(){return x}static get TIME_24_WITH_SECONDS(){return ee}static get TIME_24_WITH_SHORT_OFFSET(){return te}static get TIME_24_WITH_LONG_OFFSET(){return S}static get DATETIME_SHORT(){return ne}static get DATETIME_SHORT_WITH_SECONDS(){return re}static get DATETIME_MED(){return ie}static get DATETIME_MED_WITH_SECONDS(){return ae}static get DATETIME_MED_WITH_WEEKDAY(){return C}static get DATETIME_FULL(){return w}static get DATETIME_FULL_WITH_SECONDS(){return T}static get DATETIME_HUGE(){return E}static get DATETIME_HUGE_WITH_SECONDS(){return D}};function _i(e){if($.isDateTime(e))return e;if(e&&e.valueOf&&z(e.valueOf()))return $.fromJSDate(e);if(e&&typeof e==`object`)return $.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=$,e.Duration=Y,e.FixedOffsetZone=M,e.IANAZone=k,e.Info=vr,e.Interval=_r,e.InvalidZone=Re,e.Settings=F,e.SystemZone=se,e.VERSION=`3.7.2`,e.Zone=O})),c=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=s(),n;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.Day=`Day`,e.Month=`Month`,e.Year=`Year`})(n||(e.TimeUnit=n={}));var r;(function(e){e.Add=`Add`,e.Subtract=`Subtract`})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var i=class i{#e;#t=null;#n=null;#r={add:{[n.Year]:this.addYear.bind(this),[n.Month]:this.addMonth.bind(this),[n.Day]:this.addDay.bind(this),[n.Hour]:this.addHour.bind(this),[n.Minute]:this.addMinute.bind(this),[n.Second]:this.addSecond.bind(this)},subtract:{[n.Year]:this.subtractYear.bind(this),[n.Month]:this.subtractMonth.bind(this),[n.Day]:this.subtractDay.bind(this),[n.Hour]:this.subtractHour.bind(this),[n.Minute]:this.subtractMinute.bind(this),[n.Second]:this.subtractSecond.bind(this)}};constructor(e,n){let r={zone:n};if(e?e instanceof i?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n):e instanceof Date?this.#e=t.DateTime.fromJSDate(e,r):typeof e==`number`?this.#e=t.DateTime.fromMillis(e,r):(this.#e=t.DateTime.fromISO(e,r),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(e,`EEE, d MMM yyyy HH:mm:ss`,r))):this.#e=t.DateTime.local(),!this.#e.isValid)throw Error(`CronDate: unhandled timestamp: ${e}`);n&&n!==this.#e.zoneName&&(this.#e=this.#e.setZone(n))}static#i(e){return e%4==0&&e%100!=0||e%400==0}get dstStart(){return this.#t}set dstStart(e){this.#t=e}get dstEnd(){return this.#n}set dstEnd(e){this.#n=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf(`month`)}addDay(){this.#e=this.#e.plus({days:1}).startOf(`day`)}addHour(){this.#e=this.#e.plus({hours:1}).startOf(`hour`)}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf(`minute`)}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf(`month`).startOf(`second`)}subtractDay(){this.#e=this.#e.minus({days:1}).endOf(`day`).startOf(`second`)}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf(`hour`).startOf(`second`)}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf(`minute`).startOf(`second`)}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){this.#r.add[e]()}subtractUnit(e){this.#r.subtract[e]()}invokeDateOperation(e,t){if(e===r.Add){this.addUnit(t);return}if(e===r.Subtract){this.subtractUnit(t);return}throw Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf(`day`)}setEndOfDay(){this.#e=this.#e.endOf(`day`)}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#a().day}getUTCFullYear(){return this.#a().year}getUTCDay(){let e=this.#a().weekday;return e===7?0:e}getUTCMonth(){return this.#a().month-1}getUTCHours(){return this.#a().hour}getUTCMinutes(){return this.#a().minute}getUTCSeconds(){return this.#a().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:t,month:n}=this.#e;if(n===2){let r=i.#i(this.#e.year);return t===e.DAYS_IN_MONTH[n-1]-+!r}return t===e.DAYS_IN_MONTH[n-1]}isLastWeekdayOfMonth(){let{day:t,month:n}=this.#e,r;return r=n===2?e.DAYS_IN_MONTH[n-1]-+!i.#i(this.#e.year):e.DAYS_IN_MONTH[n-1],t>r-7}applyDateOperation(e,t,r){if(t===n.Month||t===n.Day){this.invokeDateOperation(e,t);return}let i=this.getHours();this.invokeDateOperation(e,t);let a=this.getHours(),o=a-i;o===2?r!==24&&(this.dstStart=a):o===0&&this.getMinutes()===0&&this.getSeconds()===0&&r!==24&&(this.dstEnd=a)}#a(){return this.#e.toUTC()}};e.CronDate=i,e.default=i})),l=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=c(),r=n(),i=1,a=12,o=Object.freeze([]);e.CronMonth=class extends r.CronField{static get min(){return i}static get max(){return a}static get chars(){return o}static get daysInMonth(){return t.DAYS_IN_MONTH}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),u=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=n(),r=0,i=59,a=Object.freeze([]);e.CronSecond=class extends t.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),d=e((e=>{var s=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),c=e&&e.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&s(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),c(t(),e),c(r(),e),c(i(),e),c(n(),e),c(a(),e),c(o(),e),c(l(),e),c(u(),e)})),f=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=d();e.CronFieldCollection=class e{#e;#t;#n;#r;#i;#a;static from(n,r){return new e({second:this.resolveField(t.CronSecond,n.second,r.second),minute:this.resolveField(t.CronMinute,n.minute,r.minute),hour:this.resolveField(t.CronHour,n.hour,r.hour),dayOfMonth:this.resolveField(t.CronDayOfMonth,n.dayOfMonth,r.dayOfMonth),month:this.resolveField(t.CronMonth,n.month,r.month),dayOfWeek:this.resolveField(t.CronDayOfWeek,n.dayOfWeek,r.dayOfWeek)})}static resolveField(e,n,r){return r?r instanceof t.CronField?r:new e(r):n}constructor({second:e,minute:n,hour:r,dayOfMonth:i,month:a,dayOfWeek:o}){if(!e)throw Error(`Validation error, Field second is missing`);if(!n)throw Error(`Validation error, Field minute is missing`);if(!r)throw Error(`Validation error, Field hour is missing`);if(!i)throw Error(`Validation error, Field dayOfMonth is missing`);if(!a)throw Error(`Validation error, Field month is missing`);if(!o)throw Error(`Validation error, Field dayOfWeek is missing`);if(a.values.length===1&&!i.hasLastChar&&!(parseInt(i.values[0],10)<=t.CronMonth.daysInMonth[a.values[0]-1]))throw Error(`Invalid explicit day of month definition`);this.#e=e,this.#t=n,this.#n=r,this.#i=a,this.#a=o,this.#r=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#a}static compactField(e){if(e.length===0)return[];let t=[],n;return e.forEach((e,r,i)=>{if(n===void 0){n={start:e,count:1};return}let a=i[r-1]||n.start,o=i[r+1];if(e===`L`||e===`W`){t.push(n),t.push({start:e,count:1}),n=void 0;return}if(n.step===void 0&&o!==void 0){let t=e-a;if(t<=o-e){n={...n,count:2,end:e,step:t};return}n.step=1}e-(n.end??0)===n.step?(n.count++,n.end=e):(n.count===1?t.push({start:n.start,count:1}):n.count===2?(t.push({start:n.start,count:1}),t.push({start:n.end??a,count:1})):t.push(n),n={start:e,count:1})}),n&&t.push(n),t}static#o(e,t,n){let r=t.step;return r?r===1&&t.start===e.min&&t.end&&t.end>=n?e.hasQuestionMarkChar?`?`:`*`:r!==1&&t.start===e.min&&t.end&&t.end>=n-r+1?`*/${r}`:null:null}static#s(e,t){let n=e.step;if(n===1)return`${e.start}-${e.end}`;let r=e.start===0?e.count-1:e.count;if(!n)throw Error(`Unexpected range step`);if(!e.end)throw Error(`Unexpected range end`);if(n*r>e.end){let t=(t,r)=>{if(typeof e.start!=`number`)throw Error(`Unexpected range start`);return r%n===0?e.start+r:null};if(typeof e.start!=`number`)throw Error(`Unexpected range start`);let r={length:e.end-e.start+1};return Array.from(r,t).filter(e=>e!==null).join(`,`)}return e.end===t-n+1?`${e.start}/${n}`:`${e.start}-${e.end}/${n}`}stringifyField(n){let r=n.max,i=n.values;if(n instanceof t.CronDayOfWeek){r=6;let e=this.#a.values;i=e[e.length-1]===7?e.slice(0,-1):e}n instanceof t.CronDayOfMonth&&(r=this.#i.values.length===1?t.CronMonth.daysInMonth[this.#i.values[0]-1]:n.max);let a=e.compactField(i);if(a.length===1){let t=e.#o(n,a[0],r);if(t)return t}return a.map(i=>{let a=i.count===1?i.start.toString():e.#s(i,r);return n instanceof t.CronDayOfWeek&&n.nthDay>0?`${a}#${n.nthDay}`:a}).join(`,`)}stringify(e=!1){let t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#a)),t.join(` `)}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#a.serialize()}}}})),p=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var t=c();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=`Out of the time span range`,e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=`Invalid expression, loop limit exceeded`;var n=1e4,r=class r{#e;#t;#n;#r;#i;#a;#o=null;#s=!1;constructor(e,n){this.#e=n,this.#t=n.tz,this.#r=n.startDate?new t.CronDate(n.startDate,this.#t):null,this.#i=n.endDate?new t.CronDate(n.endDate,this.#t):null;let r=n.currentDate??n.startDate;if(r){let e=new t.CronDate(r,this.#t);this.#r&&e.getTime()<this.#r.getTime()?r=this.#r:this.#i&&e.getTime()>this.#i.getTime()&&(r=this.#i)}this.#n=new t.CronDate(r,this.#t),this.#a=e}get fields(){return this.#a}static fieldsToExpression(e,t){return new r(e,t||{})}static#c(e,t){return t.some(t=>t===e)}#l(e,t){return e[t?e.length-1:0]}#u(e){let n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#o===n)return this.#s;let r=new t.CronDate(e);r.setStartOfDay();let i=new t.CronDate(e);return i.setEndOfDay(),this.#o=n,this.#s=r.getUTCOffset()!==i.getUTCOffset(),this.#s}#d(e,n,r){let i=this.#a.second.values,a=e.getSeconds(),o=this.#a.second.findNearestValue(a,r);if(o!==null){e.setSeconds(o);return}e.applyDateOperation(n,t.TimeUnit.Minute,this.#a.hour.values.length),e.setSeconds(this.#l(i,r))}#f(e,n,r){let i=this.#a.minute.values,a=this.#a.second.values,o=e.getMinutes(),s=this.#a.minute.findNearestValue(o,r);if(s!==null){e.setMinutes(s),e.setSeconds(this.#l(a,r));return}e.applyDateOperation(n,t.TimeUnit.Hour,this.#a.hour.values.length),e.setMinutes(this.#l(i,r)),e.setSeconds(this.#l(a,r))}static#p(e,t){let n=t.isLastWeekdayOfMonth();return e.some(e=>{let r=parseInt(e.toString().charAt(0),10)%7;if(Number.isNaN(r))throw Error(`Invalid last weekday of the month expression: ${e}`);return t.getDay()===r&&n})}next(){return this.#_()}prev(){return this.#_(!0)}hasNext(){let e=this.#n;try{return this.#_(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#_(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let t=[];if(e>=0)for(let n=0;n<e;n++)try{t.push(this.next())}catch{return t}else for(let n=0;n>e;n--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#n=new t.CronDate(e||this.#e.currentDate)}stringify(e=!1){return this.#a.stringify(e)}includesDate(e){let{second:n,minute:r,hour:i,month:a}=this.#a,o=new t.CronDate(e,this.#t);return!(!n.values.includes(o.getSeconds())||!r.values.includes(o.getMinutes())||!i.values.includes(o.getHours())||!a.values.includes(o.getMonth()+1)||!this.#m(o)||this.#a.dayOfWeek.nthDay>0&&Math.ceil(o.getDate()/7)!==this.#a.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#m(e){let t=this.#a.dayOfMonth.isWildcard,n=!t,i=this.#a.dayOfWeek.isWildcard,a=!i,o=r.#c(e.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),s=r.#c(e.getDay(),this.#a.dayOfWeek.values)||this.#a.dayOfWeek.hasLastChar&&r.#p(this.#a.dayOfWeek.values,e);return!!(n&&a&&(o||s)||o&&!a||t&&!i&&s)}#h(e,n,i){let a=this.#a.hour.values,o=a,s=e.getHours(),c=r.#c(s,a),l=e.dstStart===s,u=e.dstEnd===s;if(l)return r.#c(s-1,a)?!0:(e.invokeDateOperation(n,t.TimeUnit.Hour),!1);if(u&&!i)return e.dstEnd=null,e.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,o.length),!1;if(c)return!0;e.dstStart=null;let d=this.#a.hour.findNearestValue(s,i);if(d===null)return e.applyDateOperation(n,t.TimeUnit.Day,o.length),!1;if(this.#u(e)){let r=i?s-d:d-s;for(let i=0;i<r;i++)e.applyDateOperation(n,t.TimeUnit.Hour,o.length)}else e.setHours(d);return e.setMinutes(this.#l(this.#a.minute.values,i)),e.setSeconds(this.#l(this.#a.second.values,i)),!1}#g(t){if(!this.#r&&!this.#i)return;let n=t.getTime();if(this.#r&&n<this.#r.getTime()||this.#i&&n>this.#i.getTime())throw Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#_(i=!1){let a=i?t.DateMathOp.Subtract:t.DateMathOp.Add,o=new t.CronDate(this.#n),s=o.getTime(),c=0;for(;++c<n;){if(this.#g(o),!this.#m(o)){o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!(this.#a.dayOfWeek.nthDay<=0||Math.ceil(o.getDate()/7)===this.#a.dayOfWeek.nthDay)){o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!r.#c(o.getMonth()+1,this.#a.month.values)){o.applyDateOperation(a,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#h(o,a,i)){if(!r.#c(o.getMinutes(),this.#a.minute.values)){this.#f(o,a,i);continue}if(!r.#c(o.getSeconds(),this.#a.second.values)){this.#d(o,a,i);continue}if(s===o.getTime()){(a===`Add`||o.getMilliseconds()===0)&&o.applyDateOperation(a,t.TimeUnit.Second,this.#a.hour.values.length);continue}break}}if(c>n)throw Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return o.getMilliseconds()!==0&&o.setMilliseconds(0),this.#n=o,o}[Symbol.iterator](){return{next:()=>({value:this.#_(),done:!this.hasNext()})}}};e.CronExpression=r,e.default=r})),m=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.seededRandom=r;function t(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return()=>t>>>0}function n(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function r(e){return n(e?t(e)():Math.floor(Math.random()*1e10))}})),h=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=f(),n=p(),r=m(),i=d(),a;(function(e){e[`@yearly`]=`0 0 0 1 1 *`,e[`@annually`]=`0 0 0 1 1 *`,e[`@monthly`]=`0 0 0 1 * *`,e[`@weekly`]=`0 0 0 * * 0`,e[`@daily`]=`0 0 0 * * *`,e[`@hourly`]=`0 0 * * * *`,e[`@minutely`]=`0 * * * * *`,e[`@secondly`]=`* * * * * *`,e[`@weekdays`]=`0 0 0 * * 1-5`,e[`@weekends`]=`0 0 0 * * 0,6`})(a||(e.PredefinedExpressions=a={}));var o;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.DayOfMonth=`DayOfMonth`,e.Month=`Month`,e.DayOfWeek=`DayOfWeek`})(o||(e.CronUnit=o={}));var s;(function(e){e[e.jan=1]=`jan`,e[e.feb=2]=`feb`,e[e.mar=3]=`mar`,e[e.apr=4]=`apr`,e[e.may=5]=`may`,e[e.jun=6]=`jun`,e[e.jul=7]=`jul`,e[e.aug=8]=`aug`,e[e.sep=9]=`sep`,e[e.oct=10]=`oct`,e[e.nov=11]=`nov`,e[e.dec=12]=`dec`})(s||(e.Months=s={}));var c;(function(e){e[e.sun=0]=`sun`,e[e.mon=1]=`mon`,e[e.tue=2]=`tue`,e[e.wed=3]=`wed`,e[e.thu=4]=`thu`,e[e.fri=5]=`fri`,e[e.sat=6]=`sat`})(c||(e.DayOfWeek=c={})),e.CronExpressionParser=class e{static parse(s,c={}){let{strict:l=!1,hashSeed:u}=c,d=(0,r.seededRandom)(u);s=a[s]||s;let f=e.#e(s,l);if(!(f.dayOfMonth===`*`||f.dayOfWeek===`*`||!l))throw Error(`Cannot use both dayOfMonth and dayOfWeek together in strict mode!`);let p=e.#t(o.Second,f.second,i.CronSecond.constraints,d),m=e.#t(o.Minute,f.minute,i.CronMinute.constraints,d),h=e.#t(o.Hour,f.hour,i.CronHour.constraints,d),g=e.#t(o.Month,f.month,i.CronMonth.constraints,d),_=e.#t(o.DayOfMonth,f.dayOfMonth,i.CronDayOfMonth.constraints,d),{dayOfWeek:v,nthDayOfWeek:y}=e.#u(f.dayOfWeek),b=e.#t(o.DayOfWeek,v,i.CronDayOfWeek.constraints,d),x=new t.CronFieldCollection({second:new i.CronSecond(p,{rawValue:f.second}),minute:new i.CronMinute(m,{rawValue:f.minute}),hour:new i.CronHour(h,{rawValue:f.hour}),dayOfMonth:new i.CronDayOfMonth(_,{rawValue:f.dayOfMonth}),month:new i.CronMonth(g,{rawValue:f.month}),dayOfWeek:new i.CronDayOfWeek(b,{rawValue:f.dayOfWeek,nthDayOfWeek:y})});return new n.CronExpression(x,{...c,expression:s})}static#e(e,t){if(t&&!e.length)throw Error(`Invalid cron expression`);e||=`0 * * * * *`;let n=e.trim().split(/\s+/);if(t&&n.length<6)throw Error(`Invalid cron expression, expected 6 fields`);if(n.length>6)throw Error(`Invalid cron expression, too many fields`);let r=[`*`,`*`,`*`,`*`,`*`,`0`];n.length<r.length&&n.unshift(...r.slice(n.length));let[i,a,o,s,c,l]=n;return{second:i,minute:a,hour:o,dayOfMonth:s,month:c,dayOfWeek:l}}static#t(e,t,n,r){if((e===o.Month||e===o.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,e=>{e=e.toLowerCase();let t=s[e]||c[e];if(t===void 0)throw Error(`Validation error, cannot resolve alias "${e}"`);return t.toString()})),!n.validChars.test(t))throw Error(`Invalid characters, got value: ${t}`);return t=this.#n(t,n),t=this.#r(t,n,r),this.#i(e,t,n)}static#n(e,t){return e.replace(/[*?]/g,t.min+`-`+t.max)}static#r(e,t,n){let r=n();return e.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(e,n,i,a)=>{if(n&&i&&a){let e=parseInt(n,10),o=parseInt(i,10),s=parseInt(a,10);if(e>o)throw Error(`Invalid range: ${e}-${o}, min > max`);if(s<=0)throw Error(`Invalid step: ${s}, must be positive`);let c=Math.max(e,t.min),l=Math.floor(r*s),u=[];for(let e=Math.floor(c/s)*s+l;e<=o;e+=s)e>=c&&u.push(e);return u.join(`,`)}else if(n&&i){let e=parseInt(n,10),t=parseInt(i,10);if(e>t)throw Error(`Invalid range: ${e}-${t}, min > max`);return String(Math.floor(r*(t-e+1))+e)}else if(a){let e=parseInt(a,10);if(e<=0)throw Error(`Invalid step: ${e}, must be positive`);let n=Math.floor(r*e),i=[];for(let r=Math.floor(t.min/e)*e+n;r<=t.max;r+=e)r>=t.min&&i.push(r);return i.join(`,`)}else return String(Math.floor(r*(t.max-t.min+1)+t.min))})}static#i(t,n,r){let i=[];function a(n,r){if(Array.isArray(n))i.push(...n);else if(e.#d(r,n))i.push(n);else{let e=parseInt(n.toString(),10);if(!(e>=r.min&&e<=r.max))throw Error(`Constraint error, got value ${n} expected range ${r.min}-${r.max}`);i.push(t===o.DayOfWeek?e%7:n)}}return n.split(`,`).forEach(n=>{if(!(n.length>0))throw Error(`Invalid list value format`);a(e.#a(t,n,r),r)}),i}static#a(t,n,r){let i=n.split(`/`);if(i.length>2)throw Error(`Invalid repeat: ${n}`);return i.length===2?(isNaN(parseInt(i[0],10))||(i[0]=`${i[0]}-${r.max}`),e.#l(t,i[0],parseInt(i[1],10),r)):e.#l(t,n,1,r)}static#o(e,t,n){if(!(!isNaN(e)&&!isNaN(t)&&e>=n.min&&t<=n.max))throw Error(`Constraint error, got range ${e}-${t} expected range ${n.min}-${n.max}`);if(e>t)throw Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#s(e){if(!(!isNaN(e)&&e>0))throw Error(`Constraint error, cannot repeat at every ${e} time.`)}static#c(e,t,n,r){let i=[];e===o.DayOfWeek&&n%7==0&&i.push(0);for(let e=t;e<=n;e+=r)i.indexOf(e)===-1&&i.push(e);return i}static#l(e,t,n,r){let i=t.split(`-`);if(i.length<=1)return isNaN(+t)?t:+t;let[a,o]=i.map(e=>parseInt(e,10));return this.#o(a,o,r),this.#s(n),this.#c(e,a,o,n)}static#u(e){let t=e.split(`#`);if(t.length<=1)return{dayOfWeek:t[0]};let n=+t[t.length-1],r=e.match(/([,-/])/);if(r!==null)throw Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r?.[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(n)&&n>=1&&n<=5))throw Error(`Constraint error, invalid dayOfWeek occurrence number (#)`);return{dayOfWeek:t[0],nthDayOfWeek:n}}static#d(e,t){return e.chars.some(e=>t.toString().includes(e))}}})),g=e(((e,t)=>{t.exports={}})),_=e((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=void 0;var i=h();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=await Promise.resolve().then(()=>r(g())),i=await n(t,`utf8`);return e.#e(i)}static parseFileSync(t){let{readFileSync:n}=g(),r=n(t,`utf8`);return e.#e(r)}static#e(t){let n=t.split(`
2
- `),r={variables:{},expressions:[],errors:{}};for(let t of n){let n=t.trim();if(n.length===0||n.startsWith(`#`))continue;let i=n.match(/^(.*)=(.*)$/);if(i){let[,e,t]=i;r.variables[e]=t.replace(/["']/g,``);continue}try{let t=e.#t(n);r.expressions.push(t.interval)}catch(e){r.errors[n]=e}}return r}static#t(e){let t=e.split(` `);return{interval:i.CronExpressionParser.parse(t.slice(0,5).join(` `)),command:t.slice(5,t.length)}}}})),v=e((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;var r=h(),i=c();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return i.CronDate}});var a=f();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var o=p();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var s=h();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var l=_();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return l.CronFileParser}}),n(d(),e),e.default=r.CronExpressionParser}))();function y(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`).sort((e,t)=>e-t):[]}function b(e){if(e.length<2)return null;let t=e[1]-e[0];if(t<=0)return null;for(let n=2;n<e.length;n++)if(e[n]-e[n-1]!==t)return null;return t}function x(e,t,n){let r=new Date;return r.setHours(e,t,0,0),r.toLocaleTimeString(n,{hour:`numeric`,minute:`2-digit`})}function ee(e,t){let n=e===7?0:e;return new Date(Date.UTC(2023,0,1)+n*864e5).toLocaleDateString(t,{weekday:`short`,timeZone:`UTC`})}function te(e,t){return e.length<=1?e[0]??``:t.startsWith(`zh`)?e.join(`、`):e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e.at(-1)}`}function S(e){return e.length===5&&e.every((e,t)=>e===t+1)}function ne(e){if(e.length!==2)return!1;let t=[...e].toSorted((e,t)=>e-t);return t[0]===0&&t[1]===6}function re(e,t,n,r){try{let i=v.CronExpressionParser.parse(e,{...r?.timezone?{tz:r.timezone}:{}}).fields,a=y(i.minute.values),o=y(i.hour.values),s=y(i.dayOfWeek.values),c=y(i.dayOfMonth.values);if(a.length===60&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard)return n.everyMinute;if(!i.minute.isWildcard&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard&&a.length>1){let e=b(a);if(e!=null&&e>0)return n.everyNMinutes.replace(`{{n}}`,String(e))}if(!i.minute.isWildcard&&a.length===1&&!i.hour.isWildcard&&o.length>1&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard){let e=b(o);if(e!=null&&e>0)return n.everyNHours.replace(`{{n}}`,String(e))}if(!i.minute.isWildcard&&a.length===1&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard&&o.length===24)return n.hourly;let l=!i.minute.isWildcard&&a.length===1&&!i.hour.isWildcard&&o.length===1?x(o[0],a[0],t):``;if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard)return n.dailyAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&S(s))return n.weekdaysAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&ne(s))return n.weekendsAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&s.length===1){let e=ee(s[0],t);return n.weeklyOn.replace(`{{day}}`,e).replace(`{{time}}`,l)}if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&s.length>1){let e=te(s.map(e=>ee(e,t)),t);return n.daysAt.replace(`{{days}}`,e).replace(`{{time}}`,l)}return l&&!i.dayOfMonth.isWildcard&&c.length===1&&i.month.isWildcard&&i.dayOfWeek.isWildcard?n.monthlyAt.replace(`{{day}}`,String(c[0])).replace(`{{time}}`,l):n.customSchedule}catch{return null}}function ie(e,t,n,r){let i=e.trim();return i?re(i,t,n,r)||ae(r?.nextRun,t)||n.customSchedule:ae(r?.nextRun,t)||`—`}function ae(e,t){if(!e)return``;let n=new Date(e);return Number.isNaN(n.getTime())?``:n.toLocaleString(t,{weekday:`short`,hour:`numeric`,minute:`2-digit`})}var C=1e3,w=60*C,T=60*w,E=24*T,D=7*E,O=new Intl.ListFormat(`en-US`,{type:`conjunction`}),oe=Object.fromEntries([`second`,`minute`,`hour`,`day`,`week`].map(e=>[e,new Intl.NumberFormat(`en-US`,{style:`unit`,unit:e,unitDisplay:`long`})])),se={en:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),zh:new Intl.DateTimeFormat(`zh-CN`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})},ce={en:new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`}),zh:new Intl.DateTimeFormat(`zh-CN`,{hour:`2-digit`,minute:`2-digit`})},le={minute:w,hour:T,day:E,week:D};function ue(e){return e===`zh`?`zh-CN`:`en-US`}function de(e,t,n){return n===`zh`?`${e} ${t===`week`?`周`:t===`day`?`天`:t===`hour`?`小时`:t===`minute`?`分钟`:`秒`}`:oe[String(t)].format(e)}function fe(e,t){return t===`zh`?e.join(` `):O.format(e)}function pe(e,t){let n=typeof e==`number`?e:Number.parseFloat(e);return Math.max(w,Math.round((Number.isFinite(n)&&n>0?n:1)*le[t]))}function k(e,t,n){let r=typeof e==`number`?e:Number.parseFloat(e),i=Number.isFinite(r)&&r>0?r:1;return String(Number.parseFloat((i*le[t]/le[n]).toFixed(6)))}function me(e,t){let n=Math.max(C,Math.round(e)),r=n===E?[{unit:`hour`,ms:T}]:n>=D&&n%D===0?[{unit:`week`,ms:D}]:n>=E?[{unit:`day`,ms:E},{unit:`hour`,ms:T},{unit:`minute`,ms:w},{unit:`second`,ms:C}]:n>=T?[{unit:`hour`,ms:T},{unit:`minute`,ms:w},{unit:`second`,ms:C}]:n>=w?[{unit:`minute`,ms:w},{unit:`second`,ms:C}]:[{unit:`second`,ms:C}],i=n,a=[];for(let{unit:e,ms:n}of r){let r=Math.floor(i/n);r<=0||(a.push(de(r,e,t)),i%=n)}return fe(a,t)}function he(e,t){let n=me(e,t);return t===`zh`?`每 ${n}运行一次`:`Runs every ${n}`}function ge(e,t){return se[t].format(new Date(e))}function _e(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}function A(e,t,n=Date.now()){let r=new Date(e),i=Math.round((_e(r)-_e(new Date(n)))/E),a=ce[t].format(r);return i===0?t===`zh`?`今天 ${a}`:`today at ${a}`:i===1?t===`zh`?`明天 ${a}`:`tomorrow at ${a}`:i===-1?t===`zh`?`昨天 ${a}`:`yesterday at ${a}`:ge(e,t)}function ve(e,t){return e.eventType===`task.attention_required.v2`&&e.payloadMatch?.reason===`blocked`?t.trigger.taskBlockedWhen:e.eventType===`note.created`?t.trigger.noteCreatedWhen:e.eventType===`session.transcript.updated`?t.trigger.sessionUpdatedWhen:t.trigger.eventWithType.replace(`{type}`,e.eventType)}function ye(e,t,n,r){if(e.kind===`manual`)return t.trigger.manualWhen;if(e.kind===`webhook`)return t.trigger.webhookWhen;if(e.kind===`event`)return ve(e,t);let i=e.schedule;return i.kind===`once`?t.trigger.onceAt.replace(`{time}`,A(Date.parse(i.at),r)):i.kind===`interval`?he(i.everyMs,r):ie(i.expr,ue(r),n.scheduleBadge,{timezone:i.tz})}function be(e,t,n,r=Date.now()){return e.enabled?e.state.nextRunAtMs?A(e.state.nextRunAtMs,n,r):e.trigger.kind===`manual`?t.info.noAutomaticTrigger:e.trigger.kind===`event`||e.trigger.kind===`webhook`?t.info.waitingForTrigger:t.info.noUpcomingRun:t.info.pausedNoAutomaticRuns}function xe(e,t,n,r=Date.now()){if(!e.state.lastRunAtMs)return t.info.notRunYet;let i=A(e.state.lastRunAtMs,n,r),a=e.state.lastRunStatus;return a?`${i} · ${t.status[a]}`:i}export{k as a,he as c,ye as i,A as l,xe as n,ge as o,be as r,me as s,pe as t};