nolzu 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +24 -7
  3. package/build/client/_app/immutable/assets/0.SPD4wYkc.css +1 -0
  4. package/build/client/_app/immutable/assets/1.BRilEoOO.css +1 -0
  5. package/build/client/_app/immutable/assets/10.DwLiBGDj.css +1 -0
  6. package/build/client/_app/immutable/assets/11.D_TtWT3D.css +1 -0
  7. package/build/client/_app/immutable/assets/12.CSVGmtUY.css +1 -0
  8. package/build/client/_app/immutable/assets/13.qTa7IHbg.css +1 -0
  9. package/build/client/_app/immutable/assets/19.CbCFXKb8.css +1 -0
  10. package/build/client/_app/immutable/assets/2.CfHhgI77.css +1 -0
  11. package/build/client/_app/immutable/assets/20.C5CSZhyT.css +1 -0
  12. package/build/client/_app/immutable/assets/21.BBpYkZcc.css +1 -0
  13. package/build/client/_app/immutable/assets/22.C9RgY9kl.css +1 -0
  14. package/build/client/_app/immutable/assets/23.B6Dp9RJO.css +1 -0
  15. package/build/client/_app/immutable/assets/24.C7g2abUW.css +1 -0
  16. package/build/client/_app/immutable/assets/26.DTMI6ROV.css +1 -0
  17. package/build/client/_app/immutable/assets/27.AxXMpDkB.css +1 -0
  18. package/build/client/_app/immutable/assets/28.939ac-98.css +1 -0
  19. package/build/client/_app/immutable/assets/3.3lqex1t-.css +1 -0
  20. package/build/client/_app/immutable/assets/4.C52MzO_d.css +1 -0
  21. package/build/client/_app/immutable/assets/5.CsfJAwvS.css +1 -0
  22. package/build/client/_app/immutable/assets/8.ByspUp-s.css +1 -0
  23. package/build/client/_app/immutable/assets/9.BCSFZmce.css +1 -0
  24. package/build/client/_app/immutable/assets/Banner.DDqfpWLD.css +1 -0
  25. package/build/client/_app/immutable/assets/BoardOff.mpX08-Be.css +1 -0
  26. package/build/client/_app/immutable/assets/Button.BlwsEgUc.css +1 -0
  27. package/build/client/_app/immutable/assets/Chip.qAAa6_e5.css +1 -0
  28. package/build/client/_app/immutable/assets/Dialog.D5Ln60a8.css +1 -0
  29. package/build/client/_app/immutable/assets/FeaturePanels.DZ_Mth5M.css +1 -0
  30. package/build/client/_app/immutable/assets/FolderBrowser.DBmRWDCH.css +1 -0
  31. package/build/client/_app/immutable/assets/Geist-Variable.Bj2R_7yk.woff2 +0 -0
  32. package/build/client/_app/immutable/assets/GeistMono-Variable.Dispecij.woff2 +0 -0
  33. package/build/client/_app/immutable/assets/HelpTip.DF6T9nns.css +1 -0
  34. package/build/client/_app/immutable/assets/InfoBox.CpavOykF.css +1 -0
  35. package/build/client/_app/immutable/assets/KeyCaps.D2t-lY-8.css +1 -0
  36. package/build/client/_app/immutable/assets/LogLine.Bu4feLn5.css +1 -0
  37. package/build/client/_app/immutable/assets/Markdown.DI6AtWAc.css +1 -0
  38. package/build/client/_app/immutable/assets/ModelPicker.DQzj7Nj8.css +1 -0
  39. package/build/client/_app/immutable/assets/OptionButtons.BYiyOXOE.css +1 -0
  40. package/build/client/_app/immutable/assets/PeekPanel.DzMdHoqg.css +1 -0
  41. package/build/client/_app/immutable/assets/ScoutPage.CVIiLy5c.css +1 -0
  42. package/build/client/_app/immutable/assets/SetupSteps.B6pZP1Bk.css +1 -0
  43. package/build/client/_app/immutable/assets/Skeleton.BC-1_U5d.css +1 -0
  44. package/build/client/_app/immutable/assets/SlotsMeter.Dq7GGYlD.css +1 -0
  45. package/build/client/_app/immutable/assets/StartConfirm.DxNN2AOb.css +1 -0
  46. package/build/client/_app/immutable/assets/StatePill.CGWFVUUg.css +1 -0
  47. package/build/client/_app/immutable/assets/Streamed.DpZ6wgO2.css +1 -0
  48. package/build/client/_app/immutable/assets/card-pulls.C5uGMuAh.css +1 -0
  49. package/build/client/_app/immutable/assets/next-step.CKg1w06J.css +1 -0
  50. package/build/client/_app/immutable/chunks/-B5EclhK.js +1 -0
  51. package/build/client/_app/immutable/chunks/-Q3zApAy.js +1 -0
  52. package/build/client/_app/immutable/chunks/6-hwN_Ik.js +3 -0
  53. package/build/client/_app/immutable/chunks/B16UF4PA.js +11 -0
  54. package/build/client/_app/immutable/chunks/B1V3h1VF.js +1 -0
  55. package/build/client/_app/immutable/chunks/B2d2Mkuz.js +68 -0
  56. package/build/client/_app/immutable/chunks/B2yzhiEa.js +1 -0
  57. package/build/client/_app/immutable/chunks/B5zDDQUU.js +2 -0
  58. package/build/client/_app/immutable/chunks/B8DHSiWf.js +1 -0
  59. package/build/client/_app/immutable/chunks/B8z33EzI.js +1 -0
  60. package/build/client/_app/immutable/chunks/BCRkrH6c.js +1 -0
  61. package/build/client/_app/immutable/chunks/BCScjOxu.js +1 -0
  62. package/build/client/_app/immutable/chunks/BMUQtCEC.js +1 -0
  63. package/build/client/_app/immutable/chunks/BNnfkvZM.js +1 -0
  64. package/build/client/_app/immutable/chunks/BelWyZaW.js +1 -0
  65. package/build/client/_app/immutable/chunks/BhZpqODT.js +1 -0
  66. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  67. package/build/client/_app/immutable/chunks/BmafI-Bs.js +1 -0
  68. package/build/client/_app/immutable/chunks/BvRk9kiK.js +0 -0
  69. package/build/client/_app/immutable/chunks/C4i6bdQg.js +1 -0
  70. package/build/client/_app/immutable/chunks/C8u5TyIB.js +1 -0
  71. package/build/client/_app/immutable/chunks/CFs2xhoy.js +1 -0
  72. package/build/client/_app/immutable/chunks/CIm2DioU.js +1 -0
  73. package/build/client/_app/immutable/chunks/CONqGBXC.js +1 -0
  74. package/build/client/_app/immutable/chunks/CSOz40qO.js +1 -0
  75. package/build/client/_app/immutable/chunks/CXxuD1ef.js +3 -0
  76. package/build/client/_app/immutable/chunks/CarrGsZA.js +2 -0
  77. package/build/client/_app/immutable/chunks/CdrmTD44.js +1 -0
  78. package/build/client/_app/immutable/chunks/CfJRH9gh.js +2 -0
  79. package/build/client/_app/immutable/chunks/Ci7C9Cki.js +1 -0
  80. package/build/client/_app/immutable/chunks/CkOTL1vK.js +1 -0
  81. package/build/client/_app/immutable/chunks/CngTtGc_.js +1 -0
  82. package/build/client/_app/immutable/chunks/Cp3A1zR8.js +1 -0
  83. package/build/client/_app/immutable/chunks/CwtMnwNL.js +3 -0
  84. package/build/client/_app/immutable/chunks/Cy7f_oXg.js +1 -0
  85. package/build/client/_app/immutable/chunks/D-wwLm5t.js +1 -0
  86. package/build/client/_app/immutable/chunks/D2imbgaf.js +1 -0
  87. package/build/client/_app/immutable/chunks/D32mip60.js +1 -0
  88. package/build/client/_app/immutable/chunks/D46Vk19W.js +1 -0
  89. package/build/client/_app/immutable/chunks/DCUUgo-6.js +1 -0
  90. package/build/client/_app/immutable/chunks/DFjnjJjy.js +1 -0
  91. package/build/client/_app/immutable/chunks/DHMbSbMg.js +1 -0
  92. package/build/client/_app/immutable/chunks/DJOFx2wx.js +1 -0
  93. package/build/client/_app/immutable/chunks/DV4tvxHp.js +3 -0
  94. package/build/client/_app/immutable/chunks/DXk_5YEw.js +1 -0
  95. package/build/client/_app/immutable/chunks/DjgnRLJt.js +1 -0
  96. package/build/client/_app/immutable/chunks/DlWlQ_vP.js +1 -0
  97. package/build/client/_app/immutable/chunks/DpIAei2y.js +2 -0
  98. package/build/client/_app/immutable/chunks/Dt-HX3Vu.js +1 -0
  99. package/build/client/_app/immutable/chunks/DuSthUWX.js +1 -0
  100. package/build/client/_app/immutable/chunks/Ecfl8TOn.js +2 -0
  101. package/build/client/_app/immutable/chunks/ITHE99Aa.js +1 -0
  102. package/build/client/_app/immutable/chunks/Khdge0KS.js +1 -0
  103. package/build/client/_app/immutable/chunks/LMEKNlm0.js +1 -0
  104. package/build/client/_app/immutable/chunks/OnIeaiuO.js +1 -0
  105. package/build/client/_app/immutable/chunks/VFQLu55q.js +1 -0
  106. package/build/client/_app/immutable/chunks/ZsUxKnQw.js +1 -0
  107. package/build/client/_app/immutable/chunks/aWP8DVhV.js +1 -0
  108. package/build/client/_app/immutable/chunks/bB04Xp1f.js +1 -0
  109. package/build/client/_app/immutable/chunks/eylBqhv8.js +3 -0
  110. package/build/client/_app/immutable/chunks/hx0ssLL_.js +2 -0
  111. package/build/client/_app/immutable/chunks/mumDj17t.js +1 -0
  112. package/build/client/_app/immutable/chunks/pZYp3_TE.js +1 -0
  113. package/build/client/_app/immutable/chunks/tImwjqWn.js +1 -0
  114. package/build/client/_app/immutable/chunks/uBIymjUX.js +1 -0
  115. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  116. package/build/client/_app/immutable/entry/app.DVZ1wE36.js +2 -0
  117. package/build/client/_app/immutable/entry/start.DluCc61B.js +1 -0
  118. package/build/client/_app/immutable/nodes/0.CwNFevXf.js +1 -0
  119. package/build/client/_app/immutable/nodes/1.BR6FYiC-.js +1 -0
  120. package/build/client/_app/immutable/nodes/10.wNwBFtom.js +2 -0
  121. package/build/client/_app/immutable/nodes/11.DpoIbMNF.js +2 -0
  122. package/build/client/_app/immutable/nodes/12.CWdUJ8l3.js +2 -0
  123. package/build/client/_app/immutable/nodes/13.CZ2uTvNS.js +1 -0
  124. package/build/client/_app/immutable/nodes/14.CzgyXuvL.js +1 -0
  125. package/build/client/_app/immutable/nodes/15.CzgyXuvL.js +1 -0
  126. package/build/client/_app/immutable/nodes/16.odL9eB2N.js +1 -0
  127. package/build/client/_app/immutable/nodes/17.B-RnUeVU.js +1 -0
  128. package/build/client/_app/immutable/nodes/18.BLYKxyq2.js +1 -0
  129. package/build/client/_app/immutable/nodes/19.CgyFfPqF.js +3 -0
  130. package/build/client/_app/immutable/nodes/2.CCWT41Qr.js +1 -0
  131. package/build/client/_app/immutable/nodes/20.BBk5-krg.js +1 -0
  132. package/build/client/_app/immutable/nodes/21.CJoU3s1A.js +2 -0
  133. package/build/client/_app/immutable/nodes/22.CoRvPh8m.js +1 -0
  134. package/build/client/_app/immutable/nodes/23.zXO3NjnM.js +3 -0
  135. package/build/client/_app/immutable/nodes/24.CmO27TED.js +1 -0
  136. package/build/client/_app/immutable/nodes/26.TVKNr_xX.js +18 -0
  137. package/build/client/_app/immutable/nodes/27.RojtGU_o.js +1 -0
  138. package/build/client/_app/immutable/nodes/28.CVTdeeSI.js +2 -0
  139. package/build/client/_app/immutable/nodes/3.Cgib7Vi6.js +1 -0
  140. package/build/client/_app/immutable/nodes/4.CnMwOCec.js +1 -0
  141. package/build/client/_app/immutable/nodes/5.-NqYtQj_.js +1 -0
  142. package/build/client/_app/immutable/nodes/6.D5xk-UBM.js +1 -0
  143. package/build/client/_app/immutable/nodes/7.IL4b-DII.js +1 -0
  144. package/build/client/_app/immutable/nodes/8.DJrguHjO.js +11 -0
  145. package/build/client/_app/immutable/nodes/9.DTUSzWiK.js +1 -0
  146. package/build/client/_app/version.json +1 -0
  147. package/build/client/favicon.svg +7 -0
  148. package/build/env.js +70 -0
  149. package/build/handler.js +26 -0
  150. package/build/index.js +149 -0
  151. package/build/server/chunks/chunks/Banner.js-D4mtxUfF.js +17 -0
  152. package/build/server/chunks/chunks/BoardOff.js-Dg5-LoR3.js +1627 -0
  153. package/build/server/chunks/chunks/Button.js-Buh9rnpu.js +43 -0
  154. package/build/server/chunks/chunks/Chip.js-xZ7vFkHx.js +12 -0
  155. package/build/server/chunks/chunks/Dialog.js-CGpwdpM-.js +60 -0
  156. package/build/server/chunks/chunks/FeaturePanels.js-B2sKozgF.js +84 -0
  157. package/build/server/chunks/chunks/FolderBrowser.js-DUHFhDaX.js +28 -0
  158. package/build/server/chunks/chunks/HelpTip.js-CzemvmjC.js +19 -0
  159. package/build/server/chunks/chunks/InfoBox.js-BJiVzZgw.js +10 -0
  160. package/build/server/chunks/chunks/KeyCaps.js-BMI2Hrh2.js +37 -0
  161. package/build/server/chunks/chunks/LogLine.js-2b7uX__H.js +35 -0
  162. package/build/server/chunks/chunks/Markdown.js-Clud88KU.js +4233 -0
  163. package/build/server/chunks/chunks/ModelPicker.js-FuBgyKIA.js +141 -0
  164. package/build/server/chunks/chunks/OptionButtons.js-LQKrAwUX.js +28 -0
  165. package/build/server/chunks/chunks/PeekPanel.js-aZ-r_v3N.js +375 -0
  166. package/build/server/chunks/chunks/ScoutPage.js-2DcNia96.js +733 -0
  167. package/build/server/chunks/chunks/SetupSteps.js-D7TAF7xa.js +66 -0
  168. package/build/server/chunks/chunks/Skeleton.js-diCP2sd5.js +30 -0
  169. package/build/server/chunks/chunks/SlotsMeter.js-BV_sAGf5.js +18 -0
  170. package/build/server/chunks/chunks/StartConfirm.js-CzEdFtbO.js +124 -0
  171. package/build/server/chunks/chunks/StatePill.js-CM7-HXNM.js +27 -0
  172. package/build/server/chunks/chunks/Streamed.js-_NgwNMMs.js +43 -0
  173. package/build/server/chunks/chunks/_page.server.js-BaGoctEY.js +1419 -0
  174. package/build/server/chunks/chunks/activity.js-CSoPUQLq.js +84 -0
  175. package/build/server/chunks/chunks/add-repo.js-DtHEobfm.js +305 -0
  176. package/build/server/chunks/chunks/app-header.js-CCflgeEQ.js +13 -0
  177. package/build/server/chunks/chunks/app.js-CuPn8jtk.js +12 -0
  178. package/build/server/chunks/chunks/bin.js-Cyb2cYLc.js +58 -0
  179. package/build/server/chunks/chunks/board-keys.js-CW3qw-MC.js +32 -0
  180. package/build/server/chunks/chunks/board-page.js-D0tdsE9J.js +860 -0
  181. package/build/server/chunks/chunks/board.js-BxL3CjB1.js +203 -0
  182. package/build/server/chunks/chunks/browser-test.js-DJEpOoVz.js +170 -0
  183. package/build/server/chunks/chunks/card-pulls.js-d_uGmBB3.js +229 -0
  184. package/build/server/chunks/chunks/card-repos.js-QaMCxiyV.js +59 -0
  185. package/build/server/chunks/chunks/chain-store.js-D42m8DUo.js +91 -0
  186. package/build/server/chunks/chunks/chain.js-CJFRywIC.js +52 -0
  187. package/build/server/chunks/chunks/changes.js-D8ITRMgU.js +513 -0
  188. package/build/server/chunks/chunks/checkout.js-Ys5L_gA4.js +319 -0
  189. package/build/server/chunks/chunks/client.js-B7jIMDuS.js +68 -0
  190. package/build/server/chunks/chunks/clipboard.js-qXskOBim.js +12 -0
  191. package/build/server/chunks/chunks/cloud-status.js-hy-9zUVX.js +95 -0
  192. package/build/server/chunks/chunks/coach.js-BhNB14rV.js +296 -0
  193. package/build/server/chunks/chunks/comments.js-1nWJQptB.js +311 -0
  194. package/build/server/chunks/chunks/commit-message.js-CMcNZUZw.js +8 -0
  195. package/build/server/chunks/chunks/create-card.js-DKtprMG6.js +498 -0
  196. package/build/server/chunks/chunks/db.js-pqoVpAzG.js +80 -0
  197. package/build/server/chunks/chunks/diff-comments.js-BSCuay_U.js +95 -0
  198. package/build/server/chunks/chunks/discussion.js-rJ5OMfvX.js +355 -0
  199. package/build/server/chunks/chunks/display.js-Bf-vGQ7Q.js +61 -0
  200. package/build/server/chunks/chunks/elapsed.js-DikkNhaD.js +27 -0
  201. package/build/server/chunks/chunks/engine.js-DS5zUwsE.js +115 -0
  202. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  203. package/build/server/chunks/chunks/estimate.js-BHTYVTaQ.js +2484 -0
  204. package/build/server/chunks/chunks/evidence-timeline.js-Dk0dTZIy.js +253 -0
  205. package/build/server/chunks/chunks/evidence.js-CT3tWdbB.js +257 -0
  206. package/build/server/chunks/chunks/exports.js-Hn-WQRMB.js +150 -0
  207. package/build/server/chunks/chunks/features.svelte.js-DNsFmFZb.js +10 -0
  208. package/build/server/chunks/chunks/files.js-V46lE0-6.js +46 -0
  209. package/build/server/chunks/chunks/filter.js-CsmCtJMd.js +11 -0
  210. package/build/server/chunks/chunks/forms.js-03E8qnFz.js +35 -0
  211. package/build/server/chunks/chunks/gate.js-Cbqo8Yy0.js +82 -0
  212. package/build/server/chunks/chunks/getting-started.js-DKbHofN5.js +55 -0
  213. package/build/server/chunks/chunks/git.js-l43vBHqs.js +16 -0
  214. package/build/server/chunks/chunks/home-path.js-BXgrl3TP.js +11 -0
  215. package/build/server/chunks/chunks/hub-link.js-B5kjLyyd.js +1532 -0
  216. package/build/server/chunks/chunks/internal.js-DaSBO6jY.js +1239 -0
  217. package/build/server/chunks/chunks/internal2.js-D6AKyUgY.js +27 -0
  218. package/build/server/chunks/chunks/knowledge-page.js-D2ALB3v9.js +292 -0
  219. package/build/server/chunks/chunks/knowledge-revert.js-2eyN9Lcb.js +109 -0
  220. package/build/server/chunks/chunks/knowledge.js--eAgdzNx.js +394 -0
  221. package/build/server/chunks/chunks/last-board.js-BemeiK3t.js +23 -0
  222. package/build/server/chunks/chunks/log.js-R2zUph6T.js +228 -0
  223. package/build/server/chunks/chunks/loop.js-D3guWKLp.js +4038 -0
  224. package/build/server/chunks/chunks/loop2.js-B_Qd2m4y.js +67 -0
  225. package/build/server/chunks/chunks/navigation.js-DQJMz-SM.js +2 -0
  226. package/build/server/chunks/chunks/new-project.js-DNcr9JpB.js +305 -0
  227. package/build/server/chunks/chunks/next-step.js-B8Kl0Iv9.js +522 -0
  228. package/build/server/chunks/chunks/node.js-Bz2jT5wt.js +3381 -0
  229. package/build/server/chunks/chunks/now-live.svelte.js-hIaDgjJ3.js +13 -0
  230. package/build/server/chunks/chunks/now-snapshot.js-zGKLIzox.js +207 -0
  231. package/build/server/chunks/chunks/now.js-Dfm-o0Ha.js +765 -0
  232. package/build/server/chunks/chunks/onboard.js-LBqPOxyU.js +1525 -0
  233. package/build/server/chunks/chunks/ordinal.js-Bm_9QEBD.js +12 -0
  234. package/build/server/chunks/chunks/overview.js-C32iHkXD.js +1108 -0
  235. package/build/server/chunks/chunks/page-keys.svelte.js-D8vXA_8Z.js +14 -0
  236. package/build/server/chunks/chunks/patch.js-Bl7vwsUj.js +62 -0
  237. package/build/server/chunks/chunks/paths.js-DVRjNYFW.js +19 -0
  238. package/build/server/chunks/chunks/peek.js-D9sSjT9t.js +95 -0
  239. package/build/server/chunks/chunks/plan.js-DFq5ntMM.js +143 -0
  240. package/build/server/chunks/chunks/project-files-notice.js-CcqcBgUP.js +19 -0
  241. package/build/server/chunks/chunks/project-files.js-DTC4jUxy.js +52 -0
  242. package/build/server/chunks/chunks/project-folder.js-CoKgPiM0.js +22 -0
  243. package/build/server/chunks/chunks/projects.js-bw2V11od.js +989 -0
  244. package/build/server/chunks/chunks/prs.js-CLfImauu.js +118 -0
  245. package/build/server/chunks/chunks/publish.js-D2vWpIJU.js +195 -0
  246. package/build/server/chunks/chunks/pull-list.js-BCIBJdyz.js +691 -0
  247. package/build/server/chunks/chunks/qa-ask.svelte.js-8Hf1JWW2.js +47 -0
  248. package/build/server/chunks/chunks/qa-setup.js-DFOEcNxH.js +1241 -0
  249. package/build/server/chunks/chunks/quiet.js-1GKY40Ay.js +104 -0
  250. package/build/server/chunks/chunks/rail.js-BePBwOqZ.js +135 -0
  251. package/build/server/chunks/chunks/review.js-MPqnq9Gy.js +98 -0
  252. package/build/server/chunks/chunks/routing.js-B8s1QwSP.js +265 -0
  253. package/build/server/chunks/chunks/run-log.js-CnN2jOcg.js +94 -0
  254. package/build/server/chunks/chunks/run.js-COSejjLl.js +34 -0
  255. package/build/server/chunks/chunks/scout-findings.js-CqJti10a.js +940 -0
  256. package/build/server/chunks/chunks/scout.js-Bm7wQLX2.js +62 -0
  257. package/build/server/chunks/chunks/sentinels.js-BXvpnzr3.js +13 -0
  258. package/build/server/chunks/chunks/server.js-BR0D07DR.js +3803 -0
  259. package/build/server/chunks/chunks/settings-sections.js-V70W7BkZ.js +103 -0
  260. package/build/server/chunks/chunks/shared.js-BgfCUZUJ.js +776 -0
  261. package/build/server/chunks/chunks/sign-in.js-O-pBhi19.js +14 -0
  262. package/build/server/chunks/chunks/snapshot.js-BekzL_He.js +38 -0
  263. package/build/server/chunks/chunks/spend.js-BabnR69T.js +63 -0
  264. package/build/server/chunks/chunks/src.js-Cm8RAH_q.js +609 -0
  265. package/build/server/chunks/chunks/src2.js-CV8tsClO.js +1186 -0
  266. package/build/server/chunks/chunks/src3.js-h9tTEbVb.js +11222 -0
  267. package/build/server/chunks/chunks/stack.js-CMWXhMZS.js +13 -0
  268. package/build/server/chunks/chunks/standup.js-D-qBnMx4.js +103 -0
  269. package/build/server/chunks/chunks/state.js-BTDrgu7s.js +71 -0
  270. package/build/server/chunks/chunks/stream.js-D6r6iqjD.js +66 -0
  271. package/build/server/chunks/chunks/terms.js-DPZztSEn.js +88 -0
  272. package/build/server/chunks/chunks/ticket-system.js-Dj9R3XJw.js +147 -0
  273. package/build/server/chunks/chunks/ticket.js-6sj-2ZEM.js +110 -0
  274. package/build/server/chunks/chunks/timesheet.js-DfhIokoE.js +212 -0
  275. package/build/server/chunks/chunks/timesheet2.js-Cu95ddl3.js +84 -0
  276. package/build/server/chunks/chunks/to-workspace.js-DiOJP59J.js +308 -0
  277. package/build/server/chunks/chunks/toast-stack.svelte.js-CXIg3_KT.js +10 -0
  278. package/build/server/chunks/chunks/uneval.js-VnZcgzZr.js +488 -0
  279. package/build/server/chunks/chunks/utils.js-DQTBh7_6.js +1006 -0
  280. package/build/server/chunks/chunks/when-said.js-0F9asAma.js +35 -0
  281. package/build/server/chunks/chunks/workspace.js-BBdJRon9.js +212 -0
  282. package/build/server/chunks/entries/endpoints/api/board/_server.ts.js-BlYC_lpV.js +69 -0
  283. package/build/server/chunks/entries/endpoints/api/board/minimize/_server.ts.js-Wddt9YPR.js +68 -0
  284. package/build/server/chunks/entries/endpoints/api/board/move/_server.ts.js-BwZpCKx0.js +68 -0
  285. package/build/server/chunks/entries/endpoints/api/board/promote/_server.ts.js-Cw6kvkMq.js +68 -0
  286. package/build/server/chunks/entries/endpoints/api/board/pulls/_server.ts.js-DFhpbiMo.js +71 -0
  287. package/build/server/chunks/entries/endpoints/api/board/stop/_server.ts.js-D5eylDMw.js +68 -0
  288. package/build/server/chunks/entries/endpoints/api/card/_key_/answer/_server.ts.js-CG8xh52y.js +68 -0
  289. package/build/server/chunks/entries/endpoints/api/card/_key_/branch/_server.ts.js-a5_P9voA.js +40 -0
  290. package/build/server/chunks/entries/endpoints/api/card/_key_/chain/_server.ts.js-tJvQy6RK.js +70 -0
  291. package/build/server/chunks/entries/endpoints/api/card/_key_/checkouts/_server.ts.js-B2_gx6vF.js +41 -0
  292. package/build/server/chunks/entries/endpoints/api/card/_key_/choice/_server.ts.js-pmAdIQkK.js +34 -0
  293. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_id_/_server.ts.js-C5NxGWw3.js +68 -0
  294. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_server.ts.js-0rw7UNv8.js +64 -0
  295. package/build/server/chunks/entries/endpoints/api/card/_key_/commit/_server.ts.js-_yXWCOlQ.js +68 -0
  296. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-diff/_server.ts.js-CRPV3z-g.js +61 -0
  297. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-message/_server.ts.js-CO9mD3u6.js +82 -0
  298. package/build/server/chunks/entries/endpoints/api/card/_key_/context/_server.ts.js-7kzrigFz.js +42 -0
  299. package/build/server/chunks/entries/endpoints/api/card/_key_/delete/_server.ts.js-DH0nO9wG.js +516 -0
  300. package/build/server/chunks/entries/endpoints/api/card/_key_/file/_server.ts.js-D80SvJDi.js +35 -0
  301. package/build/server/chunks/entries/endpoints/api/card/_key_/files/_...path_/_server.ts.js-GxFjb2H0.js +34 -0
  302. package/build/server/chunks/entries/endpoints/api/card/_key_/fix/_server.ts.js-B-HAB050.js +68 -0
  303. package/build/server/chunks/entries/endpoints/api/card/_key_/knowledge/_server.ts.js-D4fN-j7X.js +81 -0
  304. package/build/server/chunks/entries/endpoints/api/card/_key_/link/_other_/_server.ts.js-C00pQDCu.js +42 -0
  305. package/build/server/chunks/entries/endpoints/api/card/_key_/log/_server.ts.js-BXW_tG-I.js +32 -0
  306. package/build/server/chunks/entries/endpoints/api/card/_key_/log/raw/_server.ts.js-pT8StZGR.js +32 -0
  307. package/build/server/chunks/entries/endpoints/api/card/_key_/message/_server.ts.js-ZMno2Hu6.js +68 -0
  308. package/build/server/chunks/entries/endpoints/api/card/_key_/models/_server.ts.js-DEZVpqO3.js +73 -0
  309. package/build/server/chunks/entries/endpoints/api/card/_key_/patch/_server.ts.js-BxfLi-Zs.js +61 -0
  310. package/build/server/chunks/entries/endpoints/api/card/_key_/peek/_server.ts.js-CsTKWIP_.js +169 -0
  311. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/_server.ts.js-CsOeAXkf.js +53 -0
  312. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/comments/_server.ts.js-DZ2XHOhF.js +71 -0
  313. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discuss/_server.ts.js-CO8eM0e8.js +72 -0
  314. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discussions/_server.ts.js-Lp7l0Yqv.js +71 -0
  315. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix/_server.ts.js-CeIhjpQ4.js +68 -0
  316. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix-all/_server.ts.js-D-DKoCpQ.js +68 -0
  317. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/links/_server.ts.js-B_q3jUP3.js +72 -0
  318. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/qa/_server.ts.js-BulVcJY9.js +68 -0
  319. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/seen/_server.ts.js-Z06A6MS1.js +71 -0
  320. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/triage/_server.ts.js-qADU4URF.js +68 -0
  321. package/build/server/chunks/entries/endpoints/api/card/_key_/pull/_server.ts.js-CHnTH9WK.js +58 -0
  322. package/build/server/chunks/entries/endpoints/api/card/_key_/push/_server.ts.js-BPdPwPo2.js +83 -0
  323. package/build/server/chunks/entries/endpoints/api/card/_key_/repos/_server.ts.js-Bjqa3Uoo.js +73 -0
  324. package/build/server/chunks/entries/endpoints/api/card/_key_/research/_server.ts.js-DzQjoHOZ.js +138 -0
  325. package/build/server/chunks/entries/endpoints/api/card/_key_/retry/_server.ts.js-CAodrXqd.js +68 -0
  326. package/build/server/chunks/entries/endpoints/api/card/_key_/send-back/_server.ts.js-CmJSnvTx.js +68 -0
  327. package/build/server/chunks/entries/endpoints/api/card/_key_/stack/_server.ts.js-DjI8S94J.js +82 -0
  328. package/build/server/chunks/entries/endpoints/api/card/_key_/tasks/_server.ts.js-BzX_nNJk.js +71 -0
  329. package/build/server/chunks/entries/endpoints/api/card/_key_/thread/_server.ts.js-Dn36Guxk.js +33 -0
  330. package/build/server/chunks/entries/endpoints/api/cards/_server.ts.js-DPMOBsvp.js +77 -0
  331. package/build/server/chunks/entries/endpoints/api/cards/context/_server.ts.js-D6y-g2O-.js +52 -0
  332. package/build/server/chunks/entries/endpoints/api/cards/next/_server.ts.js-C2se67rf.js +55 -0
  333. package/build/server/chunks/entries/endpoints/api/chain/_server.ts.js-DKO5Q8GV.js +70 -0
  334. package/build/server/chunks/entries/endpoints/api/clones/_server.ts.js-Bgcc_Beg.js +56 -0
  335. package/build/server/chunks/entries/endpoints/api/current-project/_server.ts.js-DZCtSlXs.js +81 -0
  336. package/build/server/chunks/entries/endpoints/api/evidence/timesheet/_server.ts.js-xJwzSrcl.js +32 -0
  337. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-BdcE7k8S.js +83 -0
  338. package/build/server/chunks/entries/endpoints/api/gh/_server.ts.js-CGvM8fn7.js +66 -0
  339. package/build/server/chunks/entries/endpoints/api/gh/name/_server.ts.js-CHh3tAu7.js +36 -0
  340. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-DLUfrHo6.js +22 -0
  341. package/build/server/chunks/entries/endpoints/api/login-item/_server.ts.js-Cya7S7W6.js +77 -0
  342. package/build/server/chunks/entries/endpoints/api/notes/_server.ts.js-DaUFVqSM.js +26 -0
  343. package/build/server/chunks/entries/endpoints/api/notifications/_server.ts.js-DK6NFnII.js +76 -0
  344. package/build/server/chunks/entries/endpoints/api/now/_server.ts.js-xW0jeJdy.js +83 -0
  345. package/build/server/chunks/entries/endpoints/api/package/entry/_server.ts.js-DQyZanpo.js +35 -0
  346. package/build/server/chunks/entries/endpoints/api/projects/_server.ts.js-CzXJTj_l.js +58 -0
  347. package/build/server/chunks/entries/endpoints/api/qa-setup/_server.ts.js-DujrYbEP.js +76 -0
  348. package/build/server/chunks/entries/endpoints/api/remove-check/_server.ts.js-1KAi9LDi.js +58 -0
  349. package/build/server/chunks/entries/endpoints/api/setup/_server.ts.js-D0MKtjR7.js +69 -0
  350. package/build/server/chunks/entries/endpoints/api/tickets/jira/_server.ts.js-Z2LdOr5l.js +39 -0
  351. package/build/server/chunks/entries/endpoints/api/tickets/read/_server.ts.js-BziHtc8Y.js +68 -0
  352. package/build/server/chunks/entries/endpoints/api/tools/_server.ts.js-oyvq8i1y.js +30 -0
  353. package/build/server/chunks/entries/endpoints/api/workspace/_server.ts.js-CMGBL5cX.js +58 -0
  354. package/build/server/chunks/entries/endpoints/api/workspace/commit/_server.ts.js-BZQQJ1YG.js +66 -0
  355. package/build/server/chunks/entries/endpoints/api/workspace/patch/_server.ts.js-xrjgHECx.js +64 -0
  356. package/build/server/chunks/entries/endpoints/api/workspace/push/_server.ts.js-CTdia7Uz.js +66 -0
  357. package/build/server/chunks/entries/hooks.server.js-B0jE-ELC.js +211 -0
  358. package/build/server/chunks/entries/pages/_error.svelte.js-DPcKI5sX.js +25 -0
  359. package/build/server/chunks/entries/pages/_layout.server.ts.js-Jj3i2Th9.js +134 -0
  360. package/build/server/chunks/entries/pages/_layout.svelte.js-Cu3ghN80.js +1251 -0
  361. package/build/server/chunks/entries/pages/_page.svelte.js-DEYydBCm.js +662 -0
  362. package/build/server/chunks/entries/pages/accept/_page.server.ts.js-BF7MrA5s.js +29 -0
  363. package/build/server/chunks/entries/pages/accept/_page.svelte.js-8yPsedd-.js +54 -0
  364. package/build/server/chunks/entries/pages/b/_board_/_page.svelte.js-S9acLF3f.js +68 -0
  365. package/build/server/chunks/entries/pages/b/_board_/_page.ts.js-BcKdG_Tp.js +21 -0
  366. package/build/server/chunks/entries/pages/b/research/_page.svelte.js-FW6Hw9g5.js +68 -0
  367. package/build/server/chunks/entries/pages/b/research/_page.ts.js-Ds2AjFFK.js +13 -0
  368. package/build/server/chunks/entries/pages/evidence/_page.server.ts.js-uwu2X7bA.js +1382 -0
  369. package/build/server/chunks/entries/pages/evidence/_page.svelte.js-DBCjiT59.js +594 -0
  370. package/build/server/chunks/entries/pages/f/_...path_/_page.svelte.js-DxwJaJzh.js +58 -0
  371. package/build/server/chunks/entries/pages/knowledge/_page.server.ts.js-BAUvFEcM.js +80 -0
  372. package/build/server/chunks/entries/pages/knowledge/_page.svelte.js-D9117gHM.js +732 -0
  373. package/build/server/chunks/entries/pages/new/_page.server.ts.js-BNCQQpyw.js +110 -0
  374. package/build/server/chunks/entries/pages/new/_page.svelte.js-Ben8-N_h.js +503 -0
  375. package/build/server/chunks/entries/pages/new/idea/_page.server.ts.js-jssA29y3.js +46 -0
  376. package/build/server/chunks/entries/pages/new/idea/_page.svelte.js-XoKspqAc.js +210 -0
  377. package/build/server/chunks/entries/pages/new/task/_page.server.ts.js-CmZgfvyt.js +66 -0
  378. package/build/server/chunks/entries/pages/new/task/_page.svelte.js-BKpERKvm.js +169 -0
  379. package/build/server/chunks/entries/pages/onboard/_page.server.ts.js-pmc_pXvs.js +12 -0
  380. package/build/server/chunks/entries/pages/onboard/_page.svelte.js-C7LNK-ba.js +5 -0
  381. package/build/server/chunks/entries/pages/projects/_page.server.ts.js-BEhLRfJ_.js +12 -0
  382. package/build/server/chunks/entries/pages/projects/_page.svelte.js-OraOjsyb.js +5 -0
  383. package/build/server/chunks/entries/pages/scout/_page.server.ts.js-hQYnMHwY.js +10 -0
  384. package/build/server/chunks/entries/pages/scout/_page.svelte.js-7q4d044Z.js +40 -0
  385. package/build/server/chunks/entries/pages/scout/f/_id_/_page.server.ts.js-BN4TnSpB.js +22 -0
  386. package/build/server/chunks/entries/pages/scout/f/_id_/_page.svelte.js-GzpLhARi.js +40 -0
  387. package/build/server/chunks/entries/pages/settings/_layout.server.ts.js-B5LgqMMT.js +12 -0
  388. package/build/server/chunks/entries/pages/settings/_layout.svelte.js-CSCpV6qA.js +81 -0
  389. package/build/server/chunks/entries/pages/settings/_page.svelte.js-DNpsNFo0.js +25 -0
  390. package/build/server/chunks/entries/pages/settings/_section_/_page.server.ts.js-nRDEV3i_.js +348 -0
  391. package/build/server/chunks/entries/pages/settings/_section_/_page.svelte.js-BihUf-nY.js +1052 -0
  392. package/build/server/chunks/entries/pages/settings/integrations/_page.server.ts.js-BTuRpg8m.js +58 -0
  393. package/build/server/chunks/entries/pages/settings/integrations/_page.svelte.js-C8i8ZmZR.js +161 -0
  394. package/build/server/chunks/entries/pages/settings/mcp/_page.server.ts.js-TFISfO1a.js +925 -0
  395. package/build/server/chunks/entries/pages/settings/mcp/_page.svelte.js-D1X0TNOm.js +433 -0
  396. package/build/server/chunks/entries/pages/settings/phases/_page.server.ts.js-CgK7MTZf.js +48 -0
  397. package/build/server/chunks/entries/pages/settings/phases/_page.svelte.js-u-sTQ-ue.js +80 -0
  398. package/build/server/chunks/entries/pages/settings/project/_page.server.ts.js-CCnk9WbO.js +363 -0
  399. package/build/server/chunks/entries/pages/settings/project/_page.svelte.js-MxvNqYlQ.js +1269 -0
  400. package/build/server/chunks/entries/pages/settings/wall/_page.server.ts.js-Bt5siY_N.js +12 -0
  401. package/build/server/chunks/entries/pages/settings/wall/_page.svelte.js-CMR4zSAt.js +43 -0
  402. package/build/server/chunks/entries/pages/t/_key_/_layout.server.ts.js-W6YPvOCA.js +124 -0
  403. package/build/server/chunks/entries/pages/t/_key_/_layout.svelte.js-CK0PiWsz.js +543 -0
  404. package/build/server/chunks/entries/pages/t/_key_/_page.server.ts.js-CdB7v0WX.js +15 -0
  405. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.server.ts.js-Bksaje8R.js +75 -0
  406. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.svelte.js-9OQ2eQxu.js +4607 -0
  407. package/build/server/chunks/entries/pages/team/_page.svelte.js-BdUSXC04.js +18 -0
  408. package/build/server/chunks/entries/pages/team/_page.ts.js-DfhJmoZI.js +20 -0
  409. package/build/server/chunks/entries/pages/workspace/_page.svelte.js-DLaWe23r.js +579 -0
  410. package/build/server/chunks/handler-Dlwmumt5.js +1735 -0
  411. package/build/server/chunks/index.js-BX0fZD5G.js +3701 -0
  412. package/build/server/chunks/manifest.js-B2Of6Dj7.js +761 -0
  413. package/build/server/chunks/nodes/0.js-DSzhdY0D.js +87 -0
  414. package/build/server/chunks/nodes/1.js-j4osL1br.js +9 -0
  415. package/build/server/chunks/nodes/10.js-jkvevEFY.js +75 -0
  416. package/build/server/chunks/nodes/11.js-plyiDP2n.js +72 -0
  417. package/build/server/chunks/nodes/12.js-DwtvDAyM.js +78 -0
  418. package/build/server/chunks/nodes/13.js-BpxwqFh4.js +72 -0
  419. package/build/server/chunks/nodes/14.js-B5iNIKGy.js +15 -0
  420. package/build/server/chunks/nodes/15.js-CXCAqUsG.js +15 -0
  421. package/build/server/chunks/nodes/16.js-oxkLEH0n.js +76 -0
  422. package/build/server/chunks/nodes/17.js-B-ZJEo9K.js +76 -0
  423. package/build/server/chunks/nodes/18.js-C0OUCEux.js +9 -0
  424. package/build/server/chunks/nodes/19.js-M8EAQJdW.js +76 -0
  425. package/build/server/chunks/nodes/2.js-ZedduK-3.js +33 -0
  426. package/build/server/chunks/nodes/20.js-BHvsLNjD.js +72 -0
  427. package/build/server/chunks/nodes/21.js-eOaW4si1.js +76 -0
  428. package/build/server/chunks/nodes/22.js-CbJ6tQSs.js +38 -0
  429. package/build/server/chunks/nodes/23.js-DXk8ejlx.js +81 -0
  430. package/build/server/chunks/nodes/24.js-C4qGJc4X.js +33 -0
  431. package/build/server/chunks/nodes/25.js-Cal8uT5V.js +21 -0
  432. package/build/server/chunks/nodes/26.js-Cp5jBcrN.js +80 -0
  433. package/build/server/chunks/nodes/27.js-Do55o_cb.js +17 -0
  434. package/build/server/chunks/nodes/28.js-SNz3QVix.js +9 -0
  435. package/build/server/chunks/nodes/3.js-DyivQ5dN.js +75 -0
  436. package/build/server/chunks/nodes/4.js-BGgTTQFR.js +9 -0
  437. package/build/server/chunks/nodes/5.js-DQYA2BBI.js +31 -0
  438. package/build/server/chunks/nodes/6.js-BVTi2KFL.js +24 -0
  439. package/build/server/chunks/nodes/7.js-CnprIn3p.js +12 -0
  440. package/build/server/chunks/nodes/8.js-Bdicn369.js +50 -0
  441. package/build/server/chunks/nodes/9.js-DVclPGXf.js +9 -0
  442. package/build/shims.js +33 -0
  443. package/dist/THIRD-PARTY-NOTICES.md +659 -0
  444. package/dist/detect-BmI_gskA.js +585 -0
  445. package/dist/fonts/OFL.txt +92 -0
  446. package/dist/nolzu.js +48 -0
  447. package/dist/package-vezZOzhD.js +181 -0
  448. package/dist/shared/finish.md +110 -0
  449. package/dist/shared/knowledge.md +72 -0
  450. package/dist/shared/verdict.md +42 -0
  451. package/dist/skills/.gitkeep +0 -0
  452. package/dist/skills/nolzu-architecture/SKILL.md +140 -0
  453. package/dist/skills/nolzu-architecture/finish.md +110 -0
  454. package/dist/skills/nolzu-assess/SKILL.md +99 -0
  455. package/dist/skills/nolzu-assess/finish.md +110 -0
  456. package/dist/skills/nolzu-design/SKILL.md +115 -0
  457. package/dist/skills/nolzu-design/finish.md +110 -0
  458. package/dist/skills/nolzu-feedback/SKILL.md +107 -0
  459. package/dist/skills/nolzu-feedback/finish.md +110 -0
  460. package/dist/skills/nolzu-implement/SKILL.md +138 -0
  461. package/dist/skills/nolzu-implement/finish.md +110 -0
  462. package/dist/skills/nolzu-investigate/SKILL.md +139 -0
  463. package/dist/skills/nolzu-investigate/finish.md +110 -0
  464. package/dist/skills/nolzu-learn-repo/SKILL.md +115 -0
  465. package/dist/skills/nolzu-learn-repo/finish.md +110 -0
  466. package/dist/skills/nolzu-learn-repo/knowledge.md +72 -0
  467. package/dist/skills/nolzu-optimize/SKILL.md +82 -0
  468. package/dist/skills/nolzu-optimize/finish.md +110 -0
  469. package/dist/skills/nolzu-optimize/knowledge.md +72 -0
  470. package/dist/skills/nolzu-orient/SKILL.md +115 -0
  471. package/dist/skills/nolzu-orient/finish.md +110 -0
  472. package/dist/skills/nolzu-orient/knowledge.md +72 -0
  473. package/dist/skills/nolzu-plan/SKILL.md +165 -0
  474. package/dist/skills/nolzu-plan/finish.md +110 -0
  475. package/dist/skills/nolzu-pr-review/SKILL.md +150 -0
  476. package/dist/skills/nolzu-pr-review/finish.md +110 -0
  477. package/dist/skills/nolzu-qa/SKILL.md +177 -0
  478. package/dist/skills/nolzu-qa/finish.md +110 -0
  479. package/dist/skills/nolzu-qa/verdict.md +42 -0
  480. package/dist/skills/nolzu-refine/SKILL.md +145 -0
  481. package/dist/skills/nolzu-refine/finish.md +110 -0
  482. package/dist/skills/nolzu-research/SKILL.md +140 -0
  483. package/dist/skills/nolzu-research/finish.md +110 -0
  484. package/dist/skills/nolzu-wrapup/SKILL.md +126 -0
  485. package/dist/skills/nolzu-wrapup/finish.md +110 -0
  486. package/dist/skills/nolzu-wrapup/knowledge.md +72 -0
  487. package/dist/src-BG8LaXLS.js +723 -0
  488. package/dist/src-DPfcvRqs.js +4 -0
  489. package/dist/start-ItZOcBtM.js +362 -0
  490. package/package.json +49 -9
  491. package/bin/nolzu.js +0 -8
