@dotss/tictoccroc 0.4.1 → 0.5.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 (205) hide show
  1. package/dist/Calendar-BOLCHnjh.js +97 -0
  2. package/dist/TimePicker-BwACyeBR.js +120 -0
  3. package/dist/convertMdToHtml-Bmk0brLK.js +1431 -0
  4. package/dist/index.mjs +105 -200
  5. package/dist/parent/b2b/components/ActionButtons/ActionButtons.mjs +26 -29
  6. package/dist/parent/b2b/components/ActionButtons/index.mjs +5 -4
  7. package/dist/parent/b2b/components/BottomNotes/BottomNotes.mjs +37 -35
  8. package/dist/parent/b2b/components/BottomNotes/index.mjs +5 -4
  9. package/dist/parent/b2b/components/EmployeeNumberField/EmployeeNumberField.mjs +12 -15
  10. package/dist/parent/b2b/components/EmployeeNumberField/index.mjs +5 -4
  11. package/dist/parent/b2b/components/NameField/NameField.mjs +12 -7
  12. package/dist/parent/b2b/components/NameField/index.mjs +5 -4
  13. package/dist/parent/b2b/components/PhoneNumberField/PhoneNumberField.mjs +27 -30
  14. package/dist/parent/b2b/components/PhoneNumberField/PhoneNumberField.utils.mjs +7 -8
  15. package/dist/parent/b2b/components/PhoneNumberField/index.mjs +6 -7
  16. package/dist/parent/b2b/components/Title/Title.mjs +22 -16
  17. package/dist/parent/b2b/components/Title/index.mjs +4 -3
  18. package/dist/parent/b2b/components/TopLogo/TopLogo.mjs +55 -93
  19. package/dist/parent/b2b/components/TopLogo/index.mjs +5 -4
  20. package/dist/parent/b2b/components/index.mjs +9 -19
  21. package/dist/parent/b2b/utils/convertMdToHtml/convertMdToHtml.mjs +2 -1143
  22. package/dist/parent/b2b/utils/index.mjs +2 -4
  23. package/dist/parent/notification/components/NotificationCard/NotificationCard.d.ts +3 -1
  24. package/dist/parent/notification/components/NotificationCard/NotificationCard.mjs +90 -105
  25. package/dist/parent/notification/components/NotificationCard/index.mjs +5 -4
  26. package/dist/parent/notification/components/index.mjs +2 -4
  27. package/dist/parent/notification/utils/index.mjs +2 -4
  28. package/dist/parent/notification/utils/sanitize/sanitize.mjs +6 -6
  29. package/dist/purify.es-D3W4zDrg.js +549 -0
  30. package/dist/shared/components/Calendar/Calendar.mjs +2 -80
  31. package/dist/shared/components/Calendar/index.mjs +5 -4
  32. package/dist/shared/components/Carousel/Carousel.mjs +184 -210
  33. package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.mjs +10 -7
  34. package/dist/shared/components/Carousel/CarouselSlide/index.mjs +5 -4
  35. package/dist/shared/components/Carousel/index.mjs +6 -6
  36. package/dist/shared/components/ChatKit/BotMessage/BotMessage.mjs +151 -183
  37. package/dist/shared/components/ChatKit/BotMessage/BotMessage.utils.mjs +30 -50
  38. package/dist/shared/components/ChatKit/BotMessage/index.mjs +6 -8
  39. package/dist/shared/components/ChatKit/InputBar/InputBar.fallback.mjs +64 -84
  40. package/dist/shared/components/ChatKit/InputBar/InputBar.mjs +105 -130
  41. package/dist/shared/components/ChatKit/InputBar/index.mjs +6 -6
  42. package/dist/shared/components/ChatKit/Message/Message.fallback.mjs +50 -66
  43. package/dist/shared/components/ChatKit/Message/Message.mjs +178 -276
  44. package/dist/shared/components/ChatKit/Message/Message.utils.mjs +20 -31
  45. package/dist/shared/components/ChatKit/Message/index.mjs +7 -9
  46. package/dist/shared/components/ChatKit/Seperator/Seperator.mjs +31 -27
  47. package/dist/shared/components/ChatKit/Seperator/index.mjs +4 -3
  48. package/dist/shared/components/ChatKit/SystemMessage/(Actions)/DirectTrageRiskInfoBottomSheet/DirectTrageRiskInfoBottomSheet.mjs +183 -153
  49. package/dist/shared/components/ChatKit/SystemMessage/SystemMessage.mjs +83 -108
  50. package/dist/shared/components/ChatKit/SystemMessage/SystemMessage.utils.mjs +5 -5
  51. package/dist/shared/components/ChatKit/SystemMessage/index.mjs +7 -8
  52. package/dist/shared/components/ChatKit/UnreadMessagePill/UnreadMessagePill.mjs +49 -54
  53. package/dist/shared/components/ChatKit/UnreadMessagePill/index.mjs +5 -4
  54. package/dist/shared/components/ChatKit/index.mjs +13 -29
  55. package/dist/shared/components/Image/Image.d.ts +2 -0
  56. package/dist/shared/components/Image/Image.error.mjs +34 -40
  57. package/dist/shared/components/Image/Image.mjs +247 -289
  58. package/dist/shared/components/Image/index.mjs +6 -6
  59. package/dist/shared/components/LoadingAnnouncer/LoadingAnnouncer.mjs +19 -18
  60. package/dist/shared/components/LoadingAnnouncer/index.mjs +5 -4
  61. package/dist/shared/components/Masonry/Masonry.mjs +240 -276
  62. package/dist/shared/components/Masonry/Masonry.utils.mjs +62 -81
  63. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +111 -144
  64. package/dist/shared/components/Masonry/MasonryBlock/index.mjs +5 -4
  65. package/dist/shared/components/Masonry/index.mjs +6 -6
  66. package/dist/shared/components/MediaDialog/MediaBlock/MediaBlock.mjs +54 -69
  67. package/dist/shared/components/MediaDialog/MediaBlock/index.mjs +5 -4
  68. package/dist/shared/components/MediaDialog/MediaDialog.mjs +216 -330
  69. package/dist/shared/components/MediaDialog/MediaDialogContent/MediaDialogContent.mjs +18 -21
  70. package/dist/shared/components/MediaDialog/MediaDialogContent/index.mjs +5 -4
  71. package/dist/shared/components/MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs +22 -27
  72. package/dist/shared/components/MediaDialog/MediaDialogFooter/index.mjs +5 -4
  73. package/dist/shared/components/MediaDialog/MediaDialogToolbar/MediaDialogToolbar.mjs +15 -21
  74. package/dist/shared/components/MediaDialog/MediaDialogToolbar/index.mjs +5 -4
  75. package/dist/shared/components/MediaDialog/index.mjs +9 -12
  76. package/dist/shared/components/Roller/Roller.mjs +99 -132
  77. package/dist/shared/components/Roller/RollerBlock/RollerBlock.mjs +9 -6
  78. package/dist/shared/components/Roller/RollerBlock/index.mjs +5 -4
  79. package/dist/shared/components/Roller/index.mjs +6 -6
  80. package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.mjs +22 -30
  81. package/dist/shared/components/Scheduler/ScheduleBlock/index.mjs +5 -4
  82. package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +25 -35
  83. package/dist/shared/components/Scheduler/ScheduleEvent/index.mjs +5 -4
  84. package/dist/shared/components/Scheduler/Scheduler.mjs +472 -567
  85. package/dist/shared/components/Scheduler/Scheduler.utils.mjs +78 -101
  86. package/dist/shared/components/Scheduler/index.mjs +8 -10
  87. package/dist/shared/components/Swiper/Swiper.mjs +238 -283
  88. package/dist/shared/components/Swiper/Swiper.utils.mjs +19 -24
  89. package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.mjs +14 -17
  90. package/dist/shared/components/Swiper/SwiperBlock/index.mjs +5 -4
  91. package/dist/shared/components/Swiper/index.mjs +6 -6
  92. package/dist/shared/components/TextField/TextField.mjs +44 -55
  93. package/dist/shared/components/TextField/index.mjs +5 -4
  94. package/dist/shared/components/TimePicker/TimePicker.mjs +2 -120
  95. package/dist/shared/components/TimePicker/index.mjs +5 -4
  96. package/dist/shared/components/index.mjs +36 -75
  97. package/dist/shared/hooks/index.mjs +4 -8
  98. package/dist/shared/hooks/useCombineRef/index.mjs +5 -4
  99. package/dist/shared/hooks/useCombineRef/useCombineRef.mjs +7 -7
  100. package/dist/shared/hooks/useInView/index.mjs +5 -4
  101. package/dist/shared/hooks/useInView/useInView.d.ts +2 -1
  102. package/dist/shared/hooks/useInView/useInView.mjs +37 -47
  103. package/dist/shared/hooks/useIsomorphicLayoutEffect/index.mjs +5 -4
  104. package/dist/shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +6 -6
  105. package/dist/shared/typings/common.mjs +6 -4
  106. package/dist/shared/typings/index.mjs +2 -4
  107. package/dist/shared/utils/ageToBirthDate/ageToBirthDate.mjs +17 -9
  108. package/dist/shared/utils/ageToBirthDate/index.mjs +5 -4
  109. package/dist/shared/utils/birthDateToAge/birthDateToAge.mjs +9 -10
  110. package/dist/shared/utils/birthDateToAge/index.mjs +4 -3
  111. package/dist/shared/utils/combineRef/combineRef.mjs +20 -23
  112. package/dist/shared/utils/combineRef/index.mjs +5 -4
  113. package/dist/shared/utils/dayFlagToDay/dayFlagToDay.mjs +15 -23
  114. package/dist/shared/utils/dayFlagToDay/index.mjs +5 -4
  115. package/dist/shared/utils/getCareTypeLabel/getCareTypeLabel.mjs +13 -20
  116. package/dist/shared/utils/getCareTypeLabel/index.mjs +5 -4
  117. package/dist/shared/utils/getDateRange/getDateRange.mjs +15 -20
  118. package/dist/shared/utils/getDateRange/index.mjs +5 -4
  119. package/dist/shared/utils/getImageUrl/getImageUrl.mjs +7 -17
  120. package/dist/shared/utils/getImageUrl/index.mjs +5 -6
  121. package/dist/shared/utils/getTimeRange/getTimeRange.mjs +19 -21
  122. package/dist/shared/utils/getTimeRange/index.mjs +5 -4
  123. package/dist/shared/utils/getVimeoId/getVimeoId.mjs +11 -11
  124. package/dist/shared/utils/getVimeoId/index.mjs +5 -4
  125. package/dist/shared/utils/index.mjs +18 -36
  126. package/dist/shared/utils/isAndroid/index.mjs +5 -4
  127. package/dist/shared/utils/isAndroid/isAndroid.mjs +5 -5
  128. package/dist/shared/utils/isApp/index.mjs +5 -4
  129. package/dist/shared/utils/isApp/isApp.mjs +4 -4
  130. package/dist/shared/utils/isDesktop/index.mjs +5 -4
  131. package/dist/shared/utils/isDesktop/isDesktop.mjs +15 -15
  132. package/dist/shared/utils/isIos/index.mjs +5 -4
  133. package/dist/shared/utils/isIos/isIos.mjs +5 -5
  134. package/dist/shared/utils/isServer/index.mjs +4 -3
  135. package/dist/shared/utils/isServer/isServer.mjs +4 -4
  136. package/dist/shared/utils/objectToQueryString/index.mjs +5 -4
  137. package/dist/shared/utils/objectToQueryString/objectToQueryString.mjs +7 -8
  138. package/dist/shared/utils/parseQueryString/index.mjs +4 -3
  139. package/dist/shared/utils/parseQueryString/parseQueryString.mjs +5 -5
  140. package/dist/shared/utils/share/index.mjs +5 -4
  141. package/dist/shared/utils/share/share.mjs +12 -14
  142. package/dist/teacher/home/components/BannerAccount/BannerAccount.fallback.mjs +19 -11
  143. package/dist/teacher/home/components/BannerAccount/BannerAccount.mjs +83 -99
  144. package/dist/teacher/home/components/BannerAccount/index.mjs +6 -7
  145. package/dist/teacher/home/components/Carousel1Account/Carousel1Account.fallback.mjs +127 -67
  146. package/dist/teacher/home/components/Carousel1Account/Carousel1Account.mjs +68 -82
  147. package/dist/teacher/home/components/Carousel1Account/index.mjs +6 -7
  148. package/dist/teacher/home/components/Carousel2Account/Carousel2Account.fallback.mjs +112 -94
  149. package/dist/teacher/home/components/Carousel2Account/Carousel2Account.mjs +79 -85
  150. package/dist/teacher/home/components/Carousel2Account/index.mjs +6 -7
  151. package/dist/teacher/home/components/TextAccount/TextAccount.fallback.mjs +119 -108
  152. package/dist/teacher/home/components/TextAccount/TextAccount.mjs +91 -111
  153. package/dist/teacher/home/components/TextAccount/index.mjs +6 -7
  154. package/dist/teacher/home/components/index.mjs +9 -18
  155. package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.mjs +345 -442
  156. package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/index.mjs +5 -5
  157. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.mjs +106 -109
  158. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.mjs +54 -58
  159. package/dist/teacher/profile/components/AbilityCollection/index.mjs +7 -8
  160. package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.mjs +73 -104
  161. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs +81 -95
  162. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/index.mjs +4 -3
  163. package/dist/teacher/profile/components/ActivityGallery/index.mjs +6 -6
  164. package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs +148 -194
  165. package/dist/teacher/profile/components/AvailableScheduleSection/index.mjs +5 -4
  166. package/dist/teacher/profile/components/CareNoteSection/CareNote/CareNote.mjs +61 -53
  167. package/dist/teacher/profile/components/CareNoteSection/CareNote/index.mjs +5 -4
  168. package/dist/teacher/profile/components/CareNoteSection/CareNoteSection.mjs +72 -81
  169. package/dist/teacher/profile/components/CareNoteSection/CareNoteSection.utils.mjs +17 -12
  170. package/dist/teacher/profile/components/CareNoteSection/index.mjs +6 -6
  171. package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.mjs +108 -134
  172. package/dist/teacher/profile/components/CareerSection/CareerItem/index.mjs +5 -4
  173. package/dist/teacher/profile/components/CareerSection/CareerSection.mjs +133 -176
  174. package/dist/teacher/profile/components/CareerSection/index.mjs +6 -6
  175. package/dist/teacher/profile/components/CertificateSection/CertificateItem/CertificateItem.mjs +82 -88
  176. package/dist/teacher/profile/components/CertificateSection/CertificateItem/index.mjs +4 -3
  177. package/dist/teacher/profile/components/CertificateSection/CertificateSection.mjs +112 -141
  178. package/dist/teacher/profile/components/CertificateSection/index.mjs +6 -6
  179. package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +96 -111
  180. package/dist/teacher/profile/components/EducationSection/EducationItem/index.mjs +5 -4
  181. package/dist/teacher/profile/components/EducationSection/EducationSection.mjs +112 -141
  182. package/dist/teacher/profile/components/EducationSection/index.mjs +6 -6
  183. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs +107 -102
  184. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/index.mjs +5 -4
  185. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs +85 -81
  186. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.mjs +17 -12
  187. package/dist/teacher/profile/components/ParentReviewSection/index.mjs +7 -8
  188. package/dist/teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.mjs +43 -36
  189. package/dist/teacher/profile/components/PreferredActivityKeywordGroup/index.mjs +4 -3
  190. package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.mjs +44 -31
  191. package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs +11 -12
  192. package/dist/teacher/profile/components/PreferredAgeGroup/index.mjs +5 -5
  193. package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.mjs +348 -433
  194. package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.utils.mjs +7 -7
  195. package/dist/teacher/profile/components/ProfileSummary/index.mjs +5 -4
  196. package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.mjs +80 -105
  197. package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/index.mjs +5 -4
  198. package/dist/teacher/profile/components/StatBadgeCollection/StatBadgeCollection.mjs +34 -27
  199. package/dist/teacher/profile/components/StatBadgeCollection/index.mjs +6 -6
  200. package/dist/teacher/profile/components/index.mjs +24 -48
  201. package/dist/teacher/profile/utils/index.mjs +2 -4
  202. package/dist/teacher/profile/utils/sortItems/index.mjs +5 -4
  203. package/dist/teacher/profile/utils/sortItems/sortItems.mjs +48 -48
  204. package/package.json +1 -1
  205. package/dist/purify.es-BGaRrCfO.js +0 -553
