@marimo-team/islands 0.24.3-dev9 → 0.25.1-dev1

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 (440) hide show
  1. package/dist/{ConnectedDataExplorerComponent-C9OF_75w.js → ConnectedDataExplorerComponent-KVhjDMSe.js} +1066 -1066
  2. package/dist/ErrorBoundary-pXXIvlr3.js +200 -0
  3. package/dist/{ImageComparisonComponent-2a9TMMm2.js → ImageComparisonComponent-Dlm5aWnH.js} +4 -4
  4. package/dist/{Plot-C-9MQeGP.js → Plot-CTyjbQDT.js} +21032 -20666
  5. package/dist/_baseMerge-BiGRwuqv.js +165 -0
  6. package/dist/{abnfDiagram-N423BO3Z-CQKwzX8t.js → abnfDiagram-VCTEODGH-CpN0FRda.js} +17 -18
  7. package/dist/{any-language-editor-DmQ7dyCx.js → any-language-editor-CycIVIeP.js} +17 -17
  8. package/dist/arc-7ra3iNdN.js +81 -0
  9. package/dist/architecture-7GRP2DOG-BWLylgiA.js +3 -0
  10. package/dist/{architectureDiagram-T3A2C74G-CncrDpfa.js → architectureDiagram-5GKGNRK7-DDyj5SRB.js} +25 -25
  11. package/dist/assets/__vite-browser-external-C9iR87Zl.js +1 -0
  12. package/dist/assets/worker-D7hWi02M.js +109 -0
  13. package/dist/blockDiagram-I7D4REHJ-BbXEXJRu.js +1922 -0
  14. package/dist/{button-CKBkqR9J.js → button-DdXAm8iz.js} +5 -5
  15. package/dist/{c4Diagram-5PPSVZJV-DarUk3Yq.js → c4Diagram-7LVT6UL2-DcLsbQmR.js} +696 -668
  16. package/dist/{capabilities-CMBBJTcc.js → capabilities-B3ce_GNu.js} +1 -1
  17. package/dist/{html-to-image-BtFMe_Nq.js → cells-DYIkSxs6.js} +6757 -10137
  18. package/dist/{channel-CyiYUzJv.js → channel-B5XnTarr.js} +1 -1
  19. package/dist/chat-ui-BXj3uYjy.js +5786 -0
  20. package/dist/{check-CHig47QV.js → check-B7cIK6gb.js} +1 -1
  21. package/dist/{chunk-2Q5K7J3B-BMuJl2jB.js → chunk-2Q5K7J3B-BMkUkeuy.js} +2 -2
  22. package/dist/chunk-4HAMMTFA-D2qv8E0X.js +4188 -0
  23. package/dist/{chunk-5VM5RSS4-Bcq0ftdy.js → chunk-5VM5RSS4-DKsmPCL6.js} +2 -2
  24. package/dist/{chunk-NSK5VX7P-CDTMcJB0.js → chunk-75Z2AOVW-5_HsvXwr.js} +23 -23
  25. package/dist/{chunk-I66GZJ75-BqyTCAPf.js → chunk-DU6HZSFF-BUgAHvnM.js} +21 -4
  26. package/dist/{chunk-2GRJ4B5K-DgO8Qudq.js → chunk-F27PBJKO-DHmYWZXr.js} +4 -4
  27. package/dist/{chunk-KEIR6QF5-C4KX3XYh.js → chunk-FOHPRMQF-BpYR8RqP.js} +4 -4
  28. package/dist/{chunk-WRU74C26-BpWsbiDK.js → chunk-GMAD6QVW-Czynz8aA.js} +486 -258
  29. package/dist/chunk-GVQU2GXP-yQEdulRS.js +37 -0
  30. package/dist/{chunk-5RXB4S5H-tLNUVDdO.js → chunk-IMKFNOWR-BfwTebD0.js} +11 -11
  31. package/dist/{chunk-JWPE2WC7-BJwjGUnF.js → chunk-JWPE2WC7-DJvv1t8U.js} +2 -2
  32. package/dist/chunk-L3NEJ4N5-DwRWnDDK.js +245 -0
  33. package/dist/{chunk-7Z6QIM7H-Dc18hFxH.js → chunk-OSK3NFVY-BBKU_Ign.js} +222 -144
  34. package/dist/{chunk-W5SLKNZC-DLnvpEtV.js → chunk-P2QGCYS3-C0iGU29N.js} +20 -20
  35. package/dist/{chunk-KBJHAD2P-BuqWqkcW.js → chunk-POPQ4Y6H-BCbS3Ozc.js} +4 -4
  36. package/dist/{chunk-4I5QYGJK-DpytHuZQ.js → chunk-PWAF6VOD-CTFCL0jI.js} +4 -4
  37. package/dist/{chunk-JQJVKLGR-CgqCwe8E.js → chunk-SHT3W25Y-BspJEJ5H.js} +109 -63
  38. package/dist/{chunk-6Q2QTUOP-DmTcEBMn.js → chunk-SVP7TREG-DX3rFNTe.js} +5 -5
  39. package/dist/{chunk-GF5L2VYU-B0wgCQgS.js → chunk-TICWLB2K-fVF7Uujg.js} +13 -13
  40. package/dist/{chunk-XXDRQBXY-D73H4IN0.js → chunk-XXDRQBXY-Dnl5VBqG.js} +3 -3
  41. package/dist/{chunk-Y2CYZVJY-DoegUj_e.js → chunk-Y2CYZVJY-DKKS1VyV.js} +1 -1
  42. package/dist/{chunk-5FQGJX7Z-B85XCPv6.js → chunk-YOKDWASO-DrWbKnxA.js} +6925 -5460
  43. package/dist/classDiagram-ZZMXUADV-Fe-V14Sc.js +30 -0
  44. package/dist/classDiagram-v2-VYDZK3BY-xTDg7lOs.js +30 -0
  45. package/dist/code-visibility-BC_yF09p.js +138 -0
  46. package/dist/{common-Cv-4hMa0.js → common-Dv227ygK.js} +8838 -12645
  47. package/dist/{compiler-runtime-CAH9RLw2.js → compiler-runtime-Cj8ZWiNS.js} +2 -2
  48. package/dist/copy-icon-CLdENY__.js +190 -0
  49. package/dist/{cose-bilkent-JH36ORCC-FUWHkXFX.js → cose-bilkent-JH36ORCC-_LyRKVqm.js} +2 -2
  50. package/dist/cubic-OaEBhQPK.js +1404 -0
  51. package/dist/cynefin-OW5HDTMX-obq-i80l.js +3 -0
  52. package/dist/{cynefinDiagram-MW4NZA55-BXSFK93J.js → cynefinDiagram-5FMLGOSQ-CFQrqzSX.js} +10 -10
  53. package/dist/{dagre-CGyalH38.js → dagre-BGSfXNEb.js} +678 -537
  54. package/dist/dagre-GXQ25YYZ-xHNAUTyG.js +425 -0
  55. package/dist/{data-grid-overlay-editor-DZM4BAaI.js → data-grid-overlay-editor-B-I2K7z3.js} +8 -9
  56. package/dist/{data-grid-types-BnZwWG8z.js → data-grid-types-BucVmDDp.js} +1 -1
  57. package/dist/{defaultLocale-DKaU_opG.js → defaultLocale-JI_lnoCe.js} +1 -1
  58. package/dist/{diagram-7IWD3JNH-BjfzDNvj.js → diagram-S7CK7UJ4-Bt1rPbAx.js} +40 -39
  59. package/dist/{diagram-UB23O5K3-DDg-7wLA.js → diagram-UQ7AKVKN-D1sq5FoZ.js} +10 -10
  60. package/dist/{diagram-B4RE2ZJO-CKccR9eE.js → diagram-VSXAHHWV-BKpmG23x.js} +10 -10
  61. package/dist/{diagram-Q27KOJAE-Zhz01ss7.js → diagram-VX7I27RA-BMwGFVD6.js} +21 -21
  62. package/dist/{diagram-LBJQPF4R-CJ-bOruh.js → diagram-Z3DM3KII--KLDR9Pl.js} +10 -10
  63. package/dist/dialog-CgNq6y9-.js +94 -0
  64. package/dist/{dist-dAqZAPcF.js → dist-1HDa70oE.js} +3 -3
  65. package/dist/{dist-Re9sOPOx.js → dist-9x1ZRe-e.js} +2 -2
  66. package/dist/{dist-DEeLqRlU.js → dist-B1vYLK28.js} +1 -1
  67. package/dist/{dist-C5Bn52W4.js → dist-B8D7McG3.js} +3 -3
  68. package/dist/{dist-_XvgytiS.js → dist-BHCHt1NI.js} +1 -1
  69. package/dist/{dist-CRjAdnqF.js → dist-BRxfaJgs.js} +3 -3
  70. package/dist/{dist-Byj2bV8o.js → dist-BVGtK7Ht.js} +1 -1
  71. package/dist/{dist-BIN5LKyE.js → dist-BaHjhkpZ.js} +2 -2
  72. package/dist/{dist-DVFbIwc5.js → dist-BtKIs9N-.js} +1 -1
  73. package/dist/{dist-BrQGcfQ9.js → dist-C2KzV-vf.js} +2 -2
  74. package/dist/{dist-DJFiGP2k.js → dist-C2wDlYdD.js} +2 -2
  75. package/dist/{dist-BVRM2y1P.js → dist-C8xMLVYi.js} +2 -2
  76. package/dist/dist-CMh_W4y4.js +538 -0
  77. package/dist/{extends-BPB6_lTK.js → dist-CO1AwwG_.js} +516 -561
  78. package/dist/{dist-BzN60Z2s.js → dist-CPGxfVGX.js} +1 -1
  79. package/dist/{dist-C7v-9nUK.js → dist-Cm3iAFMD.js} +3 -3
  80. package/dist/{dist-CGAxEiaM.js → dist-Cs2FijYk.js} +2 -2
  81. package/dist/{dist-hXd65f0_.js → dist-D1PpnuZB.js} +1 -1
  82. package/dist/{dist-VdvbxG72.js → dist-DHOTQar0.js} +1 -1
  83. package/dist/{dist-DcgzXCfy.js → dist-DPcEtqmG.js} +2 -2
  84. package/dist/{dist-D4Z_qdP4.js → dist-Df0wKI0F.js} +1 -1
  85. package/dist/{dist-qhLI-SHd.js → dist-DszxuxS1.js} +2 -2
  86. package/dist/{dist-BEmkrGoQ.js → dist-Kxgjxakw.js} +1 -1
  87. package/dist/{dist-BbSMhhD2.js → dist-KzZ7WELx.js} +2 -2
  88. package/dist/{dist-jWUab2d1.js → dist-lA1Cttkb.js} +1 -1
  89. package/dist/dropdown-menu-CZgjYSAh.js +4502 -0
  90. package/dist/{ebnfDiagram-BXEA7PRR-Dm75pCAS.js → ebnfDiagram-PWID7BFC-WnG4cvSQ.js} +17 -18
  91. package/dist/{erDiagram-JOGREHBK-rVDG3VSQ.js → erDiagram-RLTQ6QDP-DhzKiYHc.js} +1037 -798
  92. package/dist/error-banner-B94dcDmP.js +391 -0
  93. package/dist/error-entries-C0NsUqXl.js +56 -0
  94. package/dist/{esm-CR1nhb1c.js → esm-BElI3qKH.js} +22 -22
  95. package/dist/{esm-C1d0g6Bv.js → esm-G4Fhsgng.js} +51 -37
  96. package/dist/{esm-CesmlDrs.js → esm-h8f7-1CJ.js} +423 -423
  97. package/dist/eventmodeling-NTZA5JFV-D7nP7Uyu.js +3 -0
  98. package/dist/feedback-button-D2hUXe09.js +380 -0
  99. package/dist/flowDiagram-HODETNUW-6dMdB8pR.js +16 -0
  100. package/dist/{formats-CslNOKy0.js → formats-BR5iGb4s.js} +8 -8
  101. package/dist/{ganttDiagram-PKOTCBZU-9D-LXF6P.js → ganttDiagram-EL5Y4UJY-DbzEBLbl.js} +15 -15
  102. package/dist/gitGraph-4MIJSDKK-Dy9uQXGh.js +3 -0
  103. package/dist/{gitGraphDiagram-DS77QQ5N-BfpsXTLf.js → gitGraphDiagram-WWUBYQGX-BMf0iKi1.js} +10 -10
  104. package/dist/{glide-data-editor-sPZ8fUFn.js → glide-data-editor-B851uguN.js} +2143 -1910
  105. package/dist/{glide-utils-NShAPPtn.js → glide-utils-B3rUT5PI.js} +15 -15
  106. package/dist/globals-CmijFoIU.js +19 -0
  107. package/dist/highlighted-body-KPVGNVTW-Ad3MKZ18.js +38 -0
  108. package/dist/html-to-image-CeYYvQNb.js +3272 -0
  109. package/dist/info-A6RAGUB7-DKoayiHY.js +3 -0
  110. package/dist/{infoDiagram-6WML65LV-DqCTXHVy.js → infoDiagram-27XIBGKW-BagtCX_5.js} +7 -7
  111. package/dist/{ishikawaDiagram-WSZJBQD7-BCUYmZ1v.js → ishikawaDiagram-5VMMS53U-DByDehYy.js} +8 -8
  112. package/dist/{journeyDiagram-NVQOT4AX-BXB6M4zN.js → journeyDiagram-3NMN7TZE-D2LcKDUO.js} +8 -8
  113. package/dist/{jsx-runtime-CpoKNRgu.js → jsx-runtime-DgDPJV9S.js} +1 -1
  114. package/dist/{kanban-definition-27J2QSJJ-CGRhrDUX.js → kanban-definition-UXKFOSKX-BxwkbBI_.js} +29 -29
  115. package/dist/katex-DFBiSucW.js +21840 -0
  116. package/dist/{label-lwzzBHUW.js → label-BJ49YTvk.js} +6 -6
  117. package/dist/{linear-D5r_1YqD.js → linear-Cnaq3Tfb.js} +4 -4
  118. package/dist/{loader-VZ__bv4g.js → loader-D2W4oM-3.js} +15 -15
  119. package/dist/main.js +8113 -13475
  120. package/dist/mermaid-DPNuhemn.js +3084 -0
  121. package/dist/mermaid-HWGCJPDP-DYCzSILp.js +2 -0
  122. package/dist/mermaid-parser.core-DxuSfYwJ.js +638 -0
  123. package/dist/{mhchem-BjwrxcV-.js → mhchem-DWCF06w9.js} +1 -1
  124. package/dist/{micromark-factory-space-DruVGzeG.js → micromark-factory-space-DGxAzmw8.js} +2 -2
  125. package/dist/{mindmap-definition-FAOFIHXS-C9gRhzZq.js → mindmap-definition-YA3MSWOX-Cgvojw3y.js} +17 -17
  126. package/dist/{node-sql-parser-DesT1xNw.js → node-sql-parser-BiZOJ-FS.js} +0 -3
  127. package/dist/{number-overlay-editor-De2CabLL.js → number-overlay-editor-BtdoxWiD.js} +5 -5
  128. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +23 -0
  129. package/dist/packet-AYTQ26CC-Yw7ajchJ.js +3 -0
  130. package/dist/{pegDiagram-VL7TDLO6-Df9IUjMD.js → pegDiagram-XKGWAZYB-DahHhYyN.js} +19 -20
  131. package/dist/{pick-SnHlmIBN.js → pick-CJeoxYOS.js} +1 -1
  132. package/dist/pie-WAS4IAKB-BKdKOAkL.js +3 -0
  133. package/dist/{pieDiagram-7S7Q4E2Y-BmRzQ8ZP.js → pieDiagram-E7YTZNPT-CCtX0oCK.js} +29 -31
  134. package/dist/{process-output-CPy0YKUe.js → process-output-BCTjlyuH.js} +7 -6
  135. package/dist/purify.es-DgKyQviY.js +805 -0
  136. package/dist/{quadrantDiagram-CIZ2JOQS-wFBvWcxS.js → quadrantDiagram-AXDQQJYC-DftINo6g.js} +5 -5
  137. package/dist/radar-RG4KPBEZ-ScR_D_Ts.js +3 -0
  138. package/dist/railroad-74A4TZTK-DQvPSdo5.js +3 -0
  139. package/dist/railroad-abnf-HS5TGJTU-CsJQG2O8.js +3 -0
  140. package/dist/railroad-ebnf-LZEXJU2U-BgEobkSn.js +3 -0
  141. package/dist/railroad-peg-WCYAUIDC-DjLAjofI.js +3 -0
  142. package/dist/{railroadDiagram-AXF67PYL-DxbIatiN.js → railroadDiagram-O6MQD6OU-Du5NsPUb.js} +17 -18
  143. package/dist/{react-dom-C94wmq5w.js → react-dom-BUgJ-ab_.js} +3 -3
  144. package/dist/{react-DMWcHin-.js → react-ofJbxM4x.js} +2 -2
  145. package/dist/{react-vega-DSD5aT7_.js → react-vega-5AcMW8gG.js} +10012 -9369
  146. package/dist/{requirementDiagram-LRYGKXZP-X_x-Y713.js → requirementDiagram-BXWQKSXE-0pmmxL6_.js} +20 -19
  147. package/dist/{reveal-component-CVsYlb9J.js → reveal-component-DQq7NUGJ.js} +1303 -1237
  148. package/dist/{sankeyDiagram-W5VNT64P-BYJALbbm.js → sankeyDiagram-P5KCCOFB-CDKR5TJH.js} +4 -4
  149. package/dist/{select-3qHpFKF9.js → select-C6plhmZr.js} +317 -562
  150. package/dist/{sequenceDiagram-SI44F4Z6-BiPBe3Sv.js → sequenceDiagram-WJ2MYXX4-DB-ChWwU.js} +11 -11
  151. package/dist/{sizeCapture-X5ZJPWSS-BKLDeh5H.js → sizeCapture-INFHLROL-Dx5SpkQF.js} +2 -2
  152. package/dist/{spec-CutWdqo3.js → spec-CAYwFeV6.js} +4 -4
  153. package/dist/{src-C31ngt98.js → src-CA_m4ONl.js} +298 -303
  154. package/dist/{stateDiagram-OKZ733FA-B7QyNBxH.js → stateDiagram-D77RDMKH-orN6AwMx.js} +19 -20
  155. package/dist/stateDiagram-v2-MP3YSRHH-o05_rJN8.js +30 -0
  156. package/dist/style.css +2 -2
  157. package/dist/{swimlanes-SLNWSIFB-B4f8VP3b.js → swimlanes-42K2YHIH-BkSDcqDT.js} +1501 -1591
  158. package/dist/swimlanesDiagram-VR7AAH4N-D_nFQfRc.js +30 -0
  159. package/dist/{swiper-component-C90YjhaV.js → swiper-component-IOUowglM.js} +39 -26
  160. package/dist/{time-aWGfjN8x.js → time-BieKwdYS.js} +42 -42
  161. package/dist/{timeline-definition-Z64GVDOM-Dacq_5lr.js → timeline-definition-24CTP7MA-BuqJUIRZ.js} +7 -7
  162. package/dist/{toDate-CpXBeDq0.js → toDate-WXg1yLcI.js} +7 -7
  163. package/dist/toast-DvY70eFX.js +1834 -0
  164. package/dist/tooltip-qB8NlSqV.js +1742 -0
  165. package/dist/treeView-Q6P3EWNA-DuRV97YF.js +3 -0
  166. package/dist/treemap-WGGIJYW6-AsLq-uwC.js +3 -0
  167. package/dist/use-restore-focus-D5D9xEjZ.js +5946 -0
  168. package/dist/{use-vega-container-remeasure-DUW4tRxq.js → use-vega-container-remeasure-4DwJbPWu.js} +2 -2
  169. package/dist/{useAsyncData-CH6-CgJF.js → useAsyncData-BD6AStMt.js} +3 -3
  170. package/dist/{useDateFormatter-Cp9Jdxls.js → useDateFormatter-BRTPsUK7.js} +8 -8
  171. package/dist/{useDeepCompareMemoize-JC87C_jO.js → useDeepCompareMemoize-D_HNdyvI.js} +2 -2
  172. package/dist/{useIframeCapabilities-De3C-9b4.js → useIframeCapabilities-CVtNkI3Y.js} +2 -2
  173. package/dist/{useLifecycle-B4RGlyf0.js → useLifecycle-DPgiiwwU.js} +6 -6
  174. package/dist/useNumberFormatter-BfDpa21j.js +251 -0
  175. package/dist/useTheme-DzXmYZ5V.js +904 -0
  176. package/dist/{vega-component-ovBXgp91.js → vega-component-D0QXopU8.js} +34 -34
  177. package/dist/{vega-embed-container-TJ5z5dZw.js → vega-embed-container-CbnTccZi.js} +6 -6
  178. package/dist/vega-loader.browser-D95WfUcj.js +1139 -0
  179. package/dist/{vennDiagram-T6HMQDX7-D-Rcq3Iu.js → vennDiagram-4TSXK5OY-CTUlJ2PK.js} +9 -9
  180. package/dist/wardley-WFR3VGLG-Na-tFhQJ.js +3 -0
  181. package/dist/{wardleyDiagram-T6FBY63Y-Z-Og7_Wd.js → wardleyDiagram-VM6X3IG4-3evLUb0M.js} +10 -10
  182. package/dist/{xychartDiagram-ELKLHX3M-BDJ2dITA.js → xychartDiagram-S5SC5T6Z-DL2E3K8-.js} +248 -139
  183. package/package.json +54 -57
  184. package/src/__mocks__/notebook.ts +1 -0
  185. package/src/__mocks__/requests.ts +7 -0
  186. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  187. package/src/__tests__/fixtures/pair-preview.ts +19 -0
  188. package/src/__tests__/mount.test.ts +18 -0
  189. package/src/components/app-config/optional-features.tsx +6 -0
  190. package/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx +394 -0
  191. package/src/components/chat/acp/__tests__/agent-panel.test.tsx +272 -0
  192. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  193. package/src/components/chat/acp/agent-panel.tsx +115 -74
  194. package/src/components/chat/acp/state.ts +1 -1
  195. package/src/components/data-table/__tests__/filters.test.ts +21 -21
  196. package/src/components/data-table/charts/__tests__/spec.test.ts +5 -10
  197. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +2 -6
  198. package/src/components/data-table/column-summary/chart-spec-model.tsx +1 -1
  199. package/src/components/data-table/columns.tsx +64 -67
  200. package/src/components/editor/RecoveryButton.tsx +1 -0
  201. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +36 -2
  202. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +115 -0
  203. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +218 -0
  204. package/src/components/editor/actions/pair-with-agent-commands.ts +46 -9
  205. package/src/components/editor/actions/pair-with-agent-modal.tsx +49 -23
  206. package/src/components/editor/ai/add-cell-with-ai.tsx +1 -0
  207. package/src/components/editor/ai/ai-completion-editor.tsx +3 -1
  208. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +186 -0
  209. package/src/components/editor/alerts/__tests__/startup-progress.test.tsx +185 -0
  210. package/src/components/editor/alerts/connecting-alert.tsx +1 -66
  211. package/src/components/editor/alerts/connection-notice.tsx +186 -0
  212. package/src/components/editor/alerts/startup-output.tsx +173 -0
  213. package/src/components/editor/alerts/startup-progress.tsx +204 -0
  214. package/src/components/editor/app-container.tsx +9 -3
  215. package/src/components/editor/boundary/ErrorBoundary.tsx +38 -16
  216. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +311 -0
  217. package/src/components/editor/cell/__tests__/toolbar.test.tsx +73 -0
  218. package/src/components/editor/cell/code/__tests__/rtc-editor-config.test.ts +50 -0
  219. package/src/components/editor/cell/code/cell-editor.tsx +41 -42
  220. package/src/components/editor/cell/toolbar.tsx +11 -0
  221. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +94 -0
  222. package/src/components/editor/chrome/components/feedback-button.tsx +63 -42
  223. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +164 -8
  224. package/src/components/editor/chrome/panels/__tests__/sandbox-details.test.tsx +358 -0
  225. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +168 -0
  226. package/src/components/editor/chrome/panels/packages-panel.tsx +113 -175
  227. package/src/components/editor/chrome/panels/sandbox-controller.tsx +106 -0
  228. package/src/components/editor/chrome/panels/sandbox-details-state.ts +38 -0
  229. package/src/components/editor/chrome/panels/sandbox-panel.tsx +230 -0
  230. package/src/components/editor/chrome/panels/sandbox-toggle.tsx +52 -0
  231. package/src/components/editor/chrome/wrapper/app-chrome.tsx +7 -0
  232. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +3 -1
  233. package/src/components/editor/code/__tests__/readonly-diff.test.tsx +65 -0
  234. package/src/components/editor/code/readonly-diff.tsx +1 -1
  235. package/src/components/editor/connections/database/__tests__/__snapshots__/as-code.test.ts.snap +98 -98
  236. package/src/components/editor/connections/database/__tests__/as-code.test.ts +11 -5
  237. package/src/components/editor/dynamic-favicon.tsx +17 -10
  238. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +13 -11
  239. package/src/components/editor/file-tree/__tests__/tree-actions.test.tsx +54 -0
  240. package/src/components/editor/file-tree/tree-actions.tsx +11 -14
  241. package/src/components/editor/header/__tests__/status.test.tsx +8 -20
  242. package/src/components/editor/header/filename-input.tsx +2 -0
  243. package/src/components/editor/header/status.tsx +5 -3
  244. package/src/components/editor/navigation/clipboard.ts +1 -0
  245. package/src/components/editor/notebook-cell.tsx +4 -2
  246. package/src/components/editor/output/JsonOutput.tsx +182 -632
  247. package/src/components/editor/output/Outputs.css +49 -17
  248. package/src/components/editor/output/__tests__/JsonOutput-interactions.test.tsx +254 -0
  249. package/src/components/editor/output/__tests__/JsonOutput-mimetype.test.tsx +41 -46
  250. package/src/components/editor/output/__tests__/{json-output.test.ts → json-output-formatting.test.ts} +113 -75
  251. package/src/components/editor/output/__tests__/json-output-pagination.test.ts +252 -0
  252. package/src/components/editor/output/json-output/formatting.ts +167 -0
  253. package/src/components/editor/output/json-output/pagination.ts +155 -0
  254. package/src/components/editor/output/json-output/renderers.tsx +196 -0
  255. package/src/components/editor/output/json-output/themes.ts +52 -0
  256. package/src/components/editor/package-alert.tsx +112 -66
  257. package/src/components/editor/renderers/cell-array.tsx +1 -5
  258. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +3 -7
  259. package/src/components/slides/slide-form.tsx +1 -0
  260. package/src/components/slides/slide-notes-editor.tsx +1 -0
  261. package/src/components/tracing/tracing-spec.ts +1 -1
  262. package/src/components/ui/__tests__/badge.test.ts +6 -4
  263. package/src/components/ui/use-toast.ts +8 -0
  264. package/src/core/MarimoApp.tsx +0 -2
  265. package/src/core/ai/context/providers/__tests__/error.test.ts +16 -22
  266. package/src/core/alerts/__tests__/environment.test.ts +183 -0
  267. package/src/core/alerts/__tests__/state.test.tsx +240 -0
  268. package/src/core/alerts/environment.ts +57 -0
  269. package/src/core/alerts/state.ts +155 -99
  270. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +296 -259
  271. package/src/core/cells/__tests__/apply-transaction.test.ts +34 -0
  272. package/src/core/cells/__tests__/cell.test.ts +61 -0
  273. package/src/core/cells/__tests__/cells.test.ts +182 -37
  274. package/src/core/cells/__tests__/document-changes.test.ts +39 -1
  275. package/src/core/cells/__tests__/outputs.test.tsx +117 -0
  276. package/src/core/cells/__tests__/pending-delete-service.test.tsx +4 -3
  277. package/src/core/cells/__tests__/session.test.ts +7 -0
  278. package/src/core/cells/cell.ts +9 -1
  279. package/src/core/cells/cells.ts +13 -18
  280. package/src/core/cells/document-changes.ts +11 -1
  281. package/src/core/cells/outputs.ts +66 -9
  282. package/src/core/cells/pending-delete-service.ts +12 -16
  283. package/src/core/cells/session.ts +2 -0
  284. package/src/core/cells/types.ts +2 -0
  285. package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +8 -16
  286. package/src/core/codemirror/language/__tests__/sql.test.ts +70 -2
  287. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +4 -8
  288. package/src/core/codemirror/language/languages/sql/sql.ts +16 -1
  289. package/src/core/codemirror/rtc/extension.ts +5 -2
  290. package/src/core/config/pair.ts +19 -0
  291. package/src/core/datasets/__tests__/data-source.test.ts +2 -0
  292. package/src/core/datasets/data-source-connections.ts +15 -10
  293. package/src/core/edit-app.tsx +8 -5
  294. package/src/core/errors/state.ts +1 -2
  295. package/src/core/export/__tests__/hooks.test.ts +1 -6
  296. package/src/core/islands/bootstrap.ts +3 -1
  297. package/src/core/islands/bridge.ts +3 -0
  298. package/src/core/islands/worker-factory.ts +2 -12
  299. package/src/core/kernel/messages.ts +2 -2
  300. package/src/core/network/__tests__/requests-network.test.ts +4 -3
  301. package/src/core/network/connection-notice.ts +117 -0
  302. package/src/core/network/connection.ts +19 -0
  303. package/src/core/network/requests-lazy.ts +3 -0
  304. package/src/core/network/requests-network.ts +12 -0
  305. package/src/core/network/requests-static.ts +3 -0
  306. package/src/core/network/requests-toasting.tsx +3 -0
  307. package/src/core/network/resolve.ts +2 -1
  308. package/src/core/network/types.ts +7 -0
  309. package/src/core/network/useConnectionNotice.ts +53 -0
  310. package/src/core/packages/__tests__/usePackageAction.test.tsx +129 -0
  311. package/src/core/packages/__tests__/useSandboxController.test.tsx +246 -0
  312. package/src/core/packages/package-data.ts +35 -0
  313. package/src/core/packages/sandbox-state.ts +67 -0
  314. package/src/core/packages/toast-components.tsx +11 -0
  315. package/src/core/packages/useInstallPackage.ts +1 -1
  316. package/src/core/packages/usePackageAction.ts +51 -0
  317. package/src/core/packages/usePackageDependencies.ts +22 -0
  318. package/src/core/packages/useSandboxController.ts +208 -0
  319. package/src/core/run-app.tsx +2 -0
  320. package/src/core/static/__tests__/files.test.ts +12 -30
  321. package/src/core/wasm/__tests__/bootstrap.test.ts +63 -0
  322. package/src/core/wasm/__tests__/bridge.test.ts +13 -4
  323. package/src/core/wasm/__tests__/fs.test.ts +22 -0
  324. package/src/core/wasm/__tests__/runtime-config.test.ts +65 -0
  325. package/src/core/wasm/bridge.ts +35 -23
  326. package/src/core/wasm/rpc.ts +2 -0
  327. package/src/core/wasm/runtime-config.ts +31 -0
  328. package/src/core/wasm/worker/bootstrap.ts +21 -11
  329. package/src/core/wasm/worker/constants.ts +1 -0
  330. package/src/core/wasm/worker/fs.ts +4 -0
  331. package/src/core/wasm/worker/getController.ts +3 -1
  332. package/src/core/wasm/worker/save-worker.ts +10 -9
  333. package/src/core/wasm/worker/types.ts +6 -4
  334. package/src/core/wasm/worker/worker.ts +9 -9
  335. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +404 -3
  336. package/src/core/websocket/__tests__/useMarimoKernelConnection.test.ts +8 -6
  337. package/src/core/websocket/transports/transport.ts +1 -1
  338. package/src/core/websocket/transports/ws.ts +1 -1
  339. package/src/core/websocket/types.ts +11 -1
  340. package/src/core/websocket/useMarimoKernelConnection.tsx +63 -16
  341. package/src/hooks/useDebounce.ts +2 -0
  342. package/src/mount.tsx +3 -0
  343. package/src/plugins/core/BadPlugin.tsx +3 -14
  344. package/src/plugins/core/RenderHTML.tsx +22 -2
  345. package/src/plugins/core/__test__/RenderHTML.test.ts +187 -0
  346. package/src/plugins/core/registerReactComponent.tsx +0 -1
  347. package/src/plugins/impl/FileBrowserPlugin.tsx +10 -4
  348. package/src/plugins/impl/FormPlugin.tsx +2 -0
  349. package/src/plugins/impl/MatrixPlugin.tsx +2 -0
  350. package/src/plugins/impl/RangeSliderPlugin.tsx +2 -0
  351. package/src/plugins/impl/SliderPlugin.tsx +2 -0
  352. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +50 -1
  353. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +23 -18
  354. package/src/plugins/impl/data-frames/panel.tsx +1 -0
  355. package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +1 -1
  356. package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +15 -0
  357. package/src/plugins/impl/vega/__tests__/make-selectable.test.ts +42 -48
  358. package/src/plugins/layout/AccordionPlugin.tsx +7 -2
  359. package/src/plugins/layout/JsonOutputPlugin.tsx +7 -10
  360. package/src/plugins/layout/__test__/AccordionPlugin.test.tsx +66 -0
  361. package/src/stories/sandbox.stories.tsx +488 -0
  362. package/src/utils/__tests__/path.test.ts +6 -5
  363. package/src/utils/__tests__/worker.test.ts +81 -0
  364. package/src/utils/worker.ts +22 -0
  365. package/dist/ErrorBoundary-CR-ZQN_c.js +0 -125
  366. package/dist/_baseMerge-Dv8bBloN.js +0 -73
  367. package/dist/_initCloneObject---vediN2.js +0 -95
  368. package/dist/arc-DOVLrCPd.js +0 -82
  369. package/dist/architecture-TIHT7OUA-MiJpPpQW.js +0 -3
  370. package/dist/array-CApNbSU9.js +0 -6
  371. package/dist/assets/__vite-browser-external-BdKGjRZ4.js +0 -1
  372. package/dist/assets/worker-DlIBfp9S.js +0 -98
  373. package/dist/blockDiagram-VBNYF7ZC-Bc--I65C.js +0 -3158
  374. package/dist/chat-ui-BSwr409J.js +0 -8455
  375. package/dist/chunk-3NCLNEKW-BIp_lB_4.js +0 -14
  376. package/dist/chunk-5FCAYU7R-C_HO9A1J.js +0 -23
  377. package/dist/chunk-5HE753X5-Bixm_MV-.js +0 -38
  378. package/dist/chunk-5JV3BV7I-CH5J3iZY.js +0 -54
  379. package/dist/chunk-5TONJI2A-DG6gDiSS.js +0 -62
  380. package/dist/chunk-7BUUIJ7U-5afmIPeo.js +0 -82
  381. package/dist/chunk-BIQX33UG-7TMBUf89.js +0 -23
  382. package/dist/chunk-CQNSW5MT-Cnqqsxt-.js +0 -38
  383. package/dist/chunk-CYSBUYHQ-BAbymFHR.js +0 -23
  384. package/dist/chunk-EMLP6XTP-Bsz-QL77.js +0 -23
  385. package/dist/chunk-J7OUQ5F2-CM_meqZH.js +0 -57
  386. package/dist/chunk-JG7HCLWE-DUnCDgPk.js +0 -62
  387. package/dist/chunk-MOZMSUNE-BG6IHvzT.js +0 -35
  388. package/dist/chunk-OSBZ3O6U-CYwj_bvR.js +0 -23
  389. package/dist/chunk-QBLGF6JB-B4vJ4j8J.js +0 -23
  390. package/dist/chunk-QR6OTTB3-D4wH2ldi.js +0 -3738
  391. package/dist/chunk-R7FJI6CG-Blf8FcmZ.js +0 -64
  392. package/dist/chunk-RYQCIY6F-BWbIlBIH.js +0 -241
  393. package/dist/chunk-U6XO7XAA-COw445DS.js +0 -63
  394. package/dist/chunk-UBXNYLIW-BHigVU4H.js +0 -32
  395. package/dist/chunk-YOTPTUD7-Dn044Q_d.js +0 -30
  396. package/dist/chunk-ZIRB5QZD-BR4TMfOa.js +0 -1153
  397. package/dist/classDiagram-JCYQIIEL-DmXSLxe_.js +0 -30
  398. package/dist/classDiagram-v2-OCEON4UE-CooqVexA.js +0 -30
  399. package/dist/click-outside-container-D_URcm3D.js +0 -167
  400. package/dist/code-block-37QAKDTI-CQrzBOr-.js +0 -107
  401. package/dist/copy-CD7S58CY.js +0 -141
  402. package/dist/cynefin-VYW2F7L2-CeHAxOEX.js +0 -3
  403. package/dist/dagre-VZM6K2ZE-CJggWPTJ.js +0 -328
  404. package/dist/dist-3_o3T78I.js +0 -1360
  405. package/dist/dist-ABQjhuek.js +0 -64
  406. package/dist/dist-CO5R6VMi.js +0 -538
  407. package/dist/dropdown-menu-DhCfcscX.js +0 -5858
  408. package/dist/emotion-is-prop-valid.esm-M57VsT8j.js +0 -14
  409. package/dist/error-banner-CsXbEEjo.js +0 -611
  410. package/dist/eventmodeling-45OFAUF4-B_lWZ-Pd.js +0 -3
  411. package/dist/flowDiagram-UKHOOZJN-g1AmrZzM.js +0 -17
  412. package/dist/gitGraph-TEB2WS4Q-Dj-eXUph.js +0 -3
  413. package/dist/info-DKCQHKI2-Bhb-pe2e.js +0 -3
  414. package/dist/line-CuKjIQa1.js +0 -34
  415. package/dist/map-BJpOfPlL.js +0 -149
  416. package/dist/math-BXtKgYah.js +0 -10
  417. package/dist/mermaid-4DMBBIKO-Ddp9TgNp.js +0 -2
  418. package/dist/mermaid-Bi23Ibnw.js +0 -1173
  419. package/dist/mermaid-parser.core-Din9FvSi.js +0 -99
  420. package/dist/packet-7NZHBO7P-fbkIIyKE.js +0 -3
  421. package/dist/path-BNHuHZP8.js +0 -87
  422. package/dist/pie-RZYD4A2V-CLRIsxY1.js +0 -3
  423. package/dist/purify.es-CB-YO1Hn.js +0 -774
  424. package/dist/radar-I7S5WNFK-BGzCbgXu.js +0 -3
  425. package/dist/railroad-3IZDKUUU-CvQIIcuU.js +0 -3
  426. package/dist/railroad-abnf-AHOZXSZD-CMwtlNtu.js +0 -3
  427. package/dist/railroad-ebnf-EBAXGLYW-n1QUOAsh.js +0 -3
  428. package/dist/railroad-peg-LSFZ7HO6-PjnrpmCs.js +0 -3
  429. package/dist/schemas-DzK6U94N.js +0 -6057
  430. package/dist/stateDiagram-v2-UEYNNEHI-BTRUs8Il.js +0 -30
  431. package/dist/step-CKczO72Q.js +0 -670
  432. package/dist/swimlanesDiagram-ULZ7WXOC-NBmgBl9G.js +0 -31
  433. package/dist/timer-DpDyj9G0.js +0 -596
  434. package/dist/tooltip-Dt77sBeT.js +0 -390
  435. package/dist/treeView-QDETBFTQ-DU8LwHuf.js +0 -3
  436. package/dist/treemap-6X3UGDF4-DUk4-k_O.js +0 -3
  437. package/dist/useTheme-CVJ0UOf2.js +0 -841
  438. package/dist/vega-loader.browser-DEggZzni.js +0 -1083
  439. package/dist/wardley-OPB4EBWU-Db-AaGas.js +0 -3
  440. package/src/components/editor/output/EmotionCacheProvider.tsx +0 -32
