@xopcai/xopc 0.0.272 → 0.0.273
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/README.md +1 -5
- package/README.zh-CN.md +1 -5
- package/dist/browser-ext/dist/assets/{auth-C1QI-uMG.js → auth-DkwOUI6_.js} +101 -53
- package/dist/browser-ext/dist/background.js +1 -22
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +24 -22
- package/dist/browser-ext/manifest.json +1 -12
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DffqjeqQ.js → activity-store-cF7IX2RP.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Cwj4HCYY.js → agent-avatar-dicebear-BrgxX8nG.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-6CLfLxVc.js → agent-defaults-settings-panel-DvhuRCLA.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-B6mu64fY.js → agents-C0By2FIo.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CGLdye4i.js → api-CYkdUpkx.js} +1 -1
- package/dist/gateway/static/root/assets/app-link-BiBXVEvp.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BLujSbaw.js → app-management-settings-panel-DfoNzWIa.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BXMcueb8.js → appearance-settings-czbLdCqj.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BEgy4hY3.js → apps-page-BSJXKWcE.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-D4bUampf.js → archive-plugin-D14P13mX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CBGNA2Ys.js → attachment-load-Dok_B1Gv.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-dQyolNmy.js → automations-page-DM7ZEewI.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DxRFrmrV.js → automations-workspace--1TsZf3O.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-bbvp81h2.js → binary-plugins-CxNg6InF.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C8e6Wri4.js → block-editor-D22VcYnC.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-oJWJtQa6.js → browser-automation-inputs-6NWTLEpd.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CAcJQSjN.js → browser-automations-page-BrqySdbW.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-TLAlqcPo.js → browser-settings-page-DOHgQer_.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-z-K_jrZz.js → capabilities-settings-panel-Bpse_5K-.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-Dzrk33aB.js → channels-settings-yHsY174W.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-status-swr-CfOPNnVr.js → channels-status-swr-BUZimNmp.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-9ZOl92kh.js → chat-terminal-dock-CZPBNpMI.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-B1dIoRNi.js → connectors-page-B_wLKGnH.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-Dj6FRLF9.js → date-picker-Da_0QyLe.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-D1q89tVc.js → dependency-picker-D_djqzy7.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DfqZBvhp.js → desktop-pet-Celmbw-T.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-HCEh2MOm.js → desktop-pet-settings-CqNNgF45.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-B5_w9qlm.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-C8cAWVoK.js → extension-debug-page-ku3kCjvH.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-5N87Vaym.js → extension-page-C7FpHwL4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-D85SAUFP.js → extension-settings-page-OMj2tU2_.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BjsDnB_n.js → gateway-config-swr-6eb1vKE1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Dqx8PmcT.js → gateway-settings-CH-6vkgN.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BIf0eLWX.js → gateway-startup-retry-DUFFCU8H.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BpDWGE1a.js → heartbeat-settings-CSFzOACM.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-DJaqpC8-.js → home-page-BJebAKB-.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-1m8xTVS_.js → image-generation-api-C1cHRBRp.js} +1 -1
- package/dist/gateway/static/root/assets/{index-C6PmD0cK.js → index-C6OWYFtQ.js} +9 -9
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Byy8mCSq.js → keyboard-shortcuts-settings-BuvD3iv8.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-l2AEiG2C.js → local-app-workbench-page-CaC4-THD.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BPo0wBgM.js → local-apps-page-DdJ8zwBp.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CRNble2Z.js → locale-store-BBSCIl4I.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-X5FdLlXK.js → logs-page-BaR2he0K.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DT6NoIjm.js → management-settings-r-iYWZFY.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-c5vtnYe8.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-Bzka9qXu.js → media-plugins-D_a6GDY6.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-DH_HCgmw.js → messages-DjuBdDCn.js} +2 -2
- package/dist/gateway/static/root/assets/{note-detail-panel-BUJPoaGZ.js → note-detail-panel-BV6nbgac.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-BwFpWRuo.js → notes-page-BmLKoWwi.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-Ys0p65Lt.js → page-tabs-C7Le9bSI.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-iknB5xEp.js → preview-open-alternatives-B2pOxJBK.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-card-BPZDgNNR.js → proactive-card-BlQ1vCtV.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-CxdZR-p2.js → proactive-page-CghKTfYa.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-W1o3f-kz.js → product-open-page-DpjiHgwu.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BU1RKAcy.js → project-detail-page-CV8Lh296.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-z0X0tL8G.js → projects-page-COweOaJP.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DmYFpjsH.js → registry-api-CyQ4k1Ux.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-NNTut2I8.js → remote-access-hub-ChPPGVU5.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DP1XyYO8.js → runtime-tools-settings-panel-Bl4ArLHf.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BMYKdzsH.js → schema-form-KQFmfWd4.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-B6SsHlz5.js → sessions-page-DgmHibOK.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DV7kMco2.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-2LGjz7bu.js → settings-form-section-Dbnls9ty.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-7DjpC9_C.js → settings-page-CDKirYRG.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Dj9jFWJt.js → setup-status-panel-SQmtWoOs.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BxYdSi8c.js → share-preview-page-DwgLjS1m.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CMqE0KuK.js → shares-settings-Cs5bUrYw.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DyKrjq7F.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DNEScMZH.js → skills-page-Bd0_ED_p.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-q88l65YU.js → skills-page.utils-rA-XT-YG.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-8NIssGKj.js → system-settings-panel-CSkMrHLz.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-L6dp9v2y.js → task-detail-page-CEQU-L_G.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BXZG3S25.js → theme-store-DWpIEWen.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-COJcGnEi.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-BwQuoTQU.js → use-autosave-DkQAIAuB.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-D4BucMrZ.js → user-model-page-BQAU55lf.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bd03Ic0s.js → voice-api-key-field-BrqcH0P-.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-gggUp3u9.js → voice-config-api-BJ95Z3pT.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DF8PR_pK.js → work-discovery-overlay-vfTWKm13.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BiAAWlir.js → workflow-run-setup-panel-CHdr_ng9.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DryKUMfA.js → workflows-page-hwRJD7vR.js} +1 -1
- package/dist/gateway/static/root/index.html +10 -9
- package/dist/package.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.d.ts +6 -0
- package/dist/src/browser/providers/browser-ext-install.js +16 -1
- package/dist/src/cli/commands/gateway/run-foreground.js +8 -5
- package/dist/src/cli/commands/gateway/service.js +4 -3
- package/dist/src/cli/commands/gateway/token.js +28 -1
- package/dist/src/gateway/device-routes.js +4 -3
- package/dist/src/gateway/hono/routes/browser.js +26 -0
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -3
- package/package.json +4 -4
- package/dist/browser-ext/dist/pairing-handoff.js +0 -51
- package/dist/gateway/static/root/assets/device-pairing-wizard-CPth92s6.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-AglreSOj.js +0 -201
- package/dist/gateway/static/root/assets/settings-advanced-gate-BQu8bAcN.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BXqSJymN.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-CWsRPM84.js +0 -1
package/dist/gateway/static/root/assets/{proactive-page-CxdZR-p2.js → proactive-page-CghKTfYa.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{h as i,t as a}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{n as o,r as s}from"./popover-select-Dz_Qis2R.js";import{n as c}from"./locale-store-CRNble2Z.js";import{i as l}from"./vendor-swr-BIWyz7Rc.js";import{t as u}from"./button-B11EPpor.js";import{t as d}from"./skeleton-BwbyijEw.js";import{t as f}from"./electron-env-DH5wF8X8.js";import{Jt as p,Kt as m,Yt as h,qt as g,ra as _}from"./index-C6PmD0cK.js";import{a as v,c as y,d as b,f as x,i as S,l as C,n as w,o as T,r as E,s as D,t as O,u as k}from"./proactive-card-BPZDgNNR.js";var ee=n(),A=e(t(),1),j=r();function M({zh:e}){let[t,n]=(0,A.useState)(m),[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)(``),s=l(t?`/api/proactive/web-push/probes`:null,p,{refreshInterval:1e4});async function c(){i(!0),o(``);try{let e=localStorage.getItem(g());if(!e)throw Error(`Enable this browser first`);await h(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}/test`,`POST`,{}),await s.mutate()}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}let d=!f()&&window.isSecureContext&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;async function _(){i(!0),o(``);try{if(t){let e=localStorage.getItem(g());e&&await h(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}`,`DELETE`,{}),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe(),localStorage.removeItem(g()),n(!1);return}if(await Notification.requestPermission()!==`granted`)throw Error(e?`浏览器未允许通知。`:`Browser notification permission was not granted.`);let{publicKey:r}=await h(`/api/proactive/web-push/prepare`,`POST`,{});await navigator.serviceWorker.register(`/notification-sw.js`);let i=await navigator.serviceWorker.ready,{id:a}=await h(`/api/proactive/web-push/subscriptions`,`POST`,{subscription:(await i.pushManager.getSubscription()??await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:r})).toJSON(),language:e?`zh`:`en`});localStorage.setItem(g(),a),n(!0)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}return(0,j.jsxs)(`section`,{className:`max-w-2xl rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:e?`网页关闭后也接收提醒`:`Receive alerts when this page is closed`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:e?`应用在线时可将重要变化送到这台设备。锁屏只显示通用提示,详情在应用内查看。`:`When the app is online, important changes can reach this device. Lock-screen alerts stay generic; open the app for details.`}),(0,j.jsx)(u,{className:`mt-4`,disabled:r||!d,onClick:()=>void _(),children:d?t?e?`关闭这台设备的提醒`:`Disable alerts on this device`:e?`在这台设备上提醒我`:`Notify me on this device`:e?`当前设备不支持系统提醒`:`System notifications are unavailable here`}),t&&(0,j.jsx)(u,{className:`ml-2 mt-4`,disabled:r,onClick:()=>void c(),children:e?`向此浏览器发送测试通知`:`Send a test to this browser`}),s.data?.probes.slice(0,3).map(t=>(0,j.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[new Date(t.createdAt).toLocaleString(),` · `,t.status===`opened`?e?`已点击打开`:`Opened`:t.status===`accepted`?e?`提供方已接受,等待点击确认`:`Provider accepted; awaiting open confirmation`:t.status,t.error&&` · ${t.error}`]},t.id)),a&&(0,j.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:a})]})}var N=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`,P=e=>{let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16)};function F({zh:e,onStarted:t,open:n,onOpen:r}){let i=l(n?`/api/proactive/follow-ups/sources`:null,p),[c,f]=(0,A.useState)(``),[m,g]=(0,A.useState)(``),[_,v]=(0,A.useState)(()=>P(new Date(Date.now()+864e5).toISOString())),[y,b]=(0,A.useState)(!1),[x,S]=(0,A.useState)(``);async function C(){b(!0),S(``);try{await h(`/api/proactive/follow-ups`,`POST`,{sourceItemId:c,instructions:m,dueAt:new Date(_).toISOString()}),t()}catch(e){S(String(e))}finally{b(!1)}}return(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:e?`替我跟进这封邮件`:`Follow this email for me`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:e?`记住等谁回复,收到变化时整理重点,到时间后准备跟进草稿。`:`Watch replies, explain changes and prepare a follow-up draft when it is time.`}),n?i.isLoading?(0,j.jsx)(d,{className:`mt-4 h-40`}):i.data?.sources.length?(0,j.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e?`最近授权同步的邮件`:`Recently synchronized email`,(0,j.jsxs)(o,{value:c,onChange:e=>f(e.target.value),children:[(0,j.jsx)(s,{value:``,children:e?`选择邮件`:`Choose email`}),i.data.sources.map(e=>(0,j.jsxs)(s,{value:e.id,children:[e.subject,` · `,e.sender,` · `,e.accountLabel]},e.id))]})]}),(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e?`希望跟进到什么结果?`:`What outcome are you waiting for?`,(0,j.jsx)(`textarea`,{className:N,rows:3,maxLength:12e3,value:m,onChange:e=>g(e.target.value),placeholder:e?`例如:等客户确认评审时间,没回复就帮我准备一封简短的跟进邮件。`:`For example: wait for a review date and prepare a short follow-up if there is no reply.`})]}),(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e?`最晚什么时候再跟进?(本地时间)`:`When should I follow up? (Local time)`,(0,j.jsx)(`input`,{type:`datetime-local`,className:N,value:_,onChange:e=>v(e.target.value)})]}),(0,j.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`只跟进这段邮件往来。草稿由你审阅后在对话中办理,发出后继续等待实际回复。`:`Follows this thread only. Review drafts and continue sending in chat; follow-up continues after sending.`}),(0,j.jsx)(u,{variant:`primary`,disabled:y||!c||!m.trim()||!_,onClick:()=>void C(),children:e?`交给你跟进`:`Start following`})]}):!i.error&&(0,j.jsxs)(`p`,{className:`mt-4 text-sm text-fg-muted`,children:[e?`还没有可跟进的邮件。`:`No email is available to follow yet.`,` `,(0,j.jsx)(a,{to:`/connectors`,className:`text-accent`,children:e?`连接邮箱并选择可用范围`:`Connect an email account and choose what is available`})]}):(0,j.jsx)(u,{className:`mt-3`,onClick:r,children:e?`选择一封邮件`:`Choose an email`}),(x||i.error)&&(0,j.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:x||String(i.error)})]})}function I(e){let t=(0,ee.c)(59),{follow:n,zh:r}=e,i=n.subject??(r?`邮件跟进`:`Email follow-up`),o;t[0]===i?o=t[1]:(o=(0,j.jsx)(`h2`,{className:`font-semibold text-fg`,children:i}),t[0]=i,t[1]=o);let s;t[2]===n.instructions?s=t[3]:(s=(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.instructions}),t[2]=n.instructions,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=`/assistant-work?follow-up=${encodeURIComponent(n.id)}`,u=r?`查看`:`View`,d;t[7]!==l||t[8]!==u?(d=(0,j.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:l,children:u}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==c||t[11]!==d?(f=(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[c,d]}),t[10]=c,t[11]=d,t[12]=f):f=t[12];let p=r?`当前状态`:`Current state`,m;t[13]===p?m=t[14]:(m=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:p}),t[13]=p,t[14]=m);let h;t[15]!==n||t[16]!==r?(h=k(n,r),t[15]=n,t[16]=r,t[17]=h):h=t[17];let g;t[18]===h?g=t[19]:(g=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:h}),t[18]=h,t[19]=g);let _;t[20]!==m||t[21]!==g?(_=(0,j.jsxs)(`div`,{children:[m,g]}),t[20]=m,t[21]=g,t[22]=_):_=t[22];let v=r?`接下来`:`Next`,y;t[23]===v?y=t[24]:(y=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:v}),t[23]=v,t[24]=y);let b;t[25]!==n.dueAt||t[26]!==n.status||t[27]!==r?(b=n.status===`completed`?r?`不会再跟进`:`No more follow-up`:`${r?`约定时间`:`Follow up by`} ${T(n.dueAt,r)}`,t[25]=n.dueAt,t[26]=n.status,t[27]=r,t[28]=b):b=t[28];let x;t[29]===b?x=t[30]:(x=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:b}),t[29]=b,t[30]=x);let S;t[31]!==y||t[32]!==x?(S=(0,j.jsxs)(`div`,{children:[y,x]}),t[31]=y,t[32]=x,t[33]=S):S=t[33];let C=r?`最新成果或决定`:`Latest result or decision`,w;t[34]===C?w=t[35]:(w=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:C}),t[34]=C,t[35]=w);let E=n.latestDirection===`received`?r?`发现新的回复,等待整理`:`A new reply is ready to review`:r?`还没有需要交付的新成果`:`No new result needs delivery yet`,D;t[36]===E?D=t[37]:(D=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:E}),t[36]=E,t[37]=D);let O;t[38]!==w||t[39]!==D?(O=(0,j.jsxs)(`div`,{children:[w,D]}),t[38]=w,t[39]=D,t[40]=O):O=t[40];let A=r?`最近核对`:`Last checked`,M;t[41]===A?M=t[42]:(M=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:A}),t[41]=A,t[42]=M);let N;t[43]!==n.lastCheckedAt||t[44]!==r?(N=n.lastCheckedAt?T(n.lastCheckedAt,r):r?`尚未完成首次核对`:`First check has not completed`,t[43]=n.lastCheckedAt,t[44]=r,t[45]=N):N=t[45];let P;t[46]===N?P=t[47]:(P=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:N}),t[46]=N,t[47]=P);let F;t[48]!==M||t[49]!==P?(F=(0,j.jsxs)(`div`,{children:[M,P]}),t[48]=M,t[49]=P,t[50]=F):F=t[50];let I;t[51]!==_||t[52]!==S||t[53]!==O||t[54]!==F?(I=(0,j.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[_,S,O,F]}),t[51]=_,t[52]=S,t[53]=O,t[54]=F,t[55]=I):I=t[55];let L;return t[56]!==I||t[57]!==f?(L=(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[f,I]}),t[56]=I,t[57]=f,t[58]=L):L=t[58],L}function L({follow:e,zh:t,refresh:n}){let[r,i]=(0,A.useState)(!1),[o,s]=(0,A.useState)(e.instructions),[c,l]=(0,A.useState)(P(e.dueAt)),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(``);async function g(t){f(!0),m(``);try{await h(`/api/proactive/follow-ups/${encodeURIComponent(e.id)}`,`PATCH`,{expectedRevision:e.revision,...t}),i(!1),n()}catch(e){m(String(e))}finally{f(!1)}}let _=k(e,t);return(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:e.subject??(t?`邮件跟进`:`Email follow-up`)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:_}),(0,j.jsx)(`p`,{className:`mt-3 whitespace-pre-wrap text-sm`,children:e.instructions}),(0,j.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t?`约定跟进时间:`:`Follow up by: `,T(e.dueAt,t)]}),e.lastCheckedAt&&(0,j.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[t?`最近核对邮件:`:`Last email check: `,T(e.lastCheckedAt,t)]}),e.lastSyncedAt&&(0,j.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[t?`邮箱最近同步:`:`Email last synchronized: `,T(e.lastSyncedAt,t)]}),e.syncFailed&&(0,j.jsx)(`p`,{className:`mt-2 text-sm text-danger`,children:t?`最近一次邮箱同步失败,当前结果可能尚未包含新回复。请检查邮箱连接。`:`The latest email sync failed. Current work may not include new replies. Check your email connection.`}),!e.sourceAvailable&&(0,j.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/connectors`,children:t?`检查邮箱连接`:`Check email connection`}),e.sessionKey&&(0,j.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/chat/${encodeURIComponent(e.sessionKey)}`,children:t?`继续原来的对话`:`Continue the conversation`}),r&&(0,j.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,j.jsx)(`textarea`,{"aria-label":t?`跟进要求`:`Instructions`,className:N,rows:3,maxLength:12e3,value:o,onChange:e=>s(e.target.value)}),(0,j.jsx)(`input`,{"aria-label":t?`跟进时间`:`Follow-up time`,type:`datetime-local`,className:N,value:c,onChange:e=>l(e.target.value)}),(0,j.jsx)(u,{disabled:d||!o.trim()||!c,onClick:()=>void g({instructions:o,...P(e.dueAt)===c?{}:{dueAt:new Date(c).toISOString()}}),children:t?`保存要求`:`Save instructions`})]}),(0,j.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,j.jsx)(u,{variant:`ghost`,disabled:d,onClick:()=>i(!r),children:r?t?`取消修改`:`Cancel edit`:t?`调整跟进要求`:`Adjust follow-up`}),(0,j.jsx)(u,{variant:`ghost`,disabled:d,onClick:()=>void g({status:e.status===`watching`?`paused`:`watching`}),children:e.status===`watching`?t?`暂停`:`Pause`:t?`重新跟进`:`Resume`}),e.status!==`completed`&&(0,j.jsx)(u,{variant:`ghost`,disabled:d,onClick:()=>void g({status:`completed`}),children:t?`结束这件事的跟进`:`End this follow-up`})]}),p&&(0,j.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:p})]})}var R=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;function z(e){let t=(0,ee.c)(64),{sub:n,card:r,zh:i}=e,o;t[0]!==n||t[1]!==i?(o=v(n,i),t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]===o?s=t[4]:(s=(0,j.jsx)(`h2`,{className:`font-semibold text-fg`,children:o}),t[3]=o,t[4]=s);let c;t[5]===n.userInstructions?c=t[6]:(c=(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.userInstructions}),t[5]=n.userInstructions,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=`/assistant-work?delegation=${encodeURIComponent(n.id)}`,d=i?`查看`:`View`,f;t[10]!==u||t[11]!==d?(f=(0,j.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:u,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==l||t[14]!==f?(p=(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15];let m=i?`当前状态`:`Current state`,h;t[16]===m?h=t[17]:(h=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:m}),t[16]=m,t[17]=h);let g;t[18]!==n||t[19]!==i?(g=S(n,i),t[18]=n,t[19]=i,t[20]=g):g=t[20];let _;t[21]===g?_=t[22]:(_=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:g}),t[21]=g,t[22]=_);let b;t[23]!==h||t[24]!==_?(b=(0,j.jsxs)(`div`,{children:[h,_]}),t[23]=h,t[24]=_,t[25]=b):b=t[25];let x=i?`接下来`:`Next`,C;t[26]===x?C=t[27]:(C=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:x}),t[26]=x,t[27]=C);let w;t[28]!==n||t[29]!==i?(w=E(n,i),t[28]=n,t[29]=i,t[30]=w):w=t[30];let D;t[31]===w?D=t[32]:(D=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:w}),t[31]=w,t[32]=D);let O;t[33]!==C||t[34]!==D?(O=(0,j.jsxs)(`div`,{children:[C,D]}),t[33]=C,t[34]=D,t[35]=O):O=t[35];let k=i?`最新成果或决定`:`Latest result or decision`,A;t[36]===k?A=t[37]:(A=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:k}),t[36]=k,t[37]=A);let M;t[38]!==r||t[39]!==i?(M=y(r,i),t[38]=r,t[39]=i,t[40]=M):M=t[40];let N;t[41]===M?N=t[42]:(N=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:M}),t[41]=M,t[42]=N);let P;t[43]!==A||t[44]!==N?(P=(0,j.jsxs)(`div`,{children:[A,N]}),t[43]=A,t[44]=N,t[45]=P):P=t[45];let F=i?`最近核对`:`Last checked`,I;t[46]===F?I=t[47]:(I=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:F}),t[46]=F,t[47]=I);let L;t[48]!==n.latestRun||t[49]!==i?(L=n.latestRun?.completedAt?T(n.latestRun.completedAt,i):i?`尚未完成首次核对`:`First check has not completed`,t[48]=n.latestRun,t[49]=i,t[50]=L):L=t[50];let R;t[51]===L?R=t[52]:(R=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:L}),t[51]=L,t[52]=R);let z;t[53]!==I||t[54]!==R?(z=(0,j.jsxs)(`div`,{children:[I,R]}),t[53]=I,t[54]=R,t[55]=z):z=t[55];let B;t[56]!==b||t[57]!==O||t[58]!==P||t[59]!==z?(B=(0,j.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[b,O,P,z]}),t[56]=b,t[57]=O,t[58]=P,t[59]=z,t[60]=B):B=t[60];let V;return t[61]!==B||t[62]!==p?(V=(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[p,B]}),t[61]=B,t[62]=p,t[63]=V):V=t[63],V}function B({sub:e,card:t,zh:n,refresh:r}){let i=l(`/api/proactive/subscriptions/${encodeURIComponent(e.id)}/runs`,p,{revalidateOnFocus:!1}),[o,s]=(0,A.useState)(`latest`),[c,f]=(0,A.useState)(e.userInstructions),[m,g]=(0,A.useState)(!1),[_,y]=(0,A.useState)(!1),[C,w]=(0,A.useState)(``);async function D(t,n=!1){y(!0),w(``);try{await h(`/api/proactive/subscriptions/${encodeURIComponent(e.id)}${n?`/check`:``}`,n?`POST`:`PATCH`,n?{}:{...t,expectedRevision:e.revision}),g(!1),r()}catch(e){w(String(e))}finally{y(!1)}}let k=[[`latest`,n?`最新成果`:`Latest result`],[`progress`,n?`进展记录`:`Progress`],[`requirements`,n?`关注要求`:`Instructions`]];return(0,j.jsxs)(`div`,{className:`space-y-5`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:v(e,n)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:S(e,n)})]}),(0,j.jsx)(`nav`,{className:`flex gap-2`,"aria-label":n?`事项详情`:`Work details`,children:k.map(([e,t])=>(0,j.jsx)(u,{variant:o===e?`secondary`:`ghost`,onClick:()=>s(e),children:t},e))}),o===`latest`&&(t?(0,j.jsx)(O,{card:t,copy:x(n),refresh:r,detail:!0}):(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-6`,children:[(0,j.jsx)(`h2`,{className:`font-medium text-fg`,children:n?`还没有需要你处理的新成果`:`No new result needs your attention`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:E(e,n)})]})),o===`progress`&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsxs)(`dl`,{className:`space-y-4 text-sm`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前状态`:`Current state`}),(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:S(e,n)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`接下来`:`Next`}),(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:E(e,n)})]})]}),(0,j.jsxs)(`div`,{className:`mt-5 border-t border-edge pt-4`,children:[(0,j.jsx)(`h2`,{className:`text-sm font-medium text-fg`,children:n?`最近进展`:`Recent progress`}),i.isLoading?(0,j.jsx)(d,{className:`mt-3 h-24 rounded-xl`}):i.data?.runs.length?(0,j.jsx)(`ol`,{className:`mt-3 divide-y divide-edge-subtle`,children:i.data.runs.map(e=>(0,j.jsxs)(`li`,{className:`py-3 text-sm`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`text-fg`,children:b(e.reason??e.status,n)}),(0,j.jsx)(`time`,{className:`text-xs text-fg-subtle`,dateTime:e.completedAt??e.startedAt,children:T(e.completedAt??e.startedAt,n)})]}),e.error&&(0,j.jsx)(`p`,{className:`mt-1 text-danger`,children:e.error})]},e.id))}):(0,j.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:n?`还没有完成第一次核对。`:`The first check has not completed yet.`}),i.error&&(0,j.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:String(i.error)})]}),e.project&&(0,j.jsx)(a,{className:`mt-4 inline-block text-sm text-accent`,to:`/projects/${encodeURIComponent(e.scopeId)}`,children:n?`打开相关项目`:`Open related project`})]}),o===`requirements`&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-fg`,children:e.userInstructions}),m&&(0,j.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[n?`希望我关注什么,忽略什么?`:`What should I follow or ignore?`,(0,j.jsx)(`textarea`,{rows:5,maxLength:12e3,className:R,value:c,onChange:e=>f(e.target.value)})]}),!e.completedAt&&(0,j.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[m?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(u,{disabled:_||!c.trim(),onClick:()=>void D({userInstructions:c}),children:n?`保存要求`:`Save instructions`}),(0,j.jsx)(u,{variant:`ghost`,onClick:()=>g(!1),children:n?`取消`:`Cancel`})]}):(0,j.jsx)(u,{variant:`ghost`,onClick:()=>g(!0),children:n?`调整要求`:`Adjust instructions`}),(0,j.jsx)(u,{variant:`ghost`,disabled:_,onClick:()=>void D({enabled:!e.enabled}),children:e.enabled?n?`暂停`:`Pause`:n?`恢复`:`Resume`}),e.scopeKind===`project`&&e.enabled&&(0,j.jsx)(u,{variant:`ghost`,disabled:_||e.pending,onClick:()=>void D({},!0),children:n?`现在核对`:`Check now`}),(0,j.jsx)(u,{variant:`ghost`,disabled:_,onClick:()=>void D({enabled:!1,completedAt:new Date().toISOString()}),children:n?`结束这件事`:`End this work`})]})]}),C&&(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:C})]})}function V({zh:e,onStarted:t,projectId:n}){let r=l(`/api/proactive/templates`,p),i=l(`/api/projects?limit=200`,p),[c,f]=(0,A.useState)(``),[m,g]=(0,A.useState)(n?`project_delivery_risk`:null),[v,y]=(0,A.useState)(n??``),[b,x]=(0,A.useState)(``),[S,C]=(0,A.useState)(!1),[w,T]=(0,A.useState)(``);async function E(){C(!0),T(``);try{await h(`/api/proactive/delegations`,`POST`,{scenarioKey:m,...m===`project_delivery_risk`?{projectId:v}:{},instructions:b}),t()}catch(e){T(String(e))}finally{C(!1)}}if(r.isLoading||i.isLoading)return(0,j.jsx)(d,{className:`h-52 rounded-2xl`});let D={project_delivery_risk:[e?`盯住项目交付`:`Follow project delivery`,e?`关注阻塞和承诺,提前准备处理清单。`:`Watch blockers and commitments, then prepare a useful checklist.`],meeting_preparation:[e?`开会前替我准备`:`Prepare me for meetings`,e?`整理目标、资料和需要决定的问题。`:`Prepare goals, context, and decisions before meetings.`],communication_follow_up:[e?`替我跟进一封邮件`:`Follow an email for me`,e?`等回复,整理变化,到时间准备跟进草稿。`:`Watch for replies and prepare a draft when it is time.`]},O=c.trim()?_(`${c.trim()}\n\n${e?`请把这件事作为持续跟进的事项记住,并先和我确认目标、范围与提醒方式。`:`Remember this as delegated work and first confirm the goal, scope, and notification preference with me.`}`,void 0,{projectScope:`none`}):null;return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:e?`想让我持续替你做什么?`:`What should I keep doing for you?`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e?`直接说目标。助理会在对话中确认范围,再开始跟进。`:`Describe the outcome. The assistant will confirm the scope in chat before following it.`}),(0,j.jsx)(`textarea`,{className:R,rows:4,value:c,onChange:e=>f(e.target.value),placeholder:e?`例如:帮我盯住官网改版,发现会影响月底上线的问题就告诉我,并提前准备解决方案。`:`For example: watch the website redesign and tell me about anything that threatens the launch, with a proposed fix.`}),O&&(0,j.jsx)(u,{asChild:!0,variant:`primary`,className:`mt-3`,children:(0,j.jsx)(a,{to:O,children:e?`交给助理`:`Delegate to assistant`})})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`h2`,{className:`mb-3 text-sm font-medium text-fg-muted`,children:e?`也可以从这些常见事项开始`:`Or start with a common request`}),(0,j.jsx)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:Object.entries(D).map(([e,[t,n]])=>(0,j.jsxs)(`button`,{type:`button`,className:`rounded-2xl border p-4 text-left transition-colors ${m===e?`border-accent bg-accent-soft`:`border-edge bg-surface-panel hover:bg-surface-hover`}`,onClick:()=>{g(e),x(n)},children:[(0,j.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,j.jsx)(`span`,{className:`mt-2 block text-sm text-fg-muted`,children:n})]},e))})]}),m===`communication_follow_up`&&(0,j.jsx)(F,{zh:e,onStarted:t,open:!0,onOpen:()=>{}}),m&&m!==`communication_follow_up`&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium text-fg`,children:D[m]?.[0]}),m===`project_delivery_risk`&&(0,j.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[e?`关注哪个项目`:`Which project`,(0,j.jsxs)(o,{value:v,onChange:e=>y(e.target.value),children:[(0,j.jsx)(s,{value:``,children:e?`选择项目`:`Choose project`}),i.data?.items.map(e=>(0,j.jsx)(s,{value:e.id,children:e.name},e.id))]})]}),(0,j.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[e?`希望跟进到什么结果?`:`What outcome should I follow through to?`,(0,j.jsx)(`textarea`,{rows:4,className:R,maxLength:12e3,value:b,onChange:e=>x(e.target.value)})]}),m===`meeting_preparation`&&r.data?.templates.find(e=>e.key===m)?.calendarSource?.status!==`available`&&(0,j.jsxs)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:[e?`还没有可用的日历资料。`:`Calendar context is not available yet.`,` `,(0,j.jsx)(a,{className:`text-accent`,to:`/connectors`,children:e?`连接日历`:`Connect a calendar`})]}),(0,j.jsx)(u,{className:`mt-4`,variant:`primary`,disabled:S||!b.trim()||m===`project_delivery_risk`&&!v,onClick:()=>void E(),children:e?`开始跟进`:`Start following`})]}),(w||r.error||i.error)&&(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:w||String(r.error??i.error)})]})}var H=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function te(e){let t=(0,ee.c)(58),{value:n,onChange:r,zh:i}=e,a;t[0]===i?a=t[1]:(a=i?{all:`所有已启用设备`,auto:`自动选择一台设备`,browser:`浏览器 / 桌面`,mobile:`手机`,telegram:`Telegram`}:{all:`All enabled devices`,auto:`Choose one device`,browser:`Browser / desktop`,mobile:`Mobile`,telegram:`Telegram`},t[0]=i,t[1]=a);let s=a,c;t[2]!==r||t[3]!==n?(c=e=>r({...n,digestEnabled:e.target.checked}),t[2]=r,t[3]=n,t[4]=c):c=t[4];let l;t[5]!==c||t[6]!==n.digestEnabled?(l=(0,j.jsx)(`input`,{type:`checkbox`,checked:n.digestEnabled,onChange:c}),t[5]=c,t[6]=n.digestEnabled,t[7]=l):l=t[7];let u=i?`将提醒合并为每日摘要`:`Combine alerts into a daily digest`,d;t[8]!==l||t[9]!==u?(d=(0,j.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f=i?`摘要时间(使用上方时区)`:`Digest time (in your selected timezone)`,p=String(n.digestHour),m;t[11]===p?m=t[12]:(m=p.padStart(2,`0`),t[11]=p,t[12]=m);let h=String(n.digestMinute),g;t[13]===h?g=t[14]:(g=h.padStart(2,`0`),t[13]=h,t[14]=g);let _=`${m}:${g}`,v;t[15]!==r||t[16]!==n?(v=e=>{let[t,i]=e.target.value.split(`:`).map(Number);r({...n,digestHour:t,digestMinute:i})},t[15]=r,t[16]=n,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,j.jsx)(`input`,{className:H,type:`time`,required:!0,value:_,onChange:v}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==y||t[22]!==f?(b=(0,j.jsxs)(`label`,{className:`block text-sm`,children:[f,y]}),t[21]=y,t[22]=f,t[23]=b):b=t[23];let x=i?`提醒渠道`:`Notification channel`,S=n.preferredChannel,C;t[24]!==r||t[25]!==n?(C=e=>r({...n,preferredChannel:e.target.value}),t[24]=r,t[25]=n,t[26]=C):C=t[26];let w;t[27]===s?w=t[28]:(w=Object.entries(s).map(U),t[27]=s,t[28]=w);let T;t[29]!==C||t[30]!==w||t[31]!==n.preferredChannel?(T=(0,j.jsx)(o,{value:S,onChange:C,children:w}),t[29]=C,t[30]=w,t[31]=n.preferredChannel,t[32]=T):T=t[32];let E;t[33]!==x||t[34]!==T?(E=(0,j.jsxs)(`label`,{className:`block text-sm`,children:[x,T]}),t[33]=x,t[34]=T,t[35]=E):E=t[35];let D=i?`自动选择优先使用最近注册的浏览器,否则选择一台手机。免打扰期间的重要提醒会合并为一份摘要。`:`Automatic selection prefers the most recently registered browser, then one mobile device. Important alerts during quiet hours are combined into one digest.`,O;t[36]===D?O=t[37]:(O=(0,j.jsx)(`p`,{className:`text-xs text-fg-muted`,children:D}),t[36]=D,t[37]=O);let k;t[38]!==r||t[39]!==n?(k=e=>r({...n,suppressWhileViewing:e.target.checked}),t[38]=r,t[39]=n,t[40]=k):k=t[40];let A;t[41]!==k||t[42]!==n.suppressWhileViewing?(A=(0,j.jsx)(`input`,{type:`checkbox`,checked:n.suppressWhileViewing,onChange:k}),t[41]=k,t[42]=n.suppressWhileViewing,t[43]=A):A=t[43];let M=i?`正在查看卡片时不再发送系统提醒`:`Skip system alerts while viewing cards`,N;t[44]!==A||t[45]!==M?(N=(0,j.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[A,M]}),t[44]=A,t[45]=M,t[46]=N):N=t[46];let P;t[47]!==r||t[48]!==n||t[49]!==i?(P=n.preferredChannel===`telegram`&&(0,j.jsxs)(`fieldset`,{className:`space-y-3 rounded-xl border border-edge p-3`,children:[(0,j.jsx)(`legend`,{className:`px-1 text-sm`,children:`Telegram`}),[`chatId`,`accountId`,`publicUrl`].map(e=>(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e===`chatId`?i?`接收对话 ID`:`Destination chat ID`:e===`accountId`?i?`账号 ID(可选)`:`Account ID (optional)`:i?`可从外部访问的控制台 HTTPS 地址`:`Public HTTPS console URL`,(0,j.jsx)(`input`,{className:H,required:e!==`accountId`,value:n.telegram?.[e]??``,onChange:t=>r({...n,telegram:{chatId:n.telegram?.chatId??``,publicUrl:n.telegram?.publicUrl??``,...n.telegram?.accountId?{accountId:n.telegram.accountId}:{},[e]:e===`accountId`?t.target.value||void 0:t.target.value}})})]},e)),(0,j.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`需要已连接 Telegram 渠道。发送通用摘要和卡片链接;链接中不要填写访问令牌。`:`Connect the Telegram channel first. Alerts contain a generic summary and a card link. Do not put access tokens in the URL.`})]}),t[47]=r,t[48]=n,t[49]=i,t[50]=P):P=t[50];let F;return t[51]!==b||t[52]!==E||t[53]!==O||t[54]!==N||t[55]!==P||t[56]!==d?(F=(0,j.jsxs)(`div`,{className:`space-y-4 border-t border-edge pt-4`,children:[d,b,E,O,N,P]}),t[51]=b,t[52]=E,t[53]=O,t[54]=N,t[55]=P,t[56]=d,t[57]=F):F=t[57],F}function U(e){let[t,n]=e;return(0,j.jsx)(s,{value:t,children:n},t)}var W=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function ne({preferences:e,copy:t,refresh:n}){let[r,i]=(0,A.useState)(e),[a,c]=(0,A.useState)(!1),[l,d]=(0,A.useState)(``);async function f(i=r){c(!0),d(``);try{let{revision:a,...o}={...r,...i};await h(`/api/proactive/preferences`,`PATCH`,{...o,expectedRevision:e.revision}),d(t.saved),n()}catch(e){d(e instanceof Error?e.message:String(e))}finally{c(!1)}}return(0,j.jsxs)(`form`,{className:`max-w-2xl space-y-5 rounded-2xl border border-edge bg-surface-panel p-5`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,j.jsxs)(`label`,{className:`block text-sm`,children:[t.level,(0,j.jsx)(o,{value:r.level,onChange:e=>i({...r,level:e.target.value}),children:Object.entries(t.levels).map(([e,t])=>(0,j.jsx)(s,{value:e,children:t},e))})]}),(0,j.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.timezone,(0,j.jsx)(`input`,{required:!0,className:W,value:r.timezone,onChange:e=>i({...r,timezone:e.target.value})})]}),(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.limit,(0,j.jsx)(`input`,{required:!0,type:`number`,min:0,max:30,className:W,value:r.dailyNotificationLimit,onChange:e=>i({...r,dailyNotificationLimit:Number(e.target.value)})})]}),(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.quietStart,(0,j.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietStartHour,onChange:e=>i({...r,quietStartHour:Number(e.target.value)})})]}),(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.quietEnd,(0,j.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietEndHour,onChange:e=>i({...r,quietEndHour:Number(e.target.value)})})]})]}),(0,j.jsx)(te,{value:r,onChange:i,zh:t.locale===`zh`}),(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.privacy}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,j.jsx)(u,{type:`submit`,variant:`primary`,disabled:a,children:t.save}),(0,j.jsx)(u,{disabled:a,onClick:()=>void f({pausedUntil:new Date(Date.now()+36e5).toISOString()}),children:t.pause}),e.pausedUntil&&(0,j.jsx)(u,{disabled:a,onClick:()=>void f({pausedUntil:null}),children:t.resume})]}),l&&(0,j.jsx)(`p`,{role:`status`,className:`text-sm`,children:l})]})}function G(){let e=(0,ee.c)(61),t=c(ae)===`zh`,n;e[0]===t?n=e[1]:(n=x(t),e[0]=t,e[1]=n);let r=n,[o,s]=i(),f;e[2]===o?f=e[3]:(f=o.get(`view`),e[2]=o,e[3]=f);let m=f,g=m===`new`||m===`settings`?m:`list`,_;e[4]===o?_=e[5]:(_=o.get(`state`),e[4]=o,e[5]=_);let v=_,y=v===`paused`||v===`completed`?v:`active`,b;e[6]===o?b=e[7]:(b=o.get(`item`),e[6]=o,e[7]=b);let S=b,T;e[8]===o?T=e[9]:(T=o.get(`digest`),e[8]=o,e[9]=T);let E=T,k;e[10]===o?k=e[11]:(k=o.get(`delegation`),e[10]=o,e[11]=k);let N=k,P;e[12]===o?P=e[13]:(P=o.get(`follow-up`),e[12]=o,e[13]=P);let F=P,R=g===`list`||!!(N||F),H=l(g===`settings`?`/api/proactive/preferences`:null,p),te;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(te={refreshInterval:15e3},e[14]=te):te=e[14];let U=l(R?`/api/proactive/overview`:null,p,te),W;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(W={revalidateOnFocus:!1},e[15]=W):W=e[15];let G=l(S?`/api/inbox/judgments/${encodeURIComponent(S)}`:null,p,W),K=l(E?`/api/proactive/digests/${encodeURIComponent(E)}`:null,p),oe;e[16]===o?oe=e[17]:(oe=o.get(`probe`),e[16]=o,e[17]=oe);let se=oe,ce,le;e[18]===se?(ce=e[19],le=e[20]):(ce=()=>{se&&h(`/api/proactive/web-push/probes/${encodeURIComponent(se)}/opened`,`POST`,{}).catch(ie)},le=[se],e[18]=se,e[19]=ce,e[20]=le),(0,A.useEffect)(ce,le);let q=G.error??U.error??H.error??K.error,ue=G.isLoading||U.isLoading||H.isLoading||K.isLoading,J,Y,X,Z,Q;if(e[21]!==y||e[22]!==r||e[23]!==N||e[24]!==G||e[25]!==K||e[26]!==E||e[27]!==q||e[28]!==F||e[29]!==S||e[30]!==ue||e[31]!==U||e[32]!==o||e[33]!==H||e[34]!==s||e[35]!==g||e[36]!==t){Q=Symbol.for(`react.early_return_sentinel`);bb0:{let n=U.data?[...U.data.needsDecision,...U.data.prepared,...U.data.updates]:[],i=U.data?.delegations.filter(re)??[],c;e[42]===y?c=e[43]:(c=e=>w(e)===y,e[42]=y,e[43]=c);let l=i.filter(c),f=U.data?.followUps.filter(e=>C(e)===y)??[],p;e[44]===N?p=e[45]:(p=e=>e.id===N,e[44]=N,e[45]=p);let m=i.find(p),h;e[46]!==F||e[47]!==U.data?.followUps?(h=U.data?.followUps.find(e=>e.id===F),e[46]=F,e[47]=U.data?.followUps,e[48]=h):h=e[48];let _=h,v;e[49]===s?v=e[50]:(v=e=>s(e),e[49]=s,e[50]=v);let b=v;if(ue){let t;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-base`,children:(0,j.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-5 px-4 py-7 sm:px-6`,children:[(0,j.jsx)(d,{className:`h-8 w-48`}),(0,j.jsx)(d,{className:`h-56 rounded-2xl`}),(0,j.jsx)(d,{className:`h-40 rounded-2xl`})]})}),e[51]=t):t=e[51],Q=t;break bb0}Z=`min-h-0 flex-1 overflow-y-auto bg-surface-base`,J=`mx-auto max-w-4xl space-y-6 px-4 py-7 sm:px-6`,e[52]===q?Y=e[53]:(Y=q&&(0,j.jsx)(`p`,{role:`alert`,className:`rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:String(q)}),e[52]=q,e[53]=Y),X=S?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/`,children:t?`返回工作台`:`Back to Workbench`}),G.data&&(0,j.jsx)(O,{card:G.data.card,copy:r,refresh:()=>void G.mutate(),detail:!0},`${G.data.card.id}:${G.data.card.revision}`)]}):E?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/`,children:t?`返回工作台`:`Back to Workbench`}),(0,j.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:t?`助理为你整理的变化`:`Updates prepared by your assistant`}),K.data?.cards.map(e=>(0,j.jsx)(O,{card:e,copy:r,refresh:()=>void K.mutate()},e.id)),K.data?.cards.length===0&&(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`这些事项已处理或不再需要关注。`:`These items have been handled or are no longer relevant.`})]}):m?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/assistant-work`,children:t?`返回交给我的事`:`Back to delegated work`}),(0,j.jsx)(B,{sub:m,card:D(n,m.id),zh:t,refresh:()=>void U.mutate()})]}):_?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/assistant-work`,children:t?`返回交给我的事`:`Back to delegated work`}),(0,j.jsx)(L,{follow:_,zh:t,refresh:()=>void U.mutate()})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:g===`new`?t?`交代一件事`:`Delegate something`:g===`settings`?t?`助理提醒`:`Assistant notifications`:t?`交给我的事`:`Delegated work`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:g===`new`?t?`说清目标,助理会记住并持续跟进。`:`Describe the goal and your assistant will follow it through.`:g===`settings`?t?`决定助理什么时候提醒你,以及通过什么方式送达。`:`Choose when and how your assistant should notify you.`:t?`查看助理记住的事项、当前进展和下一步。`:`Review remembered work, current progress, and what happens next.`})]}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[g!==`list`&&(0,j.jsx)(u,{variant:`ghost`,onClick:()=>b({}),children:t?`返回列表`:`Back to list`}),g===`list`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(u,{variant:`ghost`,onClick:()=>b({view:`settings`}),children:t?`助理提醒`:`Notifications`}),(0,j.jsx)(u,{variant:`primary`,onClick:()=>b({view:`new`}),children:t?`交代一件事`:`Delegate something`})]})]})]}),g===`settings`&&H.data?(0,j.jsxs)(`div`,{className:`space-y-5`,children:[(0,j.jsx)(ne,{preferences:H.data.preferences,copy:r,refresh:()=>void H.mutate()},H.data.preferences.revision),(0,j.jsx)(M,{zh:t})]}):g===`new`?(0,j.jsx)(V,{zh:t,projectId:o.get(`project`)??void 0,onStarted:()=>b({})}):(0,j.jsxs)(`div`,{className:`space-y-5`,children:[(0,j.jsx)(`nav`,{className:`flex gap-2`,"aria-label":t?`事项状态`:`Work status`,children:[[`active`,t?`进行中`:`Active`],[`paused`,t?`已暂停`:`Paused`],[`completed`,t?`已结束`:`Ended`]].map(e=>{let[t,n]=e;return(0,j.jsx)(u,{variant:y===t?`secondary`:`ghost`,onClick:()=>b(t===`active`?{}:{state:t}),children:n},t)})}),(0,j.jsxs)(`div`,{className:`space-y-3`,children:[l.map(e=>(0,j.jsx)(z,{sub:e,card:D(n,e.id),zh:t},`${e.id}:${e.revision}`)),f.map(e=>(0,j.jsx)(I,{follow:e,zh:t},`${e.id}:${e.revision}`)),l.length+f.length===0&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-6`,children:[(0,j.jsx)(`h2`,{className:`font-medium text-fg`,children:y===`active`?t?`还没有进行中的事项`:`No active delegated work`:y===`paused`?t?`没有已暂停的事项`:`No paused work`:t?`没有已结束的事项`:`No ended work`}),y===`active`&&(0,j.jsx)(u,{className:`mt-3`,variant:`primary`,onClick:()=>b({view:`new`}),children:t?`交代第一件事`:`Delegate your first task`})]})]})]})]})}e[21]=y,e[22]=r,e[23]=N,e[24]=G,e[25]=K,e[26]=E,e[27]=q,e[28]=F,e[29]=S,e[30]=ue,e[31]=U,e[32]=o,e[33]=H,e[34]=s,e[35]=g,e[36]=t,e[37]=J,e[38]=Y,e[39]=X,e[40]=Z,e[41]=Q}else J=e[37],Y=e[38],X=e[39],Z=e[40],Q=e[41];if(Q!==Symbol.for(`react.early_return_sentinel`))return Q;let $;e[54]!==J||e[55]!==Y||e[56]!==X?($=(0,j.jsxs)(`div`,{className:J,children:[Y,X]}),e[54]=J,e[55]=Y,e[56]=X,e[57]=$):$=e[57];let de;return e[58]!==Z||e[59]!==$?(de=(0,j.jsx)(`div`,{className:Z,children:$}),e[58]=Z,e[59]=$,e[60]=de):de=e[60],de}function re(e){return e.scenarioKey!==`communication_follow_up`}function ie(){}function ae(e){return e.language}export{G as ProactivePage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{h as i,t as a}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{n as o,r as s}from"./popover-select-Dz_Qis2R.js";import{n as c}from"./locale-store-BBSCIl4I.js";import{i as l}from"./vendor-swr-BIWyz7Rc.js";import{t as u}from"./button-B11EPpor.js";import{t as d}from"./skeleton-BwbyijEw.js";import{t as f}from"./electron-env-DH5wF8X8.js";import{Jt as p,Kt as m,Yt as h,qt as g,ra as _}from"./index-C6OWYFtQ.js";import{a as v,c as y,d as b,f as x,i as S,l as C,n as w,o as T,r as E,s as D,t as O,u as k}from"./proactive-card-BlQ1vCtV.js";var ee=n(),A=e(t(),1),j=r();function M({zh:e}){let[t,n]=(0,A.useState)(m),[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)(``),s=l(t?`/api/proactive/web-push/probes`:null,p,{refreshInterval:1e4});async function c(){i(!0),o(``);try{let e=localStorage.getItem(g());if(!e)throw Error(`Enable this browser first`);await h(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}/test`,`POST`,{}),await s.mutate()}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}let d=!f()&&window.isSecureContext&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;async function _(){i(!0),o(``);try{if(t){let e=localStorage.getItem(g());e&&await h(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}`,`DELETE`,{}),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe(),localStorage.removeItem(g()),n(!1);return}if(await Notification.requestPermission()!==`granted`)throw Error(e?`浏览器未允许通知。`:`Browser notification permission was not granted.`);let{publicKey:r}=await h(`/api/proactive/web-push/prepare`,`POST`,{});await navigator.serviceWorker.register(`/notification-sw.js`);let i=await navigator.serviceWorker.ready,{id:a}=await h(`/api/proactive/web-push/subscriptions`,`POST`,{subscription:(await i.pushManager.getSubscription()??await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:r})).toJSON(),language:e?`zh`:`en`});localStorage.setItem(g(),a),n(!0)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}return(0,j.jsxs)(`section`,{className:`max-w-2xl rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:e?`网页关闭后也接收提醒`:`Receive alerts when this page is closed`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:e?`应用在线时可将重要变化送到这台设备。锁屏只显示通用提示,详情在应用内查看。`:`When the app is online, important changes can reach this device. Lock-screen alerts stay generic; open the app for details.`}),(0,j.jsx)(u,{className:`mt-4`,disabled:r||!d,onClick:()=>void _(),children:d?t?e?`关闭这台设备的提醒`:`Disable alerts on this device`:e?`在这台设备上提醒我`:`Notify me on this device`:e?`当前设备不支持系统提醒`:`System notifications are unavailable here`}),t&&(0,j.jsx)(u,{className:`ml-2 mt-4`,disabled:r,onClick:()=>void c(),children:e?`向此浏览器发送测试通知`:`Send a test to this browser`}),s.data?.probes.slice(0,3).map(t=>(0,j.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[new Date(t.createdAt).toLocaleString(),` · `,t.status===`opened`?e?`已点击打开`:`Opened`:t.status===`accepted`?e?`提供方已接受,等待点击确认`:`Provider accepted; awaiting open confirmation`:t.status,t.error&&` · ${t.error}`]},t.id)),a&&(0,j.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:a})]})}var N=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`,P=e=>{let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16)};function F({zh:e,onStarted:t,open:n,onOpen:r}){let i=l(n?`/api/proactive/follow-ups/sources`:null,p),[c,f]=(0,A.useState)(``),[m,g]=(0,A.useState)(``),[_,v]=(0,A.useState)(()=>P(new Date(Date.now()+864e5).toISOString())),[y,b]=(0,A.useState)(!1),[x,S]=(0,A.useState)(``);async function C(){b(!0),S(``);try{await h(`/api/proactive/follow-ups`,`POST`,{sourceItemId:c,instructions:m,dueAt:new Date(_).toISOString()}),t()}catch(e){S(String(e))}finally{b(!1)}}return(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:e?`替我跟进这封邮件`:`Follow this email for me`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:e?`记住等谁回复,收到变化时整理重点,到时间后准备跟进草稿。`:`Watch replies, explain changes and prepare a follow-up draft when it is time.`}),n?i.isLoading?(0,j.jsx)(d,{className:`mt-4 h-40`}):i.data?.sources.length?(0,j.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e?`最近授权同步的邮件`:`Recently synchronized email`,(0,j.jsxs)(o,{value:c,onChange:e=>f(e.target.value),children:[(0,j.jsx)(s,{value:``,children:e?`选择邮件`:`Choose email`}),i.data.sources.map(e=>(0,j.jsxs)(s,{value:e.id,children:[e.subject,` · `,e.sender,` · `,e.accountLabel]},e.id))]})]}),(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e?`希望跟进到什么结果?`:`What outcome are you waiting for?`,(0,j.jsx)(`textarea`,{className:N,rows:3,maxLength:12e3,value:m,onChange:e=>g(e.target.value),placeholder:e?`例如:等客户确认评审时间,没回复就帮我准备一封简短的跟进邮件。`:`For example: wait for a review date and prepare a short follow-up if there is no reply.`})]}),(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e?`最晚什么时候再跟进?(本地时间)`:`When should I follow up? (Local time)`,(0,j.jsx)(`input`,{type:`datetime-local`,className:N,value:_,onChange:e=>v(e.target.value)})]}),(0,j.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`只跟进这段邮件往来。草稿由你审阅后在对话中办理,发出后继续等待实际回复。`:`Follows this thread only. Review drafts and continue sending in chat; follow-up continues after sending.`}),(0,j.jsx)(u,{variant:`primary`,disabled:y||!c||!m.trim()||!_,onClick:()=>void C(),children:e?`交给你跟进`:`Start following`})]}):!i.error&&(0,j.jsxs)(`p`,{className:`mt-4 text-sm text-fg-muted`,children:[e?`还没有可跟进的邮件。`:`No email is available to follow yet.`,` `,(0,j.jsx)(a,{to:`/connectors`,className:`text-accent`,children:e?`连接邮箱并选择可用范围`:`Connect an email account and choose what is available`})]}):(0,j.jsx)(u,{className:`mt-3`,onClick:r,children:e?`选择一封邮件`:`Choose an email`}),(x||i.error)&&(0,j.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:x||String(i.error)})]})}function I(e){let t=(0,ee.c)(59),{follow:n,zh:r}=e,i=n.subject??(r?`邮件跟进`:`Email follow-up`),o;t[0]===i?o=t[1]:(o=(0,j.jsx)(`h2`,{className:`font-semibold text-fg`,children:i}),t[0]=i,t[1]=o);let s;t[2]===n.instructions?s=t[3]:(s=(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.instructions}),t[2]=n.instructions,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=`/assistant-work?follow-up=${encodeURIComponent(n.id)}`,u=r?`查看`:`View`,d;t[7]!==l||t[8]!==u?(d=(0,j.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:l,children:u}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==c||t[11]!==d?(f=(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[c,d]}),t[10]=c,t[11]=d,t[12]=f):f=t[12];let p=r?`当前状态`:`Current state`,m;t[13]===p?m=t[14]:(m=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:p}),t[13]=p,t[14]=m);let h;t[15]!==n||t[16]!==r?(h=k(n,r),t[15]=n,t[16]=r,t[17]=h):h=t[17];let g;t[18]===h?g=t[19]:(g=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:h}),t[18]=h,t[19]=g);let _;t[20]!==m||t[21]!==g?(_=(0,j.jsxs)(`div`,{children:[m,g]}),t[20]=m,t[21]=g,t[22]=_):_=t[22];let v=r?`接下来`:`Next`,y;t[23]===v?y=t[24]:(y=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:v}),t[23]=v,t[24]=y);let b;t[25]!==n.dueAt||t[26]!==n.status||t[27]!==r?(b=n.status===`completed`?r?`不会再跟进`:`No more follow-up`:`${r?`约定时间`:`Follow up by`} ${T(n.dueAt,r)}`,t[25]=n.dueAt,t[26]=n.status,t[27]=r,t[28]=b):b=t[28];let x;t[29]===b?x=t[30]:(x=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:b}),t[29]=b,t[30]=x);let S;t[31]!==y||t[32]!==x?(S=(0,j.jsxs)(`div`,{children:[y,x]}),t[31]=y,t[32]=x,t[33]=S):S=t[33];let C=r?`最新成果或决定`:`Latest result or decision`,w;t[34]===C?w=t[35]:(w=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:C}),t[34]=C,t[35]=w);let E=n.latestDirection===`received`?r?`发现新的回复,等待整理`:`A new reply is ready to review`:r?`还没有需要交付的新成果`:`No new result needs delivery yet`,D;t[36]===E?D=t[37]:(D=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:E}),t[36]=E,t[37]=D);let O;t[38]!==w||t[39]!==D?(O=(0,j.jsxs)(`div`,{children:[w,D]}),t[38]=w,t[39]=D,t[40]=O):O=t[40];let A=r?`最近核对`:`Last checked`,M;t[41]===A?M=t[42]:(M=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:A}),t[41]=A,t[42]=M);let N;t[43]!==n.lastCheckedAt||t[44]!==r?(N=n.lastCheckedAt?T(n.lastCheckedAt,r):r?`尚未完成首次核对`:`First check has not completed`,t[43]=n.lastCheckedAt,t[44]=r,t[45]=N):N=t[45];let P;t[46]===N?P=t[47]:(P=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:N}),t[46]=N,t[47]=P);let F;t[48]!==M||t[49]!==P?(F=(0,j.jsxs)(`div`,{children:[M,P]}),t[48]=M,t[49]=P,t[50]=F):F=t[50];let I;t[51]!==_||t[52]!==S||t[53]!==O||t[54]!==F?(I=(0,j.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[_,S,O,F]}),t[51]=_,t[52]=S,t[53]=O,t[54]=F,t[55]=I):I=t[55];let L;return t[56]!==I||t[57]!==f?(L=(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[f,I]}),t[56]=I,t[57]=f,t[58]=L):L=t[58],L}function L({follow:e,zh:t,refresh:n}){let[r,i]=(0,A.useState)(!1),[o,s]=(0,A.useState)(e.instructions),[c,l]=(0,A.useState)(P(e.dueAt)),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(``);async function g(t){f(!0),m(``);try{await h(`/api/proactive/follow-ups/${encodeURIComponent(e.id)}`,`PATCH`,{expectedRevision:e.revision,...t}),i(!1),n()}catch(e){m(String(e))}finally{f(!1)}}let _=k(e,t);return(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:e.subject??(t?`邮件跟进`:`Email follow-up`)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:_}),(0,j.jsx)(`p`,{className:`mt-3 whitespace-pre-wrap text-sm`,children:e.instructions}),(0,j.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t?`约定跟进时间:`:`Follow up by: `,T(e.dueAt,t)]}),e.lastCheckedAt&&(0,j.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[t?`最近核对邮件:`:`Last email check: `,T(e.lastCheckedAt,t)]}),e.lastSyncedAt&&(0,j.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[t?`邮箱最近同步:`:`Email last synchronized: `,T(e.lastSyncedAt,t)]}),e.syncFailed&&(0,j.jsx)(`p`,{className:`mt-2 text-sm text-danger`,children:t?`最近一次邮箱同步失败,当前结果可能尚未包含新回复。请检查邮箱连接。`:`The latest email sync failed. Current work may not include new replies. Check your email connection.`}),!e.sourceAvailable&&(0,j.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/connectors`,children:t?`检查邮箱连接`:`Check email connection`}),e.sessionKey&&(0,j.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/chat/${encodeURIComponent(e.sessionKey)}`,children:t?`继续原来的对话`:`Continue the conversation`}),r&&(0,j.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,j.jsx)(`textarea`,{"aria-label":t?`跟进要求`:`Instructions`,className:N,rows:3,maxLength:12e3,value:o,onChange:e=>s(e.target.value)}),(0,j.jsx)(`input`,{"aria-label":t?`跟进时间`:`Follow-up time`,type:`datetime-local`,className:N,value:c,onChange:e=>l(e.target.value)}),(0,j.jsx)(u,{disabled:d||!o.trim()||!c,onClick:()=>void g({instructions:o,...P(e.dueAt)===c?{}:{dueAt:new Date(c).toISOString()}}),children:t?`保存要求`:`Save instructions`})]}),(0,j.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,j.jsx)(u,{variant:`ghost`,disabled:d,onClick:()=>i(!r),children:r?t?`取消修改`:`Cancel edit`:t?`调整跟进要求`:`Adjust follow-up`}),(0,j.jsx)(u,{variant:`ghost`,disabled:d,onClick:()=>void g({status:e.status===`watching`?`paused`:`watching`}),children:e.status===`watching`?t?`暂停`:`Pause`:t?`重新跟进`:`Resume`}),e.status!==`completed`&&(0,j.jsx)(u,{variant:`ghost`,disabled:d,onClick:()=>void g({status:`completed`}),children:t?`结束这件事的跟进`:`End this follow-up`})]}),p&&(0,j.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:p})]})}var R=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;function z(e){let t=(0,ee.c)(64),{sub:n,card:r,zh:i}=e,o;t[0]!==n||t[1]!==i?(o=v(n,i),t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]===o?s=t[4]:(s=(0,j.jsx)(`h2`,{className:`font-semibold text-fg`,children:o}),t[3]=o,t[4]=s);let c;t[5]===n.userInstructions?c=t[6]:(c=(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.userInstructions}),t[5]=n.userInstructions,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=`/assistant-work?delegation=${encodeURIComponent(n.id)}`,d=i?`查看`:`View`,f;t[10]!==u||t[11]!==d?(f=(0,j.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:u,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==l||t[14]!==f?(p=(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15];let m=i?`当前状态`:`Current state`,h;t[16]===m?h=t[17]:(h=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:m}),t[16]=m,t[17]=h);let g;t[18]!==n||t[19]!==i?(g=S(n,i),t[18]=n,t[19]=i,t[20]=g):g=t[20];let _;t[21]===g?_=t[22]:(_=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:g}),t[21]=g,t[22]=_);let b;t[23]!==h||t[24]!==_?(b=(0,j.jsxs)(`div`,{children:[h,_]}),t[23]=h,t[24]=_,t[25]=b):b=t[25];let x=i?`接下来`:`Next`,C;t[26]===x?C=t[27]:(C=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:x}),t[26]=x,t[27]=C);let w;t[28]!==n||t[29]!==i?(w=E(n,i),t[28]=n,t[29]=i,t[30]=w):w=t[30];let D;t[31]===w?D=t[32]:(D=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:w}),t[31]=w,t[32]=D);let O;t[33]!==C||t[34]!==D?(O=(0,j.jsxs)(`div`,{children:[C,D]}),t[33]=C,t[34]=D,t[35]=O):O=t[35];let k=i?`最新成果或决定`:`Latest result or decision`,A;t[36]===k?A=t[37]:(A=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:k}),t[36]=k,t[37]=A);let M;t[38]!==r||t[39]!==i?(M=y(r,i),t[38]=r,t[39]=i,t[40]=M):M=t[40];let N;t[41]===M?N=t[42]:(N=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:M}),t[41]=M,t[42]=N);let P;t[43]!==A||t[44]!==N?(P=(0,j.jsxs)(`div`,{children:[A,N]}),t[43]=A,t[44]=N,t[45]=P):P=t[45];let F=i?`最近核对`:`Last checked`,I;t[46]===F?I=t[47]:(I=(0,j.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:F}),t[46]=F,t[47]=I);let L;t[48]!==n.latestRun||t[49]!==i?(L=n.latestRun?.completedAt?T(n.latestRun.completedAt,i):i?`尚未完成首次核对`:`First check has not completed`,t[48]=n.latestRun,t[49]=i,t[50]=L):L=t[50];let R;t[51]===L?R=t[52]:(R=(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:L}),t[51]=L,t[52]=R);let z;t[53]!==I||t[54]!==R?(z=(0,j.jsxs)(`div`,{children:[I,R]}),t[53]=I,t[54]=R,t[55]=z):z=t[55];let B;t[56]!==b||t[57]!==O||t[58]!==P||t[59]!==z?(B=(0,j.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[b,O,P,z]}),t[56]=b,t[57]=O,t[58]=P,t[59]=z,t[60]=B):B=t[60];let V;return t[61]!==B||t[62]!==p?(V=(0,j.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[p,B]}),t[61]=B,t[62]=p,t[63]=V):V=t[63],V}function B({sub:e,card:t,zh:n,refresh:r}){let i=l(`/api/proactive/subscriptions/${encodeURIComponent(e.id)}/runs`,p,{revalidateOnFocus:!1}),[o,s]=(0,A.useState)(`latest`),[c,f]=(0,A.useState)(e.userInstructions),[m,g]=(0,A.useState)(!1),[_,y]=(0,A.useState)(!1),[C,w]=(0,A.useState)(``);async function D(t,n=!1){y(!0),w(``);try{await h(`/api/proactive/subscriptions/${encodeURIComponent(e.id)}${n?`/check`:``}`,n?`POST`:`PATCH`,n?{}:{...t,expectedRevision:e.revision}),g(!1),r()}catch(e){w(String(e))}finally{y(!1)}}let k=[[`latest`,n?`最新成果`:`Latest result`],[`progress`,n?`进展记录`:`Progress`],[`requirements`,n?`关注要求`:`Instructions`]];return(0,j.jsxs)(`div`,{className:`space-y-5`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:v(e,n)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:S(e,n)})]}),(0,j.jsx)(`nav`,{className:`flex gap-2`,"aria-label":n?`事项详情`:`Work details`,children:k.map(([e,t])=>(0,j.jsx)(u,{variant:o===e?`secondary`:`ghost`,onClick:()=>s(e),children:t},e))}),o===`latest`&&(t?(0,j.jsx)(O,{card:t,copy:x(n),refresh:r,detail:!0}):(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-6`,children:[(0,j.jsx)(`h2`,{className:`font-medium text-fg`,children:n?`还没有需要你处理的新成果`:`No new result needs your attention`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:E(e,n)})]})),o===`progress`&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsxs)(`dl`,{className:`space-y-4 text-sm`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前状态`:`Current state`}),(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:S(e,n)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`接下来`:`Next`}),(0,j.jsx)(`dd`,{className:`mt-1 text-fg`,children:E(e,n)})]})]}),(0,j.jsxs)(`div`,{className:`mt-5 border-t border-edge pt-4`,children:[(0,j.jsx)(`h2`,{className:`text-sm font-medium text-fg`,children:n?`最近进展`:`Recent progress`}),i.isLoading?(0,j.jsx)(d,{className:`mt-3 h-24 rounded-xl`}):i.data?.runs.length?(0,j.jsx)(`ol`,{className:`mt-3 divide-y divide-edge-subtle`,children:i.data.runs.map(e=>(0,j.jsxs)(`li`,{className:`py-3 text-sm`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`text-fg`,children:b(e.reason??e.status,n)}),(0,j.jsx)(`time`,{className:`text-xs text-fg-subtle`,dateTime:e.completedAt??e.startedAt,children:T(e.completedAt??e.startedAt,n)})]}),e.error&&(0,j.jsx)(`p`,{className:`mt-1 text-danger`,children:e.error})]},e.id))}):(0,j.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:n?`还没有完成第一次核对。`:`The first check has not completed yet.`}),i.error&&(0,j.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:String(i.error)})]}),e.project&&(0,j.jsx)(a,{className:`mt-4 inline-block text-sm text-accent`,to:`/projects/${encodeURIComponent(e.scopeId)}`,children:n?`打开相关项目`:`Open related project`})]}),o===`requirements`&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-fg`,children:e.userInstructions}),m&&(0,j.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[n?`希望我关注什么,忽略什么?`:`What should I follow or ignore?`,(0,j.jsx)(`textarea`,{rows:5,maxLength:12e3,className:R,value:c,onChange:e=>f(e.target.value)})]}),!e.completedAt&&(0,j.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[m?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(u,{disabled:_||!c.trim(),onClick:()=>void D({userInstructions:c}),children:n?`保存要求`:`Save instructions`}),(0,j.jsx)(u,{variant:`ghost`,onClick:()=>g(!1),children:n?`取消`:`Cancel`})]}):(0,j.jsx)(u,{variant:`ghost`,onClick:()=>g(!0),children:n?`调整要求`:`Adjust instructions`}),(0,j.jsx)(u,{variant:`ghost`,disabled:_,onClick:()=>void D({enabled:!e.enabled}),children:e.enabled?n?`暂停`:`Pause`:n?`恢复`:`Resume`}),e.scopeKind===`project`&&e.enabled&&(0,j.jsx)(u,{variant:`ghost`,disabled:_||e.pending,onClick:()=>void D({},!0),children:n?`现在核对`:`Check now`}),(0,j.jsx)(u,{variant:`ghost`,disabled:_,onClick:()=>void D({enabled:!1,completedAt:new Date().toISOString()}),children:n?`结束这件事`:`End this work`})]})]}),C&&(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:C})]})}function V({zh:e,onStarted:t,projectId:n}){let r=l(`/api/proactive/templates`,p),i=l(`/api/projects?limit=200`,p),[c,f]=(0,A.useState)(``),[m,g]=(0,A.useState)(n?`project_delivery_risk`:null),[v,y]=(0,A.useState)(n??``),[b,x]=(0,A.useState)(``),[S,C]=(0,A.useState)(!1),[w,T]=(0,A.useState)(``);async function E(){C(!0),T(``);try{await h(`/api/proactive/delegations`,`POST`,{scenarioKey:m,...m===`project_delivery_risk`?{projectId:v}:{},instructions:b}),t()}catch(e){T(String(e))}finally{C(!1)}}if(r.isLoading||i.isLoading)return(0,j.jsx)(d,{className:`h-52 rounded-2xl`});let D={project_delivery_risk:[e?`盯住项目交付`:`Follow project delivery`,e?`关注阻塞和承诺,提前准备处理清单。`:`Watch blockers and commitments, then prepare a useful checklist.`],meeting_preparation:[e?`开会前替我准备`:`Prepare me for meetings`,e?`整理目标、资料和需要决定的问题。`:`Prepare goals, context, and decisions before meetings.`],communication_follow_up:[e?`替我跟进一封邮件`:`Follow an email for me`,e?`等回复,整理变化,到时间准备跟进草稿。`:`Watch for replies and prepare a draft when it is time.`]},O=c.trim()?_(`${c.trim()}\n\n${e?`请把这件事作为持续跟进的事项记住,并先和我确认目标、范围与提醒方式。`:`Remember this as delegated work and first confirm the goal, scope, and notification preference with me.`}`,void 0,{projectScope:`none`}):null;return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:e?`想让我持续替你做什么?`:`What should I keep doing for you?`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e?`直接说目标。助理会在对话中确认范围,再开始跟进。`:`Describe the outcome. The assistant will confirm the scope in chat before following it.`}),(0,j.jsx)(`textarea`,{className:R,rows:4,value:c,onChange:e=>f(e.target.value),placeholder:e?`例如:帮我盯住官网改版,发现会影响月底上线的问题就告诉我,并提前准备解决方案。`:`For example: watch the website redesign and tell me about anything that threatens the launch, with a proposed fix.`}),O&&(0,j.jsx)(u,{asChild:!0,variant:`primary`,className:`mt-3`,children:(0,j.jsx)(a,{to:O,children:e?`交给助理`:`Delegate to assistant`})})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`h2`,{className:`mb-3 text-sm font-medium text-fg-muted`,children:e?`也可以从这些常见事项开始`:`Or start with a common request`}),(0,j.jsx)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:Object.entries(D).map(([e,[t,n]])=>(0,j.jsxs)(`button`,{type:`button`,className:`rounded-2xl border p-4 text-left transition-colors ${m===e?`border-accent bg-accent-soft`:`border-edge bg-surface-panel hover:bg-surface-hover`}`,onClick:()=>{g(e),x(n)},children:[(0,j.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,j.jsx)(`span`,{className:`mt-2 block text-sm text-fg-muted`,children:n})]},e))})]}),m===`communication_follow_up`&&(0,j.jsx)(F,{zh:e,onStarted:t,open:!0,onOpen:()=>{}}),m&&m!==`communication_follow_up`&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,j.jsx)(`h2`,{className:`font-medium text-fg`,children:D[m]?.[0]}),m===`project_delivery_risk`&&(0,j.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[e?`关注哪个项目`:`Which project`,(0,j.jsxs)(o,{value:v,onChange:e=>y(e.target.value),children:[(0,j.jsx)(s,{value:``,children:e?`选择项目`:`Choose project`}),i.data?.items.map(e=>(0,j.jsx)(s,{value:e.id,children:e.name},e.id))]})]}),(0,j.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[e?`希望跟进到什么结果?`:`What outcome should I follow through to?`,(0,j.jsx)(`textarea`,{rows:4,className:R,maxLength:12e3,value:b,onChange:e=>x(e.target.value)})]}),m===`meeting_preparation`&&r.data?.templates.find(e=>e.key===m)?.calendarSource?.status!==`available`&&(0,j.jsxs)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:[e?`还没有可用的日历资料。`:`Calendar context is not available yet.`,` `,(0,j.jsx)(a,{className:`text-accent`,to:`/connectors`,children:e?`连接日历`:`Connect a calendar`})]}),(0,j.jsx)(u,{className:`mt-4`,variant:`primary`,disabled:S||!b.trim()||m===`project_delivery_risk`&&!v,onClick:()=>void E(),children:e?`开始跟进`:`Start following`})]}),(w||r.error||i.error)&&(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:w||String(r.error??i.error)})]})}var H=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function te(e){let t=(0,ee.c)(58),{value:n,onChange:r,zh:i}=e,a;t[0]===i?a=t[1]:(a=i?{all:`所有已启用设备`,auto:`自动选择一台设备`,browser:`浏览器 / 桌面`,mobile:`手机`,telegram:`Telegram`}:{all:`All enabled devices`,auto:`Choose one device`,browser:`Browser / desktop`,mobile:`Mobile`,telegram:`Telegram`},t[0]=i,t[1]=a);let s=a,c;t[2]!==r||t[3]!==n?(c=e=>r({...n,digestEnabled:e.target.checked}),t[2]=r,t[3]=n,t[4]=c):c=t[4];let l;t[5]!==c||t[6]!==n.digestEnabled?(l=(0,j.jsx)(`input`,{type:`checkbox`,checked:n.digestEnabled,onChange:c}),t[5]=c,t[6]=n.digestEnabled,t[7]=l):l=t[7];let u=i?`将提醒合并为每日摘要`:`Combine alerts into a daily digest`,d;t[8]!==l||t[9]!==u?(d=(0,j.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f=i?`摘要时间(使用上方时区)`:`Digest time (in your selected timezone)`,p=String(n.digestHour),m;t[11]===p?m=t[12]:(m=p.padStart(2,`0`),t[11]=p,t[12]=m);let h=String(n.digestMinute),g;t[13]===h?g=t[14]:(g=h.padStart(2,`0`),t[13]=h,t[14]=g);let _=`${m}:${g}`,v;t[15]!==r||t[16]!==n?(v=e=>{let[t,i]=e.target.value.split(`:`).map(Number);r({...n,digestHour:t,digestMinute:i})},t[15]=r,t[16]=n,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,j.jsx)(`input`,{className:H,type:`time`,required:!0,value:_,onChange:v}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==y||t[22]!==f?(b=(0,j.jsxs)(`label`,{className:`block text-sm`,children:[f,y]}),t[21]=y,t[22]=f,t[23]=b):b=t[23];let x=i?`提醒渠道`:`Notification channel`,S=n.preferredChannel,C;t[24]!==r||t[25]!==n?(C=e=>r({...n,preferredChannel:e.target.value}),t[24]=r,t[25]=n,t[26]=C):C=t[26];let w;t[27]===s?w=t[28]:(w=Object.entries(s).map(U),t[27]=s,t[28]=w);let T;t[29]!==C||t[30]!==w||t[31]!==n.preferredChannel?(T=(0,j.jsx)(o,{value:S,onChange:C,children:w}),t[29]=C,t[30]=w,t[31]=n.preferredChannel,t[32]=T):T=t[32];let E;t[33]!==x||t[34]!==T?(E=(0,j.jsxs)(`label`,{className:`block text-sm`,children:[x,T]}),t[33]=x,t[34]=T,t[35]=E):E=t[35];let D=i?`自动选择优先使用最近注册的浏览器,否则选择一台手机。免打扰期间的重要提醒会合并为一份摘要。`:`Automatic selection prefers the most recently registered browser, then one mobile device. Important alerts during quiet hours are combined into one digest.`,O;t[36]===D?O=t[37]:(O=(0,j.jsx)(`p`,{className:`text-xs text-fg-muted`,children:D}),t[36]=D,t[37]=O);let k;t[38]!==r||t[39]!==n?(k=e=>r({...n,suppressWhileViewing:e.target.checked}),t[38]=r,t[39]=n,t[40]=k):k=t[40];let A;t[41]!==k||t[42]!==n.suppressWhileViewing?(A=(0,j.jsx)(`input`,{type:`checkbox`,checked:n.suppressWhileViewing,onChange:k}),t[41]=k,t[42]=n.suppressWhileViewing,t[43]=A):A=t[43];let M=i?`正在查看卡片时不再发送系统提醒`:`Skip system alerts while viewing cards`,N;t[44]!==A||t[45]!==M?(N=(0,j.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[A,M]}),t[44]=A,t[45]=M,t[46]=N):N=t[46];let P;t[47]!==r||t[48]!==n||t[49]!==i?(P=n.preferredChannel===`telegram`&&(0,j.jsxs)(`fieldset`,{className:`space-y-3 rounded-xl border border-edge p-3`,children:[(0,j.jsx)(`legend`,{className:`px-1 text-sm`,children:`Telegram`}),[`chatId`,`accountId`,`publicUrl`].map(e=>(0,j.jsxs)(`label`,{className:`block text-sm`,children:[e===`chatId`?i?`接收对话 ID`:`Destination chat ID`:e===`accountId`?i?`账号 ID(可选)`:`Account ID (optional)`:i?`可从外部访问的控制台 HTTPS 地址`:`Public HTTPS console URL`,(0,j.jsx)(`input`,{className:H,required:e!==`accountId`,value:n.telegram?.[e]??``,onChange:t=>r({...n,telegram:{chatId:n.telegram?.chatId??``,publicUrl:n.telegram?.publicUrl??``,...n.telegram?.accountId?{accountId:n.telegram.accountId}:{},[e]:e===`accountId`?t.target.value||void 0:t.target.value}})})]},e)),(0,j.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`需要已连接 Telegram 渠道。发送通用摘要和卡片链接;链接中不要填写访问令牌。`:`Connect the Telegram channel first. Alerts contain a generic summary and a card link. Do not put access tokens in the URL.`})]}),t[47]=r,t[48]=n,t[49]=i,t[50]=P):P=t[50];let F;return t[51]!==b||t[52]!==E||t[53]!==O||t[54]!==N||t[55]!==P||t[56]!==d?(F=(0,j.jsxs)(`div`,{className:`space-y-4 border-t border-edge pt-4`,children:[d,b,E,O,N,P]}),t[51]=b,t[52]=E,t[53]=O,t[54]=N,t[55]=P,t[56]=d,t[57]=F):F=t[57],F}function U(e){let[t,n]=e;return(0,j.jsx)(s,{value:t,children:n},t)}var W=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function ne({preferences:e,copy:t,refresh:n}){let[r,i]=(0,A.useState)(e),[a,c]=(0,A.useState)(!1),[l,d]=(0,A.useState)(``);async function f(i=r){c(!0),d(``);try{let{revision:a,...o}={...r,...i};await h(`/api/proactive/preferences`,`PATCH`,{...o,expectedRevision:e.revision}),d(t.saved),n()}catch(e){d(e instanceof Error?e.message:String(e))}finally{c(!1)}}return(0,j.jsxs)(`form`,{className:`max-w-2xl space-y-5 rounded-2xl border border-edge bg-surface-panel p-5`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,j.jsxs)(`label`,{className:`block text-sm`,children:[t.level,(0,j.jsx)(o,{value:r.level,onChange:e=>i({...r,level:e.target.value}),children:Object.entries(t.levels).map(([e,t])=>(0,j.jsx)(s,{value:e,children:t},e))})]}),(0,j.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.timezone,(0,j.jsx)(`input`,{required:!0,className:W,value:r.timezone,onChange:e=>i({...r,timezone:e.target.value})})]}),(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.limit,(0,j.jsx)(`input`,{required:!0,type:`number`,min:0,max:30,className:W,value:r.dailyNotificationLimit,onChange:e=>i({...r,dailyNotificationLimit:Number(e.target.value)})})]}),(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.quietStart,(0,j.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietStartHour,onChange:e=>i({...r,quietStartHour:Number(e.target.value)})})]}),(0,j.jsxs)(`label`,{className:`text-sm`,children:[t.quietEnd,(0,j.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietEndHour,onChange:e=>i({...r,quietEndHour:Number(e.target.value)})})]})]}),(0,j.jsx)(te,{value:r,onChange:i,zh:t.locale===`zh`}),(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.privacy}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,j.jsx)(u,{type:`submit`,variant:`primary`,disabled:a,children:t.save}),(0,j.jsx)(u,{disabled:a,onClick:()=>void f({pausedUntil:new Date(Date.now()+36e5).toISOString()}),children:t.pause}),e.pausedUntil&&(0,j.jsx)(u,{disabled:a,onClick:()=>void f({pausedUntil:null}),children:t.resume})]}),l&&(0,j.jsx)(`p`,{role:`status`,className:`text-sm`,children:l})]})}function G(){let e=(0,ee.c)(61),t=c(ae)===`zh`,n;e[0]===t?n=e[1]:(n=x(t),e[0]=t,e[1]=n);let r=n,[o,s]=i(),f;e[2]===o?f=e[3]:(f=o.get(`view`),e[2]=o,e[3]=f);let m=f,g=m===`new`||m===`settings`?m:`list`,_;e[4]===o?_=e[5]:(_=o.get(`state`),e[4]=o,e[5]=_);let v=_,y=v===`paused`||v===`completed`?v:`active`,b;e[6]===o?b=e[7]:(b=o.get(`item`),e[6]=o,e[7]=b);let S=b,T;e[8]===o?T=e[9]:(T=o.get(`digest`),e[8]=o,e[9]=T);let E=T,k;e[10]===o?k=e[11]:(k=o.get(`delegation`),e[10]=o,e[11]=k);let N=k,P;e[12]===o?P=e[13]:(P=o.get(`follow-up`),e[12]=o,e[13]=P);let F=P,R=g===`list`||!!(N||F),H=l(g===`settings`?`/api/proactive/preferences`:null,p),te;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(te={refreshInterval:15e3},e[14]=te):te=e[14];let U=l(R?`/api/proactive/overview`:null,p,te),W;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(W={revalidateOnFocus:!1},e[15]=W):W=e[15];let G=l(S?`/api/inbox/judgments/${encodeURIComponent(S)}`:null,p,W),K=l(E?`/api/proactive/digests/${encodeURIComponent(E)}`:null,p),oe;e[16]===o?oe=e[17]:(oe=o.get(`probe`),e[16]=o,e[17]=oe);let se=oe,ce,le;e[18]===se?(ce=e[19],le=e[20]):(ce=()=>{se&&h(`/api/proactive/web-push/probes/${encodeURIComponent(se)}/opened`,`POST`,{}).catch(ie)},le=[se],e[18]=se,e[19]=ce,e[20]=le),(0,A.useEffect)(ce,le);let q=G.error??U.error??H.error??K.error,ue=G.isLoading||U.isLoading||H.isLoading||K.isLoading,J,Y,X,Z,Q;if(e[21]!==y||e[22]!==r||e[23]!==N||e[24]!==G||e[25]!==K||e[26]!==E||e[27]!==q||e[28]!==F||e[29]!==S||e[30]!==ue||e[31]!==U||e[32]!==o||e[33]!==H||e[34]!==s||e[35]!==g||e[36]!==t){Q=Symbol.for(`react.early_return_sentinel`);bb0:{let n=U.data?[...U.data.needsDecision,...U.data.prepared,...U.data.updates]:[],i=U.data?.delegations.filter(re)??[],c;e[42]===y?c=e[43]:(c=e=>w(e)===y,e[42]=y,e[43]=c);let l=i.filter(c),f=U.data?.followUps.filter(e=>C(e)===y)??[],p;e[44]===N?p=e[45]:(p=e=>e.id===N,e[44]=N,e[45]=p);let m=i.find(p),h;e[46]!==F||e[47]!==U.data?.followUps?(h=U.data?.followUps.find(e=>e.id===F),e[46]=F,e[47]=U.data?.followUps,e[48]=h):h=e[48];let _=h,v;e[49]===s?v=e[50]:(v=e=>s(e),e[49]=s,e[50]=v);let b=v;if(ue){let t;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-base`,children:(0,j.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-5 px-4 py-7 sm:px-6`,children:[(0,j.jsx)(d,{className:`h-8 w-48`}),(0,j.jsx)(d,{className:`h-56 rounded-2xl`}),(0,j.jsx)(d,{className:`h-40 rounded-2xl`})]})}),e[51]=t):t=e[51],Q=t;break bb0}Z=`min-h-0 flex-1 overflow-y-auto bg-surface-base`,J=`mx-auto max-w-4xl space-y-6 px-4 py-7 sm:px-6`,e[52]===q?Y=e[53]:(Y=q&&(0,j.jsx)(`p`,{role:`alert`,className:`rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:String(q)}),e[52]=q,e[53]=Y),X=S?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/`,children:t?`返回工作台`:`Back to Workbench`}),G.data&&(0,j.jsx)(O,{card:G.data.card,copy:r,refresh:()=>void G.mutate(),detail:!0},`${G.data.card.id}:${G.data.card.revision}`)]}):E?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/`,children:t?`返回工作台`:`Back to Workbench`}),(0,j.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:t?`助理为你整理的变化`:`Updates prepared by your assistant`}),K.data?.cards.map(e=>(0,j.jsx)(O,{card:e,copy:r,refresh:()=>void K.mutate()},e.id)),K.data?.cards.length===0&&(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`这些事项已处理或不再需要关注。`:`These items have been handled or are no longer relevant.`})]}):m?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/assistant-work`,children:t?`返回交给我的事`:`Back to delegated work`}),(0,j.jsx)(B,{sub:m,card:D(n,m.id),zh:t,refresh:()=>void U.mutate()})]}):_?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`text-sm text-accent`,to:`/assistant-work`,children:t?`返回交给我的事`:`Back to delegated work`}),(0,j.jsx)(L,{follow:_,zh:t,refresh:()=>void U.mutate()})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:g===`new`?t?`交代一件事`:`Delegate something`:g===`settings`?t?`助理提醒`:`Assistant notifications`:t?`交给我的事`:`Delegated work`}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:g===`new`?t?`说清目标,助理会记住并持续跟进。`:`Describe the goal and your assistant will follow it through.`:g===`settings`?t?`决定助理什么时候提醒你,以及通过什么方式送达。`:`Choose when and how your assistant should notify you.`:t?`查看助理记住的事项、当前进展和下一步。`:`Review remembered work, current progress, and what happens next.`})]}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[g!==`list`&&(0,j.jsx)(u,{variant:`ghost`,onClick:()=>b({}),children:t?`返回列表`:`Back to list`}),g===`list`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(u,{variant:`ghost`,onClick:()=>b({view:`settings`}),children:t?`助理提醒`:`Notifications`}),(0,j.jsx)(u,{variant:`primary`,onClick:()=>b({view:`new`}),children:t?`交代一件事`:`Delegate something`})]})]})]}),g===`settings`&&H.data?(0,j.jsxs)(`div`,{className:`space-y-5`,children:[(0,j.jsx)(ne,{preferences:H.data.preferences,copy:r,refresh:()=>void H.mutate()},H.data.preferences.revision),(0,j.jsx)(M,{zh:t})]}):g===`new`?(0,j.jsx)(V,{zh:t,projectId:o.get(`project`)??void 0,onStarted:()=>b({})}):(0,j.jsxs)(`div`,{className:`space-y-5`,children:[(0,j.jsx)(`nav`,{className:`flex gap-2`,"aria-label":t?`事项状态`:`Work status`,children:[[`active`,t?`进行中`:`Active`],[`paused`,t?`已暂停`:`Paused`],[`completed`,t?`已结束`:`Ended`]].map(e=>{let[t,n]=e;return(0,j.jsx)(u,{variant:y===t?`secondary`:`ghost`,onClick:()=>b(t===`active`?{}:{state:t}),children:n},t)})}),(0,j.jsxs)(`div`,{className:`space-y-3`,children:[l.map(e=>(0,j.jsx)(z,{sub:e,card:D(n,e.id),zh:t},`${e.id}:${e.revision}`)),f.map(e=>(0,j.jsx)(I,{follow:e,zh:t},`${e.id}:${e.revision}`)),l.length+f.length===0&&(0,j.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-6`,children:[(0,j.jsx)(`h2`,{className:`font-medium text-fg`,children:y===`active`?t?`还没有进行中的事项`:`No active delegated work`:y===`paused`?t?`没有已暂停的事项`:`No paused work`:t?`没有已结束的事项`:`No ended work`}),y===`active`&&(0,j.jsx)(u,{className:`mt-3`,variant:`primary`,onClick:()=>b({view:`new`}),children:t?`交代第一件事`:`Delegate your first task`})]})]})]})]})}e[21]=y,e[22]=r,e[23]=N,e[24]=G,e[25]=K,e[26]=E,e[27]=q,e[28]=F,e[29]=S,e[30]=ue,e[31]=U,e[32]=o,e[33]=H,e[34]=s,e[35]=g,e[36]=t,e[37]=J,e[38]=Y,e[39]=X,e[40]=Z,e[41]=Q}else J=e[37],Y=e[38],X=e[39],Z=e[40],Q=e[41];if(Q!==Symbol.for(`react.early_return_sentinel`))return Q;let $;e[54]!==J||e[55]!==Y||e[56]!==X?($=(0,j.jsxs)(`div`,{className:J,children:[Y,X]}),e[54]=J,e[55]=Y,e[56]=X,e[57]=$):$=e[57];let de;return e[58]!==Z||e[59]!==$?(de=(0,j.jsx)(`div`,{className:Z,children:$}),e[58]=Z,e[59]=$,e[60]=de):de=e[60],de}function re(e){return e.scenarioKey!==`communication_follow_up`}function ie(){}function ae(e){return e.language}export{G as ProactivePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{r as n,t as r,u as i}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{a,r as o}from"./product-delivery-CCC4FJ3Y.js";import{n as s}from"./locale-store-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{r as n,t as r,u as i}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{a,r as o}from"./product-delivery-CCC4FJ3Y.js";import{n as s}from"./locale-store-BBSCIl4I.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{t as l}from"./skeleton-BwbyijEw.js";import{n as u}from"./api-CYkdUpkx.js";var d=e();function f(e){return e.installationState===`installed`&&e.enabled&&e.status===`installed`?`/extensions/${encodeURIComponent(e.extensionId)}`:`/local-apps/${encodeURIComponent(e.id)}`}var p=t();function m(){let e=(0,d.c)(14),t=i(),r=s(h)===`zh`,m=o(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=c(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=r?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[0]=t,e[1]=r,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=a({...m,title:m.id,capabilities:[`open`]}),i;return e[3]!==t||e[4]!==r?(i=t?(0,p.jsx)(n,{to:t,replace:!0}):(0,p.jsx)(g,{message:r?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:r}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?r?`找不到这个本地应用,它可能已被删除。`:`This local app was not found and may have been deleted.`:y instanceof Error?y.message:r?`无法打开这个本地应用。`:`Unable to open this local app.`,n;return e[6]!==t||e[7]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[6]=t,e[7]=r,e[8]=n):n=e[8],n}if(v){let t;e[9]===v?t=e[10]:(t=f(v),e[9]=v,e[10]=t);let r;return e[11]===t?r=e[12]:(r=(0,p.jsx)(n,{to:t,replace:!0}),e[11]=t,e[12]=r),r}let b;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,p.jsx)(l,{className:`h-6 w-48`}),(0,p.jsx)(l,{className:`h-32 rounded-xl`})]}),e[13]=b):b=e[13],b}function h(e){return e.language}function g(e){let t=(0,d.c)(7),{message:n,zh:i}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=i?`查看本地应用`:`View local apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(r,{className:`mt-3 inline-flex font-medium text-accent hover:underline`,to:`/local-apps`,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,p.jsxs)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,role:`alert`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}export{m as ProductOpenPage};
|