@@ -1,1143 +1,2 @@
1
- var Se = Object.defineProperty;
2
- var $e = (r, e, t) => e in r ? Se(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var x = (r, e, t) => $e(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { p as Re } from "../../../../purify.es-BGaRrCfO.js";
5
- function G() {
6
- return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
7
- }
8
- var z = G();
9
- function oe(r) {
10
- z = r;
11
- }
12
- var R = { exec: () => null };
13
- function f(r, e = "") {
14
- let t = typeof r == "string" ? r : r.source, s = { replace: (n, i) => {
15
- let a = typeof i == "string" ? i : i.source;
16
- return a = a.replace(m.caret, "$1"), t = t.replace(n, a), s;
17
- }, getRegex: () => new RegExp(t, e) };
18
- return s;
19
- }
20
- var Te = (() => {
21
- try {
22
- return !!new RegExp("(?<=1)(?<!1)");
23
- } catch {
24
- return !1;
25
- }
26
- })(), m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (r) => new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}#`), htmlBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}>`) }, ze = /^(?:[ \t]*(?:\n|$))+/, Ae = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _e = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, X = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ce = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, he = f(ce).replace(/bull/g, X).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ie = f(ce).replace(/bull/g, X).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Le = /^[^\n]+/, W = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Be = f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", W).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ce = f(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, X).getRegex(), M = "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", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, qe = f("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", M).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), pe = f(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex(), ve = f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", pe).getRegex(), J = { blockquote: ve, code: Ae, def: Be, fences: _e, heading: Pe, hr: B, html: qe, lheading: he, list: Ce, newline: ze, paragraph: pe, table: R, text: Le }, re = f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex(), Ee = { ...J, lheading: Ie, table: re, paragraph: f(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex() }, Ze = { ...J, html: f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: R, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: f(F).replace("hr", B).replace("heading", ` *#{1,6} *[^
27
- ]`).replace("lheading", he).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, De = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Me = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, Qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Q = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ge = /[^\s\p{P}\p{S}]/u, He = f(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), ke = /(?!~)[\p{P}\p{S}]/u, Ne = /(?!~)[\s\p{P}\p{S}]/u, Oe = /(?:[^\s\p{P}\p{S}]|~)/u, fe = /(?![*_])[\p{P}\p{S}]/u, je = /(?![*_])[\s\p{P}\p{S}]/u, Ge = /(?:[^\s\p{P}\p{S}]|[*_])/u, Xe = f(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), de = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Fe = f(de, "u").replace(/punct/g, Q).getRegex(), We = f(de, "u").replace(/punct/g, ke).getRegex(), xe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ue = f(xe, "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, K).replace(/punct/g, Q).getRegex(), Je = f(xe, "gu").replace(/notPunctSpace/g, Oe).replace(/punctSpace/g, Ne).replace(/punct/g, ke).getRegex(), Ke = f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, K).replace(/punct/g, Q).getRegex(), Ve = f(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, fe).getRegex(), Ye = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", et = f(Ye, "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, je).replace(/punct/g, fe).getRegex(), tt = f(/\\(punct)/, "gu").replace(/punct/g, Q).getRegex(), rt = f(/^<(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(), nt = f(U).replace("(?:-->|$)", "-->").getRegex(), st = f("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", nt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), E = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, lt = f(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", E).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), be = f(/^!?\[(label)\]\[(ref)\]/).replace("label", E).replace("ref", W).getRegex(), we = f(/^!?\[(ref)\](?:\[\])?/).replace("ref", W).getRegex(), it = f("reflink|nolink(?!\\()", "g").replace("reflink", be).replace("nolink", we).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, V = { _backpedal: R, anyPunctuation: tt, autolink: rt, blockSkip: Xe, br: ue, code: Me, del: R, delLDelim: R, delRDelim: R, emStrongLDelim: Fe, emStrongRDelimAst: Ue, emStrongRDelimUnd: Ke, escape: De, link: lt, nolink: we, punctuation: He, reflink: be, reflinkSearch: it, tag: st, text: Qe, url: R }, at = { ...V, link: f(/^!?\[(label)\]\((.*?)\)/).replace("label", E).getRegex(), reflink: f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", E).getRegex() }, N = { ...V, emStrongRDelimAst: Je, emStrongLDelim: We, delLDelim: Ve, delRDelim: et, url: f(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: f(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() }, ot = { ...N, br: f(ue).replace("{2,}", "*").getRegex(), text: f(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, q = { normal: J, gfm: Ee, pedantic: Ze }, P = { normal: V, gfm: N, breaks: ot, pedantic: at }, ct = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, se = (r) => ct[r];
28
- function $(r, e) {
29
- if (e) {
30
- if (m.escapeTest.test(r)) return r.replace(m.escapeReplace, se);
31
- } else if (m.escapeTestNoEncode.test(r)) return r.replace(m.escapeReplaceNoEncode, se);
32
- return r;
33
- }
34
- function le(r) {
35
- try {
36
- r = encodeURI(r).replace(m.percentDecode, "%");
37
- } catch {
38
- return null;
39
- }
40
- return r;
41
- }
42
- function ie(r, e) {
43
- var i;
44
- let t = r.replace(m.findPipe, (a, l, h) => {
45
- let o = !1, p = l;
46
- for (; --p >= 0 && h[p] === "\\"; ) o = !o;
47
- return o ? "|" : " |";
48
- }), s = t.split(m.splitPipe), n = 0;
49
- if (s[0].trim() || s.shift(), s.length > 0 && !((i = s.at(-1)) != null && i.trim()) && s.pop(), e) if (s.length > e) s.splice(e);
50
- else for (; s.length < e; ) s.push("");
51
- for (; n < s.length; n++) s[n] = s[n].trim().replace(m.slashPipe, "|");
52
- return s;
53
- }
54
- function I(r, e, t) {
55
- let s = r.length;
56
- if (s === 0) return "";
57
- let n = 0;
58
- for (; n < s && r.charAt(s - n - 1) === e; )
59
- n++;
60
- return r.slice(0, s - n);
61
- }
62
- function ht(r, e) {
63
- if (r.indexOf(e[1]) === -1) return -1;
64
- let t = 0;
65
- for (let s = 0; s < r.length; s++) if (r[s] === "\\") s++;
66
- else if (r[s] === e[0]) t++;
67
- else if (r[s] === e[1] && (t--, t < 0)) return s;
68
- return t > 0 ? -2 : -1;
69
- }
70
- function pt(r, e = 0) {
71
- let t = e, s = "";
72
- for (let n of r) if (n === " ") {
73
- let i = 4 - t % 4;
74
- s += " ".repeat(i), t += i;
75
- } else s += n, t++;
76
- return s;
77
- }
78
- function ae(r, e, t, s, n) {
79
- let i = e.href, a = e.title || null, l = r[1].replace(n.other.outputLinkReplace, "$1");
80
- s.state.inLink = !0;
81
- let h = { type: r[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: a, text: l, tokens: s.inlineTokens(l) };
82
- return s.state.inLink = !1, h;
83
- }
84
- function ut(r, e, t) {
85
- let s = r.match(t.other.indentCodeCompensation);
86
- if (s === null) return e;
87
- let n = s[1];
88
- return e.split(`
89
- `).map((i) => {
90
- let a = i.match(t.other.beginningSpace);
91
- if (a === null) return i;
92
- let [l] = a;
93
- return l.length >= n.length ? i.slice(n.length) : i;
94
- }).join(`
95
- `);
96
- }
97
- var Z = class {
98
- constructor(r) {
99
- x(this, "options");
100
- x(this, "rules");
101
- x(this, "lexer");
102
- this.options = r || z;
103
- }
104
- space(r) {
105
- let e = this.rules.block.newline.exec(r);
106
- if (e && e[0].length > 0) return { type: "space", raw: e[0] };
107
- }
108
- code(r) {
109
- let e = this.rules.block.code.exec(r);
110
- if (e) {
111
- let t = e[0].replace(this.rules.other.codeRemoveIndent, "");
112
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? t : I(t, `
113
- `) };
114
- }
115
- }
116
- fences(r) {
117
- let e = this.rules.block.fences.exec(r);
118
- if (e) {
119
- let t = e[0], s = ut(t, e[3] || "", this.rules);
120
- return { type: "code", raw: t, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
121
- }
122
- }
123
- heading(r) {
124
- let e = this.rules.block.heading.exec(r);
125
- if (e) {
126
- let t = e[2].trim();
127
- if (this.rules.other.endingHash.test(t)) {
128
- let s = I(t, "#");
129
- (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (t = s.trim());
130
- }
131
- return { type: "heading", raw: e[0], depth: e[1].length, text: t, tokens: this.lexer.inline(t) };
132
- }
133
- }
134
- hr(r) {
135
- let e = this.rules.block.hr.exec(r);
136
- if (e) return { type: "hr", raw: I(e[0], `
137
- `) };
138
- }
139
- blockquote(r) {
140
- let e = this.rules.block.blockquote.exec(r);
141
- if (e) {
142
- let t = I(e[0], `
143
- `).split(`
144
- `), s = "", n = "", i = [];
145
- for (; t.length > 0; ) {
146
- let a = !1, l = [], h;
147
- for (h = 0; h < t.length; h++) if (this.rules.other.blockquoteStart.test(t[h])) l.push(t[h]), a = !0;
148
- else if (!a) l.push(t[h]);
149
- else break;
150
- t = t.slice(h);
151
- let o = l.join(`
152
- `), p = o.replace(this.rules.other.blockquoteSetextReplace, `
153
- $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
154
- s = s ? `${s}
155
- ${o}` : o, n = n ? `${n}
156
- ${p}` : p;
157
- let g = this.lexer.state.top;
158
- if (this.lexer.state.top = !0, this.lexer.blockTokens(p, i, !0), this.lexer.state.top = g, t.length === 0) break;
159
- let u = i.at(-1);
160
- if ((u == null ? void 0 : u.type) === "code") break;
161
- if ((u == null ? void 0 : u.type) === "blockquote") {
162
- let c = u, b = c.raw + `
163
- ` + t.join(`
164
- `), k = this.blockquote(b);
165
- i[i.length - 1] = k, s = s.substring(0, s.length - c.raw.length) + k.raw, n = n.substring(0, n.length - c.text.length) + k.text;
166
- break;
167
- } else if ((u == null ? void 0 : u.type) === "list") {
168
- let c = u, b = c.raw + `
169
- ` + t.join(`
170
- `), k = this.list(b);
171
- i[i.length - 1] = k, s = s.substring(0, s.length - u.raw.length) + k.raw, n = n.substring(0, n.length - c.raw.length) + k.raw, t = b.substring(i.at(-1).raw.length).split(`
172
- `);
173
- continue;
174
- }
175
- }
176
- return { type: "blockquote", raw: s, tokens: i, text: n };
177
- }
178
- }
179
- list(r) {
180
- var t, s;
181
- let e = this.rules.block.list.exec(r);
182
- if (e) {
183
- let n = e[1].trim(), i = n.length > 1, a = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: !1, items: [] };
184
- n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
185
- let l = this.rules.other.listItemRegex(n), h = !1;
186
- for (; r; ) {
187
- let p = !1, g = "", u = "";
188
- if (!(e = l.exec(r)) || this.rules.block.hr.test(r)) break;
189
- g = e[0], r = r.substring(g.length);
190
- let c = pt(e[2].split(`
191
- `, 1)[0], e[1].length), b = r.split(`
192
- `, 1)[0], k = !c.trim(), w = 0;
193
- if (this.options.pedantic ? (w = 2, u = c.trimStart()) : k ? w = e[1].length + 1 : (w = c.search(this.rules.other.nonSpaceChar), w = w > 4 ? 1 : w, u = c.slice(w), w += e[1].length), k && this.rules.other.blankLine.test(b) && (g += b + `
194
- `, r = r.substring(b.length + 1), p = !0), !p) {
195
- let A = this.rules.other.nextBulletRegex(w), C = this.rules.other.hrRegex(w), ee = this.rules.other.fencesBeginRegex(w), te = this.rules.other.headingBeginRegex(w), me = this.rules.other.htmlBeginRegex(w), ye = this.rules.other.blockquoteBeginRegex(w);
196
- for (; r; ) {
197
- let H = r.split(`
198
- `, 1)[0], _;
199
- if (b = H, this.options.pedantic ? (b = b.replace(this.rules.other.listReplaceNesting, " "), _ = b) : _ = b.replace(this.rules.other.tabCharGlobal, " "), ee.test(b) || te.test(b) || me.test(b) || ye.test(b) || A.test(b) || C.test(b)) break;
200
- if (_.search(this.rules.other.nonSpaceChar) >= w || !b.trim()) u += `
201
- ` + _.slice(w);
202
- else {
203
- if (k || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(c) || te.test(c) || C.test(c)) break;
204
- u += `
205
- ` + b;
206
- }
207
- k = !b.trim(), g += H + `
208
- `, r = r.substring(H.length + 1), c = _.slice(w);
209
- }
210
- }
211
- a.loose || (h ? a.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (h = !0)), a.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), a.raw += g;
212
- }
213
- let o = a.items.at(-1);
214
- if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
215
- else return;
216
- a.raw = a.raw.trimEnd();
217
- for (let p of a.items) {
218
- if (this.lexer.state.top = !1, p.tokens = this.lexer.blockTokens(p.text, []), p.task) {
219
- if (p.text = p.text.replace(this.rules.other.listReplaceTask, ""), ((t = p.tokens[0]) == null ? void 0 : t.type) === "text" || ((s = p.tokens[0]) == null ? void 0 : s.type) === "paragraph") {
220
- p.tokens[0].raw = p.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), p.tokens[0].text = p.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
221
- for (let u = this.lexer.inlineQueue.length - 1; u >= 0; u--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)) {
222
- this.lexer.inlineQueue[u].src = this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask, "");
223
- break;
224
- }
225
- }
226
- let g = this.rules.other.listTaskCheckbox.exec(p.raw);
227
- if (g) {
228
- let u = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
229
- p.checked = u.checked, a.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = u.raw + p.tokens[0].raw, p.tokens[0].text = u.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(u)) : p.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : p.tokens.unshift(u);
230
- }
231
- }
232
- if (!a.loose) {
233
- let g = p.tokens.filter((c) => c.type === "space"), u = g.length > 0 && g.some((c) => this.rules.other.anyLine.test(c.raw));
234
- a.loose = u;
235
- }
236
- }
237
- if (a.loose) for (let p of a.items) {
238
- p.loose = !0;
239
- for (let g of p.tokens) g.type === "text" && (g.type = "paragraph");
240
- }
241
- return a;
242
- }
243
- }
244
- html(r) {
245
- let e = this.rules.block.html.exec(r);
246
- if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
247
- }
248
- def(r) {
249
- let e = this.rules.block.def.exec(r);
250
- if (e) {
251
- let t = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", n = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
252
- return { type: "def", tag: t, raw: e[0], href: s, title: n };
253
- }
254
- }
255
- table(r) {
256
- var a;
257
- let e = this.rules.block.table.exec(r);
258
- if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
259
- let t = ie(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), n = (a = e[3]) != null && a.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
260
- `) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
261
- if (t.length === s.length) {
262
- for (let l of s) this.rules.other.tableAlignRight.test(l) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? i.align.push("left") : i.align.push(null);
263
- for (let l = 0; l < t.length; l++) i.header.push({ text: t[l], tokens: this.lexer.inline(t[l]), header: !0, align: i.align[l] });
264
- for (let l of n) i.rows.push(ie(l, i.header.length).map((h, o) => ({ text: h, tokens: this.lexer.inline(h), header: !1, align: i.align[o] })));
265
- return i;
266
- }
267
- }
268
- lheading(r) {
269
- let e = this.rules.block.lheading.exec(r);
270
- if (e) return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: e[1], tokens: this.lexer.inline(e[1]) };
271
- }
272
- paragraph(r) {
273
- let e = this.rules.block.paragraph.exec(r);
274
- if (e) {
275
- let t = e[1].charAt(e[1].length - 1) === `
276
- ` ? e[1].slice(0, -1) : e[1];
277
- return { type: "paragraph", raw: e[0], text: t, tokens: this.lexer.inline(t) };
278
- }
279
- }
280
- text(r) {
281
- let e = this.rules.block.text.exec(r);
282
- if (e) return { type: "text", raw: e[0], text: e[0], tokens: this.lexer.inline(e[0]) };
283
- }
284
- escape(r) {
285
- let e = this.rules.inline.escape.exec(r);
286
- if (e) return { type: "escape", raw: e[0], text: e[1] };
287
- }
288
- tag(r) {
289
- let e = this.rules.inline.tag.exec(r);
290
- if (e) return !this.lexer.state.inLink && this.rules.other.startATag.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(e[0]) && (this.lexer.state.inRawBlock = !1), { type: "html", raw: e[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: !1, text: e[0] };
291
- }
292
- link(r) {
293
- let e = this.rules.inline.link.exec(r);
294
- if (e) {
295
- let t = e[2].trim();
296
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(t)) {
297
- if (!this.rules.other.endAngleBracket.test(t)) return;
298
- let i = I(t.slice(0, -1), "\\");
299
- if ((t.length - i.length) % 2 === 0) return;
300
- } else {
301
- let i = ht(e[2], "()");
302
- if (i === -2) return;
303
- if (i > -1) {
304
- let a = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
305
- e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, a).trim(), e[3] = "";
306
- }
307
- }
308
- let s = e[2], n = "";
309
- if (this.options.pedantic) {
310
- let i = this.rules.other.pedanticHrefTitle.exec(s);
311
- i && (s = i[1], n = i[3]);
312
- } else n = e[3] ? e[3].slice(1, -1) : "";
313
- return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? s = s.slice(1) : s = s.slice(1, -1)), ae(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: n && n.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
314
- }
315
- }
316
- reflink(r, e) {
317
- let t;
318
- if ((t = this.rules.inline.reflink.exec(r)) || (t = this.rules.inline.nolink.exec(r))) {
319
- let s = (t[2] || t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = e[s.toLowerCase()];
320
- if (!n) {
321
- let i = t[0].charAt(0);
322
- return { type: "text", raw: i, text: i };
323
- }
324
- return ae(t, n, t[0], this.lexer, this.rules);
325
- }
326
- }
327
- emStrong(r, e, t = "") {
328
- let s = this.rules.inline.emStrongLDelim.exec(r);
329
- if (!(!s || s[3] && t.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !t || this.rules.inline.punctuation.exec(t))) {
330
- let n = [...s[0]].length - 1, i, a, l = n, h = 0, o = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
331
- for (o.lastIndex = 0, e = e.slice(-1 * r.length + n); (s = o.exec(e)) != null; ) {
332
- if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
333
- if (a = [...i].length, s[3] || s[4]) {
334
- l += a;
335
- continue;
336
- } else if ((s[5] || s[6]) && n % 3 && !((n + a) % 3)) {
337
- h += a;
338
- continue;
339
- }
340
- if (l -= a, l > 0) continue;
341
- a = Math.min(a, a + l + h);
342
- let p = [...s[0]][0].length, g = r.slice(0, n + s.index + p + a);
343
- if (Math.min(n, a) % 2) {
344
- let c = g.slice(1, -1);
345
- return { type: "em", raw: g, text: c, tokens: this.lexer.inlineTokens(c) };
346
- }
347
- let u = g.slice(2, -2);
348
- return { type: "strong", raw: g, text: u, tokens: this.lexer.inlineTokens(u) };
349
- }
350
- }
351
- }
352
- codespan(r) {
353
- let e = this.rules.inline.code.exec(r);
354
- if (e) {
355
- let t = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(t), n = this.rules.other.startingSpaceChar.test(t) && this.rules.other.endingSpaceChar.test(t);
356
- return s && n && (t = t.substring(1, t.length - 1)), { type: "codespan", raw: e[0], text: t };
357
- }
358
- }
359
- br(r) {
360
- let e = this.rules.inline.br.exec(r);
361
- if (e) return { type: "br", raw: e[0] };
362
- }
363
- del(r, e, t = "") {
364
- let s = this.rules.inline.delLDelim.exec(r);
365
- if (s && (!s[1] || !t || this.rules.inline.punctuation.exec(t))) {
366
- let n = [...s[0]].length - 1, i, a, l = n, h = this.rules.inline.delRDelim;
367
- for (h.lastIndex = 0, e = e.slice(-1 * r.length + n); (s = h.exec(e)) != null; ) {
368
- if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (a = [...i].length, a !== n)) continue;
369
- if (s[3] || s[4]) {
370
- l += a;
371
- continue;
372
- }
373
- if (l -= a, l > 0) continue;
374
- a = Math.min(a, a + l);
375
- let o = [...s[0]][0].length, p = r.slice(0, n + s.index + o + a), g = p.slice(n, -n);
376
- return { type: "del", raw: p, text: g, tokens: this.lexer.inlineTokens(g) };
377
- }
378
- }
379
- }
380
- autolink(r) {
381
- let e = this.rules.inline.autolink.exec(r);
382
- if (e) {
383
- let t, s;
384
- return e[2] === "@" ? (t = e[1], s = "mailto:" + t) : (t = e[1], s = t), { type: "link", raw: e[0], text: t, href: s, tokens: [{ type: "text", raw: t, text: t }] };
385
- }
386
- }
387
- url(r) {
388
- var t;
389
- let e;
390
- if (e = this.rules.inline.url.exec(r)) {
391
- let s, n;
392
- if (e[2] === "@") s = e[0], n = "mailto:" + s;
393
- else {
394
- let i;
395
- do
396
- i = e[0], e[0] = ((t = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : t[0]) ?? "";
397
- while (i !== e[0]);
398
- s = e[0], e[1] === "www." ? n = "http://" + e[0] : n = e[0];
399
- }
400
- return { type: "link", raw: e[0], text: s, href: n, tokens: [{ type: "text", raw: s, text: s }] };
401
- }
402
- }
403
- inlineText(r) {
404
- let e = this.rules.inline.text.exec(r);
405
- if (e) {
406
- let t = this.lexer.state.inRawBlock;
407
- return { type: "text", raw: e[0], text: e[0], escaped: t };
408
- }
409
- }
410
- }, y = class O {
411
- constructor(e) {
412
- x(this, "tokens");
413
- x(this, "options");
414
- x(this, "state");
415
- x(this, "inlineQueue");
416
- x(this, "tokenizer");
417
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || z, this.options.tokenizer = this.options.tokenizer || new Z(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
418
- let t = { other: m, block: q.normal, inline: P.normal };
419
- this.options.pedantic ? (t.block = q.pedantic, t.inline = P.pedantic) : this.options.gfm && (t.block = q.gfm, this.options.breaks ? t.inline = P.breaks : t.inline = P.gfm), this.tokenizer.rules = t;
420
- }
421
- static get rules() {
422
- return { block: q, inline: P };
423
- }
424
- static lex(e, t) {
425
- return new O(t).lex(e);
426
- }
427
- static lexInline(e, t) {
428
- return new O(t).inlineTokens(e);
429
- }
430
- lex(e) {
431
- e = e.replace(m.carriageReturn, `
432
- `), this.blockTokens(e, this.tokens);
433
- for (let t = 0; t < this.inlineQueue.length; t++) {
434
- let s = this.inlineQueue[t];
435
- this.inlineTokens(s.src, s.tokens);
436
- }
437
- return this.inlineQueue = [], this.tokens;
438
- }
439
- blockTokens(e, t = [], s = !1) {
440
- var n, i, a;
441
- for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
442
- let l;
443
- if ((i = (n = this.options.extensions) == null ? void 0 : n.block) != null && i.some((o) => (l = o.call({ lexer: this }, e, t)) ? (e = e.substring(l.raw.length), t.push(l), !0) : !1)) continue;
444
- if (l = this.tokenizer.space(e)) {
445
- e = e.substring(l.raw.length);
446
- let o = t.at(-1);
447
- l.raw.length === 1 && o !== void 0 ? o.raw += `
448
- ` : t.push(l);
449
- continue;
450
- }
451
- if (l = this.tokenizer.code(e)) {
452
- e = e.substring(l.raw.length);
453
- let o = t.at(-1);
454
- (o == null ? void 0 : o.type) === "paragraph" || (o == null ? void 0 : o.type) === "text" ? (o.raw += (o.raw.endsWith(`
455
- `) ? "" : `
456
- `) + l.raw, o.text += `
457
- ` + l.text, this.inlineQueue.at(-1).src = o.text) : t.push(l);
458
- continue;
459
- }
460
- if (l = this.tokenizer.fences(e)) {
461
- e = e.substring(l.raw.length), t.push(l);
462
- continue;
463
- }
464
- if (l = this.tokenizer.heading(e)) {
465
- e = e.substring(l.raw.length), t.push(l);
466
- continue;
467
- }
468
- if (l = this.tokenizer.hr(e)) {
469
- e = e.substring(l.raw.length), t.push(l);
470
- continue;
471
- }
472
- if (l = this.tokenizer.blockquote(e)) {
473
- e = e.substring(l.raw.length), t.push(l);
474
- continue;
475
- }
476
- if (l = this.tokenizer.list(e)) {
477
- e = e.substring(l.raw.length), t.push(l);
478
- continue;
479
- }
480
- if (l = this.tokenizer.html(e)) {
481
- e = e.substring(l.raw.length), t.push(l);
482
- continue;
483
- }
484
- if (l = this.tokenizer.def(e)) {
485
- e = e.substring(l.raw.length);
486
- let o = t.at(-1);
487
- (o == null ? void 0 : o.type) === "paragraph" || (o == null ? void 0 : o.type) === "text" ? (o.raw += (o.raw.endsWith(`
488
- `) ? "" : `
489
- `) + l.raw, o.text += `
490
- ` + l.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[l.tag] || (this.tokens.links[l.tag] = { href: l.href, title: l.title }, t.push(l));
491
- continue;
492
- }
493
- if (l = this.tokenizer.table(e)) {
494
- e = e.substring(l.raw.length), t.push(l);
495
- continue;
496
- }
497
- if (l = this.tokenizer.lheading(e)) {
498
- e = e.substring(l.raw.length), t.push(l);
499
- continue;
500
- }
501
- let h = e;
502
- if ((a = this.options.extensions) != null && a.startBlock) {
503
- let o = 1 / 0, p = e.slice(1), g;
504
- this.options.extensions.startBlock.forEach((u) => {
505
- g = u.call({ lexer: this }, p), typeof g == "number" && g >= 0 && (o = Math.min(o, g));
506
- }), o < 1 / 0 && o >= 0 && (h = e.substring(0, o + 1));
507
- }
508
- if (this.state.top && (l = this.tokenizer.paragraph(h))) {
509
- let o = t.at(-1);
510
- s && (o == null ? void 0 : o.type) === "paragraph" ? (o.raw += (o.raw.endsWith(`
511
- `) ? "" : `
512
- `) + l.raw, o.text += `
513
- ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(l), s = h.length !== e.length, e = e.substring(l.raw.length);
514
- continue;
515
- }
516
- if (l = this.tokenizer.text(e)) {
517
- e = e.substring(l.raw.length);
518
- let o = t.at(-1);
519
- (o == null ? void 0 : o.type) === "text" ? (o.raw += (o.raw.endsWith(`
520
- `) ? "" : `
521
- `) + l.raw, o.text += `
522
- ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(l);
523
- continue;
524
- }
525
- if (e) {
526
- let o = "Infinite loop on byte: " + e.charCodeAt(0);
527
- if (this.options.silent) {
528
- console.error(o);
529
- break;
530
- } else throw new Error(o);
531
- }
532
- }
533
- return this.state.top = !0, t;
534
- }
535
- inline(e, t = []) {
536
- return this.inlineQueue.push({ src: e, tokens: t }), t;
537
- }
538
- inlineTokens(e, t = []) {
539
- var h, o, p, g, u;
540
- let s = e, n = null;
541
- if (this.tokens.links) {
542
- let c = Object.keys(this.tokens.links);
543
- if (c.length > 0) for (; (n = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; ) c.includes(n[0].slice(n[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, n.index) + "[" + "a".repeat(n[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
544
- }
545
- for (; (n = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, n.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
546
- let i;
547
- for (; (n = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) i = n[2] ? n[2].length : 0, s = s.slice(0, n.index + i) + "[" + "a".repeat(n[0].length - i - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
548
- s = ((o = (h = this.options.hooks) == null ? void 0 : h.emStrongMask) == null ? void 0 : o.call({ lexer: this }, s)) ?? s;
549
- let a = !1, l = "";
550
- for (; e; ) {
551
- a || (l = ""), a = !1;
552
- let c;
553
- if ((g = (p = this.options.extensions) == null ? void 0 : p.inline) != null && g.some((k) => (c = k.call({ lexer: this }, e, t)) ? (e = e.substring(c.raw.length), t.push(c), !0) : !1)) continue;
554
- if (c = this.tokenizer.escape(e)) {
555
- e = e.substring(c.raw.length), t.push(c);
556
- continue;
557
- }
558
- if (c = this.tokenizer.tag(e)) {
559
- e = e.substring(c.raw.length), t.push(c);
560
- continue;
561
- }
562
- if (c = this.tokenizer.link(e)) {
563
- e = e.substring(c.raw.length), t.push(c);
564
- continue;
565
- }
566
- if (c = this.tokenizer.reflink(e, this.tokens.links)) {
567
- e = e.substring(c.raw.length);
568
- let k = t.at(-1);
569
- c.type === "text" && (k == null ? void 0 : k.type) === "text" ? (k.raw += c.raw, k.text += c.text) : t.push(c);
570
- continue;
571
- }
572
- if (c = this.tokenizer.emStrong(e, s, l)) {
573
- e = e.substring(c.raw.length), t.push(c);
574
- continue;
575
- }
576
- if (c = this.tokenizer.codespan(e)) {
577
- e = e.substring(c.raw.length), t.push(c);
578
- continue;
579
- }
580
- if (c = this.tokenizer.br(e)) {
581
- e = e.substring(c.raw.length), t.push(c);
582
- continue;
583
- }
584
- if (c = this.tokenizer.del(e, s, l)) {
585
- e = e.substring(c.raw.length), t.push(c);
586
- continue;
587
- }
588
- if (c = this.tokenizer.autolink(e)) {
589
- e = e.substring(c.raw.length), t.push(c);
590
- continue;
591
- }
592
- if (!this.state.inLink && (c = this.tokenizer.url(e))) {
593
- e = e.substring(c.raw.length), t.push(c);
594
- continue;
595
- }
596
- let b = e;
597
- if ((u = this.options.extensions) != null && u.startInline) {
598
- let k = 1 / 0, w = e.slice(1), A;
599
- this.options.extensions.startInline.forEach((C) => {
600
- A = C.call({ lexer: this }, w), typeof A == "number" && A >= 0 && (k = Math.min(k, A));
601
- }), k < 1 / 0 && k >= 0 && (b = e.substring(0, k + 1));
602
- }
603
- if (c = this.tokenizer.inlineText(b)) {
604
- e = e.substring(c.raw.length), c.raw.slice(-1) !== "_" && (l = c.raw.slice(-1)), a = !0;
605
- let k = t.at(-1);
606
- (k == null ? void 0 : k.type) === "text" ? (k.raw += c.raw, k.text += c.text) : t.push(c);
607
- continue;
608
- }
609
- if (e) {
610
- let k = "Infinite loop on byte: " + e.charCodeAt(0);
611
- if (this.options.silent) {
612
- console.error(k);
613
- break;
614
- } else throw new Error(k);
615
- }
616
- }
617
- return t;
618
- }
619
- }, D = class {
620
- constructor(r) {
621
- x(this, "options");
622
- x(this, "parser");
623
- this.options = r || z;
624
- }
625
- space(r) {
626
- return "";
627
- }
628
- code({ text: r, lang: e, escaped: t }) {
629
- var i;
630
- let s = (i = (e || "").match(m.notSpaceStart)) == null ? void 0 : i[0], n = r.replace(m.endingNewline, "") + `
631
- `;
632
- return s ? '<pre><code class="language-' + $(s) + '">' + (t ? n : $(n, !0)) + `</code></pre>
633
- ` : "<pre><code>" + (t ? n : $(n, !0)) + `</code></pre>
634
- `;
635
- }
636
- blockquote({ tokens: r }) {
637
- return `<blockquote>
638
- ${this.parser.parse(r)}</blockquote>
639
- `;
640
- }
641
- html({ text: r }) {
642
- return r;
643
- }
644
- def(r) {
645
- return "";
646
- }
647
- heading({ tokens: r, depth: e }) {
648
- return `<h${e}>${this.parser.parseInline(r)}</h${e}>
649
- `;
650
- }
651
- hr(r) {
652
- return `<hr>
653
- `;
654
- }
655
- list(r) {
656
- let e = r.ordered, t = r.start, s = "";
657
- for (let a = 0; a < r.items.length; a++) {
658
- let l = r.items[a];
659
- s += this.listitem(l);
660
- }
661
- let n = e ? "ol" : "ul", i = e && t !== 1 ? ' start="' + t + '"' : "";
662
- return "<" + n + i + `>
663
- ` + s + "</" + n + `>
664
- `;
665
- }
666
- listitem(r) {
667
- return `<li>${this.parser.parse(r.tokens)}</li>
668
- `;
669
- }
670
- checkbox({ checked: r }) {
671
- return "<input " + (r ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
672
- }
673
- paragraph({ tokens: r }) {
674
- return `<p>${this.parser.parseInline(r)}</p>
675
- `;
676
- }
677
- table(r) {
678
- let e = "", t = "";
679
- for (let n = 0; n < r.header.length; n++) t += this.tablecell(r.header[n]);
680
- e += this.tablerow({ text: t });
681
- let s = "";
682
- for (let n = 0; n < r.rows.length; n++) {
683
- let i = r.rows[n];
684
- t = "";
685
- for (let a = 0; a < i.length; a++) t += this.tablecell(i[a]);
686
- s += this.tablerow({ text: t });
687
- }
688
- return s && (s = `<tbody>${s}</tbody>`), `<table>
689
- <thead>
690
- ` + e + `</thead>
691
- ` + s + `</table>
692
- `;
693
- }
694
- tablerow({ text: r }) {
695
- return `<tr>
696
- ${r}</tr>
697
- `;
698
- }
699
- tablecell(r) {
700
- let e = this.parser.parseInline(r.tokens), t = r.header ? "th" : "td";
701
- return (r.align ? `<${t} align="${r.align}">` : `<${t}>`) + e + `</${t}>
702
- `;
703
- }
704
- strong({ tokens: r }) {
705
- return `<strong>${this.parser.parseInline(r)}</strong>`;
706
- }
707
- em({ tokens: r }) {
708
- return `<em>${this.parser.parseInline(r)}</em>`;
709
- }
710
- codespan({ text: r }) {
711
- return `<code>${$(r, !0)}</code>`;
712
- }
713
- br(r) {
714
- return "<br>";
715
- }
716
- del({ tokens: r }) {
717
- return `<del>${this.parser.parseInline(r)}</del>`;
718
- }
719
- link({ href: r, title: e, tokens: t }) {
720
- let s = this.parser.parseInline(t), n = le(r);
721
- if (n === null) return s;
722
- r = n;
723
- let i = '<a href="' + r + '"';
724
- return e && (i += ' title="' + $(e) + '"'), i += ">" + s + "</a>", i;
725
- }
726
- image({ href: r, title: e, text: t, tokens: s }) {
727
- s && (t = this.parser.parseInline(s, this.parser.textRenderer));
728
- let n = le(r);
729
- if (n === null) return $(t);
730
- r = n;
731
- let i = `<img src="${r}" alt="${$(t)}"`;
732
- return e && (i += ` title="${$(e)}"`), i += ">", i;
733
- }
734
- text(r) {
735
- return "tokens" in r && r.tokens ? this.parser.parseInline(r.tokens) : "escaped" in r && r.escaped ? r.text : $(r.text);
736
- }
737
- }, Y = class {
738
- strong({ text: r }) {
739
- return r;
740
- }
741
- em({ text: r }) {
742
- return r;
743
- }
744
- codespan({ text: r }) {
745
- return r;
746
- }
747
- del({ text: r }) {
748
- return r;
749
- }
750
- html({ text: r }) {
751
- return r;
752
- }
753
- text({ text: r }) {
754
- return r;
755
- }
756
- link({ text: r }) {
757
- return "" + r;
758
- }
759
- image({ text: r }) {
760
- return "" + r;
761
- }
762
- br() {
763
- return "";
764
- }
765
- checkbox({ raw: r }) {
766
- return r;
767
- }
768
- }, S = class j {
769
- constructor(e) {
770
- x(this, "options");
771
- x(this, "renderer");
772
- x(this, "textRenderer");
773
- this.options = e || z, this.options.renderer = this.options.renderer || new D(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Y();
774
- }
775
- static parse(e, t) {
776
- return new j(t).parse(e);
777
- }
778
- static parseInline(e, t) {
779
- return new j(t).parseInline(e);
780
- }
781
- parse(e) {
782
- var s, n;
783
- let t = "";
784
- for (let i = 0; i < e.length; i++) {
785
- let a = e[i];
786
- if ((n = (s = this.options.extensions) == null ? void 0 : s.renderers) != null && n[a.type]) {
787
- let h = a, o = this.options.extensions.renderers[h.type].call({ parser: this }, h);
788
- if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(h.type)) {
789
- t += o || "";
790
- continue;
791
- }
792
- }
793
- let l = a;
794
- switch (l.type) {
795
- case "space": {
796
- t += this.renderer.space(l);
797
- break;
798
- }
799
- case "hr": {
800
- t += this.renderer.hr(l);
801
- break;
802
- }
803
- case "heading": {
804
- t += this.renderer.heading(l);
805
- break;
806
- }
807
- case "code": {
808
- t += this.renderer.code(l);
809
- break;
810
- }
811
- case "table": {
812
- t += this.renderer.table(l);
813
- break;
814
- }
815
- case "blockquote": {
816
- t += this.renderer.blockquote(l);
817
- break;
818
- }
819
- case "list": {
820
- t += this.renderer.list(l);
821
- break;
822
- }
823
- case "checkbox": {
824
- t += this.renderer.checkbox(l);
825
- break;
826
- }
827
- case "html": {
828
- t += this.renderer.html(l);
829
- break;
830
- }
831
- case "def": {
832
- t += this.renderer.def(l);
833
- break;
834
- }
835
- case "paragraph": {
836
- t += this.renderer.paragraph(l);
837
- break;
838
- }
839
- case "text": {
840
- t += this.renderer.text(l);
841
- break;
842
- }
843
- default: {
844
- let h = 'Token with "' + l.type + '" type was not found.';
845
- if (this.options.silent) return console.error(h), "";
846
- throw new Error(h);
847
- }
848
- }
849
- }
850
- return t;
851
- }
852
- parseInline(e, t = this.renderer) {
853
- var n, i;
854
- let s = "";
855
- for (let a = 0; a < e.length; a++) {
856
- let l = e[a];
857
- if ((i = (n = this.options.extensions) == null ? void 0 : n.renderers) != null && i[l.type]) {
858
- let o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
859
- if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(l.type)) {
860
- s += o || "";
861
- continue;
862
- }
863
- }
864
- let h = l;
865
- switch (h.type) {
866
- case "escape": {
867
- s += t.text(h);
868
- break;
869
- }
870
- case "html": {
871
- s += t.html(h);
872
- break;
873
- }
874
- case "link": {
875
- s += t.link(h);
876
- break;
877
- }
878
- case "image": {
879
- s += t.image(h);
880
- break;
881
- }
882
- case "checkbox": {
883
- s += t.checkbox(h);
884
- break;
885
- }
886
- case "strong": {
887
- s += t.strong(h);
888
- break;
889
- }
890
- case "em": {
891
- s += t.em(h);
892
- break;
893
- }
894
- case "codespan": {
895
- s += t.codespan(h);
896
- break;
897
- }
898
- case "br": {
899
- s += t.br(h);
900
- break;
901
- }
902
- case "del": {
903
- s += t.del(h);
904
- break;
905
- }
906
- case "text": {
907
- s += t.text(h);
908
- break;
909
- }
910
- default: {
911
- let o = 'Token with "' + h.type + '" type was not found.';
912
- if (this.options.silent) return console.error(o), "";
913
- throw new Error(o);
914
- }
915
- }
916
- }
917
- return s;
918
- }
919
- }, v, L = (v = class {
920
- constructor(r) {
921
- x(this, "options");
922
- x(this, "block");
923
- this.options = r || z;
924
- }
925
- preprocess(r) {
926
- return r;
927
- }
928
- postprocess(r) {
929
- return r;
930
- }
931
- processAllTokens(r) {
932
- return r;
933
- }
934
- emStrongMask(r) {
935
- return r;
936
- }
937
- provideLexer() {
938
- return this.block ? y.lex : y.lexInline;
939
- }
940
- provideParser() {
941
- return this.block ? S.parse : S.parseInline;
942
- }
943
- }, x(v, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), x(v, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), v), gt = class {
944
- constructor(...r) {
945
- x(this, "defaults", G());
946
- x(this, "options", this.setOptions);
947
- x(this, "parse", this.parseMarkdown(!0));
948
- x(this, "parseInline", this.parseMarkdown(!1));
949
- x(this, "Parser", S);
950
- x(this, "Renderer", D);
951
- x(this, "TextRenderer", Y);
952
- x(this, "Lexer", y);
953
- x(this, "Tokenizer", Z);
954
- x(this, "Hooks", L);
955
- this.use(...r);
956
- }
957
- walkTokens(r, e) {
958
- var s, n;
959
- let t = [];
960
- for (let i of r) switch (t = t.concat(e.call(this, i)), i.type) {
961
- case "table": {
962
- let a = i;
963
- for (let l of a.header) t = t.concat(this.walkTokens(l.tokens, e));
964
- for (let l of a.rows) for (let h of l) t = t.concat(this.walkTokens(h.tokens, e));
965
- break;
966
- }
967
- case "list": {
968
- let a = i;
969
- t = t.concat(this.walkTokens(a.items, e));
970
- break;
971
- }
972
- default: {
973
- let a = i;
974
- (n = (s = this.defaults.extensions) == null ? void 0 : s.childTokens) != null && n[a.type] ? this.defaults.extensions.childTokens[a.type].forEach((l) => {
975
- let h = a[l].flat(1 / 0);
976
- t = t.concat(this.walkTokens(h, e));
977
- }) : a.tokens && (t = t.concat(this.walkTokens(a.tokens, e)));
978
- }
979
- }
980
- return t;
981
- }
982
- use(...r) {
983
- let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
984
- return r.forEach((t) => {
985
- let s = { ...t };
986
- if (s.async = this.defaults.async || s.async || !1, t.extensions && (t.extensions.forEach((n) => {
987
- if (!n.name) throw new Error("extension name required");
988
- if ("renderer" in n) {
989
- let i = e.renderers[n.name];
990
- i ? e.renderers[n.name] = function(...a) {
991
- let l = n.renderer.apply(this, a);
992
- return l === !1 && (l = i.apply(this, a)), l;
993
- } : e.renderers[n.name] = n.renderer;
994
- }
995
- if ("tokenizer" in n) {
996
- if (!n.level || n.level !== "block" && n.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
997
- let i = e[n.level];
998
- i ? i.unshift(n.tokenizer) : e[n.level] = [n.tokenizer], n.start && (n.level === "block" ? e.startBlock ? e.startBlock.push(n.start) : e.startBlock = [n.start] : n.level === "inline" && (e.startInline ? e.startInline.push(n.start) : e.startInline = [n.start]));
999
- }
1000
- "childTokens" in n && n.childTokens && (e.childTokens[n.name] = n.childTokens);
1001
- }), s.extensions = e), t.renderer) {
1002
- let n = this.defaults.renderer || new D(this.defaults);
1003
- for (let i in t.renderer) {
1004
- if (!(i in n)) throw new Error(`renderer '${i}' does not exist`);
1005
- if (["options", "parser"].includes(i)) continue;
1006
- let a = i, l = t.renderer[a], h = n[a];
1007
- n[a] = (...o) => {
1008
- let p = l.apply(n, o);
1009
- return p === !1 && (p = h.apply(n, o)), p || "";
1010
- };
1011
- }
1012
- s.renderer = n;
1013
- }
1014
- if (t.tokenizer) {
1015
- let n = this.defaults.tokenizer || new Z(this.defaults);
1016
- for (let i in t.tokenizer) {
1017
- if (!(i in n)) throw new Error(`tokenizer '${i}' does not exist`);
1018
- if (["options", "rules", "lexer"].includes(i)) continue;
1019
- let a = i, l = t.tokenizer[a], h = n[a];
1020
- n[a] = (...o) => {
1021
- let p = l.apply(n, o);
1022
- return p === !1 && (p = h.apply(n, o)), p;
1023
- };
1024
- }
1025
- s.tokenizer = n;
1026
- }
1027
- if (t.hooks) {
1028
- let n = this.defaults.hooks || new L();
1029
- for (let i in t.hooks) {
1030
- if (!(i in n)) throw new Error(`hook '${i}' does not exist`);
1031
- if (["options", "block"].includes(i)) continue;
1032
- let a = i, l = t.hooks[a], h = n[a];
1033
- L.passThroughHooks.has(i) ? n[a] = (o) => {
1034
- if (this.defaults.async && L.passThroughHooksRespectAsync.has(i)) return (async () => {
1035
- let g = await l.call(n, o);
1036
- return h.call(n, g);
1037
- })();
1038
- let p = l.call(n, o);
1039
- return h.call(n, p);
1040
- } : n[a] = (...o) => {
1041
- if (this.defaults.async) return (async () => {
1042
- let g = await l.apply(n, o);
1043
- return g === !1 && (g = await h.apply(n, o)), g;
1044
- })();
1045
- let p = l.apply(n, o);
1046
- return p === !1 && (p = h.apply(n, o)), p;
1047
- };
1048
- }
1049
- s.hooks = n;
1050
- }
1051
- if (t.walkTokens) {
1052
- let n = this.defaults.walkTokens, i = t.walkTokens;
1053
- s.walkTokens = function(a) {
1054
- let l = [];
1055
- return l.push(i.call(this, a)), n && (l = l.concat(n.call(this, a))), l;
1056
- };
1057
- }
1058
- this.defaults = { ...this.defaults, ...s };
1059
- }), this;
1060
- }
1061
- setOptions(r) {
1062
- return this.defaults = { ...this.defaults, ...r }, this;
1063
- }
1064
- lexer(r, e) {
1065
- return y.lex(r, e ?? this.defaults);
1066
- }
1067
- parser(r, e) {
1068
- return S.parse(r, e ?? this.defaults);
1069
- }
1070
- parseMarkdown(r) {
1071
- return (e, t) => {
1072
- let s = { ...t }, n = { ...this.defaults, ...s }, i = this.onError(!!n.silent, !!n.async);
1073
- if (this.defaults.async === !0 && s.async === !1) return i(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."));
1074
- if (typeof e > "u" || e === null) return i(new Error("marked(): input parameter is undefined or null"));
1075
- if (typeof e != "string") return i(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1076
- if (n.hooks && (n.hooks.options = n, n.hooks.block = r), n.async) return (async () => {
1077
- let a = n.hooks ? await n.hooks.preprocess(e) : e, l = await (n.hooks ? await n.hooks.provideLexer() : r ? y.lex : y.lexInline)(a, n), h = n.hooks ? await n.hooks.processAllTokens(l) : l;
1078
- n.walkTokens && await Promise.all(this.walkTokens(h, n.walkTokens));
1079
- let o = await (n.hooks ? await n.hooks.provideParser() : r ? S.parse : S.parseInline)(h, n);
1080
- return n.hooks ? await n.hooks.postprocess(o) : o;
1081
- })().catch(i);
1082
- try {
1083
- n.hooks && (e = n.hooks.preprocess(e));
1084
- let a = (n.hooks ? n.hooks.provideLexer() : r ? y.lex : y.lexInline)(e, n);
1085
- n.hooks && (a = n.hooks.processAllTokens(a)), n.walkTokens && this.walkTokens(a, n.walkTokens);
1086
- let l = (n.hooks ? n.hooks.provideParser() : r ? S.parse : S.parseInline)(a, n);
1087
- return n.hooks && (l = n.hooks.postprocess(l)), l;
1088
- } catch (a) {
1089
- return i(a);
1090
- }
1091
- };
1092
- }
1093
- onError(r, e) {
1094
- return (t) => {
1095
- if (t.message += `
1096
- Please report this to https://github.com/markedjs/marked.`, r) {
1097
- let s = "<p>An error occurred:</p><pre>" + $(t.message + "", !0) + "</pre>";
1098
- return e ? Promise.resolve(s) : s;
1099
- }
1100
- if (e) return Promise.reject(t);
1101
- throw t;
1102
- };
1103
- }
1104
- }, T = new gt();
1105
- function d(r, e) {
1106
- return T.parse(r, e);
1107
- }
1108
- d.options = d.setOptions = function(r) {
1109
- return T.setOptions(r), d.defaults = T.defaults, oe(d.defaults), d;
1110
- };
1111
- d.getDefaults = G;
1112
- d.defaults = z;
1113
- d.use = function(...r) {
1114
- return T.use(...r), d.defaults = T.defaults, oe(d.defaults), d;
1115
- };
1116
- d.walkTokens = function(r, e) {
1117
- return T.walkTokens(r, e);
1118
- };
1119
- d.parseInline = T.parseInline;
1120
- d.Parser = S;
1121
- d.parser = S.parse;
1122
- d.Renderer = D;
1123
- d.TextRenderer = Y;
1124
- d.Lexer = y;
1125
- d.lexer = y.lex;
1126
- d.Tokenizer = Z;
1127
- d.Hooks = L;
1128
- d.parse = d;
1129
- d.options;
1130
- d.setOptions;
1131
- d.use;
1132
- d.walkTokens;
1133
- d.parseInline;
1134
- S.parse;
1135
- y.lex;
1136
- function dt(r) {
1137
- if (!r) return "";
1138
- const e = d.parse(r);
1139
- return Re.sanitize(e);
1140
- }
1141
- export {
1142
- dt as default
1143
- };
1
+ import { t as e } from "../../../../convertMdToHtml-Bmk0brLK.js";
2
+ export { e as default };