@@ -0,0 +1,1834 @@
1
+ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
+ import { h as t, p as n, r } from "./button-DdXAm8iz.js";
3
+ import { t as i } from "./react-ofJbxM4x.js";
4
+ import { t as a } from "./compiler-runtime-Cj8ZWiNS.js";
5
+ import { h as o } from "./tooltip-qB8NlSqV.js";
6
+ import { A as s, k as c } from "./select-C6plhmZr.js";
7
+ import { t as l } from "./react-dom-BUgJ-ab_.js";
8
+ import { t as u } from "./jsx-runtime-DgDPJV9S.js";
9
+ import { Ct as d, Et as f, St as p, Tt as m, _t as ee, bt as h, ht as te, pt as g, vt as _, wt as v, xt as y } from "./use-restore-focus-D5D9xEjZ.js";
10
+ //#region ../node_modules/.pnpm/@radix-ui+react-toast@1.2.15_@types+react-dom@19.2.5_@types+react@19.2.18__@types+react_bf6d58ed91c2f26d21e09be1118b065a/node_modules/@radix-ui/react-toast/dist/index.mjs
11
+ var b = /* @__PURE__ */ e(i(), 1), ne = /* @__PURE__ */ e(l(), 1), x = u(), S = "ToastProvider", [re, ie, C] = c("Toast"), [w, T] = v("Toast", [C]), [ae, E] = w(S), oe = (e) => {
12
+ let { __scopeToast: t, label: n = "Notification", duration: r = 5e3, swipeDirection: i = "right", swipeThreshold: a = 50, children: o } = e, [s, c] = b.useState(null), [l, u] = b.useState(0), d = b.useRef(!1), f = b.useRef(!1);
13
+ return n.trim() || console.error(`Invalid prop \`label\` supplied to \`${S}\`. Expected non-empty \`string\`.`), /* @__PURE__ */ (0, x.jsx)(re.Provider, {
14
+ scope: t,
15
+ children: /* @__PURE__ */ (0, x.jsx)(ae, {
16
+ scope: t,
17
+ label: n,
18
+ duration: r,
19
+ swipeDirection: i,
20
+ swipeThreshold: a,
21
+ toastCount: l,
22
+ viewport: s,
23
+ onViewportChange: c,
24
+ onToastAdd: b.useCallback(() => u((e) => e + 1), []),
25
+ onToastRemove: b.useCallback(() => u((e) => e - 1), []),
26
+ isFocusedToastEscapeKeyDownRef: d,
27
+ isClosePausedRef: f,
28
+ children: o
29
+ })
30
+ });
31
+ };
32
+ oe.displayName = S;
33
+ var D = "ToastViewport", se = ["F8"], ce = "toast.viewportPause", le = "toast.viewportResume", O = b.forwardRef((e, t) => {
34
+ let { __scopeToast: r, hotkey: i = se, label: a = "Notifications ({hotkey})", ...o } = e, s = E(D, r), c = ie(r), l = b.useRef(null), u = b.useRef(null), d = b.useRef(null), f = b.useRef(null), p = n(t, f, s.onViewportChange), ee = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), h = s.toastCount > 0;
35
+ b.useEffect(() => {
36
+ let e = (e) => {
37
+ i.length !== 0 && i.every((t) => e[t] || e.code === t) && f.current?.focus();
38
+ };
39
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
40
+ }, [i]), b.useEffect(() => {
41
+ let e = l.current, t = f.current;
42
+ if (h && e && t) {
43
+ let n = () => {
44
+ if (!s.isClosePausedRef.current) {
45
+ let e = new CustomEvent(ce);
46
+ t.dispatchEvent(e), s.isClosePausedRef.current = !0;
47
+ }
48
+ }, r = () => {
49
+ if (s.isClosePausedRef.current) {
50
+ let e = new CustomEvent(le);
51
+ t.dispatchEvent(e), s.isClosePausedRef.current = !1;
52
+ }
53
+ }, i = (t) => {
54
+ e.contains(t.relatedTarget) || r();
55
+ }, a = () => {
56
+ e.contains(document.activeElement) || r();
57
+ };
58
+ return e.addEventListener("focusin", n), e.addEventListener("focusout", i), e.addEventListener("pointermove", n), e.addEventListener("pointerleave", a), window.addEventListener("blur", n), window.addEventListener("focus", r), () => {
59
+ e.removeEventListener("focusin", n), e.removeEventListener("focusout", i), e.removeEventListener("pointermove", n), e.removeEventListener("pointerleave", a), window.removeEventListener("blur", n), window.removeEventListener("focus", r);
60
+ };
61
+ }
62
+ }, [h, s.isClosePausedRef]);
63
+ let g = b.useCallback(({ tabbingDirection: e }) => {
64
+ let t = c().map((t) => {
65
+ let n = t.ref.current, r = [n, ...je(n)];
66
+ return e === "forwards" ? r : r.reverse();
67
+ });
68
+ return (e === "forwards" ? t.reverse() : t).flat();
69
+ }, [c]);
70
+ return b.useEffect(() => {
71
+ let e = f.current;
72
+ if (e) {
73
+ let t = (t) => {
74
+ let n = t.altKey || t.ctrlKey || t.metaKey;
75
+ if (t.key === "Tab" && !n) {
76
+ let n = document.activeElement, r = t.shiftKey;
77
+ if (t.target === e && r) {
78
+ u.current?.focus();
79
+ return;
80
+ }
81
+ let i = g({ tabbingDirection: r ? "backwards" : "forwards" }), a = i.findIndex((e) => e === n);
82
+ Me(i.slice(a + 1)) ? t.preventDefault() : r ? u.current?.focus() : d.current?.focus();
83
+ }
84
+ };
85
+ return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
86
+ }
87
+ }, [c, g]), /* @__PURE__ */ (0, x.jsxs)(te, {
88
+ ref: l,
89
+ role: "region",
90
+ "aria-label": a.replace("{hotkey}", ee),
91
+ tabIndex: -1,
92
+ style: { pointerEvents: h ? void 0 : "none" },
93
+ children: [
94
+ h && /* @__PURE__ */ (0, x.jsx)(A, {
95
+ ref: u,
96
+ onFocusFromOutsideViewport: () => {
97
+ Me(g({ tabbingDirection: "forwards" }));
98
+ }
99
+ }),
100
+ /* @__PURE__ */ (0, x.jsx)(re.Slot, {
101
+ scope: r,
102
+ children: /* @__PURE__ */ (0, x.jsx)(m.ol, {
103
+ tabIndex: -1,
104
+ ...o,
105
+ ref: p
106
+ })
107
+ }),
108
+ h && /* @__PURE__ */ (0, x.jsx)(A, {
109
+ ref: d,
110
+ onFocusFromOutsideViewport: () => {
111
+ Me(g({ tabbingDirection: "backwards" }));
112
+ }
113
+ })
114
+ ]
115
+ });
116
+ });
117
+ O.displayName = D;
118
+ var k = "ToastFocusProxy", A = b.forwardRef((e, t) => {
119
+ let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a = E(k, n);
120
+ return /* @__PURE__ */ (0, x.jsx)(o, {
121
+ tabIndex: 0,
122
+ ...i,
123
+ ref: t,
124
+ style: { position: "fixed" },
125
+ onFocus: (e) => {
126
+ let t = e.relatedTarget;
127
+ a.viewport?.contains(t) || r();
128
+ }
129
+ });
130
+ });
131
+ A.displayName = k;
132
+ var j = "Toast", ue = "toast.swipeStart", de = "toast.swipeMove", fe = "toast.swipeCancel", pe = "toast.swipeEnd", M = b.forwardRef((e, t) => {
133
+ let { forceMount: n, open: r, defaultOpen: i, onOpenChange: a, ...o } = e, [s, c] = y({
134
+ prop: r,
135
+ defaultProp: i ?? !0,
136
+ onChange: a,
137
+ caller: j
138
+ });
139
+ return /* @__PURE__ */ (0, x.jsx)(h, {
140
+ present: n || s,
141
+ children: /* @__PURE__ */ (0, x.jsx)(ge, {
142
+ open: s,
143
+ ...o,
144
+ ref: t,
145
+ onClose: () => c(!1),
146
+ onPause: _(e.onPause),
147
+ onResume: _(e.onResume),
148
+ onSwipeStart: d(e.onSwipeStart, (e) => {
149
+ e.currentTarget.setAttribute("data-swipe", "start");
150
+ }),
151
+ onSwipeMove: d(e.onSwipeMove, (e) => {
152
+ let { x: t, y: n } = e.detail.delta;
153
+ e.currentTarget.setAttribute("data-swipe", "move"), e.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${t}px`), e.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${n}px`);
154
+ }),
155
+ onSwipeCancel: d(e.onSwipeCancel, (e) => {
156
+ e.currentTarget.setAttribute("data-swipe", "cancel"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
157
+ }),
158
+ onSwipeEnd: d(e.onSwipeEnd, (e) => {
159
+ let { x: t, y: n } = e.detail.delta;
160
+ e.currentTarget.setAttribute("data-swipe", "end"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), e.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${t}px`), e.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${n}px`), c(!1);
161
+ })
162
+ })
163
+ });
164
+ });
165
+ M.displayName = j;
166
+ var [me, he] = w(j, { onClose() {} }), ge = b.forwardRef((e, t) => {
167
+ let { __scopeToast: r, type: i = "foreground", duration: a, open: o, onClose: s, onEscapeKeyDown: c, onPause: l, onResume: u, onSwipeStart: f, onSwipeMove: p, onSwipeCancel: h, onSwipeEnd: te, ...g } = e, v = E(j, r), [y, S] = b.useState(null), ie = n(t, (e) => S(e)), C = b.useRef(null), w = b.useRef(null), T = a || v.duration, ae = b.useRef(0), oe = b.useRef(T), D = b.useRef(0), { onToastAdd: se, onToastRemove: O } = v, k = _(() => {
168
+ y?.contains(document.activeElement) && v.viewport?.focus(), s();
169
+ }), A = b.useCallback((e) => {
170
+ !e || e === Infinity || (window.clearTimeout(D.current), ae.current = (/* @__PURE__ */ new Date()).getTime(), D.current = window.setTimeout(k, e));
171
+ }, [k]);
172
+ b.useEffect(() => {
173
+ let e = v.viewport;
174
+ if (e) {
175
+ let t = () => {
176
+ A(oe.current), u?.();
177
+ }, n = () => {
178
+ let e = (/* @__PURE__ */ new Date()).getTime() - ae.current;
179
+ oe.current -= e, window.clearTimeout(D.current), l?.();
180
+ };
181
+ return e.addEventListener(ce, n), e.addEventListener(le, t), () => {
182
+ e.removeEventListener(ce, n), e.removeEventListener(le, t);
183
+ };
184
+ }
185
+ }, [
186
+ v.viewport,
187
+ T,
188
+ l,
189
+ u,
190
+ A
191
+ ]), b.useEffect(() => {
192
+ o && !v.isClosePausedRef.current && A(T);
193
+ }, [
194
+ o,
195
+ T,
196
+ v.isClosePausedRef,
197
+ A
198
+ ]), b.useEffect(() => (se(), () => O()), [se, O]);
199
+ let M = b.useMemo(() => y ? De(y) : null, [y]);
200
+ return v.viewport ? /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [M && /* @__PURE__ */ (0, x.jsx)(_e, {
201
+ __scopeToast: r,
202
+ role: "status",
203
+ "aria-live": i === "foreground" ? "assertive" : "polite",
204
+ children: M
205
+ }), /* @__PURE__ */ (0, x.jsx)(me, {
206
+ scope: r,
207
+ onClose: k,
208
+ children: ne.createPortal(/* @__PURE__ */ (0, x.jsx)(re.ItemSlot, {
209
+ scope: r,
210
+ children: /* @__PURE__ */ (0, x.jsx)(ee, {
211
+ asChild: !0,
212
+ onEscapeKeyDown: d(c, () => {
213
+ v.isFocusedToastEscapeKeyDownRef.current || k(), v.isFocusedToastEscapeKeyDownRef.current = !1;
214
+ }),
215
+ children: /* @__PURE__ */ (0, x.jsx)(m.li, {
216
+ tabIndex: 0,
217
+ "data-state": o ? "open" : "closed",
218
+ "data-swipe-direction": v.swipeDirection,
219
+ ...g,
220
+ ref: ie,
221
+ style: {
222
+ userSelect: "none",
223
+ touchAction: "none",
224
+ ...e.style
225
+ },
226
+ onKeyDown: d(e.onKeyDown, (e) => {
227
+ e.key === "Escape" && (c?.(e.nativeEvent), e.nativeEvent.defaultPrevented || (v.isFocusedToastEscapeKeyDownRef.current = !0, k()));
228
+ }),
229
+ onPointerDown: d(e.onPointerDown, (e) => {
230
+ e.button === 0 && (C.current = {
231
+ x: e.clientX,
232
+ y: e.clientY
233
+ });
234
+ }),
235
+ onPointerMove: d(e.onPointerMove, (e) => {
236
+ if (!C.current) return;
237
+ let t = e.clientX - C.current.x, n = e.clientY - C.current.y, r = !!w.current, i = ["left", "right"].includes(v.swipeDirection), a = ["left", "up"].includes(v.swipeDirection) ? Math.min : Math.max, o = i ? a(0, t) : 0, s = i ? 0 : a(0, n), c = e.pointerType === "touch" ? 10 : 2, l = {
238
+ x: o,
239
+ y: s
240
+ }, u = {
241
+ originalEvent: e,
242
+ delta: l
243
+ };
244
+ r ? (w.current = l, N(de, p, u, { discrete: !1 })) : Oe(l, v.swipeDirection, c) ? (w.current = l, N(ue, f, u, { discrete: !1 }), e.target.setPointerCapture(e.pointerId)) : (Math.abs(t) > c || Math.abs(n) > c) && (C.current = null);
245
+ }),
246
+ onPointerUp: d(e.onPointerUp, (e) => {
247
+ let t = w.current, n = e.target;
248
+ if (n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), w.current = null, C.current = null, t) {
249
+ let n = e.currentTarget, r = {
250
+ originalEvent: e,
251
+ delta: t
252
+ };
253
+ Oe(t, v.swipeDirection, v.swipeThreshold) ? N(pe, te, r, { discrete: !0 }) : N(fe, h, r, { discrete: !0 }), n.addEventListener("click", (e) => e.preventDefault(), { once: !0 });
254
+ }
255
+ })
256
+ })
257
+ })
258
+ }), v.viewport)
259
+ })] }) : null;
260
+ }), _e = (e) => {
261
+ let { __scopeToast: t, children: n, ...r } = e, i = E(j, t), [a, s] = b.useState(!1), [c, l] = b.useState(!1);
262
+ return ke(() => s(!0)), b.useEffect(() => {
263
+ let e = window.setTimeout(() => l(!0), 1e3);
264
+ return () => window.clearTimeout(e);
265
+ }, []), c ? null : /* @__PURE__ */ (0, x.jsx)(g, {
266
+ asChild: !0,
267
+ children: /* @__PURE__ */ (0, x.jsx)(o, {
268
+ ...r,
269
+ children: a && /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [
270
+ i.label,
271
+ " ",
272
+ n
273
+ ] })
274
+ })
275
+ });
276
+ }, ve = "ToastTitle", ye = b.forwardRef((e, t) => {
277
+ let { __scopeToast: n, ...r } = e;
278
+ return /* @__PURE__ */ (0, x.jsx)(m.div, {
279
+ ...r,
280
+ ref: t
281
+ });
282
+ });
283
+ ye.displayName = ve;
284
+ var be = "ToastDescription", xe = b.forwardRef((e, t) => {
285
+ let { __scopeToast: n, ...r } = e;
286
+ return /* @__PURE__ */ (0, x.jsx)(m.div, {
287
+ ...r,
288
+ ref: t
289
+ });
290
+ });
291
+ xe.displayName = be;
292
+ var Se = "ToastAction", Ce = b.forwardRef((e, t) => {
293
+ let { altText: n, ...r } = e;
294
+ return n.trim() ? /* @__PURE__ */ (0, x.jsx)(Ee, {
295
+ altText: n,
296
+ asChild: !0,
297
+ children: /* @__PURE__ */ (0, x.jsx)(Te, {
298
+ ...r,
299
+ ref: t
300
+ })
301
+ }) : (console.error(`Invalid prop \`altText\` supplied to \`${Se}\`. Expected non-empty \`string\`.`), null);
302
+ });
303
+ Ce.displayName = Se;
304
+ var we = "ToastClose", Te = b.forwardRef((e, t) => {
305
+ let { __scopeToast: n, ...r } = e, i = he(we, n);
306
+ return /* @__PURE__ */ (0, x.jsx)(Ee, {
307
+ asChild: !0,
308
+ children: /* @__PURE__ */ (0, x.jsx)(m.button, {
309
+ type: "button",
310
+ ...r,
311
+ ref: t,
312
+ onClick: d(e.onClick, i.onClose)
313
+ })
314
+ });
315
+ });
316
+ Te.displayName = we;
317
+ var Ee = b.forwardRef((e, t) => {
318
+ let { __scopeToast: n, altText: r, ...i } = e;
319
+ return /* @__PURE__ */ (0, x.jsx)(m.div, {
320
+ "data-radix-toast-announce-exclude": "",
321
+ "data-radix-toast-announce-alt": r || void 0,
322
+ ...i,
323
+ ref: t
324
+ });
325
+ });
326
+ function De(e) {
327
+ let t = [];
328
+ return Array.from(e.childNodes).forEach((e) => {
329
+ if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent), Ae(e)) {
330
+ let n = e.ariaHidden || e.hidden || e.style.display === "none", r = e.dataset.radixToastAnnounceExclude === "";
331
+ if (!n) {
332
+ if (r) {
333
+ let n = e.dataset.radixToastAnnounceAlt;
334
+ n && t.push(n);
335
+ } else t.push(...De(e));
336
+ }
337
+ }
338
+ }), t;
339
+ }
340
+ function N(e, t, n, { discrete: r }) {
341
+ let i = n.originalEvent.currentTarget, a = new CustomEvent(e, {
342
+ bubbles: !0,
343
+ cancelable: !0,
344
+ detail: n
345
+ });
346
+ t && i.addEventListener(e, t, { once: !0 }), r ? f(i, a) : i.dispatchEvent(a);
347
+ }
348
+ var Oe = (e, t, n = 0) => {
349
+ let r = Math.abs(e.x), i = Math.abs(e.y), a = r > i;
350
+ return t === "left" || t === "right" ? a && r > n : !a && i > n;
351
+ };
352
+ function ke(e = () => {}) {
353
+ let t = _(e);
354
+ p(() => {
355
+ let e = 0, n = 0;
356
+ return e = window.requestAnimationFrame(() => n = window.requestAnimationFrame(t)), () => {
357
+ window.cancelAnimationFrame(e), window.cancelAnimationFrame(n);
358
+ };
359
+ }, [t]);
360
+ }
361
+ function Ae(e) {
362
+ return e.nodeType === e.ELEMENT_NODE;
363
+ }
364
+ function je(e) {
365
+ let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
366
+ let t = e.tagName === "INPUT" && e.type === "hidden";
367
+ return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
368
+ } });
369
+ for (; n.nextNode();) t.push(n.currentNode);
370
+ return t;
371
+ }
372
+ function Me(e) {
373
+ let t = document.activeElement;
374
+ return e.some((e) => e === t || (e.focus(), document.activeElement !== t));
375
+ }
376
+ var Ne = oe, Pe = O, Fe = M, Ie = ye, Le = xe, Re = Ce, ze = Te;
377
+ //#endregion
378
+ //#region ../node_modules/.pnpm/marked@15.0.12/node_modules/marked/lib/marked.esm.js
379
+ function Be() {
380
+ return {
381
+ async: !1,
382
+ breaks: !1,
383
+ extensions: null,
384
+ gfm: !0,
385
+ hooks: null,
386
+ pedantic: !1,
387
+ renderer: null,
388
+ silent: !1,
389
+ tokenizer: null,
390
+ walkTokens: null
391
+ };
392
+ }
393
+ var P = Be();
394
+ function Ve(e) {
395
+ P = e;
396
+ }
397
+ var F = { exec: () => null };
398
+ function I(e, t = "") {
399
+ let n = typeof e == "string" ? e : e.source, r = {
400
+ replace: (e, t) => {
401
+ let i = typeof t == "string" ? t : t.source;
402
+ return i = i.replace(L.caret, "$1"), n = n.replace(e, i), r;
403
+ },
404
+ getRegex: () => new RegExp(n, t)
405
+ };
406
+ return r;
407
+ }
408
+ var L = {
409
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
410
+ outputLinkReplace: /\\([\[\]])/g,
411
+ indentCodeCompensation: /^(\s+)(?:```)/,
412
+ beginningSpace: /^\s+/,
413
+ endingHash: /#$/,
414
+ startingSpaceChar: /^ /,
415
+ endingSpaceChar: / $/,
416
+ nonSpaceChar: /[^ ]/,
417
+ newLineCharGlobal: /\n/g,
418
+ tabCharGlobal: /\t/g,
419
+ multipleSpaceGlobal: /\s+/g,
420
+ blankLine: /^[ \t]*$/,
421
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
422
+ blockquoteStart: /^ {0,3}>/,
423
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
424
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
425
+ listReplaceTabs: /^\t+/,
426
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
427
+ listIsTask: /^\[[ xX]\] /,
428
+ listReplaceTask: /^\[[ xX]\] +/,
429
+ anyLine: /\n.*\n/,
430
+ hrefBrackets: /^<(.*)>$/,
431
+ tableDelimiter: /[:|]/,
432
+ tableAlignChars: /^\||\| *$/g,
433
+ tableRowBlankLine: /\n[ \t]*$/,
434
+ tableAlignRight: /^ *-+: *$/,
435
+ tableAlignCenter: /^ *:-+: *$/,
436
+ tableAlignLeft: /^ *:-+ *$/,
437
+ startATag: /^<a /i,
438
+ endATag: /^<\/a>/i,
439
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
440
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
441
+ startAngleBracket: /^</,
442
+ endAngleBracket: />$/,
443
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
444
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
445
+ escapeTest: /[&<>"']/,
446
+ escapeReplace: /[&<>"']/g,
447
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
448
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
449
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
450
+ caret: /(^|[^\[])\^/g,
451
+ percentDecode: /%25/g,
452
+ findPipe: /\|/g,
453
+ splitPipe: / \|/,
454
+ slashPipe: /\\\|/g,
455
+ carriageReturn: /\r\n|\r/g,
456
+ spaceLine: /^ +$/gm,
457
+ notSpaceStart: /^\S*/,
458
+ endingNewline: /\n$/,
459
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
460
+ nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
461
+ hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
462
+ fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
463
+ headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
464
+ htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
465
+ }, He = /^(?:[ \t]*(?:\n|$))+/, Ue = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, We = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, R = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ge = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ke = /(?:[*+-]|\d{1,9}[.)])/, qe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Je = I(qe).replace(/bull/g, Ke).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ye = I(qe).replace(/bull/g, Ke).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Xe = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ze = /^[^\n]+/, Qe = /(?!\s*\])(?:\\.|[^\[\]\\])+/, $e = I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Qe).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), et = I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Ke).getRegex(), z = "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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", tt = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, nt = I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", tt).replace("tag", z).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), rt = I(Xe).replace("hr", R).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", z).getRegex(), it = {
466
+ blockquote: I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", rt).getRegex(),
467
+ code: Ue,
468
+ def: $e,
469
+ fences: We,
470
+ heading: Ge,
471
+ hr: R,
472
+ html: nt,
473
+ lheading: Je,
474
+ list: et,
475
+ newline: He,
476
+ paragraph: rt,
477
+ table: F,
478
+ text: Ze
479
+ }, at = I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", R).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", z).getRegex(), ot = {
480
+ ...it,
481
+ lheading: Ye,
482
+ table: at,
483
+ paragraph: I(Xe).replace("hr", R).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", at).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", z).getRegex()
484
+ }, st = {
485
+ ...it,
486
+ html: I("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", tt).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
487
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
488
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
489
+ fences: F,
490
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
491
+ paragraph: I(Xe).replace("hr", R).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Je).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
492
+ }, ct = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, lt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ut = /^( {2,}|\\)\n(?!\s*$)/, dt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, ft = /[\s\p{P}\p{S}]/u, pt = /[^\s\p{P}\p{S}]/u, mt = I(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, ft).getRegex(), ht = /(?!~)[\p{P}\p{S}]/u, gt = /(?!~)[\s\p{P}\p{S}]/u, _t = /(?:[^\s\p{P}\p{S}]|~)/u, vt = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, yt = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, bt = I(yt, "u").replace(/punct/g, B).getRegex(), xt = I(yt, "u").replace(/punct/g, ht).getRegex(), St = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ct = I(St, "gu").replace(/notPunctSpace/g, pt).replace(/punctSpace/g, ft).replace(/punct/g, B).getRegex(), wt = I(St, "gu").replace(/notPunctSpace/g, _t).replace(/punctSpace/g, gt).replace(/punct/g, ht).getRegex(), Tt = I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, pt).replace(/punctSpace/g, ft).replace(/punct/g, B).getRegex(), Et = I(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), Dt = I(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ot = I(tt).replace("(?:-->|$)", "-->").getRegex(), kt = I("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ot).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), V = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, At = I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", V).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), jt = I(/^!?\[(label)\]\[(ref)\]/).replace("label", V).replace("ref", Qe).getRegex(), Mt = I(/^!?\[(ref)\](?:\[\])?/).replace("ref", Qe).getRegex(), Nt = {
493
+ _backpedal: F,
494
+ anyPunctuation: Et,
495
+ autolink: Dt,
496
+ blockSkip: vt,
497
+ br: ut,
498
+ code: lt,
499
+ del: F,
500
+ emStrongLDelim: bt,
501
+ emStrongRDelimAst: Ct,
502
+ emStrongRDelimUnd: Tt,
503
+ escape: ct,
504
+ link: At,
505
+ nolink: Mt,
506
+ punctuation: mt,
507
+ reflink: jt,
508
+ reflinkSearch: I("reflink|nolink(?!\\()", "g").replace("reflink", jt).replace("nolink", Mt).getRegex(),
509
+ tag: kt,
510
+ text: dt,
511
+ url: F
512
+ }, Pt = {
513
+ ...Nt,
514
+ link: I(/^!?\[(label)\]\((.*?)\)/).replace("label", V).getRegex(),
515
+ reflink: I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", V).getRegex()
516
+ }, Ft = {
517
+ ...Nt,
518
+ emStrongRDelimAst: wt,
519
+ emStrongLDelim: xt,
520
+ url: I(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
521
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
522
+ del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
523
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
524
+ }, It = {
525
+ ...Ft,
526
+ br: I(ut).replace("{2,}", "*").getRegex(),
527
+ text: I(Ft.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
528
+ }, H = {
529
+ normal: it,
530
+ gfm: ot,
531
+ pedantic: st
532
+ }, U = {
533
+ normal: Nt,
534
+ gfm: Ft,
535
+ breaks: It,
536
+ pedantic: Pt
537
+ }, Lt = {
538
+ "&": "&amp;",
539
+ "<": "&lt;",
540
+ ">": "&gt;",
541
+ "\"": "&quot;",
542
+ "'": "&#39;"
543
+ }, Rt = (e) => Lt[e];
544
+ function W(e, t) {
545
+ if (t) {
546
+ if (L.escapeTest.test(e)) return e.replace(L.escapeReplace, Rt);
547
+ } else if (L.escapeTestNoEncode.test(e)) return e.replace(L.escapeReplaceNoEncode, Rt);
548
+ return e;
549
+ }
550
+ function zt(e) {
551
+ try {
552
+ e = encodeURI(e).replace(L.percentDecode, "%");
553
+ } catch {
554
+ return null;
555
+ }
556
+ return e;
557
+ }
558
+ function Bt(e, t) {
559
+ let n = e.replace(L.findPipe, (e, t, n) => {
560
+ let r = !1, i = t;
561
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
562
+ return r ? "|" : " |";
563
+ }).split(L.splitPipe), r = 0;
564
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
565
+ if (n.length > t) n.splice(t);
566
+ else for (; n.length < t;) n.push("");
567
+ }
568
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(L.slashPipe, "|");
569
+ return n;
570
+ }
571
+ function G(e, t, n) {
572
+ let r = e.length;
573
+ if (r === 0) return "";
574
+ let i = 0;
575
+ for (; i < r;) {
576
+ let a = e.charAt(r - i - 1);
577
+ if (a === t && !n) i++;
578
+ else if (a !== t && n) i++;
579
+ else break;
580
+ }
581
+ return e.slice(0, r - i);
582
+ }
583
+ function Vt(e, t) {
584
+ if (e.indexOf(t[1]) === -1) return -1;
585
+ let n = 0;
586
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
587
+ else if (e[r] === t[0]) n++;
588
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
589
+ return n > 0 ? -2 : -1;
590
+ }
591
+ function Ht(e, t, n, r, i) {
592
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
593
+ r.state.inLink = !0;
594
+ let c = {
595
+ type: e[0].charAt(0) === "!" ? "image" : "link",
596
+ raw: n,
597
+ href: a,
598
+ title: o,
599
+ text: s,
600
+ tokens: r.inlineTokens(s)
601
+ };
602
+ return r.state.inLink = !1, c;
603
+ }
604
+ function Ut(e, t, n) {
605
+ let r = e.match(n.other.indentCodeCompensation);
606
+ if (r === null) return t;
607
+ let i = r[1];
608
+ return t.split("\n").map((e) => {
609
+ let t = e.match(n.other.beginningSpace);
610
+ if (t === null) return e;
611
+ let [r] = t;
612
+ return r.length >= i.length ? e.slice(i.length) : e;
613
+ }).join("\n");
614
+ }
615
+ var K = class {
616
+ options;
617
+ rules;
618
+ lexer;
619
+ constructor(e) {
620
+ this.options = e || P;
621
+ }
622
+ space(e) {
623
+ let t = this.rules.block.newline.exec(e);
624
+ if (t && t[0].length > 0) return {
625
+ type: "space",
626
+ raw: t[0]
627
+ };
628
+ }
629
+ code(e) {
630
+ let t = this.rules.block.code.exec(e);
631
+ if (t) {
632
+ let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
633
+ return {
634
+ type: "code",
635
+ raw: t[0],
636
+ codeBlockStyle: "indented",
637
+ text: this.options.pedantic ? e : G(e, "\n")
638
+ };
639
+ }
640
+ }
641
+ fences(e) {
642
+ let t = this.rules.block.fences.exec(e);
643
+ if (t) {
644
+ let e = t[0], n = Ut(e, t[3] || "", this.rules);
645
+ return {
646
+ type: "code",
647
+ raw: e,
648
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
649
+ text: n
650
+ };
651
+ }
652
+ }
653
+ heading(e) {
654
+ let t = this.rules.block.heading.exec(e);
655
+ if (t) {
656
+ let e = t[2].trim();
657
+ if (this.rules.other.endingHash.test(e)) {
658
+ let t = G(e, "#");
659
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
660
+ }
661
+ return {
662
+ type: "heading",
663
+ raw: t[0],
664
+ depth: t[1].length,
665
+ text: e,
666
+ tokens: this.lexer.inline(e)
667
+ };
668
+ }
669
+ }
670
+ hr(e) {
671
+ let t = this.rules.block.hr.exec(e);
672
+ if (t) return {
673
+ type: "hr",
674
+ raw: G(t[0], "\n")
675
+ };
676
+ }
677
+ blockquote(e) {
678
+ let t = this.rules.block.blockquote.exec(e);
679
+ if (t) {
680
+ let e = G(t[0], "\n").split("\n"), n = "", r = "", i = [];
681
+ for (; e.length > 0;) {
682
+ let t = !1, a = [], o;
683
+ for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
684
+ else if (!t) a.push(e[o]);
685
+ else break;
686
+ e = e.slice(o);
687
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
688
+ n = n ? `${n}
689
+ ${s}` : s, r = r ? `${r}
690
+ ${c}` : c;
691
+ let l = this.lexer.state.top;
692
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
693
+ let u = i.at(-1);
694
+ if (u?.type === "code") break;
695
+ if (u?.type === "blockquote") {
696
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
697
+ i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
698
+ break;
699
+ }
700
+ if (u?.type === "list") {
701
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
702
+ i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
703
+ continue;
704
+ }
705
+ }
706
+ return {
707
+ type: "blockquote",
708
+ raw: n,
709
+ tokens: i,
710
+ text: r
711
+ };
712
+ }
713
+ }
714
+ list(e) {
715
+ let t = this.rules.block.list.exec(e);
716
+ if (t) {
717
+ let n = t[1].trim(), r = n.length > 1, i = {
718
+ type: "list",
719
+ raw: "",
720
+ ordered: r,
721
+ start: r ? +n.slice(0, -1) : "",
722
+ loose: !1,
723
+ items: []
724
+ };
725
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
726
+ let a = this.rules.other.listItemRegex(n), o = !1;
727
+ for (; e;) {
728
+ let n = !1, r = "", s = "";
729
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
730
+ r = t[0], e = e.substring(r.length);
731
+ let c = t[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
732
+ if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = t[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
733
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d);
734
+ for (; e;) {
735
+ let f = e.split("\n", 1)[0], p;
736
+ if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || t.test(l) || n.test(l)) break;
737
+ if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
738
+ else {
739
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
740
+ s += "\n" + l;
741
+ }
742
+ !u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
743
+ }
744
+ }
745
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0));
746
+ let f = null, p;
747
+ this.options.gfm && (f = this.rules.other.listIsTask.exec(s), f && (p = f[0] !== "[ ] ", s = s.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
748
+ type: "list_item",
749
+ raw: r,
750
+ task: !!f,
751
+ checked: p,
752
+ loose: !1,
753
+ text: s,
754
+ tokens: []
755
+ }), i.raw += r;
756
+ }
757
+ let s = i.items.at(-1);
758
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
759
+ else return;
760
+ i.raw = i.raw.trimEnd();
761
+ for (let e = 0; e < i.items.length; e++) if (this.lexer.state.top = !1, i.items[e].tokens = this.lexer.blockTokens(i.items[e].text, []), !i.loose) {
762
+ let t = i.items[e].tokens.filter((e) => e.type === "space");
763
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
764
+ }
765
+ if (i.loose) for (let e = 0; e < i.items.length; e++) i.items[e].loose = !0;
766
+ return i;
767
+ }
768
+ }
769
+ html(e) {
770
+ let t = this.rules.block.html.exec(e);
771
+ if (t) return {
772
+ type: "html",
773
+ block: !0,
774
+ raw: t[0],
775
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
776
+ text: t[0]
777
+ };
778
+ }
779
+ def(e) {
780
+ let t = this.rules.block.def.exec(e);
781
+ if (t) {
782
+ let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
783
+ return {
784
+ type: "def",
785
+ tag: e,
786
+ raw: t[0],
787
+ href: n,
788
+ title: r
789
+ };
790
+ }
791
+ }
792
+ table(e) {
793
+ let t = this.rules.block.table.exec(e);
794
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
795
+ let n = Bt(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
796
+ type: "table",
797
+ raw: t[0],
798
+ header: [],
799
+ align: [],
800
+ rows: []
801
+ };
802
+ if (n.length === r.length) {
803
+ for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
804
+ for (let e = 0; e < n.length; e++) a.header.push({
805
+ text: n[e],
806
+ tokens: this.lexer.inline(n[e]),
807
+ header: !0,
808
+ align: a.align[e]
809
+ });
810
+ for (let e of i) a.rows.push(Bt(e, a.header.length).map((e, t) => ({
811
+ text: e,
812
+ tokens: this.lexer.inline(e),
813
+ header: !1,
814
+ align: a.align[t]
815
+ })));
816
+ return a;
817
+ }
818
+ }
819
+ lheading(e) {
820
+ let t = this.rules.block.lheading.exec(e);
821
+ if (t) return {
822
+ type: "heading",
823
+ raw: t[0],
824
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
825
+ text: t[1],
826
+ tokens: this.lexer.inline(t[1])
827
+ };
828
+ }
829
+ paragraph(e) {
830
+ let t = this.rules.block.paragraph.exec(e);
831
+ if (t) {
832
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
833
+ return {
834
+ type: "paragraph",
835
+ raw: t[0],
836
+ text: e,
837
+ tokens: this.lexer.inline(e)
838
+ };
839
+ }
840
+ }
841
+ text(e) {
842
+ let t = this.rules.block.text.exec(e);
843
+ if (t) return {
844
+ type: "text",
845
+ raw: t[0],
846
+ text: t[0],
847
+ tokens: this.lexer.inline(t[0])
848
+ };
849
+ }
850
+ escape(e) {
851
+ let t = this.rules.inline.escape.exec(e);
852
+ if (t) return {
853
+ type: "escape",
854
+ raw: t[0],
855
+ text: t[1]
856
+ };
857
+ }
858
+ tag(e) {
859
+ let t = this.rules.inline.tag.exec(e);
860
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
861
+ type: "html",
862
+ raw: t[0],
863
+ inLink: this.lexer.state.inLink,
864
+ inRawBlock: this.lexer.state.inRawBlock,
865
+ block: !1,
866
+ text: t[0]
867
+ };
868
+ }
869
+ link(e) {
870
+ let t = this.rules.inline.link.exec(e);
871
+ if (t) {
872
+ let e = t[2].trim();
873
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
874
+ if (!this.rules.other.endAngleBracket.test(e)) return;
875
+ let t = G(e.slice(0, -1), "\\");
876
+ if ((e.length - t.length) % 2 == 0) return;
877
+ } else {
878
+ let e = Vt(t[2], "()");
879
+ if (e === -2) return;
880
+ if (e > -1) {
881
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
882
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
883
+ }
884
+ }
885
+ let n = t[2], r = "";
886
+ if (this.options.pedantic) {
887
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
888
+ e && (n = e[1], r = e[3]);
889
+ } else r = t[3] ? t[3].slice(1, -1) : "";
890
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Ht(t, {
891
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
892
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
893
+ }, t[0], this.lexer, this.rules);
894
+ }
895
+ }
896
+ reflink(e, t) {
897
+ let n;
898
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
899
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
900
+ if (!e) {
901
+ let e = n[0].charAt(0);
902
+ return {
903
+ type: "text",
904
+ raw: e,
905
+ text: e
906
+ };
907
+ }
908
+ return Ht(n, e, n[0], this.lexer, this.rules);
909
+ }
910
+ }
911
+ emStrong(e, t, n = "") {
912
+ let r = this.rules.inline.emStrongLDelim.exec(e);
913
+ if (r && !(r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
914
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
915
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
916
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
917
+ if (a = [...i].length, r[3] || r[4]) {
918
+ o += a;
919
+ continue;
920
+ }
921
+ if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
922
+ s += a;
923
+ continue;
924
+ }
925
+ if (o -= a, o > 0) continue;
926
+ a = Math.min(a, a + o + s);
927
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
928
+ if (Math.min(n, a) % 2) {
929
+ let e = c.slice(1, -1);
930
+ return {
931
+ type: "em",
932
+ raw: c,
933
+ text: e,
934
+ tokens: this.lexer.inlineTokens(e)
935
+ };
936
+ }
937
+ let l = c.slice(2, -2);
938
+ return {
939
+ type: "strong",
940
+ raw: c,
941
+ text: l,
942
+ tokens: this.lexer.inlineTokens(l)
943
+ };
944
+ }
945
+ }
946
+ }
947
+ codespan(e) {
948
+ let t = this.rules.inline.code.exec(e);
949
+ if (t) {
950
+ let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
951
+ return n && r && (e = e.substring(1, e.length - 1)), {
952
+ type: "codespan",
953
+ raw: t[0],
954
+ text: e
955
+ };
956
+ }
957
+ }
958
+ br(e) {
959
+ let t = this.rules.inline.br.exec(e);
960
+ if (t) return {
961
+ type: "br",
962
+ raw: t[0]
963
+ };
964
+ }
965
+ del(e) {
966
+ let t = this.rules.inline.del.exec(e);
967
+ if (t) return {
968
+ type: "del",
969
+ raw: t[0],
970
+ text: t[2],
971
+ tokens: this.lexer.inlineTokens(t[2])
972
+ };
973
+ }
974
+ autolink(e) {
975
+ let t = this.rules.inline.autolink.exec(e);
976
+ if (t) {
977
+ let e, n;
978
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
979
+ type: "link",
980
+ raw: t[0],
981
+ text: e,
982
+ href: n,
983
+ tokens: [{
984
+ type: "text",
985
+ raw: e,
986
+ text: e
987
+ }]
988
+ };
989
+ }
990
+ }
991
+ url(e) {
992
+ let t;
993
+ if (t = this.rules.inline.url.exec(e)) {
994
+ let e, n;
995
+ if (t[2] === "@") e = t[0], n = "mailto:" + e;
996
+ else {
997
+ let r;
998
+ do
999
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
1000
+ while (r !== t[0]);
1001
+ e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
1002
+ }
1003
+ return {
1004
+ type: "link",
1005
+ raw: t[0],
1006
+ text: e,
1007
+ href: n,
1008
+ tokens: [{
1009
+ type: "text",
1010
+ raw: e,
1011
+ text: e
1012
+ }]
1013
+ };
1014
+ }
1015
+ }
1016
+ inlineText(e) {
1017
+ let t = this.rules.inline.text.exec(e);
1018
+ if (t) {
1019
+ let e = this.lexer.state.inRawBlock;
1020
+ return {
1021
+ type: "text",
1022
+ raw: t[0],
1023
+ text: t[0],
1024
+ escaped: e
1025
+ };
1026
+ }
1027
+ }
1028
+ }, q = class e {
1029
+ tokens;
1030
+ options;
1031
+ state;
1032
+ tokenizer;
1033
+ inlineQueue;
1034
+ constructor(e) {
1035
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || P, this.options.tokenizer = this.options.tokenizer || new K(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1036
+ inLink: !1,
1037
+ inRawBlock: !1,
1038
+ top: !0
1039
+ };
1040
+ let t = {
1041
+ other: L,
1042
+ block: H.normal,
1043
+ inline: U.normal
1044
+ };
1045
+ this.options.pedantic ? (t.block = H.pedantic, t.inline = U.pedantic) : this.options.gfm && (t.block = H.gfm, t.inline = this.options.breaks ? U.breaks : U.gfm), this.tokenizer.rules = t;
1046
+ }
1047
+ static get rules() {
1048
+ return {
1049
+ block: H,
1050
+ inline: U
1051
+ };
1052
+ }
1053
+ static lex(t, n) {
1054
+ return new e(n).lex(t);
1055
+ }
1056
+ static lexInline(t, n) {
1057
+ return new e(n).inlineTokens(t);
1058
+ }
1059
+ lex(e) {
1060
+ e = e.replace(L.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1061
+ for (let e = 0; e < this.inlineQueue.length; e++) {
1062
+ let t = this.inlineQueue[e];
1063
+ this.inlineTokens(t.src, t.tokens);
1064
+ }
1065
+ return this.inlineQueue = [], this.tokens;
1066
+ }
1067
+ blockTokens(e, t = [], n = !1) {
1068
+ for (this.options.pedantic && (e = e.replace(L.tabCharGlobal, " ").replace(L.spaceLine, "")); e;) {
1069
+ let r;
1070
+ if (this.options.extensions?.block?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
1071
+ if (r = this.tokenizer.space(e)) {
1072
+ e = e.substring(r.raw.length);
1073
+ let n = t.at(-1);
1074
+ r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
1075
+ continue;
1076
+ }
1077
+ if (r = this.tokenizer.code(e)) {
1078
+ e = e.substring(r.raw.length);
1079
+ let n = t.at(-1);
1080
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += "\n" + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
1081
+ continue;
1082
+ }
1083
+ if (r = this.tokenizer.fences(e)) {
1084
+ e = e.substring(r.raw.length), t.push(r);
1085
+ continue;
1086
+ }
1087
+ if (r = this.tokenizer.heading(e)) {
1088
+ e = e.substring(r.raw.length), t.push(r);
1089
+ continue;
1090
+ }
1091
+ if (r = this.tokenizer.hr(e)) {
1092
+ e = e.substring(r.raw.length), t.push(r);
1093
+ continue;
1094
+ }
1095
+ if (r = this.tokenizer.blockquote(e)) {
1096
+ e = e.substring(r.raw.length), t.push(r);
1097
+ continue;
1098
+ }
1099
+ if (r = this.tokenizer.list(e)) {
1100
+ e = e.substring(r.raw.length), t.push(r);
1101
+ continue;
1102
+ }
1103
+ if (r = this.tokenizer.html(e)) {
1104
+ e = e.substring(r.raw.length), t.push(r);
1105
+ continue;
1106
+ }
1107
+ if (r = this.tokenizer.def(e)) {
1108
+ e = e.substring(r.raw.length);
1109
+ let n = t.at(-1);
1110
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += "\n" + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
1111
+ href: r.href,
1112
+ title: r.title
1113
+ });
1114
+ continue;
1115
+ }
1116
+ if (r = this.tokenizer.table(e)) {
1117
+ e = e.substring(r.raw.length), t.push(r);
1118
+ continue;
1119
+ }
1120
+ if (r = this.tokenizer.lheading(e)) {
1121
+ e = e.substring(r.raw.length), t.push(r);
1122
+ continue;
1123
+ }
1124
+ let i = e;
1125
+ if (this.options.extensions?.startBlock) {
1126
+ let t = Infinity, n = e.slice(1), r;
1127
+ this.options.extensions.startBlock.forEach((e) => {
1128
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
1129
+ }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
1130
+ }
1131
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
1132
+ let a = t.at(-1);
1133
+ n && a?.type === "paragraph" ? (a.raw += "\n" + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
1134
+ continue;
1135
+ }
1136
+ if (r = this.tokenizer.text(e)) {
1137
+ e = e.substring(r.raw.length);
1138
+ let n = t.at(-1);
1139
+ n?.type === "text" ? (n.raw += "\n" + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
1140
+ continue;
1141
+ }
1142
+ if (e) {
1143
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
1144
+ if (this.options.silent) {
1145
+ console.error(t);
1146
+ break;
1147
+ }
1148
+ throw Error(t);
1149
+ }
1150
+ }
1151
+ return this.state.top = !0, t;
1152
+ }
1153
+ inline(e, t = []) {
1154
+ return this.inlineQueue.push({
1155
+ src: e,
1156
+ tokens: t
1157
+ }), t;
1158
+ }
1159
+ inlineTokens(e, t = []) {
1160
+ let n = e, r = null;
1161
+ if (this.tokens.links) {
1162
+ let e = Object.keys(this.tokens.links);
1163
+ if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1164
+ }
1165
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1166
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1167
+ let i = !1, a = "";
1168
+ for (; e;) {
1169
+ i || (a = ""), i = !1;
1170
+ let r;
1171
+ if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
1172
+ if (r = this.tokenizer.escape(e)) {
1173
+ e = e.substring(r.raw.length), t.push(r);
1174
+ continue;
1175
+ }
1176
+ if (r = this.tokenizer.tag(e)) {
1177
+ e = e.substring(r.raw.length), t.push(r);
1178
+ continue;
1179
+ }
1180
+ if (r = this.tokenizer.link(e)) {
1181
+ e = e.substring(r.raw.length), t.push(r);
1182
+ continue;
1183
+ }
1184
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
1185
+ e = e.substring(r.raw.length);
1186
+ let n = t.at(-1);
1187
+ r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
1188
+ continue;
1189
+ }
1190
+ if (r = this.tokenizer.emStrong(e, n, a)) {
1191
+ e = e.substring(r.raw.length), t.push(r);
1192
+ continue;
1193
+ }
1194
+ if (r = this.tokenizer.codespan(e)) {
1195
+ e = e.substring(r.raw.length), t.push(r);
1196
+ continue;
1197
+ }
1198
+ if (r = this.tokenizer.br(e)) {
1199
+ e = e.substring(r.raw.length), t.push(r);
1200
+ continue;
1201
+ }
1202
+ if (r = this.tokenizer.del(e)) {
1203
+ e = e.substring(r.raw.length), t.push(r);
1204
+ continue;
1205
+ }
1206
+ if (r = this.tokenizer.autolink(e)) {
1207
+ e = e.substring(r.raw.length), t.push(r);
1208
+ continue;
1209
+ }
1210
+ if (!this.state.inLink && (r = this.tokenizer.url(e))) {
1211
+ e = e.substring(r.raw.length), t.push(r);
1212
+ continue;
1213
+ }
1214
+ let o = e;
1215
+ if (this.options.extensions?.startInline) {
1216
+ let t = Infinity, n = e.slice(1), r;
1217
+ this.options.extensions.startInline.forEach((e) => {
1218
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
1219
+ }), t < Infinity && t >= 0 && (o = e.substring(0, t + 1));
1220
+ }
1221
+ if (r = this.tokenizer.inlineText(o)) {
1222
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (a = r.raw.slice(-1)), i = !0;
1223
+ let n = t.at(-1);
1224
+ n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
1225
+ continue;
1226
+ }
1227
+ if (e) {
1228
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
1229
+ if (this.options.silent) {
1230
+ console.error(t);
1231
+ break;
1232
+ }
1233
+ throw Error(t);
1234
+ }
1235
+ }
1236
+ return t;
1237
+ }
1238
+ }, J = class {
1239
+ options;
1240
+ parser;
1241
+ constructor(e) {
1242
+ this.options = e || P;
1243
+ }
1244
+ space(e) {
1245
+ return "";
1246
+ }
1247
+ code({ text: e, lang: t, escaped: n }) {
1248
+ let r = (t || "").match(L.notSpaceStart)?.[0], i = e.replace(L.endingNewline, "") + "\n";
1249
+ return r ? "<pre><code class=\"language-" + W(r) + "\">" + (n ? i : W(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : W(i, !0)) + "</code></pre>\n";
1250
+ }
1251
+ blockquote({ tokens: e }) {
1252
+ return `<blockquote>
1253
+ ${this.parser.parse(e)}</blockquote>
1254
+ `;
1255
+ }
1256
+ html({ text: e }) {
1257
+ return e;
1258
+ }
1259
+ heading({ tokens: e, depth: t }) {
1260
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
1261
+ `;
1262
+ }
1263
+ hr(e) {
1264
+ return "<hr>\n";
1265
+ }
1266
+ list(e) {
1267
+ let t = e.ordered, n = e.start, r = "";
1268
+ for (let t = 0; t < e.items.length; t++) {
1269
+ let n = e.items[t];
1270
+ r += this.listitem(n);
1271
+ }
1272
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
1273
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
1274
+ }
1275
+ listitem(e) {
1276
+ let t = "";
1277
+ if (e.task) {
1278
+ let n = this.checkbox({ checked: !!e.checked });
1279
+ e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + W(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
1280
+ type: "text",
1281
+ raw: n + " ",
1282
+ text: n + " ",
1283
+ escaped: !0
1284
+ }) : t += n + " ";
1285
+ }
1286
+ return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
1287
+ `;
1288
+ }
1289
+ checkbox({ checked: e }) {
1290
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
1291
+ }
1292
+ paragraph({ tokens: e }) {
1293
+ return `<p>${this.parser.parseInline(e)}</p>
1294
+ `;
1295
+ }
1296
+ table(e) {
1297
+ let t = "", n = "";
1298
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
1299
+ t += this.tablerow({ text: n });
1300
+ let r = "";
1301
+ for (let t = 0; t < e.rows.length; t++) {
1302
+ let i = e.rows[t];
1303
+ n = "";
1304
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
1305
+ r += this.tablerow({ text: n });
1306
+ }
1307
+ return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
1308
+ }
1309
+ tablerow({ text: e }) {
1310
+ return `<tr>
1311
+ ${e}</tr>
1312
+ `;
1313
+ }
1314
+ tablecell(e) {
1315
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
1316
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1317
+ `;
1318
+ }
1319
+ strong({ tokens: e }) {
1320
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
1321
+ }
1322
+ em({ tokens: e }) {
1323
+ return `<em>${this.parser.parseInline(e)}</em>`;
1324
+ }
1325
+ codespan({ text: e }) {
1326
+ return `<code>${W(e, !0)}</code>`;
1327
+ }
1328
+ br(e) {
1329
+ return "<br>";
1330
+ }
1331
+ del({ tokens: e }) {
1332
+ return `<del>${this.parser.parseInline(e)}</del>`;
1333
+ }
1334
+ link({ href: e, title: t, tokens: n }) {
1335
+ let r = this.parser.parseInline(n), i = zt(e);
1336
+ if (i === null) return r;
1337
+ e = i;
1338
+ let a = "<a href=\"" + e + "\"";
1339
+ return t && (a += " title=\"" + W(t) + "\""), a += ">" + r + "</a>", a;
1340
+ }
1341
+ image({ href: e, title: t, text: n, tokens: r }) {
1342
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1343
+ let i = zt(e);
1344
+ if (i === null) return W(n);
1345
+ e = i;
1346
+ let a = `<img src="${e}" alt="${n}"`;
1347
+ return t && (a += ` title="${W(t)}"`), a += ">", a;
1348
+ }
1349
+ text(e) {
1350
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : W(e.text);
1351
+ }
1352
+ }, Wt = class {
1353
+ strong({ text: e }) {
1354
+ return e;
1355
+ }
1356
+ em({ text: e }) {
1357
+ return e;
1358
+ }
1359
+ codespan({ text: e }) {
1360
+ return e;
1361
+ }
1362
+ del({ text: e }) {
1363
+ return e;
1364
+ }
1365
+ html({ text: e }) {
1366
+ return e;
1367
+ }
1368
+ text({ text: e }) {
1369
+ return e;
1370
+ }
1371
+ link({ text: e }) {
1372
+ return "" + e;
1373
+ }
1374
+ image({ text: e }) {
1375
+ return "" + e;
1376
+ }
1377
+ br() {
1378
+ return "";
1379
+ }
1380
+ }, Y = class e {
1381
+ options;
1382
+ renderer;
1383
+ textRenderer;
1384
+ constructor(e) {
1385
+ this.options = e || P, this.options.renderer = this.options.renderer || new J(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Wt();
1386
+ }
1387
+ static parse(t, n) {
1388
+ return new e(n).parse(t);
1389
+ }
1390
+ static parseInline(t, n) {
1391
+ return new e(n).parseInline(t);
1392
+ }
1393
+ parse(e, t = !0) {
1394
+ let n = "";
1395
+ for (let r = 0; r < e.length; r++) {
1396
+ let i = e[r];
1397
+ if (this.options.extensions?.renderers?.[i.type]) {
1398
+ let e = i, t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1399
+ if (t !== !1 || ![
1400
+ "space",
1401
+ "hr",
1402
+ "heading",
1403
+ "code",
1404
+ "table",
1405
+ "blockquote",
1406
+ "list",
1407
+ "html",
1408
+ "paragraph",
1409
+ "text"
1410
+ ].includes(e.type)) {
1411
+ n += t || "";
1412
+ continue;
1413
+ }
1414
+ }
1415
+ let a = i;
1416
+ switch (a.type) {
1417
+ case "space":
1418
+ n += this.renderer.space(a);
1419
+ continue;
1420
+ case "hr":
1421
+ n += this.renderer.hr(a);
1422
+ continue;
1423
+ case "heading":
1424
+ n += this.renderer.heading(a);
1425
+ continue;
1426
+ case "code":
1427
+ n += this.renderer.code(a);
1428
+ continue;
1429
+ case "table":
1430
+ n += this.renderer.table(a);
1431
+ continue;
1432
+ case "blockquote":
1433
+ n += this.renderer.blockquote(a);
1434
+ continue;
1435
+ case "list":
1436
+ n += this.renderer.list(a);
1437
+ continue;
1438
+ case "html":
1439
+ n += this.renderer.html(a);
1440
+ continue;
1441
+ case "paragraph":
1442
+ n += this.renderer.paragraph(a);
1443
+ continue;
1444
+ case "text": {
1445
+ let i = a, o = this.renderer.text(i);
1446
+ for (; r + 1 < e.length && e[r + 1].type === "text";) i = e[++r], o += "\n" + this.renderer.text(i);
1447
+ n += t ? this.renderer.paragraph({
1448
+ type: "paragraph",
1449
+ raw: o,
1450
+ text: o,
1451
+ tokens: [{
1452
+ type: "text",
1453
+ raw: o,
1454
+ text: o,
1455
+ escaped: !0
1456
+ }]
1457
+ }) : o;
1458
+ continue;
1459
+ }
1460
+ default: {
1461
+ let e = "Token with \"" + a.type + "\" type was not found.";
1462
+ if (this.options.silent) return console.error(e), "";
1463
+ throw Error(e);
1464
+ }
1465
+ }
1466
+ }
1467
+ return n;
1468
+ }
1469
+ parseInline(e, t = this.renderer) {
1470
+ let n = "";
1471
+ for (let r = 0; r < e.length; r++) {
1472
+ let i = e[r];
1473
+ if (this.options.extensions?.renderers?.[i.type]) {
1474
+ let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1475
+ if (e !== !1 || ![
1476
+ "escape",
1477
+ "html",
1478
+ "link",
1479
+ "image",
1480
+ "strong",
1481
+ "em",
1482
+ "codespan",
1483
+ "br",
1484
+ "del",
1485
+ "text"
1486
+ ].includes(i.type)) {
1487
+ n += e || "";
1488
+ continue;
1489
+ }
1490
+ }
1491
+ let a = i;
1492
+ switch (a.type) {
1493
+ case "escape":
1494
+ n += t.text(a);
1495
+ break;
1496
+ case "html":
1497
+ n += t.html(a);
1498
+ break;
1499
+ case "link":
1500
+ n += t.link(a);
1501
+ break;
1502
+ case "image":
1503
+ n += t.image(a);
1504
+ break;
1505
+ case "strong":
1506
+ n += t.strong(a);
1507
+ break;
1508
+ case "em":
1509
+ n += t.em(a);
1510
+ break;
1511
+ case "codespan":
1512
+ n += t.codespan(a);
1513
+ break;
1514
+ case "br":
1515
+ n += t.br(a);
1516
+ break;
1517
+ case "del":
1518
+ n += t.del(a);
1519
+ break;
1520
+ case "text":
1521
+ n += t.text(a);
1522
+ break;
1523
+ default: {
1524
+ let e = "Token with \"" + a.type + "\" type was not found.";
1525
+ if (this.options.silent) return console.error(e), "";
1526
+ throw Error(e);
1527
+ }
1528
+ }
1529
+ }
1530
+ return n;
1531
+ }
1532
+ }, X = class {
1533
+ options;
1534
+ block;
1535
+ constructor(e) {
1536
+ this.options = e || P;
1537
+ }
1538
+ static passThroughHooks = /* @__PURE__ */ new Set([
1539
+ "preprocess",
1540
+ "postprocess",
1541
+ "processAllTokens"
1542
+ ]);
1543
+ preprocess(e) {
1544
+ return e;
1545
+ }
1546
+ postprocess(e) {
1547
+ return e;
1548
+ }
1549
+ processAllTokens(e) {
1550
+ return e;
1551
+ }
1552
+ provideLexer() {
1553
+ return this.block ? q.lex : q.lexInline;
1554
+ }
1555
+ provideParser() {
1556
+ return this.block ? Y.parse : Y.parseInline;
1557
+ }
1558
+ }, Z = new class {
1559
+ defaults = Be();
1560
+ options = this.setOptions;
1561
+ parse = this.parseMarkdown(!0);
1562
+ parseInline = this.parseMarkdown(!1);
1563
+ Parser = Y;
1564
+ Renderer = J;
1565
+ TextRenderer = Wt;
1566
+ Lexer = q;
1567
+ Tokenizer = K;
1568
+ Hooks = X;
1569
+ constructor(...e) {
1570
+ this.use(...e);
1571
+ }
1572
+ walkTokens(e, t) {
1573
+ let n = [];
1574
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1575
+ case "table": {
1576
+ let e = r;
1577
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1578
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1579
+ break;
1580
+ }
1581
+ case "list": {
1582
+ let e = r;
1583
+ n = n.concat(this.walkTokens(e.items, t));
1584
+ break;
1585
+ }
1586
+ default: {
1587
+ let e = r;
1588
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1589
+ let i = e[r].flat(Infinity);
1590
+ n = n.concat(this.walkTokens(i, t));
1591
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1592
+ }
1593
+ }
1594
+ return n;
1595
+ }
1596
+ use(...e) {
1597
+ let t = this.defaults.extensions || {
1598
+ renderers: {},
1599
+ childTokens: {}
1600
+ };
1601
+ return e.forEach((e) => {
1602
+ let n = { ...e };
1603
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1604
+ if (!e.name) throw Error("extension name required");
1605
+ if ("renderer" in e) {
1606
+ let n = t.renderers[e.name];
1607
+ n ? t.renderers[e.name] = function(...t) {
1608
+ let r = e.renderer.apply(this, t);
1609
+ return r === !1 && (r = n.apply(this, t)), r;
1610
+ } : t.renderers[e.name] = e.renderer;
1611
+ }
1612
+ if ("tokenizer" in e) {
1613
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1614
+ let n = t[e.level];
1615
+ n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
1616
+ }
1617
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1618
+ }), n.extensions = t), e.renderer) {
1619
+ let t = this.defaults.renderer || new J(this.defaults);
1620
+ for (let n in e.renderer) {
1621
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1622
+ if (["options", "parser"].includes(n)) continue;
1623
+ let r = n, i = e.renderer[r], a = t[r];
1624
+ t[r] = (...e) => {
1625
+ let n = i.apply(t, e);
1626
+ return n === !1 && (n = a.apply(t, e)), n || "";
1627
+ };
1628
+ }
1629
+ n.renderer = t;
1630
+ }
1631
+ if (e.tokenizer) {
1632
+ let t = this.defaults.tokenizer || new K(this.defaults);
1633
+ for (let n in e.tokenizer) {
1634
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1635
+ if ([
1636
+ "options",
1637
+ "rules",
1638
+ "lexer"
1639
+ ].includes(n)) continue;
1640
+ let r = n, i = e.tokenizer[r], a = t[r];
1641
+ t[r] = (...e) => {
1642
+ let n = i.apply(t, e);
1643
+ return n === !1 && (n = a.apply(t, e)), n;
1644
+ };
1645
+ }
1646
+ n.tokenizer = t;
1647
+ }
1648
+ if (e.hooks) {
1649
+ let t = this.defaults.hooks || new X();
1650
+ for (let n in e.hooks) {
1651
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1652
+ if (["options", "block"].includes(n)) continue;
1653
+ let r = n, i = e.hooks[r], a = t[r];
1654
+ t[r] = X.passThroughHooks.has(n) ? (e) => {
1655
+ if (this.defaults.async) return Promise.resolve(i.call(t, e)).then((e) => a.call(t, e));
1656
+ let n = i.call(t, e);
1657
+ return a.call(t, n);
1658
+ } : (...e) => {
1659
+ let n = i.apply(t, e);
1660
+ return n === !1 && (n = a.apply(t, e)), n;
1661
+ };
1662
+ }
1663
+ n.hooks = t;
1664
+ }
1665
+ if (e.walkTokens) {
1666
+ let t = this.defaults.walkTokens, r = e.walkTokens;
1667
+ n.walkTokens = function(e) {
1668
+ let n = [];
1669
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1670
+ };
1671
+ }
1672
+ this.defaults = {
1673
+ ...this.defaults,
1674
+ ...n
1675
+ };
1676
+ }), this;
1677
+ }
1678
+ setOptions(e) {
1679
+ return this.defaults = {
1680
+ ...this.defaults,
1681
+ ...e
1682
+ }, this;
1683
+ }
1684
+ lexer(e, t) {
1685
+ return q.lex(e, t ?? this.defaults);
1686
+ }
1687
+ parser(e, t) {
1688
+ return Y.parse(e, t ?? this.defaults);
1689
+ }
1690
+ parseMarkdown(e) {
1691
+ return (t, n) => {
1692
+ let r = { ...n }, i = {
1693
+ ...this.defaults,
1694
+ ...r
1695
+ }, a = this.onError(!!i.silent, !!i.async);
1696
+ if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1697
+ if (t == null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1698
+ if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1699
+ i.hooks && (i.hooks.options = i, i.hooks.block = e);
1700
+ let o = i.hooks ? i.hooks.provideLexer() : e ? q.lex : q.lexInline, s = i.hooks ? i.hooks.provideParser() : e ? Y.parse : Y.parseInline;
1701
+ if (i.async) return Promise.resolve(i.hooks ? i.hooks.preprocess(t) : t).then((e) => o(e, i)).then((e) => i.hooks ? i.hooks.processAllTokens(e) : e).then((e) => i.walkTokens ? Promise.all(this.walkTokens(e, i.walkTokens)).then(() => e) : e).then((e) => s(e, i)).then((e) => i.hooks ? i.hooks.postprocess(e) : e).catch(a);
1702
+ try {
1703
+ i.hooks && (t = i.hooks.preprocess(t));
1704
+ let e = o(t, i);
1705
+ i.hooks && (e = i.hooks.processAllTokens(e)), i.walkTokens && this.walkTokens(e, i.walkTokens);
1706
+ let n = s(e, i);
1707
+ return i.hooks && (n = i.hooks.postprocess(n)), n;
1708
+ } catch (e) {
1709
+ return a(e);
1710
+ }
1711
+ };
1712
+ }
1713
+ onError(e, t) {
1714
+ return (n) => {
1715
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1716
+ let e = "<p>An error occurred:</p><pre>" + W(n.message + "", !0) + "</pre>";
1717
+ return t ? Promise.resolve(e) : e;
1718
+ }
1719
+ if (t) return Promise.reject(n);
1720
+ throw n;
1721
+ };
1722
+ }
1723
+ }();
1724
+ function Q(e, t) {
1725
+ return Z.parse(e, t);
1726
+ }
1727
+ Q.options = Q.setOptions = function(e) {
1728
+ return Z.setOptions(e), Q.defaults = Z.defaults, Ve(Q.defaults), Q;
1729
+ }, Q.getDefaults = Be, Q.defaults = P, Q.use = function(...e) {
1730
+ return Z.use(...e), Q.defaults = Z.defaults, Ve(Q.defaults), Q;
1731
+ }, Q.walkTokens = function(e, t) {
1732
+ return Z.walkTokens(e, t);
1733
+ }, Q.parseInline = Z.parseInline, Q.Parser = Y, Q.parser = Y.parse, Q.Renderer = J, Q.TextRenderer = Wt, Q.Lexer = q, Q.lexer = q.lex, Q.Tokenizer = K, Q.Hooks = X, Q.parse = Q, Q.options, Q.setOptions, Q.use, Q.walkTokens, Q.parseInline, Y.parse, q.lex;
1734
+ //#endregion
1735
+ //#region src/components/ui/toast.tsx
1736
+ var $ = a(), Gt = Ne, Kt = b.forwardRef((e, n) => {
1737
+ let r = (0, $.c)(9), i, a;
1738
+ r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
1739
+ let o;
1740
+ r[3] === i ? o = r[4] : (o = t("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:w-fit md:max-w-[420px]", "print:hidden", i), r[3] = i, r[4] = o);
1741
+ let s;
1742
+ return r[5] !== a || r[6] !== n || r[7] !== o ? (s = /* @__PURE__ */ (0, x.jsx)(Pe, {
1743
+ ref: n,
1744
+ className: o,
1745
+ ...a
1746
+ }), r[5] = a, r[6] = n, r[7] = o, r[8] = s) : s = r[8], s;
1747
+ });
1748
+ Kt.displayName = Pe.displayName;
1749
+ var qt = {
1750
+ default: "bg-background border forced-colors:border-[CanvasText] forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]",
1751
+ danger: "group destructive text-error border-destructive bg-(--red-1) shadow-md-solid shadow-error forced-colors:border-[CanvasText] forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]"
1752
+ }, Jt = r("data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-start justify-between gap-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full forced-color-adjust-none", {
1753
+ variants: { variant: qt },
1754
+ defaultVariants: { variant: "default" }
1755
+ });
1756
+ function Yt(e) {
1757
+ return typeof e == "string" && e in qt;
1758
+ }
1759
+ var Xt = b.forwardRef((e, n) => {
1760
+ let r = (0, $.c)(11), i, a, o;
1761
+ r[0] === e ? (i = r[1], a = r[2], o = r[3]) : ({className: i, variant: o, ...a} = e, r[0] = e, r[1] = i, r[2] = a, r[3] = o);
1762
+ let s = Yt(o) ? o : "default", c;
1763
+ r[4] !== i || r[5] !== s ? (c = t(Jt({ variant: s }), "print:hidden", i), r[4] = i, r[5] = s, r[6] = c) : c = r[6];
1764
+ let l;
1765
+ return r[7] !== a || r[8] !== n || r[9] !== c ? (l = /* @__PURE__ */ (0, x.jsx)(Fe, {
1766
+ ref: n,
1767
+ className: c,
1768
+ ...a
1769
+ }), r[7] = a, r[8] = n, r[9] = c, r[10] = l) : l = r[10], l;
1770
+ });
1771
+ Xt.displayName = Fe.displayName;
1772
+ var Zt = b.forwardRef((e, n) => {
1773
+ let r = (0, $.c)(9), i, a;
1774
+ r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
1775
+ let o;
1776
+ r[3] === i ? o = r[4] : (o = t("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus-visible:group-[.destructive]:ring-destructive", "forced-color-adjust-none forced-colors:border-[ButtonText] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText] forced-colors:hover:bg-[Highlight] forced-colors:hover:text-[HighlightText] forced-colors:disabled:border-[GrayText] forced-colors:disabled:text-[GrayText]", i), r[3] = i, r[4] = o);
1777
+ let s;
1778
+ return r[5] !== a || r[6] !== n || r[7] !== o ? (s = /* @__PURE__ */ (0, x.jsx)(Re, {
1779
+ ref: n,
1780
+ className: o,
1781
+ ...a
1782
+ }), r[5] = a, r[6] = n, r[7] = o, r[8] = s) : s = r[8], s;
1783
+ });
1784
+ Zt.displayName = Re.displayName;
1785
+ var Qt = b.forwardRef((e, n) => {
1786
+ let r = (0, $.c)(10), i, a;
1787
+ r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
1788
+ let o;
1789
+ r[3] === i ? o = r[4] : (o = t("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus-visible:group-[.destructive]:ring-red-400 focus-visible:group-[.destructive]:ring-offset-red-600", "forced-colors:text-[CanvasText] forced-colors:hover:text-[CanvasText] forced-colors:group-[.destructive]:text-[CanvasText] forced-colors:hover:group-[.destructive]:text-[CanvasText]", i), r[3] = i, r[4] = o);
1790
+ let c;
1791
+ r[5] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ (0, x.jsx)(s, { className: "h-4 w-4" }), r[5] = c) : c = r[5];
1792
+ let l;
1793
+ return r[6] !== a || r[7] !== n || r[8] !== o ? (l = /* @__PURE__ */ (0, x.jsx)(ze, {
1794
+ ref: n,
1795
+ className: o,
1796
+ "toast-close": "",
1797
+ ...a,
1798
+ children: c
1799
+ }), r[6] = a, r[7] = n, r[8] = o, r[9] = l) : l = r[9], l;
1800
+ });
1801
+ Qt.displayName = ze.displayName;
1802
+ var $t = b.forwardRef((e, n) => {
1803
+ let r = (0, $.c)(9), i, a;
1804
+ r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
1805
+ let o;
1806
+ r[3] === i ? o = r[4] : (o = t("text-sm font-semibold", i), r[3] = i, r[4] = o);
1807
+ let s;
1808
+ return r[5] !== a || r[6] !== n || r[7] !== o ? (s = /* @__PURE__ */ (0, x.jsx)(Ie, {
1809
+ ref: n,
1810
+ className: o,
1811
+ ...a
1812
+ }), r[5] = a, r[6] = n, r[7] = o, r[8] = s) : s = r[8], s;
1813
+ });
1814
+ $t.displayName = Ie.displayName;
1815
+ var en = b.forwardRef((e, n) => {
1816
+ let r = (0, $.c)(13), i, a, o;
1817
+ r[0] === e ? (i = r[1], a = r[2], o = r[3]) : ({className: i, onPointerDown: a, ...o} = e, r[0] = e, r[1] = i, r[2] = a, r[3] = o);
1818
+ let s;
1819
+ r[4] === i ? s = r[5] : (s = t("max-h-48 overflow-auto text-sm opacity-90 whitespace-pre-wrap wrap-break-word select-text cursor-text", i), r[4] = i, r[5] = s);
1820
+ let c;
1821
+ r[6] === a ? c = r[7] : (c = (e) => {
1822
+ e.stopPropagation(), a?.(e);
1823
+ }, r[6] = a, r[7] = c);
1824
+ let l;
1825
+ return r[8] !== o || r[9] !== n || r[10] !== s || r[11] !== c ? (l = /* @__PURE__ */ (0, x.jsx)(Le, {
1826
+ ref: n,
1827
+ className: s,
1828
+ onPointerDown: c,
1829
+ ...o
1830
+ }), r[8] = o, r[9] = n, r[10] = s, r[11] = c, r[12] = l) : l = r[12], l;
1831
+ });
1832
+ en.displayName = Le.displayName;
1833
+ //#endregion
1834
+ export { Gt as a, Q as c, en as i, Zt as n, $t as o, Qt as r, Kt as s, Xt as t };