@signalwire/web-components 4.0.0-beta.8 → 4.0.0-dev-20260515133934

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 (362) hide show
  1. package/README.md +48 -55
  2. package/dist/_virtual/_commonjsHelpers.js +9 -0
  3. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  4. package/dist/_virtual/prism-python.js +28 -0
  5. package/dist/_virtual/prism-python.js.map +1 -0
  6. package/dist/_virtual/prism-python2.js +5 -0
  7. package/dist/_virtual/prism-python2.js.map +1 -0
  8. package/dist/_virtual/prism-typescript.js +28 -0
  9. package/dist/_virtual/prism-typescript.js.map +1 -0
  10. package/dist/_virtual/prism-typescript2.js +5 -0
  11. package/dist/_virtual/prism-typescript2.js.map +1 -0
  12. package/dist/_virtual/prism.js +28 -0
  13. package/dist/_virtual/prism.js.map +1 -0
  14. package/dist/_virtual/prism2.js +5 -0
  15. package/dist/_virtual/prism2.js.map +1 -0
  16. package/dist/assets/sw_background.webp.js +5 -0
  17. package/dist/assets/sw_background.webp.js.map +1 -0
  18. package/dist/components/UI/DEFAULT_BACKGROUND.d.ts +4 -0
  19. package/dist/components/UI/DEFAULT_BACKGROUND.d.ts.map +1 -0
  20. package/dist/components/UI/DEFAULT_BACKGROUND.js +5 -0
  21. package/dist/components/UI/DEFAULT_BACKGROUND.js.map +1 -0
  22. package/dist/components/UI/controls/sw-ui-control-bar.d.ts +114 -0
  23. package/dist/components/UI/controls/sw-ui-control-bar.d.ts.map +1 -0
  24. package/dist/components/UI/controls/sw-ui-control-bar.js +324 -0
  25. package/dist/components/UI/controls/sw-ui-control-bar.js.map +1 -0
  26. package/dist/components/UI/controls/sw-ui-dialpad.d.ts +67 -0
  27. package/dist/components/UI/controls/sw-ui-dialpad.d.ts.map +1 -0
  28. package/dist/components/UI/controls/sw-ui-dialpad.js +360 -0
  29. package/dist/components/UI/controls/sw-ui-dialpad.js.map +1 -0
  30. package/dist/components/UI/controls/sw-ui-dropup.d.ts +42 -0
  31. package/dist/components/UI/controls/sw-ui-dropup.d.ts.map +1 -0
  32. package/dist/components/UI/controls/sw-ui-dropup.js +138 -0
  33. package/dist/components/UI/controls/sw-ui-dropup.js.map +1 -0
  34. package/dist/components/UI/controls/sw-ui-split-button.d.ts +44 -0
  35. package/dist/components/UI/controls/sw-ui-split-button.d.ts.map +1 -0
  36. package/dist/components/UI/controls/sw-ui-split-button.js +178 -0
  37. package/dist/components/UI/controls/sw-ui-split-button.js.map +1 -0
  38. package/dist/components/UI/host-reset.d.ts +16 -0
  39. package/dist/components/UI/host-reset.d.ts.map +1 -0
  40. package/dist/components/UI/host-reset.js +20 -0
  41. package/dist/components/UI/host-reset.js.map +1 -0
  42. package/dist/components/UI/icons/backspace.svg.js +10 -0
  43. package/dist/components/UI/icons/backspace.svg.js.map +1 -0
  44. package/dist/components/UI/icons/camera-off.svg.js +8 -0
  45. package/dist/components/UI/icons/camera-off.svg.js.map +1 -0
  46. package/dist/components/UI/icons/camera-on.svg.js +8 -0
  47. package/dist/components/UI/icons/camera-on.svg.js.map +1 -0
  48. package/dist/components/UI/icons/check-circle.svg.js +6 -0
  49. package/dist/components/UI/icons/check-circle.svg.js.map +1 -0
  50. package/dist/components/UI/icons/chevron-up.svg.js +8 -0
  51. package/dist/components/UI/icons/chevron-up.svg.js.map +1 -0
  52. package/dist/components/UI/icons/close.svg.js +6 -0
  53. package/dist/components/UI/icons/close.svg.js.map +1 -0
  54. package/dist/components/UI/icons/copy.svg.js +6 -0
  55. package/dist/components/UI/icons/copy.svg.js.map +1 -0
  56. package/dist/components/UI/icons/download.svg.js +6 -0
  57. package/dist/components/UI/icons/download.svg.js.map +1 -0
  58. package/dist/components/UI/icons/fullscreen-exit.svg.js +8 -0
  59. package/dist/components/UI/icons/fullscreen-exit.svg.js.map +1 -0
  60. package/dist/components/UI/icons/fullscreen.svg.js +8 -0
  61. package/dist/components/UI/icons/fullscreen.svg.js.map +1 -0
  62. package/dist/components/UI/icons/hand-raise.svg.js +6 -0
  63. package/dist/components/UI/icons/hand-raise.svg.js.map +1 -0
  64. package/dist/components/UI/icons/icons.d.ts +31 -0
  65. package/dist/components/UI/icons/icons.d.ts.map +1 -0
  66. package/dist/components/UI/icons/icons.js +60 -0
  67. package/dist/components/UI/icons/icons.js.map +1 -0
  68. package/dist/components/UI/icons/index.d.ts +4 -0
  69. package/dist/components/UI/icons/index.d.ts.map +1 -0
  70. package/dist/components/UI/icons/info-circle.svg.js +6 -0
  71. package/dist/components/UI/icons/info-circle.svg.js.map +1 -0
  72. package/dist/components/UI/icons/mic-off.svg.js +8 -0
  73. package/dist/components/UI/icons/mic-off.svg.js.map +1 -0
  74. package/dist/components/UI/icons/mic-on.svg.js +8 -0
  75. package/dist/components/UI/icons/mic-on.svg.js.map +1 -0
  76. package/dist/components/UI/icons/person.svg.js +8 -0
  77. package/dist/components/UI/icons/person.svg.js.map +1 -0
  78. package/dist/components/UI/icons/phone-call.svg.js +8 -0
  79. package/dist/components/UI/icons/phone-call.svg.js.map +1 -0
  80. package/dist/components/UI/icons/phone-end.svg.js +8 -0
  81. package/dist/components/UI/icons/phone-end.svg.js.map +1 -0
  82. package/dist/components/UI/icons/room.svg.js +8 -0
  83. package/dist/components/UI/icons/room.svg.js.map +1 -0
  84. package/dist/components/UI/icons/screen-share-off.svg.js +9 -0
  85. package/dist/components/UI/icons/screen-share-off.svg.js.map +1 -0
  86. package/dist/components/UI/icons/screen-share.svg.js +9 -0
  87. package/dist/components/UI/icons/screen-share.svg.js.map +1 -0
  88. package/dist/components/UI/icons/sendIcon.svg.js +9 -0
  89. package/dist/components/UI/icons/sendIcon.svg.js.map +1 -0
  90. package/dist/components/UI/icons/settings.svg.js +8 -0
  91. package/dist/components/UI/icons/settings.svg.js.map +1 -0
  92. package/dist/components/UI/icons/speaker-off.svg.js +8 -0
  93. package/dist/components/UI/icons/speaker-off.svg.js.map +1 -0
  94. package/dist/components/UI/icons/speaker-on.svg.js +8 -0
  95. package/dist/components/UI/icons/speaker-on.svg.js.map +1 -0
  96. package/dist/components/UI/icons/spinner.svg.js +9 -0
  97. package/dist/components/UI/icons/spinner.svg.js.map +1 -0
  98. package/dist/components/UI/icons/sw-logo.svg.js +11 -0
  99. package/dist/components/UI/icons/sw-logo.svg.js.map +1 -0
  100. package/dist/components/UI/icons/sw-ui-icon.d.ts +28 -0
  101. package/dist/components/UI/icons/sw-ui-icon.d.ts.map +1 -0
  102. package/dist/components/UI/icons/sw-ui-icon.js +47 -0
  103. package/dist/components/UI/icons/sw-ui-icon.js.map +1 -0
  104. package/dist/components/UI/icons/transcript.svg.js +10 -0
  105. package/dist/components/UI/icons/transcript.svg.js.map +1 -0
  106. package/dist/components/UI/index.d.ts +18 -0
  107. package/dist/components/UI/index.d.ts.map +1 -0
  108. package/dist/components/UI/layout/sw-ui-background.d.ts +33 -0
  109. package/dist/components/UI/layout/sw-ui-background.d.ts.map +1 -0
  110. package/dist/components/UI/layout/sw-ui-background.js +106 -0
  111. package/dist/components/UI/layout/sw-ui-background.js.map +1 -0
  112. package/dist/components/UI/layout/sw-ui-call-layout.d.ts +69 -0
  113. package/dist/components/UI/layout/sw-ui-call-layout.d.ts.map +1 -0
  114. package/dist/components/UI/layout/sw-ui-call-layout.js +278 -0
  115. package/dist/components/UI/layout/sw-ui-call-layout.js.map +1 -0
  116. package/dist/components/UI/layout/sw-ui-content-drawer.d.ts +50 -0
  117. package/dist/components/UI/layout/sw-ui-content-drawer.d.ts.map +1 -0
  118. package/dist/components/UI/layout/sw-ui-content-drawer.js +413 -0
  119. package/dist/components/UI/layout/sw-ui-content-drawer.js.map +1 -0
  120. package/dist/components/UI/layout/sw-ui-modal.d.ts +31 -0
  121. package/dist/components/UI/layout/sw-ui-modal.d.ts.map +1 -0
  122. package/dist/components/UI/layout/sw-ui-modal.js +150 -0
  123. package/dist/components/UI/layout/sw-ui-modal.js.map +1 -0
  124. package/dist/components/UI/layout/sw-ui-responsive-container.d.ts +15 -0
  125. package/dist/components/UI/layout/sw-ui-responsive-container.d.ts.map +1 -0
  126. package/dist/components/UI/layout/sw-ui-responsive-container.js +78 -0
  127. package/dist/components/UI/layout/sw-ui-responsive-container.js.map +1 -0
  128. package/dist/components/UI/sw-ui-alert.d.ts +37 -0
  129. package/dist/components/UI/sw-ui-alert.d.ts.map +1 -0
  130. package/dist/components/UI/sw-ui-alert.js +127 -0
  131. package/dist/components/UI/sw-ui-alert.js.map +1 -0
  132. package/dist/components/UI/sw-ui-transcript-view.d.ts +56 -0
  133. package/dist/components/UI/sw-ui-transcript-view.d.ts.map +1 -0
  134. package/dist/components/UI/sw-ui-transcript-view.js +342 -0
  135. package/dist/components/UI/sw-ui-transcript-view.js.map +1 -0
  136. package/dist/components/{audio-level.d.ts → sw-audio-level.d.ts} +44 -4
  137. package/dist/components/sw-audio-level.d.ts.map +1 -0
  138. package/dist/components/sw-audio-level.js +252 -0
  139. package/dist/components/sw-audio-level.js.map +1 -0
  140. package/dist/components/sw-call-controls.d.ts +58 -0
  141. package/dist/components/sw-call-controls.d.ts.map +1 -0
  142. package/dist/components/sw-call-controls.js +186 -0
  143. package/dist/components/sw-call-controls.js.map +1 -0
  144. package/dist/components/sw-call-dialpad.d.ts +52 -0
  145. package/dist/components/sw-call-dialpad.d.ts.map +1 -0
  146. package/dist/components/sw-call-dialpad.js +70 -0
  147. package/dist/components/sw-call-dialpad.js.map +1 -0
  148. package/dist/components/sw-call-media.d.ts +59 -0
  149. package/dist/components/sw-call-media.d.ts.map +1 -0
  150. package/dist/components/sw-call-media.js +178 -0
  151. package/dist/components/sw-call-media.js.map +1 -0
  152. package/dist/components/sw-call-provider.d.ts +41 -0
  153. package/dist/components/sw-call-provider.d.ts.map +1 -0
  154. package/dist/components/sw-call-provider.js +37 -0
  155. package/dist/components/sw-call-provider.js.map +1 -0
  156. package/dist/components/sw-call-status.d.ts +50 -0
  157. package/dist/components/sw-call-status.d.ts.map +1 -0
  158. package/dist/components/sw-call-status.js +204 -0
  159. package/dist/components/sw-call-status.js.map +1 -0
  160. package/dist/components/sw-call-widget/client-factory.d.ts +6 -0
  161. package/dist/components/sw-call-widget/client-factory.d.ts.map +1 -0
  162. package/dist/components/sw-call-widget/client-factory.js +25 -0
  163. package/dist/components/sw-call-widget/client-factory.js.map +1 -0
  164. package/dist/components/sw-call-widget/sw-call-widget.d.ts +110 -0
  165. package/dist/components/sw-call-widget/sw-call-widget.d.ts.map +1 -0
  166. package/dist/components/sw-call-widget/sw-call-widget.js +251 -0
  167. package/dist/components/sw-call-widget/sw-call-widget.js.map +1 -0
  168. package/dist/components/sw-call-widget/sw-call-widget.templates.d.ts +17 -0
  169. package/dist/components/sw-call-widget/sw-call-widget.templates.d.ts.map +1 -0
  170. package/dist/components/sw-call-widget/sw-call-widget.templates.js +80 -0
  171. package/dist/components/sw-call-widget/sw-call-widget.templates.js.map +1 -0
  172. package/dist/components/sw-click-to-call.d.ts +39 -0
  173. package/dist/components/sw-click-to-call.d.ts.map +1 -0
  174. package/dist/components/sw-click-to-call.js +88 -0
  175. package/dist/components/sw-click-to-call.js.map +1 -0
  176. package/dist/components/sw-device-selector/index.d.ts +2 -0
  177. package/dist/components/sw-device-selector/index.d.ts.map +1 -0
  178. package/dist/components/sw-device-selector/sw-device-selector.d.ts +69 -0
  179. package/dist/components/sw-device-selector/sw-device-selector.d.ts.map +1 -0
  180. package/dist/components/sw-device-selector/sw-device-selector.js +278 -0
  181. package/dist/components/sw-device-selector/sw-device-selector.js.map +1 -0
  182. package/dist/components/sw-device-selector/sw-device-selector.styles.d.ts +2 -0
  183. package/dist/components/sw-device-selector/sw-device-selector.styles.d.ts.map +1 -0
  184. package/dist/components/sw-device-selector/sw-device-selector.styles.js +238 -0
  185. package/dist/components/sw-device-selector/sw-device-selector.styles.js.map +1 -0
  186. package/dist/components/{directory.d.ts → sw-directory.d.ts} +18 -4
  187. package/dist/components/sw-directory.d.ts.map +1 -0
  188. package/dist/components/sw-directory.js +435 -0
  189. package/dist/components/sw-directory.js.map +1 -0
  190. package/dist/components/sw-local-camera.d.ts +53 -0
  191. package/dist/components/sw-local-camera.d.ts.map +1 -0
  192. package/dist/components/sw-local-camera.js +147 -0
  193. package/dist/components/sw-local-camera.js.map +1 -0
  194. package/dist/components/sw-participant-controls.d.ts +58 -0
  195. package/dist/components/sw-participant-controls.d.ts.map +1 -0
  196. package/dist/components/sw-participant-controls.js +306 -0
  197. package/dist/components/sw-participant-controls.js.map +1 -0
  198. package/dist/components/sw-participants.d.ts +55 -0
  199. package/dist/components/sw-participants.d.ts.map +1 -0
  200. package/dist/components/sw-participants.js +320 -0
  201. package/dist/components/sw-participants.js.map +1 -0
  202. package/dist/components/sw-self-media.d.ts +46 -0
  203. package/dist/components/sw-self-media.d.ts.map +1 -0
  204. package/dist/components/sw-self-media.js +106 -0
  205. package/dist/components/sw-self-media.js.map +1 -0
  206. package/dist/context/CallStateContextController.d.ts +31 -0
  207. package/dist/context/CallStateContextController.d.ts.map +1 -0
  208. package/dist/context/CallStateContextController.js +125 -0
  209. package/dist/context/CallStateContextController.js.map +1 -0
  210. package/dist/context/DevicesContextController.d.ts +38 -0
  211. package/dist/context/DevicesContextController.d.ts.map +1 -0
  212. package/dist/context/DevicesContextController.js +124 -0
  213. package/dist/context/DevicesContextController.js.map +1 -0
  214. package/dist/context/TranscriptController.d.ts +32 -0
  215. package/dist/context/TranscriptController.d.ts.map +1 -0
  216. package/dist/context/TranscriptController.js +113 -0
  217. package/dist/context/TranscriptController.js.map +1 -0
  218. package/dist/context/UserEventController.d.ts +26 -0
  219. package/dist/context/UserEventController.d.ts.map +1 -0
  220. package/dist/context/UserEventController.js +55 -0
  221. package/dist/context/UserEventController.js.map +1 -0
  222. package/dist/context/call-state-context.d.ts +75 -0
  223. package/dist/context/call-state-context.d.ts.map +1 -0
  224. package/dist/context/call-state-context.js +39 -0
  225. package/dist/context/call-state-context.js.map +1 -0
  226. package/dist/context/chat-state.d.ts +41 -0
  227. package/dist/context/chat-state.d.ts.map +1 -0
  228. package/dist/context/chat-state.js +61 -0
  229. package/dist/context/chat-state.js.map +1 -0
  230. package/dist/context/devices-context.d.ts +28 -0
  231. package/dist/context/devices-context.d.ts.map +1 -0
  232. package/dist/context/devices-context.js +6 -0
  233. package/dist/context/devices-context.js.map +1 -0
  234. package/dist/context/index.d.ts +9 -1
  235. package/dist/context/index.d.ts.map +1 -1
  236. package/dist/context/transcript-context.d.ts +9 -0
  237. package/dist/context/transcript-context.d.ts.map +1 -0
  238. package/dist/context/transcript-context.js +6 -0
  239. package/dist/context/transcript-context.js.map +1 -0
  240. package/dist/context/types.d.ts +9 -0
  241. package/dist/context/types.d.ts.map +1 -0
  242. package/dist/embed/signalwire-web-components-embed.iife.js +3237 -0
  243. package/dist/embed/signalwire-web-components-embed.iife.js.map +1 -0
  244. package/dist/embed/signalwire-web-components-embed.umd.cjs +3237 -0
  245. package/dist/embed/signalwire-web-components-embed.umd.cjs.map +1 -0
  246. package/dist/embed.d.ts +20 -0
  247. package/dist/embed.d.ts.map +1 -0
  248. package/dist/index.d.ts +19 -13
  249. package/dist/index.d.ts.map +1 -1
  250. package/dist/index.js +84 -35
  251. package/dist/index.js.map +1 -1
  252. package/dist/node_modules/dompurify/dist/purify.es.js +597 -0
  253. package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -0
  254. package/dist/node_modules/marked/lib/marked.esm.js +1475 -0
  255. package/dist/node_modules/marked/lib/marked.esm.js.map +1 -0
  256. package/dist/node_modules/prismjs/components/prism-bash.js +220 -0
  257. package/dist/node_modules/prismjs/components/prism-bash.js.map +1 -0
  258. package/dist/node_modules/prismjs/components/prism-css.js +56 -0
  259. package/dist/node_modules/prismjs/components/prism-css.js.map +1 -0
  260. package/dist/node_modules/prismjs/components/prism-javascript.js +138 -0
  261. package/dist/node_modules/prismjs/components/prism-javascript.js.map +1 -0
  262. package/dist/node_modules/prismjs/components/prism-json.js +26 -0
  263. package/dist/node_modules/prismjs/components/prism-json.js.map +1 -0
  264. package/dist/node_modules/prismjs/components/prism-markdown.js +301 -0
  265. package/dist/node_modules/prismjs/components/prism-markdown.js.map +1 -0
  266. package/dist/node_modules/prismjs/components/prism-python.js +69 -0
  267. package/dist/node_modules/prismjs/components/prism-python.js.map +1 -0
  268. package/dist/node_modules/prismjs/components/prism-sql.js +34 -0
  269. package/dist/node_modules/prismjs/components/prism-sql.js.map +1 -0
  270. package/dist/node_modules/prismjs/components/prism-typescript.js +53 -0
  271. package/dist/node_modules/prismjs/components/prism-typescript.js.map +1 -0
  272. package/dist/node_modules/prismjs/components/prism-yaml.js +67 -0
  273. package/dist/node_modules/prismjs/components/prism-yaml.js.map +1 -0
  274. package/dist/node_modules/prismjs/prism.js +1165 -0
  275. package/dist/node_modules/prismjs/prism.js.map +1 -0
  276. package/dist/react.d.ts +96 -46
  277. package/dist/theme.css +451 -0
  278. package/dist/theme.css.js +5 -0
  279. package/dist/theme.css.js.map +1 -0
  280. package/dist/types/index.d.ts +9 -33
  281. package/dist/types/index.d.ts.map +1 -1
  282. package/dist/utils/index.d.ts +2 -0
  283. package/dist/utils/index.d.ts.map +1 -1
  284. package/dist/utils/prism.d.ts +4 -0
  285. package/dist/utils/prism.d.ts.map +1 -0
  286. package/dist/utils/prism.js +34 -0
  287. package/dist/utils/prism.js.map +1 -0
  288. package/dist/utils/theme-loader.d.ts +11 -0
  289. package/dist/utils/theme-loader.d.ts.map +1 -0
  290. package/dist/utils/theme-loader.js +17 -0
  291. package/dist/utils/theme-loader.js.map +1 -0
  292. package/dist/utils/transcriptToMarkdown.d.ts +14 -0
  293. package/dist/utils/transcriptToMarkdown.d.ts.map +1 -0
  294. package/dist/utils/transcriptToMarkdown.js +59 -0
  295. package/dist/utils/transcriptToMarkdown.js.map +1 -0
  296. package/dist/utils/use-google-font.d.ts +18 -0
  297. package/dist/utils/use-google-font.d.ts.map +1 -0
  298. package/dist/utils/use-google-font.js +12 -0
  299. package/dist/utils/use-google-font.js.map +1 -0
  300. package/dist/utils/user-variables.d.ts +20 -0
  301. package/dist/utils/user-variables.d.ts.map +1 -0
  302. package/dist/utils/user-variables.js +37 -0
  303. package/dist/utils/user-variables.js.map +1 -0
  304. package/dist/utils/video.js +6 -21
  305. package/dist/utils/video.js.map +1 -1
  306. package/package.json +105 -42
  307. package/dist/components/audio-level.d.ts.map +0 -1
  308. package/dist/components/audio-level.js +0 -203
  309. package/dist/components/audio-level.js.map +0 -1
  310. package/dist/components/call-controls.d.ts +0 -163
  311. package/dist/components/call-controls.d.ts.map +0 -1
  312. package/dist/components/call-controls.js +0 -606
  313. package/dist/components/call-controls.js.map +0 -1
  314. package/dist/components/call-media.d.ts +0 -114
  315. package/dist/components/call-media.d.ts.map +0 -1
  316. package/dist/components/call-media.js +0 -219
  317. package/dist/components/call-media.js.map +0 -1
  318. package/dist/components/call-status.d.ts +0 -68
  319. package/dist/components/call-status.d.ts.map +0 -1
  320. package/dist/components/call-status.js +0 -254
  321. package/dist/components/call-status.js.map +0 -1
  322. package/dist/components/click-to-call.d.ts +0 -123
  323. package/dist/components/click-to-call.d.ts.map +0 -1
  324. package/dist/components/click-to-call.js +0 -428
  325. package/dist/components/click-to-call.js.map +0 -1
  326. package/dist/components/device-selector.d.ts +0 -224
  327. package/dist/components/device-selector.d.ts.map +0 -1
  328. package/dist/components/device-selector.js +0 -685
  329. package/dist/components/device-selector.js.map +0 -1
  330. package/dist/components/dialpad.d.ts +0 -60
  331. package/dist/components/dialpad.d.ts.map +0 -1
  332. package/dist/components/dialpad.js +0 -372
  333. package/dist/components/dialpad.js.map +0 -1
  334. package/dist/components/directory.d.ts.map +0 -1
  335. package/dist/components/directory.js +0 -503
  336. package/dist/components/directory.js.map +0 -1
  337. package/dist/components/example-button.d.ts +0 -20
  338. package/dist/components/example-button.d.ts.map +0 -1
  339. package/dist/components/example-button.js +0 -74
  340. package/dist/components/example-button.js.map +0 -1
  341. package/dist/components/participant-controls.d.ts +0 -94
  342. package/dist/components/participant-controls.d.ts.map +0 -1
  343. package/dist/components/participant-controls.js +0 -468
  344. package/dist/components/participant-controls.js.map +0 -1
  345. package/dist/components/participants.d.ts +0 -116
  346. package/dist/components/participants.d.ts.map +0 -1
  347. package/dist/components/participants.js +0 -394
  348. package/dist/components/participants.js.map +0 -1
  349. package/dist/components/self-media.d.ts +0 -78
  350. package/dist/components/self-media.d.ts.map +0 -1
  351. package/dist/components/self-media.js +0 -129
  352. package/dist/components/self-media.js.map +0 -1
  353. package/dist/constants.js +0 -5
  354. package/dist/constants.js.map +0 -1
  355. package/dist/context/call-context.d.ts +0 -13
  356. package/dist/context/call-context.d.ts.map +0 -1
  357. package/dist/context/call-context.js +0 -6
  358. package/dist/context/call-context.js.map +0 -1
  359. package/dist/types/index.js +0 -12
  360. package/dist/types/index.js.map +0 -1
  361. package/dist/utils/debounce.js +0 -13
  362. package/dist/utils/debounce.js.map +0 -1
