@forsion/unit 2.12.2 → 2.13.0

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 (204) hide show
  1. package/README.md +61 -0
  2. package/backendWorker.mjs +6 -2
  3. package/main.mjs +987 -495
  4. package/package.json +1 -1
  5. package/release.json +5 -5
  6. package/web/assets/ArtificialView-BSv3Mx5C.js +1 -0
  7. package/web/assets/{AutomationBuilder-sxWdUa0L.js → AutomationBuilder-BuiHtVB-.js} +1 -1
  8. package/web/assets/CalendarConfigView-BJtG6cqN.js +1 -0
  9. package/web/assets/CalendarView-C-FX1RED.js +1 -0
  10. package/web/assets/CapabilityMenu-kx1TIJYN.js +1 -0
  11. package/web/assets/{CheckboxInput-BsaoUHZ0.js → CheckboxInput-eW7xdiRS.js} +1 -1
  12. package/web/assets/Chrome-B77-lQyh.js +1 -0
  13. package/web/assets/{CodeView-j065KtVh.js → CodeView-Df3AiSIi.js} +3 -3
  14. package/web/assets/DashboardGridView-MlO1dpuo.js +17 -0
  15. package/web/assets/{EventCard-BmDQkEj9.js → EventCard-CDmeCbI8.js} +1 -1
  16. package/web/assets/ExcalidrawCanvas-D9vkBh_5.js +1 -0
  17. package/web/assets/{FloatingToc-CENybkAA.js → FloatingToc-tART_jC4.js} +1 -1
  18. package/web/assets/HomepageView-Trqmd3RV.js +1 -0
  19. package/web/assets/ImageStudioPanels-BfCVTnKC.js +3 -0
  20. package/web/assets/ImageStudioView-KJhx0wJk.js +1 -0
  21. package/web/assets/InlineFiles-BHwivGbQ.js +1 -0
  22. package/web/assets/MarkdownBlock--__nPQGh.css +1 -0
  23. package/web/assets/MarkdownBlock-D8LgHFYY.js +58 -0
  24. package/web/assets/ModelPill-DrW2cG0l.js +2 -0
  25. package/web/assets/MuseLibraryView-CW78Uivf.js +2 -0
  26. package/web/assets/{MuseView-d-iBk3sc.js → MuseView-Cb6R_l4i.js} +2 -2
  27. package/web/assets/{PageHistoryPanel-CR-k1AM7.js → PageHistoryPanel-BQs9IWTP.js} +2 -2
  28. package/web/assets/PdfAnnotator-BFTBkxvO.js +505 -0
  29. package/web/assets/PdfAnnotator-C_kglLCA.css +1 -0
  30. package/web/assets/{ProductView-u2aezVsl.js → ProductView-mB-S0j81.js} +1 -1
  31. package/web/assets/RightPanel-BVZeVO3c.js +4 -0
  32. package/web/assets/RunLocationPicker-BE5mxnab.css +1 -0
  33. package/web/assets/RunLocationPicker-CyVa0RJa.js +38 -0
  34. package/web/assets/{SidebarRow-BuSkKH5q.js → SidebarRow-D77yrSLf.js} +1 -1
  35. package/web/assets/{SketchCard-D87GADyG.js → SketchCard-CAAr_cqF.js} +5 -5
  36. package/web/assets/{StudioGuestSurface-BijU_EEb.js → StudioGuestSurface-DthpuVGg.js} +1 -1
  37. package/web/assets/{TodoListView-DPPVpPUn.js → TodoListView-C3ZkMIIf.js} +1 -1
  38. package/web/assets/{Tooltip-DY4ISA-e.js → Tooltip-D9Dt9ZTr.js} +1 -1
  39. package/web/assets/UnifiedPage-C75y-MKT.js +68 -0
  40. package/web/assets/UnifiedPage-CWXc_mo1.css +1 -0
  41. package/web/assets/{amadeus-manual.en-DWaN2fPs.js → amadeus-manual.en-D5wZKuag.js} +3 -3
  42. package/web/assets/{amadeus-manual.zh--7D5TS8X.js → amadeus-manual.zh-Br5fidrj.js} +3 -3
  43. package/web/assets/{appStore-Dg9WALEA.js → appStore-B1ynyt42.js} +186 -120
  44. package/web/assets/appStore-BC_CQv-L.css +1 -0
  45. package/web/assets/{arrow-up-right-CpQs92mu.js → arrow-up-right-R10mR2I6.js} +1 -1
  46. package/web/assets/{astryxBridge-BZhaZPs4.js → astryxBridge-CU_kQTEl.js} +3 -3
  47. package/web/assets/automationListSource-B8EIRmDW.js +1 -0
  48. package/web/assets/book-open-DBJ3dDpw.js +1 -0
  49. package/web/assets/{calendarNavStore-C7fGRpoH.js → calendarNavStore-DGvUlU5N.js} +1 -1
  50. package/web/assets/{canvasPrefs-BeG4oEgP.js → canvasPrefs-DwL_OAAo.js} +1 -1
  51. package/web/assets/chatBoxSurface-Lq-2qfd3.js +1 -0
  52. package/web/assets/{circle-question-mark-WL3vbp-Z.js → circle-question-mark-HPZpZQxd.js} +1 -1
  53. package/web/assets/{circle-x-D7s-M5sB.js → circle-x-BZfe7d6S.js} +1 -1
  54. package/web/assets/{client-BSKpsyAw.js → client-DxGbwZLy.js} +1 -1
  55. package/web/assets/{code-xml-BALV9u_c.js → code-xml-joKQ-qGS.js} +1 -1
  56. package/web/assets/{codeStudioStore-C2mWfm32.js → codeStudioStore-C7rGKlOC.js} +1 -1
  57. package/web/assets/codingNavigation-CZB4v1ZW.css +1 -0
  58. package/web/assets/codingNavigation-CjeWG4xm.js +47 -0
  59. package/web/assets/{create-4xUyKtAF.js → create-BjBRKATq.js} +4 -4
  60. package/web/assets/dashboardSurface-Cojgf_-U.js +1 -0
  61. package/web/assets/{deskCapture-Df701U8L.js → deskCapture-DnGWk1iq.js} +1 -1
  62. package/web/assets/{diff2html-BV-zCH4d.js → diff2html-Cd1rVi_Z.js} +1 -1
  63. package/web/assets/{docx-preview-DW4IyU_Q.js → docx-preview-CK0k1mUD.js} +1 -1
  64. package/web/assets/{emoji-DGaxpCIu.js → emoji-Cjm3bKiF.js} +1 -1
  65. package/web/assets/floatingTocSurface-Dd1pT5j5.js +1 -0
  66. package/web/assets/foldActions-Dm-uAt3L.js +1 -0
  67. package/web/assets/folder-CvZyHIgb.js +1 -0
  68. package/web/assets/{folder-plus-D1TDb7k9.js → folder-plus-BRScGQ9m.js} +1 -1
  69. package/web/assets/gestures-CZQVefU0.js +1 -0
  70. package/web/assets/{hand-Crrw-nSn.js → hand-D3QspKYq.js} +1 -1
  71. package/web/assets/{hard-drive-BbyVSbfP.js → hard-drive-BQsHSala.js} +1 -1
  72. package/web/assets/i18n-ecQQxiMQ.css +1 -0
  73. package/web/assets/i18n.generated-BZRHO2Nc.js +15 -0
  74. package/web/assets/imageStudio--KF9gwHA.css +1 -0
  75. package/web/assets/imageStudio-Cy3_437s.js +2 -0
  76. package/web/assets/{index-CflzrdSt.js → index-0AYHATDX.js} +1 -1
  77. package/web/assets/{index-Dg9oixs4.js → index-1FhRiJ_X.js} +1 -1
  78. package/web/assets/{index-CqyM6tQ0.js → index-4E9nrhwf.js} +1 -1
  79. package/web/assets/{index-Cmr7gVZQ.js → index-8ag1K7AZ.js} +1 -1
  80. package/web/assets/{index-SZ5waGAq.js → index-9BmmlTjY.js} +1 -1
  81. package/web/assets/{index-CzM-C2Sd.js → index-B5GxvbNm.js} +1 -1
  82. package/web/assets/{index-DKhyDkGB.js → index-BPhwi4-v.js} +1 -1
  83. package/web/assets/index-BaRySZ-M.js +1 -0
  84. package/web/assets/{index-Brik2pf9.js → index-BcVGjCAJ.js} +1 -1
  85. package/web/assets/{index-OHi69jDq.js → index-BdZaheMZ.js} +1 -1
  86. package/web/assets/{index-D1f_JwPH.js → index-BgDZGDqt.js} +1 -1
  87. package/web/assets/{index-C6GJulug.js → index-BgtO11q8.js} +1 -1
  88. package/web/assets/{index-CF4RV4mh.js → index-Bh_nLVTc.js} +90 -90
  89. package/web/assets/{index-DjzSBM0U.js → index-BnWj6ggb.js} +1 -1
  90. package/web/assets/{index-BRW82CsP.js → index-Bpc3R3DS.js} +1 -1
  91. package/web/assets/{index-BCZZVJ_w.js → index-C9yo04Ck.js} +1 -1
  92. package/web/assets/{index--drOLtq7.js → index-CcOag8eb.js} +1 -1
  93. package/web/assets/{index-Czu_bbDM.js → index-D0FLFLfh.js} +1 -1
  94. package/web/assets/{index-KL5Rj9kP.js → index-D6mpAJ9S.js} +1 -1
  95. package/web/assets/{index-tAXBa_fN.js → index-DElrDw66.js} +1 -1
  96. package/web/assets/{index-DUWR2nZi.js → index-DJLWTPtq.js} +1 -1
  97. package/web/assets/{index-gPSbFSUn.js → index-DNE_PBJt.js} +1 -1
  98. package/web/assets/index-Dj-PygjB.js +1 -0
  99. package/web/assets/{index-BYsdKR_1.js → index-Dkd-nl1u.js} +1 -1
  100. package/web/assets/{index-C7U6T-k8.js → index-GjLSlygt.js} +1 -1
  101. package/web/assets/{invitePage-lLQ-e0pj.js → invitePage-B4gMvEKi.js} +1 -1
  102. package/web/assets/{ipc-DQOD2UKk.js → ipc-CPhL3bPp.js} +1 -1
  103. package/web/assets/{jszip.min-DZxV9uZ_.js → jszip.min-DAJT9RUA.js} +1 -1
  104. package/web/assets/launchpad-C2c1MSVX.css +1 -0
  105. package/web/assets/{layout-grid-B_pjJwz4.js → layout-grid-DfUfnvDS.js} +1 -1
  106. package/web/assets/{linkFollow-C0_3k_PC.js → linkFollow-C6PHGUxk.js} +5 -5
  107. package/web/assets/{list-tree-DkAJYEXd.js → list-tree-DaGpnIYu.js} +1 -1
  108. package/web/assets/{listFold-BsOVn9UZ.js → listFold-Q_8mh5ZG.js} +1 -1
  109. package/web/assets/{lock-BnGHxjeE.js → lock-DQ_yL4nF.js} +1 -1
  110. package/web/assets/{log-out-DBuMeqik.js → log-out-DFwTeh2X.js} +1 -1
  111. package/web/assets/main-CwqZ_ymb.js +19 -0
  112. package/web/assets/markdownEditorSurface-e_oMhqx-.js +3 -0
  113. package/web/assets/mdMarkStore-DjN4bf1T.js +2 -0
  114. package/web/assets/{mdMarks-Bq7Hl-4C.js → mdMarks-cmL6vzR-.js} +1 -1
  115. package/web/assets/{message-square-plus-BiAZAvcw.js → message-square-plus-CEHkduIL.js} +1 -1
  116. package/web/assets/{messages-BH5MfQdZ.js → messages-CBtmbpur.js} +1 -1
  117. package/web/assets/minus-BUT48dAC.js +1 -0
  118. package/web/assets/mobileEntry-qR7BAROr.js +13 -0
  119. package/web/assets/nativeDownload-CziEyW_p.js +1 -0
  120. package/web/assets/{pageChrome-xLNdFaSg.css → pageChrome-CovzZPdb.css} +1 -1
  121. package/web/assets/pageChrome-DFz_AAzZ.js +1 -0
  122. package/web/assets/{pageTree-CZH2J6cc.js → pageTree-yVO1_fSy.js} +2 -2
  123. package/web/assets/{pen-tool-lkmBqliH.js → pen-tool-uxsFELYC.js} +1 -1
  124. package/web/assets/{pencil-Cvk91P_Z.js → pencil-BSbra1Ra.js} +1 -1
  125. package/web/assets/pluginChat-BMFnf_j2.js +2 -0
  126. package/web/assets/{redo-2-DSi54z4e.js → redo-2-BK5LMNa5.js} +1 -1
  127. package/web/assets/{rotate-ccw-CUlnplr0.js → rotate-ccw-HedfU4na.js} +1 -1
  128. package/web/assets/{sharePage-MM6UpPJ9.js → sharePage-CpzDpuU1.js} +2 -2
  129. package/web/assets/{shareViewer-CDZ8lTdy.js → shareViewer-BwzH2bIs.js} +1 -1
  130. package/web/assets/{star-CwDiGyUW.js → star-CgYon3z4.js} +1 -1
  131. package/web/assets/tableSurface-CmDwnKnd.js +1 -0
  132. package/web/assets/{terminal-DIXogYJY.js → terminal-krsPf1mc.js} +1 -1
  133. package/web/assets/{terminalView-B3aZSsrQ.js → terminalView-4e2_u5_I.js} +1 -1
  134. package/web/assets/theme-C6D3tMGV.css +1 -0
  135. package/web/assets/type-GJYLEhY-.js +1 -0
  136. package/web/assets/{undo-2-tUKCv5Gs.js → undo-2-DCTs4Ro4.js} +1 -1
  137. package/web/assets/{unitAccount-D8lVwaaT.js → unitAccount-D3xjX3cu.js} +1 -1
  138. package/web/assets/{unitBridge-D547ublk.js → unitBridge-D5JcIkAP.js} +1 -1
  139. package/web/assets/{unitCloudTransport-BVF6lVp4.js → unitCloudTransport-B44L3x6M.js} +1 -1
  140. package/web/assets/{unitOwnerAccess-BfnEjsZb.js → unitOwnerAccess-CRUHWGpf.js} +1 -1
  141. package/web/assets/{unitShim-DxetRgmP.js → unitShim-_VzxvdEG.js} +3 -3
  142. package/web/assets/{upload-BbeAsMuD.js → upload-MVVRQtkj.js} +1 -1
  143. package/web/assets/userSpaces-CI4eqEgh.js +1 -0
  144. package/web/assets/viewportLock-BH26xHQO.js +611 -0
  145. package/web/assets/viewportLock-IP1zaVkz.css +1 -0
  146. package/web/assets/{workflow-DuoVRSSX.js → workflow-DzeW9OXR.js} +1 -1
  147. package/web/assets/{zoom-in-hr5bRpDL.js → zoom-in-CovPsw4g.js} +1 -1
  148. package/web/index.html +212 -13
  149. package/web/assets/ArtificialView-B4ESD4iK.js +0 -1
  150. package/web/assets/CalendarConfigView-cCfo_EvZ.js +0 -1
  151. package/web/assets/CalendarView-wgLapctk.js +0 -1
  152. package/web/assets/CapabilityMenu-BQBsM638.js +0 -1
  153. package/web/assets/ChatView-BIUk0OJd.css +0 -1
  154. package/web/assets/ChatView-C-jCJnyS.js +0 -47
  155. package/web/assets/Chrome-CwFiDmre.js +0 -1
  156. package/web/assets/DashboardGridView-DXqe0vPd.js +0 -17
  157. package/web/assets/ExcalidrawCanvas-C3egkikA.js +0 -1
  158. package/web/assets/HomepageView-CRdhjLXu.js +0 -1
  159. package/web/assets/ImageStudioPanels-Dke7xf8E.js +0 -3
  160. package/web/assets/ImageStudioView-g38V8gaj.js +0 -1
  161. package/web/assets/InlineFiles-C_hjvn3u.js +0 -1
  162. package/web/assets/MarkdownBlock-DIjYEhTK.js +0 -56
  163. package/web/assets/ModelPill-BPlgovPo.js +0 -1
  164. package/web/assets/MuseLibraryView-CenyTTim.js +0 -2
  165. package/web/assets/PdfAnnotator-CGzC_o1Q.css +0 -1
  166. package/web/assets/PdfAnnotator-D79ip27w.js +0 -560
  167. package/web/assets/RightPanel-C3OJTIqT.js +0 -4
  168. package/web/assets/RunLocationPicker-BNcZ7KKF.css +0 -1
  169. package/web/assets/RunLocationPicker-CTYXUH2z.js +0 -34
  170. package/web/assets/UnifiedPage-CKNtVD_n.js +0 -57
  171. package/web/assets/UnifiedPage-DX_sTpyZ.css +0 -1
  172. package/web/assets/appStore-Di8LXuJ9.css +0 -1
  173. package/web/assets/automationListSource-DP5xZBxo.js +0 -1
  174. package/web/assets/chatBoxSurface-zvcyfrxE.js +0 -1
  175. package/web/assets/dashboardSurface-CFTH5z4c.js +0 -1
  176. package/web/assets/ellipsis-r1EcXsFq.js +0 -1
  177. package/web/assets/floatingTocSurface-C6RJ6i41.js +0 -1
  178. package/web/assets/foldActions-B7KByFdN.js +0 -1
  179. package/web/assets/folder-DlxnPmWY.js +0 -1
  180. package/web/assets/frame-_xBVYe3P.js +0 -1
  181. package/web/assets/gestures-CkW1Kfs9.js +0 -1
  182. package/web/assets/i18n-D-eU58uw.css +0 -1
  183. package/web/assets/i18n.generated-Bbsz16cl.js +0 -15
  184. package/web/assets/imageStudio-BqbNOvpu.css +0 -1
  185. package/web/assets/imageStudio-C_Rs630L.js +0 -2
  186. package/web/assets/index-BCubCwdT.js +0 -1
  187. package/web/assets/index-DZfZTksa.js +0 -1
  188. package/web/assets/main-Dki8NlsT.js +0 -21
  189. package/web/assets/markdownEditorSurface-B4PeUzed.js +0 -3
  190. package/web/assets/mdMarkStore-CsKl7C8O.js +0 -2
  191. package/web/assets/minus-Cyv1YzOU.js +0 -1
  192. package/web/assets/mobileEntry-Bd_nKr0D.js +0 -13
  193. package/web/assets/nativeDownload-D-f1_L2S.js +0 -1
  194. package/web/assets/pageChrome-C9_azUYW.js +0 -1
  195. package/web/assets/panel-left-rOc8As0s.js +0 -1
  196. package/web/assets/pen-line-m6_HvWZ9.js +0 -1
  197. package/web/assets/sticky-note-BIuPUSOU.js +0 -1
  198. package/web/assets/tableSurface-Y_JBQsuz.js +0 -1
  199. package/web/assets/theme-DfEi_DND.css +0 -1
  200. package/web/assets/type-Cqoabh7H.js +0 -1
  201. package/web/assets/userSpaces-DyyAn7vj.js +0 -1
  202. package/web/assets/viewportLock-C4SX-9PO.js +0 -103
  203. package/web/assets/viewportLock-DYSe7Jsn.css +0 -1
  204. package/web/assets/waves-horizontal-B8ZpHQ5H.js +0 -1
