@coffer-org/web 1.9.2 → 2.0.2
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/assets/ChatWidget-Bz4u-SNy.js +16 -0
- package/dist/assets/ExtendReasonInfo-BeDIuYIi.js +1 -0
- package/dist/assets/GeoMap-7TgzIUoI.js +1 -0
- package/dist/assets/Icon-BOpumJtD.js +2 -0
- package/dist/assets/MarkdownEditor-CxlMpjDc.js +1042 -0
- package/dist/assets/NewRecordView-CEU4tihb.js +1 -0
- package/dist/assets/NoMac-BarbbnIj.js +1 -0
- package/dist/assets/PageBody-Y-cpiRMh.js +1 -0
- package/dist/assets/PluginSettingsPage-T_qvClIU.js +1 -0
- package/dist/assets/ScanSummary-CtIkC51I.js +1 -0
- package/dist/assets/SettingsForm-BHlzjvhR.js +1 -0
- package/dist/assets/SettingsPage-CVFkzyOu.js +3 -0
- package/dist/assets/Toolbar-C1CC_tBj.js +2 -0
- package/dist/assets/api-1ZNfndlh.js +1 -0
- package/dist/assets/auth-context-CJTSRD17.js +1 -0
- package/dist/assets/button-D-Q6I5Ob.js +1 -0
- package/dist/assets/chrome-BWlqqMIt.js +1 -0
- package/dist/assets/clsx-CjueKrWZ.js +1 -0
- package/dist/assets/combobox-DkZHekBD.js +1 -0
- package/dist/assets/{data-size-Bszy5tww.js → data-size-BKFevwmi.js} +1 -1
- package/dist/assets/{development-ChLInqDF.js → development-olQNibq5.js} +1 -1
- package/dist/assets/dialog-DqWXrq6M.js +1 -0
- package/dist/assets/dispatch-TTtoo72r.js +1 -0
- package/dist/assets/dist-COeDLrWj.js +1 -0
- package/dist/assets/esm-C5Scej0H.js +1 -0
- package/dist/assets/{esm-BNZSV1P6.js → esm-Dfm1ivm4.js} +11 -11
- package/dist/assets/{extend-B2TSunN9.js → extend-BEGrSWug.js} +1 -1
- package/dist/assets/field-frame-BoLGR-Rm.js +1 -0
- package/dist/assets/fields-CFyhFHW7.js +64 -0
- package/dist/assets/flag-icons-CTDpPZQq.css +1 -0
- package/dist/assets/i18n-vendor-T6EnJ_TL.js +13 -0
- package/dist/assets/icons-DBHj1PyA.js +6 -0
- package/dist/assets/index-Dyp9mLfJ.css +2 -0
- package/dist/assets/index-InoHPhVb.js +59 -0
- package/dist/assets/input-group-Bmvb-qBI.js +1 -0
- package/dist/assets/json-CkyL3W27.js +1 -0
- package/dist/assets/lib-B13BbhLB.js +16 -0
- package/dist/assets/lib-BJGpevNH.js +1 -0
- package/dist/assets/lib-Du7RHLba.js +1 -0
- package/dist/assets/lib-sYoE14fC.js +1 -0
- package/dist/assets/markdown-vendor-CtaBI5gJ.js +56 -0
- package/dist/assets/{micromark-extension-gfm-Cu0AwUgc.js → micromark-extension-gfm-BUw6_ZLT.js} +2 -2
- package/dist/assets/phone-input-DLmP9Sfd.js +21 -0
- package/dist/assets/plugin-ui-CKd6q8ec.js +1 -0
- package/dist/assets/react-vendor-BskHO5hY.js +229 -0
- package/dist/assets/shared-BTj2W-Q0.js +1 -0
- package/dist/assets/{shelf-BK3PnmC8.js → shelf-BqwX4Wzq.js} +1 -1
- package/dist/assets/space-separated-tokens-IJiqTQpk.js +1 -0
- package/dist/assets/square-CiErsTOS.js +1 -0
- package/dist/assets/{src-BTBN5KMd.js → src-2jGaQ-C3.js} +1 -1
- package/dist/assets/src-7UE-kCDq.js +1 -0
- package/dist/assets/src-7w_NUAGr.js +1 -0
- package/dist/assets/src-82xH6mzL.js +1 -0
- package/dist/assets/src-B03lewBR.js +1 -0
- package/dist/assets/{src-BRmMx6aP.js → src-B1VIJtHj.js} +1 -1
- package/dist/assets/src-BKtjLdxS.js +1 -0
- package/dist/assets/src-BqABh1uZ.js +1 -0
- package/dist/assets/src-Bw_s3Ntp.js +1 -0
- package/dist/assets/{src-CGDLkExi.js → src-C0UxSUeR.js} +1 -1
- package/dist/assets/{src-BZR3veCD.js → src-C78Tm4dQ.js} +4 -4
- package/dist/assets/{src-x98wK60X.js → src-CkyeS9DG.js} +1 -1
- package/dist/assets/src-D09noJea.js +1 -0
- package/dist/assets/{src-DiXQGHgL.js → src-DGTYbs6s.js} +1 -1
- package/dist/assets/src-DK2Y5zSQ.js +1 -0
- package/dist/assets/src-DK_szrYh.js +1 -0
- package/dist/assets/src-DNRPYtVW.js +1 -0
- package/dist/assets/src-DWuhltOv.js +4 -0
- package/dist/assets/src-DY4zcFBV.js +1 -0
- package/dist/assets/src-DdDc6tQm.js +1 -0
- package/dist/assets/src-DlMQDr49.js +1 -0
- package/dist/assets/src-DtS4bMoK.js +1 -0
- package/dist/assets/src-MK8RohgP.js +4 -0
- package/dist/assets/src-NjjI6BoS.js +2 -0
- package/dist/assets/src-RuPVoIKg.js +1 -0
- package/dist/assets/{src-yzod66e_2.js → src-zgHG-QuP.js} +1 -1
- package/dist/assets/ui-B3pPuRs1.js +2 -0
- package/dist/assets/ui-CqAR7iK_.js +2 -0
- package/dist/assets/ui-DzUTPbkP.js +2 -0
- package/dist/assets/ui-vendor-EU9CHLyR.js +44 -0
- package/dist/assets/use-media-query-DWcBtoAU.js +1 -0
- package/dist/assets/x-BFRg18Fi.js +1 -0
- package/dist/assets/zwitch-656t1L3N.js +1 -0
- package/dist/index.html +37 -26
- package/dist-vendor/react-dom-CSpNHkg-.js +131 -0
- package/dist-vendor/react-dom.js +5 -130
- package/dist-vendor/react-router-dom.js +8050 -0
- package/dist-vendor/web-sdk.js +964 -895
- package/package.json +8 -3
- package/site.d.mts +8 -0
- package/site.mjs +51 -0
- package/dist/assets/Combination-lRbXGCSx.js +0 -41
- package/dist/assets/ExtendReasonInfo-D50L3SUy.js +0 -1
- package/dist/assets/GeoMap-Gfe3Mxlk.js +0 -1
- package/dist/assets/MarkdownEditor-BZVJGWMb.js +0 -1057
- package/dist/assets/NewRecordView-Bc5P_UIV.js +0 -1
- package/dist/assets/NoMac-D7iyE4U0.js +0 -1
- package/dist/assets/PageBody-CvuReTKD.js +0 -1
- package/dist/assets/PluginSettingsPage-uganqrBt.js +0 -1
- package/dist/assets/ScanSummary-BtTfSAGX.js +0 -1
- package/dist/assets/SettingsForm-JjEXZ-t9.js +0 -1
- package/dist/assets/SettingsPage-D7eX_VOW.js +0 -3
- package/dist/assets/Toolbar-BwCsWgeh.js +0 -2
- package/dist/assets/api-CZDF0K_X.js +0 -1
- package/dist/assets/auth-context-Cw3aF7cR.js +0 -1
- package/dist/assets/button-Dlm2GmQs.js +0 -5
- package/dist/assets/chunk-KS7C4IRE-B1_Zk64s.js +0 -3
- package/dist/assets/clsx-enQ3xCtU.js +0 -1
- package/dist/assets/dist-CdqdWApy.js +0 -1
- package/dist/assets/dist-nHZzrtBn.js +0 -1
- package/dist/assets/esm-DCMdnC8o.js +0 -1
- package/dist/assets/field-frame-ghjkvmJL.js +0 -1
- package/dist/assets/fields-DM_Scep8.js +0 -64
- package/dist/assets/floating-ui.dom-BiC1_AXf.js +0 -1
- package/dist/assets/index-CO8Ldftb.css +0 -2
- package/dist/assets/index-DS03kek4.js +0 -354
- package/dist/assets/json-DhhZ0035.js +0 -1
- package/dist/assets/jsx-dev-runtime-CSfA-jUb.js +0 -6
- package/dist/assets/jsx-runtime-JUshM5qe.js +0 -6
- package/dist/assets/lib-Co4B8qAy.js +0 -1
- package/dist/assets/lib-DqTnDi2O.js +0 -1
- package/dist/assets/react-n93t21jb.js +0 -13
- package/dist/assets/shared-2FvmrkOU.js +0 -1
- package/dist/assets/src-1rZMvlbf.js +0 -1
- package/dist/assets/src-9R01NlCm.js +0 -1
- package/dist/assets/src-B1D9UYwu.js +0 -1
- package/dist/assets/src-B1xlnIj1.js +0 -1
- package/dist/assets/src-BMbgcBzC.js +0 -4
- package/dist/assets/src-BesH3Mb-.js +0 -1
- package/dist/assets/src-Btcb_Owg.js +0 -1
- package/dist/assets/src-Bw5hUET5.js +0 -1
- package/dist/assets/src-C5aZ23Xq.js +0 -1
- package/dist/assets/src-CJ63Qi1g.js +0 -1
- package/dist/assets/src-CuAjDF_E.js +0 -1
- package/dist/assets/src-D4Vq1SI2.js +0 -2
- package/dist/assets/src-O8AsCoRg.js +0 -1
- package/dist/assets/src-SoSUSubV.js +0 -1
- package/dist/assets/src-YB9DbMxM.js +0 -1
- package/dist/assets/src-YM3yhIXD.js +0 -4
- package/dist/assets/ui-CfMH0X_L.js +0 -2
- /package/dist/assets/{dist-BVqKJBMt2.js → dist-BVqKJBMt.js} +0 -0
- /package/dist/assets/{dist-CUwIxyXc2.js → dist-CUwIxyXc.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t}from"./i18n-vendor-T6EnJ_TL.js";import{t as n}from"./react-vendor-BskHO5hY.js";import{n as r,r as i}from"./x-BFRg18Fi.js";import{r as a,t as o}from"./button-D-Q6I5Ob.js";var s=e(t(),1),c=n(),l=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/components/ui/input.tsx`,u=s.forwardRef(({className:e,type:t,...n},r)=>(0,c.jsxDEV)(`input`,{type:t,ref:r,className:i(`flex h-9 w-full rounded-lg border border-input bg-background px-2 py-1 text-sm text-foreground transition-colors`,`placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...n},void 0,!1,{fileName:l,lineNumber:6,columnNumber:5},void 0));u.displayName=`Input`;var d=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/components/ui/textarea.tsx`,f=s.forwardRef(({className:e,...t},n)=>(0,c.jsxDEV)(`textarea`,{ref:n,className:i(`flex min-h-20 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground transition-colors`,`placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...t},void 0,!1,{fileName:d,lineNumber:6,columnNumber:5},void 0));f.displayName=`Textarea`;var p=r(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),m=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/components/ui/input-group.tsx`;function h({className:e,...t}){return(0,c.jsxDEV)(`div`,{"data-slot":`input-group`,role:`group`,className:i(`group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30`,`h-9 min-w-0 has-[>textarea]:h-auto`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,`has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50`,`has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40`,e),...t},void 0,!1,{fileName:m,lineNumber:11,columnNumber:5},this)}var g=a(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]`,"inline-end":`order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]`,"block-start":`order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3`,"block-end":`order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3`}},defaultVariants:{align:`inline-start`}});function _({className:e,align:t=`inline-start`,...n}){return(0,c.jsxDEV)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:i(g({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n},void 0,!1,{fileName:m,lineNumber:61,columnNumber:5},this)}var v=a(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5`,sm:`h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5`,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function y({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...a}){return(0,c.jsxDEV)(o,{type:t,"data-size":r,variant:n,className:i(v({size:r}),e),...a},void 0,!1,{fileName:m,lineNumber:99,columnNumber:5},this)}function b({className:e,...t}){return(0,c.jsxDEV)(`span`,{className:i(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t},void 0,!1,{fileName:m,lineNumber:111,columnNumber:5},this)}function x({className:e,...t}){return(0,c.jsxDEV)(u,{"data-slot":`input-group-control`,className:i(`flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent`,e),...t},void 0,!1,{fileName:m,lineNumber:123,columnNumber:5},this)}export{b as a,u as c,x as i,_ as n,p as o,y as r,f as s,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){if(e==null||e===``)return t;if(typeof e==`object`)return e;try{return JSON.parse(String(e))}catch{return t}}export{e as t};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{r as e,t}from"./development-olQNibq5.js";import{a as n,b as r,d as i,f as a,h as o,i as s,o as c,p as l,r as u,t as d,v as f,y as p}from"./micromark-extension-gfm-BUw6_ZLT.js";import{i as m,l as h,o as g,r as _,t as ee}from"./lib-Du7RHLba.js";var te={};function v(e,t){let n=t||te;return y(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function y(e,t,n){if(ne(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return b(e.children,t,n)}return Array.isArray(e)?b(e,t,n):``}function b(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=y(e[i],t,n);return r.join(``)}function ne(e){return!!(e&&typeof e==`object`)}var re=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function x(e){return e.replace(re,S)}function S(t,n,i){if(n)return n;if(i.charCodeAt(0)===r.numberSign){let e=i.charCodeAt(1),t=e===r.lowercaseX||e===r.uppercaseX;return o(i.slice(t?2:1),t?p.numericBaseHexadecimal:p.numericBaseDecimal)}return e(i)||t}var ie={}.hasOwnProperty;function ae(e,t,r){return t&&typeof t==`object`&&(r=t,t=void 0),oe(r)(s(n(r).document().write(u()(e,t,!0))))}function oe(n){let i={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:u(W),autolinkProtocol:w,autolinkEmail:w,atxHeading:u(V),blockQuote:u(be),characterEscape:w,characterReference:w,codeFenced:u(B),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(B,d),codeText:u(xe,d),codeTextData:w,data:w,codeFlowValue:w,definition:u(Se),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(Ce),hardBreakEscape:u(H),hardBreakTrailing:u(H),htmlFlow:u(U,d),htmlFlowData:w,htmlText:u(U,d),htmlTextData:w,image:u(we),label:d,link:u(W),listItem:u(Te),listItemValue:y,listOrdered:u(G,te),listUnordered:u(G),paragraph:u(Ee),reference:L,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(V),strong:u(De),thematicBreak:u(K)},exit:{atxHeading:g(),atxHeadingSequence:de,autolink:g(),autolinkEmail:ye,autolinkProtocol:ve,blockQuote:g(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:ge,characterReference:_e,codeFenced:g(S),codeFencedFence:re,codeFencedFenceInfo:b,codeFencedFenceMeta:ne,codeFlowValue:T,codeIndented:g(ae),codeText:g(A),codeTextData:T,data:T,definition:g(),definitionDestinationString:ue,definitionLabelString:oe,definitionTitleString:ce,emphasis:g(),hardBreakEscape:g(D),hardBreakTrailing:g(D),htmlFlow:g(O),htmlFlowData:T,htmlText:g(k),htmlTextData:T,image:g(j),label:N,labelText:M,lineEnding:E,link:g(he),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:R,resourceDestinationString:P,resourceTitleString:F,resource:I,setextHeading:g(me),setextHeadingLineSequence:pe,setextHeadingText:fe,strong:g(),thematicBreak:g()}};se(i,(n||{}).mdastExtensions||[]);let a={};return s;function s(e){let n={type:`root`,children:[]},r={stack:[n],tokenStack:[],config:i,enter:m,exit:_,buffer:d,resume:ee,data:a},o=[],s=-1;for(;++s<e.length;)if(e[s][1].type===f.listOrdered||e[s][1].type===f.listUnordered)if(e[s][0]===`enter`)o.push(s);else{let n=o.pop();t(typeof n==`number`,`expected list to be open`),s=c(e,n,s)}for(s=-1;++s<e.length;){let t=i[e[s][0]];ie.call(t,e[s][1].type)&&t[e[s][1].type].call(Object.assign({sliceSerialize:e[s][2].sliceSerialize},r),e[s][1])}if(r.tokenStack.length>0){let e=r.tokenStack[r.tokenStack.length-1];(e[1]||le).call(r,void 0,e[0])}for(n.position={start:C(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:C(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},s=-1;++s<i.transforms.length;)n=i.transforms[s](n)||n;return n}function c(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case f.listUnordered:case f.listOrdered:case f.blockQuote:t[0]===`enter`?i++:i--,l=void 0;break;case f.lineEndingBlank:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case f.linePrefix:case f.listItemValue:case f.listItemMarker:case f.listItemPrefix:case f.listItemPrefixWhitespace:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===f.listItemPrefix||i===-1&&t[0]===`exit`&&(t[1].type===f.listUnordered||t[1].type===f.listOrdered)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===f.lineEnding||t[1].type===f.lineEndingBlank){if(t[0]===`exit`)continue;s&&(e[s][1].type=f.lineEndingBlank,a=!0),t[1].type=f.lineEnding,s=i}else if(!(t[1].type===f.linePrefix||t[1].type===f.blockQuotePrefix||t[1].type===f.blockQuotePrefixWhitespace||t[1].type===f.blockQuoteMarker||t[1].type===f.listItemIndent))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===f.listItemPrefix){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function u(e,t){return n;function n(n){m.call(this,e(n),n),t&&t.call(this,n)}}function d(){this.stack.push({type:`fragment`,children:[]})}function m(e,n,r){let i=this.stack[this.stack.length-1];t(i,"expected `parent`"),t(`children`in i,"expected `parent`"),i.children.push(e),this.stack.push(e),this.tokenStack.push([n,r||void 0]),e.position={start:C(n.start),end:void 0}}function g(e){return t;function t(t){e&&e.call(this,t),_.call(this,t)}}function _(e,n){let r=this.stack.pop();t(r,"expected `node`");let i=this.tokenStack.pop();if(i)i[0].type!==e.type&&(n?n.call(this,e,i[0]):(i[1]||le).call(this,e,i[0]));else throw Error("Cannot close `"+e.type+"` ("+h({start:e.start,end:e.end})+`): it’s not open`);t(r.type!==`fragment`,"unexpected fragment `exit`ed"),t(r.position,"expected `position` to be defined"),r.position.end=C(e.end)}function ee(){return v(this.stack.pop())}function te(){this.data.expectingFirstListItemValue=!0}function y(e){if(this.data.expectingFirstListItemValue){let n=this.stack[this.stack.length-2];t(n,`expected nodes on stack`),t(n.type===`list`,`expected list on stack`),n.start=Number.parseInt(this.sliceSerialize(e),p.numericBaseDecimal),this.data.expectingFirstListItemValue=void 0}}function b(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`code`,`expected code on stack`),n.lang=e}function ne(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`code`,`expected code on stack`),n.meta=e}function re(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`code`,`expected code on stack`),n.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function ae(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`code`,`expected code on stack`),n.value=e.replace(/(\r?\n|\r)$/g,``)}function oe(e){let n=this.resume(),r=this.stack[this.stack.length-1];t(r,`expected node on stack`),t(r.type===`definition`,`expected definition on stack`),r.label=n,r.identifier=l(this.sliceSerialize(e)).toLowerCase()}function ce(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`definition`,`expected definition on stack`),n.title=e}function ue(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`definition`,`expected definition on stack`),n.url=e}function de(e){let n=this.stack[this.stack.length-1];if(t(n,`expected node on stack`),t(n.type===`heading`,`expected heading on stack`),!n.depth){let r=this.sliceSerialize(e).length;t(r===1||r===2||r===3||r===4||r===5||r===6,"expected `depth` between `1` and `6`"),n.depth=r}}function fe(){this.data.setextHeadingSlurpLineEnding=!0}function pe(e){let n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`heading`,`expected heading on stack`),n.depth=this.sliceSerialize(e).codePointAt(0)===r.equalsTo?1:2}function me(){this.data.setextHeadingSlurpLineEnding=void 0}function w(e){let n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(`children`in n,`expected parent on stack`);let r=n.children,i=r[r.length-1];(!i||i.type!==`text`)&&(i=Oe(),i.position={start:C(e.start),end:void 0},r.push(i)),this.stack.push(i)}function T(e){let n=this.stack.pop();t(n,"expected a `node` to be on the stack"),t(`value`in n,"expected a `literal` to be on the stack"),t(n.position,"expected `node` to have an open position"),n.value+=this.sliceSerialize(e),n.position.end=C(e.end)}function E(e){let n=this.stack[this.stack.length-1];if(t(n,"expected `node`"),this.data.atHardBreak){t(`children`in n,"expected `parent`");let r=n.children[n.children.length-1];t(r.position,`expected tail to have a starting position`),r.position.end=C(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(n.type)&&(w.call(this,e),T.call(this,e))}function D(){this.data.atHardBreak=!0}function O(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`html`,`expected html on stack`),n.value=e}function k(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`html`,`expected html on stack`),n.value=e}function A(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`inlineCode`,`expected inline code on stack`),n.value=e}function he(){let e=this.stack[this.stack.length-1];if(t(e,`expected node on stack`),t(e.type===`link`,`expected link on stack`),this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){let e=this.stack[this.stack.length-1];if(t(e,`expected node on stack`),t(e.type===`image`,`expected image on stack`),this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){let n=this.sliceSerialize(e),r=this.stack[this.stack.length-2];t(r,`expected ancestor on stack`),t(r.type===`image`||r.type===`link`,`expected image or link on stack`),r.label=x(n),r.identifier=l(n).toLowerCase()}function N(){let e=this.stack[this.stack.length-1];t(e,`expected node on stack`),t(e.type===`fragment`,`expected fragment on stack`);let n=this.resume(),r=this.stack[this.stack.length-1];t(r,`expected node on stack`),t(r.type===`image`||r.type===`link`,`expected image or link on stack`),this.data.inReference=!0,r.type===`link`?r.children=e.children:r.alt=n}function P(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`image`||n.type===`link`,`expected image or link on stack`),n.url=e}function F(){let e=this.resume(),n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`image`||n.type===`link`,`expected image or link on stack`),n.title=e}function I(){this.data.inReference=void 0}function L(){this.data.referenceType=`collapsed`}function R(e){let n=this.resume(),r=this.stack[this.stack.length-1];t(r,`expected node on stack`),t(r.type===`image`||r.type===`link`,`expected image reference or link reference on stack`),r.label=n,r.identifier=l(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function z(e){t(e.type===`characterReferenceMarkerNumeric`||e.type===`characterReferenceMarkerHexadecimal`),this.data.characterReferenceType=e.type}function ge(n){let r=this.sliceSerialize(n),i=this.data.characterReferenceType,a;if(i)a=o(r,i===f.characterReferenceMarkerNumeric?p.numericBaseDecimal:p.numericBaseHexadecimal),this.data.characterReferenceType=void 0;else{let n=e(r);t(n!==!1,`expected reference to decode`),a=n}let s=this.stack[this.stack.length-1];t(s,"expected `node`"),t(`value`in s,"expected `node.value`"),s.value+=a}function _e(e){let n=this.stack.pop();t(n,"expected `node`"),t(n.position,"expected `node.position`"),n.position.end=C(e.end)}function ve(e){T.call(this,e);let n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`link`,`expected link on stack`),n.url=this.sliceSerialize(e)}function ye(e){T.call(this,e);let n=this.stack[this.stack.length-1];t(n,`expected node on stack`),t(n.type===`link`,`expected link on stack`),n.url=`mailto:`+this.sliceSerialize(e)}function be(){return{type:`blockquote`,children:[]}}function B(){return{type:`code`,lang:null,meta:null,value:``}}function xe(){return{type:`inlineCode`,value:``}}function Se(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function Ce(){return{type:`emphasis`,children:[]}}function V(){return{type:`heading`,depth:0,children:[]}}function H(){return{type:`break`}}function U(){return{type:`html`,value:``}}function we(){return{type:`image`,title:null,url:``,alt:null}}function W(){return{type:`link`,title:null,url:``,children:[]}}function G(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function K(){return{type:`thematicBreak`}}}function C(e){return{line:e.line,column:e.column,offset:e.offset}}function se(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?se(e,r):ce(e,r)}}function ce(e,t){let n;for(n in t)if(ie.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function le(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+h({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+h({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+h({start:t.start,end:t.end})+`) is still open`)}function ue(e){let t=this;t.parser=n;function n(n){return ae(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function de(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function fe(e,t,n){let r=m((n||{}).ignore||[]),i=pe(t),a=-1;for(;++a<i.length;)_(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function pe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([me(e[0]),w(e[1])])}return t}function me(e){return typeof e==`string`?new RegExp(de(e),`g`):e}function w(e){return typeof e==`function`?e:function(){return e}}var T=`phrasing`,E=[`autolink`,`link`,`image`,`label`];function D(){return{transforms:[P],enter:{literalAutolink:k,literalAutolinkEmail:A,literalAutolinkHttp:A,literalAutolinkWww:A},exit:{literalAutolink:N,literalAutolinkEmail:M,literalAutolinkHttp:he,literalAutolinkWww:j}}}function O(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:T,notInConstruct:E},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:T,notInConstruct:E},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:T,notInConstruct:E}]}}function k(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function A(e){this.config.enter.autolinkProtocol.call(this,e)}function he(e){this.config.exit.autolinkProtocol.call(this,e)}function j(e){this.config.exit.data.call(this,e);let n=this.stack[this.stack.length-1];t(n.type===`link`),n.url=`http://`+this.sliceSerialize(e)}function M(e){this.config.exit.autolinkEmail.call(this,e)}function N(e){this.exit(e)}function P(e){fe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,F],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,I]],{ignore:[`link`,`linkReference`]})}function F(e,t,n,r,i){let a=``;if(!z(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!L(n)))return!1;let o=R(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function I(e,t,n,r){return!z(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function L(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function R(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=g(e,`(`),a=g(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function z(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||a(n)||i(n))&&(!t||n!==47)}V.peek=Ce;function ge(){this.buffer()}function _e(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ve(){this.buffer()}function ye(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function be(e){let n=this.resume(),r=this.stack[this.stack.length-1];t(r.type===`footnoteReference`),r.identifier=l(this.sliceSerialize(e)).toLowerCase(),r.label=n}function B(e){this.exit(e)}function xe(e){let n=this.resume(),r=this.stack[this.stack.length-1];t(r.type===`footnoteDefinition`),r.identifier=l(this.sliceSerialize(e)).toLowerCase(),r.label=n}function Se(e){this.exit(e)}function Ce(){return`[`}function V(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function H(){return{enter:{gfmFootnoteCallString:ge,gfmFootnoteCall:_e,gfmFootnoteDefinitionLabelString:ve,gfmFootnoteDefinition:ye},exit:{gfmFootnoteCallString:be,gfmFootnoteCall:B,gfmFootnoteDefinitionLabelString:xe,gfmFootnoteDefinition:Se}}}function U(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:V},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
2
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?W:we))),s(),o}}function we(e,t,n){return t===0?e:W(e,t,n)}function W(e,t,n){return(n?``:` `)+e}var G=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];K.peek=ke;function Te(){return{canContainEols:[`delete`],enter:{strikethrough:De},exit:{strikethrough:Oe}}}function Ee(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:G}],handlers:{delete:K}}}function De(e){this.enter({type:`delete`,children:[]},e)}function Oe(e){this.exit(e)}function K(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function ke(){return`~`}function Ae(e){return e.length}function je(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ae,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Me(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=q(r[d]);else{let e=q(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
3
|
+
`)}function Me(e){return e==null?``:String(e)}function q(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Ne(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Pe);return i(),o}function Pe(e,t,n){return`>`+(n?``:` `)+e}function Fe(e,t){return Ie(e,t.inConstruct,!0)&&!Ie(e,t.notInConstruct,!1)}function Ie(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Le(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
4
|
+
`&&Fe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
5
|
+
`}function Re(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function ze(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Be(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ve(e,t,n,r){let i=Be(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(ze(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,He);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Re(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
6
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
7
|
+
`),a&&(u+=s.move(a+`
|
|
8
|
+
`)),u+=s.move(c),l(),u}function He(e,t,n){return(n?``:` `)+e}function J(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ue(e,t,n,r){let i=J(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
9
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function We(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Y(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function X(e,t,n){let r=c(e),i=c(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ge.peek=Ke;function Ge(e,t,n,r){let i=We(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=X(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Y(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=X(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Y(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ke(e,t,n){return n.options.emphasis||`*`}function qe(e,t){let n=!1;return ee(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&v(e)&&(t.options.setext||n))}function Je(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(qe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
10
|
+
`,after:`
|
|
11
|
+
`});return r(),t(),o+`
|
|
12
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
13
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
14
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Y(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Ye.peek=Xe;function Ye(e){return e.value||``}function Xe(){return`<`}Ze.peek=Qe;function Ze(e,t,n,r){let i=J(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Qe(){return`!`}$e.peek=et;function $e(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function et(){return`!`}tt.peek=nt;function tt(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function nt(){return"`"}function rt(e,t){let n=v(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}it.peek=at;function it(e,t,n,r){let i=J(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(rt(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function at(e,t,n){return rt(e,n)?`<`:`[`}ot.peek=st;function ot(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function st(){return`[`}function Z(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ct(e){let t=Z(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function lt(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ut(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function dt(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?lt(n):Z(n),s=e.ordered?o===`.`?`)`:`.`:ct(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),ut(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function ft(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function pt(e,t,n,r){let i=ft(n),a=n.bulletCurrent||Z(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function mt(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var ht=m([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function gt(e,t,n,r){return(e.children.some(function(e){return ht(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function _t(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}vt.peek=yt;function vt(e,t,n,r){let i=_t(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=X(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Y(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=X(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Y(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function yt(e,t,n){return n.options.strong||`*`}function bt(e,t,n,r){return n.safe(e.value,r)}function xt(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function St(e,t,n){let r=(ut(n)+(n.options.ruleSpaces?` `:``)).repeat(xt(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Q={blockquote:Ne,break:Le,code:Ve,definition:Ue,emphasis:Ge,hardBreak:Le,heading:Je,html:Ye,image:Ze,imageReference:$e,inlineCode:tt,link:it,linkReference:ot,list:dt,listItem:pt,paragraph:mt,root:gt,strong:vt,text:bt,thematicBreak:St};function Ct(){return{enter:{table:wt,tableData:Dt,tableHeader:Dt,tableRow:Et},exit:{codeText:Ot,table:Tt,tableData:$,tableHeader:$,tableRow:$}}}function wt(e){let n=e._align;t(n,"expected `_align` on table"),this.enter({type:`table`,align:n.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Tt(e){this.exit(e),this.data.inTable=void 0}function Et(e){this.enter({type:`tableRow`,children:[]},e)}function $(e){this.exit(e)}function Dt(e){this.enter({type:`tableCell`,children:[]},e)}function Ot(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,kt));let r=this.stack[this.stack.length-1];t(r.type===`inlineCode`),r.value=n,this.exit(e)}function kt(e,t){return t===`|`?t:e}function At(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
15
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
16
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return je(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Q.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function jt(){return{exit:{taskListCheckValueChecked:Nt,taskListCheckValueUnchecked:Nt,paragraph:Pt}}}function Mt(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Ft}}}function Nt(e){let n=this.stack[this.stack.length-2];t(n.type===`listItem`),n.checked=e.type===`taskListCheckValueChecked`}function Pt(e){let n=this.stack[this.stack.length-2];if(n&&n.type===`listItem`&&typeof n.checked==`boolean`){let e=this.stack[this.stack.length-1];t(e.type===`paragraph`);let r=e.children[0];if(r&&r.type===`text`){let t=n.children,i=-1,a;for(;++i<t.length;){let e=t[i];if(e.type===`paragraph`){a=e;break}}a===e&&(r.value=r.value.slice(1),r.value.length===0?e.children.shift():e.position&&r.position&&typeof r.position.start.offset==`number`&&(r.position.start.column++,r.position.start.offset++,e.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Ft(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Q.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function It(){return[D(),H(),Te(),Ct(),jt()]}function Lt(e){return{extensions:[O(),U(e),Ee(),At(e),Mt()]}}var Rt={};function zt(e){let t=this,n=e||Rt,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(d(n)),a.push(It()),o.push(Lt(n))}export{ze as a,ue as c,Y as i,x as l,Q as n,Re as o,qe as r,Fe as s,zt as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./development-olQNibq5.js";import{a as t,c as n,o as r,r as i,s as a,t as o}from"./space-separated-tokens-IJiqTQpk.js";var s=/[#.]/g;function c(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){s.lastIndex=i;let e=s.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function l(e,t,n){let r=n?h(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=c(n,t);let s=o.tagName.toLowerCase(),l=r?r.get(s):void 0;if(o.tagName=l||s,u(i))a.unshift(i);else for(let[t,n]of Object.entries(i))d(e,o.properties,t,n)}for(let e of a)f(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function u(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function d(e,t,n,r){let s=a(e,n),c;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;c=r}else c=typeof r==`boolean`?r:typeof r==`string`?s.spaceSeparated?o(r):s.commaSeparated?i(r):s.commaOrSpaceSeparated?o(i(r).join(` `)):p(s,s.property,r):Array.isArray(r)?[...r]:s.property===`style`?m(r):String(r);if(Array.isArray(c)){let e=[];for(let t of c)e.push(p(s,s.property,t));c=e}s.property===`className`&&Array.isArray(t.className)&&(c=t.className.concat(c)),t[s.property]=c}}function f(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)f(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?f(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function p(e,t,r){if(typeof r==`string`){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===``||n(r)===n(t)))return!0}return r}function m(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function h(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var g=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),_=l(t,`div`),v=l(r,`g`,g),y=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),b={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function x(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function S(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function C(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function w(e){return C(e)||x(e)}var T=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function E(t,n){let r=n||{},i=typeof r.additional==`string`?r.additional.charCodeAt(0):r.additional,a=[],o=0,s=-1,c=``,l,u;r.position&&(`start`in r.position||`indent`in r.position?(u=r.position.indent,l=r.position.start):l=r.position);let d=(l?l.line:0)||1,f=(l?l.column:0)||1,p=h(),m;for(o--;++o<=t.length;)if(m===10&&(f=(u?u[s]:0)||1),m=t.charCodeAt(o),m===38){let n=t.charCodeAt(o+1);if(n===9||n===10||n===12||n===32||n===38||n===60||Number.isNaN(n)||i&&n===i){c+=String.fromCharCode(m),f++;continue}let s=o+1,l=s,u=s,d;if(n===35){u=++l;let e=t.charCodeAt(u);e===88||e===120?(d=`hexadecimal`,u=++l):d=`decimal`}else d=`named`;let v=``,C=``,T=``,E=d===`named`?w:d===`decimal`?x:S;for(u--;++u<=t.length;){let n=t.charCodeAt(u);if(!E(n))break;T+=String.fromCharCode(n),d===`named`&&y.includes(T)&&(v=T,C=e(T))}let k=t.charCodeAt(u)===59;if(k){u++;let t=d===`named`&&e(T);t&&(v=T,C=t)}let A=1+u-s,j=``;if(!(!k&&r.nonTerminated===!1))if(!T)d!==`named`&&g(4,A);else if(d===`named`){if(k&&!C)g(5,1);else if(v!==T&&(u=l+v.length,A=1+u-l,k=!1),!k){let e=v?1:3;if(r.attribute){let n=t.charCodeAt(u);n===61?(g(e,A),C=``):w(n)?C=``:g(e,A)}else g(e,A)}j=C}else{k||g(2,A);let e=Number.parseInt(T,d===`hexadecimal`?16:10);if(D(e))g(7,A),j=`�`;else if(e in b)g(6,A),j=b[e];else{let t=``;O(e)&&g(6,A),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),j=t+String.fromCharCode(e)}}if(j){_(),p=h(),o=u-1,f+=u-s+1,a.push(j);let e=h();e.offset++,r.reference&&r.reference.call(r.referenceContext||void 0,j,{start:p,end:e},t.slice(s-1,u)),p=e}else T=t.slice(s-1,u),c+=T,f+=T.length,o=u-1}else m===10&&(d++,s++,f=0),Number.isNaN(m)?_():(c+=String.fromCharCode(m),f++);return a.join(``);function h(){return{line:d,column:f,offset:o+((l?l.offset:0)||0)}}function g(e,t){let n;r.warning&&(n=h(),n.column+=t,n.offset+=t,r.warning.call(r.warningContext||void 0,T[e],n,e))}function _(){c&&=(a.push(c),r.text&&r.text.call(r.textContext||void 0,c,{start:p,end:h()}),``)}}function D(e){return e>=55296&&e<=57343||e>1114111}function O(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}export{v as i,y as n,_ as r,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-QTnfLwEv.js";import{t as n}from"./development-olQNibq5.js";function r(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?a(e.position):`start`in e||`end`in e?a(e):`line`in e||`column`in e?i(e):``}function i(e){return o(e&&e.line)+`:`+o(e&&e.column)}function a(e){return i(e&&e.start)+`-`+i(e&&e.end)}function o(e){return e&&typeof e==`number`?e:1}var s=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let i=``,a={},o=!1;if(t&&(a=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?i=e:!a.cause&&e&&(o=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?a.ruleId=n:(a.source=n.slice(0,e),a.ruleId=n.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let s=a.place&&`start`in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file=``,this.message=i,this.line=s?s.line:void 0,this.name=r(a.place)||`1:1`,this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack==`string`?a.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};s.prototype.file=``,s.prototype.name=``,s.prototype.reason=``,s.prototype.message=``,s.prototype.stack=``,s.prototype.column=void 0,s.prototype.line=void 0,s.prototype.ancestors=void 0,s.prototype.cause=void 0,s.prototype.fatal=void 0,s.prototype.place=void 0,s.prototype.ruleId=void 0,s.prototype.source=void 0;var c={basename:l,dirname:u,extname:d,join:f,sep:`/`};function l(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);h(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function u(e){if(h(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function d(e){h(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function f(...e){let t=-1,n;for(;++t<e.length;)h(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:p(n)}function p(e){h(e);let t=e.codePointAt(0)===47,n=m(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function m(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function h(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var g={cwd:_};function _(){return`/`}function v(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function y(e){if(typeof e==`string`)e=new URL(e);else if(!v(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return b(e)}function b(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var x=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],S=class{constructor(e){let t;t=e?v(e)?{path:e}:typeof e==`string`||ee(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:g.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<x.length;){let e=x[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)x.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?c.basename(this.path):void 0}set basename(e){w(e,`basename`),C(e,`basename`),this.path=c.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?c.dirname(this.path):void 0}set dirname(e){T(this.basename,`dirname`),this.path=c.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?c.extname(this.path):void 0}set extname(e){if(C(e,`extname`),T(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=c.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){v(e)&&(e=y(e)),w(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?c.basename(this.path,this.extname):void 0}set stem(e){w(e,`stem`),C(e,`stem`),this.path=c.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new s(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function C(e,t){if(e&&e.includes(c.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+c.sep+"`")}function w(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function T(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ee(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function E(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function D(e){if(e)throw e}var O=e(t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function A(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?j(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function j(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var M=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),N={}.hasOwnProperty,P=new class e extends M{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=A()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,O.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(L(`data`,this.frozen),this.namespace[e]=t,this):N.call(this.namespace,e)&&this.namespace[e]||void 0:e?(L(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=B(e),n=this.parser||this.Parser;return F(`parse`,n),n(String(t),t)}process(e,t){let r=this;return this.freeze(),F(`process`,this.parser||this.Parser),I(`process`,this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(i,a){let o=B(e),s=r.parse(o);r.run(s,o,function(e,t,n){if(e||!t||!n)return c(e);let i=t,a=r.stringify(i,n);H(a)?n.value=a:n.result=a,c(e,n)});function c(e,r){e||!r?a(e):i?i(r):(n(t,"`done` is defined if `resolve` is not"),t(void 0,r))}}}processSync(e){let t=!1,r;return this.freeze(),F(`processSync`,this.parser||this.Parser),I(`processSync`,this.compiler||this.Compiler),this.process(e,i),z(`processSync`,`process`,t),n(r,`we either bailed on an error or have a tree`),r;function i(e,n){t=!0,D(e),r=n}}run(e,t,r){R(e),this.freeze();let i=this.transformers;return!r&&typeof t==`function`&&(r=t,t=void 0),r?a(void 0,r):new Promise(a);function a(a,o){n(typeof t!=`function`,"`file` can’t be a `done` anymore, we checked");let s=B(t);i.run(e,s,c);function c(t,i,s){let c=i||e;t?o(t):a?a(c):(n(r,"`done` is defined if `resolve` is not"),r(void 0,c,s))}}}runSync(e,t){let r=!1,i;return this.run(e,t,a),z(`runSync`,`run`,r),n(i,`we either bailed on an error or have a tree`),i;function a(e,t){D(e),i=t,r=!0}}stringify(e,t){this.freeze();let n=B(t),r=this.compiler||this.Compiler;return I(`stringify`,r),R(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(L(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,O.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];k(o)&&k(r)&&(r=(0,O.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function F(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function I(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function L(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function R(e){if(!k(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function z(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function B(e){return V(e)?e:new S(e)}function V(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function H(e){return typeof e==`string`||U(e)}function U(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var W=(function(e){if(e==null)return Y;if(typeof e==`function`)return J(e);if(typeof e==`object`)return Array.isArray(e)?G(e):K(e);if(typeof e==`string`)return q(e);throw Error(`Expected function, string, or object as test`)});function G(e){let t=[],n=-1;for(;++n<e.length;)t[n]=W(e[n]);return J(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function K(e){let t=e;return J(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function q(e){return J(t);function t(t){return t&&t.type===e}}function J(e){return t;function t(t,n,r){return!!(X(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Y(){return!0}function X(e){return typeof e==`object`&&!!e&&`type`in e}function Z(e){return e}var Q=[],te=`skip`;function $(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=W(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Z(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Q,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ne(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function ne(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Q:[e]}function re(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),$(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}export{P as a,s as c,W as i,r as l,te as n,E as o,$ as r,S as s,re as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=/[ \t\n\f\r]/g;function t(e){return typeof e==`object`?e.type===`text`&&n(e.value):n(e)}function n(t){return t.replace(e,``)===``}export{t};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var t=e();function n(e){t=e}var r={exec:()=>null};function i(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(a.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var a={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},o=/^(?:[ \t]*(?:\n|$))+/,s=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,c=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,l=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,u=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,d=/(?:[*+-]|\d{1,9}[.)])/,f=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,p=i(f).replace(/bull/g,d).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(),ee=i(f).replace(/bull/g,d).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(),m=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,te=/^[^\n]+/,h=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ne=i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,h).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),re=i(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,d).getRegex(),g=`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`,_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,v=i(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,_).replace(`tag`,g).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y=i(m).replace(`hr`,l).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`,g).getRegex(),b={blockquote:i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,y).getRegex(),code:s,def:ne,fences:c,heading:u,hr:l,html:v,lheading:p,list:re,newline:o,paragraph:y,table:r,text:te},x=i(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,l).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`,g).getRegex(),ie={...b,lheading:ee,table:x,paragraph:i(m).replace(`hr`,l).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,x).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`,g).getRegex()},ae={...b,html:i(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`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(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:i(m).replace(`hr`,l).replace(`heading`,` *#{1,6} *[^
|
|
2
|
+
]`).replace(`lheading`,p).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},S=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,C=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,w=/^( {2,}|\\)\n(?!\s*$)/,oe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,E=/[\s\p{P}\p{S}]/u,D=/[^\s\p{P}\p{S}]/u,se=i(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,E).getRegex(),O=/(?!~)[\p{P}\p{S}]/u,ce=/(?!~)[\s\p{P}\p{S}]/u,le=/(?:[^\s\p{P}\p{S}]|~)/u,ue=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,k=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,de=i(k,`u`).replace(/punct/g,T).getRegex(),fe=i(k,`u`).replace(/punct/g,O).getRegex(),A=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,pe=i(A,`gu`).replace(/notPunctSpace/g,D).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),me=i(A,`gu`).replace(/notPunctSpace/g,le).replace(/punctSpace/g,ce).replace(/punct/g,O).getRegex(),he=i(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,D).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),ge=i(/\\(punct)/,`gu`).replace(/punct/g,T).getRegex(),_e=i(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ve=i(_).replace(`(?:-->|$)`,`-->`).getRegex(),j=i(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,ve).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,N=i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,M).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),P=i(/^!?\[(label)\]\[(ref)\]/).replace(`label`,M).replace(`ref`,h).getRegex(),F=i(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,h).getRegex(),I={_backpedal:r,anyPunctuation:ge,autolink:_e,blockSkip:ue,br:w,code:C,del:r,emStrongLDelim:de,emStrongRDelimAst:pe,emStrongRDelimUnd:he,escape:S,link:N,nolink:F,punctuation:se,reflink:P,reflinkSearch:i(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,P).replace(`nolink`,F).getRegex(),tag:j,text:oe,url:r},ye={...I,link:i(/^!?\[(label)\]\((.*?)\)/).replace(`label`,M).getRegex(),reflink:i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,M).getRegex()},L={...I,emStrongRDelimAst:me,emStrongLDelim:fe,url:i(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},be={...L,br:i(w).replace(`{2,}`,`*`).getRegex(),text:i(L.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},R={normal:b,gfm:ie,pedantic:ae},z={normal:I,gfm:L,breaks:be,pedantic:ye},xe={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},B=e=>xe[e];function V(e,t){if(t){if(a.escapeTest.test(e))return e.replace(a.escapeReplace,B)}else if(a.escapeTestNoEncode.test(e))return e.replace(a.escapeReplaceNoEncode,B);return e}function H(e){try{e=encodeURI(e).replace(a.percentDecode,`%`)}catch{return null}return e}function U(e,t){let n=e.replace(a.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(a.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(a.slashPipe,`|`);return n}function W(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Se(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function G(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Ce(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
4
|
+
`)}var K=class{options;rules;lexer;constructor(e){this.options=e||t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:W(e,`
|
|
5
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Ce(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=W(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:W(t[0],`
|
|
6
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=W(t[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
9
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
11
|
+
${s}`:s,r=r?`${r}
|
|
12
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
13
|
+
`+e.join(`
|
|
14
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
15
|
+
`+e.join(`
|
|
16
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
19
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
20
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
21
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
22
|
+
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
23
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
24
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=U(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
25
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(U(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
26
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=W(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Se(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),G(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return G(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},q=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new K,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:a,block:R.normal,inline:z.normal};this.options.pedantic?(n.block=R.pedantic,n.inline=z.pedantic):this.options.gfm&&(n.block=R.gfm,this.options.breaks?n.inline=z.breaks:n.inline=z.gfm),this.tokenizer.rules=n}static get rules(){return{block:R,inline:z}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(a.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(a.tabCharGlobal,` `).replace(a.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
28
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
29
|
+
`+r.raw,n.text+=`
|
|
30
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
31
|
+
`+r.raw,n.text+=`
|
|
32
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=`
|
|
33
|
+
`+r.raw,a.text+=`
|
|
34
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=`
|
|
35
|
+
`+r.raw,n.text+=`
|
|
36
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a=``;for(;e;){i||(a=``),i=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(a=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},J=class{options;parser;constructor(e){this.options=e||t}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(a.notSpaceStart)?.[0],i=e.replace(a.endingNewline,``)+`
|
|
37
|
+
`;return r?`<pre><code class="language-`+V(r)+`">`+(n?i:V(i,!0))+`</code></pre>
|
|
38
|
+
`:`<pre><code>`+(n?i:V(i,!0))+`</code></pre>
|
|
39
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
40
|
+
${this.parser.parse(e)}</blockquote>
|
|
41
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
42
|
+
`}hr(e){return`<hr>
|
|
43
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
44
|
+
`+r+`</`+i+`>
|
|
45
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+V(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
46
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
47
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
48
|
+
<thead>
|
|
49
|
+
`+t+`</thead>
|
|
50
|
+
`+r+`</table>
|
|
51
|
+
`}tablerow({text:e}){return`<tr>
|
|
52
|
+
${e}</tr>
|
|
53
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
54
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${V(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=H(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+V(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=H(e);if(i===null)return V(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${V(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:V(e.text)}},Y=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},X=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Y}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
55
|
+
`+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Z=class{options;block;constructor(e){this.options=e||t}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?q.lex:q.lexInline}provideParser(){return this.block?X.parse:X.parseInline}},Q=new class{defaults=e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=X;Renderer=J;TextRenderer=Y;Lexer=q;Tokenizer=K;Hooks=Z;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new J(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new K(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Z;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Z.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?q.lex:q.lexInline,s=i.hooks?i.hooks.provideParser():e?X.parse:X.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
56
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+V(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,n($.defaults),$},$.getDefaults=e,$.defaults=t,$.use=function(...e){return Q.use(...e),$.defaults=Q.defaults,n($.defaults),$},$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=X,$.parser=X.parse,$.Renderer=J,$.TextRenderer=Y,$.Lexer=q,$.lexer=q.lex,$.Tokenizer=K,$.Hooks=Z,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,X.parse,q.lex;export{$ as t};
|