ranui 0.2.1-alpha.1 → 0.2.1-alpha.4
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.
- package/dist/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
- package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
- package/dist/arc-D25LhgTs.cjs +1 -0
- package/dist/arc-DRPGof21.js +82 -0
- package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
- package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
- package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
- package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
- package/dist/array-By5736M5.js +7 -0
- package/dist/array-C3cbN3GY.cjs +1 -0
- package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
- package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
- package/dist/builder.d.ts +2 -2
- package/dist/builder.js +39 -34
- package/dist/{builtin-D9djWkCE.js → builtin-1lUEp_ro.js} +83 -76
- package/dist/button-Cj-XSCsd.js +117 -0
- package/dist/button.js +1 -1
- package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
- package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
- package/dist/{card-CqJa4Q_v.js → card-BHN9Xp4S.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/channel-C9WSNwcS.cjs +1 -0
- package/dist/channel-k5-UxdcV.js +5 -0
- package/dist/{checkbox-CThC9-vy.js → checkbox-O_J_n1_W.js} +10 -10
- package/dist/checkbox.js +1 -1
- package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
- package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
- package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
- package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
- package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
- package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
- package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
- package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
- package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
- package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
- package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
- package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
- package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
- package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
- package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
- package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
- package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
- package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
- package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
- package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
- package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
- package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
- package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
- package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
- package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
- package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
- package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
- package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
- package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
- package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
- package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
- package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
- package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
- package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
- package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
- package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
- package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
- package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
- package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
- package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
- package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
- package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
- package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
- package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
- package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
- package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
- package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
- package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
- package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
- package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
- package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
- package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
- package/dist/{colorpicker-XNxDRcQ-.js → colorpicker-mebH0XLm.js} +8 -8
- package/dist/colorpicker.js +1 -1
- package/dist/components/glass/index.d.ts +52 -0
- package/dist/components/icon/core-icons.d.ts +13 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/mermaid/index.d.ts +52 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/content-YOKzMoc7.js +39 -0
- package/dist/content.js +5 -0
- package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
- package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
- package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
- package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
- package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
- package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
- package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
- package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
- package/dist/dagre-D1-W1tt6.cjs +1 -0
- package/dist/dagre-D8GLTwuf.js +1578 -0
- package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
- package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
- package/dist/defaultLocale-0M_kMcEH.js +184 -0
- package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
- package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
- package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
- package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
- package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
- package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
- package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
- package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
- package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
- package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
- package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
- package/dist/dist-C0Fwsvsq.js +70 -0
- package/dist/dist-C20XxSsP.cjs +1 -0
- package/dist/{dropdown-CCvsambb.js → dropdown-CzGAVWYC.js} +4 -4
- package/dist/dropdown.js +1 -1
- package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
- package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
- package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
- package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
- package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
- package/dist/factory-ZNhcQ4tf.js +482 -0
- package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
- package/dist/{form-Ceq3uJzz.js → form-B8afuJlF.js} +5 -5
- package/dist/form.js +1 -1
- package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
- package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
- package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
- package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
- package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
- package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
- package/dist/glass-BniIptBE.js +115 -0
- package/dist/glass.js +5 -0
- package/dist/graphlib-CCKThIKP.js +1104 -0
- package/dist/graphlib-Du-578Js.cjs +1 -0
- package/dist/{icon-C_ENrJ3F.js → icon-GZrfSeon.js} +77 -25
- package/dist/icon.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/glass.iife.js +1 -0
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/mermaid.iife.js +3535 -0
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/iife/theme-switch.iife.js +1 -1
- package/dist/{image-B7MBI5n_.js → image-CqoQfJoV.js} +4 -4
- package/dist/image.js +1 -1
- package/dist/index.cjs +38 -37
- package/dist/index.d.ts +8 -0
- package/dist/index.iife.js +3623 -88
- package/dist/index.js +88 -84
- package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
- package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
- package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
- package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
- package/dist/init-1VpIn1S3.js +16 -0
- package/dist/init-CbDwVtpO.cjs +1 -0
- package/dist/{input-RNqdEHPf.js → input-BlwAXu7I.js} +6 -6
- package/dist/input.js +1 -1
- package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
- package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
- package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
- package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
- package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
- package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
- package/dist/katex-Cq3Y8cmK.cjs +257 -0
- package/dist/katex-Pg2EqTH0.js +23485 -0
- package/dist/line-BIPmUVxO.js +33 -0
- package/dist/line-CAB5QHC6.cjs +1 -0
- package/dist/linear-B2AM4ZBe.js +259 -0
- package/dist/linear-CSAfNEpl.cjs +1 -0
- package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
- package/dist/link.js +1 -1
- package/dist/{loading-B9MFI03l.js → loading-M6gWxLbm.js} +4 -4
- package/dist/loading.js +1 -1
- package/dist/map-BC2bk_rV.cjs +1 -0
- package/dist/map-DMSWkcq6.js +208 -0
- package/dist/{math-CudIwEXZ.js → math-8E-45Y8e.js} +4 -4
- package/dist/math.js +1 -1
- package/dist/mermaid-C1oQyPE3.js +261 -0
- package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
- package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
- package/dist/mermaid.core-B2d5lQW2.js +1085 -0
- package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
- package/dist/mermaid.js +5 -0
- package/dist/{message-DW7qWpEm.js → message-CNdmbeLf.js} +6 -6
- package/dist/message.js +1 -1
- package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
- package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
- package/dist/{modal-CrvGKL2B.js → modal-gRagDkTb.js} +40 -24
- package/dist/modal.js +1 -1
- package/dist/ordinal-BMN81JG2.js +64 -0
- package/dist/ordinal-BplLHIij.cjs +1 -0
- package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
- package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
- package/dist/path-Bja5PoYn.js +82 -0
- package/dist/path-DmfWsuKi.cjs +1 -0
- package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
- package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
- package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
- package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
- package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
- package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
- package/dist/{player-BKQaaT7o.js → player-CAQ5Og2P.js} +196 -195
- package/dist/player.js +1 -1
- package/dist/{popover-CvYIVgUS.js → popover-BZKSLe3D.js} +22 -54
- package/dist/popover.js +1 -1
- package/dist/{progress-C6jctsFH.js → progress-vk40tuhm.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
- package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
- package/dist/{radar-BUb4EzmG.js → radar-Bg0cexzU.js} +5 -5
- package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
- package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
- package/dist/radar.js +1 -1
- package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
- package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
- package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
- package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
- package/dist/ranui.css +1 -1
- package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
- package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
- package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
- package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
- package/dist/rough.esm-BWe9E0Nz.js +1387 -0
- package/dist/rough.esm-BfSi6CZE.cjs +1 -0
- package/dist/{route-Djrf9UR_.js → route-CGwS0cd_.js} +10 -10
- package/dist/route.js +1 -1
- package/dist/{router-BU2KhtxV.js → router-BK6DEkcN.js} +5 -5
- package/dist/router.js +1 -1
- package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
- package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
- package/dist/{scratch-CO4I2dIa.js → scratch-ClF1awGi.js} +2 -2
- package/dist/scratch.js +1 -1
- package/dist/{section-CsUkp8bv.js → section-BL0V7Kjf.js} +2 -2
- package/dist/section.js +1 -1
- package/dist/{select-Dn26ajJZ.js → select-BIFVbQIj.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
- package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
- package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
- package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
- package/dist/{skeleton-BuMLhvzQ.js → skeleton-D7JIbROq.js} +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/src-C9EhKhbk.cjs +1 -0
- package/dist/src-DtRLxcYO.js +2104 -0
- package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
- package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
- package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
- package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
- package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
- package/dist/{tab-40fDkuox.js → tab-DFVtDJb2.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-F4Pd7JtC.js → tabpane-C3qZGN-D.js} +5 -5
- package/dist/tabpane.js +1 -1
- package/dist/test/ssr/stream.test.d.ts +1 -0
- package/dist/{theme-switch-B09egc6h.js → theme-switch-BXNH5uPD.js} +45 -45
- package/dist/theme-switch.js +1 -1
- package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
- package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
- package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
- package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
- package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
- package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
- package/dist/utils/builder/core.d.ts +135 -3
- package/dist/utils/builder/index.d.ts +1 -1
- package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
- package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
- package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
- package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
- package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
- package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
- package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
- package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
- package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
- package/docs/BUILDER.md +170 -2
- package/package.json +7 -1
- package/dist/button-BfYw0fes.js +0 -117
- package/dist/factory-DCrO37si.js +0 -334
|
@@ -0,0 +1,1709 @@
|
|
|
1
|
+
import { n as x } from "./chunk-Y2CYZVJY-0JxdZxki.js";
|
|
2
|
+
import { m as xe, p as R } from "./src-DtRLxcYO.js";
|
|
3
|
+
import { A as be, F as De, b as Fe, s as Ne, z as me } from "./chunk-WYO6CB5R-DDHkKowO.js";
|
|
4
|
+
import { a as oe } from "./chunk-ICXQ74PX-DR8rL-xF.js";
|
|
5
|
+
import { n as Ge, t as Qe } from "./chunk-HOUHSVGY-DRQcQeMT.js";
|
|
6
|
+
function U() {
|
|
7
|
+
return {
|
|
8
|
+
async: !1,
|
|
9
|
+
breaks: !1,
|
|
10
|
+
extensions: null,
|
|
11
|
+
gfm: !0,
|
|
12
|
+
hooks: null,
|
|
13
|
+
pedantic: !1,
|
|
14
|
+
renderer: null,
|
|
15
|
+
silent: !1,
|
|
16
|
+
tokenizer: null,
|
|
17
|
+
walkTokens: null
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var $ = U();
|
|
21
|
+
function we(r) {
|
|
22
|
+
$ = r;
|
|
23
|
+
}
|
|
24
|
+
var L = { exec: () => null };
|
|
25
|
+
function g(r, e = "") {
|
|
26
|
+
let n = typeof r == "string" ? r : r.source, s = {
|
|
27
|
+
replace: (t, l) => {
|
|
28
|
+
let i = typeof l == "string" ? l : l.source;
|
|
29
|
+
return i = i.replace(b.caret, "$1"), n = n.replace(t, i), s;
|
|
30
|
+
},
|
|
31
|
+
getRegex: () => new RegExp(n, e)
|
|
32
|
+
};
|
|
33
|
+
return s;
|
|
34
|
+
}
|
|
35
|
+
var Ue = (() => {
|
|
36
|
+
try {
|
|
37
|
+
return !0;
|
|
38
|
+
} catch {
|
|
39
|
+
return !1;
|
|
40
|
+
}
|
|
41
|
+
})(), b = {
|
|
42
|
+
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
43
|
+
outputLinkReplace: /\\([\[\]])/g,
|
|
44
|
+
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
45
|
+
beginningSpace: /^\s+/,
|
|
46
|
+
endingHash: /#$/,
|
|
47
|
+
startingSpaceChar: /^ /,
|
|
48
|
+
endingSpaceChar: / $/,
|
|
49
|
+
nonSpaceChar: /[^ ]/,
|
|
50
|
+
newLineCharGlobal: /\n/g,
|
|
51
|
+
tabCharGlobal: /\t/g,
|
|
52
|
+
multipleSpaceGlobal: /\s+/g,
|
|
53
|
+
blankLine: /^[ \t]*$/,
|
|
54
|
+
doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
|
|
55
|
+
blockquoteStart: /^ {0,3}>/,
|
|
56
|
+
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
|
|
57
|
+
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
|
|
58
|
+
listReplaceTabs: /^\t+/,
|
|
59
|
+
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
|
|
60
|
+
listIsTask: /^\[[ xX]\] /,
|
|
61
|
+
listReplaceTask: /^\[[ xX]\] +/,
|
|
62
|
+
anyLine: /\n.*\n/,
|
|
63
|
+
hrefBrackets: /^<(.*)>$/,
|
|
64
|
+
tableDelimiter: /[:|]/,
|
|
65
|
+
tableAlignChars: /^\||\| *$/g,
|
|
66
|
+
tableRowBlankLine: /\n[ \t]*$/,
|
|
67
|
+
tableAlignRight: /^ *-+: *$/,
|
|
68
|
+
tableAlignCenter: /^ *:-+: *$/,
|
|
69
|
+
tableAlignLeft: /^ *:-+ *$/,
|
|
70
|
+
startATag: /^<a /i,
|
|
71
|
+
endATag: /^<\/a>/i,
|
|
72
|
+
startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
|
|
73
|
+
endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
|
|
74
|
+
startAngleBracket: /^</,
|
|
75
|
+
endAngleBracket: />$/,
|
|
76
|
+
pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
|
|
77
|
+
unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
|
|
78
|
+
escapeTest: /[&<>"']/,
|
|
79
|
+
escapeReplace: /[&<>"']/g,
|
|
80
|
+
escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
|
|
81
|
+
escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
|
|
82
|
+
unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
|
|
83
|
+
caret: /(^|[^\[])\^/g,
|
|
84
|
+
percentDecode: /%25/g,
|
|
85
|
+
findPipe: /\|/g,
|
|
86
|
+
splitPipe: / \|/,
|
|
87
|
+
slashPipe: /\\\|/g,
|
|
88
|
+
carriageReturn: /\r\n|\r/g,
|
|
89
|
+
spaceLine: /^ +$/gm,
|
|
90
|
+
notSpaceStart: /^\S*/,
|
|
91
|
+
endingNewline: /\n$/,
|
|
92
|
+
listItemRegex: (r) => new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
93
|
+
nextBulletRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
94
|
+
hrRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
|
|
95
|
+
fencesBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`),
|
|
96
|
+
headingBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}#`),
|
|
97
|
+
htmlBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
98
|
+
}, Xe = /^(?:[ \t]*(?:\n|$))+/, Ke = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ve = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, _ = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, X = /(?:[*+-]|\d{1,9}[.)])/, ye = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Te = g(ye).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(), Je = g(ye).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(), K = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, et = /^[^\n]+/, V = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, tt = g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", V).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), nt = g(/^( {0,3}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", Y = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, rt = g("^ {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", Y).replace("tag", M).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ce = g(K).replace("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", M).getRegex(), J = {
|
|
99
|
+
blockquote: g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ce).getRegex(),
|
|
100
|
+
code: Ke,
|
|
101
|
+
def: tt,
|
|
102
|
+
fences: Ve,
|
|
103
|
+
heading: Ye,
|
|
104
|
+
hr: _,
|
|
105
|
+
html: rt,
|
|
106
|
+
lheading: Te,
|
|
107
|
+
list: nt,
|
|
108
|
+
newline: Xe,
|
|
109
|
+
paragraph: ce,
|
|
110
|
+
table: L,
|
|
111
|
+
text: et
|
|
112
|
+
}, pe = g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex(), st = {
|
|
113
|
+
...J,
|
|
114
|
+
lheading: Je,
|
|
115
|
+
table: pe,
|
|
116
|
+
paragraph: g(K).replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", pe).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", M).getRegex()
|
|
117
|
+
}, it = {
|
|
118
|
+
...J,
|
|
119
|
+
html: g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Y).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(),
|
|
120
|
+
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
121
|
+
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
122
|
+
fences: L,
|
|
123
|
+
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
124
|
+
paragraph: g(K).replace("hr", _).replace("heading", ` *#{1,6} *[^
|
|
125
|
+
]`).replace("lheading", Te).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
126
|
+
}, lt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, at = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Se = /^( {2,}|\\)\n(?!\s*$)/, ot = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, W = /[\p{P}\p{S}]/u, ee = /[\s\p{P}\p{S}]/u, $e = /[^\s\p{P}\p{S}]/u, ct = g(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, ee).getRegex(), ve = /(?!~)[\p{P}\p{S}]/u, pt = /(?!~)[\s\p{P}\p{S}]/u, ht = /(?:[^\s\p{P}\p{S}]|~)/u, ut = g(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ue ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Re = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, gt = g(Re, "u").replace(/punct/g, W).getRegex(), ft = g(Re, "u").replace(/punct/g, ve).getRegex(), ze = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", kt = g(ze, "gu").replace(/notPunctSpace/g, $e).replace(/punctSpace/g, ee).replace(/punct/g, W).getRegex(), dt = g(ze, "gu").replace(/notPunctSpace/g, ht).replace(/punctSpace/g, pt).replace(/punct/g, ve).getRegex(), xt = g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, $e).replace(/punctSpace/g, ee).replace(/punct/g, W).getRegex(), bt = g(/\\(punct)/, "gu").replace(/punct/g, W).getRegex(), mt = g(/^<(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(), wt = g(Y).replace("(?:-->|$)", "-->").getRegex(), yt = g("^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", wt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), P = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Tt = g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", P).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ae = g(/^!?\[(label)\]\[(ref)\]/).replace("label", P).replace("ref", V).getRegex(), Ie = g(/^!?\[(ref)\](?:\[\])?/).replace("ref", V).getRegex(), St = g("reflink|nolink(?!\\()", "g").replace("reflink", Ae).replace("nolink", Ie).getRegex(), he = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, te = {
|
|
127
|
+
_backpedal: L,
|
|
128
|
+
anyPunctuation: bt,
|
|
129
|
+
autolink: mt,
|
|
130
|
+
blockSkip: ut,
|
|
131
|
+
br: Se,
|
|
132
|
+
code: at,
|
|
133
|
+
del: L,
|
|
134
|
+
emStrongLDelim: gt,
|
|
135
|
+
emStrongRDelimAst: kt,
|
|
136
|
+
emStrongRDelimUnd: xt,
|
|
137
|
+
escape: lt,
|
|
138
|
+
link: Tt,
|
|
139
|
+
nolink: Ie,
|
|
140
|
+
punctuation: ct,
|
|
141
|
+
reflink: Ae,
|
|
142
|
+
reflinkSearch: St,
|
|
143
|
+
tag: yt,
|
|
144
|
+
text: ot,
|
|
145
|
+
url: L
|
|
146
|
+
}, $t = {
|
|
147
|
+
...te,
|
|
148
|
+
link: g(/^!?\[(label)\]\((.*?)\)/).replace("label", P).getRegex(),
|
|
149
|
+
reflink: g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", P).getRegex()
|
|
150
|
+
}, D = {
|
|
151
|
+
...te,
|
|
152
|
+
emStrongRDelimAst: dt,
|
|
153
|
+
emStrongLDelim: ft,
|
|
154
|
+
url: g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", he).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
155
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
156
|
+
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
157
|
+
text: g(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", he).getRegex()
|
|
158
|
+
}, vt = {
|
|
159
|
+
...D,
|
|
160
|
+
br: g(Se).replace("{2,}", "*").getRegex(),
|
|
161
|
+
text: g(D.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
162
|
+
}, E = {
|
|
163
|
+
normal: J,
|
|
164
|
+
gfm: st,
|
|
165
|
+
pedantic: it
|
|
166
|
+
}, z = {
|
|
167
|
+
normal: te,
|
|
168
|
+
gfm: D,
|
|
169
|
+
breaks: vt,
|
|
170
|
+
pedantic: $t
|
|
171
|
+
}, Rt = {
|
|
172
|
+
"&": "&",
|
|
173
|
+
"<": "<",
|
|
174
|
+
">": ">",
|
|
175
|
+
'"': """,
|
|
176
|
+
"'": "'"
|
|
177
|
+
}, ue = (r) => Rt[r];
|
|
178
|
+
function T(r, e) {
|
|
179
|
+
if (e) {
|
|
180
|
+
if (b.escapeTest.test(r)) return r.replace(b.escapeReplace, ue);
|
|
181
|
+
} else if (b.escapeTestNoEncode.test(r)) return r.replace(b.escapeReplaceNoEncode, ue);
|
|
182
|
+
return r;
|
|
183
|
+
}
|
|
184
|
+
function ge(r) {
|
|
185
|
+
try {
|
|
186
|
+
r = encodeURI(r).replace(b.percentDecode, "%");
|
|
187
|
+
} catch {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
return r;
|
|
191
|
+
}
|
|
192
|
+
function fe(r, e) {
|
|
193
|
+
let n = r.replace(b.findPipe, (t, l, i) => {
|
|
194
|
+
let a = !1, o = l;
|
|
195
|
+
for (; --o >= 0 && i[o] === "\\"; ) a = !a;
|
|
196
|
+
return a ? "|" : " |";
|
|
197
|
+
}).split(b.splitPipe), s = 0;
|
|
198
|
+
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
|
|
199
|
+
else for (; n.length < e; ) n.push("");
|
|
200
|
+
for (; s < n.length; s++) n[s] = n[s].trim().replace(b.slashPipe, "|");
|
|
201
|
+
return n;
|
|
202
|
+
}
|
|
203
|
+
function A(r, e, n) {
|
|
204
|
+
let s = r.length;
|
|
205
|
+
if (s === 0) return "";
|
|
206
|
+
let t = 0;
|
|
207
|
+
for (; t < s; ) {
|
|
208
|
+
let l = r.charAt(s - t - 1);
|
|
209
|
+
if (l === e && !n) t++;
|
|
210
|
+
else if (l !== e && n) t++;
|
|
211
|
+
else break;
|
|
212
|
+
}
|
|
213
|
+
return r.slice(0, s - t);
|
|
214
|
+
}
|
|
215
|
+
function zt(r, e) {
|
|
216
|
+
if (r.indexOf(e[1]) === -1) return -1;
|
|
217
|
+
let n = 0;
|
|
218
|
+
for (let s = 0; s < r.length; s++) if (r[s] === "\\") s++;
|
|
219
|
+
else if (r[s] === e[0]) n++;
|
|
220
|
+
else if (r[s] === e[1] && (n--, n < 0)) return s;
|
|
221
|
+
return n > 0 ? -2 : -1;
|
|
222
|
+
}
|
|
223
|
+
function ke(r, e, n, s, t) {
|
|
224
|
+
let l = e.href, i = e.title || null, a = r[1].replace(t.other.outputLinkReplace, "$1");
|
|
225
|
+
s.state.inLink = !0;
|
|
226
|
+
let o = {
|
|
227
|
+
type: r[0].charAt(0) === "!" ? "image" : "link",
|
|
228
|
+
raw: n,
|
|
229
|
+
href: l,
|
|
230
|
+
title: i,
|
|
231
|
+
text: a,
|
|
232
|
+
tokens: s.inlineTokens(a)
|
|
233
|
+
};
|
|
234
|
+
return s.state.inLink = !1, o;
|
|
235
|
+
}
|
|
236
|
+
function At(r, e, n) {
|
|
237
|
+
let s = r.match(n.other.indentCodeCompensation);
|
|
238
|
+
if (s === null) return e;
|
|
239
|
+
let t = s[1];
|
|
240
|
+
return e.split(`
|
|
241
|
+
`).map((l) => {
|
|
242
|
+
let i = l.match(n.other.beginningSpace);
|
|
243
|
+
if (i === null) return l;
|
|
244
|
+
let [a] = i;
|
|
245
|
+
return a.length >= t.length ? l.slice(t.length) : l;
|
|
246
|
+
}).join(`
|
|
247
|
+
`);
|
|
248
|
+
}
|
|
249
|
+
var B = class {
|
|
250
|
+
options;
|
|
251
|
+
rules;
|
|
252
|
+
lexer;
|
|
253
|
+
constructor(r) {
|
|
254
|
+
this.options = r || $;
|
|
255
|
+
}
|
|
256
|
+
space(r) {
|
|
257
|
+
let e = this.rules.block.newline.exec(r);
|
|
258
|
+
if (e && e[0].length > 0) return {
|
|
259
|
+
type: "space",
|
|
260
|
+
raw: e[0]
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
code(r) {
|
|
264
|
+
let e = this.rules.block.code.exec(r);
|
|
265
|
+
if (e) {
|
|
266
|
+
let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
267
|
+
return {
|
|
268
|
+
type: "code",
|
|
269
|
+
raw: e[0],
|
|
270
|
+
codeBlockStyle: "indented",
|
|
271
|
+
text: this.options.pedantic ? n : A(n, `
|
|
272
|
+
`)
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
fences(r) {
|
|
277
|
+
let e = this.rules.block.fences.exec(r);
|
|
278
|
+
if (e) {
|
|
279
|
+
let n = e[0], s = At(n, e[3] || "", this.rules);
|
|
280
|
+
return {
|
|
281
|
+
type: "code",
|
|
282
|
+
raw: n,
|
|
283
|
+
lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2],
|
|
284
|
+
text: s
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
heading(r) {
|
|
289
|
+
let e = this.rules.block.heading.exec(r);
|
|
290
|
+
if (e) {
|
|
291
|
+
let n = e[2].trim();
|
|
292
|
+
if (this.rules.other.endingHash.test(n)) {
|
|
293
|
+
let s = A(n, "#");
|
|
294
|
+
(this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
type: "heading",
|
|
298
|
+
raw: e[0],
|
|
299
|
+
depth: e[1].length,
|
|
300
|
+
text: n,
|
|
301
|
+
tokens: this.lexer.inline(n)
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
hr(r) {
|
|
306
|
+
let e = this.rules.block.hr.exec(r);
|
|
307
|
+
if (e) return {
|
|
308
|
+
type: "hr",
|
|
309
|
+
raw: A(e[0], `
|
|
310
|
+
`)
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
blockquote(r) {
|
|
314
|
+
let e = this.rules.block.blockquote.exec(r);
|
|
315
|
+
if (e) {
|
|
316
|
+
let n = A(e[0], `
|
|
317
|
+
`).split(`
|
|
318
|
+
`), s = "", t = "", l = [];
|
|
319
|
+
for (; n.length > 0; ) {
|
|
320
|
+
let i = !1, a = [], o;
|
|
321
|
+
for (o = 0; o < n.length; o++) if (this.rules.other.blockquoteStart.test(n[o])) a.push(n[o]), i = !0;
|
|
322
|
+
else if (!i) a.push(n[o]);
|
|
323
|
+
else break;
|
|
324
|
+
n = n.slice(o);
|
|
325
|
+
let p = a.join(`
|
|
326
|
+
`), c = p.replace(this.rules.other.blockquoteSetextReplace, `
|
|
327
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
328
|
+
s = s ? `${s}
|
|
329
|
+
${p}` : p, t = t ? `${t}
|
|
330
|
+
${c}` : c;
|
|
331
|
+
let h = this.lexer.state.top;
|
|
332
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, l, !0), this.lexer.state.top = h, n.length === 0) break;
|
|
333
|
+
let u = l.at(-1);
|
|
334
|
+
if (u?.type === "code") break;
|
|
335
|
+
if (u?.type === "blockquote") {
|
|
336
|
+
let k = u, d = k.raw + `
|
|
337
|
+
` + n.join(`
|
|
338
|
+
`), m = this.blockquote(d);
|
|
339
|
+
l[l.length - 1] = m, s = s.substring(0, s.length - k.raw.length) + m.raw, t = t.substring(0, t.length - k.text.length) + m.text;
|
|
340
|
+
break;
|
|
341
|
+
} else if (u?.type === "list") {
|
|
342
|
+
let k = u, d = k.raw + `
|
|
343
|
+
` + n.join(`
|
|
344
|
+
`), m = this.list(d);
|
|
345
|
+
l[l.length - 1] = m, s = s.substring(0, s.length - u.raw.length) + m.raw, t = t.substring(0, t.length - k.raw.length) + m.raw, n = d.substring(l.at(-1).raw.length).split(`
|
|
346
|
+
`);
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
type: "blockquote",
|
|
352
|
+
raw: s,
|
|
353
|
+
tokens: l,
|
|
354
|
+
text: t
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
list(r) {
|
|
359
|
+
let e = this.rules.block.list.exec(r);
|
|
360
|
+
if (e) {
|
|
361
|
+
let n = e[1].trim(), s = n.length > 1, t = {
|
|
362
|
+
type: "list",
|
|
363
|
+
raw: "",
|
|
364
|
+
ordered: s,
|
|
365
|
+
start: s ? +n.slice(0, -1) : "",
|
|
366
|
+
loose: !1,
|
|
367
|
+
items: []
|
|
368
|
+
};
|
|
369
|
+
n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
|
|
370
|
+
let l = this.rules.other.listItemRegex(n), i = !1;
|
|
371
|
+
for (; r; ) {
|
|
372
|
+
let o = !1, p = "", c = "";
|
|
373
|
+
if (!(e = l.exec(r)) || this.rules.block.hr.test(r)) break;
|
|
374
|
+
p = e[0], r = r.substring(p.length);
|
|
375
|
+
let h = e[2].split(`
|
|
376
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), u = r.split(`
|
|
377
|
+
`, 1)[0], k = !h.trim(), d = 0;
|
|
378
|
+
if (this.options.pedantic ? (d = 2, c = h.trimStart()) : k ? d = e[1].length + 1 : (d = e[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, c = h.slice(d), d += e[1].length), k && this.rules.other.blankLine.test(u) && (p += u + `
|
|
379
|
+
`, r = r.substring(u.length + 1), o = !0), !o) {
|
|
380
|
+
let H = this.rules.other.nextBulletRegex(d), ie = this.rules.other.hrRegex(d), le = this.rules.other.fencesBeginRegex(d), ae = this.rules.other.headingBeginRegex(d), Oe = this.rules.other.htmlBeginRegex(d);
|
|
381
|
+
for (; r; ) {
|
|
382
|
+
let O = r.split(`
|
|
383
|
+
`, 1)[0], v;
|
|
384
|
+
if (u = O, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), v = u) : v = u.replace(this.rules.other.tabCharGlobal, " "), le.test(u) || ae.test(u) || Oe.test(u) || H.test(u) || ie.test(u)) break;
|
|
385
|
+
if (v.search(this.rules.other.nonSpaceChar) >= d || !u.trim()) c += `
|
|
386
|
+
` + v.slice(d);
|
|
387
|
+
else {
|
|
388
|
+
if (k || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || le.test(h) || ae.test(h) || ie.test(h)) break;
|
|
389
|
+
c += `
|
|
390
|
+
` + u;
|
|
391
|
+
}
|
|
392
|
+
!k && !u.trim() && (k = !0), p += O + `
|
|
393
|
+
`, r = r.substring(O.length + 1), h = v.slice(d);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
t.loose || (i ? t.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (i = !0));
|
|
397
|
+
let m = null, se;
|
|
398
|
+
this.options.gfm && (m = this.rules.other.listIsTask.exec(c), m && (se = m[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), t.items.push({
|
|
399
|
+
type: "list_item",
|
|
400
|
+
raw: p,
|
|
401
|
+
task: !!m,
|
|
402
|
+
checked: se,
|
|
403
|
+
loose: !1,
|
|
404
|
+
text: c,
|
|
405
|
+
tokens: []
|
|
406
|
+
}), t.raw += p;
|
|
407
|
+
}
|
|
408
|
+
let a = t.items.at(-1);
|
|
409
|
+
if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
|
|
410
|
+
else return;
|
|
411
|
+
t.raw = t.raw.trimEnd();
|
|
412
|
+
for (let o = 0; o < t.items.length; o++) if (this.lexer.state.top = !1, t.items[o].tokens = this.lexer.blockTokens(t.items[o].text, []), !t.loose) {
|
|
413
|
+
let p = t.items[o].tokens.filter((c) => c.type === "space");
|
|
414
|
+
t.loose = p.length > 0 && p.some((c) => this.rules.other.anyLine.test(c.raw));
|
|
415
|
+
}
|
|
416
|
+
if (t.loose) for (let o = 0; o < t.items.length; o++) t.items[o].loose = !0;
|
|
417
|
+
return t;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
html(r) {
|
|
421
|
+
let e = this.rules.block.html.exec(r);
|
|
422
|
+
if (e) return {
|
|
423
|
+
type: "html",
|
|
424
|
+
block: !0,
|
|
425
|
+
raw: e[0],
|
|
426
|
+
pre: e[1] === "pre" || e[1] === "script" || e[1] === "style",
|
|
427
|
+
text: e[0]
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
def(r) {
|
|
431
|
+
let e = this.rules.block.def.exec(r);
|
|
432
|
+
if (e) {
|
|
433
|
+
let n = 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") : "", t = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
|
|
434
|
+
return {
|
|
435
|
+
type: "def",
|
|
436
|
+
tag: n,
|
|
437
|
+
raw: e[0],
|
|
438
|
+
href: s,
|
|
439
|
+
title: t
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
table(r) {
|
|
444
|
+
let e = this.rules.block.table.exec(r);
|
|
445
|
+
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
446
|
+
let n = fe(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
447
|
+
`) : [], l = {
|
|
448
|
+
type: "table",
|
|
449
|
+
raw: e[0],
|
|
450
|
+
header: [],
|
|
451
|
+
align: [],
|
|
452
|
+
rows: []
|
|
453
|
+
};
|
|
454
|
+
if (n.length === s.length) {
|
|
455
|
+
for (let i of s) this.rules.other.tableAlignRight.test(i) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(i) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(i) ? l.align.push("left") : l.align.push(null);
|
|
456
|
+
for (let i = 0; i < n.length; i++) l.header.push({
|
|
457
|
+
text: n[i],
|
|
458
|
+
tokens: this.lexer.inline(n[i]),
|
|
459
|
+
header: !0,
|
|
460
|
+
align: l.align[i]
|
|
461
|
+
});
|
|
462
|
+
for (let i of t) l.rows.push(fe(i, l.header.length).map((a, o) => ({
|
|
463
|
+
text: a,
|
|
464
|
+
tokens: this.lexer.inline(a),
|
|
465
|
+
header: !1,
|
|
466
|
+
align: l.align[o]
|
|
467
|
+
})));
|
|
468
|
+
return l;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
lheading(r) {
|
|
472
|
+
let e = this.rules.block.lheading.exec(r);
|
|
473
|
+
if (e) return {
|
|
474
|
+
type: "heading",
|
|
475
|
+
raw: e[0],
|
|
476
|
+
depth: e[2].charAt(0) === "=" ? 1 : 2,
|
|
477
|
+
text: e[1],
|
|
478
|
+
tokens: this.lexer.inline(e[1])
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
paragraph(r) {
|
|
482
|
+
let e = this.rules.block.paragraph.exec(r);
|
|
483
|
+
if (e) {
|
|
484
|
+
let n = e[1].charAt(e[1].length - 1) === `
|
|
485
|
+
` ? e[1].slice(0, -1) : e[1];
|
|
486
|
+
return {
|
|
487
|
+
type: "paragraph",
|
|
488
|
+
raw: e[0],
|
|
489
|
+
text: n,
|
|
490
|
+
tokens: this.lexer.inline(n)
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
text(r) {
|
|
495
|
+
let e = this.rules.block.text.exec(r);
|
|
496
|
+
if (e) return {
|
|
497
|
+
type: "text",
|
|
498
|
+
raw: e[0],
|
|
499
|
+
text: e[0],
|
|
500
|
+
tokens: this.lexer.inline(e[0])
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
escape(r) {
|
|
504
|
+
let e = this.rules.inline.escape.exec(r);
|
|
505
|
+
if (e) return {
|
|
506
|
+
type: "escape",
|
|
507
|
+
raw: e[0],
|
|
508
|
+
text: e[1]
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
tag(r) {
|
|
512
|
+
let e = this.rules.inline.tag.exec(r);
|
|
513
|
+
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), {
|
|
514
|
+
type: "html",
|
|
515
|
+
raw: e[0],
|
|
516
|
+
inLink: this.lexer.state.inLink,
|
|
517
|
+
inRawBlock: this.lexer.state.inRawBlock,
|
|
518
|
+
block: !1,
|
|
519
|
+
text: e[0]
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
link(r) {
|
|
523
|
+
let e = this.rules.inline.link.exec(r);
|
|
524
|
+
if (e) {
|
|
525
|
+
let n = e[2].trim();
|
|
526
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
527
|
+
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
528
|
+
let l = A(n.slice(0, -1), "\\");
|
|
529
|
+
if ((n.length - l.length) % 2 === 0) return;
|
|
530
|
+
} else {
|
|
531
|
+
let l = zt(e[2], "()");
|
|
532
|
+
if (l === -2) return;
|
|
533
|
+
if (l > -1) {
|
|
534
|
+
let i = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
|
|
535
|
+
e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, i).trim(), e[3] = "";
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
let s = e[2], t = "";
|
|
539
|
+
if (this.options.pedantic) {
|
|
540
|
+
let l = this.rules.other.pedanticHrefTitle.exec(s);
|
|
541
|
+
l && (s = l[1], t = l[3]);
|
|
542
|
+
} else t = e[3] ? e[3].slice(1, -1) : "";
|
|
543
|
+
return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), ke(e, {
|
|
544
|
+
href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
545
|
+
title: t && t.replace(this.rules.inline.anyPunctuation, "$1")
|
|
546
|
+
}, e[0], this.lexer, this.rules);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
reflink(r, e) {
|
|
550
|
+
let n;
|
|
551
|
+
if ((n = this.rules.inline.reflink.exec(r)) || (n = this.rules.inline.nolink.exec(r))) {
|
|
552
|
+
let s = e[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
|
|
553
|
+
if (!s) {
|
|
554
|
+
let t = n[0].charAt(0);
|
|
555
|
+
return {
|
|
556
|
+
type: "text",
|
|
557
|
+
raw: t,
|
|
558
|
+
text: t
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
return ke(n, s, n[0], this.lexer, this.rules);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
emStrong(r, e, n = "") {
|
|
565
|
+
let s = this.rules.inline.emStrongLDelim.exec(r);
|
|
566
|
+
if (!(!s || s[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
567
|
+
let t = [...s[0]].length - 1, l, i, a = t, o = 0, p = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
568
|
+
for (p.lastIndex = 0, e = e.slice(-1 * r.length + t); (s = p.exec(e)) != null; ) {
|
|
569
|
+
if (l = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !l) continue;
|
|
570
|
+
if (i = [...l].length, s[3] || s[4]) {
|
|
571
|
+
a += i;
|
|
572
|
+
continue;
|
|
573
|
+
} else if ((s[5] || s[6]) && t % 3 && !((t + i) % 3)) {
|
|
574
|
+
o += i;
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
if (a -= i, a > 0) continue;
|
|
578
|
+
i = Math.min(i, i + a + o);
|
|
579
|
+
let c = [...s[0]][0].length, h = r.slice(0, t + s.index + c + i);
|
|
580
|
+
if (Math.min(t, i) % 2) {
|
|
581
|
+
let k = h.slice(1, -1);
|
|
582
|
+
return {
|
|
583
|
+
type: "em",
|
|
584
|
+
raw: h,
|
|
585
|
+
text: k,
|
|
586
|
+
tokens: this.lexer.inlineTokens(k)
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
let u = h.slice(2, -2);
|
|
590
|
+
return {
|
|
591
|
+
type: "strong",
|
|
592
|
+
raw: h,
|
|
593
|
+
text: u,
|
|
594
|
+
tokens: this.lexer.inlineTokens(u)
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
codespan(r) {
|
|
600
|
+
let e = this.rules.inline.code.exec(r);
|
|
601
|
+
if (e) {
|
|
602
|
+
let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), t = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
603
|
+
return s && t && (n = n.substring(1, n.length - 1)), {
|
|
604
|
+
type: "codespan",
|
|
605
|
+
raw: e[0],
|
|
606
|
+
text: n
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
br(r) {
|
|
611
|
+
let e = this.rules.inline.br.exec(r);
|
|
612
|
+
if (e) return {
|
|
613
|
+
type: "br",
|
|
614
|
+
raw: e[0]
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
del(r) {
|
|
618
|
+
let e = this.rules.inline.del.exec(r);
|
|
619
|
+
if (e) return {
|
|
620
|
+
type: "del",
|
|
621
|
+
raw: e[0],
|
|
622
|
+
text: e[2],
|
|
623
|
+
tokens: this.lexer.inlineTokens(e[2])
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
autolink(r) {
|
|
627
|
+
let e = this.rules.inline.autolink.exec(r);
|
|
628
|
+
if (e) {
|
|
629
|
+
let n, s;
|
|
630
|
+
return e[2] === "@" ? (n = e[1], s = "mailto:" + n) : (n = e[1], s = n), {
|
|
631
|
+
type: "link",
|
|
632
|
+
raw: e[0],
|
|
633
|
+
text: n,
|
|
634
|
+
href: s,
|
|
635
|
+
tokens: [{
|
|
636
|
+
type: "text",
|
|
637
|
+
raw: n,
|
|
638
|
+
text: n
|
|
639
|
+
}]
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
url(r) {
|
|
644
|
+
let e;
|
|
645
|
+
if (e = this.rules.inline.url.exec(r)) {
|
|
646
|
+
let n, s;
|
|
647
|
+
if (e[2] === "@") n = e[0], s = "mailto:" + n;
|
|
648
|
+
else {
|
|
649
|
+
let t;
|
|
650
|
+
do
|
|
651
|
+
t = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
|
|
652
|
+
while (t !== e[0]);
|
|
653
|
+
n = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
|
|
654
|
+
}
|
|
655
|
+
return {
|
|
656
|
+
type: "link",
|
|
657
|
+
raw: e[0],
|
|
658
|
+
text: n,
|
|
659
|
+
href: s,
|
|
660
|
+
tokens: [{
|
|
661
|
+
type: "text",
|
|
662
|
+
raw: n,
|
|
663
|
+
text: n
|
|
664
|
+
}]
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
inlineText(r) {
|
|
669
|
+
let e = this.rules.inline.text.exec(r);
|
|
670
|
+
if (e) {
|
|
671
|
+
let n = this.lexer.state.inRawBlock;
|
|
672
|
+
return {
|
|
673
|
+
type: "text",
|
|
674
|
+
raw: e[0],
|
|
675
|
+
text: e[0],
|
|
676
|
+
escaped: n
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}, w = class F {
|
|
681
|
+
tokens;
|
|
682
|
+
options;
|
|
683
|
+
state;
|
|
684
|
+
tokenizer;
|
|
685
|
+
inlineQueue;
|
|
686
|
+
constructor(e) {
|
|
687
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || $, this.options.tokenizer = this.options.tokenizer || new B(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
688
|
+
inLink: !1,
|
|
689
|
+
inRawBlock: !1,
|
|
690
|
+
top: !0
|
|
691
|
+
};
|
|
692
|
+
let n = {
|
|
693
|
+
other: b,
|
|
694
|
+
block: E.normal,
|
|
695
|
+
inline: z.normal
|
|
696
|
+
};
|
|
697
|
+
this.options.pedantic ? (n.block = E.pedantic, n.inline = z.pedantic) : this.options.gfm && (n.block = E.gfm, this.options.breaks ? n.inline = z.breaks : n.inline = z.gfm), this.tokenizer.rules = n;
|
|
698
|
+
}
|
|
699
|
+
static get rules() {
|
|
700
|
+
return {
|
|
701
|
+
block: E,
|
|
702
|
+
inline: z
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
static lex(e, n) {
|
|
706
|
+
return new F(n).lex(e);
|
|
707
|
+
}
|
|
708
|
+
static lexInline(e, n) {
|
|
709
|
+
return new F(n).inlineTokens(e);
|
|
710
|
+
}
|
|
711
|
+
lex(e) {
|
|
712
|
+
e = e.replace(b.carriageReturn, `
|
|
713
|
+
`), this.blockTokens(e, this.tokens);
|
|
714
|
+
for (let n = 0; n < this.inlineQueue.length; n++) {
|
|
715
|
+
let s = this.inlineQueue[n];
|
|
716
|
+
this.inlineTokens(s.src, s.tokens);
|
|
717
|
+
}
|
|
718
|
+
return this.inlineQueue = [], this.tokens;
|
|
719
|
+
}
|
|
720
|
+
blockTokens(e, n = [], s = !1) {
|
|
721
|
+
for (this.options.pedantic && (e = e.replace(b.tabCharGlobal, " ").replace(b.spaceLine, "")); e; ) {
|
|
722
|
+
let t;
|
|
723
|
+
if (this.options.extensions?.block?.some((i) => (t = i.call({ lexer: this }, e, n)) ? (e = e.substring(t.raw.length), n.push(t), !0) : !1)) continue;
|
|
724
|
+
if (t = this.tokenizer.space(e)) {
|
|
725
|
+
e = e.substring(t.raw.length);
|
|
726
|
+
let i = n.at(-1);
|
|
727
|
+
t.raw.length === 1 && i !== void 0 ? i.raw += `
|
|
728
|
+
` : n.push(t);
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
if (t = this.tokenizer.code(e)) {
|
|
732
|
+
e = e.substring(t.raw.length);
|
|
733
|
+
let i = n.at(-1);
|
|
734
|
+
i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
|
|
735
|
+
`) ? "" : `
|
|
736
|
+
`) + t.raw, i.text += `
|
|
737
|
+
` + t.text, this.inlineQueue.at(-1).src = i.text) : n.push(t);
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
if (t = this.tokenizer.fences(e)) {
|
|
741
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
if (t = this.tokenizer.heading(e)) {
|
|
745
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
746
|
+
continue;
|
|
747
|
+
}
|
|
748
|
+
if (t = this.tokenizer.hr(e)) {
|
|
749
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
if (t = this.tokenizer.blockquote(e)) {
|
|
753
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
754
|
+
continue;
|
|
755
|
+
}
|
|
756
|
+
if (t = this.tokenizer.list(e)) {
|
|
757
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
758
|
+
continue;
|
|
759
|
+
}
|
|
760
|
+
if (t = this.tokenizer.html(e)) {
|
|
761
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
if (t = this.tokenizer.def(e)) {
|
|
765
|
+
e = e.substring(t.raw.length);
|
|
766
|
+
let i = n.at(-1);
|
|
767
|
+
i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
|
|
768
|
+
`) ? "" : `
|
|
769
|
+
`) + t.raw, i.text += `
|
|
770
|
+
` + t.raw, this.inlineQueue.at(-1).src = i.text) : this.tokens.links[t.tag] || (this.tokens.links[t.tag] = {
|
|
771
|
+
href: t.href,
|
|
772
|
+
title: t.title
|
|
773
|
+
}, n.push(t));
|
|
774
|
+
continue;
|
|
775
|
+
}
|
|
776
|
+
if (t = this.tokenizer.table(e)) {
|
|
777
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
if (t = this.tokenizer.lheading(e)) {
|
|
781
|
+
e = e.substring(t.raw.length), n.push(t);
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
let l = e;
|
|
785
|
+
if (this.options.extensions?.startBlock) {
|
|
786
|
+
let i = 1 / 0, a = e.slice(1), o;
|
|
787
|
+
this.options.extensions.startBlock.forEach((p) => {
|
|
788
|
+
o = p.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (i = Math.min(i, o));
|
|
789
|
+
}), i < 1 / 0 && i >= 0 && (l = e.substring(0, i + 1));
|
|
790
|
+
}
|
|
791
|
+
if (this.state.top && (t = this.tokenizer.paragraph(l))) {
|
|
792
|
+
let i = n.at(-1);
|
|
793
|
+
s && i?.type === "paragraph" ? (i.raw += (i.raw.endsWith(`
|
|
794
|
+
`) ? "" : `
|
|
795
|
+
`) + t.raw, i.text += `
|
|
796
|
+
` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : n.push(t), s = l.length !== e.length, e = e.substring(t.raw.length);
|
|
797
|
+
continue;
|
|
798
|
+
}
|
|
799
|
+
if (t = this.tokenizer.text(e)) {
|
|
800
|
+
e = e.substring(t.raw.length);
|
|
801
|
+
let i = n.at(-1);
|
|
802
|
+
i?.type === "text" ? (i.raw += (i.raw.endsWith(`
|
|
803
|
+
`) ? "" : `
|
|
804
|
+
`) + t.raw, i.text += `
|
|
805
|
+
` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : n.push(t);
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
if (e) {
|
|
809
|
+
let i = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
810
|
+
if (this.options.silent) {
|
|
811
|
+
console.error(i);
|
|
812
|
+
break;
|
|
813
|
+
} else throw new Error(i);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
return this.state.top = !0, n;
|
|
817
|
+
}
|
|
818
|
+
inline(e, n = []) {
|
|
819
|
+
return this.inlineQueue.push({
|
|
820
|
+
src: e,
|
|
821
|
+
tokens: n
|
|
822
|
+
}), n;
|
|
823
|
+
}
|
|
824
|
+
inlineTokens(e, n = []) {
|
|
825
|
+
let s = e, t = null;
|
|
826
|
+
if (this.tokens.links) {
|
|
827
|
+
let o = Object.keys(this.tokens.links);
|
|
828
|
+
if (o.length > 0) for (; (t = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; ) o.includes(t[0].slice(t[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, t.index) + "[" + "a".repeat(t[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
829
|
+
}
|
|
830
|
+
for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, t.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
831
|
+
let l;
|
|
832
|
+
for (; (t = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) l = t[2] ? t[2].length : 0, s = s.slice(0, t.index + l) + "[" + "a".repeat(t[0].length - l - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
833
|
+
s = this.options.hooks?.emStrongMask?.call({ lexer: this }, s) ?? s;
|
|
834
|
+
let i = !1, a = "";
|
|
835
|
+
for (; e; ) {
|
|
836
|
+
i || (a = ""), i = !1;
|
|
837
|
+
let o;
|
|
838
|
+
if (this.options.extensions?.inline?.some((c) => (o = c.call({ lexer: this }, e, n)) ? (e = e.substring(o.raw.length), n.push(o), !0) : !1)) continue;
|
|
839
|
+
if (o = this.tokenizer.escape(e)) {
|
|
840
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
if (o = this.tokenizer.tag(e)) {
|
|
844
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
if (o = this.tokenizer.link(e)) {
|
|
848
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
849
|
+
continue;
|
|
850
|
+
}
|
|
851
|
+
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
852
|
+
e = e.substring(o.raw.length);
|
|
853
|
+
let c = n.at(-1);
|
|
854
|
+
o.type === "text" && c?.type === "text" ? (c.raw += o.raw, c.text += o.text) : n.push(o);
|
|
855
|
+
continue;
|
|
856
|
+
}
|
|
857
|
+
if (o = this.tokenizer.emStrong(e, s, a)) {
|
|
858
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
if (o = this.tokenizer.codespan(e)) {
|
|
862
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
if (o = this.tokenizer.br(e)) {
|
|
866
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
867
|
+
continue;
|
|
868
|
+
}
|
|
869
|
+
if (o = this.tokenizer.del(e)) {
|
|
870
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
873
|
+
if (o = this.tokenizer.autolink(e)) {
|
|
874
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
if (!this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
878
|
+
e = e.substring(o.raw.length), n.push(o);
|
|
879
|
+
continue;
|
|
880
|
+
}
|
|
881
|
+
let p = e;
|
|
882
|
+
if (this.options.extensions?.startInline) {
|
|
883
|
+
let c = 1 / 0, h = e.slice(1), u;
|
|
884
|
+
this.options.extensions.startInline.forEach((k) => {
|
|
885
|
+
u = k.call({ lexer: this }, h), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
|
|
886
|
+
}), c < 1 / 0 && c >= 0 && (p = e.substring(0, c + 1));
|
|
887
|
+
}
|
|
888
|
+
if (o = this.tokenizer.inlineText(p)) {
|
|
889
|
+
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), i = !0;
|
|
890
|
+
let c = n.at(-1);
|
|
891
|
+
c?.type === "text" ? (c.raw += o.raw, c.text += o.text) : n.push(o);
|
|
892
|
+
continue;
|
|
893
|
+
}
|
|
894
|
+
if (e) {
|
|
895
|
+
let c = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
896
|
+
if (this.options.silent) {
|
|
897
|
+
console.error(c);
|
|
898
|
+
break;
|
|
899
|
+
} else throw new Error(c);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
return n;
|
|
903
|
+
}
|
|
904
|
+
}, C = class {
|
|
905
|
+
options;
|
|
906
|
+
parser;
|
|
907
|
+
constructor(r) {
|
|
908
|
+
this.options = r || $;
|
|
909
|
+
}
|
|
910
|
+
space(r) {
|
|
911
|
+
return "";
|
|
912
|
+
}
|
|
913
|
+
code({ text: r, lang: e, escaped: n }) {
|
|
914
|
+
let s = (e || "").match(b.notSpaceStart)?.[0], t = r.replace(b.endingNewline, "") + `
|
|
915
|
+
`;
|
|
916
|
+
return s ? '<pre><code class="language-' + T(s) + '">' + (n ? t : T(t, !0)) + `</code></pre>
|
|
917
|
+
` : "<pre><code>" + (n ? t : T(t, !0)) + `</code></pre>
|
|
918
|
+
`;
|
|
919
|
+
}
|
|
920
|
+
blockquote({ tokens: r }) {
|
|
921
|
+
return `<blockquote>
|
|
922
|
+
${this.parser.parse(r)}</blockquote>
|
|
923
|
+
`;
|
|
924
|
+
}
|
|
925
|
+
html({ text: r }) {
|
|
926
|
+
return r;
|
|
927
|
+
}
|
|
928
|
+
def(r) {
|
|
929
|
+
return "";
|
|
930
|
+
}
|
|
931
|
+
heading({ tokens: r, depth: e }) {
|
|
932
|
+
return `<h${e}>${this.parser.parseInline(r)}</h${e}>
|
|
933
|
+
`;
|
|
934
|
+
}
|
|
935
|
+
hr(r) {
|
|
936
|
+
return `<hr>
|
|
937
|
+
`;
|
|
938
|
+
}
|
|
939
|
+
list(r) {
|
|
940
|
+
let e = r.ordered, n = r.start, s = "";
|
|
941
|
+
for (let i = 0; i < r.items.length; i++) {
|
|
942
|
+
let a = r.items[i];
|
|
943
|
+
s += this.listitem(a);
|
|
944
|
+
}
|
|
945
|
+
let t = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
|
|
946
|
+
return "<" + t + l + `>
|
|
947
|
+
` + s + "</" + t + `>
|
|
948
|
+
`;
|
|
949
|
+
}
|
|
950
|
+
listitem(r) {
|
|
951
|
+
let e = "";
|
|
952
|
+
if (r.task) {
|
|
953
|
+
let n = this.checkbox({ checked: !!r.checked });
|
|
954
|
+
r.loose ? r.tokens[0]?.type === "paragraph" ? (r.tokens[0].text = n + " " + r.tokens[0].text, r.tokens[0].tokens && r.tokens[0].tokens.length > 0 && r.tokens[0].tokens[0].type === "text" && (r.tokens[0].tokens[0].text = n + " " + T(r.tokens[0].tokens[0].text), r.tokens[0].tokens[0].escaped = !0)) : r.tokens.unshift({
|
|
955
|
+
type: "text",
|
|
956
|
+
raw: n + " ",
|
|
957
|
+
text: n + " ",
|
|
958
|
+
escaped: !0
|
|
959
|
+
}) : e += n + " ";
|
|
960
|
+
}
|
|
961
|
+
return e += this.parser.parse(r.tokens, !!r.loose), `<li>${e}</li>
|
|
962
|
+
`;
|
|
963
|
+
}
|
|
964
|
+
checkbox({ checked: r }) {
|
|
965
|
+
return "<input " + (r ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
|
|
966
|
+
}
|
|
967
|
+
paragraph({ tokens: r }) {
|
|
968
|
+
return `<p>${this.parser.parseInline(r)}</p>
|
|
969
|
+
`;
|
|
970
|
+
}
|
|
971
|
+
table(r) {
|
|
972
|
+
let e = "", n = "";
|
|
973
|
+
for (let t = 0; t < r.header.length; t++) n += this.tablecell(r.header[t]);
|
|
974
|
+
e += this.tablerow({ text: n });
|
|
975
|
+
let s = "";
|
|
976
|
+
for (let t = 0; t < r.rows.length; t++) {
|
|
977
|
+
let l = r.rows[t];
|
|
978
|
+
n = "";
|
|
979
|
+
for (let i = 0; i < l.length; i++) n += this.tablecell(l[i]);
|
|
980
|
+
s += this.tablerow({ text: n });
|
|
981
|
+
}
|
|
982
|
+
return s && (s = `<tbody>${s}</tbody>`), `<table>
|
|
983
|
+
<thead>
|
|
984
|
+
` + e + `</thead>
|
|
985
|
+
` + s + `</table>
|
|
986
|
+
`;
|
|
987
|
+
}
|
|
988
|
+
tablerow({ text: r }) {
|
|
989
|
+
return `<tr>
|
|
990
|
+
${r}</tr>
|
|
991
|
+
`;
|
|
992
|
+
}
|
|
993
|
+
tablecell(r) {
|
|
994
|
+
let e = this.parser.parseInline(r.tokens), n = r.header ? "th" : "td";
|
|
995
|
+
return (r.align ? `<${n} align="${r.align}">` : `<${n}>`) + e + `</${n}>
|
|
996
|
+
`;
|
|
997
|
+
}
|
|
998
|
+
strong({ tokens: r }) {
|
|
999
|
+
return `<strong>${this.parser.parseInline(r)}</strong>`;
|
|
1000
|
+
}
|
|
1001
|
+
em({ tokens: r }) {
|
|
1002
|
+
return `<em>${this.parser.parseInline(r)}</em>`;
|
|
1003
|
+
}
|
|
1004
|
+
codespan({ text: r }) {
|
|
1005
|
+
return `<code>${T(r, !0)}</code>`;
|
|
1006
|
+
}
|
|
1007
|
+
br(r) {
|
|
1008
|
+
return "<br>";
|
|
1009
|
+
}
|
|
1010
|
+
del({ tokens: r }) {
|
|
1011
|
+
return `<del>${this.parser.parseInline(r)}</del>`;
|
|
1012
|
+
}
|
|
1013
|
+
link({ href: r, title: e, tokens: n }) {
|
|
1014
|
+
let s = this.parser.parseInline(n), t = ge(r);
|
|
1015
|
+
if (t === null) return s;
|
|
1016
|
+
r = t;
|
|
1017
|
+
let l = '<a href="' + r + '"';
|
|
1018
|
+
return e && (l += ' title="' + T(e) + '"'), l += ">" + s + "</a>", l;
|
|
1019
|
+
}
|
|
1020
|
+
image({ href: r, title: e, text: n, tokens: s }) {
|
|
1021
|
+
s && (n = this.parser.parseInline(s, this.parser.textRenderer));
|
|
1022
|
+
let t = ge(r);
|
|
1023
|
+
if (t === null) return T(n);
|
|
1024
|
+
r = t;
|
|
1025
|
+
let l = `<img src="${r}" alt="${n}"`;
|
|
1026
|
+
return e && (l += ` title="${T(e)}"`), l += ">", l;
|
|
1027
|
+
}
|
|
1028
|
+
text(r) {
|
|
1029
|
+
return "tokens" in r && r.tokens ? this.parser.parseInline(r.tokens) : "escaped" in r && r.escaped ? r.text : T(r.text);
|
|
1030
|
+
}
|
|
1031
|
+
}, ne = class {
|
|
1032
|
+
strong({ text: r }) {
|
|
1033
|
+
return r;
|
|
1034
|
+
}
|
|
1035
|
+
em({ text: r }) {
|
|
1036
|
+
return r;
|
|
1037
|
+
}
|
|
1038
|
+
codespan({ text: r }) {
|
|
1039
|
+
return r;
|
|
1040
|
+
}
|
|
1041
|
+
del({ text: r }) {
|
|
1042
|
+
return r;
|
|
1043
|
+
}
|
|
1044
|
+
html({ text: r }) {
|
|
1045
|
+
return r;
|
|
1046
|
+
}
|
|
1047
|
+
text({ text: r }) {
|
|
1048
|
+
return r;
|
|
1049
|
+
}
|
|
1050
|
+
link({ text: r }) {
|
|
1051
|
+
return "" + r;
|
|
1052
|
+
}
|
|
1053
|
+
image({ text: r }) {
|
|
1054
|
+
return "" + r;
|
|
1055
|
+
}
|
|
1056
|
+
br() {
|
|
1057
|
+
return "";
|
|
1058
|
+
}
|
|
1059
|
+
}, y = class N {
|
|
1060
|
+
options;
|
|
1061
|
+
renderer;
|
|
1062
|
+
textRenderer;
|
|
1063
|
+
constructor(e) {
|
|
1064
|
+
this.options = e || $, this.options.renderer = this.options.renderer || new C(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new ne();
|
|
1065
|
+
}
|
|
1066
|
+
static parse(e, n) {
|
|
1067
|
+
return new N(n).parse(e);
|
|
1068
|
+
}
|
|
1069
|
+
static parseInline(e, n) {
|
|
1070
|
+
return new N(n).parseInline(e);
|
|
1071
|
+
}
|
|
1072
|
+
parse(e, n = !0) {
|
|
1073
|
+
let s = "";
|
|
1074
|
+
for (let t = 0; t < e.length; t++) {
|
|
1075
|
+
let l = e[t];
|
|
1076
|
+
if (this.options.extensions?.renderers?.[l.type]) {
|
|
1077
|
+
let a = l, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
1078
|
+
if (o !== !1 || ![
|
|
1079
|
+
"space",
|
|
1080
|
+
"hr",
|
|
1081
|
+
"heading",
|
|
1082
|
+
"code",
|
|
1083
|
+
"table",
|
|
1084
|
+
"blockquote",
|
|
1085
|
+
"list",
|
|
1086
|
+
"html",
|
|
1087
|
+
"def",
|
|
1088
|
+
"paragraph",
|
|
1089
|
+
"text"
|
|
1090
|
+
].includes(a.type)) {
|
|
1091
|
+
s += o || "";
|
|
1092
|
+
continue;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
let i = l;
|
|
1096
|
+
switch (i.type) {
|
|
1097
|
+
case "space":
|
|
1098
|
+
s += this.renderer.space(i);
|
|
1099
|
+
continue;
|
|
1100
|
+
case "hr":
|
|
1101
|
+
s += this.renderer.hr(i);
|
|
1102
|
+
continue;
|
|
1103
|
+
case "heading":
|
|
1104
|
+
s += this.renderer.heading(i);
|
|
1105
|
+
continue;
|
|
1106
|
+
case "code":
|
|
1107
|
+
s += this.renderer.code(i);
|
|
1108
|
+
continue;
|
|
1109
|
+
case "table":
|
|
1110
|
+
s += this.renderer.table(i);
|
|
1111
|
+
continue;
|
|
1112
|
+
case "blockquote":
|
|
1113
|
+
s += this.renderer.blockquote(i);
|
|
1114
|
+
continue;
|
|
1115
|
+
case "list":
|
|
1116
|
+
s += this.renderer.list(i);
|
|
1117
|
+
continue;
|
|
1118
|
+
case "html":
|
|
1119
|
+
s += this.renderer.html(i);
|
|
1120
|
+
continue;
|
|
1121
|
+
case "def":
|
|
1122
|
+
s += this.renderer.def(i);
|
|
1123
|
+
continue;
|
|
1124
|
+
case "paragraph":
|
|
1125
|
+
s += this.renderer.paragraph(i);
|
|
1126
|
+
continue;
|
|
1127
|
+
case "text": {
|
|
1128
|
+
let a = i, o = this.renderer.text(a);
|
|
1129
|
+
for (; t + 1 < e.length && e[t + 1].type === "text"; ) a = e[++t], o += `
|
|
1130
|
+
` + this.renderer.text(a);
|
|
1131
|
+
n ? s += this.renderer.paragraph({
|
|
1132
|
+
type: "paragraph",
|
|
1133
|
+
raw: o,
|
|
1134
|
+
text: o,
|
|
1135
|
+
tokens: [{
|
|
1136
|
+
type: "text",
|
|
1137
|
+
raw: o,
|
|
1138
|
+
text: o,
|
|
1139
|
+
escaped: !0
|
|
1140
|
+
}]
|
|
1141
|
+
}) : s += o;
|
|
1142
|
+
continue;
|
|
1143
|
+
}
|
|
1144
|
+
default: {
|
|
1145
|
+
let a = 'Token with "' + i.type + '" type was not found.';
|
|
1146
|
+
if (this.options.silent) return console.error(a), "";
|
|
1147
|
+
throw new Error(a);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
return s;
|
|
1152
|
+
}
|
|
1153
|
+
parseInline(e, n = this.renderer) {
|
|
1154
|
+
let s = "";
|
|
1155
|
+
for (let t = 0; t < e.length; t++) {
|
|
1156
|
+
let l = e[t];
|
|
1157
|
+
if (this.options.extensions?.renderers?.[l.type]) {
|
|
1158
|
+
let a = this.options.extensions.renderers[l.type].call({ parser: this }, l);
|
|
1159
|
+
if (a !== !1 || ![
|
|
1160
|
+
"escape",
|
|
1161
|
+
"html",
|
|
1162
|
+
"link",
|
|
1163
|
+
"image",
|
|
1164
|
+
"strong",
|
|
1165
|
+
"em",
|
|
1166
|
+
"codespan",
|
|
1167
|
+
"br",
|
|
1168
|
+
"del",
|
|
1169
|
+
"text"
|
|
1170
|
+
].includes(l.type)) {
|
|
1171
|
+
s += a || "";
|
|
1172
|
+
continue;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
let i = l;
|
|
1176
|
+
switch (i.type) {
|
|
1177
|
+
case "escape":
|
|
1178
|
+
s += n.text(i);
|
|
1179
|
+
break;
|
|
1180
|
+
case "html":
|
|
1181
|
+
s += n.html(i);
|
|
1182
|
+
break;
|
|
1183
|
+
case "link":
|
|
1184
|
+
s += n.link(i);
|
|
1185
|
+
break;
|
|
1186
|
+
case "image":
|
|
1187
|
+
s += n.image(i);
|
|
1188
|
+
break;
|
|
1189
|
+
case "strong":
|
|
1190
|
+
s += n.strong(i);
|
|
1191
|
+
break;
|
|
1192
|
+
case "em":
|
|
1193
|
+
s += n.em(i);
|
|
1194
|
+
break;
|
|
1195
|
+
case "codespan":
|
|
1196
|
+
s += n.codespan(i);
|
|
1197
|
+
break;
|
|
1198
|
+
case "br":
|
|
1199
|
+
s += n.br(i);
|
|
1200
|
+
break;
|
|
1201
|
+
case "del":
|
|
1202
|
+
s += n.del(i);
|
|
1203
|
+
break;
|
|
1204
|
+
case "text":
|
|
1205
|
+
s += n.text(i);
|
|
1206
|
+
break;
|
|
1207
|
+
default: {
|
|
1208
|
+
let a = 'Token with "' + i.type + '" type was not found.';
|
|
1209
|
+
if (this.options.silent) return console.error(a), "";
|
|
1210
|
+
throw new Error(a);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
return s;
|
|
1215
|
+
}
|
|
1216
|
+
}, I = class {
|
|
1217
|
+
options;
|
|
1218
|
+
block;
|
|
1219
|
+
constructor(r) {
|
|
1220
|
+
this.options = r || $;
|
|
1221
|
+
}
|
|
1222
|
+
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
1223
|
+
"preprocess",
|
|
1224
|
+
"postprocess",
|
|
1225
|
+
"processAllTokens",
|
|
1226
|
+
"emStrongMask"
|
|
1227
|
+
]);
|
|
1228
|
+
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
|
|
1229
|
+
"preprocess",
|
|
1230
|
+
"postprocess",
|
|
1231
|
+
"processAllTokens"
|
|
1232
|
+
]);
|
|
1233
|
+
preprocess(r) {
|
|
1234
|
+
return r;
|
|
1235
|
+
}
|
|
1236
|
+
postprocess(r) {
|
|
1237
|
+
return r;
|
|
1238
|
+
}
|
|
1239
|
+
processAllTokens(r) {
|
|
1240
|
+
return r;
|
|
1241
|
+
}
|
|
1242
|
+
emStrongMask(r) {
|
|
1243
|
+
return r;
|
|
1244
|
+
}
|
|
1245
|
+
provideLexer() {
|
|
1246
|
+
return this.block ? w.lex : w.lexInline;
|
|
1247
|
+
}
|
|
1248
|
+
provideParser() {
|
|
1249
|
+
return this.block ? y.parse : y.parseInline;
|
|
1250
|
+
}
|
|
1251
|
+
}, It = class {
|
|
1252
|
+
defaults = U();
|
|
1253
|
+
options = this.setOptions;
|
|
1254
|
+
parse = this.parseMarkdown(!0);
|
|
1255
|
+
parseInline = this.parseMarkdown(!1);
|
|
1256
|
+
Parser = y;
|
|
1257
|
+
Renderer = C;
|
|
1258
|
+
TextRenderer = ne;
|
|
1259
|
+
Lexer = w;
|
|
1260
|
+
Tokenizer = B;
|
|
1261
|
+
Hooks = I;
|
|
1262
|
+
constructor(...r) {
|
|
1263
|
+
this.use(...r);
|
|
1264
|
+
}
|
|
1265
|
+
walkTokens(r, e) {
|
|
1266
|
+
let n = [];
|
|
1267
|
+
for (let s of r) switch (n = n.concat(e.call(this, s)), s.type) {
|
|
1268
|
+
case "table": {
|
|
1269
|
+
let t = s;
|
|
1270
|
+
for (let l of t.header) n = n.concat(this.walkTokens(l.tokens, e));
|
|
1271
|
+
for (let l of t.rows) for (let i of l) n = n.concat(this.walkTokens(i.tokens, e));
|
|
1272
|
+
break;
|
|
1273
|
+
}
|
|
1274
|
+
case "list": {
|
|
1275
|
+
let t = s;
|
|
1276
|
+
n = n.concat(this.walkTokens(t.items, e));
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
default: {
|
|
1280
|
+
let t = s;
|
|
1281
|
+
this.defaults.extensions?.childTokens?.[t.type] ? this.defaults.extensions.childTokens[t.type].forEach((l) => {
|
|
1282
|
+
let i = t[l].flat(1 / 0);
|
|
1283
|
+
n = n.concat(this.walkTokens(i, e));
|
|
1284
|
+
}) : t.tokens && (n = n.concat(this.walkTokens(t.tokens, e)));
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
return n;
|
|
1288
|
+
}
|
|
1289
|
+
use(...r) {
|
|
1290
|
+
let e = this.defaults.extensions || {
|
|
1291
|
+
renderers: {},
|
|
1292
|
+
childTokens: {}
|
|
1293
|
+
};
|
|
1294
|
+
return r.forEach((n) => {
|
|
1295
|
+
let s = { ...n };
|
|
1296
|
+
if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((t) => {
|
|
1297
|
+
if (!t.name) throw new Error("extension name required");
|
|
1298
|
+
if ("renderer" in t) {
|
|
1299
|
+
let l = e.renderers[t.name];
|
|
1300
|
+
l ? e.renderers[t.name] = function(...i) {
|
|
1301
|
+
let a = t.renderer.apply(this, i);
|
|
1302
|
+
return a === !1 && (a = l.apply(this, i)), a;
|
|
1303
|
+
} : e.renderers[t.name] = t.renderer;
|
|
1304
|
+
}
|
|
1305
|
+
if ("tokenizer" in t) {
|
|
1306
|
+
if (!t.level || t.level !== "block" && t.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
|
|
1307
|
+
let l = e[t.level];
|
|
1308
|
+
l ? l.unshift(t.tokenizer) : e[t.level] = [t.tokenizer], t.start && (t.level === "block" ? e.startBlock ? e.startBlock.push(t.start) : e.startBlock = [t.start] : t.level === "inline" && (e.startInline ? e.startInline.push(t.start) : e.startInline = [t.start]));
|
|
1309
|
+
}
|
|
1310
|
+
"childTokens" in t && t.childTokens && (e.childTokens[t.name] = t.childTokens);
|
|
1311
|
+
}), s.extensions = e), n.renderer) {
|
|
1312
|
+
let t = this.defaults.renderer || new C(this.defaults);
|
|
1313
|
+
for (let l in n.renderer) {
|
|
1314
|
+
if (!(l in t)) throw new Error(`renderer '${l}' does not exist`);
|
|
1315
|
+
if (["options", "parser"].includes(l)) continue;
|
|
1316
|
+
let i = l, a = n.renderer[i], o = t[i];
|
|
1317
|
+
t[i] = (...p) => {
|
|
1318
|
+
let c = a.apply(t, p);
|
|
1319
|
+
return c === !1 && (c = o.apply(t, p)), c || "";
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
s.renderer = t;
|
|
1323
|
+
}
|
|
1324
|
+
if (n.tokenizer) {
|
|
1325
|
+
let t = this.defaults.tokenizer || new B(this.defaults);
|
|
1326
|
+
for (let l in n.tokenizer) {
|
|
1327
|
+
if (!(l in t)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
1328
|
+
if ([
|
|
1329
|
+
"options",
|
|
1330
|
+
"rules",
|
|
1331
|
+
"lexer"
|
|
1332
|
+
].includes(l)) continue;
|
|
1333
|
+
let i = l, a = n.tokenizer[i], o = t[i];
|
|
1334
|
+
t[i] = (...p) => {
|
|
1335
|
+
let c = a.apply(t, p);
|
|
1336
|
+
return c === !1 && (c = o.apply(t, p)), c;
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
s.tokenizer = t;
|
|
1340
|
+
}
|
|
1341
|
+
if (n.hooks) {
|
|
1342
|
+
let t = this.defaults.hooks || new I();
|
|
1343
|
+
for (let l in n.hooks) {
|
|
1344
|
+
if (!(l in t)) throw new Error(`hook '${l}' does not exist`);
|
|
1345
|
+
if (["options", "block"].includes(l)) continue;
|
|
1346
|
+
let i = l, a = n.hooks[i], o = t[i];
|
|
1347
|
+
I.passThroughHooks.has(l) ? t[i] = (p) => {
|
|
1348
|
+
if (this.defaults.async && I.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
1349
|
+
let h = await a.call(t, p);
|
|
1350
|
+
return o.call(t, h);
|
|
1351
|
+
})();
|
|
1352
|
+
let c = a.call(t, p);
|
|
1353
|
+
return o.call(t, c);
|
|
1354
|
+
} : t[i] = (...p) => {
|
|
1355
|
+
if (this.defaults.async) return (async () => {
|
|
1356
|
+
let h = await a.apply(t, p);
|
|
1357
|
+
return h === !1 && (h = await o.apply(t, p)), h;
|
|
1358
|
+
})();
|
|
1359
|
+
let c = a.apply(t, p);
|
|
1360
|
+
return c === !1 && (c = o.apply(t, p)), c;
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
s.hooks = t;
|
|
1364
|
+
}
|
|
1365
|
+
if (n.walkTokens) {
|
|
1366
|
+
let t = this.defaults.walkTokens, l = n.walkTokens;
|
|
1367
|
+
s.walkTokens = function(i) {
|
|
1368
|
+
let a = [];
|
|
1369
|
+
return a.push(l.call(this, i)), t && (a = a.concat(t.call(this, i))), a;
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
this.defaults = {
|
|
1373
|
+
...this.defaults,
|
|
1374
|
+
...s
|
|
1375
|
+
};
|
|
1376
|
+
}), this;
|
|
1377
|
+
}
|
|
1378
|
+
setOptions(r) {
|
|
1379
|
+
return this.defaults = {
|
|
1380
|
+
...this.defaults,
|
|
1381
|
+
...r
|
|
1382
|
+
}, this;
|
|
1383
|
+
}
|
|
1384
|
+
lexer(r, e) {
|
|
1385
|
+
return w.lex(r, e ?? this.defaults);
|
|
1386
|
+
}
|
|
1387
|
+
parser(r, e) {
|
|
1388
|
+
return y.parse(r, e ?? this.defaults);
|
|
1389
|
+
}
|
|
1390
|
+
parseMarkdown(r) {
|
|
1391
|
+
return (e, n) => {
|
|
1392
|
+
let s = { ...n }, t = {
|
|
1393
|
+
...this.defaults,
|
|
1394
|
+
...s
|
|
1395
|
+
}, l = this.onError(!!t.silent, !!t.async);
|
|
1396
|
+
if (this.defaults.async === !0 && s.async === !1) return l(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1397
|
+
if (typeof e > "u" || e === null) return l(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
|
|
1398
|
+
if (typeof e != "string") return l(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
1399
|
+
if (t.hooks && (t.hooks.options = t, t.hooks.block = r), t.async) return (async () => {
|
|
1400
|
+
let i = t.hooks ? await t.hooks.preprocess(e) : e, a = await (t.hooks ? await t.hooks.provideLexer() : r ? w.lex : w.lexInline)(i, t), o = t.hooks ? await t.hooks.processAllTokens(a) : a;
|
|
1401
|
+
t.walkTokens && await Promise.all(this.walkTokens(o, t.walkTokens));
|
|
1402
|
+
let p = await (t.hooks ? await t.hooks.provideParser() : r ? y.parse : y.parseInline)(o, t);
|
|
1403
|
+
return t.hooks ? await t.hooks.postprocess(p) : p;
|
|
1404
|
+
})().catch(l);
|
|
1405
|
+
try {
|
|
1406
|
+
t.hooks && (e = t.hooks.preprocess(e));
|
|
1407
|
+
let i = (t.hooks ? t.hooks.provideLexer() : r ? w.lex : w.lexInline)(e, t);
|
|
1408
|
+
t.hooks && (i = t.hooks.processAllTokens(i)), t.walkTokens && this.walkTokens(i, t.walkTokens);
|
|
1409
|
+
let a = (t.hooks ? t.hooks.provideParser() : r ? y.parse : y.parseInline)(i, t);
|
|
1410
|
+
return t.hooks && (a = t.hooks.postprocess(a)), a;
|
|
1411
|
+
} catch (i) {
|
|
1412
|
+
return l(i);
|
|
1413
|
+
}
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
onError(r, e) {
|
|
1417
|
+
return (n) => {
|
|
1418
|
+
if (n.message += `
|
|
1419
|
+
Please report this to https://github.com/markedjs/marked.`, r) {
|
|
1420
|
+
let s = "<p>An error occurred:</p><pre>" + T(n.message + "", !0) + "</pre>";
|
|
1421
|
+
return e ? Promise.resolve(s) : s;
|
|
1422
|
+
}
|
|
1423
|
+
if (e) return Promise.reject(n);
|
|
1424
|
+
throw n;
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
}, S = new It();
|
|
1428
|
+
function f(r, e) {
|
|
1429
|
+
return S.parse(r, e);
|
|
1430
|
+
}
|
|
1431
|
+
f.options = f.setOptions = function(r) {
|
|
1432
|
+
return S.setOptions(r), f.defaults = S.defaults, we(f.defaults), f;
|
|
1433
|
+
};
|
|
1434
|
+
f.getDefaults = U;
|
|
1435
|
+
f.defaults = $;
|
|
1436
|
+
f.use = function(...r) {
|
|
1437
|
+
return S.use(...r), f.defaults = S.defaults, we(f.defaults), f;
|
|
1438
|
+
};
|
|
1439
|
+
f.walkTokens = function(r, e) {
|
|
1440
|
+
return S.walkTokens(r, e);
|
|
1441
|
+
};
|
|
1442
|
+
f.parseInline = S.parseInline;
|
|
1443
|
+
f.Parser = y;
|
|
1444
|
+
f.parser = y.parse;
|
|
1445
|
+
f.Renderer = C;
|
|
1446
|
+
f.TextRenderer = ne;
|
|
1447
|
+
f.Lexer = w;
|
|
1448
|
+
f.lexer = w.lex;
|
|
1449
|
+
f.Tokenizer = B;
|
|
1450
|
+
f.Hooks = I;
|
|
1451
|
+
f.parse = f;
|
|
1452
|
+
var Mt = f.options, Wt = f.setOptions, Zt = f.use, jt = f.walkTokens, Ht = f.parseInline, Ot = y.parse, Dt = w.lex;
|
|
1453
|
+
function Lt(r) {
|
|
1454
|
+
for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
|
|
1455
|
+
var s = Array.from(typeof r == "string" ? [r] : r);
|
|
1456
|
+
s[s.length - 1] = s[s.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
1457
|
+
var t = s.reduce(function(a, o) {
|
|
1458
|
+
var p = o.match(/\n([\t ]+|(?!\s).)/g);
|
|
1459
|
+
return p ? a.concat(p.map(function(c) {
|
|
1460
|
+
var h, u;
|
|
1461
|
+
return (u = (h = c.match(/[\t ]/g)) === null || h === void 0 ? void 0 : h.length) !== null && u !== void 0 ? u : 0;
|
|
1462
|
+
})) : a;
|
|
1463
|
+
}, []);
|
|
1464
|
+
if (t.length) {
|
|
1465
|
+
var l = new RegExp(`
|
|
1466
|
+
[ ]{`.concat(Math.min.apply(Math, t), "}"), "g");
|
|
1467
|
+
s = s.map(function(a) {
|
|
1468
|
+
return a.replace(l, `
|
|
1469
|
+
`);
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
s[0] = s[0].replace(/^\r?\n/, "");
|
|
1473
|
+
var i = s[0];
|
|
1474
|
+
return e.forEach(function(a, o) {
|
|
1475
|
+
var p = i.match(/(?:^|\n)( *)$/), c = p ? p[1] : "", h = a;
|
|
1476
|
+
typeof a == "string" && a.includes(`
|
|
1477
|
+
`) && (h = String(a).split(`
|
|
1478
|
+
`).map(function(u, k) {
|
|
1479
|
+
return k === 0 ? u : "".concat(c).concat(u);
|
|
1480
|
+
}).join(`
|
|
1481
|
+
`)), i += h + s[o + 1];
|
|
1482
|
+
}), i;
|
|
1483
|
+
}
|
|
1484
|
+
function Le(r, { markdownAutoWrap: e }) {
|
|
1485
|
+
return Lt(r.replace(/<br\/>/g, `
|
|
1486
|
+
`).replace(/\n{2,}/g, `
|
|
1487
|
+
`));
|
|
1488
|
+
}
|
|
1489
|
+
x(Le, "preprocessMarkdown");
|
|
1490
|
+
function _e(r) {
|
|
1491
|
+
return r.split(/\\n|\n|<br\s*\/?>/gi).map((e) => e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map((n) => ({
|
|
1492
|
+
content: n,
|
|
1493
|
+
type: "normal"
|
|
1494
|
+
})) ?? []);
|
|
1495
|
+
}
|
|
1496
|
+
x(_e, "nonMarkdownToLines");
|
|
1497
|
+
function Ee(r, e = {}) {
|
|
1498
|
+
const n = Le(r, e), s = f.lexer(n), t = [[]];
|
|
1499
|
+
let l = 0;
|
|
1500
|
+
function i(a, o = "normal") {
|
|
1501
|
+
a.type === "text" ? a.text.split(`
|
|
1502
|
+
`).forEach((p, c) => {
|
|
1503
|
+
c !== 0 && (l++, t.push([])), p.split(" ").forEach((h) => {
|
|
1504
|
+
h = h.replace(/'/g, "'"), h && t[l].push({
|
|
1505
|
+
content: h,
|
|
1506
|
+
type: o
|
|
1507
|
+
});
|
|
1508
|
+
});
|
|
1509
|
+
}) : a.type === "strong" || a.type === "em" ? a.tokens.forEach((p) => {
|
|
1510
|
+
i(p, a.type);
|
|
1511
|
+
}) : a.type === "html" && t[l].push({
|
|
1512
|
+
content: a.text,
|
|
1513
|
+
type: "normal"
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
return x(i, "processNode"), s.forEach((a) => {
|
|
1517
|
+
a.type === "paragraph" ? a.tokens?.forEach((o) => {
|
|
1518
|
+
i(o);
|
|
1519
|
+
}) : a.type === "html" ? t[l].push({
|
|
1520
|
+
content: a.text,
|
|
1521
|
+
type: "normal"
|
|
1522
|
+
}) : t[l].push({
|
|
1523
|
+
content: a.raw,
|
|
1524
|
+
type: "normal"
|
|
1525
|
+
});
|
|
1526
|
+
}), t;
|
|
1527
|
+
}
|
|
1528
|
+
x(Ee, "markdownToLines");
|
|
1529
|
+
function Pe(r) {
|
|
1530
|
+
return r ? `<p>${r.replace(/\\n|\n/g, "<br />")}</p>` : "";
|
|
1531
|
+
}
|
|
1532
|
+
x(Pe, "nonMarkdownToHTML");
|
|
1533
|
+
function Be(r, { markdownAutoWrap: e } = {}) {
|
|
1534
|
+
const n = f.lexer(r);
|
|
1535
|
+
function s(t) {
|
|
1536
|
+
return t.type === "text" ? e === !1 ? t.text.replace(/\n */g, "<br/>").replace(/ /g, " ") : t.text.replace(/\n */g, "<br/>") : t.type === "strong" ? `<strong>${t.tokens?.map(s).join("")}</strong>` : t.type === "em" ? `<em>${t.tokens?.map(s).join("")}</em>` : t.type === "paragraph" ? `<p>${t.tokens?.map(s).join("")}</p>` : t.type === "space" ? "" : t.type === "html" ? `${t.text}` : t.type === "escape" ? t.text : (xe.warn(`Unsupported markdown: ${t.type}`), t.raw);
|
|
1537
|
+
}
|
|
1538
|
+
return x(s, "output"), n.map(s).join("");
|
|
1539
|
+
}
|
|
1540
|
+
x(Be, "markdownToHTML");
|
|
1541
|
+
function Ce(r) {
|
|
1542
|
+
return Intl.Segmenter ? [...new Intl.Segmenter().segment(r)].map((e) => e.segment) : [...r];
|
|
1543
|
+
}
|
|
1544
|
+
x(Ce, "splitTextToChars");
|
|
1545
|
+
function qe(r, e) {
|
|
1546
|
+
return re(r, [], Ce(e.content), e.type);
|
|
1547
|
+
}
|
|
1548
|
+
x(qe, "splitWordToFitWidth");
|
|
1549
|
+
function re(r, e, n, s) {
|
|
1550
|
+
if (n.length === 0) return [{
|
|
1551
|
+
content: e.join(""),
|
|
1552
|
+
type: s
|
|
1553
|
+
}, {
|
|
1554
|
+
content: "",
|
|
1555
|
+
type: s
|
|
1556
|
+
}];
|
|
1557
|
+
const [t, ...l] = n, i = [...e, t];
|
|
1558
|
+
return r([{
|
|
1559
|
+
content: i.join(""),
|
|
1560
|
+
type: s
|
|
1561
|
+
}]) ? re(r, i, l, s) : (e.length === 0 && t && (e.push(t), n.shift()), [{
|
|
1562
|
+
content: e.join(""),
|
|
1563
|
+
type: s
|
|
1564
|
+
}, {
|
|
1565
|
+
content: n.join(""),
|
|
1566
|
+
type: s
|
|
1567
|
+
}]);
|
|
1568
|
+
}
|
|
1569
|
+
x(re, "splitWordToFitWidthRecursion");
|
|
1570
|
+
function Me(r, e) {
|
|
1571
|
+
if (r.some(({ content: n }) => n.includes(`
|
|
1572
|
+
`))) throw new Error("splitLineToFitWidth does not support newlines in the line");
|
|
1573
|
+
return q(r, e);
|
|
1574
|
+
}
|
|
1575
|
+
x(Me, "splitLineToFitWidth");
|
|
1576
|
+
function q(r, e, n = [], s = []) {
|
|
1577
|
+
if (r.length === 0)
|
|
1578
|
+
return s.length > 0 && n.push(s), n.length > 0 ? n : [];
|
|
1579
|
+
let t = "";
|
|
1580
|
+
r[0].content === " " && (t = " ", r.shift());
|
|
1581
|
+
const l = r.shift() ?? {
|
|
1582
|
+
content: " ",
|
|
1583
|
+
type: "normal"
|
|
1584
|
+
}, i = [...s];
|
|
1585
|
+
if (t !== "" && i.push({
|
|
1586
|
+
content: t,
|
|
1587
|
+
type: "normal"
|
|
1588
|
+
}), i.push(l), e(i)) return q(r, e, n, i);
|
|
1589
|
+
if (s.length > 0)
|
|
1590
|
+
n.push(s), r.unshift(l);
|
|
1591
|
+
else if (l.content) {
|
|
1592
|
+
const [a, o] = qe(e, l);
|
|
1593
|
+
n.push([a]), o.content && r.unshift(o);
|
|
1594
|
+
}
|
|
1595
|
+
return q(r, e, n);
|
|
1596
|
+
}
|
|
1597
|
+
x(q, "splitLineToFitWidthRecursion");
|
|
1598
|
+
function G(r, e) {
|
|
1599
|
+
e && r.attr("style", e);
|
|
1600
|
+
}
|
|
1601
|
+
x(G, "applyStyle");
|
|
1602
|
+
var de = 16384;
|
|
1603
|
+
async function We(r, e, n, s, t = !1, l = Fe()) {
|
|
1604
|
+
const i = r.append("foreignObject");
|
|
1605
|
+
i.attr("width", `${Math.min(10 * n, de)}px`), i.attr("height", `${Math.min(10 * n, de)}px`);
|
|
1606
|
+
const a = i.append("xhtml:div"), o = be(e.label) ? await De(e.label.replace(Ne.lineBreakRegex, `
|
|
1607
|
+
`), l) : me(e.label, l), p = e.isNode ? "nodeLabel" : "edgeLabel", c = a.append("span");
|
|
1608
|
+
c.html(o), G(c, e.labelStyle), c.attr("class", `${p} ${s}`), G(a, e.labelStyle), a.style("display", "table-cell"), a.style("white-space", "nowrap"), a.style("line-height", "1.5"), n !== Number.POSITIVE_INFINITY && (a.style("max-width", n + "px"), a.style("text-align", "center")), a.attr("xmlns", "http://www.w3.org/1999/xhtml"), t && a.attr("class", "labelBkg");
|
|
1609
|
+
let h = a.node().getBoundingClientRect();
|
|
1610
|
+
return h.width === n && (a.style("display", "table"), a.style("white-space", "break-spaces"), a.style("width", n + "px"), h = a.node().getBoundingClientRect()), i.node();
|
|
1611
|
+
}
|
|
1612
|
+
x(We, "addHtmlSpan");
|
|
1613
|
+
function Z(r, e, n, s = !1) {
|
|
1614
|
+
const t = r.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", e * n - 0.1 + "em").attr("dy", n + "em");
|
|
1615
|
+
return s && t.attr("text-anchor", "middle"), t;
|
|
1616
|
+
}
|
|
1617
|
+
x(Z, "createTspan");
|
|
1618
|
+
function Ze(r, e, n) {
|
|
1619
|
+
const s = r.append("text"), t = Z(s, 1, e);
|
|
1620
|
+
j(t, n);
|
|
1621
|
+
const l = t.node().getComputedTextLength();
|
|
1622
|
+
return s.remove(), l;
|
|
1623
|
+
}
|
|
1624
|
+
x(Ze, "computeWidthOfText");
|
|
1625
|
+
function _t(r, e, n) {
|
|
1626
|
+
const s = r.append("text"), t = Z(s, 1, e);
|
|
1627
|
+
j(t, [{
|
|
1628
|
+
content: n,
|
|
1629
|
+
type: "normal"
|
|
1630
|
+
}]);
|
|
1631
|
+
const l = t.node()?.getBoundingClientRect();
|
|
1632
|
+
return l && s.remove(), l;
|
|
1633
|
+
}
|
|
1634
|
+
x(_t, "computeDimensionOfText");
|
|
1635
|
+
function je(r, e, n, s = !1, t = !1) {
|
|
1636
|
+
const i = e.append("g"), a = i.insert("rect").attr("class", "background").attr("style", "stroke: none"), o = i.append("text").attr("y", "-10.1");
|
|
1637
|
+
t && o.attr("text-anchor", "middle");
|
|
1638
|
+
let p = 0;
|
|
1639
|
+
for (const c of n) {
|
|
1640
|
+
const h = /* @__PURE__ */ x((k) => Ze(i, 1.1, k) <= r, "checkWidth"), u = h(c) ? [c] : Me(c, h);
|
|
1641
|
+
for (const k of u)
|
|
1642
|
+
j(Z(o, p, 1.1, t), k), p++;
|
|
1643
|
+
}
|
|
1644
|
+
if (s) {
|
|
1645
|
+
const c = o.node().getBBox(), h = 2;
|
|
1646
|
+
return a.attr("x", c.x - h).attr("y", c.y - h).attr("width", c.width + 2 * h).attr("height", c.height + 2 * h), i.node();
|
|
1647
|
+
} else return o.node();
|
|
1648
|
+
}
|
|
1649
|
+
x(je, "createFormattedText");
|
|
1650
|
+
function Q(r) {
|
|
1651
|
+
return r.replace(/&(amp|lt|gt);/g, (e, n) => {
|
|
1652
|
+
switch (n) {
|
|
1653
|
+
case "amp":
|
|
1654
|
+
return "&";
|
|
1655
|
+
case "lt":
|
|
1656
|
+
return "<";
|
|
1657
|
+
case "gt":
|
|
1658
|
+
return ">";
|
|
1659
|
+
default:
|
|
1660
|
+
return e;
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
x(Q, "decodeHTMLEntities");
|
|
1665
|
+
function j(r, e) {
|
|
1666
|
+
r.text(""), e.forEach((n, s) => {
|
|
1667
|
+
const t = r.append("tspan").attr("font-style", n.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", n.type === "strong" ? "bold" : "normal");
|
|
1668
|
+
s === 0 ? t.text(Q(n.content)) : t.text(" " + Q(n.content));
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1671
|
+
x(j, "updateTextContentAndStyles");
|
|
1672
|
+
async function He(r, e = {}) {
|
|
1673
|
+
const n = [];
|
|
1674
|
+
r.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (t, l, i) => (n.push((async () => {
|
|
1675
|
+
const a = `${l}:${i}`;
|
|
1676
|
+
return await Ge(a) ? await Qe(a, void 0, { class: "label-icon" }) : `<i class='${me(t, e).replace(":", " ")}'></i>`;
|
|
1677
|
+
})()), t));
|
|
1678
|
+
const s = await Promise.all(n);
|
|
1679
|
+
return r.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => s.shift() ?? "");
|
|
1680
|
+
}
|
|
1681
|
+
x(He, "replaceIconSubstring");
|
|
1682
|
+
var Ft = /* @__PURE__ */ x(async (r, e = "", { style: n = "", isTitle: s = !1, classes: t = "", useHtmlLabels: l = !0, markdown: i = !0, isNode: a = !0, width: o = 200, addSvgBackground: p = !1 } = {}, c) => {
|
|
1683
|
+
if (xe.debug("XYZ createText", e, n, s, t, l, a, "addSvgBackground: ", p), l) {
|
|
1684
|
+
const h = await He(oe(i ? Be(e, c) : Pe(e)), c), u = e.replace(/\\\\/g, "\\");
|
|
1685
|
+
return await We(r, {
|
|
1686
|
+
isNode: a,
|
|
1687
|
+
label: be(e) ? u : h,
|
|
1688
|
+
labelStyle: n.replace("fill:", "color:")
|
|
1689
|
+
}, o, t, p, c);
|
|
1690
|
+
} else {
|
|
1691
|
+
const h = oe(e.replace(/<br\s*\/?>/g, "<br/>")), u = je(o, r, i ? Ee(h.replace("<br>", "<br/>"), c) : _e(h), e ? p : !1, !a);
|
|
1692
|
+
if (a) {
|
|
1693
|
+
/stroke:/.exec(n) && (n = n.replace("stroke:", "lineColor:"));
|
|
1694
|
+
const k = n.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
|
|
1695
|
+
R(u).attr("style", k);
|
|
1696
|
+
} else {
|
|
1697
|
+
const k = n.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
|
|
1698
|
+
R(u).select("rect").attr("style", k.replace(/background:/g, "fill:"));
|
|
1699
|
+
const d = n.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
|
|
1700
|
+
R(u).select("text").attr("style", d);
|
|
1701
|
+
}
|
|
1702
|
+
return s ? R(u).selectAll("tspan.text-outer-tspan").classed("title-row", !0) : R(u).selectAll("tspan.text-outer-tspan").classed("row", !0), u;
|
|
1703
|
+
}
|
|
1704
|
+
}, "createText");
|
|
1705
|
+
export {
|
|
1706
|
+
Ft as n,
|
|
1707
|
+
Lt as r,
|
|
1708
|
+
_t as t
|
|
1709
|
+
};
|