@xopcai/xopc 0.0.311 → 0.0.312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +2 -1
  2. package/README.zh-CN.md +2 -1
  3. package/dist/browser-ext/manifest.json +1 -1
  4. package/dist/extensions/telegram/xopc.extension.json +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-zKINl7UH.js → agent-avatar-dicebear-BVIJMP8w.js} +1 -1
  6. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D2ePZKdY.js → agent-defaults-settings-panel-K3hTmu9d.js} +1 -1
  7. package/dist/gateway/static/root/assets/{agents-BiD9STyv.js → agents-D6g_SeWI.js} +1 -1
  8. package/dist/gateway/static/root/assets/app-link-CKueEVbT.js +1 -0
  9. package/dist/gateway/static/root/assets/{app-management-settings-panel-C94LAxyt.js → app-management-settings-panel-CLg_aXYG.js} +1 -1
  10. package/dist/gateway/static/root/assets/{appearance-settings-CP01zHvC.js → appearance-settings-CU52MfIT.js} +1 -1
  11. package/dist/gateway/static/root/assets/apps-page-ZpA1-6ad.js +1 -0
  12. package/dist/gateway/static/root/assets/{archive-plugin-SwWFt5MT.js → archive-plugin-CHO3heHX.js} +1 -1
  13. package/dist/gateway/static/root/assets/{attachment-load-DdTFml9l.js → attachment-load-BsmsBCI2.js} +1 -1
  14. package/dist/gateway/static/root/assets/{automations-page-Kmr5WVFp.js → automations-page-CftigJlf.js} +1 -1
  15. package/dist/gateway/static/root/assets/{automations-workspace-bkijiu-Y.js → automations-workspace-IEAxKRME.js} +1 -1
  16. package/dist/gateway/static/root/assets/{binary-plugins-47UTtDNq.js → binary-plugins-CRCLWBo2.js} +1 -1
  17. package/dist/gateway/static/root/assets/{block-editor-DvzZkMG8.js → block-editor-D0LDiOTT.js} +1 -1
  18. package/dist/gateway/static/root/assets/{browser-automations-page-DrUKNL9X.js → browser-automations-page-Djyv3vy-.js} +1 -1
  19. package/dist/gateway/static/root/assets/{browser-settings-page-Dhf_MWCf.js → browser-settings-page-CU4VWsmX.js} +1 -1
  20. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BCubrDf8.js → capabilities-settings-panel-C9XQk3HL.js} +1 -1
  21. package/dist/gateway/static/root/assets/{channels-settings-e4T1DEfN.js → channels-settings-Bqlhjooi.js} +1 -1
  22. package/dist/gateway/static/root/assets/{chat-terminal-dock-Bg_m7HUE.js → chat-terminal-dock-CIsKqdET.js} +1 -1
  23. package/dist/gateway/static/root/assets/{computer-settings-page-CosCmVsT.js → computer-settings-page-C0YL9J7m.js} +1 -1
  24. package/dist/gateway/static/root/assets/{connector-service-page-BL-hSR7_.js → connector-service-page-BmH17JnO.js} +1 -1
  25. package/dist/gateway/static/root/assets/{connectors-page-C0WWxnxJ.js → connectors-page-zkx8Q-e6.js} +1 -1
  26. package/dist/gateway/static/root/assets/{date-picker-DqYFVasF.js → date-picker-CDsfv8R0.js} +1 -1
  27. package/dist/gateway/static/root/assets/{dependency-picker-DCyyFLKp.js → dependency-picker-DvhPj3CZ.js} +1 -1
  28. package/dist/gateway/static/root/assets/{desktop-pet-CFnnpRA_.js → desktop-pet-Cyg8XMpL.js} +1 -1
  29. package/dist/gateway/static/root/assets/{desktop-pet-settings-U5wWRH4c.js → desktop-pet-settings-CE4GOlMM.js} +1 -1
  30. package/dist/gateway/static/root/assets/{device-pairing-wizard-BhHxvFO1.js → device-pairing-wizard-CdKJqnnw.js} +1 -1
  31. package/dist/gateway/static/root/assets/{extension-debug-page-DA8WJ3-E.js → extension-debug-page-D-AVJU3q.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-page-C2BIB88m.js → extension-page-DrFoQ9xt.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-settings-page-kpYo979N.js → extension-settings-page-DxWjESC1.js} +1 -1
  34. package/dist/gateway/static/root/assets/{gateway-settings-CE9t1yTa.js → gateway-settings-CgXp2zq4.js} +1 -1
  35. package/dist/gateway/static/root/assets/{home-page-C7Ezx8Du.js → home-page-D6Idk732.js} +1 -1
  36. package/dist/gateway/static/root/assets/{imports-page-NPk698vI.js → imports-page-BKucJlXI.js} +1 -1
  37. package/dist/gateway/static/root/assets/{index-DxYitLp8.js → index-PFQHPGgi.js} +45 -45
  38. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BhreF0_O.js → keyboard-shortcuts-settings-BxLXD-yU.js} +1 -1
  39. package/dist/gateway/static/root/assets/{local-app-workbench-page-CPmynb3x.js → local-app-workbench-page-BmAqTRb4.js} +2 -2
  40. package/dist/gateway/static/root/assets/{local-apps-page-DOZZBdqj.js → local-apps-page-BAsQJQKJ.js} +1 -1
  41. package/dist/gateway/static/root/assets/{logs-page-M8kz26yo.js → logs-page-ZjVYXXyM.js} +1 -1
  42. package/dist/gateway/static/root/assets/{management-settings-JLqHYQvY.js → management-settings-CSTkYVOZ.js} +1 -1
  43. package/dist/gateway/static/root/assets/{markdown-view-BDpcjR_Z.js → markdown-view-DYGPxPee.js} +1 -1
  44. package/dist/gateway/static/root/assets/{media-plugins-B75SWUJd.js → media-plugins-CQtQzLyg.js} +1 -1
  45. package/dist/gateway/static/root/assets/{note-detail-panel-B_Ft0M32.js → note-detail-panel-DuXCt-MM.js} +3 -3
  46. package/dist/gateway/static/root/assets/notes-page-BjOgBVq5.js +8 -0
  47. package/dist/gateway/static/root/assets/{page-tabs-CMlQUzT6.js → page-tabs-B6DjkyMM.js} +1 -1
  48. package/dist/gateway/static/root/assets/{preview-open-alternatives-cZ2hszQT.js → preview-open-alternatives-Dn57uLhr.js} +1 -1
  49. package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +1 -0
  50. package/dist/gateway/static/root/assets/{product-open-page-CPoSbglF.js → product-open-page-H2YMk8TY.js} +1 -1
  51. package/dist/gateway/static/root/assets/{project-detail-page-DYttWua0.js → project-detail-page-0zi4-i9X.js} +1 -1
  52. package/dist/gateway/static/root/assets/{projects-page-D46drWbl.js → projects-page-B18OxmJj.js} +1 -1
  53. package/dist/gateway/static/root/assets/{remote-access-hub-C9n9Nuhi.js → remote-access-hub-z-DxbuaE.js} +1 -1
  54. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-bMLWRApp.js → runtime-tools-settings-panel-DGsBTbo6.js} +1 -1
  55. package/dist/gateway/static/root/assets/scenes-page-Bgba03B_.js +1 -0
  56. package/dist/gateway/static/root/assets/{schema-form-UVJV_7AS.js → schema-form-CblI9WUA.js} +1 -1
  57. package/dist/gateway/static/root/assets/{sessions-page-C8P6ff91.js → sessions-page-B1t3bMsm.js} +1 -1
  58. package/dist/gateway/static/root/assets/settings-advanced-gate-CBX0Ezhf.js +1 -0
  59. package/dist/gateway/static/root/assets/{settings-form-section-BqzOqonM.js → settings-form-section-BAaVyxJH.js} +1 -1
  60. package/dist/gateway/static/root/assets/{settings-page-DQ9RJ8-b.js → settings-page-CKNPbm5q.js} +1 -1
  61. package/dist/gateway/static/root/assets/{settings-page-layout-D3Spald3.js → settings-page-layout-DqNCGKxQ.js} +1 -1
  62. package/dist/gateway/static/root/assets/{setup-status-panel-C8u601m8.js → setup-status-panel-Bw71C2X3.js} +1 -1
  63. package/dist/gateway/static/root/assets/{share-preview-page-BcgYzA7y.js → share-preview-page-BzMfp_HM.js} +1 -1
  64. package/dist/gateway/static/root/assets/{shares-settings-Bv-2rZ8e.js → shares-settings-BoVDQolc.js} +1 -1
  65. package/dist/gateway/static/root/assets/{skill-reload-api-LM-cgWUS.js → skill-reload-api-DtTptpAt.js} +1 -1
  66. package/dist/gateway/static/root/assets/{skills-page-ggmb7rCW.js → skills-page-DIht92q6.js} +1 -1
  67. package/dist/gateway/static/root/assets/{skills-page.utils-ADABzrtk.js → skills-page.utils-DLYRiEn3.js} +1 -1
  68. package/dist/gateway/static/root/assets/{system-settings-panel-DfkcW_Za.js → system-settings-panel-yYs4YgYk.js} +1 -1
  69. package/dist/gateway/static/root/assets/{task-detail-page-DC4yqDFd.js → task-detail-page-vgkiGo-D.js} +1 -1
  70. package/dist/gateway/static/root/assets/{tunnel-api-CTuwTdMm.js → tunnel-api-BasDYxvx.js} +1 -1
  71. package/dist/gateway/static/root/assets/{use-autosave-5ZDd9XKh.js → use-autosave-CWAUHhcb.js} +1 -1
  72. package/dist/gateway/static/root/assets/{user-model-page-BFKFhdZ0.js → user-model-page-CAGafNfP.js} +1 -1
  73. package/dist/gateway/static/root/assets/{voice-api-key-field-D3urfd-n.js → voice-api-key-field-Kc4UlxZs.js} +1 -1
  74. package/dist/gateway/static/root/assets/{work-discovery-overlay-JzM3Ylbs.js → work-discovery-overlay-BPC_c9dO.js} +1 -1
  75. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bn2CtRdB.js → workflow-run-setup-panel-DBTciOrq.js} +1 -1
  76. package/dist/gateway/static/root/assets/{workflows-page-BiCmt98A.js → workflows-page-CSxHVs1p.js} +1 -1
  77. package/dist/gateway/static/root/index.html +4 -4
  78. package/dist/package.js +1 -1
  79. package/dist/packages/gateway-contract/src/product-delivery.js +1 -0
  80. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  81. package/dist/src/agent/tool-manuals/xopc-use.js +43 -16
  82. package/dist/src/agent/tools/xopc-use-tool.js +60 -3
  83. package/dist/src/config/index.js +2 -2
  84. package/dist/src/config/schema.d.ts +9 -0
  85. package/dist/src/config/schema.js +8 -2
  86. package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -0
  87. package/dist/src/gateway/hono/lib/config-payload.js +1 -0
  88. package/dist/src/gateway/scenes/host.js +5 -4
  89. package/dist/src/gateway/service.js +2 -2
  90. package/dist/src/scenes/metrics.d.ts +3 -1
  91. package/dist/src/scenes/metrics.js +7 -1
  92. package/dist/src/scenes/model.d.ts +3 -0
  93. package/dist/src/scenes/model.js +10 -0
  94. package/package.json +4 -4
  95. package/dist/gateway/static/root/assets/app-link-wamYbNUl.js +0 -1
  96. package/dist/gateway/static/root/assets/apps-page-B7DmSJQj.js +0 -1
  97. package/dist/gateway/static/root/assets/notes-page-C32mxSD-.js +0 -8
  98. package/dist/gateway/static/root/assets/product-delivery-CCC4FJ3Y.js +0 -1
  99. package/dist/gateway/static/root/assets/scenes-page-Dw3hmHAr.js +0 -1
  100. package/dist/gateway/static/root/assets/settings-advanced-gate-whpUsAy3.js +0 -1
