@forsion/unit 2.13.0 → 2.13.2

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 (184) hide show
  1. package/main.mjs +23 -3
  2. package/package.json +1 -1
  3. package/release.json +5 -5
  4. package/web/assets/{ArtificialView-BSv3Mx5C.js → ArtificialView-Bs_6B211.js} +1 -1
  5. package/web/assets/{AutomationBuilder-BuiHtVB-.js → AutomationBuilder-C-IFaaBp.js} +1 -1
  6. package/web/assets/CalendarConfigView-DEsNvVkD.js +1 -0
  7. package/web/assets/CalendarView-D7ZUE_dr.js +1 -0
  8. package/web/assets/{CapabilityMenu-kx1TIJYN.js → CapabilityMenu-CrsaTtDe.js} +1 -1
  9. package/web/assets/{CheckboxInput-eW7xdiRS.js → CheckboxInput-DVO2-1J7.js} +1 -1
  10. package/web/assets/{Chrome-B77-lQyh.js → Chrome-BvpbCvo1.js} +1 -1
  11. package/web/assets/{CodeView-Df3AiSIi.js → CodeView-CB4kG7Y6.js} +3 -3
  12. package/web/assets/DashboardGridView-hpRmBr9B.css +1 -0
  13. package/web/assets/DashboardGridView-tgaj9-SM.js +17 -0
  14. package/web/assets/{EventCard-CDmeCbI8.js → EventCard-c6s4uGBu.js} +1 -1
  15. package/web/assets/ExcalidrawCanvas-NdV86AR3.js +1 -0
  16. package/web/assets/{FloatingToc-tART_jC4.js → FloatingToc-ldOYWe2C.js} +1 -1
  17. package/web/assets/HomepageView-4joJWYlg.js +1 -0
  18. package/web/assets/HomepageView-Cxf3AWBu.css +1 -0
  19. package/web/assets/ImageStudioPanels-DgMYAsHj.js +3 -0
  20. package/web/assets/{ImageStudioView-KJhx0wJk.js → ImageStudioView-_CYHoOoG.js} +1 -1
  21. package/web/assets/InlineFiles-BIfsx3R-.js +1 -0
  22. package/web/assets/MarkdownBlock-wYEaBBOr.js +58 -0
  23. package/web/assets/ModelPill-DveHcLqq.js +2 -0
  24. package/web/assets/MuseLibraryView-Do9RnKiq.js +2 -0
  25. package/web/assets/{MuseView-Cb6R_l4i.js → MuseView-3GL4Ltoj.js} +2 -2
  26. package/web/assets/{PageHistoryPanel-BQs9IWTP.js → PageHistoryPanel-BMQC-V_l.js} +2 -2
  27. package/web/assets/{PdfAnnotator-BFTBkxvO.js → PdfAnnotator-CyAw8sgq.js} +1 -1
  28. package/web/assets/PenRow-BSB-h5Pb.js +1 -0
  29. package/web/assets/{ProductView-mB-S0j81.js → ProductView-B96OeHOP.js} +1 -1
  30. package/web/assets/{RightPanel-BVZeVO3c.js → RightPanel-BgSeCLnw.js} +3 -3
  31. package/web/assets/RunLocationPicker-CEmFio4n.css +1 -0
  32. package/web/assets/RunLocationPicker-M1UoJyjf.js +38 -0
  33. package/web/assets/{SketchCard-CAAr_cqF.js → SketchCard-DAD0jR0i.js} +212 -8
  34. package/web/assets/{StudioGuestSurface-DthpuVGg.js → StudioGuestSurface-DlUKXBXv.js} +1 -1
  35. package/web/assets/TodoListView-_yFkPUrw.js +1 -0
  36. package/web/assets/{Tooltip-D9Dt9ZTr.js → Tooltip-DXuy9-1_.js} +1 -1
  37. package/web/assets/UnifiedPage-EJNWKzxN.js +68 -0
  38. package/web/assets/{amadeus-manual.en-D5wZKuag.js → amadeus-manual.en-DzRWr4BL.js} +15 -15
  39. package/web/assets/{amadeus-manual.zh-Br5fidrj.js → amadeus-manual.zh-DW32DkL7.js} +15 -15
  40. package/web/assets/{appStore-B1ynyt42.js → appStore-CidPWYa0.js} +242 -134
  41. package/web/assets/appStore-DeaC1U32.css +1 -0
  42. package/web/assets/{arrow-up-right-R10mR2I6.js → arrow-up-right-KPFbRA41.js} +1 -1
  43. package/web/assets/{astryxBridge-CU_kQTEl.js → astryxBridge-Bupzouso.js} +3 -3
  44. package/web/assets/{automationListSource-B8EIRmDW.js → automationListSource-1aOVKBLw.js} +1 -1
  45. package/web/assets/boardSurface-BHuMoQN-.js +1 -0
  46. package/web/assets/{book-open-DBJ3dDpw.js → book-open-CBeNsIpo.js} +1 -1
  47. package/web/assets/{calendarNavStore-DGvUlU5N.js → calendarNavStore-Duyhbmm_.js} +1 -1
  48. package/web/assets/{canvasPrefs-DwL_OAAo.js → canvasPrefs-CxfyDTMT.js} +1 -1
  49. package/web/assets/{chatBoxSurface-Lq-2qfd3.js → chatBoxSurface-OBzO1Z5E.js} +1 -1
  50. package/web/assets/{circle-question-mark-HPZpZQxd.js → circle-question-mark-M8QUJJYk.js} +1 -1
  51. package/web/assets/{circle-x-BZfe7d6S.js → circle-x-Szwop5L_.js} +1 -1
  52. package/web/assets/{client-DxGbwZLy.js → client-CPUljePZ.js} +1 -1
  53. package/web/assets/{code-xml-joKQ-qGS.js → code-xml-n9mgGgkv.js} +1 -1
  54. package/web/assets/{codeStudioStore-C7rGKlOC.js → codeStudioStore-DXMQwRzG.js} +1 -1
  55. package/web/assets/codingNavigation-CCjs1kon.js +53 -0
  56. package/web/assets/codingNavigation-yp19w6uu.css +1 -0
  57. package/web/assets/{create-BjBRKATq.js → create-C19zqt5N.js} +2 -2
  58. package/web/assets/dashboardSurface-BwcH16Qc.js +1 -0
  59. package/web/assets/{deskCapture-DnGWk1iq.js → deskCapture-B_LKZSPt.js} +1 -1
  60. package/web/assets/{diff2html-Cd1rVi_Z.js → diff2html-DrCCWvpR.js} +1 -1
  61. package/web/assets/{docx-preview-CK0k1mUD.js → docx-preview-Bi7wekSM.js} +1 -1
  62. package/web/assets/{emoji-Cjm3bKiF.js → emoji-DczIG8SO.js} +1 -1
  63. package/web/assets/{floatingTocSurface-Dd1pT5j5.js → floatingTocSurface-rc1ZC7-I.js} +1 -1
  64. package/web/assets/foldActions-BGocXE-o.js +1 -0
  65. package/web/assets/{folder-CvZyHIgb.js → folder-CoOsfQ64.js} +1 -1
  66. package/web/assets/{folder-plus-BRScGQ9m.js → folder-plus-d5MwIMlf.js} +1 -1
  67. package/web/assets/{gestures-CZQVefU0.js → gestures-CXFaEydn.js} +1 -1
  68. package/web/assets/{hand-D3QspKYq.js → hand-fuehbnkI.js} +1 -1
  69. package/web/assets/{hard-drive-BQsHSala.js → hard-drive-Bh1DmZg0.js} +1 -1
  70. package/web/assets/i18n-DjziAw8r.css +1 -0
  71. package/web/assets/{i18n.generated-BZRHO2Nc.js → i18n.generated-BiQFRL2U.js} +1 -1
  72. package/web/assets/{imageStudio-Cy3_437s.js → imageStudio-Dgl1wZNB.js} +2 -2
  73. package/web/assets/{index-0AYHATDX.js → index-2tD0kijW.js} +1 -1
  74. package/web/assets/{index-DJLWTPtq.js → index-38xsQSS9.js} +1 -1
  75. package/web/assets/{index-B5GxvbNm.js → index-7kdR1oL8.js} +1 -1
  76. package/web/assets/index-B5UW6SaE.js +297 -0
  77. package/web/assets/{index-D6mpAJ9S.js → index-B8Co6KG3.js} +1 -1
  78. package/web/assets/{index-C9yo04Ck.js → index-BCG8Wnc4.js} +1 -1
  79. package/web/assets/{index-Bpc3R3DS.js → index-BPqoEOV_.js} +1 -1
  80. package/web/assets/{index-BaRySZ-M.js → index-BqGpbntz.js} +1 -1
  81. package/web/assets/{index-Dj-PygjB.js → index-CPLtf9Vc.js} +1 -1
  82. package/web/assets/{index-8ag1K7AZ.js → index-Ce1sNSS8.js} +1 -1
  83. package/web/assets/{index-BgDZGDqt.js → index-Ch0FIsJX.js} +1 -1
  84. package/web/assets/{index-CcOag8eb.js → index-CnDAYLti.js} +1 -1
  85. package/web/assets/{index-Dkd-nl1u.js → index-D4CSH-v1.js} +1 -1
  86. package/web/assets/{index-BnWj6ggb.js → index-Dc8iMctf.js} +1 -1
  87. package/web/assets/{index-D0FLFLfh.js → index-DcRyQ3eU.js} +1 -1
  88. package/web/assets/{index-DElrDw66.js → index-Df9jregv.js} +1 -1
  89. package/web/assets/{index-4E9nrhwf.js → index-Dff-DL1v.js} +1 -1
  90. package/web/assets/{index-BdZaheMZ.js → index-DvOrTnw2.js} +1 -1
  91. package/web/assets/{index-BPhwi4-v.js → index-Dx9aIoyo.js} +1 -1
  92. package/web/assets/{index-BcVGjCAJ.js → index-Dy07SBfH.js} +1 -1
  93. package/web/assets/{index-GjLSlygt.js → index-QjVOA7QM.js} +1 -1
  94. package/web/assets/{index-BgtO11q8.js → index-YRWOePBS.js} +1 -1
  95. package/web/assets/{index-9BmmlTjY.js → index-e-MxdHFO.js} +1 -1
  96. package/web/assets/{index-DNE_PBJt.js → index-fViJsYjM.js} +1 -1
  97. package/web/assets/{index-1FhRiJ_X.js → index-lfow5R3O.js} +1 -1
  98. package/web/assets/{invitePage-B4gMvEKi.js → invitePage-Dgl3-c_m.js} +1 -1
  99. package/web/assets/{ipc-CPhL3bPp.js → ipc-CNlIRMtU.js} +1 -1
  100. package/web/assets/{jszip.min-DAJT9RUA.js → jszip.min-tyV0GaJg.js} +1 -1
  101. package/web/assets/{layout-grid-DfUfnvDS.js → layout-grid-DFmwM9NU.js} +1 -1
  102. package/web/assets/linkFollow-iP2zfbA3.js +8 -0
  103. package/web/assets/{list-tree-DaGpnIYu.js → list-tree-i07HsP3D.js} +1 -1
  104. package/web/assets/{listFold-Q_8mh5ZG.js → listFold-Aea6I0Sa.js} +1 -1
  105. package/web/assets/{lock-DQ_yL4nF.js → lock-TSDKuCod.js} +1 -1
  106. package/web/assets/{log-out-DFwTeh2X.js → log-out-DK84lW5n.js} +1 -1
  107. package/web/assets/{main-NgUPPqDn.css → main-BiS_5wrB.css} +1 -1
  108. package/web/assets/main-D7CEGndC.js +20 -0
  109. package/web/assets/markdownEditorSurface-DISu_twy.js +3 -0
  110. package/web/assets/{message-square-plus-CEHkduIL.js → message-square-plus-3wFslIMY.js} +1 -1
  111. package/web/assets/{messages-CBtmbpur.js → messages-DEAGRsC3.js} +1 -1
  112. package/web/assets/minus-BBdfT_sc.js +1 -0
  113. package/web/assets/mobileEntry-5UaAITwY.js +13 -0
  114. package/web/assets/{nativeDownload-CziEyW_p.js → nativeDownload-B3JGkABw.js} +1 -1
  115. package/web/assets/pageChrome-BDHHmRnt.css +1 -0
  116. package/web/assets/{pageChrome-DFz_AAzZ.js → pageChrome-DFi9zs6F.js} +1 -1
  117. package/web/assets/{pageTree-yVO1_fSy.js → pageTree-DZ7Eiro-.js} +4 -4
  118. package/web/assets/{pen-tool-uxsFELYC.js → pen-tool-ChGmX6g_.js} +1 -1
  119. package/web/assets/{pencil-BSbra1Ra.js → pencil-CJsJD7M_.js} +1 -1
  120. package/web/assets/phoneList-DrxIwJxQ.js +9 -0
  121. package/web/assets/phoneList-DvpzD3zT.css +1 -0
  122. package/web/assets/pluginChat-0QI9a8Q1.js +2 -0
  123. package/web/assets/{redo-2-BK5LMNa5.js → redo-2-CI57sDFr.js} +1 -1
  124. package/web/assets/{rotate-ccw-HedfU4na.js → rotate-ccw-xgT_0UN9.js} +1 -1
  125. package/web/assets/{sharePage-CpzDpuU1.js → sharePage-C2Yqx0NQ.js} +2 -2
  126. package/web/assets/{shareViewer-BwzH2bIs.js → shareViewer-DKPWhTJv.js} +2 -2
  127. package/web/assets/{star-CgYon3z4.js → star-C9KTji9N.js} +1 -1
  128. package/web/assets/tableSurface-cYs6dX6B.js +1 -0
  129. package/web/assets/{terminal-krsPf1mc.js → terminal-DPZazOQ2.js} +1 -1
  130. package/web/assets/{terminalView-4e2_u5_I.js → terminalView-CsJmxE_m.js} +1 -1
  131. package/web/assets/{theme-C6D3tMGV.css → theme-Dgqst5S9.css} +1 -1
  132. package/web/assets/{type-GJYLEhY-.js → type-C5J875vb.js} +1 -1
  133. package/web/assets/{undo-2-DCTs4Ro4.js → undo-2-BOUt5qks.js} +1 -1
  134. package/web/assets/{unitAccount-D3xjX3cu.js → unitAccount-BIAIxKNp.js} +1 -1
  135. package/web/assets/unitBridge-b2C6zb3a.js +1 -0
  136. package/web/assets/{unitCloudTransport-B44L3x6M.js → unitCloudTransport-NGtDDKWo.js} +1 -1
  137. package/web/assets/{unitOwnerAccess-CRUHWGpf.js → unitOwnerAccess-CwH9ApZT.js} +1 -1
  138. package/web/assets/{unitShim-_VzxvdEG.js → unitShim-CY8EVkKD.js} +3 -3
  139. package/web/assets/{upload-MVVRQtkj.js → upload-CrbEAW8C.js} +1 -1
  140. package/web/assets/userSpaces-B_Njvel_.js +1 -0
  141. package/web/assets/viewportLock-Bi3orrUs.css +1 -0
  142. package/web/assets/viewportLock-DZ927PNz.js +629 -0
  143. package/web/assets/{workflow-DzeW9OXR.js → workflow-DY2Cnaei.js} +1 -1
  144. package/web/assets/{zoom-in-CovPsw4g.js → zoom-in-BcuPvIYd.js} +1 -1
  145. package/web/index.html +28 -11
  146. package/web/assets/CalendarConfigView-BJtG6cqN.js +0 -1
  147. package/web/assets/CalendarView-C-FX1RED.js +0 -1
  148. package/web/assets/DashboardGridView-Ck3LKkOb.css +0 -1
  149. package/web/assets/DashboardGridView-MlO1dpuo.js +0 -17
  150. package/web/assets/ExcalidrawCanvas-D9vkBh_5.js +0 -1
  151. package/web/assets/HomepageView-BNabJQfP.css +0 -1
  152. package/web/assets/HomepageView-Trqmd3RV.js +0 -1
  153. package/web/assets/ImageStudioPanels-BfCVTnKC.js +0 -3
  154. package/web/assets/InlineFiles-BHwivGbQ.js +0 -1
  155. package/web/assets/MarkdownBlock-D8LgHFYY.js +0 -58
  156. package/web/assets/ModelPill-DrW2cG0l.js +0 -2
  157. package/web/assets/MuseLibraryView-CW78Uivf.js +0 -2
  158. package/web/assets/RunLocationPicker-BE5mxnab.css +0 -1
  159. package/web/assets/RunLocationPicker-CyVa0RJa.js +0 -38
  160. package/web/assets/SidebarRow-CsWEqPKX.css +0 -1
  161. package/web/assets/SidebarRow-D77yrSLf.js +0 -9
  162. package/web/assets/TodoListView-C3ZkMIIf.js +0 -1
  163. package/web/assets/UnifiedPage-C75y-MKT.js +0 -68
  164. package/web/assets/appStore-BC_CQv-L.css +0 -1
  165. package/web/assets/codingNavigation-CZB4v1ZW.css +0 -1
  166. package/web/assets/codingNavigation-CjeWG4xm.js +0 -47
  167. package/web/assets/dashboardSurface-Cojgf_-U.js +0 -1
  168. package/web/assets/foldActions-Dm-uAt3L.js +0 -1
  169. package/web/assets/i18n-ecQQxiMQ.css +0 -1
  170. package/web/assets/index-Bh_nLVTc.js +0 -298
  171. package/web/assets/linkFollow-C6PHGUxk.js +0 -8
  172. package/web/assets/main-CwqZ_ymb.js +0 -19
  173. package/web/assets/markdownEditorSurface-e_oMhqx-.js +0 -3
  174. package/web/assets/mdMarkStore-DjN4bf1T.js +0 -2
  175. package/web/assets/mdMarks-cmL6vzR-.js +0 -1
  176. package/web/assets/minus-BUT48dAC.js +0 -1
  177. package/web/assets/mobileEntry-qR7BAROr.js +0 -13
  178. package/web/assets/pageChrome-CovzZPdb.css +0 -1
  179. package/web/assets/pluginChat-BMFnf_j2.js +0 -2
  180. package/web/assets/tableSurface-CmDwnKnd.js +0 -1
  181. package/web/assets/unitBridge-D5JcIkAP.js +0 -1
  182. package/web/assets/userSpaces-CI4eqEgh.js +0 -1
  183. package/web/assets/viewportLock-BH26xHQO.js +0 -611
  184. package/web/assets/viewportLock-IP1zaVkz.css +0 -1
@@ -0,0 +1,297 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./appStore-CidPWYa0.js","./nativeDownload-B3JGkABw.js","./ipc-CNlIRMtU.js","./client-CPUljePZ.js","./appStore-DeaC1U32.css","./invitePage-Dgl3-c_m.js","./mobileEntry-5UaAITwY.js","./viewportLock-DZ927PNz.js","./UnifiedPage-EJNWKzxN.js","./MarkdownBlock-wYEaBBOr.js","./index-BqGpbntz.js","./linkFollow-iP2zfbA3.js","./emoji-DczIG8SO.js","./listFold-Aea6I0Sa.js","./book-open-CBeNsIpo.js","./MarkdownBlock--__nPQGh.css","./pageChrome-DFi9zs6F.js","./upload-CrbEAW8C.js","./pageChrome-BDHHmRnt.css","./SketchCard-DAD0jR0i.js","./arrow-up-right-KPFbRA41.js","./Chrome-BvpbCvo1.js","./minus-BBdfT_sc.js","./canvasPrefs-CxfyDTMT.js","./hand-fuehbnkI.js","./type-C5J875vb.js","./foldActions-BGocXE-o.js","./lock-TSDKuCod.js","./undo-2-BOUt5qks.js","./code-xml-n9mgGgkv.js","./message-square-plus-3wFslIMY.js","./UnifiedPage-CWXc_mo1.css","./RunLocationPicker-M1UoJyjf.js","./codeStudioStore-DXMQwRzG.js","./RightPanel-BgSeCLnw.js","./folder-plus-d5MwIMlf.js","./folder-CoOsfQ64.js","./pencil-CJsJD7M_.js","./phoneList-DrxIwJxQ.js","./phoneList-DvpzD3zT.css","./ModelPill-DveHcLqq.js","./ModelPill-CzdNh7Mt.css","./create-C19zqt5N.js","./create-BgE3edmZ.css","./approvalText-Cy2UAUAQ.js","./RunLocationPicker-CEmFio4n.css","./codingNavigation-CCjs1kon.js","./pdf.worker.min-CGb3BKV9.js","./zoom-in-BcuPvIYd.js","./InlineFiles-BIfsx3R-.js","./layout-grid-DFmwM9NU.js","./rotate-ccw-xgT_0UN9.js","./terminal-DPZazOQ2.js","./circle-x-Szwop5L_.js","./circle-question-mark-M8QUJJYk.js","./FloatingToc-ldOYWe2C.js","./codingNavigation-yp19w6uu.css","./hard-drive-Bh1DmZg0.js","./CapabilityMenu-CrsaTtDe.js","./CapabilityMenu-CTIzmTJB.css","./userSpaces-B_Njvel_.js","./automationListSource-1aOVKBLw.js","./messages-DEAGRsC3.js","./workflow-DY2Cnaei.js","./list-tree-i07HsP3D.js","./star-C9KTji9N.js","./DashboardGridView-tgaj9-SM.js","./pageTree-DZ7Eiro-.js","./pluginExt-Byb64tQO.js","./pen-tool-ChGmX6g_.js","./redo-2-CI57sDFr.js","./DashboardGridView-hpRmBr9B.css","./AutomationBuilder-C-IFaaBp.js","./gestures-CXFaEydn.js","./MuseView-3GL4Ltoj.js","./i18n.generated-BiQFRL2U.js","./i18n-DjziAw8r.css","./log-out-DK84lW5n.js","./index-CPLtf9Vc.js","./StudioGuestSurface-DlUKXBXv.js","./viewportLock-Bi3orrUs.css","./launchpad-C2c1MSVX.css","./mobileEntry-DS1vohuL.css","./main-D7CEGndC.js","./main-BiS_5wrB.css"])))=>i.map(i=>d[i]);
2
+ function Hd(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const r=Object.getOwnPropertyDescriptor(i,s);r&&Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();const qd="modulepreload",Wd=function(e,t){return new URL(e,t).href},zo={},dt=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");s=c(n.map(d=>{if(d=Wd(d,i),d in zo)return;zo[d]=!0;const u=d.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(i)for(let m=o.length-1;m>=0;m--){const p=o[m];if(p.href===d&&(!u||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${h}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":qd,u||(f.as="script"),f.crossOrigin="",f.href=d,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((m,p)=>{f.addEventListener("load",m),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return t().catch(r)})};let dr;function Vd(e){dr=e}function zi(e){return dr?`${e}:account:${encodeURIComponent(dr)}`:e}function Zd(e,t){try{const n=new URL(e);if(n.protocol!=="https:"&&n.protocol!=="http:")return null;const i=t.split(".")[1];if(!i)return null;const s=i.replace(/-/g,"+").replace(/_/g,"/"),r=Uint8Array.from(atob(s),l=>l.charCodeAt(0)),o=JSON.parse(new TextDecoder().decode(r)),a=o.userId??o.sub;return typeof a!="string"&&typeof a!="number"||!String(a).trim()?null:`${n.origin}${n.pathname.replace(/\/+$/,"")}::${String(a)}`}catch{return null}}const fr="forsion.cloudCacheAccount",Kd=e=>!e.includes(":account:")&&(e==="tangu2_named_layouts"||/^tangu2_layout_(?:v[34]|detached_.+)$/.test(e)||/^lcl_sc_(?:layout|named_layouts)_v1(?:_.+)?$/.test(e));function Al(){try{for(const e of Object.keys(localStorage))e.includes(":account:")||(e==="amadeus_tree_snap"||e==="amadeus.cloudVaultId"||e.startsWith("amadeus_last_page:")||e==="forsion.deskBySession"||e==="forsion_tangu_unread_sessions"||Kd(e))&&localStorage.removeItem(e);localStorage.removeItem(fr)}catch{}}function ni(e,t){return Zd(e,t)}function Yi(e,t){const n=ni(e,t);Vd(n??`anonymous:${Date.now()}:${Math.random().toString(36).slice(2)}`);try{(!n||localStorage.getItem(fr)!==n)&&Al(),n&&localStorage.setItem(fr,n)}catch{}}class an extends Error{constructor(){super("The account changed while the request was in progress"),this.name="AccountChangedError"}}class wi extends Error{constructor(t,n){super(n),this.status=t,this.name="AccountHttpError"}status}function Gd(e){const t=new URL(e.apiBase,typeof location>"u"?void 0:location.href);if(!/^https?:$/.test(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Invalid account API base");t.pathname=t.pathname.replace(/\/+$/,"")+"/";const n=t.href.replace(/\/$/,""),i=e.fetch??globalThis.fetch.bind(globalThis),s=e.tokenKey??"forsion_token",r=e.storage,o=new Set(e.onChange?[e.onChange]:[]),a=new Set(e.beforeChange?[e.beforeChange]:[]),l=new Set;let c=f(),d=null,u=0,h=Promise.resolve();function f(){if(!r)return"";try{return r.getItem(s)||""}catch{return""}}function m(){u++;for(const I of l)I.abort(new an);l.clear()}function p(){if(r){const I=f();I!==c&&(m(),c=I,d=null)}return c}function b(I){const y=p(),z=I===void 0?d?!0:null:I;return{loggedIn:!!y&&z!==!1,tokenValid:y?z:null,cloudUrl:n,tokenSource:y?"tangu-login":null,username:d?.username??null,accountId:d?`${n}::${d.userId}`:null,...d??{}}}function w(){const I=b();for(const y of o)try{y(I)}catch(z){console.error("[account] Change listener failed:",z)}}function T(I,y){if(p()!==y||u!==I)throw new an}function S(I){const y=h.then(I);return h=y.catch(()=>{}),y}const C=(e.allowedPaths??[]).map(I=>{const y=new URL(I,t);if(!I.startsWith("/")||I.startsWith("//")||I.includes("\\")||I.includes("%")||y.origin!==t.origin||y.search||y.hash||y.pathname!==I||I==="/")throw new Error("Invalid account request namespace");return I.replace(/\/+$/,"")}),$=(I,y)=>I===y||I.startsWith(y+"/"),v=I=>$(I,t.pathname.slice(0,-1))||C.some(y=>$(I,y));function A(I){const y=I.split(/[?#]/,1)[0];if(!I||I.startsWith("//")||y.includes("\\"))throw new Error("Request must stay inside the account API base");const z=C.some(X=>$(y,X)),W=/^[a-z][a-z\d+.-]*:/i.test(I)?new URL(I):new URL(z?I:I.replace(/^\//,""),t);let H;try{H=new URL(decodeURIComponent(W.pathname).replace(/\\/g,"/"),t.origin)}catch{throw new Error("Request must stay inside the account API base")}if(W.origin!==t.origin||W.username||W.password||W.hash||!v(W.pathname)||H.origin!==t.origin||!v(H.pathname))throw new Error("Request must stay inside the account API base");return W}const P=e.identityUrl?new URL(e.identityUrl,t):A("/auth/me");if(P.origin!==t.origin||P.username||P.password||P.hash)throw new Error("Identity endpoint must use the account API origin");function q(I,y,z,W){const H=I.body?.getReader();let X;const ne=()=>{X&&W.removeEventListener("abort",X),z()},pe=H?new ReadableStream({start(Ce){X=()=>{const De=W.reason??new an;Ce.error(De),H.cancel(De).catch(()=>{}),ne()},W.addEventListener("abort",X,{once:!0}),W.aborted&&X()},async pull(Ce){try{y();const De=await H.read();y(),De.done?(Ce.close(),ne()):Ce.enqueue(De.value)}catch(De){Ce.error(De),H.cancel(De).catch(()=>{}),ne()}},async cancel(Ce){ne(),await H.cancel(Ce)}},{highWaterMark:0}):null;H||z();const we=new Response(pe,{status:I.status,statusText:I.statusText,headers:I.headers});Object.defineProperties(we,{url:{value:I.url},redirected:{value:I.redirected},type:{value:I.type}});for(const Ce of["json","text","arrayBuffer","blob","formData"]){const De=we[Ce].bind(we);Object.defineProperty(we,Ce,{configurable:!0,value:async()=>{y();const Xt=await De();return y(),Xt}})}const qe=we.clone.bind(we);return Object.defineProperty(we,"clone",{value:()=>(y(),q(qe(),y,()=>{},W))}),we}async function R(I,y={},z=p()){const W=p(),H=u,X=new AbortController,ne=()=>{if(T(H,W),X.signal.aborted)throw X.signal.reason??new DOMException("The request was aborted","AbortError")},pe=()=>X.abort(y.signal?.reason);y.signal?.aborted?pe():y.signal?.addEventListener("abort",pe,{once:!0}),l.add(X);const we=()=>{l.delete(X),y.signal?.removeEventListener("abort",pe)},qe=new Headers(y.headers);qe.delete("Authorization"),z&&qe.set("Authorization",`Bearer ${z}`);try{ne();const Ce=await i(I.href,{...y,headers:qe,signal:X.signal,redirect:"error",credentials:"omit",cache:"no-store"});return ne(),q(Ce,ne,we,X.signal)}catch(Ce){throw we(),ne(),Ce}}function U(I,y){const z=new Headers(y?.headers).get("Authorization");if(z&&z!==`Bearer ${p()}`)throw new an;return R(A(I),y)}function B(I){const y=I,z=y?.userId??y?.id;if(typeof z!="string"&&typeof z!="number"||!String(z).trim()||typeof y.username!="string"||!y.username)throw new Error("The account endpoint returned an invalid identity");return{userId:String(z),username:y.username,role:typeof y.role=="string"?y.role:"user",...typeof y.tenantId=="string"?{tenantId:y.tenantId}:{},...typeof y.workspaceId=="string"?{workspaceId:y.workspaceId}:{},nickname:typeof y.nickname=="string"?y.nickname:null,avatar:typeof y.avatar=="string"?y.avatar:null,membershipTier:typeof y.membershipTier=="string"?y.membershipTier:null}}async function ee(I){const y=await R(P,{},I);if(!y.ok)throw y.body?.cancel(),new wi(y.status,"Could not verify the account session");return B(await y.json())}async function oe(){const I=p(),y=u;if(!I)return b();try{const z=await ee(I);return T(y,I),d=z,b(!0)}catch(z){if(T(y,I),z instanceof wi&&(z.status===401||z.status===403))return d=null,b(!1);if(z instanceof an)throw z;return b(null)}}async function te(){for(const I of a)await I()}function ue(I,y){r&&(I?r.setItem(s,I):r.removeItem(s)),m(),c=I,d=y,w()}async function fe(I){if(!I.trim())throw new Error("An account token is required");const y=p(),z=u,W=await ee(I);if(T(z,y),I===y)return d=W,b(!0);try{return await te(),T(z,y),ue(I,W),b(!0)}catch(H){throw w(),H}}function ye(I){return S(()=>fe(I))}function ce(I){return S(async()=>{const y=await R(A("/auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)},"");if(!y.ok)throw y.body?.cancel(),new wi(y.status,"Account sign-in failed");const z=await y.json();if(typeof z?.token!="string")throw new Error("Sign-in did not return an account token");return fe(z.token)})}function _(){const I=p(),y=u;return S(async()=>{T(y,I);const z=p(),W=u;if(z)try{await te(),T(W,z);const H=await U("/auth/logout",{method:"POST"});if(!H.ok&&H.status!==401)throw H.body?.cancel(),new wi(H.status,"Account sign-out failed; the session was retained");if(H.ok&&H.status!==204){if((await H.json())?.ok!==!0)throw new Error("Account sign-out was not acknowledged; the session was retained")}else H.body?.cancel();T(W,z),ue("",null)}catch(H){throw w(),H}})}function E(I={}){const y=typeof I=="string"?I:I.expectedToken??p(),z=typeof I=="string"||I.prepare!==!1;return S(async()=>{if(p()===y)try{z&&await te(),p()===y&&ue("",null)}catch(W){throw w(),W}})}return{getToken:p,getIdentity:()=>(p(),d?{...d}:null),get generation(){return p(),u},authStatus:oe,adoptToken:ye,signIn:ce,login:(I,y)=>ce({username:I,password:y}),logout:_,clearSession:E,request:U,subscribe(I){return o.add(I),()=>{o.delete(I)}},beforeChange(I){return a.add(I),()=>{a.delete(I)}}}}function Yd(e){const t=new URL(e.apiBase),n=t.pathname.replace(/\/+$/,"");return async(i,s)=>{const r=new URL(typeof i=="string"?i:i instanceof URL?i.href:i.url,location.href);if(!(r.origin===t.origin&&(r.pathname===n||r.pathname.startsWith(n+"/"))))return e.fallback(i,s);const a=e.getToken(),c=new Headers(s?.headers??(i instanceof Request?i.headers:void 0)).get("Authorization");if(c&&c!==`Bearer ${a}`)throw new an;let d=s;if(i instanceof Request){const u=new Request(i,s);d={method:u.method,headers:u.headers,signal:u.signal,body:u.body,...u.body?{duplex:"half"}:{}}}return e.request(r.href,d)}}const Tl="forsion_token";let ki;function xn(){if(!ki){let e;try{e=localStorage}catch{}ki=Gd({apiBase:_n(),storage:e,tokenKey:Tl,onChange:()=>Yi(_n(),ki?.getToken()||"")})}return ki}function un(){return xn().getToken()}function Wt(e,t=!1){const n=e??location.origin+"./";location.replace("/auth?redirect="+encodeURIComponent(n)+"&app=tangu-web"+(t?"&logout=1":""))}async function El(){const e=new URL(location.href),t=e.searchParams.get("token");if(!t)return!0;e.searchParams.delete("token"),history.replaceState(null,"",e.toString());try{return await xn().adoptToken(t),!0}catch{return Wt(void 0,!0),!1}}async function Jd(){if(!await El())return!1;const e=un();if(e){if((await xn().authStatus()).tokenValid!==!1)return Yi(_n(),e),!0;await xn().clearSession(e)}return Wt(location.origin+location.pathname),!1}function Mo(){return un()}function _n(){return(location.origin+"/api").replace(/\/$/,"")}function Il(){const e=xn(),t=e.getToken();e.clearSession({expectedToken:t,prepare:!1}).then(()=>{e.getToken()||(Al(),Wt(void 0,!0))}).catch(n=>console.error("[account] Could not leave the expired session:",n))}async function Qd(){if(!await El())return!1;const e=xn(),t=e.getToken();if(!t)return Wt(),!1;if((await e.authStatus()).tokenValid===!1)return await e.clearSession(t),Wt(void 0,!0),!1;const i=_n(),s=i;Yi(i,t);const r=window.fetch.bind(window),o=e.authStatus,a=(h="?")=>{const f=un();return f?`${h}token=${encodeURIComponent(f)}`:""},l=h=>{let f=!1;try{f=localStorage.getItem("lcl.uiMode")==="mobile"}catch{}f?location.href=h:window.open(h,"_blank","noopener")},c=async(h,f,m)=>{const p=un();if(!p)return{status:401,json:null};try{const b=await e.request(f,{method:h,headers:{Authorization:`Bearer ${p}`,...m!==void 0?{"Content-Type":"application/json"}:{}},body:m!==void 0?JSON.stringify(m):void 0});return{status:b.status,json:await b.json().catch(()=>null)}}catch(b){return{status:0,json:{detail:String(b?.message||b)}}}};window.tangu={cloudWeb:!0,getConfig:async()=>({mode:"external",backendUrl:s,token:un(),modelId:"",cloudUrl:i,cloudApiBase:i,sandbox:"none"}),authStatus:o,forsionLogin:async()=>{e.getToken()&&await e.logout(),Wt(void 0,!0)},forsionLogout:async()=>{await e.logout(),Wt(void 0,!0)},onAuthWillChange:e.beforeChange,onAuthChanged:e.subscribe,openAccountCenter:async h=>{const f=h&&/^[a-z0-9-]+$/i.test(h)?`#${h}`:"";return l(`/account/${a()}${f}`),{ok:!0}},openPayCenter:async()=>{const h=encodeURIComponent(location.origin+"/account/");return l(`/pay/?tab=membership${a("&")}&redirect=${h}`),{ok:!0}},accountQuota:()=>c("GET","/token-quota/my"),accountUseResetCard:h=>h!==void 0&&h!=="both"&&h!=="weekly"?Promise.resolve({status:400,json:{error:"invalid_type",detail:`invalid reset card type: ${h}`}}):c("POST","/token-quota/reset-card/use",{type:h??"both"})};const u=new URL(i).pathname.replace(/\/+$/,"");return window.fetch=Yd({apiBase:i,getToken:e.getToken,fallback:r,request:async(h,f)=>{const m=e.getToken(),p=e.generation,b=await e.request(h,f),w=new URL(h);return m===e.getToken()&&p===e.generation&&b.status===401&&(w.pathname.startsWith(u+"/agent/")||w.pathname.startsWith(u+"/amadeus/"))&&Il(),b}}),window.addEventListener("storage",h=>{h.key!==Tl||h.oldValue===h.newValue||(Yi(i,un()),location.reload())}),!0}const Xd="amadeus.page/3",ef="3.0.0";let tf=e=>crypto.getRandomValues(new Uint8Array(e)),nf=(e,t,n)=>{let i=256-256%e.length;if(i===256){let r=e.length-1;return(o=t)=>{if(!o)return"";let a="";for(;;){let l=n(o),c=o;for(;c--;)if(a+=e[l[c]&r],a.length>=o)return a}}}let s=Math.ceil(1.6*256*t/i);return(r=t)=>{if(!r)return"";let o="";for(;;){let a=n(s),l=s;for(;l--;)if(a[l]<i&&(o+=e[a[l]%e.length],o.length>=r))return o}}},sf=(e,t=21)=>nf(e,t|0,tf);const rf="0123456789abcdefghijklmnopqrstuvwxyz",Hr=sf(rf,8);function Ji(e,t=1){let n=0;for(const i of e){const s=Number.parseInt(String(i),10);Number.isSafeInteger(s)&&String(s)===String(i)&&s>n&&(n=s)}return String(Math.max(n+1,t))}function of(e,t){const n=Number.parseInt(String(t),10);return!Number.isSafeInteger(n)||String(n)!==String(t)?e:Math.max(e??0,n+1)}function Pl(){return`pg_${Hr()}`}function af(){return`row_${Hr()}`}function lf(){return`col_${Hr()}`}function Ol(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>0?t.slice(0,n):t}function $l(e){return e.split(/[\\/]/).pop()??e}const cf=/^<!--\s*a\s+([A-Za-z0-9_-]+)\s*-->\s*$/,uf=/^<!--\s*\/a\s+([A-Za-z0-9_-]+)\s*-->\s*$/;function jo(e){return`<!-- a ${e} -->`}function Rl(e){const t=[];let n=null,i=[];const s=()=>{const r=i.join(`
3
+ `).replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd();(n!==null||r)&&t.push({id:n,content:r}),i=[]};for(const r of e.split(`
4
+ `)){const o=cf.exec(r);if(o)s(),n=o[1];else{const a=uf.exec(r);a&&n!==null&&a[1]===n?(s(),n=null):i.push(r)}}return s(),t}var Bo;function D(e,t,n){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=o.prototype,d=Object.keys(c);for(let u=0;u<d.length;u++){const h=d[u];h in a||(a[h]=c[h].bind(a))}}const s=n?.Parent??Object;class r extends s{}Object.defineProperty(r,"name",{value:e});function o(a){var l;const c=n?.Parent?new r:this;i(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class yn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Nl extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Bo=globalThis).__zod_globalConfig??(Bo.__zod_globalConfig={});const qr=globalThis.__zod_globalConfig;function Et(e){return qr}function Ll(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,s])=>t.indexOf(+i)===-1).map(([i,s])=>s)}function hr(e,t){return typeof t=="bigint"?t.toString():t}function Wr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Vr(e){return e==null}function Zr(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function df(e,t){const n=e/t,i=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<s?0:n-i}const Uo=Symbol("evaluating");function me(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==Uo)return i===void 0&&(i=Uo,i=n()),i},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Qt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Dt(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function Ho(e){return JSON.stringify(e)}function ff(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Fl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const hf=Wr(()=>{if(qr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Cn(e){if(Qi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Qi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Dl(e){return Cn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const pf=new Set(["string","number","symbol"]);function An(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zt(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function J(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function mf(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const gf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function bf(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const r=Dt(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Qt(this,"shape",o),o},checks:[]});return zt(e,r)}function yf(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=Dt(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Qt(this,"shape",o),o},checks:[]});return zt(e,r)}function wf(e,t){if(!Cn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const r=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Dt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Qt(this,"shape",r),r}});return zt(e,s)}function kf(e,t){if(!Cn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Dt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Qt(this,"shape",i),i}});return zt(e,n)}function vf(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Dt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Qt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return zt(e,n)}function Sf(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Dt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Qt(this,"shape",l),l},checks:[]});return zt(t,o)}function xf(e,t,n){const i=Dt(t._zod.def,{get shape(){const s=t._zod.def.shape,r={...s};if(n)for(const o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)r[o]=new e({type:"nonoptional",innerType:s[o]});return Qt(this,"shape",r),r}});return zt(t,i)}function dn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function _f(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function fn(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function vi(e){return typeof e=="string"?e:e?.message}function It(e,t,n){const i=e.message?e.message:vi(e.inst?._zod.def?.error?.(e))??vi(t?.error?.(e))??vi(n.customError?.(e))??vi(n.localeError?.(e))??"Invalid input",{inst:s,continue:r,input:o,...a}=e;return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=o),a}function Kr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ii(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const zl=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,hr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ml=D("$ZodError",zl),jl=D("$ZodError",zl,{Parent:Error});function Cf(e,t=n=>n.message){const n={},i=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):i.push(t(s));return{formErrors:i,fieldErrors:n}}function Af(e,t=n=>n.message){const n={_errors:[]},i=(s,r=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a},[...r,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...r,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...r,...o.path]);else{const a=[...r,...o.path];if(a.length===0)n._errors.push(t(o));else{let l=n,c=0;for(;c<a.length;){const d=a[c];c===a.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}}};return i(e),n}const Gr=e=>(t,n,i,s)=>{const r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new yn;if(o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>It(l,r,Et())));throw Fl(a,s?.callee),a}return o.value},Yr=e=>async(t,n,i,s)=>{const r=i?{...i,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>It(l,r,Et())));throw Fl(a,s?.callee),a}return o.value},fs=e=>(t,n,i)=>{const s=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new yn;return r.issues.length?{success:!1,error:new(e??Ml)(r.issues.map(o=>It(o,s,Et())))}:{success:!0,data:r.value}},Tf=fs(jl),hs=e=>async(t,n,i)=>{const s=i?{...i,async:!0}:{async:!0};let r=t._zod.run({value:n,issues:[]},s);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(o=>It(o,s,Et())))}:{success:!0,data:r.value}},Ef=hs(jl),If=e=>(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return Gr(e)(t,n,s)},Pf=e=>(t,n,i)=>Gr(e)(t,n,i),Of=e=>async(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return Yr(e)(t,n,s)},$f=e=>async(t,n,i)=>Yr(e)(t,n,i),Rf=e=>(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return fs(e)(t,n,s)},Nf=e=>(t,n,i)=>fs(e)(t,n,i),Lf=e=>async(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return hs(e)(t,n,s)},Ff=e=>async(t,n,i)=>hs(e)(t,n,i),Df=/^[cC][0-9a-z]{6,}$/,zf=/^[0-9a-z]+$/,Mf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jf=/^[0-9a-vA-V]{20}$/,Bf=/^[A-Za-z0-9]{27}$/,Uf=/^[a-zA-Z0-9_-]{21}$/,Hf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qf=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qo=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Wf=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Zf(){return new RegExp(Vf,"u")}const Kf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Yf=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Jf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bl=/^[A-Za-z0-9_-]*$/,Xf=/^https?$/,eh=/^\+[1-9]\d{6,14}$/,Ul="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",th=new RegExp(`^${Ul}$`);function Hl(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nh(e){return new RegExp(`^${Hl(e)}$`)}function ih(e){const t=Hl({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Ul}T(?:${i})$`)}const sh=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},rh=/^-?\d+$/,ql=/^-?\d+(?:\.\d+)?$/,oh=/^(?:true|false)$/i,ah=/^null$/i,lh=/^[^A-Z]*$/,ch=/^[^a-z]*$/,Ze=D("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wl={number:"number",bigint:"bigint",object:"date"},Vl=D("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);const n=Wl[typeof t.value];e._zod.onattach.push(i=>{const s=i._zod.bag,r=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zl=D("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);const n=Wl[typeof t.value];e._zod.onattach.push(i=>{const s=i._zod.bag,r=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),uh=D("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):df(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dh=D("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[s,r]=gf[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=s,a.maximum=r,n&&(a.pattern=rh)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>r&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),fh=D("$ZodCheckMaxLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Vr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const s=i.value;if(s.length<=t.maximum)return;const o=Kr(s);i.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),hh=D("$ZodCheckMinLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Vr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const s=i.value;if(s.length>=t.minimum)return;const o=Kr(s);i.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ph=D("$ZodCheckLengthEquals",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Vr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=i=>{const s=i.value,r=s.length;if(r===t.length)return;const o=Kr(s),a=r>t.length;i.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),ps=D("$ZodCheckStringFormat",(e,t)=>{var n,i;Ze.init(e,t),e._zod.onattach.push(s=>{const r=s._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),mh=D("$ZodCheckRegex",(e,t)=>{ps.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gh=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=lh),ps.init(e,t)}),bh=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ch),ps.init(e,t)}),yh=D("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);const n=An(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(s=>{const r=s._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),wh=D("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);const n=new RegExp(`^${An(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),kh=D("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);const n=new RegExp(`.*${An(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),vh=D("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Sh{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
5
+ `).filter(o=>o),s=Math.min(...i.map(o=>o.length-o.trimStart().length)),r=i.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of r)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(r=>` ${r}`)];return new t(...n,s.join(`
6
+ `))}}const xh={major:4,minor:4,patch:3},ke=D("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xh;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const s of i)for(const r of s._zod.onattach)r(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,a,l)=>{let c=dn(o),d;for(const u of a){if(u._zod.def.when){if(_f(o)||!u._zod.def.when(o))continue}else if(c)continue;const h=o.issues.length,f=u._zod.check(o);if(f instanceof Promise&&l?.async===!1)throw new yn;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,o.issues.length!==h&&(c||(c=dn(o,h)))});else{if(o.issues.length===h)continue;c||(c=dn(o,h))}}return d?d.then(()=>o):o},r=(o,a,l)=>{if(dn(o))return o.aborted=!0,o;const c=s(a,i,l);if(c instanceof Promise){if(l.async===!1)throw new yn;return c.then(d=>e._zod.parse(d,l))}return e._zod.parse(c,l)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const c=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>r(d,o,a)):r(c,o,a)}const l=e._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new yn;return l.then(c=>s(c,i,a))}return s(l,i,a)}}me(e,"~standard",()=>({validate:s=>{try{const r=Tf(e,s);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return Ef(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Jr=D("$ZodString",(e,t)=>{ke.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sh(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ve=D("$ZodStringFormat",(e,t)=>{ps.init(e,t),Jr.init(e,t)}),_h=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qf),ve.init(e,t)}),Ch=D("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=qo(i))}else t.pattern??(t.pattern=qo());ve.init(e,t)}),Ah=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wf),ve.init(e,t)}),Th=D("$ZodURL",(e,t)=>{ve.init(e,t),e._zod.check=n=>{try{const i=n.value.trim();if(!t.normalize&&t.protocol?.source===Xf.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Eh=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Zf()),ve.init(e,t)}),Ih=D("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Uf),ve.init(e,t)}),Ph=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Df),ve.init(e,t)}),Oh=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zf),ve.init(e,t)}),$h=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Mf),ve.init(e,t)}),Rh=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=jf),ve.init(e,t)}),Nh=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Bf),ve.init(e,t)}),Lh=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ih(t)),ve.init(e,t)}),Fh=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=th),ve.init(e,t)}),Dh=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=nh(t)),ve.init(e,t)}),zh=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hf),ve.init(e,t)}),Mh=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Kf),ve.init(e,t),e._zod.bag.format="ipv4"}),jh=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Gf),ve.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Bh=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Yf),ve.init(e,t)}),Uh=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Jf),ve.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[s,r]=i;if(!r)throw new Error;const o=Number(r);if(`${o}`!==r)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Kl(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Hh=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qf),ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Kl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function qh(e){if(!Bl.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Kl(n)}const Wh=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Bl),ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{qh(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Vh=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=eh),ve.init(e,t)});function Zh(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const s=JSON.parse(atob(i));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Kh=D("$ZodJWT",(e,t)=>{ve.init(e,t),e._zod.check=n=>{Zh(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Gl=D("$ZodNumber",(e,t)=>{ke.init(e,t),e._zod.pattern=e._zod.bag.pattern??ql,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const r=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...r?{received:r}:{}}),n}}),Gh=D("$ZodNumberFormat",(e,t)=>{dh.init(e,t),Gl.init(e,t)}),Yh=D("$ZodBoolean",(e,t)=>{ke.init(e,t),e._zod.pattern=oh,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Jh=D("$ZodNull",(e,t)=>{ke.init(e,t),e._zod.pattern=ah,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),Qh=D("$ZodUnknown",(e,t)=>{ke.init(e,t),e._zod.parse=n=>n}),Xh=D("$ZodNever",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Wo(e,t,n){e.issues.length&&t.issues.push(...fn(n,e.issues)),t.value[n]=e.value}const ep=D("$ZodArray",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const r=[];for(let o=0;o<s.length;o++){const a=s[o],l=t.element._zod.run({value:a,issues:[]},i);l instanceof Promise?r.push(l.then(c=>Wo(c,n,o))):Wo(l,n,o)}return r.length?Promise.all(r).then(()=>n):n}});function Xi(e,t,n,i,s,r){const o=n in i;if(e.issues.length){if(s&&r&&!o)return;t.issues.push(...fn(n,e.issues))}if(!o&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Yl(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=mf(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Jl(e,t,n,i,s,r){const o=[],a=s.keySet,l=s.catchall._zod,c=l.def.type,d=l.optin==="optional",u=l.optout==="optional";for(const h in t){if(h==="__proto__"||a.has(h))continue;if(c==="never"){o.push(h);continue}const f=l.run({value:t[h],issues:[]},i);f instanceof Promise?e.push(f.then(m=>Xi(m,n,h,t,d,u))):Xi(f,n,h,t,d,u)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:r}),e.length?Promise.all(e).then(()=>n):n}const tp=D("$ZodObject",(e,t)=>{if(ke.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const i=Wr(()=>Yl(t));me(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const u of d.values)l[c].add(u)}}return l});const s=Qi,r=t.catchall;let o;e._zod.parse=(a,l)=>{o??(o=i.value);const c=a.value;if(!s(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const d=[],u=o.shape;for(const h of o.keys){const f=u[h],m=f._zod.optin==="optional",p=f._zod.optout==="optional",b=f._zod.run({value:c[h],issues:[]},l);b instanceof Promise?d.push(b.then(w=>Xi(w,a,h,c,m,p))):Xi(b,a,h,c,m,p)}return r?Jl(d,c,a,l,i.value,e):d.length?Promise.all(d).then(()=>a):a}}),np=D("$ZodObjectJIT",(e,t)=>{tp.init(e,t);const n=e._zod.parse,i=Wr(()=>Yl(t)),s=h=>{const f=new Sh(["shape","payload","ctx"]),m=i.value,p=S=>{const C=Ho(S);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};f.write("const input = payload.value;");const b=Object.create(null);let w=0;for(const S of m.keys)b[S]=`key_${w++}`;f.write("const newResult = {};");for(const S of m.keys){const C=b[S],$=Ho(S),v=h[S],A=v?._zod?.optin==="optional",P=v?._zod?.optout==="optional";f.write(`const ${C} = ${p(S)};`),A&&P?f.write(`
7
+ if (${C}.issues.length) {
8
+ if (${$} in input) {
9
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
10
+ ...iss,
11
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
12
+ })));
13
+ }
14
+ }
15
+
16
+ if (${C}.value === undefined) {
17
+ if (${$} in input) {
18
+ newResult[${$}] = undefined;
19
+ }
20
+ } else {
21
+ newResult[${$}] = ${C}.value;
22
+ }
23
+
24
+ `):A?f.write(`
25
+ if (${C}.issues.length) {
26
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
27
+ ...iss,
28
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
29
+ })));
30
+ }
31
+
32
+ if (${C}.value === undefined) {
33
+ if (${$} in input) {
34
+ newResult[${$}] = undefined;
35
+ }
36
+ } else {
37
+ newResult[${$}] = ${C}.value;
38
+ }
39
+
40
+ `):f.write(`
41
+ const ${C}_present = ${$} in input;
42
+ if (${C}.issues.length) {
43
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
44
+ ...iss,
45
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
46
+ })));
47
+ }
48
+ if (!${C}_present && !${C}.issues.length) {
49
+ payload.issues.push({
50
+ code: "invalid_type",
51
+ expected: "nonoptional",
52
+ input: undefined,
53
+ path: [${$}]
54
+ });
55
+ }
56
+
57
+ if (${C}_present) {
58
+ if (${C}.value === undefined) {
59
+ newResult[${$}] = undefined;
60
+ } else {
61
+ newResult[${$}] = ${C}.value;
62
+ }
63
+ }
64
+
65
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");const T=f.compile();return(S,C)=>T(h,S,C)};let r;const o=Qi,a=!qr.jitless,c=a&&hf.value,d=t.catchall;let u;e._zod.parse=(h,f)=>{u??(u=i.value);const m=h.value;return o(m)?a&&c&&f?.async===!1&&f.jitless!==!0?(r||(r=s(t.shape)),h=r(h,f),d?Jl([],m,h,f,u,e):h):n(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function Vo(e,t,n,i){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const s=e.filter(r=>!dn(r));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(o=>It(o,i,Et())))}),t)}const ip=D("$ZodUnion",(e,t)=>{ke.init(e,t),me(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),me(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),me(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),me(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Zr(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,s)=>{if(n)return n(i,s);let r=!1;const o=[];for(const a of t.options){const l=a._zod.run({value:i.value,issues:[]},s);if(l instanceof Promise)o.push(l),r=!0;else{if(l.issues.length===0)return l;o.push(l)}}return r?Promise.all(o).then(a=>Vo(a,i,e,s)):Vo(o,i,e,s)}}),sp=D("$ZodIntersection",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value,r=t.left._zod.run({value:s,issues:[]},i),o=t.right._zod.run({value:s,issues:[]},i);return r instanceof Promise||o instanceof Promise?Promise.all([r,o]).then(([l,c])=>Zo(n,l,c)):Zo(n,r,o)}});function pr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Cn(e)&&Cn(t)){const n=Object.keys(t),i=Object.keys(e).filter(r=>n.indexOf(r)!==-1),s={...e,...t};for(const r of i){const o=pr(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};s[r]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const s=e[i],r=t[i],o=pr(s,r);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zo(e,t,n){const i=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const l of a.keys)i.has(l)||i.set(l,{}),i.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)i.has(l)||i.set(l,{}),i.get(l).r=!0;else e.issues.push(a);const r=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(r.length&&s&&e.issues.push({...s,keys:r}),dn(e))return e;const o=pr(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const rp=D("$ZodRecord",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value;if(!Cn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const r=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const d=t.keyType._zod.run({value:c,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>It(f,i,Et())),input:c,path:[c],inst:e});continue}const u=d.value,h=t.valueType._zod.run({value:s[c],issues:[]},i);h instanceof Promise?r.push(h.then(f=>{f.issues.length&&n.issues.push(...fn(c,f.issues)),n.value[u]=f.value})):(h.issues.length&&n.issues.push(...fn(c,h.issues)),n.value[u]=h.value)}let l;for(const c in s)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ql.test(a)&&l.issues.length){const u=t.keyType._zod.run({value:Number(a),issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");u.issues.length===0&&(l=u)}if(l.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>It(u,i,Et())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:s[a],issues:[]},i);d instanceof Promise?r.push(d.then(u=>{u.issues.length&&n.issues.push(...fn(a,u.issues)),n.value[l.value]=u.value})):(d.issues.length&&n.issues.push(...fn(a,d.issues)),n.value[l.value]=d.value)}}return r.length?Promise.all(r).then(()=>n):n}}),op=D("$ZodEnum",(e,t)=>{ke.init(e,t);const n=Ll(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(s=>pf.has(typeof s)).map(s=>typeof s=="string"?An(s):s.toString()).join("|")})$`),e._zod.parse=(s,r)=>{const o=s.value;return i.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),ap=D("$ZodLiteral",(e,t)=>{if(ke.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?An(i):i?An(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,s)=>{const r=i.value;return n.has(r)||i.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),i}}),lp=D("$ZodTransform",(e,t)=>{ke.init(e,t),e._zod.optin="optional",e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Nl(e.constructor.name);const s=t.transform(n.value,n);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n.fallback=!0,n));if(s instanceof Promise)throw new yn;return n.value=s,n.fallback=!0,n}});function Ko(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ql=D("$ZodOptional",(e,t)=>{ke.init(e,t),e._zod.optin="optional",e._zod.optout="optional",me(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),me(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zr(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Ko(o,s)):Ko(r,s)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),cp=D("$ZodExactOptional",(e,t)=>{Ql.init(e,t),me(e._zod,"values",()=>t.innerType._zod.values),me(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),up=D("$ZodNullable",(e,t)=>{ke.init(e,t),me(e._zod,"optin",()=>t.innerType._zod.optin),me(e._zod,"optout",()=>t.innerType._zod.optout),me(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zr(n.source)}|null)$`):void 0}),me(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),dp=D("$ZodDefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",me(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>Go(r,t)):Go(s,t)}});function Go(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const fp=D("$ZodPrefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",me(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),hp=D("$ZodNonOptional",(e,t)=>{ke.init(e,t),me(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>Yo(r,e)):Yo(s,e)}});function Yo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const pp=D("$ZodCatch",(e,t)=>{ke.init(e,t),e._zod.optin="optional",me(e._zod,"optout",()=>t.innerType._zod.optout),me(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(o=>It(o,i,Et()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>It(r,i,Et()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),mp=D("$ZodPipe",(e,t)=>{ke.init(e,t),me(e._zod,"values",()=>t.in._zod.values),me(e._zod,"optin",()=>t.in._zod.optin),me(e._zod,"optout",()=>t.out._zod.optout),me(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const r=t.out._zod.run(n,i);return r instanceof Promise?r.then(o=>Si(o,t.in,i)):Si(r,t.in,i)}const s=t.in._zod.run(n,i);return s instanceof Promise?s.then(r=>Si(r,t.out,i)):Si(s,t.out,i)}});function Si(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const gp=D("$ZodReadonly",(e,t)=>{ke.init(e,t),me(e._zod,"propValues",()=>t.innerType._zod.propValues),me(e._zod,"values",()=>t.innerType._zod.values),me(e._zod,"optin",()=>t.innerType?._zod?.optin),me(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(Jo):Jo(s)}});function Jo(e){return e.value=Object.freeze(e.value),e}const bp=D("$ZodCustom",(e,t)=>{Ze.init(e,t),ke.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,s=t.fn(i);if(s instanceof Promise)return s.then(r=>Qo(r,n,i,e));Qo(s,n,i,e)}});function Qo(e,t,n,i){if(!e){const s={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(s.params=i._zod.def.params),t.issues.push(ii(s))}}var Xo;class yp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const s={...i,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function wp(){return new yp}(Xo=globalThis).__zod_globalRegistry??(Xo.__zod_globalRegistry=wp());const Zn=globalThis.__zod_globalRegistry;function kp(e,t){return new e({type:"string",...J(t)})}function vp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...J(t)})}function ea(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...J(t)})}function Sp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...J(t)})}function xp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J(t)})}function _p(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J(t)})}function Cp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J(t)})}function Ap(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...J(t)})}function Tp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...J(t)})}function Ep(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...J(t)})}function Ip(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...J(t)})}function Pp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...J(t)})}function Op(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...J(t)})}function $p(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...J(t)})}function Rp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...J(t)})}function Np(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...J(t)})}function Lp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...J(t)})}function Fp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J(t)})}function Dp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J(t)})}function zp(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...J(t)})}function Mp(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...J(t)})}function jp(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...J(t)})}function Bp(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...J(t)})}function Up(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J(t)})}function Hp(e,t){return new e({type:"string",format:"date",check:"string_format",...J(t)})}function qp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...J(t)})}function Wp(e,t){return new e({type:"string",format:"duration",check:"string_format",...J(t)})}function Vp(e,t){return new e({type:"number",checks:[],...J(t)})}function Zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...J(t)})}function Kp(e,t){return new e({type:"boolean",...J(t)})}function Gp(e,t){return new e({type:"null",...J(t)})}function Yp(e){return new e({type:"unknown"})}function Jp(e,t){return new e({type:"never",...J(t)})}function ta(e,t){return new Vl({check:"less_than",...J(t),value:e,inclusive:!1})}function Ns(e,t){return new Vl({check:"less_than",...J(t),value:e,inclusive:!0})}function na(e,t){return new Zl({check:"greater_than",...J(t),value:e,inclusive:!1})}function Ls(e,t){return new Zl({check:"greater_than",...J(t),value:e,inclusive:!0})}function ia(e,t){return new uh({check:"multiple_of",...J(t),value:e})}function Xl(e,t){return new fh({check:"max_length",...J(t),maximum:e})}function es(e,t){return new hh({check:"min_length",...J(t),minimum:e})}function ec(e,t){return new ph({check:"length_equals",...J(t),length:e})}function Qp(e,t){return new mh({check:"string_format",format:"regex",...J(t),pattern:e})}function Xp(e){return new gh({check:"string_format",format:"lowercase",...J(e)})}function em(e){return new bh({check:"string_format",format:"uppercase",...J(e)})}function tm(e,t){return new yh({check:"string_format",format:"includes",...J(t),includes:e})}function nm(e,t){return new wh({check:"string_format",format:"starts_with",...J(t),prefix:e})}function im(e,t){return new kh({check:"string_format",format:"ends_with",...J(t),suffix:e})}function Pn(e){return new vh({check:"overwrite",tx:e})}function sm(e){return Pn(t=>t.normalize(e))}function rm(){return Pn(e=>e.trim())}function om(){return Pn(e=>e.toLowerCase())}function am(){return Pn(e=>e.toUpperCase())}function lm(){return Pn(e=>ff(e))}function cm(e,t,n){return new e({type:"array",element:t,...J(n)})}function um(e,t,n){return new e({type:"custom",check:"custom",fn:t,...J(n)})}function dm(e,t){const n=fm(i=>(i.addIssue=s=>{if(typeof s=="string")i.issues.push(ii(s,i.value,n._zod.def));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),i.issues.push(ii(r))}},e(i.value,i)),t);return n}function fm(e,t){const n=new Ze({check:"custom",...J(t)});return n._zod.check=e,n}function tc(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Zn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Oe(e,t,n={path:[],schemaPath:[]}){var i;const s=e._zod.def,r=t.seen.get(e);if(r)return r.count++,n.schemaPath.includes(e)&&(r.cycle=n.path),r.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,d);else{const h=o.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,h,d)}const u=e._zod.parent;u&&(o.ref||(o.ref=u),Oe(u,t,d),t.seen.get(u).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&ze(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function nc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const l=i.get(a);if(l&&l!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,o[0])}}const s=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const u=e.external.registry.get(o[0])?.id,h=e.external.uri??(m=>m);if(u)return{ref:h(u)};const f=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=f,{defId:f,ref:`${h("__shared")}#/${a}/${f}`}}if(o[1]===n)return{ref:"#"};const c=`#/${a}/`,d=o[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:c+d}},r=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:l,defId:c}=s(o);a.def={...a.schema},c&&(a.defId=c);const d=a.schema;for(const u in d)delete d[u];d.$ref=l};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
66
+
67
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){r(o);continue}if(e.external){const c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){r(o);continue}}if(e.metadataRegistry.get(o[0])?.id){r(o);continue}if(a.cycle){r(o);continue}if(a.count>1&&e.reused==="ref"){r(o);continue}}}function ic(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=a=>{const l=e.seen.get(a);if(l.ref===null)return;const c=l.def??l.schema,d={...c},u=l.ref;if(l.ref=null,u){i(u);const f=e.seen.get(u),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,d),a._zod.parent===u)for(const b in c)b==="$ref"||b==="allOf"||b in d||delete c[b];if(m.$ref&&f.def)for(const b in c)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(c[b])===JSON.stringify(f.def[b])&&delete c[b]}const h=a._zod.parent;if(h&&h!==u){i(h);const f=e.seen.get(h);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}e.override({zodSchema:a,jsonSchema:c,path:l.path??[]})};for(const a of[...e.seen.entries()].reverse())i(a[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(a)}Object.assign(s,n.def??n.schema);const r=e.metadataRegistry.get(t)?.id;r!==void 0&&s.id===r&&delete s.id;const o=e.external?.defs??{};for(const a of e.seen.entries()){const l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const a=JSON.parse(JSON.stringify(s));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:ts(t,"input",e.processors),output:ts(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ze(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ze(i.element,n);if(i.type==="set")return ze(i.valueType,n);if(i.type==="lazy")return ze(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ze(i.innerType,n);if(i.type==="intersection")return ze(i.left,n)||ze(i.right,n);if(i.type==="record"||i.type==="map")return ze(i.keyType,n)||ze(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ze(i.in,n)||ze(i.out,n);if(i.type==="object"){for(const s in i.shape)if(ze(i.shape[s],n))return!0;return!1}if(i.type==="union"){for(const s of i.options)if(ze(s,n))return!0;return!1}if(i.type==="tuple"){for(const s of i.items)if(ze(s,n))return!0;return!!(i.rest&&ze(i.rest,n))}return!1}const hm=(e,t={})=>n=>{const i=tc({...n,processors:t});return Oe(e,i),nc(i,e),ic(i,e)},ts=(e,t,n={})=>i=>{const{libraryOptions:s,target:r}=i??{},o=tc({...s??{},target:r,io:t,processors:n});return Oe(e,o),nc(o,e),ic(o,e)},pm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mm=(e,t,n,i)=>{const s=n;s.type="string";const{minimum:r,maximum:o,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof r=="number"&&(s.minLength=r),typeof o=="number"&&(s.maxLength=o),a&&(s.format=pm[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const d=[...l];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},gm=(e,t,n,i)=>{const s=n,{minimum:r,maximum:o,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number";const u=typeof d=="number"&&d>=(r??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";u?f?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof r=="number"&&(s.minimum=r),h?f?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),typeof l=="number"&&(s.multipleOf=l)},bm=(e,t,n,i)=>{n.type="boolean"},ym=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},wm=(e,t,n,i)=>{n.not={}},km=(e,t,n,i)=>{},vm=(e,t,n,i)=>{const s=e._zod.def,r=Ll(s.entries);r.every(o=>typeof o=="number")&&(n.type="number"),r.every(o=>typeof o=="string")&&(n.type="string"),n.enum=r},Sm=(e,t,n,i)=>{const s=e._zod.def,r=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(o))}else r.push(o);if(r.length!==0)if(r.length===1){const o=r[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else r.every(o=>typeof o=="number")&&(n.type="number"),r.every(o=>typeof o=="string")&&(n.type="string"),r.every(o=>typeof o=="boolean")&&(n.type="boolean"),r.every(o=>o===null)&&(n.type="null"),n.enum=r},xm=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_m=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Cm=(e,t,n,i)=>{const s=n,r=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Oe(r.element,t,{...i,path:[...i.path,"items"]})},Am=(e,t,n,i)=>{const s=n,r=e._zod.def;s.type="object",s.properties={};const o=r.shape;for(const c in o)s.properties[c]=Oe(o[c],t,{...i,path:[...i.path,"properties",c]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(c=>{const d=r.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(s.required=Array.from(l)),r.catchall?._zod.def.type==="never"?s.additionalProperties=!1:r.catchall?r.catchall&&(s.additionalProperties=Oe(r.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Tm=(e,t,n,i)=>{const s=e._zod.def,r=s.inclusive===!1,o=s.options.map((a,l)=>Oe(a,t,{...i,path:[...i.path,r?"oneOf":"anyOf",l]}));r?n.oneOf=o:n.anyOf=o},Em=(e,t,n,i)=>{const s=e._zod.def,r=Oe(s.left,t,{...i,path:[...i.path,"allOf",0]}),o=Oe(s.right,t,{...i,path:[...i.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(r)?r.allOf:[r],...a(o)?o.allOf:[o]];n.allOf=l},Im=(e,t,n,i)=>{const s=n,r=e._zod.def;s.type="object";const o=r.keyType,l=o._zod.bag?.patterns;if(r.mode==="loose"&&l&&l.size>0){const d=Oe(r.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});s.patternProperties={};for(const u of l)s.patternProperties[u.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Oe(r.keyType,t,{...i,path:[...i.path,"propertyNames"]})),s.additionalProperties=Oe(r.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const c=o._zod.values;if(c){const d=[...c].filter(u=>typeof u=="string"||typeof u=="number");d.length>0&&(s.required=d)}},Pm=(e,t,n,i)=>{const s=e._zod.def,r=Oe(s.innerType,t,i),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[r,{type:"null"}]},Om=(e,t,n,i)=>{const s=e._zod.def;Oe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType},$m=(e,t,n,i)=>{const s=e._zod.def;Oe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},Rm=(e,t,n,i)=>{const s=e._zod.def;Oe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Nm=(e,t,n,i)=>{const s=e._zod.def;Oe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},Lm=(e,t,n,i)=>{const s=e._zod.def,r=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?r?s.out:s.in:s.out;Oe(o,t,i);const a=t.seen.get(e);a.ref=o},Fm=(e,t,n,i)=>{const s=e._zod.def;Oe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,n.readOnly=!0},sc=(e,t,n,i)=>{const s=e._zod.def;Oe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType},Dm=D("ZodISODateTime",(e,t)=>{Lh.init(e,t),xe.init(e,t)});function zm(e){return Up(Dm,e)}const Mm=D("ZodISODate",(e,t)=>{Fh.init(e,t),xe.init(e,t)});function jm(e){return Hp(Mm,e)}const Bm=D("ZodISOTime",(e,t)=>{Dh.init(e,t),xe.init(e,t)});function Um(e){return qp(Bm,e)}const Hm=D("ZodISODuration",(e,t)=>{zh.init(e,t),xe.init(e,t)});function qm(e){return Wp(Hm,e)}const Wm=(e,t)=>{Ml.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Af(e,n)},flatten:{value:n=>Cf(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,hr,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,hr,2)}},isEmpty:{get(){return e.issues.length===0}}})},lt=D("ZodError",Wm,{Parent:Error}),Vm=Gr(lt),Zm=Yr(lt),Km=fs(lt),Gm=hs(lt),Ym=If(lt),Jm=Pf(lt),Qm=Of(lt),Xm=$f(lt),eg=Rf(lt),tg=Nf(lt),ng=Lf(lt),ig=Ff(lt),sa=new WeakMap;function ai(e,t,n){const i=Object.getPrototypeOf(e);let s=sa.get(i);if(s||(s=new Set,sa.set(i,s)),!s.has(t)){s.add(t);for(const r in n){const o=n[r];Object.defineProperty(i,r,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Se=D("ZodType",(e,t)=>(ke.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ts(e,"input"),output:ts(e,"output")}}),e.toJSONSchema=hm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,i)=>Vm(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>Km(e,n,i),e.parseAsync=async(n,i)=>Zm(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>Gm(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>Ym(e,n,i),e.decode=(n,i)=>Jm(e,n,i),e.encodeAsync=async(n,i)=>Qm(e,n,i),e.decodeAsync=async(n,i)=>Xm(e,n,i),e.safeEncode=(n,i)=>eg(e,n,i),e.safeDecode=(n,i)=>tg(e,n,i),e.safeEncodeAsync=async(n,i)=>ng(e,n,i),e.safeDecodeAsync=async(n,i)=>ig(e,n,i),ai(e,"ZodType",{check(...n){const i=this.def;return this.clone(Dt(i,{checks:[...i.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return zt(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(Jg(n,i))},superRefine(n,i){return this.check(Qg(n,i))},overwrite(n){return this.check(Pn(n))},optional(){return ca(this)},exactOptional(){return zg(this)},nullable(){return ua(this)},nullish(){return ca(ua(this))},nonoptional(n){return qg(this,n)},array(){return Ne(this)},or(n){return ac([this,n])},and(n){return Rg(this,n)},transform(n){return da(this,Fg(n))},default(n){return Bg(this,n)},prefault(n){return Hg(this,n)},catch(n){return Vg(this,n)},pipe(n){return da(this,n)},readonly(){return Gg(this)},describe(n){const i=this.clone();return Zn.add(i,{description:n}),i},meta(...n){if(n.length===0)return Zn.get(this);const i=this.clone();return Zn.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Zn.get(e)?.description},configurable:!0}),e)),rc=D("_ZodString",(e,t)=>{Jr.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>mm(e,i,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ai(e,"_ZodString",{regex(...i){return this.check(Qp(...i))},includes(...i){return this.check(tm(...i))},startsWith(...i){return this.check(nm(...i))},endsWith(...i){return this.check(im(...i))},min(...i){return this.check(es(...i))},max(...i){return this.check(Xl(...i))},length(...i){return this.check(ec(...i))},nonempty(...i){return this.check(es(1,...i))},lowercase(i){return this.check(Xp(i))},uppercase(i){return this.check(em(i))},trim(){return this.check(rm())},normalize(...i){return this.check(sm(...i))},toLowerCase(){return this.check(om())},toUpperCase(){return this.check(am())},slugify(){return this.check(lm())}})}),sg=D("ZodString",(e,t)=>{Jr.init(e,t),rc.init(e,t),e.email=n=>e.check(vp(rg,n)),e.url=n=>e.check(Ap(og,n)),e.jwt=n=>e.check(Bp(vg,n)),e.emoji=n=>e.check(Tp(ag,n)),e.guid=n=>e.check(ea(ra,n)),e.uuid=n=>e.check(Sp(xi,n)),e.uuidv4=n=>e.check(xp(xi,n)),e.uuidv6=n=>e.check(_p(xi,n)),e.uuidv7=n=>e.check(Cp(xi,n)),e.nanoid=n=>e.check(Ep(lg,n)),e.guid=n=>e.check(ea(ra,n)),e.cuid=n=>e.check(Ip(cg,n)),e.cuid2=n=>e.check(Pp(ug,n)),e.ulid=n=>e.check(Op(dg,n)),e.base64=n=>e.check(zp(yg,n)),e.base64url=n=>e.check(Mp(wg,n)),e.xid=n=>e.check($p(fg,n)),e.ksuid=n=>e.check(Rp(hg,n)),e.ipv4=n=>e.check(Np(pg,n)),e.ipv6=n=>e.check(Lp(mg,n)),e.cidrv4=n=>e.check(Fp(gg,n)),e.cidrv6=n=>e.check(Dp(bg,n)),e.e164=n=>e.check(jp(kg,n)),e.datetime=n=>e.check(zm(n)),e.date=n=>e.check(jm(n)),e.time=n=>e.check(Um(n)),e.duration=n=>e.check(qm(n))});function Y(e){return kp(sg,e)}const xe=D("ZodStringFormat",(e,t)=>{ve.init(e,t),rc.init(e,t)}),rg=D("ZodEmail",(e,t)=>{Ah.init(e,t),xe.init(e,t)}),ra=D("ZodGUID",(e,t)=>{_h.init(e,t),xe.init(e,t)}),xi=D("ZodUUID",(e,t)=>{Ch.init(e,t),xe.init(e,t)}),og=D("ZodURL",(e,t)=>{Th.init(e,t),xe.init(e,t)}),ag=D("ZodEmoji",(e,t)=>{Eh.init(e,t),xe.init(e,t)}),lg=D("ZodNanoID",(e,t)=>{Ih.init(e,t),xe.init(e,t)}),cg=D("ZodCUID",(e,t)=>{Ph.init(e,t),xe.init(e,t)}),ug=D("ZodCUID2",(e,t)=>{Oh.init(e,t),xe.init(e,t)}),dg=D("ZodULID",(e,t)=>{$h.init(e,t),xe.init(e,t)}),fg=D("ZodXID",(e,t)=>{Rh.init(e,t),xe.init(e,t)}),hg=D("ZodKSUID",(e,t)=>{Nh.init(e,t),xe.init(e,t)}),pg=D("ZodIPv4",(e,t)=>{Mh.init(e,t),xe.init(e,t)}),mg=D("ZodIPv6",(e,t)=>{jh.init(e,t),xe.init(e,t)}),gg=D("ZodCIDRv4",(e,t)=>{Bh.init(e,t),xe.init(e,t)}),bg=D("ZodCIDRv6",(e,t)=>{Uh.init(e,t),xe.init(e,t)}),yg=D("ZodBase64",(e,t)=>{Hh.init(e,t),xe.init(e,t)}),wg=D("ZodBase64URL",(e,t)=>{Wh.init(e,t),xe.init(e,t)}),kg=D("ZodE164",(e,t)=>{Vh.init(e,t),xe.init(e,t)}),vg=D("ZodJWT",(e,t)=>{Kh.init(e,t),xe.init(e,t)}),oc=D("ZodNumber",(e,t)=>{Gl.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>gm(e,i,s),ai(e,"ZodNumber",{gt(i,s){return this.check(na(i,s))},gte(i,s){return this.check(Ls(i,s))},min(i,s){return this.check(Ls(i,s))},lt(i,s){return this.check(ta(i,s))},lte(i,s){return this.check(Ns(i,s))},max(i,s){return this.check(Ns(i,s))},int(i){return this.check(oa(i))},safe(i){return this.check(oa(i))},positive(i){return this.check(na(0,i))},nonnegative(i){return this.check(Ls(0,i))},negative(i){return this.check(ta(0,i))},nonpositive(i){return this.check(Ns(0,i))},multipleOf(i,s){return this.check(ia(i,s))},step(i,s){return this.check(ia(i,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Kt(e){return Vp(oc,e)}const Sg=D("ZodNumberFormat",(e,t)=>{Gh.init(e,t),oc.init(e,t)});function oa(e){return Zp(Sg,e)}const xg=D("ZodBoolean",(e,t)=>{Yh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>bm(e,n,i)});function ns(e){return Kp(xg,e)}const _g=D("ZodNull",(e,t)=>{Jh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>ym(e,n,i)});function Cg(e){return Gp(_g,e)}const Ag=D("ZodUnknown",(e,t)=>{Qh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>km()});function aa(){return Yp(Ag)}const Tg=D("ZodNever",(e,t)=>{Xh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>wm(e,n,i)});function Eg(e){return Jp(Tg,e)}const Ig=D("ZodArray",(e,t)=>{ep.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Cm(e,n,i,s),e.element=t.element,ai(e,"ZodArray",{min(n,i){return this.check(es(n,i))},nonempty(n){return this.check(es(1,n))},max(n,i){return this.check(Xl(n,i))},length(n,i){return this.check(ec(n,i))},unwrap(){return this.element}})});function Ne(e,t){return cm(Ig,e,t)}const Pg=D("ZodObject",(e,t)=>{np.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Am(e,n,i,s),me(e,"shape",()=>t.shape),ai(e,"ZodObject",{keyof(){return kt(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:aa()})},loose(){return this.clone({...this._zod.def,catchall:aa()})},strict(){return this.clone({...this._zod.def,catchall:Eg()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return wf(this,n)},safeExtend(n){return kf(this,n)},merge(n){return vf(this,n)},pick(n){return bf(this,n)},omit(n){return yf(this,n)},partial(...n){return Sf(cc,this,n[0])},required(...n){return xf(uc,this,n[0])}})});function je(e,t){const n={type:"object",shape:e??{},...J(t)};return new Pg(n)}const Og=D("ZodUnion",(e,t)=>{ip.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Tm(e,n,i,s),e.options=t.options});function ac(e,t){return new Og({type:"union",options:e,...J(t)})}const $g=D("ZodIntersection",(e,t)=>{sp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Em(e,n,i,s)});function Rg(e,t){return new $g({type:"intersection",left:e,right:t})}const la=D("ZodRecord",(e,t)=>{rp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Im(e,n,i,s),e.keyType=t.keyType,e.valueType=t.valueType});function hn(e,t,n){return!t||!t._zod?new la({type:"record",keyType:Y(),valueType:e,...J(t)}):new la({type:"record",keyType:e,valueType:t,...J(n)})}const mr=D("ZodEnum",(e,t)=>{op.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>vm(e,i,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,s)=>{const r={};for(const o of i)if(n.has(o))r[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new mr({...t,checks:[],...J(s),entries:r})},e.exclude=(i,s)=>{const r={...t.entries};for(const o of i)if(n.has(o))delete r[o];else throw new Error(`Key ${o} not found in enum`);return new mr({...t,checks:[],...J(s),entries:r})}});function kt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new mr({type:"enum",entries:n,...J(t)})}const Ng=D("ZodLiteral",(e,t)=>{ap.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Sm(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function lc(e,t){return new Ng({type:"literal",values:Array.isArray(e)?e:[e],...J(t)})}const Lg=D("ZodTransform",(e,t)=>{lp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>_m(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Nl(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(ii(r,n.value,t));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(ii(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(r=>(n.value=r,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function Fg(e){return new Lg({type:"transform",transform:e})}const cc=D("ZodOptional",(e,t)=>{Ql.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>sc(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function ca(e){return new cc({type:"optional",innerType:e})}const Dg=D("ZodExactOptional",(e,t)=>{cp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>sc(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function zg(e){return new Dg({type:"optional",innerType:e})}const Mg=D("ZodNullable",(e,t)=>{up.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Pm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function ua(e){return new Mg({type:"nullable",innerType:e})}const jg=D("ZodDefault",(e,t)=>{dp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>$m(e,n,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Bg(e,t){return new jg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Dl(t)}})}const Ug=D("ZodPrefault",(e,t)=>{fp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Rm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Hg(e,t){return new Ug({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Dl(t)}})}const uc=D("ZodNonOptional",(e,t)=>{hp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Om(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function qg(e,t){return new uc({type:"nonoptional",innerType:e,...J(t)})}const Wg=D("ZodCatch",(e,t)=>{pp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Nm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Vg(e,t){return new Wg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Zg=D("ZodPipe",(e,t)=>{mp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Lm(e,n,i,s),e.in=t.in,e.out=t.out});function da(e,t){return new Zg({type:"pipe",in:e,out:t})}const Kg=D("ZodReadonly",(e,t)=>{gp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Fm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Gg(e){return new Kg({type:"readonly",innerType:e})}const Yg=D("ZodCustom",(e,t)=>{bp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>xm(e,n)});function Jg(e,t={}){return um(Yg,e,t)}function Qg(e,t){return dm(e,t)}const Xg=je({ref:Y()}),eb=je({id:Y(),width:Kt(),children:Ne(Xg)}),tb=je({type:lc("row"),id:Y(),columns:Ne(eb)}),nb=je({type:lc("stack"),children:Ne(tb)});function ib(e){return JSON.stringify(e)}function sb(e){if(!e)return{type:"stack",children:[]};try{return nb.parse(JSON.parse(e))}catch{return{type:"stack",children:[]}}}function fa(e){if(e)throw e}var N_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ms(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fs,ha;function rb(){if(ha)return Fs;ha=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},r=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),u=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!u)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},a=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(i)return i(c,d).value}else return;return c[d]};return Fs=function l(){var c,d,u,h,f,m,p=arguments[0],b=1,w=arguments.length,T=!1;for(typeof p=="boolean"&&(T=p,p=arguments[1]||{},b=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});b<w;++b)if(c=arguments[b],c!=null)for(d in c)u=a(p,d),h=a(c,d),p!==h&&(T&&h&&(r(h)||(f=s(h)))?(f?(f=!1,m=u&&s(u)?u:[]):m=u&&r(u)?u:{},o(p,{name:d,newValue:l(T,m,h)})):typeof h<"u"&&o(p,{name:d,newValue:h}));return p},Fs}var ob=rb();const Ds=ms(ob);function L_(){}function F_(){}function gr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ab(){const e=[],t={run:n,use:i};return t;function n(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const d=e[++r];let u=-1;if(l){o(l);return}for(;++u<s.length;)(c[u]===null||c[u]===void 0)&&(c[u]=s[u]);s=c,d?lb(d,a)(...c):o(null,...c)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function lb(e,t){let n;return i;function i(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const d=c;if(a&&n)throw d;return s(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(r,s):l instanceof Error?s(l):r(l))}function s(o,...a){n||(n=!0,t(o,...a))}function r(o){s(null,o)}}function Jn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?pa(e.position):"start"in e||"end"in e?pa(e):"line"in e||"column"in e?br(e):""}function br(e){return ma(e&&e.line)+":"+ma(e&&e.column)}function pa(e){return br(e&&e.start)+"-"+br(e&&e.end)}function ma(e){return e&&typeof e=="number"?e:1}class Ke extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",r={},o=!1;if(n&&("line"in n&&"column"in n?r={place:n}:"start"in n&&"end"in n?r={place:n}:"type"in n?r={ancestors:[n],place:n.position}:r={...n}),typeof t=="string"?s=t:!r.cause&&t&&(o=!0,s=t.message,r.cause=t),!r.ruleId&&!r.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?r.ruleId=i:(r.source=i.slice(0,l),r.ruleId=i.slice(l+1))}if(!r.place&&r.ancestors&&r.ancestors){const l=r.ancestors[r.ancestors.length-1];l&&(r.place=l.position)}const a=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Jn(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ke.prototype.file="";Ke.prototype.name="";Ke.prototype.reason="";Ke.prototype.message="";Ke.prototype.stack="";Ke.prototype.column=void 0;Ke.prototype.line=void 0;Ke.prototype.ancestors=void 0;Ke.prototype.cause=void 0;Ke.prototype.fatal=void 0;Ke.prototype.place=void 0;Ke.prototype.ruleId=void 0;Ke.prototype.source=void 0;const wt={basename:cb,dirname:ub,extname:db,join:fb,sep:"/"};function cb(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');li(e);let n=0,i=-1,s=e.length,r;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(r){n=s+1;break}}else i<0&&(r=!0,i=s+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(r){n=s+1;break}}else o<0&&(r=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(i=s):(a=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function ub(e){if(li(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function db(e){li(e);let t=e.length,n=-1,i=0,s=-1,r=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||n<0||r===0||r===1&&s===n-1&&s===i+1?"":e.slice(s,n)}function fb(...e){let t=-1,n;for(;++t<e.length;)li(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":hb(n)}function hb(e){li(e);const t=e.codePointAt(0)===47;let n=pb(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pb(e,t){let n="",i=0,s=-1,r=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||r===1))if(s!==o-1&&r===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),s=o,r=0;continue}}else if(n.length>0){n="",i=0,s=o,r=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),i=o-s-1;s=o,r=0}else a===46&&r>-1?r++:r=-1}return n}function li(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mb={cwd:gb};function gb(){return"/"}function yr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bb(e){if(typeof e=="string")e=new URL(e);else if(!yr(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yb(e)}function yb(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const zs=["history","path","basename","stem","extname","dirname"];class wb{constructor(t){let n;t?yr(t)?n={path:t}:typeof t=="string"||kb(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":mb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<zs.length;){const r=zs[i];r in n&&n[r]!==void 0&&n[r]!==null&&(this[r]=r==="history"?[...n[r]]:n[r])}let s;for(s in n)zs.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?wt.basename(this.path):void 0}set basename(t){js(t,"basename"),Ms(t,"basename"),this.path=wt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wt.dirname(this.path):void 0}set dirname(t){ga(this.basename,"dirname"),this.path=wt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wt.extname(this.path):void 0}set extname(t){if(Ms(t,"extname"),ga(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){yr(t)&&(t=bb(t)),js(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wt.basename(this.path,this.extname):void 0}set stem(t){js(t,"stem"),Ms(t,"stem"),this.path=wt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const s=this.message(t,n,i);throw s.fatal=!0,s}info(t,n,i){const s=this.message(t,n,i);return s.fatal=void 0,s}message(t,n,i){const s=new Ke(t,n,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ms(e,t){if(e&&e.includes(wt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wt.sep+"`")}function js(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ga(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kb(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vb=(function(e){const i=this.constructor.prototype,s=i[e],r=function(){return s.apply(r,arguments)};return Object.setPrototypeOf(r,i),r}),Sb={}.hasOwnProperty;class Qr extends vb{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ab()}copy(){const t=new Qr;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Ds(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Hs("data",this.frozen),this.namespace[t]=n,this):Sb.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hs("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=n.call(t,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_i(t),i=this.parser||this.Parser;return Bs("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Bs("process",this.parser||this.Parser),Us("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(r,o){const a=_i(t),l=i.parse(a);i.run(l,a,function(d,u,h){if(d||!u||!h)return c(d);const f=u,m=i.stringify(f,h);_b(m)?h.value=m:h.result=m,c(d,h)});function c(d,u){d||!u?o(d):r?r(u):n(void 0,u)}}}processSync(t){let n=!1,i;return this.freeze(),Bs("processSync",this.parser||this.Parser),Us("processSync",this.compiler||this.Compiler),this.process(t,s),ya("processSync","process",n),i;function s(r,o){n=!0,fa(r),i=o}}run(t,n,i){ba(t),this.freeze();const s=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?r(void 0,i):new Promise(r);function r(o,a){const l=_i(n);s.run(t,l,c);function c(d,u,h){const f=u||t;d?a(d):o?o(f):i(void 0,f,h)}}}runSync(t,n){let i=!1,s;return this.run(t,n,r),ya("runSync","run",i),s;function r(o,a){fa(o),s=a,i=!0}}stringify(t,n){this.freeze();const i=_i(n),s=this.compiler||this.Compiler;return Us("stringify",s),ba(t),s(t,i)}use(t,...n){const i=this.attachers,s=this.namespace;if(Hs("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function r(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(s.settings=Ds(!0,s.settings,c.settings))}function a(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const u=c[d];r(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let u=-1,h=-1;for(;++u<i.length;)if(i[u][0]===c){h=u;break}if(h===-1)i.push([c,...d]);else if(d.length>0){let[f,...m]=d;const p=i[h][1];gr(p)&&gr(f)&&(f=Ds(!0,p,f)),i[h]=[c,f,...m]}}}}const dc=new Qr().freeze();function Bs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Us(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hs(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ba(e){if(!gr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ya(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _i(e){return xb(e)?e:new wb(e)}function xb(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _b(e){return typeof e=="string"||Cb(e)}function Cb(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ab={};function Xr(e,t){const n=Ab,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return fc(e,i,s)}function fc(e,t,n){if(Tb(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return wa(e.children,t,n)}return Array.isArray(e)?wa(e,t,n):""}function wa(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=fc(e[s],t,n);return i.join("")}function Tb(e){return!!(e&&typeof e=="object")}const ka=document.createElement("i");function eo(e){const t="&"+e+";";ka.innerHTML=t;const n=ka.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qe(e,t,n,i){const s=e.length;let r=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);r<i.length;)o=i.slice(r,r+1e4),o.unshift(t,0),e.splice(...o),r+=1e4,t+=1e4}function st(e,t){return e.length>0?(Qe(e,e.length,0,t),e):t}const va={}.hasOwnProperty;function hc(e){const t={};let n=-1;for(;++n<e.length;)Eb(t,e[n]);return t}function Eb(e,t){let n;for(n in t){const s=(va.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let o;if(r)for(o in r){va.call(s,o)||(s[o]=[]);const a=r[o];Ib(s[o],Array.isArray(a)?a:a?[a]:[])}}}function Ib(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Qe(e,0,0,i)}function pc(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ht(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Be=Mt(/[A-Za-z]/),Ve=Mt(/[\dA-Za-z]/),Pb=Mt(/[#-'*+\--9=?A-Z^-~]/);function is(e){return e!==null&&(e<32||e===127)}const wr=Mt(/\d/),Ob=Mt(/[\dA-Fa-f]/),$b=Mt(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function ge(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const gs=Mt(new RegExp("\\p{P}|\\p{S}","u")),Gt=Mt(/\s/);function Mt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function de(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let r=0;return o;function o(l){return ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return ae(l)&&r++<s?(e.consume(l),a):(e.exit(n),t(l))}}const Rb={tokenize:Nb};function Nb(e){const t=e.attempt(this.parser.constructs.contentInitial,i,s);let n;return t;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),de(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),r(a)}function r(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Q(a)?(e.consume(a),e.exit("chunkText"),r):(e.consume(a),o)}}const Lb={tokenize:Fb},Sa={tokenize:Db};function Fb(e){const t=this,n=[];let i=0,s,r,o;return a;function a(S){if(i<n.length){const C=n[i];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(S)}return c(S)}function l(S){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&T();const C=t.events.length;let $=C,v;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){v=t.events[$][1].end;break}w(i);let A=C;for(;A<t.events.length;)t.events[A][1].end={...v},A++;return Qe(t.events,$+1,0,t.events.slice(C)),t.events.length=A,c(S)}return a(S)}function c(S){if(i===n.length){if(!s)return h(S);if(s.currentConstruct&&s.currentConstruct.concrete)return m(S);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sa,d,u)(S)}function d(S){return s&&T(),w(i),h(S)}function u(S){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,m(S)}function h(S){return t.containerState={},e.attempt(Sa,f,m)(S)}function f(S){return i++,n.push([t.currentConstruct,t.containerState]),h(S)}function m(S){if(S===null){s&&T(),w(0),e.consume(S);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:r}),p(S)}function p(S){if(S===null){b(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return Q(S)?(e.consume(S),b(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(S),p)}function b(S,C){const $=t.sliceStream(S);if(C&&$.push(null),S.previous=r,r&&(r.next=S),r=S,s.defineSkip(S.start),s.write($),t.parser.lazy[S.start.line]){let v=s.events.length;for(;v--;)if(s.events[v][1].start.offset<o&&(!s.events[v][1].end||s.events[v][1].end.offset>o))return;const A=t.events.length;let P=A,q,R;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(q){R=t.events[P][1].end;break}q=!0}for(w(i),v=A;v<t.events.length;)t.events[v][1].end={...R},v++;Qe(t.events,P+1,0,t.events.slice(A)),t.events.length=v}}function w(S){let C=n.length;for(;C-- >S;){const $=n[C];t.containerState=$[1],$[0].exit.call(t,e)}n.length=S}function T(){s.write([null]),r=void 0,s=void 0,t.containerState._closeFlow=void 0}}function Db(e,t,n){return de(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Tn(e){if(e===null||ge(e)||Gt(e))return 1;if(gs(e))return 2}function bs(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const r=e[s].resolveAll;r&&!i.includes(r)&&(t=r(t,n),i.push(r))}return t}const kr={name:"attention",resolveAll:zb,tokenize:Mb};function zb(e,t){let n=-1,i,s,r,o,a,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[i][1].end},h={...e[n][1].start};xa(u,-l),xa(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},r={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[i][1].end={...o.start},e[n][1].start={...a.end},c=[],e[i][1].end.offset-e[i][1].start.offset&&(c=st(c,[["enter",e[i][1],t],["exit",e[i][1],t]])),c=st(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",r,t]]),c=st(c,bs(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),c=st(c,[["exit",r,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=st(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Qe(e,i-1,n-i+3,c),n=i+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Mb(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=Tn(i);let r;return o;function o(l){return r=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===r)return e.consume(l),a;const c=e.exit("attentionSequence"),d=Tn(l),u=!d||d===2&&s||n.includes(l),h=!s||s===2&&d||n.includes(i);return c._open=!!(r===42?u:u&&(s||!h)),c._close=!!(r===42?h:h&&(d||!u)),t(l)}}function xa(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jb={name:"autolink",tokenize:Bb};function Bb(e,t,n){let i=0;return s;function s(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),r}function r(f){return Be(f)?(e.consume(f),o):f===64?n(f):c(f)}function o(f){return f===43||f===45||f===46||Ve(f)?(i=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),i=0,l):(f===43||f===45||f===46||Ve(f))&&i++<32?(e.consume(f),a):(i=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||is(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),d):Pb(f)?(e.consume(f),c):n(f)}function d(f){return Ve(f)?u(f):n(f)}function u(f){return f===46?(e.consume(f),i=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||Ve(f))&&i++<63){const m=f===45?h:u;return e.consume(f),m}return n(f)}}const ci={partial:!0,tokenize:Ub};function Ub(e,t,n){return i;function i(r){return ae(r)?de(e,s,"linePrefix")(r):s(r)}function s(r){return r===null||Q(r)?t(r):n(r)}}const mc={continuation:{tokenize:qb},exit:Wb,name:"blockQuote",tokenize:Hb};function Hb(e,t,n){const i=this;return s;function s(o){if(o===62){const a=i.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),r}return n(o)}function r(o){return ae(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function qb(e,t,n){const i=this;return s;function s(o){return ae(o)?de(e,r,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):r(o)}function r(o){return e.attempt(mc,t,n)(o)}}function Wb(e){e.exit("blockQuote")}const gc={name:"characterEscape",tokenize:Vb};function Vb(e,t,n){return i;function i(r){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(r),e.exit("escapeMarker"),s}function s(r){return $b(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}const bc={name:"characterReference",tokenize:Zb};function Zb(e,t,n){const i=this;let s=0,r,o;return a;function a(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),r=31,o=Ve,d(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=Ob,d):(e.enter("characterReferenceValue"),r=7,o=wr,d(u))}function d(u){if(u===59&&s){const h=e.exit("characterReferenceValue");return o===Ve&&!eo(i.sliceSerialize(h))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(u)&&s++<r?(e.consume(u),d):n(u)}}const _a={partial:!0,tokenize:Gb},Ca={concrete:!0,name:"codeFenced",tokenize:Kb};function Kb(e,t,n){const i=this,s={partial:!0,tokenize:$};let r=0,o=0,a;return l;function l(v){return c(v)}function c(v){const A=i.events[i.events.length-1];return r=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(v)}function d(v){return v===a?(o++,e.consume(v),d):o<3?n(v):(e.exit("codeFencedFenceSequence"),ae(v)?de(e,u,"whitespace")(v):u(v))}function u(v){return v===null||Q(v)?(e.exit("codeFencedFence"),i.interrupt?t(v):e.check(_a,p,C)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||Q(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(v)):ae(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),de(e,f,"whitespace")(v)):v===96&&v===a?n(v):(e.consume(v),h)}function f(v){return v===null||Q(v)?u(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||Q(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(v)):v===96&&v===a?n(v):(e.consume(v),m)}function p(v){return e.attempt(s,C,b)(v)}function b(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),w}function w(v){return r>0&&ae(v)?de(e,T,"linePrefix",r+1)(v):T(v)}function T(v){return v===null||Q(v)?e.check(_a,p,C)(v):(e.enter("codeFlowValue"),S(v))}function S(v){return v===null||Q(v)?(e.exit("codeFlowValue"),T(v)):(e.consume(v),S)}function C(v){return e.exit("codeFenced"),t(v)}function $(v,A,P){let q=0;return R;function R(te){return v.enter("lineEnding"),v.consume(te),v.exit("lineEnding"),U}function U(te){return v.enter("codeFencedFence"),ae(te)?de(v,B,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):B(te)}function B(te){return te===a?(v.enter("codeFencedFenceSequence"),ee(te)):P(te)}function ee(te){return te===a?(q++,v.consume(te),ee):q>=o?(v.exit("codeFencedFenceSequence"),ae(te)?de(v,oe,"whitespace")(te):oe(te)):P(te)}function oe(te){return te===null||Q(te)?(v.exit("codeFencedFence"),A(te)):P(te)}}}function Gb(e,t,n){const i=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r)}function r(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const qs={name:"codeIndented",tokenize:Jb},Yb={partial:!0,tokenize:Qb};function Jb(e,t,n){const i=this;return s;function s(c){return e.enter("codeIndented"),de(e,r,"linePrefix",5)(c)}function r(c){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Q(c)?e.attempt(Yb,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Q(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Qb(e,t,n){const i=this;return s;function s(o){return i.parser.lazy[i.now().line]?n(o):Q(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):de(e,r,"linePrefix",5)(o)}function r(o){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Q(o)?s(o):n(o)}}const Xb={name:"codeText",previous:ty,resolve:ey,tokenize:ny};function ey(e){let t=e.length-4,n=3,i,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)s===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(s=i):(i===t||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),t-=i-s-2,i=s+2),s=void 0);return e}function ty(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ny(e,t,n){let i=0,s,r;return o;function o(u){return e.enter("codeText"),e.enter("codeTextSequence"),a(u)}function a(u){return u===96?(e.consume(u),i++,a):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(r=e.enter("codeTextSequence"),s=0,d(u)):Q(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||Q(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function d(u){return u===96?(e.consume(u),s++,d):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(r.type="codeTextData",c(u))}}class iy{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const r=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&qn(this.left,i),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);qn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qn(this.left,n.reverse())}}}function qn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yc(e){const t={};let n=-1,i,s,r,o,a,l,c;const d=new iy(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(i=d.get(n),n&&i[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,r=0,r<l.length&&l[r][1].type==="lineEndingBlank"&&(r+=2),r<l.length&&l[r][1].type==="content"))for(;++r<l.length&&l[r][1].type!=="content";)l[r][1].type==="chunkText"&&(l[r][1]._isInFirstContentOfListItem=!0,r++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,sy(d,n)),n=t[n],c=!0);else if(i[1]._container){for(r=n,s=void 0;r--;)if(o=d.get(r),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=r);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(i[1].end={...d.get(s)[1].start},a=d.slice(s,n),a.unshift(i),d.splice(s,n-s+1,a))}}return Qe(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function sy(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const r=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let d,u,h=-1,f=n,m=0,p=0;const b=[p];for(;f;){for(;e.get(++s)[1]!==f;);r.push(s),f._tokenizer||(d=i.sliceStream(f),f.next||d.push(null),u&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(p=h+1,b.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),h=b.length;h--;){const w=a.slice(b[h],b[h+1]),T=r.pop();l.push([T,T+w.length-1]),e.splice(T,2,w)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const ry={resolve:ay,tokenize:ly},oy={partial:!0,tokenize:cy};function ay(e){return yc(e),e}function ly(e,t){let n;return i;function i(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?r(a):Q(a)?e.check(oy,o,r)(a):(e.consume(a),s)}function r(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function cy(e,t,n){const i=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),de(e,r,"linePrefix")}function r(o){if(o===null||Q(o))return n(o);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function wc(e,t,n,i,s,r,o,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(w){return w===60?(e.enter(i),e.enter(s),e.enter(r),e.consume(w),e.exit(r),h):w===null||w===32||w===41||is(w)?n(w):(e.enter(i),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function h(w){return w===62?(e.enter(r),e.consume(w),e.exit(r),e.exit(s),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(a),h(w)):w===null||w===60||Q(w)?n(w):(e.consume(w),w===92?m:f)}function m(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function p(w){return!d&&(w===null||w===41||ge(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(i),t(w)):d<c&&w===40?(e.consume(w),d++,p):w===41?(e.consume(w),d--,p):w===null||w===32||w===40||is(w)?n(w):(e.consume(w),w===92?b:p)}function b(w){return w===40||w===41||w===92?(e.consume(w),p):p(w)}}function kc(e,t,n,i,s,r){const o=this;let a=0,l;return c;function c(f){return e.enter(i),e.enter(s),e.consume(f),e.exit(s),e.enter(r),d}function d(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(r),e.enter(s),e.consume(f),e.exit(s),e.exit(i),t):Q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===null||f===91||f===93||Q(f)||a++>999?(e.exit("chunkString"),d(f)):(e.consume(f),l||(l=!ae(f)),f===92?h:u)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,u):u(f)}}function vc(e,t,n,i,s,r){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(i),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(i),t):(e.enter(r),c(h))}function c(h){return h===o?(e.exit(r),l(o)):h===null?n(h):Q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),de(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Q(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?u:d)}function u(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Qn(e,t){let n;return i;function i(s){return Q(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):ae(s)?de(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const uy={name:"definition",tokenize:fy},dy={partial:!0,tokenize:hy};function fy(e,t,n){const i=this;let s;return r;function r(f){return e.enter("definition"),o(f)}function o(f){return kc.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return s=ht(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ge(f)?Qn(e,c)(f):c(f)}function c(f){return wc(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(dy,u,u)(f)}function u(f){return ae(f)?de(e,h,"whitespace")(f):h(f)}function h(f){return f===null||Q(f)?(e.exit("definition"),i.parser.defined.push(s),t(f)):n(f)}}function hy(e,t,n){return i;function i(a){return ge(a)?Qn(e,s)(a):n(a)}function s(a){return vc(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function r(a){return ae(a)?de(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Q(a)?t(a):n(a)}}const py={name:"hardBreakEscape",tokenize:my};function my(e,t,n){return i;function i(r){return e.enter("hardBreakEscape"),e.consume(r),s}function s(r){return Q(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const gy={name:"headingAtx",resolve:by,tokenize:yy};function by(e,t){let n=e.length-2,i=3,s,r;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},r={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Qe(e,i,n-i+1,[["enter",s,t],["enter",r,t],["exit",r,t],["exit",s,t]])),e}function yy(e,t,n){let i=0;return s;function s(d){return e.enter("atxHeading"),r(d)}function r(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||ge(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Q(d)?(e.exit("atxHeading"),t(d)):ae(d)?de(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||ge(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const wy=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Aa=["pre","script","style","textarea"],ky={concrete:!0,name:"htmlFlow",resolveTo:xy,tokenize:_y},vy={partial:!0,tokenize:Ay},Sy={partial:!0,tokenize:Cy};function xy(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function _y(e,t,n){const i=this;let s,r,o,a,l;return c;function c(y){return d(y)}function d(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),u}function u(y){return y===33?(e.consume(y),h):y===47?(e.consume(y),r=!0,p):y===63?(e.consume(y),s=3,i.interrupt?t:_):Be(y)?(e.consume(y),o=String.fromCharCode(y),b):n(y)}function h(y){return y===45?(e.consume(y),s=2,f):y===91?(e.consume(y),s=5,a=0,m):Be(y)?(e.consume(y),s=4,i.interrupt?t:_):n(y)}function f(y){return y===45?(e.consume(y),i.interrupt?t:_):n(y)}function m(y){const z="CDATA[";return y===z.charCodeAt(a++)?(e.consume(y),a===z.length?i.interrupt?t:B:m):n(y)}function p(y){return Be(y)?(e.consume(y),o=String.fromCharCode(y),b):n(y)}function b(y){if(y===null||y===47||y===62||ge(y)){const z=y===47,W=o.toLowerCase();return!z&&!r&&Aa.includes(W)?(s=1,i.interrupt?t(y):B(y)):wy.includes(o.toLowerCase())?(s=6,z?(e.consume(y),w):i.interrupt?t(y):B(y)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(y):r?T(y):S(y))}return y===45||Ve(y)?(e.consume(y),o+=String.fromCharCode(y),b):n(y)}function w(y){return y===62?(e.consume(y),i.interrupt?t:B):n(y)}function T(y){return ae(y)?(e.consume(y),T):R(y)}function S(y){return y===47?(e.consume(y),R):y===58||y===95||Be(y)?(e.consume(y),C):ae(y)?(e.consume(y),S):R(y)}function C(y){return y===45||y===46||y===58||y===95||Ve(y)?(e.consume(y),C):$(y)}function $(y){return y===61?(e.consume(y),v):ae(y)?(e.consume(y),$):S(y)}function v(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),l=y,A):ae(y)?(e.consume(y),v):P(y)}function A(y){return y===l?(e.consume(y),l=null,q):y===null||Q(y)?n(y):(e.consume(y),A)}function P(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||ge(y)?$(y):(e.consume(y),P)}function q(y){return y===47||y===62||ae(y)?S(y):n(y)}function R(y){return y===62?(e.consume(y),U):n(y)}function U(y){return y===null||Q(y)?B(y):ae(y)?(e.consume(y),U):n(y)}function B(y){return y===45&&s===2?(e.consume(y),ue):y===60&&s===1?(e.consume(y),fe):y===62&&s===4?(e.consume(y),E):y===63&&s===3?(e.consume(y),_):y===93&&s===5?(e.consume(y),ce):Q(y)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(vy,I,ee)(y)):y===null||Q(y)?(e.exit("htmlFlowData"),ee(y)):(e.consume(y),B)}function ee(y){return e.check(Sy,oe,I)(y)}function oe(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),te}function te(y){return y===null||Q(y)?ee(y):(e.enter("htmlFlowData"),B(y))}function ue(y){return y===45?(e.consume(y),_):B(y)}function fe(y){return y===47?(e.consume(y),o="",ye):B(y)}function ye(y){if(y===62){const z=o.toLowerCase();return Aa.includes(z)?(e.consume(y),E):B(y)}return Be(y)&&o.length<8?(e.consume(y),o+=String.fromCharCode(y),ye):B(y)}function ce(y){return y===93?(e.consume(y),_):B(y)}function _(y){return y===62?(e.consume(y),E):y===45&&s===2?(e.consume(y),_):B(y)}function E(y){return y===null||Q(y)?(e.exit("htmlFlowData"),I(y)):(e.consume(y),E)}function I(y){return e.exit("htmlFlow"),t(y)}}function Cy(e,t,n){const i=this;return s;function s(o){return Q(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):n(o)}function r(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function Ay(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ci,t,n)}}const Ty={name:"htmlText",tokenize:Ey};function Ey(e,t,n){const i=this;let s,r,o;return a;function a(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),l}function l(_){return _===33?(e.consume(_),c):_===47?(e.consume(_),$):_===63?(e.consume(_),S):Be(_)?(e.consume(_),P):n(_)}function c(_){return _===45?(e.consume(_),d):_===91?(e.consume(_),r=0,m):Be(_)?(e.consume(_),T):n(_)}function d(_){return _===45?(e.consume(_),f):n(_)}function u(_){return _===null?n(_):_===45?(e.consume(_),h):Q(_)?(o=u,fe(_)):(e.consume(_),u)}function h(_){return _===45?(e.consume(_),f):u(_)}function f(_){return _===62?ue(_):_===45?h(_):u(_)}function m(_){const E="CDATA[";return _===E.charCodeAt(r++)?(e.consume(_),r===E.length?p:m):n(_)}function p(_){return _===null?n(_):_===93?(e.consume(_),b):Q(_)?(o=p,fe(_)):(e.consume(_),p)}function b(_){return _===93?(e.consume(_),w):p(_)}function w(_){return _===62?ue(_):_===93?(e.consume(_),w):p(_)}function T(_){return _===null||_===62?ue(_):Q(_)?(o=T,fe(_)):(e.consume(_),T)}function S(_){return _===null?n(_):_===63?(e.consume(_),C):Q(_)?(o=S,fe(_)):(e.consume(_),S)}function C(_){return _===62?ue(_):S(_)}function $(_){return Be(_)?(e.consume(_),v):n(_)}function v(_){return _===45||Ve(_)?(e.consume(_),v):A(_)}function A(_){return Q(_)?(o=A,fe(_)):ae(_)?(e.consume(_),A):ue(_)}function P(_){return _===45||Ve(_)?(e.consume(_),P):_===47||_===62||ge(_)?q(_):n(_)}function q(_){return _===47?(e.consume(_),ue):_===58||_===95||Be(_)?(e.consume(_),R):Q(_)?(o=q,fe(_)):ae(_)?(e.consume(_),q):ue(_)}function R(_){return _===45||_===46||_===58||_===95||Ve(_)?(e.consume(_),R):U(_)}function U(_){return _===61?(e.consume(_),B):Q(_)?(o=U,fe(_)):ae(_)?(e.consume(_),U):q(_)}function B(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),s=_,ee):Q(_)?(o=B,fe(_)):ae(_)?(e.consume(_),B):(e.consume(_),oe)}function ee(_){return _===s?(e.consume(_),s=void 0,te):_===null?n(_):Q(_)?(o=ee,fe(_)):(e.consume(_),ee)}function oe(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||ge(_)?q(_):(e.consume(_),oe)}function te(_){return _===47||_===62||ge(_)?q(_):n(_)}function ue(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function fe(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ye}function ye(_){return ae(_)?de(e,ce,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):ce(_)}function ce(_){return e.enter("htmlTextData"),o(_)}}const to={name:"labelEnd",resolveAll:$y,resolveTo:Ry,tokenize:Ny},Iy={tokenize:Ly},Py={tokenize:Fy},Oy={tokenize:Dy};function $y(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",t+=s}}return e.length!==n.length&&Qe(e,0,e.length,n),e}function Ry(e,t){let n=e.length,i=0,s,r,o,a;for(;n--;)if(s=e[n][1],r){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(r=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(o=n);const l={type:e[r][1].type==="labelLink"?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[r+i+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=st(a,e.slice(r+1,r+i+3)),a=st(a,[["enter",d,t]]),a=st(a,bs(t.parser.constructs.insideSpan.null,e.slice(r+i+4,o-3),t)),a=st(a,[["exit",d,t],e[o-2],e[o-1],["exit",c,t]]),a=st(a,e.slice(o+1)),a=st(a,[["exit",l,t]]),Qe(e,r,e.length,a),e}function Ny(e,t,n){const i=this;let s=i.events.length,r,o;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){r=i.events[s][1];break}return a;function a(h){return r?r._inactive?u(h):(o=i.parser.defined.includes(ht(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Iy,d,o?d:u)(h):h===91?e.attempt(Py,d,o?c:u)(h):o?d(h):u(h)}function c(h){return e.attempt(Oy,d,u)(h)}function d(h){return t(h)}function u(h){return r._balanced=!0,n(h)}}function Ly(e,t,n){return i;function i(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),s}function s(u){return ge(u)?Qn(e,r)(u):r(u)}function r(u){return u===41?d(u):wc(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function o(u){return ge(u)?Qn(e,l)(u):d(u)}function a(u){return n(u)}function l(u){return u===34||u===39||u===40?vc(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return ge(u)?Qn(e,d)(u):d(u)}function d(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function Fy(e,t,n){const i=this;return s;function s(a){return kc.call(i,e,r,o,"reference","referenceMarker","referenceString")(a)}function r(a){return i.parser.defined.includes(ht(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function Dy(e,t,n){return i;function i(r){return e.enter("reference"),e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),s}function s(r){return r===93?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}const zy={name:"labelStartImage",resolveAll:to.resolveAll,tokenize:My};function My(e,t,n){const i=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),r}function r(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}const jy={name:"labelStartLink",resolveAll:to.resolveAll,tokenize:By};function By(e,t,n){const i=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),r}function r(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const Ws={name:"lineEnding",tokenize:Uy};function Uy(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),de(e,t,"linePrefix")}}const Mi={name:"thematicBreak",tokenize:Hy};function Hy(e,t,n){let i=0,s;return r;function r(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||Q(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),i++,l):(e.exit("thematicBreakSequence"),ae(c)?de(e,a,"whitespace")(c):a(c))}}const We={continuation:{tokenize:Zy},exit:Gy,name:"list",tokenize:Vy},qy={partial:!0,tokenize:Yy},Wy={partial:!0,tokenize:Ky};function Vy(e,t,n){const i=this,s=i.events[i.events.length-1];let r=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(f){const m=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:wr(f)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Mi,n,c)(f):c(f);if(!i.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return wr(f)&&++o<10?(e.consume(f),l):(!i.interrupt||o<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,e.check(ci,i.interrupt?n:d,e.attempt(qy,h,u))}function d(f){return i.containerState.initialBlankLine=!0,r++,h(f)}function u(f){return ae(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return i.containerState.size=r+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Zy(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(ci,s,r);function s(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,de(e,t,"listItemIndent",i.containerState.size+1)(a)}function r(a){return i.containerState.furtherBlankLines||!ae(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Wy,t,o)(a))}function o(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,de(e,e.attempt(We,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ky(e,t,n){const i=this;return de(e,s,"listItemIndent",i.containerState.size+1);function s(r){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(r):n(r)}}function Gy(e){e.exit(this.containerState.type)}function Yy(e,t,n){const i=this;return de(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(r){const o=i.events[i.events.length-1];return!ae(r)&&o&&o[1].type==="listItemPrefixWhitespace"?t(r):n(r)}}const Ta={name:"setextUnderline",resolveTo:Jy,tokenize:Qy};function Jy(e,t){let n=e.length,i,s,r;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!r&&e[n][1].type==="definition"&&(r=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",r?(e.splice(s,0,["enter",o,t]),e.splice(r+1,0,["exit",e[i][1],t]),e[i][1].end={...e[r][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function Qy(e,t,n){const i=this;let s;return r;function r(c){let d=i.events.length,u;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){u=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||u)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ae(c)?de(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Q(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Xy={tokenize:ew};function ew(e){const t=this,n=e.attempt(ci,i,e.attempt(this.parser.constructs.flowInitial,s,de(e,e.attempt(this.parser.constructs.flow,s,e.attempt(ry,s)),"linePrefix")));return n;function i(r){if(r===null){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(r){if(r===null){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tw={resolveAll:xc()},nw=Sc("string"),iw=Sc("text");function Sc(e){return{resolveAll:xc(e==="text"?sw:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],r=n.attempt(s,o,a);return o;function o(d){return c(d)?r(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),r(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const u=s[d];let h=-1;if(u)for(;++h<u.length;){const f=u[h];if(!f.previous||f.previous.call(i,i.previous))return!0}return!1}}}function xc(e){return t;function t(n,i){let s=-1,r;for(;++s<=n.length;)r===void 0?n[s]&&n[s][1].type==="data"&&(r=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==r+2&&(n[r][1].end=n[s-1][1].end,n.splice(r+2,s-r-2),s=r+2),r=void 0);return e?e(n,i):n}}function sw(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],s=t.sliceStream(i);let r=s.length,o=-1,a=0,l;for(;r--;){const c=s[r];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){r++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?o:i.start._bufferIndex+o,_index:i.start._index+r,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const rw={42:We,43:We,45:We,48:We,49:We,50:We,51:We,52:We,53:We,54:We,55:We,56:We,57:We,62:mc},ow={91:uy},aw={[-2]:qs,[-1]:qs,32:qs},lw={35:gy,42:Mi,45:[Ta,Mi],60:ky,61:Ta,95:Mi,96:Ca,126:Ca},cw={38:bc,92:gc},uw={[-5]:Ws,[-4]:Ws,[-3]:Ws,33:zy,38:bc,42:kr,60:[jb,Ty],91:jy,92:[py,gc],93:to,95:kr,96:Xb},dw={null:[kr,tw]},fw={null:[42,95]},hw={null:[]},pw=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fw,contentInitial:ow,disable:hw,document:rw,flow:lw,flowInitial:aw,insideSpan:dw,string:cw,text:uw},Symbol.toStringTag,{value:"Module"}));function mw(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},r=[];let o=[],a=[];const l={attempt:A($),check:A(v),consume:T,enter:S,exit:C,interrupt:A(v,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:u};let d=t.tokenize.call(c,l);return t.resolveAll&&r.push(t),c;function u(U){return o=st(o,U),b(),o[o.length-1]!==null?[]:(P(t,0),c.events=bs(r,c.events,c),c.events)}function h(U,B){return bw(f(U),B)}function f(U){return gw(o,U)}function m(){const{_bufferIndex:U,_index:B,line:ee,column:oe,offset:te}=i;return{_bufferIndex:U,_index:B,line:ee,column:oe,offset:te}}function p(U){s[U.line]=U.column,R()}function b(){let U;for(;i._index<o.length;){const B=o[i._index];if(typeof B=="string")for(U=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===U&&i._bufferIndex<B.length;)w(B.charCodeAt(i._bufferIndex));else w(B)}}function w(U){d=d(U)}function T(U){Q(U)?(i.line++,i.column=1,i.offset+=U===-3?2:1,R()):U!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=U}function S(U,B){const ee=B||{};return ee.type=U,ee.start=m(),c.events.push(["enter",ee,c]),a.push(ee),ee}function C(U){const B=a.pop();return B.end=m(),c.events.push(["exit",B,c]),B}function $(U,B){P(U,B.from)}function v(U,B){B.restore()}function A(U,B){return ee;function ee(oe,te,ue){let fe,ye,ce,_;return Array.isArray(oe)?I(oe):"tokenize"in oe?I([oe]):E(oe);function E(H){return X;function X(ne){const pe=ne!==null&&H[ne],we=ne!==null&&H.null,qe=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(we)?we:we?[we]:[]];return I(qe)(ne)}}function I(H){return fe=H,ye=0,H.length===0?ue:y(H[ye])}function y(H){return X;function X(ne){return _=q(),ce=H,H.partial||(c.currentConstruct=H),H.name&&c.parser.constructs.disable.null.includes(H.name)?W():H.tokenize.call(B?Object.assign(Object.create(c),B):c,l,z,W)(ne)}}function z(H){return U(ce,_),te}function W(H){return _.restore(),++ye<fe.length?y(fe[ye]):ue}}}function P(U,B){U.resolveAll&&!r.includes(U)&&r.push(U),U.resolve&&Qe(c.events,B,c.events.length-B,U.resolve(c.events.slice(B),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function q(){const U=m(),B=c.previous,ee=c.currentConstruct,oe=c.events.length,te=Array.from(a);return{from:oe,restore:ue};function ue(){i=U,c.previous=B,c.currentConstruct=ee,c.events.length=oe,a=te,R()}}function R(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function gw(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,r=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(i,r)];else{if(o=e.slice(n,s),i>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(i):o.shift()}r>0&&o.push(e[s].slice(0,r))}return o}function bw(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const r=e[n];let o;if(typeof r=="string")o=r;else switch(r){case-5:{o="\r";break}case-4:{o=`
68
+ `;break}case-3:{o=`\r
69
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(r)}s=r===-2,i.push(o)}return i.join("")}function yw(e){const i={constructs:hc([pw,...(e||{}).extensions||[]]),content:s(Rb),defined:[],document:s(Lb),flow:s(Xy),lazy:{},string:s(nw),text:s(iw)};return i;function s(r){return o;function o(a){return mw(i,r,a)}}}function ww(e){for(;!yc(e););return e}const Ea=/[\0\t\n\r]/g;function kw(){let e=1,t="",n=!0,i;return s;function s(r,o,a){const l=[];let c,d,u,h,f;for(r=t+(typeof r=="string"?r.toString():new TextDecoder(o||void 0).decode(r)),u=0,t="",n&&(r.charCodeAt(0)===65279&&u++,n=void 0);u<r.length;){if(Ea.lastIndex=u,c=Ea.exec(r),h=c&&c.index!==void 0?c.index:r.length,f=r.charCodeAt(h),!c){t=r.slice(u);break}if(f===10&&u===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),u<h&&(l.push(r.slice(u,h)),e+=h-u),f){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:i=!0,e=1}u=h+1}return a&&(i&&l.push(-5),t&&l.push(t),l.push(null)),l}}const vw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _c(e){return e.replace(vw,Sw)}function Sw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),r=s===120||s===88;return pc(n.slice(r?2:1),r?16:10)}return eo(n)||e}const Cc={}.hasOwnProperty;function xw(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_w(n)(ww(yw(n).document().write(kw()(e,t,!0))))}function _w(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(mt),autolinkProtocol:q,autolinkEmail:q,atxHeading:r(en),blockQuote:r(we),characterEscape:q,characterReference:q,codeFenced:r(qe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(qe,o),codeText:r(Ce,o),codeTextData:q,data:q,codeFlowValue:q,definition:r(De),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(Xt),hardBreakEscape:r(jn),hardBreakTrailing:r(jn),htmlFlow:r(et,o),htmlFlowData:q,htmlText:r(et,o),htmlTextData:q,image:r(Bn),label:o,link:r(mt),listItem:r(Un),listItemValue:h,listOrdered:r(pi,u),listUnordered:r(pi),paragraph:r(gt),reference:y,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(en),strong:r(tn),thematicBreak:r(mi)},exit:{atxHeading:l(),atxHeadingSequence:$,autolink:l(),autolinkEmail:pe,autolinkProtocol:ne,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:H,characterReference:X,codeFenced:l(b),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(w),codeText:l(te),codeTextData:R,data:R,definition:l(),definitionDestinationString:C,definitionLabelString:T,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(ee),htmlFlowData:R,htmlText:l(oe),htmlTextData:R,image:l(fe),label:ce,labelText:ye,lineEnding:U,link:l(ue),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:z,resourceDestinationString:_,resourceTitleString:E,resource:I,setextHeading:l(P),setextHeadingLineSequence:A,setextHeadingText:v,strong:l(),thematicBreak:l()}};Ac(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(F){let M={type:"root",children:[]};const G={stack:[M],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:d,data:n},le=[];let he=-1;for(;++he<F.length;)if(F[he][1].type==="listOrdered"||F[he][1].type==="listUnordered")if(F[he][0]==="enter")le.push(he);else{const Ge=le.pop();he=s(F,Ge,he)}for(he=-1;++he<F.length;){const Ge=t[F[he][0]];Cc.call(Ge,F[he][1].type)&&Ge[F[he][1].type].call(Object.assign({sliceSerialize:F[he][2].sliceSerialize},G),F[he][1])}if(G.tokenStack.length>0){const Ge=G.tokenStack[G.tokenStack.length-1];(Ge[1]||Ia).call(G,void 0,Ge[0])}for(M.position={start:$t(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:$t(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)M=t.transforms[he](M)||M;return M}function s(F,M,G){let le=M-1,he=-1,Ge=!1,bt,tt,xt,Ye;for(;++le<=G;){const Le=F[le];switch(Le[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Le[0]==="enter"?he++:he--,Ye=void 0;break}case"lineEndingBlank":{Le[0]==="enter"&&(bt&&!Ye&&!he&&!xt&&(xt=le),Ye=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ye=void 0}if(!he&&Le[0]==="enter"&&Le[1].type==="listItemPrefix"||he===-1&&Le[0]==="exit"&&(Le[1].type==="listUnordered"||Le[1].type==="listOrdered")){if(bt){let nt=le;for(tt=void 0;nt--;){const ct=F[nt];if(ct[1].type==="lineEnding"||ct[1].type==="lineEndingBlank"){if(ct[0]==="exit")continue;tt&&(F[tt][1].type="lineEndingBlank",Ge=!0),ct[1].type="lineEnding",tt=nt}else if(!(ct[1].type==="linePrefix"||ct[1].type==="blockQuotePrefix"||ct[1].type==="blockQuotePrefixWhitespace"||ct[1].type==="blockQuoteMarker"||ct[1].type==="listItemIndent"))break}xt&&(!tt||xt<tt)&&(bt._spread=!0),bt.end=Object.assign({},tt?F[tt][1].start:Le[1].end),F.splice(tt||le,0,["exit",bt,Le[2]]),le++,G++}if(Le[1].type==="listItemPrefix"){const nt={type:"listItem",_spread:!1,start:Object.assign({},Le[1].start),end:void 0};bt=nt,F.splice(le,0,["enter",nt,Le[2]]),le++,G++,xt=void 0,Ye=!0}}}return F[M][1]._spread=Ge,G}function r(F,M){return G;function G(le){a.call(this,F(le),le),M&&M.call(this,le)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(F,M,G){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([M,G||void 0]),F.position={start:$t(M.start),end:void 0}}function l(F){return M;function M(G){F&&F.call(this,G),c.call(this,G)}}function c(F,M){const G=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==F.type&&(M?M.call(this,F,le[0]):(le[1]||Ia).call(this,F,le[0]));else throw new Error("Cannot close `"+F.type+"` ("+Jn({start:F.start,end:F.end})+"): it’s not open");G.position.end=$t(F.end)}function d(){return Xr(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function h(F){if(this.data.expectingFirstListItemValue){const M=this.stack[this.stack.length-2];M.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function f(){const F=this.resume(),M=this.stack[this.stack.length-1];M.lang=F}function m(){const F=this.resume(),M=this.stack[this.stack.length-1];M.meta=F}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const F=this.resume(),M=this.stack[this.stack.length-1];M.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const F=this.resume(),M=this.stack[this.stack.length-1];M.value=F.replace(/(\r?\n|\r)$/g,"")}function T(F){const M=this.resume(),G=this.stack[this.stack.length-1];G.label=M,G.identifier=ht(this.sliceSerialize(F)).toLowerCase()}function S(){const F=this.resume(),M=this.stack[this.stack.length-1];M.title=F}function C(){const F=this.resume(),M=this.stack[this.stack.length-1];M.url=F}function $(F){const M=this.stack[this.stack.length-1];if(!M.depth){const G=this.sliceSerialize(F).length;M.depth=G}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function A(F){const M=this.stack[this.stack.length-1];M.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function q(F){const G=this.stack[this.stack.length-1].children;let le=G[G.length-1];(!le||le.type!=="text")&&(le=jt(),le.position={start:$t(F.start),end:void 0},G.push(le)),this.stack.push(le)}function R(F){const M=this.stack.pop();M.value+=this.sliceSerialize(F),M.position.end=$t(F.end)}function U(F){const M=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=M.children[M.children.length-1];G.position.end=$t(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(M.type)&&(q.call(this,F),R.call(this,F))}function B(){this.data.atHardBreak=!0}function ee(){const F=this.resume(),M=this.stack[this.stack.length-1];M.value=F}function oe(){const F=this.resume(),M=this.stack[this.stack.length-1];M.value=F}function te(){const F=this.resume(),M=this.stack[this.stack.length-1];M.value=F}function ue(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const M=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=M,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function fe(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const M=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=M,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function ye(F){const M=this.sliceSerialize(F),G=this.stack[this.stack.length-2];G.label=_c(M),G.identifier=ht(M).toLowerCase()}function ce(){const F=this.stack[this.stack.length-1],M=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const le=F.children;G.children=le}else G.alt=M}function _(){const F=this.resume(),M=this.stack[this.stack.length-1];M.url=F}function E(){const F=this.resume(),M=this.stack[this.stack.length-1];M.title=F}function I(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function z(F){const M=this.resume(),G=this.stack[this.stack.length-1];G.label=M,G.identifier=ht(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function W(F){this.data.characterReferenceType=F.type}function H(F){const M=this.sliceSerialize(F),G=this.data.characterReferenceType;let le;G?(le=pc(M,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=eo(M);const he=this.stack[this.stack.length-1];he.value+=le}function X(F){const M=this.stack.pop();M.position.end=$t(F.end)}function ne(F){R.call(this,F);const M=this.stack[this.stack.length-1];M.url=this.sliceSerialize(F)}function pe(F){R.call(this,F);const M=this.stack[this.stack.length-1];M.url="mailto:"+this.sliceSerialize(F)}function we(){return{type:"blockquote",children:[]}}function qe(){return{type:"code",lang:null,meta:null,value:""}}function Ce(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xt(){return{type:"emphasis",children:[]}}function en(){return{type:"heading",depth:0,children:[]}}function jn(){return{type:"break"}}function et(){return{type:"html",value:""}}function Bn(){return{type:"image",title:null,url:"",alt:null}}function mt(){return{type:"link",title:null,url:"",children:[]}}function pi(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function Un(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function gt(){return{type:"paragraph",children:[]}}function tn(){return{type:"strong",children:[]}}function jt(){return{type:"text",value:""}}function mi(){return{type:"thematicBreak"}}}function $t(e){return{line:e.line,column:e.column,offset:e.offset}}function Ac(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Ac(e,i):Cw(e,i)}}function Cw(e,t){let n;for(n in t)if(Cc.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Ia(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Jn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Jn({start:t.start,end:t.end})+") is still open")}function Aw(e){const t=this;t.parser=n;function n(i){return xw(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const Pa={}.hasOwnProperty;function Tw(e,t){const n=t||{};function i(s,...r){let o=i.invalid;const a=i.handlers;if(s&&Pa.call(s,e)){const l=String(s[e]);o=Pa.call(a,l)?a[l]:i.unknown}if(o)return o.call(this,s,...r)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const Ew={}.hasOwnProperty;function Tc(e,t){let n=-1,i;if(t.extensions)for(;++n<t.extensions.length;)Tc(e,t.extensions[n]);for(i in t)if(Ew.call(t,i))switch(i){case"extensions":break;case"unsafe":{Oa(e[i],t[i]);break}case"join":{Oa(e[i],t[i]);break}case"handlers":{Iw(e[i],t[i]);break}default:e.options[i]=t[i]}return e}function Oa(e,t){t&&e.push(...t)}function Iw(e,t){t&&Object.assign(e,t)}function Pw(e,t,n,i){const s=n.enter("blockquote"),r=n.createTracker(i);r.move("> "),r.shift(2);const o=n.indentLines(n.containerFlow(e,r.current()),Ow);return s(),o}function Ow(e,t,n){return">"+(n?"":" ")+e}function Ec(e,t){return $a(e,t.inConstruct,!0)&&!$a(e,t.notInConstruct,!1)}function $a(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Ra(e,t,n,i){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
70
+ `&&Ec(n.stack,n.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
71
+ `}function $w(e,t){const n=String(e);let i=n.indexOf(t),s=i,r=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++r>o&&(o=r):r=1,s=i+t.length,i=n.indexOf(t,s);return o}function vr(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Rw(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Nw(e,t,n,i){const s=Rw(n),r=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(vr(e,n)){const u=n.enter("codeIndented"),h=n.indentLines(r,Lw);return u(),h}const a=n.createTracker(i),l=s.repeat(Math.max($w(r,s)+1,3)),c=n.enter("codeFenced");let d=a.move(l);if(e.lang){const u=n.enter(`codeFencedLang${o}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${o}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
72
+ `,encode:["`"],...a.current()})),u()}return d+=a.move(`
73
+ `),r&&(d+=a.move(r+`
74
+ `)),d+=a.move(l),c(),d}function Lw(e,t,n){return(n?"":" ")+e}function no(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Fw(e,t,n,i){const s=no(n),r=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
75
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),o(),c}function Dw(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ft(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ss(e,t,n){const i=Tn(e),s=Tn(t);return i===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ic.peek=zw;function Ic(e,t,n,i){const s=Dw(n),r=n.enter("emphasis"),o=n.createTracker(i),a=o.move(s);let l=o.move(n.containerPhrasing(e,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),d=ss(i.before.charCodeAt(i.before.length-1),c,s);d.inside&&(l=Ft(c)+l.slice(1));const u=l.charCodeAt(l.length-1),h=ss(i.after.charCodeAt(0),u,s);h.inside&&(l=l.slice(0,-1)+Ft(u));const f=o.move(s);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+f}function zw(e,t,n){return n.options.emphasis||"*"}const ys=(function(e){if(e==null)return Uw;if(typeof e=="function")return ws(e);if(typeof e=="object")return Array.isArray(e)?Mw(e):jw(e);if(typeof e=="string")return Bw(e);throw new Error("Expected function, string, or object as test")});function Mw(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ys(e[n]);return ws(i);function i(...s){let r=-1;for(;++r<t.length;)if(t[r].apply(this,s))return!0;return!1}}function jw(e){const t=e;return ws(n);function n(i){const s=i;let r;for(r in e)if(s[r]!==t[r])return!1;return!0}}function Bw(e){return ws(t);function t(n){return n&&n.type===e}}function ws(e){return t;function t(n,i,s){return!!(Hw(n)&&e.call(this,n,typeof i=="number"?i:void 0,s||void 0))}}function Uw(){return!0}function Hw(e){return e!==null&&typeof e=="object"&&"type"in e}const Pc=[],qw=!0,Sr=!1,Ww="skip";function Oc(e,t,n,i){let s;typeof t=="function"&&typeof n!="function"?(i=n,n=t):s=t;const r=ys(s),o=i?-1:1;a(e,void 0,[])();function a(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const f=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=Pc,m,p,b;if((!t||r(l,c,d[d.length-1]||void 0))&&(f=Vw(n(l,d)),f[0]===Sr))return f;if("children"in l&&l.children){const w=l;if(w.children&&f[0]!==Ww)for(p=(i?w.children.length:-1)+o,b=d.concat(w);p>-1&&p<w.children.length;){const T=w.children[p];if(m=a(T,p,b)(),m[0]===Sr)return m;p=typeof m[1]=="number"?m[1]:p+o}}return f}}}function Vw(e){return Array.isArray(e)?e:typeof e=="number"?[qw,e]:e==null?Pc:[e]}function Zw(e,t,n,i){let s,r,o;typeof t=="function"&&typeof n!="function"?(r=void 0,o=t,s=n):(r=t,o=n,s=i),Oc(e,r,a,s);function a(l,c){const d=c[c.length-1],u=d?d.children.indexOf(l):void 0;return o(l,u,d)}}function $c(e,t){let n=!1;return Zw(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Sr}),!!((!e.depth||e.depth<3)&&Xr(e)&&(t.options.setext||n))}function Kw(e,t,n,i){const s=Math.max(Math.min(6,e.depth||1),1),r=n.createTracker(i);if($c(e,n)){const d=n.enter("headingSetext"),u=n.enter("phrasing"),h=n.containerPhrasing(e,{...r.current(),before:`
76
+ `,after:`
77
+ `});return u(),d(),h+`
78
+ `+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
79
+ `))+1))}const o="#".repeat(s),a=n.enter("headingAtx"),l=n.enter("phrasing");r.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
80
+ `,...r.current()});return/^[\t ]/.test(c)&&(c=Ft(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}Rc.peek=Gw;function Rc(e){return e.value||""}function Gw(){return"<"}Nc.peek=Yw;function Nc(e,t,n,i){const s=no(n),r=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),c+=l.move(")"),o(),c}function Yw(){return"!"}Lc.peek=Jw;function Lc(e,t,n,i){const s=e.referenceType,r=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,r(),s==="full"||!c||c!==u?l+=a.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Jw(){return"!"}Fc.peek=Qw;function Fc(e,t,n){let i=e.value||"",s="`",r=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++r<n.unsafe.length;){const o=n.unsafe[r],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(i);){let c=l.index;i.charCodeAt(c)===10&&i.charCodeAt(c-1)===13&&c--,i=i.slice(0,c)+" "+i.slice(l.index+1)}}return s+i+s}function Qw(){return"`"}function Dc(e,t){const n=Xr(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}zc.peek=Xw;function zc(e,t,n,i){const s=no(n),r=s==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let a,l;if(Dc(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let u=o.move("<");return u+=o.move(n.containerPhrasing(e,{before:u,after:">",...o.current()})),u+=o.move(">"),a(),n.stack=d,u}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${r}`),c+=o.move(" "+s),c+=o.move(n.safe(e.title,{before:c,after:s,...o.current()})),c+=o.move(s),l()),c+=o.move(")"),a(),c}function Xw(e,t,n){return Dc(e,n)?"<":"["}Mc.peek=ek;function Mc(e,t,n,i){const s=e.referenceType,r=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,r(),s==="full"||!c||c!==u?l+=a.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function ek(){return"["}function io(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function tk(e){const t=io(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function nk(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function jc(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ik(e,t,n,i){const s=n.enter("list"),r=n.bulletCurrent;let o=e.ordered?nk(n):io(n);const a=e.ordered?o==="."?")":".":tk(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),jc(n)===o&&d){let u=-1;for(;++u<e.children.length;){const h=e.children[u];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=r,s(),c}function sk(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function rk(e,t,n,i){const s=sk(n);let r=n.bulletCurrent||io(n);t&&t.type==="list"&&t.ordered&&(r=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+r);let o=r.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(i);a.move(r+" ".repeat(o-r.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),d);return l(),c;function d(u,h,f){return h?(f?"":" ".repeat(o))+u:(f?r:r+" ".repeat(o-r.length))+u}}function ok(e,t,n,i){const s=n.enter("paragraph"),r=n.enter("phrasing"),o=n.containerPhrasing(e,i);return r(),s(),o}const ak=ys(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function lk(e,t,n,i){return(e.children.some(function(o){return ak(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function ck(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Bc.peek=uk;function Bc(e,t,n,i){const s=ck(n),r=n.enter("strong"),o=n.createTracker(i),a=o.move(s+s);let l=o.move(n.containerPhrasing(e,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),d=ss(i.before.charCodeAt(i.before.length-1),c,s);d.inside&&(l=Ft(c)+l.slice(1));const u=l.charCodeAt(l.length-1),h=ss(i.after.charCodeAt(0),u,s);h.inside&&(l=l.slice(0,-1)+Ft(u));const f=o.move(s+s);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+f}function uk(e,t,n){return n.options.strong||"*"}function dk(e,t,n,i){return n.safe(e.value,i)}function fk(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function hk(e,t,n){const i=(jc(n)+(n.options.ruleSpaces?" ":"")).repeat(fk(n));return n.options.ruleSpaces?i.slice(0,-1):i}const so={blockquote:Pw,break:Ra,code:Nw,definition:Fw,emphasis:Ic,hardBreak:Ra,heading:Kw,html:Rc,image:Nc,imageReference:Lc,inlineCode:Fc,link:zc,linkReference:Mc,list:ik,listItem:rk,paragraph:ok,root:lk,strong:Bc,text:dk,thematicBreak:hk},pk=[mk];function mk(e,t,n,i){if(t.type==="code"&&vr(t,i)&&(e.type==="list"||e.type===t.type&&vr(e,i)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&$c(t,i))?void 0:n.spread?1:0}const Bt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],gk=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
81
+ `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Bt},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
82
+ ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Bt},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
83
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:Bt},{atBreak:!0,character:"+",after:`(?:[ \r
84
+ ])`},{atBreak:!0,character:"-",after:`(?:[ \r
85
+ -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
86
+ ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Bt},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Bt},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Bt},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Bt},{atBreak:!0,character:"~"}];function bk(e){return e.label||!e.identifier?e.label||"":_c(e.identifier)}function yk(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function wk(e,t,n){const i=t.indexStack,s=e.children||[],r=[];let o=-1,a=n.before,l;i.push(-1);let c=t.createTracker(n);for(;++o<s.length;){const d=s[o];let u;if(i[i.length-1]=o,o+1<s.length){let m=t.handle.handlers[s[o+1].type];m&&m.peek&&(m=m.peek),u=m?m(s[o+1],e,t,{before:"",after:"",...c.current()}).charAt(0):""}else u=n.after;r.length>0&&(a==="\r"||a===`
87
+ `)&&d.type==="html"&&(r[r.length-1]=r[r.length-1].replace(/(\r?\n|\r)$/," "),a=" ",c=t.createTracker(n),c.move(r.join("")));let h=t.handle(d,e,t,{...c.current(),after:u,before:a});l&&l===h.slice(0,1)&&(h=Ft(l.charCodeAt(0))+h.slice(1));const f=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,l=void 0,f&&(r.length>0&&f.before&&a===r[r.length-1].slice(-1)&&(r[r.length-1]=r[r.length-1].slice(0,-1)+Ft(a.charCodeAt(0))),f.after&&(l=u)),c.move(h),r.push(h),a=h.slice(-1)}return i.pop(),r.join("")}function kk(e,t,n){const i=t.indexStack,s=e.children||[],r=t.createTracker(n),o=[];let a=-1;for(i.push(-1);++a<s.length;){const l=s[a];i[i.length-1]=a,o.push(r.move(t.handle(l,e,t,{before:`
88
+ `,after:`
89
+ `,...r.current()}))),l.type!=="list"&&(t.bulletLastUsed=void 0),a<s.length-1&&o.push(r.move(vk(l,s[a+1],e,t)))}return i.pop(),o.join("")}function vk(e,t,n,i){let s=i.join.length;for(;s--;){const r=i.join[s](e,t,n,i);if(r===!0||r===1)break;if(typeof r=="number")return`
90
+ `.repeat(1+r);if(r===!1)return`
91
+
92
+ <!---->
93
+
94
+ `}return`
95
+
96
+ `}const Sk=/\r?\n|\r/g;function xk(e,t){const n=[];let i=0,s=0,r;for(;r=Sk.exec(e);)o(e.slice(i,r.index)),n.push(r[0]),i=r.index+r[0].length,s++;return o(e.slice(i)),n.join("");function o(a){n.push(t(a,s,!a))}}function _k(e,t,n){const i=(n.before||"")+(t||"")+(n.after||""),s=[],r=[],o={};let a=-1;for(;++a<e.unsafe.length;){const d=e.unsafe[a];if(!Ec(e.stack,d))continue;const u=e.compilePattern(d);let h;for(;h=u.exec(i);){const f="before"in d||!!d.atBreak,m="after"in d,p=h.index+(f?h[1].length:0);s.includes(p)?(o[p].before&&!f&&(o[p].before=!1),o[p].after&&!m&&(o[p].after=!1)):(s.push(p),o[p]={before:f,after:m})}}s.sort(Ck);let l=n.before?n.before.length:0;const c=i.length-(n.after?n.after.length:0);for(a=-1;++a<s.length;){const d=s[a];d<l||d>=c||d+1<c&&s[a+1]===d+1&&o[d].after&&!o[d+1].before&&!o[d+1].after||s[a-1]===d-1&&o[d].before&&!o[d-1].before&&!o[d-1].after||(l!==d&&r.push(Na(i.slice(l,d),"\\")),l=d,/[!-/:-@[-`{-~]/.test(i.charAt(d))&&(!n.encode||!n.encode.includes(i.charAt(d)))?r.push("\\"):(r.push(Ft(i.charCodeAt(d))),l++))}return r.push(Na(i.slice(l,c),n.after)),r.join("")}function Ck(e,t){return e-t}function Na(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,i=[],s=[],r=e+t;let o=-1,a=0,l;for(;l=n.exec(r);)i.push(l.index);for(;++o<i.length;)a!==i[o]&&s.push(e.slice(a,i[o])),s.push("\\"),a=i[o];return s.push(e.slice(a)),s.join("")}function Ak(e){const t=e||{},n=t.now||{};let i=t.lineShift||0,s=n.line||1,r=n.column||1;return{move:l,current:o,shift:a};function o(){return{now:{line:s,column:r},lineShift:i}}function a(c){i+=c}function l(c){const d=c||"",u=d.split(/\r?\n|\r/g),h=u[u.length-1];return s+=u.length-1,r=u.length===1?r+h.length:1+h.length+i,d}}function Tk(e,t){const n=t||{},i={associationId:bk,containerPhrasing:Ok,containerFlow:$k,createTracker:Ak,compilePattern:yk,enter:r,handlers:{...so},handle:void 0,indentLines:xk,indexStack:[],join:[...pk],options:{},safe:Rk,stack:[],unsafe:[...gk]};Tc(i,n),i.options.tightDefinitions&&i.join.push(Pk),i.handle=Tw("type",{invalid:Ek,unknown:Ik,handlers:i.handlers});let s=i.handle(e,void 0,i,{before:`
97
+ `,after:`
98
+ `,now:{line:1,column:1},lineShift:0});return s&&s.charCodeAt(s.length-1)!==10&&s.charCodeAt(s.length-1)!==13&&(s+=`
99
+ `),s;function r(o){return i.stack.push(o),a;function a(){i.stack.pop()}}}function Ek(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function Ik(e){const t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function Pk(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function Ok(e,t){return wk(e,this,t)}function $k(e,t){return kk(e,this,t)}function Rk(e,t){return _k(this,e,t)}function Nk(e){const t=this;t.compiler=n;function n(i){return Tk(i,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function La(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,s=n.indexOf(t);for(;s!==-1;)i++,s=n.indexOf(t,s+t.length);return i}function Lk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Fk(e,t,n){const s=ys((n||{}).ignore||[]),r=Dk(t);let o=-1;for(;++o<r.length;)Oc(e,"text",a);function a(c,d){let u=-1,h;for(;++u<d.length;){const f=d[u],m=h?h.children:void 0;if(s(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(c,d)}function l(c,d){const u=d[d.length-1],h=r[o][0],f=r[o][1];let m=0;const b=u.children.indexOf(c);let w=!1,T=[];h.lastIndex=0;let S=h.exec(c.value);for(;S;){const C=S.index,$={index:S.index,input:S.input,stack:[...d,c]};let v=f(...S,$);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?h.lastIndex=C+1:(m!==C&&T.push({type:"text",value:c.value.slice(m,C)}),Array.isArray(v)?T.push(...v):v&&T.push(v),m=C+S[0].length,w=!0),!h.global)break;S=h.exec(c.value)}return w?(m<c.value.length&&T.push({type:"text",value:c.value.slice(m)}),u.children.splice(b,1,...T)):T=[c],b+T.length}}function Dk(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const s=n[i];t.push([zk(s[0]),Mk(s[1])])}return t}function zk(e){return typeof e=="string"?new RegExp(Lk(e),"g"):e}function Mk(e){return typeof e=="function"?e:function(){return e}}const Vs="phrasing",Zs=["autolink","link","image","label"];function jk(){return{transforms:[Zk],enter:{literalAutolink:Uk,literalAutolinkEmail:Ks,literalAutolinkHttp:Ks,literalAutolinkWww:Ks},exit:{literalAutolink:Vk,literalAutolinkEmail:Wk,literalAutolinkHttp:Hk,literalAutolinkWww:qk}}}function Bk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vs,notInConstruct:Zs},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vs,notInConstruct:Zs},{character:":",before:"[ps]",after:"\\/",inConstruct:Vs,notInConstruct:Zs}]}}function Uk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ks(e){this.config.enter.autolinkProtocol.call(this,e)}function Hk(e){this.config.exit.autolinkProtocol.call(this,e)}function qk(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Wk(e){this.config.exit.autolinkEmail.call(this,e)}function Vk(e){this.exit(e)}function Zk(e){Fk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Kk],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Gk]],{ignore:["link","linkReference"]})}function Kk(e,t,n,i,s){let r="";if(!Uc(s)||(/^w/i.test(t)&&(n=t+n,t="",r="http://"),!Yk(n)))return!1;const o=Jk(n+i);if(!o[0])return!1;const a={type:"link",title:null,url:r+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Gk(e,t,n,i){return!Uc(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Yk(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Jk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const s=La(e,"(");let r=La(e,")");for(;i!==-1&&s>r;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),r++;return[e,n]}function Uc(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gt(n)||gs(n))&&(!t||n!==47)}Hc.peek=ov;function Qk(){this.buffer()}function Xk(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ev(){this.buffer()}function tv(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function nv(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ht(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iv(e){this.exit(e)}function sv(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ht(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rv(e){this.exit(e)}function ov(){return"["}function Hc(e,t,n,i){const s=n.createTracker(i);let r=s.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return r+=s.move(n.safe(n.associationId(e),{after:"]",before:r})),a(),o(),r+=s.move("]"),r}function av(){return{enter:{gfmFootnoteCallString:Qk,gfmFootnoteCall:Xk,gfmFootnoteDefinitionLabelString:ev,gfmFootnoteDefinition:tv},exit:{gfmFootnoteCallString:nv,gfmFootnoteCall:iv,gfmFootnoteDefinitionLabelString:sv,gfmFootnoteDefinition:rv}}}function lv(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Hc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,s,r,o){const a=r.createTracker(o);let l=a.move("[^");const c=r.enter("footnoteDefinition"),d=r.enter("label");return l+=a.move(r.safe(r.associationId(i),{before:l,after:"]"})),d(),l+=a.move("]:"),i.children&&i.children.length>0&&(a.shift(4),l+=a.move((t?`
100
+ `:" ")+r.indentLines(r.containerFlow(i,a.current()),t?qc:cv))),c(),l}}function cv(e,t,n){return t===0?e:qc(e,t,n)}function qc(e,t,n){return(n?"":" ")+e}const uv=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Wc.peek=mv;function dv(){return{canContainEols:["delete"],enter:{strikethrough:hv},exit:{strikethrough:pv}}}function fv(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:uv}],handlers:{delete:Wc}}}function hv(e){this.enter({type:"delete",children:[]},e)}function pv(e){this.exit(e)}function Wc(e,t,n,i){const s=n.createTracker(i),r=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),r(),o}function mv(){return"~"}function gv(e){return e.length}function bv(e,t){const n=t||{},i=(n.align||[]).concat(),s=n.stringLength||gv,r=[],o=[],a=[],l=[];let c=0,d=-1;for(;++d<e.length;){const p=[],b=[];let w=-1;for(e[d].length>c&&(c=e[d].length);++w<e[d].length;){const T=yv(e[d][w]);if(n.alignDelimiters!==!1){const S=s(T);b[w]=S,(l[w]===void 0||S>l[w])&&(l[w]=S)}p.push(T)}o[d]=p,a[d]=b}let u=-1;if(typeof i=="object"&&"length"in i)for(;++u<c;)r[u]=Fa(i[u]);else{const p=Fa(i);for(;++u<c;)r[u]=p}u=-1;const h=[],f=[];for(;++u<c;){const p=r[u];let b="",w="";p===99?(b=":",w=":"):p===108?b=":":p===114&&(w=":");let T=n.alignDelimiters===!1?1:Math.max(1,l[u]-b.length-w.length);const S=b+"-".repeat(T)+w;n.alignDelimiters!==!1&&(T=b.length+T+w.length,T>l[u]&&(l[u]=T),f[u]=T),h[u]=S}o.splice(1,0,h),a.splice(1,0,f),d=-1;const m=[];for(;++d<o.length;){const p=o[d],b=a[d];u=-1;const w=[];for(;++u<c;){const T=p[u]||"";let S="",C="";if(n.alignDelimiters!==!1){const $=l[u]-(b[u]||0),v=r[u];v===114?S=" ".repeat($):v===99?$%2?(S=" ".repeat($/2+.5),C=" ".repeat($/2-.5)):(S=" ".repeat($/2),C=S):C=" ".repeat($)}n.delimiterStart!==!1&&!u&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||u)&&w.push(" "),n.alignDelimiters!==!1&&w.push(S),w.push(T),n.alignDelimiters!==!1&&w.push(C),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&w.push("|")}m.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return m.join(`
101
+ `)}function yv(e){return e==null?"":String(e)}function Fa(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function wv(){return{enter:{table:kv,tableData:Da,tableHeader:Da,tableRow:Sv},exit:{codeText:xv,table:vv,tableData:Gs,tableHeader:Gs,tableRow:Gs}}}function kv(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function vv(e){this.exit(e),this.data.inTable=void 0}function Sv(e){this.enter({type:"tableRow",children:[]},e)}function Gs(e){this.exit(e)}function Da(e){this.enter({type:"tableCell",children:[]},e)}function xv(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_v));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _v(e,t){return t==="|"?t:e}function Cv(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,s=t.stringLength,r=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
102
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(f,m,p,b){return c(d(f,p,b),f.align)}function a(f,m,p,b){const w=u(f,p,b),T=c([w]);return T.slice(0,T.indexOf(`
103
+ `))}function l(f,m,p,b){const w=p.enter("tableCell"),T=p.enter("phrasing"),S=p.containerPhrasing(f,{...b,before:r,after:r});return T(),w(),S}function c(f,m){return bv(f,{align:m,alignDelimiters:i,padding:n,stringLength:s})}function d(f,m,p){const b=f.children;let w=-1;const T=[],S=m.enter("table");for(;++w<b.length;)T[w]=u(b[w],m,p);return S(),T}function u(f,m,p){const b=f.children;let w=-1;const T=[],S=m.enter("tableRow");for(;++w<b.length;)T[w]=l(b[w],f,m,p);return S(),T}function h(f,m,p){let b=so.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function Av(){return{exit:{taskListCheckValueChecked:za,taskListCheckValueUnchecked:za,paragraph:Ev}}}function Tv(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Iv}}}function za(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Ev(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const s=t.children;let r=-1,o;for(;++r<s.length;){const a=s[r];if(a.type==="paragraph"){o=a;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function Iv(e,t,n,i){const s=e.children[0],r=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(i);r&&a.move(o);let l=so.listItem(e,t,n,{...i,...a.current()});return r&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(d){return d+o}}function Pv(){return[jk(),av(),dv(),wv(),Av()]}function Ov(e){return{extensions:[Bk(),lv(e),fv(),Cv(e),Tv()]}}const $v={tokenize:zv,partial:!0},Vc={tokenize:Mv,partial:!0},Zc={tokenize:jv,partial:!0},Kc={tokenize:Bv,partial:!0},Rv={tokenize:Uv,partial:!0},Gc={name:"wwwAutolink",tokenize:Fv,previous:Jc},Yc={name:"protocolAutolink",tokenize:Dv,previous:Qc},Pt={name:"emailAutolink",tokenize:Lv,previous:Xc},St={};function Nv(){return{text:St}}let Ut=48;for(;Ut<123;)St[Ut]=Pt,Ut++,Ut===58?Ut=65:Ut===91&&(Ut=97);St[43]=Pt;St[45]=Pt;St[46]=Pt;St[95]=Pt;St[72]=[Pt,Yc];St[104]=[Pt,Yc];St[87]=[Pt,Gc];St[119]=[Pt,Gc];function Lv(e,t,n){const i=this;let s,r;return o;function o(u){return!xr(u)||!Xc.call(i,i.previous)||ro(i.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(u))}function a(u){return xr(u)?(e.consume(u),a):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(Rv,d,c)(u):u===45||u===95||Ve(u)?(r=!0,e.consume(u),l):d(u)}function c(u){return e.consume(u),s=!0,l}function d(u){return r&&s&&Be(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function Fv(e,t,n){const i=this;return s;function s(o){return o!==87&&o!==119||!Jc.call(i,i.previous)||ro(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($v,e.attempt(Vc,e.attempt(Zc,r),n),n)(o))}function r(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Dv(e,t,n){const i=this;let s="",r=!1;return o;function o(u){return(u===72||u===104)&&Qc.call(i,i.previous)&&!ro(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(u),e.consume(u),a):n(u)}function a(u){if(Be(u)&&s.length<5)return s+=String.fromCodePoint(u),e.consume(u),a;if(u===58){const h=s.toLowerCase();if(h==="http"||h==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),r?c:(r=!0,l)):n(u)}function c(u){return u===null||is(u)||ge(u)||Gt(u)||gs(u)?n(u):e.attempt(Vc,e.attempt(Zc,d),n)(u)}function d(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function zv(e,t,n){let i=0;return s;function s(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),s):o===46&&i===3?(e.consume(o),r):n(o)}function r(o){return o===null?n(o):t(o)}}function Mv(e,t,n){let i,s,r;return o;function o(c){return c===46||c===95?e.check(Kc,l,a)(c):c===null||ge(c)||Gt(c)||c!==45&&gs(c)?l(c):(r=!0,e.consume(c),o)}function a(c){return c===95?i=!0:(s=i,i=void 0),e.consume(c),o}function l(c){return s||i||!r?n(c):t(c)}}function jv(e,t){let n=0,i=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&i<n?r(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Kc,t,r)(o):o===null||ge(o)||Gt(o)?t(o):(e.consume(o),s)}function r(o){return o===41&&i++,e.consume(o),s}}function Bv(e,t,n){return i;function i(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),i):a===38?(e.consume(a),r):a===93?(e.consume(a),s):a===60||a===null||ge(a)||Gt(a)?t(a):n(a)}function s(a){return a===null||a===40||a===91||ge(a)||Gt(a)?t(a):i(a)}function r(a){return Be(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),i):Be(a)?(e.consume(a),o):n(a)}}function Uv(e,t,n){return i;function i(r){return e.consume(r),s}function s(r){return Ve(r)?n(r):t(r)}}function Jc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ge(e)}function Qc(e){return!Be(e)}function Xc(e){return!(e===47||xr(e))}function xr(e){return e===43||e===45||e===46||e===95||Ve(e)}function ro(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Hv={tokenize:Jv,partial:!0};function qv(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Kv,continuation:{tokenize:Gv},exit:Yv}},text:{91:{name:"gfmFootnoteCall",tokenize:Zv},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Wv,resolveTo:Vv}}}}function Wv(e,t,n){const i=this;let s=i.events.length;const r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;s--;){const l=i.events[s][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=ht(i.sliceSerialize({start:o.end,end:i.now()}));return c.codePointAt(0)!==94||!r.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Vv(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const r={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},a=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...a),e}function Zv(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r=0,o;return a;function a(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(r>999||u===93&&!o||u===null||u===91||ge(u))return n(u);if(u===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(ht(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return ge(u)||(o=!0),r++,e.consume(u),u===92?d:c}function d(u){return u===91||u===92||u===93?(e.consume(u),r++,c):c(u)}}function Kv(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r,o=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!a||m===null||m===91||ge(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return r=ht(i.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ge(m)||(a=!0),o++,e.consume(m),m===92?u:d}function u(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(r)||s.push(r),de(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function Gv(e,t,n){return e.check(ci,t,e.attempt(Hv,t,n))}function Yv(e){e.exit("gfmFootnoteDefinition")}function Jv(e,t,n){const i=this;return de(e,s,"gfmFootnoteDefinitionIndent",5);function s(r){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(r):n(r)}}function Qv(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:r,resolveAll:s};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},u={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",d,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",u,a]],f=a.parser.constructs.insideSpan.null;f&&Qe(h,h.length,0,bs(f,o.slice(c+1,l),a)),Qe(h,h.length,0,[["exit",u,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",d,a]]),Qe(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function r(o,a,l){const c=this.previous,d=this.events;let u=0;return h;function h(m){return c===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const p=Tn(c);if(m===126)return u>1?l(m):(o.consume(m),u++,f);if(u<2&&!n)return l(m);const b=o.exit("strikethroughSequenceTemporary"),w=Tn(m);return b._open=!w||w===2&&!!p,b._close=!p||p===2&&!!w,a(m)}}}class Xv{constructor(){this.map=[]}add(t,n,i){eS(this,t,n,i)}consume(t){if(this.map.sort(function(r,o){return r[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let s=i.pop();for(;s;){for(const r of s)t.push(r);s=i.pop()}this.map.length=0}}function eS(e,t,n,i){let s=0;if(!(n===0&&i.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...i);return}s+=1}e.map.push([t,n,i])}}function tS(e,t){let n=!1;const i=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const r=i.length-1;i[r]=i[r]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function nS(){return{flow:{null:{name:"table",tokenize:iS,resolveAll:sS}}}}function iS(e,t,n){const i=this;let s=0,r=0,o;return a;function a(R){let U=i.events.length-1;for(;U>-1;){const oe=i.events[U][1].type;if(oe==="lineEnding"||oe==="linePrefix")U--;else break}const B=U>-1?i.events[U][1].type:null,ee=B==="tableHead"||B==="tableRow"?v:l;return ee===v&&i.parser.lazy[i.now().line]?n(R):ee(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(o=!0,r+=1),d(R)}function d(R){return R===null?n(R):Q(R)?r>1?(r=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),f):n(R):ae(R)?de(e,d,"whitespace")(R):(r+=1,o&&(o=!1,s+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),u(R)))}function u(R){return R===null||R===124||ge(R)?(e.exit("data"),d(R)):(e.consume(R),R===92?h:u)}function h(R){return R===92||R===124?(e.consume(R),u):u(R)}function f(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),o=!1,ae(R)?de(e,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?b(R):R===124?(o=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),p):$(R)}function p(R){return ae(R)?de(e,b,"whitespace")(R):b(R)}function b(R){return R===58?(r+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):R===45?(r+=1,w(R)):R===null||Q(R)?C(R):$(R)}function w(R){return R===45?(e.enter("tableDelimiterFiller"),T(R)):$(R)}function T(R){return R===45?(e.consume(R),T):R===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(R))}function S(R){return ae(R)?de(e,C,"whitespace")(R):C(R)}function C(R){return R===124?m(R):R===null||Q(R)?!o||s!==r?$(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):$(R)}function $(R){return n(R)}function v(R){return e.enter("tableRow"),A(R)}function A(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),A):R===null||Q(R)?(e.exit("tableRow"),t(R)):ae(R)?de(e,A,"whitespace")(R):(e.enter("data"),P(R))}function P(R){return R===null||R===124||ge(R)?(e.exit("data"),A(R)):(e.consume(R),R===92?q:P)}function q(R){return R===92||R===124?(e.consume(R),P):P(R)}}function sS(e,t){let n=-1,i=!0,s=0,r=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,d,u;const h=new Xv;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(Ma(h,t,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(i=!0,u=void 0,r=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),s=m.type==="tableDelimiterRow"?2:d?3:1):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(r[1]!==0&&(o[0]=o[1],u=Ci(h,t,r,s,void 0,u),r=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(i?i=!1:(r[1]!==0&&(o[0]=o[1],u=Ci(h,t,r,s,void 0,u)),r=o,o=[r[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,r[1]!==0?(o[0]=o[1],u=Ci(h,t,r,s,n,u)):o[1]!==0&&(u=Ci(h,t,o,s,n,u)),s=0):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Ma(h,t,l,c,d),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=tS(t.events,n))}return e}function Ci(e,t,n,i,s,r){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(r.end=Object.assign({},ln(t.events,n[0])),e.add(n[0],0,[["exit",r,t]]));const l=ln(t.events,n[1]);if(r={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",r,t]]),n[2]!==0){const c=ln(t.events,n[2]),d=ln(t.events,n[3]),u={type:a,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",u,t]]),i!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return s!==void 0&&(r.end=Object.assign({},ln(t.events,s)),e.add(s,0,[["exit",r,t]]),r=void 0),r}function Ma(e,t,n,i,s){const r=[],o=ln(t.events,n);s&&(s.end=Object.assign({},o),r.push(["exit",s,t])),i.end=Object.assign({},o),r.push(["exit",i,t]),e.add(n+1,0,r)}function ln(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const rS={name:"tasklistCheck",tokenize:aS};function oS(){return{text:{91:rS}}}function aS(e,t,n){const i=this;return s;function s(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),r)}function r(l){return ge(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return Q(l)?t(l):ae(l)?e.check({tokenize:lS},t,n)(l):n(l)}}function lS(e,t,n){return de(e,i,"whitespace");function i(s){return s===null?n(s):t(s)}}function cS(e){return hc([Nv(),qv(),Qv(e),nS(),oS()])}const uS={};function eu(e){const t=this,n=e||uS,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),r=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(cS(n)),r.push(Pv()),o.push(Ov(n))}var Ys={exports:{}},ja;function dS(){return ja||(ja=1,(function(e){(function(){var t;t=e.exports=s,t.format=s,t.vsprintf=i,typeof console<"u"&&typeof console.log=="function"&&(t.printf=n);function n(){console.log(s.apply(null,arguments))}function i(r,o){return s.apply(null,[r].concat(o))}function s(r){for(var o=1,a=[].slice.call(arguments),l=0,c=r.length,d="",u,h=!1,f,m,p=!1,b,w=function(){return a[o++]},T=function(){for(var S="";/\d/.test(r[l]);)S+=r[l++],u=r[l];return S.length>0?parseInt(S):null};l<c;++l)if(u=r[l],h)switch(h=!1,u=="."?(p=!1,u=r[++l]):u=="0"&&r[l+1]=="."?(p=!0,l+=2,u=r[l]):p=!0,b=T(),u){case"b":d+=parseInt(w(),10).toString(2);break;case"c":f=w(),typeof f=="string"||f instanceof String?d+=f:d+=String.fromCharCode(parseInt(f,10));break;case"d":d+=parseInt(w(),10);break;case"f":m=String(parseFloat(w()).toFixed(b||6)),d+=p?m:m.replace(/^0/,"");break;case"j":d+=JSON.stringify(w());break;case"o":d+="0"+parseInt(w(),10).toString(8);break;case"s":d+=w();break;case"x":d+="0x"+parseInt(w(),10).toString(16);break;case"X":d+="0x"+parseInt(w(),10).toString(16).toUpperCase();break;default:d+=u;break}else u==="%"?h=!0:d+=u;return d}})()})(Ys)),Ys.exports}var fS=dS();const hS=ms(fS),Ai=Object.assign(Ht(Error),{eval:Ht(EvalError),range:Ht(RangeError),reference:Ht(ReferenceError),syntax:Ht(SyntaxError),type:Ht(TypeError),uri:Ht(URIError)});function Ht(e){return t.displayName=e.displayName||e.name,t;function t(n,...i){const s=n&&hS(n,...i);return new e(s)}}const Ti={}.hasOwnProperty,Ba={yaml:"-",toml:"+"};function oo(e){const t=[];let n=-1;const i=Array.isArray(e)?e:e?[e]:["yaml"];for(;++n<i.length;)t[n]=pS(i[n]);return t}function pS(e){let t=e;if(typeof t=="string"){if(!Ti.call(Ba,t))throw Ai("Missing matter definition for `%s`",t);t={type:t,marker:Ba[t]}}else if(typeof t!="object")throw Ai("Expected matter to be an object, not `%j`",t);if(!Ti.call(t,"type"))throw Ai("Missing `type` in matter `%j`",t);if(!Ti.call(t,"fence")&&!Ti.call(t,"marker"))throw Ai("Missing `marker` or `fence` in matter `%j`",t);return t}function mS(e){const t=oo(e),n={};let i=-1;for(;++i<t.length;){const s=t[i],r=_r(s,"open").charCodeAt(0),o=gS(s),a=n[r];Array.isArray(a)?a.push(o):n[r]=[o]}return{flow:n}}function gS(e){const t=e.anywhere,n=e.type,i=n+"Fence",s=i+"Sequence",r=n+"Value",o={tokenize:d,partial:!0};let a,l=0;return{tokenize:c,concrete:!0};function c(u,h,f){const m=this;return p;function p(A){const P=m.now();return P.column===1&&(P.line===1||t)&&(a=_r(e,"open"),l=0,A===a.charCodeAt(l))?(u.enter(n),u.enter(i),u.enter(s),b(A)):f(A)}function b(A){return l===a.length?(u.exit(s),ae(A)?(u.enter("whitespace"),w(A)):T(A)):A===a.charCodeAt(l++)?(u.consume(A),b):f(A)}function w(A){return ae(A)?(u.consume(A),w):(u.exit("whitespace"),T(A))}function T(A){return Q(A)?(u.exit(i),u.enter("lineEnding"),u.consume(A),u.exit("lineEnding"),a=_r(e,"close"),l=0,u.attempt(o,v,S)):f(A)}function S(A){return A===null||Q(A)?$(A):(u.enter(r),C(A))}function C(A){return A===null||Q(A)?(u.exit(r),$(A)):(u.consume(A),C)}function $(A){return A===null?f(A):(u.enter("lineEnding"),u.consume(A),u.exit("lineEnding"),u.attempt(o,v,S))}function v(A){return u.exit(n),h(A)}}function d(u,h,f){let m=0;return p;function p(S){return S===a.charCodeAt(m)?(u.enter(i),u.enter(s),b(S)):f(S)}function b(S){return m===a.length?(u.exit(s),ae(S)?(u.enter("whitespace"),w(S)):T(S)):S===a.charCodeAt(m++)?(u.consume(S),b):f(S)}function w(S){return ae(S)?(u.consume(S),w):(u.exit("whitespace"),T(S))}function T(S){return S===null||Q(S)?(u.exit(i),h(S)):f(S)}}}function _r(e,t){return e.marker?Ua(e.marker,t).repeat(3):Ua(e.fence,t)}function Ua(e,t){return typeof e=="string"?e:e[t]}function bS(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function yS(e){const t=oo(e),n={},i={};let s=-1;for(;++s<t.length;){const r=t[s];n[r.type]=wS(r),i[r.type]=kS,i[r.type+"Value"]=vS}return{enter:n,exit:i}}function wS(e){return t;function t(n){this.enter({type:e.type,value:""},n),this.buffer()}}function kS(e){const t=this.resume(),n=this.stack[this.stack.length-1];this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}function vS(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function SS(e){const t=[],n={},i=oo(e);let s=-1;for(;++s<i.length;){const r=i[s];n[r.type]=xS(r);const o=Cr(r,"open");t.push({atBreak:!0,character:o.charAt(0),after:bS(o.charAt(1))})}return{unsafe:t,handlers:n}}function xS(e){const t=Cr(e,"open"),n=Cr(e,"close");return i;function i(s){return t+(s.value?`
104
+ `+s.value:"")+`
105
+ `+n}}function Cr(e,t){return e.marker?Ha(e.marker,t).repeat(3):Ha(e.fence,t)}function Ha(e,t){return typeof e=="string"?e:e[t]}const _S="yaml";function tu(e){const t=this,n=e||_S,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),r=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(mS(n)),r.push(yS(n)),o.push(SS(n))}const nu=dc().use(Aw).use(eu).use(tu,["yaml"]);dc().use(Nk,{bullet:"-",fences:!0,listItemIndent:"one",rule:"-"}).use(eu).use(tu,["yaml"]);function CS(e){const t={};for(const n of e.split(/\r?\n/)){const i=/^(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_-]+)):\s*(.*)$/.exec(n);i&&(t[i[1]??i[2]??i[3]]=i[4].trim())}return t}const qa="\uFEFF";function ao(e){return e.replace(/^\uFEFF?---\r?\n(?:[\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,"")}function iu(e){const t=nu.parse(e);for(const n of t.children??[])if(n.type==="yaml")return CS(n.value??"");return{}}const ks=/^["']?(amadeus_page|amadeus_schema|amadeus_layout|amadeus_canvas|amadeus_next_id)["']?\s*:/;function AS(e){const t=/^["']?amadeus\.page\/(\d+)\b/.exec(e.amadeus_schema??"");return t?Number.parseInt(t[1],10):null}function lo(e){const t=[];let n=null,i=[];const s=()=>{for(const r of i)t.push([r]);i=[]};for(const r of e)!r.trim()||r.startsWith("#")?i.push(r):/^[ \t]/.test(r)||/^-(?:[ \t]|\r?$)/.test(r)||/^[}\],]/.test(r)?n?(n.push(...i,r),i=[]):(s(),t.push([r])):(s(),n=[r],t.push(n));return s(),t}function su(e){const t=nu.parse(e);for(const n of t.children??[])if(n.type==="yaml")return lo((n.value??"").split(`
106
+ `)).filter(i=>!ks.test(i[0])).flat().join(`
107
+ `).replace(/^\n+|\n+$/g,"");return""}function TS(e){let t=0;for(const n of e.root.children)for(const i of n.columns)for(const s of i.children){const r=Number.parseInt(s.ref,10);Number.isInteger(r)&&String(r)===s.ref&&r>t&&(t=r)}return t+1}function ES(e){const t=(e.fmExtra??"").split(`
108
+ `).filter(s=>!ks.test(s)&&!/^---\s*$/.test(s)).join(`
109
+ `).replace(/^\n+|\n+$/g,""),n=TS(e),i=Math.max(e.nextId??0,n);return["---",`amadeus_page: ${e.id}`,`amadeus_schema: ${e.schema}`,`amadeus_layout: ${ib(e.root)}`,...i>n?[`amadeus_next_id: ${i}`]:[],...t?[t]:[],"---"].join(`
110
+ `)}function Ar(e,t){if(e.schemaTooNew)throw new Error("amadeus: 笔记由更新版本的格式写入(amadeus_schema 超出本端支持),已拒绝改写以防损坏");const n=[ES(e)];for(const i of e.root.children)for(const s of i.columns)for(const r of s.children){const o=(t[r.ref]??"").replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd();n.push(o?`${jo(r.ref)}
111
+
112
+ ${o}`:jo(r.ref))}return n.join(`
113
+
114
+ `)+`
115
+ `}const ru={children:[]},IS=3;function PS(e){const t=e.reduce((n,i)=>n+(i.width>0?i.width:0),0);if(t<=0){const n=1/Math.max(1,e.length);return e.map(i=>({...i,width:n}))}return e.map(n=>({...n,width:(n.width>0?n.width:0)/t}))}function OS(e,t){const n=new Set,i=[];for(const r of e.children){const o=[];for(const a of r.columns){const l=a.children.filter(c=>t.has(c.ref)?(n.add(c.ref),!0):!1);l.length&&o.push({...a,children:l})}o.length&&i.push({...r,columns:PS(o)})}const s=[...t].filter(r=>!n.has(r));return s.length&&i.push({type:"row",id:af(),columns:[{id:lf(),width:1,children:s.map(r=>({ref:r}))}]}),{type:"stack",children:i}}function $S(e,t){const n={};for(const[i,s]of Object.entries(e.blocks))n[i]={id:i,type:s.type,content:t[i]??""};return n}function co(e,t,n,i,s,r,o,a,l,c){const d=new Set(c??Object.keys(i)),u={schema:Xd,id:t,title:Ol(e),createdAt:r,updatedAt:o,compiler:{version:ef},root:OS(n,d),blocks:Object.fromEntries(Object.entries(i).map(([h,f])=>[h,{type:f}])),...a?{fmExtra:a}:{},...l&&l>0?{nextId:l}:{}};return{manifest:u,blocks:$S(u,s)}}async function RS(e,t,n,i){await e.writeFile($l(t),Ar(n,i.contents))}async function NS(e,t,n){const i=Ji([]),s=co(t,Pl(),ru,{[i]:"markdown"},{[i]:""},n,n);return await RS(e,t,s.manifest,{contents:{[i]:""}}),s}function ou(e,t,n){const i=ao(t).replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd(),s=Ji([]);return co(e,Pl(),ru,{[s]:"markdown"},{[s]:i},n,n,su(t))}function LS(e,t,n,i){const s=ou(e,t,i);return s.manifest.id=n.amadeus_page,s.manifest.schemaTooNew=!0,s}function FS(e,t,n,i){const s=Rl(ao(t)),r=sb(n.amadeus_layout),o=su(t),a=Number.parseInt(n.amadeus_next_id??"",10),l=new Set;for(const p of s)p.id!=null&&l.add(p.id);let c=Number.isSafeInteger(a)&&a>0?a:void 0,d=!1;const u=new Set,h={},f={},m=[];for(const p of s){let b;if(p.id!=null&&p.id!=="__proto__"&&!u.has(p.id))u.add(p.id),b=p.id;else{b=Ji(l,c);for(let w=2;l.has(b);w++)b=`${Ji(l,c)}-${w}`;l.add(b),c=of(c,b),d=!0}h[b]="markdown",f[b]=p.content,m.push(b)}return{page:co(e,n.amadeus_page,r,h,f,i,i,o,c,m),renumbered:d}}function ji(e,t,n){const i=iu(t);if(!i.amadeus_page)return ou(e,t,n);const s=AS(i);return s!=null&&s>IS?LS(e,t,i,n):FS(e,t,i,n).page}const DS=/^ {0,3}(`{3,}|~{3,}|\$\$)(.*)$/,zS=e=>e==="$$"?/^ {0,3}\$\$\s*$/:new RegExp(`^ {0,3}${e[0]==="`"?"`":"~"}{${e.length},}\\s*$`),MS=(e,t)=>e==="$$"?!t.includes("$"):e[0]==="`"?!t.includes("`"):!0,au=/^(?:[-*+][ \t]|\d{1,9}[.)][ \t]|>)/;function lu(e,t){const n=e.split(`
116
+ `);let i=0;if(n[0]==="---"){for(i=1;i<n.length;i++)if(n[i]==="---"||n[i]==="..."){i++;break}}let s=null,r=!1;for(;i<n.length;i++){const o=n[i];if(s){zS(s).test(o)&&(s=null);continue}const a=DS.exec(o);if(a&&MS(a[1],a[2])){s=a[1];continue}const l=t(o);l!==o&&(n[i]=l,r=!0)}return r?n.join(`
117
+ `):e}function jS(e){return e.includes(" ")?lu(e,t=>{const n=/^(\t+)(.*)$/.exec(t);return!n||!n[2]||au.test(n[2])?t:"&#9;".repeat(n[1].length)+n[2]}):e}function BS(e){return e.includes("&#")?lu(e,t=>{const n=/^((?:&#[xX]?9;|\t)+)(?=.)(.*)$/.exec(t);if(n&&n[1].includes("&#")){if(au.test(n[2]))return t;const s=(n[1].match(/&#|\t/g)??[]).length;return" ".repeat(s)+n[2]}const i=/^((?:> ?)+|(?:[-*+]|\d{1,9}[.)])[ \t]+)((?:&#[xX]?9;)+)(.*)$/.exec(t);return i?i[1]+i[3]:t}):e}const D_=8,Wa=/\[\[([^\]\n]+)\]\]/g,z_=/(?:^|\s)#([\p{L}\p{N}_/-]+)/gu;function cu(e){const t=e.indexOf("|");return t>0&&e[t-1]==="\\"?t-1:t}function US(e){let t=e.trim();const n=cu(t);n>=0&&(t=t.slice(0,n));const i=t.indexOf("#");return i>=0&&(t=t.slice(0,i)),t.trim()}function M_(e){e=qS(e);const t=new RegExp(Wa.source,Wa.flags),n=[],i=new Set;let s;for(;s=t.exec(e);){const r=US(s[1]);if(!r)continue;const o=r.toLowerCase();i.has(o)||(i.add(o),n.push(r))}return n}function pn(e){return(e.split(/[\\/]/).pop()??e).replace(/\.md$/i,"").trim().toLowerCase()}const Bi=e=>e.replace(/\\/g,"/"),Va=e=>Bi(e).replace(/\.md$/i,"").trim().toLowerCase();function Ui(e,t,n){const i=e.trim();if(!i)return null;if(/[\\/]/.test(i)){const r=Va(i).replace(/^\/+/,"");return t.find(o=>Va(o)===r)??null}const s=pn(i);if(!s)return null;if(n){const r=Bi(n),o=r.includes("/")?r.slice(0,r.lastIndexOf("/")+1):"",a=t.find(d=>{const u=Bi(d);return u.startsWith(o)&&!u.slice(o.length).includes("/")&&pn(d)===s});if(a)return a;const l=`${r.replace(/\.md$/i,"")}.fd/`.toLowerCase(),c=t.find(d=>Bi(d).toLowerCase().startsWith(l)&&pn(d)===s);if(c)return c}return t.find(r=>pn(r)===s)??null}const uu=/^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]*)*(`{3,}|~{3,})([^\r\n]*)\r?$/;function du(e){const t=uu.exec(e);return!t||t[1][0]==="`"&&t[2].includes("`")?null:{ch:t[1][0],n:t[1].length}}const fu=(e,t)=>{const n=uu.exec(e);return!!n&&n[1][0]===t.ch&&n[1].length>=t.n&&!n[2].trim()};function On(e,t,n=!1){const i=e.split(`
118
+ `);for(let s=0;s<i.length;s++){const r=du(i[s]);if(r){let o=s+1;for(;o<i.length&&!fu(i[o],r);)o++;if(o<i.length){s=o;continue}if(n)break}i[s]=t(i[s])}return i.join(`
119
+ `)}const HS="";function qS(e){if(!e.includes("`")&&!e.includes("~~~"))return e;const t=e.split(`
120
+ `);for(let n=0;n<t.length;n++){const i=du(t[n]);if(i){let s=n+1;for(;s<t.length&&!fu(t[s],i);)s++;if(s<t.length){for(let r=n;r<=s;r++)t[r]="";n=s;continue}}t[n].includes("`")&&(t[n]=vs(t[n],s=>s,s=>HS.repeat(s.length)))}return t.join(`
121
+ `)}function j_(e){return e.includes("\\[\\[")?On(e,t=>t.replace(/\\\[\\\[/g,"[[")):e}function B_(e){return!e.includes("\\")&&!e.includes("<")?e:On(e,t=>t.split(/(`+[^`]*`+)/).map((n,i)=>i%2===1?n:n.replace(new RegExp("(?<=[ps])\\\\:(?=\\/)","g"),":").replace(new RegExp("(?<=[Ww])\\\\\\.(?=[-.\\w])","g"),".").replace(new RegExp("(?<=[+\\-.\\w])\\\\@(?=[-.\\w])","g"),"@").replace(/(\[\[)<(https?:\/\/[^>\s\]]+)>/g,"$1$2")).join("").replace(/^<(https?:\/\/[^>\s]+)>$/,"$1"))}function WS(e){return!(e<9||e===11||e>13&&e<32||e>126&&e<160||e>55295&&e<57344||e>64975&&e<65008||(e&65535)===65535||(e&65535)===65534||e>1114111)}const VS=/&#(?:[xX]([0-9a-fA-F]{1,6})|([0-9]{1,7}));/g;function vs(e,t,n=i=>i){let i="",s=0,r=0;for(;(r=e.indexOf("`",r))>=0;){let o=0;for(;e[r-1-o]==="\\";)o++;if(o%2){r++;continue}let a=0;for(;e[r+a]==="`";)a++;let l=r+a,c=-1;for(;(l=e.indexOf("`",l))>=0;){let d=0;for(;e[l+d]==="`";)d++;if(d===a){c=l;break}l+=d}if(c<0){r+=a;continue}i+=t(e.slice(s,r))+n(e.slice(r,c+a)),s=r=c+a}return i+t(e.slice(s))}function U_(e){if(!e.includes("&#"))return e;const t=n=>n.replace(VS,(i,s,r,o,a)=>{let l=0;for(;a[o-1-l]==="\\";)l++;if(l%2)return i;const c=s?parseInt(s,16):parseInt(r,10);return WS(c)?c===10||c===13?" ":String.fromCodePoint(c):i});return On(e,n=>n.includes("&#")?vs(n,t):n)}function ZS(e){const t=cu(e),n=t>=0?e.slice(e.indexOf("|",t)+1).trim():"";return n||(t>=0?e.slice(0,t):e).trim().replace(/\s*#\^?\s*/," › ").replace(/^ › /,"")}function H_(e){return e.replace(/^\s*(?:>\s*)*(?:(?:[-*+]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?|#{1,6}\s+)?/,"").replace(/!?\[\[([^\]\n]+)\]\]/g,(t,n)=>ZS(n)).replace(/!?\[([^\]\n]*)\]\([^)\n]*\)/g,"$1").replace(/%%.*?%%/g,"").replace(/<\/?[A-Za-z][^>\n]*>/g,"").replace(new RegExp("(\\*\\*|__|~~|==)(?=\\S)(.+?)(?<=\\S)\\1","g"),"$2").replace(new RegExp("(^|[^\\p{L}\\p{N}*_])[*_](?=\\S)(.+?)(?<=\\S)[*_](?![\\p{L}\\p{N}*_])","gu"),"$1$2").replace(/(`+)([^`]*?)\1/g,"$2").replace(/\\([\\`*_{}[\]()#+\-.!~|>=])/g,"$1").replace(/\s\^[A-Za-z0-9-]+\s*$/,"").replace(/\s+/g," ").trim()}function Za(e){return e.replace(/^\uFEFF?---\r?\n(?:[\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,"").replace(/<!--[\s\S]*?-->/g,"")}const Ss="amadeus-asset";function Hi(e,t){const n=e.replace(/\\/g,"/").replace(/\/+$/,""),i=t.replace(/\\/g,"/");return!n||n==="."?i:`${n}/${i}`.replace(/\/{2,}/g,"/")}function rs(e){const t=[];for(const n of e.split("/"))!n||n==="."||(n===".."&&t.length&&t[t.length-1]!==".."?t.pop():t.push(n));return t.join("/")}function hu(e,t){const n=e?e.split("/"):[],i=t.split("/");let s=0;for(;s<n.length&&s<i.length-1&&n[s]===i[s];)s++;return[...n.slice(s).map(()=>".."),...i.slice(s)].join("/")}function KS(e,t){const n=e.replace(/\\/g,"/").replace(/\/+$/,"");if(!n||n===".")return t;const i=`${n}/`;if(t.startsWith(i))return t.slice(i.length);const s=rs(t);return s?hu(rs(n),s):t}const GS=e=>`${Ss}://v/${encodeURIComponent(e)}`;let pu=GS,Tr=null;function mu(e,t){pu=e,Tr=t??null}function Ka(e,t=!1){return pu(e,t).replace(/[()]/g,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase())}function YS(e){const t=`${Ss}://v/`;if(!e.startsWith(t))return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}}function gu(e){if(e.startsWith(`${Ss}://v/`))return YS(e);if(!Tr)return null;try{return Tr(e.replace(/\\&/g,"&"))||null}catch{return null}}const bu=/(!\[[^\]]*\]\()(<[^>\n]*>|[^)\s]+)((?:\s+"[^"]*")?\))/g;function yu(e){return e.replace(/[ ()<>]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function JS(e){return/^(https?:|data:|amadeus-asset:|blob:|\/)/.test(e)}function q_(e,t){const n=s=>s.replace(bu,(r,o,a,l)=>{const c=(a.startsWith("<")?a.slice(1,-1):a).trim();if(!c)return r;if(JS(c)){if(a.startsWith("<")||c.startsWith(`${Ss}:`))return r;const d=gu(c);return d==null?r:o+Ka(d,!0)+l}return o+Ka(Hi(t,wu(c)),!0)+l}),i=e.includes("![")?On(e,s=>s.includes("![")?vs(s,n):s):e;return jS(i)}function W_(e,t){return BS(e.replace(bu,(n,i,s,r)=>{const o=gu(s.trim());return o==null?n:i+yu(KS(t,o))+r}))}const Js=/([^)\s]{1,2048})((?:\s+"[^"]{0,2048}")?\))/y,Ga=/^[^\s/]+\.[^\s/]/,QS=/[&|\\"'`[\]*?:<>()\u0000-\u001f\u007f]/,XS=/[&|\\"'`[\]*?:\u0000-\u001f\u007f-\u009f]|[^\S ]/,Ei=(e,t)=>{let n=0;for(;e[t-1-n]==="\\";)n++;return n%2===1},ex=e=>yu(e.replace(/%/g,"%25")).replace(/#/g,"%23");async function tx(e,t,n,i,s,r={}){const o=S=>rs(S.replace(/\\/g,"/")).split("/").slice(0,-1).join("/"),a=o(t),l=o(n);if(a===l&&!i||!e.includes("]("))return e;const c=(S,C)=>rs(S?`${S}/${C}`:C),d=S=>S.filter(C=>C==="..").length,u=new Map;let h=[];const f=(S,C,$)=>{if(h.push(S),r.only&&!r.only.has(S)||/^[/#]/.test(S))return null;const v=C?-1:S.indexOf("#"),A=v<0?S:S.slice(0,v);if(QS.test(A))return null;const P=A.split("/");if(!C&&(P.length===1||Ga.test(A)))return null;let q;try{q=P.map(fe=>decodeURIComponent(fe))}catch{return null}if(q.some(fe=>/[\\/]/.test(fe)))return null;const R=q.join("/");if(!/\.[a-z0-9]{1,12}$/i.test(R)||/\.md$/i.test(R))return null;const U=c(a,R);if(!U||U===".."||U.startsWith("../"))return null;const B=i?i(U):U;if(a===l&&B===U)return null;const ee=hu(l,B).split("/");if(c(l,R)===B&&d(q)<=d(ee))return null;let oe=0;for(;oe<q.length&&oe<ee.length&&q[q.length-1-oe]===ee[ee.length-1-oe]&&!/^\.{0,2}$/.test(q[q.length-1-oe]);)oe++;const te=ee.slice(0,ee.length-oe);if(te.some(fe=>XS.test(fe)))return null;if($)return u.set(B,!1),null;if(!u.get(B))return null;const ue=[...te.map(ex),...P.slice(P.length-oe)].join("/");return(!C&&(!ue.includes("/")||Ga.test(ue))?`./${ue}`:ue)+(v<0?"":S.slice(v))},m=S=>C=>{let $="",v=0,A=0;for(let P=C.indexOf("](");P>=0;P=C.indexOf("](",Math.max(P+2,A))){const q=Math.max(C.lastIndexOf("]",P-1)+1,A),R=q+C.substring(q,P).lastIndexOf("[");if(R<q||R>=P||Ei(C,R)||Ei(C,P)||C[R+1]==="^")continue;Js.lastIndex=P+2;const U=Js.exec(C);if(!U)continue;A=Js.lastIndex;const B=f(U[1],C[R-1]==="!"&&!Ei(C,R-1),S);B!=null&&($+=C.slice(v,P+2)+B+U[2],v=A)}return v?$+C.slice(v):C},p=S=>{for(let C=S.indexOf("`");C>=0;C=S.indexOf("`",C+1))if(!Ei(S,C))return!0;return!1},b=/^\uFEFF?---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/.exec(e)?.[0]??"",w=e.slice(b.length),T=S=>{let C=!1;return On(w,$=>{if(!$.trim())return C=!1,$;if(C)return $;let v=!1;h=[];const A=vs($,P=>(p(P)&&(v=!0),P.includes("](")?m(S)(P):P));if(!v){for(const P of h)r.seen?.add(P);return A}return C=!0,$},!0)};return T(!0),u.size?(await Promise.all([...u.keys()].map(async S=>{u.set(S,await s(S))})),b+T(!1)):e}function V_(e){const t=[],n=i=>{const s=i.split("|")[0].split("#")[0].trim().replace(/^<|>$/g,"");!s||/^[a-z][a-z0-9+.-]*:/i.test(s)||!/\.[a-z0-9]{1,12}$/i.test(s)||/\.md$/i.test(s)||t.includes(s)||t.push(s)};for(const i of e.matchAll(/!?\[\[([^\]\n]+)\]\]/g))n(i[1]);for(const i of e.matchAll(/!?\[[^\]\n]*\]\(([^)\s]+)/g))n(wu(i[1]));return t}function Z_(e){return(e.split(/[\\/]/).pop()??e).toLowerCase()}function wu(e){try{return decodeURIComponent(e)}catch{return e}}const nx=".forsion-vault.md";function ix(e){const t=new RegExp(`^([^/]+)/${nx.replace(/\./g,"\\.")}$`);return[...new Set(e.map(n=>t.exec(n)?.[1]).filter(n=>!!n))].sort()}const qi=e=>e.replace(/\\/g,"/").normalize("NFC");function sx(e){const t=qi(e.path);return t?e.kind==="folder"?`${t}/`:e.kind==="page"?`${t.replace(/\.md$/i,"")}.fd/`:null:null}function K_(e,t,n){const i=qi(n);if(!i)return!1;if(e.some(s=>qi(s.path)===i))return!0;for(const s of t??[]){const r=qi(s);if(!r)continue;const o=`${r.replace(/\.md$/i,"")}.fd`;if(i===r||i.startsWith(`${r}/`)||i===o||i.startsWith(`${o}/`))return!1}return e.some(s=>{const r=sx(s);return!!r&&i.startsWith(r)})}const uo=2,G_=["text","number","checkbox","date","select","multiselect","url"],Kn="__page_name",fo=ac([Y(),Kt(),ns(),Ne(Y()),Cg()]),ku=je({colId:Y().min(1),op:Y().min(1),value:fo.optional()}),rx=je({id:Y().min(1),name:Y(),type:Y().min(1),options:Ne(Y()).optional(),optionLabels:hn(Y(),Y()).optional(),width:Kt().positive().optional(),formula:Y().optional(),refDb:Y().optional(),multiple:ns().optional(),titleCol:Y().optional(),refFilter:Ne(ku).optional(),refFilterMode:kt(["and","or"]).optional(),lookupRel:Y().optional(),lookupBackCol:Y().optional(),lookupCol:Y().optional(),lookupAgg:Y().optional(),lookupKind:kt(["links"]).optional(),prefix:Y().optional(),precision:Kt().int().min(0).max(6).optional(),unitPrefix:Y().optional(),unitSuffix:Y().optional()}),ox=je({id:Y().min(1),cells:hn(Y(),fo),body:Y().optional()}),ax=je({id:Y().min(1),name:Y(),type:Y().min(1),openMode:kt(["side","center","full"]).optional(),groupBy:Y().optional(),groupUnit:kt(["day","month"]).optional(),groupSort:kt(["manual","asc","desc"]).optional(),groupOrder:Ne(Y()).optional(),groupHidden:Ne(Y()).optional(),groupHideEmpty:ns().optional(),treeCol:Y().optional(),fold:je({by:Ne(Y()).optional(),timeCol:Y().optional(),minutes:Kt().positive().optional()}).optional(),chartKind:Y().optional(),agg:Y().optional(),valueCol:Y().optional(),dateCol:Y().optional(),filters:Ne(ku).optional(),filterMode:Y().optional(),sort:je({colId:Y().min(1),dir:kt(["asc","desc"])}).optional(),sorts:Ne(je({colId:Y().min(1),dir:kt(["asc","desc"])})).optional(),hidden:Ne(Y()).optional(),order:Ne(Y()).optional(),widths:hn(Y(),Kt().positive()).optional(),autoSize:ns().optional(),stats:hn(Y(),Y()).optional(),form:je({required:Ne(Y()).optional(),defaults:hn(Y(),fo).optional(),desc:hn(Y(),Y()).optional(),title:Y().optional(),submitText:Y().optional(),after:kt(["stay","table"]).optional()}).optional(),gantt:je({startCol:Y().optional(),endCol:Y().optional(),scale:kt(["day","week"]).optional()}).optional()}),vu=je({version:Kt().int().min(1),name:Y(),source:je({folder:Y()}).optional(),columns:Ne(rx),rows:Ne(ox),views:Ne(ax).optional()}),Qs=()=>Math.random().toString(36).slice(2,10),lx={id:"v-default",name:"表格",type:"table"},Y_=e=>e.views?.length?e.views:[lx],J_=e=>e.sorts?.length?e.sorts:e.sort?[e.sort]:[];function Q_(e){return{version:uo,name:e,columns:[{id:Qs(),name:"标题",type:"text"},{id:Qs(),name:"文本",type:"text"}],rows:[{id:Qs(),cells:{}}]}}function X_(e,t){return{version:uo,name:e,source:{folder:t},columns:[{id:Kn,name:"Page Name",type:"page"}],rows:[]}}function Su(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"JSON 解析失败"}}const n=vu.safeParse(t);return n.success?n.data.version>uo?{ok:!1,error:`版本过新(v${n.data.version}),请升级应用`}:{ok:!0,data:xu(n.data)}:{ok:!1,error:"不是有效的 Database 文件结构"}}function xu(e){return e.version<2&&e.rows.some(t=>t.body!==void 0)?{...e,version:2}:e}function cx(e){return`${JSON.stringify(xu(e),null,2)}
122
+ `}function eC(e,t){switch(t){case"text":case"url":case"page":return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.join(", "):"";case"number":{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=Number.parseFloat(e);if(Number.isFinite(n))return n}return null}case"checkbox":return e===!0;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:"";case"select":return typeof e=="string"?e:Array.isArray(e)?e[0]??"":"";case"multiselect":return Array.isArray(e)?e:typeof e=="string"&&e!==""?[e]:[]}}var Xs={exports:{}},Ya;function ux(){return Ya||(Ya=1,(function(e){var t=(function(){var n=String.fromCharCode,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function o(l,c){if(!r[l]){r[l]={};for(var d=0;d<l.length;d++)r[l][l.charAt(d)]=d}return r[l][c]}var a={compressToBase64:function(l){if(l==null)return"";var c=a._compress(l,6,function(d){return i.charAt(d)});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:a._decompress(l.length,32,function(c){return o(i,l.charAt(c))})},compressToUTF16:function(l){return l==null?"":a._compress(l,15,function(c){return n(c+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:a._decompress(l.length,16384,function(c){return l.charCodeAt(c)-32})},compressToUint8Array:function(l){for(var c=a.compress(l),d=new Uint8Array(c.length*2),u=0,h=c.length;u<h;u++){var f=c.charCodeAt(u);d[u*2]=f>>>8,d[u*2+1]=f%256}return d},decompressFromUint8Array:function(l){if(l==null)return a.decompress(l);for(var c=new Array(l.length/2),d=0,u=c.length;d<u;d++)c[d]=l[d*2]*256+l[d*2+1];var h=[];return c.forEach(function(f){h.push(n(f))}),a.decompress(h.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":a._compress(l,6,function(c){return s.charAt(c)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),a._decompress(l.length,32,function(c){return o(s,l.charAt(c))}))},compress:function(l){return a._compress(l,16,function(c){return n(c)})},_compress:function(l,c,d){if(l==null)return"";var u,h,f={},m={},p="",b="",w="",T=2,S=3,C=2,$=[],v=0,A=0,P;for(P=0;P<l.length;P+=1)if(p=l.charAt(P),Object.prototype.hasOwnProperty.call(f,p)||(f[p]=S++,m[p]=!0),b=w+p,Object.prototype.hasOwnProperty.call(f,b))w=b;else{if(Object.prototype.hasOwnProperty.call(m,w)){if(w.charCodeAt(0)<256){for(u=0;u<C;u++)v=v<<1,A==c-1?(A=0,$.push(d(v)),v=0):A++;for(h=w.charCodeAt(0),u=0;u<8;u++)v=v<<1|h&1,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=h>>1}else{for(h=1,u=0;u<C;u++)v=v<<1|h,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=0;for(h=w.charCodeAt(0),u=0;u<16;u++)v=v<<1|h&1,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=h>>1}T--,T==0&&(T=Math.pow(2,C),C++),delete m[w]}else for(h=f[w],u=0;u<C;u++)v=v<<1|h&1,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=h>>1;T--,T==0&&(T=Math.pow(2,C),C++),f[b]=S++,w=String(p)}if(w!==""){if(Object.prototype.hasOwnProperty.call(m,w)){if(w.charCodeAt(0)<256){for(u=0;u<C;u++)v=v<<1,A==c-1?(A=0,$.push(d(v)),v=0):A++;for(h=w.charCodeAt(0),u=0;u<8;u++)v=v<<1|h&1,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=h>>1}else{for(h=1,u=0;u<C;u++)v=v<<1|h,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=0;for(h=w.charCodeAt(0),u=0;u<16;u++)v=v<<1|h&1,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=h>>1}T--,T==0&&(T=Math.pow(2,C),C++),delete m[w]}else for(h=f[w],u=0;u<C;u++)v=v<<1|h&1,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=h>>1;T--,T==0&&(T=Math.pow(2,C),C++)}for(h=2,u=0;u<C;u++)v=v<<1|h&1,A==c-1?(A=0,$.push(d(v)),v=0):A++,h=h>>1;for(;;)if(v=v<<1,A==c-1){$.push(d(v));break}else A++;return $.join("")},decompress:function(l){return l==null?"":l==""?null:a._decompress(l.length,32768,function(c){return l.charCodeAt(c)})},_decompress:function(l,c,d){var u=[],h=4,f=4,m=3,p="",b=[],w,T,S,C,$,v,A,P={val:d(0),position:c,index:1};for(w=0;w<3;w+=1)u[w]=w;for(S=0,$=Math.pow(2,2),v=1;v!=$;)C=P.val&P.position,P.position>>=1,P.position==0&&(P.position=c,P.val=d(P.index++)),S|=(C>0?1:0)*v,v<<=1;switch(S){case 0:for(S=0,$=Math.pow(2,8),v=1;v!=$;)C=P.val&P.position,P.position>>=1,P.position==0&&(P.position=c,P.val=d(P.index++)),S|=(C>0?1:0)*v,v<<=1;A=n(S);break;case 1:for(S=0,$=Math.pow(2,16),v=1;v!=$;)C=P.val&P.position,P.position>>=1,P.position==0&&(P.position=c,P.val=d(P.index++)),S|=(C>0?1:0)*v,v<<=1;A=n(S);break;case 2:return""}for(u[3]=A,T=A,b.push(A);;){if(P.index>l)return"";for(S=0,$=Math.pow(2,m),v=1;v!=$;)C=P.val&P.position,P.position>>=1,P.position==0&&(P.position=c,P.val=d(P.index++)),S|=(C>0?1:0)*v,v<<=1;switch(A=S){case 0:for(S=0,$=Math.pow(2,8),v=1;v!=$;)C=P.val&P.position,P.position>>=1,P.position==0&&(P.position=c,P.val=d(P.index++)),S|=(C>0?1:0)*v,v<<=1;u[f++]=n(S),A=f-1,h--;break;case 1:for(S=0,$=Math.pow(2,16),v=1;v!=$;)C=P.val&P.position,P.position>>=1,P.position==0&&(P.position=c,P.val=d(P.index++)),S|=(C>0?1:0)*v,v<<=1;u[f++]=n(S),A=f-1,h--;break;case 2:return b.join("")}if(h==0&&(h=Math.pow(2,m),m++),u[A])p=u[A];else if(A===f)p=T+T.charAt(0);else return null;b.push(p),u[f++]=T+p.charAt(0),h--,T=p,h==0&&(h=Math.pow(2,m),m++)}}};return a})();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})(Xs)),Xs.exports}var _u=ux();function tC(e){return/\.excalidraw(\.md)?$/i.test(e)}const Cu=/(\n##? Drawing\n[^`]*```json\n)([\s\S]*?)(```\n)/,Au=/(\n##? Drawing\n[^`]*```compressed-json\n)([\s\S]*?)(```\n)/,Tu=/```compressed-json\n/;function Ja(e){const t=Tu.test(e),n=(t?Au:Cu).exec(e);if(!n)return null;const i=t?_u.decompressFromBase64(px(n[2])):n[2];if(!i)return null;const s=i.lastIndexOf("}");return s===-1?null:{sceneJson:i.slice(0,s+1),compressed:t}}function dx(e,t){const n=Tu.test(e),i=(n?Au:Cu).exec(e);if(!i)return null;const s=n?hx(t):t;return e.slice(0,i.index)+i[1]+s+`
123
+ `+i[3]+e.slice(i.index+i[0].length)}const fx=["---","","excalidraw-plugin: parsed","tags: [excalidraw]","","---","==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'","",""].join(`
124
+ `);function nC(e){return`${fx}
125
+ ## Drawing
126
+ \`\`\`json
127
+ ${e}
128
+ \`\`\`
129
+ %%`}const iC='{"type":"excalidraw","version":2,"source":"Forsion Amadeus","elements":[],"appState":{"gridSize":null,"viewBackgroundColor":"#ffffff"}}';function hx(e){const t=_u.compressToBase64(e);let n="";for(let i=0;i<t.length;i+=256)n+=`${t.slice(i,i+256)}
130
+
131
+ `;return n.trim()}const px=e=>e.replace(/[\n\r]/g,""),mx=(e,t)=>{const n=e.version??0,i=t.version??0;return n!==i?n>i:(e.versionNonce??0)<=(t.versionNonce??0)},Ii=e=>typeof e.index=="string"?e.index:"￿";function gx(e,t){const n=new Map;for(const i of t)i&&typeof i.id=="string"&&n.set(i.id,i);for(const i of e){if(!i||typeof i.id!="string")continue;const s=n.get(i.id);(!s||mx(i,s))&&n.set(i.id,i)}return[...n.values()].sort((i,s)=>Ii(i)<Ii(s)?-1:Ii(i)>Ii(s)?1:0)}function sC(e,t){if(e.length!==t.length)return!1;const n=new Map(e.map(i=>[i.id,i]));for(const i of t){const s=n.get(i.id);if(!s||(s.version??0)!==(i.version??0)||(s.versionNonce??0)!==(i.versionNonce??0))return!1}return!0}function bx(e,t){return{...t,...e,elements:gx(e.elements??[],t.elements??[]),appState:e.appState??t.appState??{},files:{...t.files??{},...e.files??{}}}}const ho=Symbol.for("yaml.alias"),Er=Symbol.for("yaml.document"),Lt=Symbol.for("yaml.map"),Eu=Symbol.for("yaml.pair"),vt=Symbol.for("yaml.scalar"),$n=Symbol.for("yaml.seq"),at=Symbol.for("yaml.node.type"),Rn=e=>!!e&&typeof e=="object"&&e[at]===ho,ui=e=>!!e&&typeof e=="object"&&e[at]===Er,Nn=e=>!!e&&typeof e=="object"&&e[at]===Lt,Ie=e=>!!e&&typeof e=="object"&&e[at]===Eu,be=e=>!!e&&typeof e=="object"&&e[at]===vt,Ln=e=>!!e&&typeof e=="object"&&e[at]===$n;function Te(e){if(e&&typeof e=="object")switch(e[at]){case Lt:case $n:return!0}return!1}function Ee(e){if(e&&typeof e=="object")switch(e[at]){case ho:case Lt:case vt:case $n:return!0}return!1}const Iu=e=>(be(e)||Te(e))&&!!e.anchor,qt=Symbol("break visit"),yx=Symbol("skip children"),Xn=Symbol("remove node");function Fn(e,t){const n=wx(t);ui(e)?mn(null,e.contents,n,Object.freeze([e]))===Xn&&(e.contents=null):mn(null,e,n,Object.freeze([]))}Fn.BREAK=qt;Fn.SKIP=yx;Fn.REMOVE=Xn;function mn(e,t,n,i){const s=kx(e,t,n,i);if(Ee(s)||Ie(s))return vx(e,i,s),mn(e,s,n,i);if(typeof s!="symbol"){if(Te(t)){i=Object.freeze(i.concat(t));for(let r=0;r<t.items.length;++r){const o=mn(r,t.items[r],n,i);if(typeof o=="number")r=o-1;else{if(o===qt)return qt;o===Xn&&(t.items.splice(r,1),r-=1)}}}else if(Ie(t)){i=Object.freeze(i.concat(t));const r=mn("key",t.key,n,i);if(r===qt)return qt;r===Xn&&(t.key=null);const o=mn("value",t.value,n,i);if(o===qt)return qt;o===Xn&&(t.value=null)}}return s}function wx(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function kx(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(Nn(t))return n.Map?.(e,t,i);if(Ln(t))return n.Seq?.(e,t,i);if(Ie(t))return n.Pair?.(e,t,i);if(be(t))return n.Scalar?.(e,t,i);if(Rn(t))return n.Alias?.(e,t,i)}function vx(e,t,n){const i=t[t.length-1];if(Te(i))i.items[e]=n;else if(Ie(i))e==="key"?i.key=n:i.value=n;else if(ui(i))i.contents=n;else{const s=Rn(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const Sx={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},xx=e=>e.replace(/[!,[\]{}]/g,t=>Sx[t]);class Me{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Me.defaultYaml,t),this.tags=Object.assign({},Me.defaultTags,n)}clone(){const t=new Me(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Me(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Me.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Me.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Me.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Me.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),s=i.shift();switch(s){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const r=this.tags[i];if(r)try{return r+decodeURIComponent(s)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+xx(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let s;if(t&&i.length>0&&Ee(t.contents)){const r={};Fn(t.contents,(o,a)=>{Ee(a)&&a.tag&&(r[a.tag]=!0)}),s=Object.keys(r)}else s=[];for(const[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
132
+ `)}}Me.defaultYaml={explicit:!1,version:"1.2"};Me.defaultTags={"!!":"tag:yaml.org,2002:"};function Pu(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Ou(e){const t=new Set;return Fn(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function $u(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function _x(e,t){const n=[],i=new Map;let s=null;return{onAnchor:r=>{n.push(r),s??(s=Ou(e));const o=$u(t,s);return s.add(o),o},setAnchors:()=>{for(const r of n){const o=i.get(r);if(typeof o=="object"&&o.anchor&&(be(o.node)||Te(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:i}}function gn(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let s=0,r=i.length;s<r;++s){const o=i[s],a=gn(e,i,String(s),o);a===void 0?delete i[s]:a!==o&&(i[s]=a)}else if(i instanceof Map)for(const s of Array.from(i.keys())){const r=i.get(s),o=gn(e,i,s,r);o===void 0?i.delete(s):o!==r&&i.set(s,o)}else if(i instanceof Set)for(const s of Array.from(i)){const r=gn(e,i,s,s);r===void 0?i.delete(s):r!==s&&(i.delete(s),i.add(r))}else for(const[s,r]of Object.entries(i)){const o=gn(e,i,s,r);o===void 0?delete i[s]:o!==r&&(i[s]=o)}return e.call(t,n,i)}function ot(e,t,n){if(Array.isArray(e))return e.map((i,s)=>ot(i,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!Iu(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=r=>{i.res=r,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!n?.keep?Number(e):e}class po{constructor(t){Object.defineProperty(this,at,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:r}={}){if(!ui(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=ot(this,"",o);if(typeof s=="function")for(const{count:l,res:c}of o.anchors.values())s(c,l);return typeof r=="function"?gn(r,{"":a},"",a):a}}class mo extends po{constructor(t){super(ho),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],Fn(t,{Node:(r,o)=>{(Rn(o)||Iu(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let s;for(const r of i){if(r===this)break;r.anchor===this.source&&(s=r)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:s,maxAliasCount:r}=n,o=this.resolve(s,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(o);if(a||(ot(o,null,n),a=i.get(o)),a?.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Wi(s,o,i)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,i){const s=`*${this.source}`;if(t){if(Pu(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${s} `}return s}}function Wi(e,t,n){if(Rn(t)){const i=t.resolve(e),s=n&&i&&n.get(i);return s?s.count*s.aliasCount:0}else if(Te(t)){let i=0;for(const s of t.items){const r=Wi(e,s,n);r>i&&(i=r)}return i}else if(Ie(t)){const i=Wi(e,t.key,n),s=Wi(e,t.value,n);return Math.max(i,s)}return 1}const Ru=e=>!e||typeof e!="function"&&typeof e!="object";class re extends po{constructor(t){super(vt),this.value=t}toJSON(t,n){return n?.keep?this.value:ot(this.value,t,n)}toString(){return String(this.value)}}re.BLOCK_FOLDED="BLOCK_FOLDED";re.BLOCK_LITERAL="BLOCK_LITERAL";re.PLAIN="PLAIN";re.QUOTE_DOUBLE="QUOTE_DOUBLE";re.QUOTE_SINGLE="QUOTE_SINGLE";const Cx="tag:yaml.org,2002:";function Ax(e,t,n){if(t){const i=n.filter(r=>r.tag===t),s=i.find(r=>!r.format)??i[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(i=>i.identify?.(e)&&!i.format)}function si(e,t,n){if(ui(e)&&(e=e.contents),Ee(e))return e;if(Ie(e)){const u=n.schema[Lt].createNode?.(n.schema,null,n);return u.items.push(e),u}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:s,onTagObj:r,schema:o,sourceObjects:a}=n;let l;if(i&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=s(e)),new mo(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Cx+t.slice(2));let c=Ax(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const u=new re(e);return l&&(l.node=u),u}c=e instanceof Map?o[Lt]:Symbol.iterator in Object(e)?o[$n]:o[Lt]}r&&(r(c),delete n.onTagObj);const d=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new re(e);return t?d.tag=t:c.default||(d.tag=c.tag),l&&(l.node=d),d}function os(e,t,n){let i=n;for(let s=t.length-1;s>=0;--s){const r=t[s];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return si(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Gn=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Nu extends po{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Ee(i)||Ie(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Gn(t))this.add(n);else{const[i,...s]=t,r=this.get(i,!0);if(Te(r))r.addIn(s,n);else if(r===void 0&&this.schema)this.set(i,os(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const s=this.get(n,!0);if(Te(s))return s.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...s]=t,r=this.get(i,!0);return s.length===0?!n&&be(r)?r.value:r:Te(r)?r.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ie(n))return!1;const i=n.value;return i==null||t&&be(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const s=this.get(n,!0);return Te(s)?s.hasIn(i):!1}setIn(t,n){const[i,...s]=t;if(s.length===0)this.set(i,n);else{const r=this.get(i,!0);if(Te(r))r.setIn(s,n);else if(r===void 0&&this.schema)this.set(i,os(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}}const Tx=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function At(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Vt=(e,t,n)=>e.endsWith(`
133
+ `)?At(n,t):n.includes(`
134
+ `)?`
135
+ `+At(n,t):(e.endsWith(" ")?"":" ")+n,Lu="flow",Ir="block",Vi="quoted";function xs(e,t,n="flow",{indentAtStart:i,lineWidth:s=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<r&&(r=0);const l=Math.max(1+r,1+s-t.length);if(e.length<=l)return e;const c=[],d={};let u=s-t.length;typeof i=="number"&&(i>s-Math.max(2,r)?c.push(0):u=s-i);let h,f,m=!1,p=-1,b=-1,w=-1;n===Ir&&(p=Qa(e,p,t.length),p!==-1&&(u=p+l));for(let S;S=e[p+=1];){if(n===Vi&&S==="\\"){switch(b=p,e[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}w=p}if(S===`
136
+ `)n===Ir&&(p=Qa(e,p,t.length)),u=p+t.length+l,h=void 0;else{if(S===" "&&f&&f!==" "&&f!==`
137
+ `&&f!==" "){const C=e[p+1];C&&C!==" "&&C!==`
138
+ `&&C!==" "&&(h=p)}if(p>=u)if(h)c.push(h),u=h+l,h=void 0;else if(n===Vi){for(;f===" "||f===" ";)f=S,S=e[p+=1],m=!0;const C=p>w+1?p-2:b-1;if(d[C])return e;c.push(C),d[C]=!0,u=C+l,h=void 0}else m=!0}f=S}if(m&&a&&a(),c.length===0)return e;o&&o();let T=e.slice(0,c[0]);for(let S=0;S<c.length;++S){const C=c[S],$=c[S+1]||e.length;C===0?T=`
139
+ ${t}${e.slice(0,$)}`:(n===Vi&&d[C]&&(T+=`${e[C]}\\`),T+=`
140
+ ${t}${e.slice(C+1,$)}`)}return T}function Qa(e,t,n){let i=t,s=t+1,r=e[s];for(;r===" "||r===" ";)if(t<s+n)r=e[++t];else{do r=e[++t];while(r&&r!==`
141
+ `);i=t,s=t+1,r=e[s]}return i}const _s=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Cs=e=>/^(%|---|\.\.\.)/m.test(e);function Ex(e,t,n){if(!t||t<0)return!1;const i=t-n,s=e.length;if(s<=i)return!1;for(let r=0,o=0;r<s;++r)if(e[r]===`
142
+ `){if(r-o>i)return!0;if(o=r+1,s-o<=i)return!1}return!0}function ei(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,s=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(Cs(e)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const d=n.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(i||n[l+2]==='"'||n.length<s)l+=1;else{for(o+=n.slice(a,l)+`
143
+
144
+ `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
145
+ `,l+=2;o+=r,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,i?o:xs(o,r,Vi,_s(t,!1))}function Pr(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
146
+ `)||/[ \t]\n|\n[ \t]/.test(e))return ei(e,t);const n=t.indent||(Cs(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
147
+ ${n}`)+"'";return t.implicitKey?i:xs(i,n,Lu,_s(t,!1))}function bn(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=ei;else{const s=e.includes('"'),r=e.includes("'");s&&!r?i=Pr:r&&!s?i=ei:i=n?Pr:ei}return i(e,t)}let Or;try{Or=new RegExp(`(^|(?<!
148
+ ))
149
+ +(?!
150
+ |$)`,"g")}catch{Or=/\n+(?!\n|$)/g}function Zi({comment:e,type:t,value:n},i,s,r){const{blockQuote:o,commentString:a,lineWidth:l}=i.options;if(!o||/\n[\t ]+$/.test(n))return bn(n,i);const c=i.indent||(i.forceBlockIndent||Cs(n)?" ":""),d=o==="literal"?!0:o==="folded"||t===re.BLOCK_FOLDED?!1:t===re.BLOCK_LITERAL?!0:!Ex(n,l,c.length);if(!n)return d?`|
151
+ `:`>
152
+ `;let u,h;for(h=n.length;h>0;--h){const $=n[h-1];if($!==`
153
+ `&&$!==" "&&$!==" ")break}let f=n.substring(h);const m=f.indexOf(`
154
+ `);m===-1?u="-":n===f||m!==f.length-1?(u="+",r&&r()):u="",f&&(n=n.slice(0,-f.length),f[f.length-1]===`
155
+ `&&(f=f.slice(0,-1)),f=f.replace(Or,`$&${c}`));let p=!1,b,w=-1;for(b=0;b<n.length;++b){const $=n[b];if($===" ")p=!0;else if($===`
156
+ `)w=b;else break}let T=n.substring(0,w<b?w+1:b);T&&(n=n.substring(T.length),T=T.replace(/\n+/g,`$&${c}`));let C=(p?c?"2":"1":"")+u;if(e&&(C+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!d){const $=n.replace(/\n+/g,`
157
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let v=!1;const A=_s(i,!0);o!=="folded"&&t!==re.BLOCK_FOLDED&&(A.onOverflow=()=>{v=!0});const P=xs(`${T}${$}${f}`,c,Ir,A);if(!v)return`>${C}
158
+ ${c}${P}`}return n=n.replace(/\n+/g,`$&${c}`),`|${C}
159
+ ${c}${T}${n}${f}`}function Ix(e,t,n,i){const{type:s,value:r}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=t;if(a&&r.includes(`
160
+ `)||d&&/[[\]{},]/.test(r))return bn(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
161
+ `)?bn(r,t):Zi(e,t,n,i);if(!a&&!d&&s!==re.PLAIN&&r.includes(`
162
+ `))return Zi(e,t,n,i);if(Cs(r)){if(l==="")return t.forceBlockIndent=!0,Zi(e,t,n,i);if(a&&l===c)return bn(r,t)}const u=r.replace(/\n+/g,`$&
163
+ ${l}`);if(o){const h=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:f,tags:m}=t.doc.schema;if(m.some(h)||f?.some(h))return bn(r,t)}return a?u:xs(u,l,Lu,_s(t,!1))}function go(e,t,n,i){const{implicitKey:s,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=re.QUOTE_DOUBLE);const l=d=>{switch(d){case re.BLOCK_FOLDED:case re.BLOCK_LITERAL:return s||r?bn(o.value,t):Zi(o,t,n,i);case re.QUOTE_DOUBLE:return ei(o.value,t);case re.QUOTE_SINGLE:return Pr(o.value,t);case re.PLAIN:return Ix(o,t,n,i);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:d,defaultStringType:u}=t.options,h=s&&d||u;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function Fu(e,t){const n=Object.assign({blockQuote:!0,commentString:Tx,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Px(e,t){if(t.tag){const s=e.filter(r=>r.tag===t.tag);if(s.length>0)return s.find(r=>r.format===t.format)??s[0]}let n,i;if(be(t)){i=t.value;let s=e.filter(r=>r.identify?.(i));if(s.length>1){const r=s.filter(o=>o.test);r.length>0&&(s=r)}n=s.find(r=>r.format===t.format)??s.find(r=>!r.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function Ox(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const s=[],r=(be(e)||Te(e))&&e.anchor;r&&Pu(r)&&(n.add(r),s.push(`&${r}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(i.directives.tagString(o)),s.join(" ")}function En(e,t,n,i){if(Ie(e))return e.toString(t,n,i);if(Rn(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const r=Ee(e)?e:t.doc.createNode(e,{onTagObj:l=>s=l});s??(s=Px(t.doc.schema.tags,r));const o=Ox(r,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(r,t,n,i):be(r)?go(r,t,n,i):r.toString(t,n,i);return o?be(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
164
+ ${t.indent}${a}`:a}function $x({key:e,value:t},n,i,s){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=n;let h=Ee(e)&&e.comment||null;if(u){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Te(e)||!Ee(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let f=!u&&(!e||h&&t==null&&!n.inFlow||Te(e)||(be(e)?e.type===re.BLOCK_FOLDED||e.type===re.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(u||!r),indent:a+l});let m=!1,p=!1,b=En(e,n,()=>m=!0,()=>p=!0);if(!f&&!n.inFlow&&b.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(r||t==null)return m&&i&&i(),b===""?"?":f?`? ${b}`:b}else if(r&&!u||t==null&&f)return b=`? ${b}`,h&&!m?b+=Vt(b,n.indent,c(h)):p&&s&&s(),b;m&&(h=null),f?(h&&(b+=Vt(b,n.indent,c(h))),b=`? ${b}
165
+ ${a}:`):(b=`${b}:`,h&&(b+=Vt(b,n.indent,c(h))));let w,T,S;Ee(t)?(w=!!t.spaceBefore,T=t.commentBefore,S=t.comment):(w=!1,T=null,S=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!f&&!h&&be(t)&&(n.indentAtStart=b.length+1),p=!1,!d&&l.length>=2&&!n.inFlow&&!f&&Ln(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const $=En(t,n,()=>C=!0,()=>p=!0);let v=" ";if(h||w||T){if(v=w?`
166
+ `:"",T){const A=c(T);v+=`
167
+ ${At(A,n.indent)}`}$===""&&!n.inFlow?v===`
168
+ `&&S&&(v=`
169
+
170
+ `):v+=`
171
+ ${n.indent}`}else if(!f&&Te(t)){const A=$[0],P=$.indexOf(`
172
+ `),q=P!==-1,R=n.inFlow??t.flow??t.items.length===0;if(q||!R){let U=!1;if(q&&(A==="&"||A==="!")){let B=$.indexOf(" ");A==="&"&&B!==-1&&B<P&&$[B+1]==="!"&&(B=$.indexOf(" ",B+1)),(B===-1||P<B)&&(U=!0)}U||(v=`
173
+ ${n.indent}`)}}else($===""||$[0]===`
174
+ `)&&(v="");return b+=v+$,n.inFlow?C&&i&&i():S&&!C?b+=Vt(b,n.indent,c(S)):p&&s&&s(),b}function Du(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Pi="<<",Tt={identify:e=>e===Pi||typeof e=="symbol"&&e.description===Pi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new re(Symbol(Pi)),{addToJSMap:zu}),stringify:()=>Pi},Rx=(e,t)=>(Tt.identify(t)||be(t)&&(!t.type||t.type===re.PLAIN)&&Tt.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Tt.tag&&n.default);function zu(e,t,n){const i=Mu(e,n);if(Ln(i))for(const s of i.items)er(e,t,s);else if(Array.isArray(i))for(const s of i)er(e,t,s);else er(e,t,i)}function er(e,t,n){const i=Mu(e,n);if(!Nn(i))throw new Error("Merge sources must be maps or map aliases");const s=i.toJSON(null,e,Map);for(const[r,o]of s)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Mu(e,t){return e&&Rn(t)?t.resolve(e.doc,e):t}function ju(e,t,{key:n,value:i}){if(Ee(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(Rx(e,n))zu(e,t,i);else{const s=ot(n,"",e);if(t instanceof Map)t.set(s,ot(i,s,e));else if(t instanceof Set)t.add(s);else{const r=Nx(n,s,e),o=ot(i,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function Nx(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ee(e)&&n?.doc){const i=Fu(n.doc,{});i.anchors=new Set;for(const r of n.anchors.keys())i.anchors.add(r.anchor);i.inFlow=!0,i.inStringifyKey=!0;const s=e.toString(i);if(!n.mapKeyWarned){let r=JSON.stringify(s);r.length>40&&(r=r.substring(0,36)+'..."'),Du(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function bo(e,t,n){const i=si(e,void 0,n),s=si(t,void 0,n);return new Ue(i,s)}class Ue{constructor(t,n=null){Object.defineProperty(this,at,{value:Eu}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ee(n)&&(n=n.clone(t)),Ee(i)&&(i=i.clone(t)),new Ue(n,i)}toJSON(t,n){const i=n?.mapAsMap?new Map:{};return ju(n,i,this)}toString(t,n,i){return t?.doc?$x(this,t,n,i):JSON.stringify(this)}}function Bu(e,t,n){return(t.inFlow??e.flow?Fx:Lx)(e,t,n)}function Lx({comment:e,items:t},n,{blockItemPrefix:i,flowChars:s,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:r,type:null});let u=!1;const h=[];for(let m=0;m<t.length;++m){const p=t[m];let b=null;if(Ee(p))!u&&p.spaceBefore&&h.push(""),as(n,h,p.commentBefore,u),p.comment&&(b=p.comment);else if(Ie(p)){const T=Ee(p.key)?p.key:null;T&&(!u&&T.spaceBefore&&h.push(""),as(n,h,T.commentBefore,u))}u=!1;let w=En(p,d,()=>b=null,()=>u=!0);b&&(w+=Vt(w,r,c(b))),u&&b&&(u=!1),h.push(i+w)}let f;if(h.length===0)f=s.start+s.end;else{f=h[0];for(let m=1;m<h.length;++m){const p=h[m];f+=p?`
175
+ ${l}${p}`:`
176
+ `}}return e?(f+=`
177
+ `+At(c(e),l),a&&a()):u&&o&&o(),f}function Fx({items:e},t,{flowChars:n,itemIndent:i}){const{indent:s,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;i+=r;const l=Object.assign({},t,{indent:i,inFlow:!0,type:null});let c=!1,d=0;const u=[];for(let m=0;m<e.length;++m){const p=e[m];let b=null;if(Ee(p))p.spaceBefore&&u.push(""),as(t,u,p.commentBefore,!1),p.comment&&(b=p.comment);else if(Ie(p)){const T=Ee(p.key)?p.key:null;T&&(T.spaceBefore&&u.push(""),as(t,u,T.commentBefore,!1),T.comment&&(c=!0));const S=Ee(p.value)?p.value:null;S?(S.comment&&(b=S.comment),S.commentBefore&&(c=!0)):p.value==null&&T?.comment&&(b=T.comment)}b&&(c=!0);let w=En(p,l,()=>b=null);c||(c=u.length>d||w.includes(`
178
+ `)),m<e.length-1?w+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=u.reduce((T,S)=>T+S.length+2,2)+(w.length+2)>t.options.lineWidth)),c&&(w+=",")),b&&(w+=Vt(w,i,a(b))),u.push(w),d=u.length}const{start:h,end:f}=n;if(u.length===0)return h+f;if(!c){const m=u.reduce((p,b)=>p+b.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=h;for(const p of u)m+=p?`
179
+ ${r}${s}${p}`:`
180
+ `;return`${m}
181
+ ${s}${f}`}else return`${h}${o}${u.join(" ")}${o}${f}`}function as({indent:e,options:{commentString:t}},n,i,s){if(i&&s&&(i=i.replace(/^\n+/,"")),i){const r=At(t(i),e);n.push(r.trimStart())}}function Zt(e,t){const n=be(t)?t.value:t;for(const i of e)if(Ie(i)&&(i.key===t||i.key===n||be(i.key)&&i.key.value===n))return i}class rt extends Nu{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Lt,t),this.items=[]}static from(t,n,i){const{keepUndefined:s,replacer:r}=i,o=new this(t),a=(l,c)=>{if(typeof r=="function")c=r.call(n,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||s)&&o.items.push(bo(l,c,i))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let i;Ie(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Ue(t,t?.value):i=new Ue(t.key,t.value);const s=Zt(this.items,i.key),r=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${i.key} already set`);be(s.value)&&Ru(i.value)?s.value.value=i.value:s.value=i.value}else if(r){const o=this.items.findIndex(a=>r(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(t){const n=Zt(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=Zt(this.items,t)?.value;return(!n&&be(s)?s.value:s)??void 0}has(t){return!!Zt(this.items,t)}set(t,n){this.add(new Ue(t,n),!0)}toJSON(t,n,i){const s=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const r of this.items)ju(n,s,r);return s}toString(t,n,i){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Ie(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Bu(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const Dn={collection:"map",default:!0,nodeClass:rt,tag:"tag:yaml.org,2002:map",resolve(e,t){return Nn(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>rt.from(e,t,n)};class Yt extends Nu{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super($n,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Oi(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=Oi(t);if(typeof i!="number")return;const s=this.items[i];return!n&&be(s)?s.value:s}has(t){const n=Oi(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=Oi(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[i];be(s)&&Ru(n)?s.value=n:this.items[i]=n}toJSON(t,n){const i=[];n?.onCreate&&n.onCreate(i);let s=0;for(const r of this.items)i.push(ot(r,String(s++),n));return i}toString(t,n,i){return t?Bu(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:s}=i,r=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const l=n instanceof Set?a:String(o++);a=s.call(n,l,a)}r.items.push(si(a,void 0,i))}}return r}}function Oi(e){let t=be(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const zn={collection:"seq",default:!0,nodeClass:Yt,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ln(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Yt.from(e,t,n)},As={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),go(e,t,n,i)}},Ts={identify:e=>e==null,createNode:()=>new re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new re(null),stringify:({source:e},t)=>typeof e=="string"&&Ts.test.test(e)?e:t.options.nullStr},yo={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new re(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&yo.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function pt({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const s=typeof i=="number"?i:Number(i);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let r=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=t-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const Uu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:pt},Hu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():pt(e)}},qu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new re(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:pt},Es=e=>typeof e=="bigint"||Number.isInteger(e),wo=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Wu(e,t,n){const{value:i}=e;return Es(i)&&i>=0?n+i.toString(t):pt(e)}const Vu={identify:e=>Es(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>wo(e,2,8,n),stringify:e=>Wu(e,8,"0o")},Zu={identify:Es,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>wo(e,0,10,n),stringify:pt},Ku={identify:e=>Es(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>wo(e,2,16,n),stringify:e=>Wu(e,16,"0x")},Dx=[Dn,zn,As,Ts,yo,Vu,Zu,Ku,Uu,Hu,qu];function Xa(e){return typeof e=="bigint"||Number.isInteger(e)}const $i=({value:e})=>JSON.stringify(e),zx=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:$i},{identify:e=>e==null,createNode:()=>new re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:$i},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:$i},{identify:Xa,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Xa(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:$i}],Mx={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},jx=[Dn,zn].concat(zx,Mx),ko={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let s=0;s<n.length;++s)i[s]=n.charCodeAt(s);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,s,r){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=re.BLOCK_LITERAL),t!==re.QUOTE_DOUBLE){const l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let u=0,h=0;u<c;++u,h+=l)d[u]=a.substr(h,l);a=d.join(t===re.BLOCK_LITERAL?`
182
+ `:" ")}return go({comment:e,type:t,value:a},i,s,r)}};function Gu(e,t){if(Ln(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!Ie(i)){if(Nn(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const s=i.items[0]||new Ue(new re(null));if(i.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${i.commentBefore}
183
+ ${s.key.commentBefore}`:i.commentBefore),i.comment){const r=s.value??s.key;r.comment=r.comment?`${i.comment}
184
+ ${r.comment}`:i.comment}i=s}e.items[n]=Ie(i)?i:new Ue(i)}}else t("Expected a sequence for this tag");return e}function Yu(e,t,n){const{replacer:i}=n,s=new Yt(e);s.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;s.items.push(bo(a,l,n))}return s}const vo={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Gu,createNode:Yu};class wn extends Yt{constructor(){super(),this.add=rt.prototype.add.bind(this),this.delete=rt.prototype.delete.bind(this),this.get=rt.prototype.get.bind(this),this.has=rt.prototype.has.bind(this),this.set=rt.prototype.set.bind(this),this.tag=wn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n?.onCreate&&n.onCreate(i);for(const s of this.items){let r,o;if(Ie(s)?(r=ot(s.key,"",n),o=ot(s.value,r,n)):r=ot(s,"",n),i.has(r))throw new Error("Ordered maps must not include duplicate keys");i.set(r,o)}return i}static from(t,n,i){const s=Yu(t,n,i),r=new this;return r.items=s.items,r}}wn.tag="tag:yaml.org,2002:omap";const So={collection:"seq",identify:e=>e instanceof Map,nodeClass:wn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Gu(e,t),i=[];for(const{key:s}of n.items)be(s)&&(i.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):i.push(s.value));return Object.assign(new wn,n)},createNode:(e,t,n)=>wn.from(e,t,n)};function Ju({value:e,source:t},n){return t&&(e?Qu:Xu).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Qu={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new re(!0),stringify:Ju},Xu={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new re(!1),stringify:Ju},Bx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:pt},Ux={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():pt(e)}},Hx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new re(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:pt},di=e=>typeof e=="bigint"||Number.isInteger(e);function Is(e,t,n,{intAsBigInt:i}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const r=parseInt(e,n);return s==="-"?-1*r:r}function xo(e,t,n){const{value:i}=e;if(di(i)){const s=i.toString(t);return i<0?"-"+n+s.substr(1):n+s}return pt(e)}const qx={identify:di,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Is(e,2,2,n),stringify:e=>xo(e,2,"0b")},Wx={identify:di,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Is(e,1,8,n),stringify:e=>xo(e,8,"0")},Vx={identify:di,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Is(e,0,10,n),stringify:pt},Zx={identify:di,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Is(e,2,16,n),stringify:e=>xo(e,16,"0x")};class kn extends rt{constructor(t){super(t),this.tag=kn.tag}add(t){let n;Ie(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ue(t.key,null):n=new Ue(t,null),Zt(this.items,n.key)||this.items.push(n)}get(t,n){const i=Zt(this.items,t);return!n&&Ie(i)?be(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Zt(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Ue(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:s}=i,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),r.items.push(bo(o,null,i));return r}}kn.tag="tag:yaml.org,2002:set";const _o={collection:"map",identify:e=>e instanceof Set,nodeClass:kn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>kn.from(e,t,n),resolve(e,t){if(Nn(e)){if(e.hasAllNullValues(!0))return Object.assign(new kn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Co(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,s=o=>t?BigInt(o):Number(o),r=i.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*r:r}function ed(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return pt(e);let i="";t<0&&(i="-",t*=n(-1));const s=n(60),r=[t%s];return t<60?r.unshift(0):(t=(t-r[0])/s,r.unshift(t%s),t>=60&&(t=(t-r[0])/s,r.unshift(t))),i+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const td={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Co(e,n),stringify:ed},nd={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Co(e,!1),stringify:ed},Ps={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Ps.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,s,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,i-1,s,r||0,o||0,a||0,l);const d=t[8];if(d&&d!=="Z"){let u=Co(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},el=[Dn,zn,As,Ts,Qu,Xu,qx,Wx,Vx,Zx,Bx,Ux,Hx,ko,Tt,So,vo,_o,td,nd,Ps],tl=new Map([["core",Dx],["failsafe",[Dn,zn,As]],["json",jx],["yaml11",el],["yaml-1.1",el]]),nl={binary:ko,bool:yo,float:qu,floatExp:Hu,floatNaN:Uu,floatTime:nd,int:Zu,intHex:Ku,intOct:Vu,intTime:td,map:Dn,merge:Tt,null:Ts,omap:So,pairs:vo,seq:zn,set:_o,timestamp:Ps},Kx={"tag:yaml.org,2002:binary":ko,"tag:yaml.org,2002:merge":Tt,"tag:yaml.org,2002:omap":So,"tag:yaml.org,2002:pairs":vo,"tag:yaml.org,2002:set":_o,"tag:yaml.org,2002:timestamp":Ps};function tr(e,t,n){const i=tl.get(t);if(i&&!e)return n&&!i.includes(Tt)?i.concat(Tt):i.slice();let s=i;if(!s)if(Array.isArray(e))s=[];else{const r=Array.from(tl.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)s=s.concat(r);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Tt)),s.reduce((r,o)=>{const a=typeof o=="string"?nl[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(nl).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const Gx=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Ao{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:s,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?tr(t,"compat"):t?tr(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=s?Kx:{},this.tags=tr(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,Lt,{value:Dn}),Object.defineProperty(this,vt,{value:As}),Object.defineProperty(this,$n,{value:zn}),this.sortMapEntries=typeof o=="function"?o:o===!0?Gx:null}clone(){const t=Object.create(Ao.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Yx(e,t){const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const l=e.directives.toString(e);l?(n.push(l),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const s=Fu(e,t),{commentString:r}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const l=r(e.commentBefore);n.unshift(At(l,""))}let o=!1,a=null;if(e.contents){if(Ee(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const d=r(e.contents.commentBefore);n.push(At(d,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const l=a?void 0:()=>o=!0;let c=En(e.contents,s,()=>a=null,l);a&&(c+=Vt(c,"",r(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(En(e.contents,s));if(e.directives?.docEnd)if(e.comment){const l=r(e.comment);l.includes(`
185
+ `)?(n.push("..."),n.push(At(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=e.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(At(r(l),"")))}return n.join(`
186
+ `)+`
187
+ `}class Mn{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,at,{value:Er});let s=null;typeof n=="function"||Array.isArray(n)?s=n:i===void 0&&n&&(i=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=r;let{version:o}=r;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Me({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,s,i)}clone(){const t=Object.create(Mn.prototype,{[at]:{value:Er}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ee(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){rn(this.contents)&&this.contents.add(t)}addIn(t,n){rn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=Ou(this);t.anchor=!n||i.has(n)?$u(n||"a",i):n}return new mo(t.anchor)}createNode(t,n,i){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const b=T=>typeof T=="number"||T instanceof String||T instanceof Number,w=n.filter(b).map(String);w.length>0&&(n=n.concat(w)),s=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=i??{},{onAnchor:u,setAnchors:h,sourceObjects:f}=_x(this,o||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:f},p=si(t,d,m);return a&&Te(p)&&(p.flow=!0),h(),p}createPair(t,n,i={}){const s=this.createNode(t,null,i),r=this.createNode(n,null,i);return new Ue(s,r)}delete(t){return rn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Gn(t)?this.contents==null?!1:(this.contents=null,!0):rn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Te(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Gn(t)?!n&&be(this.contents)?this.contents.value:this.contents:Te(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Te(this.contents)?this.contents.has(t):!1}hasIn(t){return Gn(t)?this.contents!==void 0:Te(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=os(this.schema,[t],n):rn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Gn(t)?this.contents=n:this.contents==null?this.contents=os(this.schema,Array.from(t),n):rn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Me({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Me({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new Ao(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:s,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=ot(this.contents,n??"",a);if(typeof r=="function")for(const{count:c,res:d}of a.anchors.values())r(d,c);return typeof o=="function"?gn(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Yx(this,t)}}function rn(e){if(Te(e))return!0;throw new Error("Expected a YAML collection as document contents")}class id extends Error{constructor(t,n,i,s){super(),this.name=t,this.code=i,this.message=s,this.pos=n}}class Yn extends id{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class Jx extends id{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const il=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:i,col:s}=n.linePos[0];n.message+=` at line ${i}, column ${s}`;let r=s-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
188
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];l?.line===i&&l.col>s&&(a=Math.max(1,Math.min(l.col-s,80-r)));const c=" ".repeat(r)+"^".repeat(a);n.message+=`:
189
+
190
+ ${o}
191
+ ${c}
192
+ `}};function In(e,{flow:t,indicator:n,next:i,offset:s,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,u="",h="",f=!1,m=!1,p=null,b=null,w=null,T=null,S=null,C=null,$=null;for(const P of e)switch(m&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&r(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),p&&(c&&P.type!=="comment"&&P.type!=="newline"&&r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),P.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&P.source.includes(" ")&&(p=P),d=!0;break;case"comment":{d||r(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const q=P.source.substring(1)||" ";u?u+=h+q:u=q,h="",c=!1;break}case"newline":c?u?u+=P.source:(!C||n!=="seq-item-ind")&&(l=!0):h+=P.source,c=!0,f=!0,(b||w)&&(T=P),d=!0;break;case"anchor":b&&r(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&r(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=P,$??($=P.offset),c=!1,d=!1,m=!0;break;case"tag":{w&&r(P,"MULTIPLE_TAGS","A node can have at most one tag"),w=P,$??($=P.offset),c=!1,d=!1,m=!0;break}case n:(b||w)&&r(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),C&&r(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${t??"collection"}`),C=P,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){S&&r(P,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=P,c=!1,d=!1;break}default:r(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),c=!1,d=!1}const v=e[e.length-1],A=v?v.offset+v.source.length:s;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(c&&p.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:C,spaceBefore:l,comment:u,hasNewline:f,anchor:b,tag:w,newlineAfterProp:T,end:A,start:$??A}}function ri(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
193
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(ri(t.key)||ri(t.value))return!0}return!1;default:return!0}}function $r(e,t,n){if(t?.type==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&ri(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function sd(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const s=typeof i=="function"?i:(r,o)=>r===o||be(r)&&be(o)&&r.value===o.value;return t.some(r=>s(r.key,n))}const sl="All mapping items must start at the same column";function Qx({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=r?.nodeClass??rt,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=i.offset,c=null;for(const d of i.items){const{start:u,key:h,sep:f,value:m}=d,p=In(u,{indicator:"explicit-key-ind",next:h??f?.[0],offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0}),b=!p.found;if(b){if(h&&(h.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==i.indent&&s(l,"BAD_INDENT",sl)),!p.anchor&&!p.tag&&!f){c=p.end,p.comment&&(a.comment?a.comment+=`
194
+ `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||ri(h))&&s(h??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&s(l,"BAD_INDENT",sl);n.atKey=!0;const w=p.end,T=h?e(n,h,p,s):t(n,w,u,null,p,s);n.schema.compat&&$r(i.indent,h,s),n.atKey=!1,sd(n,a.items,T)&&s(w,"DUPLICATE_KEY","Map keys must be unique");const S=In(f??[],{indicator:"map-value-ind",next:m,offset:T.range[2],onError:s,parentIndent:i.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=S.end,S.found){b&&(m?.type==="block-map"&&!S.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<S.found.offset-1024&&s(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const C=m?e(n,m,S,s):t(n,l,f,null,S,s);n.schema.compat&&$r(i.indent,m,s),l=C.range[2];const $=new Ue(T,C);n.options.keepSourceTokens&&($.srcToken=d),a.items.push($)}else{b&&s(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(T.comment?T.comment+=`
195
+ `+S.comment:T.comment=S.comment);const C=new Ue(T);n.options.keepSourceTokens&&(C.srcToken=d),a.items.push(C)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}function Xx({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=r?.nodeClass??Yt,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=i.offset,c=null;for(const{start:d,value:u}of i.items){const h=In(d,{indicator:"seq-item-ind",next:u,offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||u)u?.type==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}const f=u?e(n,u,h,s):t(n,h.end,d,null,h,s);n.schema.compat&&$r(i.indent,u,s),l=f.range[2],a.items.push(f)}return a.range=[i.offset,l,c??l],a}function fi(e,t,n,i){let s="";if(e){let r=!1,o="";for(const a of e){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{n&&!r&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=l.substring(1)||" ";s?s+=o+d:s=d,o="";break}case"newline":s&&(o+=l),r=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:s,offset:t}}const nr="Block collections are not allowed within flow collections",ir=e=>e&&(e.type==="block-map"||e.type==="block-seq");function e0({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=i.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?rt:Yt),c=new l(n.schema);c.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset+i.start.source.length;for(let b=0;b<i.items.length;++b){const w=i.items[b],{start:T,key:S,sep:C,value:$}=w,v=In(T,{flow:a,indicator:"explicit-key-ind",next:S??C?.[0],offset:u,onError:s,parentIndent:i.indent,startOnNewline:!1});if(!v.found){if(!v.anchor&&!v.tag&&!C&&!$){b===0&&v.comma?s(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):b<i.items.length-1&&s(v.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),v.comment&&(c.comment?c.comment+=`
196
+ `+v.comment:c.comment=v.comment),u=v.end;continue}!o&&n.options.strict&&ri(S)&&s(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)v.comma&&s(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(v.comma||s(v.start,"MISSING_CHAR",`Missing , between ${a} items`),v.comment){let A="";e:for(const P of T)switch(P.type){case"comma":case"space":break;case"comment":A=P.source.substring(1);break e;default:break e}if(A){let P=c.items[c.items.length-1];Ie(P)&&(P=P.value??P.key),P.comment?P.comment+=`
197
+ `+A:P.comment=A,v.comment=v.comment.substring(A.length+1)}}if(!o&&!C&&!v.found){const A=$?e(n,$,v,s):t(n,v.end,C,null,v,s);c.items.push(A),u=A.range[2],ir($)&&s(A.range,"BLOCK_IN_FLOW",nr)}else{n.atKey=!0;const A=v.end,P=S?e(n,S,v,s):t(n,A,T,null,v,s);ir(S)&&s(P.range,"BLOCK_IN_FLOW",nr),n.atKey=!1;const q=In(C??[],{flow:a,indicator:"map-value-ind",next:$,offset:P.range[2],onError:s,parentIndent:i.indent,startOnNewline:!1});if(q.found){if(!o&&!v.found&&n.options.strict){if(C)for(const B of C){if(B===q.found)break;if(B.type==="newline"){s(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}v.start<q.found.offset-1024&&s(q.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else $&&("source"in $&&$.source?.[0]===":"?s($,"MISSING_CHAR",`Missing space after : in ${a}`):s(q.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const R=$?e(n,$,q,s):q.found?t(n,q.end,C,null,q,s):null;R?ir($)&&s(R.range,"BLOCK_IN_FLOW",nr):q.comment&&(P.comment?P.comment+=`
198
+ `+q.comment:P.comment=q.comment);const U=new Ue(P,R);if(n.options.keepSourceTokens&&(U.srcToken=w),o){const B=c;sd(n,B.items,P)&&s(A,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(U)}else{const B=new rt(n.schema);B.flow=!0,B.items.push(U);const ee=(R??P).range;B.range=[P.range[0],ee[1],ee[2]],c.items.push(B)}u=R?R.range[2]:q.end}}const h=o?"}":"]",[f,...m]=i.end;let p=u;if(f?.source===h)p=f.offset+f.source.length;else{const b=a[0].toUpperCase()+a.substring(1),w=d?`${b} must end with a ${h}`:`${b} in block collection must be sufficiently indented and end with a ${h}`;s(u,d?"MISSING_CHAR":"BAD_INDENT",w),f&&f.source.length!==1&&m.unshift(f)}if(m.length>0){const b=fi(m,p,n.options.strict,s);b.comment&&(c.comment?c.comment+=`
199
+ `+b.comment:c.comment=b.comment),c.range=[i.offset,p,b.offset]}else c.range=[i.offset,p,p];return c}function sr(e,t,n,i,s,r){const o=n.type==="block-map"?Qx(e,t,n,i,r):n.type==="block-seq"?Xx(e,t,n,i,r):e0(e,t,n,i,r),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function t0(e,t,n,i,s){const r=i.tag,o=r?t.directives.tagName(r.source,h=>s(r,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:f}=i,m=h&&r?h.offset>r.offset?h:r:h??r;m&&(!f||f.offset<m.offset)&&s(m,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===rt.tagName&&a==="map"||o===Yt.tagName&&a==="seq")return sr(e,t,n,s,o);let l=t.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){const h=t.schema.knownTags[o];if(h?.collection===a)t.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?s(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),sr(e,t,n,s,o)}const c=sr(e,t,n,s,o,l),d=l.resolve?.(c,h=>s(r,"TAG_RESOLVE_FAILED",h),t.options)??c,u=Ee(d)?d:new re(d);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}function n0(e,t,n){const i=t.offset,s=i0(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[i,i,i]};const r=s.mode===">"?re.BLOCK_FOLDED:re.BLOCK_LITERAL,o=t.source?s0(t.source):[];let a=o.length;for(let p=o.length-1;p>=0;--p){const b=o[p][1];if(b===""||b==="\r")a=p;else break}if(a===0){const p=s.chomp==="+"&&o.length>0?`
200
+ `.repeat(Math.max(1,o.length-1)):"";let b=i+s.length;return t.source&&(b+=t.source.length),{value:p,type:r,comment:s.comment,range:[i,b,b]}}let l=t.indent+s.indent,c=t.offset+s.length,d=0;for(let p=0;p<a;++p){const[b,w]=o[p];if(w===""||w==="\r")s.indent===0&&b.length>l&&(l=b.length);else{b.length<l&&n(c+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=b.length),d=p,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=b.length+w.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>l&&(a=p+1);let u="",h="",f=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(l)+`
201
+ `;for(let p=d;p<a;++p){let[b,w]=o[p];c+=b.length+w.length+1;const T=w[w.length-1]==="\r";if(T&&(w=w.slice(0,-1)),w&&b.length<l){const C=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(c-w.length-(T?2:1),"BAD_INDENT",C),b=""}r===re.BLOCK_LITERAL?(u+=h+b.slice(l)+w,h=`
202
+ `):b.length>l||w[0]===" "?(h===" "?h=`
203
+ `:!f&&h===`
204
+ `&&(h=`
205
+
206
+ `),u+=h+b.slice(l)+w,h=`
207
+ `,f=!0):w===""?h===`
208
+ `?u+=`
209
+ `:h=`
210
+ `:(u+=h+w,h=" ",f=!1)}switch(s.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)u+=`
211
+ `+o[p][0].slice(l);u[u.length-1]!==`
212
+ `&&(u+=`
213
+ `);break;default:u+=`
214
+ `}const m=i+s.length+t.source.length;return{value:u,type:r,comment:s.comment,range:[i,m,m]}}function i0({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],r=s[0];let o=0,a="",l=-1;for(let h=1;h<s.length;++h){const f=s[h];if(!a&&(f==="-"||f==="+"))a=f;else{const m=Number(f);!o&&m?o=m:l===-1&&(l=e+h)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let c=!1,d="",u=s.length;for(let h=1;h<t.length;++h){const f=t[h];switch(f.type){case"space":c=!0;case"newline":u+=f.source.length;break;case"comment":n&&!c&&i(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=f.source.length,d=f.source.substring(1);break;case"error":i(f,"UNEXPECTED_TOKEN",f.message),u+=f.source.length;break;default:{const m=`Unexpected token in block scalar header: ${f.type}`;i(f,"UNEXPECTED_TOKEN",m);const p=f.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:u}}function s0(e){const t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),r=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}function r0(e,t,n){const{offset:i,type:s,source:r,end:o}=e;let a,l;const c=(h,f,m)=>n(i+h,f,m);switch(s){case"scalar":a=re.PLAIN,l=o0(r,c);break;case"single-quoted-scalar":a=re.QUOTE_SINGLE,l=a0(r,c);break;case"double-quoted-scalar":a=re.QUOTE_DOUBLE,l=l0(r,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[i,i+r.length,i+r.length]}}const d=i+r.length,u=fi(o,d,t,n);return{value:l,type:a,comment:u.comment,range:[i,d,u.offset]}}function o0(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),rd(e)}function a0(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),rd(e.slice(1,-1)).replace(/''/g,"'")}function rd(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
215
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
216
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let s=i[1],r=" ",o=t.lastIndex;for(n.lastIndex=o;i=n.exec(e);)i[1]===""?r===`
217
+ `?s+=r:r=`
218
+ `:(s+=r+i[1],r=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(e),s+r+(i?.[1]??"")}function l0(e,t){let n="";for(let i=1;i<e.length-1;++i){const s=e[i];if(!(s==="\r"&&e[i+1]===`
219
+ `))if(s===`
220
+ `){const{fold:r,offset:o}=c0(e,i);n+=r,i=o}else if(s==="\\"){let r=e[++i];const o=u0[r];if(o)n+=o;else if(r===`
221
+ `)for(r=e[i+1];r===" "||r===" ";)r=e[++i+1];else if(r==="\r"&&e[i+1]===`
222
+ `)for(r=e[++i+1];r===" "||r===" ";)r=e[++i+1];else if(r==="x"||r==="u"||r==="U"){const a=r==="x"?2:r==="u"?4:8;n+=d0(e,i+1,a,t),i+=a}else{const a=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){const r=i;let o=e[i+1];for(;o===" "||o===" ";)o=e[++i+1];o!==`
223
+ `&&!(o==="\r"&&e[i+2]===`
224
+ `)&&(n+=i>r?e.slice(r,i+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function c0(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
225
+ `||i==="\r")&&!(i==="\r"&&e[t+2]!==`
226
+ `);)i===`
227
+ `&&(n+=`
228
+ `),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const u0={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
229
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function d0(e,t,n,i){const s=e.substr(t,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function od(e,t,n,i){const{value:s,type:r,comment:o,range:a}=t.type==="block-scalar"?n0(e,t,i):r0(t,e.options.strict,i),l=n?e.directives.tagName(n.source,u=>i(n,"TAG_RESOLVE_FAILED",u)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[vt]:l?c=f0(e.schema,s,l,n,i):t.type==="scalar"?c=h0(e,s,t,i):c=e.schema[vt];let d;try{const u=c.resolve(s,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=be(u)?u:new re(u)}catch(u){const h=u instanceof Error?u.message:String(u);i(n??t,"TAG_RESOLVE_FAILED",h),d=new re(s)}return d.range=a,d.source=s,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function f0(e,t,n,i,s){if(n==="!")return e[vt];const r=[];for(const a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if(a.test?.test(t))return a;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[vt])}function h0({atKey:e,directives:t,schema:n},i,s,r){const o=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[vt];if(n.compat){const a=n.compat.find(l=>l.default&&l.test?.test(i))??n[vt];if(o.tag!==a.tag){const l=t.tagString(o.tag),c=t.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(s,"TAG_RESOLVE_FAILED",d,!0)}}return o}function p0(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let s=t[i];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++i];s?.type==="space";)e+=s.source.length,s=t[++i];break}}return e}const m0={composeNode:ad,composeEmptyNode:To};function ad(e,t,n,i){const s=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=n;let c,d=!0;switch(t.type){case"alias":c=g0(e,t,i),(a||l)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=od(e,t,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=t0(m0,e,t,n,i),a&&(c.anchor=a.source.substring(1))}catch(u){const h=u instanceof Error?u.message:String(u);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",u),d=!1}}return c??(c=To(e,t.offset,void 0,null,n,i)),a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!be(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?c.comment=o:c.commentBefore=o),e.options.keepSourceTokens&&d&&(c.srcToken=t),c}function To(e,t,n,i,{spaceBefore:s,comment:r,anchor:o,tag:a,end:l},c){const d={type:"scalar",offset:p0(t,n,i),indent:-1,source:""},u=od(e,d,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function g0({options:e},{offset:t,source:n,end:i},s){const r=new mo(n.substring(1));r.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=fi(i,o,e.strict,s);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}function b0(e,t,{offset:n,start:i,value:s,end:r},o){const a=Object.assign({_directives:t},e),l=new Mn(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=In(i,{indicator:"doc-start",next:s??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?ad(c,s,d,o):To(c,d.end,i,null,d,o);const u=l.contents.range[2],h=fi(r,u,!1,o);return h.comment&&(l.comment=h.comment),l.range=[n,u,h.offset],l}function Wn(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function rl(e){let t="",n=!1,i=!1;for(let s=0;s<e.length;++s){const r=e[s];switch(r[0]){case"#":t+=(t===""?"":i?`
230
+
231
+ `:`
232
+ `)+(r.substring(1)||" "),n=!0,i=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class y0{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,s,r)=>{const o=Wn(n);r?this.warnings.push(new Jx(o,i,s)):this.errors.push(new Yn(o,i,s))},this.directives=new Me({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:s}=rl(this.prelude);if(i){const r=t.contents;if(n)t.comment=t.comment?`${t.comment}
233
+ ${i}`:i;else if(s||t.directives.docStart||!r)t.commentBefore=i;else if(Te(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Ie(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${i}
234
+ ${a}`:i}else{const o=r.commentBefore;r.commentBefore=o?`${i}
235
+ ${o}`:i}}if(n){for(let r=0;r<this.errors.length;++r)t.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)t.warnings.push(this.warnings[r])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:rl(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(const s of t)yield*this.next(s);yield*this.end(n,i)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,i,s)=>{const r=Wn(t);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",i,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=b0(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new Yn(Wn(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new Yn(Wn(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=fi(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
236
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Yn(Wn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),s=new Mn(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const ld="\uFEFF",cd="",ud="",Rr="";function w0(e){switch(e){case ld:return"byte-order-mark";case cd:return"doc-mode";case ud:return"flow-error-end";case Rr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
237
+ `:case`\r
238
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ut(e){switch(e){case void 0:case" ":case`
239
+ `:case"\r":case" ":return!0;default:return!1}}const ol=new Set("0123456789ABCDEFabcdef"),k0=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ri=new Set(",[]{}"),v0=new Set(` ,[]{}
240
+ \r `),rr=e=>!e||v0.has(e);class S0{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
241
+ `?!0:n==="\r"?this.buffer[t+1]===`
242
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const s=this.buffer[i+t+1];if(s===`
243
+ `||!s&&!this.atEnd)return t+i+1}return n===`
244
+ `||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&ut(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
245
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===ld&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){const r=t[i-1];if(r===" "||r===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){const r=t[n-1];if(r===" "||r===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield cd,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&ut(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ut(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ut(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(rr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&s[0]!=="#"||i===0&&(s.startsWith("---")||s.startsWith("..."))&&ut(s[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield ud,yield*this.parseLineStart();let r=0;for(;s[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),s[r]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(rr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ut(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let r=0;for(;this.buffer[n-1-r]==="\\";)r+=1;if(r%2===0)break;n=this.buffer.indexOf('"',n+1)}const i=this.buffer.substring(0,n);let s=i.indexOf(`
246
+ `,this.pos);if(s!==-1){for(;s!==-1;){const r=this.continueScalar(s+1);if(r===-1)break;s=i.indexOf(`
247
+ `,r)}s!==-1&&(n=s-(i[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ut(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let r=this.pos;i=this.buffer[r];++r)switch(i){case" ":n+=1;break;case`
248
+ `:t=r,n=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
249
+ `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(t+1);if(r===-1)break;t=this.buffer.indexOf(`
250
+ `,r)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(i=this.buffer[s];i===" ";)i=this.buffer[++s];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
251
+ `;)i=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let r=t-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
252
+ `&&r>=this.pos&&r+1+n>a)t=r;else break}while(!0);return yield Rr,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,s;for(;s=this.buffer[++i];)if(s===":"){const r=this.buffer[i+1];if(ut(r)||t&&Ri.has(r))break;n=i}else if(ut(s)){let r=this.buffer[i+1];if(s==="\r"&&(r===`
253
+ `?(i+=1,s=`
254
+ `,r=this.buffer[i+1]):n=i),r==="#"||t&&Ri.has(r))break;if(s===`
255
+ `){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&Ri.has(s))break;n=i}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Rr,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(rr),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(ut(i)||n&&Ri.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ut(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(k0.has(n))n=this.buffer[++t];else if(n==="%"&&ol.has(this.buffer[t+1])&&ol.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
256
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
257
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class x0{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){const r=n+i>>1;this.lineStarts[r]<t?n=r+1:i=r}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function Rt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function al(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function dd(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ni(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function on(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ls(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function ll(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Rt(t.start,"explicit-key-ind")&&!Rt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,dd(t.value)?t.value.end?ls(t.value.end,t.sep):t.value.end=t.sep:ls(t.start,t.sep),delete t.sep)}class _0{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new S0,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=w0(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&ll(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const s=i.items[i.items.length-1];if(s.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=i.items[i.items.length-1];s.value?i.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=i.items[i.items.length-1];!s||s.value?i.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&al(s.start)===-1&&(n.indent===0||s.start.every(r=>r.type!=="comment"||r.indent<n.indent))&&(i.type==="document"?i.end=s.start:i.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{al(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Ni(this.peek(2)),i=on(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const r={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
258
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
259
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2]?.value?.end;if(Array.isArray(s)){ls(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const i=!this.onKeyLine&&this.indent===t.indent,s=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(s&&n.sep&&!n.value){const o=[];for(let a=0;a<n.sep.length;++a){const l=n.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(r.push(this.sourceToken),t.items.push({start:r}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(r.push(this.sourceToken),t.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Rt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(dd(n.key)&&!Rt(n.sep,"newline")){const o=on(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?n.sep=n.sep.concat(r,this.sourceToken):n.sep.push(this.sourceToken);else if(Rt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=on(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:r,key:null,sep:[this.sourceToken]}):Rt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||n.value?(t.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Rt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2]?.value?.end;if(Array.isArray(s)){ls(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Rt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const s=Ni(i),r=on(s);ll(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
260
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
261
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Ni(t),i=on(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Ni(t),i=on(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function C0(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new x0||null,prettyErrors:t}}function A0(e,t={}){const{lineCounter:n,prettyErrors:i}=C0(t),s=new _0(n?.addNewLine),r=new y0(t);let o=null;for(const a of r.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Yn(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(il(e,n)),o.warnings.forEach(il(e,n))),o}function fd(e,t,n){let i;const s=A0(e,n);if(!s)return null;if(s.warnings.forEach(r=>Du(s.options.logLevel,r)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:i},n))}function hd(e,t,n){let i=null;if(Array.isArray(t)&&(i=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return ui(e)&&!i?e.toString(n):new Mn(e,i,n).toString(n)}const T0=/^---\r?\n([\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,pd=e=>ks.test(`${e}:`);function md(e){if(!e.trim())return{};try{const t=fd(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function cl(e){return md(e)}function Li(e){let t=/^("(?:[^"\\]|\\.)*")[ \t]*:(?=[ \t]|$)/.exec(e);if(t)try{return{key:JSON.parse(t[1]),token:t[1]}}catch{return null}return t=/^('(?:[^']|'')*')[ \t]*:(?=[ \t]|$)/.exec(e),t?{key:t[1].slice(1,-1).replace(/''/g,"'"),token:t[1]}:/^(?:[?:,[\]{}#&*!|>'"%@`]|-[ \t]|-$)/.test(e)?null:(t=/^(.+?)[ \t]*:(?=[ \t]|$)/.exec(e),t?{key:t[1],token:t[1]}:null)}function or(e,t,n){const i=new Mn({[e]:t});if(n){const s=i.get(e,!0);(Ln(s)||Nn(s))&&(s.flow=!0)}return i.toString({lineWidth:0,flowCollectionPadding:!1}).replace(/\n+$/,"").split(`
262
+ `)}function gd(e,t,n,i){const s=e?e.includes(`\r
263
+ `):n===`\r
264
+ `,r=e.endsWith(`
265
+ `),o=e?(r?e.slice(0,-1):e).split(`
266
+ `).map(d=>s?d.replace(/\r$/,""):d):[],a=lo(o),l=[];if("rename"in t){const{from:d,to:u}=t.rename,h=Li(or(u,null,!1)[0])?.token??u;for(const f of a){const m=Li(f[0]);l.push(...m&&m.key===d?[h+f[0].slice(m.token.length),...f.slice(1)]:f)}}else{const d=new Set;for(const u of a){const h=Li(u[0]);if(!h||!Object.prototype.hasOwnProperty.call(t.set,h.key)){l.push(...u);continue}const f=t.set[h.key];if(f===void 0||d.has(h.key))continue;if(d.add(h.key),i&&Object.prototype.hasOwnProperty.call(i,h.key)&&oi(i[h.key],f)){l.push(...u);continue}const m=or(h.key,f,u.length===1&&/^[[{]/.test(u[0].slice(h.token.length).replace(/^[ \t]*:[ \t]*/,""))),p=Li(m[0]);p&&p.token!==h.token&&(m[0]=h.token+m[0].slice(p.token.length)),l.push(...m)}for(const[u,h]of Object.entries(t.set))h!==void 0&&!d.has(u)&&l.push(...or(u,h,!1))}const c=s?`\r
267
+ `:`
268
+ `;return l.length?l.join(c)+(r||!e?c:""):""}function cs(e){if(!e.trim())return{};try{const t=fd(e);return t==null?{}:typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function oi(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||!e||!t)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((s,r)=>oi(s,t[r]));const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(s=>Object.prototype.hasOwnProperty.call(t,s)&&oi(e[s],t[s]))}function bd(e,t){const n={...e};if("rename"in t)return Object.prototype.hasOwnProperty.call(n,t.rename.from)&&(n[t.rename.to]=n[t.rename.from],delete n[t.rename.from]),n;for(const[i,s]of Object.entries(t.set))s===void 0?delete n[i]:n[i]=s;return n}function yd(e,t,n){const i=cs(e);if(!i)return null;const s=bd(i,t),r=gd(e,t,n,i),o=cs(r);return o&&oi(o,s)?r:(console.warn("[amadeus] line-level frontmatter edit did not verify; rewriting the block"),Object.keys(s).length?hd(s).replace(/\n+$/,"")+(e.endsWith(`
269
+ `)?`
270
+ `:""):"")}function E0(e,t){return yd(e,{set:t})}function rC(e,t,n){return yd(e,{rename:{from:t,to:n}})}function I0(e,t){const n=e.startsWith(qa)?qa:"";return n+P0(e.slice(n.length),t)}function P0(e,t){const n=T0.exec(e),i=n?.[1]??"",s=n?e.slice(n[0].length):e,r={};for(const[d,u]of Object.entries(t))pd(d)||(r[d]=u);const o=n&&n[0].startsWith(`---\r
271
+ `)?`\r
272
+ `:`
273
+ `,a=cs(i);let l=gd(i,{set:r},o,a??void 0);if(a){const d=cs(l);(!d||!oi(d,bd(a,{set:r})))&&(console.warn("[amadeus] line-level frontmatter edit did not verify; regrouping the foreign keys"),l=O0(i,r))}if(!l.trim())return n?s.replace(/^\r?\n/,""):e;if(l.endsWith(`
274
+ `)||(l+=o),n){const d=n[0].indexOf(`
275
+ `)+1;return e.slice(0,d)+l+e.slice(d+i.length)}const c=`---
276
+ ${l}---`;return s?`${c}
277
+
278
+ ${s}`:`${c}
279
+ `}function O0(e,t){const n=[],i=[];for(const a of lo(e.split(`
280
+ `)))ks.test(a[0])?n.push(...a):i.push(...a);const s=md(i.join(`
281
+ `));for(const[a,l]of Object.entries(t))l===void 0?delete s[a]:s[a]=l;const r=Object.keys(s).length?hd(s).replace(/\n+$/,""):"",o=[...n,...r?[r]:[]];return o.length?`${o.join(`
282
+ `)}
283
+ `:""}function oC(e,t){const n={};for(const[s,r]of Object.entries(t))pd(s)||(n[s]=r);const i=E0(e,n);return i==null?null:i.replace(/\r?\n+$/,"")}function $0(e){return typeof e=="boolean"?"checkbox":Array.isArray(e)?"multiselect":typeof e=="number"&&Number.isFinite(e)?"number":typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?"date":"text"}function aC(e,t){switch(t){case"checkbox":return e===!0;case"number":if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=Number.parseFloat(e);if(Number.isFinite(n))return n}return null;case"multiselect":return Array.isArray(e)?e.map(String):e==null||e===""?[]:[String(e)];case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:"";default:return e==null?"":Array.isArray(e)?e.map(String).join(", "):String(e)}}function lC(e,t){switch(t){case"checkbox":return e===!0?!0:void 0;case"number":return typeof e=="number"&&Number.isFinite(e)?e:void 0;case"multiselect":return Array.isArray(e)&&e.length?e:void 0;case"date":return typeof e=="string"&&e?e:void 0;default:return(typeof e=="string"?e:e==null?"":String(e))||void 0}}function cC(e,t){const n=e.map(s=>({...s,options:s.options?[...s.options]:void 0})),i=new Map(n.map(s=>[s.id,s]));if(!i.has(Kn)){const s={id:Kn,name:"Page Name",type:"page"};n.unshift(s),i.set(Kn,s)}for(const s of t)for(const[r,o]of Object.entries(s)){if(r===Kn||i.has(r))continue;const a={id:r,name:r,type:$0(o)};n.push(a),i.set(r,a)}for(const s of n){if(s.type!=="select"&&s.type!=="multiselect")continue;const r=new Set(s.options??[]);for(const o of t){const a=o[s.id];Array.isArray(a)?a.forEach(l=>r.add(String(l))):typeof a=="string"&&a&&r.add(a)}s.options=[...r]}return n}function uC(e,t){const n=e.lastIndexOf("/"),i=n<0?"":e.slice(0,n+1),s=n<0?e:e.slice(n+1),r=s.lastIndexOf("."),o=r>0?s.slice(0,r):s,a=r>0?s.slice(r):"",l=d=>String(d).padStart(2,"0"),c=`${t.getFullYear()}-${l(t.getMonth()+1)}-${l(t.getDate())} ${l(t.getHours())}${l(t.getMinutes())}`;return`${i}${o} (conflict ${c})${a}`}function dC(e,t){if(t<2)return e;const n=e.lastIndexOf("."),i=n>e.lastIndexOf("/")&&n>e.lastIndexOf(")"),s=i?e.slice(0,n):e,r=i?e.slice(n):"";return`${s}-${t}${r}`}function cn(e){let t=3735928559,n=1103547991;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);t=Math.imul(t^r,2654435761),n=Math.imul(n^r,1597334677)}t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909);const i=4294967296*(2097151&n)+(t>>>0);return`${e.length.toString(36)}-${i.toString(36)}`}const wd=e=>/\.pdf$/i.test(e.trim()),fC=e=>/^\/|^[A-Za-z]:[\\/]/.test(e);function hC(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n));const i=t.indexOf("#");return i>=0&&(t=t.slice(0,i)),wd(t)}function R0(e){const t=[`page=${Math.max(1,Math.trunc(e.page)||1)}`];return e.color&&t.push(`color=${encodeURIComponent(e.color)}`),e.annot&&t.push(`annot=${encodeURIComponent(e.annot)}`),e.q&&t.push(`q=${encodeURIComponent(e.q)}`),t.join("&")}function N0(e){const t=e.replace(/^#/,"");if(!t)return null;const n=new Map;for(const l of t.split("&")){const c=l.indexOf("=");c<0||n.set(l.slice(0,c),l.slice(c+1))}const i=parseInt(n.get("page")??"",10);if(!Number.isFinite(i)||i<1)return null;const s={page:i},r=n.get("color");r&&(s.color=decodeURIComponent(r));const o=n.get("annot");o&&(s.annot=decodeURIComponent(o));const a=n.get("q");if(a)try{s.q=decodeURIComponent(a)}catch{s.q=a}return s}function pC(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n).trim());const i=t.indexOf("#"),s=(i>=0?t.slice(0,i):t).trim();return wd(s)?{target:s,loc:i>=0?N0(t.slice(i+1)):null}:null}function mC(e,t){return`[[${e}#${R0(t)}]]`}function gC(e){const t=/^#?L(\d+)(?:-L?(\d+))?$/i.exec(e.trim());if(!t)return null;const n=parseInt(t[1],10);if(!n||n<1)return null;const i=t[2]?parseInt(t[2],10):NaN;return i>n?{from:n,to:i}:{from:n}}function L0(e){const t=/^#?\^([A-Za-z0-9-]+)$/.exec(e.trim());return t?t[1]:null}function F0(e){const t=/(?:^|\s)\^([A-Za-z0-9-]+)\s*$/.exec(e);return t?t[1]:null}const D0=e=>/^\s*\^[A-Za-z0-9-]+\s*$/.test(e),z0=e=>e.replace(/[*_~`]|!?\[\[|\]\]/g,"").trim().toLowerCase(),Ki=e=>e.trim().toLowerCase();function M0(e,t){for(const n of[Ki,z0]){const i=j0(e,t,n);if(i>=0)return i}return-1}function j0(e,t,n){const i=n(t);if(!i)return-1;const s=e.findIndex(a=>Ki(a.text)===i);if(s>=0)return s;const r=t.split("#").map(n).filter(Boolean);if(!r.length)return-1;const o=r[r.length-1];for(let a=0;a<e.length;a++){if(Ki(e[a].text)!==o)continue;if(r.length===1)return a;const l=[];let c=e[a].level;for(let u=a-1;u>=0&&c>1;u--)e[u].level<c&&(l.unshift(Ki(e[u].text)),c=e[u].level);let d=0;for(const u of l)d<r.length-1&&u===r[d]&&d++;if(d===r.length-1)return a}return-1}function kd(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n).trim());const i=t.indexOf("#");if(i<0)return{target:t,subpath:null};const s=t.slice(i+1).trim();return{target:t.slice(0,i).trim(),subpath:s||null}}const B0=/\.(mp4|webm|mov|m4v)$/i,U0=/\.(mp3|wav|ogg|m4a|flac)$/i,H0=e=>B0.test(e.trim())||U0.test(e.trim());function ul(e){const t=e.trim();let n,i=null;return(n=/^(\d+):([0-5]\d):([0-5]\d(?:\.\d+)?)$/.exec(t))?i=+n[1]*3600+ +n[2]*60+ +n[3]:(n=/^([0-5]\d):([0-5]\d(?:\.\d+)?)$/.exec(t))?i=+n[1]*60+ +n[2]:/^\d+(?:\.\d+)?$/.test(t)&&(i=+t),i!=null&&Number.isFinite(i)?i:null}function q0(e){const t=/^#?t=(.*)$/i.exec(e.trim());if(!t||t[1].trim()==="")return null;const[n,i]=t[1].split(","),s=n.trim()===""?0:ul(n);if(s==null||s<0)return null;if(i===void 0)return{at:s};const r=ul(i);return r!=null&&r>s?{at:s,to:r}:{at:s,badTo:!0}}const W0=e=>`t=${Math.round(e.at)}${e.to?`,${Math.round(e.to)}`:""}`;function V0(e){const t=Math.max(0,Math.floor(e||0)),n=s=>String(s).padStart(2,"0"),i=Math.floor(t/3600);return i?`${i}:${n(Math.floor(t%3600/60))}:${n(t%60)}`:`${n(Math.floor(t/60))}:${n(t%60)}`}function bC(e){const{target:t,subpath:n}=kd(e);return!t||!H0(t)?null:{target:t,loc:n?q0(n):null}}const yC=(e,t,n)=>`[[${e}#${W0(t)}${`|${V0(t.at)}`}]]`;function wC(e,t){if(!/^https?:\/\//i.test(e)||e.includes(":~:"))return e;const n=t.replace(/\s+/g," ").trim();return n.length<8||n.length>300||e.startsWith(n)?e:`${e.includes("#")?e:e+"#"}:~:text=${encodeURIComponent(n)}`}const kC=e=>e.split("#")[0];function Z0(e){const t=e.split("|");if(t.length<2)return;const n=t[t.length-1].trim();return/^\d{2,4}$/.test(n)?Number(n):void 0}function K0(e,t){const n=e.split("|");Z0(e)!==void 0&&n.pop();const i=n.join("|");return t==null?i:`${i}|${t}`}function vC(e){const t=K0(e.trim(),null).trim();return/^https?:\/\/\S+$/i.test(t)?t:null}const SC=e=>e.replace(/\|/g,"%7C").replace(/\]/g,"%5D");function G0(e){const{target:t,subpath:n}=kd(e);return{note:t,subpath:n}}const Y0=/^ {0,3}(`{3,}|~{3,})/,J0=/^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/,dl=/^([ \t]*)(?:[-*+]|\d{1,9}[.)])(?:[ \t]|$)/;function vd(e){const t=[];let n=null;for(const i of e){const s=Y0.exec(i);if(n){t.push(!0),s&&s[1][0]===n[0]&&s[1].length>=n.length&&!i.slice(i.indexOf(s[1])+s[1].length).trim()&&(n=null);continue}if(s){n=s[1],t.push(!0);continue}t.push(!1)}return t}const Sd=e=>e.split(/\r?\n/),Gi=e=>e.join(`
284
+ `).replace(/^\n+|\s+$/g,"");function Q0(e){return e.replace(/`([^`]*)`/g,"$1").replace(/!?\[\[([^\]|]*\|)?([^\]]*)\]\]/g,"$2").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(new RegExp("(\\*\\*|__|~~|==)(?=\\S)(.+?)(?<=\\S)\\1","g"),"$2").replace(new RegExp("(^|[^\\w*])\\*(?=\\S)(.+?)(?<=\\S)\\*(?!\\w)","g"),"$1$2")}function X0(e,t){const n=Sd(e),i=vd(n),s=[];n.forEach((a,l)=>{if(i[l])return;const c=J0.exec(a);c&&c[2].trim()&&s.push({level:c[1].length,text:Q0(c[2].trim()),line:l})});const r=M0(s,t);if(r<0)return null;const o=s.slice(r+1).find(a=>a.level<=s[r].level);return Gi(n.slice(s[r].line,o?o.line:n.length))}function e1(e,t){let n=t;for(;n>0&&e[n-1];)n--;return n}function t1(e,t){const n=Sd(e),i=vd(n),s=n.findIndex((u,h)=>!i[h]&&F0(u)===t);if(s<0)return null;const r=u=>/^[ \t]*/.exec(u)[0].length,o=u=>u>=0&&!!n[u].trim()&&!i[u];if(D0(n[s])){let u=s-1;for(;u>=0&&!n[u].trim();)u--;if(u<0)return null;if(i[u])return Gi(n.slice(e1(i,u),u+1));let h=u;for(;o(h-1);)h--;return Gi(n.slice(h,u+1))}let a=s;for(;!dl.test(n[a])&&o(a-1);)a--;let l=s+1;const c=dl.exec(n[a]);if(c){const u=c[1].length;for(;l<n.length;){if(n[l].trim()){if(r(n[l])<=u)break}else{const h=n.slice(l+1).find(f=>f.trim());if(h==null||r(h)<=u)break}l++}}else for(;o(l);)l++;const d=n.slice(a,l);return d[s-a]=d[s-a].replace(/[ \t]*\^[A-Za-z0-9-]+[ \t]*$/,""),Gi(d)}function n1(e,t){const n=L0(t);return n?t1(e,n):t.trim().startsWith("^")?null:X0(e,t)}function ar(e){return/\.(md|db)$/i.test(e)}function Ct(e){const t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n<0?"":t.slice(0,n)}function Je(e){const t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n<0?t:t.slice(n+1)}function Nr(e){const t=Je(e),n=t.lastIndexOf(".");return n>0?t.slice(n):""}function ft(e){const t=[];for(const n of e.replace(/\\/g,"/").split("/"))if(!(!n||n===".")){if(n===".."){if(!t.length)return null;t.pop();continue}t.push(n)}return t.join("/")}function i1(e,t){const n=e.split("/").filter(o=>o&&o!=="."),i=t.split("/").filter(o=>o&&o!==".");let s=0;for(;s<n.length&&s<i.length&&n[s]===i[s];)s++;return[...Array(n.length-s).fill(".."),...i.slice(s)].join("/")||"."}function s1(e){try{return decodeURIComponent(e)}catch{return e}}function fl(e){return e.replace(/^<|>$/g,"").trim()}function hl(e,t){const n=t.toLowerCase();for(const i of e)if(Je(i).toLowerCase()===n)return i;return null}function pl(e,t,n){const i=Ct(e),s=l=>l.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),r=n.mode==="same"?i:n.mode==="vault"?s(n.folder):s(`${i}/attachments`),o=r?`${r}/${t}`:t,a=i1(i,o);return{destDirRel:r,fileVaultRel:o,pageRel:a}}function ml(e,t){const n=Nr(t),i=t.slice(0,t.length-n.length)||"file";for(let s=0;s<1e3;s++){const r=s===0?t:`${i}-${s}${n}`;if(!e.has(r.toLowerCase()))return r}return`${i}-${Date.now().toString(36)}${n}`}class r1 extends Error{constructor(t){super(`share viewer is read-only: ${t}`),this.name="ShareReadOnlyError"}}const o1=()=>new Date().toISOString(),xd=e=>e.split("/").slice(0,-1).join("/");function gl(e,t){const n=t.trim().replace(/^!?\[\[/,"").replace(/\]\]$/,"").split("|")[0].split("#")[0].trim(),i=n.startsWith("/")?n.slice(1):[xd(e),n].filter(Boolean).join("/"),s=[];for(const r of i.split("/"))if(!(!r||r===".")){if(r===".."){s.pop();continue}s.push(r)}return s.join("/")}const us=/^ {0,3}(`{3,}|~{3,})/,bl=e=>e.trim().replace(/\.block$/i,"").toLowerCase();function a1(e){const t=e.lastIndexOf("#");if(t<0)return{noteKey:null,id:bl(e)};const n=e.slice(0,t).trim();return{noteKey:n?pn(n):null,id:bl(e.slice(t+1))}}function l1(e){const t=/^\uFEFF?---\r?\n([\s\S]*?)\r?\n---/.exec(e)?.[1];return!!t&&t.split(`
285
+ `).some(n=>/^["']?amadeus_/.test(n))}function c1(e){const t=e.split(`
286
+ `);let n=0;for(;n<t.length&&!t[n].trim();)n++;if(n>=t.length)return"";const i=us.exec(t[n]),s=[];if(i){const r=i[1][0];for(s.push(t[n]),n++;n<t.length;n++){s.push(t[n]);const o=us.exec(t[n]);if(o&&o[1][0]===r)break}return s.join(`
287
+ `)}for(;n<t.length&&t[n].trim();n++)s.push(t[n]);return s.join(`
288
+ `)}function u1(e,t){const n=e.split(`
289
+ `);let i=null;for(let s=0;s<n.length;s++){const r=us.exec(n[s]);if(r&&(!i||r[1][0]===i)){i=i?null:r[1][0];continue}if(i)continue;const o=/^(#{1,6})\s+(.*?)\s*#*\s*$/.exec(n[s]);if(!o||o[2].trim().toLowerCase()!==t)continue;const a=o[1].length,l=[n[s]];let c=null;for(let d=s+1;d<n.length;d++){const u=us.exec(n[d]);if(u&&(!c||u[1][0]===c)){c=c?null:u[1][0],l.push(n[d]);continue}if(!c){const h=/^(#{1,6})\s/.exec(n[d]);if(h&&h[1].length<=a)break}l.push(n[d])}return l.join(`
290
+ `).trimEnd()}return null}function _d(e,t){const n=ao(e);for(const i of Rl(n))if(i.id&&i.id.toLowerCase()===t)return l1(e)?i.content:c1(i.content);return u1(n,t)}function d1(e){const t=e.fetch??((...f)=>fetch(...f)),n=`${e.apiBase}/amadeus/public/shares/${encodeURIComponent(e.token)}`,i=f=>()=>Promise.reject(new r1(f)),s=()=>()=>{},r=()=>e.tree().pages,o=new Map,a=f=>{let m=o.get(f);return m||(m=(async()=>{const p=await t(`${n}/file?path=${encodeURIComponent(f)}`);if(p.status===404)return null;if(!p.ok)throw new Error(`share file ${p.status}`);const b=await p.json();return typeof b.content=="string"?b.content:""})(),o.set(f,m),m.catch(()=>o.delete(f))),m},l=(f,m)=>{const p=new URLSearchParams({ref:f});return m&&p.set("page",m),`${n}/asset?${p.toString()}`},c=async(f,m)=>{const p=await t(l(f,m));if(p.status===404)return null;if(!p.ok)throw new Error(`share asset ${p.status}`);return p},d=async f=>{const m=await a(f);if(m==null)throw new Error(`not found: ${f}`);return ji(f,m,o1())},u=()=>({root:`share:${e.token}`,pages:r(),folders:e.tree().folders});return{openVault:async()=>u(),restoreVault:async()=>u(),listPages:async()=>r(),listFiles:async()=>[],listFolders:async()=>e.tree().folders,loadPage:d,readPage:d,reconcilePage:f=>d(f),newPage:i("newPage"),savePage:i("savePage"),renamePage:i("renamePage"),saveAsset:i("saveAsset"),saveVaultBytes:i("saveVaultBytes"),readVaultBytes:async f=>{const m=await c(f,e.currentPage());if(!m)throw new Error(`not found: ${f}`);return new Uint8Array(await m.arrayBuffer())},saveAttachment:i("saveAttachment"),openAttachment:async(f,m)=>{window.open(l(m,f),"_blank","noopener")},openVaultFile:async f=>{window.open(l(f,null),"_blank","noopener")},exportPdf:async()=>(window.print(),null),onExternalChange:s,onStructureChange:s,onDbExternalChange:s,search:async()=>[],backlinks:async()=>[],reindex:async()=>{},listTags:async()=>[],pagesByTag:async()=>[],deletePage:i("deletePage"),movePage:i("movePage"),resolveEmbed:async f=>{const{noteKey:m,id:p}=a1(f);if(!p)return null;const b=e.currentPage(),w=r(),T=m?w.filter(S=>pn(S)===m):[...b&&w.includes(b)?[b]:[],...w.filter(S=>S!==b)];for(const S of T){const C=await a(S);if(C==null)continue;const $=_d(C,p);if($!==null)return{owner:S,content:$,type:"markdown"}}return null},blockBacklinks:async()=>[],createFolder:i("createFolder"),renameFolder:i("renameFolder"),deleteFolder:i("deleteFolder"),moveFolder:i("moveFolder"),listPlugins:async()=>[],openPluginsFolder:async()=>{},scaffoldSamplePlugin:async()=>{},revealInFileManager:async()=>{},readDatabase:async(f,m)=>{const p=await c(m,f);if(!p)return{status:"missing"};const b=gl(f,m),w=Su(await p.text());return w.ok?{status:"ok",path:b,data:w.data}:{status:"corrupt",path:b,message:w.error}},writeDatabase:i("writeDatabase"),readDrawing:async(f,m)=>{for(const p of/\.md$/i.test(m)?[m]:[m,`${m}.md`]){const b=await c(p,f);if(b)return{status:"ok",path:gl(f,p),source:await b.text()}}return{status:"missing"}},writeDrawing:i("writeDrawing"),readTextFile:f=>a(f),writeTextFile:i("writeTextFile"),listPageProps:async f=>{const m=f.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),p=r().filter(w=>xd(w)===m),b=[];for(const w of p){const T=await a(w);T!=null&&b.push({path:w,title:Ol(w),fm:iu(T)})}return b},setPageFrontmatter:i("setPageFrontmatter"),renamePageFile:i("renamePageFile"),renameDbFile:i("renameDbFile")}}function xC(e){const t=d1(e);return mu((n,i)=>{const s=new URLSearchParams({ref:ft(n)||n}),r=i?null:e.currentPage();return r&&s.set("page",r),`${e.apiBase}/amadeus/public/shares/${encodeURIComponent(e.token)}/asset?${s.toString()}`}),typeof window<"u"&&(window.amadeus=t),t}const f1=e=>{const t=e.search(/\\\||[#|]/);return t<0?{note:e,suffix:""}:{note:e.slice(0,t),suffix:e.slice(t)}},h1=e=>(e.split("/").pop()??e).replace(/\.md$/i,"");function p1(e,t,n,i){if(!e.includes("[["))return e;const s=i.pagesBefore,r=i.pagesAfter;return On(e,o=>o.replace(/(!?)\[\[([^\]\n]+)\]\]/g,(a,l,c)=>{const{note:d,suffix:u}=f1(c),h=d.trim();if(!h)return a;const f=Ui(h,s,t);if(!f)return a;const m=i.pairs.get(f)??f;if(Ui(h,r,n)===m)return a;const p=h1(m),w=!/[\\/]/.test(h)&&Ui(p,r,n)===m?p:m.replace(/\.md$/i,"");return`${l}[[${w}${u}]]`}))}const m1=e=>{const[t,n]=(e??[]).map(i=>i.replace(/\\/g,"/").replace(/\/+$/,""));return i=>t&&(i===t||i.startsWith(`${t}/`))?n+i.slice(t.length):i};async function g1(e,t,n,i={}){const s={rewritten:[],failed:[]},r=new Map(Object.entries(t).filter(([b,w])=>b!==w));if(!r.size&&!i.folder)return s;const o=new Map([...r].map(([b,w])=>[w,b])),a=[...n].sort(),l=a.map(b=>r.get(b)??b).sort(),c={pairs:r,pagesBefore:a,pagesAfter:l},d=Math.max(1,i.attempts??3),u=i.folder?m1(i.folder):null,h=e.exists?.bind(e),f=async b=>{try{let w=await e.read(b);if(w==null){s.failed.push({path:b,error:"gone"});return}const T=new Set;for(let S=0;S<d;S++){const C=o.get(b)??b,$=p1(w,C,b,c),v=h?await tx($,C,b,u,h,S?{only:T}:{seen:T}):$;if(v===w)return;const A=await e.write(b,v,cn(w));if(A==="gone"){s.failed.push({path:b,error:"gone"});return}if(!A||A.ok){s.rewritten.push(b);return}if(A.current==null){s.failed.push({path:b,error:"gone"});return}w=A.current}s.failed.push({path:b,error:"conflict"})}catch(w){s.failed.push({path:b,error:w instanceof Error?w.message:String(w)})}},m=[...l],p=Array.from({length:Math.max(1,Math.min(i.concurrency??6,m.length))},async()=>{for(let b=m.shift();b!==void 0;b=m.shift())await f(b)});return await Promise.all(p),s.rewritten.sort(),s}const b1=["renamePage","renamePageFile","movePage","renameFolder","moveFolder","deletePage","deleteFolder","trashEntry","restoreTrash"];function y1(e){const t=e;let n=Promise.resolve();for(const i of b1){const s=t[i];typeof s=="function"&&(t[i]=(...r)=>{const o=n.then(()=>s(...r));return n=o.catch(()=>{}),o})}return e}var lr={exports:{}},Vn={};var yl;function w1(){if(yl)return Vn;yl=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var a in s)a!=="key"&&(r[a]=s[a])}else r=s;return s=r.ref,{$$typeof:e,type:i,key:o,ref:s!==void 0?s:null,props:r}}return Vn.Fragment=t,Vn.jsx=n,Vn.jsxs=n,Vn}var wl;function k1(){return wl||(wl=1,lr.exports=w1()),lr.exports}var Os=k1();const v1=ms(Os),_C=Hd({__proto__:null,default:v1},[Os]);var cr={exports:{}},se={};var kl;function S1(){if(kl)return se;kl=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),h=Symbol.iterator;function f(E){return E===null||typeof E!="object"?null:(E=h&&E[h]||E["@@iterator"],typeof E=="function"?E:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,b={};function w(E,I,y){this.props=E,this.context=I,this.refs=b,this.updater=y||m}w.prototype.isReactComponent={},w.prototype.setState=function(E,I){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,I,"setState")},w.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function T(){}T.prototype=w.prototype;function S(E,I,y){this.props=E,this.context=I,this.refs=b,this.updater=y||m}var C=S.prototype=new T;C.constructor=S,p(C,w.prototype),C.isPureReactComponent=!0;var $=Array.isArray;function v(){}var A={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function q(E,I,y){var z=y.ref;return{$$typeof:e,type:E,key:I,ref:z!==void 0?z:null,props:y}}function R(E,I){return q(E.type,I,E.props)}function U(E){return typeof E=="object"&&E!==null&&E.$$typeof===e}function B(E){var I={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(y){return I[y]})}var ee=/\/+/g;function oe(E,I){return typeof E=="object"&&E!==null&&E.key!=null?B(""+E.key):I.toString(36)}function te(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(v,v):(E.status="pending",E.then(function(I){E.status==="pending"&&(E.status="fulfilled",E.value=I)},function(I){E.status==="pending"&&(E.status="rejected",E.reason=I)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function ue(E,I,y,z,W){var H=typeof E;(H==="undefined"||H==="boolean")&&(E=null);var X=!1;if(E===null)X=!0;else switch(H){case"bigint":case"string":case"number":X=!0;break;case"object":switch(E.$$typeof){case e:case t:X=!0;break;case d:return X=E._init,ue(X(E._payload),I,y,z,W)}}if(X)return W=W(E),X=z===""?"."+oe(E,0):z,$(W)?(y="",X!=null&&(y=X.replace(ee,"$&/")+"/"),ue(W,I,y,"",function(we){return we})):W!=null&&(U(W)&&(W=R(W,y+(W.key==null||E&&E.key===W.key?"":(""+W.key).replace(ee,"$&/")+"/")+X)),I.push(W)),1;X=0;var ne=z===""?".":z+":";if($(E))for(var pe=0;pe<E.length;pe++)z=E[pe],H=ne+oe(z,pe),X+=ue(z,I,y,H,W);else if(pe=f(E),typeof pe=="function")for(E=pe.call(E),pe=0;!(z=E.next()).done;)z=z.value,H=ne+oe(z,pe++),X+=ue(z,I,y,H,W);else if(H==="object"){if(typeof E.then=="function")return ue(te(E),I,y,z,W);throw I=String(E),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return X}function fe(E,I,y){if(E==null)return E;var z=[],W=0;return ue(E,z,"","",function(H){return I.call(y,H,W++)}),z}function ye(E){if(E._status===-1){var I=E._result;I=I(),I.then(function(y){(E._status===0||E._status===-1)&&(E._status=1,E._result=y)},function(y){(E._status===0||E._status===-1)&&(E._status=2,E._result=y)}),E._status===-1&&(E._status=0,E._result=I)}if(E._status===1)return E._result.default;throw E._result}var ce=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},_={map:fe,forEach:function(E,I,y){fe(E,function(){I.apply(this,arguments)},y)},count:function(E){var I=0;return fe(E,function(){I++}),I},toArray:function(E){return fe(E,function(I){return I})||[]},only:function(E){if(!U(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return se.Activity=u,se.Children=_,se.Component=w,se.Fragment=n,se.Profiler=s,se.PureComponent=S,se.StrictMode=i,se.Suspense=l,se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,se.__COMPILER_RUNTIME={__proto__:null,c:function(E){return A.H.useMemoCache(E)}},se.cache=function(E){return function(){return E.apply(null,arguments)}},se.cacheSignal=function(){return null},se.cloneElement=function(E,I,y){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var z=p({},E.props),W=E.key;if(I!=null)for(H in I.key!==void 0&&(W=""+I.key),I)!P.call(I,H)||H==="key"||H==="__self"||H==="__source"||H==="ref"&&I.ref===void 0||(z[H]=I[H]);var H=arguments.length-2;if(H===1)z.children=y;else if(1<H){for(var X=Array(H),ne=0;ne<H;ne++)X[ne]=arguments[ne+2];z.children=X}return q(E.type,W,z)},se.createContext=function(E){return E={$$typeof:o,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:r,_context:E},E},se.createElement=function(E,I,y){var z,W={},H=null;if(I!=null)for(z in I.key!==void 0&&(H=""+I.key),I)P.call(I,z)&&z!=="key"&&z!=="__self"&&z!=="__source"&&(W[z]=I[z]);var X=arguments.length-2;if(X===1)W.children=y;else if(1<X){for(var ne=Array(X),pe=0;pe<X;pe++)ne[pe]=arguments[pe+2];W.children=ne}if(E&&E.defaultProps)for(z in X=E.defaultProps,X)W[z]===void 0&&(W[z]=X[z]);return q(E,H,W)},se.createRef=function(){return{current:null}},se.forwardRef=function(E){return{$$typeof:a,render:E}},se.isValidElement=U,se.lazy=function(E){return{$$typeof:d,_payload:{_status:-1,_result:E},_init:ye}},se.memo=function(E,I){return{$$typeof:c,type:E,compare:I===void 0?null:I}},se.startTransition=function(E){var I=A.T,y={};A.T=y;try{var z=E(),W=A.S;W!==null&&W(y,z),typeof z=="object"&&z!==null&&typeof z.then=="function"&&z.then(v,ce)}catch(H){ce(H)}finally{I!==null&&y.types!==null&&(I.types=y.types),A.T=I}},se.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},se.use=function(E){return A.H.use(E)},se.useActionState=function(E,I,y){return A.H.useActionState(E,I,y)},se.useCallback=function(E,I){return A.H.useCallback(E,I)},se.useContext=function(E){return A.H.useContext(E)},se.useDebugValue=function(){},se.useDeferredValue=function(E,I){return A.H.useDeferredValue(E,I)},se.useEffect=function(E,I){return A.H.useEffect(E,I)},se.useEffectEvent=function(E){return A.H.useEffectEvent(E)},se.useId=function(){return A.H.useId()},se.useImperativeHandle=function(E,I,y){return A.H.useImperativeHandle(E,I,y)},se.useInsertionEffect=function(E,I){return A.H.useInsertionEffect(E,I)},se.useLayoutEffect=function(E,I){return A.H.useLayoutEffect(E,I)},se.useMemo=function(E,I){return A.H.useMemo(E,I)},se.useOptimistic=function(E,I){return A.H.useOptimistic(E,I)},se.useReducer=function(E,I,y){return A.H.useReducer(E,I,y)},se.useRef=function(E){return A.H.useRef(E)},se.useState=function(E){return A.H.useState(E)},se.useSyncExternalStore=function(E,I,y){return A.H.useSyncExternalStore(E,I,y)},se.useTransition=function(){return A.H.useTransition()},se.version="19.2.7",se}var vl;function x1(){return vl||(vl=1,cr.exports=S1()),cr.exports}var it=x1();const CC=ms(it),AC=["off","minimal","low","medium","high","xhigh","max"];function TC(e){return!e.location||e.location.kind==="home"}const EC="xyra",IC="forsion_tangu_show_system_prompt",_1="forsion_tangu_smooth_caret",C1="forsion_ui_zoom",hi="tangu_locale",A1="forsion_tangu_font_ui",T1="forsion_tangu_font_body",E1="forsion_tangu_font_mono",PC=e=>/^avatar\.(png|jpe?g|gif|webp)$/i.test(e||""),OC=e=>!!(e?.soloAgentSlug||e?.soloEngineId||e?.teamSlug),I1="__cloud__",P1="__rootless__",$C="__default_ws__",O1="Tangu",$1=e=>`${I1}:${e||O1}`,RC=(e,t)=>{const n=e.projectless?P1:e.project_path||$1(e.project_name);return t?.find(i=>i.key===n||i.sessionKeys?.includes(n))?.key??n},NC=e=>/^icon\.(png|jpe?g|gif|webp)$/i.test(e||""),R1=[A1,T1,E1,_1,C1,hi],N1=/^theme\.[A-Za-z0-9._-]{1,64}\.--[a-z0-9-]{1,64}$/i;let Lr=!1;function LC(e){Lr=!0;try{e()}finally{Lr=!1}}const Sl=e=>{try{return localStorage.getItem(e)}catch{return null}};function L1(){const e={};for(const t of R1)e[t]=Sl(t);try{const t=document.documentElement.dataset.theme||"";for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);i&&N1.test(i)&&i.startsWith(`theme.${t}.`)&&(e[i]=Sl(i))}}catch{}return e}function F1(){if(!Lr)try{window.tangu?.broadcastUi?.({prefs:L1()})}catch{}}function D1(e){const t=typeof e?.cloudApiBase=="string"?e.cloudApiBase.trim():"";if(t)return t.replace(/\/+$/,"");const n=typeof e?.cloudUrl=="string"?e.cloudUrl.trim().replace(/\/+$/,""):"";return n?`${n}/api`:""}const Fr="forsion_region";function Cd(){try{const e=navigator.languages?.length?navigator.languages:[navigator.language];for(const t of e){const n=String(t||"").toLowerCase();if(n)return n.startsWith("zh")?"zh":"en"}}catch{}return null}function Ad(){try{const t=localStorage.getItem(hi);if(t==="en"||t==="zh")return t}catch{}const e=Cd();if(e==="zh")return"zh";try{const t=localStorage.getItem(Fr);if(t)return t==="CN"?"zh":"en"}catch{}return e??"zh"}async function z1(){if(Cd()==="zh")return;try{if(localStorage.getItem(hi)||localStorage.getItem(Fr))return}catch{return}let e="";try{e=D1(await window.tangu?.getConfig?.())}catch{}if(!e)return;const t=`${e}/auth/region`;try{const n=new AbortController,i=setTimeout(()=>n.abort(),3e3),s=await fetch(t,{signal:n.signal}).finally(()=>clearTimeout(i));if(!s.ok)return;const r=(await s.json())?.country;if(!r)return;try{localStorage.setItem(Fr,r)}catch{}const o=r==="CN"?"zh":"en";o!==zr()&&Od(o)}catch{}}const Eo={"common.save":"保存","chat.wait.sending":"正在发送上下文 {kb} KB","chat.wait.firstToken":"等待模型首帧","chat.wait.describing":"当前模型不能直接看图,正在把图片转成文字({n} 张)。换用能看图的模型可以省掉这一步","chat.wait.elapsed":"已等待 {s} 秒","settings.python.label":"Python","settings.python.bundled":"内置(推荐)","settings.python.system":"系统","settings.python.hint":"内置:免安装、与你自己的 Python 隔离;系统:用你已装的 python(改动后重启后端生效)。","settings.mirror.label":"网络镜像","settings.mirror.toggle":"使用中国大陆镜像源","settings.mirror.recommend":"检测到你的系统环境可能位于中国大陆,建议开启镜像源以加速下载。","settings.mirror.hint":"开启后,引导安装、pip 装包、Agent 运行的 npx/git 与商店下载走国内镜像(清华/npmmirror/多站 GitHub 代理)。仅对 Forsion 发起的命令注入环境变量,不修改任何系统配置文件,可随时关闭;pip/npm/git 部分需「内置后端」模式。","settings.mirror.test":"测试连通","settings.mirror.unreachable":"不可达","settings.test.canceled":"已取消","settings.test.timeout":"✗ 连接超时","onboarding.env.mirrorLabel":"网络环境","onboarding.env.pythonBundled":"Python 已内置,无需单独安装。","onboarding.env.recheck":"重新检测","onboarding.env.installOk":"{tool} 安装成功 · {version}","onboarding.env.installedButMissing":"命令已执行完成,但仍未检测到 {tool}。可能需要重启应用或新开终端后生效,也可点「重新检测」再试。","onboarding.env.installFail":"{tool} 安装失败(exit {code}),请查看下方日志。","onboarding.env.copyCmd":"复制命令","onboarding.env.copied":"⤷ 已复制到剪贴板,请打开「终端」粘贴执行(需要输入系统密码):{command}","sidebar.newChat":"新会话","sidebar.memory":"记忆","sidebar.agents":"后台 Agent","sidebar.viewMore":"查看更多","tip.folder":"{files} 个文件,{folders} 个文件夹","tip.sessions":"{count} 个会话","tip.modified":"修改:{t}","tip.created":"创建:{t}","input.fileref.session":"历史会话","input.project.label":"项目","input.project.none":"不在项目中","input.project.dontWork":"不在项目中工作","input.project.search":"搜索项目","input.project.noMatches":"没有匹配的项目","input.project.add":"添加本地项目","input.project.addCloud":"新建云端项目","input.project.cloudName":"项目名称,回车创建","app.amadeusWorkspace":"Amadeus · {name}","app.createProjectFail":"创建项目失败:{e}","ws.detail.count":"{n} 个会话","ws.detail.newChat":"在此项目中新建会话","ws.detail.empty":"该项目暂无会话","ws.detail.viewMore":"查看更多","agents.detail.title":"后台 Agent","agents.detail.settings":"设置","agents.detail.historian":"Historian 活动","agents.detail.noActivity":"暂无活动记录","settings.advanced.sessionLimit":"侧栏每个项目显示的会话数","settings.mcpServer.label":"对外 MCP 端点(给外部 Agent 用)","settings.mcpServer.hint":"开启后本机起一个本地 HTTP MCP 端点,外部 Agent(Claude Code / Codex / OpenCode 等)可通过它调用 Forsion Desktop 的能力(当前:发消息到收件箱)。仅监听 127.0.0.1,带令牌鉴权。","settings.mcpServer.enable":"开放给外部 Agent(Claude Code / Codex / OpenCode 等)","settings.mcpServer.connectHint":"选择你的 Agent,复制配置接入(令牌已内嵌):","settings.mcpServer.endpoint":"端点","settings.mcpServer.generic":"通用 JSON","settings.mcpServer.genericNote":"任意支持 Streamable HTTP MCP 的客户端(Cursor / Windsurf / Cline 等)用「通用」配置填 url + Authorization 头即可。","settings.mcpServer.copy":"复制","settings.mcpServer.notRunning":"端点未能启动,请查看日志或重启应用。","common.cancel":"取消","common.retry":"重试","chat.action.copy":"复制","chat.you":"你","workbench.noSession":"选择或新建一个会话以查看","workbench.sessions":"工作会话","space.home":"主页","space.tangu":"Tangu","space.amadeus":"笔记","space.calendar":"日历","view.todo":"待办清单","view.calendar":"日历","view.calendarConfig":"日历设置","view.db":"多维表","view.drawing":"白板","space.coding":"编码工作室","view.codeStudio":"编码工作室","space.artificial":"造物","view.artificial":"造物","view.product":"作品","space.public":"发布","view.publicHub":"发布管理","public.title":"发布管理","public.subtitle":"集中管理你已发布的网站与笔记","public.needLogin":"登录 Forsion 账号后查看已发布内容","public.refresh":"刷新","public.empty":"暂无内容","public.open":"打开","public.copy":"复制链接","public.copied":"已复制","public.unpublish":"下架","public.revoke":"撤销","public.confirm":"确认?","public.sites":"我的网站","public.sitesDesc":"Forsion Connect 托管的网页应用","public.published":"公开发布的笔记","public.publishedDesc":"任何人可只读访问的分享链接","public.shared":"协作共享的笔记","public.sharedDesc":"邀请他人编辑 / 查看的页面","public.disabled":"已停用","public.unavailable":"此功能在当前环境不可用","coding.code":"代码","coding.preview":"预览","coding.reload":"刷新预览","coding.noEntry":"暂无入口页面","coding.noFile":"未选择文件","coding.pickFile":"在右侧文件树点选一个文件来编辑","coding.emptyPreview":"还没有可预览的页面。让左侧的 Coding Agent 生成一个 index.html 吧。","coding.projects":"项目","coding.newProject":"新建项目","coding.publish":"发布","coding.publishTitle":"发布到 Forsion","coding.publishDesc":"把这个网页应用发布成公开链接。应用内可用 window.forsion 调用 Forsion AI —— 访客登录自己的 Forsion 账号、消耗自己的额度。","coding.publishName":"应用名称","coding.publishSlug":"链接标识","coding.publishSlugHint":"3-32 位小写字母 / 数字 / 中划线","coding.publishEntry":"入口页面","coding.publishSlots":"已发布 {used}/{limit} 个({tier})","coding.publishBtn":"发布","coding.publishUpdate":"更新发布","coding.publishing":"发布中…","coding.unpublish":"下架","coding.unpublishConfirm":"确认下架?","coding.publishNeedLogin":"发布需要登录 Forsion 账号","coding.loginNow":"登录 Forsion","coding.loginWaiting":"等待浏览器完成授权…","coding.copyLink":"复制链接","coding.copied":"已复制","coding.openLink":"打开","coding.publishHint":"资源请用相对路径引用;.ts/.tsx 发布时自动转译,无需构建。","coding.publishNoEntry":"项目里还没有 .html 入口,先让 AI 生成页面再发布。","coding.listingTitle":"商店","coding.listingHint":"上架后会在商店「网站应用」中公开展示,需要平台审核。","coding.listingNone":"未上架","coding.listingPending":"审核中","coding.listingApproved":"已上架","coding.listingRejected":"已驳回","coding.listingNoteLabel":"驳回原因:{note}","coding.listingApply":"申请上架","coding.listingReapply":"重新申请","coding.listingWithdraw":"撤回申请","coding.listingDelist":"下架","coding.listingSummaryPh":"一句话介绍这个应用(审核后展示在商店的卡片上,300 字内)","coding.listingSubmit":"提交申请","coding.termsTitle":"发布为公开页面","coding.termsIntro":"发布后,任何获得链接的人均可查看该页面,页面也可能被转发或被搜索引擎收录。请确认:","coding.termsLi1":"你有权发布页面中的文字、图片、音视频及其他内容;","coding.termsLi2":"页面不包含违法信息、侵权内容或未经许可披露的个人信息;","coding.termsLi3":"你将对自己发布的内容承担相应责任。","coding.termsManage":"平台将依据法律法规及《内容发布规范》对公开内容进行管理,并可能对违规内容采取限制访问、停止展示或删除等措施。","coding.termsAgreePre":"我已阅读并同意","coding.termsGuidelines":"《内容发布规范》","coding.termsConfirm":"确认发布","coding.cancel":"取消","coding.projectName":"项目名称","coding.create":"创建","coding.noProjects":"还没有项目。点「新建项目」创建第一个。","coding.switchProject":"切换项目","coding.generating":"生成中…","space.inbox":"收件箱","inbox.list":"消息列表","inbox.reader":"消息阅读","inbox.filter.unread":"未读","inbox.filter.archived":"已归档","inbox.source.forsion":"Forsion","inbox.source.automation":"自动化","inbox.source.agents":"Agent","inbox.reader.empty":"选择一封消息开始阅读","inbox.sender.system":"系统","inbox.sender.automation":"自动化","inbox.action.markRead":"标为已读","inbox.action.markUnread":"标为未读","inbox.action.readAll":"全部已读","inbox.action.archive":"归档","inbox.action.unarchive":"取消归档","inbox.action.delete":"删除","inbox.action.refresh":"拉取新消息","inbox.action.chat":"与 {name} 聊天","inbox.deleteConfirm":"删除消息「{title}」?","time.justNow":"刚刚","net.unavailable":"网络不可用,请稍后再试","inbox.pullOk":"已拉取 {n} 条新消息","inbox.pullNone":"没有新消息","inbox.opFail":"操作失败:{e}","inbox.attach.title":"附带物品","inbox.attach.claim":"领取","inbox.approval.title":"请求批准","inbox.approval.loading":"读取审批记录…","inbox.approval.missing":"找不到这条审批记录(可能已过期或已清理)","inbox.approval.approved":"已批准并执行","inbox.approval.rejected":"已拒绝","inbox.approval.executing":"执行中…","inbox.approval.failed":"已批准,但执行失败","inbox.approval.loadFail":"读取审批记录失败","inbox.approval.retry":"重试","inbox.approval.reason.customAsk":"你的审批规则要求","inbox.approval.reason.rule":"审批规则「{rule}」","inbox.approval.reason.escalate":"写工作区以外的文件","inbox.approval.reason.mode":"审批档要求批准","inbox.approval.reason.control":"设置无人值守工作","inbox.attach.claiming":"领取中…","inbox.attach.claimed":"已领取","inbox.attach.expired":"已过期,无法领取","inbox.claim.ok":"已领取,物品已入账","inbox.claim.already":"之前已领取过","inbox.claim.fail":"领取失败","inbox.claim.unmet":"未满足领取条件,暂时领不了","inbox.attach.unmet":"未满足领取条件","inbox.req.title":"领取条件","inbox.req.version":"客户端 {v} 及以上","inbox.req.tiers":"{tiers}","inbox.req.currentVersion":"当前版本 {v}","inbox.req.currentTier":"当前:{tier}","inbox.req.other":"另有条件(以领取时服务端校验为准)","inbox.feedback.title":"反馈线程","inbox.feedback.event.created":"新的用户反馈","inbox.feedback.event.user_reply":"用户回复了反馈","inbox.feedback.event.admin_reply":"你的反馈有了回复","inbox.feedback.loading":"读取反馈线程…","inbox.feedback.loadFail":"读不到反馈线程","inbox.feedback.signIn":"登录 Forsion 账号后可查看与回复","inbox.feedback.missing":"这条反馈已不存在","inbox.feedback.retry":"重试","inbox.feedback.you":"你","inbox.feedback.support":"Forsion 支持","inbox.feedback.user":"用户","inbox.feedback.replyPh":"回复…","inbox.feedback.attach":"添加附件","inbox.feedback.attachHint":"图片 / 文本 / JSON,单个 ≤5MB,最多 5 个","inbox.feedback.remove":"移除","inbox.feedback.send":"发送","inbox.feedback.sending":"发送中…","inbox.feedback.sendFail":"发送失败:{e}","inbox.feedback.tooMany":"最多 5 个附件","inbox.feedback.tooBig":"{name} 超过 5MB 或为空","inbox.feedback.badType":"{name} 类型不支持(只收图片 / 文本 / JSON)","inbox.feedback.download":"下载","inbox.feedback.status.open":"待处理","inbox.feedback.status.in_progress":"处理中","inbox.feedback.status.resolved":"已解决","inbox.feedback.status.closed":"已关闭","inbox.tier.free":"免费用户","inbox.tier.plus":"Plus 会员","inbox.tier.pro":"Pro 会员","inbox.expiresAt":"有效期至 {d}","inbox.expired":"已过期","settings.inbox.title":"收件箱","settings.inbox.notifyLabel":"新消息系统通知","settings.inbox.notifyHint":"收到新消息时弹系统通知(点击可直达收件箱);关闭后仅保留图标角标。","amadeus.pages":"智库","amadeus.editor":"编辑器","amadeus.outline":"大纲","amadeus.backlinks":"反链","amadeus.search":"搜索","amadeus.tags":"标签","amadeus.graph":"关系图","chat.action.copied":"已复制","chat.action.edit":"编辑","chat.action.resend":"发送","chat.action.regenerate":"重新生成","chat.action.branch":"从此处分支","chat.branchTitle":"{title}(分支)","chat.branchEmpty":"当前会话还没有可分支的 AI 回复","chat.branched":"已分支到新会话(继承历史)","input.slash.branch":"从最近一条回复分支新会话(继承历史)","app.branchFail":"分支失败:{e}","sidebar.ws.menu":"项目操作","sidebar.ws.rename":"重命名项目","sidebar.ws.remove":"移除项目","app.truncateFail":"截断消息失败:{e}","search.jumpOutOfWindow":"命中的消息在更早的历史里,已打开会话但没能定位到它","rewind.busy":"运行中无法回退,请先停止当前运行","rewind.noTime":"这条消息没有时间戳,定位不到回退点","rewind.codeDone":"代码已回退({n} 个文件)","rewind.codePartial":"{bad} 个文件回退失败,已中止(对话未改动)","rewind.codeSkipped":"代码已回退 {n} 个文件;另有 {bad} 个当时没存下快照,恢复不了","rewind.codeConflict":"代码已回退 {n} 个文件;{kept} 个在那之后另有改动,已原样保留(未删)","inquiry.sendFail":"回答没送达:{e},请重试","rewind.codeFail":"回退代码失败:{e}","app.resendFailed":"重发失败,已恢复本地显示;请重试。","app.regenNoUser":"找不到可重新生成的用户消息","app.wsRenameFail":"重命名项目失败:{e}","app.moveToProjectFail":"把对话挪进作品文件夹失败:{e}","app.moveToProjectHalf":"这条对话只挪了一半:项目已切到「{name}」,但工作目录没切过去({e})。","app.sessionMoving":"正在把这条对话挪进作品文件夹,稍等一下再发。","app.wsRemoveFail":"移除项目失败:{e}","app.wsRemoved":"已移除项目「{name}」","app.wsTrashFail":"会话已删除,但 .tangu 文件夹没能移到废纸篓:{e}","app.agentTrashFail":"Agent 已删除,但它的文件没能移到废纸篓,还在 {path}","app.sessionExpired":"登录已过期,请重新登录 Forsion 账号","onboarding.connect.cloudSync":"开启云同步(同步云端 Agents)","onboarding.connect.cloudSyncHint":"开启后,记忆、日志与标记为云同步的 Agents 会在登录设备间双向同步。稍后可在「设置 → Forsion 账号」更改。","common.confirm":"确定","extendView.close":"关闭扩展视图","extendView.failed":"扩展视图加载失败","extendView.back":"返回","common.close":"关闭","common.back":"返回","common.refresh":"刷新","common.loading":"加载中…","common.listSep":"、","common.delete":"删除","common.edit":"编辑","common.open":"打开","common.language":"语言","common.copyCode":"复制代码","common.enabled":"开启","common.disabled":"关闭","locale.zh":"中文","locale.en":"English","locale.toggleTitle":"切换语言","feedback.title":"反馈","achievements.title":"成就","achievements.unlocked":"成就达成","achievements.claim":"领取","achievements.claimed":"已领取","achievements.pts":"{n} 点","achievements.seriesPts":"{n}/{total} 点","achievements.pluginGroup":"插件","achievements.medal.bronze":"铜牌","achievements.medal.silver":"银牌","achievements.medal.gold":"金牌","achievements.s.starter":"初识","achievements.s.chat":"对话","achievements.s.notes":"笔记","achievements.s.agents":"Agent","achievements.a.first-login.title":"Forsion is All You Need","achievements.a.first-login.desc":"登录 Forsion 账号","achievements.a.theme-change.title":"焕然一新","achievements.a.theme-change.desc":"更换一次主题或配色","achievements.a.market-install.title":"超级武装","achievements.a.market-install.desc":"从商店安装一个项目","achievements.a.space-save.title":"Space 之力","achievements.a.space-save.desc":"把当前布局另存为 Space","achievements.a.first-message.title":"Hello Agent!","achievements.a.first-message.desc":"向 Agent 发出第一条消息","achievements.a.chat-10.title":"畅所欲言","achievements.a.chat-10.desc":"累计发出 10 条消息","achievements.a.chat-100.title":"滔滔不绝","achievements.a.chat-100.desc":"累计发出 100 条消息","achievements.a.group-chat.title":"圆桌会议","achievements.a.group-chat.desc":"发起一次团队协作","achievements.a.first-note.title":"妙笔生花","achievements.a.first-note.desc":"创建第一篇笔记","achievements.a.notes-10.title":"笔耕不辍","achievements.a.notes-10.desc":"累计创建 10 篇笔记","achievements.a.notes-100.title":"著作等身","achievements.a.notes-100.desc":"累计创建 100 篇笔记","achievements.a.first-base.title":"数据雏形","achievements.a.first-base.desc":"创建第一个 Base 多维表","achievements.a.first-agent.title":"造物主","achievements.a.first-agent.desc":"创建你的第一个 Agent","achievements.a.agents-3.title":"智囊团","achievements.a.agents-3.desc":"累计创建 3 个 Agent","achievements.a.special-agent.title":"幕后协作","achievements.a.special-agent.desc":"开启后台 Agent Muse 或 Historian","achievements.a.first-image.title":"妙笔生花","achievements.a.first-image.desc":"让 Agent 生成第一张图片","achievements.a.debug-toast.title":"这都被你发现了?","achievements.a.debug-toast.desc":"??????","settings.developer.achToastLabel":"成就弹窗","settings.developer.achToast":"触发成就弹窗","settings.developer.achToastHint":"调试成就达成动画,可重复触发;它本身也是一个隐藏成就(奖励只发一次)。","settings.developer.activityLabel":"活动日志","settings.developer.activityExport":"导出活动日志","settings.developer.activityEnable":"记录应用内活动","settings.developer.activityHint":"在本机记录你的操作(开会话/改笔记/建任务等),供后台 Agent Muse 理解你在做什么;仅存本地 activity 目录,保留 30 天。导出可用于排查问题。","settings.developer.activityViewCmd":"活动日志实时视图命令","settings.developer.activityViewCmdHint":"开启后命令面板(⌘K)多一条「打开活动日志」:在主区标签页实时查看活动记录(2 秒刷新,可过滤/暂停)。","command.openActivityLog":"打开活动日志","view.activityLog":"活动日志","activityView.filter":"过滤(子串匹配)…","activityView.pause":"暂停","activityView.resume":"继续","activityView.count":"{n} 行","activityView.empty":"还没有活动记录。请确认开发者选项里「记录应用内活动」处于开启,然后随便操作几下。","command.openActiveWindow":"前台窗口采样","view.activeWindow":"前台窗口采样","activeWindowView.on":"接缝已开启","activeWindowView.off":"接缝未开启","activeWindowView.offHint":"前台窗口采样默认关闭。到 设置 → 开发者选项 打开「前台窗口采样」后,这里会实时显示当前焦点所在的应用。","activeWindowView.noSample":"开着但探不到前台窗口。Linux 上 Wayland 会话拿不到(与 ActivityWatch 同样的天花板),X11 需要 xprop。","activeWindowView.noTitle":"(本平台不提供:macOS 的窗口标题属于「屏幕录制」权限)","activeWindowView.idleMark":"挂机","activeWindowView.clear":"清空","activeWindowView.segEmpty":"正在采样。切到别的应用待一会儿再回来,下面会出现折好的焦点段(挂机段会变灰)。","space.automation":"自动化","view.automationList":"自动化列表","view.automationDetail":"自动化详情","view.automationRuns":"触发记录","automation.group.system":"系统自动化","automation.group.watches":"盯任务规则","automation.group.buttons":"按钮","automation.group.schedules":"Agent 日程","automation.group.finished":"已结束 ({n})","automation.finished":"已结束","automation.finishedHint":"一次性,时刻已过——编辑可改期重开","automation.fact.status":"状态:","automation.schedule.every":"每 {ivl}","automation.schedule.once":"一次性","automation.fact.desc":"描述:","automation.sched.name":"名称","automation.sched.date":"日期","automation.sched.dateHint":"YYYY-MM-DD 或 YYYY-MM-DDTHH:mm,可带 /结束时刻","automation.sched.repeat":"重复","automation.sched.repeatHint":"留空=一次性;如 24h / 7d,从锚点滚动","automation.builder.expiredReset":"原时刻已过,已重置为下一整点——保存即改期重开。","automation.builder.atPast":"一次性时刻已过,请重新设定时间。","automation.muse.title":"Muse 巡检","automation.muse.trigger":"每 {min} 分钟巡检","automation.muse.action":"思考可为用户做什么 → 产出 TODO","automation.historian.title":"Historian 记忆维护","automation.historian.trigger":"每 {n} 轮对话后","automation.historian.action":"总结会话、维护日志与记忆","automation.watches.empty":"还没有盯任务规则——点下方新建,或在聊天里说「帮我盯着…」。","automation.enabled":"已启用(点击停用)","automation.disabled":"已停用(点击启用)","automation.new":"新建自动化","automation.cond.daily":"每天 {time}","automation.cond.event":"活动含「{match}」","automation.cond.file":"{path} 满 {n} 字","automation.cond.at":"一次 · {time}","automation.cond.every":"每 {ivl}","automation.cond.manual":"手动 · 按钮","automation.cond.dbRow":"{path} 新增行","automation.cond.dbCell":"{path} 单元格变化","automation.cond.dbWhereN":"条件 ×{n}","automation.nextRun":"下次 {time}","automation.detail.empty":"在左侧选择一个自动化","automation.detail.latest":"最近运行","automation.detail.recent":"近期活动","automation.deepConfig":"深度配置","automation.fact.trigger":"触发:","automation.fact.action":"动作:","automation.fact.actions":"动作链:","automation.fact.runner":"执行:","automation.fact.prompt":"指令:","automation.fact.cooldown":"冷却:","automation.fact.where":"条件:","automation.fact.columns":"监听列:","automation.fact.noCooldown":"无(0h)","automation.fact.disabledReason":"已被引擎自动停用:{reason}","automation.fact.lastRun":"上次运行:","automation.fact.nextRun":"下次触发:","automation.fire.btn":"试跑","automation.fire.hint":"立即执行一次动作链(不影响正常触发节奏)","automation.fire.ok":"试跑完成({status})","automation.fire.fail":"试跑失败({status})","automation.exec.manual":"试跑","automation.exec.steps":"{n} 步完成","automation.step.notify":"通知","automation.step.agent_run":"跑 Agent","automation.step.db_row_add":"表格加行","automation.step.db_row_edit":"表格改行","automation.step.tool_call":"调工具","automation.transcript.empty":"还没有运行内容","automation.transcript.trigger":"触发输入","automation.transcript.agent":"Agent","automation.transcript.tools":"工具调用 {n} 次","automation.trigger.neverFired":"还没触发过——命中后这里会出现该次运行","automation.trigger.museNote":"该规则命中会唤醒 Muse,运行内容见","automation.runs.empty":"暂无记录","automation.runs.pick":"选中一条自动化后,这里显示它的运行记录","automation.builder.title":"新建自动化","automation.builder.editTitle":"编辑自动化","automation.builder.trigger":"触发","automation.builder.desc":"名称","automation.builder.descPh":"一句话描述这个自动化","automation.builder.condType":"触发方式","automation.builder.condTimer":"定时","automation.builder.condEvent":"事件","automation.builder.condFile":"文件达标","automation.builder.condManual":"手动(按钮)","automation.builder.condDb":"多维表","automation.builder.manualHint":"不会自动触发。在笔记里插入「按钮」块并选中这条规则,由你点击执行。","automation.builder.unsupported":"这条规则含有当前构建器还不认识的动作类型。用聊天里的 manage_automation 修改(在这里保存会把那部分抹掉,所以不给编辑)。","automation.builder.dbPath":"哪张多维表(.db)","automation.builder.dbPickDb":"选择多维表…","automation.builder.dbEvent":"监听事件","automation.builder.dbEventRow":"新增行","automation.builder.dbEventCell":"单元格变化","automation.builder.dbColumn":"监听列(可多选)","automation.builder.dbColumnsHint":"勾选多列时任一列变化即触发;「新值等于」按变化的那一列比。","automation.builder.dbPickCol":"选择列…","automation.builder.dbColsLoading":"表读取中…","automation.builder.dbEquals":"且新值等于(可选)","automation.builder.dbEqualsPh":"留空 = 任意变化都触发","automation.builder.dbHint":"表内容变化后由引擎按游标比对触发;规则钉在建立时的智库,切换智库不误伤同名表。","automation.builder.dbRowId":"行 id","automation.builder.dbRowIdPh":"留空 = 触发命中的那一行","automation.builder.dbRowIdRequired":"必填(当前触发方式没有「触发行」可缺省)","automation.builder.dbCells":"写入字段","automation.builder.dbCellKey":"列名或列 id","automation.builder.dbCellVal":"值(可用 {{row.列名}} 模板)","automation.builder.dbCellAdd":"添加字段","automation.builder.dbCellsHint":"多维表触发时,值里的 {{row.列名}} 会替换成触发行对应单元格。","automation.builder.dbCellValPh":"{{= {target.数量} - {row.出库数量} }}","automation.builder.dbWhere":"附加条件(可选)","automation.builder.dbWhereAdd":"添加条件","automation.builder.dbWhereOpEq":"等于","automation.builder.dbWhereOpNe":"不等于","automation.builder.dbWhereOpEmpty":"为空","automation.builder.dbWhereOpNotEmpty":"不为空","automation.builder.dbWhereValPh":"值","automation.builder.dbWhereHint":"与上面的条件 AND;比对触发行物化后的值,公式/引用列也可比;最多 10 条。","automation.builder.dbRowFrom":"沿关联列取目标行(可选)","automation.builder.dbRowFromPh":"触发表里的关联列名或列 id;留空 = 用上面的行 id","automation.builder.dbMatch":"按列值匹配多行(可选)","automation.builder.dbMatchValPh":"值,可用 {{row.id}} 模板","automation.builder.dbTargetHint":"目标行优先级:行 id > 关联列 > 列值匹配 > 触发命中的那一行。","automation.builder.dbSkipIfEmpty":"此字段为空则跳过(可选)","automation.builder.dbSkipIfEmptyPh":"填一个上面的列名/列 id","automation.builder.cooldownDbHint":"多维表触发的纯动作链可设 0 = 不冷却(链式规则需要)","automation.builder.dbNoteView":"选中的是「笔记视图」库(行来自文件夹里的笔记)——自动化只支持经典多维表,请换一张。","automation.builder.timerMode":"定时方式","automation.builder.timerDaily":"每天","automation.builder.timerOnce":"一次","automation.builder.timerEvery":"间隔","automation.builder.time":"每天时刻","automation.builder.datetime":"触发时刻","automation.builder.onceHint":"到点执行一次后自动停用(留在列表里,改期+启用即可复用)。","automation.builder.interval":"重复间隔","automation.builder.everyHint":"从创建时刻起按间隔滚动;停机错过只补最近一次。含跑 Agent 步骤时下限 1 小时。","automation.builder.unitM":"分钟","automation.builder.unitH":"小时","automation.builder.unitD":"天","automation.builder.match":"活动日志匹配串","automation.builder.matchPh":"如 note.edit、文件名或 plugin: 事件","automation.builder.matchHint":"匹配新出现的活动日志行(子串)。可盯插件事件(plugin:插件id:事件)或 run.done agent=xx。","automation.builder.path":"文件路径(绝对路径或 ~ 开头)","automation.builder.chars":"非空白字符数","automation.builder.stepN":"步骤 {n}","automation.builder.moveUp":"上移","automation.builder.moveDown":"下移","automation.builder.notifyTitle":"通知标题","automation.builder.notifyTitlePh":"收件箱消息标题","automation.builder.notifyBody":"通知正文(可选)","automation.builder.notifyHint":"直接投递到收件箱(0 token),已接微信/TG 等通道会一并推送。","automation.builder.runner":"执行者","automation.builder.runnerPick":"选择 Agent…","automation.builder.tool":"工具","automation.builder.toolPick":"选择工具…","automation.builder.dangerous":"⚠ 高危工具:参数即保存即批准,请确认内容","automation.builder.toolCatalogEmpty":"引擎未提供动作目录(需新版引擎)","automation.builder.museFallback":"唤醒 Muse(默认)","automation.builder.museFallbackHint":"不加步骤时,命中会唤醒 Muse 把这件事整理成给你的提醒/TODO。添加步骤则改为按步骤执行。","automation.builder.prompt":"执行指令","automation.builder.promptPh":"命中后让它做什么(英文最佳)","automation.builder.cooldown":"冷却(小时)","automation.builder.cooldownHint":"两次触发的最小间隔,单位小时(纯通知/工具链下限 0.25=15 分钟)","automation.builder.cooldownAgentHint":"含跑 Agent 步骤,下限 1 小时(无人值守自激护栏)","market.title":"商店","market.subtitle":"发现社区构建的工作流、能力与界面扩展","market.navSubtitle":"社区扩展与工作流","market.group.discover":"发现","market.group.categories":"分类","market.group.manage":"管理","market.tab.discover":"商店首页","market.tab.skills":"技能","market.tab.agents":"Agent","market.tab.plugins":"插件","market.tab.spaces":"Space","market.tab.themes":"主题","market.tab.webapps":"网站应用","market.tab.installed":"已安装","market.searchPlaceholder":"搜索名称、作者或标签","market.clearSearch":"清除搜索","market.sort.label":"排序","market.sort.popular":"热门","market.sort.latest":"最近","market.sort.name":"名称","market.sectionSubtitle":"浏览{section}并管理安装状态","market.pluginsSubtitle":"浏览插件、Space 与 Agent,并管理安装状态","market.detailSubtitle":"详情、来源与安装信息","market.webOpen":"打开","market.webHint":"用户用 Coding Space 构建并上架的网页应用,在内置浏览器中打开;AI 功能消耗访客自己的账号额度。","market.tab.updates":"可更新","market.tab.submit":"投稿","market.author":"作者","market.downloads":"{n} 次下载","market.downloadsShort":"{n} 下载","market.install":"安装","market.installing":"安装中…","market.installed":"已安装","market.reinstall":"重新安装","market.desktopOnly":"仅桌面","market.desktopOnlyInstall":"仅桌面可用","market.desktopOnlyHint":"这个插件要用到电脑上才有的功能,手机上装不了","market.platform":"平台","market.uninstall":"卸载","market.uninstallConfirm":"卸载「{name}」?将删除它的安装目录。","market.uninstallWarnAgent":"⚠️ 这是一个 Agent:它落地后有自己的记忆与日志,卸载会一并删除,且无法恢复。","market.uninstallWarnSkill":"⚠️ 若你改过这份技能,你的改动会一并删除。","market.uninstalled":"已卸载「{name}」","market.uninstalledNeedsRestart":"已卸载「{name}」· 重启后端后它的工具才会真正消失","market.uninstallFail":"卸载失败:{e}","market.openSettings":"打开设置","market.update":"更新","market.updateTitle":"更新 v{from} → v{to}","market.allUpToDate":"已安装的内容都是最新版本","market.allUpToDateHint":"发现新版本时会自动出现在这里。","market.detailBack":"返回列表","market.empty":"这个分类还没有内容","market.emptyHint":"社区内容通过审核后会出现在这里。","market.noInstalled":"还没有从商店安装内容","market.noResults":"没有找到匹配内容","market.noResultsHint":"换一个名称、作者或标签试试。","market.browse":"浏览商店","market.retry":"重新加载","market.loadFailShort":"商店暂时无法加载","market.loadFail":"加载失败:{e}","market.summaryFallback":"作者暂未提供简介。","market.searchResults":"搜索结果","market.resultCount":"共 {n} 项内容","market.featured":"社区精选","market.viewDetails":"查看详情","market.recent":"最近上架","market.recentHint":"看看社区刚刚带来了什么。","market.popular":"热门内容","market.popularHint":"按真实安装量排序。","market.overview":"内容介绍","market.reviewed":"已通过上架审核","market.reviewedHint":"表示内容符合发布要求,不代表 Forsion 为第三方代码提供担保。","market.type":"类型","market.version":"版本","market.source":"安装来源","market.sourceUpload":"Forsion 托管包","market.updated":"最近更新","market.unknown":"未知","market.installOk":"已安装「{name}」","market.spaceInstalled":"已安装 Space「{name}」并加入功能栏","market.themeInstalled":"已安装「{name}」,可在 设置 → 外观 中选用","market.amadeusPluginInstalled":"Forsion 插件「{name}」已安装并加载","market.pluginInstalledOk":"插件已安装并启用","market.pluginInstalledRestartHint":"插件已安装,重启后端后才完整生效","market.pluginInstalledWaiting":"插件已安装,但还需要先安装或启用:{list}","market.amadeusPluginNeedsDeps":"Forsion 插件「{name}」已安装,但还需要先安装或启用:{list}","market.restartBackend":"重启后端","market.restartBackendHint":"只需几秒;正在运行的对话会被中断","market.backendRestarting":"正在重启后端…","market.backendRestarted":"后端已重启,改动已生效","market.backendRestartFailed":"后端没能重启,请稍后重试或重启应用","market.installFail":"安装失败:{e}","market.installFailNamed":"「{name}」安装失败:{e}","market.installHintGithub":"这个项目从 GitHub 下载,部分网络下连不上。可以开启系统代理后重试,或在「设置 → 常规 → 连接」打开「使用中国大陆镜像源」,改走国内代理线路。","market.installRetry":"重试","market.phase.resolve":"准备中…","market.phase.connect":"连接中…","market.phase.connectN":"连接中 {n}/{m}…","market.phase.percent":"下载中 {n}%","market.phase.bytes":"已下载 {size}","market.openRepo":"查看 GitHub 仓库","market.readmeEmpty":"(暂无详情)","market.submitHint":"支持 GitHub 仓库、npm 公开包和 ZIP 上传。在个人中心提交,审核通过后上架。","market.submitOpen":"前往投稿页","market.submitKicker":"开发者中心","market.submitTitle":"把你的工作流带给更多人","market.submitArtTitle":"统一审核与版本管理","market.submitArtHint":"Skills、Agents、Plugins、Spaces 与 Themes 使用同一条发布管线。","feedback.label":"遇到的问题 / 想反馈的内容","feedback.placeholder":"描述你遇到的问题或建议……提交后会自动附带本次会话日志,便于我们排查。","feedback.logAttached":"将自动附带本次会话日志({name})","feedback.noSession":"当前无会话,仅提交文字反馈","feedback.submit":"提交反馈","feedback.diagnoseViaChat":"让 Tangu 帮我诊断","feedback.diagnoseViaChatHint":"把问题描述发给当前会话的 Agent,就地帮你排查","feedback.ok":"已提交,感谢你的反馈!","feedback.okNoLog":"已提交(会话日志超过 5MB,本次未附带)","feedback.errEmpty":"请先填写反馈内容","feedback.errFail":"提交失败:{err}","feedback.errNotLoggedIn":"未登录 Forsion,无法提交","feedback.errUnavailable":"当前环境不支持提交反馈","sidebar.account.login":"登录 Forsion","sidebar.account.loginHint":"登录后可用云端记忆 / 技能 / 托管模型(不登录也能正常使用)","sidebar.account.loggingIn":"登录中…","sidebar.account.logout":"退出登录","sidebar.account.menu.weekly":"本周","sidebar.account.menu.daily":"今日","sidebar.account.menu.unlimited":"不限","sidebar.account.menu.loading":"加载中…","sidebar.account.menu.quotaFail":"额度加载失败","settings.provider.loginBusy":"在浏览器里完成登录后,本地引擎会自动重启加载该 provider,模型列表随后自动刷新(约几秒)。","quota.exhausted.daily":"今日 AI 额度已用尽(本次运行已预支跑完;可在「Forsion 云端 → 额度与积分」用额度重置卡立即恢复)","quota.exhausted.weekly":"本周 AI 额度已用尽(本次运行已预支跑完;可在「Forsion 云端 → 额度与积分」用额度重置卡立即恢复)","sidebar.account.loginFail":"登录失败:{e}","sidebar.account.loginSub":"点击登录","sidebar.account.engineDown":"引擎未运行 · 点击重启","sidebar.account.engineStarting":"引擎启动中…","sidebar.settings":"设置 (Ctrl+,)","header.theme":"深浅模式","header.browser":"浏览器","header.browserEnabled":"浏览器工具已开启","header.browserDisabled":"浏览器工具已关闭","settings.tab.about":"关于","about.version":"版本","about.checkUpdates":"前往官网","about.update.check":"检查更新","about.update.checking":"检查中…","about.update.upToDate":"已是最新版本","about.update.available":"发现新版本 v{version}","about.update.download":"下载更新","about.update.downloading":"下载中 {percent}%","about.update.install":"重启并安装","about.update.goToDownload":"前往下载","about.update.error":"更新失败:{error}","about.update.unsupported":"开发环境不支持自动更新","about.update.unreachable":"连不上更新服务器,稍后再试","about.update.beta":"接收测试版更新","about.update.betaHint":"打开后会收到 x.y.z-beta.N 这类预发布版本(功能更早、也更可能有问题)。关着则完全看不到它们。正式版永远优先:测试版之后发的正式版照常推送。","app.update.bannerTitle":"发现新版本 v{version}","app.update.bannerAction":"前往更新","app.update.bannerDismiss":"忽略","about.changelogTitle":"最新更新","about.builtWith":"Forsion Desktop · 扶桑","about.builtWithMobile":"Forsion 移动端 · 扶桑","about.complianceTitle":"备案与协议","about.appFiling":"App 备案号","about.privacy":"隐私政策","about.terms":"服务条款","settings.cloud.envOnly":"Forsion 云端地址由环境变量 TANGU_CLOUD_URL 设置(此处只读)。","settings.cloud.label":"Forsion 云端地址(大脑:记忆/技能/托管模型)","settings.cloud.unset":"(未设置,用内置默认)","model.group.forsion":"Forsion 云端","picker.ungrouped":"未分组","model.group.direct":"本地","model.collapseAll":"全部折叠","model.expandAll":"全部展开","model.empty":"暂无模型","model.searchPlaceholder":"搜索模型…","settings.tab.developer":"开发者选项","settings.tab.browser":"浏览器控制","settings.tab.channels":"通道","channel.name.wechat":"微信","channel.name.telegram":"Telegram","channel.name.qq":"QQ","channels.intro":"把 Tangu 接进你的 IM:连接即新建一个通道会话,消息即聊即答;收件箱转发可独立开启,两者互不影响。","channels.loadingTitle":"正在加载通道","channels.loadingHint":"正在读取本机通道能力与连接状态。","channels.notAvailable":"通道功能需要内置本地后端(桌面版)。","channels.notAvailableHint":"确认本机后端已启动后重试;外部后端模式暂不提供此设置。","channels.enable":"启用","channels.status.connected":"已连接","channels.status.notConnected":"未连接","channels.status.disabled":"已停用","channels.connect":"连接","channels.scanConnect":"扫码连接","channels.disconnect":"断开连接","channels.disconnected":"已断开。","channels.connectedAs":"已连接:{label}","channels.connectedMsg":"微信已连接,已新建通道会话。","channels.connectFailed":"操作失败:{e}","channels.qrExpired":"二维码已过期,请重新扫码。","channels.scanQrHint":"用微信「扫一扫」确认登录。","qr.failed":"二维码生成失败,请重试。","qr.alt":"登录二维码","channels.newSessionHint":"连接即新建会话;之后的消息发往该会话。在 IM 里可用 /new 新建、/list /switch 切换会话,/help 查看全部命令。","channels.botToken":"Bot Token","channels.botTokenHint":"在 Telegram 找 @BotFather 创建机器人获取 token,填入后点「连接」。","channels.qqHint":"在 QQ 开放平台(q.qq.com)创建机器人获取 AppID / AppSecret。","channels.secretSaved":"已保存(输入可更换)","channels.sessionsSec":"通道会话","channels.sessions":"启用通道会话","channels.sessionsHint":"收到的消息驱动 Agent 会话并回复;关闭后仅收件箱转发在工作。","channels.approval":"远程审批","channels.approval.readonly":"询问我批准","channels.approval.autoEdit":"替我批准","channels.approval.fullAuto":"完全放行","channels.defaultAgent":"默认 Agent","channels.defaultModel":"默认模型","channels.imageModel":"画图模型","channels.ttsModel":"语音模型","channels.ttsModelPlaceholder":"空=沿用「语音朗读」设置","channels.ttsVoice":"音色","channels.followDefault":"跟随全局默认","channels.followGlobal":"跟随全局设置","channels.forwardSec":"收件箱转发","channels.forward":"转发收件箱消息到此通道","channels.forwardHint":"收件箱有新消息时推送到你的 IM(与通道会话相互独立)。","channels.forwardSenders":"允许的发件人","channels.forwardAll":"全部","channels.waitingPeer":"已连接,等待对方发来第一条消息以绑定联系人。","channels.senderSystem":"系统","channels.senderServer":"Forsion 云端","sidebar.channel.setAsConnected":"设为正在连接","settings.tab.notes":"笔记","settings.tab.sync":"同步","settings.sync.cloudSec":"在线同步","settings.sync.remoteSec":"本地智库远程同步","settings.notes.storageTitle":"文件与附件","settings.notes.storageDescription":"集中设置附件落点与日记目录。","settings.notes.behaviorTitle":"编辑与安全","settings.notes.behaviorDescription":"控制导入、链接兼容与删除附件时的保护策略。","settings.notes.modeLabel":"附件存放方式","settings.notes.modeAttachments":"笔记同目录下的 attachments 文件夹","settings.notes.modeSame":"与笔记同目录","settings.notes.modeVault":"智库内固定文件夹","settings.notes.modeHint":"拖入笔记的文件保存到哪里。attachments 模式会在笔记所在目录自动创建 attachments 子文件夹(不存在则新建)。","settings.notes.folderLabel":"智库相对文件夹","settings.notes.folderHint":"相对智库根目录,如 assets。所有附件集中存放于此(需在智库内才能内联预览)。","settings.notes.previewLabel":"导入文件默认开启预览","settings.notes.previewHint":"开启:插入 ![[文件]] 预览块(图片内联,其它显示可点开的文件卡片)。关闭:插入 [文件名](相对路径) 链接。","settings.notes.upgradeV4Label":"打开旧笔记时升级为 v4 纯 Markdown 格式","settings.notes.upgradeV4Hint":"默认开启:v3 块标记笔记在编辑时转为纯 Markdown(无标记、标准分段)。升级仅在你真正编辑后落盘;若还有设备停留在 2.7.8 以前,可暂时关闭。","settings.notes.dailyLabel":"日记文件夹","settings.notes.dailyPlaceholder":"留空 = 智库根目录","settings.notes.dailyHint":"「打开今天的日记」创建 YYYY-MM-DD.md 的位置(智库相对路径);若存在 templates/daily.md 会自动套用为模板。","settings.notes.wikiFilesLabel":"双链补全包含附件与多维表","settings.notes.wikiFilesHint":"开启:输入 [[ 时除笔记外也补全附件、多维表(.db)、画板等文件。关闭:只补全笔记。","settings.notes.canvasDoubleClickFocusLabel":"双击聚焦画布卡片","settings.notes.canvasDoubleClickFocusHint":"双击卡片一律进入编辑并把光标落到点击处。开启:进编辑的同时还把它平滑移到画面中心并缩放到适合阅读的比例;关闭:只进编辑,视口不动。单击只选中;空格也可进编辑。","settings.notes.canvasOverviewZLabel":"画布简略标题的触发比例","settings.notes.canvasOverviewZHint":"画布缩小到这个比例或更小时,卡片正文换成标题摘要。默认 25% = 只在缩到底那一档才简略;调高则更早换成摘要。画布右下角的开关可以整个关掉简略显示。","settings.notes.deleteAssetsLabel":"删除笔记时连带删除独占附件","settings.notes.deleteAssetsAsk":"每次询问","settings.notes.deleteAssetsYes":"记住:一并删除","settings.notes.deleteAssetsNo":"记住:保留附件","settings.notes.deleteAssetsHint":"只处理「仅被这条笔记引用」的附件;被别的笔记也引用的一律保留。","settings.remote.saved":"远程设置已保存。托管后端可能会重启以应用配置。","settings.browser.title":"浏览器控制","settings.browser.agentBrowser":"Agent 浏览器","settings.browser.hint":"Tangu 会优先使用 browser_search 与 browser_* 交互工具完成网页任务;web_search 保留兼容。","settings.browser.engine":"浏览器引擎","settings.browser.engineHint":"自动模式会按可用性选择浏览器实现。","settings.browser.searchEngine":"搜索引擎","settings.browser.timeout":"超时","settings.browser.timeoutHint":"单次浏览器命令的最长等待时间(毫秒)。","settings.browser.allowPrivate":"允许浏览器工具打开私网/本机 URL","settings.browser.allowPrivateHint":"默认关闭;browser_navigate 会阻止 localhost、RFC1918 与 link-local 地址。","settings.tab.spaces":"Space","settings.spaces.hint":"管理 ribbon 顶部的 Space。内置 Space 随应用提供、不可移除;你自建或从商店安装的 Space 可卸载(删除其磁盘布局配方)。","settings.spaces.builtin":"内置","settings.spaces.user":"自建/商店","settings.spaces.uninstall":"卸载","settings.spaces.uninstalled":"已卸载「{name}」","settings.spaces.empty":"还没有任何 Space。","settings.spaces.startupTitle":"启动位置","settings.spaces.startupLabel":"打开应用时进入","settings.spaces.startupHint":"默认进入 ribbon 主位槽指着的那个 Space;也可以回到上次退出的 Space 并恢复标签页,或固定进入某一个。","settings.spaces.lastExit":"上次退出的 Space(连同标签页)","settings.spaces.homeSlotStartup":"主位槽的 Space(默认 · 当前是「{name}」)","settings.spaces.homeSlotLabel":"Ribbon 主位槽","settings.spaces.homeSlotHint":"ribbon 竖条正中那一格。默认放主页,也可以换成任何一个 Space;在那一格上右键同样能换。","settings.spaces.hintPhone":"内置 Space 随应用提供、不可移除;你自建或从市场安装的 Space 可卸载(删除其磁盘布局配方)。","settings.spaces.startupHintPhone":"选择打开应用时先进哪个 Space:默认的那个、上次退出的,或固定某一个。","settings.spaces.homeSlotStartupPhone":"默认(当前是「{name}」)","settings.spaces.libraryTitle":"已安装的 Space · {count}","settings.tab.plugins":"插件","settings.tab.amadeusPlugins":"插件","settings.amadeusPlugins.builtinTitle":"内置插件","settings.amadeusPlugins.builtinHint":"随 App 发行、默认开启的能力(浏览器/终端/日历是宿主原生视图,其余是编辑器增强)。关闭即从工作台、命令面板与编辑器中移除 —— 日历连同它的 Space 一起撤下。","settings.amadeusPlugins.externalTitle":"外置插件","settings.amadeusPlugins.changelog":"更新日志","settings.amadeusPlugins.hint":"启用/禁用即时生效,点击插件可查看详情。插件目录:~/.forsion/plugins/(商店安装位置)。插件可捆绑引擎插件/Agent/技能/Space(捆绑包),随本插件一并识别、启停与卸载。","settings.amadeusPlugins.openFolder":"打开插件文件夹","settings.amadeusPlugins.reload":"重新加载","settings.amadeusPlugins.scaffold":"创建示例插件","settings.amadeusPlugins.builtin":"内置","settings.amadeusPlugins.external":"外部","settings.amadeusPlugins.agentOwned":"{agent} 自建 Space","settings.amadeusPlugins.blockedInvalid":"插件清单无效:{reason}","settings.amadeusPlugins.uninstall":"卸载","settings.amadeusPlugins.uninstallConfirm":"确定卸载插件「{name}」?其文件夹将被整体删除;内嵌的引擎插件/Space 一并移除(已播种的 Agent 会保留,可在 Agents 页手动删)。","settings.amadeusPlugins.uninstalled":"已卸载「{name}」","settings.amadeusPlugins.uninstalledRestartPending":"「{name}」文件已删除,但引擎重启未完成——内嵌工具可能仍在运行,请手动重启后端","settings.amadeusPlugins.bundleEngine":"引擎插件 ×{n}","settings.amadeusPlugins.bundleAgents":"Agent ×{n}","settings.amadeusPlugins.bundleSkills":"技能 ×{n}","settings.amadeusPlugins.bundleSpaces":"Space ×{n}","settings.amadeusPlugins.bundleTitle":"捆绑内容","settings.amadeusPlugins.bundleEngineList":"引擎插件:{list}","settings.amadeusPlugins.bundleAgentsList":"Agent:{list}","settings.amadeusPlugins.bundleSkillsList":"技能:{list}","settings.amadeusPlugins.bundleSpacesList":"Space:{list}","settings.amadeusPlugins.bundleHint":"内嵌引擎插件与 Space 随本插件启停/卸载;Agent 首次发现时播种进引擎,之后独立存在(升级不覆盖、卸载保留)。","settings.amadeusPlugins.blockedApi":"需要插件 API v{v},与当前应用不兼容","settings.amadeusPlugins.blockedMinApp":"需要应用版本 ≥ {v}","settings.amadeusPlugins.empty":"还没有任何插件。","settings.amadeusPlugins.back":"返回列表","settings.amadeusPlugins.dep":"依赖应用","settings.amadeusPlugins.depConnected":"已连接 {v}","settings.amadeusPlugins.depMissing":"未检测到,需要安装并运行","settings.amadeusPlugins.depCheck":"检测连接","settings.amadeusPlugins.depInstall":"一键安装","settings.amadeusPlugins.depInstalling":"安装中…","settings.amadeusPlugins.depFail":"安装未完成,可打开官网手动安装","settings.amadeusPlugins.depHomepage":"打开官网","settings.amadeusPlugins.commands":"命令","settings.amadeusPlugins.settings":"设置","plugin.onboarding.title":"插件引导 — {name}","plugin.onboarding.stepsTitle":"就绪步骤","plugin.onboarding.settingsTitle":"必要设置","plugin.onboarding.recommendsTitle":"配套推荐","plugin.onboarding.install":"安装","plugin.onboarding.installed":"已装","plugin.onboarding.installing":"安装中…","plugin.onboarding.notFound":"未在商店上架","plugin.onboarding.later":"稍后","plugin.onboarding.done":"完成","plugin.onboarding.laterHint":"跳过后随时可回 设置 → Forsion 插件,点该插件的「运行引导」继续;前置条件全部满足后「待引导」标记会自己消失。","plugin.onboarding.requiresTitle":"开始前需要","plugin.onboarding.req.ok":"已就绪","plugin.onboarding.req.unmet":"未完成","plugin.onboarding.req.unknown":"暂时无法检查","plugin.onboarding.req.timeout":"检查超时,稍后再试一次。","plugin.onboarding.req.inactive":"启用插件后才能检查这一项。","plugin.onboarding.recheck":"重新检查","plugin.onboarding.checking":"检查中…","plugin.onboarding.allReady":"全部就绪,可以开始用了。","plugin.onboarding.someUnknown":"没有发现未完成的项;另有 {n} 项此刻无法检查。","plugin.onboarding.guideTitle":"使用说明","plugin.onboarding.badge":"待引导","plugin.onboarding.run":"运行引导","plugin.onboarding.nudgeTitle":"「{name}」插件还差几步就绪","plugin.onboarding.nudgeBody":"「{name}」还有前置条件没满足。打开 设置 → Forsion 插件 → {name},点「运行引导」查看缺哪一项。","settings.plugins.npmInstallTitle":"从 npm 安装引擎插件","settings.plugins.npmInstallHint":"输入包名(如 npm:@forsion/tangu-computer-use)。插件以你的完整系统权限运行,只安装信任的来源。","settings.plugins.npmInstallConfirm":"即将从 npm 安装「{spec}」。插件以你的完整系统权限运行,装前请确认来源可信。继续?","settings.plugins.preferMirror":"国内镜像优先","settings.plugins.installBtn":"安装","settings.plugins.installing":"安装中…","settings.plugins.installed":"已安装 {id}@{version}","settings.plugins.empty":"暂无插件","settings.plugins.secForsion":"Forsion 插件","settings.plugins.secEngine":"Tangu 引擎插件","settings.plugins.bundleOwnedHint":"另有 {n} 个引擎插件由上方 Forsion 插件捆绑提供,在对应插件卡片中随插件统一启停。","settings.plugins.selectHint":"选择左侧插件查看其设置","settings.plugins.builtin":"内置","settings.plugins.folder":"文件夹","settings.plugins.needsRestart":"需重启","settings.plugins.needsRestartHint":"新版本已在磁盘上,但它的入口引用了相对路径模块,需重启后端才会运行新版","settings.plugins.waitingDeps":"等待前置插件","settings.plugins.loadFailed":"加载失败","settings.plugins.settling":"正在收尾","settings.plugins.settlingHint":"上一次启动或停用还没结束,结束后会按开关自动生效","settings.plugins.needsDepsToEnable":"需要先安装并启用:{list}","settings.plugins.disableDependents":"停用「{name}」后,依赖它的插件也会暂停:{list}。重新启用后它们会自动恢复。继续吗?","settings.plugins.uninstallDependents":"以下插件依赖「{name}」,卸载后将无法运行:{list}。","settings.plugins.openFolder":"打开插件文件夹","settings.plugins.rescan":"重载插件","settings.plugins.rescanning":"重扫中…","settings.plugins.rescanAdded":"重扫完成:{n} 个插件有变化(新装、更新或移除)","settings.plugins.rescanNone":"重扫完成:没有变化","settings.plugins.rescanHint":"新装入、更新或移除的插件即时生效;入口引用相对路径模块的插件更新后仍需重启后端","settings.plugins.uninstall":"卸载","settings.plugins.uninstallConfirm":"卸载「{name}」?将删除插件文件与全部设置。","settings.plugins.uninstalled":"已卸载「{name}」","settings.plugins.scope":"作用域","settings.plugins.scopeGlobal":"全局","settings.plugins.scopeAgent":"按 Agent","settings.plugins.selectAgent":"选择 Agent","settings.plugins.noSettings":"该插件无可配置项","settings.plugins.saved":"已保存","settings.plugins.import":"导入图片","settings.plugins.deleteConfirm":"删除「{name}」?","settings.plugins.onlyImage":"只能导入图片(png/jpg/gif/webp)","about.versionClickHint":"再点 {n} 次开启开发者模式","about.devUnlocked":"开发者模式已开启","settings.developer.note":"以下选项面向高级用户/调试,一般无需修改。","settings.developer.cloudUrlLabel":"Forsion 云端地址","settings.developer.cloudUrlHint":"大脑服务(记忆/技能/托管模型)的地址。留空则用环境变量 TANGU_CLOUD_URL 或内置默认。托管模式下保存会重启后端使其生效。","settings.developer.cloudUrlPlaceholder":"https://api.forsion.net","settings.developer.saveCloudUrl":"保存","settings.developer.savedRestarting":"已保存,正在重启后端…","settings.developer.saved":"已保存","settings.developer.relaunchLabel":"引导界面","settings.developer.relaunchHint":"重新进入首次安装的引导流程(主题 / 连接 / 模型 / 项目目录)。","settings.developer.relaunch":"重新进入引导","settings.developer.disable":"关闭开发者模式","settings.developer.showSystemPrompt":"回复前显示 system prompt","settings.developer.showSystemPromptHint":"开启后,每条 AI 回复前会显示本条消息发送给模型的完整 system prompt(可展开检查内容与结构);仅本机调试,关闭开发者模式时自动一并关闭。","settings.developer.activeWindow":"前台窗口采样(接缝)","settings.developer.activeWindowHint":"开启后,声明了 activeWindow 能力的插件可以读到「现在焦点在哪个应用」——用来替掉 ActivityWatch 这类外部依赖。数据只留本机。命令面板(⌘K)会多一条「前台窗口采样」调试面板。默认关闭,关闭开发者模式时自动一并关闭。","settings.developer.mobileUiPreview":"移动端 UI 预览命令","settings.developer.mobileUiPreviewHint":"开启后命令面板(⌘K)多一条「切换到移动端 UI」,运行时把桌面壳换成单列移动壳预览(会刷新页面);web 端同样可用。仅本机调试,关闭开发者模式时自动一并关闭。","command.switchToMobileUi":"切换到移动端 UI","command.switchToDesktopUi":"切换回桌面 UI","command.zoomIn":"放大页面","command.zoomOut":"缩小页面","command.zoomReset":"重置页面缩放","chat.systemPrompt":"系统提示词","onboarding.brand.caption":"AI 工作台","onboarding.progress.label":"设置进度","onboarding.phase.connect":"连接账号","onboarding.phase.appearance":"选择外观","onboarding.phase.capabilities":"配置能力","onboarding.phase.workspace":"准备项目目录","onboarding.welcome.kicker":"首次设置","onboarding.welcome.subtitle":"把模型、Agent、知识和本地工具放进同一个应用。","onboarding.welcome.railLabel":"从这里开始","onboarding.welcome.railTitle":"让 Forsion 适合你的工作方式。","onboarding.welcome.railBody":"几分钟内完成基础设置。每一项之后都可以在设置中修改。","onboarding.welcome.promiseModels":"连接 Forsion 或你自己的模型","onboarding.welcome.promiseAgents":"准备可随时切换的 Agent","onboarding.welcome.promiseLocal":"保留本地文件与执行控制权","onboarding.step.connect.title":"连接模型与账号","onboarding.step.connect.description":"登录 Forsion、使用订阅额度,或接入自己的 OpenAI 兼容服务。","onboarding.step.theme.title":"选择界面外观","onboarding.step.theme.description":"设计语言决定结构,主题色决定强调色,背景色决定底色,三者可以自由组合。","onboarding.step.model.title":"选择默认模型","onboarding.step.model.description":"先选一个日常模型,之后可以在每次对话中随时切换。","onboarding.step.speech.title":"配置语音输入","onboarding.step.speech.description":"选择语音识别模型,也可以保持默认并稍后配置。","onboarding.step.agents.title":"认识你的 Agent","onboarding.step.agents.description":"查看现有名册,按需创建一个有专属人格和记忆的助手。","onboarding.step.workspace.title":"选择工作目录","onboarding.step.workspace.description":"为本地会话指定默认目录,Forsion 只在你授权的范围内工作。","onboarding.step.env.title":"检查本机环境","onboarding.step.env.description":"确认编码任务所需工具,并按当前网络环境选择下载源。","onboarding.step.done.title":"一切准备就绪","onboarding.step.done.description":"基础配置已经完成,现在可以进入 Forsion 开始工作。","onboarding.done.cloudLine1":"· 输入栏可随时切换模型与思考档位;笔记、日历与自动化都在 Forsion 里","onboarding.done.cloudLine2":"· 设置 → 外观可随时改主题与语言;桌面版还能连接本机文件与工具","onboarding.connect.modeLabel":"连接方式","onboarding.model.choiceLabel":"默认对话模型","onboarding.speech.choiceLabel":"语音输入","onboarding.workspace.choiceLabel":"默认工作目录","onboarding.connect.forsionHint":"用 Forsion 账号登录(云端地址由环境变量配置,无需填写);也可在上方切换为自带 API Key。","onboarding.connect.skipForNow":"暂时跳过","onboarding.theme.stepLabel":"选择主题外观","onboarding.theme.modeLabel":"明暗模式","onboarding.theme.light":"浅色","onboarding.theme.dark":"深色","onboarding.theme.hint":"随时可在 设置 → 外观 中更改。","onboarding.theme.customSeedLabel":"自定义强调色","settings.theme.system":"跟随系统","settings.theme.modeLocked":"该主题固定跟随系统明暗","settings.theme.modeLockedHint":"Glass 等主题的明暗由系统决定,不可手动切换。","settings.theme.zoomLabel":"界面大小","settings.theme.zoomHint":"缩放整个界面,当前 {percent}%。也可用 ⌘/Ctrl + +/− 按 10% 微调。","settings.theme.zoomPresetLabel":"界面大小预设","settings.theme.zoomSmall":"小","settings.theme.zoomStandard":"标准","settings.theme.zoomLarge":"大","settings.theme.smoothCaret":"丝滑光标","settings.theme.smoothCaretHint":"编辑器与聊天输入框的文字光标平滑滑动到新位置(Word 手感)。默认关闭,需要时手动打开。","settings.theme.promptSuggest":"输入建议","settings.theme.promptSuggestHint":"一轮结束后,在空输入框里用灰字猜你的下一句,按 Tab 填进输入框。每轮会多请求一次模型(复用缓存,开销很小)。默认关闭。","settings.theme.chatAvatars":"聊天头像","settings.theme.chatAvatarsHint":"在对话里显示 Agent 与你的头像。关掉后消息更素净,Agent 名字仍保留。","settings.theme.calmDim":"外围淡出","settings.theme.calmDimHint":"Ribbon、未选中的标签、左侧栏和对话右侧的卡片平时淡一些,指针移过去或键盘焦点进来就恢复。","settings.theme.calmReading":"宽松正文","settings.theme.calmReadingHint":"笔记和对话正文的行距、段距放宽,笔记每行短一些。界面字号和控件大小不变。","settings.theme.calmMotion":"舒缓过渡","settings.theme.calmMotionHint":"切换视图、外围恢复时慢一点。","settings.theme.ribbonAutoHome":"Ribbon 滚动后自动归位","settings.theme.ribbonAutoHomeHint":"用滚轮翻过 Ribbon 以后,点别处或点开一个图标,稍后自动滑回原位。关掉后停在翻到的位置。","settings.theme.ribbonRecent":"Ribbon 中间显示最近使用的 Space","settings.theme.ribbonRecentHint":"在 Ribbon 中间的空当里列出最近用过的几个 Space,最近的在上。位置不够时自动少显示,直到一个不显示。","settings.theme.ribbonRecentOff":"不显示","settings.theme.fontUi":"界面字体","settings.theme.fontBody":"正文字体","settings.theme.fontMono":"等宽字体","settings.theme.fontFollow":"跟随主题","settings.theme.fontSystem":"系统默认","settings.theme.fontHint":"预设字体随应用内置,不依赖本机是否装过,每台设备观感一致。选「跟随主题」则用当前主题自带的字体栈。","settings.theme.fontPreset.inter":"Inter(现代无衬线)","settings.theme.fontPreset.notoSans":"思源黑体 Noto Sans","settings.theme.fontPreset.wenkai":"霞鹜文楷(阅读)","settings.theme.fontPreset.jetbrains":"JetBrains Mono","settings.theme.fontPreset.system":"系统默认","settings.theme.fontGroupBuiltin":"内置","settings.theme.fontGroupPlugin":"插件提供","settings.theme.customSeedLabel":"自定义强调色","settings.theme.customBgLabel":"自定义背景色","settings.theme.customBgFollow":"跟随主题色","settings.theme.customBgClear":"恢复跟随","settings.theme.customBgHint":"不设置时背景由主题色微染;设置后将所选色作为独立氛围种子,并自动调至当前明暗模式的可读范围。","settings.theme.langLabel":"设计语言","settings.theme.visuals":"Intelligent UI","settings.theme.visualsOpt.auto":"自动","settings.theme.visualsOpt.less":"少一点","settings.theme.visualsOpt.off":"关闭","settings.theme.visuals.auto":"按问题组织图文、来源与交互控件,简单问题保持文字回答。","settings.theme.visuals.less":"只在你明确要求图片、图表或交互界面时使用;下一轮生效。","settings.theme.visuals.off":"只用文字回答,不再画卡片;下一次对话起生效。","settings.theme.openFolder":"打开主题文件夹","settings.theme.reload":"重载主题","settings.theme.dropHint":"把 theme.json + theme.css 放进 ~/.forsion/themes/<id>/ 即可装第三方主题,放好后点「重载主题」。","settings.theme.options":"{name} 选项","settings.theme.optionsReset":"重置","settings.theme.skinLabel":"配色","settings.theme.accentLabel":"主题色","settings.theme.bgLabel":"背景色","settings.theme.skin.cream":"经典","settings.theme.skin.coral":"珊瑚","settings.theme.skin.teal":"柔青","settings.theme.skin.lavender":"薰衣草","settings.theme.skin.zhi":"晴蓝","settings.theme.skin.ink":"墨色","settings.theme.skin.custom":"自定义","settings.group.appearance":"外观","settings.group.account":"账户","settings.group.model":"模型","settings.group.agents":"Agent","settings.group.extensions":"扩展","settings.group.appearanceAbout":"外观·关于","settings.group.plugins":"插件","settings.group.advanced":"高级","settings.group.options":"选项","settings.group.workspace":"工作区","settings.group.ai":"AI","settings.group.system":"系统","settings.group.tools":"工具","settings.group.corePlugins":"核心插件","settings.group.communityPlugins":"社区插件","settings.tab.general":"常规","settings.page.generalDescription":"管理工作目录、运行环境与 Forsion 连接状态。","settings.page.spacesDescription":"选择启动位置,查看或移除已安装的 Space。","settings.page.notesDescription":"统一管理附件位置、笔记行为与删除安全选项。","settings.page.syncDescription":"把本地智库同步到远程存储(Dropbox、S3、WebDAV 等)。","settings.page.themeDescription":"预览并组合设计语言、配色、明暗、界面大小与字体。","settings.page.shortcutsDescription":"搜索命令并录制、解绑或恢复快捷键。","settings.page.notificationsDescription":"控制通知出口,以及每类事件与插件是否提醒。","settings.page.statusbarDescription":"选择底部状态项,并拖动调整显示顺序。","settings.page.modelDescription":"选择默认模型,管理提供商、联网搜索与语音能力。","settings.page.agentsDescription":"管理 Agent 名册、后台 Agent 与本机 Agent CLI。","settings.page.skillsDescription":"浏览技能库,导入其他工具中的技能与 MCP 配置。","settings.page.mcpDescription":"连接、启停并维护外部 MCP 工具服务器。","settings.page.hooksDescription":"管理 Agent 运行前后的自动化钩子。","settings.page.channelsDescription":"连接消息通道并集中查看其运行状态。","settings.page.browserDescription":"选择浏览器与搜索引擎,并调整访问安全边界。","settings.page.pluginsDescription":"管理核心能力与已安装插件,查看设置和更新。","settings.page.pluginDescription":"调整该插件提供的功能与运行选项。","settings.page.advancedDescription":"管理本机服务、界面行为、日志与数据安全。","settings.page.developerDescription":"用于调试界面、活动日志与内部功能的开发选项。","settings.page.aboutDescription":"查看版本、更新通道、语言与完整更新日志。","settings.overview.label":"当前状态","settings.overview.mode":"运行模式","settings.overview.backend":"后端服务","settings.overview.account":"Forsion 账号","settings.overview.signedIn":"已登录","settings.overview.signedOut":"未登录","settings.overview.readyTitle":"工作环境运行正常","settings.overview.readyDescription":"后端已连接,可以继续调整工作目录和本机运行选项。","settings.overview.attentionTitle":"工作环境尚未就绪","settings.overview.attentionDescription":"检查后端连接与运行方式,保存后会在这里显示最新状态。","settings.backend.modeDescription":"选择由 Forsion 管理本机服务,或连接你已经部署的后端。","settings.backend.modeManagedDescription":"开箱即用,由桌面端负责启动、检查和重启。","settings.backend.modeExternalDescription":"适合局域网、容器或远程部署的现有服务。","settings.workspace.summary":"新建本地会话时默认使用的位置。","settings.runtime.title":"本机运行环境","settings.runtime.description":"配置代码沙箱、Python 和下载网络,修改后重启后端生效。","settings.runtime.details":"了解 Python 与网络镜像的影响","settings.external.title":"外部后端连接","settings.external.description":"填写服务地址和访问凭证,先测试连接再保存。","settings.theme.previewLabel":"实时外观预览","settings.theme.previewChat":"对话","settings.theme.previewWorkspace":"Forsion","settings.theme.previewTitle":"让想法保持连贯","settings.theme.previewMessage":"当前的设计语言、配色、字体和质感会实时应用到这块预览。","settings.theme.previewInput":"问问 Forsion,或输入 / 使用能力","settings.theme.langDescription":"选择界面的结构、圆角、排版和整体气质。","settings.theme.skinDescription":"主题色与背景色分开选,布局不变;两边选同一个 = 原来的整套配色。","settings.theme.behaviorTitle":"显示与动效","settings.theme.behaviorDescription":"调整明暗、界面大小、层次质感和输入时的反馈。","settings.theme.flatLabel":"阴影","settings.theme.flatOff":"立体","settings.theme.flatOn":"扁平","settings.theme.flatDescription":"立体使用淡阴影,扁平隐藏装饰阴影。","settings.theme.glassDescription":"为支持的表面加入半透明模糊效果。","settings.theme.ambient":"外壳随内容取色","settings.theme.ambientHint":"Genesis 的外围磨砂玻璃跟随当前可见内容的颜色,需要开着毛玻璃。滚动和切换页面时会多占一些性能。","settings.theme.typographyTitle":"字体","settings.sub.connection":"连接","settings.sub.models":"模型","settings.sub.providers":"自定义提供方","settings.sub.webSearch":"联网搜索","settings.sub.voice":"语音","settings.sub.specialAgents":"后台 Agent","settings.sub.mcpServer":"对外 MCP","settings.sub.uiSession":"界面与会话","settings.sub.data":"数据","settings.sub.skillLibrary":"技能库","settings.group.about":"关于","settings.plugins.openSettings":"设置","onboarding.agents.stepLabel":"Agent","onboarding.agents.intro":"Agent 是有自己名字、人格与专属记忆的对话角色——默认 Agent 已就绪,你也可以养一群:工作助手、翻译、陪聊各司其职,聊天时随时切换。之后可在主界面的 Agents 完整管理(头像/模型/工具等)。","onboarding.agents.rosterLabel":"当前名册","onboarding.agents.rosterEmpty":"名册为空(默认 Agent 将在首次对话时就绪)。","onboarding.agents.systemBadge":"后台","onboarding.agents.createLabel":"快速新建(可选)","onboarding.agents.namePlaceholder":"名字,如 秦车","onboarding.agents.personaPlaceholder":"一句话人格与口吻,如 严谨的中文技术编辑,惜字如金","onboarding.agents.createBtn":"创建","onboarding.agents.createHint":"只需名字即可创建;人格描述会成为它的初始设定,之后随时可改。","onboarding.agents.created":"已创建「{name}」,聊天时可在输入框上方切换。","onboarding.agents.createFail":"创建失败:{e}","onboarding.agents.historianTitle":"后台 Agent:Historian(史官)","onboarding.agents.historianDesc":"开启后每隔几轮自动为会话起标题、整理日志与长期记忆——独立模式全自动托管;辅助模式则作为档案助手进入后台子讨论,与你的 Agent 商量后再写。","onboarding.agents.historianSaveFail":"Historian 设置保存失败:{e}","onboarding.agents.moreHint":"触发轮次、提示词与另一位后台 Agent Muse,在 设置 → 后台 Agent 里配置。","onboarding.workspace.stepLabel":"选择默认本地文件夹","onboarding.workspace.hint":"Agent 新建本机会话时的默认工作目录;留空则用智库内的 Sessions 文件夹(无智库时 ~/Forsion)。","onboarding.workspace.placeholder":"~/Forsion(默认)","onboarding.workspace.pick":"浏览文件夹","onboarding.workspace.clear":"清除","settings.advanced.agentDesk":"Agent Desk 演出面板","settings.advanced.agentDeskHint":"聊天右侧的 Agent 演出区,默认开启。Agent 编辑文件时自动在旁边展示正在改的文件;Agent 也可主动把文件、笔记、导图摆上面板给你看,并截图核对自己做的效果。可拖宽度,可收成卡片。","settings.advanced.agentDeskEnable":"启用 Agent Desk","settings.advanced.summaryOpenIn":"任务概览里点文件时","settings.advanced.summaryOpenInHint":"右侧「任务概览」卡片里的来源/产物,点一下开在哪。","settings.advanced.summaryOpenIn.tab":"在新标签页打开","settings.advanced.summaryOpenIn.desk":"在 Agent Desk 展开","desk.title":"Agent Desk","desk.close":"关闭面板","tool.verb.presented":"展示了","tool.verb.sketched":"画了","sketch.mobileUnavailable":"此卡片在移动端 App 暂不可用(请在桌面或网页端查看)。","sketch.expand":"展开卡片","sketch.collapse":"收起卡片","settings.advanced.exportLogs":"导出会话日志","settings.advanced.exportLogsHint":"将当前会话的全部对话内容、界面实际状态与动作轨迹、渲染端错误、后端运行日志打包成一个 JSON 文件,便于开发者排查问题。","settings.advanced.exportBtn":"导出为 JSON","settings.advanced.exportNoSession":"当前没有打开的会话,请先选择一个会话再导出。","settings.advanced.exportOk":"已导出到 {path}","settings.advanced.exportCanceled":"已取消导出","settings.advanced.exportFailed":"导出失败:{err}","settings.clearData.label":"清空数据 / 卸载","settings.clearData.hint":"删除本机上的 Forsion 数据。此操作不可恢复,完成后应用会重启为全新状态。","settings.clearData.tangu":"Tangu 数据与项目目录(账号、设置、Agent、会话、~/Forsion)","settings.clearData.desktop":"桌面设置(窗口与 Amadeus 壳层配置)","settings.clearData.btn":"清空并重启","settings.clearData.confirm":"确定要清空所选数据吗?此操作不可恢复,应用将重启。","settings.clearData.macNote":"这只清除数据;要彻底卸载 Forsion,请把「应用程序」里的 Forsion 拖入废纸篓。","view.changelog":"更新","changelog.newVersion":"发现新版本 {version}","changelog.newest":"最新","changelog.zhOnly":"这一版的更新说明只有中文。","settings.developer.testUpdateLabel":"更新弹窗测试","settings.developer.testUpdate":"打开更新页(测试)","settings.developer.testUpdateHint":"强制弹出更新标签页,用于验证版本更新弹窗渲染是否生效(不依赖真的有新版本)。","input.slash.loop":"最大循环轮数:/loop <轮数>(当前 {current},范围 1-200)","input.slash.loopSet":"最大循环轮数已设为 {n} 轮","input.ctxLabel":"上下文","input.sessionTokens":"本会话 {n} tokens","input.runCost":"本 run 成本 {used}/{limit} 点","cost.nearCap":"⚠ 本 run 成本已达 {used} 点(上限 {limit},TANGU_MAX_RUN_COST 可调),越过上限将自动停止","ctx.compacted.auto":"上下文已自动压缩(节省约 {saved} 字符)","ctx.compacted.forced":"上下文到达自动压缩阈值,已生成摘要压缩","ctx.compacted.overflow":"上下文超出模型上限,已生成摘要压缩并重试本轮","ctx.windowSource.override":"窗口值:手动覆盖表","ctx.windowSource.model":"窗口值:模型自报","ctx.windowSource.family":"窗口值:按模型族推断(非模型自报)","ctx.windowSource.learned":"窗口值:从上游超长报错回学到的真实上限","ctx.windowSource.default":"窗口值:272k 默认兜底(未知模型,可在设置 → 模型里手填)","ctx.windowCapped":"模型最大 {max},默认只用到 {n}","ctx.sec.persona":"人格/指令","ctx.sec.harness":"进化记录","ctx.sec.guidance":"基础指引/契约","ctx.sec.profile":"用户画像","ctx.sec.project":"项目指令","ctx.sec.agentFolder":"专属文件夹/资料","ctx.sec.memory":"长期记忆","ctx.sec.skills":"技能目录","ctx.sec.environment":"环境/工具目录","ctx.sec.hooks":"Hooks 注入","ctx.sec.plan":"计划模式","ctx.sec.history":"历史消息({n} 条)","ctx.files.label":"本局装载的指令文件","ctx.files.truncated":"⚠ 超 32KB 已截断","ctx.files.none":"无(本项目没有 AGENTS.md / CLAUDE.md)","approval.why.customAsk":"按你的审批规则「{rule}」,这一步必须问你","approval.why.escalate":"要写工作区以外的文件 —— 这一档下每次都要你确认(「总允许」对它无效)","approval.why.protected":"要改凭据或 Forsion 本机配置 —— 每次都要你确认(完全通行和「总允许」都不跳过)","approval.why.always":"这个操作每次都要你本人确认(完全通行和「总允许」都不跳过)","approval.why.mode":"当前审批档「{mode}」下,这类操作需要你批准","approval.why.control":"这会设置或修改之后可在你不在场时运行的工作,需要你逐次确认(「总允许」对它无效)","inbox.approval.withdrawnSystem":"系统已撤回这条请求(它存下的内容无法完整显示,或已被同一动作的新请求取代),不能在这里批准。需要的话让 Agent 重新发起。","approval.cmdOverflow":"命令太长,框里没显示完,请滚动看完再批准。","approval.cmdWideBlank":"命令里有一大段空白,可能把后面的内容推出视线;下面是标出空白后的完整内容。","approval.previewScrollHint":"内容较长,请滚动看完再批准。","approval.cmdHiddenChars":"命令里有不可见或会改变显示顺序的字符,看到的文字可能与实际执行的不同。","input.approval.editRules":"编辑规则…","input.approval.editRulesDesc":"按工具名/参数前缀写放行、每次问、拒绝三张名单","approvalRules.loadFailed":"读不到现有规则,先不显示表单 —— 空着保存会把已有的名单整片清掉。","approvalRules.title":"自定义审批规则","approvalRules.scopeNote":"⚠ 规则是全局的 —— 存在 ~/.forsion/config.json,所有会话共用;审批档才是按会话选的。保存后下一次工具调用即生效,不用重启。","approvalRules.syntax":"写法:工具名,或 工具名* 前缀通配,可再跟:参数前缀(跑命令比命令、写文件比路径)。例:web_fetch | mcp__* | run_bash:npm test | write_file:/etc/","approvalRules.base":"兜底档","approvalRules.baseHint":"一条规则都没命中时按这一档判(优先级:拒绝 > 每次问 > 放行 > 兜底档)","approvalRules.deny":"拒绝","approvalRules.denyHint":"直接拒掉,不问你。模型会看到是哪条规则挡的。","approvalRules.denyPh":`write_file:/etc/
291
+ run_bash:rm -rf`,"approvalRules.ask":"每次问我","approvalRules.askHint":"一律弹审批,「总允许」对它无效(你写下的就是「永远问我」)。","approvalRules.askPh":`run_bash:npm publish
292
+ browser_task`,"approvalRules.allow":"放行","approvalRules.allowHint":"不问直接执行,压过兜底档。但工作区外的写入仍要确认(兜底档为「完全放行」时除外)—— 放行规则只有带绝对路径前缀、且本次所有写入目标都落在该路径之内,才免这一问(例:write_file:/Users/you/proj/)。⚠ 写宽了(如 run_bash 或 *)除上面那一问外照样整片免问,所有用自定义档的会话都生效。","approvalRules.allowPh":`web_fetch
293
+ mcp__*`,"pill.thinkUnsupported":"(本模型不支持,将自动降档)","input.compact":"压缩上下文","input.compacting":"正在压缩上下文…","input.compactDone":"已压缩上下文(折叠 {n} 条消息为摘要,后续从此精简续接)","input.compactSkip":"无需压缩:{reason}","input.compactFail":"压缩失败:{e}","input.slash.compact":"压缩上下文:总结后精简续接","input.slash.voiceOn":"切到语音消息(该 Agent 回复变语音)","input.slash.voiceOff":"切回文字消息","input.slash.voiceOnHint":"已切到语音消息:该 Agent 之后的回复会以语音呈现(桌面语音条;微信端文字外附一份语音文件)。","input.slash.voiceOffHint":"已切回文字消息。","voice.play":"播放","voice.pause":"暂停","voice.label":"语音","voice.toText":"转文字","voice.toggleFailed":"语音模式切换失败:{e}","input.slash.stop":"停止当前运行","input.slash.skillUse":"本条消息使用技能 {name}","input.skillChipTitle":"本条消息将使用此技能","input.slash.agent":"选用 Normal Agent(自定义人格)","input.agentActive":"当前 Agent:{name}","input.agentCleared":"已取消 Normal Agent","input.engineDefault":"Tangu","input.engineChipTitle":"运行引擎","input.engineSection":"运行引擎","input.engineModelDefault":"用引擎默认","engine.pickTitle":"选择运行此对话的 Agent","engine.warming":"正在启动 {name}…","pill.more":"更多(翻页)","header.currentAgent":"当前 Agent","settings.tab.agentClis":"本机 Agent CLI","settings.agentClis.title":"外部 Agent CLI","settings.agentClis.hint":"检测到的第三方 Agent(Claude Code / Codex 等);可设默认模型。新会话开始时才能选用它们。","settings.agentClis.detected":"已检测到","settings.agentClis.needsSignin":"需登录","settings.agentClis.notDetected":"未检测到","settings.agentClis.notDetectedHint":"安装并登录该 Agent 后自动出现。","settings.agentClis.defaultModel":"默认模型","settings.agentClis.modelDefault":"(用引擎默认)","settings.agentClis.loadingModels":"加载模型…","settings.agentClis.empty":"无外部 Agent 引擎(仅本机形态可用)。","settings.agentClis.importHint":"导入后复制成 Tangu 自有技能/MCP(卸载该 CLI 也不丢);MCP 默认不启用,到 MCP 设置里开启。","settings.agentClis.skillsLabel":"已装技能","settings.agentClis.mcpLabel":"已装 MCP","settings.agentClis.importBtn":"导入","settings.agentClis.imported":"已导入","settings.tab.agents":"Agent","settings.agents.title":"Normal Agent(自定义人格)","settings.agents.hint":"为不同任务定义可复用的对话人格(system prompt + 模型 + 设置)。也可让 Agent 用 manage_agent 工具自创建。","settings.agents.new":"新建 Agent","settings.agents.createViaChat":"让 AI 帮我配置","settings.agents.createViaChatHint":"开一个新会话,用对话的方式让 Agent 帮你把新 Agent 建出来","settings.agents.empty":"暂无 Agent,点「新建 Agent」创建一个。","settings.agents.name":"名称","settings.agents.namePlaceholder":"如:代码审查员","settings.agents.desc":"简介","settings.agents.model":"模型(留空=用会话模型)","settings.agents.modelDefault":"(用会话模型)","settings.agents.systemPrompt":"开发指令(做什么 / 怎么做 / 必读什么)","settings.agents.systemPromptPlaceholder":"你是一位严谨的代码审查员……","settings.agents.thinking":"思考档位","settings.agents.maxIter":"最大循环轮数","settings.agents.approval":"审批档","settings.agents.inherit":"(继承)","settings.agents.byAgent":"Agent 创建","agent.badge.system":"后台","settings.agents.deleteConfirm":"删除 Agent「{name}」?","settings.agents.saveFail":"保存失败:{e}","settings.agents.cloudOnly":"Normal Agent 仅在本地(桌面/TUI)可用。","settings.agents.soul":"人格设定(SOUL)","settings.agents.soulPlaceholder":'沉静、专注;说话简洁,默认中文……(语气与价值观,区别于"做什么"的开发指令)',"settings.agents.shareMemory":"共用默认 Agent 的记忆和日志","settings.agents.shareMemoryHint":"开启后该 Agent 读写默认 Agent 的记忆/日志;默认关闭=有专属自己的记忆/日志。","settings.agents.cloudSync":"云同步(跨设备镜像)","settings.agents.cloudSyncHint":"开启后该 Agent 的全部文件(定义/记忆/日志/Library)在你的设备间完全镜像,新内容覆盖旧的;默认关闭=纯本地。","settings.agents.cloudSyncOn":"云同步:已开启","settings.agents.cloudSyncOff":"云同步:已关闭","settings.agents.activityAccess":"允许读取活动日志","settings.agents.activityAccessHint":"授权该 Agent 使用 read_activity 查看你的应用内操作记录;默认关闭=仅 Muse 可读。","settings.agents.toolPolicy":"工具黑白名单","settings.agents.toolPolicyNone":"不限制(全部可用)","settings.agents.toolPolicyDeny":"黑名单:取消勾选=禁用,引擎新增工具默认可用","settings.agents.toolPolicyAllow":"白名单:仅勾选的可用,引擎新增工具默认禁用","settings.agents.toolPolicyHint":"勾选=允许使用。仅约束下列常规工具;带权限门禁的工具(如 read_activity)不受名单影响。","settings.agents.toolPolicyEmpty":"工具目录不可用(需本地引擎在运行)。","settings.agents.avatar":"头像","settings.agents.avatarHint":"点击上传,≤1MB(PNG/JPG/GIF/WebP);存入该 Agent 的 Library。","settings.agents.avatarPick":"上传头像","settings.agents.avatarRemove":"删除头像","settings.agents.avatarTooLarge":"图片超过 1MB,请换更小的。","settings.agents.avatarSaveFirst":"请先保存 Agent,再设置头像。","settings.tab.shortcuts":"快捷键","settings.shortcuts.desc":"点击某条右侧的快捷键开始录制,按下组合键即设定;Esc 取消。同一组合键只会绑定到一个命令。","settings.shortcuts.commands":"命令与快捷键 · {count}","settings.shortcuts.searchPlaceholder":"搜索命令或快捷键","settings.shortcuts.resultCount":"显示 {count} 项","settings.shortcuts.noResults":"没有匹配的命令。","settings.shortcuts.commandPalette":"命令面板","settings.shortcuts.record":"点击录制快捷键","settings.shortcuts.recording":"按下组合键…","settings.shortcuts.reset":"恢复默认","settings.shortcuts.clear":"解绑","settings.shortcuts.unbound":"未设置","settings.shortcuts.resetAll":"全部恢复默认","settings.shortcuts.reassigned":"已从「{name}」解绑该快捷键","tool.verb.wrote":"写入","tool.verb.edited":"编辑","tool.verb.ran":"运行","tool.verb.read":"读取","tool.verb.listed":"列出","tool.verb.searched":"搜索","tool.verb.browsed":"浏览","tool.sum.wrote":"写入 {n} 文件","tool.sum.edited":"编辑 {n} 文件","tool.sum.ran":"运行 {n} 命令","tool.sum.read":"读取 {n} 项","tool.sum.searched":"搜索 {n} 次","tool.sum.browsed":"浏览 {n} 次","tool.sum.other":"{n} 个工具","settings.agents.isDefault":"默认","settings.agents.setDefault":"设为默认","settings.agents.viewMem":"查看大脑(记忆 / 日志 / 资料库)","settings.agents.brainSection":"大脑(记忆 / 日志 / 资料库)","settings.agents.brainSectionHint":"查看与编辑该 Agent 的长期记忆、按日日志和资料库文件。","settings.agents.openBrain":"打开大脑","settings.agents.memTitle":"{name} · Agent 大脑","settings.agents.memory":"长期记忆(MEMORY.md,可编辑)","settings.agents.memSaved":"已保存","settings.agents.log":"日志(LOG,可编辑)","settings.agents.noLog":"暂无日志","settings.agents.tabMemory":"记忆","settings.agents.tabLog":"日志","settings.agents.tabLibrary":"资料库","settings.agents.library":"资料库(Library/,参考资料 + 头像)","settings.agents.libraryEmpty":"暂无文件","settings.agents.libraryUpload":"上传文件","settings.agents.librarySelectHint":"点击文件查看 / 编辑","settings.agents.libraryBinaryHint":"二进制文件,仅预览","settings.agents.libraryDeleteConfirm":"删除文件「{name}」?","settings.agents.libraryTooLarge":"文件超过 5MB","settings.agents.userProfile":"用户画像(USER.md,所有 Agent 可见)","settings.agents.userProfileHint":"记录你的名字、偏好、水平、长期需求;所有 Agent 都会读到。","settings.agents.tabHarness":"进化史","settings.agents.harnessHint":"进化记录是 Agent 自我进化的内容:它从工作中自己总结的做法,以及它收起的装备。它自己写入立即生效,对话里会出现一张可撤销的更新卡;后台复盘和 Muse 的用量巡检也会直接写入,条目上标着来源,都可以在这里撤销。每次运行都会带上。","settings.agents.harnessEmpty":"还没有进化记录。Agent 自己摸索出的耐久做法会记在这里(它当场写,或由后台复盘写入);也可以在它的会话里输入 /refine 让它专门复盘一次。","settings.agents.harnessEvidence":"证据:{text}","settings.agents.harnessKindNote":"笔记","settings.agents.harnessKindRecipe":"做法","settings.agents.harnessKindEquip":"装备","settings.agents.harnessShelvedTools":"收起的工具:{names}","settings.agents.harnessShelvedSkills":"收起的技能:{names}","settings.agents.harnessCount":"{count} / {max} 条进化记录","settings.agents.harnessLastChange":"最近进化:{time}","settings.agents.harnessRefine":"复盘本次对话","settings.agents.harnessRefineSent":"已开始复盘,进度在对话里。","settings.agents.harnessShowAll":"显示全部 {count} 条","settings.agents.harnessLoading":"正在读取进化记录…","settings.agents.harnessLocalOnly":"进化记录仅在本机引擎可用。","settings.agents.harnessHistory":"编辑历史(本机)","settings.agents.harnessRollback":"撤销最近一次改动","settings.agents.harnessRestore":"恢复","settings.agents.harnessRollbackConfirm":"撤销「{title}」的最近一次改动?(再次撤销可还原)","settings.agents.harnessActCreate":"新建","settings.agents.harnessActUpdate":"修改","settings.agents.harnessActDelete":"删除","settings.agents.harnessActRollback":"回滚","settings.agents.harnessByHistorian":"后台复盘写入","settings.agents.harnessByMuse":"Muse 代为收起","settings.agents.harnessByUser":"你采纳的候选","settings.agents.harnessCandidates":"{count} 条候选","settings.agents.harnessCandidateNeedsYou":"等你确认","settings.agents.harnessCandidateAdopt":"采纳","settings.agents.harnessCandidateDismiss":"丢弃","settings.agents.harnessCandidateAdopted":"已采纳,写进了进化记录。","settings.agents.harnessCandidateDismissed":"已丢弃。","settings.agents.harnessCandidateGone":"这条候选已经不在了,已重新载入。","settings.agents.harnessCandidateFull":"进化记录已满({max} 条)。先撤掉或合并几条,再采纳。","settings.agents.harnessCandidateTooLong":"这条候选太长,一条记录放不下。可以丢弃,或让 Agent 自己改写后再记。","settings.agents.harnessCandidatesHint":"Historian 提名、但没有直接写进进化记录的做法。带网址、命令或权限字眼的由你逐条决定:采纳就写入,丢弃就删掉;其余的在复盘时由 Agent 逐条审阅,你也可以直接采纳或丢弃。","settings.agents.selfAuthored":"自建","settings.agents.sharedSkill":"共享","agent.pickTitle":"选择 Agent","settings.tab.special":"后台 Agent","settings.special.title":"后台特殊 Agent(Special Agents)","settings.special.hint":"默认开启;手动关闭后不会被自动打开。不选模型时跟随云端默认;其记录隔离存于本地,不进会话列表。","settings.special.pickModelFirst":"请先选模型再开启","settings.special.followCloudDefault":"跟随云端默认({model})","settings.model.imageCloudDefaultTag":"云端默认","settings.model.imageFollowingDefault":"未手动选择,当前跟随云端生图默认:{model}。点击任一模型可改为手动指定,再点一次取消。","settings.special.model":"模型","settings.special.enable":"启用","settings.special.historian":"Historian(历史员)","settings.special.historianDesc":"每 X 轮总结会话标题;每 Y 轮判断并更新你的 LOG 与记忆。","settings.special.muse":"Muse(缪斯)","settings.special.museDesc":"后台常驻:按心跳、日程、规则醒来,在自己的 Library 里做事;越界操作按权限档处理,产出进收件箱和 Muse Space。","settings.special.h.rounds":"每几轮维护(标题+记忆)","settings.special.h.firstRound":"首轮必触发","settings.special.h.harnessCandidates":"自进化自动档","settings.special.h.harnessCandidatesHint":"判官从对话里提名 Agent 自己摸索出的做法:像一条工作方法的直接写进它的进化记录;带网址、命令或权限、凭据字眼的留在候选里,等你在详情「进化」里逐条采纳或丢弃。写进去时正在看的会话会弹通知,可在详情「进化」里查看或撤销。","settings.special.h.prompt":"记忆判断提示词(留空=默认)","settings.special.m.maxIter":"每周期最多轮数","settings.special.m.maxTodos":"每窗口最多 TODO","settings.special.m.activeHours":"运行时段(本机时间)","settings.special.m.activeAllDay":"全天","settings.special.m.persona":"人格与指令在 Agent 名册的「Muse」里编辑。","settings.special.m.folders":"额外文件夹(每行一个绝对路径)","settings.special.m.foldersHintAsk":"审批 / 代批档:只是提示 Muse 去看这些目录,写入仍按权限档排队审批。","settings.special.m.foldersHintAuto":"全开档:这些目录可直接读写。","settings.special.m.secRhythm":"节奏","settings.special.m.budget":"预算","settings.special.m.budgetWindow":"预算窗口(小时)","settings.special.m.maxCycles":"每窗口最多周期","settings.special.h.mode":"工作模式","settings.special.h.modeIndependent":"独立","settings.special.h.modeAssist":"辅助","settings.special.h.modeFork":"分身","settings.special.h.modeHintIndependent":"Historian 用上方模型读取最近对话记录,自行判断并维护标题、摘要、日志与记忆。","settings.special.h.modeHintAssist":"到点后分支出一场简短的后台讨论,与该会话的 Agent 商议,由主 Agent 自己决定并写入;标题/摘要仍由 Historian 维护,首轮始终独立。","settings.special.h.modeHintFork":"用会话模型在完整上下文的尾部分叉一次补全来做判断——上下文缓存可命中,比独立模式看得更全;失败自动回落独立模式。上方模型仅用于回落判断与记忆整固。","settings.special.h.fallbackModel":"回落 / 整固模型","settings.special.saved":"已保存","settings.special.saveFail":"保存失败:{e}","settings.special.on":"启用","settings.special.off":"关闭","settings.special.custom":"自定义","settings.special.sectionTitle":"后台 Agent(Special Agents)","settings.agents.sectionTitle":"Normal Agent(自定义人格)","settings.agents.starterTemplate":"你是……(在此描述这个 Agent 的身份、专长与说话风格,以及它应如何完成任务)。","sidebar.special.title":"后台 Agent","special.action.title_updated":"更新标题","special.action.summary_updated":"更新摘要","special.action.log_appended":"写入日志","special.action.memory_appended":"写入记忆","special.action.memory_updated":"更新记忆","special.action.assist_discussion":"发起记忆讨论","special.muse.title":"Muse 工作区","special.muse.thinking":"当前思考","special.muse.idle":"Muse 空闲中","special.muse.running":"Muse 思考中…","special.muse.disabled":"Muse 未开启(在设置 → 后台 Agent 中开启并选模型)。","special.muse.todos":"Muse TODO 清单","special.muse.todosEmpty":"暂无 TODO。Muse 会在后台思考后提交高价值待办。","special.muse.selectAll":"全选","special.muse.inject":"注入所选到会话并运行","special.muse.pickSession":"选择目标会话…","special.muse.injected":"已注入 {n} 条到会话并开始运行","special.muse.dismiss":"忽略","special.muse.markDone":"标记完成","special.muse.injectFail":"注入失败:{e}","special.muse.watches":"盯任务","special.muse.watchesAll":"全部自动化 →","special.muse.watchesHint":"在任意聊天里说「帮我盯着 xxx.md 写满 100 字」即可设定;条件命中时 Muse 会被唤醒并提出待办。","special.muse.trigFile":"「{path}」达到 {n} 字","special.muse.trigEvent":"活动包含「{match}」","special.muse.trigDaily":"每天 {time}","special.muse.trigFired":"上次触发 {t}","special.muse.watchDelete":"删除规则","special.muse.approvals":"待批准","special.muse.approvalsEmpty":"没有等待你批准的操作。","special.muse.approve":"批准并执行","special.muse.reject":"拒绝","special.muse.approveFail":"批准失败:{e}","special.muse.approvalNote":"默认 Agent 代批意见:{note}","special.muse.runNew":"新会话执行所选","special.muse.injectPrefix":"请处理以下来自 Muse 的待办:","muse.lib.openEditor":"在编辑器中打开","special.muse.tracks":"追踪中","special.muse.tracksEmpty":"没有正在追踪的任务。在聊天里的任务卡上点「交给 Muse 追踪」即可添加。","special.muse.trackDelete":"停止追踪","special.muse.modeLabel":"权限档","special.muse.pending":"{n} 项待批","space.muse":"Muse","muse.builtinDesc":"Muse Space:Muse 自建的 Space(它自己写的 Forsion 插件,逐周期迭代),右栏批准它的越界操作;还没搭建时显示它的工作区。","view.museLibrary":"Muse 工作区","view.museHome":"Muse Space","muse.openLibrary":"打开 Muse 工作区","view.musePanel":"Muse","muse.lib.empty":"Muse 还没写任何东西。开启 Muse 后,它的笔记、草稿和每日工作日志会出现在这里。","muse.lib.refresh":"刷新","chat.task.here":"在此执行","chat.task.new":"新会话执行","chat.task.muse":"交给 Muse 追踪","chat.task.ignore":"忽略","chat.task.trackTag":"追踪","chat.task.tracked":"已交给 Muse 追踪(日历里可见)","chat.task.trackFail":"交给 Muse 失败:{e}","chat.task.doneHere":"已在此执行","chat.task.doneNew":"已在新会话执行","chat.task.doneMuse":"已交给 Muse 追踪","chat.task.doneIgnore":"已忽略","chat.task.showPrompt":"查看任务书","chat.task.hidePrompt":"收起任务书","chat.task.tooLong":"任务书超过 4000 字,无法交给 Muse 追踪;请拆小,或在此 / 新会话执行。","chat.task.museDo":"交给 Muse 执行","chat.task.doneMuseDo":"已交给 Muse 执行","chat.task.handedDo":"已交给 Muse:它下次运行时处理(受运行时段和预算限制),超出权限的操作会再请你审批","chat.task.museOff":"Muse 已关闭:先在设置里开启它,或改用新会话执行","chat.task.todoSyncFail":"待办状态没同步上:{e}","chat.task.doneTodo":"这条待办已经处理过了","chat.task.todoChecking":"正在确认这条待办的状态…","chat.task.todoCheckFail":"待办状态读取失败","chat.task.todoMissing":"这条待办已不存在","special.muse.actionFail":"操作失败:{e}","special.muse.execFailed":"已批准,但执行失败:{e}","settings.special.m.mode":"权限档","settings.special.m.modeAsk":"审批(越界操作排队等你批准)","settings.special.m.modeAgent":"代批(默认 Agent 替你裁决一次)","settings.special.m.modeAuto":"全开(完全自动)","settings.special.m.modeDesc":"三档都能在 Muse 自己的 Library 里自由工作;越界写入与命令按档位处理,插件安装始终需要你确认。","settings.special.m.heartbeat":"心跳间隔(分钟,0=只按日程/规则醒来)","settings.special.m.heartbeatHint":"比巡检更细时巡检自动跟着缩到这个粒度;实际次数仍受预算里「每窗口最多周期」封顶。","settings.special.m.notify":"通知","settings.special.m.notifyMode":"发送方式","settings.special.m.notifyImmediate":"即时","settings.special.m.notifyDigest":"日报","settings.special.m.escalateTo":"难活交给","settings.special.m.escalateNone":"不指定","settings.customProvider.fetchModels":"拉取模型","settings.customProvider.fetchEmpty":"未发现模型(端点未返回列表)","sidebar.search.placeholder":"搜索会话…","sidebar.search.noResults":"无匹配会话","sidebar.deleteConfirm":"永久删除会话「{name}」?此操作不可恢复。","chat.action.quote":"引用","chat.action.askInPanel":"在侧栏提问","chat.selection.actions":"选中文本操作","chat.error":"运行出错","chat.llmRetrying":"网络波动,{s} 秒后自动重试(第 {n}/{max} 次)","chat.err.network":"无法连接模型服务(网络不通或服务未启动)","chat.err.dropped":"连接中途断开(网络波动),回复未完成","chat.err.timeout":"请求超时,网络或模型响应过慢","chat.err.auth":"鉴权失败,请检查 API Key 或登录状态","chat.err.rate":"请求被限流,请稍后重试","chat.err.server":"模型服务端错误,请稍后重试","chat.err.quota":"AI 额度已用尽:点左下角头像可查看用量、使用重置卡立即恢复,或升级会员提高上限","chat.err.runCost":"本次运行成本达到上限,已自动停止","chat.err.inputTooLarge":"输入内容过长,超出模型可处理范围,请精简后重试","chat.err.groupAgents":"团队模式至少需要 2 个有效的 Agent","chat.err.orphaned":"运行意外中断(应用重启或进程退出),请重试","chat.err.engineRemote":"外部引擎不能从远程设备驱动,请回到那台电脑上继续这段对话","chat.edit.saveResend":"保存并重发","group.voting.inProgress":"正在投票…","workbench.chat":"对话","workbench.leftSidebar":"左侧栏","workbench.rightSidebar":"右侧栏","theme.changeSkin":"切换主题色","theme.changeMode":"切换明暗模式","theme.changeLanguage":"切换主题外观","command.palette":"命令面板 (⌘K)","command.search":"搜索","command.toggleSmoothCaret":"开关丝滑光标","command.toggleLeft":"切换左侧栏","command.toggleRight":"切换右侧栏","command.toggleBottom":"切换底部面板","panel.emptyTitle":"空面板","panel.empty":"这个面板是空的,把标签页拖进来试试。","command.splitRight":"分屏到右侧","command.resetLayout":"恢复默认布局","command.stop":"停止当前运行","command.compact":"压缩上下文","command.branch":"从最近回复分支","command.saveLayout":"保存命名布局","command.applyLayout":"恢复命名布局","layout.namePrompt":"布局名称","layout.saved":"已保存布局「{name}」","layout.none":"还没有已保存的命名布局","layout.applyPrompt":"输入要恢复的布局名称:{names}","status.context":"上下文","header.connecting":"连接中…","command.placeholder":"运行命令…","command.empty":"没有命令","command.select":"选择","command.run":"运行","command.count":"{count} 条命令","group.host":"主持人","special.agents.title":"后台 Agent","special.memory.title":"记忆","sidebar.special.historianSub":"总结标题 · 维护记忆","sidebar.special.museSub":"后台思考 · 产出 TODO","sidebar.wechat.setConnectedOk":"已设为微信正在连接的会话。","sidebar.wechat.setConnectedFail":"设置失败:{e}","preview.close":"关闭","preview.expand":"展开","preview.collapse":"收起","preview.download":"下载","preview.notFound":"文件不存在","preview.loadFailed":"加载失败","preview.notAvailable":"此文件类型无法预览","preview.tooLarge":"文件过大({size}),不支持预览","preview.htmlPreview":"预览","view.wsfile":"文件预览","preview.openWithDefault":"用默认应用打开","preview.unsupportedAsk":"无法预览此类型,用系统默认应用打开?","preview.expired":"预览内容已过期(此类预览不随重启保留),请从来源重新打开","preview.mdEdit":"编辑","preview.openInAmadeus":"在 Amadeus 中打开","preview.mdConflict":"文件已被外部修改","preview.mdReload":"重新加载","preview.mdOverwrite":"覆盖写入","preview.mdSaveFail":"保存失败:{err}","preview.mdSalvaged":"文件已被外部修改,你的编辑已另存为「{file}」","panel.toast.invalidName":"非法的名字:{name}","panel.action.open":"打开","panel.action.newFile":"新建文件","panel.action.newFolder":"新建文件夹","panel.action.copyPath":"复制路径","preview.htmlCode":"源码","preview.reload":"重新加载","preview.openInBrowser":"在浏览器中打开(同一预览服务器,可用本人账号调 Forsion AI)","preview.csvTruncated":"仅显示前 {shown} 行(共 {total} 行)","preview.slide":"幻灯片 {n}","preview.wrap":"自动换行","preview.zoomIn":"放大","preview.zoomOut":"缩小","preview.fit":"适应","preview.diffSideBySide":"并排","preview.diffLineByLine":"逐行","preview.pdfPages":"仅渲染前 {n} 页(共 {total} 页),下载查看全部","panel.action.preview":"预览","panel.action.deleteN":"删除 {n} 项","panel.confirm.trashN":"把选中的 {n} 项移到回收站?","panel.confirm.delete":"删除「{name}」?","panel.confirm.deleteN":"删除选中的 {n} 个文件?","panel.toast.copied":"已复制 {n} 项到工作区","panel.toast.copyFail":"复制失败:{err}","panel.toast.moveFail":"移动失败:{err}","settings.tab.notifications":"通知","settings.tab.statusbar":"状态栏","ntf.enable":"启用通知","ntf.delivery":"通知方式","ntf.enableHint":"右上角弹出的悬浮小卡片;关闭后所有通知静默(错误也不弹)。","ntf.osEnable":"系统通知","ntf.osEnableHint":"应用切到后台时,同步弹一条系统通知(所有通知类型,不止收件箱)。","ntf.sendTest":"发送测试通知","ntf.testBody":"这是一条测试通知 👋","ntf.events":"通知事件","ntf.eventsHint":"只保留需要关注的事件,减少无效打扰。","ntf.event.system":"系统消息","ntf.event.syncError":"同步失败 / 冲突","ntf.event.syncDone":"远程同步完成","ntf.event.syncDoneOnline":"在线同步完成","ntf.event.agentDone":"后台会话完成","ntf.event.inbox":"收件箱新消息","ntf.event.noteReminder":"笔记提醒(@remind:)","ntf.event.harnessCandidates":"进化记录的后台更新与候选","ntf.event.projectCandidates":"项目记忆里等你确认的候选","ntf.event.projectCompacted":"项目记忆写满后被压缩","ntf.pluginEvents":"插件通知","ntf.pluginEventsHint":"每个插件一个开关(ctx.notify 的来源;关掉即静音该插件)。","ntf.view":"查看","ntf.syncError":"在线同步失败:{e}","ipcerr.notLoggedIn":"未登录 Forsion 账号","ipcerr.loginExpired":"登录已失效,请重新登录 Forsion 账号","ipcerr.vaultMissing":"智库目录不存在:{detail}","ipcerr.mirrorMissing":"镜像目录不存在(已有同步记录,不会自动新建空目录):{detail}","ipcerr.scanFailed":"本地目录读取失败,本轮不推断删除:{detail}","ipcerr.invalidSpaceId":"非法的 Space 标识","ipcerr.invalidPluginId":"非法的插件标识","ipcerr.notUserPlugin":"插件不在用户目录(内置 / 首方插件不可卸载)","ipcerr.pluginNotFound":"插件不存在","ipcerr.mcpNameReserved":"MCP 服务名「{detail}」是保留名:dev 与 dev_ 开头的名字留给设备工具,请换一个名字","settings.discovery.mcpReserved":"未导入 {names}:dev 与 dev_ 开头的 MCP 服务名留给设备工具。换个名字后可在 MCP 页手动添加。","ntf.syncDone":"在线同步完成","ntf.noteReminder":"提醒 · {src}","ntf.remoteSyncDone":"远程同步完成:{n} 项变更","ntf.remoteSyncFail":"远程同步失败:{e}","ntf.remoteSyncConflicts":"远程同步冲突:{n} 项待处理","ntf.remoteSyncPendingDel":"远程同步:{n} 项删除待确认","ntf.actionReview":"去处理","ntf.agentDone":"「{name}」已完成","ntf.agentFail":"「{name}」运行失败","ntf.harnessCandidates":"「{name}」有新的进化记录候选,复盘一下?","ntf.harnessConfirm":"「{name}」有进化记录候选等你确认:它们带网址、命令或权限字眼,后台没有直接写。","ntf.projectCandidates":"项目「{name}」有后台记下的事实等你确认:它们带网址、命令或权限字眼,没有直接记进项目记忆。","ntf.projectCompacted":"项目「{name}」的记忆写满了,Agent 已把它压缩一遍再记新的。被合并或去掉的原句可以在项目详情里逐句恢复。","ntf.actionRefine":"复盘","ntf.actionView":"查看","ntf.harnessAdopted":"「{name}」的进化记录新增了后台复盘出的做法:{titles}。可在「进化」里查看或撤销。","sb.enable":"显示状态栏","sb.display":"显示方式","sb.enableHint":"窗口底部一条细栏,按当前视图显示同步 / 反链 / 字数等信息。默认关闭;同步出错时会临时出现,只显示同步状态。","sb.items":"状态栏","sb.itemsHint":"取消勾选即隐藏;拖动调整顺序(插件项启用后自动出现在列表里)。","sb.side.left":"前","sb.side.right":"后","sb.item.space":"当前 Space","sb.item.agentRunning":"运行中的会话","sb.item.sync":"同步状态","sb.item.backlinks":"反向链接","sb.item.wordCount":"字数统计","sb.item.inbox":"收件箱未读","sb.agentRunning":"{n} 个运行中","sb.synced":"已同步","sb.syncing":"同步中 · {n}","sb.syncingPlain":"同步中…","sb.syncProgress":"同步 {done}/{total}","sb.syncError":"同步异常","sb.syncOffline":"离线","sb.chars":"{n} 字","sb.backlinks":"{n} 反链","amadeus.default.note":"未命名","amadeus.default.dashboard":"未命名仪表盘","amadeus.default.drawing":"未命名白板","amadeus.default.database":"未命名多维表","amadeus.default.folder":"新文件夹","amadeus.default.section":"新分区","amadeus.default.pdfBookmark":"第 {page} 页","amadeus.new.note":"新建笔记","amadeus.new.childNote":"新建子笔记","amadeus.new.dashboard":"新建仪表盘","amadeus.new.dashboardIn":"在「{folder}」中新建仪表盘","amadeus.new.drawing":"新建白板","amadeus.new.drawingIn":"在「{folder}」中新建白板","amadeus.new.folder":"新建文件夹","amadeus.new.folderIn":"在「{folder}」中新建文件夹","amadeus.new.database":"新建 Base","amadeus.new.databaseIn":"在「{folder}」中新建 Base","amadeus.exists":"「{name}」已存在","amadeus.cmd.quickSwitch":"快速切换笔记","amadeus.cmd.search":"搜索笔记(全文)","amadeus.cmd.tutorial":"打开使用教程","amadeus.cmd.manual":"打开使用手册","amadeus.cmd.dailyNote":"打开今天的日记","amadeus.cmd.toggleStar":"收藏 / 取消收藏当前笔记","amadeus.cmd.toggleSource":"切换 源码 / 可视 编辑","amadeus.cmd.openVault":"打开智库…","amadeus.cmd.reveal":"在文件管理器中显示当前笔记","amadeus.cmd.reindex":"重建全文索引","amadeus.cmd.toggleWikiFiles":"切换 双链补全是否包含附件与多维表","amadeus.cmd.wikiFilesOn":"双链补全已包含附件与多维表","amadeus.cmd.wikiFilesOff":"双链补全只包含笔记"},Td={"common.save":"Save","chat.wait.sending":"Sending context ({kb} KB)","chat.wait.firstToken":"Waiting for the model","chat.wait.describing":"This model can’t view images, so they are being transcribed to text ({n}). A model with image input skips this step","chat.wait.elapsed":"{s}s elapsed","settings.python.label":"Python","settings.python.bundled":"Bundled (recommended)","settings.python.system":"System","settings.python.hint":"Bundled: no install, isolated from your own Python. System: use your installed python (restart backend to apply).","settings.mirror.label":"Network mirror","settings.mirror.toggle":"Use China mainland mirrors","settings.mirror.recommend":"Your system locale suggests mainland China — enabling mirrors is recommended for faster downloads.","settings.mirror.hint":"When on, guided installs, pip installs, agent-run npx/git and store downloads use domestic mirrors (Tsinghua/npmmirror/multi-proxy GitHub). Env vars are injected only into commands Forsion spawns — no system config files are modified; turn off anytime. pip/npm/git parts require managed backend mode.","settings.mirror.test":"Test connection","settings.mirror.unreachable":"unreachable","settings.test.canceled":"Canceled","settings.test.timeout":"✗ Connection timed out","onboarding.env.mirrorLabel":"Network","onboarding.env.recheck":"Re-check","onboarding.env.installOk":"{tool} installed · {version}","onboarding.env.installedButMissing":'Command finished, but {tool} is still not detected. A restart of the app or a new terminal may be required — or hit "Re-check".',"onboarding.env.installFail":"{tool} install failed (exit {code}) — check the log below.","onboarding.env.pythonBundled":"Python is bundled — no separate install needed.","onboarding.env.copyCmd":"Copy command","onboarding.env.copied":"⤷ Copied — paste and run it in Terminal (requires your password): {command}","sidebar.newChat":"New session","sidebar.memory":"Memory","sidebar.agents":"Background agents","sidebar.viewMore":"View more","tip.folder":"{files} files, {folders} folders","tip.sessions":"{count} sessions","tip.modified":"Modified: {t}","tip.created":"Created: {t}","input.project.label":"Project","input.project.none":"No project","input.project.dontWork":"Don’t work in a project","input.project.search":"Search projects","input.project.noMatches":"No matching projects","input.project.add":"Add local project","input.project.addCloud":"New cloud project","input.project.cloudName":"Project name, Enter to create","app.amadeusWorkspace":"Amadeus · {name}","app.createProjectFail":"Failed to create project: {e}","ws.detail.count":"{n} sessions","ws.detail.newChat":"New session in this project","ws.detail.empty":"No sessions in this project yet","ws.detail.viewMore":"View more","agents.detail.title":"Background agents","agents.detail.settings":"Settings","agents.detail.historian":"Historian activity","agents.detail.noActivity":"No activity yet","settings.advanced.sessionLimit":"Sessions shown per project in sidebar","settings.mcpServer.label":"External MCP endpoint (for other agents)","settings.mcpServer.hint":"When on, a local HTTP MCP endpoint runs on this machine so external agents (Claude Code / Codex / OpenCode, etc.) can call Forsion Desktop capabilities (currently: send to inbox). Listens on 127.0.0.1 only, token-authenticated.","settings.mcpServer.enable":"Expose to external agents (Claude Code / Codex / OpenCode, etc.)","settings.mcpServer.connectHint":"Pick your agent and copy the config to connect (token embedded):","settings.mcpServer.endpoint":"Endpoint","settings.mcpServer.generic":"Generic JSON","settings.mcpServer.genericNote":"Any Streamable HTTP MCP client (Cursor / Windsurf / Cline, etc.) works with the Generic config — url + Authorization header.","settings.mcpServer.copy":"Copy","settings.mcpServer.notRunning":"Endpoint failed to start. Check logs or restart the app.","common.cancel":"Cancel","common.retry":"Retry","chat.action.copy":"Copy","chat.you":"You","workbench.noSession":"Select or start a session to view","workbench.sessions":"Sessions","space.home":"Home","space.tangu":"Tangu","space.amadeus":"Note","space.calendar":"Calendar","view.todo":"To-do list","view.calendar":"Calendar","view.calendarConfig":"Calendar settings","view.db":"Database","view.drawing":"Whiteboard","space.coding":"Coding Studio","view.codeStudio":"Coding Studio","space.artificial":"Creations","view.artificial":"Creations","view.product":"Creation","space.public":"Publish","view.publicHub":"Published","public.title":"Published","public.subtitle":"Manage your published sites and notes in one place","public.needLogin":"Sign in to Forsion to see your published content","public.refresh":"Refresh","public.empty":"Nothing yet","public.open":"Open","public.copy":"Copy link","public.copied":"Copied","public.unpublish":"Unpublish","public.revoke":"Revoke","public.confirm":"Confirm?","public.sites":"My sites","public.sitesDesc":"Web apps hosted by Forsion Connect","public.published":"Published notes","public.publishedDesc":"Public read-only share links","public.shared":"Shared notes","public.sharedDesc":"Pages you invited others to edit / view","public.disabled":"Disabled","public.unavailable":"Not available in this environment","coding.code":"Code","coding.preview":"Preview","coding.reload":"Reload preview","coding.noEntry":"No entry page","coding.noFile":"No file selected","coding.pickFile":"Pick a file from the tree on the right to edit","coding.emptyPreview":"Nothing to preview yet. Ask the Coding Agent on the left to generate an index.html.","coding.projects":"Projects","coding.newProject":"New project","coding.publish":"Publish","coding.publishTitle":"Publish to Forsion","coding.publishDesc":"Publish this web app as a public link. Inside the app, window.forsion gives access to Forsion AI — visitors sign in with their own Forsion account and spend their own quota.","coding.publishName":"App name","coding.publishSlug":"Link slug","coding.publishSlugHint":"3-32 chars: lowercase letters / digits / hyphens","coding.publishEntry":"Entry page","coding.publishSlots":"Published {used}/{limit} ({tier})","coding.publishBtn":"Publish","coding.publishUpdate":"Update","coding.publishing":"Publishing…","coding.unpublish":"Unpublish","coding.unpublishConfirm":"Confirm unpublish?","coding.publishNeedLogin":"Publishing requires a Forsion account","coding.loginNow":"Sign in to Forsion","coding.loginWaiting":"Waiting for browser authorization…","coding.copyLink":"Copy link","coding.copied":"Copied","coding.openLink":"Open","coding.publishHint":"Use relative paths for assets; .ts/.tsx are transpiled on publish, no build step.","coding.publishNoEntry":"No .html entry in this project yet — generate a page first.","coding.listingTitle":"Store","coding.listingHint":'Listed apps appear publicly under "Web apps" in the store after platform review.',"coding.listingNone":"Not listed","coding.listingPending":"In review","coding.listingApproved":"Listed","coding.listingRejected":"Rejected","coding.listingNoteLabel":"Reason: {note}","coding.listingApply":"Apply to list","coding.listingReapply":"Re-apply","coding.listingWithdraw":"Withdraw","coding.listingDelist":"Delist","coding.listingSummaryPh":"One sentence about this app (shown on its store card after review, ≤300 chars)","coding.listingSubmit":"Submit","coding.termsTitle":"Publish as a public page","coding.termsIntro":"Once published, anyone with the link can view this page, and it may be shared or indexed by search engines. Please confirm:","coding.termsLi1":"You have the right to publish all text, images, audio, video, and other content on the page;","coding.termsLi2":"The page contains no illegal information, infringing content, or personal information disclosed without permission;","coding.termsLi3":"You take responsibility for the content you publish.","coding.termsManage":"The platform manages public content per applicable laws and the Content Publishing Guidelines, and may restrict access to, stop displaying, or remove violating content.","coding.termsAgreePre":"I have read and agree to the ","coding.termsGuidelines":"Content Publishing Guidelines","coding.termsConfirm":"Confirm & publish","coding.cancel":"Cancel","coding.projectName":"Project name","coding.create":"Create","coding.noProjects":'No projects yet. Click "New project" to create your first one.',"coding.switchProject":"Switch project","coding.generating":"Generating…","space.inbox":"Inbox","inbox.list":"Messages","inbox.reader":"Message","inbox.filter.unread":"Unread","inbox.filter.archived":"Archived","inbox.source.forsion":"Forsion","inbox.source.automation":"Automations","inbox.source.agents":"Agents","inbox.reader.empty":"Select a message to read","inbox.sender.system":"System","inbox.sender.automation":"Automation","inbox.action.markRead":"Mark as read","inbox.action.markUnread":"Mark as unread","inbox.action.readAll":"Mark all read","inbox.action.archive":"Archive","inbox.action.unarchive":"Unarchive","inbox.action.delete":"Delete","inbox.action.refresh":"Check for new","inbox.action.chat":"Chat with {name}","inbox.deleteConfirm":'Delete "{title}"?',"time.justNow":"just now","net.unavailable":"Network unavailable. Try again later.","inbox.pullOk":"Pulled {n} new messages","inbox.pullNone":"No new messages","inbox.opFail":"Operation failed: {e}","inbox.attach.title":"Attached items","inbox.attach.claim":"Claim","inbox.approval.title":"Approval request","inbox.approval.loading":"Loading the approval record…","inbox.approval.missing":"This approval record was not found (it may have expired or been cleaned up)","inbox.approval.approved":"Approved and executed","inbox.approval.rejected":"Rejected","inbox.approval.executing":"Executing…","inbox.approval.failed":"Approved, but the run failed","inbox.approval.loadFail":"Could not load the approval record","inbox.approval.retry":"Retry","inbox.approval.reason.customAsk":"Required by your approval rules","inbox.approval.reason.rule":'Approval rule "{rule}"',"inbox.approval.reason.escalate":"Writes outside the workspace","inbox.approval.reason.mode":"Required by the approval mode","inbox.approval.reason.control":"Sets up unattended work","inbox.attach.claiming":"Claiming…","inbox.attach.claimed":"Claimed","inbox.attach.expired":"Expired — cannot claim","inbox.claim.ok":"Claimed — items added to your account","inbox.claim.already":"Already claimed before","inbox.claim.fail":"Claim failed","inbox.claim.unmet":"Requirements not met, so this reward cannot be claimed yet","inbox.attach.unmet":"Requirements not met","inbox.req.title":"Requirements","inbox.req.version":"App {v} or later","inbox.req.tiers":"{tiers} plan","inbox.req.currentVersion":"Current version {v}","inbox.req.currentTier":"Current: {tier}","inbox.req.other":"Other requirements (checked when you claim)","inbox.feedback.title":"Feedback thread","inbox.feedback.event.created":"New user feedback","inbox.feedback.event.user_reply":"A user replied to feedback","inbox.feedback.event.admin_reply":"Your feedback got a reply","inbox.feedback.loading":"Loading feedback thread…","inbox.feedback.loadFail":"Could not load the feedback thread","inbox.feedback.signIn":"Sign in to your Forsion account to view and reply","inbox.feedback.missing":"This feedback ticket no longer exists","inbox.feedback.retry":"Retry","inbox.feedback.you":"You","inbox.feedback.support":"Forsion support","inbox.feedback.user":"User","inbox.feedback.replyPh":"Write a reply…","inbox.feedback.attach":"Add attachment","inbox.feedback.attachHint":"Images, text or JSON, up to 5MB each, 5 files max","inbox.feedback.remove":"Remove","inbox.feedback.send":"Send","inbox.feedback.sending":"Sending…","inbox.feedback.sendFail":"Send failed: {e}","inbox.feedback.tooMany":"At most 5 attachments","inbox.feedback.tooBig":"{name} exceeds 5MB or is empty","inbox.feedback.badType":"{name} is not a supported type (images, text or JSON only)","inbox.feedback.download":"Download","inbox.feedback.status.open":"Open","inbox.feedback.status.in_progress":"In progress","inbox.feedback.status.resolved":"Resolved","inbox.feedback.status.closed":"Closed","inbox.tier.free":"Free","inbox.tier.plus":"Plus","inbox.tier.pro":"Pro","inbox.expiresAt":"Valid until {d}","inbox.expired":"Expired","settings.inbox.title":"Inbox","settings.inbox.notifyLabel":"System notifications for new messages","settings.inbox.notifyHint":"Notify when new messages arrive (click jumps to Inbox); badges stay on when off.","amadeus.pages":"Vault","amadeus.editor":"Editor","amadeus.outline":"Outline","amadeus.backlinks":"Backlinks","amadeus.search":"Search","amadeus.tags":"Tags","amadeus.graph":"Graph","chat.action.copied":"Copied","chat.action.edit":"Edit","chat.action.resend":"Send","chat.action.regenerate":"Regenerate","chat.action.branch":"Branch from here","chat.branchTitle":"{title} (branch)","chat.branchEmpty":"No AI reply to branch from yet","chat.branched":"Branched into a new session (history inherited)","input.slash.branch":"Branch a new session from the latest reply (inherits history)","app.branchFail":"Branch failed: {e}","sidebar.ws.menu":"Project actions","sidebar.ws.rename":"Rename project","sidebar.ws.remove":"Remove project","app.truncateFail":"Failed to truncate messages: {e}","search.jumpOutOfWindow":"The matched message is further back in history — opened the chat but could not scroll to it","rewind.busy":"Cannot rewind while a run is in progress — stop it first","rewind.noTime":"This message has no timestamp, so there is no point to rewind to","rewind.codeDone":"Code rewound ({n} file(s))","rewind.codePartial":"{bad} file(s) failed to rewind — aborted (conversation untouched)","rewind.codeSkipped":"Code rewound for {n} file(s); {bad} had no snapshot and cannot be restored","rewind.codeConflict":"Code rewound for {n} file(s); {kept} changed since then were kept as-is (not deleted)","inquiry.sendFail":"Answer was not delivered: {e} — please retry","rewind.codeFail":"Failed to rewind code: {e}","app.resendFailed":"Resend failed; restored locally — please retry.","app.regenNoUser":"No user message to regenerate from","app.wsRenameFail":"Failed to rename project: {e}","app.moveToProjectFail":"Could not move the conversation into the creation folder: {e}","app.moveToProjectHalf":"This conversation was only partly moved: its project is now “{name}”, but its working folder was not changed ({e}).","app.sessionMoving":"This conversation is being moved into the creation folder. Send again in a moment.","app.wsRemoveFail":"Failed to remove project: {e}","app.wsRemoved":'Project "{name}" removed',"app.wsTrashFail":"The sessions were deleted, but the .tangu folder could not be moved to the Trash: {e}","app.agentTrashFail":"The agent was deleted, but its files could not be moved to the Trash; they are still in {path}","app.sessionExpired":"Session expired — please sign in to your Forsion account again","onboarding.connect.cloudSync":"Enable cloud sync (sync cloud Agents)","onboarding.connect.cloudSyncHint":"When on, your memory, logs and Agents marked for cloud sync stay in sync across your signed-in devices. You can change this later in Settings → Forsion account.","common.confirm":"OK","extendView.close":"Close extension","extendView.failed":"Extension failed to load","extendView.back":"Back","common.close":"Close","common.back":"Back","common.refresh":"Refresh","common.loading":"Loading…","common.listSep":", ","common.delete":"Delete","common.edit":"Edit","common.open":"Open","common.language":"Language","common.copyCode":"Copy code","common.enabled":"Enabled","common.disabled":"Disabled","locale.zh":"中文","locale.en":"English","locale.toggleTitle":"Switch language","feedback.title":"Feedback","achievements.title":"Achievements","achievements.unlocked":"Achievement unlocked","achievements.claim":"Claim","achievements.claimed":"Claimed","achievements.pts":"{n} pts","achievements.seriesPts":"{n}/{total} pts","achievements.pluginGroup":"Plugins","achievements.medal.bronze":"Bronze","achievements.medal.silver":"Silver","achievements.medal.gold":"Gold","achievements.s.starter":"First Steps","achievements.s.chat":"Conversation","achievements.s.notes":"Notes","achievements.s.agents":"Agents","achievements.a.first-login.title":"Forsion is All You Need","achievements.a.first-login.desc":"Sign in to your Forsion account","achievements.a.theme-change.title":"Fresh Coat","achievements.a.theme-change.desc":"Switch the theme or color scheme once","achievements.a.market-install.title":"Gear Up","achievements.a.market-install.desc":"Install an item from the store","achievements.a.space-save.title":"Power of Space","achievements.a.space-save.desc":"Save the current layout as a Space","achievements.a.first-message.title":"Hello Agent!","achievements.a.first-message.desc":"Send your first message to an agent","achievements.a.chat-10.title":"Talkative","achievements.a.chat-10.desc":"Send 10 messages in total","achievements.a.chat-100.title":"Unstoppable","achievements.a.chat-100.desc":"Send 100 messages in total","achievements.a.group-chat.title":"Round Table","achievements.a.group-chat.desc":"Start a team","achievements.a.first-note.title":"Blooming Ink","achievements.a.first-note.desc":"Create your first note","achievements.a.notes-10.title":"Diligent Writer","achievements.a.notes-10.desc":"Create 10 notes in total","achievements.a.notes-100.title":"Prolific Author","achievements.a.notes-100.desc":"Create 100 notes in total","achievements.a.first-base.title":"Data Sprout","achievements.a.first-base.desc":"Create your first Base","achievements.a.first-agent.title":"Creator","achievements.a.first-agent.desc":"Create your first agent","achievements.a.agents-3.title":"Think Tank","achievements.a.agents-3.desc":"Create 3 agents in total","achievements.a.special-agent.title":"Behind the Scenes","achievements.a.special-agent.desc":"Enable Muse or Historian","achievements.a.first-image.title":"Picture This","achievements.a.first-image.desc":"Have an agent generate an image","achievements.a.debug-toast.title":"You Found This?!","achievements.a.debug-toast.desc":"??????","settings.developer.achToastLabel":"Achievement toast","settings.developer.achToast":"Fire achievement toast","settings.developer.achToastHint":"Debug the unlock animation, repeatable; secretly an achievement itself (reward granted once).","settings.developer.activityLabel":"Activity log","settings.developer.activityExport":"Export activity log","settings.developer.activityEnable":"Record in-app activity","settings.developer.activityHint":"Locally journals your actions (new chats, note edits, tasks…) so the background agent Muse understands what you are doing; stored only in the local activity folder, kept 30 days. Export to troubleshoot issues.","settings.developer.activityViewCmd":"Activity log live view command","settings.developer.activityViewCmdHint":'Adds an "Open activity log" entry to the command palette (⌘K): a main-area tab tailing the activity journal in real time (2s refresh, filter/pause).',"command.openActivityLog":"Open activity log","view.activityLog":"Activity log","activityView.filter":"Filter (substring)…","activityView.pause":"Pause","activityView.resume":"Resume","activityView.count":"{n} lines","activityView.empty":'No activity recorded yet. Make sure "Record in-app activity" is enabled in developer options, then do something.',"command.openActiveWindow":"Active window sampling","view.activeWindow":"Active window","activeWindowView.on":"Seam enabled","activeWindowView.off":"Seam disabled","activeWindowView.offHint":'Active-window sampling is off by default. Turn on "Active window sampling" in Settings → Developer options and the app you are focused on will show up here live.',"activeWindowView.noSample":"Enabled, but no active window could be read. Wayland sessions cannot report it (same ceiling as ActivityWatch); X11 needs xprop.","activeWindowView.noTitle":"(not available on this platform: window titles on macOS require Screen Recording)","activeWindowView.idleMark":"idle","activeWindowView.clear":"Clear","activeWindowView.segEmpty":"Sampling. Switch to another app for a moment and come back — folded focus segments will appear below (idle ones greyed out).","space.automation":"Automation","view.automationList":"Automations","view.automationDetail":"Automation detail","view.automationRuns":"Run history","automation.group.system":"System automations","automation.group.watches":"Watch rules","automation.group.buttons":"Buttons","automation.group.schedules":"Agent schedules","automation.group.finished":"Finished ({n})","automation.finished":"Finished","automation.finishedHint":"One-off, time has passed — edit to reschedule","automation.fact.status":"Status: ","automation.schedule.every":"every {ivl}","automation.schedule.once":"one-off","automation.fact.desc":"Notes:","automation.sched.name":"Name","automation.sched.date":"Date","automation.sched.dateHint":"YYYY-MM-DD or YYYY-MM-DDTHH:mm, optional /end","automation.sched.repeat":"Repeat","automation.sched.repeatHint":"Empty = one-off; e.g. 24h / 7d, rolling from the anchor","automation.builder.expiredReset":"Original time has passed — reset to the next hour; saving reschedules and re-enables.","automation.builder.atPast":"The one-time datetime has passed — pick a new time.","automation.muse.title":"Muse patrol","automation.muse.trigger":"Patrols every {min} min","automation.muse.action":"Thinks about what to do for you → creates TODOs","automation.historian.title":"Historian memory upkeep","automation.historian.trigger":"After every {n} rounds","automation.historian.action":"Summarizes sessions, maintains logs & memory","automation.watches.empty":'No watch rules yet — create one below, or just ask in chat ("keep an eye on…").',"automation.enabled":"Enabled (click to disable)","automation.disabled":"Disabled (click to enable)","automation.new":"New automation","automation.cond.daily":"Daily at {time}","automation.cond.event":'Activity contains "{match}"',"automation.cond.file":"{path} reaches {n} chars","automation.cond.at":"Once · {time}","automation.cond.every":"Every {ivl}","automation.cond.manual":"Manual · button","automation.cond.dbRow":"Row added to {path}","automation.cond.dbCell":"Cell changed in {path}","automation.cond.dbWhereN":"{n} condition(s)","automation.nextRun":"next {time}","automation.detail.empty":"Select an automation on the left","automation.detail.latest":"Latest run","automation.detail.recent":"Recent activity","automation.deepConfig":"Configure","automation.fact.trigger":"Trigger:","automation.fact.action":"Action:","automation.fact.actions":"Steps:","automation.fact.runner":"Runs:","automation.fact.prompt":"Prompt:","automation.fact.cooldown":"Cooldown:","automation.fact.where":"Conditions:","automation.fact.columns":"Watched columns:","automation.fact.noCooldown":"none (0h)","automation.fact.disabledReason":"Auto-disabled by the engine: {reason}","automation.fact.lastRun":"Last run:","automation.fact.nextRun":"Next run:","automation.fire.btn":"Test run","automation.fire.hint":"Execute the action chain once now (does not affect the normal schedule)","automation.fire.ok":"Test run finished ({status})","automation.fire.fail":"Test run failed ({status})","automation.exec.manual":"test","automation.exec.steps":"{n} step(s)","automation.step.notify":"Notify","automation.step.agent_run":"Run agent","automation.step.db_row_add":"Add table row","automation.step.db_row_edit":"Edit table row","automation.step.tool_call":"Run tool","automation.transcript.empty":"No runs yet","automation.transcript.trigger":"Trigger input","automation.transcript.agent":"Agent","automation.transcript.tools":"{n} tool calls","automation.trigger.neverFired":"Not fired yet — runs will appear here once it does","automation.trigger.museNote":"This rule wakes Muse; see its runs under","automation.runs.empty":"No records","automation.runs.pick":"Select an automation to see its runs here","automation.builder.title":"New automation","automation.builder.editTitle":"Edit automation","automation.builder.trigger":"Trigger","automation.builder.desc":"Name","automation.builder.descPh":"Describe this automation in one line","automation.builder.condType":"Trigger type","automation.builder.condTimer":"Timer","automation.builder.condEvent":"Event","automation.builder.condFile":"File threshold","automation.builder.condManual":"Manual (button)","automation.builder.condDb":"Database","automation.builder.manualHint":"Never fires on its own. Insert a Button block in a note, point it at this rule, and click to run it.","automation.builder.unsupported":"This rule uses an action type this builder does not understand yet. Edit it via manage_automation in chat — saving here would silently drop that part, so editing is disabled.","automation.builder.dbPath":"Which database (.db)","automation.builder.dbPickDb":"Pick a database…","automation.builder.dbEvent":"Event","automation.builder.dbEventRow":"Row added","automation.builder.dbEventCell":"Cell changed","automation.builder.dbColumn":"Watched columns","automation.builder.dbColumnsHint":"With several columns checked, a change in any of them fires; “new value equals” is compared on the column that changed.","automation.builder.dbPickCol":"Pick a column…","automation.builder.dbColsLoading":"Loading table…","automation.builder.dbEquals":"And new value equals (optional)","automation.builder.dbEqualsPh":"Leave empty to fire on any change","automation.builder.dbHint":"The engine detects changes by cursor comparison after each save; the rule is pinned to the vault it was created in.","automation.builder.dbRowId":"Row id","automation.builder.dbRowIdPh":"Leave empty = the row that fired the trigger","automation.builder.dbRowIdRequired":"Required (this trigger type has no “triggering row” to default to)","automation.builder.dbCells":"Fields to write","automation.builder.dbCellKey":"Column name or id","automation.builder.dbCellVal":"Value ({{row.Column}} templates allowed)","automation.builder.dbCellAdd":"Add field","automation.builder.dbCellsHint":"With a database trigger, {{row.Column}} in values is replaced from the triggering row.","automation.builder.dbCellValPh":"{{= {target.qty} - {row.out_qty} }}","automation.builder.dbWhere":"Extra conditions (optional)","automation.builder.dbWhereAdd":"Add condition","automation.builder.dbWhereOpEq":"equals","automation.builder.dbWhereOpNe":"not equals","automation.builder.dbWhereOpEmpty":"is empty","automation.builder.dbWhereOpNotEmpty":"is not empty","automation.builder.dbWhereValPh":"value","automation.builder.dbWhereHint":"ANDed with the condition above; compared against the materialised row, so formula/lookup columns work too; up to 10.","automation.builder.dbRowFrom":"Target rows via relation column (optional)","automation.builder.dbRowFromPh":"A relation column (name or id) of the triggering table; empty = use the row id above","automation.builder.dbMatch":"Match rows by column value (optional)","automation.builder.dbMatchValPh":"value, {{row.id}} templates allowed","automation.builder.dbTargetHint":"Target precedence: row id > relation column > column match > the triggering row.","automation.builder.dbSkipIfEmpty":"Skip when this field is empty (optional)","automation.builder.dbSkipIfEmptyPh":"One of the column names/ids above","automation.builder.cooldownDbHint":"Pure action chains on a database trigger may use 0 = no cooldown (needed for chained rules)","automation.builder.dbNoteView":"That is a note-view database (rows come from notes in a folder) — automations only work on classic tables, pick another.","automation.builder.timerMode":"Timer mode","automation.builder.timerDaily":"Daily","automation.builder.timerOnce":"Once","automation.builder.timerEvery":"Interval","automation.builder.time":"Time of day","automation.builder.datetime":"Fire at","automation.builder.onceHint":"Runs once, then disables itself (stays in the list; reschedule + enable to reuse).","automation.builder.interval":"Repeat every","automation.builder.everyHint":"Rolls from creation time; only the most recent miss is caught up. Min 1h with agent steps.","automation.builder.unitM":"minutes","automation.builder.unitH":"hours","automation.builder.unitD":"days","automation.builder.match":"Activity match text","automation.builder.matchPh":"e.g. note.edit, a file name, or a plugin: event","automation.builder.matchHint":"Substring match on new activity lines. Watch plugin events (plugin:<id>:<event>) or run.done agent=xx.","automation.builder.path":"File path (absolute or ~ prefixed)","automation.builder.chars":"Non-whitespace characters","automation.builder.stepN":"Step {n}","automation.builder.moveUp":"Move up","automation.builder.moveDown":"Move down","automation.builder.notifyTitle":"Notification title","automation.builder.notifyTitlePh":"Inbox message title","automation.builder.notifyBody":"Body (optional)","automation.builder.notifyHint":"Delivered straight to your inbox (0 tokens); pushed to connected channels (WeChat/TG…).","automation.builder.runner":"Runner","automation.builder.runnerPick":"Pick an agent…","automation.builder.tool":"Tool","automation.builder.toolPick":"Pick a tool…","automation.builder.dangerous":"⚠ High-risk tool: saving approves these exact arguments","automation.builder.toolCatalogEmpty":"Engine has no action catalog (update the engine)","automation.builder.museFallback":"Wake Muse (default)","automation.builder.museFallbackHint":"With no steps, firing wakes Muse to turn this into a reminder/TODO for you. Add steps to run them instead.","automation.builder.prompt":"Prompt","automation.builder.promptPh":"What should it do when the rule fires (English preferred)","automation.builder.cooldown":"Cooldown (hours)","automation.builder.cooldownHint":"Minimum gap between fires, in hours (floor 0.25 = 15 min for pure notify/tool chains)","automation.builder.cooldownAgentHint":"Has agent steps — min 1 hour (unattended self-excitation guard)","market.title":"Store","market.subtitle":"Discover community-built workflows, capabilities and interface extensions","market.navSubtitle":"Community extensions","market.group.discover":"Discover","market.group.categories":"Categories","market.group.manage":"Manage","market.tab.discover":"Store home","market.tab.skills":"Skills","market.tab.agents":"Agents","market.tab.plugins":"Plugins","market.tab.spaces":"Spaces","market.tab.themes":"Themes","market.tab.webapps":"Web apps","market.tab.installed":"Installed","market.searchPlaceholder":"Search names, authors or tags","market.clearSearch":"Clear search","market.sort.label":"Sort","market.sort.popular":"Popular","market.sort.latest":"Recent","market.sort.name":"Name","market.sectionSubtitle":"Browse {section} and manage installs","market.pluginsSubtitle":"Browse plugins, Spaces and Agents, and manage installs","market.detailSubtitle":"Details, source and install information","market.webOpen":"Open","market.webHint":"Web apps built with Coding Space and listed by users. Opens in the built-in browser; AI features spend the visitor's own account quota.","market.tab.updates":"Updates","market.tab.submit":"Submit","market.author":"by","market.downloads":"{n} downloads","market.downloadsShort":"{n} installs","market.install":"Install","market.installing":"Installing…","market.installed":"Installed","market.reinstall":"Reinstall","market.desktopOnly":"Desktop only","market.desktopOnlyInstall":"Desktop only","market.desktopOnlyHint":"This plugin relies on features that exist on a computer only, so it cannot be installed on a phone","market.platform":"Platform","market.uninstall":"Uninstall","market.uninstallConfirm":'Uninstall "{name}"? Its install directory will be deleted.',"market.uninstallWarnAgent":"⚠️ This is an agent: once installed it keeps its own memory and logs. Uninstalling deletes them too, and that cannot be undone.","market.uninstallWarnSkill":"⚠️ If you have edited this skill, your edits will be deleted with it.","market.uninstalled":'Uninstalled "{name}"',"market.uninstalledNeedsRestart":'Uninstalled "{name}" · its tools only go away after a backend restart',"market.uninstallFail":"Uninstall failed: {e}","market.openSettings":"Open settings","market.update":"Update","market.updateTitle":"Update v{from} → v{to}","market.allUpToDate":"Everything installed is up to date","market.allUpToDateHint":"New versions will appear here automatically.","market.detailBack":"Back to list","market.empty":"Nothing here yet","market.emptyHint":"Community content appears here after review.","market.noInstalled":"Nothing installed from the store yet","market.noResults":"No matching content found","market.noResultsHint":"Try another name, author or tag.","market.browse":"Browse store","market.retry":"Reload","market.loadFailShort":"The store is temporarily unavailable","market.loadFail":"Failed to load: {e}","market.summaryFallback":"The author has not provided a summary.","market.searchResults":"Search results","market.resultCount":"{n} items","market.featured":"Community pick","market.viewDetails":"View details","market.recent":"Recently added","market.recentHint":"See what the community just published.","market.popular":"Popular","market.popularHint":"Ordered by real install count.","market.overview":"Overview","market.reviewed":"Reviewed for listing","market.reviewedHint":"The listing meets publication requirements. Forsion does not guarantee third-party code.","market.type":"Type","market.version":"Version","market.source":"Install source","market.sourceUpload":"Forsion hosted package","market.updated":"Updated","market.unknown":"Unknown","market.installOk":'Installed "{name}"',"market.spaceInstalled":'Installed Space "{name}" and added it to the ribbon',"market.themeInstalled":'Installed "{name}". Pick it in Settings → Appearance',"market.amadeusPluginInstalled":'Forsion plugin "{name}" installed and loaded',"market.pluginInstalledOk":"Plugin installed and enabled","market.pluginInstalledRestartHint":"Plugin installed. Restart the backend for it to take full effect","market.pluginInstalledWaiting":"Plugin installed, but it needs these first: {list}","market.amadeusPluginNeedsDeps":'Forsion plugin "{name}" installed, but it needs these first: {list}',"market.restartBackend":"Restart backend","market.restartBackendHint":"Takes a few seconds; any running conversation will be interrupted","market.backendRestarting":"Restarting the backend…","market.backendRestarted":"Backend restarted — changes are now in effect","market.backendRestartFailed":"The backend didn't restart. Try again, or restart the app","market.installFail":"Install failed: {e}","market.installFailNamed":"Couldn’t install {name}: {e}","market.installHintGithub":"This item downloads from GitHub, which is unreachable on some networks. Turn on a system proxy and retry, or enable “Use China mainland mirrors” in Settings → General → Connection to download through domestic mirrors.","market.installRetry":"Retry","market.phase.resolve":"Preparing…","market.phase.connect":"Connecting…","market.phase.connectN":"Connecting {n}/{m}…","market.phase.percent":"Downloading {n}%","market.phase.bytes":"Downloaded {size}","market.openRepo":"View GitHub repo","market.readmeEmpty":"(No details)","market.submitHint":"Submit a GitHub repository, public npm package or ZIP through your account. Submissions appear after review.","market.submitOpen":"Open submission page","market.submitKicker":"Developer center","market.submitTitle":"Share your workflow with more people","market.submitArtTitle":"One review and version pipeline","market.submitArtHint":"Skills, Agents, Plugins, Spaces and Themes use the same publication flow.","feedback.label":"Issue or feedback","feedback.placeholder":"Describe the problem or suggestion… the current session log is attached automatically to help us debug.","feedback.logAttached":"Current session log will be attached ({name})","feedback.noSession":"No active session — submitting text only","feedback.submit":"Send feedback","feedback.diagnoseViaChat":"Diagnose in chat","feedback.diagnoseViaChatHint":"Send the description to the current session’s agent to troubleshoot it in place","feedback.ok":"Submitted — thank you for your feedback!","feedback.okNoLog":"Submitted (session log over 5MB, not attached this time)","feedback.errEmpty":"Please enter your feedback","feedback.errFail":"Submit failed: {err}","feedback.errNotLoggedIn":"Not logged into Forsion","feedback.errUnavailable":"Feedback not available here","sidebar.account.login":"Sign in to Forsion","sidebar.account.loginHint":"Sign in for cloud memory / skills / hosted models (works fine without signing in too)","sidebar.account.loggingIn":"Signing in…","sidebar.account.logout":"Sign out","sidebar.account.menu.weekly":"This week","sidebar.account.menu.daily":"Today","sidebar.account.menu.unlimited":"Unlimited","sidebar.account.menu.loading":"Loading…","sidebar.account.menu.quotaFail":"Failed to load usage","settings.provider.loginBusy":"After you finish signing in the browser, the local engine restarts to load this provider and the model list refreshes automatically (a few seconds).","quota.exhausted.daily":"Today's AI quota is used up (this run finished on overdraft; use a quota reset card under Forsion Cloud → Quota & points to restore it now)","quota.exhausted.weekly":"This week's AI quota is used up (this run finished on overdraft; use a quota reset card under Forsion Cloud → Quota & points to restore it now)","sidebar.account.loginFail":"Sign-in failed: {e}","sidebar.account.loginSub":"Click to sign in","sidebar.account.engineDown":"Engine not running · click to restart","sidebar.account.engineStarting":"Engine starting…","sidebar.settings":"Settings (Ctrl+,)","header.theme":"Light / dark","header.browser":"Browser","header.browserEnabled":"Browser tools enabled","header.browserDisabled":"Browser tools disabled","settings.tab.about":"About","about.version":"Version","about.checkUpdates":"Visit website","about.update.check":"Check for updates","about.update.checking":"Checking…","about.update.upToDate":"You're up to date","about.update.available":"Update available v{version}","about.update.download":"Download update","about.update.downloading":"Downloading {percent}%","about.update.install":"Restart & install","about.update.goToDownload":"Go to download","about.update.error":"Update failed: {error}","about.update.unsupported":"Auto-update unavailable in dev","about.update.unreachable":"Could not reach the update server, try again later","about.update.beta":"Receive beta updates","about.update.betaHint":"Get pre-release builds like x.y.z-beta.N — newer features, more likely to break. With this off they are invisible to you. Stable always wins: a stable release published after a beta is still offered.","app.update.bannerTitle":"New version v{version} available","app.update.bannerAction":"Update now","app.update.bannerDismiss":"Dismiss","about.changelogTitle":"What's new","about.builtWith":"Forsion Desktop","about.builtWithMobile":"Forsion Mobile","about.complianceTitle":"Compliance","about.appFiling":"App filing number","about.privacy":"Privacy policy","about.terms":"Terms of service","settings.cloud.envOnly":"The Forsion cloud URL is set via the TANGU_CLOUD_URL environment variable (read-only here).","settings.cloud.label":"Forsion cloud URL (brain: memory/skills/hosted models)","settings.cloud.unset":"(unset — using built-in default)","model.group.forsion":"Forsion Cloud","picker.ungrouped":"Ungrouped","model.group.direct":"Local","model.collapseAll":"Collapse all","model.expandAll":"Expand all","model.empty":"No models","model.searchPlaceholder":"Search models…","settings.tab.developer":"Developer","settings.tab.browser":"Browser control","settings.tab.channels":"Channels","channel.name.wechat":"WeChat","channel.name.telegram":"Telegram","channel.name.qq":"QQ","channels.intro":"Bring Tangu into your IM: connecting creates a fresh channel session and messages get answered in chat; inbox forwarding can be enabled independently.","channels.loadingTitle":"Loading channels","channels.loadingHint":"Reading local channel capabilities and connection status.","channels.notAvailable":"Channels require the built-in local backend (desktop).","channels.notAvailableHint":"Start the local backend and retry. These settings are not available in external-backend mode.","channels.enable":"Enable","channels.status.connected":"Connected","channels.status.notConnected":"Not connected","channels.status.disabled":"Disabled","channels.connect":"Connect","channels.scanConnect":"Scan to connect","channels.disconnect":"Disconnect","channels.disconnected":"Disconnected.","channels.connectedAs":"Connected: {label}","channels.connectedMsg":"WeChat connected; a new channel session was created.","channels.connectFailed":"Operation failed: {e}","channels.qrExpired":"QR code expired, please scan again.","channels.scanQrHint":"Scan with WeChat to confirm login.","qr.failed":"Failed to generate QR code, please retry.","qr.alt":"Login QR code","channels.newSessionHint":"Connecting creates a new session; later messages go to it. In the IM use /new, /list, /switch to manage sessions and /help for all commands.","channels.botToken":"Bot token","channels.botTokenHint":"Create a bot via @BotFather on Telegram to get a token, then press Connect.","channels.qqHint":"Create a bot on the QQ Open Platform (q.qq.com) to get AppID / AppSecret.","channels.secretSaved":"Saved (type to replace)","channels.sessionsSec":"Channel sessions","channels.sessions":"Enable channel sessions","channels.sessionsHint":"Incoming messages drive an agent session and get replies; when off, only inbox forwarding works.","channels.approval":"Remote approval","channels.approval.readonly":"Ask for approval","channels.approval.autoEdit":"Approve for me","channels.approval.fullAuto":"Full access","channels.defaultAgent":"Default agent","channels.defaultModel":"Default model","channels.imageModel":"Image model","channels.ttsModel":"Voice model","channels.ttsModelPlaceholder":"Empty = follow Voice settings","channels.ttsVoice":"Voice","channels.followDefault":"Follow global default","channels.followGlobal":"Follow global setting","channels.forwardSec":"Inbox forwarding","channels.forward":"Forward inbox messages to this channel","channels.forwardHint":"Push new inbox messages to your IM (independent of channel sessions).","channels.forwardSenders":"Allowed senders","channels.forwardAll":"All","channels.waitingPeer":"Connected; waiting for the first incoming message to bind the contact.","channels.senderSystem":"System","channels.senderServer":"Forsion cloud","sidebar.channel.setAsConnected":"Set as connected","settings.tab.notes":"Notes","settings.tab.sync":"Sync","settings.sync.cloudSec":"Online sync","settings.sync.remoteSec":"Vault remote sync","settings.notes.storageTitle":"Files and attachments","settings.notes.storageDescription":"Keep attachment and daily-note locations together.","settings.notes.behaviorTitle":"Editing and safety","settings.notes.behaviorDescription":"Control imports, link compatibility and attachment deletion safeguards.","settings.notes.modeLabel":"Attachment location","settings.notes.modeAttachments":"attachments/ folder next to the note","settings.notes.modeSame":"Same folder as the note","settings.notes.modeVault":"Fixed folder in the vault","settings.notes.modeHint":"Where dragged-in files are saved. “attachments” auto-creates an attachments/ subfolder beside the note.","settings.notes.folderLabel":"Vault-relative folder","settings.notes.folderHint":"Relative to the vault root, e.g. assets. All attachments live here (must be inside the vault for inline preview).","settings.notes.previewLabel":"Preview imported files by default","settings.notes.previewHint":"On: insert an ![[file]] preview block (images inline, others as a clickable file card). Off: insert a [name](path) link.","settings.notes.upgradeV4Label":"Upgrade legacy notes to v4 plain Markdown on open","settings.notes.upgradeV4Hint":"On by default: v3 marker-based notes convert to plain Markdown when you edit them. The upgrade is written only after a real edit; turn this off temporarily if some device still runs a version older than 2.7.8.","settings.notes.dailyLabel":"Daily notes folder","settings.notes.dailyPlaceholder":"Empty = vault root","settings.notes.dailyHint":`Where "Open today's daily note" creates YYYY-MM-DD.md (vault-relative); templates/daily.md is applied automatically if present.`,"settings.notes.wikiFilesLabel":"Suggest attachments and databases in [[ ]]","settings.notes.wikiFilesHint":"On: typing [[ also completes attachments, databases (.db) and drawings. Off: notes only.","settings.notes.canvasDoubleClickFocusLabel":"Focus canvas cards on double-click","settings.notes.canvasDoubleClickFocusHint":"Double-clicking a card always enters editing with the caret at the click. On: it also smoothly centers the card at a readable zoom; off: it edits in place and the viewport stays put. A single click only selects; Space also enters editing.","settings.notes.canvasOverviewZLabel":"Zoom that collapses cards to titles","settings.notes.canvasOverviewZHint":"At this zoom level or below, canvas cards show a title summary instead of their body. The default 25% only collapses at the furthest zoom-out; a higher value collapses sooner. The toggle in the canvas HUD turns the summary off entirely.","settings.notes.deleteAssetsLabel":"Delete exclusive attachments with the note","settings.notes.deleteAssetsAsk":"Ask every time","settings.notes.deleteAssetsYes":"Remembered: delete them","settings.notes.deleteAssetsNo":"Remembered: keep them","settings.notes.deleteAssetsHint":"Only attachments referenced by this note alone; anything another note links to is kept.","settings.remote.saved":"Remote settings saved. The managed backend may restart to apply them.","settings.browser.title":"Browser control","settings.browser.agentBrowser":"Agent browser","settings.browser.hint":"Tangu prefers browser_search and browser_* interaction tools for web work; web_search remains available for compatibility.","settings.browser.engine":"Browser engine","settings.browser.engineHint":"Auto picks an available browser implementation for each task.","settings.browser.searchEngine":"Search engine","settings.browser.timeout":"Timeout","settings.browser.timeoutHint":"Maximum wait for a browser command, in milliseconds.","settings.browser.allowPrivate":"Allow browser tools to open private/local network URLs","settings.browser.allowPrivateHint":"Off by default; browser_navigate blocks localhost, RFC1918 and link-local addresses.","settings.tab.spaces":"Spaces","settings.spaces.hint":"Manage the Spaces in the ribbon. Built-in Spaces ship with the app and cannot be removed; Spaces you created or installed from the store can be uninstalled (their on-disk layout recipe is deleted).","settings.spaces.builtin":"Built-in","settings.spaces.user":"Custom/store","settings.spaces.uninstall":"Uninstall","settings.spaces.uninstalled":'Uninstalled "{name}"',"settings.spaces.empty":"No Spaces yet.","settings.spaces.startupTitle":"Startup location","settings.spaces.startupLabel":"Open the app in","settings.spaces.startupHint":"Opens the Space in the ribbon home slot by default; you can also return to your last Space with its tabs, or pin a specific one.","settings.spaces.lastExit":"Last Space on exit (with its tabs)","settings.spaces.homeSlotStartup":"Space in the home slot (default — now “{name}”)","settings.spaces.homeSlotLabel":"Ribbon home slot","settings.spaces.homeSlotHint":"The centred cell on the ribbon. Home by default; swap it for any Space here or by right-clicking the cell.","settings.spaces.hintPhone":"Built-in Spaces ship with the app and cannot be removed; Spaces you created or installed from the market can be uninstalled (their on-disk layout recipe is deleted).","settings.spaces.startupHintPhone":"Choose which Space the app opens in: the default one, the last one you were in, or a specific one.","settings.spaces.homeSlotStartupPhone":"Default (now “{name}”)","settings.spaces.libraryTitle":"Installed Spaces · {count}","settings.tab.plugins":"Plugins","settings.tab.amadeusPlugins":"Plugins","settings.amadeusPlugins.builtinTitle":"Built-in plugins","settings.amadeusPlugins.builtinHint":"Ships with the app and is on by default (browser, terminal and calendar are native host views; the rest are editor add-ons). Turning one off removes it from the workbench, command palette and editor — calendar takes its Space with it.","settings.amadeusPlugins.externalTitle":"External plugins","settings.amadeusPlugins.changelog":"What's new","settings.amadeusPlugins.hint":"Toggle takes effect instantly; click a plugin for details. Plugin folder: ~/.forsion/plugins/ (store installs). A plugin may bundle engine plugins / agents / skills / Spaces — they are discovered, toggled and uninstalled together with it.","settings.amadeusPlugins.openFolder":"Open plugins folder","settings.amadeusPlugins.reload":"Reload","settings.amadeusPlugins.scaffold":"Create sample plugin","settings.amadeusPlugins.builtin":"Built-in","settings.amadeusPlugins.external":"External","settings.amadeusPlugins.agentOwned":"Space built by {agent}","settings.amadeusPlugins.blockedInvalid":"Invalid manifest: {reason}","settings.amadeusPlugins.uninstall":"Uninstall","settings.amadeusPlugins.uninstallConfirm":'Uninstall "{name}"? Its folder will be deleted; bundled engine plugins/Spaces go with it (seeded agents are kept — delete them on the Agents page if needed).',"settings.amadeusPlugins.uninstalled":'Uninstalled "{name}"',"settings.amadeusPlugins.uninstalledRestartPending":'"{name}" files were deleted, but the engine restart did not complete — bundled tools may still be running; restart the backend manually',"settings.amadeusPlugins.bundleEngine":"Engine plugins ×{n}","settings.amadeusPlugins.bundleAgents":"Agents ×{n}","settings.amadeusPlugins.bundleSkills":"Skills ×{n}","settings.amadeusPlugins.bundleSpaces":"Spaces ×{n}","settings.amadeusPlugins.bundleTitle":"Bundled content","settings.amadeusPlugins.bundleEngineList":"Engine plugins: {list}","settings.amadeusPlugins.bundleAgentsList":"Agents: {list}","settings.amadeusPlugins.bundleSkillsList":"Skills: {list}","settings.amadeusPlugins.bundleSpacesList":"Spaces: {list}","settings.amadeusPlugins.bundleHint":"Bundled engine plugins and Spaces follow this plugin's enable/uninstall state; agents are seeded into the engine once on first discovery and then live independently (upgrades never overwrite, uninstall keeps them).","settings.amadeusPlugins.blockedApi":"Requires plugin API v{v}, incompatible with this app","settings.amadeusPlugins.blockedMinApp":"Requires app version ≥ {v}","settings.amadeusPlugins.empty":"No plugins yet.","settings.amadeusPlugins.back":"Back to list","settings.amadeusPlugins.dep":"Companion app","settings.amadeusPlugins.depConnected":"Connected {v}","settings.amadeusPlugins.depMissing":"Not detected — needs to be installed and running","settings.amadeusPlugins.depCheck":"Check connection","settings.amadeusPlugins.depInstall":"Install","settings.amadeusPlugins.depInstalling":"Installing…","settings.amadeusPlugins.depFail":"Install did not finish — open the website to install manually","settings.amadeusPlugins.depHomepage":"Open website","settings.amadeusPlugins.commands":"Commands","settings.amadeusPlugins.settings":"Settings","plugin.onboarding.title":"Set up — {name}","plugin.onboarding.stepsTitle":"Steps","plugin.onboarding.settingsTitle":"Required settings","plugin.onboarding.recommendsTitle":"Recommended companions","plugin.onboarding.install":"Install","plugin.onboarding.installed":"Installed","plugin.onboarding.installing":"Installing…","plugin.onboarding.notFound":"Not in store","plugin.onboarding.later":"Later","plugin.onboarding.done":"Done","plugin.onboarding.laterHint":'You can come back anytime from Settings → Forsion plugins → this plugin → "Run setup". The "Setup pending" badge clears on its own once every requirement is met.',"plugin.onboarding.requiresTitle":"Before you start","plugin.onboarding.req.ok":"Ready","plugin.onboarding.req.unmet":"Not done yet","plugin.onboarding.req.unknown":"Can't check right now","plugin.onboarding.req.timeout":"The check timed out. Try again in a moment.","plugin.onboarding.req.inactive":"Enable the plugin to check this.","plugin.onboarding.recheck":"Check again","plugin.onboarding.checking":"Checking…","plugin.onboarding.allReady":"All set — you're ready to go.","plugin.onboarding.someUnknown":"Nothing is missing; {n} item(s) can't be checked right now.","plugin.onboarding.guideTitle":"How to use","plugin.onboarding.badge":"Setup pending","plugin.onboarding.run":"Run setup","plugin.onboarding.nudgeTitle":'Plugin "{name}" needs a quick setup',"plugin.onboarding.nudgeBody":`"{name}" still has unmet requirements. Open Settings → Forsion plugins → {name} and click "Run setup" to see what's missing.`,"settings.plugins.npmInstallTitle":"Install engine plugin from npm","settings.plugins.npmInstallHint":"Enter a package spec (e.g. npm:@forsion/tangu-computer-use). Plugins run with your full system permissions — only install sources you trust.","settings.plugins.npmInstallConfirm":'Install "{spec}" from npm? Plugins run with your full system permissions; confirm the source is trustworthy before continuing.',"settings.plugins.preferMirror":"Prefer CN mirror","settings.plugins.installBtn":"Install","settings.plugins.installing":"Installing…","settings.plugins.installed":"Installed {id}@{version}","settings.plugins.empty":"No plugins","settings.plugins.secForsion":"Forsion plugins","settings.plugins.secEngine":"Tangu engine plugins","settings.plugins.bundleOwnedHint":"{n} more engine plugin(s) are bundled by Forsion plugins above and toggle together with them.","settings.plugins.selectHint":"Select a plugin to configure","settings.plugins.builtin":"Built-in","settings.plugins.folder":"Folder","settings.plugins.needsRestart":"Restart needed","settings.plugins.needsRestartHint":"The new version is on disk, but its entry imports relative modules. Restart the backend to run it","settings.plugins.waitingDeps":"Waiting for required plugins","settings.plugins.loadFailed":"Failed to load","settings.plugins.settling":"Finishing up","settings.plugins.settlingHint":"The previous start or stop is still finishing; your setting takes effect once it ends","settings.plugins.needsDepsToEnable":"Install and turn on these first: {list}","settings.plugins.disableDependents":'Turning off "{name}" also pauses the plugins that require it: {list}. They resume when you turn it back on. Continue?',"settings.plugins.uninstallDependents":'These plugins require "{name}" and stop working once it is uninstalled: {list}.',"settings.plugins.openFolder":"Open plugins folder","settings.plugins.rescan":"Reload plugins","settings.plugins.rescanning":"Rescanning…","settings.plugins.rescanAdded":"Rescan done: {n} plugin(s) added, updated or removed","settings.plugins.rescanNone":"Rescan done: nothing changed","settings.plugins.rescanHint":"Picks up plugins added, updated or removed in the folder right away. A plugin whose entry imports relative modules still needs a backend restart after an update","settings.plugins.uninstall":"Uninstall","settings.plugins.uninstallConfirm":'Uninstall "{name}"? This deletes the plugin files and all its settings.',"settings.plugins.uninstalled":'Uninstalled "{name}"',"settings.plugins.scope":"Scope","settings.plugins.scopeGlobal":"Global","settings.plugins.scopeAgent":"Per agent","settings.plugins.selectAgent":"Select agent","settings.plugins.noSettings":"This plugin has no settings","settings.plugins.saved":"Saved","settings.plugins.import":"Import image","settings.plugins.deleteConfirm":"Delete “{name}”?","settings.plugins.onlyImage":"Images only (png/jpg/gif/webp)","about.versionClickHint":"{n} more taps to enable developer mode","about.devUnlocked":"Developer mode enabled","settings.developer.note":"These options are for advanced users / debugging — normally no need to change them.","settings.developer.cloudUrlLabel":"Forsion cloud URL","settings.developer.cloudUrlHint":"Address of the brain service (memory/skills/hosted models). Leave empty to use the TANGU_CLOUD_URL env var or the built-in default. In managed mode, saving restarts the backend to take effect.","settings.developer.cloudUrlPlaceholder":"https://api.forsion.net","settings.developer.saveCloudUrl":"Save","settings.developer.savedRestarting":"Saved, restarting backend…","settings.developer.saved":"Saved","settings.developer.relaunchLabel":"Onboarding","settings.developer.relaunchHint":"Re-run the first-install setup flow (theme / connection / model / project folder).","settings.developer.relaunch":"Re-run onboarding","settings.developer.disable":"Disable developer mode","settings.developer.showSystemPrompt":"Show system prompt before each reply","settings.developer.showSystemPromptHint":"When on, each AI reply is preceded by the full system prompt sent to the model for that message (expand to inspect its content and structure). Local debugging only; cleared automatically when you disable developer mode.","settings.developer.activeWindow":"Active window sampling (seam)","settings.developer.activeWindowHint":'Lets plugins that declare the activeWindow capability read which app you are focused on — so they can drop external dependencies like ActivityWatch. Data never leaves this machine. Adds an "Active window sampling" debug panel to the command palette (⌘K). Off by default; turned off automatically when you leave developer mode.',"settings.developer.mobileUiPreview":"Mobile UI preview command","settings.developer.mobileUiPreviewHint":'Adds a "Switch to mobile UI" entry to the command palette (⌘K) that swaps the desktop shell for the single-column mobile shell at runtime (reloads the page). Works on web too. Local debugging only; cleared when you disable developer mode.',"command.switchToMobileUi":"Switch to mobile UI","command.switchToDesktopUi":"Switch back to desktop UI","command.zoomIn":"Zoom in","command.zoomOut":"Zoom out","command.zoomReset":"Reset zoom","chat.systemPrompt":"System prompt","onboarding.brand.caption":"AI workspace","onboarding.progress.label":"Setup progress","onboarding.phase.connect":"Connect account","onboarding.phase.appearance":"Choose appearance","onboarding.phase.capabilities":"Configure capabilities","onboarding.phase.workspace":"Prepare project folder","onboarding.welcome.kicker":"First-time setup","onboarding.welcome.subtitle":"Bring models, agents, knowledge and local tools into one app.","onboarding.welcome.railLabel":"Start here","onboarding.welcome.railTitle":"Make Forsion fit the way you work.","onboarding.welcome.railBody":"Finish the essentials in a few minutes. Every choice can be changed later in Settings.","onboarding.welcome.promiseModels":"Connect Forsion or your own models","onboarding.welcome.promiseAgents":"Prepare agents you can switch anytime","onboarding.welcome.promiseLocal":"Keep control of local files and execution","onboarding.step.connect.title":"Connect models and account","onboarding.step.connect.description":"Sign in to Forsion, use subscription access, or connect an OpenAI-compatible service.","onboarding.step.theme.title":"Choose your appearance","onboarding.step.theme.description":"Design language controls structure, the accent controls highlight color, the background controls the base palette. Mix them freely.","onboarding.step.model.title":"Choose a default model","onboarding.step.model.description":"Pick a daily model now. You can switch it in any conversation later.","onboarding.step.speech.title":"Configure voice input","onboarding.step.speech.description":"Choose a speech recognition model, or keep the default and configure it later.","onboarding.step.agents.title":"Meet your agents","onboarding.step.agents.description":"Review the roster and optionally create an assistant with its own persona and memory.","onboarding.step.workspace.title":"Choose a working directory","onboarding.step.workspace.description":"Set the default folder for local sessions. Forsion works only within the scope you allow.","onboarding.step.env.title":"Check the local environment","onboarding.step.env.description":"Verify tools needed for coding tasks and choose downloads for your current network.","onboarding.step.done.title":"You’re all set","onboarding.step.done.description":"The essentials are configured. Enter Forsion and start working.","onboarding.done.cloudLine1":"· Switch models and thinking effort anytime from the input bar; notes, calendar and automation all live in Forsion","onboarding.done.cloudLine2":"· Settings → Appearance changes the theme and language anytime; the desktop app adds local files and tools","onboarding.connect.modeLabel":"Connection method","onboarding.model.choiceLabel":"Default chat model","onboarding.speech.choiceLabel":"Voice input","onboarding.workspace.choiceLabel":"Default working directory","onboarding.connect.forsionHint":"Sign in with your Forsion account (the cloud URL is set via an environment variable — nothing to enter here). Or switch to your own API key above.","onboarding.connect.skipForNow":"Skip for now","onboarding.theme.stepLabel":"Choose a theme","onboarding.theme.modeLabel":"Light / dark","onboarding.theme.light":"Light","onboarding.theme.dark":"Dark","onboarding.theme.hint":"You can change this anytime in Settings → Appearance.","onboarding.theme.customSeedLabel":"Custom accent","settings.theme.system":"Follow system","settings.theme.modeLocked":"This theme follows the system appearance","settings.theme.modeLockedHint":"Themes like Glass take light/dark from the system; it can’t be switched manually.","settings.theme.zoomLabel":"Interface size","settings.theme.zoomHint":"Scales the whole interface. Currently {percent}%. You can also fine-tune it in 10% steps with ⌘/Ctrl + +/−.","settings.theme.zoomPresetLabel":"Interface size presets","settings.theme.zoomSmall":"Small","settings.theme.zoomStandard":"Standard","settings.theme.zoomLarge":"Large","settings.theme.smoothCaret":"Smooth caret","settings.theme.smoothCaretHint":"The text caret glides smoothly to its new position in the editor and chat input (Word-style). Off by default; turn it on if you want it.","settings.theme.promptSuggest":"Input suggestions","settings.theme.promptSuggestHint":"After each turn, the empty input box shows a greyed-out guess at your next message. Press Tab to fill it in. Adds one small cached model request per turn. Off by default.","settings.theme.chatAvatars":"Chat avatars","settings.theme.chatAvatarsHint":"Show agent and user avatars in conversations. Turn off for a cleaner message view; agent names stay.","settings.theme.calmDim":"Dim surroundings","settings.theme.calmDimHint":"The ribbon, inactive tabs, the left sidebar, and the cards beside a chat fade while you work. They come back when you point at them or move keyboard focus there.","settings.theme.calmReading":"Relaxed text","settings.theme.calmReadingHint":"Looser line and paragraph spacing in notes and chats, and a slightly narrower note column. Interface text and controls stay the same size.","settings.theme.calmMotion":"Gentle transitions","settings.theme.calmMotionHint":"Slow down view changes and the fade when surroundings come back.","settings.theme.ribbonAutoHome":"Reset ribbon after scrolling","settings.theme.ribbonAutoHomeHint":"After you scroll the ribbon, clicking elsewhere or opening an item slides it back a moment later. Turn off to keep it where you scrolled.","settings.theme.ribbonRecent":"Recent Spaces on the ribbon","settings.theme.ribbonRecentHint":"Lists your most recently used Spaces in the gap in the middle of the ribbon, newest first. Fewer are shown when there is not enough room.","settings.theme.ribbonRecentOff":"Off","settings.theme.fontUi":"Interface font","settings.theme.fontBody":"Body font","settings.theme.fontMono":"Monospace font","settings.theme.fontFollow":"Follow theme","settings.theme.fontSystem":"System default","settings.theme.fontHint":'Preset fonts ship with the app, so they render the same on every machine regardless of what is installed locally. Pick "Follow theme" to use the current theme’s own stack.',"settings.theme.fontPreset.inter":"Inter (modern sans)","settings.theme.fontPreset.notoSans":"Noto Sans SC","settings.theme.fontPreset.wenkai":"LXGW WenKai (reading)","settings.theme.fontPreset.jetbrains":"JetBrains Mono","settings.theme.fontPreset.system":"System default","settings.theme.fontGroupBuiltin":"Built-in","settings.theme.fontGroupPlugin":"From plugins","settings.theme.customSeedLabel":"Custom accent","settings.theme.customBgLabel":"Custom background","settings.theme.customBgFollow":"Follows accent","settings.theme.customBgClear":"Reset","settings.theme.customBgHint":"Unset: the accent softly tints the background. Set: use this hue as an independent ambience seed, adjusted into the current mode’s readable range.","settings.theme.langLabel":"Design language","settings.theme.visuals":"Intelligent UI","settings.theme.visualsOpt.auto":"Auto","settings.theme.visualsOpt.less":"Less","settings.theme.visualsOpt.off":"Off","settings.theme.visuals.auto":"Organize images, sources and controls around your question. Simple answers stay in prose.","settings.theme.visuals.less":"Use only when you ask for images, charts or an interactive view. Applies from the next turn.","settings.theme.visuals.off":"Text only, no cards; takes effect from the next turn.","settings.theme.openFolder":"Open themes folder","settings.theme.reload":"Reload themes","settings.theme.dropHint":"Drop theme.json + theme.css into ~/.forsion/themes/<id>/ to install a third-party theme, then click “Reload themes”.","settings.theme.options":"{name} options","settings.theme.optionsReset":"Reset","settings.theme.skinLabel":"Color scheme","settings.theme.accentLabel":"Accent","settings.theme.bgLabel":"Background","settings.theme.skin.cream":"Classic","settings.theme.skin.coral":"Coral","settings.theme.skin.teal":"Teal","settings.theme.skin.lavender":"Lavender","settings.theme.skin.zhi":"Clear blue","settings.theme.skin.ink":"Ink","settings.theme.skin.custom":"Custom","settings.group.appearance":"Appearance","settings.group.account":"Account","settings.group.model":"Models","settings.group.agents":"Agents","settings.group.extensions":"Extensions","settings.group.appearanceAbout":"Appearance & about","settings.group.plugins":"Extensions","settings.group.advanced":"Advanced","settings.group.about":"About","settings.group.options":"Options","settings.group.workspace":"Workspace","settings.group.ai":"AI","settings.group.system":"System","settings.group.tools":"Tools","settings.group.corePlugins":"Core plugins","settings.group.communityPlugins":"Community plugins","settings.tab.general":"General","settings.page.generalDescription":"Manage your working directory, runtime and Forsion connection status.","settings.page.spacesDescription":"Choose a startup location and manage installed Spaces.","settings.page.notesDescription":"Manage attachment locations, note behavior and deletion safeguards.","settings.page.syncDescription":"Sync your local vault to remote storage (Dropbox, S3, WebDAV, and more).","settings.page.themeDescription":"Preview and combine design language, color, appearance mode, interface size and typography.","settings.page.shortcutsDescription":"Find commands and record, unbind or restore shortcuts.","settings.page.notificationsDescription":"Control delivery and choose which events and plugins can notify you.","settings.page.statusbarDescription":"Choose bottom-bar items and drag them into display order.","settings.page.modelDescription":"Choose default models and manage providers, web search and voice.","settings.page.agentsDescription":"Manage the agent roster, background agents and local agent CLIs.","settings.page.skillsDescription":"Browse skills and import skills or MCP settings from other tools.","settings.page.mcpDescription":"Connect, toggle and maintain external MCP tool servers.","settings.page.hooksDescription":"Manage automations that run around agent activity.","settings.page.channelsDescription":"Connect messaging channels and review their status in one place.","settings.page.browserDescription":"Choose browser and search engines, and set network safety boundaries.","settings.page.pluginsDescription":"Manage core features and installed plugins, their settings and updates.","settings.page.pluginDescription":"Adjust the features and runtime options provided by this plugin.","settings.page.advancedDescription":"Manage local services, interface behavior, logs and data safety.","settings.page.developerDescription":"Internal options for UI debugging, activity logs and feature testing.","settings.page.aboutDescription":"Review the version, update channel, language and full changelog.","settings.overview.label":"Current status","settings.overview.mode":"Runtime mode","settings.overview.backend":"Backend service","settings.overview.account":"Forsion account","settings.overview.signedIn":"Signed in","settings.overview.signedOut":"Not signed in","settings.overview.readyTitle":"Workspace services are ready","settings.overview.readyDescription":"The backend is connected. You can continue adjusting the workspace and local runtime.","settings.overview.attentionTitle":"Workspace services need attention","settings.overview.attentionDescription":"Check the backend connection and runtime mode. The latest status will appear here after saving.","settings.backend.modeDescription":"Let Forsion manage its local service, or connect to a backend you already run.","settings.backend.modeManagedDescription":"Ready out of the box. The desktop app starts, checks and restarts it.","settings.backend.modeExternalDescription":"For an existing LAN, container or remote deployment.","settings.workspace.summary":"The default location used when creating a local session.","settings.runtime.title":"Local runtime","settings.runtime.description":"Configure the code sandbox, Python and download network. Restart the backend to apply changes.","settings.runtime.details":"About Python and network mirror behavior","settings.external.title":"External backend connection","settings.external.description":"Enter the service URL and credentials, test the connection, then save.","settings.theme.previewLabel":"Live appearance preview","settings.theme.previewChat":"Chat","settings.theme.previewWorkspace":"Forsion","settings.theme.previewTitle":"Keep ideas in flow","settings.theme.previewMessage":"Your design language, color scheme, typography and material are applied to this preview in real time.","settings.theme.previewInput":"Ask Forsion, or type / for capabilities","settings.theme.langDescription":"Choose the structure, radius, typography and overall character of the interface.","settings.theme.skinDescription":"Pick accent and background separately; same id on both = the original combined scheme.","settings.theme.behaviorTitle":"Display and motion","settings.theme.behaviorDescription":"Adjust appearance mode, interface size, depth and typing feedback.","settings.theme.flatLabel":"Shadows","settings.theme.flatOff":"Raised","settings.theme.flatOn":"Flat","settings.theme.flatDescription":"Raised adds subtle shadows. Flat hides decorative shadows.","settings.theme.glassDescription":"Add translucent blur to surfaces that support it.","settings.theme.ambient":"Tint chrome from content","settings.theme.ambientHint":"Genesis frosted chrome follows the colors of visible content. Needs frosted glass turned on. Uses more resources while scrolling and switching pages.","settings.theme.typographyTitle":"Typography","settings.sub.connection":"Connection","settings.sub.models":"Models","settings.sub.providers":"Custom providers","settings.sub.webSearch":"Web search","settings.sub.voice":"Voice","settings.sub.specialAgents":"Background agents","settings.sub.mcpServer":"MCP endpoint","settings.sub.uiSession":"UI & sessions","settings.sub.data":"Data","settings.sub.skillLibrary":"Skill library","settings.plugins.openSettings":"Settings","onboarding.agents.stepLabel":"Agents","onboarding.agents.intro":"Agents are chat personas with their own name, personality and private memory — the default agent is ready to go, and you can raise a whole roster: a work assistant, a translator, a companion, switching anytime mid-chat. Manage them fully (avatar/model/tools) later in the Agents Space.","onboarding.agents.rosterLabel":"Current roster","onboarding.agents.rosterEmpty":"Roster is empty (the default agent is created on first chat).","onboarding.agents.systemBadge":"background","onboarding.agents.createLabel":"Quick create (optional)","onboarding.agents.namePlaceholder":"Name, e.g. Qinche","onboarding.agents.personaPlaceholder":"One-line persona, e.g. a meticulous technical editor of few words","onboarding.agents.createBtn":"Create","onboarding.agents.createHint":"A name is enough; the persona line becomes its initial instructions and can be changed anytime.","onboarding.agents.created":'Created "{name}" — switch agents above the chat input.',"onboarding.agents.createFail":"Create failed: {e}","onboarding.agents.historianTitle":"Background agent: Historian","onboarding.agents.historianDesc":"Every few rounds it automatically titles the session and maintains logs & long-term memory — independent mode is fully automated; assist mode joins a background side-discussion as an archivist and lets your agent decide what to write.","onboarding.agents.historianSaveFail":"Failed to save Historian settings: {e}","onboarding.agents.moreHint":"Trigger cadence, prompt and the other background agent (Muse) live in Settings → Background agents.","onboarding.workspace.stepLabel":"Choose a default local folder","onboarding.workspace.hint":"Default working directory for new local sessions; leave empty to use the Sessions folder inside your notes library (or ~/Forsion without one).","onboarding.workspace.placeholder":"~/Forsion (default)","onboarding.workspace.pick":"Browse folder","onboarding.workspace.clear":"Clear","settings.advanced.agentDesk":"Agent Desk stage panel","settings.advanced.agentDeskHint":"A stage area beside the chat, on by default. Files the agent edits show up there automatically, and the agent can deliberately stage files, notes and mindmaps for you — and screenshot them to check its own work. Drag to resize, collapse to a card.","settings.advanced.agentDeskEnable":"Enable Agent Desk","settings.advanced.summaryOpenIn":"Clicking a file in the task overview","settings.advanced.summaryOpenInHint":"Where sources and outputs in the task overview card open.","settings.advanced.summaryOpenIn.tab":"Open in a new tab","settings.advanced.summaryOpenIn.desk":"Show in Agent Desk","desk.title":"Agent Desk","desk.close":"Close panel","tool.verb.presented":"Presented","tool.verb.sketched":"Sketched","sketch.mobileUnavailable":"This card isn't available in the mobile app (open it on desktop or web).","sketch.expand":"Expand card","sketch.collapse":"Collapse card","settings.advanced.exportLogs":"Export session logs","settings.advanced.exportLogsHint":"Bundle this session’s full conversation, the actual interface state and action trail, renderer errors and the backend runtime logs into one JSON file for developer debugging.","settings.advanced.exportBtn":"Export as JSON","settings.advanced.exportNoSession":"No active session — open a session first, then export.","settings.advanced.exportOk":"Exported to {path}","settings.advanced.exportCanceled":"Export canceled","settings.advanced.exportFailed":"Export failed: {err}","settings.clearData.label":"Clear data / Uninstall","settings.clearData.hint":"Delete Forsion data on this machine. This cannot be undone; the app restarts fresh afterward.","settings.clearData.tangu":"Tangu data & project folders (account, settings, agents, sessions, ~/Forsion)","settings.clearData.desktop":"Desktop settings (window & Amadeus shell config)","settings.clearData.btn":"Clear & restart","settings.clearData.confirm":"Clear the selected data? This cannot be undone and the app will restart.","settings.clearData.macNote":"This only clears data. To fully uninstall Forsion, drag it from Applications to the Trash.","view.changelog":"What's new","changelog.newVersion":"New version {version} available","changelog.newest":"Latest","changelog.zhOnly":"Release notes for this version are available in Chinese only.","settings.developer.testUpdateLabel":"Update popup test","settings.developer.testUpdate":"Open update tab (test)","settings.developer.testUpdateHint":"Force-open the update tab to verify the update popup renders (no real new version required).","input.fileref.session":"Past session","input.slash.loop":"Max loop iterations: /loop <n> (currently {current}, range 1-200)","input.slash.loopSet":"Max loop iterations set to {n}","input.ctxLabel":"Context","input.sessionTokens":"Session {n} tokens","input.runCost":"Run cost {used}/{limit} pts","cost.nearCap":"⚠ Run cost reached {used} pts (limit {limit}, tune TANGU_MAX_RUN_COST); the run stops once the cap is exceeded","ctx.compacted.auto":"Context auto-compacted (~{saved} chars saved)","ctx.compacted.forced":"Context reached the auto-compact threshold; summarized and compacted","ctx.compacted.overflow":"Context exceeded the model limit; summarized, compacted and retried this turn","ctx.windowSource.override":"Window: manual override table","ctx.windowSource.model":"Window: model-reported","ctx.windowSource.family":"Window: inferred from model family (not model-reported)","ctx.windowSource.learned":"Window: learned from the provider's own overflow error","ctx.windowSource.default":"Window: 272k default fallback (unknown model; set it under Settings → Models)","ctx.windowCapped":"The model supports up to {max}; {n} is used by default","ctx.sec.persona":"Persona/instructions","ctx.sec.harness":"Evolution record","ctx.sec.guidance":"Base guidance/contracts","ctx.sec.profile":"User profile","ctx.sec.project":"Project instructions","ctx.sec.agentFolder":"Agent folder/library","ctx.sec.memory":"Long-term memory","ctx.sec.skills":"Skill catalog","ctx.sec.environment":"Environment/tool catalog","ctx.sec.hooks":"Hooks context","ctx.sec.plan":"Plan mode","ctx.sec.history":"History ({n} messages)","ctx.files.label":"Instruction files loaded this run","ctx.files.truncated":"⚠ truncated over 32KB","ctx.files.none":"None (no AGENTS.md / CLAUDE.md in this project)","approval.why.customAsk":'Your approval rule "{rule}" requires asking you for this step',"approval.why.escalate":'Writes outside the workspace — this mode confirms every time ("always allow" does not apply)',"approval.why.protected":`Changes credentials or Forsion's local configuration — confirmed every time (full access and "always allow" do not skip it)`,"approval.why.always":'This action needs your confirmation every time (full access and "always allow" do not skip it)',"approval.why.mode":'The current approval mode "{mode}" requires your approval for this kind of action',"approval.why.control":'This sets up or changes work that can later run without you watching, so each call needs your confirmation ("always allow" does not apply)',"inbox.approval.withdrawnSystem":"The system withdrew this request (its stored details cannot be shown in full, or a newer request for the same action replaced it), so it cannot be approved here. Ask the agent to request it again if needed.","approval.cmdOverflow":"This command is too long to show in full; scroll to read all of it before approving.","approval.cmdWideBlank":"This command contains a long run of blank space that can push later text out of view; the full text with that space marked is shown below.","approval.previewScrollHint":"This is long; scroll to read all of it before approving.","approval.cmdHiddenChars":"This command contains invisible or direction-changing characters, so what you see may differ from what runs.","input.approval.editRules":"Edit rules…","input.approval.editRulesDesc":"Allow / ask / deny lists by tool name and argument prefix","approvalRules.loadFailed":"Couldn't load the existing rules, so the form is hidden — saving a blank form would wipe your lists.","approvalRules.title":"Custom approval rules","approvalRules.scopeNote":"⚠ Rules are global — stored in ~/.forsion/config.json and shared by all sessions; the approval mode is what you pick per session. Saved rules apply from the next tool call, no restart.","approvalRules.syntax":"Syntax: a tool name, or name* for prefix match, optionally followed by :argument-prefix (command for shell tools, path for file writes). e.g. web_fetch | mcp__* | run_bash:npm test | write_file:/etc/","approvalRules.base":"Fallback mode","approvalRules.baseHint":"Used when no rule matches (priority: deny > ask > allow > fallback)","approvalRules.deny":"Deny","approvalRules.denyHint":"Rejected outright, never asked. The model is told which rule blocked it.","approvalRules.denyPh":`write_file:/etc/
294
+ run_bash:rm -rf`,"approvalRules.ask":"Always ask me","approvalRules.askHint":'Always prompts; "always allow" does not apply (you wrote "ask me every time").',"approvalRules.askPh":`run_bash:npm publish
295
+ browser_task`,"approvalRules.allow":"Allow","approvalRules.allowHint":"Runs without asking and overrides the fallback mode. Writes outside the workspace still ask for confirmation (except under Full access); an allow rule skips that only when it has an absolute path prefix covering every write target (e.g. write_file:/Users/you/proj/). ⚠ A broad rule (run_bash, or *) still waves through everything else it matches, in every session on the custom mode.","approvalRules.allowPh":`web_fetch
296
+ mcp__*`,"pill.thinkUnsupported":"(unsupported by this model, auto-downgrades)","input.compact":"Compact context","input.compacting":"Compacting context…","input.compactDone":"Context compacted ({n} messages folded into a summary; continues compactly)","input.compactSkip":"Nothing to compact: {reason}","input.compactFail":"Compaction failed: {e}","input.slash.compact":"Compact context: summarize then continue compactly","input.slash.voiceOn":"Switch to voice messages (this Agent replies as voice)","input.slash.voiceOff":"Switch back to text messages","input.slash.voiceOnHint":"Voice messages on: this Agent’s replies will be voice (desktop voice bar; on WeChat, an audio file alongside the text).","input.slash.voiceOffHint":"Switched back to text messages.","voice.play":"Play","voice.pause":"Pause","voice.label":"Voice","voice.toText":"Show text","voice.toggleFailed":"Failed to toggle voice mode: {e}","input.slash.stop":"Stop the current run","input.slash.skillUse":"Use skill {name} for this message","input.skillChipTitle":"This skill will be used for this message","input.slash.agent":"Use a normal agent (custom persona)","input.agentActive":"Active agent: {name}","input.agentCleared":"Normal agent cleared","input.engineDefault":"Tangu","input.engineChipTitle":"Run engine","input.engineSection":"Run engine","input.engineModelDefault":"Use engine default","engine.pickTitle":"Choose the agent for this chat","engine.warming":"Starting {name}…","pill.more":"More (next page)","header.currentAgent":"Current agent","settings.tab.agentClis":"Local agent CLIs","settings.agentClis.title":"Agent CLIs","settings.agentClis.hint":"Detected third-party agents (Claude Code / Codex …). Set a default model. New chats can pick them.","settings.agentClis.detected":"Detected","settings.agentClis.needsSignin":"Needs sign-in","settings.agentClis.notDetected":"Not detected","settings.agentClis.notDetectedHint":"Install & sign in to this agent to enable it.","settings.agentClis.defaultModel":"Default model","settings.agentClis.modelDefault":"(engine default)","settings.agentClis.loadingModels":"Loading models…","settings.agentClis.empty":"No external agent engines (host-only feature).","settings.agentClis.importHint":"Importing copies it into Tangu as your own skill/MCP (survives uninstalling the CLI). MCP imports start disabled — enable them in MCP settings.","settings.agentClis.skillsLabel":"Installed skills","settings.agentClis.mcpLabel":"Installed MCP","settings.agentClis.importBtn":"Import","settings.agentClis.imported":"Imported","settings.tab.agents":"Agents","settings.agents.title":"Normal agents (custom personas)","settings.agents.hint":"Define reusable conversational personas (system prompt + model + settings) for different tasks. Agents can also self-author via the manage_agent tool.","settings.agents.new":"New agent","settings.agents.brainSection":"Brain (memory / journal / library)","settings.agents.brainSectionHint":"View and edit this agent's long-term memory, daily journal and library files.","settings.agents.openBrain":"Open brain","settings.agents.createViaChat":"Create with AI","settings.agents.createViaChatHint":"Open a new chat and let an agent build the new agent for you","settings.agents.empty":'No agents yet — click "New agent" to create one.',"settings.agents.name":"Name","settings.agents.namePlaceholder":"e.g. Code Reviewer","settings.agents.desc":"Description","settings.agents.model":"Model (empty = use session model)","settings.agents.modelDefault":"(use session model)","settings.agents.systemPrompt":"Developer instructions (what / how / must-read)","settings.agents.systemPromptPlaceholder":"You are a meticulous code reviewer…","settings.agents.thinking":"Thinking effort","settings.agents.maxIter":"Max iterations","settings.agents.approval":"Approval","settings.agents.inherit":"(inherit)","settings.agents.byAgent":"agent-authored","agent.badge.system":"Background","settings.agents.deleteConfirm":'Delete agent "{name}"?',"settings.agents.saveFail":"Save failed: {e}","settings.agents.cloudOnly":"Normal Agents are only available locally (desktop/TUI).","settings.agents.soul":"Persona (SOUL)","settings.agents.soulPlaceholder":'Calm, focused; concise replies… (tone & values, distinct from the "what to do" instructions)',"settings.agents.shareMemory":"Share the default agent's memory & log","settings.agents.shareMemoryHint":"When on, this agent reads/writes the default agent's memory & log; off (default) = its own.","settings.agents.cloudSync":"Cloud sync (mirror across devices)","settings.agents.cloudSyncHint":"When on, all of this agent's files (definition/memory/log/Library) mirror across your devices, newest wins; off (default) = local only.","settings.agents.cloudSyncOn":"Cloud sync: on","settings.agents.cloudSyncOff":"Cloud sync: off","settings.agents.activityAccess":"Allow reading the activity log","settings.agents.activityAccessHint":"Grants this agent read_activity to view your in-app activity; off (default) = Muse only.","settings.agents.toolPolicy":"Tool allow/deny list","settings.agents.toolPolicyNone":"No restriction (all tools)","settings.agents.toolPolicyDeny":"Denylist: unchecked = disabled; new engine tools allowed by default","settings.agents.toolPolicyAllow":"Allowlist: only checked tools usable; new engine tools disabled by default","settings.agents.toolPolicyHint":"Checked = usable. Governs the regular tools below only; permission-gated tools (e.g. read_activity) are unaffected.","settings.agents.toolPolicyEmpty":"Tool catalog unavailable (local engine must be running).","settings.agents.avatar":"Avatar","settings.agents.avatarHint":"Click to upload, ≤1MB (PNG/JPG/GIF/WebP); stored in this agent's Library.","settings.agents.avatarPick":"Upload avatar","settings.agents.avatarRemove":"Remove avatar","settings.agents.avatarTooLarge":"Image exceeds 1MB, please pick a smaller one.","settings.agents.avatarSaveFirst":"Save the agent first, then set an avatar.","settings.tab.shortcuts":"Shortcuts","settings.shortcuts.desc":"Click a shortcut to record, then press the key combo to set it; Esc to cancel. Each combo binds to only one command.","settings.shortcuts.commands":"Commands and shortcuts · {count}","settings.shortcuts.searchPlaceholder":"Search commands or shortcuts","settings.shortcuts.resultCount":"Showing {count}","settings.shortcuts.noResults":"No matching commands.","settings.shortcuts.commandPalette":"Command palette","settings.shortcuts.record":"Click to record shortcut","settings.shortcuts.recording":"Press keys…","settings.shortcuts.reset":"Reset to default","settings.shortcuts.clear":"Unbind","settings.shortcuts.unbound":"Not set","settings.shortcuts.resetAll":"Reset all to default","settings.shortcuts.reassigned":'Unbound this shortcut from "{name}"',"tool.verb.wrote":"Wrote","tool.verb.edited":"Edited","tool.verb.ran":"Ran","tool.verb.read":"Read","tool.verb.listed":"Listed","tool.verb.searched":"Searched","tool.verb.browsed":"Browsed","tool.sum.wrote":"Wrote {n} file(s)","tool.sum.edited":"Edited {n} file(s)","tool.sum.ran":"Ran {n} command(s)","tool.sum.read":"Read {n} item(s)","tool.sum.searched":"Searched {n}×","tool.sum.browsed":"Browsed {n}×","tool.sum.other":"{n} tool(s)","settings.agents.isDefault":"default","settings.agents.setDefault":"Set as default","settings.agents.viewMem":"View brain (memory / log / library)","settings.agents.memTitle":"{name} · Agent brain","settings.agents.memory":"Long-term memory (MEMORY.md, editable)","settings.agents.memSaved":"Saved","settings.agents.log":"Log (LOG, editable)","settings.agents.noLog":"No log yet","settings.agents.tabMemory":"Memory","settings.agents.tabLog":"Logs","settings.agents.tabLibrary":"Library","settings.agents.library":"Library (Library/, reference docs + avatar)","settings.agents.libraryEmpty":"No files yet","settings.agents.libraryUpload":"Upload","settings.agents.librarySelectHint":"Click a file to view / edit","settings.agents.libraryBinaryHint":"Binary file — preview only","settings.agents.libraryDeleteConfirm":'Delete file "{name}"?',"settings.agents.libraryTooLarge":"File exceeds 5MB","settings.agents.userProfile":"User profile (USER.md, visible to all agents)","settings.agents.userProfileHint":"Your name, preferences, level, long-term needs; every agent reads it.","settings.agents.tabHarness":"Evolution","settings.agents.harnessHint":"The evolution record holds how the agent evolves: methods it distilled from its own work and the equipment it shelved. Its own changes apply immediately and show an update card you can undo; background review and Muse's usage review also write here directly, each entry says where it came from, and all of them can be undone on this tab. Every run loads them.","settings.agents.harnessEmpty":"Nothing in the evolution record yet. Durable methods the agent works out for itself land here, written by the agent on the spot or by background review; you can also type /refine in a session with it to reflect on that conversation.","settings.agents.harnessEvidence":"Evidence: {text}","settings.agents.harnessKindNote":"Note","settings.agents.harnessKindRecipe":"Recipe","settings.agents.harnessKindEquip":"Equipment","settings.agents.harnessShelvedTools":"Shelved tools: {names}","settings.agents.harnessShelvedSkills":"Shelved skills: {names}","settings.agents.harnessCount":"Evolution record: {count} of {max} entries","settings.agents.harnessLastChange":"Last evolved {time}","settings.agents.harnessRefine":"Reflect on this conversation","settings.agents.harnessRefineSent":"Reflection started. Follow along in the conversation.","settings.agents.harnessShowAll":"Show all {count}","settings.agents.harnessLoading":"Loading the evolution record…","settings.agents.harnessLocalOnly":"The evolution record is available with the local engine only.","settings.agents.harnessHistory":"Edit history (this device)","settings.agents.harnessRollback":"Undo last change","settings.agents.harnessRestore":"Restore","settings.agents.harnessRollbackConfirm":'Undo the last change to "{title}"? (Undo again to bring it back)',"settings.agents.harnessActCreate":"Created","settings.agents.harnessActUpdate":"Edited","settings.agents.harnessActDelete":"Deleted","settings.agents.harnessActRollback":"Rolled back","settings.agents.harnessByHistorian":"Added by background review","settings.agents.harnessByMuse":"Shelved by Muse","settings.agents.harnessByUser":"Candidate you adopted","settings.agents.harnessCandidates":"Candidates: {count}","settings.agents.harnessCandidateNeedsYou":"Needs your decision","settings.agents.harnessCandidateAdopt":"Adopt","settings.agents.harnessCandidateDismiss":"Dismiss","settings.agents.harnessCandidateAdopted":"Adopted into the evolution record.","settings.agents.harnessCandidateDismissed":"Candidate dismissed.","settings.agents.harnessCandidateGone":"That candidate is no longer waiting. The list was reloaded.","settings.agents.harnessCandidateFull":"The evolution record is full ({max} entries). Remove or merge a few before adopting.","settings.agents.harnessCandidateTooLong":"This candidate is too long for one entry. Dismiss it, or ask the agent to rewrite it.","settings.agents.harnessCandidatesHint":"Methods the Historian nominated but did not write straight into the evolution record. Ones that carry a URL, a command or wording about permissions are yours to decide one by one: Adopt writes the entry, Dismiss removes the candidate. The agent reviews the rest during reflection, and you can adopt or dismiss those too.","settings.agents.selfAuthored":"Self-authored","settings.agents.sharedSkill":"Shared","agent.pickTitle":"Choose agent","settings.tab.special":"Background agents","settings.special.title":"Special Agents (background)","settings.special.hint":"On by default; once you turn one off, it stays off. Leave the model empty to follow the cloud default; records are isolated locally and never appear in the session list.","settings.special.pickModelFirst":"Pick a model before enabling","settings.special.followCloudDefault":"Follow cloud default ({model})","settings.model.imageCloudDefaultTag":"Cloud default","settings.model.imageFollowingDefault":"No manual pick — following the cloud image default: {model}. Click a model to pin your own choice; click again to unpin.","settings.special.model":"Model","settings.special.enable":"Enable","settings.special.historian":"Historian","settings.special.historianDesc":"Summarizes the session title every X rounds; reviews & updates your LOG and memory every Y rounds.","settings.special.muse":"Muse","settings.special.museDesc":"Resident background agent: wakes on heartbeat, schedules and rules and works inside its own Library; out-of-scope actions follow its permission tier, output lands in the inbox and Muse Space.","settings.special.h.rounds":"Maintain every N rounds","settings.special.h.firstRound":"Always trigger on first round","settings.special.h.harnessCandidates":"Self-evolution auto-collect","settings.special.h.harnessCandidatesHint":"The judge nominates methods an agent worked out for itself. One that reads like a working method goes straight into its evolution record; one that carries a URL, a command, or wording about permissions or credentials waits as a candidate until you adopt or dismiss it on the Evolution tab. A notification appears in the conversation you are viewing when an entry is added, and you can view or undo it on the Evolution tab.","settings.special.h.prompt":"Memory-judgment prompt (empty = default)","settings.special.m.maxIter":"Max iterations / cycle","settings.special.m.maxTodos":"Max TODOs / window","settings.special.m.activeHours":"Active hours (device local time)","settings.special.m.activeAllDay":"All day","settings.special.m.persona":'Edit its persona and instructions under "Muse" in the agent roster.',"settings.special.m.folders":"Extra folders (one absolute path per line)","settings.special.m.foldersHintAsk":"Ask / agent tiers: only a hint telling Muse to look there; writes still queue for approval per tier.","settings.special.m.foldersHintAuto":"Full auto: these folders are directly readable and writable.","settings.special.m.secRhythm":"Rhythm","settings.special.m.budget":"Budget","settings.special.m.budgetWindow":"Budget window (hours)","settings.special.m.maxCycles":"Max cycles / window","settings.special.h.mode":"Mode","settings.special.h.modeIndependent":"Independent","settings.special.h.modeAssist":"Assist","settings.special.h.modeFork":"Fork","settings.special.h.modeHintIndependent":"Historian reads the recent transcript with the model above and maintains the title, summary, log and memory on its own.","settings.special.h.modeHintAssist":"When due, branches a short background discussion with the session's agent; the main agent decides and writes itself. Title/summary are still maintained by Historian; the first round is always independent.","settings.special.h.modeHintFork":"Judges via a single tail-fork completion of the full live context using the session model (prompt-cache friendly, sees far more than Independent; falls back to Independent on failure). The model above is only used for fallback judging and memory consolidation.","settings.special.h.fallbackModel":"Fallback / consolidation model","settings.special.saved":"Saved","settings.special.saveFail":"Save failed: {e}","settings.special.on":"On","settings.special.off":"Off","settings.special.custom":"Custom","settings.special.sectionTitle":"Background agents (special)","settings.agents.sectionTitle":"Normal agents (custom personas)","settings.agents.starterTemplate":"You are … (describe this agent's identity, expertise, tone, and how it should approach tasks).","sidebar.special.title":"Background agents","special.action.title_updated":"title updated","special.action.summary_updated":"summary updated","special.action.log_appended":"log appended","special.action.memory_appended":"memory appended","special.action.memory_updated":"memory updated","special.action.assist_discussion":"assist discussion started","special.muse.title":"Muse workspace","special.muse.thinking":"Current thinking","special.muse.idle":"Muse is idle","special.muse.running":"Muse is thinking…","special.muse.disabled":"Muse is off (enable it and pick a model in Settings → Background agents).","special.muse.todos":"Muse TODO list","special.muse.todosEmpty":"No TODOs yet. Muse proposes high-value tasks after thinking in the background.","special.muse.selectAll":"Select all","special.muse.inject":"Inject selected into a session & run","special.muse.pickSession":"Pick target session…","special.muse.injected":"Injected {n} into a session and started running","special.muse.dismiss":"Dismiss","special.muse.markDone":"Mark done","special.muse.injectFail":"Inject failed: {e}","special.muse.watches":"Watch rules","special.muse.watchesAll":"All automations →","special.muse.watchesHint":'Say "keep an eye on xxx.md until it reaches 100 chars" in any chat to set one; when a rule fires, Muse wakes up and proposes a todo.',"special.muse.trigFile":'"{path}" reaches {n} chars',"special.muse.trigEvent":'activity contains "{match}"',"special.muse.trigDaily":"daily at {time}","special.muse.trigFired":"last fired {t}","special.muse.watchDelete":"Delete rule","special.muse.approvals":"Pending approvals","special.muse.approvalsEmpty":"Nothing is waiting for your approval.","special.muse.approve":"Approve & run","special.muse.reject":"Reject","special.muse.approveFail":"Could not approve: {e}","special.muse.approvalNote":"Your agent's verdict: {note}","special.muse.runNew":"Run selected in a new session","special.muse.injectPrefix":"Please handle these todos from Muse:","muse.lib.openEditor":"Open in editor","special.muse.tracks":"Tracking","special.muse.tracksEmpty":'No tracked tasks. Use "Hand to Muse" on a task card in chat to add one.',"special.muse.trackDelete":"Stop tracking","special.muse.modeLabel":"Tier","special.muse.pending":"{n} pending approval","space.muse":"Muse","muse.builtinDesc":"Muse Space: the Space Muse builds itself (a Forsion plugin it writes and improves each cycle); approve its out-of-scope actions in the side panel. Shows its workspace until it has built one.","view.museLibrary":"Muse workspace","view.museHome":"Muse Space","muse.openLibrary":"Open Muse workspace","view.musePanel":"Muse","muse.lib.empty":"Muse has not written anything yet. Once enabled, its notes, drafts and daily journal appear here.","muse.lib.refresh":"Refresh","chat.task.here":"Run here","chat.task.new":"Run in new session","chat.task.muse":"Hand to Muse","chat.task.ignore":"Ignore","chat.task.trackTag":"Track","chat.task.tracked":"Handed to Muse (visible in Calendar)","chat.task.trackFail":"Could not hand to Muse: {e}","chat.task.doneHere":"Sent here","chat.task.doneNew":"Sent to a new session","chat.task.doneMuse":"Handed to Muse","chat.task.doneIgnore":"Ignored","chat.task.showPrompt":"Show task brief","chat.task.hidePrompt":"Hide task brief","chat.task.tooLong":"The task brief is over 4000 characters and cannot be handed to Muse; split it up, or run it here or in a new session.","chat.task.museDo":"Let Muse do it","chat.task.doneMuseDo":"Handed to Muse","chat.task.handedDo":"Handed to Muse: it picks this up on its next run (subject to its active hours and budget); anything beyond its permissions comes back to you for approval","chat.task.museOff":"Muse is turned off: turn it on in Settings, or run this in a new session","chat.task.todoSyncFail":"Could not update the todo status: {e}","chat.task.doneTodo":"This todo has already been handled","chat.task.todoChecking":"Checking this todo’s status…","chat.task.todoCheckFail":"Couldn’t load this todo’s status","chat.task.todoMissing":"This todo no longer exists","special.muse.actionFail":"Action failed: {e}","special.muse.execFailed":"Approved, but the execution failed: {e}","settings.special.m.mode":"Permission tier","settings.special.m.modeAsk":"Ask (out-of-scope actions queue for your approval)","settings.special.m.modeAgent":"Agent approves (your default agent decides once on your behalf)","settings.special.m.modeAuto":"Full auto","settings.special.m.modeDesc":"All tiers work freely inside Muse's own Library; out-of-scope writes and commands follow the tier, and plugin installs always need your confirmation.","settings.special.m.heartbeat":"Heartbeat interval (minutes; 0 = wake only for schedules and rules)","settings.special.m.heartbeatHint":'The supervisor poll shrinks to match a finer heartbeat; the actual cycle count is still capped by "Max cycles / window" under Budget.',"settings.special.m.notify":"Notifications","settings.special.m.notifyMode":"Delivery","settings.special.m.notifyImmediate":"Immediate","settings.special.m.notifyDigest":"Daily digest","settings.special.m.escalateTo":"Hand hard work to","settings.special.m.escalateNone":"None","settings.customProvider.fetchModels":"Fetch models","settings.customProvider.fetchEmpty":"No models found (endpoint returned no list)","sidebar.search.placeholder":"Search chats…","sidebar.search.noResults":"No matching chats","sidebar.deleteConfirm":'Permanently delete chat "{name}"? This cannot be undone.',"chat.action.quote":"Quote","chat.action.askInPanel":"Ask in side panel","chat.selection.actions":"Selected text actions","chat.error":"Run failed","chat.llmRetrying":"Network hiccup — retrying in {s}s (attempt {n}/{max})","chat.err.network":"Cannot reach the model service (network down or server not running)","chat.err.dropped":"Connection dropped mid-response (network hiccup); reply incomplete","chat.err.timeout":"Request timed out — slow network or model","chat.err.auth":"Authentication failed — check API key or login","chat.err.rate":"Rate limited — please retry later","chat.err.server":"Model service error — please retry later","chat.err.quota":"AI quota used up — click your avatar (bottom-left) to check usage, use a reset card to restore it now, or upgrade your plan","chat.err.runCost":"This run hit its cost ceiling and was stopped automatically","chat.err.inputTooLarge":"Input too large for the model — trim it and retry","chat.err.groupAgents":"Team mode needs at least 2 valid agents","chat.err.orphaned":"Run was interrupted unexpectedly (app restart or process exit) — please retry","chat.err.engineRemote":"External engines can't be driven from a remote device — continue this chat on the host computer","chat.edit.saveResend":"Save & resend","group.voting.inProgress":"Voting…","workbench.chat":"Chat","workbench.leftSidebar":"Left sidebar","workbench.rightSidebar":"Right sidebar","theme.changeSkin":"Change accent color","theme.changeMode":"Toggle light/dark mode","theme.changeLanguage":"Switch theme style","command.palette":"Command palette (⌘K)","command.search":"Search","command.toggleSmoothCaret":"Toggle smooth caret","command.toggleLeft":"Toggle left sidebar","command.toggleRight":"Toggle right sidebar","command.toggleBottom":"Toggle bottom panel","panel.emptyTitle":"Empty panel","panel.empty":"This panel is empty, try dragging a tab here.","command.splitRight":"Split right","command.resetLayout":"Reset layout","command.stop":"Stop current run","command.compact":"Compact context","command.branch":"Branch from latest reply","command.saveLayout":"Save named layout","command.applyLayout":"Restore named layout","layout.namePrompt":"Layout name","layout.saved":"Saved layout “{name}”","layout.none":"No named layouts saved yet","layout.applyPrompt":"Enter a layout to restore: {names}","status.context":"Context","header.connecting":"Connecting…","command.placeholder":"Run a command…","command.empty":"No commands","command.select":"Select","command.run":"Run","command.count":"{count} commands","group.host":"Host","special.agents.title":"Background agents","special.memory.title":"Memory","sidebar.special.historianSub":"Summarizes titles · curates memory","sidebar.special.museSub":"Background thinking · TODOs","sidebar.wechat.setConnectedOk":"Now the connected WeChat session.","sidebar.wechat.setConnectedFail":"Failed: {e}","preview.close":"Close","preview.expand":"Expand","preview.collapse":"Collapse","preview.download":"Download","preview.notFound":"File not found","preview.loadFailed":"Failed to load","preview.notAvailable":"No preview for this file type","preview.tooLarge":"File too large ({size}) to preview","preview.htmlPreview":"Preview","view.wsfile":"File preview","preview.openWithDefault":"Open with default app","preview.unsupportedAsk":"Can't preview this file type. Open it with the system default app?","preview.expired":"Preview content expired (this kind of preview does not survive restarts). Reopen it from its source.","preview.mdEdit":"Edit","preview.openInAmadeus":"Open in Amadeus","preview.mdConflict":"File was modified externally","preview.mdReload":"Reload","preview.mdOverwrite":"Overwrite","preview.mdSaveFail":"Save failed: {err}","preview.mdSalvaged":'File was modified externally; your edits were saved as "{file}"',"panel.toast.invalidName":"Invalid name: {name}","panel.action.open":"Open","panel.action.newFile":"New file","panel.action.newFolder":"New folder","panel.action.copyPath":"Copy path","preview.htmlCode":"Source","preview.reload":"Reload","preview.openInBrowser":"Open in browser (same preview server; Forsion AI works with your account)","preview.csvTruncated":"Showing first {shown} of {total} rows","preview.slide":"Slide {n}","preview.wrap":"Wrap","preview.zoomIn":"Zoom in","preview.zoomOut":"Zoom out","preview.fit":"Fit","preview.diffSideBySide":"Side by side","preview.diffLineByLine":"Line by line","preview.pdfPages":"Showing first {n} of {total} pages — download to view all","panel.action.preview":"Preview","panel.action.deleteN":"Delete {n}","panel.confirm.trashN":"Move {n} selected items to trash?","panel.confirm.delete":'Delete "{name}"?',"panel.confirm.deleteN":"Delete {n} selected files?","panel.toast.copied":"Copied {n} item(s) to workspace","panel.toast.copyFail":"Copy failed: {err}","panel.toast.moveFail":"Move failed: {err}","settings.tab.notifications":"Notifications","settings.tab.statusbar":"Status bar","ntf.enable":"Enable notifications","ntf.delivery":"Delivery","ntf.enableHint":"Floating cards popping from the top-right; when off, everything (errors included) is silenced.","ntf.osEnable":"System notifications","ntf.osEnableHint":"Also pop an OS notification when the app is in the background (all types, not just Inbox).","ntf.sendTest":"Send test notification","ntf.testBody":"This is a test notification 👋","ntf.events":"Notification events","ntf.eventsHint":"Keep only the events worth your attention to reduce noise.","ntf.event.system":"System messages","ntf.event.syncError":"Sync failures / conflicts","ntf.event.syncDone":"Remote sync completed","ntf.event.syncDoneOnline":"Online sync completed","ntf.event.agentDone":"Background session finished","ntf.event.inbox":"New Inbox message","ntf.event.noteReminder":"Note reminders (@remind:)","ntf.event.harnessCandidates":"Background evolution-record updates and candidates","ntf.event.projectCandidates":"Project-memory candidates awaiting your decision","ntf.event.projectCompacted":"Project memory compacted when full","ntf.pluginEvents":"Plugin notifications","ntf.pluginEventsHint":"One switch per plugin (the source of ctx.notify; turn off to mute that plugin).","ntf.view":"View","ntf.syncError":"Online sync failed: {e}","ipcerr.notLoggedIn":"Not signed in to Forsion","ipcerr.loginExpired":"Your Forsion sign-in has expired. Sign in again","ipcerr.vaultMissing":"Vault folder not found: {detail}","ipcerr.mirrorMissing":"Mirror folder not found (it has sync history, so an empty one won't be created): {detail}","ipcerr.scanFailed":"Couldn't read the local folder, so this round won't treat missing files as deleted: {detail}","ipcerr.invalidSpaceId":"Invalid Space identifier","ipcerr.invalidPluginId":"Invalid plugin identifier","ipcerr.notUserPlugin":"This plugin isn't in the user plugins folder (built-in plugins can't be uninstalled)","ipcerr.pluginNotFound":"Plugin not found","ipcerr.mcpNameReserved":'The MCP server name "{detail}" is reserved: names that are dev or start with dev_ belong to device tools. Pick another name',"settings.discovery.mcpReserved":"Not imported: {names}. MCP server names that are dev or start with dev_ belong to device tools. Rename them and add them by hand on the MCP page.","ntf.syncDone":"Online sync completed","ntf.noteReminder":"Reminder · {src}","ntf.remoteSyncDone":"Remote sync done: {n} change(s)","ntf.remoteSyncFail":"Remote sync failed: {e}","ntf.remoteSyncConflicts":"Remote sync conflicts: {n} pending","ntf.remoteSyncPendingDel":"Remote sync: {n} deletion(s) awaiting confirmation","ntf.actionReview":"Review","ntf.agentDone":'"{name}" finished',"ntf.agentFail":'"{name}" failed',"ntf.harnessCandidates":'"{name}" has new evolution-record candidates. Reflect now?',"ntf.harnessConfirm":'"{name}" has evolution-record candidates awaiting your decision. They carry a URL, a command or wording about permissions, so nothing was written in the background.',"ntf.projectCandidates":'Project "{name}" has facts noted in the background that await your decision. They carry a URL, a command or wording about permissions, so they were not saved to project memory.',"ntf.projectCompacted":'Project memory for "{name}" was full, so the agent compacted it before saving the new entry. The original sentences that were merged or removed can be restored one by one in project details.',"ntf.actionRefine":"Reflect","ntf.actionView":"View","ntf.harnessAdopted":'Background review added an evolution-record entry for "{name}": {titles}. View or undo it under Evolution.',"sb.enable":"Show status bar","sb.display":"Display","sb.enableHint":"A slim bar at the bottom showing sync / backlinks / word count per current view. Off by default; it appears with just the sync status while sync is failing.","sb.items":"Status bar","sb.itemsHint":"Uncheck to hide; drag to reorder (plugin items appear here once enabled).","sb.side.left":"Front","sb.side.right":"Back","sb.item.space":"Current Space","sb.item.agentRunning":"Running sessions","sb.item.sync":"Sync status","sb.item.backlinks":"Backlinks","sb.item.wordCount":"Word count","sb.item.inbox":"Inbox unread","sb.agentRunning":"{n} running","sb.synced":"Synced","sb.syncing":"Syncing · {n}","sb.syncingPlain":"Syncing…","sb.syncProgress":"Syncing {done}/{total}","sb.syncError":"Sync error","sb.syncOffline":"Offline","sb.chars":"{n} chars","sb.backlinks":"{n} backlinks","amadeus.default.note":"Untitled","amadeus.default.dashboard":"Untitled dashboard","amadeus.default.drawing":"Untitled whiteboard","amadeus.default.database":"Untitled database","amadeus.default.folder":"New folder","amadeus.default.section":"New section","amadeus.default.pdfBookmark":"Page {page}","amadeus.new.note":"New note","amadeus.new.childNote":"New sub-note","amadeus.new.dashboard":"New dashboard","amadeus.new.dashboardIn":"New dashboard in “{folder}”","amadeus.new.drawing":"New whiteboard","amadeus.new.drawingIn":"New whiteboard in “{folder}”","amadeus.new.folder":"New folder","amadeus.new.folderIn":"New folder in “{folder}”","amadeus.new.database":"New base","amadeus.new.databaseIn":"New base in “{folder}”","amadeus.exists":"“{name}” already exists","amadeus.cmd.quickSwitch":"Quick switch note","amadeus.cmd.search":"Search notes (full text)","amadeus.cmd.tutorial":"Open the tutorial","amadeus.cmd.manual":"Open the user manual","amadeus.cmd.dailyNote":"Open today's daily note","amadeus.cmd.toggleStar":"Star / unstar current note","amadeus.cmd.toggleSource":"Toggle source / visual editing","amadeus.cmd.openVault":"Open vault…","amadeus.cmd.reveal":"Reveal current note in file manager","amadeus.cmd.reindex":"Rebuild full-text index","amadeus.cmd.toggleWikiFiles":"Toggle attachments & databases in wikilink autocomplete","amadeus.cmd.wikiFilesOn":"Wikilink autocomplete now includes attachments and databases","amadeus.cmd.wikiFilesOff":"Wikilink autocomplete now covers notes only"},Dr={zh:Eo,en:Td};function Io(e){for(const[t,n]of Object.entries(e))n.zh!=null&&(Eo[t]=n.zh),n.en!=null&&(Td[t]=n.en)}const M1={"app.defaultWorkspace":["Tangu Default Workspace","Tangu 默认工作区","Tangu default workspace"],"app.cloudWorkspace":["Cloud Workspace","Cloud 工作区","Cloud workspace"]};function FC(e){const t=Object.values(Dr).map(n=>n[e]).filter(n=>!!n);return[...new Set([...t,...M1[e]??[]])]}function $s(e,t,n){return Ed(Dr[e][t]??Dr.zh[t]??t,n)}function ie(e,t){return $s(Jt,e,t)}function DC(e,t,n){return $s(e,t,n)}function Ed(e,t){return t?e.replace(/\{(\w+)\}/g,(n,i)=>i in t?String(t[i]):`{${i}}`):e}const Po=it.createContext(null);let Jt=Ad(),vn=null;function zC(){vn?.(Jt==="zh"?"en":"zh")}function zr(){return Jt}const Mr=new Set;function j1(e){return Mr.add(e),()=>{Mr.delete(e)}}function Id(e){if(Jt!==e){Jt=e,F1(),Pd(e);for(const t of Array.from(Mr))try{t(e)}catch(n){typeof globalThis.reportError=="function"?globalThis.reportError(n):console.error("[i18n] locale subscriber failed",n)}}}function Pd(e=Jt){try{window.tangu?.reportUiLocale?.(e)}catch{}}function Od(e){if(vn){vn(e);return}try{localStorage.setItem(hi,e)}catch{}try{document.documentElement.lang=e==="zh"?"zh-CN":"en"}catch{}Id(e)}const MC=({children:e})=>{const[t,n]=it.useState(Ad),i=it.useCallback(r=>{n(r);try{localStorage.setItem(hi,r)}catch{}try{document.documentElement.lang=r==="zh"?"zh-CN":"en"}catch{}Id(r)},[]);it.useEffect(()=>(vn=i,Jt=t,()=>{vn===i&&(vn=null)}),[i,t]),it.useEffect(()=>{Pd(t)},[t]),it.useEffect(()=>{try{document.documentElement.lang=t==="zh"?"zh-CN":"en"}catch{}},[t]),it.useEffect(()=>{z1()},[]);const s=it.useMemo(()=>({locale:t,setLocale:i,t:(r,o)=>$s(t,r,o)}),[t,i]);return Os.jsx(Po.Provider,{value:s,children:e})},jC=({children:e})=>{const t=it.useSyncExternalStore(j1,zr,zr),n=it.useMemo(()=>({locale:t,setLocale:Od,t:(i,s)=>$s(t,i,s)}),[t]);return Os.jsx(Po.Provider,{value:n,children:e})};function BC(){const e=it.useContext(Po);return e||{locale:"zh",setLocale:()=>{},t:(t,n)=>Ed(Eo[t]??t,n)}}Io({"amxlinks.rewriteFailed":{zh:"已改名 / 移动,但有 {n} 篇笔记里指向它的链接没能跟着更新:{names}。请打开这些笔记检查链接。",en:"Renamed or moved, but links to it in {n} notes could not be updated: {names}. Open those notes and check the links."},"amxlinks.nameSep":{zh:"、",en:", "}});const B1=e=>(e.split("/").pop()??e).replace(/\.md$/i,"");function U1(e){if(!e.length||typeof window>"u")return;const t=e.slice(0,5).map(B1).join(ie("amxlinks.nameSep")),n=e.length>5?`${t} …`:t;window.dispatchEvent(new CustomEvent("amadeus:toast",{detail:{text:ie("amxlinks.rewriteFailed",{n:e.length,names:n}),level:"error",dedupeKey:"amxlinks.rewriteFailed"}}))}Io({"amxbridge.pageNameEmpty":{zh:"页面名不能为空",en:"Page name can't be empty"},"amxbridge.pageExists":{zh:"目标页面已存在",en:"A page with that name already exists"},"amxbridge.fileExistsAtTarget":{zh:"目标位置已存在同名文件",en:"A file with the same name already exists there"},"amxbridge.folderNameEmpty":{zh:"文件夹名不能为空",en:"Folder name can't be empty"},"amxbridge.folderExists":{zh:"同名文件夹已存在",en:"A folder with the same name already exists"},"amxbridge.folderPathEmpty":{zh:"文件夹路径不能为空",en:"Folder path can't be empty"},"amxbridge.moveIntoSelf":{zh:"不能移动到自身内部",en:"Can't move a folder into itself"},"amxbridge.folderExistsAtTarget":{zh:"目标位置已存在同名文件夹",en:"A folder with the same name already exists there"},"amxbridge.noteNameEmpty":{zh:"笔记名不能为空",en:"Note name can't be empty"},"amxbridge.noteExists":{zh:"目标笔记已存在",en:"A note with that name already exists"},"amxbridge.nameEmpty":{zh:"名称不能为空",en:"Name can't be empty"},"amxbridge.fileExists":{zh:"目标文件已存在",en:"A file with that name already exists"},"amxbridge.desktopOnly":{zh:"此操作仅桌面端可用",en:"This action is only available in the desktop app"},"amxbridge.conflictReloaded":{zh:"云端已有更新,已加载最新版本(本次未保存的修改被覆盖)",en:"A newer version was in the cloud, so it was loaded (your unsaved edits were overwritten)"},"amxbridge.renamedElsewhere":{zh:"这篇笔记已在别处改名为「{name}」,本次修改已保存到新名字",en:"This note was renamed to “{name}” elsewhere; your edits were saved under the new name"},"amxbridge.deletedElsewhere":{zh:"这篇笔记已在别处被删除或移走,本次修改没有写到云端(请另存为新笔记)",en:"This note was deleted or moved elsewhere, so your edits weren't saved to the cloud (save them as a new note)"},"amxbridge.deletedElsewhereSaved":{zh:"这篇笔记已在别处被删除或移走,本端未保存的修改已另存为「{name}」",en:"This note was deleted or moved elsewhere; your unsaved edits were saved as “{name}”"},"amxbridge.connectFailed":{zh:"云端连接失败,内容可能不是最新 —— 请刷新页面",en:"Lost the connection to the cloud, so content may be out of date — please refresh the page"},"amxbridge.tooLarge":{zh:"笔记过大,云端拒绝保存",en:"The note is too large for the cloud to save"},"amxbridge.imageNameFailed":{zh:"无法为图片分配文件名",en:"Couldn't pick a file name for the image"},"amxbridge.attachmentNameFailed":{zh:"无法为附件分配文件名",en:"Couldn't pick a file name for the attachment"},"amxbridge.invalidPath":{zh:"无效路径",en:"Invalid path"},"amxbridge.trashMissing":{zh:"回收站条目不存在",en:"This item is no longer in the trash"},"amxbridge.pathOutsideVault":{zh:"路径越出智库",en:"The path is outside the vault"},"amxbridge.readFailed":{zh:"读取文件失败(HTTP {status})",en:"Couldn't read the file (HTTP {status})"},"amxbridge.notText":{zh:"不是文本文件",en:"Not a text file"},"amxbridge.timeout":{zh:"请求超时({s}s),请检查网络后重试",en:"The request timed out ({s}s). Check your network and try again"},"amxbridge.network":{zh:"网络错误:{msg}",en:"Network error: {msg}"},"amxbridge.deviceTimeout":{zh:"设备请求超时,请检查与对方设备的连接",en:"The device didn't respond in time. Check the connection to it"},"amxbridge.deviceUnreachable":{zh:"设备不可达:{msg}",en:"Can't reach the device: {msg}"},"amxbridge.deviceRevoked":{zh:"连接权限已被对方移除",en:"The other device removed your access"},"amxbridge.deviceTooLarge":{zh:"内容过大:服务器中转通道上限 10MB,同一局域网内直连不受限",en:"Too large: the server relay is limited to 10 MB (a direct connection on the same local network has no limit)"},"amxbridge.deviceHttpError":{zh:"设备端错误(HTTP {status})",en:"Device error (HTTP {status})"},"amxbridge.deviceCallFailed":{zh:"设备端调用失败",en:"The call on the device failed"},"amxbridge.remoteOnly":{zh:"{what}:请在对方设备上操作",en:"{what}: do this on the other device"},"amxbridge.op.openPluginsFolder":{zh:"打开插件文件夹",en:"Open plugins folder"},"amxbridge.op.scaffoldSamplePlugin":{zh:"创建示例插件",en:"Create sample plugin"},"amxbridge.op.uninstallPlugin":{zh:"卸载插件",en:"Uninstall plugin"},"amxbridge.op.reveal":{zh:"在文件管理器中显示",en:"Show in file manager"}});class Fe extends Error{constructor(t,n,i){super(i??`HTTP ${t}`),this.status=t,this.body=n,this.name="HttpError"}status;body}const Re=e=>e instanceof Fe&&e.status===404,Ae=e=>e instanceof Fe&&e.status===409,xl=e=>{let t=0;return e.forEach(n=>{typeof n!="string"&&(t+=n.size)}),12e4+Math.ceil(t/256)};function H1(e){const t=e.getToken(),n=ni(e.apiBase,t),i=()=>{const o=e.getToken();if(e.signal?.aborted||!o||(n?ni(e.apiBase,o)!==n:o!==t))throw new Fe(409,{code:"ACCOUNT_CHANGED"},"Cloud account changed");return o},s=async(o,a,l)=>{const c=l?.query?`?${new URLSearchParams(l.query).toString()}`:"",d={Authorization:`Bearer ${i()}`};o!=="GET"&&(d["X-Amadeus-Client"]=e.clientId);let u;l?.form?u=l.form:l?.json!==void 0&&(d["Content-Type"]="application/json",u=JSON.stringify(l.json));const h=l?.form?xl(l.form):3e4,f=new AbortController,m=()=>f.abort(e.signal?.reason);e.signal?.addEventListener("abort",m,{once:!0});const p=setTimeout(()=>f.abort(),h);let b;try{b=await(e.request??fetch)(`${e.apiBase}${a}${c}`,{method:o,headers:d,body:u,signal:f.signal})}catch(S){throw new Fe(0,null,f.signal.aborted?ie("amxbridge.timeout",{s:Math.round(h/1e3)}):ie("amxbridge.network",{msg:S instanceof Error?S.message:String(S)}))}finally{clearTimeout(p),e.signal?.removeEventListener("abort",m)}if(i(),b.status===401)throw e.onUnauthorized(),new Fe(401,null);const w=await b.text().catch(()=>"");i();let T;try{T=w?JSON.parse(w):void 0}catch{T=w}if(!b.ok)throw new Fe(b.status,T);return T},r=(o,a,l)=>new Promise((c,d)=>{const u=new XMLHttpRequest,h=i(),f=()=>u.abort(),m=()=>e.signal?.removeEventListener("abort",f);u.open("POST",`${e.apiBase}${o}`),u.setRequestHeader("Authorization",`Bearer ${h}`),u.setRequestHeader("X-Amadeus-Client",e.clientId),u.upload.onprogress=p=>{try{i(),p.lengthComputable&&l(p.loaded,p.total)}catch(b){u.abort(),d(b)}},u.onload=()=>{m();try{i()}catch(b){d(b);return}if(u.status===401){e.onUnauthorized(),d(new Fe(401,null));return}let p;try{p=u.responseText?JSON.parse(u.responseText):void 0}catch{p=u.responseText}if(u.status<200||u.status>=300){d(new Fe(u.status,p));return}c(p)},u.onerror=()=>{m(),d(new Fe(0,null,"network error"))},u.ontimeout=()=>{m(),d(new Fe(0,null,"timeout"))},u.onabort=()=>{m(),d(new Fe(409,{code:"ACCOUNT_CHANGED"},"Cloud request cancelled"))},u.timeout=xl(a),e.signal?.addEventListener("abort",f,{once:!0}),u.send(a)});return{get:(o,a)=>s("GET",o,{query:a}),post:(o,a)=>s("POST",o,{json:a??{}}),postForm:(o,a,l)=>l?r(o,a,l):s("POST",o,{form:a}),put:(o,a)=>s("PUT",o,{json:a}),del:(o,a)=>s("DELETE",o,{query:a})}}const q1=/structure|create|delete|remove|move|rename|mkdir|rmdir|folder|binary|upload/;function W1(e){let t=null,n=e.signal?.aborted??!1,i=1e3,s=null,r=null,o=null;const a=()=>{r||(r=setTimeout(()=>{r=null,!n&&e.onStructureChange()},300))},l=()=>{if(!n){a();for(const f of new Set([e.lastLoadedPage(),...e.openPages?.()??[]]))f&&e.onPageChange(f)}},c=f=>{if(n)return;let m;try{m=JSON.parse(f)}catch{return}const p=typeof m.seq=="number"?m.seq:null;p!==null&&(o=Math.max(o??0,p));const b=typeof m.path=="string"?m.path:"",w=`${typeof m.op=="string"?m.op:""} ${typeof m.kind=="string"?m.kind:""}`.toLowerCase();if((!b||q1.test(w))&&a(),!b)return;const T=typeof m.op=="string"?m.op:"",S=typeof m.newPath=="string"&&m.newPath?m.newPath:null,C=typeof m.origin?.client=="string"&&m.origin.client===e.clientId;if(T==="move"&&S){e.onPageMoved?.(b,S,typeof m.fileSeq=="number"?m.fileSeq:null,C);return}if(T==="delete"){e.onPageDeleted?.(b);return}if((T==="rename-folder"||T==="move-folder")&&S){e.onFolderMoved?.(b,S,C);return}if(T==="delete-folder"){e.onFolderDeleted?.(b);return}const $=typeof m.origin?.client=="string"&&m.origin.client===e.clientId,v=e.knownSeq(b),A=p!==null&&v!==void 0&&p<=v;$||A||(/\.md$/i.test(b)?e.onPageChange(b):/\.db$/i.test(b)&&e.onDbChange(b))},d=()=>{if(n)return;const f=o;let m=null,p;try{const b=e.url();p=new EventSource(f===null?b:`${b}${b.includes("?")?"&":"?"}since=${f}`)}catch{u();return}t=p,p.onopen=()=>{n||(i=1e3)},p.addEventListener("hello",b=>{if(n)return;let w=null;try{const T=JSON.parse(b.data);typeof T.seq=="number"&&(w=T.seq)}catch{}f!==null&&w!==null?w<f?(o=w,l()):w>f&&(m=w):w!==null&&(o=Math.max(o??0,w))}),p.addEventListener("change",b=>c(b.data)),p.addEventListener("reset",()=>{l(),m!==null&&(o=Math.max(o??0,m)),m=null}),p.addEventListener("presence",b=>{if(!n)try{e.onPresence?.(JSON.parse(b.data))}catch{}}),p.addEventListener("presence-roster",b=>{if(!n)try{e.onPresenceRoster?.(JSON.parse(b.data))}catch{}}),p.onerror=()=>{p.close(),t===p&&(t=null),u()}},u=()=>{if(n||s)return;const f=i+Math.random()*i*.3;i=Math.min(i*2,3e4),s=setTimeout(()=>{s=null,d()},f)},h=()=>{n=!0,t?.close(),t=null,s&&clearTimeout(s),r&&clearTimeout(r),e.signal?.removeEventListener("abort",h)};return e.signal?.addEventListener("abort",h,{once:!0}),d(),h}const Xe=new Set;let $d=0;const jr=new Set;function _l(){$d++;for(const e of jr)e()}function V1(){return $d}function Z1(e){return jr.add(e),()=>jr.delete(e)}function K1(e){return Xe.add(e),_l(),()=>{Xe.delete(e),_l()}}function He(e){const t=[];let n=0;for(const i of Xe)(e==null||i.path===e)&&t.push({h:i,at:i.lastActive?.()??0,i:n++});return t.sort((i,s)=>s.at-i.at||i.i-s.i).map(i=>i.h)}function G1(e){return He(e)[0]?.scope??null}function Y1(e,t){for(const n of[...Xe])n.path===e&&n.owner!==t&&n.peerWrote?.()}function J1(e,t){const n=He(e).filter(r=>r.patchFm);n.sort((r,o)=>+!!o.dirty?.()-+!!r.dirty?.());let i=null;const s=[];for(const r of n)i?s.push(r):i=r.patchFm(t);if(i)for(const r of s)r.patchFm(t,!0);return i}async function Q1(e=!1){await Promise.all([...Xe].map(t=>e?t.flush(!0):t.flush().catch(()=>{})))}async function X1(e,t=!1){await Promise.all([...Xe].filter(n=>n.path===e).map(n=>t?n.flush(!0):n.flush().catch(()=>{})))}function e_(){for(const e of Xe)e.retire()}function t_(e,t){for(const n of He(e))if(n.insertFiles&&n.insertFiles(t)!==!1)return!0;return!1}function n_(e,t="file",n){for(const i of Xe)(t==="file"?i.path!==e:i.path!==e&&!i.path.startsWith(`${e}/`))||i.retire(n?t==="file"?n:n+i.path.slice(e.length):void 0)}function Rd(){return[...new Set([...Xe].map(e=>e.path))]}function i_(e,t){for(const n of Xe)if(n.path===e&&(n.scope??null)===t)return!0;return!1}function s_(e){for(const t of Xe)if(t.path===e)return!0;return!1}function r_(e){for(const t of He(e))if(t.bodyNow)return t.bodyNow();return null}function o_(e){for(const t of He(e))if(t.statsNow)return t.statsNow();return null}let Nd=0;const Br=new Set;function a_(){Nd++;for(const e of Br)e()}function l_(){return Nd}function c_(e){return Br.add(e),()=>Br.delete(e)}function u_(e){for(const t of He(e))if(t.headings)return t.headings();return null}function d_(e){for(const t of He(e))if(t.fmNow)return t.fmNow();return null}function f_(e,t,n){for(const i of He(e))if(i.insertMarkdown?.(t,n))return!0;return!1}function h_(){return Xe.size>0}function p_(){for(const e of Xe)if(e.insertReply)return!0;return!1}function m_(e,t){if(t)for(const n of He(t.path)){const i=n.insertReply?.(e,t.anchor??null);if(i)return{path:n.path,undo:i.undo}}for(const n of He()){const i=n.insertReply?.(e,null);if(i)return{path:n.path,undo:i.undo}}return null}function g_(e){for(const t of He(e))if(t.focusBody)return t.focusBody();return!1}function b_(e){for(const t of He(e))if(t.fmNow)return t.fmNow();return null}function y_(e,t,n=!1){for(const i of He(e))if(i.revealBlock)return i.revealBlock(t,n);return!1}function w_(e,t,n){for(const i of He(e))if(i.revealText)return i.revealText(t,n);return!1}function k_(e,t,n,i=!1){for(const s of He(e))if(s.revealHeading)return s.revealHeading(t,n,i),!0;return!1}const UC=Object.freeze(Object.defineProperty({__proto__:null,announceUnifiedWrite:Y1,bumpUnifiedStats:a_,flushUnifiedPath:X1,flushUnifiedScopes:Q1,hasUnifiedInstance:s_,insertFilesForPath:t_,registerUnifiedPipe:K1,retireAllUnifiedScopes:e_,retireUnifiedPath:n_,subscribeUnified:Z1,subscribeUnifiedStats:c_,unifiedBody:r_,unifiedFm:d_,unifiedFmNow:b_,unifiedFocusBody:g_,unifiedGen:V1,unifiedHasAny:h_,unifiedHasReplyTarget:p_,unifiedHeadings:u_,unifiedInsertMarkdown:f_,unifiedInsertReply:m_,unifiedPatchFm:J1,unifiedPaths:Rd,unifiedRevealBlock:y_,unifiedRevealHeading:k_,unifiedRevealText:w_,unifiedScopeFor:G1,unifiedScopeLive:i_,unifiedStats:o_,unifiedStatsVer:l_},Symbol.toStringTag,{value:"Module"})),v_=7e4,Sn=new Map,Ur=new Set;function Ld(){const e=Date.now();for(const[t,n]of Sn)e-n.at>v_&&Sn.delete(t);return[...Sn.values()]}function Fd(){const e=Ld();for(const t of Ur)try{t(e)}catch{}}function S_(e){const t=e;!t||typeof t.userId!="string"||(Sn.set(t.userId,{userId:t.userId,username:String(t.username??"user"),page:typeof t.page=="string"?t.page:null,at:Number(t.at)||Date.now()}),Fd())}function ur(e){if(Sn.clear(),Array.isArray(e))for(const t of e){const n=t;n&&typeof n.userId=="string"&&Sn.set(n.userId,n)}Fd()}function x_(e){return Ur.add(e),e(Ld()),()=>{Ur.delete(e)}}let Nt=null;function ds(e,t,n){if(!Nt)return e;const i=new URLSearchParams;i.set("ref",e);const s=t===void 0?Nt.activePage():t;s&&i.set("page",s),n&&i.set("lit",n);const r=Nt.assetToken();return r&&i.set("at",r),`${Nt.apiBase}/amadeus/vaults/${encodeURIComponent(Nt.vaultId())}/asset?${i.toString()}`}function __(e){if(!Nt||e.includes("#"))return null;const t=e.indexOf("?");if(t<0||!/^(https?:\/\/|\/)/.test(e)||!e.slice(0,t).endsWith(`/amadeus/vaults/${encodeURIComponent(Nt.vaultId())}/asset`))return null;const n=new URLSearchParams(e.slice(t+1)),i=n.get("ref")||null,s=n.get("lit");return i&&s&&ft(s)===ft(i)?s:i}function C_(e,t){const n=ft(e);return!n||n===e?ds(e,t?null:void 0):ds(n.includes("/")?n:`${n}/`,t?null:void 0,e)}function A_(e){Nt=e,mu(C_,__)}let Dd=()=>{};function T_(e){Dd=e}const _t=(e,t=!1)=>{try{Dd(e,t)}catch{}},Fi=()=>new Date().toISOString(),zd="amadeus.cloudVaultId";let ti=null;function E_(){return ti?ti():Promise.resolve("default")}function I_(e){const t=zi(zd),n=zi("amadeus_tree_snap"),i=zi("amadeus_last_page"),s=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,r=H1({apiBase:e.apiBase,getToken:e.getToken,clientId:s,onUnauthorized:e.onAuthError,request:e.request,signal:e.signal});let o=null,a=null;const l=()=>o??"default";async function c(){return o||a||(a=(async()=>{const g=await r.get("/amadeus/vaults");let k=null;try{k=localStorage.getItem(t)}catch{}if(k&&!g.vaults.some(O=>O.id===k))try{if((await r.get("/amadeus/shared-with-me")).items.some(L=>L.vaultId===k))return o=k,k}catch{}return o=((k?g.vaults.find(O=>O.id===k):void 0)??g.vaults.find(O=>O.id==="default")??g.vaults[0])?.id??"default",o})(),a.catch(()=>{a=null}),a)}ti=c,e.signal&&ur([]);const d=50,u=new Map,h=(g,k)=>{u.delete(g),u.set(g,k),u.size>d&&u.delete(u.keys().next().value)},f=new Map,m=new Map,p=(g,k)=>{const x=m.get(g);return x&&x.seq===k&&f.get(g)===k?x.fp:void 0},b=new Set,w=new Map,T=new Set;class S extends Error{constructor(k){super(`vanished elsewhere: ${k}`),this.path=k}path}const C=(g,k)=>{f.set(g,k),b.add(g),w.delete(g)},$=g=>{f.delete(g),u.delete(g),b.delete(g)},v=(g,k,x)=>{const O=x??f.get(g);f.delete(g),O!==void 0&&(f.set(k,O),b.add(k)),u.delete(g),u.delete(k)},A=async g=>{const k=q(g);return k!==g&&!T.has(g)&&(T.add(g),_t(ie("amxbridge.renamedElsewhere",{name:k.split("/").pop()}))),{target:k,base:await le(k)}},P=g=>{T.has(g)||(T.add(g),_t(ie("amxbridge.deletedElsewhere"),!0))},q=g=>{let k=g;const x=new Set([g]);for(let O=0;O<16;O++){const L=w.get(k);if(!L||x.has(L))break;x.add(L),k=L}return k},R=g=>{const k=q(g);return k===g?[g]:[g,k]},U=g=>{for(const k of[...w.keys()])q(k)===g&&w.delete(k)},B=(g,k,x)=>g.includes(k)?x():ne([k],x),ee=async(g,k,x)=>{if(!x)return P(g),null;const O=new Date,L=K=>String(K).padStart(2,"0"),N=`${O.getFullYear()}-${L(O.getMonth()+1)}-${L(O.getDate())} ${L(O.getHours())}${L(O.getMinutes())}`,j=g.replace(/\.md$/i,"");for(let K=0;K<5;K++){const V=`${j} (recovered ${N}${K?`-${K+1}`:""}).md`;try{await G(V,k,0)}catch(Z){if(Ae(Z))continue;throw Z}return w.set(g,V),ce(),T.has(g)||(T.add(g),_t(ie("amxbridge.deletedElsewhereSaved",{name:V.split("/").pop()}),!0)),V}throw P(g),new S(g)},oe=(g,k)=>{const x=`${g}/`;for(const[O,L]of[...f])O.startsWith(x)&&(f.delete(O),f.set(`${k}/${O.slice(x.length)}`,L));for(const O of[...u.keys()])O.startsWith(x)&&u.delete(O);for(const O of[...b]){if(!O.startsWith(x)||w.has(O))continue;const L=`${k}/${O.slice(x.length)}`;b.add(L),w.set(O,L)}},te=g=>{const k=`${g}/`;for(const x of[...f.keys()])(x===g||x.startsWith(k))&&f.delete(x);for(const x of[...u.keys()])(x===g||x.startsWith(k))&&u.delete(x);for(const x of[...b])(x===g||x.startsWith(k))&&(b.delete(x),U(x))},ue=g=>{const k=`${g}/`;for(const x of[...f.keys()])(x===g||x.startsWith(k))&&(f.delete(x),u.delete(x),U(x))},fe=6e4;let ye=null;const ce=()=>{ye=null};async function _(g=!1){const k=Date.now();if(!g&&ye&&(!ye.settled||k-ye.at<fe))return ye.promise;const x=await c(),O={at:Date.now(),promise:r.get(`/amadeus/vaults/${encodeURIComponent(x)}/tree`),settled:!1};return ye=O,O.promise.then(L=>{O.settled=!0,E(x,L),window.amadeusCloudMaxFileBytes=L.maxFileBytes},()=>{ye===O&&(ye=null)}),O.promise}const E=(g,k)=>{try{localStorage.setItem(n,JSON.stringify({v:g,tree:k}))}catch{}},I=()=>{try{const g=localStorage.getItem(n);if(!g)return null;const k=JSON.parse(g);if(typeof k.v!="string"||!k.tree||!Array.isArray(k.tree.pages)||!Array.isArray(k.tree.files)||!Array.isArray(k.tree.folders))return null;const x=localStorage.getItem(t);return x&&x!==k.v?null:k}catch{return null}},y=g=>[...g.pages,...g.files.map(k=>k.path)],z=g=>!g.split("/").some(k=>k.startsWith(".")),W=g=>{const k=e.pluginExts?.()??[];if(!k.length)return!1;const x=g.toLowerCase();return k.some(O=>x.endsWith(O))},H=g=>z(g)&&!W(g),X=new Map;function ne(g,k){const O=Promise.allSettled(g.map(N=>X.get(N)??Promise.resolve())).then(()=>k()),L=O.then(()=>{},()=>{});for(const N of g)X.set(N,L);return L.then(()=>{for(const N of g)X.get(N)===L&&X.delete(N)}),O}const pe=new Set,we=new Set,qe=new Set,Ce=g=>{for(const k of[...pe])try{k(g)}catch{}},De=()=>{for(const g of[...we])try{g()}catch{}},Xt=g=>{for(const k of[...qe])try{k(g)}catch{}},en=new Set,jn=g=>{for(const k of[...en])try{k(g)}catch{}};let et=null;const Bn=(g=l())=>`${i}:${g}`,mt=g=>{et=g;try{localStorage.setItem(Bn(),g)}catch{}},pi=()=>{try{return localStorage.getItem(Bn())||void 0}catch{return}};let Un="",gt=null;async function tn(){if(!e.signal?.aborted){gt&&(clearTimeout(gt),gt=null);try{const g=await c(),k=await r.post(`/amadeus/vaults/${encodeURIComponent(g)}/asset-token`);if(e.signal?.aborted)return;Un=k.token;const x=Math.max(60,k.ttlSec||600);gt=setTimeout(()=>{tn()},x/2*1e3)}catch{e.signal?.aborted||(gt=setTimeout(()=>{tn()},3e4))}}}A_({apiBase:e.apiBase,vaultId:l,assetToken:()=>Un,activePage:()=>et}),window.amadeusCloudVaults=async()=>{const g=await _();return ix([...g.pages,...g.files.map(k=>k.path)])};let jt=null;e.signal?.addEventListener("abort",()=>{gt&&clearTimeout(gt),gt=null,Un="",jt?.(),jt=null,ti===c&&(ti=null,ur([]))},{once:!0});function mi(g){jt||e.signal?.aborted||(jt=W1({signal:e.signal,url:()=>`${e.apiBase}/amadeus/vaults/${encodeURIComponent(g)}/events?token=${encodeURIComponent(e.getToken())}`,clientId:s,knownSeq:k=>f.get(k),lastLoadedPage:()=>et,openPages:Rd,onPageChange:k=>{u.delete(k),Ce(k)},onDbChange:k=>Xt(k),onPageMoved:(k,x,O,L)=>{w.set(k,x),v(k,x,O??void 0),L||jn({from:k,kind:"file",to:x,root:`cloud://${g}`})},onPageDeleted:k=>{f.delete(k),u.delete(k),U(k)},onFolderMoved:(k,x,O)=>{oe(k,x),O||jn({from:k,kind:"prefix",to:x,root:`cloud://${g}`})},onFolderDeleted:k=>ue(k),onStructureChange:()=>{ce(),u.clear(),De()},onPresence:S_,onPresenceRoster:ur}),window.addEventListener("beforeunload",()=>{jt?.()}))}const F=()=>`/amadeus/vaults/${encodeURIComponent(l())}/file`,M=async g=>{const k=await r.get(F(),{path:g});return C(g,k.seq),m.set(g,{seq:k.seq,fp:cn(k.content)}),k},G=async(g,k,x,O=!1)=>{const L=await r.put(F(),{path:g,content:k,baseSeq:x,...O?{force:!0}:{}});return C(g,L.seq),m.set(g,{seq:L.seq,fp:cn(k)}),u.delete(g),L},le=async g=>{const k=f.get(g);if(k!==void 0)return k;try{return(await M(g)).seq}catch(x){if(!Re(x))throw x;if(b.has(g))throw new S(g);return 0}},he=async g=>{const k=await M(g),x=ji(g,k.content,Fi());return h(g,x),x},Ge=async g=>{try{const k=f.get(g),x=await M(g);if(x.seq===k)return;h(g,ji(g,x.content,Fi())),Ce(g)}catch{}},bt=async g=>{const k=[],O=await NS({readFile:async()=>{throw new Error("not found")},writeFile:async(L,N)=>{k.push({name:L,data:N})},deleteFile:async()=>{},exists:async()=>!1,listDir:async()=>[]},g,Fi());for(const L of k){const N=Hi(Ct(g),L.name);try{await G(N,L.data,0)}catch(j){if(Ae(j))return he(N);throw j}}return ce(),h(g,O),O},tt=async g=>{try{return await he(g)}catch(k){if(Re(k)){if(b.has(g))throw new S(g);return bt(g)}throw k}};async function xt(g,k){const x=fl(k);if(!x)return null;if(x.includes("/"))return ft(Hi(Ct(g),s1(x)));const O=await _(),L=hl(y(O),x);if(L)return L;const N=await _(!0);return hl(y(N),x)}const Ye=async(g,k,x,O,L,N)=>{const j=new FormData;j.append("file",new Blob([x]),k),j.append("path",g),O&&j.append("ifAbsent","1"),N!==void 0&&j.append("baseSeq",String(N));const K=await r.postForm(`/amadeus/vaults/${encodeURIComponent(l())}/binary`,j,L);return C(K.path??g,K.seq),ce(),K},Le=async g=>{const k=await c();for(let x=0;;x++){const O=new AbortController,L=setTimeout(()=>O.abort(),3e4);let N;try{N=await(e.request??fetch)(`${e.apiBase}/amadeus/vaults/${encodeURIComponent(k)}/asset?ref=${encodeURIComponent(`${g}/`)}`,{headers:{Authorization:`Bearer ${e.getToken()}`},signal:O.signal})}catch(j){throw new Fe(0,null,O.signal.aborted?ie("amxbridge.timeout",{s:30}):ie("amxbridge.network",{msg:j instanceof Error?j.message:String(j)}))}finally{clearTimeout(L)}if(N.ok)return N;if(N.status!==404)throw new Fe(N.status,null,ie("amxbridge.readFailed",{status:N.status}));try{await r.get(F(),{path:g})}catch(j){if(Re(j))return null;if(!(j instanceof Fe&&j.body?.code==="BINARY"))throw j}if(x>=1)throw new Error(ie("amxbridge.readFailed",{status:404}))}},nt=async g=>{const k=await Le(g);return k?new TextDecoder("utf-8",{ignoreBOM:!0}).decode(await k.arrayBuffer()):null},ct=(g,k,x)=>{const O=ft(g.replace(/\\/g,"/"))?.normalize("NFC");return O?ne([O],async()=>{await c();const L=new TextEncoder().encode(k),N=Je(O),j=async Z=>{if(!Ae(Z))throw Z;return{ok:!1,current:await nt(O)}};if(x?.create)return Ye(O,N,L,!0).then(()=>({ok:!0}),j);if(typeof x?.base!="string"){await Ye(O,N,L,!1);return}const K=(await _(!0)).entries?.find(Z=>Z.path===O)?.seq??0,V=await nt(O);return cn(V??"")!==x.base?{ok:!1,current:V}:Ye(O,N,L,!1,void 0,K).then(()=>({ok:!0}),j)}):Promise.reject(new Error(ie("amxbridge.pathOutsideVault")))},$e=".trash",yt=`${$e}/.meta.json`,nn=Je(yt),Oo=g=>{try{const k=JSON.parse(g.replace(/^\uFEFF/,""));return!k||typeof k!="object"||Array.isArray(k)?null:Object.values(k).every(x=>!!x&&typeof x.original=="string")?k:null}catch{return null}},jd=async()=>{const g=await nt(yt);return(g?Oo(g):null)??{}},gi=g=>ne([yt],async()=>{let k=f.get(yt)??(await _()).entries?.find(x=>x.path===yt)?.seq??0;for(let x=0;;x++){const O=await nt(yt);let L=O?Oo(O):{};L||(await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:yt,to:`${$e}/${Date.now().toString(36)}-${nn}`}).catch(j=>{if(!Re(j))throw j}),f.delete(yt),ce(),L={},k=0);const N=JSON.stringify(L);if(g(L),JSON.stringify(L)===N)return;try{await Ye(yt,nn,new TextEncoder().encode(`${JSON.stringify(L,null,2)}
297
+ `),!1,void 0,k);return}catch(j){if(!Ae(j)||x>=3)throw j;k=Number(j.body?.seq)||0}}}),$o=async g=>y(g).includes(yt)?jd():{},bi=g=>{const k=new Set;for(const x of[...y(g),...g.folders])x.startsWith(`${$e}/`)&&k.add(x.slice($e.length+1).split("/")[0]);return k.delete(nn),k},Ro=(g,k,x)=>{if(!bi(g).has(x))return null;const O=g.folders.includes(`${$e}/${x}`);return Object.prototype.hasOwnProperty.call(k,x)?{...k[x],dir:O}:{original:x,deletedAt:0,dir:O}};let Bd=0,yi=null;const No=async()=>{const g=I();if(g){await tn(),(async()=>{for(let K=0;;K++){if(e.signal?.aborted)return;try{const V=await c();await _(!0),mi(V),De();return}catch{if(e.signal?.aborted)return;if(K>=2){_t(ie("amxbridge.connectFailed"),!0);return}await new Promise(V=>{const Z=()=>{clearTimeout(Pe),e.signal?.removeEventListener("abort",Z),V()},Pe=setTimeout(Z,[3e3,1e4][K]);e.signal?.addEventListener("abort",Z,{once:!0}),e.signal?.aborted&&Z()})}}})();let N;try{N=localStorage.getItem(Bn(g.v))||void 0}catch{}const j=g.tree.pages.filter(H);return{root:`cloud://${g.v}`,pages:j,folders:g.tree.folders.filter(z),lastPage:N&&j.includes(N)?N:void 0}}const k=await c(),[x]=await Promise.all([_(!0),tn()]);mi(k);const O=pi(),L=x.pages.filter(H);return{root:`cloud://${k}`,pages:L,folders:x.folders.filter(z),lastPage:O&&L.includes(O)?O:void 0}},Ud=(g,k,x)=>ne([g],async()=>{await c();for(let O=0;O<3;O++){let L;try{L=await M(g)}catch(N){if(Re(N))return"gone";throw N}if(cn(L.content)!==x)return{ok:!1,current:L.content};try{return await G(g,k,L.seq),{ok:!0}}catch(N){if(!Ae(N))throw N}}throw new Error("conflict")}),Hn=async(g,k,x)=>{let O=null;const L=await g1({exists:async N=>(await(O??=_(!0).then(j=>new Set(j.files.map(K=>K.path))))).has(N),read:async N=>{try{return(await M(N)).content}catch(j){if(Re(j))return null;throw j}},write:Ud},g,k,{folder:x});for(const N of L.rewritten)Ce(N);U1(L.failed.map(N=>N.path))},Lo=(g,k)=>g.pages.some(x=>x.startsWith(`${k}/`))||g.files.some(x=>x.path.startsWith(`${k}/`)),Fo=(g,k,x)=>{const O=`${k}/`,L={};for(const N of g)N.startsWith(O)&&(L[N]=`${x}/${N.slice(O.length)}`);return L};return y1({openVault:()=>No(),restoreVault:()=>No(),listPages:async()=>(await _()).pages.filter(H),listFiles:async()=>{const g=await _(),k=g.files.map(O=>O.path).filter(z),x=g.pages.filter(O=>z(O)&&W(O));return x.length?[...k,...x].sort():k},listFolders:async()=>(await _()).folders.filter(z),loadPage:async g=>{await c();const k=u.get(g);if(k)return mt(g),Ge(g),k;const x=await tt(g);return mt(g),x},readPage:async g=>{await c();try{return await he(g)}catch(k){throw Re(k)?new Error(`note not found: ${g}`):k}},newPage:async g=>{await c();const k=await ne([g],()=>bt(g));return mt(g),k},savePage:(g,k,x)=>{const O=R(g);return ne(O,async()=>{await c();const L=Ar(k,x),N=Object.values(x).some(V=>typeof V=="string"&&V.trim().length>0);let j,K;try{({target:j,base:K}=await A(g))}catch(V){if(V instanceof S){await ee(g,L,N);return}throw V}await B(O,j,async()=>{try{await G(j,L,K),h(j,ji(j,L,Fi()))}catch(V){if(Ae(V)){const Z=V.body;if(Z?.code==="CONFLICT"&&Z.seq===0){f.delete(j),await ee(g,L,N);return}Z&&typeof Z.seq=="number"&&C(j,Z.seq),u.delete(g),_t(ie("amxbridge.conflictReloaded"),!0),setTimeout(()=>Ce(g),0);return}throw V instanceof Fe&&V.status===413&&_t(ie("amxbridge.tooLarge"),!0),V}})})},renamePage:(g,k,x,O)=>{let L=null;return ne([g,Di(g,k,ie("amxbridge.pageNameEmpty"))],async()=>{await c();const N=Di(g,k,ie("amxbridge.pageNameEmpty"));if(N===g)return{newPath:g,page:await he(g)};const j=await _(!0);if(L=j.pages.filter(H),y(j).includes(N)||j.folders.includes(N))throw new Error(ie("amxbridge.pageExists"));const K=Ar(x,O);await G(g,K,await le(g),!0);let V;try{V=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:g,to:N})}catch(Z){throw Ae(Z)?new Error(ie("amxbridge.pageExists")):Z}return v(g,N,V.seq),ce(),mt(N),{newPath:N,page:null}}).then(async N=>N.page?{newPath:N.newPath,page:N.page}:(L&&await Hn({[g]:N.newPath},L),{newPath:N.newPath,page:await he(N.newPath)}))},reconcilePage:async g=>(await c(),tt(g)),saveAsset:async(g,k,x,O)=>{await c();const L=Nr(k),N=(L||".png").toLowerCase().replace(/[^.a-z0-9]/g,""),j=Je(k).slice(0,Je(k).length-L.length).replace(/[^a-zA-Z0-9_-]/g,"").slice(0,24)||"img";for(let K=0;K<5;K++){const V=`${j}-${Date.now().toString(36)}-${(Bd++).toString(36)}${N||".png"}`,Z=ft(Hi(Ct(g),`.amadeus/${V}`));if(Z===null)throw new Error("Asset escapes vault");try{return await Ye(Z,V,x,!0,O),`.amadeus/${V}`}catch(Pe){if(Ae(Pe))continue;throw Pe}}throw new Error(ie("amxbridge.imageNameFailed"))},saveAttachment:async(g,k,x,O,L)=>{await c();const N=(Je(k)||"file").replace(/[\\/]/g,""),{destDirRel:j}=pl(g,N,O),K=await _(!0),V=new Set(y(K).filter(_e=>Ct(_e)===j).map(_e=>Je(_e).toLowerCase()));let Z=ml(V,N);const Pe=ar(N);for(let _e=0;_e<20;_e++){const{fileVaultRel:Ot,pageRel:sn}=pl(g,Z,O),Rs=ft(Ot);if(Rs===null)throw new Error("Asset escapes vault");try{return Pe?await G(Rs,new TextDecoder().decode(x),0):await Ye(Rs,Z,x,!0,L),{pageRel:sn,base:Z}}catch(Do){if(Ae(Do)){V.add(Z.toLowerCase()),Z=ml(V,N);continue}throw Do}}throw new Error(ie("amxbridge.attachmentNameFailed"))},openAttachment:async(g,k)=>{await c(),window.open(ds(fl(k),g),"_blank","noopener")},openVaultFile:async g=>{await c(),window.open(ds(g,null),"_blank","noopener")},exportPdf:async()=>(window.print(),null),onExternalChange:g=>(pe.add(g),()=>{pe.delete(g)}),onStructureChange:g=>(we.add(g),()=>{we.delete(g)}),onDbExternalChange:g=>(qe.add(g),()=>{qe.delete(g)}),onPathGone:g=>(en.add(g),()=>{en.delete(g)}),search:async g=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/search`,{q:g})).filter(x=>z(x.path))),backlinks:async g=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/backlinks`,{path:g})),reindex:async()=>{await c(),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/reindex`)},listTags:async()=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/tags`)),pagesByTag:async g=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/tags/pages`,{tag:g})).paths),resolveEmbed:async(g,k)=>{await c();const{note:x,subpath:O}=G0(g),L=(await _()).pages.filter(H).sort(),N=x?Ui(x,L,k):k&&L.includes(k)?k:null;if(N){let V=null;try{V=(await M(N)).content}catch(Z){if(!Re(Z))throw Z}if(V!=null){if(!O)return{owner:N,content:Za(V),type:"markdown"};const Z=_d(V,O.trim().replace(/\.block$/i,"").toLowerCase())??n1(Za(V),O);return Z==null?null:{owner:N,content:Z,type:"markdown"}}}const j=O?`${x}#${O}`:x;return j?await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/embed`,{target:j})??null:null},blockBacklinks:async g=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/block-backlinks`,{target:g})),deletePage:g=>ne([g],async()=>{await c(),await r.del(F(),{path:g}),$(g),ce()}),movePage:(g,k)=>{let x=null;return ne([g],async()=>{await c();const O=$l(g),L=k.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),N=L?`${L}/${O}`:O;if(N===g)return g;N.endsWith(".md")&&(x=(await _(!0)).pages.filter(H));let j;try{j=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:g,to:N})}catch(K){throw Ae(K)?new Error(ie("amxbridge.fileExistsAtTarget")):K}return v(g,N,j.seq),ce(),N.endsWith(".md")&&mt(N),N}).then(async O=>(O!==g&&x&&await Hn({[g]:O},x),O))},createFolder:async(g,k)=>{await c();const x=k.trim().replace(/[\\/]/g,"");if(!x)throw new Error(ie("amxbridge.folderNameEmpty"));const O=g.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");try{const L=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{parent:O,name:x});return ce(),L.path}catch(L){throw Ae(L)?new Error(ie("amxbridge.folderExists")):L}},renameFolder:async(g,k)=>{await c();const x=k.trim().replace(/[\\/]/g,"");if(!x)throw new Error(ie("amxbridge.folderNameEmpty"));const O=Ct(g);if((O?`${O}/${x}`:x)===g)return g;const N=await _(!0),j=N.pages.filter(H),K=Lo(N,g);let V;try{V=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:g,newName:x})}catch(Z){throw Ae(Z)?new Error(ie("amxbridge.folderExists")):Z}return oe(g,V.path),et&&et.startsWith(`${g}/`)&&mt(`${V.path}${et.slice(g.length)}`),ce(),await Hn(Fo(j,g,V.path),j,K?[g,V.path]:void 0),V.path},deleteFolder:async g=>{await c(),await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:g}),te(g),ce()},moveFolder:async(g,k)=>{await c();const x=g.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),O=Je(x);if(!O)throw new Error(ie("amxbridge.folderPathEmpty"));const L=k.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if((L?`${L}/${O}`:O)===x)return x;if(L===x||L.startsWith(`${x}/`))throw new Error(ie("amxbridge.moveIntoSelf"));const j=await _(!0),K=j.pages.filter(H),V=Lo(j,x);let Z;try{Z=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:x,dest:L})}catch(Pe){throw Ae(Pe)?new Error(ie("amxbridge.folderExistsAtTarget")):Pe}return oe(x,Z.path),et&&et.startsWith(`${x}/`)&&mt(`${Z.path}${et.slice(x.length)}`),ce(),await Hn(Fo(K,x,Z.path),K,V?[x,Z.path]:void 0),Z.path},trashEntry:async g=>{await c();const k=g.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if(!k||k===$e||k.startsWith(`${$e}/`))throw new Error(ie("amxbridge.invalidPath"));const x=await _(!0),O=x.folders.includes(k),L=Date.now().toString(36);try{if(O){let N=k,j=Je(k);if(j===nn||x.folders.includes(`${$e}/${j}`)){const K=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:k,newName:`${j} (${L})`});N=K.path,j=Je(K.path)}await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:N,dest:$e}),te(k),await gi(K=>{K[j]={original:k,deletedAt:Date.now(),dir:!0}})}else{let N=k.replace(/\//g,"__");(N===nn||y(x).includes(`${$e}/${N}`))&&(N=`${L}-${N}`),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:k,to:`${$e}/${N}`}),$(k),await gi(j=>{j[N]={original:k,deletedAt:Date.now(),dir:!1}})}}finally{ce()}},listTrash:async()=>{await c();const g=await _(),k=await $o(g);return[...bi(g)].map(x=>({name:x,...Ro(g,k,x)})).sort((x,O)=>O.deletedAt-x.deletedAt)},restoreTrash:async g=>{await c();const k=await _(!0),x=Ro(k,await $o(k),g);if(!x)throw new Error(ie("amxbridge.trashMissing"));const O=N=>y(k).includes(N)||k.folders.includes(N);let L=x.original;for(let N=2;O(L);N++)if(x.dir)L=`${x.original} (${N})`;else{const j=Nr(x.original);L=`${x.original.slice(0,x.original.length-j.length)} (${N})${j}`}if(x.dir){const N=`${$e}/${g}`,j=Je(L),K=Ct(L),V=(Z,Pe)=>r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/${Z}`,Pe);g===j?await V("move",{path:N,dest:K}):j!==nn&&!bi(k).has(j)?await V("move",{path:(await V("rename",{path:N,newName:j})).path,dest:K}):(await V("move",{path:N,dest:K}),await V("rename",{path:K?`${K}/${g}`:g,newName:j}))}else await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:`${$e}/${g}`,to:L});return await gi(N=>{delete N[g]}),ce(),L},deleteTrashEntry:async g=>{await c();const k=await _(!0);bi(k).has(g)&&(k.folders.includes(`${$e}/${g}`)?await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:`${$e}/${g}`}).catch(x=>{if(!Re(x))throw x}):await r.del(F(),{path:`${$e}/${g}`}).catch(x=>{if(!Re(x))throw x})),await gi(x=>{delete x[g]}),ce()},emptyTrash:async()=>{await c(),await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:$e}).catch(g=>{if(!Re(g))throw g}),te($e),ce()},saveVaultBytes:async(g,k)=>{await c();const x=ft(g.replace(/\\/g,"/"));if(!x)throw new Error(ie("amxbridge.pathOutsideVault"));await Ye(x,Je(x),k,!1)},readVaultBytes:async g=>{const k=ft(g.replace(/\\/g,"/")),x=k?await Le(k):null;if(!x)throw new Error(ie("amxbridge.readFailed",{status:404}));return new Uint8Array(await x.arrayBuffer())},fetchLinkMeta:async g=>{try{return await r.get("/amadeus/link-meta",{url:g})}catch{return null}},searchImages:async g=>{const k=g.trim();if(!k)return[];const x=await fetch(`https://api.openverse.org/v1/images/?q=${encodeURIComponent(k)}&page_size=20`,{headers:{accept:"application/json"}});if(!x.ok)throw new Error(`openverse HTTP ${x.status}`);return((await x.json()).results??[]).map(L=>({thumb:L.thumbnail??"",full:L.url??"",author:L.creator})).filter(L=>L.thumb&&L.full)},listPlugins:async()=>[],openPluginsFolder:async()=>{_t(ie("amxbridge.desktopOnly"))},scaffoldSamplePlugin:async()=>{_t(ie("amxbridge.desktopOnly"))},revealInFileManager:async()=>{_t(ie("amxbridge.desktopOnly"))},hostCaps:{revealInFileManager:!1},readDatabase:async(g,k)=>{await c();const x=await xt(g,k);if(!x)return{status:"missing"};let O;try{O=await M(x)}catch(N){if(Re(N))return{status:"missing"};if(N instanceof Fe&&N.status===400)return{status:"corrupt",path:x,message:ie("amxbridge.notText")};throw N}const L=Su(O.content);return L.ok?{status:"ok",path:x,data:L.data}:{status:"corrupt",path:x,message:L.error}},writeDatabase:(g,k)=>ne([g],async()=>{await c();const x=vu.parse(k),O=cx(x),L=await le(g);try{await G(g,O,L)}catch(N){if(Ae(N)){try{await M(g)}catch{}setTimeout(()=>Xt(g),0);return}throw N}}),readDrawing:async(g,k)=>{await c();const x=await xt(g,k)??await xt(g,`${k}.md`);if(!x)return{status:"missing"};for(const O of x.endsWith(".md")?[x]:[x,`${x}.md`])try{const L=await M(O);return{status:"ok",path:O,source:L.content}}catch(L){if(!Re(L))throw L}return{status:"missing"}},writeDrawing:(g,k)=>ne([g],async()=>{await c();const x=await le(g);try{await G(g,k,x)}catch(O){if(!Ae(O))throw O;try{const N=await M(g),j=Ja(k),K=Ja(N.content),V=j?JSON.parse(j.sceneJson):null,Z=K?JSON.parse(K.sceneJson):null;if(V&&Z){const Pe=dx(N.content,JSON.stringify(bx(V,Z)));if(Pe){await G(g,Pe,N.seq);return}}}catch{}const L=O.body;L&&typeof L.seq=="number"&&C(g,L.seq),await G(g,k,f.get(g)??0,!0)}}),readTextFile:async g=>{if(await c(),!ar(g)){const k=ft(g.replace(/\\/g,"/"));return k?nt(k):null}try{return(await M(g)).content}catch(k){if(Re(k))return null;throw k}},writeTextFile:(g,k,x)=>{if(!ar(g))return ct(g,k,x);const O=R(g),L=typeof x?.base=="string"?x.base:null,N=()=>L!=null?{ok:!0}:void 0;return ne(O,async()=>{if(await c(),x?.create){try{return await G(g,k,0),w.delete(g),ce(),{ok:!0}}catch(Z){if(!Ae(Z))throw Z}try{return{ok:!1,current:(await M(g)).content}}catch(Z){if(Re(Z))return{ok:!1,current:null};throw Z}}const j=k.trim().length>0;let K,V;try{({target:K,base:V}=await A(g))}catch(Z){if(Z instanceof S)return await ee(g,k,j),N();throw Z}if(L!=null){const Z=L;return B(O,K,async()=>{const Pe=async()=>{let _e;try{_e=await M(K)}catch(Ot){if(Re(Ot))return"vanished";throw Ot}return cn(_e.content)===Z?_e.seq:{ok:!1,current:_e.content}};if(V>0&&p(K,V)!==Z){const _e=await Pe();if(_e==="vanished")return await ee(g,k,j),N();if(typeof _e!="number")return _e;V=_e}for(let _e=0;;_e++)try{return await G(K,k,V),{ok:!0}}catch(Ot){if(!Ae(Ot))throw Ot;const sn=await Pe();if(sn==="vanished")return await ee(g,k,j),N();if(typeof sn!="number")return sn;if(_e>=2)throw Ot;V=sn}})}await B(O,K,async()=>{try{await G(K,k,V)}catch(Z){if(!Ae(Z))throw Z;let Pe;try{Pe=await M(K)}catch(_e){if(Re(_e)){await ee(g,k,j);return}throw _e}await G(K,k,Pe.seq,!0)}})})},listPageProps:async g=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/page-props`,{folder:g})).map(x=>({path:x.path,title:x.title,fm:cl(x.fmExtra||"")}))),pageIcons:async()=>{await c();const g=await _();if(yi&&yi.seq===g.seq)return yi.icons;const k=await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/page-props`,{folder:"",all:"1"}),x={};for(const O of k){const L=cl(O.fmExtra||"").icon;typeof L=="string"&&L&&(x[O.path]=L)}return yi={seq:g.seq,icons:x},x},setPageFrontmatter:(g,k)=>ne([g],async()=>{await c();const x=async()=>{let O;try{O=await M(g)}catch(N){if(Re(N))return"ok";throw N}const L=I0(O.content,k);if(L===O.content)return"ok";try{return await G(g,L,O.seq),"ok"}catch(N){if(Ae(N))return"conflict";throw N}};if(await x()==="conflict")try{await x()}catch{}}),renamePageFile:(g,k)=>{let x=null;return ne([g,Di(g,k,ie("amxbridge.noteNameEmpty"))],async()=>{await c();const O=Di(g,k,ie("amxbridge.noteNameEmpty"));if(O===g)return g;x=(await _(!0)).pages.filter(H);let L;try{L=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:g,to:O})}catch(N){throw Ae(N)?new Error(ie("amxbridge.noteExists")):N}return v(g,O,L.seq),ce(),O}).then(async O=>(O!==g&&x&&await Hn({[g]:O},x),O))},renameDbFile:(g,k)=>ne([g],async()=>{await c();const x=g.replace(/\\/g,"/");let O=k.trim().replace(/[\\/]/g,"");if(O.toLowerCase().endsWith(".db")&&(O=O.slice(0,-3)),!O)throw new Error(ie("amxbridge.nameEmpty"));const L=Ct(x),N=L?`${L}/${O}.db`:`${O}.db`;if(N===x)return{newPath:N,rewrittenPages:[]};let j;try{j=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:x,to:N})}catch(K){throw Ae(K)?new Error(ie("amxbridge.fileExists")):K}return v(x,N,j.seq),ce(),{newPath:N,rewrittenPages:[]}})})}function Di(e,t,n){const i=Ct(e);let s=t.trim().replace(/[\\/]/g,"");if(!s)throw new Error(n);return s.toLowerCase().endsWith(".md")&&(s=s.slice(0,-3)),i?`${i}/${s}.md`:`${s}.md`}const P_=async e=>{if(!e.ok){let t=null;try{t=await e.json()}catch{}const n=new Error(t?.detail||`http ${e.status}`);throw n.status=e.status,n.code=t?.code,n}return e.json()};function O_(e){const t=zi(zd),n=e.getToken(),i=ni(e.apiBase,n),s=()=>{const p=e.getToken();if(e.signal?.aborted||!p||(i?ni(e.apiBase,p)!==i:p!==n))throw new Error("Cloud account changed");return p},r=async(p,b,w)=>{const T=s(),S=new AbortController,C=()=>S.abort(e.signal?.reason);e.signal?.addEventListener("abort",C,{once:!0});const $=setTimeout(()=>S.abort(),2e4);try{const v=await P_(await(e.request??fetch)(`${e.apiBase}/amadeus${b}`,{method:p,headers:{Authorization:`Bearer ${T}`,...w!==void 0?{"Content-Type":"application/json"}:{}},body:w!==void 0?JSON.stringify(w):void 0,signal:S.signal}));return s(),v}finally{clearTimeout($),e.signal?.removeEventListener("abort",C)}},o=()=>E_();let a=e.linkBase?.replace(/\/+$/,"")||null;const l=async()=>{if(a)return a;try{a=((await r("GET","/collab/link-base")).webOrigin??"").trim().replace(/\/+$/,"")||location.origin}catch{a=location.origin}return a},c=()=>a??location.origin;e.signal?.aborted||l();const d=()=>{if(s(),e.getUserId)return e.getUserId();try{const p=e.getToken().split(".")[1],b=JSON.parse(atob(p.replace(/-/g,"+").replace(/_/g,"/")));return typeof b.userId=="string"?b.userId:null}catch{return null}};let u=null,h=null;const f=()=>{u&&(clearInterval(u),u=null)};e.signal?.addEventListener("abort",f,{once:!0});const m=()=>{e.signal?.aborted||o().then(p=>r("POST",`/vaults/${encodeURIComponent(p)}/presence`,{page:h})).catch(()=>{})};window.amadeusCollab={listVaults:()=>r("GET","/vaults").then(p=>p.vaults),activeVaultId:o,switchVault(p){s();try{localStorage.setItem(t,p)}catch{}location.reload()},pageShare:async p=>r("GET",`/vaults/${encodeURIComponent(await o())}/page-shares?path=${encodeURIComponent(p)}`),createPageShare:async(p,b)=>r("POST",`/vaults/${encodeURIComponent(await o())}/page-shares`,{path:p,...b}),updatePageShare:async(p,b)=>r("PATCH",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}`,b),revokePageShare:async p=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}`)},setParticipantRole:async(p,b,w)=>{await r("PATCH",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}/members/${encodeURIComponent(b)}`,{role:w})},removeParticipant:async(p,b)=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}/members/${encodeURIComponent(b)}`)},sharedWithMe:()=>r("GET","/shared-with-me").then(p=>p.items),leaveShare:async p=>{const b=d();b&&await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}/members/${encodeURIComponent(b)}`)},inviteUrl:p=>`${c()}/invite/${p}`,publishes:async()=>r("GET",`/vaults/${encodeURIComponent(await o())}/shares`),createPublish:async(p,b)=>{const w=await r("POST",`/vaults/${encodeURIComponent(await o())}/shares`,{mode:p,path:b});return{...w,url:`${c()}/share/${w.token}`}},revokePublish:async p=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/shares/${encodeURIComponent(p)}`)},publishUrl:p=>`${c()}/share/${p}`,revokePublishIn:async(p,b)=>{await r("DELETE",`/vaults/${encodeURIComponent(p)}/shares/${encodeURIComponent(b)}`)},revokePageShareIn:async(p,b)=>{await r("DELETE",`/vaults/${encodeURIComponent(p)}/page-shares/${encodeURIComponent(b)}`)},listAllShares:async()=>{const p=(await r("GET","/vaults")).vaults||[],b=d(),w=[],T=[];for(const S of p){try{const C=await r("GET",`/vaults/${encodeURIComponent(S.id)}/shares`);for(const $ of C.shares||[])w.push({...$,vaultId:S.id,vaultName:S.name||""})}catch{}try{const C=await r("GET",`/vaults/${encodeURIComponent(S.id)}/page-shares`),$=C?.shares||C?.pageShares||(Array.isArray(C)?C:[]);for(const v of $){const A=v.created_by??v.createdBy;(!b||!A||A===b)&&T.push({...v,vaultId:S.id,vaultName:S.name||""})}}catch{}}return{publishes:w,pageShares:T,linkBase:await l()}},heartbeat(p){s(),h=p,m(),u||(u=setInterval(m,3e4))},stopHeartbeat:f,onPresence:p=>x_(p),myUserId:d}}Io({"unit.bootError.title":{zh:"暂时无法打开此 Unit",en:"Unable to open this Unit"},"unit.bootError.detail":{zh:"请检查连接后重试。",en:"Check your connection and try again."},"unit.bootError.retry":{zh:"重试",en:"Try again"}});function Md(){const e=document.getElementById("root")??document.body.appendChild(document.createElement("main")),t=document.createElement("section");t.setAttribute("role","alert");const n=document.documentElement.dataset.mode==="dark";t.style.cssText='max-width:440px;margin:15vh auto;padding:24px;font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif',t.style.color=`var(--text,${n?"#f2efe8":"#1c1c1c"})`,t.style.colorScheme=n?"dark":"light";const i=document.createElement("h1");i.textContent=ie("unit.bootError.title"),i.style.cssText="font-size:20px;font-weight:600;margin:0 0 8px";const s=document.createElement("p");s.textContent=ie("unit.bootError.detail"),s.style.cssText="margin:0 0 20px;color:var(--text-muted,inherit)";const r=document.createElement("button");r.type="button",r.textContent=ie("unit.bootError.retry"),r.style.cssText="font:inherit;padding:7px 16px;cursor:pointer",r.addEventListener("click",()=>location.reload()),t.append(i,s,r),e.replaceChildren(t),r.focus()}function $_(e,t){if(e.origin!==t.origin||!e.pathname.startsWith(t.pathname))return null;const n=/^(share|invite)\/([^/]+)\/?$/.exec(e.pathname.slice(t.pathname.length));return n?{kind:n[1],token:decodeURIComponent(n[2])}:null}const Cl=()=>dt(async()=>{const{useApp:e}=await import("./appStore-CidPWYa0.js").then(t=>t.sr);return{useApp:e}},__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(({useApp:e})=>{T_((t,n)=>e.getState().toast(t,n))});async function R_(){const e=location.pathname;if(window.__FORSION_UNIT_PAGE__){const t=window.__FORSION_UNIT_PAGE__,n=new URL(".",document.baseURI),i=$_(new URL(location.href),n);if(i&&t.capabilities?.amadeus){const s=new URL(t.capabilities.amadeus.apiBase,location.origin).href.replace(/\/+$/,"");if(i.kind==="share"){const{mountSharePage:r}=await dt(async()=>{const{mountSharePage:o}=await import("./sharePage-C2Yqx0NQ.js");return{mountSharePage:o}},[],import.meta.url);r(i.token,{apiBase:s})}else{if(!t.account)throw new Error("Invitations require an account provider");const{installUnitAccount:r}=await dt(async()=>{const{installUnitAccount:l}=await import("./unitAccount-BIAIxKNp.js");return{installUnitAccount:l}},[],import.meta.url),o=await r({instanceId:t.instanceId,account:t.account},n);if(!o.account.getIdentity()){await o.login();return}const{mountInvitePage:a}=await dt(async()=>{const{mountInvitePage:l}=await import("./invitePage-Dgl3-c_m.js");return{mountInvitePage:l}},__vite__mapDeps([5,3]),import.meta.url);a(i.token,{apiBase:s,getToken:o.account.getToken,request:o.capability.request,appBase:n.href})}return}dt(()=>import("./unitShim-CY8EVkKD.js"),[],import.meta.url).then(async s=>{if(!await s.installUnitShim())return;let r=!1;try{r=(new URLSearchParams(location.search).get("ui")||localStorage.getItem("lcl.uiMode"))==="mobile"}catch{}await(r?dt(()=>import("./mobileEntry-5UaAITwY.js"),__vite__mapDeps([6,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82]),import.meta.url):dt(()=>import("./main-D7CEGndC.js"),__vite__mapDeps([83,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,84]),import.meta.url)),t.capabilities?.amadeus&&await Cl()}).catch(s=>{console.error("[unit-page] bootstrap failed:",s),Md()})}else if(e.startsWith("/share/"))dt(()=>import("./sharePage-C2Yqx0NQ.js"),[],import.meta.url).then(t=>t.mountSharePage(decodeURIComponent(e.slice(7)).replace(/\/+$/,""))).catch(t=>console.error("[tangu-web] share page failed:",t));else if(e.startsWith("/invite/"))await Jd()&&dt(()=>import("./invitePage-Dgl3-c_m.js"),__vite__mapDeps([5,3]),import.meta.url).then(t=>t.mountInvitePage(decodeURIComponent(e.slice(8)).replace(/\/+$/,""))).catch(t=>console.error("[tangu-web] invite page failed:",t));else if(await Qd()){window.amadeus=I_({apiBase:_n(),getToken:Mo,onAuthError:Il}),O_({apiBase:_n(),getToken:Mo});let t=!1;try{t=(new URLSearchParams(location.search).get("ui")||localStorage.getItem("lcl.uiMode"))==="mobile"}catch{}(t?dt(()=>import("./mobileEntry-5UaAITwY.js"),__vite__mapDeps([6,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82]),import.meta.url):dt(()=>import("./main-D7CEGndC.js"),__vite__mapDeps([83,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,84]),import.meta.url)).then(Cl).catch(n=>console.error("[tangu-web] bootstrap failed:",n))}}R_().catch(e=>{console.error("[tangu-web] Account bootstrap failed:",e),window.__FORSION_UNIT_PAGE__&&Md()});export{E1 as $,an as A,j1 as B,zC as C,eC as D,p_ as E,m_ as F,Z1 as G,h_ as H,eu as I,tC as J,zr as K,MC as L,jC as M,Zd as N,NC as O,cn as P,EC as Q,CC as R,IC as S,AC as T,dc as U,B0 as V,Aw as W,tu as X,Ve as Y,D1 as Z,dt as _,Mo as a,ef as a$,T1 as a0,A1 as a1,C1 as a2,_1 as a3,LC as a4,hi as a5,Od as a6,lf as a7,af as a8,Ji as a9,M0 as aA,w_ as aB,Pl as aC,Ar as aD,G1 as aE,g_ as aF,s_ as aG,Xd as aH,Y_ as aI,J_ as aJ,aC as aK,Qs as aL,cC as aM,lx as aN,Hi as aO,Ja as aP,bx as aQ,dx as aR,vC as aS,f_ as aT,d_ as aU,Nk as aV,DC as aW,uo as aX,iu as aY,AS as aZ,su as a_,of as aa,Ol as ab,Q1 as ac,n_ as ad,oC as ae,J1 as af,bC as ag,kd as ah,L0 as ai,G_ as aj,lC as ak,V1 as al,u_ as am,k_ as an,c_ as ao,l_ as ap,o_ as aq,r_ as ar,V0 as as,yC as at,A0 as au,Mn as av,nC as aw,iC as ax,H0 as ay,y_ as az,zi as b,q_ as b$,jo as b0,cf as b1,cl as b2,b_ as b3,ji as b4,ks as b5,je as b6,Kt as b7,Ne as b8,Y as b9,x1 as bA,uC as bB,dC as bC,ao as bD,qa as bE,I0 as bF,fd as bG,lo as bH,a_ as bI,rC as bJ,hd as bK,E0 as bL,W_ as bM,p1 as bN,X1 as bO,F0 as bP,On as bQ,hu as bR,rs as bS,K0 as bT,SC as bU,G0 as bV,V_ as bW,Z_ as bX,YS as bY,K1 as bZ,i_ as b_,lc as ba,Su as bb,L_ as bc,Ke as bd,Zw as be,wb as bf,F_ as bg,ge as bh,st as bi,bs as bj,Qe as bk,$w as bl,de as bm,Q as bn,ys as bo,Oc as bp,Ww as bq,Wa as br,gC as bs,wC as bt,kC as bu,Z0 as bv,P1 as bw,$C as bx,O1 as by,$1 as bz,Gd as c,cx as c0,Q_ as c1,Y1 as c2,X_ as c3,D0 as c4,so as c5,Tn as c6,WS as c7,D_ as c8,gu as c9,UC as cA,H_ as ca,Za as cb,z_ as cc,BS as cd,jS as ce,B_ as cf,j_ as cg,K_ as ch,qi as ci,U_ as cj,M_ as ck,t_ as cl,hC as cm,sf as cn,_C as co,Rl as cp,sb as cq,mC as cr,gx as cs,sC as ct,Yd as cu,I_ as cv,O_ as cw,Rd as cx,mu as cy,N_ as cz,it as d,zd as e,Ad as f,_n as g,F1 as h,xC as i,Os as j,ms as k,US as l,Ui as m,pn as n,fC as o,pC as p,Ka as q,Io as r,Vd as s,ie as t,BC as u,RC as v,FC as w,PC as x,TC as y,OC as z};