@@ -1,8 +1,8 @@
1
- import{r as ct,t as D,br as P,q as Mt,cj as lt,ag as ut,ah as ft,l as dt,ai as wt}from"./index-CF4RV4mh.js";import{lO as L,lY as mt,lL as J,m3 as T,m2 as K,q6 as At,lZ as C,m4 as Tt,o1 as Lt,cO as Ft,q7 as Ot,ai as Pt}from"./appStore-Dg9WALEA.js";import{a as Ct,$ as Q}from"./index-BCubCwdT.js";ct({"srctoggle.viewSource":{zh:"查看源码",en:"View source"}});function pt(t,e){const n=Math.min(e+1,t.state.doc.content.size);t.dispatch(t.state.tr.setSelection(L.create(t.state.doc,n))),t.focus()}function ht(t,e,n,r=!1){if(!e.editable)return;const s=document.createElement("button");s.type="button",s.className=`amx-src-btn${r?" amx-src-btn--inline":""}`,s.title=D("srctoggle.viewSource"),s.setAttribute("aria-label",D("srctoggle.viewSource")),s.contentEditable="false",s.textContent="</>",s.addEventListener("mousedown",o=>{o.preventDefault(),o.stopPropagation()}),s.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),typeof n=="function"?n():pt(e,n)}),t.classList.add("amx-has-src-btn"),t.appendChild(s)}ct({"mathlive.renderFailedTitle":{zh:"LaTeX 无法渲染",en:"LaTeX could not be rendered"},"mathlive.renderFailedBadge":{zh:"公式无法渲染",en:"Formula could not be rendered"}});function gt(t){const e=[],n=t.length,r=o=>o===" "||o===" "||o===`
1
+ import{r as ct,t as D,br as C,q as Mt,cj as lt,ag as ut,ah as ft,l as dt,ai as wt}from"./index-Bh_nLVTc.js";import{mB as L,mL as mt,my as J,mS as A,mR as K,qX as Tt,mM as I,mT as At,oS as Lt,cT as Ft,qY as Pt,at as Ct}from"./appStore-B1ynyt42.js";import"./client-DxGbwZLy.js";import{a as It,$ as Q}from"./index-BaRySZ-M.js";ct({"srctoggle.viewSource":{zh:"查看源码",en:"View source"}});function pt(t,e){const n=Math.min(e+1,t.state.doc.content.size);t.dispatch(t.state.tr.setSelection(L.create(t.state.doc,n))),t.focus()}function ht(t,e,n,r=!1){if(!e.editable)return;const s=document.createElement("button");s.type="button",s.className=`amx-src-btn${r?" amx-src-btn--inline":""}`,s.title=D("srctoggle.viewSource"),s.setAttribute("aria-label",D("srctoggle.viewSource")),s.contentEditable="false",s.textContent="</>",s.addEventListener("mousedown",o=>{o.preventDefault(),o.stopPropagation()}),s.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),typeof n=="function"?n():pt(e,n)}),t.classList.add("amx-has-src-btn"),t.appendChild(s)}ct({"mathlive.renderFailedTitle":{zh:"LaTeX 无法渲染",en:"LaTeX could not be rendered"},"mathlive.renderFailedBadge":{zh:"公式无法渲染",en:"Formula could not be rendered"}});function gt(t){const e=[],n=t.length,r=o=>o===" "||o===" "||o===`
2
2
  `||o===void 0;let s=0;for(;s<n;){if(t[s]==="$"){if(t[s+1]==="$"){if(t[s+2]!=="$"){const o=t.indexOf("$$",s+2);if(o>s+1){const a=t.slice(s+2,o).trim();if(a){e.push({from:s,to:o+2,latex:a,display:!0}),s=o+2;continue}}}s+=2;continue}if(!r(t[s+1])){let o=s+1,a=-1;for(;o<n;){const c=t[o];if(c===`
3
- `)break;if(c==="$"){!r(t[o-1])&&!/[A-Za-z0-9]/.test(t[o+1]??"")&&(a=o);break}o++}if(a>s+1){e.push({from:s,to:a+1,latex:t.slice(s+1,a),display:!1}),s=a+1;continue}}}s++}return e}const It=new Set(["hardbreak","hard_break","break"]);function v(t){let e="";return t.forEach(n=>{if(n.isText){const r=n.marks.some(a=>a.type.name==="code"||a.type.name==="inlineCode"),s=n.text??"",o=!r&&n.marks.some(a=>a.type.name==="amadeusEscaped");e+=r?" ".repeat(s.length):o?s.replace(/[[\]$=%#]/g,""):s}else It.has(n.type.name)?e+=`
4
- `:e+="".repeat(n.nodeSize)}),e}function ot(t,e,n){try{At.render(e,t,{throwOnError:!1,displayMode:n,errorColor:"#e5484d"});const r=t.querySelector(".katex-error");if(r){const s=r.getAttribute("title")||D("mathlive.renderFailedTitle");t.replaceChildren();const o=document.createElement("span");o.className="math-error",o.title=s,o.textContent=n?`⚠ ${D("mathlive.renderFailedBadge")}`:"⚠",t.appendChild(o)}}catch{t.textContent=n?`$$${e}$$`:`$${e}$`}}function rt(t,e,n,r,s=!1){if(s){const a=document.createElement(n?"div":"span");a.className=n?"math-preview math-preview--block":"math-preview math-preview--inline",a.contentEditable="false";const c=document.createElement(n?"div":"span");return c.className="math-preview-inner",ot(c,e,n),a.appendChild(c),a}const o=document.createElement(n?"div":"span");return o.className=n?"math-rendered math-rendered--block":"math-rendered",o.contentEditable="false",ot(o,e,n),ht(o,t,()=>{const a=r();a!=null&&pt(t,a)},!n),o.addEventListener("mousedown",a=>{if(!t.editable)return;a.preventDefault();const c=r();if(c==null)return;const u=Math.min(c+1,t.state.doc.content.size);t.dispatch(t.state.tr.setSelection(L.create(t.state.doc,u)).setMeta(A,{focus:!0})),t.focus()}),o}const Nt=/(^```[\s\S]*?^```[^\n]*$)/m;function kt(t){if(t.indexOf("$")===-1)return[];const e=[];let n=0;return t.split(Nt).forEach((r,s)=>{if(s%2===0&&r.indexOf("$")!==-1)for(const o of gt(r))e.push({...o,from:o.from+n,to:o.to+n});n+=r.length}),e}function se(t){const e=kt(t);if(!e.length)return t;let n="",r=0;for(const s of e)n+=t.slice(r,s.from)+t.slice(s.from,s.to).replace(/\\([!-/:-@[-`{-~])/g,"$1"),r=s.to;return n+t.slice(r)}const z="amadeusEscapes",zt="amadeusLiteralEscapes",Dt={exit:{characterEscapeValue(t){const e=this.stack.pop();((e.data||={})[z]||=[]).push([e.value.length,t.start.offset]),e.value+=this.sliceSerialize(t),e.position.end={line:t.end.line,column:t.end.column,offset:t.end.offset}}}};function Kt(t,e){const n=[],r=l=>{l?.type==="text"&&l.data?.[z]&&n.push(l);for(const f of l?.children??[])r(f)};if(r(t),!n.length)return;const s=e.charCodeAt(0)===65279?1:0,o=n.map(l=>{const f=[];for(const[i,g]of l.data[z]){const b=g+s;e[b-1]==="\\"&&e[b]===l.value[i]&&f.push([i,b])}return delete l.data[z],f}),a=new Set;for(const l of o)for(const[,f]of l)e[f]==="$"&&a.add(f);let c=e,u=l=>l;if(a.size){const l=[];let f="";for(let i=0;i<e.length;i++)a.has(i+1)||(f+=e[i],l.push(i));l.push(e.length),c=f,u=i=>l[i]}const p=[];for(const l of kt(c)){const f=l.display?2:1,i=[];for(let g=0;g<f;g++)i.push(u(l.from+g),u(l.to-1-g));i.some(g=>a.has(g))||p.push([u(l.from+f-1)+1,u(l.to-f)])}n.forEach((l,f)=>{const i=[],g=[];for(const[m,y]of o[f])p.some(([h,S])=>y-1>=h&&y<S)?i.push(m):g.push(m);let b=l.value;for(const m of[...i].sort((y,h)=>h-y))b=b.slice(0,m)+"\\"+b.slice(m);l.value=b,g.length&&((l.data||={})[zt]=g.map(m=>m+i.filter(y=>y<m).length))})}function _t(){const t=this.data();return(t.fromMarkdownExtensions||=[]).push(Dt),(e,n)=>Kt(e,String(n?.value??""))}const oe=Ct("amadeusMathEscapes",()=>_t),A=new mt("amadeus-math-live-preview");function vt(t){const e=A.getState(t)?.focus??!1,n=[],r=t.selection.from,s=t.selection.to;return t.doc.descendants((o,a)=>{if(!o.isTextblock)return!0;if(o.type.spec.code)return!1;const c=a+1,u=v(o);if(u.indexOf("$")===-1)return!1;const p=gt(u);if(!p.length)return!1;let l=-1,f=-1;if(e&&r<=c+o.content.size&&s>=c){const i=Math.max(0,Math.min(u.length,r-c)),g=Math.max(0,Math.min(u.length,s-c));l=u.lastIndexOf(`
3
+ `)break;if(c==="$"){!r(t[o-1])&&!/[A-Za-z0-9]/.test(t[o+1]??"")&&(a=o);break}o++}if(a>s+1){e.push({from:s,to:a+1,latex:t.slice(s+1,a),display:!1}),s=a+1;continue}}}s++}return e}const Ot=new Set(["hardbreak","hard_break","break"]);function B(t){let e="";return t.forEach(n=>{if(n.isText){const r=n.marks.some(a=>a.type.name==="code"||a.type.name==="inlineCode"),s=n.text??"",o=!r&&n.marks.some(a=>a.type.name==="amadeusEscaped");e+=r?" ".repeat(s.length):o?s.replace(/[[\]$=%#]/g,""):s}else Ot.has(n.type.name)?e+=`
4
+ `:e+="".repeat(n.nodeSize)}),e}function ot(t,e,n){try{Tt.render(e,t,{throwOnError:!1,displayMode:n,errorColor:"#e5484d"});const r=t.querySelector(".katex-error");if(r){const s=r.getAttribute("title")||D("mathlive.renderFailedTitle");t.replaceChildren();const o=document.createElement("span");o.className="math-error",o.title=s,o.textContent=n?`⚠ ${D("mathlive.renderFailedBadge")}`:"⚠",t.appendChild(o)}}catch{t.textContent=n?`$$${e}$$`:`$${e}$`}}function rt(t,e,n,r,s=!1){if(s){const a=document.createElement(n?"div":"span");a.className=n?"math-preview math-preview--block":"math-preview math-preview--inline",a.contentEditable="false";const c=document.createElement(n?"div":"span");return c.className="math-preview-inner",ot(c,e,n),a.appendChild(c),a}const o=document.createElement(n?"div":"span");return o.className=n?"math-rendered math-rendered--block":"math-rendered",o.contentEditable="false",ot(o,e,n),ht(o,t,()=>{const a=r();a!=null&&pt(t,a)},!n),o.addEventListener("mousedown",a=>{if(!t.editable)return;a.preventDefault();const c=r();if(c==null)return;const u=Math.min(c+1,t.state.doc.content.size);t.dispatch(t.state.tr.setSelection(L.create(t.state.doc,u)).setMeta(T,{focus:!0})),t.focus()}),o}const Nt=/(^```[\s\S]*?^```[^\n]*$)/m;function kt(t){if(t.indexOf("$")===-1)return[];const e=[];let n=0;return t.split(Nt).forEach((r,s)=>{if(s%2===0&&r.indexOf("$")!==-1)for(const o of gt(r))e.push({...o,from:o.from+n,to:o.to+n});n+=r.length}),e}function oe(t){const e=kt(t);if(!e.length)return t;let n="",r=0;for(const s of e)n+=t.slice(r,s.from)+t.slice(s.from,s.to).replace(/\\([!-/:-@[-`{-~])/g,"$1"),r=s.to;return n+t.slice(r)}const z="amadeusEscapes",zt="amadeusLiteralEscapes",Dt={exit:{characterEscapeValue(t){const e=this.stack.pop();((e.data||={})[z]||=[]).push([e.value.length,t.start.offset]),e.value+=this.sliceSerialize(t),e.position.end={line:t.end.line,column:t.end.column,offset:t.end.offset}}}};function Kt(t,e){const n=[],r=l=>{l?.type==="text"&&l.data?.[z]&&n.push(l);for(const f of l?.children??[])r(f)};if(r(t),!n.length)return;const s=e.charCodeAt(0)===65279?1:0,o=n.map(l=>{const f=[];for(const[i,g]of l.data[z]){const b=g+s;e[b-1]==="\\"&&e[b]===l.value[i]&&f.push([i,b])}return delete l.data[z],f}),a=new Set;for(const l of o)for(const[,f]of l)e[f]==="$"&&a.add(f);let c=e,u=l=>l;if(a.size){const l=[];let f="";for(let i=0;i<e.length;i++)a.has(i+1)||(f+=e[i],l.push(i));l.push(e.length),c=f,u=i=>l[i]}const p=[];for(const l of kt(c)){const f=l.display?2:1,i=[];for(let g=0;g<f;g++)i.push(u(l.from+g),u(l.to-1-g));i.some(g=>a.has(g))||p.push([u(l.from+f-1)+1,u(l.to-f)])}n.forEach((l,f)=>{const i=[],g=[];for(const[m,y]of o[f])p.some(([h,S])=>y-1>=h&&y<S)?i.push(m):g.push(m);let b=l.value;for(const m of[...i].sort((y,h)=>h-y))b=b.slice(0,m)+"\\"+b.slice(m);l.value=b,g.length&&((l.data||={})[zt]=g.map(m=>m+i.filter(y=>y<m).length))})}function _t(){const t=this.data();return(t.fromMarkdownExtensions||=[]).push(Dt),(e,n)=>Kt(e,String(n?.value??""))}const re=It("amadeusMathEscapes",()=>_t),T=new mt("amadeus-math-live-preview");function Bt(t){const e=T.getState(t)?.focus??!1,n=[],r=t.selection.from,s=t.selection.to;return t.doc.descendants((o,a)=>{if(!o.isTextblock)return!0;if(o.type.spec.code)return!1;const c=a+1,u=B(o);if(u.indexOf("$")===-1)return!1;const p=gt(u);if(!p.length)return!1;let l=-1,f=-1;if(e&&r<=c+o.content.size&&s>=c){const i=Math.max(0,Math.min(u.length,r-c)),g=Math.max(0,Math.min(u.length,s-c));l=u.lastIndexOf(`
5
5
  `,i-1)+1;const b=u.indexOf(`
6
- `,g);f=b===-1?u.length:b}for(const i of p){if(l!==-1&&i.from<f&&i.to>l){const S=i.display?c+i.to:c+i.from;n.push(T.widget(S,(M,w)=>rt(M,i.latex,i.display,w,!0),{side:i.display?1:-1,ignoreSelection:!0,key:`p:${i.display?"b":"i"}:${i.latex}`}));continue}const b=c+i.from,m=c+i.to,{latex:y,display:h}=i;n.push(T.inline(b,m,{class:"math-src-hidden"})),n.push(T.widget(b,(S,M)=>rt(S,y,h,M),{side:-1,ignoreSelection:!0,key:`m:${h?"b":"i"}:${y}`}))}return!1}),n.length?K.create(t.doc,n):K.empty}function re(){return Q(()=>new J({key:A,state:{init:()=>({focus:!1}),apply:(t,e)=>{const n=t.getMeta(A);return n&&typeof n.focus=="boolean"?{focus:n.focus}:e}},props:{handleDOMEvents:{focus:t=>(A.getState(t.state)?.focus||t.dispatch(t.state.tr.setMeta(A,{focus:!0})),!1),blur:t=>(A.getState(t.state)?.focus&&t.dispatch(t.state.tr.setMeta(A,{focus:!1})),!1)},decorations:t=>vt(t)}}))}const Bt=new WeakSet;function jt(t){if(t.tagName!=="P")return t;const e=t.querySelector(":scope > img:not(.ProseMirror-separator), :scope > .wiki-inline-img-wrap, :scope > .unified-embed");if(!e)return t;const n=[...t.children].some(s=>s!==e&&!s.matches(".ProseMirror-separator, .ProseMirror-trailingBreak, .wikilink-src-hidden")),r=[...t.childNodes].some(s=>s.nodeType===Node.TEXT_NODE&&!!s.textContent?.trim());return n||r?t:e}function bt(t){const e=t.parentElement;return e&&jt(e)===t?e:null}const xt=".amx-img-resize, .amx-src-btn, .amx-img-srcline";function qt(t,e,n,r){if(n.button!==0||n.detail>1||!t.editable||!Bt.has(t)||n.target?.closest?.(xt)||!bt(e))return!1;e.draggable=!0;const s=new AbortController,o={signal:s.signal,once:!0},a=()=>{e.removeAttribute("draggable"),s.abort()};return e.addEventListener("click",()=>{a(),r()},o),window.addEventListener("mouseup",()=>setTimeout(a,0),{...o,capture:!0}),e.addEventListener("dragend",a,o),window.addEventListener("blur",a,o),!0}function ae(t){const e=t,n=e?.closest?.(".wiki-inline-img-wrap");return!n||e.closest(xt)?null:bt(n)}const Rt=/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i,at=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function St(t,e){if(!e)return null;const[n,r]=t.split("|"),s=n.trim();if(!Rt.test(s))return null;const o=r?.trim();return{url:Mt(s),width:o&&/^\d+$/.test(o)?Number(o):void 0,name:s}}function Z(t){if(lt(t)||ut(t))return t;const e=ft(t);return e?.subpath?`${e.target}#${e.subpath}`:dt(t)}function Wt(t,e){const n=v(t);if(n.indexOf("[[")===-1)return null;let r=null;P.lastIndex=0;let s;for(;s=P.exec(n);){const o=s.index,a=s.index+s[0].length;if(!(e<o||e>a)&&!St(s[1],o>0&&n[o-1]==="!")){if(e>o&&e<a)return Z(s[1]);r??=Z(s[1])}}return r}const $=new mt("amadeus-wikilink-live");function Gt(t,e){const n=t.indexOf("|");if(n!==-1){const s=t.slice(n+1).trim();if(s)return s}if(e){const s=wt(e.subpath)?e.subpath:e.subpath.split("#").map(o=>o.trim()).filter(Boolean).join(" › ");return e.target?`${e.target} › ${s}`:s}return(n===-1?t:t.slice(n+1)).trim()||t.trim()}function Vt(t,e,n,r){const s=$.getState(t)?.focus??!1,o=$.getState(t)?.sourceFrom??null,a=[],c=t.selection.from,u=t.selection.to;return t.doc.descendants((p,l)=>{if(!p.isTextblock)return!0;if(p.type.spec.code)return!1;const f=l+1,i=v(p);if(i.indexOf("[[")===-1)return!1;let g=-1,b=-1;if(s&&c>=f&&u<=f+p.content.size){const y=Math.max(0,Math.min(i.length,c-f)),h=Math.max(0,Math.min(i.length,u-f));g=i.lastIndexOf(`
6
+ `,g);f=b===-1?u.length:b}for(const i of p){if(l!==-1&&i.from<f&&i.to>l){const S=i.display?c+i.to:c+i.from;n.push(A.widget(S,(M,w)=>rt(M,i.latex,i.display,w,!0),{side:i.display?1:-1,ignoreSelection:!0,key:`p:${i.display?"b":"i"}:${i.latex}`}));continue}const b=c+i.from,m=c+i.to,{latex:y,display:h}=i;n.push(A.inline(b,m,{class:"math-src-hidden"})),n.push(A.widget(b,(S,M)=>rt(S,y,h,M),{side:-1,ignoreSelection:!0,key:`m:${h?"b":"i"}:${y}`}))}return!1}),n.length?K.create(t.doc,n):K.empty}function ae(){return Q(()=>new J({key:T,state:{init:()=>({focus:!1}),apply:(t,e)=>{const n=t.getMeta(T);return n&&typeof n.focus=="boolean"?{focus:n.focus}:e}},props:{handleDOMEvents:{focus:t=>(T.getState(t.state)?.focus||t.dispatch(t.state.tr.setMeta(T,{focus:!0})),!1),blur:t=>(T.getState(t.state)?.focus&&t.dispatch(t.state.tr.setMeta(T,{focus:!1})),!1)},decorations:t=>Bt(t)}}))}const vt=new WeakSet;function jt(t){if(t.tagName!=="P")return t;const e=t.querySelector(":scope > img:not(.ProseMirror-separator), :scope > .wiki-inline-img-wrap, :scope > .unified-embed");if(!e)return t;const n=[...t.children].some(s=>s!==e&&!s.matches(".ProseMirror-separator, .ProseMirror-trailingBreak, .wikilink-src-hidden")),r=[...t.childNodes].some(s=>s.nodeType===Node.TEXT_NODE&&!!s.textContent?.trim());return n||r?t:e}function bt(t){const e=t.parentElement;return e&&jt(e)===t?e:null}const xt=".amx-img-resize, .amx-src-btn, .amx-img-srcline";function Rt(t,e,n,r){if(n.button!==0||n.detail>1||!t.editable||!vt.has(t)||n.target?.closest?.(xt)||!bt(e))return!1;e.draggable=!0;const s=new AbortController,o={signal:s.signal,once:!0},a=()=>{e.removeAttribute("draggable"),s.abort()};return e.addEventListener("click",()=>{a(),r()},o),window.addEventListener("mouseup",()=>setTimeout(a,0),{...o,capture:!0}),e.addEventListener("dragend",a,o),window.addEventListener("blur",a,o),!0}function ie(t){const e=t,n=e?.closest?.(".wiki-inline-img-wrap");return!n||e.closest(xt)?null:bt(n)}const qt=/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i,at=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function St(t,e){if(!e)return null;const[n,r]=t.split("|"),s=n.trim();if(!qt.test(s))return null;const o=r?.trim();return{url:Mt(s),width:o&&/^\d+$/.test(o)?Number(o):void 0,name:s}}function Y(t){if(lt(t)||ut(t))return t;const e=ft(t);return e?.subpath?`${e.target}#${e.subpath}`:dt(t)}function Wt(t,e){const n=B(t);if(n.indexOf("[[")===-1)return null;let r=null;C.lastIndex=0;let s;for(;s=C.exec(n);){const o=s.index,a=s.index+s[0].length;if(!(e<o||e>a)&&!St(s[1],o>0&&n[o-1]==="!")){if(e>o&&e<a)return Y(s[1]);r??=Y(s[1])}}return r}const $=new mt("amadeus-wikilink-live");function Gt(t,e){const n=t.indexOf("|");if(n!==-1){const s=t.slice(n+1).trim();if(s)return s}if(e){const s=wt(e.subpath)?e.subpath:e.subpath.split("#").map(o=>o.trim()).filter(Boolean).join(" › ");return e.target?`${e.target} › ${s}`:s}return(n===-1?t:t.slice(n+1)).trim()||t.trim()}function Vt(t,e,n,r){const s=$.getState(t)?.focus??!1,o=$.getState(t)?.sourceFrom??null,a=[],c=t.selection.from,u=t.selection.to;return t.doc.descendants((p,l)=>{if(!p.isTextblock)return!0;if(p.type.spec.code)return!1;const f=l+1,i=B(p);if(i.indexOf("[[")===-1)return!1;let g=-1,b=-1;if(s&&c>=f&&u<=f+p.content.size){const y=Math.max(0,Math.min(i.length,c-f)),h=Math.max(0,Math.min(i.length,u-f));g=i.lastIndexOf(`
7
7
  `,y-1)+1;const S=i.indexOf(`
8
- `,h);b=S===-1?i.length:S}P.lastIndex=0;let m;for(;m=P.exec(i);){const y=m.index>0&&i[m.index-1]==="!",h=St(m[1],y),S=h?m.index-1:m.index,M=m.index+m[0].length,w=f+S,B=f+M,j=!!h&&S===0&&M===i.length;h&&s&&(c===w&&u===B||j&&t.selection instanceof C&&c===l&&l+p.nodeSize);const tt=g!==-1&&S<b&&M>g;if(!h&&tt||h&&tt&&o===w)continue;if(h){const V=M-S;a.push(T.inline(w,B,{class:"wikilink-src-hidden"})),a.push(T.widget(w,(x,E)=>{const d=document.createElement("span");d.className="wiki-inline-img-wrap",d.contentEditable="false",Y(d,E,V);const H=()=>{const k=E();return k==null?null:{from:k,to:k+V}},F=document.createElement("img");F.className="wiki-inline-img",F.src=h.url,F.alt=h.name,h.width&&(F.style.width=`${h.width}px`),d.appendChild(F),Lt(d,F,()=>h.name);const st=()=>{const k=H();if(!k)return;const N=j?x.state.tr.setSelection(C.create(x.state.doc,k.from-1)):x.state.tr.setSelection(L.create(x.state.doc,k.from,k.to));x.dispatch(N),x.focus()};return d.addEventListener("mousedown",k=>{k.button!==0||k.target.closest(".amx-img-resize, .amx-src-btn")||(k.stopPropagation(),!qt(x,d,k,st)&&(k.preventDefault(),st()))}),ht(d,x,()=>{const k=H();if(!k)return;const N=x.state.tr.setSelection(L.create(x.state.doc,Math.min(k.from+1,x.state.doc.content.size)));N.setMeta($,{sourceFrom:k.from}),x.dispatch(N),x.focus()}),d},{side:-1,ignoreSelection:!0,key:`i:${j?1:0}:${m[0]}`}));continue}const I=dt(m[1]),q=lt(m[1])||!!ut(m[1])?null:ft(m[1]),R=q?.subpath?{target:q.target,subpath:q.subpath}:null,et=Gt(m[1],R),W=R&&!R.target?!0:n(I),G=W&&I?r?.(I):void 0,nt=Z(m[1]);a.push(T.inline(w,B,{class:"wikilink-src-hidden"})),a.push(T.widget(w,(V,x)=>{const E=document.createElement("span");if(E.className=W?"wikilink":"wikilink wikilink-unresolved",E.setAttribute("role","link"),E.setAttribute("data-wiki",I),Y(E,x,M-S),G){const d=document.createElement("span");d.className="wikilink-emoji",d.textContent=G,E.append(d,et)}else E.textContent=et;return E.addEventListener("mousedown",d=>{if(d.button===2||at&&d.button===0&&d.ctrlKey){d.preventDefault();return}if(d.button===1){d.preventDefault(),e(nt,{newTab:!0});return}d.button!==0||d.shiftKey||d.altKey||(d.preventDefault(),e(nt,(at?d.metaKey:d.ctrlKey)?{newTab:!0}:void 0))}),E.addEventListener("contextmenu",d=>d.stopPropagation()),E},{side:-1,ignoreSelection:!0,key:`w:${m[0]}:${W?1:0}:${G??""}`}))}return!1}),a.length?K.create(t.doc,a):K.empty}const X=new WeakMap,U=new WeakMap,yt=new WeakMap;function Y(t,e,n){yt.set(t,{getPos:e,len:n});const r=e();r!=null&&(t.dataset.srcFrom=String(r),t.dataset.srcTo=String(r+n))}function Ht(t){const{from:e,to:n}=t.state.selection,r=$.getState(t.state)?.focus??!1;for(const u of t.dom.querySelectorAll(".wikilink[data-src-from], .wiki-inline-img-wrap[data-src-from]")){const p=yt.get(u);p&&Y(u,p.getPos,p.len)}for(const u of t.dom.querySelectorAll(".wikilink[data-src-from], .wiki-inline-img-wrap[data-src-from]")){const p=Number(u.dataset.srcFrom),l=Number(u.dataset.srcTo);e!==n&&e<l&&n>p?u.dataset.rangeSelected="":delete u.dataset.rangeSelected}const s=U.get(t)??null;let o=e,a=n;t.state.selection instanceof C&&t.state.selection.node.type.name==="paragraph"&&(o=e+1,a=n-1);const c=r&&o!==a?t.dom.querySelector(`.wiki-inline-img-wrap[data-src-from="${o}"][data-src-to="${a}"]`):null;if(s!==c){if(s&&(delete s.dataset.selected,X.get(s)?.(),X.delete(s)),c){c.dataset.selected="";const u=c.querySelector("img");u&&t.editable&&X.set(c,Tt(c,u,p=>{const l=(t.state.doc.textBetween(o,a).match(/^!\[\[([^\]\n|]+)/)??[])[1];if(!l)return;const f=`![[${l}|${p}]]`,i=t.state.tr.insertText(f,o,a);t.state.selection instanceof C?i.setSelection(C.create(i.doc,e)):i.setSelection(L.create(i.doc,o,o+f.length)),t.dispatch(i)}))}c?U.set(t,c):U.delete(t)}}function Xt(t,e){const n=t.state.selection;if(!(n instanceof L)||!n.empty||!n.$head.parent.isTextblock)return null;try{const a=t.coordsAtPos(n.head),c=t.coordsAtPos(e==="up"?n.$head.start():n.$head.end());if(Math.abs(a.top-c.top)>Math.max(2,a.bottom-a.top))return null}catch{if(e==="up"?n.$head.parentOffset!==0:n.$head.parentOffset!==n.$head.parent.content.size)return null}const r=[];t.state.doc.descendants((a,c)=>{if(!a.isTextblock)return!0;const u=v(a);let p=null;P.lastIndex=0;const l=P.exec(u);return l&&l.index===0&&l[0].length===u.length&&(p=c+1),r.push({pos:c,size:a.nodeSize,sourceFrom:p}),!1});const s=r.findIndex(a=>n.head>a.pos&&n.head<a.pos+a.size),o=r[s+(e==="up"?-1:1)];return o?.sourceFrom==null?null:o.sourceFrom+2}function ie(t,e=()=>!0,n){return Q(()=>new J({key:$,view:()=>({update:Ht}),state:{init:()=>({focus:!1,sourceFrom:null}),apply:(r,s)=>{const o=r.getMeta($);let a=s.sourceFrom;if(a!=null&&r.docChanged&&(a=r.mapping.map(a)),o&&typeof o.sourceFrom=="number")a=o.sourceFrom;else if(a!=null&&r.selectionSet){const c=r.doc.nodeAt(Math.max(0,a-1)),u=Math.max(0,a-1);(!c||r.selection.to<=u||r.selection.from>=u+c.nodeSize)&&(a=null)}return{focus:o&&typeof o.focus=="boolean"?o.focus:s.focus,sourceFrom:a}}},props:{handleDOMEvents:{focus:r=>($.getState(r.state)?.focus||r.dispatch(r.state.tr.setMeta($,{focus:!0})),!1),blur:r=>($.getState(r.state)?.focus&&r.dispatch(r.state.tr.setMeta($,{focus:!1})),!1)},handleKeyDown:(r,s)=>{if(s.key!=="ArrowUp"&&s.key!=="ArrowDown"||s.metaKey||s.ctrlKey||s.altKey||s.shiftKey)return!1;const o=Xt(r,s.key==="ArrowUp"?"up":"down");return o==null?!1:(r.dispatch(r.state.tr.setSelection(L.create(r.state.doc,o)).scrollIntoView()),!0)},decorations:r=>Vt(r,t,e,n)}}))}function Et(t){const e=t.selection.$head;if(!e.parent.isTextblock||e.parent.type.spec.code)return null;const n=Wt(e.parent,e.parentOffset);if(n)return{kind:"wiki",arg:n};const r=t.schema.marks.link;if(!r)return null;const o=(r.isInSet(e.nodeAfter?.marks??[])??r.isInSet(e.nodeBefore?.marks??[]))?.attrs.href;return typeof o=="string"&&o?{kind:"href",href:o}:null}const _=new Map;let O=null;function Ut(t){return Q(()=>new J({view:e=>(_.set(e,t),{destroy:()=>{_.delete(e),O===e&&(O=null)}}),props:{handleDOMEvents:{focus:e=>(O=e,!1)}}}))}function Zt(){const t=typeof document<"u"?document.activeElement:null;if(t){for(const e of _.keys())if(e.dom.contains(t))return e}return O&&O.dom.isConnected?O:null}function $t(t,e){const n=Et(t.state),r=_.get(t);return!n||!r?!1:(r(n,e),!0)}function Yt(t){const e=Zt();e&&$t(e,t==="followNewTab")}function it(t){const e=t.toLowerCase().split("+").map(r=>r.trim()),n=e.pop()??"";return[...e.sort(),n].join("+")}function Jt(t){if(t.isComposing)return null;const e=Ft(t);if(!e)return null;const n=it(e);for(const r of Ot){const s=Pt(r);if(s&&it(s)===n)return r.kind}return null}const ce=Object.freeze(Object.defineProperty({__proto__:null,followLinkAt:$t,linkAtCursor:Et,linkFollowPlugin:Ut,linkKindOfEvent:Jt,runLinkCommand:Yt},Symbol.toStringTag,{value:"Module"}));export{at as I,zt as L,ht as a,v as b,Bt as c,qt as d,re as e,Jt as f,Et as g,ce as h,ae as i,Ut as l,oe as m,gt as s,se as u,jt as v,ie as w};
8
+ `,h);b=S===-1?i.length:S}C.lastIndex=0;let m;for(;m=C.exec(i);){const y=m.index>0&&i[m.index-1]==="!",h=St(m[1],y),S=h?m.index-1:m.index,M=m.index+m[0].length,w=f+S,v=f+M,j=!!h&&S===0&&M===i.length;h&&s&&(c===w&&u===v||j&&t.selection instanceof I&&c===l&&l+p.nodeSize);const tt=g!==-1&&S<b&&M>g;if(!h&&tt||h&&tt&&o===w)continue;if(h){const V=M-S;a.push(A.inline(w,v,{class:"wikilink-src-hidden"})),a.push(A.widget(w,(x,E)=>{const d=document.createElement("span");d.className="wiki-inline-img-wrap",d.contentEditable="false",Z(d,E,V);const X=()=>{const k=E();return k==null?null:{from:k,to:k+V}},F=document.createElement("img");F.className="wiki-inline-img",F.src=h.url,F.alt=h.name,h.width&&(F.style.width=`${h.width}px`),d.appendChild(F),Lt(d,F,()=>h.name);const st=()=>{const k=X();if(!k)return;const N=j?x.state.tr.setSelection(I.create(x.state.doc,k.from-1)):x.state.tr.setSelection(L.create(x.state.doc,k.from,k.to));x.dispatch(N),x.focus()};return d.addEventListener("mousedown",k=>{k.button!==0||k.target.closest(".amx-img-resize, .amx-src-btn")||(k.stopPropagation(),!Rt(x,d,k,st)&&(k.preventDefault(),st()))}),ht(d,x,()=>{const k=X();if(!k)return;const N=x.state.tr.setSelection(L.create(x.state.doc,Math.min(k.from+1,x.state.doc.content.size)));N.setMeta($,{sourceFrom:k.from}),x.dispatch(N),x.focus()}),d},{side:-1,ignoreSelection:!0,key:`i:${j?1:0}:${m[0]}`}));continue}const O=dt(m[1]),R=lt(m[1])||!!ut(m[1])?null:ft(m[1]),q=R?.subpath?{target:R.target,subpath:R.subpath}:null,et=Gt(m[1],q),W=q&&!q.target?!0:n(O),G=W&&O?r?.(O):void 0,nt=Y(m[1]);a.push(A.inline(w,v,{class:"wikilink-src-hidden"})),a.push(A.widget(w,(V,x)=>{const E=document.createElement("span");if(E.className=W?"wikilink":"wikilink wikilink-unresolved",E.setAttribute("role","link"),E.setAttribute("data-wiki",O),Z(E,x,M-S),G){const d=document.createElement("span");d.className="wikilink-emoji",d.textContent=G,E.append(d,et)}else E.textContent=et;return E.addEventListener("mousedown",d=>{if(d.button===2||at&&d.button===0&&d.ctrlKey){d.preventDefault();return}if(d.button===1){d.preventDefault(),e(nt,{newTab:!0});return}d.button!==0||d.shiftKey||d.altKey||(d.preventDefault(),e(nt,(at?d.metaKey:d.ctrlKey)?{newTab:!0}:void 0))}),E.addEventListener("contextmenu",d=>d.stopPropagation()),E},{side:-1,ignoreSelection:!0,key:`w:${m[0]}:${W?1:0}:${G??""}`}))}return!1}),a.length?K.create(t.doc,a):K.empty}const H=new WeakMap,U=new WeakMap,yt=new WeakMap;function Z(t,e,n){yt.set(t,{getPos:e,len:n});const r=e();r!=null&&(t.dataset.srcFrom=String(r),t.dataset.srcTo=String(r+n))}function Xt(t){const{from:e,to:n}=t.state.selection,r=$.getState(t.state)?.focus??!1;for(const u of t.dom.querySelectorAll(".wikilink[data-src-from], .wiki-inline-img-wrap[data-src-from]")){const p=yt.get(u);p&&Z(u,p.getPos,p.len)}for(const u of t.dom.querySelectorAll(".wikilink[data-src-from], .wiki-inline-img-wrap[data-src-from]")){const p=Number(u.dataset.srcFrom),l=Number(u.dataset.srcTo);e!==n&&e<l&&n>p?u.dataset.rangeSelected="":delete u.dataset.rangeSelected}const s=U.get(t)??null;let o=e,a=n;t.state.selection instanceof I&&t.state.selection.node.type.name==="paragraph"&&(o=e+1,a=n-1);const c=r&&o!==a?t.dom.querySelector(`.wiki-inline-img-wrap[data-src-from="${o}"][data-src-to="${a}"]`):null;if(s!==c){if(s&&(delete s.dataset.selected,H.get(s)?.(),H.delete(s)),c){c.dataset.selected="";const u=c.querySelector("img");u&&t.editable&&H.set(c,At(c,u,p=>{const l=(t.state.doc.textBetween(o,a).match(/^!\[\[([^\]\n|]+)/)??[])[1];if(!l)return;const f=`![[${l}|${p}]]`,i=t.state.tr.insertText(f,o,a);t.state.selection instanceof I?i.setSelection(I.create(i.doc,e)):i.setSelection(L.create(i.doc,o,o+f.length)),t.dispatch(i)}))}c?U.set(t,c):U.delete(t)}}function Ht(t,e){const n=t.state.selection;if(!(n instanceof L)||!n.empty||!n.$head.parent.isTextblock)return null;try{const a=t.coordsAtPos(n.head),c=t.coordsAtPos(e==="up"?n.$head.start():n.$head.end());if(Math.abs(a.top-c.top)>Math.max(2,a.bottom-a.top))return null}catch{if(e==="up"?n.$head.parentOffset!==0:n.$head.parentOffset!==n.$head.parent.content.size)return null}const r=[];t.state.doc.descendants((a,c)=>{if(!a.isTextblock)return!0;const u=B(a);let p=null;C.lastIndex=0;const l=C.exec(u);return l&&l.index===0&&l[0].length===u.length&&(p=c+1),r.push({pos:c,size:a.nodeSize,sourceFrom:p}),!1});const s=r.findIndex(a=>n.head>a.pos&&n.head<a.pos+a.size),o=r[s+(e==="up"?-1:1)];return o?.sourceFrom==null?null:o.sourceFrom+2}function ce(t,e=()=>!0,n){return Q(()=>new J({key:$,view:()=>({update:Xt}),state:{init:()=>({focus:!1,sourceFrom:null}),apply:(r,s)=>{const o=r.getMeta($);let a=s.sourceFrom;if(a!=null&&r.docChanged&&(a=r.mapping.map(a)),o&&typeof o.sourceFrom=="number")a=o.sourceFrom;else if(a!=null&&r.selectionSet){const c=r.doc.nodeAt(Math.max(0,a-1)),u=Math.max(0,a-1);(!c||r.selection.to<=u||r.selection.from>=u+c.nodeSize)&&(a=null)}return{focus:o&&typeof o.focus=="boolean"?o.focus:s.focus,sourceFrom:a}}},props:{handleDOMEvents:{focus:r=>($.getState(r.state)?.focus||r.dispatch(r.state.tr.setMeta($,{focus:!0})),!1),blur:r=>($.getState(r.state)?.focus&&r.dispatch(r.state.tr.setMeta($,{focus:!1})),!1)},handleKeyDown:(r,s)=>{if(s.key!=="ArrowUp"&&s.key!=="ArrowDown"||s.metaKey||s.ctrlKey||s.altKey||s.shiftKey)return!1;const o=Ht(r,s.key==="ArrowUp"?"up":"down");return o==null?!1:(r.dispatch(r.state.tr.setSelection(L.create(r.state.doc,o)).scrollIntoView()),!0)},decorations:r=>Vt(r,t,e,n)}}))}function Et(t){const e=t.selection.$head;if(!e.parent.isTextblock||e.parent.type.spec.code)return null;const n=Wt(e.parent,e.parentOffset);if(n)return{kind:"wiki",arg:n};const r=t.schema.marks.link;if(!r)return null;const o=(r.isInSet(e.nodeAfter?.marks??[])??r.isInSet(e.nodeBefore?.marks??[]))?.attrs.href;return typeof o=="string"&&o?{kind:"href",href:o}:null}const _=new Map;let P=null;function Ut(t){return Q(()=>new J({view:e=>(_.set(e,t),{destroy:()=>{_.delete(e),P===e&&(P=null)}}),props:{handleDOMEvents:{focus:e=>(P=e,!1)}}}))}function Yt(){const t=typeof document<"u"?document.activeElement:null;if(t){for(const e of _.keys())if(e.dom.contains(t))return e}return P&&P.dom.isConnected?P:null}function $t(t,e){const n=Et(t.state),r=_.get(t);return!n||!r?!1:(r(n,e),!0)}function Zt(t){const e=Yt();e&&$t(e,t==="followNewTab")}function it(t){const e=t.toLowerCase().split("+").map(r=>r.trim()),n=e.pop()??"";return[...e.sort(),n].join("+")}function Jt(t){if(t.isComposing)return null;const e=Ft(t);if(!e)return null;const n=it(e);for(const r of Pt){const s=Ct(r);if(s&&it(s)===n)return r.kind}return null}const le=Object.freeze(Object.defineProperty({__proto__:null,followLinkAt:$t,linkAtCursor:Et,linkFollowPlugin:Ut,linkKindOfEvent:Jt,runLinkCommand:Zt},Symbol.toStringTag,{value:"Module"}));export{at as I,zt as L,ht as a,B as b,vt as c,Rt as d,ae as e,Jt as f,Et as g,le as h,ie as i,Ut as l,re as m,gt as s,oe as u,jt as v,ce as w};
@@ -1 +1 @@
1
- import{z as e}from"./appStore-Dg9WALEA.js";const t=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],h=e("list-tree",t);export{h as L};
1
+ import{F as e}from"./appStore-B1ynyt42.js";const t=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],h=e("list-tree",t);export{h as L};
@@ -1 +1 @@
1
- import{r as E,B as C,t as F}from"./index-CF4RV4mh.js";import{$ as L}from"./index-BCubCwdT.js";import{lY as M,lL as $,m2 as x,lP as S,m3 as h}from"./appStore-Dg9WALEA.js";E({"headfold.expandSection":{zh:"展开小节",en:"Expand section"}});const u=new M("AMX_HEADING_FOLD");function p(e,o){if(!Number.isInteger(o)||o<0||o>e.content.size)return null;let t;try{t=e.resolve(o)}catch{return null}const n=t.nodeAfter;return!n||n.type.name!=="heading"?null:{parent:t.parent,index:t.index(),base:t.start()}}function y(e){const o=[];let t=e.base;return e.parent.forEach(n=>{o.push(t),t+=n.nodeSize}),o}function b(e,o){const t=e.child(o),n=Number(t.attrs.level)||1;let l=o;for(let i=o+1;i<e.childCount;i++){const d=e.child(i);if(d.type.name==="heading"&&(Number(d.attrs.level)||1)<=n)break;l=i}return l===o?null:l}function D(e,o){const t=[];for(const n of o){const l=p(e,n);if(!l)continue;const i=b(l.parent,l.index);if(i==null)continue;const d=y(l);t.push(h.node(n,n+l.parent.child(l.index).nodeSize,{class:"amx-heading-folded"}));for(let s=l.index+1;s<=i;s++)t.push(h.node(d[s],d[s]+l.parent.child(s).nodeSize,{class:"amx-fold-hidden"}));t.push(h.widget(n+1,(s,c)=>{const r=document.createElement("button");r.type="button",r.className="amx-fold-caret",r.textContent="▸",r.contentEditable="false";const a=()=>{r.title=F("headfold.expandSection"),r.setAttribute("aria-label",r.title)};return a(),r.setAttribute("aria-expanded","false"),r.__off=C(a),r.addEventListener("mousedown",_=>{_.preventDefault(),_.stopPropagation();const A=c();if(A==null)return;const z=s.state.doc.resolve(A);H(s,z.before(z.depth))}),r},{side:-1,ignoreSelection:!0,key:`amxfold:${n}`,destroy:s=>{s.__off?.()}}))}return x.create(e,t)}function K(e){const o=[];return e.descendants((t,n)=>{if(t.type.name!=="heading")return!0;const l=p(e,n);return l&&b(l.parent,l.index)!=null&&o.push(n),!1}),o}function H(e,o){e.dispatch(e.state.tr.setMeta(u,{toggle:o}))}function O(e,o){const t=u.getState(e.state),n=p(e.state.doc,o);return!n||b(n.parent,n.index)==null?null:t?.folded.includes(o)?"folded":"foldable"}function g(e,o){const t=[];for(const n of o){const l=p(e,n);if(!l)continue;const i=b(l.parent,l.index);if(i==null)continue;const d=y(l);t.push({start:d[l.index+1],after:d[i]+l.parent.child(i).nodeSize})}return t}function T(e,o){const t=p(e,o);if(!t)return null;const n=b(t.parent,t.index)??t.index;return y(t)[n]+t.parent.child(n).nodeSize}function X(e,o){if(!u.getState(e)?.folded.includes(o))return null;const n=g(e.doc,[o])[0];return n?n.after:null}function j(e,o){const t=u.getState(e);if(!t?.folded.length)return null;for(const n of t.folded)for(const l of g(e.doc,[n]))if(o>l.start&&o<l.after)return n;return null}const B=[L(()=>new $({key:u,state:{init:()=>({folded:[],decos:x.empty}),apply:(e,o,t)=>{let n=o.folded;if(e.docChanged&&(n=n.map(d=>e.mapping.mapResult(d)).filter(d=>!d.deleted||p(e.doc,d.pos)!=null).map(d=>d.pos)),e.docChanged&&e.getMeta("uiEvent")==="drop"){const d=[];e.mapping.maps[e.mapping.maps.length-1].forEach((s,c,r,a)=>{a>r&&d.push([r,a])}),n=n.filter(s=>!g(e.doc,[s]).some(c=>d.some(([r,a])=>r<c.after&&a>c.start)))}let l=[];if(e.docChanged&&e.selection.empty&&n.length){const d=t.selection,s=d.empty&&g(t.doc,o.folded).some(r=>d.from>r.start&&d.from<r.after),c=e.selection.from;s||(l=n.filter(r=>g(e.doc,[r]).some(a=>c>a.start&&c<a.after)))}const i=e.getMeta(u);if(i?.set&&(n=i.set.slice()),i?.toggle!=null){const d=i.toggle;n=n.includes(d)?n.filter(s=>s!==d):[...n,d]}return l.length&&(n=n.filter(d=>d===i?.toggle||!l.includes(d))),n=[...new Set(n)].filter(d=>{const s=p(e.doc,d);return s!=null&&b(s.parent,s.index)!=null}),!e.docChanged&&!i&&n===o.folded?o:{folded:n,decos:D(e.doc,n)}}},appendTransaction:(e,o,t)=>{const n=u.getState(t);if(!n?.folded.length||!t.selection.empty)return null;const l=t.selection.from;for(const i of g(t.doc,n.folded)){if(l<=i.start||l>=i.after)continue;const d=l>=o.selection.from?1:-1;let s=S.near(t.doc.resolve(d===1?Math.min(i.after,t.doc.content.size):i.start),d);return s.from>i.start&&s.from<i.after&&(s=S.near(t.doc.resolve(i.start),-1)),t.tr.setSelection(s)}return null},props:{decorations(e){return u.getState(e)?.decos??null}}}))].flat();E({"listfold.expandChildren":{zh:"展开子项",en:"Expand children"}});const f=new M("AMX_LIST_FOLD");function m(e,o){if(o<0||o>=e.content.size)return null;const t=e.nodeAt(o);if(!t||t.type.name!=="list_item"||t.childCount<2)return null;const n=t.child(1);if(!/_list$/.test(n.type.name))return null;const l=o+1+t.child(0).nodeSize;return{item:t,from:l,to:l+n.nodeSize}}function P(e,o){const t=[];for(const n of o){const l=m(e,n);l&&(t.push(h.node(n,n+l.item.nodeSize,{class:"amx-listitem-folded"})),t.push(h.node(l.from,l.to,{class:"amx-fold-hidden"})),t.push(h.widget(n+2,(i,d)=>{const s=document.createElement("button");s.type="button",s.className="amx-fold-caret",s.textContent="▸",s.contentEditable="false";const c=()=>{s.title=F("listfold.expandChildren"),s.setAttribute("aria-label",s.title)};return c(),s.setAttribute("aria-expanded","false"),s.__off=C(c),s.addEventListener("mousedown",r=>{r.preventDefault(),r.stopPropagation();const a=d();a!=null&&k(i,i.state.doc.resolve(a).before(i.state.doc.resolve(a).depth-1))}),s},{side:-1,ignoreSelection:!0,key:`amxlfold:${n}`,destroy:i=>{i.__off?.()}})))}return x.create(e,t)}function G(e){const o=[];return e.descendants((t,n)=>(t.type.name==="list_item"&&m(e,n)&&o.push(n),!0)),o}function k(e,o){e.dispatch(e.state.tr.setMeta(f,{toggle:o}))}function Y(e,o){return m(e.state.doc,o)?f.getState(e.state)?.folded.includes(o)?"folded":"foldable":null}function N(e){const o=f.getState(e);return o?.folded.length?R(e.doc,o.folded):[]}function R(e,o){const t=[];for(const n of o){const l=m(e,n);l&&t.push({start:l.from,after:l.to})}return t}function q(e,o){const t=f.getState(e);return t?.folded.length?t.folded.filter(n=>{const l=m(e.doc,n);return!!l&&o>l.from&&o<l.to}):[]}function J(e,o){return!!f.getState(e)?.folded.includes(o)}const Q=[L(()=>new $({key:f,state:{init:()=>({folded:[],decos:x.empty}),apply:(e,o)=>{let t=o.folded;e.docChanged&&(t=t.map(l=>e.mapping.mapResult(l)).filter(l=>!l.deleted||m(e.doc,l.pos)!=null).map(l=>l.pos));const n=e.getMeta(f);if(n?.set&&(t=n.set.slice()),n?.toggle!=null){const l=n.toggle;t=t.includes(l)?t.filter(i=>i!==l):[...t,l]}return t=[...new Set(t)].filter(l=>m(e.doc,l)!=null),!e.docChanged&&!n&&t===o.folded?o:{folded:t,decos:P(e.doc,t)}}},appendTransaction:(e,o,t)=>{if(!f.getState(t)?.folded.length||!t.selection.empty)return null;const l=t.selection.from;for(const i of N(t)){if(l<=i.start||l>=i.after)continue;const d=l>=o.selection.from?1:-1;let s=S.near(t.doc.resolve(d===1?Math.min(i.after,t.doc.content.size):i.start),d);return s.from>i.start&&s.from<i.after&&(s=S.near(t.doc.resolve(i.start),-1)),t.tr.setSelection(s)}return null},props:{decorations(e){return f.getState(e)?.decos??null}}}))].flat();export{g as a,j as b,N as c,O as d,Y as e,X as f,k as g,u as h,J as i,B as j,Q as k,f as l,q as m,K as n,G as o,R as p,T as s,H as t};
1
+ import{r as E,B as C,t as F}from"./index-Bh_nLVTc.js";import{$ as L}from"./index-BaRySZ-M.js";import{mL as M,my as $,mR as x,mC as S,mS as h}from"./appStore-B1ynyt42.js";E({"headfold.expandSection":{zh:"展开小节",en:"Expand section"}});const u=new M("AMX_HEADING_FOLD");function p(e,o){if(!Number.isInteger(o)||o<0||o>e.content.size)return null;let t;try{t=e.resolve(o)}catch{return null}const n=t.nodeAfter;return!n||n.type.name!=="heading"?null:{parent:t.parent,index:t.index(),base:t.start()}}function y(e){const o=[];let t=e.base;return e.parent.forEach(n=>{o.push(t),t+=n.nodeSize}),o}function b(e,o){const t=e.child(o),n=Number(t.attrs.level)||1;let l=o;for(let i=o+1;i<e.childCount;i++){const d=e.child(i);if(d.type.name==="heading"&&(Number(d.attrs.level)||1)<=n)break;l=i}return l===o?null:l}function D(e,o){const t=[];for(const n of o){const l=p(e,n);if(!l)continue;const i=b(l.parent,l.index);if(i==null)continue;const d=y(l);t.push(h.node(n,n+l.parent.child(l.index).nodeSize,{class:"amx-heading-folded"}));for(let s=l.index+1;s<=i;s++)t.push(h.node(d[s],d[s]+l.parent.child(s).nodeSize,{class:"amx-fold-hidden"}));t.push(h.widget(n+1,(s,c)=>{const r=document.createElement("button");r.type="button",r.className="amx-fold-caret",r.textContent="▸",r.contentEditable="false";const a=()=>{r.title=F("headfold.expandSection"),r.setAttribute("aria-label",r.title)};return a(),r.setAttribute("aria-expanded","false"),r.__off=C(a),r.addEventListener("mousedown",_=>{_.preventDefault(),_.stopPropagation();const A=c();if(A==null)return;const z=s.state.doc.resolve(A);H(s,z.before(z.depth))}),r},{side:-1,ignoreSelection:!0,key:`amxfold:${n}`,destroy:s=>{s.__off?.()}}))}return x.create(e,t)}function K(e){const o=[];return e.descendants((t,n)=>{if(t.type.name!=="heading")return!0;const l=p(e,n);return l&&b(l.parent,l.index)!=null&&o.push(n),!1}),o}function H(e,o){e.dispatch(e.state.tr.setMeta(u,{toggle:o}))}function O(e,o){const t=u.getState(e.state),n=p(e.state.doc,o);return!n||b(n.parent,n.index)==null?null:t?.folded.includes(o)?"folded":"foldable"}function g(e,o){const t=[];for(const n of o){const l=p(e,n);if(!l)continue;const i=b(l.parent,l.index);if(i==null)continue;const d=y(l);t.push({start:d[l.index+1],after:d[i]+l.parent.child(i).nodeSize})}return t}function T(e,o){const t=p(e,o);if(!t)return null;const n=b(t.parent,t.index)??t.index;return y(t)[n]+t.parent.child(n).nodeSize}function X(e,o){if(!u.getState(e)?.folded.includes(o))return null;const n=g(e.doc,[o])[0];return n?n.after:null}function j(e,o){const t=u.getState(e);if(!t?.folded.length)return null;for(const n of t.folded)for(const l of g(e.doc,[n]))if(o>l.start&&o<l.after)return n;return null}const B=[L(()=>new $({key:u,state:{init:()=>({folded:[],decos:x.empty}),apply:(e,o,t)=>{let n=o.folded;if(e.docChanged&&(n=n.map(d=>e.mapping.mapResult(d)).filter(d=>!d.deleted||p(e.doc,d.pos)!=null).map(d=>d.pos)),e.docChanged&&e.getMeta("uiEvent")==="drop"){const d=[];e.mapping.maps[e.mapping.maps.length-1].forEach((s,c,r,a)=>{a>r&&d.push([r,a])}),n=n.filter(s=>!g(e.doc,[s]).some(c=>d.some(([r,a])=>r<c.after&&a>c.start)))}let l=[];if(e.docChanged&&e.selection.empty&&n.length){const d=t.selection,s=d.empty&&g(t.doc,o.folded).some(r=>d.from>r.start&&d.from<r.after),c=e.selection.from;s||(l=n.filter(r=>g(e.doc,[r]).some(a=>c>a.start&&c<a.after)))}const i=e.getMeta(u);if(i?.set&&(n=i.set.slice()),i?.toggle!=null){const d=i.toggle;n=n.includes(d)?n.filter(s=>s!==d):[...n,d]}return l.length&&(n=n.filter(d=>d===i?.toggle||!l.includes(d))),n=[...new Set(n)].filter(d=>{const s=p(e.doc,d);return s!=null&&b(s.parent,s.index)!=null}),!e.docChanged&&!i&&n===o.folded?o:{folded:n,decos:D(e.doc,n)}}},appendTransaction:(e,o,t)=>{const n=u.getState(t);if(!n?.folded.length||!t.selection.empty)return null;const l=t.selection.from;for(const i of g(t.doc,n.folded)){if(l<=i.start||l>=i.after)continue;const d=l>=o.selection.from?1:-1;let s=S.near(t.doc.resolve(d===1?Math.min(i.after,t.doc.content.size):i.start),d);return s.from>i.start&&s.from<i.after&&(s=S.near(t.doc.resolve(i.start),-1)),t.tr.setSelection(s)}return null},props:{decorations(e){return u.getState(e)?.decos??null}}}))].flat();E({"listfold.expandChildren":{zh:"展开子项",en:"Expand children"}});const f=new M("AMX_LIST_FOLD");function m(e,o){if(o<0||o>=e.content.size)return null;const t=e.nodeAt(o);if(!t||t.type.name!=="list_item"||t.childCount<2)return null;const n=t.child(1);if(!/_list$/.test(n.type.name))return null;const l=o+1+t.child(0).nodeSize;return{item:t,from:l,to:l+n.nodeSize}}function k(e,o){const t=[];for(const n of o){const l=m(e,n);l&&(t.push(h.node(n,n+l.item.nodeSize,{class:"amx-listitem-folded"})),t.push(h.node(l.from,l.to,{class:"amx-fold-hidden"})),t.push(h.widget(n+2,(i,d)=>{const s=document.createElement("button");s.type="button",s.className="amx-fold-caret",s.textContent="▸",s.contentEditable="false";const c=()=>{s.title=F("listfold.expandChildren"),s.setAttribute("aria-label",s.title)};return c(),s.setAttribute("aria-expanded","false"),s.__off=C(c),s.addEventListener("mousedown",r=>{r.preventDefault(),r.stopPropagation();const a=d();a!=null&&N(i,i.state.doc.resolve(a).before(i.state.doc.resolve(a).depth-1))}),s},{side:-1,ignoreSelection:!0,key:`amxlfold:${n}`,destroy:i=>{i.__off?.()}})))}return x.create(e,t)}function G(e){const o=[];return e.descendants((t,n)=>(t.type.name==="list_item"&&m(e,n)&&o.push(n),!0)),o}function N(e,o){e.dispatch(e.state.tr.setMeta(f,{toggle:o}))}function q(e,o){return m(e.state.doc,o)?f.getState(e.state)?.folded.includes(o)?"folded":"foldable":null}function P(e){const o=f.getState(e);return o?.folded.length?R(e.doc,o.folded):[]}function R(e,o){const t=[];for(const n of o){const l=m(e,n);l&&t.push({start:l.from,after:l.to})}return t}function J(e,o){const t=f.getState(e);return t?.folded.length?t.folded.filter(n=>{const l=m(e.doc,n);return!!l&&o>l.from&&o<l.to}):[]}function Q(e,o){return!!f.getState(e)?.folded.includes(o)}const U=[L(()=>new $({key:f,state:{init:()=>({folded:[],decos:x.empty}),apply:(e,o)=>{let t=o.folded;e.docChanged&&(t=t.map(l=>e.mapping.mapResult(l)).filter(l=>!l.deleted||m(e.doc,l.pos)!=null).map(l=>l.pos));const n=e.getMeta(f);if(n?.set&&(t=n.set.slice()),n?.toggle!=null){const l=n.toggle;t=t.includes(l)?t.filter(i=>i!==l):[...t,l]}return t=[...new Set(t)].filter(l=>m(e.doc,l)!=null),!e.docChanged&&!n&&t===o.folded?o:{folded:t,decos:k(e.doc,t)}}},appendTransaction:(e,o,t)=>{if(!f.getState(t)?.folded.length||!t.selection.empty)return null;const l=t.selection.from;for(const i of P(t)){if(l<=i.start||l>=i.after)continue;const d=l>=o.selection.from?1:-1;let s=S.near(t.doc.resolve(d===1?Math.min(i.after,t.doc.content.size):i.start),d);return s.from>i.start&&s.from<i.after&&(s=S.near(t.doc.resolve(i.start),-1)),t.tr.setSelection(s)}return null},props:{decorations(e){return f.getState(e)?.decos??null}}}))].flat();export{g as a,j as b,P as c,O as d,q as e,X as f,N as g,u as h,Q as i,B as j,U as k,f as l,J as m,K as n,G as o,R as p,T as s,H as t};
@@ -1 +1 @@
1
- import{z as e}from"./appStore-Dg9WALEA.js";const o=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],t=e("lock",o);export{t as L};
1
+ import{F as e}from"./appStore-B1ynyt42.js";const o=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],t=e("lock",o);export{t as L};
@@ -1 +1 @@
1
- import{z as o}from"./appStore-Dg9WALEA.js";const t=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],e=o("log-out",t);export{e as L};
1
+ import{F as o}from"./appStore-B1ynyt42.js";const t=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],e=o("log-out",t);export{e as L};
@@ -0,0 +1,19 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./appStore-B1ynyt42.js","./index-Bh_nLVTc.js","./nativeDownload-CziEyW_p.js","./ipc-CPhL3bPp.js","./client-DxGbwZLy.js","./appStore-BC_CQv-L.css"])))=>i.map(i=>d[i]);
2
+ import{d as c,j as t,r as mt,u as Te,t as mn,_ as je,f as as,L as os}from"./index-Bh_nLVTc.js";import{c as is}from"./client-DxGbwZLy.js";import{f as rs,g as cs,L as fn,T as ls,C as qt,W as ds,h as us,u as ms,j as fs,s as ps,k as hs,a as gs,b as pn,D as bs,A as hn,F as Ce,S as gn,M as bn,c as vn,B as vs,P as wn,d as ws,N as ks,l as xs,m as ys,i as Ss,e as js}from"./viewportLock-BH26xHQO.js";import{F as oe,M as Cs,G as Es,I as Ns,J as Is,L as Ts,P as Ms,K as Ls,N as Rs,R as Ds,U as Os,T as As,V as Ps,W as Fs,X as zs,Y as _s,Z as lt,_ as Bs,$ as $s,a0 as Ws,a1 as Vs,a2 as kn,a3 as qs,a4 as Hs,m as G,a5 as ae,a6 as Ys,a7 as Ks,a8 as xn,a9 as Us,aa as qe,ab as Ht,ac as Gs,ad as Xs,ae as Fe,af as ot,ag as dt,ah as Yt,ai as Zs,aj as Kt,ak as be,al as ze,am as Ut,an as Js,ao as Qs,ap as ea,aq as ta,ar as yn,as as na,at as sa,au as aa,av as oa,aw as ia,ax as Sn,S as ra,ay as Me,az as He,aA as Ee,aB as Ie,aC as ca,aD as la,aE as jn,aF as Cn,aG as We,aH as ft,u as C,aI as Gt,aJ as da,aK as ua,aL as ma,aM as Xt,aN as fa,aO as pa,aP as ha,p as $,aQ as ga,aR as pt,s as ht,i as Ye,j as ba,aS as En,aT as va,aU as Zt,aV as Nn,g as wa,aW as ka,Q as xa,aX as In,O as ya,aY as Jt,aZ as Sa,a_ as Qt,a$ as ja,b0 as Ve,h as Tn,b1 as Ca,b2 as Ea,b3 as Na,b4 as Ia,b5 as Ta,b6 as Ma,b7 as La,w as Ra,x as Da,y as Oa,z as Aa,b8 as Pa,B as Fa,C as za,D as _a,E as Ba}from"./appStore-B1ynyt42.js";import{P as $a}from"./pen-tool-uxsFELYC.js";import{T as Wa,R as Va,M as qa,V as Ha,a as Ya,C as Ka,H as Ua,f as Ga}from"./userSpaces-CI4eqEgh.js";import{C as Xa,P as Za,H as Ja,A as ge,m as Qa}from"./SidebarRow-D77yrSLf.js";import{M as eo}from"./Chrome-B77-lQyh.js";import{T as to}from"./terminal-krsPf1mc.js";import{B as no}from"./AutomationBuilder-BuiHtVB-.js";import{S as so}from"./star-CgYon3z4.js";import{F as Mn}from"./folder-CvZyHIgb.js";import{F as Ln}from"./UnifiedPage-C75y-MKT.js";import{i as ao,q as oo,o as en,a as io,c as ro,A as co,p as lo,d as uo,E as mo}from"./codingNavigation-CjeWG4xm.js";import"./i18n.generated-BZRHO2Nc.js";import{S as fo,C as po}from"./RunLocationPicker-CyVa0RJa.js";import{R as ho}from"./RightPanel-BVZeVO3c.js";import{n as go}from"./codeStudioStore-C7rGKlOC.js";import"./ModelPill-DrW2cG0l.js";import"./rotate-ccw-HedfU4na.js";import"./upload-MVVRQtkj.js";import"./hard-drive-BQsHSala.js";import"./CapabilityMenu-kx1TIJYN.js";import"./book-open-DBJ3dDpw.js";import"./folder-plus-BRScGQ9m.js";import"./circle-x-BZfe7d6S.js";import"./layout-grid-DfUfnvDS.js";import"./nativeDownload-CziEyW_p.js";import"./DashboardGridView-MlO1dpuo.js";import"./FloatingToc-tART_jC4.js";import"./MarkdownBlock-D8LgHFYY.js";import"./index-BaRySZ-M.js";import"./linkFollow-C6PHGUxk.js";import"./mdMarks-cmL6vzR-.js";import"./emoji-Cjm3bKiF.js";import"./listFold-Q_8mh5ZG.js";import"./pageChrome-DFz_AAzZ.js";import"./pageTree-yVO1_fSy.js";import"./pluginExt-Byb64tQO.js";import"./list-tree-DaGpnIYu.js";import"./pencil-BSbra1Ra.js";import"./type-GJYLEhY-.js";import"./undo-2-DCTs4Ro4.js";import"./redo-2-BK5LMNa5.js";import"./code-xml-joKQ-qGS.js";import"./lock-DQ_yL4nF.js";import"./ipc-CPhL3bPp.js";import"./InlineFiles-BHwivGbQ.js";import"./workflow-DzeW9OXR.js";import"./canvasPrefs-DwL_OAAo.js";import"./circle-question-mark-HPZpZQxd.js";import"./gestures-CZQVefU0.js";import"./MuseView-Cb6R_l4i.js";import"./automationListSource-B8EIRmDW.js";import"./messages-CBtmbpur.js";import"./approvalText-Cy2UAUAQ.js";import"./message-square-plus-CEHkduIL.js";import"./log-out-DFwTeh2X.js";import"./index-Dj-PygjB.js";/* empty css */import"./StudioGuestSurface-DthpuVGg.js";import"./minus-BUT48dAC.js";import"./SketchCard-CAAr_cqF.js";import"./arrow-up-right-R10mR2I6.js";import"./hand-D3QspKYq.js";import"./foldActions-Dm-uAt3L.js";import"./create-BjBRKATq.js";import"./pdf.worker.min-CGb3BKV9.js";import"./zoom-in-CovPsw4g.js";import"./mdMarkStore-DjN4bf1T.js";const bo=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],vo=oe("box",bo);const wo=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ko=oe("calendar",wo);const xo=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yo=oe("chevron-up",xo);const So=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],jo=oe("chevrons-left",So);const Co=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Eo=oe("chevrons-right",Co);const No=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],Io=oe("flag",No);const To=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Mo=oe("tag",To);const Lo=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ro=oe("user",Lo),Rn={folder:Mn,"folder-open":Hs,star:so,heart:Ua,home:qs,zap:kn,bookmark:Vs,bell:no,tag:Mo,flag:Io,pin:Za,box:vo,package:Ws,settings:$s,wrench:Bs,terminal:to,code:Ka,"file-text":lt,image:_s,music:Ya,video:Ha,camera:zs,globe:Fs,compass:Ps,map:eo,calendar:ko,clock:Xa,mail:qa,"message-circle":As,users:Os,user:Ro,search:Ds,filter:Rs,sparkles:Ls,rocket:Va,target:Wa,trophy:ls,lightbulb:fn,coffee:cs,palette:Ms,layers:Ts,database:Is,"pen-tool":$a,inbox:Ns,bot:Es,command:rs,moon:Cs},Do=Object.keys(Rn),it=n=>n?Rn[n]:void 0,rt=4,tn=5,nn=5,Oo=1e3,Ao=100;function sn(n){if(n>=9)return"";const s=sa({id:`space-slot-${n+1}`,hotkey:`mod+${n+1}`});return s?aa(s,oa()):""}function Ne({item:n,expanded:s}){if(n.component){const r=n.component;return t.jsx(r,{expanded:s})}const o=n.icon,m=n.tooltip?be(n.tooltip):"";return t.jsxs("button",{className:"rb-btn","aria-label":m||void 0,"data-rb-tip":s?void 0:m||void 0,onClick:n.onClick,children:[o&&t.jsx(o,{size:18}),s&&t.jsx("span",{className:"rb-label",children:m})]})}function Po({cmd:n,expanded:s,overrideIcon:o}){const[,m]=c.useReducer(v=>v+1,0),r=o??n.icon??kn,b=be(n.title);let f;if(n.checked)try{f=!!n.checked()}catch{f=void 0}return t.jsxs("button",{className:`rb-btn${f?" is-on":""}`,"aria-pressed":f,"aria-label":b,"data-rb-tip":s?void 0:b,onMouseEnter:n.checked?m:void 0,onMouseLeave:n.checked?m:void 0,onClick:()=>{const v=n.run();n.checked&&(m(),v&&typeof v.then=="function"&&v.then(m,m))},children:[t.jsx(r,{size:18}),s&&t.jsx("span",{className:"rb-label",children:b})]})}const _e=24,an=n=>n.startsWith("space:")?n.slice(6):null,Fo=600;function zo(){const n=G(e=>e.items),s=G(e=>e.expanded),o=G(e=>e.order),m=G(e=>e.bottomOrder),r=G(e=>e.folders),b=G(e=>e.commandItems),f=G(e=>e.commandIcons),v=G(e=>e.recentCount),w=ae(e=>e.recent),d=Ys(e=>e.commands);Ks(e=>e.overrides);const{t:p}=xn(),g=()=>G.getState(),[h,x]=c.useState(null),[N,S]=c.useState(null),[E,z]=c.useState(null),[j,L]=c.useState(null),[F,R]=c.useState(null),[Z,A]=c.useState(null),[Y,W]=c.useState(null),[P,J]=c.useState(99),O=c.useRef(null),ue=c.useRef(null),V=c.useRef(null),K=c.useRef(null),Q=c.useRef(null),ee=c.useRef(null),I=c.useRef(void 0),me=c.useRef(null),[H,ve]=c.useState({top:0,bottom:0}),[M,Le]=c.useState(null),[we,ie]=c.useState({}),q=c.useRef({}),k=c.useRef({});c.useEffect(()=>()=>{for(const e of Object.values(q.current))window.clearTimeout(e?.timer)},[]);const[_,ke]=c.useState(!1),B=c.useRef(void 0);c.useEffect(()=>()=>window.clearTimeout(B.current),[]);const fe=e=>{for(const i of["top","bottom"]){const u=q.current[i];if(!u)continue;window.clearTimeout(u.timer);const l=k.current[i];l&&(l.style.transform=u.from?`translateY(${-u.from*D}px)`:""),delete q.current[i]}ie({}),window.clearTimeout(B.current);const a=!window.matchMedia("(prefers-reduced-motion: reduce)").matches;ke(a),a&&(B.current=window.setTimeout(()=>ke(!1),240)),Le(e)},[re,xe]=c.useState(null),ce=c.useRef(null),Ue=c.useRef(void 0),Re=c.useRef(!1),gt=c.useRef(0),De=()=>{window.clearTimeout(Ue.current),ce.current=null,Re.current&&(Re.current=!1,gt.current=Date.now()),xe(null)},Ge=!!h||!!Z||!!Y||!!F;c.useEffect(()=>{(Ge||s)&&De()},[Ge,s]),c.useEffect(()=>()=>window.clearTimeout(Ue.current),[]);const $n=e=>{const a=e.target.closest("[data-rb-tip]");if(a===ce.current)return;const i=Re.current||Date.now()-gt.current<=Ao;if(De(),!a||Ge||s)return;ce.current=a;const u=()=>{if(ce.current!==a||!a.isConnected||!a.dataset.rbTip)return;const l=a.getBoundingClientRect();Re.current=!0,xe({text:a.dataset.rbTip,mid:l.top+l.height/2})};i?u():Ue.current=window.setTimeout(u,Oo)},Wn=new Set(r.flatMap(e=>e.items)),Oe=new Map,bt=e=>{const a=[];for(const u of n)(u.side??"top")===e&&!u.pinned&&a.push({kind:"item",id:u.id,item:u});if(e==="bottom")for(const u of b){const l=d.find(y=>y.id===u);l&&a.push({kind:"cmd",id:`cmd:${u}`,cmd:l})}for(const u of r)u.zone===e&&a.push({kind:"folder",id:u.id,folder:u});for(const u of a)Oe.set(u.id,u);return Zs(a.map(u=>u.id),e==="top"?o:m).map(u=>Oe.get(u)).filter(u=>!Wn.has(u.id))},U=bt("top"),te=bt("bottom"),vt=e=>e.items.reduce((a,i)=>a+(Oe.has(i)?1:0),0),Vn=n.filter(e=>e.side==="bottom"&&e.pinned),qn=n.filter(e=>e.side==="head"),Hn=n.filter(e=>e.side==="home"),D=(s?34:32)+rt;c.useLayoutEffect(()=>{const e=O.current;if(!e)return;const a=()=>{const u=getComputedStyle(e),l=(ue.current?.offsetHeight??0)+(K.current?.offsetHeight??0),y=e.clientHeight-parseFloat(u.paddingTop)-parseFloat(u.paddingBottom)-l-(V.current?.offsetHeight??0)-2*D-48;J(Math.max(2,Math.floor(y/D)))};a();const i=new ResizeObserver(a);return i.observe(e),K.current&&i.observe(K.current),()=>i.disconnect()},[s,D,n.length,r.length,b.length,M]);const wt=(e,a)=>e<=a?e:a+1,kt=wt(U.length,tn),Xe=wt(te.length,nn);let ne=kt,le=Xe;if(M)M==="top"?ne=P:le=P;else if(ne+le>P)if(U.length===0)ne=0,le=P;else if(te.length===0)ne=P,le=0;else{const e=Math.floor(P/2);ne=Math.max(1,Math.min(kt,Math.max(e,P-Xe))),le=Math.max(1,Math.min(Xe,P-ne))}const xt=(e,a,i,u,l)=>{if(e.length<=a&&e.length<=l)return{shown:e,tail:[],start:0,max:0};const y=Math.max(0,a-1),T=e.length-y,he=Math.min(Math.max(0,u),T),Se=i?e.length-y-he:he;return{shown:e.slice(Se,Se+y),tail:[...e.slice(0,Se),...e.slice(Se+y)],start:Se,max:T}},Ze=xt(U,ne,!1,H.top,M==="top"?1/0:tn),Je=xt(te,le,!0,H.bottom,M==="bottom"?1/0:nn),yt=w.map(e=>n.find(a=>a.id===`space:${e}`)).filter(e=>!!e).slice(0,Us(v,P,ne,le,!!M)),Yn=(e,a)=>i=>{const u=k.current[e];if(!a.max||h||!i.deltaY||!u)return;window.clearTimeout(I.current);let l=q.current[e];l||(l=q.current[e]={px:a.start*D,from:a.start,timer:0},ie(T=>({...T,[e]:!0}))),window.clearTimeout(l.timer);const y=i.deltaMode?Math.sign(i.deltaY)*D:Math.max(-D,Math.min(D,i.deltaY));l.px=Math.max(0,Math.min(a.max*D,l.px+y)),u.style.transform=`translateY(${-l.px}px)`,l.timer=window.setTimeout(()=>Kn(e,a),120)},Kn=(e,a)=>{const i=q.current[e],u=k.current[e];if(!i||!u)return;const l=i.at??i.from,y=i.px-l*D;let T=Math.round(i.px/D);T===l&&y&&(T+=Math.sign(y)),St(e,a,Math.max(0,Math.min(a.max,T)))},St=(e,a,i)=>{const u=k.current[e];if(!u)return;let l=q.current[e];l||(l=q.current[e]={px:a.start*D,from:a.start,timer:0},ie(y=>({...y,[e]:!0}))),window.clearTimeout(l.timer),l.px=i*D,l.at=i,u.style.transform=i?`translateY(${-i*D}px)`:"",l.timer=window.setTimeout(()=>{delete q.current[e],ie(y=>({...y,[e]:!1})),ve(y=>({...y,[e]:e==="top"?i:a.max-i}))},240)};c.useEffect(()=>()=>window.clearTimeout(I.current),[]);const jt=c.useRef(()=>{});jt.current=()=>{if(!h)for(const[e,a]of[["top",Ze],["bottom",Je]])H[e]&&(a.max&&k.current[e]?St(e,a,e==="top"?0:a.max):ve(i=>({...i,[e]:0})))};const Ct=!!(H.top||H.bottom||we.top||we.bottom);c.useEffect(()=>{if(!Ct)return;const e=()=>{Kt()&&(window.clearTimeout(I.current),I.current=window.setTimeout(()=>{Kt()&&jt.current()},Fo))},a=i=>{const u=i.target;i.button!==0||u?.closest?.(".rb-menu, .rb-iconpick, [data-rb-overlay]")||u&&(O.current?.contains(u)||u.closest(".rb-fly"))&&!u.closest(".rb-btn:not(.rb-more, .rb-plus, .rb-toggle, .rb-folder)")||e()};return window.addEventListener("click",a,!0),window.addEventListener("blur",e),()=>{window.removeEventListener("click",a,!0),window.removeEventListener("blur",e)}},[Ct]);const se=F?.folderId?r.find(e=>e.id===F.folderId):void 0,Qe=()=>{ee.current&&(window.clearTimeout(ee.current),ee.current=null)},Et=()=>{Qe(),ee.current=window.setTimeout(()=>{h||R(null)},150)},Nt=(e,a,i,u)=>{Qe(),R({key:e,zone:a,folderId:u,top:i.getBoundingClientRect().top})};c.useLayoutEffect(()=>{const e=Q.current;if(!e||!F)return;const a=e.getBoundingClientRect().bottom-(window.innerHeight-8);a>0&&R({...F,top:Math.max(8,F.top-a)})},[F?.key,se?.items.length]);const It=!!F;c.useEffect(()=>{if(!It)return;const e=i=>{i.key==="Escape"&&R(null)},a=i=>{const u=i.target;!Q.current?.contains(u)&&!O.current?.contains(u)&&R(null)};return window.addEventListener("keydown",e),window.addEventListener("mousedown",a),()=>{window.removeEventListener("keydown",e),window.removeEventListener("mousedown",a)}},[It]),c.useEffect(()=>{if(!M)return;const e=()=>fe(null),a=u=>{if(u.button!==0)return;const l=u.target;l?.closest?.(".rb-menu, .rb-iconpick, .rb-fly, [data-rb-overlay]")||l&&O.current?.contains(l)&&l.closest("button")||e()},i=u=>{u.key==="Escape"&&e()};return window.addEventListener("pointerdown",a,!0),window.addEventListener("keydown",i),window.addEventListener("blur",e),()=>{window.removeEventListener("pointerdown",a,!0),window.removeEventListener("keydown",i),window.removeEventListener("blur",e)}},[M,D]);const et=c.useRef(new Map),Tt=c.useRef(()=>{});c.useEffect(()=>{Tt.current=e=>{const a=U[e];if(a){if(a.kind==="folder"){const i=et.current.get(a.id)??O.current;i&&Nt(a.id,"top",i,a.id);return}R(null),a.kind==="cmd"?a.cmd.run():a.id.startsWith("space:")?qe(a.id.slice(6)):a.item.onClick?.()}}});const Mt=Math.min(9,U.length);c.useEffect(()=>{for(let e=1;e<=9;e++){if(e>Mt){Ht(`space-slot-${e}`);continue}Gs({id:`space-slot-${e}`,title:()=>Xs("lcl.ribbon.switchSpace",{n:e}),keywords:`space switch ${e} 切换 空间`,hotkey:`mod+${e}`,run:()=>Tt.current(e-1)})}return()=>{for(let e=1;e<=9;e++)Ht(`space-slot-${e}`)}},[Mt]);const Lt=(e,a,i,u)=>{e.dataTransfer.effectAllowed="move";const l=e.currentTarget.getBoundingClientRect();e.dataTransfer.setDragImage(e.currentTarget,e.clientX-l.left,e.clientY-l.top),x({id:a,zone:i,from:u})},Ae=()=>{me.current=null,x(null),S(null),z(null),L(null)},ye=h&&Fe()?.openSpace?an(h.id):null,Rt=c.useRef({dropped:!1,gone:!1}),Un=(e,a)=>{const i=O.current?.getBoundingClientRect();if(!i)return!0;const u=y=>e>=y.left-_e&&e<=y.right+_e&&a>=y.top-_e&&a<=y.bottom+_e,l=Q.current?.getBoundingClientRect();return u(i)||!!l&&u(l)},Dt=e=>{const a=e.target;return!!a&&(!!O.current?.contains(a)||!!Q.current?.contains(a))};c.useLayoutEffect(()=>{if(!ye)return;const e={dropped:!1,gone:!1};Rt.current=e;const a=l=>{e.gone=!1,!Dt(l)&&(l.preventDefault(),l.stopPropagation(),l.dataTransfer&&(l.dataTransfer.dropEffect="move"),z(y=>y&&null),L(y=>y&&null))},i=l=>{e.dropped=!0,!Dt(l)&&(l.preventDefault(),l.stopPropagation(),Un(l.clientX,l.clientY)||Fe()?.openSpace?.(ye,{screenX:l.screenX,screenY:l.screenY}))},u=l=>{(l.clientX<=0||l.clientY<=0||l.clientX>=window.innerWidth||l.clientY>=window.innerHeight)&&(e.gone=!0)};return window.addEventListener("dragover",a,!0),window.addEventListener("drop",i,!0),window.addEventListener("dragleave",u,!0),()=>{window.removeEventListener("dragover",a,!0),window.removeEventListener("drop",i,!0),window.removeEventListener("dragleave",u,!0)}},[ye]);const Ot=e=>{const a=Rt.current;if(ye&&!a.dropped){const{clientX:i,clientY:u}=e,l=i<0||u<0||i>window.innerWidth||u>window.innerHeight,y=!l&&/^(IFRAME|WEBVIEW)$/.test(document.elementFromPoint(i,u)?.tagName??"");(a.gone||l||y)&&Fe()?.openSpace?.(ye,e.screenX||e.screenY?{screenX:e.screenX,screenY:e.screenY}:void 0)}Ae()},pe=(e,a,i)=>{a&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="move",i?.())},At=(e,a)=>{const i=e.querySelectorAll(".rb-slot"),u=i[0]?.getBoundingClientRect().top??0,l=i.length>1?i[1].getBoundingClientRect().top-u:0;return{top:u,pitch:l,grabDy:a??l/2}},Gn=(e,a,i)=>na(a,i,me.current??At(e)),Xn=(e,a)=>{const i=e.parentElement;i&&(me.current=At(i,a-e.getBoundingClientRect().top))},tt=(e,a)=>{const i=h;if(Ae(),!i||i.zone!==e||i.id===a)return;i.from&&g().moveOutOfFolder(i.id);const u=e==="top"?g().order:g().bottomOrder,l=Js(u,(e==="top"?U:te).map(T=>T.id)),y=a?l.indexOf(a):-1;g().setZoneOrder(e,ze(l,i.id,y>=0?y:l.length))},nt=(e,a)=>{const i=h;if(Ae(),!(!i||i.zone!==e.zone||i.id.startsWith("folder:"))){if(i.from===e.id)g().setFolderItems(e.id,ze(e.items,i.id,a??e.items.length));else if(g().moveIntoFolder(e.id,i.id),i.from||g().setZoneOrder(e.zone,Ut(e.zone==="top"?g().order:g().bottomOrder,(e.zone==="top"?U:te).map(u=>u.id),i.id)),a!==void 0){const u=g().folders.find(l=>l.id===e.id);u&&g().setFolderItems(e.id,ze(u.items,i.id,a))}}},Pt=ot.prompt??((e,a)=>Promise.resolve(window.prompt(e,a))),Zn=e=>{Pt(p("lcl.ribbon.newFolder"),p("lcl.ribbon.folderDefaultName")).then(a=>{const i=a?.trim();i&&g().addFolder(e,i)})},Pe=e=>[...e==="top"&&ot.newSpace?[{label:p("lcl.ribbon.newSpace"),onClick:ot.newSpace}]:[],...e==="bottom"?[{label:p("lcl.ribbon.addCommand"),onClick:()=>Qs(a=>g().addCommandItem(a))}]:[],{label:p(e==="top"?"lcl.ribbon.newFolderSpaces":"lcl.ribbon.newFolderCommands"),onClick:()=>Zn(e)}],Jn=e=>a=>{a.defaultPrevented||(a.preventDefault(),A({x:a.clientX,y:a.clientY,entries:Pe(e)}))},Qn=e=>{e.defaultPrevented||(e.preventDefault(),A({x:e.clientX,y:e.clientY,entries:[...Pe("top"),...Pe("bottom")]}))},Ft=(e,a,i,u)=>{A(null),W({x:e,y:a,current:i,apply:u})},es=e=>a=>{a.preventDefault(),a.stopPropagation();const i=a.clientX,u=a.clientY;A({x:i,y:u,entries:[{label:p("lcl.ribbon.changeIcon"),onClick:()=>Ft(i,u,e.icon,l=>g().setFolderIcon(e.id,l))},{label:p("lcl.ribbon.rename"),onClick:()=>{Pt(p("lcl.ribbon.renameFolder"),e.name).then(l=>{const y=l?.trim();y&&g().renameFolder(e.id,y)})}},{label:p("lcl.ribbon.dissolveFolder"),onClick:()=>g().removeFolder(e.id)}]})},zt=e=>{const a=an(e.id),i=Fe()?.openSpace;return[...a&&i?[{label:p("lcl.ribbon.openInNewWindow"),onClick:()=>i(a)}]:[],...e.menu?.()??[]]},_t=e=>a=>{if(a.defaultPrevented)return;const i=zt(e);i.length&&(a.preventDefault(),a.stopPropagation(),A({x:a.clientX,y:a.clientY,entries:i}))},Bt=e=>a=>{a.preventDefault(),a.stopPropagation();const i=a.clientX,u=a.clientY;A({x:i,y:u,entries:[{label:p("lcl.ribbon.setIcon"),onClick:()=>Ft(i,u,g().commandIcons[e],l=>g().setCommandIcon(e,l))},{label:p("lcl.ribbon.removeCommand"),onClick:()=>g().removeCommandItem(e)}]})},ts=e=>{const a=it(e.icon)??Mn;return t.jsxs("button",{ref:i=>{i?et.current.set(e.id,i):et.current.delete(e.id)},className:`rb-btn rb-folder${j===e.id?" drag-into":""}`,"aria-label":`${e.name} (${vt(e)})`,onMouseEnter:i=>Nt(e.id,e.zone,i.currentTarget,e.id),onMouseLeave:Et,onContextMenu:es(e),onDragOver:i=>pe(i,!!h&&h.zone===e.zone&&!h.id.startsWith("folder:"),()=>{z(null),L(e.id)}),onDragLeave:()=>{j===e.id&&L(null)},onDrop:i=>{!h||h.id.startsWith("folder:")||(i.preventDefault(),i.stopPropagation(),nt(e))},children:[t.jsx(a,{size:18}),s&&t.jsx("span",{className:"rb-label",children:e.name})]})},$t=e=>{const a=M===e,i=p(a?"lcl.ribbon.less":"lcl.ribbon.more"),u=a?e==="top"?yo:yn:ta;return t.jsxs("button",{className:`rb-btn rb-more${a?" is-open":""}${j===`more:${e}`?" drag-into":""}`,"aria-label":i,"aria-expanded":a,"data-rb-tip":s?void 0:i,onClick:()=>fe(a?null:e),onDragOver:l=>pe(l,!!h&&h.zone===e,()=>{z(null),L(`more:${e}`)}),onDragLeave:()=>{j===`more:${e}`&&L(null)},onDrop:l=>{l.preventDefault(),l.stopPropagation(),tt(e,e==="bottom"?te[0]?.id??null:null)},children:[t.jsx(u,{size:18}),s&&t.jsx("span",{className:"rb-label",children:i})]})},st=(e,a)=>{const i=a??s;return e.kind==="item"?t.jsx(Ne,{item:e.item,expanded:i}):e.kind==="cmd"?t.jsx(Po,{cmd:e.cmd,expanded:i,overrideIcon:it(f[e.cmd.id])}):ts(e.folder)},ns=(e,a,i,u,l,y)=>{const T=u?u.indexOf(e.id):i;return t.jsxs("div",{"data-id":e.id,className:`rb-slot${h?.id===e.id?" dragging":""}${l?" drag-over":""}`,style:T!==i?{transform:`translateY(${(T-i)*D}px)`}:void 0,draggable:!0,onDragStart:he=>{Xn(he.currentTarget,he.clientY),Lt(he,e.id,a,null)},onDragEnd:Ot,onContextMenu:e.kind==="cmd"?Bt(e.cmd.id):e.kind==="item"?_t(e.item):void 0,children:[st(e),a==="top"&&s&&sn(y)&&t.jsx("span",{className:"rb-key",children:sn(y)})]},e.id)},at=e=>p(e==="top"?"lcl.ribbon.addSpaceOrFolder":"lcl.ribbon.addCommand"),Wt=e=>t.jsxs("button",{className:"rb-btn rb-plus","aria-label":at(e),"data-rb-tip":s?void 0:at(e),onClick:a=>{const i=a.currentTarget.getBoundingClientRect();A({x:i.right+6,y:i.top,entries:Pe(e)})},children:[t.jsx(ea,{size:16}),s&&t.jsx("span",{className:"rb-label",children:at(e)})]}),Vt=(e,a)=>{const i=a.shown.map(l=>l.id),u=h&&E?.zone===e&&i.includes(h.id)?ze(i,h.id,E.index):null;return t.jsxs("div",{className:`rb-group rb-${e}`,onContextMenu:Jn(e),onWheel:Yn(e,a),onDragOver:l=>{const y=Gn(l.currentTarget,l.clientY,i.length);pe(l,!!h&&h.zone===e,()=>{L(null),z(T=>T?.zone===e&&T.index===y?T:{zone:e,index:y})})},onDrop:l=>{l.preventDefault(),l.stopPropagation(),tt(e,(E?.zone===e?i[E.index]:null)??null)},children:[e==="bottom"&&t.jsxs(t.Fragment,{children:[Wt(e),(a.tail.length>0||M===e)&&$t(e)]}),t.jsx("div",{className:"rb-strip",style:{height:Math.max(0,a.shown.length*D-rt)},children:t.jsx("div",{ref:l=>{k.current[e]=l},className:"rb-strip-in",style:a.start?{transform:`translateY(${-a.start*D}px)`}:void 0,children:(e==="top"?U:te).map((l,y)=>{const T=y-a.start;return T>=0&&T<a.shown.length?ns(l,e,T,u,!u&&E?.zone===e&&E.index===T,y):t.jsx("div",{className:"rb-cell","aria-hidden":!0,inert:!0,style:{height:D-rt},children:(we[e]||_)&&st(l)},l.id)})})}),e==="top"&&t.jsxs(t.Fragment,{children:[(a.tail.length>0||M===e)&&$t(e),Wt(e)]})]})},ss=(e,a,i,u)=>t.jsx("div",{"data-id":e.id,className:`rb-fly-row${h?.id===e.id?" dragging":""}${N===e.id&&h?.id!==e.id?` drag-over${h&&u.indexOf(h.id)>=0&&u.indexOf(h.id)<i?" below":""}`:""}`,draggable:!0,onDragStart:l=>{l.stopPropagation(),Lt(l,e.id,a.zone,a.id)},onDragOver:l=>pe(l,!!h&&h.zone===a.zone&&h.id!==e.id&&!h.id.startsWith("folder:"),()=>S(e.id)),onDragLeave:()=>{N===e.id&&S(null)},onDrop:l=>{l.preventDefault(),l.stopPropagation(),nt(a,i)},onDragEnd:Ot,onContextMenu:e.kind==="cmd"?Bt(e.cmd.id):l=>{l.preventDefault(),l.stopPropagation(),A({x:l.clientX,y:l.clientY,entries:[...e.kind==="item"?zt(e.item):[],{label:p("lcl.ribbon.moveOut"),onClick:()=>{g().moveOutOfFolder(e.id);const y=a.zone==="top"?g().order:g().bottomOrder;g().setZoneOrder(a.zone,[...Ut(y,(a.zone==="top"?U:te).map(T=>T.id),e.id),e.id])}}]})},children:st(e,!0)},e.id);return t.jsxs("div",{ref:O,className:`rb${s?" rb-expanded":""}${h?" rb-dragging":""}${M?` rb-open-${M}`:""}`,onContextMenu:Qn,onMouseOver:$n,onMouseLeave:De,onMouseDownCapture:e=>{De(),ce.current=e.target.closest("[data-rb-tip]")},onDragOver:e=>pe(e,!!h),onDrop:e=>{if(!h)return;e.preventDefault();const a=h.zone,i=E?.zone===a?(a==="top"?Ze:Je).shown[E.index]?.id:void 0;if(i===void 0){Ae();return}tt(a,i)},children:[t.jsxs("div",{ref:ue,className:"rb-head",children:[t.jsxs("button",{className:"rb-btn rb-toggle","aria-label":p(s?"lcl.ribbon.iconsOnly":"lcl.ribbon.showLabels"),"aria-expanded":s,"data-rb-tip":s?void 0:p("lcl.ribbon.showLabels"),onClick:()=>g().toggleExpanded(),children:[s?t.jsx(jo,{size:18}):t.jsx(Eo,{size:18}),s&&t.jsx("span",{className:"rb-label",children:p("lcl.ribbon.iconsOnly")})]}),qn.map(e=>t.jsx(Ne,{item:e,expanded:s},e.id))]}),t.jsx("div",{ref:V,className:"rb-group rb-home",children:Hn.map(e=>t.jsx(Ne,{item:e,expanded:s},e.id))}),M!=="bottom"&&Vt("top",Ze),yt.length>0&&t.jsx("div",{className:"rb-group rb-recent",role:"group","aria-label":p("lcl.ribbon.recentSpaces"),children:yt.map(e=>t.jsx("div",{className:"rb-recent-slot","data-recent-id":e.id,onContextMenu:_t(e),children:t.jsx(Ne,{item:e,expanded:s})},e.id))}),M!=="top"&&Vt("bottom",Je),t.jsx("div",{ref:K,className:"rb-group rb-pinned",children:Vn.map(e=>t.jsx(Ne,{item:e,expanded:s},e.id))}),F&&se&&t.jsxs("div",{ref:Q,className:"rb-fly",style:(()=>{const e=dt(O.current);return{left:((O.current?.getBoundingClientRect().right??44)+4)/e,top:F.top/e}})(),onMouseEnter:Qe,onMouseLeave:Et,onDragOver:e=>pe(e,!!h&&h.zone===F.zone&&!h.id.startsWith("folder:")&&e.target===e.currentTarget),onDrop:e=>{e.target===e.currentTarget&&(e.preventDefault(),nt(se))},children:[t.jsx("div",{className:"rb-fly-head",children:se.name}),vt(se)===0&&t.jsx("div",{className:"rb-fly-empty",children:p("lcl.ribbon.folderEmpty")}),se.items.map((e,a)=>{const i=Oe.get(e);return i?ss(i,se,a,se.items):null})]}),re&&!s&&t.jsx("div",{className:"rb-tip",role:"tooltip",style:(()=>{const e=dt(O.current);return{left:((O.current?.getBoundingClientRect().right??44)+6)/e,top:re.mid/e}})(),children:re.text}),Z&&t.jsx("div",{className:"rb-menu-backdrop",onMouseDown:()=>A(null),onContextMenu:e=>{e.preventDefault(),A(null)},children:t.jsx(Yt,{className:"rb-menu",x:Z.x,y:Z.y,onMouseDown:e=>e.stopPropagation(),children:Z.entries.map((e,a)=>t.jsx("button",{onClick:()=>{A(null),e.onClick()},children:e.label},a))})}),Y&&t.jsx("div",{className:"rb-menu-backdrop",onMouseDown:()=>W(null),onContextMenu:e=>{e.preventDefault(),W(null)},children:t.jsxs(Yt,{className:"rb-iconpick",x:Y.x,y:Y.y,onMouseDown:e=>e.stopPropagation(),children:[t.jsx("button",{className:"rb-iconpick-reset",onClick:()=>{const e=Y.apply;W(null),e("")},children:p("lcl.ribbon.defaultIcon")}),t.jsx("div",{className:"rb-iconpick-grid",children:Do.map(e=>{const a=it(e);return t.jsx("button",{className:`rb-iconpick-btn${Y.current===e?" on":""}`,title:e,onClick:()=>{const i=Y.apply;W(null),i(e)},children:t.jsx(a,{size:17})},e)})})]})})]})}const on=8,_o=n=>n.dataset.lclShift==="end"?on:n.dataset.lclShift==="start"?-on:0;function Bo(){const n=Array.from(document.querySelectorAll(".dv-groupview")).map(o=>({r:o.getBoundingClientRect(),papery:!o.querySelector(".wb-tab--icon")})).filter(o=>o.r.width>0&&o.r.height>0),s=3;for(const o of document.querySelectorAll(".dv-sash")){const m=!!o.closest(".dv-split-view-container.dv-horizontal"),r=o.getBoundingClientRect();if(!r.width&&!r.height)continue;const b=m?r.left+r.width/2:r.top+r.height/2,[f,v]=m?[r.top,r.bottom]:[r.left,r.right];let w=null,d=null;for(const g of n){const[h,x,N,S]=m?[g.r.left,g.r.right,g.r.top,g.r.bottom]:[g.r.top,g.r.bottom,g.r.left,g.r.right];S<=f||N>=v||(w===null&&Math.abs(x-b)<=s&&(w=g.papery),d===null&&Math.abs(h-b)<=s&&(d=g.papery))}const p=w===!1&&d===!0?"end":w===!0&&d===!1?"start":"";p?o.dataset.lclShift=p:delete o.dataset.lclShift}}function $o(){const n=document.createElement("div");n.className="lcl-sash-tick",document.body.appendChild(n);let s=null,o=0;const m=(h,x)=>{const N=!!h.closest(".dv-split-view-container.dv-horizontal"),S=h.getBoundingClientRect(),E=_o(h);cancelAnimationFrame(o),o=requestAnimationFrame(()=>{n.classList.add("show"),n.classList.toggle("h",!N);const z=dt(n);N?(n.style.left=`${(S.left+S.width/2+E)/z}px`,n.style.top=`${Math.min(Math.max(x.clientY,S.top),S.bottom)/z}px`):(n.style.left=`${Math.min(Math.max(x.clientX,S.left),S.right)/z}px`,n.style.top=`${(S.top+S.height/2+E)/z}px`)})},r=h=>h instanceof Element?h.closest(".dv-sash"):null,b=h=>{const x=s instanceof HTMLElement?s:r(h.target);x?m(x,h):n.classList.contains("show")&&(cancelAnimationFrame(o),n.classList.remove("show"))},f=h=>{s=r(h.target)},v=h=>{s&&(s=null,r(h.target)||(cancelAnimationFrame(o),n.classList.remove("show")))};let w=0;const d=()=>{window.clearTimeout(w),w=window.setTimeout(Bo,120)},p=h=>h instanceof Element&&(h.matches(".dv-sash, .dv-view, .dv-groupview")||!!h.querySelector(".dv-sash, .dv-groupview")),g=new MutationObserver(h=>{for(const x of h)for(const N of[...x.addedNodes,...x.removedNodes])if(p(N)){d();return}});return g.observe(document.body,{childList:!0,subtree:!0}),d(),document.addEventListener("pointermove",b,{passive:!0}),document.addEventListener("pointerdown",f,{passive:!0}),document.addEventListener("pointerup",v,{passive:!0}),()=>{g.disconnect(),window.clearTimeout(w),cancelAnimationFrame(o),document.removeEventListener("pointermove",b),document.removeEventListener("pointerdown",f),document.removeEventListener("pointerup",v),n.remove()}}const Dn=({dark:n,soft:s,buildDefault:o,header:m,noRibbon:r,footer:b})=>(c.useEffect(()=>ia(),[]),c.useEffect(()=>$o(),[]),Sn==="mobile"?t.jsxs(t.Fragment,{children:[t.jsx(ra,{dark:n,soft:s,buildDefault:o}),t.jsx(qt,{})]}):t.jsxs("div",{className:"shell",children:[m,t.jsxs("div",{className:"shell-top",children:[!r&&t.jsx(zo,{}),t.jsxs("div",{className:"shell-work",children:[t.jsx(ds,{dark:n,soft:s,buildDefault:o}),b]})]}),t.jsx(qt,{})]})),Wo=({buildDefault:n,direct:s})=>{const o=ae(j=>j.spaces),m=ae(j=>j.activeSpaceId),[,r]=c.useReducer(j=>j+1,0);c.useEffect(()=>Me(r),[]);const b=o.filter(He),f=b.find(j=>j.id===m),v=Ee(j=>j.mainLeaves.find(L=>L.id===j.activeMainId)),[w,d]=c.useState(!1),{t:p}=xn(),g=f?.icon,h=s?Ie(s.view.type):void 0,x=c.useRef(!1);h&&(x.current=!0),c.useEffect(()=>{s&&x.current&&!h&&window.tangu?.closeSelf?.()},[s,h]);const N=s?.title||(h?be(h.displayName):f?be(f.mini?.name??f.name):"Mini Panel");c.useEffect(()=>{const j=Ee.getState();if(j.setDefaultBuilder(n),!s)if(f)j.getActiveLeaf()?.type!==f.mini.view.type&&j.resetLayout();else{const L=b.find(F=>F.id==="tangu")??b[0];L&&ca(L.id),j.resetLayout()}},[o,m,f,n,s]),c.useEffect(()=>{const j=L=>{L.key==="Escape"&&d(!1)};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[]);const S=v&&(s?v.type===s.view.type:f&&v.type===f.mini.view.type)?Ee.getState().getActiveLeaf():null,E=S?Ie(S.type):null,z=()=>{if(s){We({type:s.mainView.type,params:{...s.mainView.params,...Ee.getState().getActiveLeaf()?.params}});return}const j=ft();j?.mini&&We({spaceId:j.id,type:j.mini.mainView.type,params:{...j.mini.mainView.params,...Ee.getState().getActiveLeaf()?.params}})};return t.jsxs("div",{className:"mini-card-shell","data-space":s?"direct":f?.id,children:[t.jsxs("header",{className:"mini-card-chrome",children:[t.jsxs("button",{className:"mini-card-space","aria-label":p("lcl.mini.switchSpace"),"aria-expanded":w,disabled:!!s||b.length<2,onClick:()=>d(!w),children:[!s&&g&&t.jsx(g,{size:15}),t.jsx("span",{children:N}),!s&&b.length>1&&t.jsx(yn,{size:12})]}),t.jsx("div",{className:"mini-card-drag-title"}),t.jsx("button",{className:"mini-card-action","aria-label":p("lcl.mini.showMain"),title:p("lcl.mini.showMain"),disabled:!s&&!f,onClick:z,children:t.jsx(la,{size:15})}),t.jsx("button",{className:"mini-card-action mini-card-close","aria-label":p("lcl.mini.close"),onClick:()=>window.tangu?.closeSelf?.(),children:t.jsx(jn,{size:15})})]}),t.jsx("main",{className:"mini-card-main",children:S&&E?t.jsx("div",{className:"mini-panel-view","data-view":S.type,children:t.jsx(Cn,{children:t.jsx(c.Suspense,{fallback:null,children:E.factory({leaf:S,params:S.params})})})},`${S.id}:${S.type}`):t.jsx("div",{className:"mini-panel-empty",children:p("lcl.mini.empty")})}),w&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"mini-card-dismiss","aria-label":p("lcl.mini.closeMenu"),onClick:()=>d(!1)}),t.jsx("section",{className:"mini-card-popover","aria-label":p("lcl.mini.switchSpace"),children:t.jsx("div",{className:"mini-card-popover-list",children:b.map(j=>{const L=j.icon;return t.jsxs("button",{className:`mini-card-row${j.id===m?" active":""}`,onClick:()=>{qe(j.id),d(!1)},children:[L&&t.jsx(L,{size:15}),t.jsx("span",{className:"mini-card-row-label",children:be(j.mini.name??j.name)})]},j.id)})})})]})]})};function Vo(){return t.jsx("div",{className:"mac-titlebar"})}const ct=9e3,qo=5*1024*1024;function ut(n){return typeof n=="string"?n.replace(/\bBearer\s+[A-Za-z0-9._~+\/-]+=*/gi,"Bearer [redacted]").replace(/\b(sk-[a-zA-Z0-9_-]{12,})\b/g,"[redacted]").replace(/((?:["']?)(?:api[_-]?key|access[_-]?token|refresh[_-]?token|token|password|secret|authorization|cookie)(?:["']?)\s*[:=]\s*["']?)([^\s,"';&}]+)/gi,"$1[redacted]"):Array.isArray(n)?n.map(ut):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,o])=>[s,/^(?:token|.*api[_-]?key|access[_-]?token|refresh[_-]?token|password|secret|authorization|cookie|set-cookie)$/i.test(s)?"[redacted]":ut(o)])):n}async function Ho(n,s,o){const m=await us(n,s,o),r=JSON.stringify(ut({...m,feedbackSelection:o}),null,2);return{json:r,filename:`tangu-feedback-${s?.id.slice(0,8)||"app"}-${new Date().toISOString().slice(0,10)}.json`,bytes:new TextEncoder().encode(r).byteLength,missing:Object.entries(m.sources).filter(([,b])=>b!=="included").map(([b])=>b),truncated:!!m.messagesTruncated||!!m.activityLogTruncated}}mt({"feedback.subtitle":{zh:"告诉我们哪里可以做得更好。",en:"Tell us what could work better."},"feedback.kind":{zh:"反馈类型",en:"Feedback type"},"feedback.bug":{zh:"遇到问题",en:"Report a problem"},"feedback.idea":{zh:"功能建议",en:"Suggest a feature"},"feedback.other":{zh:"其他反馈",en:"Something else"},"feedback.description":{zh:"具体发生了什么?",en:"What happened?"},"feedback.bugPlaceholder":{zh:`你当时在做什么?预期的结果是什么,实际又发生了什么?
3
+ 如果可以,请写下重现步骤。`,en:`What were you doing? What did you expect, and what happened instead?
4
+ Include steps to reproduce it if you can.`},"feedback.ideaPlaceholder":{zh:"你想完成什么?哪项改进会对你有帮助?",en:"What are you trying to do? What change would help?"},"feedback.otherPlaceholder":{zh:"分享你的使用体验或想法……",en:"Share your experience or thoughts…"},"feedback.context":{zh:"附带诊断信息",en:"Include diagnostic information"},"feedback.diagnostics":{zh:"应用与运行日志",en:"App and runtime logs"},"feedback.diagnosticsHint":{zh:"版本、界面状态、错误、运行时间线与用量;进程日志可能涉及其他会话。",en:"Version, interface state, errors, run timeline and usage. Process logs may include other sessions."},"feedback.conversation":{zh:"当前会话内容",en:"Current conversation"},"feedback.conversationHint":{zh:"最多 500 条消息,包含工具输入与输出。",en:"Up to 500 messages, including tool inputs and outputs."},"feedback.activity":{zh:"近期活动记录",en:"Recent activity"},"feedback.activityHint":{zh:"近 2 天内最新 500 行,可能包含文件名与操作路径。",en:"The latest 500 lines from the last 2 days; may contain file names and paths."},"feedback.sessionContext":{zh:"关联会话:{name}",en:"Linked conversation: {name}"},"feedback.withoutSession":{zh:"未关联会话,仍可提交应用问题。",en:"No linked conversation. You can still report an app issue."},"feedback.privacy":{zh:"已过滤常见凭据字段。日志仍可能包含路径或内容片段,请按需选择并预览。",en:"Common credential fields are filtered. Logs may still contain paths or content excerpts; choose what to include and review the preview."},"feedback.preview":{zh:"预览附件",en:"Preview attachment"},"feedback.export":{zh:"导出日志文件",en:"Export log file"},"feedback.backToForm":{zh:"返回反馈",en:"Back to feedback"},"feedback.preparing":{zh:"正在准备诊断信息…",en:"Preparing diagnostics…"},"feedback.sending":{zh:"正在提交…",en:"Sending…"},"feedback.ready":{zh:"诊断附件已就绪 · {size}",en:"Diagnostics ready · {size}"},"feedback.textOnly":{zh:"仅提交反馈文字",en:"Only your feedback text will be sent"},"feedback.partial":{zh:"部分诊断来源不可用:{sources}。将提交已获取的内容。",en:"Some diagnostic sources are unavailable: {sources}. Available information will be sent."},"feedback.source.appVersion":{zh:"应用版本",en:"app version"},"feedback.source.messages":{zh:"会话内容",en:"conversation"},"feedback.source.agentConfig":{zh:"会话设置",en:"session settings"},"feedback.source.backendLogs":{zh:"运行输出",en:"runtime output"},"feedback.source.connection":{zh:"连接信息",en:"connection details"},"feedback.source.backendStatus":{zh:"引擎状态",en:"engine status"},"feedback.source.usage":{zh:"用量",en:"usage"},"feedback.source.timeline":{zh:"运行时间线",en:"run timeline"},"feedback.source.activityLog":{zh:"活动记录",en:"activity"},"feedback.truncated":{zh:"部分记录已达到数量上限,附件内已标记。",en:"Some records reached the collection limit; this is marked in the attachment."},"feedback.tooLarge":{zh:"附件超过 5 MB,请减少勾选的内容后再提交。",en:"The attachment exceeds 5 MB. Deselect some information before sending."},"feedback.prepareFailed":{zh:"诊断信息准备失败。请重试,或取消勾选后仅提交文字。",en:"Could not prepare diagnostics. Retry, or deselect the options to send text only."},"feedback.refresh":{zh:"重新收集",en:"Collect again"},"feedback.successTitle":{zh:"反馈已收到",en:"Feedback received"},"feedback.successHint":{zh:"感谢你帮助我们改进 Tangu。你可以在账户中心查看回复。",en:"Thanks for helping improve Tangu. You can view replies in your account center."},"feedback.ticket":{zh:"反馈编号:{id}",en:"Reference: {id}"},"feedback.viewFeedback":{zh:"查看我的反馈",en:"View my feedback"},"feedback.done":{zh:"完成",en:"Done"},"feedback.limit":{zh:"反馈内容不能超过 {max} 字。",en:"Feedback cannot exceed {max} characters."},"feedback.retry":{zh:"重试提交",en:"Try again"},"feedback.diagnosePrompt":{zh:`我在使用 Tangu 时遇到一个问题,想请你帮我诊断:
5
+
6
+ {description}
7
+
8
+ 请结合当前会话的上下文分析可能的原因,并给出排查步骤。`,en:`I ran into a problem while using Tangu and would like your help diagnosing it:
9
+
10
+ {description}
11
+
12
+ Using the context of this session, analyze the likely causes and suggest troubleshooting steps.`}});function On(n){C.getState().setPendingDraft(n),$.getState().openView("chat",{followActive:!0,reuseKey:"primary"},"main")}const An=({cfg:n,activeSession:s,onClose:o,surface:m="modal"})=>{const{t:r}=Te(),[b]=c.useState(()=>({cfg:n,session:s})),f=C(k=>k.feedbackDraft),[v,w]=c.useState("bug"),[d,p]=c.useState(!0),[g,h]=c.useState(!1),[x,N]=c.useState(!1),[S,E]=c.useState(0),[z,j]=c.useState(null),[L,F]=c.useState(!1),[R,Z]=c.useState(!1),[A,Y]=c.useState(null),[W,P]=c.useState(""),J=c.useRef(null),O=c.useRef(!1),ue=c.useRef(o);ue.current=o;const V=d||g||x,K=`${d}:${g}:${x}:${S}`,Q=z?.key===K?z:null,ee=V&&!Q,I=V?Q?.report:void 0,me=!!I&&I.bytes>qo,H=f.trim().length>ct,ve=!!f.trim()&&!H&&!R&&!A&&!ee&&!me&&(!V||!!I),M=()=>{O.current||ue.current()};c.useEffect(()=>{if(!V)return;let k=!0;return Ho(b.cfg,b.session,{diagnostics:d,conversation:g,activity:x}).then(_=>{k&&j({key:K,report:_})}).catch(()=>{k&&j({key:K,failed:!0})}),()=>{k=!1}},[b,d,g,x,S,K,V]),c.useEffect(()=>{const k=document.activeElement,_=requestAnimationFrame(()=>J.current?.querySelector("textarea")?.focus()),ke=B=>{if(B.key==="Escape"&&(B.preventDefault(),B.stopImmediatePropagation(),O.current||ue.current()),B.key==="Tab"){const fe=Array.from(J.current?.querySelectorAll('button:not(:disabled), textarea:not(:disabled), input:not(:disabled), [tabindex="0"]')||[]).filter(ce=>ce.getClientRects().length>0),re=fe[0],xe=fe[fe.length-1];if(!re){B.preventDefault(),J.current?.focus();return}B.shiftKey&&(document.activeElement===re||!J.current?.contains(document.activeElement))?(B.preventDefault(),xe.focus()):!B.shiftKey&&(document.activeElement===xe||!J.current?.contains(document.activeElement))&&(B.preventDefault(),re.focus())}};return document.addEventListener("keydown",ke,!0),()=>{cancelAnimationFrame(_),document.removeEventListener("keydown",ke,!0),k?.focus()}},[]);const Le=async()=>{if(!(!ve||O.current)){if(!window.tangu?.submitFeedback){P(r("feedback.errUnavailable"));return}O.current=!0,Z(!0),P("");try{const k=await window.tangu.submitFeedback({description:`[Tangu · ${r(`feedback.${v}`)}]
13
+
14
+ ${f.trim()}`,...I?{sessionLogJson:I.json,sessionLogName:I.filename}:{}});k.ok?(Y(k),C.setState({feedbackDraft:""})):P(k.error==="attachment-too-large"?r("feedback.tooLarge"):r("feedback.errFail",{err:k.error==="not-logged-in"?r("feedback.errNotLoggedIn"):k.error||"Unknown error"}))}catch(k){P(r("feedback.errFail",{err:String(k?.message||k)}))}finally{O.current=!1,Z(!1)}}},we=()=>{if(!f.trim()||R)return;const k=r("feedback.diagnosePrompt",{description:f.trim()});window.tangu?.requestMainAction?window.tangu.requestMainAction("chat-draft",k):On(k),M()},ie=I?`${(I.bytes/1024).toFixed(1)} KB`:"",q=()=>{if(!I)return;const k=URL.createObjectURL(new Blob([I.json],{type:"application/json;charset=utf-8"})),_=document.createElement("a");_.href=k,_.download=I.filename,_.click(),setTimeout(()=>URL.revokeObjectURL(k),1e4)};return t.jsx("div",{className:m==="panel"?"feedback-panel-surface":"memv-modal feedback-overlay",onClick:k=>{m==="modal"&&k.target===k.currentTarget&&M()},children:t.jsxs("div",{ref:J,className:"modal feedback-modal",role:"dialog","aria-modal":"true","aria-labelledby":"feedback-title",tabIndex:-1,onKeyDown:k=>{(k.metaKey||k.ctrlKey)&&k.key==="Enter"&&!k.nativeEvent.isComposing&&(k.preventDefault(),Le())},children:[t.jsxs("div",{className:"modal-head feedback-head",children:[t.jsxs("div",{className:"feedback-heading",children:[t.jsx(Gt,{size:19}),t.jsxs("div",{children:[t.jsx("h2",{id:"feedback-title",children:r("feedback.title")}),t.jsx("p",{children:r("feedback.subtitle")})]})]}),t.jsx("button",{className:"icon-btn",onClick:M,disabled:R,"aria-label":r("settings.btn.cancel"),children:t.jsx(jn,{size:18})})]}),A?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"modal-body feedback-success",role:"status",children:[t.jsx("span",{className:"feedback-success-icon",children:t.jsx(da,{size:28})}),t.jsx("h3",{children:r("feedback.successTitle")}),t.jsx("p",{children:r("feedback.successHint")}),A.id&&t.jsx("code",{children:r("feedback.ticket",{id:A.id})}),A.attachmentSkipped&&t.jsx("p",{className:"feedback-warning",children:r("feedback.okNoLog")}),W&&t.jsx("p",{className:"feedback-warning",role:"alert",children:W})]}),t.jsxs("div",{className:"feedback-footer",children:[window.tangu?.openAccountCenter&&t.jsx("button",{className:"btn ghost",onClick:()=>{P(""),window.tangu.openAccountCenter("feedback").catch(()=>P(r("feedback.errUnavailable")))},children:r("feedback.viewFeedback")}),t.jsx("span",{className:"grow"}),t.jsx("button",{autoFocus:!0,className:"btn primary",onClick:M,children:r("feedback.done")})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"modal-body feedback-body",children:[L?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn ghost sm feedback-back",onClick:()=>F(!1),children:[t.jsx(ua,{size:14}),r("feedback.backToForm")]}),t.jsxs("div",{className:"feedback-file",children:[t.jsx(lt,{size:15}),t.jsx("span",{children:I?.filename}),t.jsx("span",{children:ie})]}),t.jsx("pre",{className:"feedback-preview",tabIndex:0,children:I?.json})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"feedback-kinds",role:"group","aria-label":r("feedback.kind"),children:[{id:"bug",Icon:ma},{id:"idea",Icon:fn},{id:"other",Icon:Gt}].map(({id:k,Icon:_})=>t.jsxs("button",{className:"btn ghost","aria-pressed":v===k,disabled:R,onClick:()=>w(k),children:[t.jsx(_,{size:15}),r(`feedback.${k}`)]},k))}),t.jsxs("div",{className:"feedback-description",children:[t.jsx("label",{htmlFor:"feedback-description",children:r(v==="bug"?"feedback.description":"feedback.label")}),t.jsx("textarea",{id:"feedback-description",value:f,onChange:k=>{C.setState({feedbackDraft:k.target.value}),P("")},placeholder:r(`feedback.${v}Placeholder`),disabled:R,"aria-invalid":H,"aria-describedby":"feedback-count"}),t.jsxs("span",{id:"feedback-count",className:H?"feedback-warning":"feedback-count",children:[f.trim().length.toLocaleString()," / ",ct.toLocaleString()]})]}),t.jsxs("section",{className:"feedback-context","aria-labelledby":"feedback-context-title",children:[t.jsxs("div",{className:"feedback-section-heading",children:[t.jsx("h3",{id:"feedback-context-title",children:r("feedback.context")}),t.jsx("code",{children:"/feedback"})]}),t.jsx("p",{className:"feedback-session",children:b.session?r("feedback.sessionContext",{name:b.session.title||b.session.id.slice(0,8)}):r("feedback.withoutSession")}),[{id:"diagnostics",checked:d,change:p,unavailable:!1},{id:"conversation",checked:g,change:h,unavailable:!b.session},{id:"activity",checked:x,change:N,unavailable:!window.tangu?.exportActivity}].map(k=>t.jsxs("label",{className:"feedback-option","data-disabled":k.unavailable||void 0,children:[t.jsx("input",{type:"checkbox",checked:k.checked,onChange:_=>k.change(_.target.checked),disabled:R||k.unavailable}),t.jsxs("span",{children:[t.jsx("strong",{children:r(`feedback.${k.id}`)}),t.jsx("small",{children:r(`feedback.${k.id}Hint`)})]})]},k.id))]}),t.jsxs("div",{className:"feedback-report-status",role:"status",children:[t.jsx("span",{children:ee?t.jsxs(t.Fragment,{children:[t.jsx(Xt,{size:13,className:"spin"}),r("feedback.preparing")]}):I?t.jsxs(t.Fragment,{children:[t.jsx(lt,{size:13}),r("feedback.ready",{size:ie})]}):r(V?"feedback.prepareFailed":"feedback.textOnly")}),t.jsxs("div",{children:[I&&t.jsx("button",{className:"btn ghost sm",onClick:()=>F(!0),disabled:R,children:r("feedback.preview")}),I&&t.jsxs("button",{className:"btn ghost sm",onClick:q,disabled:R,children:[t.jsx(fa,{size:13}),r("feedback.export")]}),V&&t.jsx("button",{className:"icon-btn",onClick:()=>E(k=>k+1),disabled:R||ee,"aria-label":r("feedback.refresh"),title:r("feedback.refresh"),children:t.jsx(pa,{size:13})})]})]}),!!I?.missing.length&&t.jsx("p",{className:"feedback-warning",children:r("feedback.partial",{sources:I.missing.map(k=>r(`feedback.source.${k}`)).join(", ")})}),I?.truncated&&t.jsx("p",{className:"feedback-note",children:r("feedback.truncated")}),V&&t.jsx("p",{className:"feedback-note",children:r("feedback.privacy")})]}),me&&t.jsx("p",{className:"feedback-warning",role:"alert",children:r("feedback.tooLarge")}),H&&t.jsx("p",{className:"feedback-warning",role:"alert",children:r("feedback.limit",{max:ct})}),W&&t.jsx("p",{className:"feedback-warning",role:"alert",children:W})]}),t.jsxs("div",{className:"feedback-footer",children:[t.jsxs("button",{className:"btn ghost feedback-diagnose",onClick:we,disabled:R||!f.trim(),title:r("feedback.diagnoseViaChatHint"),children:[t.jsx(ha,{size:15}),r("feedback.diagnoseViaChat")]}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn primary",onClick:()=>{Le()},disabled:!ve,children:[R&&t.jsx(Xt,{size:14,className:"spin"}),r(R?"feedback.sending":W?"feedback.retry":"feedback.submit")]})]})]})]})})};function Be(n){return Array.from(n.dataTransfer?.types??[]).includes("Files")}function Ke(){let n=0;const s=w=>{if(w){document.body.setAttribute("data-file-drag","1");return}n=0,document.body.removeAttribute("data-file-drag")},o=w=>{!Be(w)||w.defaultPrevented||(w.preventDefault(),w.dataTransfer&&(w.dataTransfer.dropEffect="none"))},m=w=>{Be(w)&&!w.defaultPrevented&&w.preventDefault()},r=()=>s(!1),b=w=>{Be(w)&&(n++,s(!0))},f=w=>{Be(w)&&(n=Math.max(0,n-1),n||s(!1))},v=()=>s(!1);return document.addEventListener("dragover",o),document.addEventListener("drop",m),document.addEventListener("drop",r,!0),document.addEventListener("dragenter",b),document.addEventListener("dragleave",f),window.addEventListener("dragend",v),window.addEventListener("blur",v),()=>{document.removeEventListener("dragover",o),document.removeEventListener("drop",m),document.removeEventListener("drop",r,!0),document.removeEventListener("dragenter",b),document.removeEventListener("dragleave",f),window.removeEventListener("dragend",v),window.removeEventListener("blur",v),document.body.removeAttribute("data-file-drag")}}function Pn({target:n,onUnavailable:s}){const[,o]=c.useReducer(d=>d+1,0),[m,r]=c.useState(()=>({...n.params??{}})),b=c.useRef(m);b.current=m;const f=c.useRef(!1);c.useEffect(()=>Me(o),[]),c.useEffect(()=>r({...n.params??{}}),[n]);const v=Ie(n.type);v&&(f.current=!0),c.useEffect(()=>{f.current&&!v&&s?.()},[v,s]);const w=c.useMemo(()=>({id:`floating:${n.type}`,type:n.type,loc:"main",get params(){return b.current},setTitle:d=>{document.title=d},setParams:d=>r({...d}),close:()=>s?.()}),[n.type,s]);return v?t.jsx("div",{className:"floating-plugin-view","data-view":n.type,children:t.jsx(Cn,{children:t.jsx(c.Suspense,{fallback:null,children:v.factory({leaf:w,params:m})})})}):t.jsx("div",{className:"floating-panel-empty",children:"Loading panel…"})}const Yo=[[390,"iPhone"],[414,"Max"],[768,"iPad"]];function Ko({children:n}){const[s,o]=c.useState(390);return Sn!=="mobile"?t.jsx(t.Fragment,{children:n}):window.innerWidth<=820?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{className:"sc-frame",children:[t.jsx("div",{className:"sc-bar",children:Yo.map(([m,r])=>t.jsxs("button",{className:`sc-size${s===m?" on":""}`,onClick:()=>o(m),children:[r," · ",m]},m))}),t.jsx("div",{className:"sc-device",style:{width:s},children:n})]})}function Uo(){ms(),c.useEffect(()=>Ke(),[]),c.useEffect(()=>{fs(),ao()},[]),c.useEffect(()=>window.tangu?.onMainAction?.((d,p)=>{d==="onboarding"&&C.getState().setOnboarding(!0),d==="dev-commands"&&ps(),d==="test-notification"&&hs(),d==="reset-layout"&&$.getState().resetLayout({undoable:!0}),d==="achievement-toast"&&ga(),d==="space-removed"&&p&&Ga(p),d==="chat-draft"&&p&&On(p),d==="chat-quote"&&p&&oo(p),d==="agents-changed"&&(C.getState().refreshAgents(),window.dispatchEvent(new Event("forsion:agents-changed"))),d==="skills-changed"&&(pt(ht()).then(g=>C.setState({skillsList:g})).catch(()=>{}),window.dispatchEvent(new Event("forsion:skills-changed"))),d==="open-agents"&&en(C.getState().defaultAgentSlug||""),d==="open-agent"&&p&&/^[a-z0-9][a-z0-9-]{0,63}$/.test(p)&&en(p)}),[]);const n=Ye(),s=ba();gs();const o=C(En(d=>({sessions:d.sessions,archivedSessions:d.archivedSessions,activeId:d.activeId,settingsOpen:d.settingsOpen,settingsTab:d.settingsTab,settingsSkillKey:d.settingsSkillKey,onboarding:d.onboarding,feedbackOpen:d.feedbackOpen,marketOpen:d.marketOpen,closeMarket:d.closeMarket,achievementsOpen:d.achievementsOpen,cfg:d.cfg,tr:d.tr,openSettings:d.openSettings,closeSettings:d.closeSettings,patchConfig:d.patchConfig,connect:d.connect,setOnboarding:d.setOnboarding,closeFeedback:d.closeFeedback}))),m=o.sessions.find(d=>d.id===o.activeId)||o.archivedSessions.find(d=>d.id===o.activeId)||null,r=c.useSyncExternalStore(va,Zt,Zt),[b,f]=c.useState(!1),v=c.useRef(o.onboarding);c.useEffect(()=>{const d=v.current;if(v.current=o.onboarding,d&&!o.onboarding){f(!0);const p=setTimeout(()=>f(!1),650);return()=>clearTimeout(p)}},[o.onboarding]);const w=o.settingsOpen||o.marketOpen||o.achievementsOpen||o.feedbackOpen||!!r||o.onboarding;return t.jsxs(Ko,{children:[t.jsx("div",{className:`shell-host${b?" main-enter":""}`,style:o.onboarding?{visibility:"hidden"}:void 0,children:t.jsx(Dn,{dark:s.mode==="dark",soft:!!Nn(s.lang)?.manifest.panelGap,buildDefault:pn,header:t.jsx(Vo,{}),footer:t.jsx(bs,{})})}),wa()&&t.jsx(hn,{}),t.jsx(ka,{}),t.jsx(xa,{}),t.jsx(Ln,{}),t.jsx(Ja,{}),t.jsx(ge,{children:o.settingsOpen&&t.jsx(Ce,{title:o.tr("settings.title"),onClose:()=>o.closeSettings(),children:t.jsx(gn,{open:!0,initialTab:o.settingsTab??void 0,initialSkillKey:o.settingsSkillKey??void 0,cfg:o.cfg,activeSession:m,themeLang:n.lang,themeSkin:n.skin,themeMode:n.mode,themeModePref:n.modePref,flatOn:n.flat,glassOn:n.glass,themeSeed:n.seed,onClose:()=>o.closeSettings(),onConfigChange:o.patchConfig,onThemeChange:(d,p,g)=>n.setTheme(d,p,n.bg,g),onFlatChange:n.setFlat,onGlassChange:d=>n.setGlass(d),onSeedChange:d=>n.setSeedValue(d),onReloadThemes:()=>n.reloadThemes(),onReconnect:d=>{o.connect({...o.cfg,...d||{}})},onRelaunchOnboarding:()=>{o.closeSettings();try{localStorage.removeItem(In)}catch{}o.setOnboarding(!0)}})},"settings")}),t.jsx(ge,{children:o.onboarding&&t.jsx(Qa.div,{style:{position:"fixed",inset:0,zIndex:60,background:"var(--bg)"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:1.06},transition:{duration:.45,ease:[.2,.8,.2,1]},children:t.jsx(ya,{themeLang:n.lang,themeSkin:n.skin,themeMode:n.mode,themeModePref:n.modePref,themeSeed:n.seed,onThemeChange:(d,p,g)=>n.setTheme(d,p,n.bg,g),onSeedChange:d=>n.setSeedValue(d),onReconnect:()=>{window.tangu?.getConfig().then(d=>{const p={backendUrl:d.backendUrl,token:d.token,modelId:d.modelId};C.setState({cfg:p,desktopMode:"managed"}),C.getState().connect(p)})},onFinish:()=>{o.setOnboarding(!1),window.tangu?.getConfig().then(d=>{const p={backendUrl:d.backendUrl,token:d.token,modelId:d.modelId};C.setState({cfg:p,homeDir:d.homeDir,defaultWsDir:d.defaultWorkspaceDir||""}),C.getState().connect(p)})}})},"onboarding")}),t.jsx(ge,{children:o.marketOpen&&t.jsx(Ce,{title:o.tr("market.title"),onClose:()=>o.closeMarket(),children:t.jsx(bn,{onClose:()=>o.closeMarket()})},"market")}),t.jsx(ge,{children:o.achievementsOpen&&t.jsx(Ce,{title:o.tr("achievements.title"),onClose:()=>C.getState().closeAchievements(),children:t.jsx(vn,{onClose:()=>C.getState().closeAchievements()})},"achievements")}),t.jsx(ge,{children:o.feedbackOpen&&t.jsx(Ce,{compact:!0,title:o.tr("feedback.title"),onClose:()=>o.closeFeedback(),children:t.jsx(An,{surface:"panel",cfg:o.cfg,activeSession:m,onClose:()=>o.closeFeedback()})},"feedback")}),t.jsx(vs,{}),t.jsx(ge,{children:r?.view&&t.jsx(Ce,{title:r.title,onClose:Jt,children:t.jsx(Pn,{target:r.view,onUnavailable:Jt})},r.id)}),!w&&t.jsx(wn,{}),!w&&t.jsx(ws,{onOpen:()=>C.getState().openAchievements()}),!o.onboarding&&t.jsx(ks,{})]})}mt({"chatpreview.msg.ask":{zh:"帮我把 LCL 的 hash 路由分支理一下,再决定要不要抽成表。",en:"Walk me through the hash route branches in LCL, then decide whether to pull them into a table."},"chatpreview.msg.reasoning":{zh:"先看 main.tsx 的 hash 分支顺序,确认 #/aion 与 #/tangu 不会被前面的 frame 分支吞掉,再决定是否抽一个 routes 表。整体规模还小,优先可读性。",en:"Start with the order of the hash branches in main.tsx, confirm that #/aion and #/tangu are not swallowed by the earlier frame branch, then decide whether to extract a routes table. The whole thing is still small, so readability wins."},"chatpreview.todo.read":{zh:"读 main.tsx 路由分支",en:"Read the route branches in main.tsx"},"chatpreview.todo.addRoute":{zh:"加 #/tangu 分支",en:"Add the #/tangu branch"},"chatpreview.todo.navLink":{zh:"补 Navigator 链接",en:"Add the Navigator link"},"chatpreview.todo.build":{zh:"跑 tsc / build",en:"Run tsc / build"},"chatpreview.plan":{zh:`1. 检查 hash 分支顺序
15
+ 2. 补路由与导航
16
+ 3. 运行 typecheck / build`,en:`1. Check the order of the hash branches
17
+ 2. Add the route and the navigation link
18
+ 3. Run typecheck / build`},"chatpreview.msg.answer":{zh:"看完了。当前是 5 条 `if (route.view === …)` 顺序分支,`frame` 在前、`aion/tangu` 在后,互不吞。\n\n```ts\nif (route.view === 'frame') return <Frame/>\nif (route.view === 'tangu') return <Tangu/>\n```\n\n规模还小,**暂不必抽表**——超过 ~8 条再说。",en:"Had a look. Right now there are 5 sequential `if (route.view === …)` branches — `frame` first, then `aion/tangu` — and none of them swallows another.\n\n```ts\nif (route.view === 'frame') return <Frame/>\nif (route.view === 'tangu') return <Tangu/>\n```\n\nAt this size a table is **not worth extracting yet** — revisit past ~8 branches."},"chatpreview.msg.buildFirst":{zh:"我先跑一遍构建确认。",en:"Let me run a build first to confirm."},"chatpreview.plan.question":{zh:"计划已就绪。是否批准?",en:"The plan is ready. Approve it?"},"chatpreview.inquiry.question":{zh:"路由是抽成表驱动,还是保持 if 分支?",en:"Should routing become table-driven, or stay as if branches?"},"chatpreview.inquiry.optTable":{zh:"抽成 routes 表",en:"Extract a routes table"},"chatpreview.inquiry.optIf":{zh:"保持 if 分支",en:"Keep the if branches"},"chatpreview.session.routing":{zh:"重构 LCL 路由层",en:"Refactor the LCL routing layer"},"chatpreview.session.weekly":{zh:"周报整理",en:"Compile the weekly report"},"chatpreview.session.scraper":{zh:"爬虫脚本调试",en:"Debug the scraper script"},"chatpreview.session.design":{zh:"设计系统对照",en:"Design system comparison"}});function Go(n){const s=Date.now()-6e4;return[{id:"u1",role:"user",content:n("chatpreview.msg.ask"),attachments:[{name:"routes.md",mimeType:"text/markdown",data:"",size:128}],status:"done",timestamp:s+1},{id:"a1",role:"assistant",agentName:"Tangu",status:"done",timestamp:s+2,systemPrompt:"You are Tangu, a coding agent. Keep changes scoped and verify them.",reasoning:n("chatpreview.msg.reasoning"),toolEvents:[{id:"t1",name:"read_file",arguments:"src/main.tsx",done:!0,elapsedMs:400},{id:"t2",name:"run_shell",arguments:"npx tsc --noEmit",done:!0,isError:!0,elapsedMs:1200}],todos:[{status:"completed",content:n("chatpreview.todo.read")},{status:"in_progress",content:n("chatpreview.todo.addRoute")},{status:"pending",content:n("chatpreview.todo.navLink")},{status:"pending",content:n("chatpreview.todo.build")}],planProposal:n("chatpreview.plan"),inquiries:[{inquiryId:"iqp",runId:"r1",question:n("chatpreview.plan.question"),options:[],status:"pending",kind:"plan"}],content:n("chatpreview.msg.answer")},{id:"a2",role:"assistant",agentName:"Tangu",status:"done",timestamp:s+3,content:n("chatpreview.msg.buildFirst"),approvals:[{approvalId:"ap1",runId:"r1",name:"run_bash",arguments:JSON.stringify({command:"npm run build && npx tsc --noEmit"}),preview:"$ npm run build && npx tsc --noEmit",status:"pending",reason:{kind:"mode",mode:"auto-edit"}},{approvalId:"ap2",runId:"r1",name:"write_file",arguments:JSON.stringify({path:"/etc/hosts",content:`127.0.0.1 tangu.local
19
+ `}),preview:"⚠ Write outside the workspace · write /etc/hosts (22 chars)",status:"pending",reason:{kind:"escalate",mode:"auto-edit"}}]},{id:"a3",role:"assistant",agentName:"Tangu",status:"done",timestamp:s+4,content:"",inquiries:[{inquiryId:"iq1",runId:"r1",question:n("chatpreview.inquiry.question"),options:[n("chatpreview.inquiry.optTable"),n("chatpreview.inquiry.optIf")],status:"pending"}]}]}const rn=new Date().toISOString(),Xo=["chatpreview.session.routing","chatpreview.session.weekly","chatpreview.session.scraper","chatpreview.session.design"];function Zo(n){return Xo.map((s,o)=>({id:`s${o+1}`,title:n(s),model_id:null,archived:!1,emoji:null,agent_config:null,project_path:"/tangu",project_name:n("app.defaultWorkspace"),created_at:rn,updated_at:rn}))}function Jo(n){return[{key:"__cloud__",name:n("app.cloudWorkspace"),kind:"cloud",path:null,system:!0},{key:"/tangu",name:n("app.defaultWorkspace"),kind:"local",path:"/tangu",system:!0}]}const cn={backendUrl:"http://localhost:8787",token:"",modelId:""};function Qo(){const{t:n}=Te(),[s,o]=c.useState(!1),[m,r]=c.useState(""),b=c.useRef(null),f=c.useMemo(()=>Go(n),[n]),v=c.useMemo(()=>Zo(n),[n]),w=c.useMemo(()=>Jo(n),[n]);return t.jsxs("div",{className:"t2-preview-shell",children:[t.jsx("div",{className:"t2-preview-side",children:t.jsx(fo,{collapsed:!1,sessions:v,archivedSessions:[],activeId:"s1",runningIds:new Set(["s2"]),unreadIds:new Set(["s3"]),cfg:cn,modelId:"",activeSession:v[0],workspaces:w,onSelect:()=>{},onNewInWorkspace:()=>{},onAddWorkspace:()=>{},onRenameWorkspace:()=>{},onRemoveWorkspace:()=>{},onRename:()=>{},onArchive:()=>{},onDelete:()=>{},onOpenSettings:()=>{},showSpecial:!0,onNewChat:()=>o(!0),onOpenWorkspace:()=>{}})}),t.jsxs("div",{className:"t2-preview-main t2-chat-view",children:[t.jsxs("div",{className:"t2-toolbar",children:[t.jsx("div",{className:"t2-toolbar-title",children:v[0].title}),t.jsx("span",{className:"t2-toolbar-grow"}),t.jsx("button",{className:"t2-pill",onClick:()=>o(!1),style:{fontWeight:s?400:600},children:n("workbench.chat")}),t.jsx("button",{className:"t2-pill",onClick:()=>o(!0),style:{fontWeight:s?600:400},children:n("chat.emptyHint")}),m&&t.jsx("span",{className:"t2-toolbar-pill","data-preview-action":!0,children:m})]}),s?t.jsx(io,{}):t.jsx("div",{className:"t2-stream",ref:b,children:t.jsx("div",{className:"t2-stream-inner",children:f.map(d=>t.jsx(ro,{msg:d},d.id))})}),t.jsx(po,{approvalTray:s?void 0:t.jsx(co,{items:lo(f),onDecide:(d,p,g,h)=>(r(`approval:${g}:${String(h?.command||"")}`),!1),onAnswer:(d,p,g)=>(r(`inquiry:${g}`),!1)}),disabled:!1,running:!1,execConfig:{execMode:"host",approvalMode:"auto-edit"},models:null,modelId:"",onModelChange:()=>{},planMode:!1,onPlanModeChange:()=>{},onExecConfigChange:()=>{},onSend:async()=>!0,onStop:()=>{},contextWindow:2e5,ctxTokens:84e3,sessionTokens:12e3,onCompact:()=>{}})]}),t.jsxs("div",{className:"t2-preview-right",children:[t.jsx("div",{className:"t2-preview-right-title",children:n("panel.tab.toc")}),t.jsx(ho,{view:"toc",cfg:cn,sessionId:"s1",sessionConfig:{},running:!1,messages:s?[]:f,chatScrollRef:b,onToast:()=>{},onOpenPreview:()=>{},subChats:[]})]})]})}function ei(){$.getState().openView("home",{},"main")}mt({"spaceWindow.stuck":{zh:"这个 Space 还没准备好。它所属的插件可能还在加载,或已被停用、卸载。准备好后这里会自动打开,也可以直接关掉这扇窗。",en:"This Space is not ready yet. Its plugin may still be loading, or may have been disabled or removed. It will open here once it is ready, or you can close this window."}});const ln=6e3;function ti(){const[n,s]=c.useState(Qt?"wait":"plain");return c.useEffect(()=>{const o=Qt;if(!o)return;const m=Date.now();let r=null,b=!1;const f=()=>{const p=ae.getState().spaces.find(h=>h.id===o);if(r){p!==r&&!b&&(b=!0,location.reload());return}if(!p||!ja()&&Date.now()-m<ln)return;r=p;const g=$.getState();g.setSidebarDefaults(p.sidebarDefaults),g.setSideProfile(p.id,p.resizableSides??{},p.sideDefaultScale,p.bottomSpan),g.setPinned(p.pinned),document.title=be(p.name),s("ready")};f();const v=ae.subscribe(f),w=Me(f),d=window.setTimeout(()=>{f(),r||s("stuck")},ln+50);return()=>{v(),w(),window.clearTimeout(d)}},[]),n}function ni(){const{t:n}=Te(),s=Ye(),o=ti();c.useEffect(()=>{C.getState().setTr((r,b)=>n(r,b))},[n]),c.useEffect(()=>{C.getState().boot()},[]),c.useEffect(()=>Ke(),[]),c.useEffect(()=>window.tangu?.onMainAction?.(r=>{r==="agents-changed"&&(C.getState().refreshAgents(),window.dispatchEvent(new Event("forsion:agents-changed"))),r==="skills-changed"&&(pt(ht()).then(b=>C.setState({skillsList:b})).catch(()=>{}),window.dispatchEvent(new Event("forsion:skills-changed")))}),[]),c.useEffect(()=>{window.tangu?.detachedReady?.(Sa()).then(r=>{if(!r?.length)return;const b=$.getState();for(const f of r)b.openView(f.type,f.params??{},"main")})},[]);const m=(()=>{try{return window.tangu?.platform==="darwin"}catch{return!1}})();return o==="wait"||o==="stuck"?t.jsxs("div",{className:"shell-host",style:{display:"flex",flexDirection:"column"},children:[m&&t.jsx("div",{style:{height:38,flex:"0 0 auto",WebkitAppRegion:"drag"}}),o==="stuck"&&t.jsx("div",{className:"space-window-wait",role:"status",style:{flex:1,display:"grid",placeItems:"center",padding:32,textAlign:"center",color:"var(--text-muted)",fontSize:"var(--ui-font-body, 13px)",lineHeight:1.6},children:t.jsx("span",{style:{maxWidth:420},children:n("spaceWindow.stuck")})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"shell-host",children:t.jsx(Dn,{noRibbon:!0,dark:s.mode==="dark",soft:!!Nn(s.lang)?.manifest.panelGap,buildDefault:o==="ready"?pn:ei,header:m?t.jsx("div",{style:{height:38,flex:"0 0 auto",WebkitAppRegion:"drag"}}):void 0})}),window.amadeus&&t.jsx(hn,{}),t.jsx(Ln,{})]})}let X=null;Ve()==="mini"&&(Ca(async n=>{n.type==="amadeus-editor"&&await Na();const s={...n.params};delete s.miniSurface,n.type==="chat"&&(s.sessionId||=C.getState().activeId||void 0,s.followActive=!s.sessionId),window.tangu?.showMainPanel?.({...n,params:s})}),Ea(n=>{if(X?.view)return n.type===X.view.type?n:n.type===(X.mainView?.type||X.view.type)?{type:X.view.type,params:{...X.view.params,...n.params}}:(We({...n}),null);const s=ft();if(!s||!He(s))return null;const o=s.mini;return n.type===o.view.type?n:n.type===o.mainView.type?{type:o.view.type,params:{...o.view.params,...n.params}}:(We({...n}),null)}));function si(){const n=ft();n&&He(n)&&$.getState().openView(n.mini.view.type,n.mini.view.params??{},"main")}function ai(){const{t:n}=Te(),[s,o]=c.useState(null);return c.useEffect(()=>{C.getState().setTr((m,r)=>n(m,r))},[n]),c.useEffect(()=>{let m=!1,r=!1;const b=new URLSearchParams(location.search);let f=b.get("sessionId")?{sessionId:b.get("sessionId")}:null;const v=()=>{if(!m||!f)return;if(f.view){const S=f.view;if(!Ie(S.type)){r&&window.tangu?.closeSelf?.();return}r=!0;const E=f;f=null,X=E,o(E),$.getState().openView(S.type,{...S.params,...E.params},"main");return}const g=f.spaceId||(f.sessionId?"tangu":void 0),h=ae.getState().spaces.find(S=>S.id===g);if(!h||!He(h))return;const x=f;f=null,X=null,o(null),qe(h.id);const N={...h.mini.view.params,...x.params,...x.sessionId?{sessionId:x.sessionId,followActive:!1}:{}};$.getState().openView(h.mini.view.type,N,"main"),x.sessionId&&C.getState().setActiveId(x.sessionId)},w=window.tangu?.onMiniTarget?.(g=>{f=g,v()});window.tangu?.miniReady?.();const d=ae.subscribe(v),p=Me(v);return C.getState().boot().finally(()=>{m=!0,v()}),()=>{w?.(),d(),p(),m=!1,X=null}},[]),c.useEffect(()=>{window.amadeus&&Tn()},[]),c.useEffect(()=>Ke(),[]),t.jsx(Wo,{buildDefault:si,direct:s?.view?{title:s.title,view:s.view,mainView:s.mainView??s.view}:null})}const oi={settings:"settings.title",market:"market.title",achievements:"achievements.title",feedback:"feedback.title",btw:"btw.title"};function ii(n,s){return n.builtin?s(oi[n.builtin]):n.title}function ri(){const{t:n}=Te(),s=Ye(),[o,m]=c.useState(null),r=C(En(x=>({cfg:x.cfg,cfgLoaded:x.cfgLoaded,closeSettings:x.closeSettings,closeMarket:x.closeMarket,closeAchievements:x.closeAchievements,closeFeedback:x.closeFeedback,patchConfig:x.patchConfig,connect:x.connect}))),b=o?.params?.session?.id?o.params.session:null,f=()=>window.tangu?.closeSelf?.(),v=o?.builtin==="btw"?uo(o.params):null,w=o?ii(o,n):"";if(c.useEffect(()=>{o?.builtin&&w&&(document.title=w)},[o?.builtin,w]),c.useEffect(()=>{C.getState().setTr((x,N)=>n(x,N))},[n]),c.useEffect(()=>{C.getState().boot()},[]),c.useEffect(()=>{window.amadeus&&Tn()},[]),c.useEffect(()=>Ke(),[]),c.useEffect(()=>window.tangu?.onMainAction?.(x=>{x==="agents-changed"&&(C.getState().refreshAgents(),window.dispatchEvent(new Event("forsion:agents-changed"))),x==="skills-changed"&&(pt(ht()).then(N=>C.setState({skillsList:N})).catch(()=>{}),window.dispatchEvent(new Event("forsion:skills-changed")))}),[]),c.useEffect(()=>{const x=Ia(),N=window.tangu?.onFloatingTarget?.(m);return window.tangu?.floatingReady?.(x).then(S=>{S&&m(S)}),()=>N?.()},[]),c.useEffect(()=>{o?.builtin==="feedback"&&typeof o.params?.description=="string"&&C.setState({feedbackDraft:o.params.description})},[o]),!o)return t.jsx("div",{className:"floating-native-root"});const d=()=>{r.closeSettings(),f()},p=()=>{r.closeMarket(),f()},g=()=>{r.closeAchievements(),f()},h=()=>{r.closeFeedback(),f()};return t.jsxs("div",{className:"floating-native-root",children:[window.tangu?.platform==="darwin"&&t.jsx("header",{className:"floating-native-chrome",children:t.jsx("span",{title:w,children:w})}),t.jsxs("main",{className:"floating-native-content",children:[o.builtin==="settings"&&t.jsx(gn,{open:!0,initialTab:typeof o.params?.tab=="string"?o.params.tab:void 0,initialSkillKey:typeof o.params?.skillKey=="string"?o.params.skillKey:void 0,cfg:r.cfg,activeSession:b,themeLang:s.lang,themeSkin:s.skin,themeMode:s.mode,themeModePref:s.modePref,flatOn:s.flat,glassOn:s.glass,themeSeed:s.seed,onClose:d,onConfigChange:r.patchConfig,onThemeChange:(x,N,S)=>s.setTheme(x,N,s.bg,S),onFlatChange:s.setFlat,onGlassChange:s.setGlass,onSeedChange:s.setSeedValue,onReloadThemes:s.reloadThemes,onReconnect:x=>{r.connect({...r.cfg,...x||{}})},onRelaunchOnboarding:()=>{try{localStorage.removeItem(In)}catch{}window.tangu?.requestMainAction?.("onboarding"),f()}},JSON.stringify(o.params??{})),o.builtin==="market"&&t.jsx(bn,{initialQuery:typeof o.params?.q=="string"?o.params.q:void 0,onClose:p},String(o.params?.q??"")),o.builtin==="achievements"&&t.jsx(vn,{onClose:g}),o.builtin==="feedback"&&r.cfgLoaded&&t.jsx(An,{surface:"panel",cfg:r.cfg,activeSession:b,onClose:h},b?.id||""),o.builtin==="btw"&&r.cfgLoaded&&v&&t.jsx(xs,{seed:v,onClose:f}),o.view&&t.jsx(Pn,{target:o.view,onUnavailable:f})]}),(o.builtin==="settings"||o.builtin==="market")&&t.jsx(wn,{})]})}let de=null;function dn(n){if(!n){de&&(de.style.display="none");return}de||(de=document.createElement("div"),Object.assign(de.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"99998",boxSizing:"border-box",border:"3px solid var(--accent, #4d8794)",background:"color-mix(in srgb, var(--accent, #4d8794) 8%, transparent)"}),document.body.appendChild(de)),de.style.display="block"}function ci(){const n=window.tangu;if(n?.openDetached){if(Ve()==="main"){let s="";const o=()=>{const f=C.getState(),v=f.activeId,w={sessionId:v,runId:v?f.runningBySession[v]??null:null},d=JSON.stringify(w);d!==s&&(s=d,n.reportMiniSession?.(w))};C.subscribe(o),o();let m=null;const r=()=>{if(!$.getState().api||!m||!Ie(m.type))return;const v=m;m=null,v.spaceId&&qe(v.spaceId);const w=$.getState().openView(v.type,v.params??{},"main");w&&v.params&&w.setParams({...w.params,...v.params})};n.onMainPanelTarget?.(f=>{m=f,r()}),Me(r);let b=!1;$.subscribe(f=>{f.api&&(b||(b=!0,n.mainPanelReady?.()),r())})}Ta({detach:(s,o)=>{n.openDetached?.(s,o)},openSpace:(s,o)=>{Ve()==="main"&&Ma()===s&&ae.getState().activeSpaceId===s&&$.getState().saveNamed(La(s)),n.openDetached?.([],o,{space:s})},dragUpdate:(s,o,m)=>n.dragUpdate?.(s,o,m),drop:async(s,o,m)=>(await n.dropView?.(s,o,m))?.routed??!1}),n.onAcceptView?.(s=>{dn(null),$.getState().openView(s.type,s.params??{},"main")}),n.onDragPreview?.(s=>dn(s))}}function li(){const n=window.tangu;if(!n?.reportRunningSessions)return;const s=o=>n.reportRunningSessions(Object.keys(o).length);s(C.getState().runningBySession),C.subscribe((o,m)=>{o.runningBySession!==m.runningBySession&&s(o.runningBySession)})}const un=n=>go(n).toLowerCase(),Fn=(n,s)=>n.configBySession[s]?.cwd||n.sessions.find(o=>o.id===s)?.project_path||"",zn=(n,s)=>Object.keys(n.runningBySession).some(o=>un(Fn(n,o))===un(s));function di(){const n=window.tangu;if(!(!n?.codeStudioGitCommit||!n.codeStudioGitStatus||!n.productsIsCreation))return C.subscribe((s,o)=>{if(s.runningBySession!==o.runningBySession)for(const m of Object.keys(o.runningBySession)){if(s.runningBySession[m])continue;const r=Fn(s,m);!r||zn(s,r)||ui(r,m)}})}async function ui(n,s){try{if(!await window.tangu.productsIsCreation(n))return;const o=await window.tangu.codeStudioGitStatus(n);if(!(o?.auto??o?.writable)||zn(C.getState(),n))return;const m=ys(C.getState().messagesBySession[s]||[]);await window.tangu.codeStudioGitCommit(n,{name:m,auto:!0,untitled:mn("studio.history.untitled")})}catch(o){console.warn("[creations] 自动存版本失败",o)}}function mi(){if(!window.tangu?.onAuthWillChange)return()=>{};let n=!1,s=null,o=!1,m=0,r=Promise.resolve(),b=!1;const f=()=>{s&&(s.inert=o),s=null},v=window.tangu.onAuthWillChange(async()=>{const d=++m;s||(s=document.body,o=s?.inert??!1,s&&(s.inert=!0));try{if(await r,d!==m||b||!window.amadeus)return;const[{flushAllScopes:p,resetAllScopeDocs:g,usePageStore:h},{useDbStore:x},{useDrawStore:N},S]=await Promise.all([je(()=>import("./appStore-B1ynyt42.js").then(E=>E.rD),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),je(()=>import("./appStore-B1ynyt42.js").then(E=>E.rE),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),je(()=>import("./appStore-B1ynyt42.js").then(E=>E.rG),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),je(()=>import("./index-Bh_nLVTc.js").then(E=>E.cx),[],import.meta.url)]);if(await Promise.all([p(!0),x.getState().flushAll(!0),N.getState().flushAll(!0)]),d!==m)return;n=h.getState().vaultSide==="cloud",n&&(S.retireAllUnifiedScopes(),g(),h.setState({vaultRoot:null,pages:[],folders:[],files:[],icons:{}}))}catch(p){throw d===m&&f(),p}}),w=window.tangu.onAuthChanged?.(()=>{const d=++m;if(!n){r.finally(()=>{d===m&&f()});return}n=!1,r=r.then(async()=>{const{usePageStore:p}=await je(async()=>{const{usePageStore:g}=await import("./appStore-B1ynyt42.js").then(h=>h.rD);return{usePageStore:g}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);b||(await p.getState().restoreVault(),await p.getState().initVaultSide())}).catch(p=>console.error("[auth] Cannot restore vault after account change:",p)).finally(()=>{d===m&&f()})});return()=>{b=!0,++m,v(),w?.(),f()}}mi();window.addEventListener("error",n=>{console.error("[tangu] window error:",n.error||n.message)});window.addEventListener("unhandledrejection",n=>{console.error("[tangu] unhandledrejection:",n.reason)});const fi=(()=>{try{return location.hash==="#preview"}catch{return!1}})(),$e=Ve();try{document.documentElement.dataset.window=$e}catch{}try{document.documentElement.lang=as()==="zh"?"zh-CN":"en"}catch{}try{window.tangu?.platform==="darwin"&&(document.documentElement.dataset.platform="mac")}catch{}let _n,Bn=null;try{_n=localStorage.getItem("forsion_theme_seed")||void 0}catch{}try{Bn=localStorage.getItem("forsion_theme_lang")}catch{}try{Ra(Da(),Oa(),Aa(),Pa(),{customColor:_n}),Fa(),document.documentElement.style.removeProperty("background"),Ye.getState().initThemes(Bn),C.getState().setTr(mn),Ss(),ci(),li(),di(),za(),js(),_a()}catch(n){console.error("[tangu] init failed, continue to mount:",n),Ba("init",n)}is.createRoot(document.getElementById("root")).render(t.jsx(os,{children:t.jsx(mo,{children:fi?t.jsx(Qo,{}):$e==="mini"?t.jsx(ai,{}):$e==="floating"?t.jsx(ri,{}):$e==="detached"?t.jsx(ni,{}):t.jsx(Uo,{})})}));
@@ -0,0 +1,3 @@
1
+ import{Q as z,U as A,W as O,X as H,j as y,K as W,u as V,d as w,r as F}from"./index-Bh_nLVTc.js";import{mr as B,ms as I,mt as _,g2 as T}from"./appStore-B1ynyt42.js";import{P as N}from"./MarkdownBlock-D8LgHFYY.js";import"./nativeDownload-CziEyW_p.js";import"./ipc-CPhL3bPp.js";import"./client-DxGbwZLy.js";import"./index-BaRySZ-M.js";import"./linkFollow-C6PHGUxk.js";import"./mdMarks-cmL6vzR-.js";import"./emoji-Cjm3bKiF.js";import"./listFold-Q_8mh5ZG.js";import"./book-open-DBJ3dDpw.js";const G=z().use(A).use(O,{singleTilde:!1}).use(H,["yaml"]).use(B).use(I,{singleTilde:!1}),c=t=>String(t??"").replace(/[&<>"']/g,m=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[m]);function P(t,m=!1){if(!t||/[\u0000-\u0020\u007f\\]/.test(t)||t.startsWith("//"))return null;if(t.startsWith("/")||t.startsWith("#"))return t;try{const o=new URL(t);if(o.protocol==="https:"||o.protocol==="http:"||!m&&o.protocol==="mailto:")return o.href}catch{}return!t.includes(":")&&!t.startsWith(".")?t:null}function j(t){return t.value??(t.children??[]).map(j).join("")}function M(t){return t.type!=="paragraph"?null:/^!\[\[([^\]\n]+)\]\]$/.exec(j(t).trim())?.[1]?.replace(/\|\d+$/,"")??null}function K(t){return t.type==="paragraph"&&t.children?.length===1&&t.children[0].type==="image"?t.children[0]:null}function Q(t,m={}){const o=G.parse(t),d=m.locale==="zh",u=(e,l=!1)=>{const r=P(e,l);if(!r||!m.baseUrl||r.startsWith("#"))return r;try{return P(new URL(r,m.baseUrl).href,l)}catch{return r}};let g=!0;const v=()=>{const e=!!m.priorityFirstImage&&g;return g=!1,e?'loading="eager" fetchpriority="high"':'loading="lazy"'},i=new Map((o.children??[]).filter(e=>e.type==="definition").map(e=>[e.identifier,e]));let f=0;const p=e=>(e.children??[]).map(s).join(""),$=(e,l)=>{const r=_(e),a=u(r?.provider==="Bilibili"&&/^BV[\w]{10}$/i.test(e.trim())?"https://www.bilibili.com/video/"+e.trim():e,!0);if(!a)return null;let h=a;try{h=new URL(a,"https://forsion.example").pathname}catch{}const b=/\.(mp4|webm|mov|m4v|ogv)$/i.test(h),C=/\.(mp3|m4a|ogg|wav|flac)$/i.test(h);if(!r&&!b&&!C)return null;const S=l?.alt||r?.provider||(d?C?"音频":"视频演示":C?"Audio":"Video demo"),q=l?.url?u(l.url,!0):null,x=/^(\d{1,4})[:/](\d{1,4})$/.exec(l?.title||""),R=x&&+x[1]>0&&+x[2]>0?` style="aspect-ratio:${+x[1]}/${+x[2]}"`:"",U=q?`<img src="${c(q)}" alt="${c(S)}" ${v()} decoding="async">`:`<div class="md-media-placeholder"><span>${c(S)}</span></div>`;return`<figure class="md-media" data-amadeus-media="${r?"platform":C?"audio":"video"}" data-src="${c(r?.src||a)}"><div class="md-media-stage${q?" has-poster":""}"${R}>${U}</div><figcaption><span>${c(S)}</span><button type="button" class="play-button">${d?"播放":"Play"}${r?` · ${r.provider}`:""}</button><a href="${c(a)}" target="_blank" rel="noopener noreferrer">${d?"打开原视频":"Open original"} ↗</a></figcaption><p class="md-media-error" role="status" hidden>${d?"暂时无法播放,请打开原视频。":"Playback is unavailable. Open the original video."}</p></figure>`};function s(e){const l=()=>p(e);switch(e.type){case"text":return c(e.value);case"strong":return`<strong>${l()}</strong>`;case"emphasis":return`<em>${l()}</em>`;case"delete":return`<del>${l()}</del>`;case"inlineCode":return`<code>${c(e.value)}</code>`;case"break":return"<br>";case"heading":{const r=Math.min(6,(e.depth??2)+(m.headingOffset??0));return`<h${r} id="${c(m.idPrefix||"md")}-${++f}">${l()}</h${r}>`}case"paragraph":{const r=M(e);if(r){const a=u(r,!0);if(a&&/\.(?:png|jpe?g|gif|webp|avif|svg)(?:[?#]|$)/i.test(a))return`<figure class="md-image"><img src="${c(a)}" alt="${c(r)}" ${v()} decoding="async"></figure>`;const h=$(r);if(h)return h;const b=u(r);return b?`<p class="md-bookmark"><a href="${c(b)}" target="_blank" rel="noopener noreferrer">${c(r)} ↗</a></p>`:`<p>${c(j(e))}</p>`}return`<p>${l()}</p>`}case"link":case"linkReference":{const r=e.url??i.get(e.identifier)?.url??"",a=u(r);return a?`<a href="${c(a)}"${/^https?:/.test(a)?' target="_blank" rel="noopener noreferrer"':""}>${l()}</a>`:l()}case"image":case"imageReference":{const r=i.get(e.identifier),a=u(e.url??r?.url??"",!0);return a?`<img src="${c(a)}" alt="${c(e.alt||"")}" ${v()} decoding="async">`:c(e.alt||"")}case"list":return`<${e.ordered?"ol":"ul"}${e.ordered&&e.start?` start="${e.start}"`:""}>${l()}</${e.ordered?"ol":"ul"}>`;case"listItem":return`<li>${e.checked!=null?`<input type="checkbox" disabled aria-label="${d?"清单项":"Checklist item"}"${e.checked?" checked":""}>`:""}${l()}</li>`;case"blockquote":{const r=e.children?.[0],a=r?.type==="paragraph"?/^\[!([\w-]+)\]([+-])?\s*(.*)/.exec(j(r)):null;if(!a)return`<blockquote>${l()}</blockquote>`;const h=(e.children??[]).slice(1).map(s).join(""),b=c(a[3]||a[1]);return a[2]?`<details class="md-callout md-fold"${a[2]==="+"?" open":""}><summary>${b}</summary><div>${h}</div></details>`:`<aside class="md-callout"><p class="md-callout-title">${b}</p>${h}</aside>`}case"table":return`<div class="md-table-wrap"><table>${(e.children??[]).map((r,a)=>`<${a?"tbody":"thead"}><tr>${(r.children??[]).map(h=>`<${a?"td":"th"}>${p(h)}</${a?"td":"th"}>`).join("")}</tr></${a?"tbody":"thead"}>`).join("")}</table></div>`;case"code":return`<pre><code${e.lang?` class="language-${c(e.lang.replace(/[^\w-]/g,""))}"`:""}>${c(e.value)}</code></pre>`;case"thematicBreak":return"<hr>";case"html":case"yaml":case"definition":return"";default:return e.children?l():c(e.value)}}const n=(o.children??[]).filter(e=>!["yaml","html","definition"].includes(e.type));let L="";n[0]?.type==="heading"&&n[0].depth===1&&(L=j(n.shift()));let k="",E=!1;for(let e=0;e<n.length;e++){const l=n[e];l.type==="heading"&&l.depth===2&&(E&&(k+="</section>"),k+='<section class="md-feature">',E=!0);const r=K(l),a=n[e+1]&&M(n[e+1]),h=r&&a?$(a,r):null;if(h){k+=h,e++;continue}k+=s(l)}return E&&(k+="</section>"),{title:L,html:k}}function X(t,m="en"){const o=m==="zh",d=Array.from(t.querySelectorAll("[data-amadeus-media]")),u=new AbortController,g=i=>{d.forEach(f=>{f!==i&&f.querySelector("video,audio")?.pause()})};for(const i of d){const f=i.querySelector("button"),p=i.querySelector(".md-media-stage");f.addEventListener("click",()=>{const $=i.querySelector(".md-media-error");if($.hidden=!0,i.dataset.amadeusMedia==="platform"){if(p.querySelector("iframe")){p.querySelector("iframe").remove(),p.classList.remove("playing"),f.textContent=o?"播放":"Play";return}g(i);const n=document.createElement("iframe");n.src=i.dataset.src,n.title=i.querySelector("figcaption span")?.textContent||"Video",n.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",n.allowFullscreen=!0,n.referrerPolicy="strict-origin-when-cross-origin",p.appendChild(n),p.classList.add("playing"),f.textContent=o?"关闭播放器":"Close player";return}let s=p.querySelector("video,audio");if(s||(s=document.createElement(i.dataset.amadeusMedia==="audio"?"audio":"video"),s.setAttribute("controls",""),s.setAttribute("playsinline",""),s.preload="none",s.src=i.dataset.src,p.appendChild(s),s.addEventListener("playing",()=>{p.classList.add("playing"),f.textContent=o?"暂停":"Pause"},{signal:u.signal}),s.addEventListener("pause",()=>{f.textContent=s.ended?o?"重播":"Replay":o?"继续播放":"Resume"},{signal:u.signal}),s.addEventListener("loadedmetadata",()=>{s instanceof HTMLVideoElement&&s.videoHeight&&(p.style.aspectRatio=`${s.videoWidth}/${s.videoHeight}`)},{signal:u.signal})),!s.paused){s.pause();return}g(i),s.play().catch(()=>{$.hidden=!1,p.classList.remove("playing")})},{signal:u.signal})}const v=()=>{d.forEach(i=>i.querySelector("video,audio")?.pause())};return document.addEventListener("visibilitychange",()=>{document.hidden&&v()},{signal:u.signal}),()=>{u.abort(),v(),d.forEach(i=>i.querySelector("iframe")?.remove())}}F({"publishing.visual":{zh:"Amadeus 编辑",en:"Amadeus editor"},"publishing.source":{zh:"Markdown 源码",en:"Markdown source"},"publishing.preview":{zh:"预览",en:"Preview"}});function D({options:t,revision:m,alive:o}){const{t:d,locale:u}=V(),[g,v]=w.useState(t.value),[i,f]=w.useState("visual"),p=w.useRef(null);w.useEffect(()=>{v(t.value)},[t.value,m]);const $=n=>{o()&&(t.value=n,v(n),t.onChange?.(n))};w.useEffect(()=>p.current?X(p.current,u):void 0,[i,g,u,t.previewBaseUrl]);const s=i==="preview"?Q(g,{locale:u,baseUrl:t.previewBaseUrl}):null;return y.jsxs("div",{className:"am-app amx-publishing-editor","aria-label":t.label,children:[y.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"8px 0"},children:["visual","source","preview"].map(n=>y.jsx("button",{className:"btn",type:"button","aria-pressed":i===n,onClick:()=>f(n),children:d(`publishing.${n}`)},n))}),i==="visual"&&y.jsx(N,{initial:g,onChange:$,readOnly:t.readOnly,immediate:!0}),i==="source"&&y.jsx("textarea",{"aria-label":t.label||d("publishing.source"),value:g,readOnly:t.readOnly,onChange:n=>$(n.target.value),style:{width:"100%",minHeight:420,resize:"vertical",padding:12,font:"inherit",fontFamily:"var(--font-mono)",color:"var(--text)",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)"}}),s&&y.jsx("div",{ref:p,className:"amadeus-published",dangerouslySetInnerHTML:{__html:(s.title?`<h1>${s.title.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}</h1>`:"")+s.html}})]})}function ce(t,m){const o={...m};let d=!0,u=0;const g=()=>y.jsx(W,{children:y.jsx(D,{options:o,revision:u++,alive:()=>d})}),v=T(t,g(),()=>{d=!1}),i=()=>v.render(g());return{getValue(){return o.value},update(f){d&&(Object.assign(o,f),i())},insertMarkdown(f){d&&!o.readOnly&&(o.value+=`
2
+
3
+ `+f,o.onChange?.(o.value),i())},focus(){d&&t.querySelector('[contenteditable="true"],textarea')?.focus()},dispose:v.dispose}}export{ce as mountPluginMarkdownEditor};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./appStore-B1ynyt42.js","./index-Bh_nLVTc.js","./nativeDownload-CziEyW_p.js","./ipc-CPhL3bPp.js","./client-DxGbwZLy.js","./appStore-BC_CQv-L.css"])))=>i.map(i=>d[i]);
2
+ import{u as y,d as f,_ as g,t as l,r as w}from"./index-Bh_nLVTc.js";import{w as M,a as S}from"./mdMarks-cmL6vzR-.js";import{dk as d,b as m}from"./appStore-B1ynyt42.js";import{c as _,n as N}from"./nativeDownload-CziEyW_p.js";w({"mdmark.patchFailed":{zh:"改不动「{name}」—— 笔记里那一行已经变了",en:"Can’t update “{name}” — that line in the note has changed"},"mdmark.openNote":{zh:"打开笔记",en:"Open note"},"mdmark.colName":{zh:"事项",en:"Item"},"mdmark.colDate":{zh:"时间",en:"Time"},"mdmark.colNote":{zh:"来源笔记",en:"Source note"},"mdmark.calName":{zh:"笔记",en:"Notes"}});const u=a=>`${a.path}:${a.line}`,h=new Map;let p=0,k=0;const i=_((a,c)=>({marks:[],ready:!1,overlay:{},async load(){if(!d?.listMarks){a({marks:[],ready:!0});return}const r=++k,n=m.getState().vaultRoot;try{await m.getState().flushSave().catch(()=>{});const t=await d.listMarks();r===k&&m.getState().vaultRoot===n&&a({marks:t,ready:!0})}catch{r===k&&a({marks:[],ready:!0})}},patch(r,n){const t=u(r);a(o=>({overlay:{...o.overlay,[t]:{...o.overlay[t],...n}}}));const e=h.get(t);e&&clearTimeout(e),h.set(t,window.setTimeout(()=>{h.delete(t),x(t,r)},400))}}));async function x(a,c){const r=i.getState(),n=r.overlay[a];if(!n||!d?.patchMark)return;const t=r.marks.find(o=>u(o)===a)??c;let e=t.raw;if(n.checked!==void 0&&(e=M(e,n.checked)??e),n.due!==void 0&&(e=S(e,n.due)??e),e!==t.raw){p++;try{await m.getState().flushSave().catch(()=>{}),await d.patchMark(t.path,t.raw,t.occ,e).catch(()=>!1)||N({event:"system.generic",level:"warning",text:l("mdmark.patchFailed",{name:t.text}),action:{label:l("mdmark.openNote"),run:()=>{g(()=>import("./appStore-B1ynyt42.js").then(s=>s.rF),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(s=>s.openNoteAtHeading(t.path,t.heading))}}})}finally{p--}}await i.getState().load(),!h.has(a)&&p===0&&i.setState(o=>{const s={...o.overlay};return delete s[a],{overlay:s}})}function T(){const a=i(t=>t.marks),c=i(t=>t.overlay),r=m(t=>t.vaultRoot),n=m(t=>t.activePage);return f.useEffect(()=>{const t=setTimeout(()=>{i.getState().load()},250);return()=>clearTimeout(t)},[r,n]),f.useMemo(()=>Object.keys(c).length?a.map(e=>{const o=c[u(e)];return o?{...e,due:o.due??e.due,checked:o.checked??e.checked}:e}):a,[a,c])}function z(a,c){return d?.patchMark?(i.getState().patch(a,c),!0):!1}d?.onStructureChange?.(()=>{i.getState().load()});const C="mdnote://vault-notes",D=()=>[{id:"name",name:l("mdmark.colName"),type:"text"},{id:"date",name:l("mdmark.colDate"),type:"calendarDate"},{id:"note",name:l("mdmark.colNote"),type:"text"}];function E(){const a=T(),{locale:c}=y();return f.useMemo(()=>{const r=a.filter(e=>!e.isTask);if(!r.length)return[];const n=new Map(r.map(e=>[u(e),e])),t=r.map(e=>({rowId:u(e),name:e.text,cells:{name:e.text,date:e.due,note:e.title}}));return[{path:C,name:l("mdmark.calName"),isNoteView:!1,readonly:!0,columns:D(),rows:t,writeCell:d?.patchMark?(e,o,s)=>{const v=n.get(e);!v||o!=="date"||typeof s!="string"||!s||i.getState().patch(v,{due:s})}:void 0,openRow:e=>{const o=n.get(e);o&&g(()=>import("./appStore-B1ynyt42.js").then(s=>s.rF),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(s=>s.openNoteAtHeading(o.path,o.heading))}}]},[a,c])}export{T as a,i as b,z as p,E as u};
@@ -1 +1 @@
1
- import{o5 as c}from"./appStore-Dg9WALEA.js";const s=String.raw`\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2})?`,d=/[A-Za-z0-9._%+-]/,l=new RegExp(String.raw`(?<!${d.source})@(remind:)?(${s}(?:/${s})?)(?=$|[\s,;.。,、;))\]】!?!?])`,"g");function*h(n){l.lastIndex=0;let e;for(;e=l.exec(n);)e[2].split("/").every(c)&&(yield{index:e.index,whole:e[0],remind:!!e[1],val:e[2]})}function a(n,e){const i=[...h(n)],t=i.find(r=>!r.remind)??i[0];if(!t)return null;const o=`${t.whole.startsWith("@")?"":t.whole[0]}@${t.remind?"remind:":""}${e}`;return n.slice(0,t.index)+o+n.slice(t.index+t.whole.length)}function x(n,e){const i=/^(\s*[-*+]\s+\[)[ xX](\]\s)/.exec(n);return i?n.slice(0,i[1].length)+(e?"x":" ")+n.slice(i[1].length+1):null}export{d as A,a,x as w};
1
+ import{oW as c}from"./appStore-B1ynyt42.js";const s=String.raw`\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2})?`,d=/[A-Za-z0-9._%+-]/,l=new RegExp(String.raw`(?<!${d.source})@(remind:)?(${s}(?:/${s})?)(?=$|[\s,;.。,、;))\]】!?!?])`,"g");function*h(n){l.lastIndex=0;let e;for(;e=l.exec(n);)e[2].split("/").every(c)&&(yield{index:e.index,whole:e[0],remind:!!e[1],val:e[2]})}function a(n,e){const i=[...h(n)],t=i.find(r=>!r.remind)??i[0];if(!t)return null;const o=`${t.whole.startsWith("@")?"":t.whole[0]}@${t.remind?"remind:":""}${e}`;return n.slice(0,t.index)+o+n.slice(t.index+t.whole.length)}function x(n,e){const i=/^(\s*[-*+]\s+\[)[ xX](\]\s)/.exec(n);return i?n.slice(0,i[1].length)+(e?"x":" ")+n.slice(i[1].length+1):null}export{d as A,a,x as w};
@@ -1 +1 @@
1
- import{z as a}from"./appStore-Dg9WALEA.js";const e=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],o=a("message-square-plus",e);export{o as M};
1
+ import{F as a}from"./appStore-B1ynyt42.js";const e=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],o=a("message-square-plus",e);export{o as M};
@@ -1 +1 @@
1
- import{r as t}from"./index-CF4RV4mh.js";t({"automation.deleted":{zh:"已删除「{name}」",en:"Deleted “{name}”"},"automation.deleteConfirm":{zh:"删除「{name}」?此操作无法撤销。",en:"Delete “{name}”? This can’t be undone."},"automation.undo":{zh:"撤销",en:"Undo"},"automation.ux.actions":{zh:"更多操作",en:"More actions"},"automation.ux.help":{zh:"使用说明",en:"Workflow help"},"automation.ux.properties":{zh:"规则配置",en:"Rule configuration"},"automation.ux.myWorkflows":{zh:"我的自动化",en:"My workflows"},"automation.ux.noRules":{zh:"从入门模板创建第一条自动化。",en:"Create your first workflow from a starter template."},"automation.ux.workspace":{zh:"自动化工作台",en:"Automation studio"},"automation.ux.welcome":{zh:"把重复的事,交给流程",en:"Turn repeat work into a workflow"},"automation.ux.intro":{zh:"从一个触发条件开始,连接 Agent、笔记和多维表,随时查看每一步的结果。",en:"Start with a trigger, connect your agents, notes and databases, and see what each step did."},"automation.ux.guide.trigger":{zh:"选择触发方式",en:"Choose a trigger"},"automation.ux.guide.triggerHint":{zh:"定时、事件、表格变化,或手动点击。",en:"A schedule, an event, a database change, or a click."},"automation.ux.guide.actions":{zh:"连接要做的事",en:"Connect your actions"},"automation.ux.guide.actionsHint":{zh:"在画布添加步骤,选中节点完成配置。",en:"Add steps on the canvas, then select a node to configure it."},"automation.ux.guide.test":{zh:"试运行,再启用",en:"Test, then enable"},"automation.ux.guide.testHint":{zh:"先保存为暂停状态,检查结果后开启。",en:"Save paused, review a test run, then enable it."},"automation.ux.startWith":{zh:"从场景开始",en:"Start with a use case"},"automation.ux.blank":{zh:"自定义流程",en:"Custom workflow"},"automation.ux.draftHint":{zh:"模板只填入草稿。保存前,你可以修改所有配置。",en:"Templates only fill a draft. Review and change anything before saving."},"automation.ux.native":{zh:"和 Forsion 一起工作",en:"Works with Forsion"},"automation.ux.nativeHint":{zh:"笔记按钮负责手动启动,多维表提供触发数据,Agent 处理任务,通知送达收件箱。Muse 和 Historian 的系统自动化也可在左侧单独管理。",en:"Note buttons start manual workflows, databases supply trigger data, agents handle tasks, and notifications arrive in your inbox. Manage Muse and Historian separately in the sidebar."},"automation.ux.reminder.name":{zh:"每日提醒",en:"Daily reminder"},"automation.ux.reminder.hint":{zh:"每天固定时间,把提醒送进收件箱。",en:"Send a reminder to your inbox at a set time each day."},"automation.ux.reminder.flow":{zh:"每天 09:00 → 发通知",en:"Daily at 09:00 → Notify"},"automation.ux.reminder.body":{zh:"今天有哪些值得优先处理的事?",en:"What deserves your attention today?"},"automation.ux.briefing.name":{zh:"Agent 每日简报",en:"Daily agent briefing"},"automation.ux.briefing.hint":{zh:"选一个 Agent,定时整理你关心的信息。",en:"Choose an agent to prepare a scheduled briefing."},"automation.ux.briefing.flow":{zh:"定时 → 跑 Agent",en:"Schedule → Run agent"},"automation.ux.briefing.prompt":{zh:"整理一份今日工作简报,总结当前待办和需要关注的事项。",en:"Prepare a daily briefing of current tasks and items that need attention."},"automation.ux.table.name":{zh:"新增记录提醒",en:"New record notification"},"automation.ux.table.hint":{zh:"多维表新增一行时,通知你及时跟进。",en:"Get notified when a new row is added to a database."},"automation.ux.table.flow":{zh:"新增记录 → 发通知",en:"Row added → Notify"},"automation.ux.table.body":{zh:"多维表新增了记录:{{row.id}}",en:"A new database row was added: {{row.id}}"},"automation.ux.button.name":{zh:"一键交给 Agent",en:"One click to an agent"},"automation.ux.button.hint":{zh:"手动执行常用任务,也能绑定到笔记按钮。",en:"Run a repeat task manually or attach it to a note button."},"automation.ux.button.flow":{zh:"手动点击 → 跑 Agent",en:"Manual click → Run agent"},"automation.ux.button.prompt":{zh:"检查我的待办,整理接下来最值得推进的三件事。",en:"Review my tasks and identify the three most useful next actions."},"automation.ux.overview":{zh:"入门与模板",en:"Guide and templates"},"automation.ux.search":{zh:"搜索自动化",en:"Search automations"},"automation.ux.noMatches":{zh:"没有匹配的自动化",en:"No matching automations"},"automation.ux.enable":{zh:"启用",en:"Enable"},"automation.ux.pause":{zh:"暂停",en:"Pause"},"automation.ux.on":{zh:"已启用",en:"Enabled"},"automation.ux.off":{zh:"已暂停",en:"Paused"},"automation.ux.flow":{zh:"工作流画布",en:"Workflow canvas"},"automation.ux.canvasHint":{zh:"拖动排列 · 点击配置",en:"Drag to arrange · Click to configure"},"automation.ux.canvasOrder":{zh:"按连线顺序执行。拖动只调整布局,步骤顺序在配置中调整。",en:"Steps run in connected order. Dragging changes the layout; use the step controls to reorder execution."},"automation.ux.zoomIn":{zh:"放大画布",en:"Zoom in"},"automation.ux.zoomOut":{zh:"缩小画布",en:"Zoom out"},"automation.ux.fit":{zh:"适应视图",en:"Fit to view"},"automation.ux.arrange":{zh:"自动排列",en:"Auto arrange"},"automation.ux.ready":{zh:"已配置",en:"Configured"},"automation.ux.incomplete":{zh:"待配置",en:"Needs setup"},"automation.ux.finish":{zh:"保存与启用",en:"Save and enable"},"automation.ux.finishHint":{zh:"检查配置与启动方式",en:"Review setup and activation"},"automation.ux.addStep":{zh:"添加步骤",en:"Add a step"},"automation.ux.maxSteps":{zh:"最多添加 24 个步骤",en:"Up to 24 steps"},"automation.ux.setup":{zh:"节点配置",en:"Node configuration"},"automation.ux.setupHint":{zh:"选中画布节点,配置触发条件或动作。",en:"Select a canvas node to configure its trigger or action."},"automation.ux.savePaused":{zh:"保存为暂停",en:"Save paused"},"automation.ux.saveEnabled":{zh:"保存并启用",en:"Save and enable"},"automation.ux.enabledLabel":{zh:"保存后启用",en:"Enable after saving"},"automation.ux.enableHint":{zh:"暂停状态仍可试运行;启用后才响应触发条件。",en:"Paused workflows can still be tested. Enable them to respond to triggers."},"automation.ux.saved":{zh:"自动化已保存",en:"Automation saved"},"automation.ux.checklist":{zh:"还需完成",en:"Complete the setup"},"automation.ux.allReady":{zh:"配置已完成,可以保存",en:"Ready to save"},"automation.ux.review":{zh:"检查并保存",en:"Review and save"},"automation.ux.issue.name":{zh:"填写自动化名称",en:"Enter a workflow name"},"automation.ux.issue.trigger":{zh:"补全触发条件",en:"Complete the trigger settings"},"automation.ux.issue.steps":{zh:"至少添加一个动作",en:"Add at least one action"},"automation.ux.issue.notify":{zh:"填写通知标题",en:"Enter a notification title"},"automation.ux.issue.agent":{zh:"选择执行任务的 Agent",en:"Choose an agent"},"automation.ux.issue.prompt":{zh:"说明 Agent 需要完成的任务",en:"Describe the task for the agent"},"automation.ux.issue.table":{zh:"选择目标多维表",en:"Choose a database"},"automation.ux.issue.cells":{zh:"至少指定一个要写入的字段",en:"Add at least one field to write"},"automation.ux.issue.row":{zh:"指定记录 ID 或按列值匹配目标记录",en:"Set a row ID or match target rows by a column value"},"automation.ux.issue.match":{zh:"填写记录匹配值",en:"Enter a row matching value"},"automation.ux.issue.tool":{zh:"选择一个可用工具",en:"Choose an available tool"},"automation.ux.issue.args":{zh:"补全工具的必填参数",en:"Complete the required tool arguments"},"automation.ux.issue.json":{zh:"填写有效的 JSON 参数",en:"Enter valid JSON arguments"},"automation.ux.issue.cooldown":{zh:"填写有效的冷却时长",en:"Enter a valid cooldown duration"},"automation.ux.variables":{zh:"插入变量",en:"Insert variable"},"automation.ux.insertVariable":{zh:"为「{field}」插入变量",en:"Insert a variable into {field}"},"automation.ux.today":{zh:"今天的日期",en:"Today"},"automation.ux.now":{zh:"当前时间",en:"Current time"},"automation.ux.triggerRow":{zh:"触发记录",en:"Trigger row"},"automation.ux.rowId":{zh:"记录 ID",en:"Row ID"},"automation.ux.runHint":{zh:"试运行会真实执行已保存的动作。",en:"Testing executes the saved actions."},"automation.ux.dbRunHint":{zh:"表格规则试运行不携带触发行数据;行变量与默认触发行目标需要真实表格事件。",en:"Database tests have no triggering row. Row variables and default row targets require a real database event."},"automation.ux.runResults":{zh:"运行结果",en:"Run results"},"automation.ux.runEmpty":{zh:"还没有运行记录。可以先试运行一次,或等待触发条件满足。",en:"No runs yet. Test the workflow or wait for its trigger."},"automation.ux.runLoading":{zh:"正在读取运行记录…",en:"Loading runs…"},"automation.ux.runError":{zh:"无法读取运行记录,请重试。",en:"Could not load runs. Please retry."},"automation.ux.retry":{zh:"重试",en:"Retry"},"automation.ux.done":{zh:"已完成",en:"Completed"},"automation.ux.failed":{zh:"失败",en:"Failed"},"automation.ux.running":{zh:"运行中",en:"Running"},"automation.ux.queued":{zh:"排队中",en:"Queued"},"automation.ux.autoOrigin":{zh:"自动触发",en:"Automatic"},"automation.ux.manualOrigin":{zh:"手动执行",en:"Manual"},"automation.ux.stepResult":{zh:"步骤 {n} · {type}",en:"Step {n} · {type}"},"automation.ux.latestResults":{zh:"每步执行结果",en:"Step results"},"automation.ux.noSteps":{zh:"这次执行没有步骤结果。",en:"No step results were recorded for this run."},"automation.ux.systemHint":{zh:"系统助理",en:"System assistants"},"automation.ux.loadError":{zh:"自动化加载失败,请重试。",en:"Could not load automations. Please retry."}});
1
+ import{r as t}from"./index-Bh_nLVTc.js";t({"automation.deleted":{zh:"已删除「{name}」",en:"Deleted “{name}”"},"automation.deleteConfirm":{zh:"删除「{name}」?此操作无法撤销。",en:"Delete “{name}”? This can’t be undone."},"automation.undo":{zh:"撤销",en:"Undo"},"automation.ux.actions":{zh:"更多操作",en:"More actions"},"automation.ux.help":{zh:"使用说明",en:"Workflow help"},"automation.ux.properties":{zh:"规则配置",en:"Rule configuration"},"automation.ux.myWorkflows":{zh:"我的自动化",en:"My workflows"},"automation.ux.noRules":{zh:"从入门模板创建第一条自动化。",en:"Create your first workflow from a starter template."},"automation.ux.workspace":{zh:"自动化工作台",en:"Automation studio"},"automation.ux.welcome":{zh:"把重复的事,交给流程",en:"Turn repeat work into a workflow"},"automation.ux.intro":{zh:"从一个触发条件开始,连接 Agent、笔记和多维表,随时查看每一步的结果。",en:"Start with a trigger, connect your agents, notes and databases, and see what each step did."},"automation.ux.guide.trigger":{zh:"选择触发方式",en:"Choose a trigger"},"automation.ux.guide.triggerHint":{zh:"定时、事件、表格变化,或手动点击。",en:"A schedule, an event, a database change, or a click."},"automation.ux.guide.actions":{zh:"连接要做的事",en:"Connect your actions"},"automation.ux.guide.actionsHint":{zh:"在画布添加步骤,选中节点完成配置。",en:"Add steps on the canvas, then select a node to configure it."},"automation.ux.guide.test":{zh:"试运行,再启用",en:"Test, then enable"},"automation.ux.guide.testHint":{zh:"先保存为暂停状态,检查结果后开启。",en:"Save paused, review a test run, then enable it."},"automation.ux.startWith":{zh:"从场景开始",en:"Start with a use case"},"automation.ux.blank":{zh:"自定义流程",en:"Custom workflow"},"automation.ux.draftHint":{zh:"模板只填入草稿。保存前,你可以修改所有配置。",en:"Templates only fill a draft. Review and change anything before saving."},"automation.ux.native":{zh:"和 Forsion 一起工作",en:"Works with Forsion"},"automation.ux.nativeHint":{zh:"笔记按钮负责手动启动,多维表提供触发数据,Agent 处理任务,通知送达收件箱。Muse 和 Historian 的系统自动化也可在左侧单独管理。",en:"Note buttons start manual workflows, databases supply trigger data, agents handle tasks, and notifications arrive in your inbox. Manage Muse and Historian separately in the sidebar."},"automation.ux.reminder.name":{zh:"每日提醒",en:"Daily reminder"},"automation.ux.reminder.hint":{zh:"每天固定时间,把提醒送进收件箱。",en:"Send a reminder to your inbox at a set time each day."},"automation.ux.reminder.flow":{zh:"每天 09:00 → 发通知",en:"Daily at 09:00 → Notify"},"automation.ux.reminder.body":{zh:"今天有哪些值得优先处理的事?",en:"What deserves your attention today?"},"automation.ux.briefing.name":{zh:"Agent 每日简报",en:"Daily agent briefing"},"automation.ux.briefing.hint":{zh:"选一个 Agent,定时整理你关心的信息。",en:"Choose an agent to prepare a scheduled briefing."},"automation.ux.briefing.flow":{zh:"定时 → 跑 Agent",en:"Schedule → Run agent"},"automation.ux.briefing.prompt":{zh:"整理一份今日工作简报,总结当前待办和需要关注的事项。",en:"Prepare a daily briefing of current tasks and items that need attention."},"automation.ux.table.name":{zh:"新增记录提醒",en:"New record notification"},"automation.ux.table.hint":{zh:"多维表新增一行时,通知你及时跟进。",en:"Get notified when a new row is added to a database."},"automation.ux.table.flow":{zh:"新增记录 → 发通知",en:"Row added → Notify"},"automation.ux.table.body":{zh:"多维表新增了记录:{{row.id}}",en:"A new database row was added: {{row.id}}"},"automation.ux.button.name":{zh:"一键交给 Agent",en:"One click to an agent"},"automation.ux.button.hint":{zh:"手动执行常用任务,也能绑定到笔记按钮。",en:"Run a repeat task manually or attach it to a note button."},"automation.ux.button.flow":{zh:"手动点击 → 跑 Agent",en:"Manual click → Run agent"},"automation.ux.button.prompt":{zh:"检查我的待办,整理接下来最值得推进的三件事。",en:"Review my tasks and identify the three most useful next actions."},"automation.ux.overview":{zh:"入门与模板",en:"Guide and templates"},"automation.ux.search":{zh:"搜索自动化",en:"Search automations"},"automation.ux.noMatches":{zh:"没有匹配的自动化",en:"No matching automations"},"automation.ux.enable":{zh:"启用",en:"Enable"},"automation.ux.pause":{zh:"暂停",en:"Pause"},"automation.ux.on":{zh:"已启用",en:"Enabled"},"automation.ux.off":{zh:"已暂停",en:"Paused"},"automation.ux.flow":{zh:"工作流画布",en:"Workflow canvas"},"automation.ux.canvasHint":{zh:"拖动排列 · 点击配置",en:"Drag to arrange · Click to configure"},"automation.ux.canvasOrder":{zh:"按连线顺序执行。拖动只调整布局,步骤顺序在配置中调整。",en:"Steps run in connected order. Dragging changes the layout; use the step controls to reorder execution."},"automation.ux.zoomIn":{zh:"放大画布",en:"Zoom in"},"automation.ux.zoomOut":{zh:"缩小画布",en:"Zoom out"},"automation.ux.fit":{zh:"适应视图",en:"Fit to view"},"automation.ux.arrange":{zh:"自动排列",en:"Auto arrange"},"automation.ux.ready":{zh:"已配置",en:"Configured"},"automation.ux.incomplete":{zh:"待配置",en:"Needs setup"},"automation.ux.finish":{zh:"保存与启用",en:"Save and enable"},"automation.ux.finishHint":{zh:"检查配置与启动方式",en:"Review setup and activation"},"automation.ux.addStep":{zh:"添加步骤",en:"Add a step"},"automation.ux.maxSteps":{zh:"最多添加 24 个步骤",en:"Up to 24 steps"},"automation.ux.setup":{zh:"节点配置",en:"Node configuration"},"automation.ux.setupHint":{zh:"选中画布节点,配置触发条件或动作。",en:"Select a canvas node to configure its trigger or action."},"automation.ux.savePaused":{zh:"保存为暂停",en:"Save paused"},"automation.ux.saveEnabled":{zh:"保存并启用",en:"Save and enable"},"automation.ux.enabledLabel":{zh:"保存后启用",en:"Enable after saving"},"automation.ux.enableHint":{zh:"暂停状态仍可试运行;启用后才响应触发条件。",en:"Paused workflows can still be tested. Enable them to respond to triggers."},"automation.ux.saved":{zh:"自动化已保存",en:"Automation saved"},"automation.ux.checklist":{zh:"还需完成",en:"Complete the setup"},"automation.ux.allReady":{zh:"配置已完成,可以保存",en:"Ready to save"},"automation.ux.review":{zh:"检查并保存",en:"Review and save"},"automation.ux.issue.name":{zh:"填写自动化名称",en:"Enter a workflow name"},"automation.ux.issue.trigger":{zh:"补全触发条件",en:"Complete the trigger settings"},"automation.ux.issue.steps":{zh:"至少添加一个动作",en:"Add at least one action"},"automation.ux.issue.notify":{zh:"填写通知标题",en:"Enter a notification title"},"automation.ux.issue.agent":{zh:"选择执行任务的 Agent",en:"Choose an agent"},"automation.ux.issue.prompt":{zh:"说明 Agent 需要完成的任务",en:"Describe the task for the agent"},"automation.ux.issue.table":{zh:"选择目标多维表",en:"Choose a database"},"automation.ux.issue.cells":{zh:"至少指定一个要写入的字段",en:"Add at least one field to write"},"automation.ux.issue.row":{zh:"指定记录 ID 或按列值匹配目标记录",en:"Set a row ID or match target rows by a column value"},"automation.ux.issue.match":{zh:"填写记录匹配值",en:"Enter a row matching value"},"automation.ux.issue.tool":{zh:"选择一个可用工具",en:"Choose an available tool"},"automation.ux.issue.args":{zh:"补全工具的必填参数",en:"Complete the required tool arguments"},"automation.ux.issue.json":{zh:"填写有效的 JSON 参数",en:"Enter valid JSON arguments"},"automation.ux.issue.cooldown":{zh:"填写有效的冷却时长",en:"Enter a valid cooldown duration"},"automation.ux.variables":{zh:"插入变量",en:"Insert variable"},"automation.ux.insertVariable":{zh:"为「{field}」插入变量",en:"Insert a variable into {field}"},"automation.ux.today":{zh:"今天的日期",en:"Today"},"automation.ux.now":{zh:"当前时间",en:"Current time"},"automation.ux.triggerRow":{zh:"触发记录",en:"Trigger row"},"automation.ux.rowId":{zh:"记录 ID",en:"Row ID"},"automation.ux.runHint":{zh:"试运行会真实执行已保存的动作。",en:"Testing executes the saved actions."},"automation.ux.dbRunHint":{zh:"表格规则试运行不携带触发行数据;行变量与默认触发行目标需要真实表格事件。",en:"Database tests have no triggering row. Row variables and default row targets require a real database event."},"automation.ux.runResults":{zh:"运行结果",en:"Run results"},"automation.ux.runEmpty":{zh:"还没有运行记录。可以先试运行一次,或等待触发条件满足。",en:"No runs yet. Test the workflow or wait for its trigger."},"automation.ux.runLoading":{zh:"正在读取运行记录…",en:"Loading runs…"},"automation.ux.runError":{zh:"无法读取运行记录,请重试。",en:"Could not load runs. Please retry."},"automation.ux.retry":{zh:"重试",en:"Retry"},"automation.ux.done":{zh:"已完成",en:"Completed"},"automation.ux.failed":{zh:"失败",en:"Failed"},"automation.ux.running":{zh:"运行中",en:"Running"},"automation.ux.queued":{zh:"排队中",en:"Queued"},"automation.ux.autoOrigin":{zh:"自动触发",en:"Automatic"},"automation.ux.manualOrigin":{zh:"手动执行",en:"Manual"},"automation.ux.stepResult":{zh:"步骤 {n} · {type}",en:"Step {n} · {type}"},"automation.ux.latestResults":{zh:"每步执行结果",en:"Step results"},"automation.ux.noSteps":{zh:"这次执行没有步骤结果。",en:"No step results were recorded for this run."},"automation.ux.systemHint":{zh:"系统助理",en:"System assistants"},"automation.ux.loadError":{zh:"自动化加载失败,请重试。",en:"Could not load automations. Please retry."}});
@@ -0,0 +1 @@
1
+ import{F as o}from"./appStore-B1ynyt42.js";const s=[["path",{d:"M5 12h14",key:"1ays0h"}]],e=o("minus",s);export{e as M};