@@ -0,0 +1,8 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,m as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./popover-select-B-GDnZO9.js";import{f as l}from"./markdown-view-DYGPxPee.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./cn-JdwAhgNB.js";import{c as p,f as m,n as h}from"./locale-store-DA0Z5jM_.js";import{t as g}from"./messages-4BtQKYlM.js";import{i as _}from"./vendor-swr-BIWyz7Rc.js";import{t as v}from"./skeleton-BwbyijEw.js";import{Bu as y,Dc as b,Dn as x,Do as S,Ec as ee,Fn as te,Gl as ne,Gt as C,Gu as w,Jn as T,Jt as E,Ju as D,Kc as O,Kt as k,Ku as A,Ml as re,Nu as j,Qi as ie,Ql as ae,Qn as M,Rn as oe,Sn as se,Ta as ce,Xt as le,Yn as N,Yt as P,Yu as ue,Zc as de,Zs as fe,Zt as pe,Zu as me,au as he,bn as ge,do as _e,fl as ve,hc as ye,kn as be,lo as xe,qt as F,rl as I,tc as Se,uc as Ce,wn as we,xn as Te,yn as Ee,zn as De}from"./index-PFQHPGgi.js";import{i as Oe,t as ke}from"./note-detail-panel-DuXCt-MM.js";var L=n(),R=e(t(),1),z=r();function B({projectId:e}){let t=h(e=>e.language)===`zh`,n=i(),r=(0,R.useRef)(null),a=(0,R.useRef)(null),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(null);async function f(){let t=a.current;if(!(!t||o!==null)){s(0),l(null);try{let r=await pe();if(r.consentAcknowledgedAt==null){d(r.consentPolicyVersion);return}let i=await C(t.file,t.requestId),o=await le({clientRequestId:t.requestId,contextProjectId:e,source:`web`,consentPolicyVersion:r.consentPolicyVersion});t.discussionId=o.discussion.id,await E({...i,serverDiscussionId:o.discussion.id,projectId:e}),o.discussion.audioAttachmentId||await k(i,o.discussion.id,s),await F(t.requestId),a.current=null,n(`/notes/${encodeURIComponent(o.note.id)}`)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(null)}}}return(0,z.jsxs)(`div`,{className:`inline-flex flex-wrap items-center gap-2 text-xs`,children:[(0,z.jsx)(`input`,{ref:r,hidden:!0,type:`file`,accept:`audio/*,.m4a,.wav,.mp3,.webm,.ogg`,onChange:e=>{let n=e.target.files?.[0];if(e.target.value=``,n){if(!n.size||n.size>1073741824){l(t?`音频须为 1 字节至 1 GiB`:`Audio must be between 1 byte and 1 GiB`);return}a.current={file:n,requestId:crypto.randomUUID()},f()}}}),(0,z.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md p-2 hover:bg-surface-hover`,disabled:o!==null,onClick:()=>c&&a.current?void f():r.current?.click(),children:[(0,z.jsx)(fe,{className:`size-3.5`}),o===null?c&&a.current?t?`重试导入`:`Retry import`:t?`导入录音`:`Import recording`:`${o}%`]}),u===null?null:(0,z.jsxs)(`span`,{children:[t?`请确认你有权上传此录音,并允许配置的语音服务处理。`:`Confirm permission to upload this recording and process it with your configured speech service.`,(0,z.jsx)(`button`,{type:`button`,className:`p-2 text-accent`,onClick:()=>void P(u).then(()=>(d(null),f())).catch(e=>l(String(e))),children:t?`确认导入`:`Confirm import`})]}),c?(0,z.jsx)(`span`,{role:`alert`,className:`text-danger`,children:c}):null]})}async function V(e){e.note??=await x({title:e.title,markdown:e.markdown,projectId:e.projectId,channel:`web`},e.requestId);let t=e.note.id;for(let n=e.attachments.length;n<e.files.length;n++)e.attachments.push(await N(t,e.files[n],`${e.requestId}:file:${n}`));if(e.attachments.length){let n=e.attachments.map(e=>`[${e.fileName.replace(/[\\[\]]/g,`\\$&`).replace(/[\r\n]/g,` `)}](${M(t,e.id)})`);e.note=await T(t,{markdown:`${e.markdown}\n\n## ${e.materialHeading}\n\n${n.join(`
2
+
3
+ `)}`})}return{noteId:t,conversationId:(await De(t,{projectId:e.projectId})).conversationId}}function H(e,t,n){let r=new URLSearchParams({draft:n.replace(`{{id}}`,t),autoSend:`1`});return`/chat/${encodeURIComponent(e)}?${r}`}var U={meeting:w,requirements:ae,research:b,weekly:j};function Ae({projects:e,projectId:t,onProjectChange:n,onCreated:r,labels:a,projectsLoading:o,projectsError:s}){let l=a.home,u=i(),[p,m]=(0,R.useState)(``),[h,g]=(0,R.useState)(null),[_,v]=(0,R.useState)([]),[y,b]=(0,R.useState)(!1),[x,S]=(0,R.useState)(null),[ee,te]=(0,R.useState)(``),C=(0,R.useRef)(null),w=(0,R.useRef)(!1),T=(0,R.useRef)(null),E=(0,R.useRef)(null),D=y||!!C.current,k=h?l.templateOptions[h]:null,re=!!(p.trim()||_.length);async function j(){if(!(w.current||!re&&!C.current)){w.current=!0,b(!0),S(null),C.current??={requestId:crypto.randomUUID(),title:p.trim().split(`
4
+ `)[0]?.slice(0,80)||k?.label||a.titlePlaceholder,markdown:`## ${l.requestHeading}\n\n${k?`${k.prompt}\n`:``}${p.trim()}`,projectId:t||void 0,files:[..._],attachments:[],materialHeading:l.materialsHeading};try{let e=await V(C.current);r(),u(H(e.conversationId,e.noteId,l.agentPrompt))}catch(e){C.current.note&&r(),S(e instanceof Error?e.message:a.quickCaptureFailedHint)}finally{w.current=!1,b(!1)}}}function ie(){C.current=null,S(null),m(``),v([]),g(null),E.current?.focus()}return(0,z.jsxs)(`section`,{"aria-label":l.askLabel,children:[(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),j()},className:`relative rounded-xl border border-edge bg-surface-panel p-4 focus-within:border-accent/60 sm:p-5`,children:[(0,z.jsxs)(`fieldset`,{disabled:D,className:`min-w-0`,children:[(0,z.jsxs)(`label`,{htmlFor:`notes-home-prompt`,className:`flex items-center gap-2 text-xs font-medium text-accent-fg`,children:[(0,z.jsx)(ye,{className:`size-4`,"aria-hidden":!0}),l.askLabel]}),k?(0,z.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg bg-accent-soft px-3 py-2 text-xs leading-5 text-accent-fg`,children:[(0,z.jsxs)(`p`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`span`,{className:`font-medium`,children:[k.label,` · `]}),k.prompt.split(`
5
+
6
+ `)[0]]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>g(null),"aria-label":a.searchClear,className:`shrink-0 rounded p-1 hover:bg-surface-hover`,children:(0,z.jsx)(d,{className:`size-3.5`})})]}):null,(0,z.jsx)(`textarea`,{ref:E,id:`notes-home-prompt`,value:p,onChange:e=>m(e.target.value),placeholder:k?k.prompt.split(`
7
+
8
+ `).at(-1):l.askPlaceholder,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),j())},className:`mt-2 min-h-16 w-full resize-y bg-transparent py-2 text-base leading-6 text-fg outline-none placeholder:text-fg-muted sm:text-sm`}),_.length?(0,z.jsx)(`ul`,{className:`mb-3 flex flex-wrap gap-2`,children:_.map((e,t)=>(0,z.jsxs)(`li`,{className:`flex max-w-full items-center gap-2 rounded-md border border-edge px-2 py-1 text-xs text-fg-muted`,children:[(0,z.jsx)(O,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name}),(0,z.jsx)(`button`,{type:`button`,"aria-label":`${l.removeMaterial}: ${e.name}`,onClick:()=>v(e=>e.filter((e,n)=>n!==t)),className:`rounded p-1 hover:bg-surface-hover`,children:(0,z.jsx)(d,{className:`size-3`})})]},`${e.name}-${t}`))}):null,(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 sm:pr-40`,children:[(0,z.jsx)(`div`,{className:`w-44 max-w-full`,children:(0,z.jsx)(c,{value:t,options:e.filter(e=>e.name.toLowerCase().includes(ee.toLowerCase())).map(e=>({value:e.id,label:e.name})),selectedLabel:t?e.find(e=>e.id===t)?.name:l.unassigned,placeholder:l.unassigned,emptyLabel:l.unassigned,ariaLabel:l.assignProject,triggerIcon:(0,z.jsx)(ne,{className:`size-4 shrink-0`,"aria-hidden":!0}),triggerClassName:`h-8 border-transparent bg-transparent px-2 text-xs text-fg-muted hover:bg-surface-hover`,onChange:n,disabled:D,loading:o,statusMessage:s?l.projectsLoadFailed:void 0,searchPlaceholder:l.projectSearch,searchValue:ee,onSearchChange:te})}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>T.current?.click(),className:`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover`,children:[(0,z.jsx)(O,{className:`size-4`,"aria-hidden":!0}),l.addMaterials]}),(0,z.jsx)(`input`,{ref:T,type:`file`,multiple:!0,className:`hidden`,"aria-label":l.addMaterials,onChange:e=>{let t=Array.from(e.target.files??[]);v(e=>[...e,...t]),e.target.value=``}})]})]}),(0,z.jsx)(`div`,{className:`mt-2 flex justify-end sm:absolute sm:bottom-5 sm:right-5 sm:mt-0`,children:(0,z.jsxs)(`button`,{type:`submit`,disabled:y||!C.current&&!re,className:`inline-flex h-9 items-center gap-2 rounded-lg bg-accent px-4 text-sm font-medium text-on-accent hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,children:[y?(0,z.jsx)(ve,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(A,{className:`size-4`,"aria-hidden":!0}),y?l.creating:x?l.retry:l.agentCreate]})})]}),x?(0,z.jsxs)(`div`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-3 text-xs text-danger`,role:`alert`,children:[(0,z.jsx)(`p`,{children:x}),C.current?.note?(0,z.jsx)(`p`,{className:`mt-1`,children:l.partialFailure}):null,(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3`,children:[C.current?.note?(0,z.jsx)(`button`,{type:`button`,onClick:()=>u(`/notes/${encodeURIComponent(C.current.note.id)}?edit=1`),className:`underline`,children:l.openSavedDraft}):null,(0,z.jsx)(`button`,{type:`button`,onClick:ie,className:`underline`,children:l.newRequest})]})]}):null,(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-1 gap-y-1 text-xs text-fg-muted`,children:[(0,z.jsx)(`span`,{className:`mr-1 py-2`,children:l.templates}),Object.keys(U).map(e=>{let t=U[e];return(0,z.jsxs)(`button`,{type:`button`,disabled:D,"aria-pressed":h===e,onClick:()=>{g(h===e?null:e),E.current?.focus()},className:f(`inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover disabled:opacity-50`,h===e&&`bg-accent-soft text-accent-fg`),children:[(0,z.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),l.templateOptions[e].label]},e)}),(0,z.jsx)(B,{}),(0,z.jsxs)(`button`,{type:`button`,disabled:y,onClick:()=>xe(),className:`ml-auto inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover`,children:[(0,z.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),l.recordDiscussion]})]})]})}function je(e,t){let n=Number(e.get(`page`)??0),r=Number.isSafeInteger(n)&&n>=0?n:0,i=e.get(`view`);return{projectId:e.get(`projectId`)||void 0,unassigned:e.get(`unassigned`)===`true`||i===`unassigned`||void 0,pinned:i===`favorites`?!0:void 0,agentEdited:i===`agent`||void 0,status:i===`archived`?`archived`:void 0,search:t.trim()||void 0,sortBy:`updatedAt`,sortOrder:`desc`,limit:12,offset:r*12}}function Me(e){let t=e.snippet?.trim()??``,n=e.title?.trim();return n&&t.startsWith(n)?t.slice(n.length).replace(/^[\s::·—-]+/,``):t}var W=`touch-target inline-flex min-h-9 items-center justify-center gap-2 rounded-lg px-3 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`;function G(){let e=h(e=>e.language),t=g(e).notes,n=t.home,r=p(e=>e.conversationId),o=_e(e=>e.setPageHeader),l=_e(e=>e.clearPageHeader),d=i(),{pathname:b,search:C}=s(),[E,O]=a(),k=E.get(`projectId`)||``,A=E.get(`view`)||`all`,j=E.get(`unassigned`)===`true`||A===`unassigned`,M=E.get(`search`)||``,[le]=ce(M,250),[N,P]=(0,R.useState)(k),[fe,pe]=(0,R.useState)(``),[xe,F]=(0,R.useState)(null),[I,De]=(0,R.useState)(!1),[ke,L]=(0,R.useState)(new Set),[B,V]=(0,R.useState)(null),[H,U]=(0,R.useState)(null),G=(0,R.useRef)(new Set),K=(0,R.useRef)(null),q=(0,R.useRef)(!1),Ne=(0,R.useRef)(null),Pe=je(E,le),J=(Pe.offset??0)/12,{data:Fe,error:Ie,isLoading:Le,mutate:Re}=_(r?[`notes-home`,r,Pe]:null,()=>oe(Pe)),{data:ze,error:Be,isLoading:Y,mutate:Ve}=_(r?[`notes-home-projects`,r]:null,te),X=ze?.items??[],He=X.find(e=>e.id===k)?.name??n.projectNotes,Ue=Fe?.items??[],Z=Fe?.total??0,We=Le||M!==le,Ge=(0,R.useMemo)(()=>({justNow:t.justNow,minutesAgo:t.minutesAgo,today:t.today,yesterday:t.yesterday,daysAgo:t.daysAgo,locale:m(e)}),[e,t.justNow,t.minutesAgo,t.today,t.yesterday,t.daysAgo]),[Ke,qe]=(0,R.useState)(()=>Date.now());(0,R.useEffect)(()=>{P(k)},[k]),(0,R.useEffect)(()=>{let e=window.setInterval(()=>qe(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let Q=(0,R.useCallback)(()=>{Re().catch(()=>void 0),Ve().catch(()=>void 0)},[Re,Ve]);(0,R.useEffect)(()=>{let e=[`note-updated`,`note-created`,`note-deleted`,`project-updated`,`project-created`,`project-deleted`];return e.forEach(e=>window.addEventListener(e,Q)),()=>e.forEach(e=>window.removeEventListener(e,Q))},[Q]);let Je=(0,R.useCallback)((e,t=!1)=>{let n=`${b}${C}`,r=new URLSearchParams({returnTo:n});t&&r.set(`edit`,`1`),d(`/notes/${encodeURIComponent(e)}?${r}`)},[b,C,d]),$=(0,R.useCallback)(async()=>{if(!(q.current||!r)){q.current=!0,De(!0),F(null),K.current??={key:crypto.randomUUID(),projectId:N||void 0};try{let e=await x({markdown:``,kind:`thought`,projectId:K.current.projectId},K.current.key);K.current=null,Q(),Je(e.id,!0)}catch(e){F(`${t.createBlankFailed}: ${e instanceof Error?e.message:t.createBlankFailedHint}`)}finally{q.current=!1,De(!1)}}},[N,t.createBlankFailed,t.createBlankFailedHint,Je,Q,r]),Ye=(0,R.useCallback)(e=>{O(t=>{let n=new URLSearchParams(t);return e?n.set(`search`,e):n.delete(`search`),n.delete(`page`),n},{replace:!0})},[O]);function Xe(e,t=`all`){let n=new URLSearchParams;e&&n.set(`projectId`,e),t===`unassigned`?n.set(`unassigned`,`true`):t!==`all`&&n.set(`view`,t),P(e),O(n)}function Ze(e){O(t=>{let n=new URLSearchParams(t);return j&&n.set(`unassigned`,`true`),e===`all`?n.delete(`view`):n.set(`view`,e),n.delete(`page`),n})}async function Qe(e,n){if(!G.current.has(e)){G.current.add(e),L(new Set(G.current)),F(null);try{await T(e,{pinned:n}),Q()}catch(e){F(`${t.actionFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{G.current.delete(e),L(new Set(G.current))}}}async function $e(){let e=B;if(!(!e||H)){V(null),U(e.id),F(null);try{await be(e.id),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e.id}})),Q()}catch(e){F(`${t.deleteFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{U(null)}}}if((0,R.useLayoutEffect)(()=>{if(!r){l();return}return o({startExtra:null,main:(0,z.jsx)(`h1`,{className:`truncate text-base font-semibold text-fg`,children:t.title}),end:(0,z.jsxs)(`div`,{className:f(`flex min-w-0 items-center gap-2`,S),children:[(0,z.jsxs)(`label`,{className:`flex h-9 w-32 min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2 sm:w-48`,children:[(0,z.jsx)(ee,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,z.jsx)(`input`,{ref:Ne,type:`search`,value:M,onChange:e=>Ye(e.target.value),"aria-label":t.searchDialogTitle,placeholder:t.searchPlaceholder,className:`min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void $(),disabled:I,"aria-label":n.blankNote,className:f(W,`border border-edge bg-surface-panel text-fg`),children:[I?(0,z.jsx)(ve,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(u,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`hidden sm:inline`,children:n.blankNote})]})]})}),()=>l()},[l,$,I,n.blankNote,t.searchDialogTitle,t.searchPlaceholder,t.title,M,o,Ye,r]),(0,R.useEffect)(()=>{let e=e=>{!(e.metaKey||e.ctrlKey)||e.altKey||e.isComposing||e.target?.closest(`input, textarea, [contenteditable="true"], [role="dialog"]`)||(e.key.toLowerCase()===`n`&&(e.preventDefault(),$()),e.key.toLowerCase()===`f`&&(e.preventDefault(),Ne.current?.focus()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[$]),!r)return(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-fg-muted`,children:t.needToken});let et=[{id:`all`,label:n.homeNav,Icon:de},{id:`favorites`,label:n.favorites,Icon:Ce},{id:`unassigned`,label:n.unassigned,Icon:re},{id:`archived`,label:t.filterArchived,Icon:me}],tt=k?`project:${k}`:j?`unassigned`:`all`;return(0,z.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,children:[(0,z.jsxs)(`aside`,{className:`hidden w-44 shrink-0 flex-col gap-1 overflow-y-auto px-3 py-6 xl:flex`,"aria-label":n.homeNav,children:[et.map(({id:e,label:t,Icon:n})=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Xe(``,e),"aria-current":!k&&(e===`unassigned`?j:!j&&A===e)?`page`:void 0,className:f(W,`justify-start px-2 text-left text-xs`,!k&&(e===`unassigned`?j:!j&&A===e)&&`bg-surface-hover font-medium text-fg`),children:[(0,z.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),t]},e)),(0,z.jsx)(`span`,{className:`mb-1 mt-7 px-2 text-xs text-fg-muted`,children:n.projects}),Y?[0,1,2].map(e=>(0,z.jsx)(v,{className:`mb-2 h-8 w-full`},e)):X.slice(0,8).map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Xe(e.id),"aria-current":k===e.id?`page`:void 0,className:f(W,`justify-start px-2 text-left text-xs`,k===e.id&&`bg-surface-hover font-medium text-fg`),children:[(0,z.jsx)(ne,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>d(`/projects`),className:f(W,`mt-2 justify-start px-2 text-xs`),children:[n.allProjects,(0,z.jsx)(D,{className:`ml-auto size-3`,"aria-hidden":!0})]})]}),(0,z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col px-4 py-4 sm:py-7 sm:px-8 lg:px-10 lg:py-9`,children:[(0,z.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,z.jsx)(`h2`,{className:`min-w-0 break-words text-2xl font-semibold tracking-tight text-fg`,children:k?He:j?n.unassigned:n.homeTitle}),k?(0,z.jsxs)(`button`,{type:`button`,onClick:()=>d(`/projects/${encodeURIComponent(k)}`),className:f(W,`text-xs`),children:[n.openProject,(0,z.jsx)(D,{className:`size-3.5`,"aria-hidden":!0})]}):null]}),xe?(0,z.jsx)(`p`,{className:`mb-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:xe}):null,(0,z.jsx)(`div`,{className:`order-3 mt-6 sm:order-none sm:mt-0`,children:(0,z.jsx)(Ae,{projects:X,projectId:N,onProjectChange:P,onCreated:Q,labels:t,projectsLoading:Y,projectsError:!!Be})}),Be?(0,z.jsxs)(`div`,{role:`alert`,className:`mt-4 flex items-center gap-3 text-xs text-danger`,children:[(0,z.jsx)(`span`,{children:n.projectsLoadFailed}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Ve().catch(()=>void 0),className:`underline`,children:n.retry})]}):null,!k&&!j&&(Y||X.length>0)?(0,z.jsxs)(`section`,{className:`order-4 mt-8 sm:order-none`,"aria-label":n.continueProjects,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.continueProjects}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>d(`/projects`),className:`text-xs text-fg-muted hover:text-fg`,children:n.allProjects})]}),(0,z.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:Y?[0,1,2].map(e=>(0,z.jsx)(v,{className:`h-28 w-full`},e)):X.slice(0,3).map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Xe(e.id),className:`min-w-0 rounded-lg border border-edge bg-surface-panel p-3 text-left transition-colors sm:p-4 hover:bg-surface-base focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,z.jsx)(ne,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,z.jsx)(`p`,{className:`mt-2 hidden line-clamp-1 text-xs text-fg-muted sm:block`,children:e.description}):null,(0,z.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center justify-between gap-1 text-xs text-fg-muted sm:mt-3`,children:[(0,z.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(e.noteCount))}),(0,z.jsx)(`span`,{children:e.updatedAt?Oe(e.updatedAt,Ke,Ge):n.emptyProject})]})]},e.id))})]}):null,(0,z.jsxs)(`section`,{className:`order-2 mt-2 pb-6 sm:order-none sm:mt-8`,"aria-label":n.recentNotes,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:k?n.projectNotes:n.recentNotes}),(0,z.jsx)(`div`,{className:`w-48 max-w-full`,children:(0,z.jsx)(c,{value:tt,allowEmpty:!1,ariaLabel:n.projects,placeholder:n.allNotes,options:[{value:`all`,label:n.allNotes},{value:`unassigned`,label:n.unassigned},...X.filter(e=>e.name.toLowerCase().includes(fe.toLowerCase())).map(e=>({value:`project:${e.id}`,label:e.name}))],selectedLabel:k?He:j?n.unassigned:n.allNotes,triggerClassName:`h-8 bg-surface-panel text-xs`,loading:Y,searchPlaceholder:n.projectSearch,searchValue:fe,onSearchChange:pe,onChange:e=>Xe(e.startsWith(`project:`)?e.slice(8):``,e===`unassigned`?e:`all`)})})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 border-b border-edge`,"aria-label":t.libraryTitle,children:[[{id:`all`,label:t.filterAll},{id:`agent`,label:n.agentEdited},{id:`favorites`,label:n.favorites},{id:`archived`,label:t.filterArchived}].map(({id:e,label:t})=>(0,z.jsx)(`button`,{type:`button`,"aria-pressed":A===e||e===`all`&&A===`unassigned`,onClick:()=>Ze(e),className:f(`touch-target border-b-2 border-transparent py-3 text-xs text-fg-muted hover:text-fg`,(A===e||e===`all`&&A===`unassigned`)&&`border-fg font-medium text-fg`),children:t},e)),(0,z.jsx)(`span`,{className:`ml-auto py-3 text-xs text-fg-muted`,children:n.sortUpdated})]}),Ie?(0,z.jsxs)(`div`,{className:`py-10 text-center`,role:`alert`,children:[(0,z.jsx)(`p`,{className:`text-sm text-danger`,children:n.loadFailed}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Re().catch(()=>void 0),className:f(W,`mt-2`),children:n.retry})]}):We?(0,z.jsx)(`div`,{"aria-busy":`true`,className:`divide-y divide-edge`,children:[0,1,2,3].map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-3 py-4`,children:[(0,z.jsx)(v,{className:`h-10 w-8 shrink-0`}),(0,z.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,z.jsx)(v,{className:`h-4 w-2/3`}),(0,z.jsx)(v,{className:`h-3 w-1/2`})]})]},e))}):Ue.length===0?(0,z.jsxs)(`div`,{className:`flex flex-col items-center px-4 py-12 text-center`,children:[(0,z.jsx)(de,{className:`mb-4 size-8 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,z.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:M||A!==`all`&&A!==`unassigned`?n.noMatches:k?n.projectEmpty:n.emptyTitle}),(0,z.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:M||A!==`all`&&A!==`unassigned`?n.noMatchesHint:k?n.projectEmptyHint:n.emptyDescription})]}):(0,z.jsx)(`ul`,{className:`divide-y divide-edge`,children:Ue.map(e=>{let r=e.voiceAttachmentId||e.kind===`voice`?w:e.kind===`bookmark`?y:ae,i=Me(e)||(e.coverAttachmentId?t.imageNote:t.noText);return(0,z.jsxs)(`li`,{className:`group flex min-w-0 items-center gap-3 py-4`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Je(e.id),className:`touch-target flex min-w-0 flex-1 items-center gap-3 rounded-md text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,z.jsx)(`span`,{className:`flex h-10 w-8 shrink-0 items-center justify-center rounded-md border border-edge text-fg-muted`,children:(0,z.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-base font-medium text-fg sm:text-sm group-hover:text-accent-fg`,children:e.title||i.slice(0,48)||t.titlePlaceholder}),(0,z.jsxs)(`span`,{className:`mt-1 flex min-w-0 items-center gap-1.5 text-xs text-fg-muted`,children:[e.lastEditTrigger===`ai_edit`?(0,z.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-accent-fg`,children:[(0,z.jsx)(ye,{className:`size-3`,"aria-hidden":!0}),n.agentEditLabel,(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`})]}):null,(0,z.jsx)(`span`,{className:`truncate`,children:i})]}),(0,z.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`mt-1.5 block text-xs text-fg-muted sm:hidden`,children:Oe(e.updatedAt,Ke,Ge)})]})]}),(0,z.jsx)(`span`,{className:`hidden max-w-32 truncate text-xs text-fg-muted md:block`,title:e.projects?.map(e=>e.name).join(` · `),children:e.projects?.map(e=>e.name).join(` · `)||n.unassigned}),(0,z.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`hidden w-24 shrink-0 text-right text-xs text-fg-muted sm:block`,children:Oe(e.updatedAt,Ke,Ge)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Qe(e.id,!e.pinned),disabled:ke.has(e.id),"aria-label":`${e.pinned?n.unfavorite:n.favorite}: ${e.title||t.titlePlaceholder}`,"aria-pressed":!!e.pinned,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:(0,z.jsx)(Ce,{className:f(`size-4`,e.pinned&&`fill-current text-fg`),"aria-hidden":!0})}),(0,z.jsxs)(se,{children:[(0,z.jsx)(we,{asChild:!0,children:(0,z.jsx)(`button`,{type:`button`,disabled:H===e.id,"aria-label":`${t.noteActions}: ${e.title||t.titlePlaceholder}`,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:H===e.id?(0,z.jsx)(ve,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(he,{className:`size-4`,"aria-hidden":!0})})}),(0,z.jsx)(Te,{children:(0,z.jsx)(Ee,{align:`end`,sideOffset:4,className:`z-50 min-w-36 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,z.jsxs)(ge,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft`,onSelect:()=>V(e),children:[(0,z.jsx)(Se,{className:`size-4`,"aria-hidden":!0}),t.delete]})})})]})]},e.id)})}),!We&&!Ie&&Z>0?(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-fg-muted`,"aria-live":`polite`,children:[(0,z.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(Z))}),Z>12||J>0?(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":n.previousPage,disabled:J===0,className:W,onClick:()=>O(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(J-1)),t}),children:(0,z.jsx)(ue,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{children:[J+1,` / `,Math.max(1,Math.ceil(Z/12))]}),(0,z.jsx)(`button`,{type:`button`,"aria-label":n.nextPage,disabled:(J+1)*12>=Z,className:W,onClick:()=>O(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(J+1)),t}),children:(0,z.jsx)(D,{className:`size-4`,"aria-hidden":!0})})]}):null]}):null]})]})}),(0,z.jsx)(ie,{open:B!==null,title:t.deleteConfirmTitle,description:t.deleteConfirmDescription.replace(`{{title}}`,B?.title||t.titlePlaceholder),confirmLabel:t.deleteConfirmLabel,cancelLabel:t.deleteCancelLabel,destructive:!0,onConfirm:()=>void $e(),onCancel:()=>V(null)})]})}function K(){let e=(0,L.c)(12),{noteId:t}=o(),n=i(),[r]=a(),s;e[0]===r?s=e[1]:(s=l(r.get(`returnTo`),`/notes`,[`/chat`,`/projects`,`/notes`,`/tasks`]),e[0]=r,e[1]=s);let c=s,u;e[2]!==n||e[3]!==c?(u=()=>{n(c)},e[2]=n,e[3]=c,e[4]=u):u=e[4];let d=u;if(!t)return null;let f=r.get(`edit`)===`1`?`wysiwyg`:`preview`,p;e[5]===r?p=e[6]:(p=r.get(`edit`),e[5]=r,e[6]=p);let m=p===`1`,h;return e[7]!==d||e[8]!==t||e[9]!==f||e[10]!==m?(h=(0,z.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-6xl flex-1 flex-col`,children:(0,z.jsx)(ke,{noteId:t,onBack:d,initialMode:f,autoFocus:m},t)}),e[7]=d,e[8]=t,e[9]=f,e[10]=m,e[11]=h):h=e[11],h}function q(){let e=(0,L.c)(2),{noteId:t}=o(),n;return e[0]===t?n=e[1]:(n=t?(0,z.jsx)(K,{}):(0,z.jsx)(G,{}),e[0]=t,e[1]=n),n}export{q as NotesPage};
@@ -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{t as i}from"./cn-JdwAhgNB.js";import{bs as a}from"./index-DxYitLp8.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-surface-active text-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto overscroll-x-contain px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)||!n.length)return;e.preventDefault();let t=n.findIndex(e=>e.id===r),i=e.key===`Home`?0:e.key===`End`?n.length-1:(Math.max(0,t)+(e.key===`ArrowRight`?1:-1)+n.length)%n.length;l(n[i].id);let a=e.currentTarget.querySelectorAll(`[role="tab"]`)[i];a?.focus(),a?.scrollIntoView({block:`nearest`,inline:`nearest`})},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,tabIndex:h?0:-1,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`touch-target relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-xs tabular-nums text-fg-muted`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{bs as a}from"./index-PFQHPGgi.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-surface-active text-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto overscroll-x-contain px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)||!n.length)return;e.preventDefault();let t=n.findIndex(e=>e.id===r),i=e.key===`Home`?0:e.key===`End`?n.length-1:(Math.max(0,t)+(e.key===`ArrowRight`?1:-1)+n.length)%n.length;l(n[i].id);let a=e.currentTarget.querySelectorAll(`[role="tab"]`)[i];a?.focus(),a?.scrollIntoView({block:`nearest`,inline:`nearest`})},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,tabIndex:h?0:-1,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`touch-target relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-xs tabular-nums text-fg-muted`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./cn-JdwAhgNB.js";import{n as i}from"./electron-env-Dit0bHgy.js";import{bs as a,iu as o}from"./index-DxYitLp8.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=i()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=i()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=r(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:r(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:r(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=r(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-on-accent shadow-sm`,a.transition,a.press,a.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./cn-JdwAhgNB.js";import{n as i}from"./electron-env-Dit0bHgy.js";import{bs as a,iu as o}from"./index-PFQHPGgi.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=i()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=i()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=r(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:r(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:r(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=r(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-on-accent shadow-sm`,a.transition,a.press,a.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,s as n,t as r,u as i}from"./schemas-BaskVM5g.js";var a=r([`task`,`project`,`note`,`workflow_definition`,`workflow_run`,`automation`,`scene`,`local_app`,`file`,`session`,`settings`]),o=r([`open`,`preview`,`edit`,`continue_in_chat`,`run`,`pause`,`resume`,`share`,`reveal`,`configure`]),s=n({kind:a,id:i().min(1),title:i().min(1),summary:i().optional(),status:i().optional(),revision:i().optional(),projectId:i().optional(),capabilities:t(o).default([])}),c=r([`created`,`updated`,`opened`,`started`,`completed`,`failed`]),l=n({version:e(1),operation:c,primary:s.optional(),related:t(s).optional()});function u(e){let t=l.safeParse(e);return t.success?t.data:null}var d=`xopc-product-delivery:`;function f(e){let t=e.split(/\s+/).find(e=>e.startsWith(d));if(!t)return null;try{return u(JSON.parse(decodeURIComponent(t.slice(22))))}catch{return null}}function p(e){let t=encodeURIComponent(e.id);switch(e.kind){case`task`:return`/tasks/${t}`;case`project`:return`/projects/${t}`;case`note`:return`/notes/${t}`;case`workflow_definition`:return`/workflows/${t}`;case`workflow_run`:return`/workflows/runs/${t}`;case`automation`:return`/automations?automation=${t}`;case`scene`:return`/scenes/${t}`;case`local_app`:return`/local-apps/${t}`;case`session`:return`/chat/${t}`;case`settings`:return`/settings/${e.id.replace(/^\/+/,``).split(`/`).map(encodeURIComponent).join(`/`)}`;case`file`:return null}}function m(e){return e.kind===`local_app`?`/open?${new URLSearchParams({kind:e.kind,id:e.id}).toString()}`:p(e)}function h(e){try{let t=new URL(e);if(t.protocol!==`xopc:`||t.hostname!==`open`)return null;let n=a.safeParse(t.searchParams.get(`kind`)),r=t.searchParams.get(`id`)?.trim()||(n.success&&n.data===`session`?t.searchParams.get(`key`)?.trim():void 0);return n.success&&r?{kind:n.data,id:r}:null}catch{return null}}export{p as a,m as i,f as n,h as r,u as t};
@@ -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-BMYIfy9x.js";import{n as a}from"./locale-store-DA0Z5jM_.js";import{a as o,r as s}from"./product-delivery-CCC4FJ3Y.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{t as l}from"./skeleton-BwbyijEw.js";import{n as u}from"./api-_aHQA8bd.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=a(h)===`zh`,m=s(`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=o({...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};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{r as n,t as r,u as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as a}from"./locale-store-DA0Z5jM_.js";import{a as o,r as s}from"./product-delivery-CrAI8ZEa.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{t as l}from"./skeleton-BwbyijEw.js";import{n as u}from"./api-_aHQA8bd.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=a(h)===`zh`,m=s(`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=o({...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};