@xopcai/xopc 0.0.424 → 0.0.425
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/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-AI081rxe.js → activity-store-CMw8qBuC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DupnTbL7.js → agent-avatar-dicebear-JI0YWOIm.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-CmEj6Uqy.js → agent-avatar-display-YqmwzOSa.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-IEV5yKuu.js → agent-defaults-settings-panel-DlvjxWg6.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-D_njOuFA.js → agent-plugin-dialog-OBueuQSc.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-B_yg9nA3.js → agents-Cp6_5OOQ.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-CUZUolwG.js → agents-admin-api-DLnmdC1h.js} +1 -1
- package/dist/gateway/static/root/assets/{api-bpQ7yR10.js → api-Boc-CVh7.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CWWEVThO.js → api-bL7sxjAF.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C0_hxwgg.js → app-management-settings-panel-jIG5i7KE.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CLh-qnCC.js → appearance-settings-BnaQW9Xd.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Bjtm3Rgi.js → apps-page-C2WKUwtN.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-dGnstkhB.js → archive-plugin-DjboG3kA.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-MB2xCoFF.js → automation-api-CZqL9l_d.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-DJQflY78.js → automation-result-state-DRd-X_Ai.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-DXgBxVE2.js → automation-task-card-wbnR5i6N.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D3O7M2FH.js → automations-page-HyBQIfmn.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-Dk3FVWoX.js → automations-workspace-D6cTOKr7.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-BrVJXmYf.js → binary-plugins-Bg8ARZUH.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Dok4sfT3.js → block-editor-DKohqFAW.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-PJbT3CxW.js → browser-automation-inputs-YeibTzw4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-kkpX1Q7K.js → browser-automations-page-BWNcbuz2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-Bg4wnkeA.js → browser-control-api-CDeuxy2x.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BrgX_Yb2.js → browser-settings-page-L0nBjfhG.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Cs6Jt5Gl.js → capabilities-BcQa8c9n.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BMaJizw4.js → capabilities-aT-QjNTl.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-D5hvAG6D.js → capabilities-page-DlpuHdHi.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BrEvm4IH.js → capabilities-settings-panel-pvqkN2-2.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-1jQgGVc9.js → channels-BUPtawh6.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BAOWaUJf.js → chat-agents-api-B8JO6Tcj.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DeWrb9XR.js → chat-chart-block-DRtuFfF1.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-CafkCKOj.js → chat-page-BP0huA-W.js} +31 -31
- package/dist/gateway/static/root/assets/{chat-terminal-dock-C544n0-R.js → chat-terminal-dock-Dkqq5FSL.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-D9PXzY8b.js → command-palette-api-qujvNqkK.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CYXfjpem.js → composer-payload-handoff-CYIhcczq.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DJmod8-w.js → computer-settings-page-8q4hRmoo.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-b46VH4uy.js → connected-providers-grid-CKZfhHSD.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BqDbTOTp.js → connector-service-page-DQaTI21R.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CwRuUnH4.js → connectors-api-BjypBp2g.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Mq9Bvoax.js → connectors-page-Lf1ZzaVn.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DWaT0IC0.js → date-picker-D_PSHGpe.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DV9XAt6F.js → dependency-picker-UqKVJ9dv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Dffq2NxL.js → desktop-pet-1Et9VqkM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-CS8qJpNO.js → desktop-pet-narrative-rADKU0FX.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CrB1ICax.js → desktop-pet-settings-0fCGgaG7.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-liRgSkcT.js → dev-view-store-TTj_djD8.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-ByEL5lvM.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-EKqQLQrE.js → directory-picker-path-field-C07a7wYX.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-D-b1X6ro.js → discussion-annotation-sync-BFqKm9ky.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-wD97GeG0.js → extension-debug-page-DFaVlqas.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-B4Q1CjvW.js → extension-iframe-host-BfzPfXBq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-ak1_K3u8.js → extension-marketplace-api-ow0K1Y4_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DWFI4iIh.js → extension-page-CrDADV5W.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BZwcaU5Y.js → extension-provider-mnRoa63o.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-cn4KS42C.js → extension-settings-page-BLl02GFY.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-c3gDD9sM.js → file-preview-surface-TGdKqhCf.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Dmt5JhZU.js → gateway-config-swr-DfPQIHOL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-CJtDXQCt.js → gateway-realtime-67vWg_M2.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DInvvT5u.js → gateway-restart-CLtR2wkL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BZXdv2FE.js → gateway-settings-COvC3r-l.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-s2KcWekp.js → gateway-startup-retry-9YQllbw2.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DtnmDd87.js → global-defaults-api-DYMRjGvd.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CAVjA5rO.js → home-page-k9LFXcVa.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-RQQokgE9.js → image-generation-api-Dzydfvy8.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BP_4TubV.js → imports-page-Csd_YZXZ.js} +1 -1
- package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +1 -0
- package/dist/gateway/static/root/assets/index-DKW7BeT_.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-BNzNuXJ8.js → install-connector-dialog-CTQAKTPv.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DNRQFepg.js → keyboard-shortcuts-settings-B201bMIa.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CvY5XxbX.js → local-app-workbench-page-CD_8_gd_.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DfwEvd8G.js → local-apps-page-BOwqNH0L.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CuDdIyxR.js → local-session-drafts-DjmK-SM9.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-TQcz_Vjt.js → locale-store-Bg_XR36n.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-eq49F1Rt.js → logs-page-gw3E9CMQ.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BaYXDMOJ.js → management-settings-t_Z2mCyw.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D4nII6Zv.js → markdown-view-BUpXJUPv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-MvlAY405.js → media-plugins-_shnaEMY.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DG4HLOER.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-nsoNHqif.js → model-selector-a7PIT1Lk.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-CFIazNIF.js → models-hub-cache-KOJC3z6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-KPzbHiEW.js → note-detail-panel-BsHYUFgk.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-HVxR5bRD.js → notes-api-BSmikUKI.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-yShJeR3i.js → notes-page-CA0NRL8O.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CfKjRVnb.js → oauth-api-D2t9HXoC.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-D4uqONWr.js → oauth-provider-connect-DGGGGtcB.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-B98nlKTc.js → page-context-capture-button-BH54VO0V.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-HcuK45iu.js → page-context-draft-BS5y8Cx9.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-_d72UP_d.js → personal-avatar-D8DtpDTa.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-B19h_3WQ.js → personal-page-KJezmTKP.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CfwtGyue.js → personal-settings-panel-9uDaNJy5.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-D8bqsDk_.js → phone-dependencies-card-DLYrI0C4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CL_Zn6Xd.js → phone-model-picker-BbA2iI-3.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-C5Jia8eQ.js → phone-settings-page-Cg_BPss4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-FBfrfkYq.js → phone-workspace-store-CVDk80Bf.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-gAq2KPzK.js → plugin-details-dialog-DgibLkc3.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-Ck8GAX_y.js → preference-select-fields-BVoN-lAv.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BJ9oTnNs.js → product-automation-feedback-DCo90zGh.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dw9hUdxP.js → product-open-page-OWl8IAoY.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-C0iPzmSm.js → product-preview-content-Cjas7UNe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-COFtHoh6.js → product-preview-modal-CPWRvBI9.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-C5Amjah-.js → project-detail-page-B_HlZux_.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-DpL9ADQU.js → project-understanding-Ba02SFzB.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-gGg9nM2t.js → projects-page-CdfKjp95.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-D6JJRlJb.js → providers-api-rwQ4LWzr.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DxX1xKyt.js → recording-upload-BSmvRrZQ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BfXzBR1D.js → registry-api-Vy7LfH6E.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BZA4StwC.js → remote-access-hub-UXrnpGev.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-X-SIrZYI.js → resource-unavailable-f9OzSi4W.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-CWRb0UCt.js → route-preload-BtObM-co.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-1DjsPyQ5.js → runtime-tools-api-Bt8t37z5.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BnCtyORj.js → runtime-tools-settings-panel-DU4UXnBm.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-ChSOfHHh.js → service-recommendation-list-CuYsRcBB.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-rvY5aWw8.js → session-api-DJI9eSgw.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-CtKgACGl.js +23 -0
- package/dist/gateway/static/root/assets/{sessions-page-DAS2IUGT.js → sessions-page-BAsKzRHt.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-ZKRIuk7h.js → settings-advanced-section-BxUuF_yi.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CtJ8pEfm.js → settings-mode-store-CaoRh2gt.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DuNCn8i-.js → settings-page-header-CyUHrn7c.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DeNC8YHJ.js → settings-page-layout-DGVqXrlp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B3pUce-_.js → settings-page-qQ8-6dJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Fc3vuz_h.js → setup-status-panel-BpaPb625.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-B3hwjVAx.js → share-link-dialog-CQJ6Ykm2.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-D_9oFzGS.js → share-preview-page-Cem96FbB.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BoUpXmxq.js → shares-api-Dowes16l.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Drfuvepz.js → shares-settings-DZEkZDR0.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-By2HhJ9O.js → skill-api-D8ZwFEVe.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-TaUCzS8Y.js → skill-list-api-B4gp00-f.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CN2fpS1n.js → skill-reload-api-ClmaaDXo.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-LzGLique.js → skills-page-CV0X9rvG.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Cuyg8Ml3.js → system-settings-panel-D095uacX.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +2 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-DDubAU_5.js → task-result-evidence-LUrJlUhb.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BNs75Wdr.js → terminal-panel-store-BqEDB1Vl.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DB1ZfBUm.js → theme-store-gAcojLgP.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +1 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-TvtX4Goh.js → tracing-settings-page-B1ZRh-Is.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-COoVEdV9.js → tunnel-api-C9u9E3UQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-Dr_MLgYe.js → understanding-activity-store-BTrzsR6_.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-DGmLGEqw.js → understanding-refresh-store-5Qava3jh.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DP6eb6ed.js → usage-page-DFMLYKAc.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-itwjDYUb.js → use-autosave-3O-X7x15.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-hjIGlI_2.js → use-composer-attachments-BLc4dBfe.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-ClLa0g8D.js → use-file-preview-expanded-BaOmTXsT.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-vhWk6tTU.js → use-personal-profile-MusPgljM.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-dfXXjA2-.js → use-workspace-tree-Ck_U2yTw.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-D8dswPWd.js → user-model-page-Den5Lg-k.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BIfBySnN.js → voice-api-key-field-C5zJApoa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-J4o59ICE.js → voice-config-api-DC1bYDt1.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-B1mlpUdC.js → voice-input-shortcut-events-0SZjJdVV.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-xxaSOOmq.js → voice-transcribe-api-CxVeANPX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DqwT1E5u.js → work-discovery-overlay-DAQ8McVe.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BzYQmPLT.js → work-discovery-page-DUQysEyb.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-D2Zf3GOG.js → working-directory-picker-modal-BO9qdJyZ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Bnx3eS2M.js → workspace-api-ZrN6yUER.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-D13qHzVr.js → workspace-file-preview-dialog-Yj_kBWSb.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Cou-ig1H.js → workspace-open-location-menu-yxT7wajO.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DQGPKxHA.js → xopc-cloud-account-card-IcH9KDzx.js} +1 -1
- package/dist/gateway/static/root/index.html +81 -81
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +33 -3
- package/dist/src/agent/embedded/run-turn.js +64 -4
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +6 -0
- package/dist/src/agent/tools/computer-use-tool.js +18 -5
- package/dist/src/agent/tools/phone-use-tool.js +12 -2
- package/dist/src/cli/commands/backup.js +1 -1
- package/dist/src/computer/agent-context.d.ts +21 -0
- package/dist/src/computer/agent-context.js +107 -0
- package/dist/src/computer/broker.d.ts +4 -2
- package/dist/src/computer/broker.js +26 -11
- package/dist/src/computer/diagnostics.d.ts +60 -6
- package/dist/src/computer/diagnostics.js +45 -4
- package/dist/src/computer/errors.d.ts +1 -1
- package/dist/src/computer/errors.js +4 -0
- package/dist/src/computer/evaluation.d.ts +2 -2
- package/dist/src/computer/native-timing.d.ts +15 -0
- package/dist/src/computer/native-timing.js +49 -0
- package/dist/src/computer/program-runtime.d.ts +22 -0
- package/dist/src/computer/program-runtime.js +105 -0
- package/dist/src/computer/runtime.d.ts +36 -2
- package/dist/src/computer/runtime.js +269 -58
- package/dist/src/config/schema.d.ts +18 -0
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +6 -0
- package/dist/src/phone/adb-driver.d.ts +15 -1
- package/dist/src/phone/adb-driver.js +104 -41
- package/dist/src/phone/autoglm-protocol.d.ts +36 -0
- package/dist/src/phone/autoglm-protocol.js +88 -0
- package/dist/src/phone/autoglm-upstream-prompt.d.ts +2 -0
- package/dist/src/phone/autoglm-upstream-prompt.js +5 -0
- package/dist/src/phone/autoglm-upstream.LICENSE +201 -0
- package/dist/src/phone/cloud-adb-connection.d.ts +3 -0
- package/dist/src/phone/cloud-adb-connection.js +102 -31
- package/dist/src/phone/cloud-adb.js +18 -6
- package/dist/src/phone/completion-recovery.d.ts +6 -0
- package/dist/src/phone/completion-recovery.js +30 -0
- package/dist/src/phone/contracts.d.ts +20 -0
- package/dist/src/phone/contracts.js +6 -0
- package/dist/src/phone/execution-trace.d.ts +51 -0
- package/dist/src/phone/execution-trace.js +78 -0
- package/dist/src/phone/model-adapter.d.ts +9 -1
- package/dist/src/phone/model-adapter.js +132 -61
- package/dist/src/phone/model-response.d.ts +5 -0
- package/dist/src/phone/model-response.js +118 -0
- package/dist/src/phone/runtime.d.ts +4 -0
- package/dist/src/phone/runtime.js +146 -16
- package/dist/src/phone/text-session.d.ts +14 -0
- package/dist/src/phone/text-session.js +39 -0
- package/dist/src/phone/ui-dump-binary.d.ts +1 -1
- package/dist/src/phone/ui-dump-binary.js +1 -1
- package/dist/src/phone/ui-session.d.ts +22 -0
- package/dist/src/phone/ui-session.js +191 -0
- package/dist/src/process/phone-process.d.ts +1 -0
- package/dist/src/process/phone-process.js +11 -1
- package/package.json +2 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-1du1hfi5.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DcsZyYEa.js +0 -1
- package/dist/gateway/static/root/assets/index-BS9mjvSL.js +0 -11
- package/dist/gateway/static/root/assets/index-pT-m6l6b.css +0 -1
- package/dist/gateway/static/root/assets/messages-DaLmc4W1.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DticJxxh.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-D6SzJ9Ch.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-D2rbRfX3.js +0 -23
- package/dist/gateway/static/root/assets/settings-advanced-gate-CYDQybNF.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-6A9337pK.js +0 -2
- package/dist/gateway/static/root/assets/tool-friendly-title-DGmi7rCQ.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-COUVwj-p.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-D6cTOKr7.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,n as u}from"./locale-store-TQcz_Vjt.js";import{t as d}from"./messages-DaLmc4W1.js";import{t as f}from"./activity-YogQEteU.js";import{t as p}from"./calendar-clock-D-quYVPe.js";import{t as m}from"./check-DUBLcKHA.js";import{t as h}from"./chevron-down-ccbiQQz_.js";import{t as g}from"./chevron-right-BweFrslA.js";import{n as _,r as v}from"./popover-select-DD8fmrxH.js";import{t as y}from"./circle-alert-BEjgurr2.js";import{t as b}from"./circle-check-C23XjkUj.js";import{t as x}from"./copy-Dv6d4Dvw.js";import{t as S}from"./ellipsis-0k4rZLoy.js";import{t as C}from"./eye-CABVeTq0.js";import{t as w}from"./git-branch-Dh9uxTot.js";import{t as T}from"./list-filter-CIPvpfLA.js";import{t as E}from"./list-tree-B0OMswgM.js";import{t as D}from"./markdown-view-D4nII6Zv.js";import{t as O}from"./message-circle-Badhj-4D.js";import{t as k}from"./pause-DuPxgSxk.js";import{t as A}from"./pencil-DmIY3Oa-.js";import{t as j}from"./play-kxZvpBg8.js";import{t as M}from"./plus-Q2yW6OE7.js";import{t as N}from"./refresh-cw-BRlGaq2w.js";import{t as P}from"./search-DA7gz22f.js";import{t as F}from"./shield-check-BU58siTV.js";import{t as I}from"./sparkles-DHlfQFAF.js";import{t as L}from"./square-pen-B8FsvqNu.js";import{t as ee}from"./trash-2-DusmjVPV.js";import{t as te}from"./x-B_N4OPjy.js";import{t as ne}from"./zap-dximCGjy.js";import{t as R}from"./cn-0WouolD0.js";import{t as z}from"./button-CnRSIP6m.js";import{t as B}from"./skeleton-BI5TyibZ.js";import{a as re,n as V,o as ie,r as ae,s as oe,t as se}from"./dist-DfWfZ9iu.js";import{a as ce,i as H}from"./vendor-swr-CdRzEUwF.js";import{S as U}from"./session-manager-D2rbRfX3.js";import{d as W}from"./api-bpQ7yR10.js";import{t as G}from"./page-header-store-D6SzJ9Ch.js";import{t as le}from"./sliding-tab-list-DuQyViqe.js";import{t as ue}from"./chat-agents-api-BAOWaUJf.js";import{t as de}from"./refresh-button-bU_0NarN.js";import{a as fe,c as K,d as pe,f as q,i as me,l as he,m as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se}from"./dist-D3lWNSe7.js";import{n as J}from"./model-selector-nsoNHqif.js";import{C as Ce,S as we,T as Y,_ as Te,a as Ee,b as De,c as Oe,d as X,f as ke,g as Ae,h as je,l as Me,m as Ne,n as Pe,o as Fe,p as Ie,r as Le,s as Re,u as ze,v as Be,w as Ve,x as He,y as Ue}from"./automation-task-card-DXgBxVE2.js";import{t as Z}from"./automation-api-MB2xCoFF.js";import{n as We}from"./agent-display-names-Bje7vfSn.js";import{a as Ge,i as Ke,n as qe,r as Je,t as Ye}from"./automation-result-state-DJQflY78.js";import{i as Xe,n as Ze,r as Qe,t as $e}from"./browser-automation-inputs-PJbT3CxW.js";var et=n(),Q=e(t(),1),$=r(),tt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-CafkCKOj.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])));function nt(e){let t=(0,et.c)(50),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]===c?l=t[1]:(l=c?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=l);let u;t[2]===c?u=t[3]:(u=()=>Z.openConfiguration({automationId:c}),t[2]=c,t[3]=u);let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[4]=f):f=t[4];let{data:p,error:m,mutate:h}=H(l,u,f),g;t[5]===r?g=t[6]:(g=r?[`automation-configuration`,r]:null,t[5]=r,t[6]=g);let _;t[7]===r?_=t[8]:(_=()=>Z.configuration(r),t[7]=r,t[8]=_);let v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[9]=v):v=t[9];let{data:y}=H(g,_,v),b,x;t[10]!==n||t[11]!==s||t[12]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[10]=n,t[11]=s,t[12]=y,t[13]=b,t[14]=x):(b=t[13],x=t[14]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ce(),w;t[15]===S?w=t[16]:(w=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[15]=S,t[16]=w);let T=U(w),E=(0,Q.useRef)(!1),O,k;t[17]!==C||t[18]!==T?(O=()=>{E.current&&!T&&C(rt),E.current=T},k=[T,C],t[17]=C,t[18]=T,t[19]=O,t[20]=k):(O=t[19],k=t[20]),(0,Q.useEffect)(O,k);let A=a===`zh`,j;t[21]===a?j=t[22]:(j=d(a),t[21]=a,t[22]=j);let M=j,N;if(t[23]!==a||t[24]!==M.automations.status||t[25]!==o||t[26]!==i||t[27]!==A){let e;t[29]!==a||t[30]!==M.automations.status||t[31]!==o||t[32]!==A?(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":A?`任务运行结果`:`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(A?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,M.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:A?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:Je(e,a)}):e.summary?(0,$.jsx)(D,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:A?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(Pe,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)(Ge,{runId:e.id,language:a})]})}),t[29]=a,t[30]=M.automations.status,t[31]=o,t[32]=A,t[33]=e):e=t[33],N=i.map(e),t[23]=a,t[24]=M.automations.status,t[25]=o,t[26]=i,t[27]=A,t[28]=N}else N=t[28];let P=N;if(m){let e=A?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[34]===e?n=t[35]:(n=(0,$.jsx)(`p`,{children:e}),t[34]=e,t[35]=n);let r;t[36]===h?r=t[37]:(r=()=>void h(),t[36]=h,t[37]=r);let i=A?`重试`:`Retry`,a;t[38]!==r||t[39]!==i?(a=(0,$.jsx)(z,{variant:`secondary`,onClick:r,children:i}),t[38]=r,t[39]=i,t[40]=a):a=t[40];let o;return t[41]!==n||t[42]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[41]=n,t[42]=a,t[43]=o):o=t[43],o}let F=A?`任务对话`:`Task conversation`,I;t[44]!==P||t[45]!==S?(I=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(B,{className:`m-5 h-40`}),children:(0,$.jsx)(tt,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:P},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[44]=P,t[45]=S,t[46]=I):I=t[46];let L;return t[47]!==F||t[48]!==I?(L=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":F,children:I}),t[47]=F,t[48]=I,t[49]=L):L=t[49],L}function rt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}function it(e){let t=(0,et.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)(S,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(ge,{asChild:!0,children:(0,$.jsx)(z,{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`))&&!Ce(n)?(0,$.jsxs)(ye,{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)(k,{className:`size-4`}):(0,$.jsx)(j,{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)(ye,{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)(j,{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)(ye,{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)(A,{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)(x,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(ye,{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)(Se,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(ye,{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)(ee,{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)(_e,{children:(0,$.jsxs)(xe,{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 C;return t[41]!==b||t[42]!==d?(C=(0,$.jsxs)(he,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=C):C=t[43],C}var at=`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`,ot=`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 st(e){let t=(0,et.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(me,{className:`absolute right-2.5`,children:(0,$.jsx)(m,{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)(K,{value:n,className:at,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function ct(e){let t=(0,et.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:_,onQuery:v,onClear:y,onMarkAllRead:b}=e,x=n===`zh`,[S,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),E=(0,Q.useRef)(null),D=S||!!u,O=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,k;t[0]===v?k=t[1]:(k=()=>{v(``),C(!1),E.current?.focus()},t[0]=v,t[1]=k);let A=k,j=x?`定时任务`:`Scheduled tasks`,M;t[2]===j?M=t[3]:(M=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:j}),t[2]=j,t[3]=M);let N=x?`筛选任务`:`Filter tasks`,F=x?`筛选任务`:`Filter tasks`,I=O&&`text-accent-fg`,L;t[4]===I?L=t[5]:(L=R(`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`,I),t[4]=I,t[5]=L);let ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(T,{className:`size-4`,"aria-hidden":!0}),t[6]=ee):ee=t[6];let ne;t[7]!==O||t[8]!==x?(ne=O?(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:x?`已应用筛选`:`Filters applied`})}):null,t[7]=O,t[8]=x,t[9]=ne):ne=t[9];let z;t[10]!==N||t[11]!==F||t[12]!==L||t[13]!==ne?(z=(0,$.jsx)(ge,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":N,title:F,className:L,children:[ee,ne]})}),t[10]=N,t[11]=F,t[12]=L,t[13]=ne,t[14]=z):z=t[14];let B=x?`状态`:`Status`,re;t[15]===B?re=t[16]:(re=(0,$.jsx)(fe,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:B}),t[15]=B,t[16]=re);let V;t[17]===p?V=t[18]:(V=e=>p(e),t[17]=p,t[18]=V);let ie=x?`全部状态`:`All statuses`,ae;t[19]===ie?ae=t[20]:(ae=(0,$.jsx)(st,{value:`all`,children:ie}),t[19]=ie,t[20]=ae);let oe;t[21]===r.filters.active?oe=t[22]:(oe=(0,$.jsx)(st,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=oe);let se;t[23]===r.paused?se=t[24]:(se=(0,$.jsx)(st,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=se);let ce=x?`已完成`:`Completed`,H;t[25]===ce?H=t[26]:(H=(0,$.jsx)(st,{value:`completed`,children:ce}),t[25]=ce,t[26]=H);let U;t[27]===r.metrics.running?U=t[28]:(U=(0,$.jsx)(st,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=U);let W;t[29]===r.dashboard.needsAttention?W=t[30]:(W=(0,$.jsx)(st,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=W);let G;t[31]!==i||t[32]!==V||t[33]!==ae||t[34]!==oe||t[35]!==se||t[36]!==H||t[37]!==U||t[38]!==W?(G=(0,$.jsxs)(be,{value:i,onValueChange:V,children:[ae,oe,se,H,U,W]}),t[31]=i,t[32]=V,t[33]=ae,t[34]=oe,t[35]=se,t[36]=H,t[37]=U,t[38]=W,t[39]=G):G=t[39];let le;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),t[40]=le):le=t[40];let ue=x?`归属`:`Owner`,de;t[41]===ue?de=t[42]:(de=(0,$.jsx)(fe,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:ue}),t[41]=ue,t[42]=de);let K;t[43]===m?K=t[44]:(K=e=>m(e),t[43]=m,t[44]=K);let me=x?`我的任务`:`My tasks`,J;t[45]===me?J=t[46]:(J=(0,$.jsx)(st,{value:`user`,children:me}),t[45]=me,t[46]=J);let Ce=x?`系统任务`:`System tasks`,we;t[47]===Ce?we=t[48]:(we=(0,$.jsx)(st,{value:`system`,children:Ce}),t[47]=Ce,t[48]=we);let Y;t[49]!==a||t[50]!==K||t[51]!==J||t[52]!==we?(Y=(0,$.jsxs)(be,{value:a,onValueChange:K,children:[J,we]}),t[49]=a,t[50]=K,t[51]=J,t[52]=we,t[53]=Y):Y=t[53];let Te;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),t[54]=Te):Te=t[54];let Ee;t[55]!==r.filters.allProjects||t[56]!==_||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==x?(Ee=l?null:(0,$.jsxs)(pe,{children:[(0,$.jsxs)(ve,{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:[x?`项目`:`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)(g,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(_e,{children:(0,$.jsx)(q,{sideOffset:4,className:ot,children:(0,$.jsxs)(be,{value:s,onValueChange:_,children:[(0,$.jsx)(st,{value:``,children:r.filters.allProjects}),c.map(lt)]})})})]}),t[55]=r.filters.allProjects,t[56]=_,t[57]=s,t[58]=l,t[59]=c,t[60]=x,t[61]=Ee):Ee=t[61];let De=x?`任务类型`:`Task type`,Oe;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(g,{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)(ve,{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=x?`全部类型`:`All types`,je;t[67]===Ae?je=t[68]:(je=(0,$.jsx)(st,{value:`all`,children:Ae}),t[67]=Ae,t[68]=je);let Me;t[69]===r.sources.agent?Me=t[70]:(Me=(0,$.jsx)(st,{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)(st,{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)(st,{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)(_e,{children:(0,$.jsx)(q,{sideOffset:4,className:ot,children:(0,$.jsxs)(be,{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)(pe,{children:[X,Fe]}),t[82]=X,t[83]=Fe,t[84]=Ie):Ie=t[84];let Le;t[85]!==O||t[86]!==y||t[87]!==u||t[88]!==x?(Le=O||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),(0,$.jsx)(ye,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:y,children:x?`重置筛选`:`Reset filters`})]}):null,t[85]=O,t[86]=y,t[87]=u,t[88]=x,t[89]=Le):Le=t[89];let Re;t[90]!==r.filters.markAllRead||t[91]!==f||t[92]!==b||t[93]!==d?(Re=d>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),(0,$.jsx)(ye,{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:b,children:r.filters.markAllRead})]}):null,t[90]=r.filters.markAllRead,t[91]=f,t[92]=b,t[93]=d,t[94]=Re):Re=t[94];let ze;t[95]!==re||t[96]!==G||t[97]!==de||t[98]!==Y||t[99]!==Ee||t[100]!==Ie||t[101]!==Le||t[102]!==Re?(ze=(0,$.jsx)(_e,{children:(0,$.jsxs)(xe,{align:`end`,sideOffset:6,className:ot,children:[re,G,le,de,Y,Te,Ee,Ie,Le,Re]})}),t[95]=re,t[96]=G,t[97]=de,t[98]=Y,t[99]=Ee,t[100]=Ie,t[101]=Le,t[102]=Re,t[103]=ze):ze=t[103];let Be;t[104]!==z||t[105]!==ze?(Be=(0,$.jsxs)(he,{children:[z,ze]}),t[104]=z,t[105]=ze,t[106]=Be):Be=t[106];let Ve=x?`搜索任务`:`Search tasks`,He=x?`搜索任务`:`Search tasks`,Ue;t[107]!==A||t[108]!==D?(Ue=()=>{D?A():(C(!0),requestAnimationFrame(()=>w.current?.focus()))},t[107]=A,t[108]=D,t[109]=Ue):Ue=t[109];let Z=D&&`bg-surface-hover text-fg`,We;t[110]===Z?We=t[111]:(We=R(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,Z),t[110]=Z,t[111]=We);let Ge;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,$.jsx)(P,{className:`size-4`,"aria-hidden":!0}),t[112]=Ge):Ge=t[112];let Ke;t[113]!==D||t[114]!==Ve||t[115]!==He||t[116]!==Ue||t[117]!==We?(Ke=(0,$.jsx)(`button`,{ref:E,type:`button`,"aria-label":Ve,title:He,"aria-expanded":D,onClick:Ue,className:We,children:Ge}),t[113]=D,t[114]=Ve,t[115]=He,t[116]=Ue,t[117]=We,t[118]=Ke):Ke=t[118];let qe;t[119]!==Be||t[120]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[Be,Ke]}),t[119]=Be,t[120]=Ke,t[121]=qe):qe=t[121];let Je;t[122]!==M||t[123]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[M,qe]}),t[122]=M,t[123]=qe,t[124]=Je):Je=t[124];let Ye;t[125]!==A||t[126]!==v||t[127]!==u||t[128]!==D||t[129]!==x?(Ye=D?(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)(P,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:w,value:u,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),A())},"aria-label":x?`搜索任务名称或内容`:`Search task names or content`,placeholder:x?`搜索任务…`:`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":x?`关闭搜索`:`Close search`,onClick:A,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(te,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[125]=A,t[126]=v,t[127]=u,t[128]=D,t[129]=x,t[130]=Ye):Ye=t[130];let Xe;return t[131]!==Je||t[132]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Je,Ye]}),t[131]=Je,t[132]=Ye,t[133]=Xe):Xe=t[133],Xe}function lt(e){return(0,$.jsx)(st,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var ut=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`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 dt(e=Math.random){let t=[...ut];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 ft({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 Ie({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)(dt),m=(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)(p,{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(dt()),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)(N,{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:m})}function pt(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function mt(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 ht(e,t={}){let n=pt(e.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-BP0huA-W.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/locale-store-Bg_XR36n.js","assets/messages-DG4HLOER.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-DCo90zGh.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-BSmikUKI.js","assets/markdown-view-BUpXJUPv.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/dist-DfWfZ9iu.js","assets/dist-CxGUk8J-.js","assets/es2015-DBLcMg5B.js","assets/app-link-1j40sJ-z.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-DRtuFfF1.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/button-CnRSIP6m.js","assets/vendor-swr-CdRzEUwF.js","assets/automation-api-CZqL9l_d.js","assets/book-open-CCGtrT3R.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/working-directory-picker-modal-BO9qdJyZ.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-DD8fmrxH.js","assets/dist-CaUuvp8-.js","assets/dist-DusecO_p.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-alert-BEjgurr2.js","assets/send-1f1Ntw6E.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-BaOmTXsT.js","assets/eye-CABVeTq0.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-DJI9eSgw.js","assets/gateway-startup-retry-9YQllbw2.js","assets/activity-store-CMw8qBuC.js","assets/attachment-utils-core-BIOUBrpT.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-ZrN6yUER.js","assets/files-BNL4kkSB.js","assets/dist-D3lWNSe7.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-CTQAKTPv.js","assets/secret-input-BQvFXqzz.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-BjypBp2g.js","assets/gateway-config-swr-DfPQIHOL.js","assets/oauth-provider-connect-DGGGGtcB.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-KOJC3z6Q.js","assets/registry-api-Vy7LfH6E.js","assets/oauth-api-D2t9HXoC.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-CQJ6Ykm2.js","assets/copy-text-row-CYIv7RfP.js","assets/wrench-DFb4r8bH.js","assets/file-preview-surface-TGdKqhCf.js","assets/phone-workspace-store-CVDk80Bf.js","assets/shares-api-Dowes16l.js","assets/session-manager-CtKgACGl.js","assets/gateway-realtime-67vWg_M2.js","assets/gateway-realtime-store-Bkt1z-xo.js","assets/local-session-drafts-DjmK-SM9.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/agents-admin-api-DLnmdC1h.js","assets/middleware-Pd0e8Igk.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/api-Boc-CVh7.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-mnRoa63o.js","assets/capabilities-aT-QjNTl.js","assets/theme-store-gAcojLgP.js","assets/composer-payload-handoff-CYIhcczq.js","assets/voice-transcribe-api-CxVeANPX.js","assets/open-capability-settings-Cvb65hQB.js","assets/workspace-editor-agent-store-Bo5dwoWP.js","assets/voice-input-shortcut-events-0SZjJdVV.js","assets/use-composer-attachments-BLc4dBfe.js","assets/chevron-left-DqFhpbvK.js","assets/capabilities-BcQa8c9n.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/tool-friendly-title-o6sxGVUu.js","assets/voice-call-context-BM2A4bLz.js","assets/page-header-store-BdZnUh-D.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/agent-avatar-display-YqmwzOSa.js","assets/chat-agents-api-B8JO6Tcj.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-XGclfBqe.js","assets/command-palette-api-qujvNqkK.js","assets/skill-list-api-B4gp00-f.js","assets/skill-api-utils-C7V4JVXM.js","assets/model-selector-a7PIT1Lk.js","assets/dev-view-store-TTj_djD8.js","assets/extension-iframe-host-BfzPfXBq.js","assets/automation-task-card-wbnR5i6N.js","assets/calendar-clock-D-quYVPe.js","assets/message-circle-Badhj-4D.js","assets/date-picker-D_PSHGpe.js","assets/calendar-days-hw_Y-g-s.js","assets/api-bL7sxjAF.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-BqEDB1Vl.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-BS5y8Cx9.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,n as u}from"./locale-store-Bg_XR36n.js";import{t as d}from"./messages-DG4HLOER.js";import{t as f}from"./activity-YogQEteU.js";import{t as p}from"./calendar-clock-D-quYVPe.js";import{t as m}from"./check-DUBLcKHA.js";import{t as h}from"./chevron-down-ccbiQQz_.js";import{t as g}from"./chevron-right-BweFrslA.js";import{n as _,r as v}from"./popover-select-DD8fmrxH.js";import{t as y}from"./circle-alert-BEjgurr2.js";import{t as b}from"./circle-check-C23XjkUj.js";import{t as x}from"./copy-Dv6d4Dvw.js";import{t as S}from"./ellipsis-0k4rZLoy.js";import{t as C}from"./eye-CABVeTq0.js";import{t as w}from"./git-branch-Dh9uxTot.js";import{t as T}from"./list-filter-CIPvpfLA.js";import{t as E}from"./list-tree-B0OMswgM.js";import{t as D}from"./markdown-view-BUpXJUPv.js";import{t as O}from"./message-circle-Badhj-4D.js";import{t as k}from"./pause-DuPxgSxk.js";import{t as A}from"./pencil-DmIY3Oa-.js";import{t as j}from"./play-kxZvpBg8.js";import{t as M}from"./plus-Q2yW6OE7.js";import{t as N}from"./refresh-cw-BRlGaq2w.js";import{t as P}from"./search-DA7gz22f.js";import{t as F}from"./shield-check-BU58siTV.js";import{t as I}from"./sparkles-DHlfQFAF.js";import{t as L}from"./square-pen-B8FsvqNu.js";import{t as ee}from"./trash-2-DusmjVPV.js";import{t as te}from"./x-B_N4OPjy.js";import{t as ne}from"./zap-dximCGjy.js";import{t as R}from"./cn-0WouolD0.js";import{t as z}from"./button-CnRSIP6m.js";import{t as B}from"./skeleton-BI5TyibZ.js";import{a as re,n as V,o as ie,r as ae,s as oe,t as se}from"./dist-DfWfZ9iu.js";import{a as ce,i as H}from"./vendor-swr-CdRzEUwF.js";import{S as U}from"./session-manager-CtKgACGl.js";import{d as W}from"./api-Boc-CVh7.js";import{t as G}from"./page-header-store-BdZnUh-D.js";import{t as le}from"./sliding-tab-list-DuQyViqe.js";import{t as ue}from"./chat-agents-api-B8JO6Tcj.js";import{t as de}from"./refresh-button-bU_0NarN.js";import{a as fe,c as K,d as pe,f as q,i as me,l as he,m as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se}from"./dist-D3lWNSe7.js";import{n as J}from"./model-selector-a7PIT1Lk.js";import{C as Ce,S as we,T as Y,_ as Te,a as Ee,b as De,c as Oe,d as X,f as ke,g as Ae,h as je,l as Me,m as Ne,n as Pe,o as Fe,p as Ie,r as Le,s as Re,u as ze,v as Be,w as Ve,x as He,y as Ue}from"./automation-task-card-wbnR5i6N.js";import{t as Z}from"./automation-api-CZqL9l_d.js";import{n as We}from"./agent-display-names-Bje7vfSn.js";import{a as Ge,i as Ke,n as qe,r as Je,t as Ye}from"./automation-result-state-DRd-X_Ai.js";import{i as Xe,n as Ze,r as Qe,t as $e}from"./browser-automation-inputs-YeibTzw4.js";var et=n(),Q=e(t(),1),$=r(),tt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-BP0huA-W.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])));function nt(e){let t=(0,et.c)(50),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]===c?l=t[1]:(l=c?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=l);let u;t[2]===c?u=t[3]:(u=()=>Z.openConfiguration({automationId:c}),t[2]=c,t[3]=u);let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[4]=f):f=t[4];let{data:p,error:m,mutate:h}=H(l,u,f),g;t[5]===r?g=t[6]:(g=r?[`automation-configuration`,r]:null,t[5]=r,t[6]=g);let _;t[7]===r?_=t[8]:(_=()=>Z.configuration(r),t[7]=r,t[8]=_);let v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[9]=v):v=t[9];let{data:y}=H(g,_,v),b,x;t[10]!==n||t[11]!==s||t[12]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[10]=n,t[11]=s,t[12]=y,t[13]=b,t[14]=x):(b=t[13],x=t[14]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ce(),w;t[15]===S?w=t[16]:(w=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[15]=S,t[16]=w);let T=U(w),E=(0,Q.useRef)(!1),O,k;t[17]!==C||t[18]!==T?(O=()=>{E.current&&!T&&C(rt),E.current=T},k=[T,C],t[17]=C,t[18]=T,t[19]=O,t[20]=k):(O=t[19],k=t[20]),(0,Q.useEffect)(O,k);let A=a===`zh`,j;t[21]===a?j=t[22]:(j=d(a),t[21]=a,t[22]=j);let M=j,N;if(t[23]!==a||t[24]!==M.automations.status||t[25]!==o||t[26]!==i||t[27]!==A){let e;t[29]!==a||t[30]!==M.automations.status||t[31]!==o||t[32]!==A?(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":A?`任务运行结果`:`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(A?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,M.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:A?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:Je(e,a)}):e.summary?(0,$.jsx)(D,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:A?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(Pe,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)(Ge,{runId:e.id,language:a})]})}),t[29]=a,t[30]=M.automations.status,t[31]=o,t[32]=A,t[33]=e):e=t[33],N=i.map(e),t[23]=a,t[24]=M.automations.status,t[25]=o,t[26]=i,t[27]=A,t[28]=N}else N=t[28];let P=N;if(m){let e=A?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[34]===e?n=t[35]:(n=(0,$.jsx)(`p`,{children:e}),t[34]=e,t[35]=n);let r;t[36]===h?r=t[37]:(r=()=>void h(),t[36]=h,t[37]=r);let i=A?`重试`:`Retry`,a;t[38]!==r||t[39]!==i?(a=(0,$.jsx)(z,{variant:`secondary`,onClick:r,children:i}),t[38]=r,t[39]=i,t[40]=a):a=t[40];let o;return t[41]!==n||t[42]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[41]=n,t[42]=a,t[43]=o):o=t[43],o}let F=A?`任务对话`:`Task conversation`,I;t[44]!==P||t[45]!==S?(I=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(B,{className:`m-5 h-40`}),children:(0,$.jsx)(tt,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:P},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[44]=P,t[45]=S,t[46]=I):I=t[46];let L;return t[47]!==F||t[48]!==I?(L=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":F,children:I}),t[47]=F,t[48]=I,t[49]=L):L=t[49],L}function rt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}function it(e){let t=(0,et.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)(S,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(ge,{asChild:!0,children:(0,$.jsx)(z,{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`))&&!Ce(n)?(0,$.jsxs)(ye,{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)(k,{className:`size-4`}):(0,$.jsx)(j,{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)(ye,{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)(j,{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)(ye,{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)(A,{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)(x,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(ye,{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)(Se,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(ye,{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)(ee,{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)(_e,{children:(0,$.jsxs)(xe,{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 C;return t[41]!==b||t[42]!==d?(C=(0,$.jsxs)(he,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=C):C=t[43],C}var at=`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`,ot=`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 st(e){let t=(0,et.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(me,{className:`absolute right-2.5`,children:(0,$.jsx)(m,{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)(K,{value:n,className:at,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function ct(e){let t=(0,et.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:_,onQuery:v,onClear:y,onMarkAllRead:b}=e,x=n===`zh`,[S,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),E=(0,Q.useRef)(null),D=S||!!u,O=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,k;t[0]===v?k=t[1]:(k=()=>{v(``),C(!1),E.current?.focus()},t[0]=v,t[1]=k);let A=k,j=x?`定时任务`:`Scheduled tasks`,M;t[2]===j?M=t[3]:(M=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:j}),t[2]=j,t[3]=M);let N=x?`筛选任务`:`Filter tasks`,F=x?`筛选任务`:`Filter tasks`,I=O&&`text-accent-fg`,L;t[4]===I?L=t[5]:(L=R(`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`,I),t[4]=I,t[5]=L);let ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(T,{className:`size-4`,"aria-hidden":!0}),t[6]=ee):ee=t[6];let ne;t[7]!==O||t[8]!==x?(ne=O?(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:x?`已应用筛选`:`Filters applied`})}):null,t[7]=O,t[8]=x,t[9]=ne):ne=t[9];let z;t[10]!==N||t[11]!==F||t[12]!==L||t[13]!==ne?(z=(0,$.jsx)(ge,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":N,title:F,className:L,children:[ee,ne]})}),t[10]=N,t[11]=F,t[12]=L,t[13]=ne,t[14]=z):z=t[14];let B=x?`状态`:`Status`,re;t[15]===B?re=t[16]:(re=(0,$.jsx)(fe,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:B}),t[15]=B,t[16]=re);let V;t[17]===p?V=t[18]:(V=e=>p(e),t[17]=p,t[18]=V);let ie=x?`全部状态`:`All statuses`,ae;t[19]===ie?ae=t[20]:(ae=(0,$.jsx)(st,{value:`all`,children:ie}),t[19]=ie,t[20]=ae);let oe;t[21]===r.filters.active?oe=t[22]:(oe=(0,$.jsx)(st,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=oe);let se;t[23]===r.paused?se=t[24]:(se=(0,$.jsx)(st,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=se);let ce=x?`已完成`:`Completed`,H;t[25]===ce?H=t[26]:(H=(0,$.jsx)(st,{value:`completed`,children:ce}),t[25]=ce,t[26]=H);let U;t[27]===r.metrics.running?U=t[28]:(U=(0,$.jsx)(st,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=U);let W;t[29]===r.dashboard.needsAttention?W=t[30]:(W=(0,$.jsx)(st,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=W);let G;t[31]!==i||t[32]!==V||t[33]!==ae||t[34]!==oe||t[35]!==se||t[36]!==H||t[37]!==U||t[38]!==W?(G=(0,$.jsxs)(be,{value:i,onValueChange:V,children:[ae,oe,se,H,U,W]}),t[31]=i,t[32]=V,t[33]=ae,t[34]=oe,t[35]=se,t[36]=H,t[37]=U,t[38]=W,t[39]=G):G=t[39];let le;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),t[40]=le):le=t[40];let ue=x?`归属`:`Owner`,de;t[41]===ue?de=t[42]:(de=(0,$.jsx)(fe,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:ue}),t[41]=ue,t[42]=de);let K;t[43]===m?K=t[44]:(K=e=>m(e),t[43]=m,t[44]=K);let me=x?`我的任务`:`My tasks`,J;t[45]===me?J=t[46]:(J=(0,$.jsx)(st,{value:`user`,children:me}),t[45]=me,t[46]=J);let Ce=x?`系统任务`:`System tasks`,we;t[47]===Ce?we=t[48]:(we=(0,$.jsx)(st,{value:`system`,children:Ce}),t[47]=Ce,t[48]=we);let Y;t[49]!==a||t[50]!==K||t[51]!==J||t[52]!==we?(Y=(0,$.jsxs)(be,{value:a,onValueChange:K,children:[J,we]}),t[49]=a,t[50]=K,t[51]=J,t[52]=we,t[53]=Y):Y=t[53];let Te;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),t[54]=Te):Te=t[54];let Ee;t[55]!==r.filters.allProjects||t[56]!==_||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==x?(Ee=l?null:(0,$.jsxs)(pe,{children:[(0,$.jsxs)(ve,{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:[x?`项目`:`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)(g,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(_e,{children:(0,$.jsx)(q,{sideOffset:4,className:ot,children:(0,$.jsxs)(be,{value:s,onValueChange:_,children:[(0,$.jsx)(st,{value:``,children:r.filters.allProjects}),c.map(lt)]})})})]}),t[55]=r.filters.allProjects,t[56]=_,t[57]=s,t[58]=l,t[59]=c,t[60]=x,t[61]=Ee):Ee=t[61];let De=x?`任务类型`:`Task type`,Oe;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(g,{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)(ve,{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=x?`全部类型`:`All types`,je;t[67]===Ae?je=t[68]:(je=(0,$.jsx)(st,{value:`all`,children:Ae}),t[67]=Ae,t[68]=je);let Me;t[69]===r.sources.agent?Me=t[70]:(Me=(0,$.jsx)(st,{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)(st,{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)(st,{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)(_e,{children:(0,$.jsx)(q,{sideOffset:4,className:ot,children:(0,$.jsxs)(be,{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)(pe,{children:[X,Fe]}),t[82]=X,t[83]=Fe,t[84]=Ie):Ie=t[84];let Le;t[85]!==O||t[86]!==y||t[87]!==u||t[88]!==x?(Le=O||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),(0,$.jsx)(ye,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:y,children:x?`重置筛选`:`Reset filters`})]}):null,t[85]=O,t[86]=y,t[87]=u,t[88]=x,t[89]=Le):Le=t[89];let Re;t[90]!==r.filters.markAllRead||t[91]!==f||t[92]!==b||t[93]!==d?(Re=d>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Se,{className:`my-1 border-t border-edge`}),(0,$.jsx)(ye,{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:b,children:r.filters.markAllRead})]}):null,t[90]=r.filters.markAllRead,t[91]=f,t[92]=b,t[93]=d,t[94]=Re):Re=t[94];let ze;t[95]!==re||t[96]!==G||t[97]!==de||t[98]!==Y||t[99]!==Ee||t[100]!==Ie||t[101]!==Le||t[102]!==Re?(ze=(0,$.jsx)(_e,{children:(0,$.jsxs)(xe,{align:`end`,sideOffset:6,className:ot,children:[re,G,le,de,Y,Te,Ee,Ie,Le,Re]})}),t[95]=re,t[96]=G,t[97]=de,t[98]=Y,t[99]=Ee,t[100]=Ie,t[101]=Le,t[102]=Re,t[103]=ze):ze=t[103];let Be;t[104]!==z||t[105]!==ze?(Be=(0,$.jsxs)(he,{children:[z,ze]}),t[104]=z,t[105]=ze,t[106]=Be):Be=t[106];let Ve=x?`搜索任务`:`Search tasks`,He=x?`搜索任务`:`Search tasks`,Ue;t[107]!==A||t[108]!==D?(Ue=()=>{D?A():(C(!0),requestAnimationFrame(()=>w.current?.focus()))},t[107]=A,t[108]=D,t[109]=Ue):Ue=t[109];let Z=D&&`bg-surface-hover text-fg`,We;t[110]===Z?We=t[111]:(We=R(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,Z),t[110]=Z,t[111]=We);let Ge;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,$.jsx)(P,{className:`size-4`,"aria-hidden":!0}),t[112]=Ge):Ge=t[112];let Ke;t[113]!==D||t[114]!==Ve||t[115]!==He||t[116]!==Ue||t[117]!==We?(Ke=(0,$.jsx)(`button`,{ref:E,type:`button`,"aria-label":Ve,title:He,"aria-expanded":D,onClick:Ue,className:We,children:Ge}),t[113]=D,t[114]=Ve,t[115]=He,t[116]=Ue,t[117]=We,t[118]=Ke):Ke=t[118];let qe;t[119]!==Be||t[120]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[Be,Ke]}),t[119]=Be,t[120]=Ke,t[121]=qe):qe=t[121];let Je;t[122]!==M||t[123]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[M,qe]}),t[122]=M,t[123]=qe,t[124]=Je):Je=t[124];let Ye;t[125]!==A||t[126]!==v||t[127]!==u||t[128]!==D||t[129]!==x?(Ye=D?(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)(P,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:w,value:u,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),A())},"aria-label":x?`搜索任务名称或内容`:`Search task names or content`,placeholder:x?`搜索任务…`:`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":x?`关闭搜索`:`Close search`,onClick:A,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(te,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[125]=A,t[126]=v,t[127]=u,t[128]=D,t[129]=x,t[130]=Ye):Ye=t[130];let Xe;return t[131]!==Je||t[132]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Je,Ye]}),t[131]=Je,t[132]=Ye,t[133]=Xe):Xe=t[133],Xe}function lt(e){return(0,$.jsx)(st,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var ut=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`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 dt(e=Math.random){let t=[...ut];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 ft({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 Ie({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)(dt),m=(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)(p,{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(dt()),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)(N,{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:m})}function pt(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function mt(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 ht(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(mt(n));return null}async function gt(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=ht(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=ht(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 _t(){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 gt(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 vt=5;function yt(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 bt(e){let t=(0,et.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:p}=e,m=o===void 0?`generic.text`:o,g=s===void 0?`plain`:s,_=c===void 0?`improve`:c,v=p===void 0||p,[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(n),[w,T]=(0,Q.useState)(`preview`),[E,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(`edit`),[j,M]=(0,Q.useState)(!0),[P,F]=(0,Q.useState)(!1),[ee,ne]=(0,Q.useState)(null),B=(0,Q.useRef)(null),ce=(0,Q.useRef)(!0),{suggestion:H,thinking:U,loading:W,error:G,generate:ue,reset:de}=_t(),fe;t[0]===l?fe=t[1]:(fe=yt(l),t[0]=l,t[1]=fe);let K=fe,pe;t[2]!==W||t[3]!==U?(pe=W&&U.trim().length>0,t[2]=W,t[3]=U,t[4]=pe):pe=t[4];let q=pe,me,he;t[5]!==y||t[6]!==n?(me=()=>{y||S(n)},he=[y,n],t[5]=y,t[6]=n,t[7]=me,t[8]=he):(me=t[7],he=t[8]),(0,Q.useEffect)(me,he);let ge,_e;t[9]===H?(ge=t[10],_e=t[11]):(_e=()=>{O(H)},ge=[H],t[9]=H,t[10]=ge,t[11]=_e),(0,Q.useEffect)(_e,ge);let ve,ye;t[12]===U?(ve=t[13],ye=t[14]):(ve=()=>{U.trim()&&M(!0)},ye=[U],t[12]=U,t[13]=ve,t[14]=ye),(0,Q.useEffect)(ve,ye);let be;t[15]!==q||t[16]!==j?(be=()=>{let e=B.current;!e||!q||!j||ce.current&&(e.scrollTop=e.scrollHeight)},t[15]=q,t[16]=j,t[17]=be):be=t[17];let xe;t[18]!==q||t[19]!==U||t[20]!==j?(xe=[q,U,j],t[18]=q,t[19]=U,t[20]=j,t[21]=xe):xe=t[21],(0,Q.useLayoutEffect)(be,xe);let Se;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Se=()=>{let e=B.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;ce.current=t<=vt},t[22]=Se):Se=t[22];let J=Se,Ce;t[23]!==u||t[24]!==i||t[25]!==a||t[26]!==g||t[27]!==ue||t[28]!==_||t[29]!==l||t[30]!==m?(Ce=async e=>{A(`edit`),M(!0),ce.current=!0,await ue({intent:_,scenario:m,input:e,locale:l,field:{id:i,label:a,format:g},context:u})},t[23]=u,t[24]=i,t[25]=a,t[26]=g,t[27]=ue,t[28]=_,t[29]=l,t[30]=m,t[31]=Ce):Ce=t[31];let we=Ce,Y;t[32]!==de||t[33]!==n?(Y=e=>{F(!!e.currentTarget.closest(`[role="dialog"]`)),ne(document.querySelector(`.app-main-surface`)),S(n),T(`preview`),O(``),A(`edit`),M(!0),de(),b(!0)},t[32]=de,t[33]=n,t[34]=Y):Y=t[34];let Te=Y,Ee;t[35]!==x||t[36]!==we?(Ee=async()=>{await we(x)},t[35]=x,t[36]=we,t[37]=Ee):Ee=t[37];let De=Ee,Oe;t[38]!==de||t[39]!==n?(Oe=()=>{b(!1),S(n),T(`preview`),O(``),A(`edit`),M(!0),de()},t[38]=de,t[39]=n,t[40]=Oe):Oe=t[40];let X=Oe,ke;t[41]!==X||t[42]!==x||t[43]!==r?(ke=()=>{r(x),X()},t[41]=X,t[42]=x,t[43]=r,t[44]=ke):ke=t[44];let Ae=ke,je;t[45]!==X||t[46]!==E||t[47]!==r?(je=()=>{E.trim()&&(r(E),X())},t[45]=X,t[46]=E,t[47]=r,t[48]=je):je=t[48];let Me=je,Ne;t[49]!==X||t[50]!==x||t[51]!==E||t[52]!==r?(Ne=()=>{if(!E.trim())return;let e=x.trimEnd();r(e?`${e}\n\n${E}`:E),X()},t[49]=X,t[50]=x,t[51]=E,t[52]=r,t[53]=Ne):Ne=t[53];let Pe=Ne,Fe;t[54]!==E||t[55]!==G||t[56]!==W?(Fe=!W&&!G&&E.trim().length>0,t[54]=E,t[55]=G,t[56]=W,t[57]=Fe):Fe=t[57];let Ie=Fe,Le=x!==n,Re;t[58]!==E||t[59]!==G||t[60]!==U?(Re=E.trim().length>0||U.trim().length>0||!!G,t[58]=E,t[59]=G,t[60]=U,t[61]=Re):Re=t[61];let ze=Re,Be=!v&&`size-7 p-0`,Ve;t[62]!==f||t[63]!==Be?(Ve=R(`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||W,Ue;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,$.jsx)(I,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=Ue):Ue=t[65];let Z=v?K.buttonTitle:null,We;t[66]!==K.buttonTitle||t[67]!==Te||t[68]!==Ve||t[69]!==He||t[70]!==Z?(We=(0,$.jsxs)(z,{type:`button`,variant:`ghost`,className:Ve,title:K.buttonTitle,"aria-label":K.buttonTitle,disabled:He,onClick:Te,children:[Ue,Z]}),t[66]=K.buttonTitle,t[67]=Te,t[68]=Ve,t[69]=He,t[70]=Z,t[71]=We):We=t[71];let Ge;t[72]===X?Ge=t[73]:(Ge=e=>e?b(!0):X(),t[72]=X,t[73]=Ge);let Ke=ee??void 0,qe=P?`bg-transparent`:`bg-scrim`,Je;t[74]===qe?Je=t[75]:(Je=R(`xopc-dialog-overlay absolute inset-0 z-[80]`,qe),t[74]=qe,t[75]=Je);let Ye;t[76]===Je?Ye=t[77]:(Ye=(0,$.jsx)(re,{className:Je}),t[76]=Je,t[77]=Ye);let Xe;t[78]===K.title?Xe=t[79]:(Xe=(0,$.jsx)(oe,{className:`text-base font-semibold text-fg`,children:K.title}),t[78]=K.title,t[79]=Xe);let Ze;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,$.jsx)(te,{className:`size-5`,strokeWidth:1.75}),t[80]=Ze):Ze=t[80];let Qe;t[81]===K.close?Qe=t[82]:(Qe=(0,$.jsx)(V,{asChild:!0,children:(0,$.jsx)(z,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":K.close,children:Ze})}),t[81]=K.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 tt;t[86]===K.current?tt=t[87]:(tt=(0,$.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:K.current}),t[86]=K.current,t[87]=tt);let nt=K.current,rt=w===`edit`,it=w===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,at;t[88]===it?at=t[89]:(at=R(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,it),t[88]=it,t[89]=at);let ot,st;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ot=()=>T(`edit`),st=(0,$.jsx)(L,{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]!==K.edit||t[93]!==rt||t[94]!==at?(ct=(0,$.jsxs)(`button`,{"aria-pressed":rt,type:`button`,className:at,onClick:ot,children:[st,K.edit]}),t[92]=K.edit,t[93]=rt,t[94]=at,t[95]=ct):ct=t[95];let lt=w===`preview`,ut=w===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,dt;t[96]===ut?dt=t[97]:(dt=R(`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=()=>T(`preview`),pt=(0,$.jsx)(C,{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]!==K.preview||t[101]!==lt||t[102]!==dt?(mt=(0,$.jsxs)(`button`,{"aria-pressed":lt,type:`button`,className:dt,onClick:ft,children:[pt,K.preview]}),t[100]=K.preview,t[101]=lt,t[102]=dt,t[103]=mt):mt=t[103];let ht;t[104]!==K.current||t[105]!==ct||t[106]!==mt?(ht=(0,$.jsxs)(le,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":nt,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[ct,mt]}),t[104]=K.current,t[105]=ct,t[106]=mt,t[107]=ht):ht=t[107];let gt;t[108]!==tt||t[109]!==ht?(gt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[tt,ht]}),t[108]=tt,t[109]=ht,t[110]=gt):gt=t[110];let bt;t[111]!==x||t[112]!==w||t[113]!==g||t[114]!==K.current||t[115]!==K.empty?(bt=w===`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:g===`markdown`?(0,$.jsx)(D,{content:x||K.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:x||K.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:x,onChange:e=>S(e.currentTarget.value),placeholder:K.empty,"aria-label":K.current}),t[111]=x,t[112]=w,t[113]=g,t[114]=K.current,t[115]=K.empty,t[116]=bt):bt=t[116];let Ct;t[117]!==gt||t[118]!==bt?(Ct=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[gt,bt]}),t[117]=gt,t[118]=bt,t[119]=Ct):Ct=t[119];let wt;t[120]===K.editedSuggestion?wt=t[121]:(wt=(0,$.jsx)(`span`,{children:K.editedSuggestion}),t[120]=K.editedSuggestion,t[121]=wt);let Tt;t[122]!==K.loading||t[123]!==W?(Tt=W?(0,$.jsx)(`span`,{className:`ml-2 font-normal`,children:K.loading}):null,t[122]=K.loading,t[123]=W,t[124]=Tt):Tt=t[124];let Et;t[125]!==wt||t[126]!==Tt?(Et=(0,$.jsxs)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:[wt,Tt]}),t[125]=wt,t[126]=Tt,t[127]=Et):Et=t[127];let Dt=K.editedSuggestion,Ot=k===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,kt;t[128]===Ot?kt=t[129]:(kt=R(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ot),t[128]=Ot,t[129]=kt);let At=k===`edit`,jt,Mt;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(jt=()=>A(`edit`),Mt=(0,$.jsx)(L,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[130]=jt,t[131]=Mt):(jt=t[130],Mt=t[131]);let Nt;t[132]!==K.edit||t[133]!==kt||t[134]!==At?(Nt=(0,$.jsxs)(`button`,{type:`button`,className:kt,"aria-pressed":At,onClick:jt,children:[Mt,K.edit]}),t[132]=K.edit,t[133]=kt,t[134]=At,t[135]=Nt):Nt=t[135];let Pt=k===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,Ft;t[136]===Pt?Ft=t[137]:(Ft=R(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Pt),t[136]=Pt,t[137]=Ft);let It=k===`preview`,Lt,Rt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(Lt=()=>A(`preview`),Rt=(0,$.jsx)(C,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[138]=Lt,t[139]=Rt):(Lt=t[138],Rt=t[139]);let zt;t[140]!==K.preview||t[141]!==Ft||t[142]!==It?(zt=(0,$.jsxs)(`button`,{type:`button`,className:Ft,"aria-pressed":It,onClick:Lt,children:[Rt,K.preview]}),t[140]=K.preview,t[141]=Ft,t[142]=It,t[143]=zt):zt=t[143];let Bt;t[144]!==K.editedSuggestion||t[145]!==Nt||t[146]!==zt?(Bt=(0,$.jsxs)(le,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":Dt,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[Nt,zt]}),t[144]=K.editedSuggestion,t[145]=Nt,t[146]=zt,t[147]=Bt):Bt=t[147];let Vt;t[148]!==Et||t[149]!==Bt?(Vt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[Et,Bt]}),t[148]=Et,t[149]=Bt,t[150]=Vt):Vt=t[150];let Ht=q?`opacity-100`:`pointer-events-none opacity-0`,Ut;t[151]===Ht?Ut=t[152]:(Ut=R(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Ht),t[151]=Ht,t[152]=Ut);let Wt=!q,Gt;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=()=>M(xt),t[153]=Gt):Gt=t[153];let Kt;t[154]!==K.thinkingLoading||t[155]!==W?(Kt=W?(0,$.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,K.thinkingLoading]}):null,t[154]=K.thinkingLoading,t[155]=W,t[156]=Kt):Kt=t[156];let qt;t[157]!==K.thinking||t[158]!==Kt?(qt=(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[K.thinking,Kt]}),t[157]=K.thinking,t[158]=Kt,t[159]=qt):qt=t[159];let Jt=j&&`rotate-180`,Yt;t[160]===Jt?Yt=t[161]:(Yt=R(`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)(h,{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]!==U||t[168]!==j?(Qt=j?(0,$.jsx)(`pre`,{ref:B,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:J,children:U}):null,t[167]=U,t[168]=j,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]!==Ut||t[174]!==Wt||t[175]!==$t?(en=(0,$.jsx)(`div`,{className:Ut,"aria-hidden":Wt,children:$t}),t[173]=Ut,t[174]=Wt,t[175]=$t,t[176]=en):en=t[176];let tn=q?`pointer-events-none opacity-0`:`opacity-100`,nn;t[177]===tn?nn=t[178]:(nn=R(`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]!==E||t[180]!==G||t[181]!==g||t[182]!==K.empty||t[183]!==K.loading||t[184]!==K.suggestion||t[185]!==W||t[186]!==k?(rn=G?(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:G}):k===`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:W&&!E.trim()?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:K.loading}):g===`markdown`?(0,$.jsx)(D,{content:E||K.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:E||K.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:E,onChange:e=>O(e.currentTarget.value),disabled:W,placeholder:W?K.loading:K.empty,"aria-label":K.suggestion}),t[179]=E,t[180]=G,t[181]=g,t[182]=K.empty,t[183]=K.loading,t[184]=K.suggestion,t[185]=W,t[186]=k,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]!==Vt||t[195]!==on?(sn=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[Vt,on]}),t[194]=Vt,t[195]=on,t[196]=sn):sn=t[196];let cn;t[197]!==Ct||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:[Ct,sn]}),t[197]=Ct,t[198]=sn,t[199]=cn):cn=t[199];let ln;t[200]!==X||t[201]!==K.cancel?(ln=(0,$.jsx)(z,{type:`button`,variant:`secondary`,onClick:X,children:K.cancel}),t[200]=X,t[201]=K.cancel,t[202]=ln):ln=t[202];let un=!Le,dn;t[203]!==Ae||t[204]!==K.applyCurrent||t[205]!==un?(dn=(0,$.jsx)(z,{type:`button`,variant:`secondary`,disabled:un,onClick:Ae,children:K.applyCurrent}),t[203]=Ae,t[204]=K.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)(N,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,$.jsx)(I,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[209]=ze,t[210]=pn);let mn=ze?K.regenerate:K.generate,hn;t[211]!==W||t[212]!==pn||t[213]!==mn||t[214]!==fn?(hn=(0,$.jsxs)(z,{type:`button`,variant:`secondary`,disabled:W,onClick:fn,children:[pn,mn]}),t[211]=W,t[212]=pn,t[213]=mn,t[214]=fn,t[215]=hn):hn=t[215];let gn=!Ie,_n;t[216]!==Pe||t[217]!==K.append||t[218]!==gn?(_n=(0,$.jsx)(z,{type:`button`,variant:`secondary`,disabled:gn,onClick:Pe,children:K.append}),t[216]=Pe,t[217]=K.append,t[218]=gn,t[219]=_n):_n=t[219];let vn=!Ie,yn;t[220]!==Me||t[221]!==K.replace||t[222]!==vn?(yn=(0,$.jsx)(z,{type:`button`,variant:`primary`,disabled:vn,onClick:Me,children:K.replace}),t[220]=Me,t[221]=K.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)(ae,{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:St,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]!==Ke||t[236]!==Ye?(Sn=(0,$.jsxs)(ie,{container:Ke,children:[Ye,xn]}),t[234]=xn,t[235]=Ke,t[236]=Ye,t[237]=Sn):Sn=t[237];let Cn;t[238]!==y||t[239]!==Sn||t[240]!==Ge?(Cn=(0,$.jsx)(se,{open:y,onOpenChange:Ge,children:Sn}),t[238]=y,t[239]=Sn,t[240]=Ge,t[241]=Cn):Cn=t[241];let wn;return t[242]!==Cn||t[243]!==We?(wn=(0,$.jsxs)($.Fragment,{children:[We,Cn]}),t[242]=Cn,t[243]=We,t[244]=wn):wn=t[244],wn}function xt(e){return!e}function St(e){return e.preventDefault()}function Ct(e){return e.management!==void 0}function wt(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...X,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 Tt=`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 Et(e){let t=(0,et.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:Tt,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:Tt,rows:5,value:n.instruction,onChange:h}),t[15]=n.instruction,t[16]=h,t[17]=g):g=t[17];let y;t[18]!==i.info.task||t[19]!==g?(y=(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]=y):y=t[20];let b;t[21]!==n.projectId||t[22]!==i.form.noProject||t[23]!==i.form.project||t[24]!==o||t[25]!==a||t[26]!==u?(b=!o&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.project,(0,$.jsxs)(_,{className:Tt,value:n.projectId,onChange:e=>u({projectId:e.target.value}),children:[(0,$.jsx)(v,{value:``,children:i.form.noProject}),a.map(Dt)]})]}),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]=b):b=t[27];let x;t[28]!==n.projectId||t[29]!==i.experience.projectRequired||t[30]!==c?(x=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]=x):x=t[31];let S;t[32]===u?S=t[33]:(S=e=>u({triggerMode:e.target.value}),t[32]=u,t[33]=S);let C;t[34]===i.trigger.once?C=t[35]:(C=(0,$.jsx)(v,{value:`once`,children:i.trigger.once}),t[34]=i.trigger.once,t[35]=C);let w;t[36]===i.trigger.daily?w=t[37]:(w=(0,$.jsx)(v,{value:`daily`,children:i.trigger.daily}),t[36]=i.trigger.daily,t[37]=w);let T;t[38]===i.trigger.weekly?T=t[39]:(T=(0,$.jsx)(v,{value:`weekly`,children:i.trigger.weekly}),t[38]=i.trigger.weekly,t[39]=T);let E;t[40]!==n.triggerMode||t[41]!==S||t[42]!==C||t[43]!==w||t[44]!==T?(E=(0,$.jsxs)(_,{className:Tt,value:n.triggerMode,onChange:S,children:[C,w,T]}),t[40]=n.triggerMode,t[41]=S,t[42]=C,t[43]=w,t[44]=T,t[45]=E):E=t[45];let D;t[46]!==i.form.trigger||t[47]!==E?(D=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.trigger,E]}),t[46]=i.form.trigger,t[47]=E,t[48]=D):D=t[48];let O;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?(O=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:Tt,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)(Ve,{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]=O):O=t[55];let k;t[56]!==n.triggerMode||t[57]!==n.weekday||t[58]!==i.form.day||t[59]!==i.weekdays||t[60]!==u?(k=n.triggerMode===`weekly`&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,$.jsx)(_,{className:Tt,value:n.weekday,onChange:e=>u({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,$.jsx)(v,{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]=k):k=t[61];let A;t[62]!==D||t[63]!==O||t[64]!==k?(A=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[D,O,k]}),t[62]=D,t[63]=O,t[64]=k,t[65]=A):A=t[65];let j;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(j=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]=j):j=t[69];let M;t[70]===i.experience.scheduleNote?M=t[71]:(M=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=M);let N;t[72]===u?N=t[73]:(N=e=>u({notificationPolicy:e.target.value}),t[72]=u,t[73]=N);let P;t[74]===i.draft.notifyAll?P=t[75]:(P=(0,$.jsx)(v,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=P);let F;t[76]===i.draft.notifyAttention?F=t[77]:(F=(0,$.jsx)(v,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=F);let I;t[78]===i.draft.notifyNone?I=t[79]:(I=(0,$.jsx)(v,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=I);let L;t[80]!==n.notificationPolicy||t[81]!==N||t[82]!==P||t[83]!==F||t[84]!==I?(L=(0,$.jsxs)(_,{className:Tt,value:n.notificationPolicy,onChange:N,children:[P,F,I]}),t[80]=n.notificationPolicy,t[81]=N,t[82]=P,t[83]=F,t[84]=I,t[85]=L):L=t[85];let ee;t[86]!==i.draft.notifications||t[87]!==L?(ee=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.draft.notifications,L]}),t[86]=i.draft.notifications,t[87]=L,t[88]=ee):ee=t[88];let te;return t[89]!==x||t[90]!==A||t[91]!==d||t[92]!==j||t[93]!==M||t[94]!==ee||t[95]!==m||t[96]!==y||t[97]!==b?(te=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[d,m,y,b,x,A,j,M,ee]}),t[89]=x,t[90]=A,t[91]=d,t[92]=j,t[93]=M,t[94]=ee,t[95]=m,t[96]=y,t[97]=b,t[98]=te):te=t[98],te}function Dt(e){return(0,$.jsx)(v,{value:e.id,children:e.name},e.id)}var Ot=`xopc.automations.dismissedExecutionIssues`;function kt(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(Ot)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function At(e,t,n){return e?Ue(e,n):t.never}function jt(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 Mt(e,t){return e===`browser_automation`?t.sources.browser:e===`task_command`?t.action.runTask:t.action.runAgent}function Nt(e){return e.safety?.mode??`auto_apply`}function Pt(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 Ft(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 It(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function Lt(e){return e.status===`failed`||e.status===`timeout`}function Rt(e,t){return e.action.kind===`system`?jt(e.action,t):e.action.kind===`agent`?e.action.instruction:(e.action.kind,jt(e.action,t))}function zt(e){return e.description?.trim()??``}function Bt(e){return It(e)?0:Lt(e)?1:e.status===`succeeded`?2:3}function Vt(e){return[...e].sort((e,t)=>{let n=Bt(e)-Bt(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function Ht(){let e=(0,et.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(Wt)}),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(Ut)})]}),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 Ut(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 Wt(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 Gt({projectId:e,embedded:t=!1,title:n,subtitle:r}){let i=u(e=>e.language),o=d(i),s=o.automations,c=o.productNavigation.sections[`automation-triggers`],l=o.cron,f=G(e=>e.setPageHeader),p=G(e=>e.clearPageHeader),[m,h]=a(),g=!t&&m.get(`view`)===`activity`,_=m.get(`run`)?.trim()??``,v=m.get(`automation`)?.trim()??``,b=m.get(`new`)===`1`,x=m.get(`setupChat`)??void 0,S=m.get(`draft`)?.trim()??``,C=m.get(`action`)?.trim()??``,w=m.get(`taskId`)?.trim()??``,T=m.get(`projectId`)?.trim()??``,E=e?.trim()||T,D=!!e?.trim(),O=m.get(`autogenerate`)===`1`,k=(0,Q.useRef)(``),A=m.get(`status`),j=A===`active`||A===`paused`||A===`completed`||A===`running`||A===`attention`?A:`all`,N=m.get(`ownership`)===`system`?`system`:`user`,P=m.get(`source`),F=P===`agent`||P===`task_command`||P===`browser_automation`?P:`all`,I=m.get(`q`)??``,L=e=>h(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),ee=e=>h(t=>{let n=new URLSearchParams(t);return e===`user`?n.delete(`ownership`):n.set(`ownership`,e),n.delete(`automation`),n}),B=e=>h(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),ce=e=>h(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`source`):n.set(`source`,e),n.delete(`automation`),n}),U=()=>h(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.delete(`automation`),t}),[le,fe]=(0,Q.useState)(null),[K,pe]=(0,Q.useState)(!1),[q,me]=(0,Q.useState)(`blank`),[he,ge]=(0,Q.useState)(!1),[_e,ve]=(0,Q.useState)(null),[ye,be]=(0,Q.useState)(null),[xe,Se]=(0,Q.useState)(!1),[J,we]=(0,Q.useState)(X),[Y,De]=(0,Q.useState)(null),[Ae,je]=(0,Q.useState)(null),[Pe,Ie]=(0,Q.useState)(!1),[Re,Be]=(0,Q.useState)(null),[Ve,He]=(0,Q.useState)(``),[Ue,We]=(0,Q.useState)(null),[Ge,Je]=(0,Q.useState)(!1),[Qe,$e]=(0,Q.useState)(!1),[et,tt]=(0,Q.useState)(E),[rt,it]=(0,Q.useState)(`new_session`),[at,ot]=(0,Q.useState)(`attention`),[st,lt]=(0,Q.useState)(null),[ut,dt]=(0,Q.useState)(!1),[pt,mt]=(0,Q.useState)(!1),[ht,gt]=(0,Q.useState)(!1),[_t,vt]=(0,Q.useState)(null),[yt,bt]=(0,Q.useState)(kt),xt=H([`automations`,E],()=>Z.list(E?{projectId:E}:void 0),{keepPreviousData:!0,refreshInterval:15e3}),St=H([`automation-runs`,E],()=>Z.runs(50,void 0,E?{projectId:E}:void 0),{keepPreviousData:!0,refreshInterval:1e4}),Tt=H(E?`automations-global-system-source`:null,()=>Z.list(),{keepPreviousData:!0,refreshInterval:15e3}),Dt=H(E?`automation-runs-global-system-source`:null,()=>Z.runs(50),{keepPreviousData:!0,refreshInterval:1e4}),At=H(Re?[`automation-history`,Re,E]:null,()=>Z.runs(50,Re,E?{projectId:E}:void 0),{refreshInterval:1e4}),jt=H(Ae?`automation-run-events:${Ae}`:null,()=>Z.runEvents(Ae),{refreshInterval:5e3}),Mt=H(Ae?[`automation-exact-run`,Ae]:null,()=>Z.getRun(Ae),{refreshInterval:3e3}),Nt=H(`automation-browser-automations`,()=>Xe.list()),Pt=H(`automation-chat-agents`,ue),Ft=H(`automation-tasks`,Z.tasks),Lt=H(`automation-projects`,()=>W({sortBy:`name`,sortOrder:`asc`,limit:200})),Bt=xt.isLoading&&!xt.data||St.isLoading&&!St.data||!!E&&Tt.isLoading&&!Tt.data||!!E&&Dt.isLoading&&!Dt.data,Ut=!Bt&&(xt.isLoading||St.isLoading||Tt.isLoading||Dt.isLoading),Wt=xt.data?.automations??[],Gt=E?Tt.data?.automations??[]:Wt,Jt=(0,Q.useMemo)(()=>Vt(St.data?.runs??[]),[St.data?.runs]),Yt=(0,Q.useMemo)(()=>E?Vt(Dt.data?.runs??[]):Jt,[Dt.data?.runs,E,Jt]),Xt=(0,Q.useMemo)(()=>Wt.filter(e=>!Ct(e)),[Wt]),Zt=(0,Q.useMemo)(()=>Gt.filter(Ct),[Gt]),en=(0,Q.useMemo)(()=>[...Xt,...Zt],[Zt,Xt]),tn=(0,Q.useMemo)(()=>new Set(Zt.map(e=>e.id)),[Zt]),nn=(0,Q.useMemo)(()=>Jt.filter(e=>!tn.has(e.automationId)),[Jt,tn]),rn=(0,Q.useMemo)(()=>Yt.filter(e=>tn.has(e.automationId)),[Yt,tn]),sn=(0,Q.useMemo)(()=>E?[...Jt,...rn]:Jt,[E,Jt,rn]),cn=(0,Q.useMemo)(()=>Mt.data?.run?.id===Ae?Mt.data.run:sn.find(e=>e.id===Ae)??At.data?.runs.find(e=>e.id===Ae)??null,[sn,Ae,At.data,Mt.data]),ln=(0,Q.useMemo)(()=>en.find(e=>e.id===Re)??null,[en,Re]),un=(0,Q.useMemo)(()=>en.find(e=>e.id===ye)??null,[en,ye]),dn=(0,Q.useMemo)(()=>[...At.data?.runs??sn].filter(e=>e.automationId===Re).sort((e,t)=>t.createdAtMs-e.createdAtMs),[sn,Re,At.data]),fn=jt.data?.events??[],pn=(0,Q.useMemo)(()=>nn.filter(e=>!It(e)&&e.readAtMs==null),[nn]),mn=I.trim().toLocaleLowerCase(),gn=N===`system`?Zt:Xt,_n=N===`system`?rn:nn,vn=(0,Q.useMemo)(()=>new Set(_n.filter(It).map(e=>e.automationId)),[_n]),yn=(0,Q.useMemo)(()=>gn.filter(e=>j===`attention`&&!qe(e,_n)||j===`running`&&!vn.has(e.id)||j===`active`&&!e.enabled||j===`paused`&&(e.enabled||Ce(e))||j===`completed`&&!Ce(e)||F!==`all`&&e.action.kind!==F?!1:!mn||[e.name,zt(e),Rt(e,s),Te(e.trigger,s,l,i)].some(e=>e.toLocaleLowerCase().includes(mn))),[l,j,s,i,mn,gn,_n,vn,F]),bn=(0,Q.useMemo)(()=>(Nt.data?.automations??[]).filter(e=>e.enabled),[Nt.data]),xn=Pt.data?.items??[],Sn=(0,Q.useMemo)(()=>(Ft.data?.items??[]).map(e=>e.task),[Ft.data]),Cn=Lt.data?.items??[],wn=(0,Q.useMemo)(()=>bn.find(e=>e.id===J.browserAutomationId.trim())??null,[bn,J.browserAutomationId]),Tn=!!un?.management?.editable.includes(`trigger`),En=[`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`||Ne(J.intervalValue,J.intervalUnit)>=6e4)&&(J.triggerMode!==`cron`||!!J.cronExpr.trim()),Dn=Tn?En:!!J.name.trim()&&(J.triggerMode!==`once`||Number.isFinite(new Date(J.onceAt).getTime())&&(!!un||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()&&ke(J.eventPayloadMatch))&&(J.actionMode===`browser_automation`?wn!==null&&Ze(wn,J.browserAutomationInputs):J.actionMode===`task_command`?!!(J.taskId.trim()&&J.agentId.trim()):!!J.instruction.trim()),On=!0;try{[`daily`,`weekly`,`cron`].includes(J.triggerMode)&&Fe(J)}catch{On=!1}let kn=Dn&&On,An=(0,Q.useMemo)(()=>wt(s),[s]),jn=(0,Q.useMemo)(()=>Xt.filter(e=>qe(e,nn)),[Xt,nn]),Mn=jn.some(e=>{let t=Ye(e,nn);return t!==null&&yt[e.id]!==t}),Nn=(0,Q.useCallback)(()=>{bt(e=>{let t={...e};for(let e of jn){let n=Ye(e,nn);n&&(t[e.id]=n)}try{window.localStorage.setItem(Ot,JSON.stringify(t))}catch{}return t})},[jn,nn]);(0,Q.useEffect)(()=>{if(!Ut){if(b){Be(null);return}if(yn.length===0){Be(null);return}if(v&&yn.some(e=>e.id===v)){Be(v);return}Re&&yn.some(e=>e.id===Re)||Be(null)}},[v,yn,b,Ut,Re]);let Pn=(0,Q.useCallback)(async()=>{await Promise.all([xt.mutate(),St.mutate(),Tt.mutate(),Dt.mutate(),At.mutate(),jt.mutate()])},[xt.mutate,Tt.mutate,Dt.mutate,jt.mutate,St.mutate,At.mutate]),Fn=(0,Q.useCallback)(e=>{if(D){Be(null),je(null);return}h(t=>{let n=new URLSearchParams(t);return e?n.set(`projectId`,e):n.delete(`projectId`),n.delete(`automation`),n.delete(`run`),n}),Be(null),je(null)},[D,h]);(0,Q.useEffect)(()=>{D&&(tt(E),we(e=>e.projectId===E?e:{...e,projectId:E}))},[E,D]);let In=(0,Q.useCallback)(e=>{if(e===`blank`&&!w){ge(!0);return}if(be(null),Se(!1),De(null),me(e),pe(!0),e===`blank`){we({...X,projectId:E});return}He(``),We(null),$e(!1),tt(E),it(`new_session`),ot(`attention`)},[E,w]),Ln=e=>{fe(e),we({...e.form,projectId:E}),be(null),Se(!1),De(null),me(`quick`),pe(!0)},Rn=(0,Q.useCallback)(e=>{if(e.action.kind===`agent`&&!e.management){ve(e);return}we(ze(e)),be(e.id),Se(!1),Be(null),me(`blank`),pe(!0)},[]),zn=(0,Q.useCallback)(()=>{Ue&&(we({...ze(Ue.automation),projectId:et,conversationMode:rt,notificationPolicy:at}),be(null),Se(!0),me(`blank`))},[Ue,rt,at,et]),Bn=(0,Q.useCallback)(async()=>{gt(!0),De(null);try{await Pn()}catch(e){let t=e instanceof Error?e.message:String(e);De(t)}finally{gt(!1)}},[s.feedback.actionFailed,Pn]);(0,Q.useEffect)(()=>{let e=en.find(e=>e.id===v);!e||!Ct(e)||N===`system`||h(e=>{let t=new URLSearchParams(e);return t.set(`ownership`,`system`),t},{replace:!0})},[v,en,N,h]),(0,Q.useEffect)(()=>{C===`create`&&(In(`blank`),w&&we(e=>({...e,actionMode:`task_command`,taskId:w,safetyMode:`auto_apply`})),h(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t.delete(`taskId`),t},{replace:!0}))},[C,In,h,w]),(0,Q.useEffect)(()=>{if(!S)return;let e=`${i}:${O?`auto`:`seed`}:${S}`;k.current!==e&&(k.current=e,He(S),We(null),$e(!1),tt(E),me(`draft`),pe(!0),h(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),O&&(De(null),Je(!0),Z.draft({prompt:S,language:i}).then(e=>{We(e.draft),$e(!1)}).catch(e=>{De(e instanceof Error?e.message:String(e))}).finally(()=>{Je(!1)})))},[O,S,i,E,h]);let Vn=(0,Q.useCallback)(e=>{let t=Jt.find(t=>t.id===e)??At.data?.runs.find(t=>t.id===e);if(!t||It(t)||t.readAtMs!=null)return;let n=Date.now();St.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),At.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Z.markRunRead(e).catch(e=>{De(e instanceof Error?e.message:String(e)),St.mutate(),At.mutate()})},[Jt,St.mutate,At.data,At.mutate]),Hn=(0,Q.useCallback)(e=>{Vn(e),je(e),Ie(!0),h(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[Vn,h]),Un=(0,Q.useCallback)(e=>{Be(e);let t=Ke(e,sn);h(t=>{let n=new URLSearchParams(t);return n.set(`automation`,e),n.delete(`new`),n.delete(`setupChat`),n.delete(`chatDraft`),n},{replace:!0}),t&&t.readAtMs==null&&!It(t)&&Vn(t.id)},[sn,Vn,h]);(0,Q.useEffect)(()=>{_&&(Vn(_),je(_),Ie(!0))},[Vn,_]),(0,Q.useEffect)(()=>{lt(null),mt(!1)},[Ae]);async function Wn(){if(De(null),J.triggerMode===`once`&&!un&&new Date(J.onceAt).getTime()<=Date.now()){De(s.experience.futureTime);return}if(!(!kn||_t)&&!(q===`quick`&&le?.requiresProject&&!J.projectId)){if(xe&&Ue){vt(`draft:edit`);try{let e=Me(J),{simulation:t}=await Z.simulate(e);We({...Ue,automation:e,simulation:t}),tt(J.projectId),it(J.conversationMode),ot(J.notificationPolicy),$e(!1),Se(!1),me(`draft`)}catch(e){let t=e instanceof Error?e.message:String(e);De(t)}finally{vt(null)}return}if(un){let e=un.id;await Gn(`automation:${e}:edit`,()=>Z.update(e,{...Tn?{trigger:Oe(un,{...J,instruction:`managed`}).trigger}:Oe(un,J),expectedRevision:un.updatedAtMs}))&&(pe(!1),be(null),Be(e));return}vt(`automation:create`);try{let e=Me(J),{automation:t}=await Z.create(e);we(X),pe(!1),h(e=>{let n=new URLSearchParams(e);return n.delete(`status`),n.delete(`q`),n.delete(`run`),n.delete(`new`),n.set(`automation`,t.id),D||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await Pn(),Be(t.id)}catch(e){let t=e instanceof Error?e.message:String(e);De(t)}finally{vt(null)}}}async function Gn(e,t){De(null),vt(e);try{return await t(),await Pn(),!0}catch(e){let t=e instanceof Error?e.message:String(e);return De(t),!1}finally{vt(null)}}async function Kn(){await Gn(`runs:read-all`,()=>Z.markAllRunsRead(E||void 0))}async function qn(){let e=Ve.trim();if(e){De(null),Je(!0);try{let t=await Z.draft({prompt:e,language:i});We(t.draft),$e(!1)}catch(e){De(e instanceof Error?e.message:String(e))}finally{Je(!1)}}}async function Jn(){if(!Ue)return;let e=``,t=``;await Gn(`draft:publish`,async()=>{let{automation:n}=await Z.create({...Ue.automation,...et?{projectId:et}:{projectId:void 0},conversationMode:rt,delivery:{...Ue.automation.delivery,notificationPolicy:at}});We(null),He(``),$e(!1),pe(!1),L(`all`),B(``),e=n.id,t=n.projectId??``})&&e&&(Fn(t),Un(e))}async function Yn(){if(!Ue)return;let e=``,t=``,n=``;await Gn(`draft:test`,async()=>{let{automation:r}=await Z.create({...Ue.automation,...et?{projectId:et}:{projectId:void 0},conversationMode:rt,delivery:{...Ue.automation.delivery,notificationPolicy:at},enabled:!1}),{run:i}=await Z.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,We(null),He(``),$e(!1),pe(!1),L(`all`),B(``)})&&e&&n&&(Fn(t),Un(e),Hn(n))}async function Xn(e){De(null),dt(!0),lt(null),mt(!1);try{let t=await Z.repairDraft(e.id,{language:i});lt(t.repair)}catch(e){De(e instanceof Error?e.message:String(e))}finally{dt(!1)}}async function Zn(e){st&&await Gn(`run:${e.id}:repair`,async()=>{await Z.update(e.automationId,st.patch),lt(null),mt(!1)})}let Qn=(0,Q.useMemo)(()=>(0,$.jsx)(de,{className:`size-9 shrink-0 p-0`,loading:ht,label:s.refresh,onClick:Bn}),[s.refresh,ht,Bn]);return(0,Q.useLayoutEffect)(()=>{if(!t)return f({startExtra:null,main:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:c}),end:Qn}),()=>p()},[p,t,Qn,c,f]),(0,$.jsxs)(`div`,{className:R(`flex min-h-0 min-w-0 flex-1 flex-col`,t?`bg-transparent`:`bg-surface-panel`),children:[(0,$.jsxs)(`div`,{className:R(`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&&(g?`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)(ne,{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})]}),Qn]}):null,Y||xt.error||St.error||Tt.error||Dt.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:Y||s.feedback.actionFailed}):null,g?Bt?(0,$.jsx)(Ht,{}):(0,$.jsx)(Qt,{runs:_n,ownership:N,labels:s,language:i,unreadCount:N===`user`?pn.length:0,loading:Ut||ht,onOwnershipChange:ee,onRefresh:Bn,onSelectRun:Hn}):(0,$.jsxs)($.Fragment,{children:[!Bt&&Mn&&N===`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:()=>L(`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)(y,{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,` · `,jn.length]}),(0,$.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:s.experience.issuesDescription})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:Nn,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)(te,{className:`size-4`,"aria-hidden":!0})})]}):null,Bt?(0,$.jsx)(Ht,{}):(0,$.jsxs)(`section`,{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)]`,"aria-busy":Ut,children:[(0,$.jsxs)(`aside`,{className:`flex max-h-[28vh] min-h-0 flex-col overflow-hidden rounded-xl bg-surface-base md:h-full md:max-h-none`,children:[(0,$.jsxs)(`div`,{className:`shrink-0 p-3`,children:[(0,$.jsx)(ct,{language:i,labels:s,filter:j,ownership:N,source:F,projectId:E,projects:Cn,projectLocked:D,query:I,unreadCount:N===`user`?pn.length:0,markReadBusy:_t===`runs:read-all`,onFilter:L,onOwnership:ee,onSource:ce,onProject:Fn,onQuery:B,onClear:()=>{U(),ee(`user`),D||Fn(``)},onMarkAllRead:()=>void Kn()}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>ge(!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)(M,{className:`size-4`,"aria-hidden":!0}),i===`zh`?`新建任务`:`New task`]})]}),(0,$.jsx)($t,{automations:yn,runs:_n,labels:s,cronLabels:l,language:i,selectedAutomationId:b?null:Re,onOpenDetails:Un,busy:_t!==null,onEdit:Rn,onAction:Gn})]}),!b&&ln&&!ln.management&&ln.action.kind!==`system`?(0,$.jsx)(nt,{automation:ln,runs:dn,language:i,onSelectRun:Hn},ln.id):x?(0,$.jsx)(nt,{conversationId:x,runs:[],language:i,onSelectRun:Hn,onConfigured:Un},x):!b&&ln?(0,$.jsx)(on,{automation:ln,runs:dn,runsLoading:At.isLoading,runsError:At.error?s.feedback.actionFailed:void 0,labels:s,cronLabels:l,language:i,projects:Cn,busyAction:_t,onEdit:Rn,onSelectRun:Hn,onAction:Gn},ln.id):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto`,children:(0,$.jsx)(ft,{language:i,projectId:E,onOpenConversation:e=>{let t=new URL(e,window.location.origin),n=t.searchParams.get(`setupChat`);h(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})}},E)})]})]})]}),he?(0,$.jsx)(Le,{language:i,projectId:E,onClose:()=>ge(!1),onCreated:e=>{ee(`user`),U(),Un(e.id)}}):null,_e?(0,$.jsx)(Le,{automation:_e,language:i,onClose:()=>ve(null)}):null,(0,$.jsx)(se,{open:K,onOpenChange:e=>{pe(e),e||(be(null),Se(!1))},children:(0,$.jsxs)(ie,{children:[(0,$.jsx)(re,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(ae,{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)(oe,{className:`text-base font-semibold text-fg`,children:q===`draft`?s.draft.title:un?s.editTitle:xe?s.draft.editTitle:s.createTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:q===`draft`?s.draft.subtitle:s.form.createFlowHint})]}),(0,$.jsx)(V,{asChild:!0,children:(0,$.jsx)(z,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(te,{className:`size-4`})})})]}),Y?(0,$.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:Y}):null,q===`draft`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,$.jsx)(qt,{labels:s,prompt:Ve,draft:Ue,loading:Ge,approved:Qe,publishBusy:_t===`draft:publish`,testBusy:_t===`draft:test`,templates:An,projects:Cn,projectId:et,conversationMode:rt,notificationPolicy:at,onPromptChange:He,onGenerate:qn,onEdit:zn,onPublish:Jn,onTest:Yn,onProjectChange:tt,onConversationModeChange:it,onNotificationPolicyChange:ot,projectLocked:D,onApprovedChange:$e,onDiscard:()=>{We(null),$e(!1)},onTemplateSelect:e=>{Ln(e),we({...e.form,projectId:et})},onOpenAdvanced:()=>{we({...X,projectId:et,conversationMode:rt,notificationPolicy:at}),me(`blank`)}})}):(0,$.jsxs)($.Fragment,{children:[Tn?(0,$.jsx)(Kt,{form:J,setForm:we,labels:s}):q===`quick`&&le?(0,$.jsx)(Et,{form:J,setForm:we,labels:s,projects:Cn,projectLocked:D,source:le.source,requiresProject:le.requiresProject}):(0,$.jsx)(hn,{form:J,labels:s,setForm:we,projects:Cn,browserAutomations:bn,selectedBrowserAutomation:wn,browserAutomationsLoading:Nt.isLoading,agentOptions:xn,agentsLoading:Pt.isLoading,defaultAgentId:Pt.data?.defaultId??``,taskOptions:Sn,tasksLoading:Ft.isLoading,language:i,projectLocked:D}),Tn||q===`quick`?(0,$.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto px-5 pb-4`,children:(0,$.jsx)(Ee,{form:J,onChange:e=>we(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:[q===`quick`?(0,$.jsx)(z,{variant:`ghost`,onClick:()=>me(`blank`),children:s.draft.advancedCreate}):null,xe?(0,$.jsx)(z,{variant:`ghost`,onClick:()=>{Se(!1),me(`draft`)},children:s.cancel}):(0,$.jsx)(V,{asChild:!0,children:(0,$.jsx)(z,{variant:`ghost`,children:s.cancel})}),(0,$.jsx)(z,{variant:`primary`,onClick:Wn,disabled:!kn||!!_t||q===`quick`&&!!le?.requiresProject&&!J.projectId,children:_t===`automation:create`||_t===`draft:edit`||un&&_t===`automation:${un.id}:edit`?s.feedback.working:un||xe?s.save:s.experience.createEnabled})]})]})]})]})}),(0,$.jsx)(se,{open:Pe&&!!cn,onOpenChange:e=>{Ie(e),!e&&h(e=>{let t=new URLSearchParams(e);return t.delete(`run`),t},{replace:!0})},children:(0,$.jsxs)(ie,{children:[(0,$.jsx)(re,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(ae,{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)(oe,{className:`truncate text-base font-semibold text-fg`,children:cn?.automationName??s.dashboard.result}),(0,$.jsx)(V,{asChild:!0,children:(0,$.jsx)(z,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(te,{className:`size-4`})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,$.jsx)(an,{className:`rounded-none border-0`,run:cn,events:fn,labels:s,cronLabels:l,language:i,loading:jt.isLoading,repairDraft:st,repairLoading:ut,repairApproved:pt,busyAction:_t,onRepairApprovedChange:mt,onSuggestRepair:Xn,onApplyRepair:Zn})})]})]})})]})}function Kt(e){let t=(0,et.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)(yn,{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)(v,{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)(v,{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)(v,{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)(v,{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)(_,{"aria-label":i.form.trigger,className:vn,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)(Y,{label:i.form.time,children:(0,$.jsx)(Ve,{value:n.time,onChange:e=>o({time:e}),ariaLabel:i.form.time})}),n.triggerMode===`weekly`?(0,$.jsx)(Y,{label:i.form.day,children:(0,$.jsxs)(_,{className:vn,value:n.weekday,onChange:e=>o({weekday:e.target.value}),children:[(0,$.jsx)(v,{value:`1`,children:i.weekdays.monday}),(0,$.jsx)(v,{value:`2`,children:i.weekdays.tuesday}),(0,$.jsx)(v,{value:`3`,children:i.weekdays.wednesday}),(0,$.jsx)(v,{value:`4`,children:i.weekdays.thursday}),(0,$.jsx)(v,{value:`5`,children:i.weekdays.friday}),(0,$.jsx)(v,{value:`6`,children:i.weekdays.saturday}),(0,$.jsx)(v,{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)(Y,{label:i.form.intervalEvery,children:(0,$.jsx)(`input`,{className:vn,type:`number`,min:`1`,value:n.intervalValue,onChange:e=>o({intervalValue:e.target.value})})}),(0,$.jsx)(Y,{label:i.form.intervalUnits.minute,children:(0,$.jsxs)(_,{className:vn,value:n.intervalUnit,onChange:e=>o({intervalUnit:e.target.value}),children:[(0,$.jsx)(v,{value:`minute`,children:i.form.intervalUnits.minute}),(0,$.jsx)(v,{value:`hour`,children:i.form.intervalUnits.hour}),(0,$.jsx)(v,{value:`day`,children:i.form.intervalUnits.day}),(0,$.jsx)(v,{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)(Y,{label:i.form.expression,children:(0,$.jsx)(`input`,{className:vn,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 y;return t[42]!==h||t[43]!==g||t[44]!==s||t[45]!==p||t[46]!==m?(y=(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]=y):y=t[47],y}function qt(e){let t=(0,et.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:y,onTest:b,onProjectChange:x,onConversationModeChange:S,onNotificationPolicyChange:C,onApprovedChange:w,onDiscard:T,onTemplateSelect:E,onOpenAdvanced:D,projectLocked:O}=e,k=s!==void 0&&s,M=c!==void 0&&c,N=O!==void 0&&O,P=!!(i&&i.simulation.requiredConfirmations.length>0),F;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]!==E||t[7]!==l?(F=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)(z,{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:()=>E(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]=E,t[7]=l,t[8]=F):F=t[8];let L;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(I,{className:`size-4 text-accent`}),t[9]=L):L=t[9];let ee;t[10]===n.draft.title?ee=t[11]:(ee=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[L,n.draft.title]}),t[10]=n.draft.title,t[11]=ee);let te;t[12]===n.draft.subtitle?te=t[13]:(te=(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=te);let ne;t[14]!==ee||t[15]!==te?(ne=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[ee,te]}),t[14]=ee,t[15]=te,t[16]=ne):ne=t[16];let B;t[17]!==a||t[18]!==r?(B=a||!r.trim(),t[17]=a,t[18]=r,t[19]=B):B=t[19];let re;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(I,{className:`size-4`}),t[20]=re):re=t[20];let V=a?n.draft.generating:n.draft.generate,ie;t[21]!==h||t[22]!==V||t[23]!==B?(ie=(0,$.jsxs)(z,{variant:`primary`,onClick:h,disabled:B,children:[re,V]}),t[21]=h,t[22]=V,t[23]=B,t[24]=ie):ie=t[24];let ae;t[25]!==ie||t[26]!==ne?(ae=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[ne,ie]}),t[25]=ie,t[26]=ne,t[27]=ae):ae=t[27];let oe;t[28]===m?oe=t[29]:(oe=e=>m(e.target.value),t[28]=m,t[29]=oe);let se;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==oe?(se=(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:oe,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=oe,t[34]=se):se=t[34];let ce=N?`sm:grid-cols-2`:`sm:grid-cols-3`,H;t[35]===ce?H=t[36]:(H=R(`mt-3 grid gap-3`,ce),t[35]=ce,t[36]=H);let U;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==x||t[40]!==d||t[41]!==N||t[42]!==u?(U=N?null:(0,$.jsx)(Y,{label:n.draft.project,children:(0,$.jsxs)(_,{className:vn,value:d,onChange:e=>x(e.target.value),children:[(0,$.jsx)(v,{value:``,children:n.draft.noProject}),u.map(Jt)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=x,t[40]=d,t[41]=N,t[42]=u,t[43]=U):U=t[43];let W;t[44]===S?W=t[45]:(W=e=>S(e.target.value),t[44]=S,t[45]=W);let G;t[46]===n.draft.newConversation?G=t[47]:(G=(0,$.jsx)(v,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=G);let le;t[48]===n.draft.continuousConversation?le=t[49]:(le=(0,$.jsx)(v,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=le);let ue;t[50]!==f||t[51]!==W||t[52]!==G||t[53]!==le?(ue=(0,$.jsxs)(_,{className:vn,value:f,onChange:W,children:[G,le]}),t[50]=f,t[51]=W,t[52]=G,t[53]=le,t[54]=ue):ue=t[54];let de;t[55]!==n.draft.conversation||t[56]!==ue?(de=(0,$.jsx)(Y,{label:n.draft.conversation,children:ue}),t[55]=n.draft.conversation,t[56]=ue,t[57]=de):de=t[57];let fe;t[58]===C?fe=t[59]:(fe=e=>C(e.target.value),t[58]=C,t[59]=fe);let K;t[60]===n.draft.notifyAttention?K=t[61]:(K=(0,$.jsx)(v,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=K);let pe;t[62]===n.draft.notifyAll?pe=t[63]:(pe=(0,$.jsx)(v,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=pe);let q;t[64]===n.draft.notifyNone?q=t[65]:(q=(0,$.jsx)(v,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=q);let me;t[66]!==p||t[67]!==fe||t[68]!==K||t[69]!==pe||t[70]!==q?(me=(0,$.jsxs)(_,{className:vn,value:p,onChange:fe,children:[K,pe,q]}),t[66]=p,t[67]=fe,t[68]=K,t[69]=pe,t[70]=q,t[71]=me):me=t[71];let he;t[72]!==n.draft.notifications||t[73]!==me?(he=(0,$.jsx)(Y,{label:n.draft.notifications,children:me}),t[72]=n.draft.notifications,t[73]=me,t[74]=he):he=t[74];let ge;t[75]!==H||t[76]!==U||t[77]!==de||t[78]!==he?(ge=(0,$.jsxs)(`div`,{className:H,children:[U,de,he]}),t[75]=H,t[76]=U,t[77]=de,t[78]=he,t[79]=ge):ge=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]!==w||t[96]!==T||t[97]!==g||t[98]!==y||t[99]!==b||t[100]!==k||t[101]!==P||t[102]!==M?(_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)(pn,{label:n.info.when,value:i.simulation.triggerSummary}),(0,$.jsx)(pn,{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)(Yt,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,$.jsx)(Yt,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,$.jsx)(Yt,{title:n.draft.risks,items:i.risks,empty:n.none}),P?(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=>w(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)(z,{variant:`ghost`,onClick:T,children:n.draft.discard}),(0,$.jsxs)(z,{variant:`secondary`,onClick:g,children:[(0,$.jsx)(A,{className:`size-4`}),n.draft.edit]}),(0,$.jsxs)(z,{variant:`secondary`,onClick:b,disabled:M||k||P&&!o,children:[(0,$.jsx)(j,{className:`size-4`}),M?n.draft.testing:n.draft.testOnce]}),(0,$.jsx)(z,{variant:`primary`,onClick:y,disabled:k||P&&!o,children:k?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]=w,t[96]=T,t[97]=g,t[98]=y,t[99]=b,t[100]=k,t[101]=P,t[102]=M,t[103]=_e):_e=t[103];let ve;return t[104]!==ae||t[105]!==se||t[106]!==ge||t[107]!==_e||t[108]!==F?(ve=(0,$.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[F,ae,se,ge,_e]}),t[104]=ae,t[105]=se,t[106]=ge,t[107]=_e,t[108]=F,t[109]=ve):ve=t[109],ve}function Jt(e){return(0,$.jsx)(v,{value:e.id,children:e.name},e.id)}function Yt(e){let t=(0,et.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(Xt):(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 Xt(e){return(0,$.jsxs)(`li`,{children:[`- `,e]},e)}function Zt(e){let t=(0,et.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=R(`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=R(`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=R(`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 Qt(e){let t=(0,et.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(It),t[0]=n,t[1]=d);let p=d.length,m;t[2]===n?m=t[3]:(m=n.filter(Lt),t[2]=n,t[3]=m);let h=m.length,g;t[4]===i.dashboard.activity?g=t[5]:(g=(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]=g);let _;t[6]===i.dashboard.activityDescription?_=t[7]:(_=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.dashboard.activityDescription}),t[6]=i.dashboard.activityDescription,t[7]=_);let v;t[8]!==g||t[9]!==_?(v=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[g,_]}),t[8]=g,t[9]=_,t[10]=v):v=t[10];let x=i.filters.ownership,S=r===`user`&&`bg-surface-base text-fg shadow-sm`,C;t[11]===S?C=t[12]:(C=R(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,S),t[11]=S,t[12]=C);let w;t[13]===c?w=t[14]:(w=()=>c(`user`),t[13]=c,t[14]=w);let T=r===`user`,E;t[15]!==i.filters.userManaged||t[16]!==T||t[17]!==C||t[18]!==w?(E=(0,$.jsx)(`button`,{type:`button`,className:C,onClick:w,"aria-pressed":T,children:i.filters.userManaged}),t[15]=i.filters.userManaged,t[16]=T,t[17]=C,t[18]=w,t[19]=E):E=t[19];let D=r===`system`&&`bg-surface-base text-fg shadow-sm`,O;t[20]===D?O=t[21]:(O=R(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,D),t[20]=D,t[21]=O);let k;t[22]===c?k=t[23]:(k=()=>c(`system`),t[22]=c,t[23]=k);let A=r===`system`,M;t[24]!==i.system.title||t[25]!==O||t[26]!==k||t[27]!==A?(M=(0,$.jsx)(`button`,{type:`button`,className:O,onClick:k,"aria-pressed":A,children:i.system.title}),t[24]=i.system.title,t[25]=O,t[26]=k,t[27]=A,t[28]=M):M=t[28];let N;t[29]!==i.filters.ownership||t[30]!==E||t[31]!==M?(N=(0,$.jsxs)(le,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":x,indicatorClassName:`rounded-md bg-surface-base shadow-sm`,children:[E,M]}),t[29]=i.filters.ownership,t[30]=E,t[31]=M,t[32]=N):N=t[32];let P;t[33]!==i.refresh||t[34]!==s||t[35]!==l?(P=(0,$.jsx)(de,{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]=P):P=t[36];let F;t[37]!==N||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[N,P]}),t[37]=N,t[38]=P,t[39]=F):F=t[39];let I;t[40]!==F||t[41]!==v?(I=(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:[v,F]}),t[40]=F,t[41]=v,t[42]=I):I=t[42];let L;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(f,{className:`size-4`,"aria-hidden":!0}),t[43]=L):L=t[43];let ee=i.metrics.total,te=String(n.length),ne;t[44]!==i.metrics.total||t[45]!==te?(ne=(0,$.jsx)(Zt,{icon:L,label:ee,value:te}),t[44]=i.metrics.total,t[45]=te,t[46]=ne):ne=t[46];let z;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(j,{className:`size-4`,"aria-hidden":!0}),t[47]=z):z=t[47];let B=i.metrics.running,re=String(p),V;t[48]!==i.metrics.running||t[49]!==re?(V=(0,$.jsx)(Zt,{icon:z,label:B,value:re}),t[48]=i.metrics.running,t[49]=re,t[50]=V):V=t[50];let ie;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t[51]=ie):ie=t[51];let ae=i.dashboard.needsAttention,oe=String(h),se=h>0?`danger`:`default`,ce;t[52]!==i.dashboard.needsAttention||t[53]!==oe||t[54]!==se?(ce=(0,$.jsx)(Zt,{icon:ie,label:ae,value:oe,tone:se}),t[52]=i.dashboard.needsAttention,t[53]=oe,t[54]=se,t[55]=ce):ce=t[55];let H;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(b,{className:`size-4`,"aria-hidden":!0}),t[56]=H):H=t[56];let U=i.filters.unread,W=String(o),G;t[57]!==i.filters.unread||t[58]!==W?(G=(0,$.jsx)(Zt,{icon:H,label:U,value:W}),t[57]=i.filters.unread,t[58]=W,t[59]=G):G=t[59];let ue;t[60]!==ne||t[61]!==V||t[62]!==ce||t[63]!==G?(ue=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-b border-edge-subtle bg-edge-subtle lg:grid-cols-4`,children:[ne,V,ce,G]}),t[60]=ne,t[61]=V,t[62]=ce,t[63]=G,t[64]=ue):ue=t[64];let fe;t[65]!==i||t[66]!==a||t[67]!==u||t[68]!==n?(fe=n.length===0?(0,$.jsx)(mn,{className:`min-h-64 rounded-none border-0 shadow-none`,icon:(0,$.jsx)(f,{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:R(`mt-1.5 size-2 shrink-0 rounded-full`,It(e)?`bg-blue-500`:Lt(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&&!It(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:R(`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:At(e.createdAtMs,i,a)})]}),(0,$.jsx)(`span`,{className:R(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Pt(e.status)),children:i.status[e.status]})]},e.id))}),t[65]=i,t[66]=a,t[67]=u,t[68]=n,t[69]=fe):fe=t[69];let K;return t[70]!==I||t[71]!==ue||t[72]!==fe?(K=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,"aria-labelledby":`automation-activity-title`,children:[I,ue,fe]}),t[70]=I,t[71]=ue,t[72]=fe,t[73]=K):K=t[73],K}function $t(e){let t=(0,et.c)(26),{automations:n,runs:r,labels:i,cronLabels:a,language:o,selectedAutomationId:s,onOpenDetails:c,busy:l,onEdit:u,onAction:d}=e;if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ne,{className:`size-5`}),t[0]=e):e=t[0];let n;return t[1]===i.empty.filtered?n=t[2]:(n=(0,$.jsx)(mn,{className:`rounded-none border-0 shadow-none`,icon:e,title:i.empty.filtered}),t[1]=i.empty.filtered,t[2]=n),n}let f;if(t[3]!==n||t[4]!==l||t[5]!==a||t[6]!==i||t[7]!==o||t[8]!==d||t[9]!==u||t[10]!==c||t[11]!==r||t[12]!==s){let e;t[14]!==l||t[15]!==a||t[16]!==i||t[17]!==o||t[18]!==d||t[19]!==u||t[20]!==c||t[21]!==r||t[22]!==s?(e=e=>{let t=r.filter(t=>t.automationId===e.id).sort(en),n=t.find(It),f=t[0];return(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsxs)(`button`,{type:`button`,className:R(`block w-full p-3 pr-10 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,s===e.id&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 76px`},"aria-current":s===e.id?`true`:void 0,onClick:()=>c(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:R(`size-2 shrink-0 rounded-full`,n?`bg-blue-500`:qe(e,t)?`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:Ce(e)?o===`zh`?`已完成`:`Completed`:e.enabled?i.enabled:i.paused}),f&&f.readAtMs==null&&!It(f)?(0,$.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:i.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:[Ae(e,i,o),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,Te(e.trigger,i,a,o)]}),qe(e,t)?(0,$.jsx)(`p`,{className:`mt-1 pl-4 text-xs text-red-700 dark:text-red-300`,children:i.dashboard.needsAttention}):null]}),(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)(it,{automation:e,language:o,busy:l,onEdit:u,onAction:d})})]},e.id)},t[14]=l,t[15]=a,t[16]=i,t[17]=o,t[18]=d,t[19]=u,t[20]=c,t[21]=r,t[22]=s,t[23]=e):e=t[23],f=n.map(e),t[3]=n,t[4]=l,t[5]=a,t[6]=i,t[7]=o,t[8]=d,t[9]=u,t[10]=c,t[11]=r,t[12]=s,t[13]=f}else f=t[13];let p;return t[24]===f?p=t[25]:(p=(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:f}),t[24]=f,t[25]=p),p}function en(e,t){return t.createdAtMs-e.createdAtMs}function tn(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 nn(e){let t=(0,et.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-BrVJXmYf.js → binary-plugins-Bg8ARZUH.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-DaLmc4W1.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-DG4HLOER.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};
|