@@ -0,0 +1,1475 @@
1
+ var V = Object.defineProperty;
2
+ var j = (c) => {
3
+ throw TypeError(c);
4
+ };
5
+ var Y = (c, n, e) => n in c ? V(c, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[n] = e;
6
+ var m = (c, n, e) => Y(c, typeof n != "symbol" ? n + "" : n, e), ee = (c, n, e) => n.has(c) || j("Cannot " + e);
7
+ var U = (c, n, e) => n.has(c) ? j("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(c) : n.set(c, e);
8
+ var A = (c, n, e) => (ee(c, n, "access private method"), e);
9
+ function P() {
10
+ return {
11
+ async: !1,
12
+ breaks: !1,
13
+ extensions: null,
14
+ gfm: !0,
15
+ hooks: null,
16
+ pedantic: !1,
17
+ renderer: null,
18
+ silent: !1,
19
+ tokenizer: null,
20
+ walkTokens: null
21
+ };
22
+ }
23
+ let S = P();
24
+ function X(c) {
25
+ S = c;
26
+ }
27
+ const W = /[&<>"']/, te = new RegExp(W.source, "g"), G = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, ne = new RegExp(G.source, "g"), se = {
28
+ "&": "&amp;",
29
+ "<": "&lt;",
30
+ ">": "&gt;",
31
+ '"': "&quot;",
32
+ "'": "&#39;"
33
+ }, H = (c) => se[c];
34
+ function b(c, n) {
35
+ if (n) {
36
+ if (W.test(c))
37
+ return c.replace(te, H);
38
+ } else if (G.test(c))
39
+ return c.replace(ne, H);
40
+ return c;
41
+ }
42
+ const ie = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
43
+ function re(c) {
44
+ return c.replace(ie, (n, e) => (e = e.toLowerCase(), e === "colon" ? ":" : e.charAt(0) === "#" ? e.charAt(1) === "x" ? String.fromCharCode(parseInt(e.substring(2), 16)) : String.fromCharCode(+e.substring(1)) : ""));
45
+ }
46
+ const le = /(^|[^\[])\^/g;
47
+ function k(c, n) {
48
+ c = typeof c == "string" ? c : c.source, n = n || "";
49
+ const e = {
50
+ replace: (t, s) => (s = typeof s == "object" && "source" in s ? s.source : s, s = s.replace(le, "$1"), c = c.replace(t, s), e),
51
+ getRegex: () => new RegExp(c, n)
52
+ };
53
+ return e;
54
+ }
55
+ function N(c) {
56
+ try {
57
+ c = encodeURI(c).replace(/%25/g, "%");
58
+ } catch {
59
+ return null;
60
+ }
61
+ return c;
62
+ }
63
+ const L = { exec: () => null };
64
+ function F(c, n) {
65
+ const e = c.replace(/\|/g, (r, i, l) => {
66
+ let o = !1, u = i;
67
+ for (; --u >= 0 && l[u] === "\\"; )
68
+ o = !o;
69
+ return o ? "|" : " |";
70
+ }), t = e.split(/ \|/);
71
+ let s = 0;
72
+ if (t[0].trim() || t.shift(), t.length > 0 && !t[t.length - 1].trim() && t.pop(), n)
73
+ if (t.length > n)
74
+ t.splice(n);
75
+ else
76
+ for (; t.length < n; )
77
+ t.push("");
78
+ for (; s < t.length; s++)
79
+ t[s] = t[s].trim().replace(/\\\|/g, "|");
80
+ return t;
81
+ }
82
+ function E(c, n, e) {
83
+ const t = c.length;
84
+ if (t === 0)
85
+ return "";
86
+ let s = 0;
87
+ for (; s < t && c.charAt(t - s - 1) === n; )
88
+ s++;
89
+ return c.slice(0, t - s);
90
+ }
91
+ function oe(c, n) {
92
+ if (c.indexOf(n[1]) === -1)
93
+ return -1;
94
+ let e = 0;
95
+ for (let t = 0; t < c.length; t++)
96
+ if (c[t] === "\\")
97
+ t++;
98
+ else if (c[t] === n[0])
99
+ e++;
100
+ else if (c[t] === n[1] && (e--, e < 0))
101
+ return t;
102
+ return -1;
103
+ }
104
+ function K(c, n, e, t) {
105
+ const s = n.href, r = n.title ? b(n.title) : null, i = c[1].replace(/\\([\[\]])/g, "$1");
106
+ if (c[0].charAt(0) !== "!") {
107
+ t.state.inLink = !0;
108
+ const l = {
109
+ type: "link",
110
+ raw: e,
111
+ href: s,
112
+ title: r,
113
+ text: i,
114
+ tokens: t.inlineTokens(i)
115
+ };
116
+ return t.state.inLink = !1, l;
117
+ }
118
+ return {
119
+ type: "image",
120
+ raw: e,
121
+ href: s,
122
+ title: r,
123
+ text: b(i)
124
+ };
125
+ }
126
+ function ae(c, n) {
127
+ const e = c.match(/^(\s+)(?:```)/);
128
+ if (e === null)
129
+ return n;
130
+ const t = e[1];
131
+ return n.split(`
132
+ `).map((s) => {
133
+ const r = s.match(/^\s+/);
134
+ if (r === null)
135
+ return s;
136
+ const [i] = r;
137
+ return i.length >= t.length ? s.slice(t.length) : s;
138
+ }).join(`
139
+ `);
140
+ }
141
+ class C {
142
+ constructor(n) {
143
+ m(this, "options");
144
+ // TODO: Fix this rules type
145
+ m(this, "rules");
146
+ m(this, "lexer");
147
+ this.options = n || S;
148
+ }
149
+ space(n) {
150
+ const e = this.rules.block.newline.exec(n);
151
+ if (e && e[0].length > 0)
152
+ return {
153
+ type: "space",
154
+ raw: e[0]
155
+ };
156
+ }
157
+ code(n) {
158
+ const e = this.rules.block.code.exec(n);
159
+ if (e) {
160
+ const t = e[0].replace(/^ {1,4}/gm, "");
161
+ return {
162
+ type: "code",
163
+ raw: e[0],
164
+ codeBlockStyle: "indented",
165
+ text: this.options.pedantic ? t : E(t, `
166
+ `)
167
+ };
168
+ }
169
+ }
170
+ fences(n) {
171
+ const e = this.rules.block.fences.exec(n);
172
+ if (e) {
173
+ const t = e[0], s = ae(t, e[3] || "");
174
+ return {
175
+ type: "code",
176
+ raw: t,
177
+ lang: e[2] ? e[2].trim().replace(this.rules.inline._escapes, "$1") : e[2],
178
+ text: s
179
+ };
180
+ }
181
+ }
182
+ heading(n) {
183
+ const e = this.rules.block.heading.exec(n);
184
+ if (e) {
185
+ let t = e[2].trim();
186
+ if (/#$/.test(t)) {
187
+ const s = E(t, "#");
188
+ (this.options.pedantic || !s || / $/.test(s)) && (t = s.trim());
189
+ }
190
+ return {
191
+ type: "heading",
192
+ raw: e[0],
193
+ depth: e[1].length,
194
+ text: t,
195
+ tokens: this.lexer.inline(t)
196
+ };
197
+ }
198
+ }
199
+ hr(n) {
200
+ const e = this.rules.block.hr.exec(n);
201
+ if (e)
202
+ return {
203
+ type: "hr",
204
+ raw: e[0]
205
+ };
206
+ }
207
+ blockquote(n) {
208
+ const e = this.rules.block.blockquote.exec(n);
209
+ if (e) {
210
+ const t = E(e[0].replace(/^ *>[ \t]?/gm, ""), `
211
+ `), s = this.lexer.state.top;
212
+ this.lexer.state.top = !0;
213
+ const r = this.lexer.blockTokens(t);
214
+ return this.lexer.state.top = s, {
215
+ type: "blockquote",
216
+ raw: e[0],
217
+ tokens: r,
218
+ text: t
219
+ };
220
+ }
221
+ }
222
+ list(n) {
223
+ let e = this.rules.block.list.exec(n);
224
+ if (e) {
225
+ let t = e[1].trim();
226
+ const s = t.length > 1, r = {
227
+ type: "list",
228
+ raw: "",
229
+ ordered: s,
230
+ start: s ? +t.slice(0, -1) : "",
231
+ loose: !1,
232
+ items: []
233
+ };
234
+ t = s ? `\\d{1,9}\\${t.slice(-1)}` : `\\${t}`, this.options.pedantic && (t = s ? t : "[*+-]");
235
+ const i = new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`);
236
+ let l = "", o = "", u = !1;
237
+ for (; n; ) {
238
+ let h = !1;
239
+ if (!(e = i.exec(n)) || this.rules.block.hr.test(n))
240
+ break;
241
+ l = e[0], n = n.substring(l.length);
242
+ let g = e[2].split(`
243
+ `, 1)[0].replace(/^\t+/, (q) => " ".repeat(3 * q.length)), f = n.split(`
244
+ `, 1)[0], x = 0;
245
+ this.options.pedantic ? (x = 2, o = g.trimStart()) : (x = e[2].search(/[^ ]/), x = x > 4 ? 1 : x, o = g.slice(x), x += e[1].length);
246
+ let $ = !1;
247
+ if (!g && /^ *$/.test(f) && (l += f + `
248
+ `, n = n.substring(f.length + 1), h = !0), !h) {
249
+ const q = new RegExp(`^ {0,${Math.min(3, x - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), M = new RegExp(`^ {0,${Math.min(3, x - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), O = new RegExp(`^ {0,${Math.min(3, x - 1)}}(?:\`\`\`|~~~)`), Q = new RegExp(`^ {0,${Math.min(3, x - 1)}}#`);
250
+ for (; n; ) {
251
+ const B = n.split(`
252
+ `, 1)[0];
253
+ if (f = B, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), O.test(f) || Q.test(f) || q.test(f) || M.test(n))
254
+ break;
255
+ if (f.search(/[^ ]/) >= x || !f.trim())
256
+ o += `
257
+ ` + f.slice(x);
258
+ else {
259
+ if ($ || g.search(/[^ ]/) >= 4 || O.test(g) || Q.test(g) || M.test(g))
260
+ break;
261
+ o += `
262
+ ` + f;
263
+ }
264
+ !$ && !f.trim() && ($ = !0), l += B + `
265
+ `, n = n.substring(B.length + 1), g = f.slice(x);
266
+ }
267
+ }
268
+ r.loose || (u ? r.loose = !0 : /\n *\n *$/.test(l) && (u = !0));
269
+ let w = null, T;
270
+ this.options.gfm && (w = /^\[[ xX]\] /.exec(o), w && (T = w[0] !== "[ ] ", o = o.replace(/^\[[ xX]\] +/, ""))), r.items.push({
271
+ type: "list_item",
272
+ raw: l,
273
+ task: !!w,
274
+ checked: T,
275
+ loose: !1,
276
+ text: o,
277
+ tokens: []
278
+ }), r.raw += l;
279
+ }
280
+ r.items[r.items.length - 1].raw = l.trimEnd(), r.items[r.items.length - 1].text = o.trimEnd(), r.raw = r.raw.trimEnd();
281
+ for (let h = 0; h < r.items.length; h++)
282
+ if (this.lexer.state.top = !1, r.items[h].tokens = this.lexer.blockTokens(r.items[h].text, []), !r.loose) {
283
+ const g = r.items[h].tokens.filter((x) => x.type === "space"), f = g.length > 0 && g.some((x) => /\n.*\n/.test(x.raw));
284
+ r.loose = f;
285
+ }
286
+ if (r.loose)
287
+ for (let h = 0; h < r.items.length; h++)
288
+ r.items[h].loose = !0;
289
+ return r;
290
+ }
291
+ }
292
+ html(n) {
293
+ const e = this.rules.block.html.exec(n);
294
+ if (e)
295
+ return {
296
+ type: "html",
297
+ block: !0,
298
+ raw: e[0],
299
+ pre: e[1] === "pre" || e[1] === "script" || e[1] === "style",
300
+ text: e[0]
301
+ };
302
+ }
303
+ def(n) {
304
+ const e = this.rules.block.def.exec(n);
305
+ if (e) {
306
+ const t = e[1].toLowerCase().replace(/\s+/g, " "), s = e[2] ? e[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", r = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline._escapes, "$1") : e[3];
307
+ return {
308
+ type: "def",
309
+ tag: t,
310
+ raw: e[0],
311
+ href: s,
312
+ title: r
313
+ };
314
+ }
315
+ }
316
+ table(n) {
317
+ const e = this.rules.block.table.exec(n);
318
+ if (e) {
319
+ if (!/[:|]/.test(e[2]))
320
+ return;
321
+ const t = {
322
+ type: "table",
323
+ raw: e[0],
324
+ header: F(e[1]).map((s) => ({ text: s, tokens: [] })),
325
+ align: e[2].replace(/^\||\| *$/g, "").split("|"),
326
+ rows: e[3] && e[3].trim() ? e[3].replace(/\n[ \t]*$/, "").split(`
327
+ `) : []
328
+ };
329
+ if (t.header.length === t.align.length) {
330
+ let s = t.align.length, r, i, l, o;
331
+ for (r = 0; r < s; r++) {
332
+ const u = t.align[r];
333
+ u && (/^ *-+: *$/.test(u) ? t.align[r] = "right" : /^ *:-+: *$/.test(u) ? t.align[r] = "center" : /^ *:-+ *$/.test(u) ? t.align[r] = "left" : t.align[r] = null);
334
+ }
335
+ for (s = t.rows.length, r = 0; r < s; r++)
336
+ t.rows[r] = F(t.rows[r], t.header.length).map((u) => ({ text: u, tokens: [] }));
337
+ for (s = t.header.length, i = 0; i < s; i++)
338
+ t.header[i].tokens = this.lexer.inline(t.header[i].text);
339
+ for (s = t.rows.length, i = 0; i < s; i++)
340
+ for (o = t.rows[i], l = 0; l < o.length; l++)
341
+ o[l].tokens = this.lexer.inline(o[l].text);
342
+ return t;
343
+ }
344
+ }
345
+ }
346
+ lheading(n) {
347
+ const e = this.rules.block.lheading.exec(n);
348
+ if (e)
349
+ return {
350
+ type: "heading",
351
+ raw: e[0],
352
+ depth: e[2].charAt(0) === "=" ? 1 : 2,
353
+ text: e[1],
354
+ tokens: this.lexer.inline(e[1])
355
+ };
356
+ }
357
+ paragraph(n) {
358
+ const e = this.rules.block.paragraph.exec(n);
359
+ if (e) {
360
+ const t = e[1].charAt(e[1].length - 1) === `
361
+ ` ? e[1].slice(0, -1) : e[1];
362
+ return {
363
+ type: "paragraph",
364
+ raw: e[0],
365
+ text: t,
366
+ tokens: this.lexer.inline(t)
367
+ };
368
+ }
369
+ }
370
+ text(n) {
371
+ const e = this.rules.block.text.exec(n);
372
+ if (e)
373
+ return {
374
+ type: "text",
375
+ raw: e[0],
376
+ text: e[0],
377
+ tokens: this.lexer.inline(e[0])
378
+ };
379
+ }
380
+ escape(n) {
381
+ const e = this.rules.inline.escape.exec(n);
382
+ if (e)
383
+ return {
384
+ type: "escape",
385
+ raw: e[0],
386
+ text: b(e[1])
387
+ };
388
+ }
389
+ tag(n) {
390
+ const e = this.rules.inline.tag.exec(n);
391
+ if (e)
392
+ return !this.lexer.state.inLink && /^<a /i.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0]) && (this.lexer.state.inRawBlock = !1), {
393
+ type: "html",
394
+ raw: e[0],
395
+ inLink: this.lexer.state.inLink,
396
+ inRawBlock: this.lexer.state.inRawBlock,
397
+ block: !1,
398
+ text: e[0]
399
+ };
400
+ }
401
+ link(n) {
402
+ const e = this.rules.inline.link.exec(n);
403
+ if (e) {
404
+ const t = e[2].trim();
405
+ if (!this.options.pedantic && /^</.test(t)) {
406
+ if (!/>$/.test(t))
407
+ return;
408
+ const i = E(t.slice(0, -1), "\\");
409
+ if ((t.length - i.length) % 2 === 0)
410
+ return;
411
+ } else {
412
+ const i = oe(e[2], "()");
413
+ if (i > -1) {
414
+ const o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
415
+ e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, o).trim(), e[3] = "";
416
+ }
417
+ }
418
+ let s = e[2], r = "";
419
+ if (this.options.pedantic) {
420
+ const i = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);
421
+ i && (s = i[1], r = i[3]);
422
+ } else
423
+ r = e[3] ? e[3].slice(1, -1) : "";
424
+ return s = s.trim(), /^</.test(s) && (this.options.pedantic && !/>$/.test(t) ? s = s.slice(1) : s = s.slice(1, -1)), K(e, {
425
+ href: s && s.replace(this.rules.inline._escapes, "$1"),
426
+ title: r && r.replace(this.rules.inline._escapes, "$1")
427
+ }, e[0], this.lexer);
428
+ }
429
+ }
430
+ reflink(n, e) {
431
+ let t;
432
+ if ((t = this.rules.inline.reflink.exec(n)) || (t = this.rules.inline.nolink.exec(n))) {
433
+ let s = (t[2] || t[1]).replace(/\s+/g, " ");
434
+ if (s = e[s.toLowerCase()], !s) {
435
+ const r = t[0].charAt(0);
436
+ return {
437
+ type: "text",
438
+ raw: r,
439
+ text: r
440
+ };
441
+ }
442
+ return K(t, s, t[0], this.lexer);
443
+ }
444
+ }
445
+ emStrong(n, e, t = "") {
446
+ let s = this.rules.inline.emStrong.lDelim.exec(n);
447
+ if (!s || s[3] && t.match(/[\p{L}\p{N}]/u))
448
+ return;
449
+ if (!(s[1] || s[2] || "") || !t || this.rules.inline.punctuation.exec(t)) {
450
+ const i = [...s[0]].length - 1;
451
+ let l, o, u = i, h = 0;
452
+ const g = s[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
453
+ for (g.lastIndex = 0, e = e.slice(-1 * n.length + i); (s = g.exec(e)) != null; ) {
454
+ if (l = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !l)
455
+ continue;
456
+ if (o = [...l].length, s[3] || s[4]) {
457
+ u += o;
458
+ continue;
459
+ } else if ((s[5] || s[6]) && i % 3 && !((i + o) % 3)) {
460
+ h += o;
461
+ continue;
462
+ }
463
+ if (u -= o, u > 0)
464
+ continue;
465
+ o = Math.min(o, o + u + h);
466
+ const f = [...s[0]][0].length, x = n.slice(0, i + s.index + f + o);
467
+ if (Math.min(i, o) % 2) {
468
+ const w = x.slice(1, -1);
469
+ return {
470
+ type: "em",
471
+ raw: x,
472
+ text: w,
473
+ tokens: this.lexer.inlineTokens(w)
474
+ };
475
+ }
476
+ const $ = x.slice(2, -2);
477
+ return {
478
+ type: "strong",
479
+ raw: x,
480
+ text: $,
481
+ tokens: this.lexer.inlineTokens($)
482
+ };
483
+ }
484
+ }
485
+ }
486
+ codespan(n) {
487
+ const e = this.rules.inline.code.exec(n);
488
+ if (e) {
489
+ let t = e[2].replace(/\n/g, " ");
490
+ const s = /[^ ]/.test(t), r = /^ /.test(t) && / $/.test(t);
491
+ return s && r && (t = t.substring(1, t.length - 1)), t = b(t, !0), {
492
+ type: "codespan",
493
+ raw: e[0],
494
+ text: t
495
+ };
496
+ }
497
+ }
498
+ br(n) {
499
+ const e = this.rules.inline.br.exec(n);
500
+ if (e)
501
+ return {
502
+ type: "br",
503
+ raw: e[0]
504
+ };
505
+ }
506
+ del(n) {
507
+ const e = this.rules.inline.del.exec(n);
508
+ if (e)
509
+ return {
510
+ type: "del",
511
+ raw: e[0],
512
+ text: e[2],
513
+ tokens: this.lexer.inlineTokens(e[2])
514
+ };
515
+ }
516
+ autolink(n) {
517
+ const e = this.rules.inline.autolink.exec(n);
518
+ if (e) {
519
+ let t, s;
520
+ return e[2] === "@" ? (t = b(e[1]), s = "mailto:" + t) : (t = b(e[1]), s = t), {
521
+ type: "link",
522
+ raw: e[0],
523
+ text: t,
524
+ href: s,
525
+ tokens: [
526
+ {
527
+ type: "text",
528
+ raw: t,
529
+ text: t
530
+ }
531
+ ]
532
+ };
533
+ }
534
+ }
535
+ url(n) {
536
+ let e;
537
+ if (e = this.rules.inline.url.exec(n)) {
538
+ let t, s;
539
+ if (e[2] === "@")
540
+ t = b(e[0]), s = "mailto:" + t;
541
+ else {
542
+ let r;
543
+ do
544
+ r = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])[0];
545
+ while (r !== e[0]);
546
+ t = b(e[0]), e[1] === "www." ? s = "http://" + e[0] : s = e[0];
547
+ }
548
+ return {
549
+ type: "link",
550
+ raw: e[0],
551
+ text: t,
552
+ href: s,
553
+ tokens: [
554
+ {
555
+ type: "text",
556
+ raw: t,
557
+ text: t
558
+ }
559
+ ]
560
+ };
561
+ }
562
+ }
563
+ inlineText(n) {
564
+ const e = this.rules.inline.text.exec(n);
565
+ if (e) {
566
+ let t;
567
+ return this.lexer.state.inRawBlock ? t = e[0] : t = b(e[0]), {
568
+ type: "text",
569
+ raw: e[0],
570
+ text: t
571
+ };
572
+ }
573
+ }
574
+ }
575
+ const p = {
576
+ newline: /^(?: *(?:\n|$))+/,
577
+ code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
578
+ fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
579
+ hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
580
+ heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
581
+ blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
582
+ list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
583
+ html: "^ {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|$))",
584
+ def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
585
+ table: L,
586
+ lheading: /^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
587
+ // regex template, placeholders will be replaced according to different paragraph
588
+ // interruption rules of commonmark and the original markdown spec:
589
+ _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
590
+ text: /^[^\n]+/
591
+ };
592
+ p._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
593
+ p._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
594
+ p.def = k(p.def).replace("label", p._label).replace("title", p._title).getRegex();
595
+ p.bullet = /(?:[*+-]|\d{1,9}[.)])/;
596
+ p.listItemStart = k(/^( *)(bull) */).replace("bull", p.bullet).getRegex();
597
+ p.list = k(p.list).replace(/bull/g, p.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + p.def.source + ")").getRegex();
598
+ p._tag = "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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
599
+ p._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
600
+ p.html = k(p.html, "i").replace("comment", p._comment).replace("tag", p._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
601
+ p.lheading = k(p.lheading).replace(/bull/g, p.bullet).getRegex();
602
+ p.paragraph = k(p._paragraph).replace("hr", p.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", p._tag).getRegex();
603
+ p.blockquote = k(p.blockquote).replace("paragraph", p.paragraph).getRegex();
604
+ p.normal = { ...p };
605
+ p.gfm = {
606
+ ...p.normal,
607
+ table: "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
608
+ // Cells
609
+ };
610
+ p.gfm.table = k(p.gfm.table).replace("hr", p.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", p._tag).getRegex();
611
+ p.gfm.paragraph = k(p._paragraph).replace("hr", p.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", p.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", p._tag).getRegex();
612
+ p.pedantic = {
613
+ ...p.normal,
614
+ html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", p._comment).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(),
615
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
616
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
617
+ fences: L,
618
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
619
+ paragraph: k(p.normal._paragraph).replace("hr", p.hr).replace("heading", ` *#{1,6} *[^
620
+ ]`).replace("lheading", p.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
621
+ };
622
+ const a = {
623
+ escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
624
+ autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
625
+ url: L,
626
+ tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
627
+ link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
628
+ reflink: /^!?\[(label)\]\[(ref)\]/,
629
+ nolink: /^!?\[(ref)\](?:\[\])?/,
630
+ reflinkSearch: "reflink|nolink(?!\\()",
631
+ emStrong: {
632
+ lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,
633
+ // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
634
+ // | Skip orphan inside strong | Consume to delim | (1) #*** | (2) a***#, a*** | (3) #***a, ***a | (4) ***# | (5) #***# | (6) a***a
635
+ rDelimAst: /^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,
636
+ rDelimUnd: /^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/
637
+ // ^- Not allowed for _
638
+ },
639
+ code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
640
+ br: /^( {2,}|\\)\n(?!\s*$)/,
641
+ del: L,
642
+ text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
643
+ punctuation: /^((?![*_])[\spunctuation])/
644
+ };
645
+ a._punctuation = "\\p{P}$+<=>`^|~";
646
+ a.punctuation = k(a.punctuation, "u").replace(/punctuation/g, a._punctuation).getRegex();
647
+ a.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;
648
+ a.anyPunctuation = /\\[punct]/g;
649
+ a._escapes = /\\([punct])/g;
650
+ a._comment = k(p._comment).replace("(?:-->|$)", "-->").getRegex();
651
+ a.emStrong.lDelim = k(a.emStrong.lDelim, "u").replace(/punct/g, a._punctuation).getRegex();
652
+ a.emStrong.rDelimAst = k(a.emStrong.rDelimAst, "gu").replace(/punct/g, a._punctuation).getRegex();
653
+ a.emStrong.rDelimUnd = k(a.emStrong.rDelimUnd, "gu").replace(/punct/g, a._punctuation).getRegex();
654
+ a.anyPunctuation = k(a.anyPunctuation, "gu").replace(/punct/g, a._punctuation).getRegex();
655
+ a._escapes = k(a._escapes, "gu").replace(/punct/g, a._punctuation).getRegex();
656
+ a._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
657
+ a._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])?)+(?![-_])/;
658
+ a.autolink = k(a.autolink).replace("scheme", a._scheme).replace("email", a._email).getRegex();
659
+ a._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
660
+ a.tag = k(a.tag).replace("comment", a._comment).replace("attribute", a._attribute).getRegex();
661
+ a._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
662
+ a._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
663
+ a._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
664
+ a.link = k(a.link).replace("label", a._label).replace("href", a._href).replace("title", a._title).getRegex();
665
+ a.reflink = k(a.reflink).replace("label", a._label).replace("ref", p._label).getRegex();
666
+ a.nolink = k(a.nolink).replace("ref", p._label).getRegex();
667
+ a.reflinkSearch = k(a.reflinkSearch, "g").replace("reflink", a.reflink).replace("nolink", a.nolink).getRegex();
668
+ a.normal = { ...a };
669
+ a.pedantic = {
670
+ ...a.normal,
671
+ strong: {
672
+ start: /^__|\*\*/,
673
+ middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
674
+ endAst: /\*\*(?!\*)/g,
675
+ endUnd: /__(?!_)/g
676
+ },
677
+ em: {
678
+ start: /^_|\*/,
679
+ middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
680
+ endAst: /\*(?!\*)/g,
681
+ endUnd: /_(?!_)/g
682
+ },
683
+ link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", a._label).getRegex(),
684
+ reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", a._label).getRegex()
685
+ };
686
+ a.gfm = {
687
+ ...a.normal,
688
+ escape: k(a.escape).replace("])", "~|])").getRegex(),
689
+ _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
690
+ url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
691
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
692
+ del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
693
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
694
+ };
695
+ a.gfm.url = k(a.gfm.url, "i").replace("email", a.gfm._extended_email).getRegex();
696
+ a.breaks = {
697
+ ...a.gfm,
698
+ br: k(a.br).replace("{2,}", "*").getRegex(),
699
+ text: k(a.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
700
+ };
701
+ class _ {
702
+ constructor(n) {
703
+ m(this, "tokens");
704
+ m(this, "options");
705
+ m(this, "state");
706
+ m(this, "tokenizer");
707
+ m(this, "inlineQueue");
708
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = n || S, this.options.tokenizer = this.options.tokenizer || new C(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
709
+ inLink: !1,
710
+ inRawBlock: !1,
711
+ top: !0
712
+ };
713
+ const e = {
714
+ block: p.normal,
715
+ inline: a.normal
716
+ };
717
+ this.options.pedantic ? (e.block = p.pedantic, e.inline = a.pedantic) : this.options.gfm && (e.block = p.gfm, this.options.breaks ? e.inline = a.breaks : e.inline = a.gfm), this.tokenizer.rules = e;
718
+ }
719
+ /**
720
+ * Expose Rules
721
+ */
722
+ static get rules() {
723
+ return {
724
+ block: p,
725
+ inline: a
726
+ };
727
+ }
728
+ /**
729
+ * Static Lex Method
730
+ */
731
+ static lex(n, e) {
732
+ return new _(e).lex(n);
733
+ }
734
+ /**
735
+ * Static Lex Inline Method
736
+ */
737
+ static lexInline(n, e) {
738
+ return new _(e).inlineTokens(n);
739
+ }
740
+ /**
741
+ * Preprocessing
742
+ */
743
+ lex(n) {
744
+ n = n.replace(/\r\n|\r/g, `
745
+ `), this.blockTokens(n, this.tokens);
746
+ let e;
747
+ for (; e = this.inlineQueue.shift(); )
748
+ this.inlineTokens(e.src, e.tokens);
749
+ return this.tokens;
750
+ }
751
+ blockTokens(n, e = []) {
752
+ this.options.pedantic ? n = n.replace(/\t/g, " ").replace(/^ +$/gm, "") : n = n.replace(/^( *)(\t+)/gm, (l, o, u) => o + " ".repeat(u.length));
753
+ let t, s, r, i;
754
+ for (; n; )
755
+ if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (t = l.call({ lexer: this }, n, e)) ? (n = n.substring(t.raw.length), e.push(t), !0) : !1))) {
756
+ if (t = this.tokenizer.space(n)) {
757
+ n = n.substring(t.raw.length), t.raw.length === 1 && e.length > 0 ? e[e.length - 1].raw += `
758
+ ` : e.push(t);
759
+ continue;
760
+ }
761
+ if (t = this.tokenizer.code(n)) {
762
+ n = n.substring(t.raw.length), s = e[e.length - 1], s && (s.type === "paragraph" || s.type === "text") ? (s.raw += `
763
+ ` + t.raw, s.text += `
764
+ ` + t.text, this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : e.push(t);
765
+ continue;
766
+ }
767
+ if (t = this.tokenizer.fences(n)) {
768
+ n = n.substring(t.raw.length), e.push(t);
769
+ continue;
770
+ }
771
+ if (t = this.tokenizer.heading(n)) {
772
+ n = n.substring(t.raw.length), e.push(t);
773
+ continue;
774
+ }
775
+ if (t = this.tokenizer.hr(n)) {
776
+ n = n.substring(t.raw.length), e.push(t);
777
+ continue;
778
+ }
779
+ if (t = this.tokenizer.blockquote(n)) {
780
+ n = n.substring(t.raw.length), e.push(t);
781
+ continue;
782
+ }
783
+ if (t = this.tokenizer.list(n)) {
784
+ n = n.substring(t.raw.length), e.push(t);
785
+ continue;
786
+ }
787
+ if (t = this.tokenizer.html(n)) {
788
+ n = n.substring(t.raw.length), e.push(t);
789
+ continue;
790
+ }
791
+ if (t = this.tokenizer.def(n)) {
792
+ n = n.substring(t.raw.length), s = e[e.length - 1], s && (s.type === "paragraph" || s.type === "text") ? (s.raw += `
793
+ ` + t.raw, s.text += `
794
+ ` + t.raw, this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : this.tokens.links[t.tag] || (this.tokens.links[t.tag] = {
795
+ href: t.href,
796
+ title: t.title
797
+ });
798
+ continue;
799
+ }
800
+ if (t = this.tokenizer.table(n)) {
801
+ n = n.substring(t.raw.length), e.push(t);
802
+ continue;
803
+ }
804
+ if (t = this.tokenizer.lheading(n)) {
805
+ n = n.substring(t.raw.length), e.push(t);
806
+ continue;
807
+ }
808
+ if (r = n, this.options.extensions && this.options.extensions.startBlock) {
809
+ let l = 1 / 0;
810
+ const o = n.slice(1);
811
+ let u;
812
+ this.options.extensions.startBlock.forEach((h) => {
813
+ u = h.call({ lexer: this }, o), typeof u == "number" && u >= 0 && (l = Math.min(l, u));
814
+ }), l < 1 / 0 && l >= 0 && (r = n.substring(0, l + 1));
815
+ }
816
+ if (this.state.top && (t = this.tokenizer.paragraph(r))) {
817
+ s = e[e.length - 1], i && s.type === "paragraph" ? (s.raw += `
818
+ ` + t.raw, s.text += `
819
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : e.push(t), i = r.length !== n.length, n = n.substring(t.raw.length);
820
+ continue;
821
+ }
822
+ if (t = this.tokenizer.text(n)) {
823
+ n = n.substring(t.raw.length), s = e[e.length - 1], s && s.type === "text" ? (s.raw += `
824
+ ` + t.raw, s.text += `
825
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : e.push(t);
826
+ continue;
827
+ }
828
+ if (n) {
829
+ const l = "Infinite loop on byte: " + n.charCodeAt(0);
830
+ if (this.options.silent) {
831
+ console.error(l);
832
+ break;
833
+ } else
834
+ throw new Error(l);
835
+ }
836
+ }
837
+ return this.state.top = !0, e;
838
+ }
839
+ inline(n, e = []) {
840
+ return this.inlineQueue.push({ src: n, tokens: e }), e;
841
+ }
842
+ /**
843
+ * Lexing/Compiling
844
+ */
845
+ inlineTokens(n, e = []) {
846
+ let t, s, r, i = n, l, o, u;
847
+ if (this.tokens.links) {
848
+ const h = Object.keys(this.tokens.links);
849
+ if (h.length > 0)
850
+ for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(i)) != null; )
851
+ h.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (i = i.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
852
+ }
853
+ for (; (l = this.tokenizer.rules.inline.blockSkip.exec(i)) != null; )
854
+ i = i.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
855
+ for (; (l = this.tokenizer.rules.inline.anyPunctuation.exec(i)) != null; )
856
+ i = i.slice(0, l.index) + "++" + i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
857
+ for (; n; )
858
+ if (o || (u = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (t = h.call({ lexer: this }, n, e)) ? (n = n.substring(t.raw.length), e.push(t), !0) : !1))) {
859
+ if (t = this.tokenizer.escape(n)) {
860
+ n = n.substring(t.raw.length), e.push(t);
861
+ continue;
862
+ }
863
+ if (t = this.tokenizer.tag(n)) {
864
+ n = n.substring(t.raw.length), s = e[e.length - 1], s && t.type === "text" && s.type === "text" ? (s.raw += t.raw, s.text += t.text) : e.push(t);
865
+ continue;
866
+ }
867
+ if (t = this.tokenizer.link(n)) {
868
+ n = n.substring(t.raw.length), e.push(t);
869
+ continue;
870
+ }
871
+ if (t = this.tokenizer.reflink(n, this.tokens.links)) {
872
+ n = n.substring(t.raw.length), s = e[e.length - 1], s && t.type === "text" && s.type === "text" ? (s.raw += t.raw, s.text += t.text) : e.push(t);
873
+ continue;
874
+ }
875
+ if (t = this.tokenizer.emStrong(n, i, u)) {
876
+ n = n.substring(t.raw.length), e.push(t);
877
+ continue;
878
+ }
879
+ if (t = this.tokenizer.codespan(n)) {
880
+ n = n.substring(t.raw.length), e.push(t);
881
+ continue;
882
+ }
883
+ if (t = this.tokenizer.br(n)) {
884
+ n = n.substring(t.raw.length), e.push(t);
885
+ continue;
886
+ }
887
+ if (t = this.tokenizer.del(n)) {
888
+ n = n.substring(t.raw.length), e.push(t);
889
+ continue;
890
+ }
891
+ if (t = this.tokenizer.autolink(n)) {
892
+ n = n.substring(t.raw.length), e.push(t);
893
+ continue;
894
+ }
895
+ if (!this.state.inLink && (t = this.tokenizer.url(n))) {
896
+ n = n.substring(t.raw.length), e.push(t);
897
+ continue;
898
+ }
899
+ if (r = n, this.options.extensions && this.options.extensions.startInline) {
900
+ let h = 1 / 0;
901
+ const g = n.slice(1);
902
+ let f;
903
+ this.options.extensions.startInline.forEach((x) => {
904
+ f = x.call({ lexer: this }, g), typeof f == "number" && f >= 0 && (h = Math.min(h, f));
905
+ }), h < 1 / 0 && h >= 0 && (r = n.substring(0, h + 1));
906
+ }
907
+ if (t = this.tokenizer.inlineText(r)) {
908
+ n = n.substring(t.raw.length), t.raw.slice(-1) !== "_" && (u = t.raw.slice(-1)), o = !0, s = e[e.length - 1], s && s.type === "text" ? (s.raw += t.raw, s.text += t.text) : e.push(t);
909
+ continue;
910
+ }
911
+ if (n) {
912
+ const h = "Infinite loop on byte: " + n.charCodeAt(0);
913
+ if (this.options.silent) {
914
+ console.error(h);
915
+ break;
916
+ } else
917
+ throw new Error(h);
918
+ }
919
+ }
920
+ return e;
921
+ }
922
+ }
923
+ class Z {
924
+ constructor(n) {
925
+ m(this, "options");
926
+ this.options = n || S;
927
+ }
928
+ code(n, e, t) {
929
+ var r;
930
+ const s = (r = (e || "").match(/^\S*/)) == null ? void 0 : r[0];
931
+ return n = n.replace(/\n$/, "") + `
932
+ `, s ? '<pre><code class="language-' + b(s) + '">' + (t ? n : b(n, !0)) + `</code></pre>
933
+ ` : "<pre><code>" + (t ? n : b(n, !0)) + `</code></pre>
934
+ `;
935
+ }
936
+ blockquote(n) {
937
+ return `<blockquote>
938
+ ${n}</blockquote>
939
+ `;
940
+ }
941
+ html(n, e) {
942
+ return n;
943
+ }
944
+ heading(n, e, t) {
945
+ return `<h${e}>${n}</h${e}>
946
+ `;
947
+ }
948
+ hr() {
949
+ return `<hr>
950
+ `;
951
+ }
952
+ list(n, e, t) {
953
+ const s = e ? "ol" : "ul", r = e && t !== 1 ? ' start="' + t + '"' : "";
954
+ return "<" + s + r + `>
955
+ ` + n + "</" + s + `>
956
+ `;
957
+ }
958
+ listitem(n, e, t) {
959
+ return `<li>${n}</li>
960
+ `;
961
+ }
962
+ checkbox(n) {
963
+ return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
964
+ }
965
+ paragraph(n) {
966
+ return `<p>${n}</p>
967
+ `;
968
+ }
969
+ table(n, e) {
970
+ return e && (e = `<tbody>${e}</tbody>`), `<table>
971
+ <thead>
972
+ ` + n + `</thead>
973
+ ` + e + `</table>
974
+ `;
975
+ }
976
+ tablerow(n) {
977
+ return `<tr>
978
+ ${n}</tr>
979
+ `;
980
+ }
981
+ tablecell(n, e) {
982
+ const t = e.header ? "th" : "td";
983
+ return (e.align ? `<${t} align="${e.align}">` : `<${t}>`) + n + `</${t}>
984
+ `;
985
+ }
986
+ /**
987
+ * span level renderer
988
+ */
989
+ strong(n) {
990
+ return `<strong>${n}</strong>`;
991
+ }
992
+ em(n) {
993
+ return `<em>${n}</em>`;
994
+ }
995
+ codespan(n) {
996
+ return `<code>${n}</code>`;
997
+ }
998
+ br() {
999
+ return "<br>";
1000
+ }
1001
+ del(n) {
1002
+ return `<del>${n}</del>`;
1003
+ }
1004
+ link(n, e, t) {
1005
+ const s = N(n);
1006
+ if (s === null)
1007
+ return t;
1008
+ n = s;
1009
+ let r = '<a href="' + n + '"';
1010
+ return e && (r += ' title="' + e + '"'), r += ">" + t + "</a>", r;
1011
+ }
1012
+ image(n, e, t) {
1013
+ const s = N(n);
1014
+ if (s === null)
1015
+ return t;
1016
+ n = s;
1017
+ let r = `<img src="${n}" alt="${t}"`;
1018
+ return e && (r += ` title="${e}"`), r += ">", r;
1019
+ }
1020
+ text(n) {
1021
+ return n;
1022
+ }
1023
+ }
1024
+ class v {
1025
+ // no need for block level renderers
1026
+ strong(n) {
1027
+ return n;
1028
+ }
1029
+ em(n) {
1030
+ return n;
1031
+ }
1032
+ codespan(n) {
1033
+ return n;
1034
+ }
1035
+ del(n) {
1036
+ return n;
1037
+ }
1038
+ html(n) {
1039
+ return n;
1040
+ }
1041
+ text(n) {
1042
+ return n;
1043
+ }
1044
+ link(n, e, t) {
1045
+ return "" + t;
1046
+ }
1047
+ image(n, e, t) {
1048
+ return "" + t;
1049
+ }
1050
+ br() {
1051
+ return "";
1052
+ }
1053
+ }
1054
+ class y {
1055
+ constructor(n) {
1056
+ m(this, "options");
1057
+ m(this, "renderer");
1058
+ m(this, "textRenderer");
1059
+ this.options = n || S, this.options.renderer = this.options.renderer || new Z(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new v();
1060
+ }
1061
+ /**
1062
+ * Static Parse Method
1063
+ */
1064
+ static parse(n, e) {
1065
+ return new y(e).parse(n);
1066
+ }
1067
+ /**
1068
+ * Static Parse Inline Method
1069
+ */
1070
+ static parseInline(n, e) {
1071
+ return new y(e).parseInline(n);
1072
+ }
1073
+ /**
1074
+ * Parse Loop
1075
+ */
1076
+ parse(n, e = !0) {
1077
+ let t = "";
1078
+ for (let s = 0; s < n.length; s++) {
1079
+ const r = n[s];
1080
+ if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) {
1081
+ const i = r, l = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1082
+ if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(i.type)) {
1083
+ t += l || "";
1084
+ continue;
1085
+ }
1086
+ }
1087
+ switch (r.type) {
1088
+ case "space":
1089
+ continue;
1090
+ case "hr": {
1091
+ t += this.renderer.hr();
1092
+ continue;
1093
+ }
1094
+ case "heading": {
1095
+ const i = r;
1096
+ t += this.renderer.heading(this.parseInline(i.tokens), i.depth, re(this.parseInline(i.tokens, this.textRenderer)));
1097
+ continue;
1098
+ }
1099
+ case "code": {
1100
+ const i = r;
1101
+ t += this.renderer.code(i.text, i.lang, !!i.escaped);
1102
+ continue;
1103
+ }
1104
+ case "table": {
1105
+ const i = r;
1106
+ let l = "", o = "";
1107
+ for (let h = 0; h < i.header.length; h++)
1108
+ o += this.renderer.tablecell(this.parseInline(i.header[h].tokens), { header: !0, align: i.align[h] });
1109
+ l += this.renderer.tablerow(o);
1110
+ let u = "";
1111
+ for (let h = 0; h < i.rows.length; h++) {
1112
+ const g = i.rows[h];
1113
+ o = "";
1114
+ for (let f = 0; f < g.length; f++)
1115
+ o += this.renderer.tablecell(this.parseInline(g[f].tokens), { header: !1, align: i.align[f] });
1116
+ u += this.renderer.tablerow(o);
1117
+ }
1118
+ t += this.renderer.table(l, u);
1119
+ continue;
1120
+ }
1121
+ case "blockquote": {
1122
+ const i = r, l = this.parse(i.tokens);
1123
+ t += this.renderer.blockquote(l);
1124
+ continue;
1125
+ }
1126
+ case "list": {
1127
+ const i = r, l = i.ordered, o = i.start, u = i.loose;
1128
+ let h = "";
1129
+ for (let g = 0; g < i.items.length; g++) {
1130
+ const f = i.items[g], x = f.checked, $ = f.task;
1131
+ let w = "";
1132
+ if (f.task) {
1133
+ const T = this.renderer.checkbox(!!x);
1134
+ u ? f.tokens.length > 0 && f.tokens[0].type === "paragraph" ? (f.tokens[0].text = T + " " + f.tokens[0].text, f.tokens[0].tokens && f.tokens[0].tokens.length > 0 && f.tokens[0].tokens[0].type === "text" && (f.tokens[0].tokens[0].text = T + " " + f.tokens[0].tokens[0].text)) : f.tokens.unshift({
1135
+ type: "text",
1136
+ text: T + " "
1137
+ }) : w += T + " ";
1138
+ }
1139
+ w += this.parse(f.tokens, u), h += this.renderer.listitem(w, $, !!x);
1140
+ }
1141
+ t += this.renderer.list(h, l, o);
1142
+ continue;
1143
+ }
1144
+ case "html": {
1145
+ const i = r;
1146
+ t += this.renderer.html(i.text, i.block);
1147
+ continue;
1148
+ }
1149
+ case "paragraph": {
1150
+ const i = r;
1151
+ t += this.renderer.paragraph(this.parseInline(i.tokens));
1152
+ continue;
1153
+ }
1154
+ case "text": {
1155
+ let i = r, l = i.tokens ? this.parseInline(i.tokens) : i.text;
1156
+ for (; s + 1 < n.length && n[s + 1].type === "text"; )
1157
+ i = n[++s], l += `
1158
+ ` + (i.tokens ? this.parseInline(i.tokens) : i.text);
1159
+ t += e ? this.renderer.paragraph(l) : l;
1160
+ continue;
1161
+ }
1162
+ default: {
1163
+ const i = 'Token with "' + r.type + '" type was not found.';
1164
+ if (this.options.silent)
1165
+ return console.error(i), "";
1166
+ throw new Error(i);
1167
+ }
1168
+ }
1169
+ }
1170
+ return t;
1171
+ }
1172
+ /**
1173
+ * Parse Inline Tokens
1174
+ */
1175
+ parseInline(n, e) {
1176
+ e = e || this.renderer;
1177
+ let t = "";
1178
+ for (let s = 0; s < n.length; s++) {
1179
+ const r = n[s];
1180
+ if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) {
1181
+ const i = this.options.extensions.renderers[r.type].call({ parser: this }, r);
1182
+ if (i !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
1183
+ t += i || "";
1184
+ continue;
1185
+ }
1186
+ }
1187
+ switch (r.type) {
1188
+ case "escape": {
1189
+ const i = r;
1190
+ t += e.text(i.text);
1191
+ break;
1192
+ }
1193
+ case "html": {
1194
+ const i = r;
1195
+ t += e.html(i.text);
1196
+ break;
1197
+ }
1198
+ case "link": {
1199
+ const i = r;
1200
+ t += e.link(i.href, i.title, this.parseInline(i.tokens, e));
1201
+ break;
1202
+ }
1203
+ case "image": {
1204
+ const i = r;
1205
+ t += e.image(i.href, i.title, i.text);
1206
+ break;
1207
+ }
1208
+ case "strong": {
1209
+ const i = r;
1210
+ t += e.strong(this.parseInline(i.tokens, e));
1211
+ break;
1212
+ }
1213
+ case "em": {
1214
+ const i = r;
1215
+ t += e.em(this.parseInline(i.tokens, e));
1216
+ break;
1217
+ }
1218
+ case "codespan": {
1219
+ const i = r;
1220
+ t += e.codespan(i.text);
1221
+ break;
1222
+ }
1223
+ case "br": {
1224
+ t += e.br();
1225
+ break;
1226
+ }
1227
+ case "del": {
1228
+ const i = r;
1229
+ t += e.del(this.parseInline(i.tokens, e));
1230
+ break;
1231
+ }
1232
+ case "text": {
1233
+ const i = r;
1234
+ t += e.text(i.text);
1235
+ break;
1236
+ }
1237
+ default: {
1238
+ const i = 'Token with "' + r.type + '" type was not found.';
1239
+ if (this.options.silent)
1240
+ return console.error(i), "";
1241
+ throw new Error(i);
1242
+ }
1243
+ }
1244
+ }
1245
+ return t;
1246
+ }
1247
+ }
1248
+ class I {
1249
+ constructor(n) {
1250
+ m(this, "options");
1251
+ this.options = n || S;
1252
+ }
1253
+ /**
1254
+ * Process markdown before marked
1255
+ */
1256
+ preprocess(n) {
1257
+ return n;
1258
+ }
1259
+ /**
1260
+ * Process HTML after marked is finished
1261
+ */
1262
+ postprocess(n) {
1263
+ return n;
1264
+ }
1265
+ }
1266
+ m(I, "passThroughHooks", /* @__PURE__ */ new Set([
1267
+ "preprocess",
1268
+ "postprocess"
1269
+ ]));
1270
+ var R, D, J;
1271
+ class ce {
1272
+ constructor(...n) {
1273
+ U(this, R);
1274
+ m(this, "defaults", P());
1275
+ m(this, "options", this.setOptions);
1276
+ m(this, "parse", A(this, R, D).call(this, _.lex, y.parse));
1277
+ m(this, "parseInline", A(this, R, D).call(this, _.lexInline, y.parseInline));
1278
+ m(this, "Parser", y);
1279
+ m(this, "Renderer", Z);
1280
+ m(this, "TextRenderer", v);
1281
+ m(this, "Lexer", _);
1282
+ m(this, "Tokenizer", C);
1283
+ m(this, "Hooks", I);
1284
+ this.use(...n);
1285
+ }
1286
+ /**
1287
+ * Run callback for every token
1288
+ */
1289
+ walkTokens(n, e) {
1290
+ var s, r;
1291
+ let t = [];
1292
+ for (const i of n)
1293
+ switch (t = t.concat(e.call(this, i)), i.type) {
1294
+ case "table": {
1295
+ const l = i;
1296
+ for (const o of l.header)
1297
+ t = t.concat(this.walkTokens(o.tokens, e));
1298
+ for (const o of l.rows)
1299
+ for (const u of o)
1300
+ t = t.concat(this.walkTokens(u.tokens, e));
1301
+ break;
1302
+ }
1303
+ case "list": {
1304
+ const l = i;
1305
+ t = t.concat(this.walkTokens(l.items, e));
1306
+ break;
1307
+ }
1308
+ default: {
1309
+ const l = i;
1310
+ (r = (s = this.defaults.extensions) == null ? void 0 : s.childTokens) != null && r[l.type] ? this.defaults.extensions.childTokens[l.type].forEach((o) => {
1311
+ t = t.concat(this.walkTokens(l[o], e));
1312
+ }) : l.tokens && (t = t.concat(this.walkTokens(l.tokens, e)));
1313
+ }
1314
+ }
1315
+ return t;
1316
+ }
1317
+ use(...n) {
1318
+ const e = this.defaults.extensions || { renderers: {}, childTokens: {} };
1319
+ return n.forEach((t) => {
1320
+ const s = { ...t };
1321
+ if (s.async = this.defaults.async || s.async || !1, t.extensions && (t.extensions.forEach((r) => {
1322
+ if (!r.name)
1323
+ throw new Error("extension name required");
1324
+ if ("renderer" in r) {
1325
+ const i = e.renderers[r.name];
1326
+ i ? e.renderers[r.name] = function(...l) {
1327
+ let o = r.renderer.apply(this, l);
1328
+ return o === !1 && (o = i.apply(this, l)), o;
1329
+ } : e.renderers[r.name] = r.renderer;
1330
+ }
1331
+ if ("tokenizer" in r) {
1332
+ if (!r.level || r.level !== "block" && r.level !== "inline")
1333
+ throw new Error("extension level must be 'block' or 'inline'");
1334
+ const i = e[r.level];
1335
+ i ? i.unshift(r.tokenizer) : e[r.level] = [r.tokenizer], r.start && (r.level === "block" ? e.startBlock ? e.startBlock.push(r.start) : e.startBlock = [r.start] : r.level === "inline" && (e.startInline ? e.startInline.push(r.start) : e.startInline = [r.start]));
1336
+ }
1337
+ "childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
1338
+ }), s.extensions = e), t.renderer) {
1339
+ const r = this.defaults.renderer || new Z(this.defaults);
1340
+ for (const i in t.renderer) {
1341
+ const l = t.renderer[i], o = i, u = r[o];
1342
+ r[o] = (...h) => {
1343
+ let g = l.apply(r, h);
1344
+ return g === !1 && (g = u.apply(r, h)), g || "";
1345
+ };
1346
+ }
1347
+ s.renderer = r;
1348
+ }
1349
+ if (t.tokenizer) {
1350
+ const r = this.defaults.tokenizer || new C(this.defaults);
1351
+ for (const i in t.tokenizer) {
1352
+ const l = t.tokenizer[i], o = i, u = r[o];
1353
+ r[o] = (...h) => {
1354
+ let g = l.apply(r, h);
1355
+ return g === !1 && (g = u.apply(r, h)), g;
1356
+ };
1357
+ }
1358
+ s.tokenizer = r;
1359
+ }
1360
+ if (t.hooks) {
1361
+ const r = this.defaults.hooks || new I();
1362
+ for (const i in t.hooks) {
1363
+ const l = t.hooks[i], o = i, u = r[o];
1364
+ I.passThroughHooks.has(i) ? r[o] = (h) => {
1365
+ if (this.defaults.async)
1366
+ return Promise.resolve(l.call(r, h)).then((f) => u.call(r, f));
1367
+ const g = l.call(r, h);
1368
+ return u.call(r, g);
1369
+ } : r[o] = (...h) => {
1370
+ let g = l.apply(r, h);
1371
+ return g === !1 && (g = u.apply(r, h)), g;
1372
+ };
1373
+ }
1374
+ s.hooks = r;
1375
+ }
1376
+ if (t.walkTokens) {
1377
+ const r = this.defaults.walkTokens, i = t.walkTokens;
1378
+ s.walkTokens = function(l) {
1379
+ let o = [];
1380
+ return o.push(i.call(this, l)), r && (o = o.concat(r.call(this, l))), o;
1381
+ };
1382
+ }
1383
+ this.defaults = { ...this.defaults, ...s };
1384
+ }), this;
1385
+ }
1386
+ setOptions(n) {
1387
+ return this.defaults = { ...this.defaults, ...n }, this;
1388
+ }
1389
+ lexer(n, e) {
1390
+ return _.lex(n, e ?? this.defaults);
1391
+ }
1392
+ parser(n, e) {
1393
+ return y.parse(n, e ?? this.defaults);
1394
+ }
1395
+ }
1396
+ R = new WeakSet(), D = function(n, e) {
1397
+ return (t, s) => {
1398
+ const r = { ...s }, i = { ...this.defaults, ...r };
1399
+ this.defaults.async === !0 && r.async === !1 && (i.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), i.async = !0);
1400
+ const l = A(this, R, J).call(this, !!i.silent, !!i.async);
1401
+ if (typeof t > "u" || t === null)
1402
+ return l(new Error("marked(): input parameter is undefined or null"));
1403
+ if (typeof t != "string")
1404
+ return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1405
+ if (i.hooks && (i.hooks.options = i), i.async)
1406
+ return Promise.resolve(i.hooks ? i.hooks.preprocess(t) : t).then((o) => n(o, i)).then((o) => i.walkTokens ? Promise.all(this.walkTokens(o, i.walkTokens)).then(() => o) : o).then((o) => e(o, i)).then((o) => i.hooks ? i.hooks.postprocess(o) : o).catch(l);
1407
+ try {
1408
+ i.hooks && (t = i.hooks.preprocess(t));
1409
+ const o = n(t, i);
1410
+ i.walkTokens && this.walkTokens(o, i.walkTokens);
1411
+ let u = e(o, i);
1412
+ return i.hooks && (u = i.hooks.postprocess(u)), u;
1413
+ } catch (o) {
1414
+ return l(o);
1415
+ }
1416
+ };
1417
+ }, J = function(n, e) {
1418
+ return (t) => {
1419
+ if (t.message += `
1420
+ Please report this to https://github.com/markedjs/marked.`, n) {
1421
+ const s = "<p>An error occurred:</p><pre>" + b(t.message + "", !0) + "</pre>";
1422
+ return e ? Promise.resolve(s) : s;
1423
+ }
1424
+ if (e)
1425
+ return Promise.reject(t);
1426
+ throw t;
1427
+ };
1428
+ };
1429
+ const z = new ce();
1430
+ function d(c, n) {
1431
+ return z.parse(c, n);
1432
+ }
1433
+ d.options = d.setOptions = function(c) {
1434
+ return z.setOptions(c), d.defaults = z.defaults, X(d.defaults), d;
1435
+ };
1436
+ d.getDefaults = P;
1437
+ d.defaults = S;
1438
+ d.use = function(...c) {
1439
+ return z.use(...c), d.defaults = z.defaults, X(d.defaults), d;
1440
+ };
1441
+ d.walkTokens = function(c, n) {
1442
+ return z.walkTokens(c, n);
1443
+ };
1444
+ d.parseInline = z.parseInline;
1445
+ d.Parser = y;
1446
+ d.parser = y.parse;
1447
+ d.Renderer = Z;
1448
+ d.TextRenderer = v;
1449
+ d.Lexer = _;
1450
+ d.lexer = _.lex;
1451
+ d.Tokenizer = C;
1452
+ d.Hooks = I;
1453
+ d.parse = d;
1454
+ const pe = d.options, ue = d.setOptions, fe = d.use, ge = d.walkTokens, ke = d.parseInline, de = d, xe = y.parse, me = _.lex;
1455
+ export {
1456
+ I as Hooks,
1457
+ _ as Lexer,
1458
+ ce as Marked,
1459
+ y as Parser,
1460
+ Z as Renderer,
1461
+ v as TextRenderer,
1462
+ C as Tokenizer,
1463
+ S as defaults,
1464
+ P as getDefaults,
1465
+ me as lexer,
1466
+ d as marked,
1467
+ pe as options,
1468
+ de as parse,
1469
+ ke as parseInline,
1470
+ xe as parser,
1471
+ ue as setOptions,
1472
+ fe as use,
1473
+ ge as walkTokens
1474
+ };
1475
+ //# sourceMappingURL=marked.esm.js.map