@xopcai/xopc 0.0.432 → 0.0.433
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.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{activity-store-iTw0JzOx.js → activity-store-BpYGrRXw.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CXuMwQ4y.js → agent-avatar-dicebear-DTgOSv6G.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-hRyDKdPJ.js → agent-avatar-display-BUH7ljEo.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BBRKBHLB.js → agent-defaults-settings-panel-B_FAikHA.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-PoKk6j20.js → agent-plugin-dialog-DPabZaSE.js} +1 -1
- package/dist/gateway/static/root/assets/{agents--P5-QEHR.js → agents-BAPYP1Ka.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DuYzWKP8.js → agents-admin-api-CXCAHNPj.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BeNB3MkI.js → api-DMbimMEi.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DT_Aly4B.js → api-oIK4hYkJ.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C4JhA-Kz.js → app-management-settings-panel-BZ3Fy8ZR.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-YM311zxY.js → appearance-settings-DsRTj1by.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BrnAMjXr.js → apps-page-D-n71lO1.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DoYjGZv1.js → archive-plugin-Bg1VTieK.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-ZD1VY9jO.js → automation-api-CLPsgcQN.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-BO5N3gMt.js → automation-result-state-CKVnR4KG.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card--K7uiKHL.js → automation-task-card-D27Mw66U.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Clcl5MI7.js → automations-page-DGNTJ8lN.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DM67xMcR.js → automations-workspace-DWDWy-SG.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-B-dkI6-B.js → binary-plugins-CuwSdCG5.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CB6KruU-.js → block-editor-Dtl2BG3t.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Bk_QFbzb.js → browser-automation-inputs-uGK086ag.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-54eckhYq.js → browser-automations-page-Da_edNNS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-B4T1KPPz.js → browser-control-api-k3OOX3bS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-rOmS1-T8.js → browser-settings-page-C1bSw-Jq.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-DBDeifNA.js → capabilities-CoeuLRt6.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-D_Uqx5il.js → capabilities-DlHPLld_.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-DOMoAom0.js → capabilities-page-IcwojmJK.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-iQPbNO4A.js → capabilities-settings-panel-CtY-bGIi.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-DsEP_hFB.js → channels-Cn1MWBL_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-D5-xZdAt.js → chat-agents-api-BB0biwc7.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-B-ri4wfk.js → chat-chart-block-QSvjx4w6.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-DQNLsOad.js → chat-page-CwP4OMdW.js} +11 -11
- package/dist/gateway/static/root/assets/{chat-terminal-dock-RcrdmYe8.js → chat-terminal-dock-Cd51G9eG.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-DFd-zOz_.js → command-palette-api-CEG10uE-.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-hccuv1Lk.js → composer-payload-handoff-Bogdq9Hy.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-C-7YLU9l.js → computer-settings-page-DyAlOzqY.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-DziNfbFz.js → connected-providers-grid-D0lXg22c.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-C3ZhlR8V.js → connector-service-page-k2rjyjrp.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-D6CPY0Nu.js → connectors-api-DtvB9Cjm.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CcG3V3OB.js → connectors-page-DI_Q0CKz.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D3bxeryy.js → date-picker-CAankdQw.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-B7kSoCSo.js → desktop-pet-DjM73fir.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-3dEeKSHA.js → desktop-pet-settings-Rmh-GxHl.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-Dk7ylv5S.js → dev-view-store-BgW2Riyk.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CstPAnnj.js → device-pairing-wizard-UdzSpNa5.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BUGqS-lm.js → directory-picker-path-field-Rkw3f7lG.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-D9-wFJDS.js → discussion-annotation-sync-Dudoj_Fz.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BDTA9XDE.js → extension-debug-page-DxIGAO23.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CPEaw2ZG.js → extension-iframe-host-63KpX6IP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-edmEFM6F.js → extension-marketplace-api-yXNUkQDA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Biz-65E8.js → extension-page-C811A_Ww.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-DCur0Xcb.js → extension-provider-C4jLFIgh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CvPK63oz.js → extension-settings-page-WJSw5MT0.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-BFs1sAID.js → file-preview-surface-zE9AcaHM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-C-fPl1hP.js → gateway-config-swr-D6cc6W6E.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-xZpX_HCq.js → gateway-realtime-BSRNLciy.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BFeFfApQ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-BfozBI8f.js → gateway-restart-Unun5hRL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-A8BUKcfx.js → gateway-settings-DP-DV-e5.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BRrkiv67.js → gateway-startup-retry-C8g666Ja.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-C9O_X0pj.js → global-defaults-api-BObi-1ww.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CzS-ROXe.js → home-page-CIcs7Mzy.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-ohquPPls.js → image-generation-api-C2SqYNyD.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DAebChWv.js → imports-page-C8ezUkOJ.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BinHjymm.js → index-D1_PUrJf.js} +5 -5
- package/dist/gateway/static/root/assets/{install-connector-dialog-xHNBuSj0.js → install-connector-dialog-Cn4nRSyt.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Bv4YJpTl.js → keyboard-shortcuts-settings-BRaY4-wA.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-OhV8UnzK.js → local-app-workbench-page-BZtVcjF3.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-ADzWmh3T.js → local-apps-page-MqP4EnJm.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DgtYzPiy.js → local-session-drafts-DTq9776a.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-fGFrr4_4.js → locale-store-B6OrWgY1.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-i0eD_bSC.js → logs-page-hkHBjblX.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-C-JTxRjw.js → management-settings-DoX4eTM3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-Cnt8oxNg.js → markdown-view-DrhYZSmg.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-BQ_US_jP.js → mcp-conversation-setup-page-BEp5E6TD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-cphVSfva.js → media-plugins-D987i9Gc.js} +1 -1
- package/dist/gateway/static/root/assets/messages-jwdBhfL9.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-Bv-anQ6O.js → model-selector-DXm4NS1_.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-BLYpN4bJ.js → models-hub-cache-BLcha5rx.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-B-pk3LYN.js → note-detail-panel-Cl851ivY.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DGYRJS03.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-IIQgxlMj.js → notes-api-Ddsf7FVg.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-C6l9zI17.js → notes-page-DSwA1MU1.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-BojfhqmL.js → oauth-api-CMmu4DzH.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-D_p1ez-o.js → oauth-provider-connect-BkhnftBq.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CiEaCz7v.js → page-context-capture-button-urhQBRaN.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BbGvUKjF.js → page-context-draft-BuNUerth.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-CEn_kPsn.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-Cq0y6LEK.js → personal-avatar-B49ueeZO.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CDad-FDO.js → personal-page-f05ceuFn.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-yVUzcKoo.js → personal-settings-panel-DLQxzPYr.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CM2Mj4rH.js → phone-dependencies-card-DjmC1Z5j.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-kJYAiCgI.js → phone-model-connection-BRjHSgYn.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-sXs8PpFk.js → phone-model-picker-DgIiWLhR.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-ayCImqUb.js → phone-settings-page-DCZGCL_z.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-DoTZvoDh.js → phone-workspace-store-DbqktZbO.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-B4qZ0obG.js → plugin-details-dialog-D4tGKip4.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-oZm_6PvN.js → preference-select-fields-BZWqG7pu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-Ddj5cmmF.js → product-automation-feedback-DDQUsag7.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CTuqeUDh.js → product-open-page-BkRP_HmA.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Ci8eDZ2h.js → product-preview-content-o2Y3VNE7.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-J-9O-eQ2.js → product-preview-modal-7Ohx-7OR.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-D8QlmMQp.js → project-detail-page-B2RsSHya.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-8DBS77KV.js → project-understanding-BIMouiYX.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CEyyFqca.js → projects-page-C9R5u3tF.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-DyX07mht.js → providers-api-BOCkRZ7X.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DOhMs_aU.js → recording-upload-C6muEHEO.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Bm7kut54.js → registry-api-Bl2guMRg.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DfCkv8XR.js → remote-access-hub-BceSMbCs.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-jg8QV_tO.js → resource-unavailable-CUNbPkdj.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-Uhpfz1Jz.js → route-preload-C1BKDjnu.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-BpaZgv-a.js → runtime-tools-api-LopLjgvu.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CGnX0DY1.js → runtime-tools-settings-panel-9HIPerDP.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-NdwoBa_O.js → service-recommendation-list-CoMI6MB1.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-BwcBcvzv.js → session-api-Bfmlmn9F.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-X4UHOjjO.js +25 -0
- package/dist/gateway/static/root/assets/{sessions-page-CAutHonI.js → sessions-page-BT0GdXdS.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Dk9c-Z5e.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CICMnCwv.js → settings-advanced-section-CEorDLUp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-DCnYgG87.js → settings-mode-store-C2LZqBES.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CZXi8Jro.js → settings-page-C_Np_6qZ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DH1qb4vP.js → settings-page-header-BAN34UQi.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-B2G042F2.js → settings-page-layout-B5TVFBV2.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-B-tpfd3l.js → setup-interaction-page-BYvTJW3_.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DtA2Lb-A.js → setup-status-panel-UY2dH-sK.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-BjjkGRWn.js → share-link-dialog-BMcXyzr2.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BBaJCO3w.js → share-preview-page-UQ6eUM2_.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-C1rliVTe.js → shares-api-DOeDN6Tm.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BMctLz4y.js → shares-settings-W8XhuAoL.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-fWp7oUet.js → skill-api-Do_c0d9n.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-B-2Dod7G.js → skill-list-api-DpHaXI2l.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-Cejk-tbD.js → skill-reload-api-DDRd9IJ2.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-D-dxO0Vc.js → skills-page-CaeJVKhO.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-D-gdBXlK.js → system-settings-panel-DYWlWPJL.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CIX4EckU.js → task-detail-page-De0qD7xw.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-Dp6gk3xn.js → task-result-evidence-CICR5K1t.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BDrza-7c.js → terminal-panel-store-BbWUcQe7.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-De43hGnm.js → theme-store-TkG5mo0p.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-DlQJAutq.js → tracing-settings-page-CYXEy4EG.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BSeDyRBI.js → tunnel-api-DquDm6U2.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-CABSRtdN.js → understanding-activity-store-Ot3wZ3oQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-C5pXQtC9.js → understanding-refresh-store-C5KYFMaC.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Dd6gyHlm.js → usage-page-1xFO4smo.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BhdMHxgz.js → use-autosave-HL8XRNR8.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Baw8AHhn.js → use-composer-attachments-XRlQBdNF.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-B_cRX1Ih.js → use-file-preview-expanded-CW956CXS.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-DL5rDvwX.js → use-personal-profile-202s6tJt.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-DONQqfmT.js → use-workspace-tree-CjydkmH1.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-u2vtyxcX.js → user-model-page-OGPXx3pe.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-OChN73N1.js → voice-api-key-field-CxFu4MEA.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CziHHWRu.js → voice-config-api-MHe5Pn-A.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-CWSb-oJe.js → voice-input-shortcut-events-B9xc1oK8.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-CqEwxj11.js → voice-transcribe-api-CVEcB6Pe.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BJT2mARb.js → work-discovery-overlay-C-JoAg2D.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CkHMAnBc.js → work-discovery-page-B5Kx29Ru.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-CpZEiO2a.js → working-directory-picker-modal-DGp9cNzH.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Yi28Sl0C.js → workspace-api-HBXn8pL9.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-msZa42fU.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-MLLldcHQ.js → workspace-file-preview-dialog-3cpwSG2w.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-CjfDtW9T.js → workspace-open-location-menu-D0VOFvuP.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-FioKsLPf.js → xopc-cloud-account-card-BkdW2p3v.js} +1 -1
- package/dist/gateway/static/root/index.html +78 -78
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +18 -18
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +12 -12
- package/dist/src/agent/child-agent-factory.js +2 -2
- package/dist/src/agent/context/coordinator.js +2 -2
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
- package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +6 -6
- package/dist/src/agent/embedded/run-turn.js +19 -19
- package/dist/src/agent/embedded/session-runner.js +4 -4
- package/dist/src/agent/embedded/session-tool-result-guard.js +1 -1
- package/dist/src/agent/embedded/xopc-tools-bridge.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +4 -4
- package/dist/src/agent/external-tools/composio-provider.js +4 -4
- package/dist/src/agent/external-tools/endpoint-provider.js +6 -6
- package/dist/src/agent/external-tools/extension-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +3 -3
- package/dist/src/agent/external-tools/memory-provider.js +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +2 -2
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/independent-execution.js +2 -2
- package/dist/src/agent/index.js +3 -3
- package/dist/src/agent/mcp/connection-drafts.js +1 -1
- package/dist/src/agent/mcp/connection-setup.js +1 -1
- package/dist/src/agent/mcp/conversation-setup.js +1 -1
- package/dist/src/agent/mcp/discovery.js +2 -2
- package/dist/src/agent/mcp/transport.js +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/orchestration/llm-turn-retry.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
- package/dist/src/agent/prompt/system-prompt-params.js +1 -1
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -6
- package/dist/src/agent/service/process-direct-streaming.js +6 -6
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +22 -22
- package/dist/src/agent/session/session-config-service.js +2 -2
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/source-context/index.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +8 -8
- package/dist/src/agent/tools/create-share-tool.js +2 -2
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/exec-command.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +19 -19
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +2 -2
- package/dist/src/agent/tools/index.js +4 -4
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/personal-attention-tool.js +2 -2
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +4 -4
- package/dist/src/agent/tools/personal-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.js +5 -5
- package/dist/src/agent/tools/phone-use-tool.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +2 -2
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +2 -2
- package/dist/src/agent/tools/web.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +12 -12
- package/dist/src/agent/transcript/index.js +2 -2
- package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth/openai.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/delivery/delivery-router.js +1 -1
- package/dist/src/automations/domain/index.js +1 -1
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +2 -2
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/channels/index.js +1 -1
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/context.js +1 -1
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +7 -7
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension.js +2 -2
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +3 -3
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tunnel.js +4 -4
- package/dist/src/cli/extension-cli-register.js +5 -5
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +3 -3
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/flows.js +1 -1
- package/dist/src/computer/model-adapter.js +1 -1
- package/dist/src/computer/runtime.js +4 -4
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connected-source-ingestion.js +2 -2
- package/dist/src/connectors/connected-source-understanding.js +5 -5
- package/dist/src/connectors/connection-recovery-service.js +4 -4
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/instances.js +1 -1
- package/dist/src/connectors/runtime-adapter-registry.js +2 -2
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/runtime.js +2 -2
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/agent-plugins/auth.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +3 -3
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +3 -3
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/device-routes.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/oauth-async.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
- package/dist/src/gateway/hono/routes/models.js +4 -4
- package/dist/src/gateway/hono/routes/notes.js +3 -3
- package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +2 -2
- package/dist/src/gateway/hono/routes/phone.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +5 -5
- package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +5 -5
- package/dist/src/gateway/hono/routes/sessions.js +3 -3
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +7 -7
- package/dist/src/gateway/hono/routes/voice.js +7 -7
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/provider-model-setup.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +5 -5
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.js +41 -41
- package/dist/src/gateway/session-context-summary.js +4 -4
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
- package/dist/src/home-intelligence/generator.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/imports/inventory.js +2 -2
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/imports/runtime.js +1 -1
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +9 -9
- package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
- package/dist/src/knowledge/index.js +1 -1
- package/dist/src/knowledge-memory/repository.js +1 -1
- package/dist/src/knowledge-memory/usage-policy.js +1 -1
- package/dist/src/local-apps/service.js +3 -3
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/memory-learning/source-learning.js +5 -5
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +3 -3
- package/dist/src/personal-agent/capability-service.js +2 -2
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +7 -7
- package/dist/src/personal-agent/prompt-context.js +7 -7
- package/dist/src/personal-agent/prompts.js +2 -2
- package/dist/src/personal-agent/reply-composer.js +9 -9
- package/dist/src/personal-agent/request-delivery.js +2 -2
- package/dist/src/personal-agent/request-service.js +7 -7
- package/dist/src/personal-agent/result-reader.js +1 -1
- package/dist/src/personal-agent/service.js +2 -2
- package/dist/src/phone/model-adapter.js +1 -1
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/runtime.js +4 -4
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-service.js +2 -2
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +2 -2
- package/dist/src/session/client-history.d.ts +2 -0
- package/dist/src/session/client-history.js +3 -0
- package/dist/src/session/compact-history.js +1 -0
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/store.js +5 -5
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/session-share-service.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +2 -2
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tasks/index.js +5 -5
- package/dist/src/tasks/task-allocation-service.js +5 -5
- package/dist/src/tasks/task-application-service.js +5 -5
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-contract-planner.js +2 -2
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +4 -4
- package/dist/src/tasks/task-main-update-decision-service.js +3 -3
- package/dist/src/tasks/task-model-call.js +1 -1
- package/dist/src/tasks/task-research-result.js +4 -4
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- package/dist/src/tasks/task-run-coordinator.js +3 -3
- package/dist/src/tasks/task-run-dispatcher.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +12 -12
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +3 -3
- package/dist/src/tui/tui.js +4 -4
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -2
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +1 -1
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/usage-policy.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +5 -5
- package/dist/src/voice/realtime/omniRoute.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +4 -4
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/bailian-plan-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/providers/bailian-plan-speech.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/service.js +7 -7
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-eEZgUEdH.js +0 -1
- package/dist/gateway/static/root/assets/messages-9OwWjlww.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DOG9mCzE.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-DBeD_mAA.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-SASXxhrN.js +0 -23
- package/dist/gateway/static/root/assets/settings-advanced-gate-iUlbBMZI.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bz_M_rk3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-DWDWy-SG.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AutomationsPage};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-
|
|
2
|
-
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"./preload-helper-Czpn1I53.js";import{m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as c,i as l,l as u,n as d}from"./locale-store-fGFrr4_4.js";import{t as f}from"./messages-9OwWjlww.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{t as y}from"./activity-YogQEteU.js";import{t as b}from"./arrow-left-D880xG-P.js";import{t as x}from"./calendar-clock-D-quYVPe.js";import{t as S}from"./check-DUBLcKHA.js";import{t as C}from"./chevron-down-ccbiQQz_.js";import{t as w}from"./chevron-right-BweFrslA.js";import{n as T,r as E}from"./popover-select-CEMWIrtY.js";import{t as D}from"./circle-alert-BEjgurr2.js";import{t as ee}from"./circle-check-C23XjkUj.js";import{t as O}from"./copy-Dv6d4Dvw.js";import{t as k}from"./ellipsis-0k4rZLoy.js";import{t as A}from"./eye-CABVeTq0.js";import{t as j}from"./git-branch-Dh9uxTot.js";import{t as M}from"./list-filter-CIPvpfLA.js";import{t as N}from"./list-tree-B0OMswgM.js";import{t as te}from"./markdown-view-Cnt8oxNg.js";import{t as P}from"./message-circle-Badhj-4D.js";import{t as F}from"./pause-DuPxgSxk.js";import{t as I}from"./pencil-DmIY3Oa-.js";import{t as L}from"./play-kxZvpBg8.js";import{t as R}from"./plus-Q2yW6OE7.js";import{t as ne}from"./refresh-cw-BRlGaq2w.js";import{t as re}from"./search-DA7gz22f.js";import{t as ie}from"./shield-check-BU58siTV.js";import{t as ae}from"./sparkles-DHlfQFAF.js";import{t as oe}from"./square-pen-B8FsvqNu.js";import{t as se}from"./trash-2-DusmjVPV.js";import{t as ce}from"./x-B_N4OPjy.js";import{t as le}from"./zap-dximCGjy.js";import{t as z}from"./cn-0WouolD0.js";import{t as B}from"./skeleton-BI5TyibZ.js";import{d as V}from"./api-DT_Aly4B.js";import{a as H}from"./session-api-BwcBcvzv.js";import{T as U}from"./session-manager-SASXxhrN.js";import{a as ue,i as W,o as de,t as G}from"./vendor-swr-CdRzEUwF.js";import{t as fe}from"./chat-agents-api-D5-xZdAt.js";import{t as pe}from"./button-Cc4hUNTt.js";import{t as me}from"./page-header-store-DBeD_mAA.js";import{t as K}from"./sliding-tab-list-DuQyViqe.js";import{t as he}from"./refresh-button-DiWdGAaX.js";import{a as ge,c as q,d as _e,f as ve,i as ye,l as be,m as xe,o as Se,p as Ce,r as we,s as J,t as Te,u as Ee}from"./dist-ZrL34Ps4.js";import{n as Y}from"./model-selector-Bv-anQ6O.js";import{C as De,S as Oe,T as X,_ as ke,a as Ae,b as je,c as Me,d as Ne,f as Pe,g as Fe,h as Ie,l as Le,m as Re,n as ze,o as Be,p as Ve,r as He,s as Ue,u as We,v as Ge,w as Ke,x as qe,y as Je}from"./automation-task-card--K7uiKHL.js";import{t as Z}from"./automation-api-ZD1VY9jO.js";import{n as Ye}from"./agent-display-names-Bje7vfSn.js";import{i as Xe,n as Ze,r as Qe,t as $e}from"./automation-result-state-BO5N3gMt.js";import{i as et,n as tt,r as nt,t as rt}from"./browser-automation-inputs-Bk_QFbzb.js";var it=n(),Q=e(t(),1),$=r(),at=e=>[`queued`,`running`,`cancelling`].includes(e.status);function ot(e){let t=(0,it.c)(58),{automationId:n,projectId:r,language:i,selectedRunId:a,selectedRun:o,enabled:s,onSelectRun:c}=e,l=s===void 0||s,[u,d]=(0,Q.useState)(!1),p=i===`zh`,m;t[0]!==n||t[1]!==l||t[2]!==r?(m=(e,t)=>!l||e&&!t?.nextCursor?null:[`automation-navigation-runs`,n,r??``,e?t.nextCursor:``],t[0]=n,t[1]=l,t[2]=r,t[3]=m):m=t[3];let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h={refreshInterval:lt,refreshWhenHidden:!1,refreshWhenOffline:!1,revalidateAll:!0,persistSize:!0},t[4]=h):h=t[4];let{data:g,error:_,size:v,setSize:y,isValidating:b,mutate:x}=G(m,ut,h),S,C,w,T,E,D;if(t[5]!==u||t[6]!==n||t[7]!==g||t[8]!==_||t[9]!==b||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==a||t[14]!==v||t[15]!==p){C=[...new Map((g??[]).flatMap(ct).map(st)).values()];let e=u?C:C.slice(0,3),r=o?.automationId===n&&!e.some(e=>e.id===o.id)?[o,...e]:e;S=b&&(!g||g.length<v),w=`space-y-1 pb-3 pl-8 pr-2`,T=p?`执行记录`:`Execution history`,t[22]!==g||t[23]!==_?(E=!g&&!_?(0,$.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 px-3 py-2`,children:[(0,$.jsx)(B,{className:`h-8`}),(0,$.jsx)(B,{className:`h-8`})]}):null,t[22]=g,t[23]=_,t[24]=E):E=t[24],D=r.map(t=>(0,$.jsxs)(`button`,{type:`button`,className:z(`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,a===t.id&&`bg-surface-active text-fg`),"aria-current":a===t.id?`true`:void 0,onClick:()=>c(t),children:[(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{children:new Date(t.createdAtMs).toLocaleString(p?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}),!at(t)&&t.readAtMs==null?(0,$.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:p?`未读`:`Unread`})}):null]}),o?.id===t.id&&!e.some(e=>e.id===t.id)?(0,$.jsx)(`span`,{className:`block text-accent-fg`,children:p?`当前查看`:`Currently viewing`}):null,(0,$.jsx)(`span`,{className:z(`block`,[`failed`,`timeout`].includes(t.status)&&`text-danger`),children:f(i).automations.status[t.status]})]},t.id)),t[5]=u,t[6]=n,t[7]=g,t[8]=_,t[9]=b,t[10]=i,t[11]=c,t[12]=o,t[13]=a,t[14]=v,t[15]=p,t[16]=S,t[17]=C,t[18]=w,t[19]=T,t[20]=E,t[21]=D}else S=t[16],C=t[17],w=t[18],T=t[19],E=t[20],D=t[21];let ee;t[25]!==g||t[26]!==C||t[27]!==p?(ee=g&&C.length===0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-fg-muted`,children:p?`尚未执行`:`No executions yet`}):null,t[25]=g,t[26]=C,t[27]=p,t[28]=ee):ee=t[28];let O;t[29]!==_||t[30]!==x||t[31]!==p?(O=_?(0,$.jsxs)(`div`,{role:`alert`,className:`px-3 py-2 text-xs text-danger`,children:[(0,$.jsx)(`p`,{children:p?`执行记录加载失败`:`Could not load history`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>void x(),children:p?`重试`:`Retry`})]}):null,t[29]=_,t[30]=x,t[31]=p,t[32]=O):O=t[32];let k;t[33]!==u||t[34]!==g?.[0]?.hasMore||t[35]!==C||t[36]!==p?(k=!u&&(C.length>3||g?.[0]?.hasMore)?(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>d(!0),children:p?`查看全部执行`:`View all executions`}):null,t[33]=u,t[34]=g?.[0]?.hasMore,t[35]=C,t[36]=p,t[37]=k):k=t[37];let A;t[38]!==u||t[39]!==g||t[40]!==S||t[41]!==y||t[42]!==v||t[43]!==p?(A=u&&g?.at(-1)?.hasMore?(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,disabled:S,onClick:()=>void y(v+1),children:S?p?`加载中…`:`Loading…`:p?`加载更多`:`Load more`}):null,t[38]=u,t[39]=g,t[40]=S,t[41]=y,t[42]=v,t[43]=p,t[44]=A):A=t[44];let j;t[45]!==u||t[46]!==p?(j=u?(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>d(!1),children:p?`收起历史`:`Show recent`}):null,t[45]=u,t[46]=p,t[47]=j):j=t[47];let M;return t[48]!==k||t[49]!==A||t[50]!==j||t[51]!==w||t[52]!==T||t[53]!==E||t[54]!==D||t[55]!==ee||t[56]!==O?(M=(0,$.jsxs)(`div`,{className:w,"aria-label":T,children:[E,D,ee,O,k,A,j]}),t[48]=k,t[49]=A,t[50]=j,t[51]=w,t[52]=T,t[53]=E,t[54]=D,t[55]=ee,t[56]=O,t[57]=M):M=t[57],M}function st(e){return[e.id,e]}function ct(e){return e.runs}function lt(e){return(e?.length??0)>1?0:e?.[0]?.runs.some(at)?3e3:15e3}function ut(e){let[,t,n,r]=e;return Z.runs(20,t,{projectId:n||void 0,cursor:r||void 0})}var dt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-DQNLsOad.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191])));function ft(e){let t=(0,it.c)(110),{runId:n,automationId:r,projectId:i,language:a,onConfigure:o,onDetails:s,onBack:c}=e,l=a===`zh`,[u,d]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>g(e),t[0]=_):_=t[0];let v=_,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(!0),t[1]=y):y=t[1];let x=y,{mutate:S}=ue(),C=(0,Q.useRef)(!1),w=i??``,T;t[2]!==r||t[3]!==n||t[4]!==w?(T=[`automation-execution`,r,n,w],t[2]=r,t[3]=n,t[4]=w,t[5]=T):T=t[5];let E;t[6]!==r||t[7]!==i||t[8]!==n||t[9]!==l?(E=async()=>{let{run:e}=await Z.getRun(n);if(e.automationId!==r)throw Error(l?`执行记录不属于此自动化`:`Execution does not belong to this automation`);let{automation:t}=await Z.get(r);if(i&&t.projectId!==i)throw Error(l?`执行记录不属于此项目`:`Execution does not belong to this project`);return{run:e,automation:t}},t[6]=r,t[7]=i,t[8]=n,t[9]=l,t[10]=E):E=t[10];let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D={refreshInterval:ht,shouldRetryOnError:!1},t[11]=D):D=t[11];let{data:ee,error:O,mutate:k}=W(T,E,D),A=ee?.run,j=A?.conversationId,M;t[12]===j?M=t[13]:(M=e=>!!(j&&(e.sessions[j]?.streaming||e.sessions[j]?.sending)),t[12]=j,t[13]=M);let N=U(M),P;t[14]===j?P=t[15]:(P=j?[`automation-execution-session`,j]:null,t[14]=j,t[15]=P);let F;t[16]===j?F=t[17]:(F=()=>H(j),t[16]=j,t[17]=F);let I;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(I={shouldRetryOnError:!1},t[18]=I):I=t[18];let{data:L,error:R,mutate:ne}=W(P,F,I),re=A?.conversationShared||ee?.automation.conversationMode===`continuous`||L?.customData?.latestAutomationRunId!==void 0&&L.customData.latestAutomationRunId!==n,ie=!!(L&&(!re||u)),ae=!O&&!!(A&&(!j||re&&!u&&L&&!R&&(A?.summary||A?.error)||L&&!R&&p)),oe,se;if(t[19]!==ae||t[20]!==k||t[21]!==S||t[22]!==A?(oe=()=>{!A||!ae||at(A)||A.readAtMs!=null||C.current||(C.current=!0,Z.markRunRead(A.id).then(async()=>{await Promise.all([k(),S(mt)])}).catch(pt).finally(()=>{C.current=!1}))},se=[A,ae,k,S],t[19]=ae,t[20]=k,t[21]=S,t[22]=A,t[23]=oe,t[24]=se):(oe=t[23],se=t[24]),(0,Q.useEffect)(oe,se),O){let e=O instanceof Error?O.message:l?`执行记录加载失败`:`Could not load execution`,n;t[25]===e?n=t[26]:(n=(0,$.jsx)(`p`,{children:e}),t[25]=e,t[26]=n);let r;t[27]===k?r=t[28]:(r=()=>void k(),t[27]=k,t[28]=r);let i=l?`重试`:`Retry`,a;t[29]!==r||t[30]!==i?(a=(0,$.jsx)(pe,{onClick:r,children:i}),t[29]=r,t[30]=i,t[31]=a):a=t[31];let o=l?`返回自动化`:`Back to automation`,s;t[32]!==c||t[33]!==o?(s=(0,$.jsx)(pe,{onClick:c,children:o}),t[32]=c,t[33]=o,t[34]=s):s=t[34];let u;return t[35]!==n||t[36]!==a||t[37]!==s?(u=(0,$.jsxs)(`section`,{role:`alert`,className:`space-y-3 p-5`,children:[n,a,s]}),t[35]=n,t[36]=a,t[37]=s,t[38]=u):u=t[38],u}if(!A){let e;return t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-4 p-5`,"aria-busy":`true`,children:[(0,$.jsx)(B,{className:`h-6 w-2/3`}),(0,$.jsx)(B,{className:`h-20`})]}),t[39]=e):e=t[39],e}let ce;t[40]===A?ce=t[41]:(ce=at(A),t[40]=A,t[41]=ce);let le=ce,z=l?`执行会话`:`Execution conversation`,V=l?`返回自动化`:`Back to automation`,de;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(b,{className:`size-4`}),t[42]=de):de=t[42];let G;t[43]!==c||t[44]!==V?(G=(0,$.jsx)(pe,{variant:`ghost`,className:`shrink-0`,onClick:c,"aria-label":V,children:de}),t[43]=c,t[44]=V,t[45]=G):G=t[45];let fe;t[46]===A.automationName?fe=t[47]:(fe=(0,$.jsx)(`h2`,{className:`truncate text-sm font-medium text-fg`,children:A.automationName}),t[46]=A.automationName,t[47]=fe);let me;t[48]!==G||t[49]!==fe?(me=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[G,fe]}),t[48]=G,t[49]=fe,t[50]=me):me=t[50];let K;t[51]!==A.createdAtMs||t[52]!==l?(K=new Date(A.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[51]=A.createdAtMs,t[52]=l,t[53]=K):K=t[53];let he;t[54]===a?he=t[55]:(he=f(a),t[54]=a,t[55]=he);let ge=he.automations.status[A.status],q;t[56]!==K||t[57]!==ge?(q=(0,$.jsxs)(`span`,{children:[K,` · `,ge]}),t[56]=K,t[57]=ge,t[58]=q):q=t[58];let _e;t[59]!==s||t[60]!==A.id?(_e=()=>s(A.id),t[59]=s,t[60]=A.id,t[61]=_e):_e=t[61];let ve=l?`运行详情`:`Run details`,ye;t[62]!==_e||t[63]!==ve?(ye=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:_e,children:ve}),t[62]=_e,t[63]=ve,t[64]=ye):ye=t[64];let be;t[65]!==o||t[66]!==A?(be=()=>o(A),t[65]=o,t[66]=A,t[67]=be):be=t[67];let xe=l?`调整自动化`:`Adjust automation`,Se;t[68]!==be||t[69]!==xe?(Se=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:be,children:xe}),t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==q||t[72]!==ye||t[73]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[q,ye,Se]}),t[71]=q,t[72]=ye,t[73]=Se,t[74]=Ce):Ce=t[74];let we;t[75]!==ee?.automation||t[76]!==re||t[77]!==l?(we=re?(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[l?`多次执行可能共用此会话;下方摘要对应所选执行。`:`Executions may share this conversation. The summary belongs to the selected execution.`,ee?.automation.conversationMode===`continuous`?l?`追问会进入后续运行上下文。`:` Follow-ups become context for future runs.`:null]}):null,t[75]=ee?.automation,t[76]=re,t[77]=l,t[78]=we):we=t[78];let J;t[79]!==h||t[80]!==u||t[81]!==l?(J=u?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:h===!0?l?`已定位到所选执行的会话起点。`:`Located the selected execution in this conversation.`:h===!1?l?`旧记录缺少可用的执行定位信息,当前显示完整会话。`:`No matching turn was found in the available history. Showing the full conversation.`:l?`正在定位所选执行…`:`Locating the selected execution…`}):null,t[79]=h,t[80]=u,t[81]=l,t[82]=J):J=t[82];let Te;t[83]!==le||t[84]!==l?(Te=le?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`执行中,完成后可继续追问。`:`Execution in progress. Follow up after it finishes.`}):null,t[83]=le,t[84]=l,t[85]=Te):Te=t[85];let Ee;t[86]!==me||t[87]!==Ce||t[88]!==we||t[89]!==J||t[90]!==Te?(Ee=(0,$.jsxs)(`header`,{className:`shrink-0 space-y-2 border-b border-edge px-4 py-3`,children:[me,Ce,we,J,Te]}),t[86]=me,t[87]=Ce,t[88]=we,t[89]=J,t[90]=Te,t[91]=Ee):Ee=t[91];let Y;t[92]!==le||t[93]!==j||t[94]!==N||t[95]!==L||t[96]!==a||t[97]!==ne||t[98]!==A.error||t[99]!==A.id||t[100]!==A.summary||t[101]!==R||t[102]!==re||t[103]!==ie||t[104]!==l?(Y=ie?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(B,{className:`m-5 h-40`}),children:(0,$.jsx)(dt,{embedded:!0,automationExecution:!0,conversationId:j,readOnly:le||N,onHistoryReady:x,initialTurnId:re?A.id:void 0,onInitialTurnLocated:v},j)}):(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[A.summary?(0,$.jsx)(te,{content:A.summary}):null,A.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-danger`,children:A.error}):null,j?null:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:le?l?`等待执行会话,开始后会自动更新。`:`Waiting for the execution conversation. This view updates automatically.`:l?`本次执行没有关联会话,可查看运行结果和详情。`:`No conversation is associated with this execution. Results and diagnostics remain available.`}),j&&!L&&!R?(0,$.jsx)(B,{className:`h-24`}):null,R?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:R.status===404?l?`执行会话已删除,运行结果仍保留。`:`The execution conversation was deleted. Results are still available.`:l?`执行会话暂时无法读取,运行结果仍保留。`:`The conversation is unavailable. Results are still available.`}),(0,$.jsx)(pe,{onClick:()=>void ne(),children:l?`重试`:`Retry`})]}):null,re&&L?(0,$.jsx)(pe,{variant:`secondary`,onClick:()=>d(!0),children:l?`打开共享会话`:`Open shared conversation`}):null,le?null:(0,$.jsx)(Xe,{runId:A.id,language:a})]}),t[92]=le,t[93]=j,t[94]=N,t[95]=L,t[96]=a,t[97]=ne,t[98]=A.error,t[99]=A.id,t[100]=A.summary,t[101]=R,t[102]=re,t[103]=ie,t[104]=l,t[105]=Y):Y=t[105];let De;return t[106]!==z||t[107]!==Ee||t[108]!==Y?(De=(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":z,children:[Ee,Y]}),t[106]=z,t[107]=Ee,t[108]=Y,t[109]=De):De=t[109],De}function pt(){}function mt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-navigation-runs`].includes(String(e[0]))||e===`automations-global-system-source`}function ht(e){return e&&at(e.run)?3e3:15e3}function gt(e){let t=(0,it.c)(44),{automation:n,language:r,busy:i,onEdit:a,onAction:o}=e,s=r===`zh`,c=n.management,l=s?`${n.name}的更多操作`:`More actions for ${n.name}`,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(k,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(xe,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,className:`size-8 p-0`,"aria-label":l,children:u})}),t[1]=l,t[2]=d);let f;t[3]!==n||t[4]!==i||t[5]!==c||t[6]!==o||t[7]!==s?(f=(!c||c.editable.includes(`enabled`))&&!De(n)?(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:toggle`,()=>n.enabled?Z.pause(n.id):Z.resume(n.id)),children:[n.enabled?(0,$.jsx)(F,{className:`size-4`}):(0,$.jsx)(L,{className:`size-4`}),n.enabled?s?`暂停`:`Pause`:s?`恢复`:`Resume`]}):null,t[3]=n,t[4]=i,t[5]=c,t[6]=o,t[7]=s,t[8]=f):f=t[8];let p;t[9]!==n.id||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==s?(p=!c||c.runnable?(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:run`,()=>Z.runNow(n.id)),children:[(0,$.jsx)(L,{className:`size-4`}),s?`立即运行`:`Run now`]}):null,t[9]=n.id,t[10]=i,t[11]=c,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==i||t[17]!==c||t[18]!==a||t[19]!==s?(m=!c||c.editable.includes(`trigger`)?(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>a(n),children:[(0,$.jsx)(I,{className:`size-4`}),s?`编辑`:`Edit`]}):null,t[15]=n,t[16]=i,t[17]=c,t[18]=a,t[19]=s,t[20]=m):m=t[20];let h;t[21]!==n.id||t[22]!==o||t[23]!==s?(h=()=>void o(`automation:${n.id}:copy-link`,()=>navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}#/automations?automation=${encodeURIComponent(n.id)}`),s?`任务链接已复制`:`Task link copied`),t[21]=n.id,t[22]=o,t[23]=s,t[24]=h):h=t[24];let g;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(O,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:h,children:[g,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.id||t[30]!==i||t[31]!==c||t[32]!==o||t[33]!==s?(y=!c||c.deletable?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50 text-danger`,disabled:i,onSelect:()=>{window.confirm(s?`删除这个定时任务?已保存的对话仍可查看。`:`Delete this scheduled task? Saved conversations will remain available.`)&&o(`automation:${n.id}:delete`,()=>Z.remove(n.id))},children:[(0,$.jsx)(se,{className:`size-4`}),s?`删除`:`Delete`]})]}):null,t[29]=n.id,t[30]=i,t[31]=c,t[32]=o,t[33]=s,t[34]=y):y=t[34];let b;t[35]!==v||t[36]!==y||t[37]!==f||t[38]!==p||t[39]!==m?(b=(0,$.jsx)(Se,{children:(0,$.jsxs)(Te,{align:`end`,sideOffset:4,className:`z-70 min-w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[f,p,m,v,y]})}),t[35]=v,t[36]=y,t[37]=f,t[38]=p,t[39]=m,t[40]=b):b=t[40];let x;return t[41]!==b||t[42]!==d?(x=(0,$.jsxs)(be,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=x):x=t[43],x}function _t({automations:e,runs:t,labels:n,cronLabels:r,language:i,selectedAutomationId:a,selectedRunId:o,selectedRun:s,projectId:c,executionSummaries:l,onSelectRun:d,onOpenDetails:f,busy:p,onEdit:m,onAction:h}){let g=`xopc.automation-navigation:${u(e=>e.baseUrl)}:${u(e=>e.conversationId)??`local`}`,[_,v]=(0,Q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}});(0,Q.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);v(e&&typeof e==`object`&&!Array.isArray(e)?e:{})}catch{v({})}},[g]);let y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{!a||y.current===a||(y.current=a,v(e=>({...e,[a]:!0})))},[a]);let b=e=>v(t=>{let n={...t,[e]:!t[e]};try{localStorage.setItem(g,JSON.stringify(n))}catch{}return n});return e.length===0?(0,$.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:n.empty.filtered}):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:e.map(e=>{let u=t.filter(t=>t.automationId===e.id).sort((e,t)=>t.createdAtMs-e.createdAtMs),g=u.find(at);return(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-expanded":!!_[e.id],"aria-controls":`automation-runs-${e.id}`,"aria-label":i===`zh`?`${_[e.id]?`收起`:`展开`} ${e.name} 的执行记录`:`${_[e.id]?`Collapse`:`Expand`} executions for ${e.name}`,className:`absolute left-1 top-2 z-10 rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>b(e.id),children:_[e.id]?(0,$.jsx)(C,{className:`size-4`}):(0,$.jsx)(w,{className:`size-4`})}),(0,$.jsxs)(`button`,{type:`button`,className:z(`block w-full p-3 pl-9 pr-10 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a===e.id&&!o&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 76px`},"aria-current":a===e.id&&!o?`true`:void 0,onClick:()=>f(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:z(`size-2 shrink-0 rounded-full`,g?`bg-blue-500`:Ze(e,u)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:De(e)?i===`zh`?`已完成`:`Completed`:e.enabled?n.enabled:n.paused}),(l?.[e.id]?.unreadCount??0)>0?(0,$.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:n.filters.unread})}):null]}),(0,$.jsxs)(`p`,{className:`mt-1 truncate pl-4 text-xs leading-5 text-fg-muted`,children:[e.enabled?(0,$.jsxs)($.Fragment,{children:[Fe(e,n,i),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,ke(e.trigger,n,r,i)]}),Ze(e,u)?(0,$.jsx)(`p`,{className:`mt-1 pl-4 text-xs text-red-700 dark:text-red-300`,children:n.dashboard.needsAttention}):null]}),(0,$.jsx)(`div`,{id:`automation-runs-${e.id}`,hidden:!_[e.id],children:(0,$.jsx)(ot,{automationId:e.id,projectId:c,language:i,selectedRunId:o,selectedRun:s,enabled:!!_[e.id],onSelectRun:d})}),(0,$.jsx)(`div`,{className:`absolute right-1 top-2 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,$.jsx)(gt,{automation:e,language:i,busy:p,onEdit:m,onAction:h})})]},e.id)})})}var vt=`xopc.automations.listWidth`,yt=272,bt=200,xt=560;function St({children:e,language:t,busy:n}){let r=(0,Q.useRef)(null),i=(0,Q.useRef)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(()=>{try{let e=Number(window.localStorage.getItem(vt));if(Number.isFinite(e)&&e>=bt&&e<=xt)return e}catch{}return yt});(0,Q.useEffect)(()=>{try{window.localStorage.setItem(vt,String(s))}catch{}},[s]),(0,Q.useEffect)(()=>{if(!a)return;let{cursor:e,userSelect:t}=document.body.style;return document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,()=>{document.body.style.cursor=e,document.body.style.userSelect=t}},[a]);let l=e=>{let t=r.current?.getBoundingClientRect().width??1e3,n=Math.max(bt,Math.min(xt,t*.6,t-292));return Math.round(Math.max(bt,Math.min(n,e)))},u=t===`zh`?`调整任务列表宽度`:`Resize task list`;return(0,$.jsxs)(`section`,{ref:r,"aria-busy":n,className:`grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-y-3 md:grid-cols-[minmax(0,min(var(--automation-list-width),60%))_0.75rem_minmax(0,1fr)] md:grid-rows-1 md:gap-y-0`,style:{"--automation-list-width":`${s}px`},children:[e[0],(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":u,"aria-valuemin":bt,"aria-valuemax":xt,"aria-valuenow":s,tabIndex:0,title:t===`zh`?`左右拖动调整宽度,双击恢复默认`:`Drag to resize, double-click to reset`,className:`relative hidden touch-none select-none cursor-col-resize focus-visible:outline-accent md:block`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e.currentTarget.previousElementSibling?.getBoundingClientRect().width??s;i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t},o(!0)},onPointerMove:e=>{let t=i.current;t?.pointerId===e.pointerId&&c(l(t.startWidth+e.clientX-t.startX))},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&(i.current=null,o(!1),e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{i.current=null,o(!1)},onLostPointerCapture:()=>{i.current=null,o(!1)},onDoubleClick:()=>c(yt),onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),c(l(e.key===`Home`?bt:e.key===`End`?xt:s+(e.key===`ArrowLeft`?-16:16))))}}),e[1]]})}var Ct=(0,Q.lazy)(()=>i(()=>import(`./chat-page-DQNLsOad.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191])));function wt(e){let t=(0,it.c)(51),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]!==c||t[1]!==r?(l=c&&!r?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=r,t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=()=>Z.openConfiguration({automationId:c}),t[3]=c,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[5]=d):d=t[5];let{data:p,error:m,mutate:h}=W(l,u,d),g;t[6]===r?g=t[7]:(g=r?[`automation-configuration`,r]:null,t[6]=r,t[7]=g);let _;t[8]===r?_=t[9]:(_=()=>Z.configuration(r),t[8]=r,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[10]=v):v=t[10];let{data:y}=W(g,_,v),b,x;t[11]!==n||t[12]!==s||t[13]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[11]=n,t[12]=s,t[13]=y,t[14]=b,t[15]=x):(b=t[14],x=t[15]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ue(),w;t[16]===S?w=t[17]:(w=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[16]=S,t[17]=w);let T=U(w),E=(0,Q.useRef)(!1),D,ee;t[18]!==C||t[19]!==T?(D=()=>{E.current&&!T&&C(Tt),E.current=T},ee=[T,C],t[18]=C,t[19]=T,t[20]=D,t[21]=ee):(D=t[20],ee=t[21]),(0,Q.useEffect)(D,ee);let O=a===`zh`,k;t[22]===a?k=t[23]:(k=f(a),t[22]=a,t[23]=k);let A=k,j;if(t[24]!==a||t[25]!==A.automations.status||t[26]!==o||t[27]!==i||t[28]!==O){let e;t[30]!==a||t[31]!==A.automations.status||t[32]!==o||t[33]!==O?(e=e=>({id:`automation-run:${e.id}`,timestamp:e.createdAtMs,content:(0,$.jsxs)(`article`,{className:`mx-auto w-full max-w-[var(--max-width-chat-frame)] space-y-3 py-3`,"aria-label":O?`任务运行结果`:`Task run result`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,$.jsxs)(`span`,{children:[new Date(e.createdAtMs).toLocaleString(O?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,A.automations.status[e.status]]}),(0,$.jsx)(`button`,{type:`button`,className:`rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>o(e.id),children:O?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:Qe(e,a)}):e.summary?(0,$.jsx)(te,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:O?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(ze,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)(Xe,{runId:e.id,language:a})]})}),t[30]=a,t[31]=A.automations.status,t[32]=o,t[33]=O,t[34]=e):e=t[34],j=i.map(e),t[24]=a,t[25]=A.automations.status,t[26]=o,t[27]=i,t[28]=O,t[29]=j}else j=t[29];let M=j;if(m){let e=O?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[35]===e?n=t[36]:(n=(0,$.jsx)(`p`,{children:e}),t[35]=e,t[36]=n);let r;t[37]===h?r=t[38]:(r=()=>void h(),t[37]=h,t[38]=r);let i=O?`重试`:`Retry`,a;t[39]!==r||t[40]!==i?(a=(0,$.jsx)(pe,{variant:`secondary`,onClick:r,children:i}),t[39]=r,t[40]=i,t[41]=a):a=t[41];let o;return t[42]!==n||t[43]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[42]=n,t[43]=a,t[44]=o):o=t[44],o}let N=O?`任务对话`:`Task conversation`,P;t[45]!==M||t[46]!==S?(P=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(B,{className:`m-5 h-40`}),children:(0,$.jsx)(Ct,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:M},S)}):(0,$.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,$.jsx)(B,{className:`h-20 w-2/3`}),(0,$.jsx)(B,{className:`h-28`})]}),t[45]=M,t[46]=S,t[47]=P):P=t[47];let F;return t[48]!==N||t[49]!==P?(F=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":N,children:P}),t[48]=N,t[49]=P,t[50]=F):F=t[50],F}function Tt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}var Et=`relative flex min-h-9 cursor-pointer items-center rounded-md py-2 pl-3 pr-8 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,Dt=`z-70 max-h-[min(32rem,calc(100dvh-2rem))] min-w-52 overflow-y-auto rounded-xl border border-edge bg-surface-overlay p-1.5 shadow-popover`;function Ot(e){let t=(0,it.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ye,{className:`absolute right-2.5`,children:(0,$.jsx)(S,{className:`size-3.5`,"aria-hidden":!0})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,$.jsxs)(q,{value:n,className:Et,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function kt(e){let t=(0,it.c)(134),{language:n,labels:r,filter:i,ownership:a,source:o,projectId:s,projects:c,projectLocked:l,query:u,unreadCount:d,markReadBusy:f,onFilter:p,onOwnership:m,onSource:h,onProject:g,onQuery:_,onClear:v,onMarkAllRead:y}=e,b=n===`zh`,[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=x||!!u,D=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,ee;t[0]===_?ee=t[1]:(ee=()=>{_(``),S(!1),T.current?.focus()},t[0]=_,t[1]=ee);let O=ee,k=b?`定时任务`:`Scheduled tasks`,A;t[2]===k?A=t[3]:(A=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:k}),t[2]=k,t[3]=A);let j=b?`筛选任务`:`Filter tasks`,N=b?`筛选任务`:`Filter tasks`,te=D&&`text-accent-fg`,P;t[4]===te?P=t[5]:(P=z(`relative rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-surface-hover`,te),t[4]=te,t[5]=P);let F;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(M,{className:`size-4`,"aria-hidden":!0}),t[6]=F):F=t[6];let I;t[7]!==D||t[8]!==b?(I=D?(0,$.jsx)(`span`,{className:`absolute right-1.5 top-1.5 size-1 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:b?`已应用筛选`:`Filters applied`})}):null,t[7]=D,t[8]=b,t[9]=I):I=t[9];let L;t[10]!==j||t[11]!==N||t[12]!==P||t[13]!==I?(L=(0,$.jsx)(xe,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":j,title:N,className:P,children:[F,I]})}),t[10]=j,t[11]=N,t[12]=P,t[13]=I,t[14]=L):L=t[14];let R=b?`状态`:`Status`,ne;t[15]===R?ne=t[16]:(ne=(0,$.jsx)(ge,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:R}),t[15]=R,t[16]=ne);let ie;t[17]===p?ie=t[18]:(ie=e=>p(e),t[17]=p,t[18]=ie);let ae=b?`全部状态`:`All statuses`,oe;t[19]===ae?oe=t[20]:(oe=(0,$.jsx)(Ot,{value:`all`,children:ae}),t[19]=ae,t[20]=oe);let se;t[21]===r.filters.active?se=t[22]:(se=(0,$.jsx)(Ot,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=se);let le;t[23]===r.paused?le=t[24]:(le=(0,$.jsx)(Ot,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=le);let B=b?`已完成`:`Completed`,V;t[25]===B?V=t[26]:(V=(0,$.jsx)(Ot,{value:`completed`,children:B}),t[25]=B,t[26]=V);let H;t[27]===r.metrics.running?H=t[28]:(H=(0,$.jsx)(Ot,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=H);let U;t[29]===r.dashboard.needsAttention?U=t[30]:(U=(0,$.jsx)(Ot,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=U);let ue;t[31]!==i||t[32]!==ie||t[33]!==oe||t[34]!==se||t[35]!==le||t[36]!==V||t[37]!==H||t[38]!==U?(ue=(0,$.jsxs)(J,{value:i,onValueChange:ie,children:[oe,se,le,V,H,U]}),t[31]=i,t[32]=ie,t[33]=oe,t[34]=se,t[35]=le,t[36]=V,t[37]=H,t[38]=U,t[39]=ue):ue=t[39];let W;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),t[40]=W):W=t[40];let de=b?`归属`:`Owner`,G;t[41]===de?G=t[42]:(G=(0,$.jsx)(ge,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:de}),t[41]=de,t[42]=G);let fe;t[43]===m?fe=t[44]:(fe=e=>m(e),t[43]=m,t[44]=fe);let pe=b?`我的任务`:`My tasks`,me;t[45]===pe?me=t[46]:(me=(0,$.jsx)(Ot,{value:`user`,children:pe}),t[45]=pe,t[46]=me);let K=b?`系统任务`:`System tasks`,he;t[47]===K?he=t[48]:(he=(0,$.jsx)(Ot,{value:`system`,children:K}),t[47]=K,t[48]=he);let q;t[49]!==a||t[50]!==fe||t[51]!==me||t[52]!==he?(q=(0,$.jsxs)(J,{value:a,onValueChange:fe,children:[me,he]}),t[49]=a,t[50]=fe,t[51]=me,t[52]=he,t[53]=q):q=t[53];let ye;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),t[54]=ye):ye=t[54];let Y;t[55]!==r.filters.allProjects||t[56]!==g||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==b?(Y=l?null:(0,$.jsxs)(_e,{children:[(0,$.jsxs)(Ce,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[b?`项目`:`Project`,(0,$.jsx)(`span`,{className:`ml-auto max-w-28 truncate text-xs text-fg-muted`,children:c.find(e=>e.id===s)?.name??r.filters.allProjects}),(0,$.jsx)(w,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(Se,{children:(0,$.jsx)(ve,{sideOffset:4,className:Dt,children:(0,$.jsxs)(J,{value:s,onValueChange:g,children:[(0,$.jsx)(Ot,{value:``,children:r.filters.allProjects}),c.map(At)]})})})]}),t[55]=r.filters.allProjects,t[56]=g,t[57]=s,t[58]=l,t[59]=c,t[60]=b,t[61]=Y):Y=t[61];let De=b?`任务类型`:`Task type`,Oe;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(w,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0}),t[62]=Oe):Oe=t[62];let X;t[63]===De?X=t[64]:(X=(0,$.jsxs)(Ce,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[De,Oe]}),t[63]=De,t[64]=X);let ke;t[65]===h?ke=t[66]:(ke=e=>h(e),t[65]=h,t[66]=ke);let Ae=b?`全部类型`:`All types`,je;t[67]===Ae?je=t[68]:(je=(0,$.jsx)(Ot,{value:`all`,children:Ae}),t[67]=Ae,t[68]=je);let Me;t[69]===r.sources.agent?Me=t[70]:(Me=(0,$.jsx)(Ot,{value:`agent`,children:r.sources.agent}),t[69]=r.sources.agent,t[70]=Me);let Ne;t[71]===r.sources.task?Ne=t[72]:(Ne=(0,$.jsx)(Ot,{value:`task_command`,children:r.sources.task}),t[71]=r.sources.task,t[72]=Ne);let Pe;t[73]===r.sources.browser?Pe=t[74]:(Pe=(0,$.jsx)(Ot,{value:`browser_automation`,children:r.sources.browser}),t[73]=r.sources.browser,t[74]=Pe);let Fe;t[75]!==o||t[76]!==ke||t[77]!==je||t[78]!==Me||t[79]!==Ne||t[80]!==Pe?(Fe=(0,$.jsx)(Se,{children:(0,$.jsx)(ve,{sideOffset:4,className:Dt,children:(0,$.jsxs)(J,{value:o,onValueChange:ke,children:[je,Me,Ne,Pe]})})}),t[75]=o,t[76]=ke,t[77]=je,t[78]=Me,t[79]=Ne,t[80]=Pe,t[81]=Fe):Fe=t[81];let Ie;t[82]!==X||t[83]!==Fe?(Ie=(0,$.jsxs)(_e,{children:[X,Fe]}),t[82]=X,t[83]=Fe,t[84]=Ie):Ie=t[84];let Le;t[85]!==D||t[86]!==v||t[87]!==u||t[88]!==b?(Le=D||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),(0,$.jsx)(we,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:v,children:b?`重置筛选`:`Reset filters`})]}):null,t[85]=D,t[86]=v,t[87]=u,t[88]=b,t[89]=Le):Le=t[89];let Re;t[90]!==r.filters.markAllRead||t[91]!==f||t[92]!==y||t[93]!==d?(Re=d>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),(0,$.jsx)(we,{disabled:f,className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:y,children:r.filters.markAllRead})]}):null,t[90]=r.filters.markAllRead,t[91]=f,t[92]=y,t[93]=d,t[94]=Re):Re=t[94];let ze;t[95]!==ne||t[96]!==ue||t[97]!==G||t[98]!==q||t[99]!==Y||t[100]!==Ie||t[101]!==Le||t[102]!==Re?(ze=(0,$.jsx)(Se,{children:(0,$.jsxs)(Te,{align:`end`,sideOffset:6,className:Dt,children:[ne,ue,W,G,q,ye,Y,Ie,Le,Re]})}),t[95]=ne,t[96]=ue,t[97]=G,t[98]=q,t[99]=Y,t[100]=Ie,t[101]=Le,t[102]=Re,t[103]=ze):ze=t[103];let Be;t[104]!==L||t[105]!==ze?(Be=(0,$.jsxs)(be,{children:[L,ze]}),t[104]=L,t[105]=ze,t[106]=Be):Be=t[106];let Ve=b?`搜索任务`:`Search tasks`,He=b?`搜索任务`:`Search tasks`,Ue;t[107]!==O||t[108]!==E?(Ue=()=>{E?O():(S(!0),requestAnimationFrame(()=>C.current?.focus()))},t[107]=O,t[108]=E,t[109]=Ue):Ue=t[109];let We=E&&`bg-surface-hover text-fg`,Ge;t[110]===We?Ge=t[111]:(Ge=z(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,We),t[110]=We,t[111]=Ge);let Ke;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,$.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t[112]=Ke):Ke=t[112];let qe;t[113]!==E||t[114]!==Ve||t[115]!==He||t[116]!==Ue||t[117]!==Ge?(qe=(0,$.jsx)(`button`,{ref:T,type:`button`,"aria-label":Ve,title:He,"aria-expanded":E,onClick:Ue,className:Ge,children:Ke}),t[113]=E,t[114]=Ve,t[115]=He,t[116]=Ue,t[117]=Ge,t[118]=qe):qe=t[118];let Je;t[119]!==Be||t[120]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[Be,qe]}),t[119]=Be,t[120]=qe,t[121]=Je):Je=t[121];let Z;t[122]!==A||t[123]!==Je?(Z=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[A,Je]}),t[122]=A,t[123]=Je,t[124]=Z):Z=t[124];let Ye;t[125]!==O||t[126]!==_||t[127]!==u||t[128]!==E||t[129]!==b?(Ye=E?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2.5 focus-within:border-accent`,children:[(0,$.jsx)(re,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:C,value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),O())},"aria-label":b?`搜索任务名称或内容`:`Search task names or content`,placeholder:b?`搜索任务…`:`Search tasks…`,className:`min-h-10 min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-subtle`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":b?`关闭搜索`:`Close search`,onClick:O,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[125]=O,t[126]=_,t[127]=u,t[128]=E,t[129]=b,t[130]=Ye):Ye=t[130];let Xe;return t[131]!==Z||t[132]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Z,Ye]}),t[131]=Z,t[132]=Ye,t[133]=Xe):Xe=t[133],Xe}function At(e){return(0,$.jsx)(Ot,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var jt=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`Morning briefing`,`Start each day with your tasks and project updates.`,`每天早上帮我整理当天到期、逾期的任务和项目进展,给出今天的重点。`,`Each morning, summarize my due and overdue tasks and project progress, and suggest priorities.`],[`📝`,`每周工作回顾`,`回顾一周的成果和问题,为下周留出清晰的方向。`,`Weekly review`,`Review the week and find a clear direction for the next.`,`每周五帮我回顾本周完成的任务和项目进展,整理未解决的问题,建议下周的重点。`,`Every Friday, review completed tasks and project progress, unresolved issues, and priorities for next week.`],[`🌱`,`项目进展跟进`,`定期看看项目进度,找出需要你关注的事情。`,`Project check-in`,`Keep an eye on project progress and what needs attention.`,`定期帮我检查项目进度,整理延期、阻塞和需要我决策的事项。先和我确认关注哪个项目以及运行时间。`,`Regularly review a project for delays, blockers, and decisions I need to make. Ask which project and when to run.`],[`🔔`,`重要事项提醒`,`把容易忘记的事情交给提醒,安心专注眼前。`,`A timely reminder`,`Make room to focus by setting a reminder for later.`,`我想安排一个重要事项提醒。请先问我需要提醒什么、什么时候提醒,以及是否重复。`,`Help me schedule a reminder. Ask what to remember, when, and whether it should repeat.`],[`📚`,`笔记整理`,`回看新收集的想法,整理出值得继续推进的线索。`,`Notes roundup`,`Revisit recent ideas and surface useful next steps.`,`每周帮我回顾最近新增的笔记,按主题整理,找出值得继续推进的想法。请先确认时间和范围。`,`Each week, group my recent notes by topic and suggest ideas worth pursuing. Confirm the schedule and scope.`],[`🧭`,`明日工作计划`,`下班前梳理未完成的事,安排明天最重要的三件事。`,`Plan tomorrow`,`Wrap up loose ends and choose tomorrow’s top three priorities.`,`每个工作日下班前,帮我梳理未完成的任务,建议明天最重要的三件事。请先确认具体时间。`,`Before the end of each workday, review unfinished tasks and suggest tomorrow’s top three priorities. Confirm the time.`],[`🗓️`,`月度复盘`,`拉远一点看进展,发现反复出现的问题和新的机会。`,`Monthly reflection`,`Step back to spot progress, recurring problems, and opportunities.`,`每月月底帮我回顾项目和任务的进展,总结成果、反复出现的问题和下个月的重点。请确认运行时间。`,`At the end of each month, review project and task progress, achievements, recurring problems, and priorities. Confirm the schedule.`],[`🎯`,`逾期任务检查`,`定期发现被搁置的事项,让重要的事重新向前。`,`Overdue task check`,`Find neglected tasks and get important work moving again.`,`定期帮我检查逾期任务,按紧迫程度整理,并建议下一步。请先确认运行频率和时间。`,`Regularly review overdue tasks, prioritize them by urgency, and suggest next steps. Confirm the frequency and time.`]];function Mt(e=Math.random){let t=[...jt];for(let n=t.length-1;n>0;n--){let r=Math.min(n,Math.max(0,Math.floor(e()*(n+1))));[t[n],t[r]]=[t[r],t[n]]}return t.slice(0,6)}function Nt({language:e,projectId:t,onOpenConversation:n}){let r=s(),[i,a]=(0,Q.useState)(!1),[o,c]=(0,Q.useState)(``),l=async e=>{a(!0),c(``);try{let i=await Ve({projectId:t,prompt:e});n?n(i):r(i)}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}},u=e===`zh`,[d,f]=(0,Q.useState)(Mt),p=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-2 py-10 sm:px-6 md:py-20`,children:[(0,$.jsxs)(`div`,{className:`text-center`,children:[(0,$.jsx)(x,{className:`mx-auto size-10 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:u?`安排任务`:`Schedule a task`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:u?`说说你希望定期完成什么,我们一起安排好。`:`Tell us what you’d like done regularly. We’ll work out the details together.`})]}),(0,$.jsxs)(`div`,{className:`mb-3 mt-10 flex items-center justify-between text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:u?`也可以从这些想法开始`:`Or start with an idea`}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>f(Mt()),className:`flex items-center gap-1.5 rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),u?`换一组`:`More ideas`]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:d.map(e=>(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>void l(u?e[5]:e[6]),className:`flex min-h-28 items-center gap-4 rounded-xl border border-dashed border-edge bg-surface-panel px-5 py-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-2xl`,"aria-hidden":!0,children:e[0]}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:u?e[1]:e[3]}),(0,$.jsx)(`span`,{className:`mt-1 block text-sm leading-5 text-fg-muted`,children:u?e[2]:e[4]})]})]},e[1]))}),(0,$.jsx)(`div`,{className:`mt-6 text-center`,children:(0,$.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void l(),className:`rounded-md px-3 py-2 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:u?`说说你想安排的其他任务`:`Describe another task`})}),o?(0,$.jsx)(`p`,{role:`alert`,className:`mt-3 text-center text-sm text-danger`,children:o}):null]});return(0,$.jsx)(`section`,{"aria-label":u?`安排任务`:`Schedule a task`,children:p})}function Pt(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function Ft(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function It(e,t={}){let n=Pt(e.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-CwP4OMdW.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/locale-store-B6OrWgY1.js","assets/messages-jwdBhfL9.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/archive-Dz0hferG.js","assets/arrow-left-D880xG-P.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-DDQUsag7.js","assets/activity-YogQEteU.js","assets/bot-DjLkhyZL.js","assets/circle-check-C23XjkUj.js","assets/circle-pause-CN9jYH2s.js","assets/clock-3-DnrAnuyZ.js","assets/external-link-DjqjBmc3.js","assets/notes-api-Ddsf7FVg.js","assets/markdown-view-DrhYZSmg.js","assets/download-Dk-ZjtO6.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/app-link-DRy3-k7j.js","assets/product-delivery-DRyD9_Xq.js","assets/schemas-CCWMleym.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/chat-chart-block-QSvjx4w6.js","assets/check-DUBLcKHA.js","assets/copy-Dv6d4Dvw.js","assets/skeleton-BI5TyibZ.js","assets/loader-circle-CifKLtgG.js","assets/message-square-fVE7Ghj1.js","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/rotate-ccw-JM1TBLpp.js","assets/rotate-cw-LIg3Am9S.js","assets/sparkles-DHlfQFAF.js","assets/triangle-alert-2JXFNNKU.js","assets/volume-2-BSJhAY97.js","assets/zap-dximCGjy.js","assets/vendor-swr-CdRzEUwF.js","assets/button-Cc4hUNTt.js","assets/automation-api-CLPsgcQN.js","assets/book-open-CCGtrT3R.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/working-directory-picker-modal-DGp9cNzH.js","assets/file-archive-DanfQJNe.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/settings-form-draft-Dy10ldo8.js","assets/popover-select-CEMWIrtY.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-alert-BEjgurr2.js","assets/new-chat-navigation-B6NPQ4h4.js","assets/circle-x-DFsCKeya.js","assets/circle-BoO4YvTx.js","assets/file-tree-utils-DJs1faGv.js","assets/database-CjjeZfRG.js","assets/earth-BMhZtzcj.js","assets/ellipsis-0k4rZLoy.js","assets/file-BqMS_3DT.js","assets/file-text-D12HbeVy.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-open-CyzJ19I9.js","assets/folder-CN-pC3XL.js","assets/use-file-preview-expanded-CW956CXS.js","assets/eye-CABVeTq0.js","assets/link-2-D_ZKYUW7.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/constants-DBtMsXdW.js","assets/session-api-Bfmlmn9F.js","assets/gateway-startup-retry-C8g666Ja.js","assets/attachment-utils-core-BIOUBrpT.js","assets/activity-store-BpYGrRXw.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/sliding-tab-list-DuQyViqe.js","assets/sliding-indicator-hwz0sx3h.js","assets/index.module-Cd9ENXfk.js","assets/workspace-api-HBXn8pL9.js","assets/files-BNL4kkSB.js","assets/dist-ZrL34Ps4.js","assets/git-branch-Dh9uxTot.js","assets/globe-DSSGFWFn.js","assets/history-DXH_9jsE.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/mic-CuUb7zc-.js","assets/monitor-Af5eAvF7.js","assets/install-connector-dialog-Cn4nRSyt.js","assets/secret-input-Dryrns2s.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-DtvB9Cjm.js","assets/gateway-config-swr-D6cc6W6E.js","assets/oauth-provider-connect-BkhnftBq.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-BLcha5rx.js","assets/registry-api-Bl2guMRg.js","assets/oauth-api-CMmu4DzH.js","assets/settings-2-D-csvaET.js","assets/settings-uiTATseT.js","assets/shield-check-BU58siTV.js","assets/smartphone-DSSsQFqA.js","assets/square-DMK_fB-3.js","assets/trash-2-DusmjVPV.js","assets/share-link-dialog-BMcXyzr2.js","assets/copy-text-row-CpiRzq4G.js","assets/wrench-DFb4r8bH.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/api-oIK4hYkJ.js","assets/session-manager-X4UHOjjO.js","assets/local-session-drafts-DTq9776a.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/gateway-realtime-BSRNLciy.js","assets/gateway-realtime-store-BFeFfApQ.js","assets/agents-admin-api-CXCAHNPj.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-C4jLFIgh.js","assets/capabilities-DlHPLld_.js","assets/theme-store-TkG5mo0p.js","assets/middleware-Pd0e8Igk.js","assets/use-composer-attachments-XRlQBdNF.js","assets/chevron-left-DqFhpbvK.js","assets/capabilities-CoeuLRt6.js","assets/file-preview-surface-zE9AcaHM.js","assets/phone-workspace-store-DbqktZbO.js","assets/shares-api-DOeDN6Tm.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/chat-agents-api-BB0biwc7.js","assets/composer-payload-handoff-Bogdq9Hy.js","assets/voice-transcribe-api-CVEcB6Pe.js","assets/open-capability-settings-Cvb65hQB.js","assets/workspace-editor-agent-store-msZa42fU.js","assets/voice-input-shortcut-events-B9xc1oK8.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/tool-friendly-title-DcCc6g7o.js","assets/voice-call-context-BM2A4bLz.js","assets/page-header-store-CEn_kPsn.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/agent-avatar-display-BUH7ljEo.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-D7dQJytv.js","assets/command-palette-api-CEG10uE-.js","assets/skill-list-api-DpHaXI2l.js","assets/skill-api-utils-C7V4JVXM.js","assets/model-selector-DXm4NS1_.js","assets/dev-view-store-BgW2Riyk.js","assets/extension-iframe-host-63KpX6IP.js","assets/automation-task-card-D27Mw66U.js","assets/calendar-clock-D-quYVPe.js","assets/message-circle-Badhj-4D.js","assets/date-picker-CAankdQw.js","assets/calendar-days-hw_Y-g-s.js","assets/api-DMbimMEi.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-BbWUcQe7.js","assets/agents-app-path-ciChvpCS.js","assets/agent-display-names-Bje7vfSn.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-BuNUerth.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
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"./preload-helper-Czpn1I53.js";import{m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as c,i as l,l as u,n as d}from"./locale-store-B6OrWgY1.js";import{t as f}from"./messages-jwdBhfL9.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{t as y}from"./activity-YogQEteU.js";import{t as b}from"./arrow-left-D880xG-P.js";import{t as x}from"./calendar-clock-D-quYVPe.js";import{t as S}from"./check-DUBLcKHA.js";import{t as C}from"./chevron-down-ccbiQQz_.js";import{t as w}from"./chevron-right-BweFrslA.js";import{n as T,r as E}from"./popover-select-CEMWIrtY.js";import{t as D}from"./circle-alert-BEjgurr2.js";import{t as ee}from"./circle-check-C23XjkUj.js";import{t as O}from"./copy-Dv6d4Dvw.js";import{t as k}from"./ellipsis-0k4rZLoy.js";import{t as A}from"./eye-CABVeTq0.js";import{t as j}from"./git-branch-Dh9uxTot.js";import{t as M}from"./list-filter-CIPvpfLA.js";import{t as N}from"./list-tree-B0OMswgM.js";import{t as te}from"./markdown-view-DrhYZSmg.js";import{t as P}from"./message-circle-Badhj-4D.js";import{t as F}from"./pause-DuPxgSxk.js";import{t as I}from"./pencil-DmIY3Oa-.js";import{t as L}from"./play-kxZvpBg8.js";import{t as R}from"./plus-Q2yW6OE7.js";import{t as ne}from"./refresh-cw-BRlGaq2w.js";import{t as re}from"./search-DA7gz22f.js";import{t as ie}from"./shield-check-BU58siTV.js";import{t as ae}from"./sparkles-DHlfQFAF.js";import{t as oe}from"./square-pen-B8FsvqNu.js";import{t as se}from"./trash-2-DusmjVPV.js";import{t as ce}from"./x-B_N4OPjy.js";import{t as le}from"./zap-dximCGjy.js";import{t as z}from"./cn-0WouolD0.js";import{t as B}from"./skeleton-BI5TyibZ.js";import{d as V}from"./api-oIK4hYkJ.js";import{a as H}from"./session-api-Bfmlmn9F.js";import{T as U}from"./session-manager-X4UHOjjO.js";import{a as ue,i as W,o as de,t as G}from"./vendor-swr-CdRzEUwF.js";import{t as fe}from"./chat-agents-api-BB0biwc7.js";import{t as pe}from"./button-Cc4hUNTt.js";import{t as me}from"./page-header-store-CEn_kPsn.js";import{t as K}from"./sliding-tab-list-DuQyViqe.js";import{t as he}from"./refresh-button-DiWdGAaX.js";import{a as ge,c as q,d as _e,f as ve,i as ye,l as be,m as xe,o as Se,p as Ce,r as we,s as J,t as Te,u as Ee}from"./dist-ZrL34Ps4.js";import{n as Y}from"./model-selector-DXm4NS1_.js";import{C as De,S as Oe,T as X,_ as ke,a as Ae,b as je,c as Me,d as Ne,f as Pe,g as Fe,h as Ie,l as Le,m as Re,n as ze,o as Be,p as Ve,r as He,s as Ue,u as We,v as Ge,w as Ke,x as qe,y as Je}from"./automation-task-card-D27Mw66U.js";import{t as Z}from"./automation-api-CLPsgcQN.js";import{n as Ye}from"./agent-display-names-Bje7vfSn.js";import{i as Xe,n as Ze,r as Qe,t as $e}from"./automation-result-state-CKVnR4KG.js";import{i as et,n as tt,r as nt,t as rt}from"./browser-automation-inputs-uGK086ag.js";var it=n(),Q=e(t(),1),$=r(),at=e=>[`queued`,`running`,`cancelling`].includes(e.status);function ot(e){let t=(0,it.c)(58),{automationId:n,projectId:r,language:i,selectedRunId:a,selectedRun:o,enabled:s,onSelectRun:c}=e,l=s===void 0||s,[u,d]=(0,Q.useState)(!1),p=i===`zh`,m;t[0]!==n||t[1]!==l||t[2]!==r?(m=(e,t)=>!l||e&&!t?.nextCursor?null:[`automation-navigation-runs`,n,r??``,e?t.nextCursor:``],t[0]=n,t[1]=l,t[2]=r,t[3]=m):m=t[3];let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h={refreshInterval:lt,refreshWhenHidden:!1,refreshWhenOffline:!1,revalidateAll:!0,persistSize:!0},t[4]=h):h=t[4];let{data:g,error:_,size:v,setSize:y,isValidating:b,mutate:x}=G(m,ut,h),S,C,w,T,E,D;if(t[5]!==u||t[6]!==n||t[7]!==g||t[8]!==_||t[9]!==b||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==a||t[14]!==v||t[15]!==p){C=[...new Map((g??[]).flatMap(ct).map(st)).values()];let e=u?C:C.slice(0,3),r=o?.automationId===n&&!e.some(e=>e.id===o.id)?[o,...e]:e;S=b&&(!g||g.length<v),w=`space-y-1 pb-3 pl-8 pr-2`,T=p?`执行记录`:`Execution history`,t[22]!==g||t[23]!==_?(E=!g&&!_?(0,$.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 px-3 py-2`,children:[(0,$.jsx)(B,{className:`h-8`}),(0,$.jsx)(B,{className:`h-8`})]}):null,t[22]=g,t[23]=_,t[24]=E):E=t[24],D=r.map(t=>(0,$.jsxs)(`button`,{type:`button`,className:z(`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,a===t.id&&`bg-surface-active text-fg`),"aria-current":a===t.id?`true`:void 0,onClick:()=>c(t),children:[(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{children:new Date(t.createdAtMs).toLocaleString(p?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}),!at(t)&&t.readAtMs==null?(0,$.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:p?`未读`:`Unread`})}):null]}),o?.id===t.id&&!e.some(e=>e.id===t.id)?(0,$.jsx)(`span`,{className:`block text-accent-fg`,children:p?`当前查看`:`Currently viewing`}):null,(0,$.jsx)(`span`,{className:z(`block`,[`failed`,`timeout`].includes(t.status)&&`text-danger`),children:f(i).automations.status[t.status]})]},t.id)),t[5]=u,t[6]=n,t[7]=g,t[8]=_,t[9]=b,t[10]=i,t[11]=c,t[12]=o,t[13]=a,t[14]=v,t[15]=p,t[16]=S,t[17]=C,t[18]=w,t[19]=T,t[20]=E,t[21]=D}else S=t[16],C=t[17],w=t[18],T=t[19],E=t[20],D=t[21];let ee;t[25]!==g||t[26]!==C||t[27]!==p?(ee=g&&C.length===0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-fg-muted`,children:p?`尚未执行`:`No executions yet`}):null,t[25]=g,t[26]=C,t[27]=p,t[28]=ee):ee=t[28];let O;t[29]!==_||t[30]!==x||t[31]!==p?(O=_?(0,$.jsxs)(`div`,{role:`alert`,className:`px-3 py-2 text-xs text-danger`,children:[(0,$.jsx)(`p`,{children:p?`执行记录加载失败`:`Could not load history`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>void x(),children:p?`重试`:`Retry`})]}):null,t[29]=_,t[30]=x,t[31]=p,t[32]=O):O=t[32];let k;t[33]!==u||t[34]!==g?.[0]?.hasMore||t[35]!==C||t[36]!==p?(k=!u&&(C.length>3||g?.[0]?.hasMore)?(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>d(!0),children:p?`查看全部执行`:`View all executions`}):null,t[33]=u,t[34]=g?.[0]?.hasMore,t[35]=C,t[36]=p,t[37]=k):k=t[37];let A;t[38]!==u||t[39]!==g||t[40]!==S||t[41]!==y||t[42]!==v||t[43]!==p?(A=u&&g?.at(-1)?.hasMore?(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,disabled:S,onClick:()=>void y(v+1),children:S?p?`加载中…`:`Loading…`:p?`加载更多`:`Load more`}):null,t[38]=u,t[39]=g,t[40]=S,t[41]=y,t[42]=v,t[43]=p,t[44]=A):A=t[44];let j;t[45]!==u||t[46]!==p?(j=u?(0,$.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>d(!1),children:p?`收起历史`:`Show recent`}):null,t[45]=u,t[46]=p,t[47]=j):j=t[47];let M;return t[48]!==k||t[49]!==A||t[50]!==j||t[51]!==w||t[52]!==T||t[53]!==E||t[54]!==D||t[55]!==ee||t[56]!==O?(M=(0,$.jsxs)(`div`,{className:w,"aria-label":T,children:[E,D,ee,O,k,A,j]}),t[48]=k,t[49]=A,t[50]=j,t[51]=w,t[52]=T,t[53]=E,t[54]=D,t[55]=ee,t[56]=O,t[57]=M):M=t[57],M}function st(e){return[e.id,e]}function ct(e){return e.runs}function lt(e){return(e?.length??0)>1?0:e?.[0]?.runs.some(at)?3e3:15e3}function ut(e){let[,t,n,r]=e;return Z.runs(20,t,{projectId:n||void 0,cursor:r||void 0})}var dt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-CwP4OMdW.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191])));function ft(e){let t=(0,it.c)(110),{runId:n,automationId:r,projectId:i,language:a,onConfigure:o,onDetails:s,onBack:c}=e,l=a===`zh`,[u,d]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>g(e),t[0]=_):_=t[0];let v=_,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(!0),t[1]=y):y=t[1];let x=y,{mutate:S}=ue(),C=(0,Q.useRef)(!1),w=i??``,T;t[2]!==r||t[3]!==n||t[4]!==w?(T=[`automation-execution`,r,n,w],t[2]=r,t[3]=n,t[4]=w,t[5]=T):T=t[5];let E;t[6]!==r||t[7]!==i||t[8]!==n||t[9]!==l?(E=async()=>{let{run:e}=await Z.getRun(n);if(e.automationId!==r)throw Error(l?`执行记录不属于此自动化`:`Execution does not belong to this automation`);let{automation:t}=await Z.get(r);if(i&&t.projectId!==i)throw Error(l?`执行记录不属于此项目`:`Execution does not belong to this project`);return{run:e,automation:t}},t[6]=r,t[7]=i,t[8]=n,t[9]=l,t[10]=E):E=t[10];let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D={refreshInterval:ht,shouldRetryOnError:!1},t[11]=D):D=t[11];let{data:ee,error:O,mutate:k}=W(T,E,D),A=ee?.run,j=A?.conversationId,M;t[12]===j?M=t[13]:(M=e=>!!(j&&(e.sessions[j]?.streaming||e.sessions[j]?.sending)),t[12]=j,t[13]=M);let N=U(M),P;t[14]===j?P=t[15]:(P=j?[`automation-execution-session`,j]:null,t[14]=j,t[15]=P);let F;t[16]===j?F=t[17]:(F=()=>H(j),t[16]=j,t[17]=F);let I;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(I={shouldRetryOnError:!1},t[18]=I):I=t[18];let{data:L,error:R,mutate:ne}=W(P,F,I),re=A?.conversationShared||ee?.automation.conversationMode===`continuous`||L?.customData?.latestAutomationRunId!==void 0&&L.customData.latestAutomationRunId!==n,ie=!!(L&&(!re||u)),ae=!O&&!!(A&&(!j||re&&!u&&L&&!R&&(A?.summary||A?.error)||L&&!R&&p)),oe,se;if(t[19]!==ae||t[20]!==k||t[21]!==S||t[22]!==A?(oe=()=>{!A||!ae||at(A)||A.readAtMs!=null||C.current||(C.current=!0,Z.markRunRead(A.id).then(async()=>{await Promise.all([k(),S(mt)])}).catch(pt).finally(()=>{C.current=!1}))},se=[A,ae,k,S],t[19]=ae,t[20]=k,t[21]=S,t[22]=A,t[23]=oe,t[24]=se):(oe=t[23],se=t[24]),(0,Q.useEffect)(oe,se),O){let e=O instanceof Error?O.message:l?`执行记录加载失败`:`Could not load execution`,n;t[25]===e?n=t[26]:(n=(0,$.jsx)(`p`,{children:e}),t[25]=e,t[26]=n);let r;t[27]===k?r=t[28]:(r=()=>void k(),t[27]=k,t[28]=r);let i=l?`重试`:`Retry`,a;t[29]!==r||t[30]!==i?(a=(0,$.jsx)(pe,{onClick:r,children:i}),t[29]=r,t[30]=i,t[31]=a):a=t[31];let o=l?`返回自动化`:`Back to automation`,s;t[32]!==c||t[33]!==o?(s=(0,$.jsx)(pe,{onClick:c,children:o}),t[32]=c,t[33]=o,t[34]=s):s=t[34];let u;return t[35]!==n||t[36]!==a||t[37]!==s?(u=(0,$.jsxs)(`section`,{role:`alert`,className:`space-y-3 p-5`,children:[n,a,s]}),t[35]=n,t[36]=a,t[37]=s,t[38]=u):u=t[38],u}if(!A){let e;return t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-4 p-5`,"aria-busy":`true`,children:[(0,$.jsx)(B,{className:`h-6 w-2/3`}),(0,$.jsx)(B,{className:`h-20`})]}),t[39]=e):e=t[39],e}let ce;t[40]===A?ce=t[41]:(ce=at(A),t[40]=A,t[41]=ce);let le=ce,z=l?`执行会话`:`Execution conversation`,V=l?`返回自动化`:`Back to automation`,de;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(b,{className:`size-4`}),t[42]=de):de=t[42];let G;t[43]!==c||t[44]!==V?(G=(0,$.jsx)(pe,{variant:`ghost`,className:`shrink-0`,onClick:c,"aria-label":V,children:de}),t[43]=c,t[44]=V,t[45]=G):G=t[45];let fe;t[46]===A.automationName?fe=t[47]:(fe=(0,$.jsx)(`h2`,{className:`truncate text-sm font-medium text-fg`,children:A.automationName}),t[46]=A.automationName,t[47]=fe);let me;t[48]!==G||t[49]!==fe?(me=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[G,fe]}),t[48]=G,t[49]=fe,t[50]=me):me=t[50];let K;t[51]!==A.createdAtMs||t[52]!==l?(K=new Date(A.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[51]=A.createdAtMs,t[52]=l,t[53]=K):K=t[53];let he;t[54]===a?he=t[55]:(he=f(a),t[54]=a,t[55]=he);let ge=he.automations.status[A.status],q;t[56]!==K||t[57]!==ge?(q=(0,$.jsxs)(`span`,{children:[K,` · `,ge]}),t[56]=K,t[57]=ge,t[58]=q):q=t[58];let _e;t[59]!==s||t[60]!==A.id?(_e=()=>s(A.id),t[59]=s,t[60]=A.id,t[61]=_e):_e=t[61];let ve=l?`运行详情`:`Run details`,ye;t[62]!==_e||t[63]!==ve?(ye=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:_e,children:ve}),t[62]=_e,t[63]=ve,t[64]=ye):ye=t[64];let be;t[65]!==o||t[66]!==A?(be=()=>o(A),t[65]=o,t[66]=A,t[67]=be):be=t[67];let xe=l?`调整自动化`:`Adjust automation`,Se;t[68]!==be||t[69]!==xe?(Se=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:be,children:xe}),t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==q||t[72]!==ye||t[73]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[q,ye,Se]}),t[71]=q,t[72]=ye,t[73]=Se,t[74]=Ce):Ce=t[74];let we;t[75]!==ee?.automation||t[76]!==re||t[77]!==l?(we=re?(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[l?`多次执行可能共用此会话;下方摘要对应所选执行。`:`Executions may share this conversation. The summary belongs to the selected execution.`,ee?.automation.conversationMode===`continuous`?l?`追问会进入后续运行上下文。`:` Follow-ups become context for future runs.`:null]}):null,t[75]=ee?.automation,t[76]=re,t[77]=l,t[78]=we):we=t[78];let J;t[79]!==h||t[80]!==u||t[81]!==l?(J=u?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:h===!0?l?`已定位到所选执行的会话起点。`:`Located the selected execution in this conversation.`:h===!1?l?`旧记录缺少可用的执行定位信息,当前显示完整会话。`:`No matching turn was found in the available history. Showing the full conversation.`:l?`正在定位所选执行…`:`Locating the selected execution…`}):null,t[79]=h,t[80]=u,t[81]=l,t[82]=J):J=t[82];let Te;t[83]!==le||t[84]!==l?(Te=le?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`执行中,完成后可继续追问。`:`Execution in progress. Follow up after it finishes.`}):null,t[83]=le,t[84]=l,t[85]=Te):Te=t[85];let Ee;t[86]!==me||t[87]!==Ce||t[88]!==we||t[89]!==J||t[90]!==Te?(Ee=(0,$.jsxs)(`header`,{className:`shrink-0 space-y-2 border-b border-edge px-4 py-3`,children:[me,Ce,we,J,Te]}),t[86]=me,t[87]=Ce,t[88]=we,t[89]=J,t[90]=Te,t[91]=Ee):Ee=t[91];let Y;t[92]!==le||t[93]!==j||t[94]!==N||t[95]!==L||t[96]!==a||t[97]!==ne||t[98]!==A.error||t[99]!==A.id||t[100]!==A.summary||t[101]!==R||t[102]!==re||t[103]!==ie||t[104]!==l?(Y=ie?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(B,{className:`m-5 h-40`}),children:(0,$.jsx)(dt,{embedded:!0,automationExecution:!0,conversationId:j,readOnly:le||N,onHistoryReady:x,initialTurnId:re?A.id:void 0,onInitialTurnLocated:v},j)}):(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[A.summary?(0,$.jsx)(te,{content:A.summary}):null,A.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-danger`,children:A.error}):null,j?null:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:le?l?`等待执行会话,开始后会自动更新。`:`Waiting for the execution conversation. This view updates automatically.`:l?`本次执行没有关联会话,可查看运行结果和详情。`:`No conversation is associated with this execution. Results and diagnostics remain available.`}),j&&!L&&!R?(0,$.jsx)(B,{className:`h-24`}):null,R?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:R.status===404?l?`执行会话已删除,运行结果仍保留。`:`The execution conversation was deleted. Results are still available.`:l?`执行会话暂时无法读取,运行结果仍保留。`:`The conversation is unavailable. Results are still available.`}),(0,$.jsx)(pe,{onClick:()=>void ne(),children:l?`重试`:`Retry`})]}):null,re&&L?(0,$.jsx)(pe,{variant:`secondary`,onClick:()=>d(!0),children:l?`打开共享会话`:`Open shared conversation`}):null,le?null:(0,$.jsx)(Xe,{runId:A.id,language:a})]}),t[92]=le,t[93]=j,t[94]=N,t[95]=L,t[96]=a,t[97]=ne,t[98]=A.error,t[99]=A.id,t[100]=A.summary,t[101]=R,t[102]=re,t[103]=ie,t[104]=l,t[105]=Y):Y=t[105];let De;return t[106]!==z||t[107]!==Ee||t[108]!==Y?(De=(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":z,children:[Ee,Y]}),t[106]=z,t[107]=Ee,t[108]=Y,t[109]=De):De=t[109],De}function pt(){}function mt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-navigation-runs`].includes(String(e[0]))||e===`automations-global-system-source`}function ht(e){return e&&at(e.run)?3e3:15e3}function gt(e){let t=(0,it.c)(44),{automation:n,language:r,busy:i,onEdit:a,onAction:o}=e,s=r===`zh`,c=n.management,l=s?`${n.name}的更多操作`:`More actions for ${n.name}`,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(k,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(xe,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,className:`size-8 p-0`,"aria-label":l,children:u})}),t[1]=l,t[2]=d);let f;t[3]!==n||t[4]!==i||t[5]!==c||t[6]!==o||t[7]!==s?(f=(!c||c.editable.includes(`enabled`))&&!De(n)?(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:toggle`,()=>n.enabled?Z.pause(n.id):Z.resume(n.id)),children:[n.enabled?(0,$.jsx)(F,{className:`size-4`}):(0,$.jsx)(L,{className:`size-4`}),n.enabled?s?`暂停`:`Pause`:s?`恢复`:`Resume`]}):null,t[3]=n,t[4]=i,t[5]=c,t[6]=o,t[7]=s,t[8]=f):f=t[8];let p;t[9]!==n.id||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==s?(p=!c||c.runnable?(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:run`,()=>Z.runNow(n.id)),children:[(0,$.jsx)(L,{className:`size-4`}),s?`立即运行`:`Run now`]}):null,t[9]=n.id,t[10]=i,t[11]=c,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==i||t[17]!==c||t[18]!==a||t[19]!==s?(m=!c||c.editable.includes(`trigger`)?(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>a(n),children:[(0,$.jsx)(I,{className:`size-4`}),s?`编辑`:`Edit`]}):null,t[15]=n,t[16]=i,t[17]=c,t[18]=a,t[19]=s,t[20]=m):m=t[20];let h;t[21]!==n.id||t[22]!==o||t[23]!==s?(h=()=>void o(`automation:${n.id}:copy-link`,()=>navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}#/automations?automation=${encodeURIComponent(n.id)}`),s?`任务链接已复制`:`Task link copied`),t[21]=n.id,t[22]=o,t[23]=s,t[24]=h):h=t[24];let g;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(O,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:h,children:[g,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.id||t[30]!==i||t[31]!==c||t[32]!==o||t[33]!==s?(y=!c||c.deletable?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(we,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50 text-danger`,disabled:i,onSelect:()=>{window.confirm(s?`删除这个定时任务?已保存的对话仍可查看。`:`Delete this scheduled task? Saved conversations will remain available.`)&&o(`automation:${n.id}:delete`,()=>Z.remove(n.id))},children:[(0,$.jsx)(se,{className:`size-4`}),s?`删除`:`Delete`]})]}):null,t[29]=n.id,t[30]=i,t[31]=c,t[32]=o,t[33]=s,t[34]=y):y=t[34];let b;t[35]!==v||t[36]!==y||t[37]!==f||t[38]!==p||t[39]!==m?(b=(0,$.jsx)(Se,{children:(0,$.jsxs)(Te,{align:`end`,sideOffset:4,className:`z-70 min-w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[f,p,m,v,y]})}),t[35]=v,t[36]=y,t[37]=f,t[38]=p,t[39]=m,t[40]=b):b=t[40];let x;return t[41]!==b||t[42]!==d?(x=(0,$.jsxs)(be,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=x):x=t[43],x}function _t({automations:e,runs:t,labels:n,cronLabels:r,language:i,selectedAutomationId:a,selectedRunId:o,selectedRun:s,projectId:c,executionSummaries:l,onSelectRun:d,onOpenDetails:f,busy:p,onEdit:m,onAction:h}){let g=`xopc.automation-navigation:${u(e=>e.baseUrl)}:${u(e=>e.conversationId)??`local`}`,[_,v]=(0,Q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}});(0,Q.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);v(e&&typeof e==`object`&&!Array.isArray(e)?e:{})}catch{v({})}},[g]);let y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{!a||y.current===a||(y.current=a,v(e=>({...e,[a]:!0})))},[a]);let b=e=>v(t=>{let n={...t,[e]:!t[e]};try{localStorage.setItem(g,JSON.stringify(n))}catch{}return n});return e.length===0?(0,$.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:n.empty.filtered}):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:e.map(e=>{let u=t.filter(t=>t.automationId===e.id).sort((e,t)=>t.createdAtMs-e.createdAtMs),g=u.find(at);return(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-expanded":!!_[e.id],"aria-controls":`automation-runs-${e.id}`,"aria-label":i===`zh`?`${_[e.id]?`收起`:`展开`} ${e.name} 的执行记录`:`${_[e.id]?`Collapse`:`Expand`} executions for ${e.name}`,className:`absolute left-1 top-2 z-10 rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>b(e.id),children:_[e.id]?(0,$.jsx)(C,{className:`size-4`}):(0,$.jsx)(w,{className:`size-4`})}),(0,$.jsxs)(`button`,{type:`button`,className:z(`block w-full p-3 pl-9 pr-10 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a===e.id&&!o&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 76px`},"aria-current":a===e.id&&!o?`true`:void 0,onClick:()=>f(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:z(`size-2 shrink-0 rounded-full`,g?`bg-blue-500`:Ze(e,u)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:De(e)?i===`zh`?`已完成`:`Completed`:e.enabled?n.enabled:n.paused}),(l?.[e.id]?.unreadCount??0)>0?(0,$.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:n.filters.unread})}):null]}),(0,$.jsxs)(`p`,{className:`mt-1 truncate pl-4 text-xs leading-5 text-fg-muted`,children:[e.enabled?(0,$.jsxs)($.Fragment,{children:[Fe(e,n,i),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,ke(e.trigger,n,r,i)]}),Ze(e,u)?(0,$.jsx)(`p`,{className:`mt-1 pl-4 text-xs text-red-700 dark:text-red-300`,children:n.dashboard.needsAttention}):null]}),(0,$.jsx)(`div`,{id:`automation-runs-${e.id}`,hidden:!_[e.id],children:(0,$.jsx)(ot,{automationId:e.id,projectId:c,language:i,selectedRunId:o,selectedRun:s,enabled:!!_[e.id],onSelectRun:d})}),(0,$.jsx)(`div`,{className:`absolute right-1 top-2 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,$.jsx)(gt,{automation:e,language:i,busy:p,onEdit:m,onAction:h})})]},e.id)})})}var vt=`xopc.automations.listWidth`,yt=272,bt=200,xt=560;function St({children:e,language:t,busy:n}){let r=(0,Q.useRef)(null),i=(0,Q.useRef)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(()=>{try{let e=Number(window.localStorage.getItem(vt));if(Number.isFinite(e)&&e>=bt&&e<=xt)return e}catch{}return yt});(0,Q.useEffect)(()=>{try{window.localStorage.setItem(vt,String(s))}catch{}},[s]),(0,Q.useEffect)(()=>{if(!a)return;let{cursor:e,userSelect:t}=document.body.style;return document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,()=>{document.body.style.cursor=e,document.body.style.userSelect=t}},[a]);let l=e=>{let t=r.current?.getBoundingClientRect().width??1e3,n=Math.max(bt,Math.min(xt,t*.6,t-292));return Math.round(Math.max(bt,Math.min(n,e)))},u=t===`zh`?`调整任务列表宽度`:`Resize task list`;return(0,$.jsxs)(`section`,{ref:r,"aria-busy":n,className:`grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-y-3 md:grid-cols-[minmax(0,min(var(--automation-list-width),60%))_0.75rem_minmax(0,1fr)] md:grid-rows-1 md:gap-y-0`,style:{"--automation-list-width":`${s}px`},children:[e[0],(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":u,"aria-valuemin":bt,"aria-valuemax":xt,"aria-valuenow":s,tabIndex:0,title:t===`zh`?`左右拖动调整宽度,双击恢复默认`:`Drag to resize, double-click to reset`,className:`relative hidden touch-none select-none cursor-col-resize focus-visible:outline-accent md:block`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e.currentTarget.previousElementSibling?.getBoundingClientRect().width??s;i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t},o(!0)},onPointerMove:e=>{let t=i.current;t?.pointerId===e.pointerId&&c(l(t.startWidth+e.clientX-t.startX))},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&(i.current=null,o(!1),e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{i.current=null,o(!1)},onLostPointerCapture:()=>{i.current=null,o(!1)},onDoubleClick:()=>c(yt),onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),c(l(e.key===`Home`?bt:e.key===`End`?xt:s+(e.key===`ArrowLeft`?-16:16))))}}),e[1]]})}var Ct=(0,Q.lazy)(()=>i(()=>import(`./chat-page-CwP4OMdW.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191])));function wt(e){let t=(0,it.c)(51),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]!==c||t[1]!==r?(l=c&&!r?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=r,t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=()=>Z.openConfiguration({automationId:c}),t[3]=c,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[5]=d):d=t[5];let{data:p,error:m,mutate:h}=W(l,u,d),g;t[6]===r?g=t[7]:(g=r?[`automation-configuration`,r]:null,t[6]=r,t[7]=g);let _;t[8]===r?_=t[9]:(_=()=>Z.configuration(r),t[8]=r,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[10]=v):v=t[10];let{data:y}=W(g,_,v),b,x;t[11]!==n||t[12]!==s||t[13]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[11]=n,t[12]=s,t[13]=y,t[14]=b,t[15]=x):(b=t[14],x=t[15]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ue(),w;t[16]===S?w=t[17]:(w=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[16]=S,t[17]=w);let T=U(w),E=(0,Q.useRef)(!1),D,ee;t[18]!==C||t[19]!==T?(D=()=>{E.current&&!T&&C(Tt),E.current=T},ee=[T,C],t[18]=C,t[19]=T,t[20]=D,t[21]=ee):(D=t[20],ee=t[21]),(0,Q.useEffect)(D,ee);let O=a===`zh`,k;t[22]===a?k=t[23]:(k=f(a),t[22]=a,t[23]=k);let A=k,j;if(t[24]!==a||t[25]!==A.automations.status||t[26]!==o||t[27]!==i||t[28]!==O){let e;t[30]!==a||t[31]!==A.automations.status||t[32]!==o||t[33]!==O?(e=e=>({id:`automation-run:${e.id}`,timestamp:e.createdAtMs,content:(0,$.jsxs)(`article`,{className:`mx-auto w-full max-w-[var(--max-width-chat-frame)] space-y-3 py-3`,"aria-label":O?`任务运行结果`:`Task run result`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,$.jsxs)(`span`,{children:[new Date(e.createdAtMs).toLocaleString(O?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,A.automations.status[e.status]]}),(0,$.jsx)(`button`,{type:`button`,className:`rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>o(e.id),children:O?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:Qe(e,a)}):e.summary?(0,$.jsx)(te,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:O?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(ze,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)(Xe,{runId:e.id,language:a})]})}),t[30]=a,t[31]=A.automations.status,t[32]=o,t[33]=O,t[34]=e):e=t[34],j=i.map(e),t[24]=a,t[25]=A.automations.status,t[26]=o,t[27]=i,t[28]=O,t[29]=j}else j=t[29];let M=j;if(m){let e=O?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[35]===e?n=t[36]:(n=(0,$.jsx)(`p`,{children:e}),t[35]=e,t[36]=n);let r;t[37]===h?r=t[38]:(r=()=>void h(),t[37]=h,t[38]=r);let i=O?`重试`:`Retry`,a;t[39]!==r||t[40]!==i?(a=(0,$.jsx)(pe,{variant:`secondary`,onClick:r,children:i}),t[39]=r,t[40]=i,t[41]=a):a=t[41];let o;return t[42]!==n||t[43]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[42]=n,t[43]=a,t[44]=o):o=t[44],o}let N=O?`任务对话`:`Task conversation`,P;t[45]!==M||t[46]!==S?(P=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(B,{className:`m-5 h-40`}),children:(0,$.jsx)(Ct,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:M},S)}):(0,$.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,$.jsx)(B,{className:`h-20 w-2/3`}),(0,$.jsx)(B,{className:`h-28`})]}),t[45]=M,t[46]=S,t[47]=P):P=t[47];let F;return t[48]!==N||t[49]!==P?(F=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":N,children:P}),t[48]=N,t[49]=P,t[50]=F):F=t[50],F}function Tt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}var Et=`relative flex min-h-9 cursor-pointer items-center rounded-md py-2 pl-3 pr-8 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,Dt=`z-70 max-h-[min(32rem,calc(100dvh-2rem))] min-w-52 overflow-y-auto rounded-xl border border-edge bg-surface-overlay p-1.5 shadow-popover`;function Ot(e){let t=(0,it.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ye,{className:`absolute right-2.5`,children:(0,$.jsx)(S,{className:`size-3.5`,"aria-hidden":!0})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,$.jsxs)(q,{value:n,className:Et,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function kt(e){let t=(0,it.c)(134),{language:n,labels:r,filter:i,ownership:a,source:o,projectId:s,projects:c,projectLocked:l,query:u,unreadCount:d,markReadBusy:f,onFilter:p,onOwnership:m,onSource:h,onProject:g,onQuery:_,onClear:v,onMarkAllRead:y}=e,b=n===`zh`,[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=x||!!u,D=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,ee;t[0]===_?ee=t[1]:(ee=()=>{_(``),S(!1),T.current?.focus()},t[0]=_,t[1]=ee);let O=ee,k=b?`定时任务`:`Scheduled tasks`,A;t[2]===k?A=t[3]:(A=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:k}),t[2]=k,t[3]=A);let j=b?`筛选任务`:`Filter tasks`,N=b?`筛选任务`:`Filter tasks`,te=D&&`text-accent-fg`,P;t[4]===te?P=t[5]:(P=z(`relative rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-surface-hover`,te),t[4]=te,t[5]=P);let F;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(M,{className:`size-4`,"aria-hidden":!0}),t[6]=F):F=t[6];let I;t[7]!==D||t[8]!==b?(I=D?(0,$.jsx)(`span`,{className:`absolute right-1.5 top-1.5 size-1 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:b?`已应用筛选`:`Filters applied`})}):null,t[7]=D,t[8]=b,t[9]=I):I=t[9];let L;t[10]!==j||t[11]!==N||t[12]!==P||t[13]!==I?(L=(0,$.jsx)(xe,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":j,title:N,className:P,children:[F,I]})}),t[10]=j,t[11]=N,t[12]=P,t[13]=I,t[14]=L):L=t[14];let R=b?`状态`:`Status`,ne;t[15]===R?ne=t[16]:(ne=(0,$.jsx)(ge,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:R}),t[15]=R,t[16]=ne);let ie;t[17]===p?ie=t[18]:(ie=e=>p(e),t[17]=p,t[18]=ie);let ae=b?`全部状态`:`All statuses`,oe;t[19]===ae?oe=t[20]:(oe=(0,$.jsx)(Ot,{value:`all`,children:ae}),t[19]=ae,t[20]=oe);let se;t[21]===r.filters.active?se=t[22]:(se=(0,$.jsx)(Ot,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=se);let le;t[23]===r.paused?le=t[24]:(le=(0,$.jsx)(Ot,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=le);let B=b?`已完成`:`Completed`,V;t[25]===B?V=t[26]:(V=(0,$.jsx)(Ot,{value:`completed`,children:B}),t[25]=B,t[26]=V);let H;t[27]===r.metrics.running?H=t[28]:(H=(0,$.jsx)(Ot,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=H);let U;t[29]===r.dashboard.needsAttention?U=t[30]:(U=(0,$.jsx)(Ot,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=U);let ue;t[31]!==i||t[32]!==ie||t[33]!==oe||t[34]!==se||t[35]!==le||t[36]!==V||t[37]!==H||t[38]!==U?(ue=(0,$.jsxs)(J,{value:i,onValueChange:ie,children:[oe,se,le,V,H,U]}),t[31]=i,t[32]=ie,t[33]=oe,t[34]=se,t[35]=le,t[36]=V,t[37]=H,t[38]=U,t[39]=ue):ue=t[39];let W;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),t[40]=W):W=t[40];let de=b?`归属`:`Owner`,G;t[41]===de?G=t[42]:(G=(0,$.jsx)(ge,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:de}),t[41]=de,t[42]=G);let fe;t[43]===m?fe=t[44]:(fe=e=>m(e),t[43]=m,t[44]=fe);let pe=b?`我的任务`:`My tasks`,me;t[45]===pe?me=t[46]:(me=(0,$.jsx)(Ot,{value:`user`,children:pe}),t[45]=pe,t[46]=me);let K=b?`系统任务`:`System tasks`,he;t[47]===K?he=t[48]:(he=(0,$.jsx)(Ot,{value:`system`,children:K}),t[47]=K,t[48]=he);let q;t[49]!==a||t[50]!==fe||t[51]!==me||t[52]!==he?(q=(0,$.jsxs)(J,{value:a,onValueChange:fe,children:[me,he]}),t[49]=a,t[50]=fe,t[51]=me,t[52]=he,t[53]=q):q=t[53];let ye;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),t[54]=ye):ye=t[54];let Y;t[55]!==r.filters.allProjects||t[56]!==g||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==b?(Y=l?null:(0,$.jsxs)(_e,{children:[(0,$.jsxs)(Ce,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[b?`项目`:`Project`,(0,$.jsx)(`span`,{className:`ml-auto max-w-28 truncate text-xs text-fg-muted`,children:c.find(e=>e.id===s)?.name??r.filters.allProjects}),(0,$.jsx)(w,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(Se,{children:(0,$.jsx)(ve,{sideOffset:4,className:Dt,children:(0,$.jsxs)(J,{value:s,onValueChange:g,children:[(0,$.jsx)(Ot,{value:``,children:r.filters.allProjects}),c.map(At)]})})})]}),t[55]=r.filters.allProjects,t[56]=g,t[57]=s,t[58]=l,t[59]=c,t[60]=b,t[61]=Y):Y=t[61];let De=b?`任务类型`:`Task type`,Oe;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(w,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0}),t[62]=Oe):Oe=t[62];let X;t[63]===De?X=t[64]:(X=(0,$.jsxs)(Ce,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[De,Oe]}),t[63]=De,t[64]=X);let ke;t[65]===h?ke=t[66]:(ke=e=>h(e),t[65]=h,t[66]=ke);let Ae=b?`全部类型`:`All types`,je;t[67]===Ae?je=t[68]:(je=(0,$.jsx)(Ot,{value:`all`,children:Ae}),t[67]=Ae,t[68]=je);let Me;t[69]===r.sources.agent?Me=t[70]:(Me=(0,$.jsx)(Ot,{value:`agent`,children:r.sources.agent}),t[69]=r.sources.agent,t[70]=Me);let Ne;t[71]===r.sources.task?Ne=t[72]:(Ne=(0,$.jsx)(Ot,{value:`task_command`,children:r.sources.task}),t[71]=r.sources.task,t[72]=Ne);let Pe;t[73]===r.sources.browser?Pe=t[74]:(Pe=(0,$.jsx)(Ot,{value:`browser_automation`,children:r.sources.browser}),t[73]=r.sources.browser,t[74]=Pe);let Fe;t[75]!==o||t[76]!==ke||t[77]!==je||t[78]!==Me||t[79]!==Ne||t[80]!==Pe?(Fe=(0,$.jsx)(Se,{children:(0,$.jsx)(ve,{sideOffset:4,className:Dt,children:(0,$.jsxs)(J,{value:o,onValueChange:ke,children:[je,Me,Ne,Pe]})})}),t[75]=o,t[76]=ke,t[77]=je,t[78]=Me,t[79]=Ne,t[80]=Pe,t[81]=Fe):Fe=t[81];let Ie;t[82]!==X||t[83]!==Fe?(Ie=(0,$.jsxs)(_e,{children:[X,Fe]}),t[82]=X,t[83]=Fe,t[84]=Ie):Ie=t[84];let Le;t[85]!==D||t[86]!==v||t[87]!==u||t[88]!==b?(Le=D||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),(0,$.jsx)(we,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:v,children:b?`重置筛选`:`Reset filters`})]}):null,t[85]=D,t[86]=v,t[87]=u,t[88]=b,t[89]=Le):Le=t[89];let Re;t[90]!==r.filters.markAllRead||t[91]!==f||t[92]!==y||t[93]!==d?(Re=d>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{className:`my-1 border-t border-edge`}),(0,$.jsx)(we,{disabled:f,className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:y,children:r.filters.markAllRead})]}):null,t[90]=r.filters.markAllRead,t[91]=f,t[92]=y,t[93]=d,t[94]=Re):Re=t[94];let ze;t[95]!==ne||t[96]!==ue||t[97]!==G||t[98]!==q||t[99]!==Y||t[100]!==Ie||t[101]!==Le||t[102]!==Re?(ze=(0,$.jsx)(Se,{children:(0,$.jsxs)(Te,{align:`end`,sideOffset:6,className:Dt,children:[ne,ue,W,G,q,ye,Y,Ie,Le,Re]})}),t[95]=ne,t[96]=ue,t[97]=G,t[98]=q,t[99]=Y,t[100]=Ie,t[101]=Le,t[102]=Re,t[103]=ze):ze=t[103];let Be;t[104]!==L||t[105]!==ze?(Be=(0,$.jsxs)(be,{children:[L,ze]}),t[104]=L,t[105]=ze,t[106]=Be):Be=t[106];let Ve=b?`搜索任务`:`Search tasks`,He=b?`搜索任务`:`Search tasks`,Ue;t[107]!==O||t[108]!==E?(Ue=()=>{E?O():(S(!0),requestAnimationFrame(()=>C.current?.focus()))},t[107]=O,t[108]=E,t[109]=Ue):Ue=t[109];let We=E&&`bg-surface-hover text-fg`,Ge;t[110]===We?Ge=t[111]:(Ge=z(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,We),t[110]=We,t[111]=Ge);let Ke;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,$.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t[112]=Ke):Ke=t[112];let qe;t[113]!==E||t[114]!==Ve||t[115]!==He||t[116]!==Ue||t[117]!==Ge?(qe=(0,$.jsx)(`button`,{ref:T,type:`button`,"aria-label":Ve,title:He,"aria-expanded":E,onClick:Ue,className:Ge,children:Ke}),t[113]=E,t[114]=Ve,t[115]=He,t[116]=Ue,t[117]=Ge,t[118]=qe):qe=t[118];let Je;t[119]!==Be||t[120]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[Be,qe]}),t[119]=Be,t[120]=qe,t[121]=Je):Je=t[121];let Z;t[122]!==A||t[123]!==Je?(Z=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[A,Je]}),t[122]=A,t[123]=Je,t[124]=Z):Z=t[124];let Ye;t[125]!==O||t[126]!==_||t[127]!==u||t[128]!==E||t[129]!==b?(Ye=E?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2.5 focus-within:border-accent`,children:[(0,$.jsx)(re,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:C,value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),O())},"aria-label":b?`搜索任务名称或内容`:`Search task names or content`,placeholder:b?`搜索任务…`:`Search tasks…`,className:`min-h-10 min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-subtle`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":b?`关闭搜索`:`Close search`,onClick:O,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[125]=O,t[126]=_,t[127]=u,t[128]=E,t[129]=b,t[130]=Ye):Ye=t[130];let Xe;return t[131]!==Z||t[132]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Z,Ye]}),t[131]=Z,t[132]=Ye,t[133]=Xe):Xe=t[133],Xe}function At(e){return(0,$.jsx)(Ot,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var jt=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`Morning briefing`,`Start each day with your tasks and project updates.`,`每天早上帮我整理当天到期、逾期的任务和项目进展,给出今天的重点。`,`Each morning, summarize my due and overdue tasks and project progress, and suggest priorities.`],[`📝`,`每周工作回顾`,`回顾一周的成果和问题,为下周留出清晰的方向。`,`Weekly review`,`Review the week and find a clear direction for the next.`,`每周五帮我回顾本周完成的任务和项目进展,整理未解决的问题,建议下周的重点。`,`Every Friday, review completed tasks and project progress, unresolved issues, and priorities for next week.`],[`🌱`,`项目进展跟进`,`定期看看项目进度,找出需要你关注的事情。`,`Project check-in`,`Keep an eye on project progress and what needs attention.`,`定期帮我检查项目进度,整理延期、阻塞和需要我决策的事项。先和我确认关注哪个项目以及运行时间。`,`Regularly review a project for delays, blockers, and decisions I need to make. Ask which project and when to run.`],[`🔔`,`重要事项提醒`,`把容易忘记的事情交给提醒,安心专注眼前。`,`A timely reminder`,`Make room to focus by setting a reminder for later.`,`我想安排一个重要事项提醒。请先问我需要提醒什么、什么时候提醒,以及是否重复。`,`Help me schedule a reminder. Ask what to remember, when, and whether it should repeat.`],[`📚`,`笔记整理`,`回看新收集的想法,整理出值得继续推进的线索。`,`Notes roundup`,`Revisit recent ideas and surface useful next steps.`,`每周帮我回顾最近新增的笔记,按主题整理,找出值得继续推进的想法。请先确认时间和范围。`,`Each week, group my recent notes by topic and suggest ideas worth pursuing. Confirm the schedule and scope.`],[`🧭`,`明日工作计划`,`下班前梳理未完成的事,安排明天最重要的三件事。`,`Plan tomorrow`,`Wrap up loose ends and choose tomorrow’s top three priorities.`,`每个工作日下班前,帮我梳理未完成的任务,建议明天最重要的三件事。请先确认具体时间。`,`Before the end of each workday, review unfinished tasks and suggest tomorrow’s top three priorities. Confirm the time.`],[`🗓️`,`月度复盘`,`拉远一点看进展,发现反复出现的问题和新的机会。`,`Monthly reflection`,`Step back to spot progress, recurring problems, and opportunities.`,`每月月底帮我回顾项目和任务的进展,总结成果、反复出现的问题和下个月的重点。请确认运行时间。`,`At the end of each month, review project and task progress, achievements, recurring problems, and priorities. Confirm the schedule.`],[`🎯`,`逾期任务检查`,`定期发现被搁置的事项,让重要的事重新向前。`,`Overdue task check`,`Find neglected tasks and get important work moving again.`,`定期帮我检查逾期任务,按紧迫程度整理,并建议下一步。请先确认运行频率和时间。`,`Regularly review overdue tasks, prioritize them by urgency, and suggest next steps. Confirm the frequency and time.`]];function Mt(e=Math.random){let t=[...jt];for(let n=t.length-1;n>0;n--){let r=Math.min(n,Math.max(0,Math.floor(e()*(n+1))));[t[n],t[r]]=[t[r],t[n]]}return t.slice(0,6)}function Nt({language:e,projectId:t,onOpenConversation:n}){let r=s(),[i,a]=(0,Q.useState)(!1),[o,c]=(0,Q.useState)(``),l=async e=>{a(!0),c(``);try{let i=await Ve({projectId:t,prompt:e});n?n(i):r(i)}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}},u=e===`zh`,[d,f]=(0,Q.useState)(Mt),p=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-2 py-10 sm:px-6 md:py-20`,children:[(0,$.jsxs)(`div`,{className:`text-center`,children:[(0,$.jsx)(x,{className:`mx-auto size-10 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:u?`安排任务`:`Schedule a task`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:u?`说说你希望定期完成什么,我们一起安排好。`:`Tell us what you’d like done regularly. We’ll work out the details together.`})]}),(0,$.jsxs)(`div`,{className:`mb-3 mt-10 flex items-center justify-between text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:u?`也可以从这些想法开始`:`Or start with an idea`}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>f(Mt()),className:`flex items-center gap-1.5 rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),u?`换一组`:`More ideas`]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:d.map(e=>(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>void l(u?e[5]:e[6]),className:`flex min-h-28 items-center gap-4 rounded-xl border border-dashed border-edge bg-surface-panel px-5 py-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-2xl`,"aria-hidden":!0,children:e[0]}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:u?e[1]:e[3]}),(0,$.jsx)(`span`,{className:`mt-1 block text-sm leading-5 text-fg-muted`,children:u?e[2]:e[4]})]})]},e[1]))}),(0,$.jsx)(`div`,{className:`mt-6 text-center`,children:(0,$.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void l(),className:`rounded-md px-3 py-2 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:u?`说说你想安排的其他任务`:`Describe another task`})}),o?(0,$.jsx)(`p`,{role:`alert`,className:`mt-3 text-center text-sm text-danger`,children:o}):null]});return(0,$.jsx)(`section`,{"aria-label":u?`安排任务`:`Schedule a task`,children:p})}function Pt(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function Ft(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function It(e,t={}){let n=Pt(e.split(`
|
|
3
3
|
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
|
|
4
4
|
`));if(!n)return null;if(n.type===`text_delta`&&typeof n.delta==`string`)return t.onDelta?.(n.delta),null;if(n.type===`thinking_delta`&&typeof n.delta==`string`)return t.onThinkingDelta?.(n.delta),null;if(n.type===`done`&&typeof n.text==`string`)return n.text;if(n.type===`error`)throw Error(Ft(n));return null}async function Lt(e,t={}){let n=await c(l(`/api/ai/text-assist`),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(e)});if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message;throw Error(t||`AI suggestion failed (${n.status})`)}if(!n.body){let e=await n.json().catch(()=>null);if(e?.text)return e;throw Error(`AI suggestion stream is empty`)}let r=n.body.getReader(),i=new TextDecoder,a=``,o=``,s=``;for(;;){let{done:e,value:n}=await r.read();if(n){a+=i.decode(n,{stream:!e});let r=a.split(/\r?\n\r?\n/);a=r.pop()??``;for(let e of r){let n=It(e,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});n!==null&&(o=n)}}if(e)break}if(a.trim()){let e=It(a,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});e!==null&&(o=e)}let u=o.trim();if(!u)throw Error(`AI returned an empty suggestion`);return{text:u,thinking:s.trim()||void 0}}function Rt(){let[e,t]=(0,Q.useState)(``),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null);return{suggestion:e,thinking:n,loading:i,error:o,generate:(0,Q.useCallback)(async e=>{a(!0),s(null),t(``),r(``);try{let n=await Lt(e,{onDelta:e=>{t(t=>t+e)},onThinkingDelta:e=>{r(t=>t+e)}});return t(n.text),r(n.thinking??``),n.text}catch(e){let t=e instanceof Error?e.message:`AI suggestion failed`;return s(t),null}finally{a(!1)}},[]),reset:(0,Q.useCallback)(()=>{t(``),r(``),s(null),a(!1)},[])}}var zt=5;function Bt(e){return e.startsWith(`zh`)?{title:`AI 优化文案`,buttonTitle:`优化文案`,current:`当前内容`,suggestion:`AI 建议`,editedSuggestion:`审核并编辑建议`,thinking:`模型思考`,thinkingLoading:`思考中`,edit:`编辑`,preview:`预览`,loading:`正在生成建议...`,empty:`暂无内容`,generate:`生成建议`,regenerate:`重新生成`,applyCurrent:`应用当前内容`,replace:`替换`,append:`追加`,cancel:`取消`,close:`关闭`}:{title:`AI text assist`,buttonTitle:`Improve text`,current:`Current`,suggestion:`Suggestion`,editedSuggestion:`Review and edit suggestion`,thinking:`Model thinking`,thinkingLoading:`Thinking`,edit:`Edit`,preview:`Preview`,loading:`Generating suggestion...`,empty:`No content`,generate:`Generate suggestion`,regenerate:`Regenerate`,applyCurrent:`Apply current`,replace:`Replace`,append:`Append`,cancel:`Cancel`,close:`Close`}}function Vt(e){let t=(0,it.c)(245),{value:n,onApply:r,fieldId:i,fieldLabel:a,scenario:o,format:s,intent:c,locale:l,context:u,disabled:d,className:f,showLabel:y}=e,b=o===void 0?`generic.text`:o,x=s===void 0?`plain`:s,S=c===void 0?`improve`:c,w=y===void 0||y,[T,E]=(0,Q.useState)(!1),[D,ee]=(0,Q.useState)(n),[O,k]=(0,Q.useState)(`preview`),[j,M]=(0,Q.useState)(``),[N,P]=(0,Q.useState)(`edit`),[F,I]=(0,Q.useState)(!0),[L,R]=(0,Q.useState)(!1),[re,ie]=(0,Q.useState)(null),se=(0,Q.useRef)(null),le=(0,Q.useRef)(!0),{suggestion:B,thinking:V,loading:H,error:U,generate:ue,reset:W}=Rt(),de;t[0]===l?de=t[1]:(de=Bt(l),t[0]=l,t[1]=de);let G=de,fe;t[2]!==H||t[3]!==V?(fe=H&&V.trim().length>0,t[2]=H,t[3]=V,t[4]=fe):fe=t[4];let me=fe,he,ge;t[5]!==T||t[6]!==n?(he=()=>{T||ee(n)},ge=[T,n],t[5]=T,t[6]=n,t[7]=he,t[8]=ge):(he=t[7],ge=t[8]),(0,Q.useEffect)(he,ge);let q,_e;t[9]===B?(q=t[10],_e=t[11]):(_e=()=>{M(B)},q=[B],t[9]=B,t[10]=q,t[11]=_e),(0,Q.useEffect)(_e,q);let ve,ye;t[12]===V?(ve=t[13],ye=t[14]):(ve=()=>{V.trim()&&I(!0)},ye=[V],t[12]=V,t[13]=ve,t[14]=ye),(0,Q.useEffect)(ve,ye);let be;t[15]!==me||t[16]!==F?(be=()=>{let e=se.current;!e||!me||!F||le.current&&(e.scrollTop=e.scrollHeight)},t[15]=me,t[16]=F,t[17]=be):be=t[17];let xe;t[18]!==me||t[19]!==V||t[20]!==F?(xe=[me,V,F],t[18]=me,t[19]=V,t[20]=F,t[21]=xe):xe=t[21],(0,Q.useLayoutEffect)(be,xe);let Se;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Se=()=>{let e=se.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;le.current=t<=zt},t[22]=Se):Se=t[22];let Ce=Se,we;t[23]!==u||t[24]!==i||t[25]!==a||t[26]!==x||t[27]!==ue||t[28]!==S||t[29]!==l||t[30]!==b?(we=async e=>{P(`edit`),I(!0),le.current=!0,await ue({intent:S,scenario:b,input:e,locale:l,field:{id:i,label:a,format:x},context:u})},t[23]=u,t[24]=i,t[25]=a,t[26]=x,t[27]=ue,t[28]=S,t[29]=l,t[30]=b,t[31]=we):we=t[31];let J=we,Te;t[32]!==W||t[33]!==n?(Te=e=>{R(!!e.currentTarget.closest(`[role="dialog"]`)),ie(document.querySelector(`.app-main-surface`)),ee(n),k(`preview`),M(``),P(`edit`),I(!0),W(),E(!0)},t[32]=W,t[33]=n,t[34]=Te):Te=t[34];let Ee=Te,Y;t[35]!==D||t[36]!==J?(Y=async()=>{await J(D)},t[35]=D,t[36]=J,t[37]=Y):Y=t[37];let De=Y,Oe;t[38]!==W||t[39]!==n?(Oe=()=>{E(!1),ee(n),k(`preview`),M(``),P(`edit`),I(!0),W()},t[38]=W,t[39]=n,t[40]=Oe):Oe=t[40];let X=Oe,ke;t[41]!==X||t[42]!==D||t[43]!==r?(ke=()=>{r(D),X()},t[41]=X,t[42]=D,t[43]=r,t[44]=ke):ke=t[44];let Ae=ke,je;t[45]!==X||t[46]!==j||t[47]!==r?(je=()=>{j.trim()&&(r(j),X())},t[45]=X,t[46]=j,t[47]=r,t[48]=je):je=t[48];let Me=je,Ne;t[49]!==X||t[50]!==D||t[51]!==j||t[52]!==r?(Ne=()=>{if(!j.trim())return;let e=D.trimEnd();r(e?`${e}\n\n${j}`:j),X()},t[49]=X,t[50]=D,t[51]=j,t[52]=r,t[53]=Ne):Ne=t[53];let Pe=Ne,Fe;t[54]!==j||t[55]!==U||t[56]!==H?(Fe=!H&&!U&&j.trim().length>0,t[54]=j,t[55]=U,t[56]=H,t[57]=Fe):Fe=t[57];let Ie=Fe,Le=D!==n,Re;t[58]!==j||t[59]!==U||t[60]!==V?(Re=j.trim().length>0||V.trim().length>0||!!U,t[58]=j,t[59]=U,t[60]=V,t[61]=Re):Re=t[61];let ze=Re,Be=!w&&`size-7 p-0`,Ve;t[62]!==f||t[63]!==Be?(Ve=z(`h-7 gap-1 px-2 text-xs`,Be,f),t[62]=f,t[63]=Be,t[64]=Ve):Ve=t[64];let He=d||H,Ue;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,$.jsx)(ae,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=Ue):Ue=t[65];let We=w?G.buttonTitle:null,Ge;t[66]!==G.buttonTitle||t[67]!==Ee||t[68]!==Ve||t[69]!==He||t[70]!==We?(Ge=(0,$.jsxs)(pe,{type:`button`,variant:`ghost`,className:Ve,title:G.buttonTitle,"aria-label":G.buttonTitle,disabled:He,onClick:Ee,children:[Ue,We]}),t[66]=G.buttonTitle,t[67]=Ee,t[68]=Ve,t[69]=He,t[70]=We,t[71]=Ge):Ge=t[71];let Ke;t[72]===X?Ke=t[73]:(Ke=e=>e?E(!0):X(),t[72]=X,t[73]=Ke);let qe=re??void 0,Je=L?`bg-transparent`:`bg-scrim`,Z;t[74]===Je?Z=t[75]:(Z=z(`xopc-dialog-overlay absolute inset-0 z-[80]`,Je),t[74]=Je,t[75]=Z);let Ye;t[76]===Z?Ye=t[77]:(Ye=(0,$.jsx)(p,{className:Z}),t[76]=Z,t[77]=Ye);let Xe;t[78]===G.title?Xe=t[79]:(Xe=(0,$.jsx)(_,{className:`text-base font-semibold text-fg`,children:G.title}),t[78]=G.title,t[79]=Xe);let Ze;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,$.jsx)(ce,{className:`size-5`,strokeWidth:1.75}),t[80]=Ze):Ze=t[80];let Qe;t[81]===G.close?Qe=t[82]:(Qe=(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":G.close,children:Ze})}),t[81]=G.close,t[82]=Qe);let $e;t[83]!==Xe||t[84]!==Qe?($e=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[Xe,Qe]}),t[83]=Xe,t[84]=Qe,t[85]=$e):$e=t[85];let et;t[86]===G.current?et=t[87]:(et=(0,$.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:G.current}),t[86]=G.current,t[87]=et);let tt=G.current,nt=O===`edit`,rt=O===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,at;t[88]===rt?at=t[89]:(at=z(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,rt),t[88]=rt,t[89]=at);let ot,st;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ot=()=>k(`edit`),st=(0,$.jsx)(oe,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[90]=ot,t[91]=st):(ot=t[90],st=t[91]);let ct;t[92]!==G.edit||t[93]!==nt||t[94]!==at?(ct=(0,$.jsxs)(`button`,{"aria-pressed":nt,type:`button`,className:at,onClick:ot,children:[st,G.edit]}),t[92]=G.edit,t[93]=nt,t[94]=at,t[95]=ct):ct=t[95];let lt=O===`preview`,ut=O===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,dt;t[96]===ut?dt=t[97]:(dt=z(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,ut),t[96]=ut,t[97]=dt);let ft,pt;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(ft=()=>k(`preview`),pt=(0,$.jsx)(A,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[98]=ft,t[99]=pt):(ft=t[98],pt=t[99]);let mt;t[100]!==G.preview||t[101]!==lt||t[102]!==dt?(mt=(0,$.jsxs)(`button`,{"aria-pressed":lt,type:`button`,className:dt,onClick:ft,children:[pt,G.preview]}),t[100]=G.preview,t[101]=lt,t[102]=dt,t[103]=mt):mt=t[103];let ht;t[104]!==G.current||t[105]!==ct||t[106]!==mt?(ht=(0,$.jsxs)(K,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":tt,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[ct,mt]}),t[104]=G.current,t[105]=ct,t[106]=mt,t[107]=ht):ht=t[107];let gt;t[108]!==et||t[109]!==ht?(gt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[et,ht]}),t[108]=et,t[109]=ht,t[110]=gt):gt=t[110];let _t;t[111]!==D||t[112]!==O||t[113]!==x||t[114]!==G.current||t[115]!==G.empty?(_t=O===`preview`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:x===`markdown`?(0,$.jsx)(te,{content:D||G.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:D||G.empty})}):(0,$.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25`,value:D,onChange:e=>ee(e.currentTarget.value),placeholder:G.empty,"aria-label":G.current}),t[111]=D,t[112]=O,t[113]=x,t[114]=G.current,t[115]=G.empty,t[116]=_t):_t=t[116];let vt;t[117]!==gt||t[118]!==_t?(vt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[gt,_t]}),t[117]=gt,t[118]=_t,t[119]=vt):vt=t[119];let yt;t[120]===G.editedSuggestion?yt=t[121]:(yt=(0,$.jsx)(`span`,{children:G.editedSuggestion}),t[120]=G.editedSuggestion,t[121]=yt);let bt;t[122]!==G.loading||t[123]!==H?(bt=H?(0,$.jsx)(`span`,{className:`ml-2 font-normal`,children:G.loading}):null,t[122]=G.loading,t[123]=H,t[124]=bt):bt=t[124];let xt;t[125]!==yt||t[126]!==bt?(xt=(0,$.jsxs)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:[yt,bt]}),t[125]=yt,t[126]=bt,t[127]=xt):xt=t[127];let St=G.editedSuggestion,Ct=N===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,wt;t[128]===Ct?wt=t[129]:(wt=z(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ct),t[128]=Ct,t[129]=wt);let Tt=N===`edit`,Et,Dt;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>P(`edit`),Dt=(0,$.jsx)(oe,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[130]=Et,t[131]=Dt):(Et=t[130],Dt=t[131]);let Ot;t[132]!==G.edit||t[133]!==wt||t[134]!==Tt?(Ot=(0,$.jsxs)(`button`,{type:`button`,className:wt,"aria-pressed":Tt,onClick:Et,children:[Dt,G.edit]}),t[132]=G.edit,t[133]=wt,t[134]=Tt,t[135]=Ot):Ot=t[135];let kt=N===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,At;t[136]===kt?At=t[137]:(At=z(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,kt),t[136]=kt,t[137]=At);let jt=N===`preview`,Mt,Nt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=()=>P(`preview`),Nt=(0,$.jsx)(A,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[138]=Mt,t[139]=Nt):(Mt=t[138],Nt=t[139]);let Pt;t[140]!==G.preview||t[141]!==At||t[142]!==jt?(Pt=(0,$.jsxs)(`button`,{type:`button`,className:At,"aria-pressed":jt,onClick:Mt,children:[Nt,G.preview]}),t[140]=G.preview,t[141]=At,t[142]=jt,t[143]=Pt):Pt=t[143];let Ft;t[144]!==G.editedSuggestion||t[145]!==Ot||t[146]!==Pt?(Ft=(0,$.jsxs)(K,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":St,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[Ot,Pt]}),t[144]=G.editedSuggestion,t[145]=Ot,t[146]=Pt,t[147]=Ft):Ft=t[147];let It;t[148]!==xt||t[149]!==Ft?(It=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[xt,Ft]}),t[148]=xt,t[149]=Ft,t[150]=It):It=t[150];let Lt=me?`opacity-100`:`pointer-events-none opacity-0`,Vt;t[151]===Lt?Vt=t[152]:(Vt=z(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Lt),t[151]=Lt,t[152]=Vt);let Wt=!me,Gt;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=()=>I(Ht),t[153]=Gt):Gt=t[153];let Kt;t[154]!==G.thinkingLoading||t[155]!==H?(Kt=H?(0,$.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,G.thinkingLoading]}):null,t[154]=G.thinkingLoading,t[155]=H,t[156]=Kt):Kt=t[156];let qt;t[157]!==G.thinking||t[158]!==Kt?(qt=(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[G.thinking,Kt]}),t[157]=G.thinking,t[158]=Kt,t[159]=qt):qt=t[159];let Jt=F&&`rotate-180`,Yt;t[160]===Jt?Yt=t[161]:(Yt=z(`size-3.5 shrink-0 transition-transform`,Jt),t[160]=Jt,t[161]=Yt);let Xt;t[162]===Yt?Xt=t[163]:(Xt=(0,$.jsx)(C,{className:Yt,strokeWidth:1.75,"aria-hidden":!0}),t[162]=Yt,t[163]=Xt);let Zt;t[164]!==qt||t[165]!==Xt?(Zt=(0,$.jsxs)(`button`,{type:`button`,className:`flex shrink-0 items-center justify-between gap-2 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:text-fg`,onClick:Gt,children:[qt,Xt]}),t[164]=qt,t[165]=Xt,t[166]=Zt):Zt=t[166];let Qt;t[167]!==V||t[168]!==F?(Qt=F?(0,$.jsx)(`pre`,{ref:se,className:`min-h-0 flex-1 overflow-auto border-t border-edge px-2.5 py-2 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,onScroll:Ce,children:V}):null,t[167]=V,t[168]=F,t[169]=Qt):Qt=t[169];let $t;t[170]!==Zt||t[171]!==Qt?($t=(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col rounded-lg border border-edge bg-surface-inset/70`,children:[Zt,Qt]}),t[170]=Zt,t[171]=Qt,t[172]=$t):$t=t[172];let en;t[173]!==Vt||t[174]!==Wt||t[175]!==$t?(en=(0,$.jsx)(`div`,{className:Vt,"aria-hidden":Wt,children:$t}),t[173]=Vt,t[174]=Wt,t[175]=$t,t[176]=en):en=t[176];let tn=me?`pointer-events-none opacity-0`:`opacity-100`,nn;t[177]===tn?nn=t[178]:(nn=z(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,tn),t[177]=tn,t[178]=nn);let rn;t[179]!==j||t[180]!==U||t[181]!==x||t[182]!==G.empty||t[183]!==G.loading||t[184]!==G.suggestion||t[185]!==H||t[186]!==N?(rn=U?(0,$.jsx)(`pre`,{className:`h-full min-h-0 overflow-auto whitespace-pre-wrap rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg-muted`,children:U}):N===`preview`?(0,$.jsx)(`div`,{className:`h-full min-h-0 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:H&&!j.trim()?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:G.loading}):x===`markdown`?(0,$.jsx)(te,{content:j||G.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:j||G.empty})}):(0,$.jsx)(`textarea`,{className:`h-full min-h-0 w-full resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25 disabled:text-fg-muted`,value:j,onChange:e=>M(e.currentTarget.value),disabled:H,placeholder:H?G.loading:G.empty,"aria-label":G.suggestion}),t[179]=j,t[180]=U,t[181]=x,t[182]=G.empty,t[183]=G.loading,t[184]=G.suggestion,t[185]=H,t[186]=N,t[187]=rn):rn=t[187];let an;t[188]!==nn||t[189]!==rn?(an=(0,$.jsx)(`div`,{className:nn,children:rn}),t[188]=nn,t[189]=rn,t[190]=an):an=t[190];let on;t[191]!==en||t[192]!==an?(on=(0,$.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[en,an]}),t[191]=en,t[192]=an,t[193]=on):on=t[193];let sn;t[194]!==It||t[195]!==on?(sn=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[It,on]}),t[194]=It,t[195]=on,t[196]=sn):sn=t[196];let cn;t[197]!==vt||t[198]!==sn?(cn=(0,$.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-hidden p-4 md:grid-cols-2`,children:[vt,sn]}),t[197]=vt,t[198]=sn,t[199]=cn):cn=t[199];let ln;t[200]!==X||t[201]!==G.cancel?(ln=(0,$.jsx)(pe,{type:`button`,variant:`secondary`,onClick:X,children:G.cancel}),t[200]=X,t[201]=G.cancel,t[202]=ln):ln=t[202];let un=!Le,dn;t[203]!==Ae||t[204]!==G.applyCurrent||t[205]!==un?(dn=(0,$.jsx)(pe,{type:`button`,variant:`secondary`,disabled:un,onClick:Ae,children:G.applyCurrent}),t[203]=Ae,t[204]=G.applyCurrent,t[205]=un,t[206]=dn):dn=t[206];let fn;t[207]===De?fn=t[208]:(fn=()=>void De(),t[207]=De,t[208]=fn);let pn;t[209]===ze?pn=t[210]:(pn=ze?(0,$.jsx)(ne,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,$.jsx)(ae,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[209]=ze,t[210]=pn);let mn=ze?G.regenerate:G.generate,hn;t[211]!==H||t[212]!==pn||t[213]!==mn||t[214]!==fn?(hn=(0,$.jsxs)(pe,{type:`button`,variant:`secondary`,disabled:H,onClick:fn,children:[pn,mn]}),t[211]=H,t[212]=pn,t[213]=mn,t[214]=fn,t[215]=hn):hn=t[215];let gn=!Ie,_n;t[216]!==Pe||t[217]!==G.append||t[218]!==gn?(_n=(0,$.jsx)(pe,{type:`button`,variant:`secondary`,disabled:gn,onClick:Pe,children:G.append}),t[216]=Pe,t[217]=G.append,t[218]=gn,t[219]=_n):_n=t[219];let vn=!Ie,yn;t[220]!==Me||t[221]!==G.replace||t[222]!==vn?(yn=(0,$.jsx)(pe,{type:`button`,variant:`primary`,disabled:vn,onClick:Me,children:G.replace}),t[220]=Me,t[221]=G.replace,t[222]=vn,t[223]=yn):yn=t[223];let bn;t[224]!==hn||t[225]!==_n||t[226]!==yn||t[227]!==ln||t[228]!==dn?(bn=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[ln,dn,hn,_n,yn]}),t[224]=hn,t[225]=_n,t[226]=yn,t[227]=ln,t[228]=dn,t[229]=bn):bn=t[229];let xn;t[230]!==bn||t[231]!==$e||t[232]!==cn?(xn=(0,$.jsx)(`div`,{className:`absolute inset-0 z-[80] flex items-center justify-center p-4 pointer-events-none`,children:(0,$.jsxs)(g,{className:`xopc-dialog-content-pane pointer-events-auto flex h-[min(78vh,38rem)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,onOpenAutoFocus:Ut,children:[$e,cn,bn]})}),t[230]=bn,t[231]=$e,t[232]=cn,t[233]=xn):xn=t[233];let Sn;t[234]!==xn||t[235]!==qe||t[236]!==Ye?(Sn=(0,$.jsxs)(h,{container:qe,children:[Ye,xn]}),t[234]=xn,t[235]=qe,t[236]=Ye,t[237]=Sn):Sn=t[237];let Cn;t[238]!==T||t[239]!==Sn||t[240]!==Ke?(Cn=(0,$.jsx)(v,{open:T,onOpenChange:Ke,children:Sn}),t[238]=T,t[239]=Sn,t[240]=Ke,t[241]=Cn):Cn=t[241];let wn;return t[242]!==Cn||t[243]!==Ge?(wn=(0,$.jsxs)($.Fragment,{children:[Ge,Cn]}),t[242]=Cn,t[243]=Ge,t[244]=wn):wn=t[244],wn}function Ht(e){return!e}function Ut(e){return e.preventDefault()}function Wt(e){return e.management!==void 0}function Gt(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...Ne,name:n.name,instruction:t===`reminder`?``:n.instruction,triggerMode:t===`reminder`?`once`:t===`review`?`weekly`:`daily`,time:t===`brief`?`08:30`:t===`review`?`17:00`:`09:00`,weekday:`5`,notificationPolicy:`all`}}})}var Kt=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-2 focus-visible:outline-accent`;function qt(e){let t=(0,it.c)(99),{form:n,setForm:r,labels:i,projects:a,projectLocked:o,source:s,requiresProject:c}=e,l;t[0]===r?l=t[1]:(l=e=>r(t=>({...t,...e})),t[0]=r,t[1]=l);let u=l,d;t[2]!==i.experience.source||t[3]!==s?(d=(0,$.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[i.experience.source,`: `,s]}),t[2]=i.experience.source,t[3]=s,t[4]=d):d=t[4];let f;t[5]===u?f=t[6]:(f=e=>u({name:e.target.value}),t[5]=u,t[6]=f);let p;t[7]!==n.name||t[8]!==f?(p=(0,$.jsx)(`input`,{className:Kt,value:n.name,onChange:f}),t[7]=n.name,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==i.form.name||t[11]!==p?(m=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.name,p]}),t[10]=i.form.name,t[11]=p,t[12]=m):m=t[12];let h;t[13]===u?h=t[14]:(h=e=>u({instruction:e.target.value}),t[13]=u,t[14]=h);let g;t[15]!==n.instruction||t[16]!==h?(g=(0,$.jsx)(`textarea`,{className:Kt,rows:5,value:n.instruction,onChange:h}),t[15]=n.instruction,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==i.info.task||t[19]!==g?(_=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.info.task,g]}),t[18]=i.info.task,t[19]=g,t[20]=_):_=t[20];let v;t[21]!==n.projectId||t[22]!==i.form.noProject||t[23]!==i.form.project||t[24]!==o||t[25]!==a||t[26]!==u?(v=!o&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.project,(0,$.jsxs)(T,{className:Kt,value:n.projectId,onChange:e=>u({projectId:e.target.value}),children:[(0,$.jsx)(E,{value:``,children:i.form.noProject}),a.map(Jt)]})]}),t[21]=n.projectId,t[22]=i.form.noProject,t[23]=i.form.project,t[24]=o,t[25]=a,t[26]=u,t[27]=v):v=t[27];let y;t[28]!==n.projectId||t[29]!==i.experience.projectRequired||t[30]!==c?(y=c&&!n.projectId?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:i.experience.projectRequired}):null,t[28]=n.projectId,t[29]=i.experience.projectRequired,t[30]=c,t[31]=y):y=t[31];let b;t[32]===u?b=t[33]:(b=e=>u({triggerMode:e.target.value}),t[32]=u,t[33]=b);let x;t[34]===i.trigger.once?x=t[35]:(x=(0,$.jsx)(E,{value:`once`,children:i.trigger.once}),t[34]=i.trigger.once,t[35]=x);let S;t[36]===i.trigger.daily?S=t[37]:(S=(0,$.jsx)(E,{value:`daily`,children:i.trigger.daily}),t[36]=i.trigger.daily,t[37]=S);let C;t[38]===i.trigger.weekly?C=t[39]:(C=(0,$.jsx)(E,{value:`weekly`,children:i.trigger.weekly}),t[38]=i.trigger.weekly,t[39]=C);let w;t[40]!==n.triggerMode||t[41]!==b||t[42]!==x||t[43]!==S||t[44]!==C?(w=(0,$.jsxs)(T,{className:Kt,value:n.triggerMode,onChange:b,children:[x,S,C]}),t[40]=n.triggerMode,t[41]=b,t[42]=x,t[43]=S,t[44]=C,t[45]=w):w=t[45];let D;t[46]!==i.form.trigger||t[47]!==w?(D=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.trigger,w]}),t[46]=i.form.trigger,t[47]=w,t[48]=D):D=t[48];let ee;t[49]!==n.onceAt||t[50]!==n.time||t[51]!==n.triggerMode||t[52]!==i.form.onceAt||t[53]!==i.form.time||t[54]!==u?(ee=n.triggerMode===`once`?(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.onceAt,(0,$.jsx)(`input`,{type:`datetime-local`,className:Kt,value:n.onceAt,onChange:e=>u({onceAt:e.target.value})})]}):(0,$.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:i.form.time}),(0,$.jsx)(Ke,{value:n.time,onChange:e=>u({time:e}),ariaLabel:i.form.time})]}),t[49]=n.onceAt,t[50]=n.time,t[51]=n.triggerMode,t[52]=i.form.onceAt,t[53]=i.form.time,t[54]=u,t[55]=ee):ee=t[55];let O;t[56]!==n.triggerMode||t[57]!==n.weekday||t[58]!==i.form.day||t[59]!==i.weekdays||t[60]!==u?(O=n.triggerMode===`weekly`&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,$.jsx)(T,{className:Kt,value:n.weekday,onChange:e=>u({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,$.jsx)(E,{value:String(t),children:i.weekdays[e]},e))})]}),t[56]=n.triggerMode,t[57]=n.weekday,t[58]=i.form.day,t[59]=i.weekdays,t[60]=u,t[61]=O):O=t[61];let k;t[62]!==D||t[63]!==ee||t[64]!==O?(k=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[D,ee,O]}),t[62]=D,t[63]=ee,t[64]=O,t[65]=k):k=t[65];let A;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(A=n.triggerMode===`once`&&n.onceAt&&new Date(n.onceAt).getTime()<=Date.now()?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-red-700 dark:text-red-300`,children:i.experience.futureTime}):null,t[66]=n.onceAt,t[67]=n.triggerMode,t[68]=i.experience.futureTime,t[69]=A):A=t[69];let j;t[70]===i.experience.scheduleNote?j=t[71]:(j=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=j);let M;t[72]===u?M=t[73]:(M=e=>u({notificationPolicy:e.target.value}),t[72]=u,t[73]=M);let N;t[74]===i.draft.notifyAll?N=t[75]:(N=(0,$.jsx)(E,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=N);let te;t[76]===i.draft.notifyAttention?te=t[77]:(te=(0,$.jsx)(E,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=te);let P;t[78]===i.draft.notifyNone?P=t[79]:(P=(0,$.jsx)(E,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=P);let F;t[80]!==n.notificationPolicy||t[81]!==M||t[82]!==N||t[83]!==te||t[84]!==P?(F=(0,$.jsxs)(T,{className:Kt,value:n.notificationPolicy,onChange:M,children:[N,te,P]}),t[80]=n.notificationPolicy,t[81]=M,t[82]=N,t[83]=te,t[84]=P,t[85]=F):F=t[85];let I;t[86]!==i.draft.notifications||t[87]!==F?(I=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.draft.notifications,F]}),t[86]=i.draft.notifications,t[87]=F,t[88]=I):I=t[88];let L;return t[89]!==y||t[90]!==k||t[91]!==d||t[92]!==A||t[93]!==j||t[94]!==I||t[95]!==m||t[96]!==_||t[97]!==v?(L=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[d,m,_,v,y,k,A,j,I]}),t[89]=y,t[90]=k,t[91]=d,t[92]=A,t[93]=j,t[94]=I,t[95]=m,t[96]=_,t[97]=v,t[98]=L):L=t[98],L}function Jt(e){return(0,$.jsx)(E,{value:e.id,children:e.name},e.id)}var Yt=`xopc.automations.dismissedExecutionIssues`;function Xt(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(Yt)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function Zt(e,t,n){return e?Je(e,n):t.never}function Qt(e,t){return e.kind===`system`?e.capability===`home.advisor.refresh`?`Home AI suggestions refresh`:e.capability===`memory.temporal_sweep`?`Memory temporal sweep`:e.capability===`memory.daily_reconciliation`?`Memory daily reconciliation`:`Memory weekly knowledge maintenance`:e.kind===`browser_automation`?`Browser automation: ${e.automationId}`:e.kind===`task_command`?t.action.taskWithId.replace(`{id}`,e.taskId):e.agentId?t.action.agentWithId.replace(`{id}`,e.agentId):t.action.agent}function $t(e,t){return e===`browser_automation`?t.sources.browser:e===`task_command`?t.action.runTask:t.action.runAgent}function en(e){return e.safety?.mode??`auto_apply`}function tn(e){return e===`succeeded`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`failed`||e===`timeout`?`bg-red-500/10 text-red-700 dark:text-red-300`:e===`running`||e===`queued`||e===`cancelling`?`bg-blue-500/10 text-blue-700 dark:text-blue-300`:`bg-surface-hover text-fg-muted`}function nn(e,t){if(e==null)return t.never;if(e<1e3)return`${e}ms`;let n=Math.round(e/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m ${n%60}s`}function rn(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function an(e){return e.status===`failed`||e.status===`timeout`}function on(e,t){return e.action.kind===`system`?Qt(e.action,t):e.action.kind===`agent`?e.action.instruction:(e.action.kind,Qt(e.action,t))}function sn(e){return e.description?.trim()??``}function cn(e){return rn(e)?0:an(e)?1:e.status===`succeeded`?2:3}function ln(e){return[...e].sort((e,t)=>{let n=cn(e)-cn(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function un(){let e=(0,it.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`section`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-edge-subtle bg-edge-subtle xl:grid-cols-4`,children:Array.from({length:4}).map(fn)}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,$.jsx)(B,{className:`h-4 w-36`}),(0,$.jsx)(B,{className:`h-3 w-56 max-w-full`})]}),(0,$.jsx)(B,{className:`h-7 w-20 rounded-full`})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:[n,(0,$.jsx)(`div`,{className:`mt-4 grid gap-2`,children:Array.from({length:6}).map(dn)})]}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(B,{className:`h-4 w-32`}),a=(0,$.jsx)(B,{className:`mt-4 h-24 rounded-lg`}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let o;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4`,"aria-hidden":`true`,children:[t,(0,$.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-3 md:grid-cols-[15rem_minmax(0,1fr)] md:grid-rows-1 lg:grid-cols-[17rem_minmax(0,1fr)]`,children:[r,(0,$.jsxs)(`section`,{className:`hidden rounded-xl bg-surface-panel p-4 shadow-surface xl:block`,children:[i,a,(0,$.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,$.jsx)(B,{className:`h-12 rounded-lg`}),(0,$.jsx)(B,{className:`h-12 rounded-lg`}),(0,$.jsx)(B,{className:`h-12 rounded-lg`})]})]})]})]}),e[5]=o):o=e[5],o}function dn(e,t){return(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-base p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(B,{className:`size-4 rounded-full`}),(0,$.jsx)(B,{className:`h-4 w-32`}),(0,$.jsx)(B,{className:`h-5 w-20 rounded-full`})]}),(0,$.jsx)(B,{className:`mt-3 h-4 w-full`}),(0,$.jsx)(B,{className:`mt-2 h-4 w-3/5`})]}),(0,$.jsx)(B,{className:`h-8 w-24 rounded-md`})]})},t)}function fn(e,t){return(0,$.jsxs)(`div`,{className:`flex min-h-12 items-center gap-2.5 bg-surface-base px-3 py-2.5`,children:[(0,$.jsx)(B,{className:`size-4 rounded-full`}),(0,$.jsx)(B,{className:`h-3 w-14`}),(0,$.jsx)(B,{className:`ml-auto h-4 w-10`})]},t)}function pn({projectId:e,embedded:t=!1,title:n,subtitle:r}){let i=d(e=>e.language),o=f(i),s=o.automations,c=o.productNavigation.sections[`automation-triggers`],l=o.cron,u=me(e=>e.setPageHeader),y=me(e=>e.clearPageHeader),[b,x]=a(),S=!t&&b.get(`view`)===`activity`,C=b.get(`run`)?.trim()??``,w=b.get(`view`)===`execution`&&!!C,T=b.get(`automation`)?.trim()??``,E=b.get(`new`)===`1`,ee=b.get(`setupChat`)??void 0,O=b.get(`draft`)?.trim()??``,k=b.get(`action`)?.trim()??``,A=b.get(`taskId`)?.trim()??``,j=b.get(`projectId`)?.trim()??``,M=e?.trim()||j,N=!!e?.trim(),te=b.get(`autogenerate`)===`1`,P=(0,Q.useRef)(``),F=b.get(`status`),I=F===`active`||F===`paused`||F===`completed`||F===`running`||F===`attention`?F:`all`,L=b.get(`ownership`)===`system`?`system`:`user`,ne=b.get(`source`),re=ne===`agent`||ne===`task_command`||ne===`browser_automation`?ne:`all`,ie=b.get(`q`)??``,ae=e=>x(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),oe=e=>x(t=>{let n=new URLSearchParams(t);return e===`user`?n.delete(`ownership`):n.set(`ownership`,e),n.delete(`automation`),n}),se=e=>x(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),B=e=>x(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`source`):n.set(`source`,e),n.delete(`automation`),n}),H=()=>x(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.delete(`automation`),t}),[U,ue]=(0,Q.useState)(null),[G,K]=(0,Q.useState)(!1),[ge,q]=(0,Q.useState)(`blank`),[_e,ve]=(0,Q.useState)(!1),[ye,be]=(0,Q.useState)(null),[xe,Se]=(0,Q.useState)(null),[Ce,we]=(0,Q.useState)(!1),[J,Te]=(0,Q.useState)(Ne),[Ee,Y]=(0,Q.useState)(null),[Oe,X]=(0,Q.useState)(null),[je,Fe]=(0,Q.useState)(!1),[Ie,ze]=(0,Q.useState)(null),[Ve,Ue]=(0,Q.useState)(``),[Ge,Ke]=(0,Q.useState)(null),[qe,Je]=(0,Q.useState)(!1),[Ye,Xe]=(0,Q.useState)(!1),[Qe,nt]=(0,Q.useState)(M),[rt,it]=(0,Q.useState)(`new_session`),[at,ot]=(0,Q.useState)(`attention`),[st,ct]=(0,Q.useState)(null),[lt,ut]=(0,Q.useState)(!1),[dt,pt]=(0,Q.useState)(!1),[mt,ht]=(0,Q.useState)(!1),[gt,vt]=(0,Q.useState)(null),[yt,bt]=(0,Q.useState)(Xt),xt=W([`automations`,M],()=>Z.list(M?{projectId:M}:void 0),{keepPreviousData:!0,refreshInterval:15e3}),Ct=W([`automation-runs`,M],()=>Z.runs(50,void 0,M?{projectId:M}:void 0),{keepPreviousData:!0,refreshInterval:1e4}),Tt=W(M?`automations-global-system-source`:null,()=>Z.list(),{keepPreviousData:!0,refreshInterval:15e3}),Et=W(M?`automation-runs-global-system-source`:null,()=>Z.runs(50),{keepPreviousData:!0,refreshInterval:1e4}),Dt=W(Ie?[`automation-history`,Ie,M]:null,()=>Z.runs(50,Ie,M?{projectId:M}:void 0),{refreshInterval:1e4}),Ot=W(Oe?`automation-run-events:${Oe}`:null,()=>Z.runEvents(Oe),{refreshInterval:5e3}),At=W(Oe?[`automation-exact-run`,Oe]:null,()=>Z.getRun(Oe),{refreshInterval:3e3}),jt=W(`automation-browser-automations`,()=>et.list()),Mt=W(`automation-chat-agents`,fe),Pt=W(`automation-tasks`,Z.tasks),Ft=W(`automation-projects`,()=>V({sortBy:`name`,sortOrder:`asc`,limit:200})),It=xt.isLoading&&!xt.data||Ct.isLoading&&!Ct.data||!!M&&Tt.isLoading&&!Tt.data||!!M&&Et.isLoading&&!Et.data,Lt=!It&&(xt.isLoading||Ct.isLoading||Tt.isLoading||Et.isLoading),Rt=xt.data?.automations??[],zt=M?Tt.data?.automations??[]:Rt,Bt=(0,Q.useMemo)(()=>ln(Ct.data?.runs??[]),[Ct.data?.runs]),Vt=(0,Q.useMemo)(()=>M?ln(Et.data?.runs??[]):Bt,[Et.data?.runs,M,Bt]),Ht=(0,Q.useMemo)(()=>Rt.filter(e=>!Wt(e)),[Rt]),Ut=(0,Q.useMemo)(()=>zt.filter(Wt),[zt]),Kt=(0,Q.useMemo)(()=>[...Ht,...Ut],[Ut,Ht]),Jt=(0,Q.useMemo)(()=>new Set(Ut.map(e=>e.id)),[Ut]),Zt=(0,Q.useMemo)(()=>Bt.filter(e=>!Jt.has(e.automationId)),[Bt,Jt]),Qt=(0,Q.useMemo)(()=>Vt.filter(e=>Jt.has(e.automationId)),[Vt,Jt]),$t=(0,Q.useMemo)(()=>M?[...Bt,...Qt]:Bt,[M,Bt,Qt]),en=(0,Q.useMemo)(()=>At.data?.run?.id===Oe?At.data.run:$t.find(e=>e.id===Oe)??Dt.data?.runs.find(e=>e.id===Oe)??null,[$t,Oe,Dt.data,At.data]),tn=(0,Q.useMemo)(()=>Kt.find(e=>e.id===Ie)??null,[Kt,Ie]),nn=(0,Q.useMemo)(()=>Kt.find(e=>e.id===xe)??null,[Kt,xe]),an=(0,Q.useMemo)(()=>[...Dt.data?.runs??$t].filter(e=>e.automationId===Ie).sort((e,t)=>t.createdAtMs-e.createdAtMs),[$t,Ie,Dt.data]),cn=Ot.data?.events??[],dn=(0,Q.useMemo)(()=>Zt.filter(e=>!rn(e)&&e.readAtMs==null),[Zt]),fn=ie.trim().toLocaleLowerCase(),pn=L===`system`?Ut:Ht,gn=L===`system`?Qt:Zt,_n=(0,Q.useMemo)(()=>new Set(gn.filter(rn).map(e=>e.automationId)),[gn]),vn=(0,Q.useMemo)(()=>pn.filter(e=>I===`attention`&&!Ze(e,gn)||I===`running`&&!_n.has(e.id)||I===`active`&&!e.enabled||I===`paused`&&(e.enabled||De(e))||I===`completed`&&!De(e)||re!==`all`&&e.action.kind!==re?!1:!fn||[e.name,sn(e),on(e,s),ke(e.trigger,s,l,i)].some(e=>e.toLocaleLowerCase().includes(fn))),[l,I,s,i,fn,pn,gn,_n,re]),yn=(0,Q.useMemo)(()=>(jt.data?.automations??[]).filter(e=>e.enabled),[jt.data]),xn=Mt.data?.items??[],Sn=(0,Q.useMemo)(()=>(Pt.data?.items??[]).map(e=>e.task),[Pt.data]),Cn=Ft.data?.items??[],En=(0,Q.useMemo)(()=>yn.find(e=>e.id===J.browserAutomationId.trim())??null,[yn,J.browserAutomationId]),Dn=!!nn?.management?.editable.includes(`trigger`),On=[`daily`,`weekly`,`interval`,`cron`].includes(J.triggerMode)&&(![`daily`,`weekly`].includes(J.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(J.time))&&(J.triggerMode!==`interval`||Re(J.intervalValue,J.intervalUnit)>=6e4)&&(J.triggerMode!==`cron`||!!J.cronExpr.trim()),kn=Dn?On:!!J.name.trim()&&(J.triggerMode!==`once`||Number.isFinite(new Date(J.onceAt).getTime())&&(!!nn||new Date(J.onceAt).getTime()>Date.now()))&&(![`daily`,`weekly`].includes(J.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(J.time))&&(J.triggerMode!==`event`||!!J.eventType.trim()&&Pe(J.eventPayloadMatch))&&(J.actionMode===`browser_automation`?En!==null&&tt(En,J.browserAutomationInputs):J.actionMode===`task_command`?!!(J.taskId.trim()&&J.agentId.trim()):!!J.instruction.trim()),An=!0;try{[`daily`,`weekly`,`cron`].includes(J.triggerMode)&&Be(J)}catch{An=!1}let jn=kn&&An,Mn=(0,Q.useMemo)(()=>Gt(s),[s]),Nn=(0,Q.useMemo)(()=>Ht.filter(e=>Ze(e,Zt)),[Ht,Zt]),Fn=Nn.some(e=>{let t=$e(e,Zt);return t!==null&&yt[e.id]!==t}),In=(0,Q.useCallback)(()=>{bt(e=>{let t={...e};for(let e of Nn){let n=$e(e,Zt);n&&(t[e.id]=n)}try{window.localStorage.setItem(Yt,JSON.stringify(t))}catch{}return t})},[Nn,Zt]);(0,Q.useEffect)(()=>{if(!Lt){if(E){ze(null);return}if(T){ze(T);return}if(vn.length===0){ze(null);return}Ie&&vn.some(e=>e.id===Ie)||ze(null)}},[T,vn,E,Lt,Ie]);let Ln=(0,Q.useCallback)(async()=>{await Promise.all([xt.mutate(),Ct.mutate(),Tt.mutate(),Et.mutate(),Dt.mutate(),Ot.mutate(),de(e=>Array.isArray(e)&&e[0]===`automation-navigation-runs`)])},[xt.mutate,Tt.mutate,Et.mutate,Ot.mutate,Ct.mutate,Dt.mutate]),Rn=(0,Q.useCallback)(e=>{if(N){ze(null),X(null);return}x(t=>{let n=new URLSearchParams(t);return e?n.set(`projectId`,e):n.delete(`projectId`),n.delete(`automation`),n.delete(`run`),n}),ze(null),X(null)},[N,x]);(0,Q.useEffect)(()=>{N&&(nt(M),Te(e=>e.projectId===M?e:{...e,projectId:M}))},[M,N]);let zn=(0,Q.useCallback)(e=>{if(e===`blank`&&!A){ve(!0);return}if(Se(null),we(!1),Y(null),q(e),K(!0),e===`blank`){Te({...Ne,projectId:M});return}Ue(``),Ke(null),Xe(!1),nt(M),it(`new_session`),ot(`attention`)},[M,A]),Bn=e=>{ue(e),Te({...e.form,projectId:M}),Se(null),we(!1),Y(null),q(`quick`),K(!0)},Vn=(0,Q.useCallback)(e=>{if(e.action.kind===`agent`&&!e.management){be(e);return}Te(We(e)),Se(e.id),we(!1),ze(null),q(`blank`),K(!0)},[]),Hn=(0,Q.useCallback)(()=>{Ge&&(Te({...We(Ge.automation),projectId:Qe,conversationMode:rt,notificationPolicy:at}),Se(null),we(!0),q(`blank`))},[Ge,rt,at,Qe]),Un=(0,Q.useCallback)(async()=>{ht(!0),Y(null);try{await Ln()}catch(e){let t=e instanceof Error?e.message:String(e);Y(t)}finally{ht(!1)}},[s.feedback.actionFailed,Ln]);(0,Q.useEffect)(()=>{let e=Kt.find(e=>e.id===T);!e||!Wt(e)||L===`system`||x(e=>{let t=new URLSearchParams(e);return t.set(`ownership`,`system`),t},{replace:!0})},[T,Kt,L,x]),(0,Q.useEffect)(()=>{k===`create`&&(zn(`blank`),A&&Te(e=>({...e,actionMode:`task_command`,taskId:A,safetyMode:`auto_apply`})),x(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t.delete(`taskId`),t},{replace:!0}))},[k,zn,x,A]),(0,Q.useEffect)(()=>{if(!O)return;let e=`${i}:${te?`auto`:`seed`}:${O}`;P.current!==e&&(P.current=e,Ue(O),Ke(null),Xe(!1),nt(M),q(`draft`),K(!0),x(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),te&&(Y(null),Je(!0),Z.draft({prompt:O,language:i}).then(e=>{Ke(e.draft),Xe(!1)}).catch(e=>{Y(e instanceof Error?e.message:String(e))}).finally(()=>{Je(!1)})))},[te,O,i,M,x]);let Wn=(0,Q.useCallback)(e=>{let t=Bt.find(t=>t.id===e)??Dt.data?.runs.find(t=>t.id===e);if(!t||rn(t)||t.readAtMs!=null)return;let n=Date.now();Ct.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Dt.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Z.markRunRead(e).catch(e=>{Y(e instanceof Error?e.message:String(e)),Ct.mutate(),Dt.mutate()})},[Bt,Ct.mutate,Dt.data,Dt.mutate]),Gn=(0,Q.useCallback)(e=>{Wn(e),X(e),Fe(!0),x(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[Wn,x]),Kn=(0,Q.useCallback)(e=>{ze(e),X(null),Fe(!1),x(t=>{let n=new URLSearchParams(t);n.set(`automation`,e);for(let e of[`new`,`setupChat`,`chatDraft`,`run`,`view`])n.delete(e);return n})},[x]),qn=(0,Q.useCallback)(e=>{Fe(!1),x(t=>{let n=new URLSearchParams(t);n.set(`automation`,e.automationId),n.set(`run`,e.id),n.set(`view`,`execution`);for(let e of[`new`,`setupChat`,`chatDraft`])n.delete(e);return n})},[x]);(0,Q.useEffect)(()=>{X(C||null),Fe(!!C&&!w)},[w,C]),(0,Q.useEffect)(()=>{C&&!w&&Wn(C)},[w,C,Wn]),(0,Q.useEffect)(()=>{ct(null),pt(!1)},[Oe]);async function Jn(){if(Y(null),J.triggerMode===`once`&&!nn&&new Date(J.onceAt).getTime()<=Date.now()){Y(s.experience.futureTime);return}if(!(!jn||gt)&&!(ge===`quick`&&U?.requiresProject&&!J.projectId)){if(Ce&&Ge){vt(`draft:edit`);try{let e=Le(J),{simulation:t}=await Z.simulate(e);Ke({...Ge,automation:e,simulation:t}),nt(J.projectId),it(J.conversationMode),ot(J.notificationPolicy),Xe(!1),we(!1),q(`draft`)}catch(e){let t=e instanceof Error?e.message:String(e);Y(t)}finally{vt(null)}return}if(nn){let e=nn.id;await Yn(`automation:${e}:edit`,()=>Z.update(e,{...Dn?{trigger:Me(nn,{...J,instruction:`managed`}).trigger}:Me(nn,J),expectedRevision:nn.updatedAtMs}))&&(K(!1),Se(null),ze(e));return}vt(`automation:create`);try{let e=Le(J),{automation:t}=await Z.create(e);Te(Ne),K(!1),x(e=>{let n=new URLSearchParams(e);return n.delete(`status`),n.delete(`q`),n.delete(`run`),n.delete(`new`),n.set(`automation`,t.id),N||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await Ln(),ze(t.id)}catch(e){let t=e instanceof Error?e.message:String(e);Y(t)}finally{vt(null)}}}async function Yn(e,t){Y(null),vt(e);try{return await t(),await Ln(),!0}catch(e){let t=e instanceof Error?e.message:String(e);return Y(t),!1}finally{vt(null)}}async function Xn(){await Yn(`runs:read-all`,()=>Z.markAllRunsRead(M||void 0))}async function Zn(){let e=Ve.trim();if(e){Y(null),Je(!0);try{let t=await Z.draft({prompt:e,language:i});Ke(t.draft),Xe(!1)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{Je(!1)}}}async function Qn(){if(!Ge)return;let e=``,t=``;await Yn(`draft:publish`,async()=>{let{automation:n}=await Z.create({...Ge.automation,...Qe?{projectId:Qe}:{projectId:void 0},conversationMode:rt,delivery:{...Ge.automation.delivery,notificationPolicy:at}});Ke(null),Ue(``),Xe(!1),K(!1),ae(`all`),se(``),e=n.id,t=n.projectId??``})&&e&&(Rn(t),Kn(e))}async function $n(){if(!Ge)return;let e=``,t=``,n=``;await Yn(`draft:test`,async()=>{let{automation:r}=await Z.create({...Ge.automation,...Qe?{projectId:Qe}:{projectId:void 0},conversationMode:rt,delivery:{...Ge.automation.delivery,notificationPolicy:at},enabled:!1}),{run:i}=await Z.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,Ke(null),Ue(``),Xe(!1),K(!1),ae(`all`),se(``)})&&e&&n&&(Rn(t),Kn(e),Gn(n))}async function er(e){Y(null),ut(!0),ct(null),pt(!1);try{let t=await Z.repairDraft(e.id,{language:i});ct(t.repair)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{ut(!1)}}async function tr(e){st&&await Yn(`run:${e.id}:repair`,async()=>{await Z.update(e.automationId,st.patch),ct(null),pt(!1)})}let nr=(0,Q.useMemo)(()=>(0,$.jsx)(he,{className:`size-9 shrink-0 p-0`,loading:mt,label:s.refresh,onClick:Un}),[s.refresh,mt,Un]);return(0,Q.useLayoutEffect)(()=>{if(!t)return u({startExtra:null,main:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:c}),end:nr}),()=>y()},[y,t,nr,c,u]),(0,$.jsxs)(`div`,{className:z(`flex min-h-0 min-w-0 flex-1 flex-col`,t?`bg-transparent`:`bg-surface-panel`),children:[(0,$.jsxs)(`div`,{className:z(`flex min-h-0 w-full flex-1 flex-col gap-4`,t?`py-1`:`px-4 pt-3 sm:px-9 lg:pt-4 xl:px-10`,!t&&(S?`overflow-y-auto`:`overflow-hidden`)),children:[t?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-xl border border-edge-subtle bg-surface-base px-4 py-3 shadow-surface`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(le,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n||s.title})]}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r||s.subtitle})]}),nr]}):null,Ee||xt.error||Ct.error||Tt.error||Et.error?(0,$.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:Ee||s.feedback.actionFailed}):null,S?It?(0,$.jsx)(un,{}):(0,$.jsx)(bn,{runs:gn,ownership:L,labels:s,language:i,unreadCount:L===`user`?dn.length:0,loading:Lt||mt,onOwnershipChange:oe,onRefresh:Un,onSelectRun:Gn}):(0,$.jsxs)($.Fragment,{children:[!It&&Fn&&L===`user`?(0,$.jsxs)(`div`,{className:`flex items-center rounded-lg border border-red-500/20 bg-red-500/5`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>ae(`attention`),className:`flex min-w-0 flex-1 items-center gap-3 rounded-l-lg px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(D,{className:`size-4 shrink-0 text-red-700 dark:text-red-300`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 text-sm text-fg`,children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[s.experience.executionIssues,` · `,Nn.length]}),(0,$.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:s.experience.issuesDescription})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:In,className:`mr-2 rounded-md p-2 text-fg-muted hover:bg-red-500/10 hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":s.close,title:s.close,children:(0,$.jsx)(ce,{className:`size-4`,"aria-hidden":!0})})]}):null,It?(0,$.jsx)(un,{}):(0,$.jsxs)(St,{language:i,busy:Lt,children:[(0,$.jsxs)(`aside`,{className:z(`max-h-[28vh] min-h-0 min-w-0 flex-col overflow-hidden rounded-xl bg-surface-base md:flex md:h-full md:max-h-none`,w?`hidden`:`flex`),children:[(0,$.jsxs)(`div`,{className:`shrink-0 p-3`,children:[(0,$.jsx)(kt,{language:i,labels:s,filter:I,ownership:L,source:re,projectId:M,projects:Cn,projectLocked:N,query:ie,unreadCount:L===`user`?dn.length:0,markReadBusy:gt===`runs:read-all`,onFilter:ae,onOwnership:oe,onSource:B,onProject:Rn,onQuery:se,onClear:()=>{H(),oe(`user`),N||Rn(``)},onMarkAllRead:()=>void Xn()}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>ve(!0),className:`mt-2 flex w-full items-center gap-2 rounded-lg px-2 py-2 text-sm text-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(R,{className:`size-4`,"aria-hidden":!0}),i===`zh`?`新建任务`:`New task`]})]}),T&&!vn.some(e=>e.id===T)?(0,$.jsxs)(`p`,{role:`status`,className:`px-3 pb-2 text-xs text-fg-muted`,children:[i===`zh`?`当前自动化不在筛选结果中。`:`The selected automation is outside these filters.`,(0,$.jsx)(`button`,{type:`button`,className:`ml-1 text-accent-fg underline`,onClick:H,children:i===`zh`?`清除筛选`:`Clear filters`})]}):null,(0,$.jsx)(_t,{automations:vn,runs:gn,labels:s,cronLabels:l,language:i,selectedAutomationId:E?null:Ie,selectedRunId:w?C:void 0,selectedRun:w?en:null,projectId:M||void 0,executionSummaries:(L===`system`&&M?Tt.data:xt.data)?.executionSummaries,onSelectRun:qn,onOpenDetails:Kn,busy:gt!==null,onEdit:Vn,onAction:Yn})]}),w&&T?(0,$.jsx)(ft,{automationId:T,runId:C,projectId:M||void 0,language:i,onBack:()=>Kn(T),onDetails:()=>Fe(!0),onConfigure:e=>{Z.openConfiguration({automationId:e.automationId,runId:e.id}).then(({conversationId:t})=>{Fe(!1),x(n=>{let r=new URLSearchParams(n);return r.set(`automation`,e.automationId),r.set(`setupChat`,t),r.delete(`run`),r.delete(`view`),r})}).catch(e=>Y(e instanceof Error?e.message:String(e)))}},`${T}:${C}`):!E&&tn&&!tn.management&&tn.action.kind!==`system`?(0,$.jsx)(wt,{automation:tn,conversationId:ee,runs:an,language:i,onSelectRun:Gn},tn.id):ee?(0,$.jsx)(wt,{conversationId:ee,runs:[],language:i,onSelectRun:Gn,onConfigured:Kn},ee):!E&&tn?(0,$.jsx)(Tn,{automation:tn,runs:an,runsLoading:Dt.isLoading,runsError:Dt.error?s.feedback.actionFailed:void 0,labels:s,cronLabels:l,language:i,projects:Cn,busyAction:gt,onEdit:Vn,onSelectRun:Gn,onAction:Yn},tn.id):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto`,children:(0,$.jsx)(Nt,{language:i,projectId:M,onOpenConversation:e=>{let t=new URL(e,window.location.origin),n=t.searchParams.get(`setupChat`);x(e=>{let r=new URLSearchParams(e);r.set(`new`,`1`),r.delete(`automation`),r.set(`setupChat`,n);let i=t.searchParams.get(`chatDraft`);return i?r.set(`chatDraft`,i):r.delete(`chatDraft`),r})}},M)})]})]})]}),_e?(0,$.jsx)(He,{language:i,projectId:M,onClose:()=>ve(!1),onCreated:e=>{oe(`user`),H(),Kn(e.id)}}):null,ye?(0,$.jsx)(He,{automation:ye,language:i,onClose:()=>be(null)}):null,(0,$.jsx)(v,{open:G,onOpenChange:e=>{K(e),e||(Se(null),we(!1))},children:(0,$.jsxs)(h,{children:[(0,$.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(760px,calc(100vh-2rem))] w-[min(100%-2rem,64rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(_,{className:`text-base font-semibold text-fg`,children:ge===`draft`?s.draft.title:nn?s.editTitle:Ce?s.draft.editTitle:s.createTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:ge===`draft`?s.draft.subtitle:s.form.createFlowHint})]}),(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(ce,{className:`size-4`})})})]}),Ee?(0,$.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:Ee}):null,ge===`draft`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,$.jsx)(hn,{labels:s,prompt:Ve,draft:Ge,loading:qe,approved:Ye,publishBusy:gt===`draft:publish`,testBusy:gt===`draft:test`,templates:Mn,projects:Cn,projectId:Qe,conversationMode:rt,notificationPolicy:at,onPromptChange:Ue,onGenerate:Zn,onEdit:Hn,onPublish:Qn,onTest:$n,onProjectChange:nt,onConversationModeChange:it,onNotificationPolicyChange:ot,projectLocked:N,onApprovedChange:Xe,onDiscard:()=>{Ke(null),Xe(!1)},onTemplateSelect:e=>{Bn(e),Te({...e.form,projectId:Qe})},onOpenAdvanced:()=>{Te({...Ne,projectId:Qe,conversationMode:rt,notificationPolicy:at}),q(`blank`)}})}):(0,$.jsxs)($.Fragment,{children:[Dn?(0,$.jsx)(mn,{form:J,setForm:Te,labels:s}):ge===`quick`&&U?(0,$.jsx)(qt,{form:J,setForm:Te,labels:s,projects:Cn,projectLocked:N,source:U.source,requiresProject:U.requiresProject}):(0,$.jsx)(Pn,{form:J,labels:s,setForm:Te,projects:Cn,browserAutomations:yn,selectedBrowserAutomation:En,browserAutomationsLoading:jt.isLoading,agentOptions:xn,agentsLoading:Mt.isLoading,defaultAgentId:Mt.data?.defaultId??``,taskOptions:Sn,tasksLoading:Pt.isLoading,language:i,projectLocked:N}),Dn||ge===`quick`?(0,$.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto px-5 pb-4`,children:(0,$.jsx)(Ae,{form:J,onChange:e=>Te(t=>({...t,...e})),language:i})}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[ge===`quick`?(0,$.jsx)(pe,{variant:`ghost`,onClick:()=>q(`blank`),children:s.draft.advancedCreate}):null,Ce?(0,$.jsx)(pe,{variant:`ghost`,onClick:()=>{we(!1),q(`draft`)},children:s.cancel}):(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,children:s.cancel})}),(0,$.jsx)(pe,{variant:`primary`,onClick:Jn,disabled:!jn||!!gt||ge===`quick`&&!!U?.requiresProject&&!J.projectId,children:gt===`automation:create`||gt===`draft:edit`||nn&>===`automation:${nn.id}:edit`?s.feedback.working:nn||Ce?s.save:s.experience.createEnabled})]})]})]})]})}),(0,$.jsx)(v,{open:je&&!!en,onOpenChange:e=>{Fe(e),!(e||w)&&x(e=>{let t=new URLSearchParams(e);return t.delete(`run`),t},{replace:!0})},children:(0,$.jsxs)(h,{children:[(0,$.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(85vh,40rem)] w-[min(100%-2rem,32rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(_,{className:`truncate text-base font-semibold text-fg`,children:en?.automationName??s.dashboard.result}),(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(pe,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(ce,{className:`size-4`})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,$.jsx)(wn,{className:`rounded-none border-0`,run:en,events:cn,labels:s,cronLabels:l,language:i,loading:Ot.isLoading,repairDraft:st,repairLoading:lt,repairApproved:dt,busyAction:gt,onRepairApprovedChange:pt,onSuggestRepair:er,onApplyRepair:tr})})]})]})})]})}function mn(e){let t=(0,it.c)(48),{form:n,setForm:r,labels:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(t=>({...t,...e})),t[0]=r,t[1]=a);let o=a,s;t[2]===i.form.trigger?s=t[3]:(s=(0,$.jsx)(Rn,{title:i.form.trigger}),t[2]=i.form.trigger,t[3]=s);let c;t[4]===o?c=t[5]:(c=e=>o({triggerMode:e.target.value}),t[4]=o,t[5]=c);let l;t[6]===i.trigger.daily?l=t[7]:(l=(0,$.jsx)(E,{value:`daily`,children:i.trigger.daily}),t[6]=i.trigger.daily,t[7]=l);let u;t[8]===i.trigger.weekly?u=t[9]:(u=(0,$.jsx)(E,{value:`weekly`,children:i.trigger.weekly}),t[8]=i.trigger.weekly,t[9]=u);let d;t[10]===i.trigger.interval?d=t[11]:(d=(0,$.jsx)(E,{value:`interval`,children:i.trigger.interval}),t[10]=i.trigger.interval,t[11]=d);let f;t[12]===i.trigger.customCron?f=t[13]:(f=(0,$.jsx)(E,{value:`cron`,children:i.trigger.customCron}),t[12]=i.trigger.customCron,t[13]=f);let p;t[14]!==n.triggerMode||t[15]!==i.form.trigger||t[16]!==c||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==f?(p=(0,$.jsxs)(T,{"aria-label":i.form.trigger,className:Ln,value:n.triggerMode,onChange:c,children:[l,u,d,f]}),t[14]=n.triggerMode,t[15]=i.form.trigger,t[16]=c,t[17]=l,t[18]=u,t[19]=d,t[20]=f,t[21]=p):p=t[21];let m;t[22]!==n.time||t[23]!==n.triggerMode||t[24]!==n.weekday||t[25]!==i.form.day||t[26]!==i.form.time||t[27]!==i.weekdays||t[28]!==o?(m=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(X,{label:i.form.time,children:(0,$.jsx)(Ke,{value:n.time,onChange:e=>o({time:e}),ariaLabel:i.form.time})}),n.triggerMode===`weekly`?(0,$.jsx)(X,{label:i.form.day,children:(0,$.jsxs)(T,{className:Ln,value:n.weekday,onChange:e=>o({weekday:e.target.value}),children:[(0,$.jsx)(E,{value:`1`,children:i.weekdays.monday}),(0,$.jsx)(E,{value:`2`,children:i.weekdays.tuesday}),(0,$.jsx)(E,{value:`3`,children:i.weekdays.wednesday}),(0,$.jsx)(E,{value:`4`,children:i.weekdays.thursday}),(0,$.jsx)(E,{value:`5`,children:i.weekdays.friday}),(0,$.jsx)(E,{value:`6`,children:i.weekdays.saturday}),(0,$.jsx)(E,{value:`0`,children:i.weekdays.sunday})]})}):null]}):null,t[22]=n.time,t[23]=n.triggerMode,t[24]=n.weekday,t[25]=i.form.day,t[26]=i.form.time,t[27]=i.weekdays,t[28]=o,t[29]=m):m=t[29];let h;t[30]!==n.intervalUnit||t[31]!==n.intervalValue||t[32]!==n.triggerMode||t[33]!==i.form.intervalEvery||t[34]!==i.form.intervalUnits||t[35]!==o?(h=n.triggerMode===`interval`?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,$.jsx)(X,{label:i.form.intervalEvery,children:(0,$.jsx)(`input`,{className:Ln,type:`number`,min:`1`,value:n.intervalValue,onChange:e=>o({intervalValue:e.target.value})})}),(0,$.jsx)(X,{label:i.form.intervalUnits.minute,children:(0,$.jsxs)(T,{className:Ln,value:n.intervalUnit,onChange:e=>o({intervalUnit:e.target.value}),children:[(0,$.jsx)(E,{value:`minute`,children:i.form.intervalUnits.minute}),(0,$.jsx)(E,{value:`hour`,children:i.form.intervalUnits.hour}),(0,$.jsx)(E,{value:`day`,children:i.form.intervalUnits.day}),(0,$.jsx)(E,{value:`week`,children:i.form.intervalUnits.week})]})})]}):null,t[30]=n.intervalUnit,t[31]=n.intervalValue,t[32]=n.triggerMode,t[33]=i.form.intervalEvery,t[34]=i.form.intervalUnits,t[35]=o,t[36]=h):h=t[36];let g;t[37]!==n.cronExpr||t[38]!==n.triggerMode||t[39]!==i.form.expression||t[40]!==o?(g=n.triggerMode===`cron`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsx)(X,{label:i.form.expression,children:(0,$.jsx)(`input`,{className:Ln,value:n.cronExpr,onChange:e=>o({cronExpr:e.target.value})})})}):null,t[37]=n.cronExpr,t[38]=n.triggerMode,t[39]=i.form.expression,t[40]=o,t[41]=g):g=t[41];let _;return t[42]!==h||t[43]!==g||t[44]!==s||t[45]!==p||t[46]!==m?(_=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[s,p,m,h,g]}),t[42]=h,t[43]=g,t[44]=s,t[45]=p,t[46]=m,t[47]=_):_=t[47],_}function hn(e){let t=(0,it.c)(110),{labels:n,prompt:r,draft:i,loading:a,approved:o,publishBusy:s,testBusy:c,templates:l,projects:u,projectId:d,conversationMode:f,notificationPolicy:p,onPromptChange:m,onGenerate:h,onEdit:g,onPublish:_,onTest:v,onProjectChange:y,onConversationModeChange:b,onNotificationPolicyChange:x,onApprovedChange:S,onDiscard:C,onTemplateSelect:w,onOpenAdvanced:D,projectLocked:ee}=e,O=s!==void 0&&s,k=c!==void 0&&c,A=ee!==void 0&&ee,j=!!(i&&i.simulation.requiredConfirmations.length>0),M;t[0]!==i||t[1]!==n.draft.advancedCreate||t[2]!==n.draft.suggestions||t[3]!==n.draft.suggestionsDescription||t[4]!==n.experience||t[5]!==D||t[6]!==w||t[7]!==l?(M=i?null:(0,$.jsxs)(`div`,{className:`mb-5 border-b border-edge-subtle pb-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.draft.suggestions}),(0,$.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n.draft.suggestionsDescription})]}),(0,$.jsx)(pe,{variant:`ghost`,onClick:D,children:n.draft.advancedCreate})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:l.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`focus-visible:ring-2 focus-visible:ring-accent rounded-lg border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>w(e),children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description}),(0,$.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.experience.source,`: `,e.source]})]},e.name))})]}),t[0]=i,t[1]=n.draft.advancedCreate,t[2]=n.draft.suggestions,t[3]=n.draft.suggestionsDescription,t[4]=n.experience,t[5]=D,t[6]=w,t[7]=l,t[8]=M):M=t[8];let N;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(ae,{className:`size-4 text-accent`}),t[9]=N):N=t[9];let te;t[10]===n.draft.title?te=t[11]:(te=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[N,n.draft.title]}),t[10]=n.draft.title,t[11]=te);let P;t[12]===n.draft.subtitle?P=t[13]:(P=(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=P);let F;t[14]!==te||t[15]!==P?(F=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[te,P]}),t[14]=te,t[15]=P,t[16]=F):F=t[16];let R;t[17]!==a||t[18]!==r?(R=a||!r.trim(),t[17]=a,t[18]=r,t[19]=R):R=t[19];let ne;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(ae,{className:`size-4`}),t[20]=ne):ne=t[20];let re=a?n.draft.generating:n.draft.generate,ie;t[21]!==h||t[22]!==re||t[23]!==R?(ie=(0,$.jsxs)(pe,{variant:`primary`,onClick:h,disabled:R,children:[ne,re]}),t[21]=h,t[22]=re,t[23]=R,t[24]=ie):ie=t[24];let oe;t[25]!==ie||t[26]!==F?(oe=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[F,ie]}),t[25]=ie,t[26]=F,t[27]=oe):oe=t[27];let se;t[28]===m?se=t[29]:(se=e=>m(e.target.value),t[28]=m,t[29]=se);let ce;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==se?(ce=(0,$.jsx)(`textarea`,{"aria-label":n.draft.title,className:`mt-4 min-h-20 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,value:r,onChange:se,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=se,t[34]=ce):ce=t[34];let le=A?`sm:grid-cols-2`:`sm:grid-cols-3`,B;t[35]===le?B=t[36]:(B=z(`mt-3 grid gap-3`,le),t[35]=le,t[36]=B);let V;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==y||t[40]!==d||t[41]!==A||t[42]!==u?(V=A?null:(0,$.jsx)(X,{label:n.draft.project,children:(0,$.jsxs)(T,{className:Ln,value:d,onChange:e=>y(e.target.value),children:[(0,$.jsx)(E,{value:``,children:n.draft.noProject}),u.map(gn)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=y,t[40]=d,t[41]=A,t[42]=u,t[43]=V):V=t[43];let H;t[44]===b?H=t[45]:(H=e=>b(e.target.value),t[44]=b,t[45]=H);let U;t[46]===n.draft.newConversation?U=t[47]:(U=(0,$.jsx)(E,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=U);let ue;t[48]===n.draft.continuousConversation?ue=t[49]:(ue=(0,$.jsx)(E,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=ue);let W;t[50]!==f||t[51]!==H||t[52]!==U||t[53]!==ue?(W=(0,$.jsxs)(T,{className:Ln,value:f,onChange:H,children:[U,ue]}),t[50]=f,t[51]=H,t[52]=U,t[53]=ue,t[54]=W):W=t[54];let de;t[55]!==n.draft.conversation||t[56]!==W?(de=(0,$.jsx)(X,{label:n.draft.conversation,children:W}),t[55]=n.draft.conversation,t[56]=W,t[57]=de):de=t[57];let G;t[58]===x?G=t[59]:(G=e=>x(e.target.value),t[58]=x,t[59]=G);let fe;t[60]===n.draft.notifyAttention?fe=t[61]:(fe=(0,$.jsx)(E,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=fe);let me;t[62]===n.draft.notifyAll?me=t[63]:(me=(0,$.jsx)(E,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=me);let K;t[64]===n.draft.notifyNone?K=t[65]:(K=(0,$.jsx)(E,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=K);let he;t[66]!==p||t[67]!==G||t[68]!==fe||t[69]!==me||t[70]!==K?(he=(0,$.jsxs)(T,{className:Ln,value:p,onChange:G,children:[fe,me,K]}),t[66]=p,t[67]=G,t[68]=fe,t[69]=me,t[70]=K,t[71]=he):he=t[71];let ge;t[72]!==n.draft.notifications||t[73]!==he?(ge=(0,$.jsx)(X,{label:n.draft.notifications,children:he}),t[72]=n.draft.notifications,t[73]=he,t[74]=ge):ge=t[74];let q;t[75]!==B||t[76]!==V||t[77]!==de||t[78]!==ge?(q=(0,$.jsxs)(`div`,{className:B,children:[V,de,ge]}),t[75]=B,t[76]=V,t[77]=de,t[78]=ge,t[79]=q):q=t[79];let _e;t[80]!==o||t[81]!==i||t[82]!==n.draft.approval||t[83]!==n.draft.assumptions||t[84]!==n.draft.discard||t[85]!==n.draft.edit||t[86]!==n.draft.publish||t[87]!==n.draft.review||t[88]!==n.draft.risks||t[89]!==n.draft.safety||t[90]!==n.draft.testOnce||t[91]!==n.draft.testing||t[92]!==n.feedback||t[93]!==n.info||t[94]!==n.none||t[95]!==S||t[96]!==C||t[97]!==g||t[98]!==_||t[99]!==v||t[100]!==O||t[101]!==j||t[102]!==k?(_e=i?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 rounded-lg bg-surface-base p-4 lg:grid-cols-[1fr_1fr]`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:i.automation.name}),i.automation.description?(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:i.automation.description}):null,(0,$.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,$.jsx)(Mn,{label:n.info.when,value:i.simulation.triggerSummary}),(0,$.jsx)(Mn,{label:n.info.run,value:i.simulation.actionSummary})]})]}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:n.draft.review}),(0,$.jsx)(_n,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,$.jsx)(_n,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,$.jsx)(_n,{title:n.draft.risks,items:i.risks,empty:n.none}),j?(0,$.jsxs)(`label`,{className:`mt-4 flex items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:o,onChange:e=>S(e.target.checked)}),(0,$.jsx)(`span`,{children:n.draft.approval})]}):null,(0,$.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,$.jsx)(pe,{variant:`ghost`,onClick:C,children:n.draft.discard}),(0,$.jsxs)(pe,{variant:`secondary`,onClick:g,children:[(0,$.jsx)(I,{className:`size-4`}),n.draft.edit]}),(0,$.jsxs)(pe,{variant:`secondary`,onClick:v,disabled:k||O||j&&!o,children:[(0,$.jsx)(L,{className:`size-4`}),k?n.draft.testing:n.draft.testOnce]}),(0,$.jsx)(pe,{variant:`primary`,onClick:_,disabled:O||j&&!o,children:O?n.feedback.working:n.draft.publish})]})]})]}):null,t[80]=o,t[81]=i,t[82]=n.draft.approval,t[83]=n.draft.assumptions,t[84]=n.draft.discard,t[85]=n.draft.edit,t[86]=n.draft.publish,t[87]=n.draft.review,t[88]=n.draft.risks,t[89]=n.draft.safety,t[90]=n.draft.testOnce,t[91]=n.draft.testing,t[92]=n.feedback,t[93]=n.info,t[94]=n.none,t[95]=S,t[96]=C,t[97]=g,t[98]=_,t[99]=v,t[100]=O,t[101]=j,t[102]=k,t[103]=_e):_e=t[103];let ve;return t[104]!==oe||t[105]!==ce||t[106]!==q||t[107]!==_e||t[108]!==M?(ve=(0,$.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[M,oe,ce,q,_e]}),t[104]=oe,t[105]=ce,t[106]=q,t[107]=_e,t[108]=M,t[109]=ve):ve=t[109],ve}function gn(e){return(0,$.jsx)(E,{value:e.id,children:e.name},e.id)}function _n(e){let t=(0,it.c)(10),{title:n,items:r,empty:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r?(o=r.length>0?r.map(vn):(0,$.jsx)(`li`,{className:`text-fg-muted`,children:i}),t[2]=i,t[3]=r,t[4]=o):o=t[4];let s;t[5]===o?s=t[6]:(s=(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm text-fg`,children:o}),t[5]=o,t[6]=s);let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`mt-3`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function vn(e){return(0,$.jsxs)(`li`,{children:[`- `,e]},e)}function yn(e){let t=(0,it.c)(25),{icon:n,label:r,value:i,tone:a,active:o,onClick:s}=e,c=a===void 0?`default`:a,l=c===`danger`?`text-red-600 dark:text-red-300`:`text-fg-subtle`,u;t[0]===l?u=t[1]:(u=z(`shrink-0`,l),t[0]=l,t[1]=u);let d;t[2]!==n||t[3]!==u?(d=(0,$.jsx)(`span`,{className:u,children:n}),t[2]=n,t[3]=u,t[4]=d):d=t[4];let f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`truncate text-xs font-medium text-fg-muted`,children:r}),t[5]=r,t[6]=f);let p=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,m;t[7]===p?m=t[8]:(m=z(`ml-auto truncate text-sm font-semibold tabular-nums`,p),t[7]=p,t[8]=m);let h;t[9]!==m||t[10]!==i?(h=(0,$.jsx)(`span`,{className:m,children:i}),t[9]=m,t[10]=i,t[11]=h):h=t[11];let g;t[12]!==d||t[13]!==f||t[14]!==h?(g=(0,$.jsxs)($.Fragment,{children:[d,f,h]}),t[12]=d,t[13]=f,t[14]=h,t[15]=g):g=t[15];let _=g,v=o&&`bg-accent/8`,y=s&&`cursor-pointer hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,b;t[16]!==v||t[17]!==y?(b=z(`flex min-h-12 min-w-0 items-center gap-2.5 bg-surface-base px-3 py-2.5 text-left transition-colors`,v,y),t[16]=v,t[17]=y,t[18]=b):b=t[18];let x=b,S=`${r}: ${i}`,C;return t[19]!==S||t[20]!==o||t[21]!==x||t[22]!==_||t[23]!==s?(C=s?(0,$.jsx)(`button`,{type:`button`,className:x,onClick:s,"aria-label":S,"aria-pressed":o,children:_}):(0,$.jsx)(`div`,{className:x,"aria-label":S,children:_}),t[19]=S,t[20]=o,t[21]=x,t[22]=_,t[23]=s,t[24]=C):C=t[24],C}function bn(e){let t=(0,it.c)(74),{runs:n,ownership:r,labels:i,language:a,unreadCount:o,loading:s,onOwnershipChange:c,onRefresh:l,onSelectRun:u}=e,d;t[0]===n?d=t[1]:(d=n.filter(rn),t[0]=n,t[1]=d);let f=d.length,p;t[2]===n?p=t[3]:(p=n.filter(an),t[2]=n,t[3]=p);let m=p.length,h;t[4]===i.dashboard.activity?h=t[5]:(h=(0,$.jsx)(`h2`,{id:`automation-activity-title`,className:`text-sm font-semibold text-fg`,children:i.dashboard.activity}),t[4]=i.dashboard.activity,t[5]=h);let g;t[6]===i.dashboard.activityDescription?g=t[7]:(g=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.dashboard.activityDescription}),t[6]=i.dashboard.activityDescription,t[7]=g);let _;t[8]!==h||t[9]!==g?(_=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[h,g]}),t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=i.filters.ownership,b=r===`user`&&`bg-surface-base text-fg shadow-sm`,x;t[11]===b?x=t[12]:(x=z(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,b),t[11]=b,t[12]=x);let S;t[13]===c?S=t[14]:(S=()=>c(`user`),t[13]=c,t[14]=S);let C=r===`user`,w;t[15]!==i.filters.userManaged||t[16]!==C||t[17]!==x||t[18]!==S?(w=(0,$.jsx)(`button`,{type:`button`,className:x,onClick:S,"aria-pressed":C,children:i.filters.userManaged}),t[15]=i.filters.userManaged,t[16]=C,t[17]=x,t[18]=S,t[19]=w):w=t[19];let T=r===`system`&&`bg-surface-base text-fg shadow-sm`,E;t[20]===T?E=t[21]:(E=z(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,T),t[20]=T,t[21]=E);let O;t[22]===c?O=t[23]:(O=()=>c(`system`),t[22]=c,t[23]=O);let k=r===`system`,A;t[24]!==i.system.title||t[25]!==E||t[26]!==O||t[27]!==k?(A=(0,$.jsx)(`button`,{type:`button`,className:E,onClick:O,"aria-pressed":k,children:i.system.title}),t[24]=i.system.title,t[25]=E,t[26]=O,t[27]=k,t[28]=A):A=t[28];let j;t[29]!==i.filters.ownership||t[30]!==w||t[31]!==A?(j=(0,$.jsxs)(K,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":v,indicatorClassName:`rounded-md bg-surface-base shadow-sm`,children:[w,A]}),t[29]=i.filters.ownership,t[30]=w,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==i.refresh||t[34]!==s||t[35]!==l?(M=(0,$.jsx)(he,{className:`size-9 shrink-0 p-0`,loading:s,label:i.refresh,onClick:l}),t[33]=i.refresh,t[34]=s,t[35]=l,t[36]=M):M=t[36];let N;t[37]!==j||t[38]!==M?(N=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[j,M]}),t[37]=j,t[38]=M,t[39]=N):N=t[39];let te;t[40]!==N||t[41]!==_?(te=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3 sm:px-5`,children:[_,N]}),t[40]=N,t[41]=_,t[42]=te):te=t[42];let P;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t[43]=P):P=t[43];let F=i.metrics.total,I=String(n.length),R;t[44]!==i.metrics.total||t[45]!==I?(R=(0,$.jsx)(yn,{icon:P,label:F,value:I}),t[44]=i.metrics.total,t[45]=I,t[46]=R):R=t[46];let ne;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(L,{className:`size-4`,"aria-hidden":!0}),t[47]=ne):ne=t[47];let re=i.metrics.running,ie=String(f),ae;t[48]!==i.metrics.running||t[49]!==ie?(ae=(0,$.jsx)(yn,{icon:ne,label:re,value:ie}),t[48]=i.metrics.running,t[49]=ie,t[50]=ae):ae=t[50];let oe;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[51]=oe):oe=t[51];let se=i.dashboard.needsAttention,ce=String(m),le=m>0?`danger`:`default`,B;t[52]!==i.dashboard.needsAttention||t[53]!==ce||t[54]!==le?(B=(0,$.jsx)(yn,{icon:oe,label:se,value:ce,tone:le}),t[52]=i.dashboard.needsAttention,t[53]=ce,t[54]=le,t[55]=B):B=t[55];let V;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[56]=V):V=t[56];let H=i.filters.unread,U=String(o),ue;t[57]!==i.filters.unread||t[58]!==U?(ue=(0,$.jsx)(yn,{icon:V,label:H,value:U}),t[57]=i.filters.unread,t[58]=U,t[59]=ue):ue=t[59];let W;t[60]!==R||t[61]!==ae||t[62]!==B||t[63]!==ue?(W=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-b border-edge-subtle bg-edge-subtle lg:grid-cols-4`,children:[R,ae,B,ue]}),t[60]=R,t[61]=ae,t[62]=B,t[63]=ue,t[64]=W):W=t[64];let de;t[65]!==i||t[66]!==a||t[67]!==u||t[68]!==n?(de=n.length===0?(0,$.jsx)(Nn,{className:`min-h-64 rounded-none border-0 shadow-none`,icon:(0,$.jsx)(y,{className:`size-5`}),title:i.empty.runs}):(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:n.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-3 px-4 py-3 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-5`,onClick:()=>u(e.id),children:[(0,$.jsx)(`span`,{className:z(`mt-1.5 size-2 shrink-0 rounded-full`,rn(e)?`bg-blue-500`:an(e)?`bg-red-500`:`bg-emerald-500`),"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.automationName}),e.readAtMs==null&&!rn(e)?(0,$.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,$.jsx)(`span`,{className:z(`mt-1 line-clamp-2 block text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||i.status[e.status]}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:Zt(e.createdAtMs,i,a)})]}),(0,$.jsx)(`span`,{className:z(`shrink-0 rounded-full px-2 py-0.5 text-xs`,tn(e.status)),children:i.status[e.status]})]},e.id))}),t[65]=i,t[66]=a,t[67]=u,t[68]=n,t[69]=de):de=t[69];let G;return t[70]!==te||t[71]!==W||t[72]!==de?(G=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,"aria-labelledby":`automation-activity-title`,children:[te,W,de]}),t[70]=te,t[71]=W,t[72]=de,t[73]=G):G=t[73],G}function xn(e,t){let n=t.events,r=e.data&&typeof e.data==`object`?e.data:{},i=typeof r.actionKind==`string`?r.actionKind:null,a=typeof r.status==`string`&&r.status in t.status?t.status[r.status]:null;switch(e.type){case`run.queued`:return e.message.toLowerCase().includes(`manual`)?n.manualQueued:e.message.toLowerCase().includes(`scheduled`)?n.scheduledQueued:n.eventQueued;case`run.started`:return n.runStarted;case`action.started`:return i?n.actionStarted.replace(`{kind}`,i):n.actionStartedFallback;case`action.completed`:return i?n.actionCompleted.replace(`{kind}`,i):n.actionCompletedFallback;case`action.failed`:return i?n.actionFailed.replace(`{kind}`,i):n.actionFailedFallback;case`run.completed`:return a?n.runCompleted.replace(`{status}`,a):n.runCompletedFallback;default:return e.message}}function Sn(e){let t=(0,it.c)(17),{value:n,labels:r,title:i,defaultExpanded:a}=e,[o,s]=(0,Q.useState)(a!==void 0&&a),c;t[0]===n?c=t[1]:(c=JSON.stringify(n,null,2),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=l.split(`
|
|
5
5
|
`),t[2]=l,t[3]=u);let d=u.length,f=l.length>720||d>18,p;t[4]!==f||t[5]!==l?(p=f?`${l.split(`
|
package/dist/gateway/static/root/assets/{binary-plugins-B-dkI6-B.js → binary-plugins-CuwSdCG5.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/attachment-preview-renderer-DdOEgexg.js","assets/preload-helper-Czpn1I53.js","assets/pdf-runtime-JnUAvfIa.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
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"./preload-helper-Czpn1I53.js";import{t as a}from"./messages-9OwWjlww.js";import{a as o,t as s}from"./attachment-utils-core-BIOUBrpT.js";import{t as c}from"./preview-open-alternatives-CY_hjK4b.js";import{t as l}from"./use-blob-object-url-D4BFuzZB.js";var u=e(t(),1),d=n();function f(e){let t=e.trim(),n=t.match(/^<pptx\s+filename="([^"]*)">\s*/),r=t;n&&(r=t.slice(n[0].length),r=r.replace(/\s*<\/pptx>\s*$/u,``).trim());let i=[],a=/<slide number="(\d+)">([\s\S]*?)<\/slide>/gu,o;for(;(o=a.exec(r))!==null;){let e=Number.parseInt(o[1],10),t=o[2].trim();i.push({slideNumber:e,text:t})}let s=[],c=/<!--([\s\S]*?)-->/gu,l;for(;(l=c.exec(r))!==null;)s.push(l[1].trim());return i.length===0?{ok:!1,raw:e}:{ok:!0,slides:i,notes:s}}var p=r();function m(e){let t=(0,d.c)(13),{text:n,slideLabel:r,emptySlideLabel:i}=e,a;t[0]===n?a=t[1]:(a=f(n),t[0]=n,t[1]=a);let o=a;if(!o.ok){let e;return t[2]===o.raw?e=t[3]:(e=(0,p.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg`,children:o.raw}),t[2]=o.raw,t[3]=e),e}let s;if(t[4]!==i||t[5]!==o.notes||t[6]!==o.slides||t[7]!==r){let e=[];if(o.notes.length>0){let n;t[9]===o.notes?n=t[10]:(n=o.notes.map(h),t[9]=o.notes,t[10]=n);let r;t[11]===n?r=t[12]:(r=(0,p.jsx)(`div`,{className:`mb-2 border-b border-edge-subtle pb-2 dark:border-edge`,role:`status`,children:n},`notes`),t[11]=n,t[12]=r),e.push(r)}for(let t of o.slides)e.push((0,p.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-panel p-3 dark:border-edge`,children:[(0,p.jsx)(`h3`,{className:`mb-2 text-sm font-semibold text-fg`,children:r(t.slideNumber)}),(0,p.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-fg`,children:t.text.length>0?t.text:i})]},t.slideNumber));s=(0,p.jsx)(`div`,{className:`flex flex-col gap-3`,children:e}),t[4]=i,t[5]=o.notes,t[6]=o.slides,t[7]=r,t[8]=s}else s=t[8];return s}function h(e){return(0,p.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e},e)}function g(e,t){return t===`pdf`?a(e).chat.attachmentPreviewPdfRendering:e===`zh`?t===`excel`?`正在加载电子表格…`:`正在加载文档…`:t===`excel`?`Loading spreadsheet...`:`Loading document...`}function _(e,t){e.innerHTML=``;let n=document.createElement(`p`);n.className=`p-4 text-sm text-fg-muted`,n.textContent=t,e.appendChild(n)}function v({language:e,buffer:t,kind:n,fileKey:r,containerEl:o,onPdfPageCount:s}){let[c,l]=(0,u.useState)(null),[d,f]=(0,u.useState)(!1);return(0,u.useLayoutEffect)(()=>{if(l(null),f(!1),!t||!n||!o||!r)return;let c=!1,u,d=document.createElement(`div`);d.className=`flex min-h-0 flex-1 flex-col overflow-auto`,o.replaceChildren(d),_(d,g(e,n));let p=e=>{c?e():u=e};return(async()=>{try{let r=await i(()=>import(`./attachment-preview-renderer-DdOEgexg.js`),__vite__mapDeps([0,1,2]));if(c)return;let o=a(e).chat;if(n===`pdf`){let{cleanup:e}=await r.renderPdfInContainer(d,t,{loadingText:o.attachmentPreviewPdfRendering,loadMoreHint:o.attachmentPreviewPdfLoadMore,onPageCount:e=>{c||s?.(e)}});p(e)}else if(n===`excel`){let{cleanup:e,truncated:n}=await r.renderExcelInContainer(d,t,{truncationNotice:o.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)});p(e),c||f(n)}else if(n===`docx`){let{cleanup:e}=await r.renderDocxInContainer(d,t);p(e)}}catch(e){c||l(e instanceof Error?e.message:String(e))}})(),()=>{c=!0,u?.(),d.remove()}},[t,n,o,r,e,s]),{error:c,excelTruncated:d}}function y(e){let t=(0,d.c)(12),{props:n,message:r}=e,i;t[0]===n.language?i=t[1]:(i=a(n.language),t[0]=n.language,t[1]=i);let o=i,s=n.descriptor.context===`workspace`,l=!!n.actions.onOpenWithSystemApp&&(n.actions.canOpenWithSystemApp??!0)&&s,u=s?o.workspace.openSystemApp:void 0,f=s?o.workspace.chooseApp:void 0,m;return t[2]!==o.chat.attachmentPreviewDownloadFull||t[3]!==r||t[4]!==n.actions.canChooseOpenWithApp||t[5]!==n.actions.onChooseOpenWithApp||t[6]!==n.actions.onDownload||t[7]!==n.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==f?(m=(0,p.jsx)(c,{message:r,downloadLabel:o.chat.attachmentPreviewDownloadFull,onDownload:n.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:n.actions.onOpenWithSystemApp,canOpenWithSystemApp:l,chooseAppLabel:f,onChooseOpenWithApp:n.actions.onChooseOpenWithApp,canChooseOpenWithApp:n.actions.canChooseOpenWithApp}),t[2]=o.chat.attachmentPreviewDownloadFull,t[3]=r,t[4]=n.actions.canChooseOpenWithApp,t[5]=n.actions.onChooseOpenWithApp,t[6]=n.actions.onDownload,t[7]=n.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function b(e){let t=a(e.language);return e.descriptor.context===`workspace`?t.workspace.openElsewhereHint:t.chat.attachmentPreviewOpenElsewhereHint}function x(e){let t=(0,d.c)(28),n;bb0:{if(!e.binaryBuffer){n=null;break bb0}let r;if(t[0]!==e.binaryBuffer||t[1]!==e.descriptor.fileName||t[2]!==e.descriptor.mimeType){let n=o(e.descriptor.fileName)??e.descriptor.mimeType??`image/png`;r=new Blob([e.binaryBuffer],{type:n}),t[0]=e.binaryBuffer,t[1]=e.descriptor.fileName,t[2]=e.descriptor.mimeType,t[3]=r}else r=t[3];n=r}let r=l(n),i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i={x:0,y:0},t[4]=i):i=t[4];let[a,s]=(0,u.useState)(i),c=(0,u.useRef)(null),f=(0,u.useRef)(null),m=e.controls?.zoom??1,h=e.controls?.rotation??0,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s({x:0,y:0})},t[5]=g):g=t[5];let _;if(t[6]!==e.descriptor.id||t[7]!==h?(_=[e.descriptor.id,h],t[6]=e.descriptor.id,t[7]=h,t[8]=_):_=t[8],(0,u.useEffect)(g,_),!r)return null;let v;t[9]!==a.x||t[10]!==a.y||t[11]!==e.onImageSwipe||t[12]!==m?(v=t=>{if(!t.isPrimary){c.current=null;return}t.button===0&&(c.current={pointerId:t.pointerId,x:t.clientX,y:t.clientY,ox:a.x,oy:a.y,swipe:t.pointerType===`touch`&&m<=1&&!!e.onImageSwipe},t.currentTarget.setPointerCapture(t.pointerId))},t[9]=a.x,t[10]=a.y,t[11]=e.onImageSwipe,t[12]=m,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||t.swipe||s({x:t.ox+e.clientX-t.x,y:t.oy+e.clientY-t.y})},t[14]=y):y=t[14];let b;t[15]===e?b=t[16]:(b=t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId)return;c.current=null;let r=t.clientX-n.x,i=t.clientY-n.y;n.swipe&&Math.abs(r)>=50&&Math.abs(r)>Math.abs(i)*1.5&&e.onImageSwipe?.(r<0?`next`:`previous`)},t[15]=e,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{c.current?.pointerId===e.pointerId&&(c.current=null)},t[17]=x):x=t[17];let S=`translate(${a.x}px, ${a.y}px) scale(${m}) rotate(${h}deg)`,C=m>1?`grab`:`default`,w;t[18]!==S||t[19]!==C?(w={transform:S,cursor:C},t[18]=S,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==r||t[22]!==w?(T=(0,p.jsx)(`img`,{src:r,alt:``,draggable:!1,className:`max-h-full max-w-full select-none object-contain transition-transform duration-100`,style:w}),t[21]=r,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==T||t[25]!==v||t[26]!==b?(E=(0,p.jsx)(`div`,{ref:f,className:`flex min-h-0 flex-1 touch-none items-center justify-center overflow-hidden bg-surface-base px-3 py-4 dark:bg-surface-hover/20`,onPointerDown:v,onPointerMove:y,onPointerUp:b,onPointerCancel:x,children:T}),t[24]=T,t[25]=v,t[26]=b,t[27]=E):E=t[27],E}function S(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`pdf`}),t[0]=e,t[1]=n),n}function C(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`docx`}),t[0]=e,t[1]=n),n}function w(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`excel`}),t[0]=e,t[1]=n),n}function T(e){let t=(0,d.c)(22),n=(0,u.useRef)(null),[r,i]=(0,u.useState)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{n.current=e,i(e)},t[0]=o):o=t[0];let s=o,c=e.kind===`pdf`?e.controls?.setPageCount:void 0,l;t[1]!==r||t[2]!==e.binaryBuffer||t[3]!==e.descriptor.id||t[4]!==e.kind||t[5]!==e.language||t[6]!==c?(l={language:e.language,buffer:e.binaryBuffer,kind:e.kind,fileKey:e.descriptor.id,containerEl:r,onPdfPageCount:c},t[1]=r,t[2]=e.binaryBuffer,t[3]=e.descriptor.id,t[4]=e.kind,t[5]=e.language,t[6]=c,t[7]=l):l=t[7];let{error:f,excelTruncated:m}=v(l),h=a(e.language),g=e.kind===`pdf`?e.controls?.zoom??1:1,_=e.kind===`pdf`?e.controls?.rotation??0:0,x=e.kind===`pdf`?e.controls?.page??1:1,S,C;t[8]!==e.kind||t[9]!==_||t[10]!==g?(S=()=>{e.kind!==`pdf`||!n.current||(n.current.style.setProperty(`--xopc-preview-pdf-zoom`,String(g)),n.current.style.setProperty(`--xopc-preview-pdf-rotation`,`${_}deg`),n.current.querySelectorAll(`[data-pdf-page]`).forEach(e=>{let t=e.dataset.pdfBaseHeight??(e.offsetHeight>0?String(e.offsetHeight):void 0);t&&(e.dataset.pdfBaseHeight=t,e.style.height=`${Number(t)*g}px`),e.style.transformOrigin=`top center`,e.style.transform=`scale(${g}) rotate(${_}deg)`,e.style.marginBottom=g===1?``:`${Math.max(16,24*g)}px`}))},C=[e.kind,_,g],t[8]=e.kind,t[9]=_,t[10]=g,t[11]=S,t[12]=C):(S=t[11],C=t[12]),(0,u.useEffect)(S,C);let w,T;t[13]!==x||t[14]!==e.kind?(w=()=>{e.kind!==`pdf`||!n.current||n.current.querySelector(`[data-pdf-page="${x}"]`)?.scrollIntoView({block:`start`})},T=[x,e.kind],t[13]=x,t[14]=e.kind,t[15]=w,t[16]=T):(w=t[15],T=t[16]),(0,u.useEffect)(w,T);let E=f?(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[(0,p.jsx)(y,{props:e,message:b(e)}),(0,p.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600 dark:text-red-400`,children:f})]}):e.kind===`excel`&&m?(0,p.jsx)(y,{props:e,message:h.chat.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)}):null,D=`${f?`hidden`:`flex`} docx-preview-host min-h-0 flex-1 flex-col overflow-auto rounded-lg border border-edge-subtle bg-surface-panel p-2 dark:border-edge`,O;t[17]===D?O=t[18]:(O=(0,p.jsx)(`div`,{ref:s,className:D}),t[17]=D,t[18]=O);let k;return t[19]!==O||t[20]!==E?(k=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:[E,O]}),t[19]=O,t[20]=E,t[21]=k):k=t[21],k}function E(e){let t=(0,d.c)(23),n;t[0]===e.language?n=t[1]:(n=a(e.language),t[0]=e.language,t[1]=n);let r=n,i=e.extractedText||r.chat.attachmentPreviewNoText,o=!!e.extractedTextTruncated||i.length>3e5,c;t[2]===i?c=t[3]:(c=i.length>3e5?i.slice(0,s):i,t[2]=i,t[3]=c);let l=c,u;t[4]!==r.chat.attachmentPreviewOpenElsewhereTruncated||t[5]!==e||t[6]!==o?(u=o?(0,p.jsx)(y,{props:e,message:r.chat.attachmentPreviewOpenElsewhereTruncated}):null,t[4]=r.chat.attachmentPreviewOpenElsewhereTruncated,t[5]=e,t[6]=o,t[7]=u):u=t[7];let f;t[8]!==r.chat.attachmentPreviewPptxTruncated||t[9]!==o?(f=o?(0,p.jsx)(`p`,{className:`mb-2 border-b border-edge-subtle pb-2 text-xs text-fg-muted dark:border-edge`,children:r.chat.attachmentPreviewPptxTruncated}):null,t[8]=r.chat.attachmentPreviewPptxTruncated,t[9]=o,t[10]=f):f=t[10];let h;t[11]===r.chat.attachmentPreviewPptxSlide?h=t[12]:(h=e=>r.chat.attachmentPreviewPptxSlide.replaceAll(`{n}`,String(e)),t[11]=r.chat.attachmentPreviewPptxSlide,t[12]=h);let g;t[13]!==r.chat.attachmentPreviewPptxEmptySlide||t[14]!==h||t[15]!==l?(g=(0,p.jsx)(m,{text:l,slideLabel:h,emptySlideLabel:r.chat.attachmentPreviewPptxEmptySlide}),t[13]=r.chat.attachmentPreviewPptxEmptySlide,t[14]=h,t[15]=l,t[16]=g):g=t[16];let _;t[17]!==f||t[18]!==g?(_=(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[f,g]}),t[17]=f,t[18]=g,t[19]=_):_=t[19];let v;return t[20]!==u||t[21]!==_?(v=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:[u,_]}),t[20]=u,t[21]=_,t[22]=v):v=t[22],v}export{C as DocxPreviewPluginView,x as InteractiveImagePreview,S as PdfPreviewPluginView,E as PptxPreviewPluginView,w as SpreadsheetPreviewPluginView};
|
|
2
|
+
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"./preload-helper-Czpn1I53.js";import{t as a}from"./messages-jwdBhfL9.js";import{a as o,t as s}from"./attachment-utils-core-BIOUBrpT.js";import{t as c}from"./preview-open-alternatives-CY_hjK4b.js";import{t as l}from"./use-blob-object-url-D4BFuzZB.js";var u=e(t(),1),d=n();function f(e){let t=e.trim(),n=t.match(/^<pptx\s+filename="([^"]*)">\s*/),r=t;n&&(r=t.slice(n[0].length),r=r.replace(/\s*<\/pptx>\s*$/u,``).trim());let i=[],a=/<slide number="(\d+)">([\s\S]*?)<\/slide>/gu,o;for(;(o=a.exec(r))!==null;){let e=Number.parseInt(o[1],10),t=o[2].trim();i.push({slideNumber:e,text:t})}let s=[],c=/<!--([\s\S]*?)-->/gu,l;for(;(l=c.exec(r))!==null;)s.push(l[1].trim());return i.length===0?{ok:!1,raw:e}:{ok:!0,slides:i,notes:s}}var p=r();function m(e){let t=(0,d.c)(13),{text:n,slideLabel:r,emptySlideLabel:i}=e,a;t[0]===n?a=t[1]:(a=f(n),t[0]=n,t[1]=a);let o=a;if(!o.ok){let e;return t[2]===o.raw?e=t[3]:(e=(0,p.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg`,children:o.raw}),t[2]=o.raw,t[3]=e),e}let s;if(t[4]!==i||t[5]!==o.notes||t[6]!==o.slides||t[7]!==r){let e=[];if(o.notes.length>0){let n;t[9]===o.notes?n=t[10]:(n=o.notes.map(h),t[9]=o.notes,t[10]=n);let r;t[11]===n?r=t[12]:(r=(0,p.jsx)(`div`,{className:`mb-2 border-b border-edge-subtle pb-2 dark:border-edge`,role:`status`,children:n},`notes`),t[11]=n,t[12]=r),e.push(r)}for(let t of o.slides)e.push((0,p.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-panel p-3 dark:border-edge`,children:[(0,p.jsx)(`h3`,{className:`mb-2 text-sm font-semibold text-fg`,children:r(t.slideNumber)}),(0,p.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-fg`,children:t.text.length>0?t.text:i})]},t.slideNumber));s=(0,p.jsx)(`div`,{className:`flex flex-col gap-3`,children:e}),t[4]=i,t[5]=o.notes,t[6]=o.slides,t[7]=r,t[8]=s}else s=t[8];return s}function h(e){return(0,p.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e},e)}function g(e,t){return t===`pdf`?a(e).chat.attachmentPreviewPdfRendering:e===`zh`?t===`excel`?`正在加载电子表格…`:`正在加载文档…`:t===`excel`?`Loading spreadsheet...`:`Loading document...`}function _(e,t){e.innerHTML=``;let n=document.createElement(`p`);n.className=`p-4 text-sm text-fg-muted`,n.textContent=t,e.appendChild(n)}function v({language:e,buffer:t,kind:n,fileKey:r,containerEl:o,onPdfPageCount:s}){let[c,l]=(0,u.useState)(null),[d,f]=(0,u.useState)(!1);return(0,u.useLayoutEffect)(()=>{if(l(null),f(!1),!t||!n||!o||!r)return;let c=!1,u,d=document.createElement(`div`);d.className=`flex min-h-0 flex-1 flex-col overflow-auto`,o.replaceChildren(d),_(d,g(e,n));let p=e=>{c?e():u=e};return(async()=>{try{let r=await i(()=>import(`./attachment-preview-renderer-DdOEgexg.js`),__vite__mapDeps([0,1,2]));if(c)return;let o=a(e).chat;if(n===`pdf`){let{cleanup:e}=await r.renderPdfInContainer(d,t,{loadingText:o.attachmentPreviewPdfRendering,loadMoreHint:o.attachmentPreviewPdfLoadMore,onPageCount:e=>{c||s?.(e)}});p(e)}else if(n===`excel`){let{cleanup:e,truncated:n}=await r.renderExcelInContainer(d,t,{truncationNotice:o.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)});p(e),c||f(n)}else if(n===`docx`){let{cleanup:e}=await r.renderDocxInContainer(d,t);p(e)}}catch(e){c||l(e instanceof Error?e.message:String(e))}})(),()=>{c=!0,u?.(),d.remove()}},[t,n,o,r,e,s]),{error:c,excelTruncated:d}}function y(e){let t=(0,d.c)(12),{props:n,message:r}=e,i;t[0]===n.language?i=t[1]:(i=a(n.language),t[0]=n.language,t[1]=i);let o=i,s=n.descriptor.context===`workspace`,l=!!n.actions.onOpenWithSystemApp&&(n.actions.canOpenWithSystemApp??!0)&&s,u=s?o.workspace.openSystemApp:void 0,f=s?o.workspace.chooseApp:void 0,m;return t[2]!==o.chat.attachmentPreviewDownloadFull||t[3]!==r||t[4]!==n.actions.canChooseOpenWithApp||t[5]!==n.actions.onChooseOpenWithApp||t[6]!==n.actions.onDownload||t[7]!==n.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==f?(m=(0,p.jsx)(c,{message:r,downloadLabel:o.chat.attachmentPreviewDownloadFull,onDownload:n.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:n.actions.onOpenWithSystemApp,canOpenWithSystemApp:l,chooseAppLabel:f,onChooseOpenWithApp:n.actions.onChooseOpenWithApp,canChooseOpenWithApp:n.actions.canChooseOpenWithApp}),t[2]=o.chat.attachmentPreviewDownloadFull,t[3]=r,t[4]=n.actions.canChooseOpenWithApp,t[5]=n.actions.onChooseOpenWithApp,t[6]=n.actions.onDownload,t[7]=n.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function b(e){let t=a(e.language);return e.descriptor.context===`workspace`?t.workspace.openElsewhereHint:t.chat.attachmentPreviewOpenElsewhereHint}function x(e){let t=(0,d.c)(28),n;bb0:{if(!e.binaryBuffer){n=null;break bb0}let r;if(t[0]!==e.binaryBuffer||t[1]!==e.descriptor.fileName||t[2]!==e.descriptor.mimeType){let n=o(e.descriptor.fileName)??e.descriptor.mimeType??`image/png`;r=new Blob([e.binaryBuffer],{type:n}),t[0]=e.binaryBuffer,t[1]=e.descriptor.fileName,t[2]=e.descriptor.mimeType,t[3]=r}else r=t[3];n=r}let r=l(n),i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i={x:0,y:0},t[4]=i):i=t[4];let[a,s]=(0,u.useState)(i),c=(0,u.useRef)(null),f=(0,u.useRef)(null),m=e.controls?.zoom??1,h=e.controls?.rotation??0,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s({x:0,y:0})},t[5]=g):g=t[5];let _;if(t[6]!==e.descriptor.id||t[7]!==h?(_=[e.descriptor.id,h],t[6]=e.descriptor.id,t[7]=h,t[8]=_):_=t[8],(0,u.useEffect)(g,_),!r)return null;let v;t[9]!==a.x||t[10]!==a.y||t[11]!==e.onImageSwipe||t[12]!==m?(v=t=>{if(!t.isPrimary){c.current=null;return}t.button===0&&(c.current={pointerId:t.pointerId,x:t.clientX,y:t.clientY,ox:a.x,oy:a.y,swipe:t.pointerType===`touch`&&m<=1&&!!e.onImageSwipe},t.currentTarget.setPointerCapture(t.pointerId))},t[9]=a.x,t[10]=a.y,t[11]=e.onImageSwipe,t[12]=m,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||t.swipe||s({x:t.ox+e.clientX-t.x,y:t.oy+e.clientY-t.y})},t[14]=y):y=t[14];let b;t[15]===e?b=t[16]:(b=t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId)return;c.current=null;let r=t.clientX-n.x,i=t.clientY-n.y;n.swipe&&Math.abs(r)>=50&&Math.abs(r)>Math.abs(i)*1.5&&e.onImageSwipe?.(r<0?`next`:`previous`)},t[15]=e,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{c.current?.pointerId===e.pointerId&&(c.current=null)},t[17]=x):x=t[17];let S=`translate(${a.x}px, ${a.y}px) scale(${m}) rotate(${h}deg)`,C=m>1?`grab`:`default`,w;t[18]!==S||t[19]!==C?(w={transform:S,cursor:C},t[18]=S,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==r||t[22]!==w?(T=(0,p.jsx)(`img`,{src:r,alt:``,draggable:!1,className:`max-h-full max-w-full select-none object-contain transition-transform duration-100`,style:w}),t[21]=r,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==T||t[25]!==v||t[26]!==b?(E=(0,p.jsx)(`div`,{ref:f,className:`flex min-h-0 flex-1 touch-none items-center justify-center overflow-hidden bg-surface-base px-3 py-4 dark:bg-surface-hover/20`,onPointerDown:v,onPointerMove:y,onPointerUp:b,onPointerCancel:x,children:T}),t[24]=T,t[25]=v,t[26]=b,t[27]=E):E=t[27],E}function S(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`pdf`}),t[0]=e,t[1]=n),n}function C(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`docx`}),t[0]=e,t[1]=n),n}function w(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`excel`}),t[0]=e,t[1]=n),n}function T(e){let t=(0,d.c)(22),n=(0,u.useRef)(null),[r,i]=(0,u.useState)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{n.current=e,i(e)},t[0]=o):o=t[0];let s=o,c=e.kind===`pdf`?e.controls?.setPageCount:void 0,l;t[1]!==r||t[2]!==e.binaryBuffer||t[3]!==e.descriptor.id||t[4]!==e.kind||t[5]!==e.language||t[6]!==c?(l={language:e.language,buffer:e.binaryBuffer,kind:e.kind,fileKey:e.descriptor.id,containerEl:r,onPdfPageCount:c},t[1]=r,t[2]=e.binaryBuffer,t[3]=e.descriptor.id,t[4]=e.kind,t[5]=e.language,t[6]=c,t[7]=l):l=t[7];let{error:f,excelTruncated:m}=v(l),h=a(e.language),g=e.kind===`pdf`?e.controls?.zoom??1:1,_=e.kind===`pdf`?e.controls?.rotation??0:0,x=e.kind===`pdf`?e.controls?.page??1:1,S,C;t[8]!==e.kind||t[9]!==_||t[10]!==g?(S=()=>{e.kind!==`pdf`||!n.current||(n.current.style.setProperty(`--xopc-preview-pdf-zoom`,String(g)),n.current.style.setProperty(`--xopc-preview-pdf-rotation`,`${_}deg`),n.current.querySelectorAll(`[data-pdf-page]`).forEach(e=>{let t=e.dataset.pdfBaseHeight??(e.offsetHeight>0?String(e.offsetHeight):void 0);t&&(e.dataset.pdfBaseHeight=t,e.style.height=`${Number(t)*g}px`),e.style.transformOrigin=`top center`,e.style.transform=`scale(${g}) rotate(${_}deg)`,e.style.marginBottom=g===1?``:`${Math.max(16,24*g)}px`}))},C=[e.kind,_,g],t[8]=e.kind,t[9]=_,t[10]=g,t[11]=S,t[12]=C):(S=t[11],C=t[12]),(0,u.useEffect)(S,C);let w,T;t[13]!==x||t[14]!==e.kind?(w=()=>{e.kind!==`pdf`||!n.current||n.current.querySelector(`[data-pdf-page="${x}"]`)?.scrollIntoView({block:`start`})},T=[x,e.kind],t[13]=x,t[14]=e.kind,t[15]=w,t[16]=T):(w=t[15],T=t[16]),(0,u.useEffect)(w,T);let E=f?(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[(0,p.jsx)(y,{props:e,message:b(e)}),(0,p.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600 dark:text-red-400`,children:f})]}):e.kind===`excel`&&m?(0,p.jsx)(y,{props:e,message:h.chat.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)}):null,D=`${f?`hidden`:`flex`} docx-preview-host min-h-0 flex-1 flex-col overflow-auto rounded-lg border border-edge-subtle bg-surface-panel p-2 dark:border-edge`,O;t[17]===D?O=t[18]:(O=(0,p.jsx)(`div`,{ref:s,className:D}),t[17]=D,t[18]=O);let k;return t[19]!==O||t[20]!==E?(k=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:[E,O]}),t[19]=O,t[20]=E,t[21]=k):k=t[21],k}function E(e){let t=(0,d.c)(23),n;t[0]===e.language?n=t[1]:(n=a(e.language),t[0]=e.language,t[1]=n);let r=n,i=e.extractedText||r.chat.attachmentPreviewNoText,o=!!e.extractedTextTruncated||i.length>3e5,c;t[2]===i?c=t[3]:(c=i.length>3e5?i.slice(0,s):i,t[2]=i,t[3]=c);let l=c,u;t[4]!==r.chat.attachmentPreviewOpenElsewhereTruncated||t[5]!==e||t[6]!==o?(u=o?(0,p.jsx)(y,{props:e,message:r.chat.attachmentPreviewOpenElsewhereTruncated}):null,t[4]=r.chat.attachmentPreviewOpenElsewhereTruncated,t[5]=e,t[6]=o,t[7]=u):u=t[7];let f;t[8]!==r.chat.attachmentPreviewPptxTruncated||t[9]!==o?(f=o?(0,p.jsx)(`p`,{className:`mb-2 border-b border-edge-subtle pb-2 text-xs text-fg-muted dark:border-edge`,children:r.chat.attachmentPreviewPptxTruncated}):null,t[8]=r.chat.attachmentPreviewPptxTruncated,t[9]=o,t[10]=f):f=t[10];let h;t[11]===r.chat.attachmentPreviewPptxSlide?h=t[12]:(h=e=>r.chat.attachmentPreviewPptxSlide.replaceAll(`{n}`,String(e)),t[11]=r.chat.attachmentPreviewPptxSlide,t[12]=h);let g;t[13]!==r.chat.attachmentPreviewPptxEmptySlide||t[14]!==h||t[15]!==l?(g=(0,p.jsx)(m,{text:l,slideLabel:h,emptySlideLabel:r.chat.attachmentPreviewPptxEmptySlide}),t[13]=r.chat.attachmentPreviewPptxEmptySlide,t[14]=h,t[15]=l,t[16]=g):g=t[16];let _;t[17]!==f||t[18]!==g?(_=(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[f,g]}),t[17]=f,t[18]=g,t[19]=_):_=t[19];let v;return t[20]!==u||t[21]!==_?(v=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:[u,_]}),t[20]=u,t[21]=_,t[22]=v):v=t[22],v}export{C as DocxPreviewPluginView,x as InteractiveImagePreview,S as PdfPreviewPluginView,E as PptxPreviewPluginView,w as SpreadsheetPreviewPluginView};
|