@@ -0,0 +1,4233 @@
1
+ import './internal.js-DaSBO6jY.js';
2
+ import { ag as escape_html, as as html$2, P as derived } from './server.js-BR0D07DR.js';
3
+
4
+ //#region ../../packages/ui/src/board/answer.ts
5
+ /**
6
+ * Where a blocked card is answered: the composer on its card page. The card's Answer link and the A
7
+ * key on the board both go here, so a question has one place to be answered. Null on a card that
8
+ * asks nothing.
9
+ */
10
+ function answerHref(card) {
11
+ return card.state === "blocked" && card.question !== null ? `/t/${encodeURIComponent(card.key)}/overview#asks` : null;
12
+ }
13
+ /**
14
+ * The answer after a press on one of the options the agent offered. A field set by script loses its
15
+ * undo history, so a press never drops typed text: the label goes in front of it, in place of the
16
+ * label a press put there before. The card page's composer and Now both answer through this.
17
+ */
18
+ function pickOption(draft, options, label) {
19
+ const text = draft.trim();
20
+ const before = options.find((option) => text === option.label || text.startsWith(`${option.label}\n\n`));
21
+ const typed = (before === void 0 ? text : text.slice(before.label.length)).trim();
22
+ return typed === "" ? label : `${label}\n\n${typed}`;
23
+ }
24
+ /**
25
+ * A question as the card page draws it: the first paragraph at size, the paragraphs under it as the
26
+ * run wrote them, and a chip for each file it named in backticks. A name with no slash is a table or
27
+ * a word, not a file, so it stays in its sentence only.
28
+ */
29
+ function questionParts(question) {
30
+ const [lead = "", ...body] = question.split(/\n\s*\n/).map((part) => part.trim()).filter((part) => part !== "");
31
+ return {
32
+ lead,
33
+ body,
34
+ files: [...new Set([...body.join("\n").matchAll(/`([^`\s]+\/[^`\s]+)`/g)].map((match) => match[1] ?? ""))]
35
+ };
36
+ }
37
+ /**
38
+ * "asked 15:02 · waiting 12m": when the card started to wait, off the Now snapshot, and for how long.
39
+ * Null for a time that is no time.
40
+ */
41
+ function askedLine(since, now, timeZone) {
42
+ const then = new Date(since);
43
+ if (Number.isNaN(then.getTime())) return null;
44
+ const at = new Intl.DateTimeFormat("en-GB", {
45
+ timeZone,
46
+ hour: "2-digit",
47
+ minute: "2-digit",
48
+ hour12: false
49
+ }).format(then);
50
+ const minutes = Math.max(0, Math.floor((now.getTime() - then.getTime()) / 6e4));
51
+ return `asked ${at} · waiting ${minutes < 60 ? `${minutes}m` : `${Math.floor(minutes / 60)}h ${minutes % 60}m`}`;
52
+ }
53
+ function _arrayLikeToArray(r, a) {
54
+ (null == a || a > r.length) && (a = r.length);
55
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
56
+ return n;
57
+ }
58
+ function _arrayWithHoles(r) {
59
+ if (Array.isArray(r)) return r;
60
+ }
61
+ function _iterableToArrayLimit(r, l) {
62
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
63
+ if (null != t) {
64
+ var e, n, i, u, a = [], f = true, o = false;
65
+ try {
66
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
67
+ } catch (r) {
68
+ o = true, n = r;
69
+ } finally {
70
+ try {
71
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
72
+ } finally {
73
+ if (o) throw n;
74
+ }
75
+ }
76
+ return a;
77
+ }
78
+ }
79
+ function _nonIterableRest() {
80
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
81
+ }
82
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
83
+ function _slicedToArray(r, e) {
84
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
85
+ }
86
+ function _unsupportedIterableToArray(r, a) {
87
+ if (r) {
88
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
89
+ var t = {}.toString.call(r).slice(8, -1);
90
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
91
+ }
92
+ }
93
+ var entries = Object.entries;
94
+ var setPrototypeOf = Object.setPrototypeOf;
95
+ var isFrozen = Object.isFrozen;
96
+ var getPrototypeOf = Object.getPrototypeOf;
97
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
98
+ var freeze = Object.freeze;
99
+ var seal = Object.seal;
100
+ var create = Object.create;
101
+ var _ref = typeof Reflect !== "undefined" && Reflect;
102
+ var apply = _ref.apply;
103
+ var construct = _ref.construct;
104
+ if (!freeze) freeze = function freeze(x) {
105
+ return x;
106
+ };
107
+ if (!seal) seal = function seal(x) {
108
+ return x;
109
+ };
110
+ if (!apply) apply = function apply(func, thisArg) {
111
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
112
+ return func.apply(thisArg, args);
113
+ };
114
+ if (!construct) construct = function construct(Func) {
115
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
116
+ return new Func(...args);
117
+ };
118
+ var arrayForEach = unapply(Array.prototype.forEach);
119
+ var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
120
+ var arrayPop = unapply(Array.prototype.pop);
121
+ var arrayPush = unapply(Array.prototype.push);
122
+ var arraySlice = unapply(Array.prototype.slice);
123
+ var arraySplice = unapply(Array.prototype.splice);
124
+ var arrayIsArray = Array.isArray;
125
+ var setCreate = unconstruct(Set);
126
+ var setAdd = unapply(Set.prototype.add);
127
+ var setHas = unapply(Set.prototype.has);
128
+ var stringToLowerCase = unapply(String.prototype.toLowerCase);
129
+ var stringToString = unapply(String.prototype.toString);
130
+ var stringMatch = unapply(String.prototype.match);
131
+ var stringReplace = unapply(String.prototype.replace);
132
+ var stringIndexOf = unapply(String.prototype.indexOf);
133
+ var stringTrim = unapply(String.prototype.trim);
134
+ var numberToString = unapply(Number.prototype.toString);
135
+ var booleanToString = unapply(Boolean.prototype.toString);
136
+ var bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
137
+ var symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
138
+ var objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
139
+ var objectToString = unapply(Object.prototype.toString);
140
+ var regExpTest = unapply(RegExp.prototype.test);
141
+ var typeErrorCreate = unconstruct(TypeError);
142
+ /**
143
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
144
+ *
145
+ * @param func - The function to be wrapped and called.
146
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
147
+ */
148
+ function unapply(func) {
149
+ return function(thisArg) {
150
+ if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
151
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
152
+ return apply(func, thisArg, args);
153
+ };
154
+ }
155
+ /**
156
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
157
+ *
158
+ * @param func - The constructor function to be wrapped and called.
159
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
160
+ */
161
+ function unconstruct(Func) {
162
+ return function() {
163
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
164
+ return construct(Func, args);
165
+ };
166
+ }
167
+ /**
168
+ * Add properties to a lookup table
169
+ *
170
+ * @param set - The set to which elements will be added.
171
+ * @param array - The array containing elements to be added to the set.
172
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
173
+ * @returns The modified set with added elements.
174
+ */
175
+ function addToSet(set, array) {
176
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
177
+ if (setPrototypeOf) setPrototypeOf(set, null);
178
+ if (!arrayIsArray(array)) return set;
179
+ let l = array.length;
180
+ while (l--) {
181
+ let element = array[l];
182
+ if (typeof element === "string") {
183
+ const lcElement = transformCaseFunc(element);
184
+ if (lcElement !== element) {
185
+ if (!isFrozen(array)) array[l] = lcElement;
186
+ element = lcElement;
187
+ }
188
+ }
189
+ set[element] = true;
190
+ }
191
+ return set;
192
+ }
193
+ /**
194
+ * Clean up an array to harden against CSPP
195
+ *
196
+ * @param array - The array to be cleaned.
197
+ * @returns The cleaned version of the array
198
+ */
199
+ function cleanArray(array) {
200
+ for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
201
+ return array;
202
+ }
203
+ /**
204
+ * Shallow clone an object
205
+ *
206
+ * @param object - The object to be cloned.
207
+ * @returns A new object that copies the original.
208
+ */
209
+ function clone(object) {
210
+ const newObject = create(null);
211
+ for (const _ref2 of entries(object)) {
212
+ var _ref3 = _slicedToArray(_ref2, 2);
213
+ const property = _ref3[0];
214
+ const value = _ref3[1];
215
+ if (objectHasOwnProperty(object, property)) {
216
+ if (arrayIsArray(value)) newObject[property] = cleanArray(value);
217
+ else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
218
+ else newObject[property] = value;
219
+ }
220
+ }
221
+ return newObject;
222
+ }
223
+ /**
224
+ * Convert non-node values into strings without depending on direct property access.
225
+ *
226
+ * @param value - The value to stringify.
227
+ * @returns A string representation of the provided value.
228
+ */
229
+ function stringifyValue(value) {
230
+ switch (typeof value) {
231
+ case "string": return value;
232
+ case "number": return numberToString(value);
233
+ case "boolean": return booleanToString(value);
234
+ case "bigint": return bigintToString ? bigintToString(value) : "0";
235
+ case "symbol": return symbolToString ? symbolToString(value) : "Symbol()";
236
+ case "undefined": return objectToString(value);
237
+ case "function":
238
+ case "object": {
239
+ if (value === null) return objectToString(value);
240
+ const valueAsRecord = value;
241
+ const valueToString = lookupGetter(valueAsRecord, "toString");
242
+ if (typeof valueToString === "function") {
243
+ const stringified = valueToString(valueAsRecord);
244
+ return typeof stringified === "string" ? stringified : objectToString(stringified);
245
+ }
246
+ return objectToString(value);
247
+ }
248
+ default: return objectToString(value);
249
+ }
250
+ }
251
+ /**
252
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
253
+ *
254
+ * @param object - The object to look up the getter function in its prototype chain.
255
+ * @param prop - The property name for which to find the getter function.
256
+ * @returns The getter function found in the prototype chain or a fallback function.
257
+ */
258
+ function lookupGetter(object, prop) {
259
+ while (object !== null) {
260
+ const desc = getOwnPropertyDescriptor(object, prop);
261
+ if (desc) {
262
+ if (desc.get) return unapply(desc.get);
263
+ if (typeof desc.value === "function") return unapply(desc.value);
264
+ }
265
+ object = getPrototypeOf(object);
266
+ }
267
+ function fallbackValue() {
268
+ return null;
269
+ }
270
+ return fallbackValue;
271
+ }
272
+ /**
273
+ * Like lookupGetter, but for accessor properties only, and returns null
274
+ * instead of a null-returning fallback when no getter exists on the chain.
275
+ * Lets a caller fall back to a direct property read in environments that
276
+ * lack the getter, where a fallback returning null would be indistinguishable
277
+ * from a legitimate null value (e.g. namespaceURI of a no-namespace element).
278
+ *
279
+ * @param object - The object (usually a prototype) to start the lookup at.
280
+ * @param prop - The accessor property name.
281
+ * @returns The unapplied getter, or null if none was found.
282
+ */
283
+ function lookupAccessor(object, prop) {
284
+ while (object !== null) {
285
+ const desc = getOwnPropertyDescriptor(object, prop);
286
+ if (desc) return desc.get ? unapply(desc.get) : null;
287
+ object = getPrototypeOf(object);
288
+ }
289
+ return null;
290
+ }
291
+ function isRegex(value) {
292
+ try {
293
+ regExpTest(value, "");
294
+ return true;
295
+ } catch (_unused) {
296
+ return false;
297
+ }
298
+ }
299
+ var html$1 = freeze([
300
+ "a",
301
+ "abbr",
302
+ "acronym",
303
+ "address",
304
+ "area",
305
+ "article",
306
+ "aside",
307
+ "audio",
308
+ "b",
309
+ "bdi",
310
+ "bdo",
311
+ "big",
312
+ "blink",
313
+ "blockquote",
314
+ "body",
315
+ "br",
316
+ "button",
317
+ "canvas",
318
+ "caption",
319
+ "center",
320
+ "cite",
321
+ "code",
322
+ "col",
323
+ "colgroup",
324
+ "content",
325
+ "data",
326
+ "datalist",
327
+ "dd",
328
+ "decorator",
329
+ "del",
330
+ "details",
331
+ "dfn",
332
+ "dialog",
333
+ "dir",
334
+ "div",
335
+ "dl",
336
+ "dt",
337
+ "element",
338
+ "em",
339
+ "fieldset",
340
+ "figcaption",
341
+ "figure",
342
+ "font",
343
+ "footer",
344
+ "form",
345
+ "h1",
346
+ "h2",
347
+ "h3",
348
+ "h4",
349
+ "h5",
350
+ "h6",
351
+ "head",
352
+ "header",
353
+ "hgroup",
354
+ "hr",
355
+ "html",
356
+ "i",
357
+ "img",
358
+ "input",
359
+ "ins",
360
+ "kbd",
361
+ "label",
362
+ "legend",
363
+ "li",
364
+ "main",
365
+ "map",
366
+ "mark",
367
+ "marquee",
368
+ "menu",
369
+ "menuitem",
370
+ "meter",
371
+ "nav",
372
+ "nobr",
373
+ "ol",
374
+ "optgroup",
375
+ "option",
376
+ "output",
377
+ "p",
378
+ "picture",
379
+ "pre",
380
+ "progress",
381
+ "q",
382
+ "rp",
383
+ "rt",
384
+ "ruby",
385
+ "s",
386
+ "samp",
387
+ "search",
388
+ "section",
389
+ "select",
390
+ "shadow",
391
+ "slot",
392
+ "small",
393
+ "source",
394
+ "spacer",
395
+ "span",
396
+ "strike",
397
+ "strong",
398
+ "style",
399
+ "sub",
400
+ "summary",
401
+ "sup",
402
+ "table",
403
+ "tbody",
404
+ "td",
405
+ "template",
406
+ "textarea",
407
+ "tfoot",
408
+ "th",
409
+ "thead",
410
+ "time",
411
+ "tr",
412
+ "track",
413
+ "tt",
414
+ "u",
415
+ "ul",
416
+ "var",
417
+ "video",
418
+ "wbr"
419
+ ]);
420
+ var svg$1 = freeze([
421
+ "svg",
422
+ "a",
423
+ "altglyph",
424
+ "altglyphdef",
425
+ "altglyphitem",
426
+ "animatecolor",
427
+ "animatemotion",
428
+ "animatetransform",
429
+ "circle",
430
+ "clippath",
431
+ "defs",
432
+ "desc",
433
+ "ellipse",
434
+ "enterkeyhint",
435
+ "exportparts",
436
+ "filter",
437
+ "font",
438
+ "g",
439
+ "glyph",
440
+ "glyphref",
441
+ "hkern",
442
+ "image",
443
+ "inputmode",
444
+ "line",
445
+ "lineargradient",
446
+ "marker",
447
+ "mask",
448
+ "metadata",
449
+ "mpath",
450
+ "part",
451
+ "path",
452
+ "pattern",
453
+ "polygon",
454
+ "polyline",
455
+ "radialgradient",
456
+ "rect",
457
+ "stop",
458
+ "style",
459
+ "switch",
460
+ "symbol",
461
+ "text",
462
+ "textpath",
463
+ "title",
464
+ "tref",
465
+ "tspan",
466
+ "view",
467
+ "vkern"
468
+ ]);
469
+ var svgFilters = freeze([
470
+ "feBlend",
471
+ "feColorMatrix",
472
+ "feComponentTransfer",
473
+ "feComposite",
474
+ "feConvolveMatrix",
475
+ "feDiffuseLighting",
476
+ "feDisplacementMap",
477
+ "feDistantLight",
478
+ "feDropShadow",
479
+ "feFlood",
480
+ "feFuncA",
481
+ "feFuncB",
482
+ "feFuncG",
483
+ "feFuncR",
484
+ "feGaussianBlur",
485
+ "feImage",
486
+ "feMerge",
487
+ "feMergeNode",
488
+ "feMorphology",
489
+ "feOffset",
490
+ "fePointLight",
491
+ "feSpecularLighting",
492
+ "feSpotLight",
493
+ "feTile",
494
+ "feTurbulence"
495
+ ]);
496
+ var svgDisallowed = freeze([
497
+ "animate",
498
+ "color-profile",
499
+ "cursor",
500
+ "discard",
501
+ "font-face",
502
+ "font-face-format",
503
+ "font-face-name",
504
+ "font-face-src",
505
+ "font-face-uri",
506
+ "foreignobject",
507
+ "hatch",
508
+ "hatchpath",
509
+ "mesh",
510
+ "meshgradient",
511
+ "meshpatch",
512
+ "meshrow",
513
+ "missing-glyph",
514
+ "script",
515
+ "set",
516
+ "solidcolor",
517
+ "unknown",
518
+ "use"
519
+ ]);
520
+ var mathMl$1 = freeze([
521
+ "math",
522
+ "menclose",
523
+ "merror",
524
+ "mfenced",
525
+ "mfrac",
526
+ "mglyph",
527
+ "mi",
528
+ "mlabeledtr",
529
+ "mmultiscripts",
530
+ "mn",
531
+ "mo",
532
+ "mover",
533
+ "mpadded",
534
+ "mphantom",
535
+ "mroot",
536
+ "mrow",
537
+ "ms",
538
+ "mspace",
539
+ "msqrt",
540
+ "mstyle",
541
+ "msub",
542
+ "msup",
543
+ "msubsup",
544
+ "mtable",
545
+ "mtd",
546
+ "mtext",
547
+ "mtr",
548
+ "munder",
549
+ "munderover",
550
+ "mprescripts"
551
+ ]);
552
+ var mathMlDisallowed = freeze([
553
+ "maction",
554
+ "maligngroup",
555
+ "malignmark",
556
+ "mlongdiv",
557
+ "mscarries",
558
+ "mscarry",
559
+ "msgroup",
560
+ "mstack",
561
+ "msline",
562
+ "msrow",
563
+ "semantics",
564
+ "annotation",
565
+ "annotation-xml",
566
+ "mprescripts",
567
+ "none"
568
+ ]);
569
+ var text = freeze(["#text"]);
570
+ var html = freeze([
571
+ "accept",
572
+ "action",
573
+ "align",
574
+ "alt",
575
+ "autocapitalize",
576
+ "autocomplete",
577
+ "autopictureinpicture",
578
+ "autoplay",
579
+ "background",
580
+ "bgcolor",
581
+ "border",
582
+ "capture",
583
+ "cellpadding",
584
+ "cellspacing",
585
+ "checked",
586
+ "cite",
587
+ "class",
588
+ "clear",
589
+ "color",
590
+ "cols",
591
+ "colspan",
592
+ "command",
593
+ "commandfor",
594
+ "controls",
595
+ "controlslist",
596
+ "coords",
597
+ "crossorigin",
598
+ "datetime",
599
+ "decoding",
600
+ "default",
601
+ "dir",
602
+ "disabled",
603
+ "disablepictureinpicture",
604
+ "disableremoteplayback",
605
+ "download",
606
+ "draggable",
607
+ "enctype",
608
+ "enterkeyhint",
609
+ "exportparts",
610
+ "face",
611
+ "for",
612
+ "headers",
613
+ "height",
614
+ "hidden",
615
+ "high",
616
+ "href",
617
+ "hreflang",
618
+ "id",
619
+ "inert",
620
+ "inputmode",
621
+ "integrity",
622
+ "ismap",
623
+ "kind",
624
+ "label",
625
+ "lang",
626
+ "list",
627
+ "loading",
628
+ "loop",
629
+ "low",
630
+ "max",
631
+ "maxlength",
632
+ "media",
633
+ "method",
634
+ "min",
635
+ "minlength",
636
+ "multiple",
637
+ "muted",
638
+ "name",
639
+ "nonce",
640
+ "noshade",
641
+ "novalidate",
642
+ "nowrap",
643
+ "open",
644
+ "optimum",
645
+ "part",
646
+ "pattern",
647
+ "placeholder",
648
+ "playsinline",
649
+ "popover",
650
+ "popovertarget",
651
+ "popovertargetaction",
652
+ "poster",
653
+ "preload",
654
+ "pubdate",
655
+ "radiogroup",
656
+ "readonly",
657
+ "rel",
658
+ "required",
659
+ "rev",
660
+ "reversed",
661
+ "role",
662
+ "rows",
663
+ "rowspan",
664
+ "spellcheck",
665
+ "scope",
666
+ "selected",
667
+ "shape",
668
+ "size",
669
+ "sizes",
670
+ "slot",
671
+ "span",
672
+ "srclang",
673
+ "start",
674
+ "src",
675
+ "srcset",
676
+ "step",
677
+ "style",
678
+ "summary",
679
+ "tabindex",
680
+ "title",
681
+ "translate",
682
+ "type",
683
+ "usemap",
684
+ "valign",
685
+ "value",
686
+ "width",
687
+ "wrap",
688
+ "xmlns"
689
+ ]);
690
+ var svg = freeze([
691
+ "accent-height",
692
+ "accumulate",
693
+ "additive",
694
+ "alignment-baseline",
695
+ "amplitude",
696
+ "ascent",
697
+ "attributename",
698
+ "attributetype",
699
+ "azimuth",
700
+ "basefrequency",
701
+ "baseline-shift",
702
+ "begin",
703
+ "bias",
704
+ "by",
705
+ "class",
706
+ "clip",
707
+ "clippathunits",
708
+ "clip-path",
709
+ "clip-rule",
710
+ "color",
711
+ "color-interpolation",
712
+ "color-interpolation-filters",
713
+ "color-profile",
714
+ "color-rendering",
715
+ "cx",
716
+ "cy",
717
+ "d",
718
+ "dx",
719
+ "dy",
720
+ "diffuseconstant",
721
+ "direction",
722
+ "display",
723
+ "divisor",
724
+ "dominant-baseline",
725
+ "dur",
726
+ "edgemode",
727
+ "elevation",
728
+ "end",
729
+ "exponent",
730
+ "fill",
731
+ "fill-opacity",
732
+ "fill-rule",
733
+ "filter",
734
+ "filterunits",
735
+ "flood-color",
736
+ "flood-opacity",
737
+ "font-family",
738
+ "font-size",
739
+ "font-size-adjust",
740
+ "font-stretch",
741
+ "font-style",
742
+ "font-variant",
743
+ "font-weight",
744
+ "fx",
745
+ "fy",
746
+ "g1",
747
+ "g2",
748
+ "glyph-name",
749
+ "glyphref",
750
+ "gradientunits",
751
+ "gradienttransform",
752
+ "height",
753
+ "href",
754
+ "id",
755
+ "image-rendering",
756
+ "in",
757
+ "in2",
758
+ "intercept",
759
+ "k",
760
+ "k1",
761
+ "k2",
762
+ "k3",
763
+ "k4",
764
+ "kerning",
765
+ "keypoints",
766
+ "keysplines",
767
+ "keytimes",
768
+ "lang",
769
+ "lengthadjust",
770
+ "letter-spacing",
771
+ "kernelmatrix",
772
+ "kernelunitlength",
773
+ "lighting-color",
774
+ "local",
775
+ "marker-end",
776
+ "marker-mid",
777
+ "marker-start",
778
+ "markerheight",
779
+ "markerunits",
780
+ "markerwidth",
781
+ "maskcontentunits",
782
+ "maskunits",
783
+ "max",
784
+ "mask",
785
+ "mask-type",
786
+ "media",
787
+ "method",
788
+ "mode",
789
+ "min",
790
+ "name",
791
+ "numoctaves",
792
+ "offset",
793
+ "operator",
794
+ "opacity",
795
+ "order",
796
+ "orient",
797
+ "orientation",
798
+ "origin",
799
+ "overflow",
800
+ "paint-order",
801
+ "path",
802
+ "pathlength",
803
+ "patterncontentunits",
804
+ "patterntransform",
805
+ "patternunits",
806
+ "pointer-events",
807
+ "points",
808
+ "preservealpha",
809
+ "preserveaspectratio",
810
+ "primitiveunits",
811
+ "r",
812
+ "rx",
813
+ "ry",
814
+ "radius",
815
+ "refx",
816
+ "refy",
817
+ "repeatcount",
818
+ "repeatdur",
819
+ "restart",
820
+ "result",
821
+ "rotate",
822
+ "scale",
823
+ "seed",
824
+ "shape-rendering",
825
+ "slope",
826
+ "specularconstant",
827
+ "specularexponent",
828
+ "spreadmethod",
829
+ "startoffset",
830
+ "stddeviation",
831
+ "stitchtiles",
832
+ "stop-color",
833
+ "stop-opacity",
834
+ "stroke-dasharray",
835
+ "stroke-dashoffset",
836
+ "stroke-linecap",
837
+ "stroke-linejoin",
838
+ "stroke-miterlimit",
839
+ "stroke-opacity",
840
+ "stroke",
841
+ "stroke-width",
842
+ "style",
843
+ "surfacescale",
844
+ "systemlanguage",
845
+ "tabindex",
846
+ "tablevalues",
847
+ "targetx",
848
+ "targety",
849
+ "transform",
850
+ "transform-origin",
851
+ "text-anchor",
852
+ "text-decoration",
853
+ "text-orientation",
854
+ "text-rendering",
855
+ "textlength",
856
+ "type",
857
+ "u1",
858
+ "u2",
859
+ "unicode",
860
+ "values",
861
+ "vector-effect",
862
+ "viewbox",
863
+ "visibility",
864
+ "version",
865
+ "vert-adv-y",
866
+ "vert-origin-x",
867
+ "vert-origin-y",
868
+ "width",
869
+ "word-spacing",
870
+ "wrap",
871
+ "writing-mode",
872
+ "xchannelselector",
873
+ "ychannelselector",
874
+ "x",
875
+ "x1",
876
+ "x2",
877
+ "xmlns",
878
+ "y",
879
+ "y1",
880
+ "y2",
881
+ "z",
882
+ "zoomandpan"
883
+ ]);
884
+ var mathMl = freeze([
885
+ "accent",
886
+ "accentunder",
887
+ "align",
888
+ "bevelled",
889
+ "close",
890
+ "columnalign",
891
+ "columnlines",
892
+ "columnspacing",
893
+ "columnspan",
894
+ "denomalign",
895
+ "depth",
896
+ "dir",
897
+ "display",
898
+ "displaystyle",
899
+ "encoding",
900
+ "fence",
901
+ "frame",
902
+ "height",
903
+ "href",
904
+ "id",
905
+ "largeop",
906
+ "length",
907
+ "linethickness",
908
+ "lquote",
909
+ "lspace",
910
+ "mathbackground",
911
+ "mathcolor",
912
+ "mathsize",
913
+ "mathvariant",
914
+ "maxsize",
915
+ "minsize",
916
+ "movablelimits",
917
+ "notation",
918
+ "numalign",
919
+ "open",
920
+ "rowalign",
921
+ "rowlines",
922
+ "rowspacing",
923
+ "rowspan",
924
+ "rspace",
925
+ "rquote",
926
+ "scriptlevel",
927
+ "scriptminsize",
928
+ "scriptsizemultiplier",
929
+ "selection",
930
+ "separator",
931
+ "separators",
932
+ "stretchy",
933
+ "subscriptshift",
934
+ "supscriptshift",
935
+ "symmetric",
936
+ "voffset",
937
+ "width",
938
+ "xmlns"
939
+ ]);
940
+ var xml = freeze([
941
+ "xlink:href",
942
+ "xml:id",
943
+ "xlink:title",
944
+ "xml:space",
945
+ "xmlns:xlink"
946
+ ]);
947
+ var MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
948
+ var ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
949
+ var TMPLIT_EXPR = seal(/\${[\w\W]*/g);
950
+ var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
951
+ var ARIA_ATTR = seal(/^aria-[\-\w]+$/);
952
+ var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
953
+ var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
954
+ var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
955
+ var DOCTYPE_NAME = seal(/^html$/i);
956
+ var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
957
+ var ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
958
+ var COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
959
+ var FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
960
+ var SELF_CLOSING_TAG = seal(/\/>/i);
961
+ var NODE_TYPE = {
962
+ element: 1,
963
+ attribute: 2,
964
+ text: 3,
965
+ cdataSection: 4,
966
+ entityReference: 5,
967
+ entityNode: 6,
968
+ processingInstruction: 7,
969
+ comment: 8,
970
+ document: 9,
971
+ documentType: 10,
972
+ documentFragment: 11,
973
+ notation: 12
974
+ };
975
+ var LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, [
976
+ "style",
977
+ "script",
978
+ "xmp",
979
+ "iframe",
980
+ "noembed",
981
+ "noframes",
982
+ "plaintext",
983
+ "noscript"
984
+ ]));
985
+ var getGlobal = function getGlobal() {
986
+ return typeof window === "undefined" ? null : window;
987
+ };
988
+ /**
989
+ * Creates a no-op policy for internal use only.
990
+ * Don't export this function outside this module!
991
+ * @param trustedTypes The policy factory.
992
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
993
+ * @return The policy created (or null, if Trusted Types
994
+ * are not supported or creating the policy failed).
995
+ */
996
+ var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
997
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
998
+ let suffix = null;
999
+ const ATTR_NAME = "data-tt-policy-suffix";
1000
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
1001
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
1002
+ try {
1003
+ return trustedTypes.createPolicy(policyName, {
1004
+ createHTML(html) {
1005
+ return html;
1006
+ },
1007
+ createScriptURL(scriptUrl) {
1008
+ return scriptUrl;
1009
+ }
1010
+ });
1011
+ } catch (_) {
1012
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
1013
+ return null;
1014
+ }
1015
+ };
1016
+ var _createHooksMap = function _createHooksMap() {
1017
+ return {
1018
+ afterSanitizeAttributes: [],
1019
+ afterSanitizeElements: [],
1020
+ afterSanitizeShadowDOM: [],
1021
+ beforeSanitizeAttributes: [],
1022
+ beforeSanitizeElements: [],
1023
+ beforeSanitizeShadowDOM: [],
1024
+ uponSanitizeAttribute: [],
1025
+ uponSanitizeElement: [],
1026
+ uponSanitizeShadowNode: []
1027
+ };
1028
+ };
1029
+ /**
1030
+ * Resolve a set-valued configuration option: a fresh set built from
1031
+ * cfg[key] when it is an own array property (seeded with a clone of
1032
+ * options.base when given, case-normalized via options.transform),
1033
+ * the fallback set otherwise.
1034
+ *
1035
+ * @param cfg the cloned, prototype-free configuration object
1036
+ * @param key the configuration property to read
1037
+ * @param fallback the set to use when the option is absent or not an array
1038
+ * @param options transform and optional base set to merge into
1039
+ * @returns the resolved set
1040
+ */
1041
+ var _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
1042
+ return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
1043
+ };
1044
+ /**
1045
+ * Resolve an object-valued configuration option: a prototype-free clone
1046
+ * of cfg[key] when it is an own, truthy object property, else a fresh
1047
+ * fallback built by makeFallback (fresh on every parse, so a previous
1048
+ * parse can never leak state into the next one).
1049
+ *
1050
+ * @param cfg the cloned, prototype-free configuration object
1051
+ * @param key the configuration property to read
1052
+ * @param makeFallback builds the fallback value when the option is absent
1053
+ * @returns the resolved object
1054
+ */
1055
+ var _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {
1056
+ const value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;
1057
+ return value && typeof value === "object" ? clone(value) : makeFallback();
1058
+ };
1059
+ function createDOMPurify() {
1060
+ let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
1061
+ const DOMPurify = (root) => createDOMPurify(root);
1062
+ DOMPurify.version = "3.4.17";
1063
+ DOMPurify.removed = [];
1064
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
1065
+ DOMPurify.isSupported = false;
1066
+ return DOMPurify;
1067
+ }
1068
+ let document = window.document;
1069
+ const originalDocument = document;
1070
+ const currentScript = originalDocument.currentScript;
1071
+ window.DocumentFragment;
1072
+ const HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;
1073
+ window.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);
1074
+ window.HTMLFormElement;
1075
+ const DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;
1076
+ const ElementPrototype = Element.prototype;
1077
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
1078
+ const remove = lookupGetter(ElementPrototype, "remove");
1079
+ const removeAttributeNode = lookupGetter(ElementPrototype, "removeAttributeNode");
1080
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
1081
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
1082
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
1083
+ const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot");
1084
+ const getAttributes = lookupGetter(ElementPrototype, "attributes");
1085
+ const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeType") : null;
1086
+ const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeName") : null;
1087
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, "ownerDocument") : null;
1088
+ const _readNodeType = function _readNodeType(node) {
1089
+ return getNodeType ? getNodeType(node) : node.nodeType;
1090
+ };
1091
+ const _readNodeName = function _readNodeName(node) {
1092
+ return getNodeName ? getNodeName(node) : node.nodeName;
1093
+ };
1094
+ const getNamespaceURI = lookupAccessor(ElementPrototype, "namespaceURI");
1095
+ const _readNamespaceURI = function _readNamespaceURI(element) {
1096
+ return getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;
1097
+ };
1098
+ if (typeof HTMLTemplateElement === "function") {
1099
+ const template = document.createElement("template");
1100
+ if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
1101
+ }
1102
+ let trustedTypesPolicy;
1103
+ let emptyHTML = "";
1104
+ let defaultTrustedTypesPolicy;
1105
+ let defaultTrustedTypesPolicyResolved = false;
1106
+ let IN_TRUSTED_TYPES_POLICY = 0;
1107
+ const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
1108
+ if (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1109
+ };
1110
+ const _createTrustedHTML = function _createTrustedHTML(html) {
1111
+ _assertNotInTrustedTypesPolicy();
1112
+ IN_TRUSTED_TYPES_POLICY++;
1113
+ try {
1114
+ return trustedTypesPolicy.createHTML(html);
1115
+ } finally {
1116
+ IN_TRUSTED_TYPES_POLICY--;
1117
+ }
1118
+ };
1119
+ const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
1120
+ _assertNotInTrustedTypesPolicy();
1121
+ IN_TRUSTED_TYPES_POLICY++;
1122
+ try {
1123
+ return trustedTypesPolicy.createScriptURL(scriptUrl);
1124
+ } finally {
1125
+ IN_TRUSTED_TYPES_POLICY--;
1126
+ }
1127
+ };
1128
+ const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
1129
+ if (!defaultTrustedTypesPolicyResolved) {
1130
+ defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
1131
+ defaultTrustedTypesPolicyResolved = true;
1132
+ }
1133
+ return defaultTrustedTypesPolicy;
1134
+ };
1135
+ const _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
1136
+ const importNode = originalDocument.importNode;
1137
+ let hooks = _createHooksMap();
1138
+ /**
1139
+ * Expose whether this browser supports running the full DOMPurify.
1140
+ */
1141
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
1142
+ const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
1143
+ let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
1144
+ /**
1145
+ * We consider the elements and attributes below to be safe. Ideally
1146
+ * don't add any new ones but feel free to remove unwanted ones.
1147
+ */
1148
+ let ALLOWED_TAGS = null;
1149
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [
1150
+ ...html$1,
1151
+ ...svg$1,
1152
+ ...svgFilters,
1153
+ ...mathMl$1,
1154
+ ...text
1155
+ ]);
1156
+ let ALLOWED_ATTR = null;
1157
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [
1158
+ ...html,
1159
+ ...svg,
1160
+ ...mathMl,
1161
+ ...xml
1162
+ ]);
1163
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
1164
+ tagNameCheck: {
1165
+ writable: true,
1166
+ configurable: false,
1167
+ enumerable: true,
1168
+ value: null
1169
+ },
1170
+ attributeNameCheck: {
1171
+ writable: true,
1172
+ configurable: false,
1173
+ enumerable: true,
1174
+ value: null
1175
+ },
1176
+ allowCustomizedBuiltInElements: {
1177
+ writable: true,
1178
+ configurable: false,
1179
+ enumerable: true,
1180
+ value: false
1181
+ }
1182
+ }));
1183
+ let FORBID_TAGS = null;
1184
+ let FORBID_ATTR = null;
1185
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
1186
+ tagCheck: {
1187
+ writable: true,
1188
+ configurable: false,
1189
+ enumerable: true,
1190
+ value: null
1191
+ },
1192
+ attributeCheck: {
1193
+ writable: true,
1194
+ configurable: false,
1195
+ enumerable: true,
1196
+ value: null
1197
+ }
1198
+ }));
1199
+ let ALLOW_ARIA_ATTR = true;
1200
+ let ALLOW_DATA_ATTR = true;
1201
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
1202
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
1203
+ let SAFE_FOR_TEMPLATES = false;
1204
+ let SAFE_FOR_XML = true;
1205
+ let WHOLE_DOCUMENT = false;
1206
+ let SET_CONFIG = false;
1207
+ let SET_CONFIG_ALLOWED_TAGS = null;
1208
+ let SET_CONFIG_ALLOWED_ATTR = null;
1209
+ let FORCE_BODY = false;
1210
+ let RETURN_DOM = false;
1211
+ let RETURN_DOM_FRAGMENT = false;
1212
+ let RETURN_TRUSTED_TYPE = false;
1213
+ let SANITIZE_DOM = true;
1214
+ let SANITIZE_NAMED_PROPS = false;
1215
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
1216
+ let KEEP_CONTENT = true;
1217
+ let IN_PLACE = false;
1218
+ let IN_PLACE_VISITED = null;
1219
+ let USE_PROFILES = {};
1220
+ let FORBID_CONTENTS = null;
1221
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
1222
+ "annotation-xml",
1223
+ "audio",
1224
+ "colgroup",
1225
+ "desc",
1226
+ "foreignobject",
1227
+ "head",
1228
+ "iframe",
1229
+ "math",
1230
+ "mi",
1231
+ "mn",
1232
+ "mo",
1233
+ "ms",
1234
+ "mtext",
1235
+ "noembed",
1236
+ "noframes",
1237
+ "noscript",
1238
+ "plaintext",
1239
+ "script",
1240
+ "selectedcontent",
1241
+ "style",
1242
+ "svg",
1243
+ "template",
1244
+ "thead",
1245
+ "title",
1246
+ "video",
1247
+ "xmp"
1248
+ ]);
1249
+ let DATA_URI_TAGS = null;
1250
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, [
1251
+ "audio",
1252
+ "video",
1253
+ "img",
1254
+ "source",
1255
+ "image",
1256
+ "track"
1257
+ ]);
1258
+ let URI_SAFE_ATTRIBUTES = null;
1259
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
1260
+ "alt",
1261
+ "class",
1262
+ "for",
1263
+ "id",
1264
+ "label",
1265
+ "name",
1266
+ "pattern",
1267
+ "placeholder",
1268
+ "role",
1269
+ "summary",
1270
+ "title",
1271
+ "value",
1272
+ "style",
1273
+ "xmlns"
1274
+ ]);
1275
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
1276
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1277
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
1278
+ let NAMESPACE = HTML_NAMESPACE;
1279
+ let IS_EMPTY_INPUT = false;
1280
+ let ALLOWED_NAMESPACES = null;
1281
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
1282
+ MATHML_NAMESPACE,
1283
+ SVG_NAMESPACE,
1284
+ HTML_NAMESPACE
1285
+ ], stringToString);
1286
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([
1287
+ "mi",
1288
+ "mo",
1289
+ "mn",
1290
+ "ms",
1291
+ "mtext"
1292
+ ]);
1293
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
1294
+ const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]);
1295
+ let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
1296
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
1297
+ "title",
1298
+ "style",
1299
+ "font",
1300
+ "a",
1301
+ "script"
1302
+ ]);
1303
+ let PARSER_MEDIA_TYPE = null;
1304
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
1305
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
1306
+ let transformCaseFunc = null;
1307
+ let CONFIG = null;
1308
+ const formElement = document.createElement("form");
1309
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
1310
+ return testValue instanceof RegExp || testValue instanceof Function;
1311
+ };
1312
+ /**
1313
+ * _parseConfig
1314
+ *
1315
+ * @param cfg optional config literal
1316
+ */
1317
+ const _parseConfig = function _parseConfig() {
1318
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1319
+ if (CONFIG && CONFIG === cfg) return;
1320
+ if (!cfg || typeof cfg !== "object") cfg = {};
1321
+ cfg = clone(cfg);
1322
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1323
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
1324
+ ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });
1325
+ ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });
1326
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });
1327
+ URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, {
1328
+ transform: transformCaseFunc,
1329
+ base: DEFAULT_URI_SAFE_ATTRIBUTES
1330
+ });
1331
+ DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, {
1332
+ transform: transformCaseFunc,
1333
+ base: DEFAULT_DATA_URI_TAGS
1334
+ });
1335
+ FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });
1336
+ FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone({}), { transform: transformCaseFunc });
1337
+ FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone({}), { transform: transformCaseFunc });
1338
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
1339
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
1340
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
1341
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
1342
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
1343
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
1344
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
1345
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
1346
+ RETURN_DOM = cfg.RETURN_DOM || false;
1347
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
1348
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
1349
+ FORCE_BODY = cfg.FORCE_BODY || false;
1350
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
1351
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
1352
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
1353
+ IN_PLACE = cfg.IN_PLACE || false;
1354
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
1355
+ NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
1356
+ MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, "MATHML_TEXT_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));
1357
+ HTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, "HTML_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));
1358
+ const customElementHandling = _resolveObjectOption(cfg, "CUSTOM_ELEMENT_HANDLING", () => create(null));
1359
+ CUSTOM_ELEMENT_HANDLING = create(null);
1360
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
1361
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
1362
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
1363
+ seal(CUSTOM_ELEMENT_HANDLING);
1364
+ if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
1365
+ if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
1366
+ if (USE_PROFILES) {
1367
+ ALLOWED_TAGS = addToSet({}, text);
1368
+ ALLOWED_ATTR = create(null);
1369
+ if (USE_PROFILES.html === true) {
1370
+ addToSet(ALLOWED_TAGS, html$1);
1371
+ addToSet(ALLOWED_ATTR, html);
1372
+ }
1373
+ if (USE_PROFILES.svg === true) {
1374
+ addToSet(ALLOWED_TAGS, svg$1);
1375
+ addToSet(ALLOWED_ATTR, svg);
1376
+ addToSet(ALLOWED_ATTR, xml);
1377
+ }
1378
+ if (USE_PROFILES.svgFilters === true) {
1379
+ addToSet(ALLOWED_TAGS, svgFilters);
1380
+ addToSet(ALLOWED_ATTR, svg);
1381
+ addToSet(ALLOWED_ATTR, xml);
1382
+ }
1383
+ if (USE_PROFILES.mathMl === true) {
1384
+ addToSet(ALLOWED_TAGS, mathMl$1);
1385
+ addToSet(ALLOWED_ATTR, mathMl);
1386
+ addToSet(ALLOWED_ATTR, xml);
1387
+ }
1388
+ }
1389
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
1390
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
1391
+ if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
1392
+ if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
1393
+ else if (arrayIsArray(cfg.ADD_TAGS)) {
1394
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
1395
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
1396
+ }
1397
+ }
1398
+ if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
1399
+ if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
1400
+ else if (arrayIsArray(cfg.ADD_ATTR)) {
1401
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
1402
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
1403
+ }
1404
+ }
1405
+ if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
1406
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
1407
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
1408
+ }
1409
+ if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
1410
+ if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
1411
+ "html",
1412
+ "head",
1413
+ "body"
1414
+ ]);
1415
+ if (ALLOWED_TAGS.table) {
1416
+ addToSet(ALLOWED_TAGS, ["tbody"]);
1417
+ delete FORBID_TAGS.tbody;
1418
+ }
1419
+ if (cfg.TRUSTED_TYPES_POLICY) {
1420
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1421
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1422
+ const previousTrustedTypesPolicy = trustedTypesPolicy;
1423
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
1424
+ try {
1425
+ emptyHTML = _createTrustedHTML("");
1426
+ } catch (error) {
1427
+ trustedTypesPolicy = previousTrustedTypesPolicy;
1428
+ throw error;
1429
+ }
1430
+ } else if (cfg.TRUSTED_TYPES_POLICY === null) {
1431
+ trustedTypesPolicy = void 0;
1432
+ emptyHTML = "";
1433
+ } else {
1434
+ if (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
1435
+ if (trustedTypesPolicy && typeof emptyHTML === "string") emptyHTML = _createTrustedHTML("");
1436
+ }
1437
+ if (freeze) freeze(cfg);
1438
+ CONFIG = cfg;
1439
+ };
1440
+ const ALL_SVG_TAGS = addToSet({}, [
1441
+ ...svg$1,
1442
+ ...svgFilters,
1443
+ ...svgDisallowed
1444
+ ]);
1445
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
1446
+ /**
1447
+ * Namespace rules for an element in the SVG namespace.
1448
+ *
1449
+ * @param tagName the element's lowercase tag name
1450
+ * @param parent the (possibly simulated) parent node
1451
+ * @param parentTagName the parent's lowercase tag name
1452
+ * @returns true if a spec-compliant parser could produce this element
1453
+ */
1454
+ const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
1455
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
1456
+ if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1457
+ return Boolean(ALL_SVG_TAGS[tagName]);
1458
+ };
1459
+ /**
1460
+ * Namespace rules for an element in the MathML namespace.
1461
+ *
1462
+ * @param tagName the element's lowercase tag name
1463
+ * @param parent the (possibly simulated) parent node
1464
+ * @param parentTagName the parent's lowercase tag name
1465
+ * @returns true if a spec-compliant parser could produce this element
1466
+ */
1467
+ const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
1468
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math";
1469
+ if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
1470
+ return Boolean(ALL_MATHML_TAGS[tagName]);
1471
+ };
1472
+ /**
1473
+ * Namespace rules for an element in the HTML namespace.
1474
+ *
1475
+ * @param tagName the element's lowercase tag name
1476
+ * @param parent the (possibly simulated) parent node
1477
+ * @param parentTagName the parent's lowercase tag name
1478
+ * @returns true if a spec-compliant parser could produce this element
1479
+ */
1480
+ const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
1481
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
1482
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
1483
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
1484
+ };
1485
+ /**
1486
+ * @param element a DOM element whose namespace is being checked
1487
+ * @returns Return false if the element has a
1488
+ * namespace that a spec-compliant parser would never
1489
+ * return. Return true otherwise.
1490
+ */
1491
+ const _checkValidNamespace = function _checkValidNamespace(element) {
1492
+ const elementNamespace = _readNamespaceURI(element);
1493
+ const tagName = stringToLowerCase(_readNodeName(element));
1494
+ const parentNode = getParentNode(element);
1495
+ let parent;
1496
+ let parentTagName;
1497
+ if (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {
1498
+ parent = { namespaceURI: _readNamespaceURI(parentNode) };
1499
+ parentTagName = stringToLowerCase(_readNodeName(parentNode));
1500
+ } else {
1501
+ parent = { namespaceURI: NAMESPACE };
1502
+ parentTagName = "template";
1503
+ }
1504
+ if (!ALLOWED_NAMESPACES[elementNamespace]) return false;
1505
+ if (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);
1506
+ if (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);
1507
+ if (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);
1508
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[elementNamespace]) return true;
1509
+ return false;
1510
+ };
1511
+ /**
1512
+ * _forceRemove
1513
+ *
1514
+ * @param node a DOM node
1515
+ */
1516
+ const _forceRemove = function _forceRemove(node) {
1517
+ arrayPush(DOMPurify.removed, { element: node });
1518
+ try {
1519
+ getParentNode(node).removeChild(node);
1520
+ } catch (_) {
1521
+ remove(node);
1522
+ if (!getParentNode(node)) throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1523
+ }
1524
+ };
1525
+ /**
1526
+ * _stripAttributeNode
1527
+ *
1528
+ * Remove a single Attr node case/namespace-exactly on an attribute-teardown
1529
+ * path. Name-based removeAttribute() ASCII-lowercases its lookup key for an
1530
+ * HTML element in an HTML document and so silently misses a case-preserved
1531
+ * handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect
1532
+ * _removeAttribute() was fixed for, which a name-based call would reintroduce
1533
+ * on these IN_PLACE teardown paths. Unlike _removeAttribute this does not
1534
+ * record into DOMPurify.removed: the neutralize passes intentionally do not
1535
+ * book-keep. A clobbered/detached node falls back to best-effort name-based
1536
+ * removal.
1537
+ *
1538
+ * @param element the element to strip the attribute from
1539
+ * @param attribute the Attr node to remove
1540
+ * @param name the attribute's name, for the fallback path
1541
+ */
1542
+ const _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {
1543
+ try {
1544
+ removeAttributeNode(element, attribute);
1545
+ } catch (_) {
1546
+ try {
1547
+ element.removeAttribute(name);
1548
+ } catch (_) {}
1549
+ }
1550
+ };
1551
+ /**
1552
+ * Fail-closed teardown of an in-place root: strip every disallowed attribute
1553
+ * in the subtree first, so nothing armed is left behind, then remove all
1554
+ * children and the root's own attributes.
1555
+ *
1556
+ * @param root the in-place root to empty
1557
+ */
1558
+ const _neutralizeRoot = function _neutralizeRoot(root) {
1559
+ _neutralizeSubtree(root);
1560
+ const childNodes = getChildNodes(root);
1561
+ if (childNodes) arrayForEach(arraySlice(childNodes), (child) => {
1562
+ try {
1563
+ remove(child);
1564
+ } catch (_) {}
1565
+ });
1566
+ const attributes = _readNodeType(root) === NODE_TYPE.element ? getAttributes(root) : null;
1567
+ if (attributes) for (let i = attributes.length - 1; i >= 0; --i) {
1568
+ const attribute = attributes[i];
1569
+ const name = attribute && attribute.name;
1570
+ if (typeof name === "string") _stripAttributeNode(root, attribute, name);
1571
+ }
1572
+ };
1573
+ /**
1574
+ * Removes an attribute, preferably as its exact Attr node: name-based
1575
+ * removal lowercases the name in HTML documents and misses case-preserved
1576
+ * names, e.g. from imported XHTML.
1577
+ *
1578
+ * @param name an Attribute name
1579
+ * @param element a DOM node
1580
+ * @param attr the exact Attr node to remove, when the caller has it
1581
+ */
1582
+ const _removeAttribute = function _removeAttribute(name, element, attr) {
1583
+ if (!attr) try {
1584
+ attr = element.getAttributeNode(name);
1585
+ } catch (_) {
1586
+ attr = null;
1587
+ }
1588
+ arrayPush(DOMPurify.removed, {
1589
+ attribute: attr || null,
1590
+ from: element
1591
+ });
1592
+ try {
1593
+ if (attr) removeAttributeNode(element, attr);
1594
+ else element.removeAttribute(name);
1595
+ } catch (_) {
1596
+ try {
1597
+ element.removeAttribute(name);
1598
+ } catch (_) {}
1599
+ }
1600
+ if (name === "is") {
1601
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
1602
+ _forceRemove(element);
1603
+ } catch (_) {}
1604
+ else try {
1605
+ element.setAttribute(name, "");
1606
+ } catch (_) {}
1607
+ }
1608
+ };
1609
+ /**
1610
+ * Removes every attribute the configuration does not allow. Used to
1611
+ * neutralize nodes discarded from an in-place tree.
1612
+ *
1613
+ * @param element the element to strip
1614
+ */
1615
+ const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
1616
+ const attributes = getAttributes(element);
1617
+ if (!attributes) return;
1618
+ for (let i = attributes.length - 1; i >= 0; --i) {
1619
+ const attribute = attributes[i];
1620
+ const name = attribute && attribute.name;
1621
+ if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;
1622
+ _stripAttributeNode(element, attribute, name);
1623
+ }
1624
+ };
1625
+ /**
1626
+ * Iterative depth-first walk, so deep trees cannot overflow the call stack,
1627
+ * reading through the cached getters, so clobbering cannot hide children.
1628
+ * When `visit` returns false, the node's children are skipped. With
1629
+ * `intoShadow`, open shadow roots are walked after their host's children.
1630
+ *
1631
+ * @param root where to start
1632
+ * @param visit called for every node
1633
+ * @param intoShadow whether to enter open shadow roots
1634
+ */
1635
+ const _walkTree = function _walkTree(root, visit) {
1636
+ let intoShadow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
1637
+ const stack = [root];
1638
+ while (stack.length > 0) {
1639
+ const node = stack.pop();
1640
+ if (visit(node) === false) continue;
1641
+ if (intoShadow && _readNodeType(node) === NODE_TYPE.element) {
1642
+ const shadowRoot = getShadowRoot(node);
1643
+ if (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);
1644
+ }
1645
+ const childNodes = getChildNodes(node);
1646
+ if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);
1647
+ }
1648
+ };
1649
+ /**
1650
+ * Strips disallowed attributes from every element of a discarded subtree,
1651
+ * so a handler that is already queued (a loading image) cannot fire.
1652
+ *
1653
+ * @param root the root of a removed subtree
1654
+ */
1655
+ const _neutralizeSubtree = function _neutralizeSubtree(root) {
1656
+ _walkTree(root, (node) => {
1657
+ if (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);
1658
+ });
1659
+ };
1660
+ /**
1661
+ * All nodes under `root`, root first, including open shadow roots. Template
1662
+ * content is not entered, it is inert.
1663
+ *
1664
+ * @param root the in-place root
1665
+ * @return the nodes
1666
+ */
1667
+ const _collectLiveNodes = function _collectLiveNodes(root) {
1668
+ const nodes = [];
1669
+ _walkTree(root, (node) => {
1670
+ nodes.push(node);
1671
+ }, true);
1672
+ return nodes;
1673
+ };
1674
+ /**
1675
+ * Strips disallowed attributes from every element that was under the
1676
+ * in-place root when the call started and no longer is, whatever removed
1677
+ * or moved it.
1678
+ *
1679
+ * @param root the in-place root
1680
+ * @param before the root's nodes, collected before the walk
1681
+ */
1682
+ const _neutralizeEscapedElements = function _neutralizeEscapedElements(root, before) {
1683
+ const reachable = setCreate();
1684
+ arrayForEach(_collectLiveNodes(root), (node) => {
1685
+ if (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);
1686
+ });
1687
+ arrayForEach(before, (node) => {
1688
+ if (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripDisallowedAttributes(node);
1689
+ });
1690
+ };
1691
+ /**
1692
+ * Neutralizes everything that left the in-place tree during the call: what
1693
+ * DOMPurify removed, and what hooks or custom elements removed or moved out.
1694
+ *
1695
+ * @param root the in-place root
1696
+ * @param before the root's nodes, collected before the walk
1697
+ * @return true if the root itself was removed
1698
+ */
1699
+ const _neutralizeDiscarded = function _neutralizeDiscarded(root, before) {
1700
+ let rootRemoved = false;
1701
+ arrayForEach(DOMPurify.removed, (entry) => {
1702
+ if (entry.element) {
1703
+ rootRemoved = rootRemoved || entry.element === root;
1704
+ _neutralizeSubtree(entry.element);
1705
+ }
1706
+ });
1707
+ _neutralizeEscapedElements(root, before);
1708
+ return rootRemoved;
1709
+ };
1710
+ const MAX_UNVISITED_ROUNDS = 8;
1711
+ /**
1712
+ * The walk only moves forward, so a node moved to a position it already
1713
+ * passed is never visited. Give every original node that is still in the
1714
+ * tree but unvisited the normal treatment, hooks included. Nodes created
1715
+ * during the call are left alone. Fails closed if the tree keeps changing.
1716
+ *
1717
+ * @param root the in-place root
1718
+ * @param before the root's nodes, collected before the walk
1719
+ */
1720
+ const _sanitizeUnvisitedNodes = function _sanitizeUnvisitedNodes(root, before) {
1721
+ const visited = IN_PLACE_VISITED;
1722
+ let original = null;
1723
+ const getOriginal = () => {
1724
+ if (!original) {
1725
+ original = setCreate();
1726
+ arrayForEach(before, (beforeNode) => {
1727
+ setAdd(original, beforeNode);
1728
+ });
1729
+ }
1730
+ return original;
1731
+ };
1732
+ for (let round = 0;; round++) {
1733
+ const live = _collectLiveNodes(root);
1734
+ const containers = [root];
1735
+ let pending = false;
1736
+ arrayForEach(live, (node) => {
1737
+ if (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);
1738
+ else if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);
1739
+ });
1740
+ if (!pending) return;
1741
+ if (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate("the tree kept changing during in-place sanitization; refusing to return it");
1742
+ arrayForEach(containers, (container, index) => {
1743
+ _sanitizeUnvisitedIn(container, index > 0, root, getOriginal());
1744
+ });
1745
+ }
1746
+ };
1747
+ /**
1748
+ * One _sanitizeUnvisitedNodes pass over the root or an open shadow root.
1749
+ *
1750
+ * @param container the root or an open shadow root
1751
+ * @param inShadow whether container is a shadow root
1752
+ * @param root the in-place root
1753
+ * @param original the root's nodes collected before the walk, as a set
1754
+ */
1755
+ const _sanitizeUnvisitedIn = function _sanitizeUnvisitedIn(container, inShadow, root, original) {
1756
+ const iterator = _createNodeIterator(container);
1757
+ let node;
1758
+ while (node = iterator.nextNode()) {
1759
+ if (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;
1760
+ if (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);
1761
+ _sanitizeElements(node, root);
1762
+ _sanitizeAttributes(node, root);
1763
+ if (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);
1764
+ }
1765
+ };
1766
+ /**
1767
+ * Records that _sanitizeElements processed `node`. No-op outside IN_PLACE.
1768
+ *
1769
+ * @param node the node being processed
1770
+ */
1771
+ const _markVisited = function _markVisited(node) {
1772
+ if (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);
1773
+ };
1774
+ /**
1775
+ * Patch-linkage attributes (declarative partial updates): `patchsrc`
1776
+ * always, `for` everywhere except on <label> and <output>. Gated on
1777
+ * SAFE_FOR_XML. Shared by the IN_PLACE pre-pass and _isValidAttribute.
1778
+ *
1779
+ * @param lcName the transformCaseFunc'd attribute name
1780
+ * @param lcTag the transformCaseFunc'd tag name of the carrying element
1781
+ * @return true if the attribute is patch linkage and must be dropped
1782
+ */
1783
+ const _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {
1784
+ if (!SAFE_FOR_XML) return false;
1785
+ if (lcName === "patchsrc") return true;
1786
+ return lcName === "for" && lcTag !== "label" && lcTag !== "output";
1787
+ };
1788
+ /**
1789
+ * IN_PLACE pre-pass: sever all patch linkage before the walk, so no patch
1790
+ * can fire mid-walk into a part of the tree the walker already passed.
1791
+ * Removes range markers (processing instructions, comments with markup)
1792
+ * and strips linkage attributes. It cannot undo a patch that already fired.
1793
+ *
1794
+ * TODO: if the shipped feature can patch through `for` on <label>/<output>,
1795
+ * drop that pair here too (see test/declarative-patch-probe.html).
1796
+ *
1797
+ * @param root the in-place root to sweep
1798
+ */
1799
+ const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
1800
+ if (!SAFE_FOR_XML) return;
1801
+ _walkTree(root, (node) => {
1802
+ const nodeType = _readNodeType(node);
1803
+ if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
1804
+ try {
1805
+ remove(node);
1806
+ } catch (_) {}
1807
+ return false;
1808
+ }
1809
+ if (nodeType === NODE_TYPE.element) {
1810
+ const element = node;
1811
+ const lcTag = transformCaseFunc(_readNodeName(node));
1812
+ try {
1813
+ if (element.hasAttribute && element.hasAttribute("patchsrc")) element.removeAttribute("patchsrc");
1814
+ if (element.hasAttribute && element.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) element.removeAttribute("for");
1815
+ } catch (_) {}
1816
+ }
1817
+ return true;
1818
+ });
1819
+ };
1820
+ /**
1821
+ * _initDocument
1822
+ *
1823
+ * @param dirty - a string of dirty markup
1824
+ * @return a DOM, filled with the dirty markup
1825
+ */
1826
+ const _initDocument = function _initDocument(dirty) {
1827
+ let doc = null;
1828
+ let leadingWhitespace = null;
1829
+ if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
1830
+ else {
1831
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
1832
+ leadingWhitespace = matches && matches[0];
1833
+ }
1834
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
1835
+ const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
1836
+ if (NAMESPACE === HTML_NAMESPACE) try {
1837
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
1838
+ } catch (_) {}
1839
+ if (!doc || !doc.documentElement) {
1840
+ doc = implementation.createDocument(NAMESPACE, "template", null);
1841
+ try {
1842
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
1843
+ } catch (_) {}
1844
+ }
1845
+ const body = doc.body || doc.documentElement;
1846
+ if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
1847
+ if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
1848
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
1849
+ };
1850
+ /**
1851
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
1852
+ *
1853
+ * @param root The root element or node to start traversing on.
1854
+ * @return The created NodeIterator
1855
+ */
1856
+ const _createNodeIterator = function _createNodeIterator(root) {
1857
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
1858
+ return createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
1859
+ };
1860
+ /**
1861
+ * Replace template expression syntax (mustache, ERB, template
1862
+ * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
1863
+ * sites. Order matters: mustache, then ERB, then template literal.
1864
+ *
1865
+ * @param value the string to scrub
1866
+ * @returns the scrubbed string
1867
+ */
1868
+ const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
1869
+ value = stringReplace(value, MUSTACHE_EXPR$1, " ");
1870
+ value = stringReplace(value, ERB_EXPR$1, " ");
1871
+ value = stringReplace(value, TMPLIT_EXPR$1, " ");
1872
+ return value;
1873
+ };
1874
+ /**
1875
+ * Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
1876
+ * character data of an element subtree. Used as the final safety net for
1877
+ * SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
1878
+ * which only form after text-node normalization (e.g. fragments split across
1879
+ * stripped elements) cannot survive into a template-evaluating framework.
1880
+ *
1881
+ * Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
1882
+ * in place rather than round-tripping through innerHTML. This preserves
1883
+ * descendant node references (important for IN_PLACE callers), avoids a
1884
+ * serialize/reparse cycle, and reads literal character data — which means
1885
+ * `<%...%>` in text content matches the ERB regex against its real bytes
1886
+ * instead of the HTML-entity-escaped form innerHTML would produce.
1887
+ *
1888
+ * Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
1889
+ * attributes is performed during the per-node `_sanitizeAttributes` pass.
1890
+ *
1891
+ * @param node The root element whose character data should be scrubbed.
1892
+ */
1893
+ const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
1894
+ var _node$querySelectorAl;
1895
+ _scrubOwnCharacterData(node);
1896
+ const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
1897
+ if (templates) arrayForEach(templates, (tmpl) => {
1898
+ if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
1899
+ });
1900
+ };
1901
+ /**
1902
+ * _scrubOwnCharacterData
1903
+ *
1904
+ * Non-recursive core of _scrubTemplateExpressions: normalize `node` and
1905
+ * strip template expressions from its own character data only. Does not
1906
+ * enter <template>.content or attached shadow roots (NodeIterator never
1907
+ * does). Used by _sanitizeShadowDOM, where every nested template content
1908
+ * and shadow root is already walked - and therefore scrubbed - by its own
1909
+ * recursive _sanitizeShadowDOM call; recursing here as well would rescrub
1910
+ * each nested fragment once per ancestor, which is quadratic in nesting
1911
+ * depth.
1912
+ *
1913
+ * @param node The root whose own character data should be scrubbed.
1914
+ */
1915
+ const _scrubOwnCharacterData = function _scrubOwnCharacterData(node) {
1916
+ node.normalize();
1917
+ const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
1918
+ const walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
1919
+ let currentNode = walker.nextNode();
1920
+ while (currentNode) {
1921
+ currentNode.data = _stripTemplateExpressions(currentNode.data);
1922
+ currentNode = walker.nextNode();
1923
+ }
1924
+ };
1925
+ /**
1926
+ * _isClobbered
1927
+ *
1928
+ * Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
1929
+ * interface with [LegacyOverrideBuiltIns]; a descendant element with a
1930
+ * `name` attribute matching a prototype property shadows that property
1931
+ * on direct reads. We use this check at the IN_PLACE entry-point and
1932
+ * during attribute sanitization to refuse clobbered forms.
1933
+ *
1934
+ * @param element element to check for clobbering attacks
1935
+ * @return true if clobbered, false if safe
1936
+ */
1937
+ const _isClobbered = function _isClobbered(element) {
1938
+ const realTagName = getNodeName ? getNodeName(element) : null;
1939
+ if (typeof realTagName !== "string") return false;
1940
+ if (transformCaseFunc(realTagName) !== "form") return false;
1941
+ return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.removeAttributeNode !== "function" || typeof element.getAttributeNode !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);
1942
+ };
1943
+ /**
1944
+ * Checks whether the given value is a DocumentFragment from any realm.
1945
+ *
1946
+ * The realm-independent replacement reads `nodeType` through the cached
1947
+ * Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
1948
+ * constant (11). nodeType is a numeric value resolved from the node's
1949
+ * internal slot, identical across realms for the same kind of node.
1950
+ *
1951
+ * @param value object to check
1952
+ * @return true if value is a DocumentFragment-shaped node from any realm
1953
+ */
1954
+ const _isDocumentFragment = function _isDocumentFragment(value) {
1955
+ if (!getNodeType || typeof value !== "object" || value === null) return false;
1956
+ try {
1957
+ return getNodeType(value) === NODE_TYPE.documentFragment;
1958
+ } catch (_) {
1959
+ return false;
1960
+ }
1961
+ };
1962
+ /**
1963
+ * Checks whether the given object is a DOM node, including nodes that
1964
+ * originate from a different window/realm (e.g. an iframe's
1965
+ * contentDocument). The previous `value instanceof Node` check was
1966
+ * realm-bound: nodes from a different window failed it, causing
1967
+ * sanitize() to silently stringify them and reset IN_PLACE to false,
1968
+ * returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
1969
+ *
1970
+ * @param value object to check whether it's a DOM node
1971
+ * @return true if value is a DOM node from any realm
1972
+ */
1973
+ const _isNode = function _isNode(value) {
1974
+ if (!getNodeType || typeof value !== "object" || value === null) return false;
1975
+ try {
1976
+ return typeof getNodeType(value) === "number";
1977
+ } catch (_) {
1978
+ return false;
1979
+ }
1980
+ };
1981
+ function _executeHooks(hooks, currentNode, data) {
1982
+ if (hooks.length === 0) return;
1983
+ arrayForEach(hooks, (hook) => {
1984
+ hook.call(DOMPurify, currentNode, data, CONFIG);
1985
+ });
1986
+ }
1987
+ /**
1988
+ * Structural-threat checks that condemn a node regardless of the
1989
+ * allowlists: mXSS via namespace confusion, risky CSS construction,
1990
+ * processing instructions, markup-bearing comments. Pure predicate;
1991
+ * the caller removes. Check order is load-bearing.
1992
+ *
1993
+ * @param currentNode the node to inspect
1994
+ * @param tagName the node's transformCaseFunc'd tag name
1995
+ * @return true if the node must be removed
1996
+ */
1997
+ const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
1998
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;
1999
+ if (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && _readNodeType(currentNode) === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;
2000
+ if (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;
2001
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;
2002
+ return false;
2003
+ };
2004
+ /**
2005
+ * Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate
2006
+ * function, per the validation in _parseConfig) against a name.
2007
+ * Additional arguments are forwarded to predicate functions - the
2008
+ * attributeNameCheck predicate receives the tag name as its second
2009
+ * argument. A null/absent check never matches.
2010
+ *
2011
+ * @param check the configured tagNameCheck / attributeNameCheck value
2012
+ * @param name the name to test
2013
+ * @param args extra arguments forwarded to a predicate function
2014
+ * @return true if the check matches the name
2015
+ */
2016
+ const _matchesNameCheck = function _matchesNameCheck(check, name) {
2017
+ if (check instanceof RegExp) return regExpTest(check, name);
2018
+ if (check instanceof Function) {
2019
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
2020
+ return Boolean(check(name, ...args));
2021
+ }
2022
+ return false;
2023
+ };
2024
+ /**
2025
+ * Handle a node whose tag is forbidden or not allowlisted: keep
2026
+ * allowed custom elements (false return exits _sanitizeElements
2027
+ * early - the namespace and fallback-tag removal checks are
2028
+ * intentionally skipped for kept custom elements), else hoist
2029
+ * content per KEEP_CONTENT and remove.
2030
+ *
2031
+ * A kept custom element is the ONLY case in which this function
2032
+ * returns false, so the caller uses that return value to run the
2033
+ * afterSanitizeElements hook on the kept element and keep the
2034
+ * element-hook lifecycle consistent with normal allowlisted
2035
+ * elements (GHSA-c2j3-45gr-mqc4).
2036
+ *
2037
+ * @param currentNode the disallowed node
2038
+ * @param tagName the node's transformCaseFunc'd tag name
2039
+ * @return true if the node was removed, false if kept
2040
+ */
2041
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
2042
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
2043
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {
2044
+ const parentNode = getParentNode(currentNode);
2045
+ const childNodes = getChildNodes(currentNode);
2046
+ if (childNodes && parentNode) {
2047
+ const childCount = childNodes.length;
2048
+ for (let i = childCount - 1; i >= 0; --i) {
2049
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
2050
+ parentNode.insertBefore(hoisted, getNextSibling(currentNode));
2051
+ }
2052
+ }
2053
+ }
2054
+ _forceRemove(currentNode);
2055
+ return true;
2056
+ };
2057
+ /**
2058
+ * Fork a hook-mutable allowlist off its shared binding the first time a
2059
+ * (possibly lazily-installed) uponSanitize* hook is about to see it, so the
2060
+ * hook cannot widen the per-instance default or the setConfig binding by
2061
+ * reference and leak past the call. Returns the set unchanged once it is
2062
+ * already call-local, so repeated calls across elements are idempotent.
2063
+ *
2064
+ * @param hookList the uponSanitize* hook array for this event
2065
+ * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding
2066
+ * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant
2067
+ * @param setConfigSet the captured setConfig() binding, or null
2068
+ * @return a call-local clone if a hook is present and set is still shared,
2069
+ * else set unchanged
2070
+ */
2071
+ const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {
2072
+ if (hookList.length === 0) return set;
2073
+ return set === defaultSet || set === setConfigSet ? clone(set) : set;
2074
+ };
2075
+ /**
2076
+ * A hook may have detached the node it was called for. If so, treat it as
2077
+ * removed and stop processing it; the walk root is exempt. On the IN_PLACE
2078
+ * path the detached subtree is neutralized right away.
2079
+ *
2080
+ * @param currentNode the node a hook may have detached
2081
+ * @param root the current walk root
2082
+ * @return true if the node was detached
2083
+ */
2084
+ const _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {
2085
+ if (currentNode === root || getParentNode(currentNode) !== null) return false;
2086
+ if (IN_PLACE) _neutralizeSubtree(currentNode);
2087
+ return true;
2088
+ };
2089
+ /**
2090
+ * _sanitizeElements
2091
+ *
2092
+ * @protect nodeName
2093
+ * @protect textContent
2094
+ * @protect removeChild
2095
+ * @param currentNode to check for permission to exist
2096
+ * @return true if node was killed, false if left alive
2097
+ */
2098
+ const _sanitizeElements = function _sanitizeElements(currentNode, root) {
2099
+ _markVisited(currentNode);
2100
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
2101
+ if (_handleHookDetachedNode(currentNode, root)) return true;
2102
+ if (_isClobbered(currentNode)) {
2103
+ _forceRemove(currentNode);
2104
+ return true;
2105
+ }
2106
+ const tagName = transformCaseFunc(_readNodeName(currentNode));
2107
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
2108
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
2109
+ tagName,
2110
+ allowedTags: ALLOWED_TAGS
2111
+ });
2112
+ if (_handleHookDetachedNode(currentNode, root)) return true;
2113
+ if (_isUnsafeNode(currentNode, tagName)) {
2114
+ _forceRemove(currentNode);
2115
+ return true;
2116
+ }
2117
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
2118
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
2119
+ if (removed === false) {
2120
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2121
+ if (_handleHookDetachedNode(currentNode, root)) return true;
2122
+ }
2123
+ return removed;
2124
+ }
2125
+ if (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
2126
+ _forceRemove(currentNode);
2127
+ return true;
2128
+ }
2129
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
2130
+ _forceRemove(currentNode);
2131
+ return true;
2132
+ }
2133
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
2134
+ const content = _stripTemplateExpressions(currentNode.textContent);
2135
+ if (currentNode.textContent !== content) {
2136
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
2137
+ currentNode.textContent = content;
2138
+ }
2139
+ }
2140
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2141
+ return _handleHookDetachedNode(currentNode, root);
2142
+ };
2143
+ /**
2144
+ * _isValidAttribute
2145
+ *
2146
+ * @param lcTag Lowercase tag name of containing element.
2147
+ * @param lcName Lowercase attribute name.
2148
+ * @param value Attribute value.
2149
+ * @return Returns true if `value` is valid, otherwise false.
2150
+ */
2151
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
2152
+ if (FORBID_ATTR[lcName]) return false;
2153
+ if (_isPatchLinkageAttribute(lcName, lcTag)) return false;
2154
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
2155
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
2156
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;
2157
+ if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;
2158
+ if (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);
2159
+ if (URI_SAFE_ATTRIBUTES[lcName]) return true;
2160
+ if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) return true;
2161
+ if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) return true;
2162
+ if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) return true;
2163
+ return !value;
2164
+ };
2165
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [
2166
+ "annotation-xml",
2167
+ "color-profile",
2168
+ "font-face",
2169
+ "font-face-format",
2170
+ "font-face-name",
2171
+ "font-face-src",
2172
+ "font-face-uri",
2173
+ "missing-glyph"
2174
+ ]);
2175
+ /**
2176
+ * _isBasicCustomElement
2177
+ * checks if at least one dash is included in tagName, and it's not the first char
2178
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
2179
+ *
2180
+ * @param tagName name of the tag of the node to sanitize
2181
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
2182
+ */
2183
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
2184
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
2185
+ };
2186
+ /**
2187
+ * Wrap an attribute value in the matching Trusted Types object when
2188
+ * the active policy requires it. Namespaced attributes pass through
2189
+ * unchanged (no TT support yet, see
2190
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
2191
+ *
2192
+ * @param lcTag lowercase tag name of the containing element
2193
+ * @param lcName lowercase attribute name
2194
+ * @param namespaceURI the attribute's namespace, if any
2195
+ * @param value the attribute value to wrap
2196
+ * @return the value, wrapped when Trusted Types demand it
2197
+ */
2198
+ const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
2199
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2200
+ case "TrustedHTML": return _createTrustedHTML(value);
2201
+ case "TrustedScriptURL": return _createTrustedScriptURL(value);
2202
+ }
2203
+ return value;
2204
+ };
2205
+ /**
2206
+ * Write a modified attribute value back onto the element. On
2207
+ * success, re-probe for clobbering introduced by the new value and
2208
+ * remove the element when found; otherwise, when this writeback is the
2209
+ * recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the
2210
+ * removal entry that path recorded so it does not show as removed. On
2211
+ * failure, remove the attribute instead.
2212
+ *
2213
+ * Returns true only on a clean write (the value was set and the new value
2214
+ * introduced no clobbering). The caller uses that, together with its own
2215
+ * knowledge of whether this attribute pushed a DOMPurify.removed record, to
2216
+ * decide whether to pop that record. The pop must happen ONLY for the
2217
+ * named-prop remove-and-recreate; popping on any other value change (trim,
2218
+ * template scrubbing, Trusted Types) would consume an unrelated _forceRemove
2219
+ * subtree-cleanup record and let that detached subtree keep a live event
2220
+ * handler through the IN_PLACE neutralization pass (SO-001).
2221
+ *
2222
+ * @param currentNode the element carrying the attribute
2223
+ * @param name the attribute name as present on the element
2224
+ * @param namespaceURI the attribute's namespace, if any
2225
+ * @param value the new attribute value
2226
+ * @return true if the value was written without introducing clobbering
2227
+ */
2228
+ const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
2229
+ try {
2230
+ if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
2231
+ else currentNode.setAttribute(name, value);
2232
+ if (_isClobbered(currentNode)) {
2233
+ _forceRemove(currentNode);
2234
+ return false;
2235
+ }
2236
+ return true;
2237
+ } catch (_) {
2238
+ _removeAttribute(name, currentNode);
2239
+ return false;
2240
+ }
2241
+ };
2242
+ /**
2243
+ * _isUnsafeAttributeValue
2244
+ *
2245
+ * Value-based attribute checks that the attribute walk applies before any
2246
+ * hook can force-keep an attribute, shared with the public
2247
+ * isValidAttribute() so that it never approves a value sanitize() would
2248
+ * strip.
2249
+ *
2250
+ * @param name the attribute name as found on the node (case preserved)
2251
+ * @param value the attribute value
2252
+ * @returns true if the attribute must be removed because of its value
2253
+ */
2254
+ const _isUnsafeAttributeValue = function _isUnsafeAttributeValue(name, value) {
2255
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) return true;
2256
+ return stringToLowerCase(name) === "attributename" && stringMatch(value, "href") !== null;
2257
+ };
2258
+ /**
2259
+ * _sanitizeAttributes
2260
+ *
2261
+ * @protect attributes
2262
+ * @protect nodeName
2263
+ * @protect removeAttribute
2264
+ * @protect setAttribute
2265
+ *
2266
+ * @param currentNode to sanitize
2267
+ * @param root the current walk root
2268
+ */
2269
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {
2270
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
2271
+ if (_handleHookDetachedNode(currentNode, root)) return;
2272
+ const attributes = currentNode.attributes;
2273
+ if (!attributes || _isClobbered(currentNode)) return;
2274
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
2275
+ const hookEvent = {
2276
+ attrName: "",
2277
+ attrValue: "",
2278
+ keepAttr: true,
2279
+ allowedAttributes: ALLOWED_ATTR,
2280
+ forceKeepAttr: void 0
2281
+ };
2282
+ let l = attributes.length;
2283
+ const lcTag = transformCaseFunc(currentNode.nodeName);
2284
+ while (l--) {
2285
+ const attr = attributes[l];
2286
+ const name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;
2287
+ const lcName = transformCaseFunc(name);
2288
+ const initValue = attrValue;
2289
+ let value = name === "value" ? initValue : stringTrim(initValue);
2290
+ let recreatedNamedProp = false;
2291
+ hookEvent.attrName = lcName;
2292
+ hookEvent.attrValue = value;
2293
+ hookEvent.keepAttr = true;
2294
+ hookEvent.forceKeepAttr = void 0;
2295
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
2296
+ value = hookEvent.attrValue;
2297
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
2298
+ _removeAttribute(name, currentNode, attr);
2299
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
2300
+ recreatedNamedProp = true;
2301
+ }
2302
+ if (_isUnsafeAttributeValue(name, value)) {
2303
+ _removeAttribute(name, currentNode, attr);
2304
+ continue;
2305
+ }
2306
+ if (hookEvent.forceKeepAttr) continue;
2307
+ if (!hookEvent.keepAttr) {
2308
+ _removeAttribute(name, currentNode, attr);
2309
+ continue;
2310
+ }
2311
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
2312
+ _removeAttribute(name, currentNode, attr);
2313
+ continue;
2314
+ }
2315
+ if (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);
2316
+ if (!_isValidAttribute(lcTag, lcName, value)) {
2317
+ _removeAttribute(name, currentNode, attr);
2318
+ continue;
2319
+ }
2320
+ value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
2321
+ if (value !== initValue) {
2322
+ if (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);
2323
+ }
2324
+ }
2325
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
2326
+ _handleHookDetachedNode(currentNode, root);
2327
+ };
2328
+ /**
2329
+ * _sanitizeShadowDOM
2330
+ *
2331
+ * @param fragment to iterate over recursively
2332
+ */
2333
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
2334
+ let shadowNode = null;
2335
+ const shadowIterator = _createNodeIterator(fragment);
2336
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
2337
+ while (shadowNode = shadowIterator.nextNode()) {
2338
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
2339
+ _sanitizeElements(shadowNode, fragment);
2340
+ _sanitizeAttributes(shadowNode, fragment);
2341
+ if (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);
2342
+ if (_readNodeType(shadowNode) === NODE_TYPE.element) {
2343
+ const innerSr = getShadowRoot(shadowNode);
2344
+ if (_isDocumentFragment(innerSr)) {
2345
+ _sanitizeAttachedShadowRoots(innerSr);
2346
+ _sanitizeShadowDOM2(innerSr);
2347
+ }
2348
+ }
2349
+ }
2350
+ if (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);
2351
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
2352
+ };
2353
+ /**
2354
+ * Sanitizes every attached shadow root under `root`, since the node
2355
+ * iterator does not enter shadow trees. Needed for IN_PLACE input and for
2356
+ * DOM input whose clonable shadow roots were copied by importNode().
2357
+ *
2358
+ * @param root the subtree root to walk for attached shadow roots
2359
+ */
2360
+ const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
2361
+ const stack = [{
2362
+ node: root,
2363
+ shadow: null
2364
+ }];
2365
+ while (stack.length > 0) {
2366
+ const item = stack.pop();
2367
+ if (item.shadow) {
2368
+ _sanitizeShadowDOM2(item.shadow);
2369
+ continue;
2370
+ }
2371
+ const node = item.node;
2372
+ const isElement = _readNodeType(node) === NODE_TYPE.element;
2373
+ const childNodes = getChildNodes(node);
2374
+ if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({
2375
+ node: childNodes[i],
2376
+ shadow: null
2377
+ });
2378
+ if (isElement) {
2379
+ const rootName = getNodeName ? getNodeName(node) : null;
2380
+ if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") {
2381
+ const content = node.content;
2382
+ if (_isDocumentFragment(content)) stack.push({
2383
+ node: content,
2384
+ shadow: null
2385
+ });
2386
+ }
2387
+ }
2388
+ if (isElement) {
2389
+ const sr = getShadowRoot(node);
2390
+ if (_isDocumentFragment(sr)) stack.push({
2391
+ node: null,
2392
+ shadow: sr
2393
+ }, {
2394
+ node: sr,
2395
+ shadow: null
2396
+ });
2397
+ }
2398
+ }
2399
+ };
2400
+ DOMPurify.sanitize = function(dirty) {
2401
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2402
+ let body = null;
2403
+ let importedNode = null;
2404
+ let currentNode = null;
2405
+ let returnNode = null;
2406
+ IS_EMPTY_INPUT = !dirty;
2407
+ if (IS_EMPTY_INPUT) dirty = "<!-->";
2408
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
2409
+ dirty = stringifyValue(dirty);
2410
+ if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
2411
+ }
2412
+ if (!DOMPurify.isSupported) return dirty;
2413
+ if (SET_CONFIG) {
2414
+ ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
2415
+ ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
2416
+ } else _parseConfig(cfg);
2417
+ if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);
2418
+ if (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);
2419
+ DOMPurify.removed = [];
2420
+ const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
2421
+ let inPlaceNodes = [];
2422
+ const outerVisited = IN_PLACE_VISITED;
2423
+ if (inPlace) {
2424
+ _neutralizePatchLinkage(dirty);
2425
+ const nn = _readNodeName(dirty);
2426
+ if (typeof nn === "string") {
2427
+ const tagName = transformCaseFunc(nn);
2428
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
2429
+ _neutralizeRoot(dirty);
2430
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
2431
+ }
2432
+ }
2433
+ if (_isClobbered(dirty)) {
2434
+ _neutralizeRoot(dirty);
2435
+ throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
2436
+ }
2437
+ inPlaceNodes = _collectLiveNodes(dirty);
2438
+ IN_PLACE_VISITED = setCreate();
2439
+ } else if (_isNode(dirty)) {
2440
+ body = _initDocument("<!---->");
2441
+ importedNode = body.ownerDocument.importNode(dirty, true);
2442
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
2443
+ else if (importedNode.nodeName === "HTML") body = importedNode;
2444
+ else body.appendChild(importedNode);
2445
+ _sanitizeAttachedShadowRoots(body);
2446
+ } else {
2447
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
2448
+ body = _initDocument(dirty);
2449
+ if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
2450
+ }
2451
+ if (body && FORCE_BODY) _forceRemove(body.firstChild);
2452
+ const walkRoot = inPlace ? dirty : body;
2453
+ try {
2454
+ if (inPlace) _sanitizeAttachedShadowRoots(dirty);
2455
+ const nodeIterator = _createNodeIterator(walkRoot);
2456
+ while (currentNode = nodeIterator.nextNode()) {
2457
+ _sanitizeElements(currentNode, walkRoot);
2458
+ _sanitizeAttributes(currentNode, walkRoot);
2459
+ if (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);
2460
+ }
2461
+ if (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);
2462
+ } catch (error) {
2463
+ if (inPlace) {
2464
+ _neutralizeRoot(dirty);
2465
+ _neutralizeDiscarded(dirty, inPlaceNodes);
2466
+ }
2467
+ throw error;
2468
+ } finally {
2469
+ IN_PLACE_VISITED = outerVisited;
2470
+ }
2471
+ if (inPlace) {
2472
+ if (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
2473
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);
2474
+ return dirty;
2475
+ }
2476
+ if (RETURN_DOM) {
2477
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);
2478
+ if (RETURN_DOM_FRAGMENT) {
2479
+ returnNode = createDocumentFragment.call(body.ownerDocument);
2480
+ while (body.firstChild) returnNode.appendChild(body.firstChild);
2481
+ } else returnNode = body;
2482
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
2483
+ return returnNode;
2484
+ }
2485
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
2486
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
2487
+ if (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);
2488
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
2489
+ };
2490
+ DOMPurify.setConfig = function() {
2491
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2492
+ _parseConfig(cfg);
2493
+ SET_CONFIG = true;
2494
+ SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
2495
+ SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
2496
+ };
2497
+ DOMPurify.clearConfig = function() {
2498
+ CONFIG = null;
2499
+ SET_CONFIG = false;
2500
+ SET_CONFIG_ALLOWED_TAGS = null;
2501
+ SET_CONFIG_ALLOWED_ATTR = null;
2502
+ trustedTypesPolicy = defaultTrustedTypesPolicy;
2503
+ emptyHTML = "";
2504
+ };
2505
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
2506
+ if (!CONFIG) _parseConfig({});
2507
+ const lcTag = transformCaseFunc(tag);
2508
+ const lcName = transformCaseFunc(attr);
2509
+ if (typeof value === "string" && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;
2510
+ return _isValidAttribute(lcTag, lcName, value);
2511
+ };
2512
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
2513
+ if (typeof hookFunction !== "function") return;
2514
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2515
+ arrayPush(hooks[entryPoint], hookFunction);
2516
+ };
2517
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
2518
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2519
+ if (hookFunction !== void 0) {
2520
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
2521
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
2522
+ }
2523
+ return arrayPop(hooks[entryPoint]);
2524
+ };
2525
+ DOMPurify.removeHooks = function(entryPoint) {
2526
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2527
+ hooks[entryPoint] = [];
2528
+ };
2529
+ DOMPurify.removeAllHooks = function() {
2530
+ hooks = _createHooksMap();
2531
+ };
2532
+ return DOMPurify;
2533
+ }
2534
+ createDOMPurify();
2535
+ //#endregion
2536
+ //#region ../../node_modules/.pnpm/marked@18.0.13/node_modules/marked/lib/marked.esm.js
2537
+ /**
2538
+ * marked v18.0.13 - a markdown parser
2539
+ * Copyright (c) 2018-2026, MarkedJS. (MIT License)
2540
+ * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
2541
+ * https://github.com/markedjs/marked
2542
+ */
2543
+ /**
2544
+ * DO NOT EDIT THIS FILE
2545
+ * The code in this file is generated from files in ./src/
2546
+ */
2547
+ function A() {
2548
+ return {
2549
+ async: false,
2550
+ breaks: false,
2551
+ extensions: null,
2552
+ gfm: true,
2553
+ hooks: null,
2554
+ pedantic: false,
2555
+ renderer: null,
2556
+ silent: false,
2557
+ tokenizer: null,
2558
+ walkTokens: null
2559
+ };
2560
+ }
2561
+ var T = A();
2562
+ function U(l) {
2563
+ T = l;
2564
+ }
2565
+ var E = { exec: () => null };
2566
+ function I(l) {
2567
+ let e = [];
2568
+ return (t) => {
2569
+ let n = Math.max(0, Math.min(3, t - 1)), i = e[n];
2570
+ return i || (i = l(n), e[n] = i), i;
2571
+ };
2572
+ }
2573
+ function d(l, e = "") {
2574
+ let t = typeof l == "string" ? l : l.source, n = {
2575
+ replace: (i, r) => {
2576
+ let o = typeof r == "string" ? r : r.source;
2577
+ return o = o.replace(m.caret, "$1"), t = t.replace(i, o), n;
2578
+ },
2579
+ getRegex: () => new RegExp(t, e)
2580
+ };
2581
+ return n;
2582
+ }
2583
+ var we = ((l = "") => {
2584
+ try {
2585
+ return !!new RegExp("(?<=1)(?<!1)" + l);
2586
+ } catch {
2587
+ return false;
2588
+ }
2589
+ })();
2590
+ var m = {
2591
+ codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
2592
+ outputLinkReplace: /\\([\[\]])/g,
2593
+ indentCodeCompensation: /^(\s+)(?:```)/,
2594
+ beginningSpace: /^\s+/,
2595
+ endingHash: /#$/,
2596
+ startingSpaceChar: /^ /,
2597
+ endingSpaceChar: / $/,
2598
+ endingSpaceTabChar: /[ \t]$/,
2599
+ nonSpaceChar: /[^ ]/,
2600
+ newLineCharGlobal: /\n/g,
2601
+ tabCharGlobal: /\t/g,
2602
+ multipleSpaceGlobal: /\s+/g,
2603
+ blankLine: /^[ \t]*$/,
2604
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
2605
+ blockquoteStart: /^ {0,3}>/,
2606
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
2607
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
2608
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
2609
+ listIsTask: /^\[[ xX]\] +\S/,
2610
+ listReplaceTask: /^\[[ xX]\] +/,
2611
+ listTaskCheckbox: /\[[ xX]\]/,
2612
+ anyLine: /\n.*\n/,
2613
+ hrefBrackets: /^<(.*)>$/,
2614
+ tableDelimiter: /[:|]/,
2615
+ tableAlignChars: /^\||\| *$/g,
2616
+ tableRowBlankLine: /\n[ \t]*$/,
2617
+ tableAlignRight: /^ *-+: *$/,
2618
+ tableAlignCenter: /^ *:-+: *$/,
2619
+ tableAlignLeft: /^ *:-+ *$/,
2620
+ startATag: /^<a /i,
2621
+ endATag: /^<\/a>/i,
2622
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
2623
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
2624
+ startAngleBracket: /^</,
2625
+ endAngleBracket: />$/,
2626
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
2627
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
2628
+ escapeTest: /[&<>"']/,
2629
+ escapeReplace: /[&<>"']/g,
2630
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
2631
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
2632
+ caret: /(^|[^\[])\^/g,
2633
+ percentDecode: /%25/g,
2634
+ findPipe: /\|/g,
2635
+ splitPipe: / \|/,
2636
+ slashPipe: /\\\|/g,
2637
+ carriageReturn: /\r\n|\r/g,
2638
+ spaceLine: /^ +$/gm,
2639
+ notSpaceStart: /^\S*/,
2640
+ endingNewline: /\n$/,
2641
+ listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
2642
+ nextBulletRegex: I((l) => new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
2643
+ hrRegex: I((l) => new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
2644
+ fencesBeginRegex: I((l) => new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),
2645
+ headingBeginRegex: I((l) => new RegExp(`^ {0,${l}}#`)),
2646
+ htmlBeginRegex: I((l) => new RegExp(`^ {0,${l}}(?:</?(?:${H})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
2647
+ blockquoteBeginRegex: I((l) => new RegExp(`^ {0,${l}}>`))
2648
+ };
2649
+ var ye = /^(?:[ \t]*(?:\n|$))+/;
2650
+ var Pe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
2651
+ var Se = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
2652
+ var v = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
2653
+ var _e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
2654
+ var K = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
2655
+ var le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
2656
+ var ue = d(le).replace(/bull/g, K).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
2657
+ var $e = d(le).replace(/bull/g, K).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
2658
+ var W = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
2659
+ var Le = /^[^\n]+/;
2660
+ var X = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
2661
+ var ze = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", X).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
2662
+ var Ee = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, K).getRegex();
2663
+ var H = "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";
2664
+ var J = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
2665
+ var Me = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", J).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
2666
+ var pe = (l) => d(W).replace("hr", v).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
2667
+ var Ae = pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
2668
+ var Ie = pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
2669
+ var V = {
2670
+ blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ie).getRegex(),
2671
+ code: Pe,
2672
+ def: ze,
2673
+ fences: Se,
2674
+ heading: _e,
2675
+ hr: v,
2676
+ html: Me,
2677
+ lheading: ue,
2678
+ list: Ee,
2679
+ newline: ye,
2680
+ paragraph: Ae,
2681
+ table: E,
2682
+ text: Le
2683
+ };
2684
+ var ie = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
2685
+ var Be = {
2686
+ ...V,
2687
+ lheading: $e,
2688
+ table: ie,
2689
+ paragraph: d(W).replace("hr", v).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ie).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex()
2690
+ };
2691
+ var De = {
2692
+ ...V,
2693
+ html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", J).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(),
2694
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
2695
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
2696
+ fences: E,
2697
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
2698
+ paragraph: d(W).replace("hr", v).replace("heading", ` *#{1,6} *[^
2699
+ ]`).replace("lheading", ue).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2700
+ };
2701
+ var qe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
2702
+ var ve = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
2703
+ var ce = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
2704
+ var He = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
2705
+ var _ = /[\p{P}\p{S}]/u;
2706
+ var C = /[\s\p{P}\p{S}]/u;
2707
+ var Z = /[^\s\p{P}\p{S}]/u;
2708
+ var Ze = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, C).getRegex();
2709
+ var Ge = /[\p{Pi}\p{Ps}"']/u;
2710
+ var he = /(?!~)[\p{P}\p{S}]/u;
2711
+ var Qe = /(?!~)[\s\p{P}\p{S}]/u;
2712
+ var Ne = /(?:[^\s\p{P}\p{S}]|~)/u;
2713
+ var je = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", we ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
2714
+ var de = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
2715
+ var Ue = d(de, "u").replace(/punct/g, _).getRegex();
2716
+ var Fe = d(de, "u").replace(/punct/g, he).getRegex();
2717
+ var We = d(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Ge).replace(/punct/g, _).getRegex();
2718
+ var ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
2719
+ var Xe = d(ke, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
2720
+ var Je = d(ke, "gu").replace(/notPunctSpace/g, Ne).replace(/punctSpace/g, Qe).replace(/punct/g, he).getRegex();
2721
+ var Ye = d("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
2722
+ var et = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
2723
+ var nt = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
2724
+ var rt = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex();
2725
+ var it = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
2726
+ var ot = d(/\\(punct)/, "gu").replace(/punct/g, _).getRegex();
2727
+ var at = d(/^<(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();
2728
+ var lt = d(J).replace("(?:-->|$)", "-->").getRegex();
2729
+ var ut = d("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", lt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
2730
+ var ge = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
2731
+ var N = d(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", ge).getRegex();
2732
+ var pt = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", N).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
2733
+ var ct = d(/^!?\[(label)\]\[(ref)\]/).replace("label", N).replace("ref", X).getRegex();
2734
+ var ht = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", X).getRegex();
2735
+ var oe = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
2736
+ var dt = d(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", ge).getRegex();
2737
+ var kt = d("reflink|nolink(?!\\()", "g").replace("reflink", d(/^!?\[(label)\]\[(ref)\]/).replace("label", dt).replace("ref", oe).getRegex()).replace("nolink", d(/^!?\[(ref)\](?:\[\])?/).replace("ref", oe).getRegex()).getRegex();
2738
+ var ae = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
2739
+ var Y = {
2740
+ _backpedal: E,
2741
+ anyPunctuation: ot,
2742
+ autolink: at,
2743
+ blockSkip: je,
2744
+ br: ce,
2745
+ code: ve,
2746
+ del: E,
2747
+ delLDelim: E,
2748
+ delRDelim: E,
2749
+ emStrongLDelim: Ue,
2750
+ emStrongRDelimAst: Xe,
2751
+ emStrongRDelimUnd: et,
2752
+ escape: qe,
2753
+ link: pt,
2754
+ nolink: ht,
2755
+ punctuation: Ze,
2756
+ reflink: ct,
2757
+ reflinkSearch: kt,
2758
+ tag: ut,
2759
+ text: He,
2760
+ url: E
2761
+ };
2762
+ var gt = {
2763
+ ...Y,
2764
+ emStrongLDelim: We,
2765
+ emStrongRDelimAst: Ye,
2766
+ emStrongRDelimUnd: nt,
2767
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", N).getRegex(),
2768
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", N).getRegex()
2769
+ };
2770
+ var F = {
2771
+ ...Y,
2772
+ emStrongRDelimAst: Je,
2773
+ emStrongLDelim: Fe,
2774
+ delLDelim: rt,
2775
+ delRDelim: it,
2776
+ url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ae).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
2777
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2778
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2779
+ text: d(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ae).getRegex()
2780
+ };
2781
+ var ft = {
2782
+ ...F,
2783
+ br: d(ce).replace("{2,}", "*").getRegex(),
2784
+ text: d(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2785
+ };
2786
+ var G = {
2787
+ normal: V,
2788
+ gfm: Be,
2789
+ pedantic: De
2790
+ };
2791
+ var B = {
2792
+ normal: Y,
2793
+ gfm: F,
2794
+ breaks: ft,
2795
+ pedantic: gt
2796
+ };
2797
+ var mt = {
2798
+ "&": "&amp;",
2799
+ "<": "&lt;",
2800
+ ">": "&gt;",
2801
+ "\"": "&quot;",
2802
+ "'": "&#39;"
2803
+ };
2804
+ var fe = (l) => mt[l];
2805
+ function R(l, e) {
2806
+ if (e) {
2807
+ if (m.escapeTest.test(l)) return l.replace(m.escapeReplace, fe);
2808
+ } else if (m.escapeTestNoEncode.test(l)) return l.replace(m.escapeReplaceNoEncode, fe);
2809
+ return l;
2810
+ }
2811
+ function ee(l) {
2812
+ try {
2813
+ l = encodeURI(l).replace(m.percentDecode, "%");
2814
+ } catch {
2815
+ return null;
2816
+ }
2817
+ return l;
2818
+ }
2819
+ function te(l, e) {
2820
+ let n = l.replace(m.findPipe, (r, o, s) => {
2821
+ let u = false, a = o;
2822
+ for (; --a >= 0 && s[a] === "\\";) u = !u;
2823
+ return u ? "|" : " |";
2824
+ }).split(m.splitPipe), i = 0;
2825
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
2826
+ else for (; n.length < e;) n.push("");
2827
+ for (; i < n.length; i++) n[i] = n[i].trim().replace(m.slashPipe, "|");
2828
+ return n;
2829
+ }
2830
+ function $(l, e, t) {
2831
+ let n = l.length;
2832
+ if (n === 0) return "";
2833
+ let i = 0;
2834
+ for (; i < n;) {
2835
+ let r = l.charAt(n - i - 1);
2836
+ if (r === e && true) i++;
2837
+ else break;
2838
+ }
2839
+ return l.slice(0, n - i);
2840
+ }
2841
+ function ne(l) {
2842
+ let e = l.split(`
2843
+ `), t = e.length - 1;
2844
+ for (; t >= 0 && m.blankLine.test(e[t]);) t--;
2845
+ return e.length - t <= 2 ? l : e.slice(0, t + 1).join(`
2846
+ `);
2847
+ }
2848
+ function D(l) {
2849
+ return l.toLowerCase().toUpperCase().toLowerCase();
2850
+ }
2851
+ function me(l, e) {
2852
+ if (l.indexOf(e[1]) === -1) return -1;
2853
+ let t = 0;
2854
+ for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
2855
+ else if (l[n] === e[0]) t++;
2856
+ else if (l[n] === e[1] && (t--, t < 0)) return n;
2857
+ return t > 0 ? -2 : -1;
2858
+ }
2859
+ function xe(l, e = 0) {
2860
+ let t = e, n = "";
2861
+ for (let i of l) if (i === " ") {
2862
+ let r = 4 - t % 4;
2863
+ n += " ".repeat(r), t += r;
2864
+ } else n += i, t++;
2865
+ return n;
2866
+ }
2867
+ function be(l, e, t, n, i) {
2868
+ let r = e.href, o = e.title || null, s = l[1].replace(i.other.outputLinkReplace, "$1"), u = l[0].charAt(0) === "!";
2869
+ n.state.inLink = true;
2870
+ let a = n.state.linkEmitted, p = n.state.inRawBlock;
2871
+ n.state.linkEmitted = false;
2872
+ let c = n.inlineTokens(s), h = n.state.linkEmitted;
2873
+ if (n.state.linkEmitted = a, n.state.inLink = false, !u) {
2874
+ if (h) {
2875
+ n.state.inRawBlock = p;
2876
+ return;
2877
+ }
2878
+ n.state.linkEmitted = true;
2879
+ }
2880
+ return {
2881
+ type: u ? "image" : "link",
2882
+ raw: t,
2883
+ href: r,
2884
+ title: o,
2885
+ text: s,
2886
+ tokens: c
2887
+ };
2888
+ }
2889
+ function xt(l, e, t) {
2890
+ let n = l.match(t.other.indentCodeCompensation);
2891
+ if (n === null) return e;
2892
+ let i = n[1];
2893
+ return e.split(`
2894
+ `).map((r) => {
2895
+ let o = r.match(t.other.beginningSpace);
2896
+ if (o === null) return r;
2897
+ let [s] = o;
2898
+ return r.slice(Math.min(s.length, i.length));
2899
+ }).join(`
2900
+ `);
2901
+ }
2902
+ function Re(l, e, t, n) {
2903
+ if (!e.includes("<")) return false;
2904
+ for (let i = 0; i < e.length; i++) {
2905
+ if (e[i] === "\\") {
2906
+ i++;
2907
+ continue;
2908
+ }
2909
+ if (e[i] === "`") {
2910
+ let s = n.inline.code.exec(e.slice(i));
2911
+ if (s) {
2912
+ i += s[0].length - 1;
2913
+ continue;
2914
+ }
2915
+ }
2916
+ if (e[i] !== "<") continue;
2917
+ let r = l.slice(t + i), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
2918
+ if (o) {
2919
+ if (o[0].length > e.length - i) return true;
2920
+ i += o[0].length - 1;
2921
+ }
2922
+ }
2923
+ return false;
2924
+ }
2925
+ var y = class {
2926
+ options;
2927
+ rules;
2928
+ lexer;
2929
+ constructor(e) {
2930
+ this.options = e || T;
2931
+ }
2932
+ space(e) {
2933
+ let t = this.rules.block.newline.exec(e);
2934
+ if (t && t[0].length > 0) return {
2935
+ type: "space",
2936
+ raw: t[0]
2937
+ };
2938
+ }
2939
+ code(e) {
2940
+ let t = this.rules.block.code.exec(e);
2941
+ if (t) {
2942
+ let n = this.options.pedantic ? t[0] : ne(t[0]);
2943
+ return {
2944
+ type: "code",
2945
+ raw: n,
2946
+ codeBlockStyle: "indented",
2947
+ text: n.replace(this.rules.other.codeRemoveIndent, "")
2948
+ };
2949
+ }
2950
+ }
2951
+ fences(e) {
2952
+ let t = this.rules.block.fences.exec(e);
2953
+ if (t) {
2954
+ let n = t[0], i = xt(n, t[3] || "", this.rules);
2955
+ return {
2956
+ type: "code",
2957
+ raw: n,
2958
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
2959
+ text: i
2960
+ };
2961
+ }
2962
+ }
2963
+ heading(e) {
2964
+ let t = this.rules.block.heading.exec(e);
2965
+ if (t) {
2966
+ let n = t[2].trim();
2967
+ if (this.rules.other.endingHash.test(n)) {
2968
+ let i = $(n, "#");
2969
+ (this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
2970
+ }
2971
+ return {
2972
+ type: "heading",
2973
+ raw: $(t[0], `
2974
+ `),
2975
+ depth: t[1].length,
2976
+ text: n,
2977
+ tokens: this.lexer.inline(n)
2978
+ };
2979
+ }
2980
+ }
2981
+ hr(e) {
2982
+ let t = this.rules.block.hr.exec(e);
2983
+ if (t) return {
2984
+ type: "hr",
2985
+ raw: $(t[0], `
2986
+ `)
2987
+ };
2988
+ }
2989
+ blockquote(e) {
2990
+ let t = this.rules.block.blockquote.exec(e);
2991
+ if (t) {
2992
+ let n = $(t[0], `
2993
+ `).split(`
2994
+ `), i = "", r = "", o = [];
2995
+ for (; n.length > 0;) {
2996
+ let s = false, u = [], a = 0;
2997
+ for (; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), s = true;
2998
+ else if (!s) u.push(n[a]);
2999
+ else break;
3000
+ n = n.slice(a);
3001
+ let p = u.join(`
3002
+ `), c = p.replace(this.rules.other.blockquoteSetextReplace, `
3003
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
3004
+ i = i ? `${i}
3005
+ ${p}` : p, r = r ? `${r}
3006
+ ${c}` : c;
3007
+ let h = this.lexer.state.top;
3008
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c, o, true), this.lexer.state.top = h, n.length === 0) break;
3009
+ let k = o.at(-1);
3010
+ if (k?.type === "code") break;
3011
+ if (k?.type === "blockquote") {
3012
+ let O = k, g = n.join(`
3013
+ `), w = O.raw + `
3014
+ ` + g.replace(this.rules.other.blockquoteSetextReplace2, ""), z = this.blockquote(w);
3015
+ o[o.length - 1] = z, i = `${i}
3016
+ ${g}`, r = r.substring(0, r.length - O.text.length) + z.text;
3017
+ break;
3018
+ } else if (k?.type === "list") {
3019
+ let O = k, g = O.raw + `
3020
+ ` + n.join(`
3021
+ `), w = this.list(g);
3022
+ o[o.length - 1] = w, i = i.substring(0, i.length - k.raw.length) + w.raw, r = r.substring(0, r.length - O.raw.length) + w.raw, n = g.substring(o.at(-1).raw.length).split(`
3023
+ `);
3024
+ continue;
3025
+ }
3026
+ }
3027
+ return {
3028
+ type: "blockquote",
3029
+ raw: i,
3030
+ tokens: o,
3031
+ text: r
3032
+ };
3033
+ }
3034
+ }
3035
+ list(e) {
3036
+ let t = this.rules.block.list.exec(e);
3037
+ if (t) {
3038
+ let n = t[1].trim(), i = n.length > 1, r = {
3039
+ type: "list",
3040
+ raw: "",
3041
+ ordered: i,
3042
+ start: i ? +n.slice(0, -1) : "",
3043
+ loose: false,
3044
+ items: []
3045
+ };
3046
+ n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
3047
+ let o = this.rules.other.listItemRegex(n), s = false;
3048
+ for (; e;) {
3049
+ let a = false, p = "", c = "";
3050
+ if (!(t = o.exec(e)) || this.rules.block.hr.test(e)) break;
3051
+ p = t[0], e = e.substring(p.length);
3052
+ let h = xe(t[2].split(`
3053
+ `, 1)[0], t[1].length), k = e.split(`
3054
+ `, 1)[0], O = !h.trim(), g = 0;
3055
+ if (this.options.pedantic ? (g = 2, c = h.trimStart()) : O ? g = t[1].length + 1 : (g = h.search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, c = h.slice(g), g += t[1].length), O && this.rules.other.blankLine.test(k) && (p += k + `
3056
+ `, e = e.substring(k.length + 1), a = true), !a) {
3057
+ let w = this.rules.other.nextBulletRegex(g), z = this.rules.other.hrRegex(g), re = this.rules.other.fencesBeginRegex(g), se = this.rules.other.headingBeginRegex(g), Te = this.rules.other.htmlBeginRegex(g), Oe = this.rules.other.blockquoteBeginRegex(g);
3058
+ for (; e;) {
3059
+ let j = e.split(`
3060
+ `, 1)[0], q;
3061
+ if (k = j, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), q = k) : q = k.replace(this.rules.other.tabCharGlobal, " "), re.test(k) || se.test(k) || Te.test(k) || Oe.test(k) || w.test(k) || z.test(k)) break;
3062
+ if (q.search(this.rules.other.nonSpaceChar) >= g || !k.trim()) c += `
3063
+ ` + q.slice(g);
3064
+ else {
3065
+ if (O || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || re.test(h) || se.test(h) || z.test(h)) break;
3066
+ c += `
3067
+ ` + k;
3068
+ }
3069
+ O = !k.trim(), p += j + `
3070
+ `, e = e.substring(j.length + 1), h = q.slice(g);
3071
+ }
3072
+ }
3073
+ r.loose || (s ? r.loose = true : this.rules.other.doubleBlankLine.test(p) && (s = true)), r.items.push({
3074
+ type: "list_item",
3075
+ raw: p,
3076
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(c),
3077
+ loose: false,
3078
+ text: c,
3079
+ tokens: []
3080
+ }), r.raw += p;
3081
+ }
3082
+ let u = r.items.at(-1);
3083
+ if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
3084
+ else return;
3085
+ r.raw = r.raw.trimEnd();
3086
+ for (let a of r.items) if (this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []), !r.loose) {
3087
+ let p = a.tokens.filter((h) => h.type === "space");
3088
+ r.loose = p.length > 0 && p.some((h) => this.rules.other.anyLine.test(h.raw));
3089
+ }
3090
+ for (let a of r.items) {
3091
+ let p = a.tokens[0];
3092
+ if (a.task && (p?.type === "text" || p?.type === "paragraph")) {
3093
+ a.text = a.text.replace(this.rules.other.listReplaceTask, ""), p.raw = p.raw.replace(this.rules.other.listReplaceTask, ""), p.text = p.text.replace(this.rules.other.listReplaceTask, "");
3094
+ for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) {
3095
+ this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, "");
3096
+ break;
3097
+ }
3098
+ let c = this.rules.other.listTaskCheckbox.exec(a.raw);
3099
+ if (c) {
3100
+ let h = {
3101
+ type: "checkbox",
3102
+ raw: c[0] + " ",
3103
+ checked: c[0] !== "[ ]"
3104
+ };
3105
+ a.checked = h.checked, r.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = h.raw + a.tokens[0].raw, a.tokens[0].text = h.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(h)) : a.tokens.unshift({
3106
+ type: "paragraph",
3107
+ raw: h.raw,
3108
+ text: h.raw,
3109
+ tokens: [h]
3110
+ }) : a.tokens.unshift(h);
3111
+ }
3112
+ } else a.task && (a.task = false);
3113
+ }
3114
+ if (r.loose) for (let a of r.items) {
3115
+ a.loose = true;
3116
+ for (let p of a.tokens) p.type === "text" && (p.type = "paragraph");
3117
+ }
3118
+ return r;
3119
+ }
3120
+ }
3121
+ html(e) {
3122
+ let t = this.rules.block.html.exec(e);
3123
+ if (t) {
3124
+ let n = ne(t[0]);
3125
+ return {
3126
+ type: "html",
3127
+ block: true,
3128
+ raw: n,
3129
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
3130
+ text: n
3131
+ };
3132
+ }
3133
+ }
3134
+ def(e) {
3135
+ let t = this.rules.block.def.exec(e);
3136
+ if (t) {
3137
+ let n = D(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = 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];
3138
+ return {
3139
+ type: "def",
3140
+ tag: n,
3141
+ raw: $(t[0], `
3142
+ `),
3143
+ href: i,
3144
+ title: r
3145
+ };
3146
+ }
3147
+ }
3148
+ table(e) {
3149
+ let t = this.rules.block.table.exec(e);
3150
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
3151
+ let n = te(t[1]), i = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
3152
+ `) : [], o = {
3153
+ type: "table",
3154
+ raw: $(t[0], `
3155
+ `),
3156
+ header: [],
3157
+ align: [],
3158
+ rows: []
3159
+ };
3160
+ if (n.length === i.length) {
3161
+ for (let s of i) this.rules.other.tableAlignRight.test(s) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o.align.push("left") : o.align.push(null);
3162
+ for (let s = 0; s < n.length; s++) o.header.push({
3163
+ text: n[s],
3164
+ tokens: this.lexer.inline(n[s]),
3165
+ header: true,
3166
+ align: o.align[s]
3167
+ });
3168
+ for (let s of r) o.rows.push(te(s, o.header.length).map((u, a) => ({
3169
+ text: u,
3170
+ tokens: this.lexer.inline(u),
3171
+ header: false,
3172
+ align: o.align[a]
3173
+ })));
3174
+ return o;
3175
+ }
3176
+ }
3177
+ lheading(e) {
3178
+ let t = this.rules.block.lheading.exec(e);
3179
+ if (t) {
3180
+ let n = t[1].trim();
3181
+ return {
3182
+ type: "heading",
3183
+ raw: $(t[0], `
3184
+ `),
3185
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
3186
+ text: n,
3187
+ tokens: this.lexer.inline(n)
3188
+ };
3189
+ }
3190
+ }
3191
+ paragraph(e) {
3192
+ let t = this.rules.block.paragraph.exec(e);
3193
+ if (t) {
3194
+ let n = t[1].charAt(t[1].length - 1) === `
3195
+ ` ? t[1].slice(0, -1) : t[1];
3196
+ return {
3197
+ type: "paragraph",
3198
+ raw: t[0],
3199
+ text: n,
3200
+ tokens: this.lexer.inline(n)
3201
+ };
3202
+ }
3203
+ }
3204
+ text(e) {
3205
+ let t = this.rules.block.text.exec(e);
3206
+ if (t) return {
3207
+ type: "text",
3208
+ raw: t[0],
3209
+ text: t[0],
3210
+ tokens: this.lexer.inline(t[0])
3211
+ };
3212
+ }
3213
+ escape(e) {
3214
+ let t = this.rules.inline.escape.exec(e);
3215
+ if (t) return {
3216
+ type: "escape",
3217
+ raw: t[0],
3218
+ text: t[1]
3219
+ };
3220
+ }
3221
+ tag(e) {
3222
+ let t = this.rules.inline.tag.exec(e);
3223
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), {
3224
+ type: "html",
3225
+ raw: t[0],
3226
+ inLink: this.lexer.state.inLink,
3227
+ inRawBlock: this.lexer.state.inRawBlock,
3228
+ block: false,
3229
+ text: t[0]
3230
+ };
3231
+ }
3232
+ link(e) {
3233
+ let t = this.rules.inline.link.exec(e);
3234
+ if (t) {
3235
+ let n = t[0].charAt(0) === "!" ? 2 : 1;
3236
+ if (!this.options.pedantic && Re(e, t[1], n, this.rules)) return;
3237
+ let i = t[2].trim();
3238
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
3239
+ if (!this.rules.other.endAngleBracket.test(i)) return;
3240
+ let s = $(i.slice(0, -1), "\\");
3241
+ if ((i.length - s.length) % 2 === 0) return;
3242
+ } else {
3243
+ let s = me(t[2], "()");
3244
+ if (s === -2) return;
3245
+ if (s > -1) {
3246
+ let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
3247
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, a).trim(), t[3] = "";
3248
+ }
3249
+ }
3250
+ let r = t[2], o = "";
3251
+ if (this.options.pedantic) {
3252
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
3253
+ s && (r = s[1], o = s[3]);
3254
+ } else o = t[3] ? t[3].slice(1, -1) : "";
3255
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? r = r.slice(1) : r = r.slice(1, -1)), be(t, {
3256
+ href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
3257
+ title: o && o.replace(this.rules.inline.anyPunctuation, "$1")
3258
+ }, t[0], this.lexer, this.rules);
3259
+ }
3260
+ }
3261
+ reflink(e, t) {
3262
+ let n;
3263
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
3264
+ let i = n[0].charAt(0) === "!" ? 2 : 1;
3265
+ if (!this.options.pedantic && Re(e, n[1], i, this.rules)) return;
3266
+ let o = t[D((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
3267
+ if (!o) {
3268
+ let s = n[0].charAt(0);
3269
+ return {
3270
+ type: "text",
3271
+ raw: s,
3272
+ text: s
3273
+ };
3274
+ }
3275
+ return be(n, o, n[0], this.lexer, this.rules);
3276
+ }
3277
+ }
3278
+ emStrong(e, t, n = "") {
3279
+ let i = this.rules.inline.emStrongLDelim.exec(e);
3280
+ if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
3281
+ if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
3282
+ let o = [...i[0]].length - 1, s, u, a = o, p = 0, c = i[0][0], h = n === c, k = c === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
3283
+ for (k.lastIndex = 0, t = t.slice(-1 * e.length + o); (i = k.exec(t)) !== null;) {
3284
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s) continue;
3285
+ if (u = [...s].length, i[3] || i[4]) {
3286
+ a += u;
3287
+ continue;
3288
+ } else if (i[5] || i[6]) {
3289
+ if (o % 3 && !((o + u) % 3)) {
3290
+ p += u;
3291
+ continue;
3292
+ }
3293
+ if (h) break;
3294
+ }
3295
+ if (a -= u, a > 0) continue;
3296
+ u = Math.min(u, u + a + p);
3297
+ let O = [...i[0]][0].length, g = e.slice(0, o + i.index + O + u);
3298
+ if (Math.min(o, u) % 2) {
3299
+ let z = g.slice(1, -1);
3300
+ return {
3301
+ type: "em",
3302
+ raw: g,
3303
+ text: z,
3304
+ tokens: this.lexer.inlineTokens(z)
3305
+ };
3306
+ }
3307
+ let w = g.slice(2, -2);
3308
+ return {
3309
+ type: "strong",
3310
+ raw: g,
3311
+ text: w,
3312
+ tokens: this.lexer.inlineTokens(w)
3313
+ };
3314
+ }
3315
+ }
3316
+ }
3317
+ codespan(e) {
3318
+ let t = this.rules.inline.code.exec(e);
3319
+ if (t) {
3320
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
3321
+ return i && r && (n = n.substring(1, n.length - 1)), {
3322
+ type: "codespan",
3323
+ raw: t[0],
3324
+ text: n
3325
+ };
3326
+ }
3327
+ }
3328
+ br(e) {
3329
+ let t = this.rules.inline.br.exec(e);
3330
+ if (t) return {
3331
+ type: "br",
3332
+ raw: t[0]
3333
+ };
3334
+ }
3335
+ del(e, t, n = "") {
3336
+ let i = this.rules.inline.delLDelim.exec(e);
3337
+ if (!i) return;
3338
+ if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
3339
+ let o = [...i[0]].length - 1, s, u, a = o, p = this.rules.inline.delRDelim;
3340
+ for (p.lastIndex = 0, t = t.slice(-1 * e.length + o); (i = p.exec(t)) !== null;) {
3341
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (u = [...s].length, u !== o)) continue;
3342
+ if (i[3] || i[4]) {
3343
+ a += u;
3344
+ continue;
3345
+ }
3346
+ if (a -= u, a > 0) continue;
3347
+ u = Math.min(u, u + a);
3348
+ let c = [...i[0]][0].length, h = e.slice(0, o + i.index + c + u), k = h.slice(o, -o);
3349
+ return {
3350
+ type: "del",
3351
+ raw: h,
3352
+ text: k,
3353
+ tokens: this.lexer.inlineTokens(k)
3354
+ };
3355
+ }
3356
+ }
3357
+ }
3358
+ autolink(e) {
3359
+ let t = this.rules.inline.autolink.exec(e);
3360
+ if (t) {
3361
+ let n, i;
3362
+ return t[2] === "@" ? (n = t[1], i = "mailto:" + n) : (n = t[1], i = n), {
3363
+ type: "link",
3364
+ raw: t[0],
3365
+ text: n,
3366
+ href: i,
3367
+ autolink: true,
3368
+ tokens: [{
3369
+ type: "text",
3370
+ raw: n,
3371
+ text: n
3372
+ }]
3373
+ };
3374
+ }
3375
+ }
3376
+ url(e) {
3377
+ let t;
3378
+ if (t = this.rules.inline.url.exec(e)) {
3379
+ let n, i;
3380
+ if (t[2] === "@") n = t[0], i = "mailto:" + n;
3381
+ else {
3382
+ let r;
3383
+ do
3384
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
3385
+ while (r !== t[0]);
3386
+ n = t[0], t[1] === "www." ? i = "http://" + t[0] : i = t[0];
3387
+ }
3388
+ return {
3389
+ type: "link",
3390
+ raw: t[0],
3391
+ text: n,
3392
+ href: i,
3393
+ autolink: true,
3394
+ tokens: [{
3395
+ type: "text",
3396
+ raw: n,
3397
+ text: n
3398
+ }]
3399
+ };
3400
+ }
3401
+ }
3402
+ inlineText(e) {
3403
+ let t = this.rules.inline.text.exec(e);
3404
+ if (t) {
3405
+ let n = this.lexer.state.inRawBlock;
3406
+ return {
3407
+ type: "text",
3408
+ raw: t[0],
3409
+ text: t[0],
3410
+ escaped: n
3411
+ };
3412
+ }
3413
+ }
3414
+ };
3415
+ var x = class l {
3416
+ tokens;
3417
+ options;
3418
+ state;
3419
+ inlineQueue;
3420
+ tokenizer;
3421
+ constructor(e) {
3422
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
3423
+ inLink: false,
3424
+ inRawBlock: false,
3425
+ linkEmitted: false,
3426
+ top: true
3427
+ };
3428
+ let t = {
3429
+ other: m,
3430
+ block: G.normal,
3431
+ inline: B.normal
3432
+ };
3433
+ this.options.pedantic ? (t.block = G.pedantic, t.inline = B.pedantic) : this.options.gfm && (t.block = G.gfm, this.options.breaks ? t.inline = B.breaks : t.inline = B.gfm), this.tokenizer.rules = t;
3434
+ }
3435
+ static get rules() {
3436
+ return {
3437
+ block: G,
3438
+ inline: B
3439
+ };
3440
+ }
3441
+ static lex(e, t) {
3442
+ return new l(t).lex(e);
3443
+ }
3444
+ static lexInline(e, t) {
3445
+ return new l(t).inlineTokens(e);
3446
+ }
3447
+ lex(e) {
3448
+ e = e.replace(m.carriageReturn, `
3449
+ `), this.blockTokens(e, this.tokens);
3450
+ for (let t = 0; t < this.inlineQueue.length; t++) {
3451
+ let n = this.inlineQueue[t];
3452
+ this.inlineTokens(n.src, n.tokens);
3453
+ }
3454
+ return this.inlineQueue = [], this.tokens;
3455
+ }
3456
+ blockTokens(e, t = [], n = false) {
3457
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, ""));
3458
+ let i = 1 / 0;
3459
+ for (; e;) {
3460
+ if (e.length < i) i = e.length;
3461
+ else {
3462
+ this.infiniteLoopError(e.charCodeAt(0));
3463
+ break;
3464
+ }
3465
+ let r;
3466
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
3467
+ if (r = this.tokenizer.space(e)) {
3468
+ e = e.substring(r.raw.length);
3469
+ let s = t.at(-1);
3470
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
3471
+ ` : t.push(r);
3472
+ continue;
3473
+ }
3474
+ if (r = this.tokenizer.code(e)) {
3475
+ e = e.substring(r.raw.length);
3476
+ let s = t.at(-1);
3477
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
3478
+ `) ? "" : `
3479
+ `) + r.raw, s.text += `
3480
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
3481
+ continue;
3482
+ }
3483
+ if (r = this.tokenizer.fences(e)) {
3484
+ e = e.substring(r.raw.length), t.push(r);
3485
+ continue;
3486
+ }
3487
+ if (r = this.tokenizer.heading(e)) {
3488
+ e = e.substring(r.raw.length), t.push(r);
3489
+ continue;
3490
+ }
3491
+ if (r = this.tokenizer.hr(e)) {
3492
+ e = e.substring(r.raw.length), t.push(r);
3493
+ continue;
3494
+ }
3495
+ if (r = this.tokenizer.blockquote(e)) {
3496
+ e = e.substring(r.raw.length), t.push(r);
3497
+ continue;
3498
+ }
3499
+ if (r = this.tokenizer.list(e)) {
3500
+ e = e.substring(r.raw.length), t.push(r);
3501
+ continue;
3502
+ }
3503
+ if (r = this.tokenizer.html(e)) {
3504
+ e = e.substring(r.raw.length), t.push(r);
3505
+ continue;
3506
+ }
3507
+ if (r = this.tokenizer.def(e)) {
3508
+ e = e.substring(r.raw.length);
3509
+ let s = t.at(-1);
3510
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
3511
+ `) ? "" : `
3512
+ `) + r.raw, s.text += `
3513
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
3514
+ href: r.href,
3515
+ title: r.title
3516
+ }, t.push(r));
3517
+ continue;
3518
+ }
3519
+ if (r = this.tokenizer.table(e)) {
3520
+ e = e.substring(r.raw.length), t.push(r);
3521
+ continue;
3522
+ }
3523
+ if (r = this.tokenizer.lheading(e)) {
3524
+ e = e.substring(r.raw.length), t.push(r);
3525
+ continue;
3526
+ }
3527
+ let o = e;
3528
+ if (this.options.extensions?.startBlock) {
3529
+ let s = 1 / 0, u = e.slice(1), a;
3530
+ this.options.extensions.startBlock.forEach((p) => {
3531
+ a = p.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
3532
+ }), s < 1 / 0 && s >= 0 && (o = e.substring(0, s + 1));
3533
+ }
3534
+ if (this.state.top && (r = this.tokenizer.paragraph(o))) {
3535
+ let s = t.at(-1);
3536
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
3537
+ `) ? "" : `
3538
+ `) + r.raw, s.text += `
3539
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
3540
+ continue;
3541
+ }
3542
+ if (r = this.tokenizer.text(e)) {
3543
+ e = e.substring(r.raw.length);
3544
+ let s = t.at(-1);
3545
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
3546
+ `) ? "" : `
3547
+ `) + r.raw, s.text += `
3548
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
3549
+ continue;
3550
+ }
3551
+ if (e) {
3552
+ this.infiniteLoopError(e.charCodeAt(0));
3553
+ break;
3554
+ }
3555
+ }
3556
+ return this.state.top = true, t;
3557
+ }
3558
+ inline(e, t = []) {
3559
+ return this.inlineQueue.push({
3560
+ src: e,
3561
+ tokens: t
3562
+ }), t;
3563
+ }
3564
+ linkInText(e) {
3565
+ if (!e.includes("[")) return false;
3566
+ let t = this.tokenizer.rules.inline.link;
3567
+ for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return true;
3568
+ for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
3569
+ let i = n[0], r = i.lastIndexOf("[");
3570
+ if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, D(i.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(i.slice(1, r - 1)))) return true;
3571
+ }
3572
+ return false;
3573
+ }
3574
+ inlineTokens(e, t = []) {
3575
+ this.tokenizer.lexer = this;
3576
+ let n = e;
3577
+ if (this.tokens.links && e.includes("[")) {
3578
+ let s = this.tokenizer.rules.inline.reflinkSearch, u = (a) => {
3579
+ let p = a.lastIndexOf("[");
3580
+ if (!Object.hasOwn(this.tokens.links, D(a.slice(p + 1, -1)))) return a;
3581
+ if (p > 1 && a.charAt(0) !== "!") {
3582
+ let c = a.slice(1, p - 1);
3583
+ if (this.linkInText(c)) return "[" + c.replace(s, u) + "][" + "a".repeat(a.length - p - 2) + "]";
3584
+ }
3585
+ return "[" + "a".repeat(a.length - 2) + "]";
3586
+ };
3587
+ n = n.replace(s, u);
3588
+ }
3589
+ n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (s) => "+".repeat(s.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, u, a) => {
3590
+ let p = a ? a.length : 0;
3591
+ return s.slice(0, p) + "[" + "a".repeat(s.length - p - 2) + "]";
3592
+ }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
3593
+ let i = false, r = "", o = 1 / 0;
3594
+ for (; e;) {
3595
+ if (e.length < o) o = e.length;
3596
+ else {
3597
+ this.infiniteLoopError(e.charCodeAt(0));
3598
+ break;
3599
+ }
3600
+ i || (r = ""), i = false;
3601
+ let s;
3602
+ if (this.options.extensions?.inline?.some((a) => (s = a.call({ lexer: this }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), true) : false)) continue;
3603
+ if (s = this.tokenizer.escape(e)) {
3604
+ e = e.substring(s.raw.length), t.push(s);
3605
+ continue;
3606
+ }
3607
+ if (s = this.tokenizer.tag(e)) {
3608
+ e = e.substring(s.raw.length), t.push(s);
3609
+ continue;
3610
+ }
3611
+ if (s = this.tokenizer.link(e)) {
3612
+ e = e.substring(s.raw.length), t.push(s);
3613
+ continue;
3614
+ }
3615
+ if (s = this.tokenizer.reflink(e, this.tokens.links)) {
3616
+ e = e.substring(s.raw.length);
3617
+ let a = t.at(-1);
3618
+ s.type === "text" && a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t.push(s);
3619
+ continue;
3620
+ }
3621
+ if (s = this.tokenizer.emStrong(e, n, r)) {
3622
+ e = e.substring(s.raw.length), t.push(s);
3623
+ continue;
3624
+ }
3625
+ if (s = this.tokenizer.codespan(e)) {
3626
+ e = e.substring(s.raw.length), t.push(s);
3627
+ continue;
3628
+ }
3629
+ if (s = this.tokenizer.br(e)) {
3630
+ e = e.substring(s.raw.length), t.push(s);
3631
+ continue;
3632
+ }
3633
+ if (s = this.tokenizer.del(e, n, r)) {
3634
+ e = e.substring(s.raw.length), t.push(s);
3635
+ continue;
3636
+ }
3637
+ if (s = this.tokenizer.autolink(e)) {
3638
+ e = e.substring(s.raw.length), t.push(s);
3639
+ continue;
3640
+ }
3641
+ if (!this.state.inLink && (s = this.tokenizer.url(e))) {
3642
+ e = e.substring(s.raw.length), t.push(s);
3643
+ continue;
3644
+ }
3645
+ let u = e;
3646
+ if (this.options.extensions?.startInline) {
3647
+ let a = 1 / 0, p = e.slice(1), c;
3648
+ this.options.extensions.startInline.forEach((h) => {
3649
+ c = h.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
3650
+ }), a < 1 / 0 && a >= 0 && (u = e.substring(0, a + 1));
3651
+ }
3652
+ if (s = this.tokenizer.inlineText(u)) {
3653
+ e = e.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r = s.raw.slice(-1)), i = true;
3654
+ let a = t.at(-1);
3655
+ a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t.push(s);
3656
+ continue;
3657
+ }
3658
+ if (e) {
3659
+ this.infiniteLoopError(e.charCodeAt(0));
3660
+ break;
3661
+ }
3662
+ }
3663
+ return t;
3664
+ }
3665
+ infiniteLoopError(e) {
3666
+ let t = "Infinite loop on byte: " + e;
3667
+ if (this.options.silent) console.error(t);
3668
+ else throw new Error(t);
3669
+ }
3670
+ };
3671
+ var P = class {
3672
+ options;
3673
+ parser;
3674
+ constructor(e) {
3675
+ this.options = e || T;
3676
+ }
3677
+ space(e) {
3678
+ return "";
3679
+ }
3680
+ code({ text: e, lang: t, escaped: n }) {
3681
+ let i = (t || "").match(m.notSpaceStart)?.[0], r = e ? e.replace(m.endingNewline, "") + `
3682
+ ` : "";
3683
+ return i ? "<pre><code class=\"language-" + R(i) + "\">" + (n ? r : R(r, true)) + `</code></pre>
3684
+ ` : "<pre><code>" + (n ? r : R(r, true)) + `</code></pre>
3685
+ `;
3686
+ }
3687
+ blockquote({ tokens: e }) {
3688
+ return `<blockquote>
3689
+ ${this.parser.parse(e)}</blockquote>
3690
+ `;
3691
+ }
3692
+ html({ text: e }) {
3693
+ return e;
3694
+ }
3695
+ def(e) {
3696
+ return "";
3697
+ }
3698
+ heading({ tokens: e, depth: t }) {
3699
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
3700
+ `;
3701
+ }
3702
+ hr(e) {
3703
+ return `<hr>
3704
+ `;
3705
+ }
3706
+ list(e) {
3707
+ let t = e.ordered, n = e.start, i = "";
3708
+ for (let s = 0; s < e.items.length; s++) {
3709
+ let u = e.items[s];
3710
+ i += this.listitem(u);
3711
+ }
3712
+ let r = t ? "ol" : "ul", o = t && n !== 1 ? " start=\"" + n + "\"" : "";
3713
+ return "<" + r + o + `>
3714
+ ` + i + "</" + r + `>
3715
+ `;
3716
+ }
3717
+ listitem(e) {
3718
+ return `<li>${this.parser.parse(e.tokens)}</li>
3719
+ `;
3720
+ }
3721
+ checkbox({ checked: e }) {
3722
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
3723
+ }
3724
+ paragraph({ tokens: e }) {
3725
+ return `<p>${this.parser.parseInline(e)}</p>
3726
+ `;
3727
+ }
3728
+ table(e) {
3729
+ let t = "", n = "";
3730
+ for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
3731
+ t += this.tablerow({ text: n });
3732
+ let i = "";
3733
+ for (let r = 0; r < e.rows.length; r++) {
3734
+ let o = e.rows[r];
3735
+ n = "";
3736
+ for (let s = 0; s < o.length; s++) n += this.tablecell(o[s]);
3737
+ i += this.tablerow({ text: n });
3738
+ }
3739
+ return i && (i = `<tbody>${i}</tbody>`), `<table>
3740
+ <thead>
3741
+ ` + t + `</thead>
3742
+ ` + i + `</table>
3743
+ `;
3744
+ }
3745
+ tablerow({ text: e }) {
3746
+ return `<tr>
3747
+ ${e}</tr>
3748
+ `;
3749
+ }
3750
+ tablecell(e) {
3751
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
3752
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
3753
+ `;
3754
+ }
3755
+ strong({ tokens: e }) {
3756
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
3757
+ }
3758
+ em({ tokens: e }) {
3759
+ return `<em>${this.parser.parseInline(e)}</em>`;
3760
+ }
3761
+ codespan({ text: e }) {
3762
+ return `<code>${R(e, true)}</code>`;
3763
+ }
3764
+ br(e) {
3765
+ return "<br>";
3766
+ }
3767
+ del({ tokens: e }) {
3768
+ return `<del>${this.parser.parseInline(e)}</del>`;
3769
+ }
3770
+ link({ href: e, title: t, text: n, tokens: i, autolink: r }) {
3771
+ let o = r ? R(n, true) : this.parser.parseInline(i), s = ee(e);
3772
+ if (s === null) return o;
3773
+ e = R(s, r);
3774
+ let u = "<a href=\"" + e + "\"";
3775
+ return t && (u += " title=\"" + R(t) + "\""), u += ">" + o + "</a>", u;
3776
+ }
3777
+ image({ href: e, title: t, text: n, tokens: i }) {
3778
+ i && (n = this.parser.parseInline(i, this.parser.textRenderer));
3779
+ let r = ee(e);
3780
+ if (r === null) return R(n);
3781
+ e = r;
3782
+ let o = `<img src="${R(e)}" alt="${R(n)}"`;
3783
+ return t && (o += ` title="${R(t)}"`), o += ">", o;
3784
+ }
3785
+ text(e) {
3786
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : R(e.text);
3787
+ }
3788
+ };
3789
+ var L = class {
3790
+ strong({ text: e }) {
3791
+ return e;
3792
+ }
3793
+ em({ text: e }) {
3794
+ return e;
3795
+ }
3796
+ codespan({ text: e }) {
3797
+ return e;
3798
+ }
3799
+ del({ text: e }) {
3800
+ return e;
3801
+ }
3802
+ html({ text: e }) {
3803
+ return e;
3804
+ }
3805
+ text({ text: e }) {
3806
+ return e;
3807
+ }
3808
+ link({ text: e }) {
3809
+ return "" + e;
3810
+ }
3811
+ image({ text: e }) {
3812
+ return "" + e;
3813
+ }
3814
+ br() {
3815
+ return "";
3816
+ }
3817
+ checkbox({ raw: e }) {
3818
+ return e;
3819
+ }
3820
+ };
3821
+ var b = class l {
3822
+ options;
3823
+ renderer;
3824
+ textRenderer;
3825
+ constructor(e) {
3826
+ this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
3827
+ }
3828
+ static parse(e, t) {
3829
+ return new l(t).parse(e);
3830
+ }
3831
+ static parseInline(e, t) {
3832
+ return new l(t).parseInline(e);
3833
+ }
3834
+ parse(e) {
3835
+ this.renderer.parser = this;
3836
+ let t = "";
3837
+ for (let n = 0; n < e.length; n++) {
3838
+ let i = e[n];
3839
+ if (this.options.extensions?.renderers?.[i.type]) {
3840
+ let o = i, s = this.options.extensions.renderers[o.type].call({ parser: this }, o);
3841
+ if (s !== false || ![
3842
+ "space",
3843
+ "hr",
3844
+ "heading",
3845
+ "code",
3846
+ "table",
3847
+ "blockquote",
3848
+ "list",
3849
+ "checkbox",
3850
+ "html",
3851
+ "def",
3852
+ "paragraph",
3853
+ "text"
3854
+ ].includes(o.type)) {
3855
+ t += s || "";
3856
+ continue;
3857
+ }
3858
+ }
3859
+ let r = i;
3860
+ switch (r.type) {
3861
+ case "space":
3862
+ t += this.renderer.space(r);
3863
+ break;
3864
+ case "hr":
3865
+ t += this.renderer.hr(r);
3866
+ break;
3867
+ case "heading":
3868
+ t += this.renderer.heading(r);
3869
+ break;
3870
+ case "code":
3871
+ t += this.renderer.code(r);
3872
+ break;
3873
+ case "table":
3874
+ t += this.renderer.table(r);
3875
+ break;
3876
+ case "blockquote":
3877
+ t += this.renderer.blockquote(r);
3878
+ break;
3879
+ case "list":
3880
+ t += this.renderer.list(r);
3881
+ break;
3882
+ case "checkbox":
3883
+ t += this.renderer.checkbox(r);
3884
+ break;
3885
+ case "html":
3886
+ t += this.renderer.html(r);
3887
+ break;
3888
+ case "def":
3889
+ t += this.renderer.def(r);
3890
+ break;
3891
+ case "paragraph":
3892
+ t += this.renderer.paragraph(r);
3893
+ break;
3894
+ case "text":
3895
+ t += this.renderer.text(r);
3896
+ break;
3897
+ default: {
3898
+ let o = "Token with \"" + r.type + "\" type was not found.";
3899
+ if (this.options.silent) return console.error(o), "";
3900
+ throw new Error(o);
3901
+ }
3902
+ }
3903
+ }
3904
+ return t;
3905
+ }
3906
+ parseInline(e, t = this.renderer) {
3907
+ this.renderer.parser = this;
3908
+ let n = "";
3909
+ for (let i = 0; i < e.length; i++) {
3910
+ let r = e[i];
3911
+ if (this.options.extensions?.renderers?.[r.type]) {
3912
+ let s = this.options.extensions.renderers[r.type].call({ parser: this }, r);
3913
+ if (s !== false || ![
3914
+ "escape",
3915
+ "html",
3916
+ "link",
3917
+ "image",
3918
+ "checkbox",
3919
+ "strong",
3920
+ "em",
3921
+ "codespan",
3922
+ "br",
3923
+ "del",
3924
+ "text"
3925
+ ].includes(r.type)) {
3926
+ n += s || "";
3927
+ continue;
3928
+ }
3929
+ }
3930
+ let o = r;
3931
+ switch (o.type) {
3932
+ case "escape":
3933
+ n += t.text(o);
3934
+ break;
3935
+ case "html":
3936
+ n += t.html(o);
3937
+ break;
3938
+ case "link":
3939
+ n += t.link(o);
3940
+ break;
3941
+ case "image":
3942
+ n += t.image(o);
3943
+ break;
3944
+ case "checkbox":
3945
+ n += t.checkbox(o);
3946
+ break;
3947
+ case "strong":
3948
+ n += t.strong(o);
3949
+ break;
3950
+ case "em":
3951
+ n += t.em(o);
3952
+ break;
3953
+ case "codespan":
3954
+ n += t.codespan(o);
3955
+ break;
3956
+ case "br":
3957
+ n += t.br(o);
3958
+ break;
3959
+ case "del":
3960
+ n += t.del(o);
3961
+ break;
3962
+ case "text":
3963
+ n += t.text(o);
3964
+ break;
3965
+ default: {
3966
+ let s = "Token with \"" + o.type + "\" type was not found.";
3967
+ if (this.options.silent) return console.error(s), "";
3968
+ throw new Error(s);
3969
+ }
3970
+ }
3971
+ }
3972
+ return n;
3973
+ }
3974
+ };
3975
+ var S = class {
3976
+ options;
3977
+ block;
3978
+ constructor(e) {
3979
+ this.options = e || T;
3980
+ }
3981
+ static passThroughHooks = /* @__PURE__ */ new Set([
3982
+ "preprocess",
3983
+ "postprocess",
3984
+ "processAllTokens",
3985
+ "emStrongMask"
3986
+ ]);
3987
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
3988
+ "preprocess",
3989
+ "postprocess",
3990
+ "processAllTokens"
3991
+ ]);
3992
+ preprocess(e) {
3993
+ return e;
3994
+ }
3995
+ postprocess(e) {
3996
+ return e;
3997
+ }
3998
+ processAllTokens(e) {
3999
+ return e;
4000
+ }
4001
+ emStrongMask(e) {
4002
+ return e;
4003
+ }
4004
+ provideLexer(e = this.block) {
4005
+ return e ? x.lex : x.lexInline;
4006
+ }
4007
+ provideParser(e = this.block) {
4008
+ return e ? b.parse : b.parseInline;
4009
+ }
4010
+ };
4011
+ var Q = class {
4012
+ defaults = A();
4013
+ options = this.setOptions;
4014
+ parse = this.parseMarkdown(true);
4015
+ parseInline = this.parseMarkdown(false);
4016
+ Parser = b;
4017
+ Renderer = P;
4018
+ TextRenderer = L;
4019
+ Lexer = x;
4020
+ Tokenizer = y;
4021
+ Hooks = S;
4022
+ constructor(...e) {
4023
+ this.use(...e);
4024
+ }
4025
+ walkTokens(e, t) {
4026
+ let n = [];
4027
+ for (let i of e) switch (n = n.concat(t.call(this, i)), i.type) {
4028
+ case "table": {
4029
+ let r = i;
4030
+ for (let o of r.header) n = n.concat(this.walkTokens(o.tokens, t));
4031
+ for (let o of r.rows) for (let s of o) n = n.concat(this.walkTokens(s.tokens, t));
4032
+ break;
4033
+ }
4034
+ case "list": {
4035
+ let r = i;
4036
+ n = n.concat(this.walkTokens(r.items, t));
4037
+ break;
4038
+ }
4039
+ default: {
4040
+ let r = i;
4041
+ this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((o) => {
4042
+ let s = r[o].flat(1 / 0);
4043
+ n = n.concat(this.walkTokens(s, t));
4044
+ }) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, t)));
4045
+ }
4046
+ }
4047
+ return n;
4048
+ }
4049
+ use(...e) {
4050
+ let t = this.defaults.extensions || {
4051
+ renderers: {},
4052
+ childTokens: {}
4053
+ };
4054
+ return e.forEach((n) => {
4055
+ let i = { ...n };
4056
+ if (i.async = this.defaults.async || i.async || false, n.extensions && (n.extensions.forEach((r) => {
4057
+ if (!r.name) throw new Error("extension name required");
4058
+ if ("renderer" in r) {
4059
+ let o = t.renderers[r.name];
4060
+ o ? t.renderers[r.name] = function(...s) {
4061
+ let u = r.renderer.apply(this, s);
4062
+ return u === false && (u = o.apply(this, s)), u;
4063
+ } : t.renderers[r.name] = r.renderer;
4064
+ }
4065
+ if ("tokenizer" in r) {
4066
+ if (!r.level || r.level !== "block" && r.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
4067
+ let o = t[r.level];
4068
+ o ? o.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
4069
+ }
4070
+ "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
4071
+ }), i.extensions = t), n.renderer) {
4072
+ let r = this.defaults.renderer || new P(this.defaults);
4073
+ for (let o in n.renderer) {
4074
+ if (!(o in r)) throw new Error(`renderer '${o}' does not exist`);
4075
+ if (["options", "parser"].includes(o)) continue;
4076
+ let s = o, u = n.renderer[s], a = r[s];
4077
+ r[s] = (...p) => {
4078
+ let c = u.apply(r, p);
4079
+ return c === false && (c = a.apply(r, p)), c || "";
4080
+ };
4081
+ }
4082
+ i.renderer = r;
4083
+ }
4084
+ if (n.tokenizer) {
4085
+ let r = this.defaults.tokenizer || new y(this.defaults);
4086
+ for (let o in n.tokenizer) {
4087
+ if (!(o in r)) throw new Error(`tokenizer '${o}' does not exist`);
4088
+ if ([
4089
+ "options",
4090
+ "rules",
4091
+ "lexer"
4092
+ ].includes(o)) continue;
4093
+ let s = o, u = n.tokenizer[s], a = r[s];
4094
+ r[s] = (...p) => {
4095
+ let c = u.apply(r, p);
4096
+ return c === false && (c = a.apply(r, p)), c;
4097
+ };
4098
+ }
4099
+ i.tokenizer = r;
4100
+ }
4101
+ if (n.hooks) {
4102
+ let r = this.defaults.hooks || new S();
4103
+ for (let o in n.hooks) {
4104
+ if (!(o in r)) throw new Error(`hook '${o}' does not exist`);
4105
+ if (["options", "block"].includes(o)) continue;
4106
+ let s = o, u = n.hooks[s], a = r[s];
4107
+ S.passThroughHooks.has(o) ? r[s] = (p) => {
4108
+ if (this.defaults.async && S.passThroughHooksRespectAsync.has(o)) return (async () => {
4109
+ let h = await u.call(r, p);
4110
+ return a.call(r, h);
4111
+ })();
4112
+ let c = u.call(r, p);
4113
+ return a.call(r, c);
4114
+ } : r[s] = (...p) => {
4115
+ if (this.defaults.async) return (async () => {
4116
+ let h = await u.apply(r, p);
4117
+ return h === false && (h = await a.apply(r, p)), h;
4118
+ })();
4119
+ let c = u.apply(r, p);
4120
+ return c === false && (c = a.apply(r, p)), c;
4121
+ };
4122
+ }
4123
+ i.hooks = r;
4124
+ }
4125
+ if (n.walkTokens) {
4126
+ let r = this.defaults.walkTokens, o = n.walkTokens;
4127
+ i.walkTokens = function(s) {
4128
+ let u = [];
4129
+ return u.push(o.call(this, s)), r && (u = u.concat(r.call(this, s))), u;
4130
+ };
4131
+ }
4132
+ this.defaults = {
4133
+ ...this.defaults,
4134
+ ...i
4135
+ };
4136
+ }), this;
4137
+ }
4138
+ setOptions(e) {
4139
+ return this.defaults = {
4140
+ ...this.defaults,
4141
+ ...e
4142
+ }, this;
4143
+ }
4144
+ lexer(e, t) {
4145
+ return x.lex(e, t ?? this.defaults);
4146
+ }
4147
+ parser(e, t) {
4148
+ return b.parse(e, t ?? this.defaults);
4149
+ }
4150
+ parseMarkdown(e) {
4151
+ return (n, i) => {
4152
+ let r = { ...i }, o = {
4153
+ ...this.defaults,
4154
+ ...r
4155
+ }, s = this.onError(!!o.silent, !!o.async);
4156
+ if (this.defaults.async === true && r.async === false) return s(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
4157
+ if (typeof n > "u" || n === null) return s(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
4158
+ if (typeof n != "string") return s(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
4159
+ if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async) return (async () => {
4160
+ let u = o.hooks ? await o.hooks.preprocess(n) : n, p = await (o.hooks ? await o.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(u, o), c = o.hooks ? await o.hooks.processAllTokens(p) : p;
4161
+ o.walkTokens && await Promise.all(this.walkTokens(c, o.walkTokens));
4162
+ let k = await (o.hooks ? await o.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, o);
4163
+ return o.hooks ? await o.hooks.postprocess(k) : k;
4164
+ })().catch(s);
4165
+ try {
4166
+ o.hooks && (n = o.hooks.preprocess(n));
4167
+ let a = (o.hooks ? o.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, o);
4168
+ o.hooks && (a = o.hooks.processAllTokens(a)), o.walkTokens && this.walkTokens(a, o.walkTokens);
4169
+ let c = (o.hooks ? o.hooks.provideParser(e) : e ? b.parse : b.parseInline)(a, o);
4170
+ return o.hooks && (c = o.hooks.postprocess(c)), c;
4171
+ } catch (u) {
4172
+ return s(u);
4173
+ }
4174
+ };
4175
+ }
4176
+ onError(e, t) {
4177
+ return (n) => {
4178
+ if (n.message += `
4179
+ Please report this to https://github.com/markedjs/marked.`, e) {
4180
+ let i = "<p>An error occurred:</p><pre>" + R(n.message + "", true) + "</pre>";
4181
+ return t ? Promise.resolve(i) : i;
4182
+ }
4183
+ if (t) return Promise.reject(n);
4184
+ throw n;
4185
+ };
4186
+ }
4187
+ };
4188
+ var M = new Q();
4189
+ function f(l, e) {
4190
+ return M.parse(l, e);
4191
+ }
4192
+ f.options = f.setOptions = function(l) {
4193
+ return M.setOptions(l), f.defaults = M.defaults, U(f.defaults), f;
4194
+ };
4195
+ f.getDefaults = A;
4196
+ f.defaults = T;
4197
+ function bt(...l) {
4198
+ return M.use(...l), f.defaults = M.defaults, U(f.defaults), f;
4199
+ }
4200
+ f.use = bt;
4201
+ f.walkTokens = function(l, e) {
4202
+ return M.walkTokens(l, e);
4203
+ };
4204
+ f.parseInline = M.parseInline;
4205
+ f.Parser = b;
4206
+ f.parser = b.parse;
4207
+ f.Renderer = P;
4208
+ f.TextRenderer = L;
4209
+ f.Lexer = x;
4210
+ f.lexer = x.lex;
4211
+ f.Tokenizer = y;
4212
+ f.Hooks = S;
4213
+ f.parse = f;
4214
+ f.options;
4215
+ f.setOptions;
4216
+ f.walkTokens;
4217
+ f.parseInline;
4218
+ b.parse;
4219
+ x.lex;
4220
+ //#endregion
4221
+ //#region ../../packages/ui/src/Markdown.svelte
4222
+ function Markdown($$renderer, $$props) {
4223
+ $$renderer.component(($$renderer) => {
4224
+ let { source, headingsFrom = 1 } = $$props;
4225
+ const html = derived(() => null);
4226
+ if (html() === null) $$renderer.push(`<!--[0--><pre class="markdown svelte-132xw63">${escape_html(source)}</pre>`);
4227
+ else $$renderer.push(`<!--[-1--><div class="markdown svelte-132xw63">${html$2(html())}</div>`);
4228
+ $$renderer.push(`<!--]-->`);
4229
+ });
4230
+ }
4231
+
4232
+ export { Markdown as M, answerHref as a, askedLine as b, pickOption as p, questionParts as q };
4233
+ //# sourceMappingURL=Markdown.js-Clud88KU.js.map