@juki-team/base-ui 1.4.128 → 1.4.129
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/esm/{ArrowForwardIcon-Bnn7Iz4G.js → ArrowForwardIcon-IN9agpuQ.js} +1 -1
- package/dist/esm/{BarChart-D5bo7JIL.js → BarChart-BnEygCik.js} +1 -1
- package/dist/esm/{CartesianChart-CobjBy-5.js → CartesianChart-46JvJlt2.js} +1 -1
- package/dist/esm/{ChangePasswordModal-C8I37Lmc.js → ChangePasswordModal-W7o3d5xv.js} +1 -1
- package/dist/esm/{CodeEditor-B6Z_vVNE.js → CodeEditor-btUZu2Dy.js} +1 -1
- package/dist/esm/{DataGrid-EEmJvadS.js → DataGrid-C-1PcbQ9.js} +1 -1
- package/dist/esm/{DataViewer-BnJZ7RG7.js → DataViewer-DdoMfhBT.js} +1 -1
- package/dist/esm/{DrawerView-BYxdlHl8.js → DrawerView-C59g89Qq.js} +1 -1
- package/dist/esm/{ExcalidrawButton-D4U4cBk4.js → ExcalidrawButton-7RauNqcW.js} +1 -1
- package/dist/esm/{GraphvizViewer-CPnICZa2.js → GraphvizViewer-Cdd3s9Pz.js} +1 -1
- package/dist/esm/{ImageLoaderCropper-BogOFrVn.js → ImageLoaderCropper-By7-NpjH.js} +1 -1
- package/dist/esm/{InputCellPhoneNumber-iWeDD6qq.js → InputCellPhoneNumber-BoliLbve.js} +1 -1
- package/dist/esm/{InputColor-B70A4U4T.js → InputColor-B6fjWGPV.js} +1 -1
- package/dist/esm/{LineChart-DLFrUWfp.js → LineChart-yzQzjap8.js} +1 -1
- package/dist/esm/{MdMath-Cu7sz6X4.js → MdMath-DcAukZc5.js} +1 -1
- package/dist/esm/{MdMathEditor-Cld-MqNo.js → MdMathEditor-Ckf7tXlp.js} +2 -2
- package/dist/esm/{Popover-DdOfIlTm.js → Popover-DOgPkWfK.js} +1 -1
- package/dist/esm/{ReplyIcon-DJPfkoNy.js → ReplyIcon-DrZrr78M.js} +1 -1
- package/dist/esm/{SettingsIcon-CInONSNO.js → SettingsIcon-DM1F7UIb.js} +1 -1
- package/dist/esm/{SlideDeck-DNpkU3EW.js → SlideDeck-yImvO_hq.js} +1 -1
- package/dist/esm/{TableOfContents-D09Tl8Li.js → TableOfContents-KP3dhzIR.js} +1 -1
- package/dist/esm/{TextHeadCell-C5VCH0Lf.js → TextHeadCell-CtlRYJ1U.js} +1 -1
- package/dist/esm/{Tooltip-CeUrSz_E.js → Tooltip-CQx5RC2x.js} +1 -1
- package/dist/esm/{UserCodeEditor-DO0kLp8T.js → UserCodeEditor-DVycUyoi.js} +6 -6
- package/dist/esm/{ViewModuleIcon-DuqGYgdz.js → ViewModuleIcon-CBJGd2NB.js} +1 -1
- package/dist/esm/{VirtualizedRowsFixed-hIujSeOl.js → VirtualizedRowsFixed-CJRctik-.js} +1 -1
- package/dist/esm/{WorksheetAsSlides-BTbKEOuB.js → WorksheetAsSlides-33duB_50.js} +1 -1
- package/dist/esm/{WorksheetBodies-CyXJo3pU.js → WorksheetBodies-Ptk1_moK.js} +1 -1
- package/dist/esm/{WorksheetContents-Cosj3MBk.js → WorksheetContents-WKXb5Uk4.js} +1 -1
- package/dist/esm/{WorksheetEditor-dQ3FmK6E.js → WorksheetEditor-z9ucL22I.js} +1 -1
- package/dist/esm/{WorksheetNode-BRplV701.js → WorksheetNode-DdlERlmz.js} +1 -1
- package/dist/esm/{WorksheetViewer-B-RX22Je.js → WorksheetViewer-C8lplKFc.js} +1 -1
- package/dist/esm/{architectureDiagram-3BPJPVTR-GHdKy6q4.js → architectureDiagram-3BPJPVTR-mkUe-O1b.js} +1 -1
- package/dist/esm/{blockDiagram-GPEHLZMM-BsKkASna.js → blockDiagram-GPEHLZMM-DI6f452i.js} +1 -1
- package/dist/esm/{c4Diagram-AAUBKEIU-BubfHfIS.js → c4Diagram-AAUBKEIU-CprJ4eDK.js} +1 -1
- package/dist/esm/channel-B3QafhkE.js +1 -0
- package/dist/esm/{chunk-2J33WTMH-DQLkwr3H.js → chunk-2J33WTMH-CRrW12Q1.js} +1 -1
- package/dist/esm/{chunk-4BX2VUAB-CtK595Al.js → chunk-4BX2VUAB-DP1enpjM.js} +1 -1
- package/dist/esm/{chunk-55IACEB6-DA8sagOJ.js → chunk-55IACEB6-Qy7BShb8.js} +1 -1
- package/dist/esm/{chunk-727SXJPM-B6XP9Ejn.js → chunk-727SXJPM-DCaL4Ssn.js} +1 -1
- package/dist/esm/{chunk-AQP2D5EJ-BGXJS1L5.js → chunk-AQP2D5EJ-MvQ9vOa8.js} +1 -1
- package/dist/esm/{chunk-FMBD7UC4-DETYmnuw.js → chunk-FMBD7UC4-C_QBV__I.js} +1 -1
- package/dist/esm/{chunk-ND2GUHAM-cVaSk2c2.js → chunk-ND2GUHAM-Cz6MG9Ip.js} +1 -1
- package/dist/esm/{chunk-QZHKN3VN-pybgO0OQ.js → chunk-QZHKN3VN-CNeKC3i9.js} +1 -1
- package/dist/esm/{classDiagram-4FO5ZUOK-DAj9h4b_.js → classDiagram-4FO5ZUOK-CIl1HCsD.js} +1 -1
- package/dist/esm/{classDiagram-v2-Q7XG4LA2-DAj9h4b_.js → classDiagram-v2-Q7XG4LA2-CIl1HCsD.js} +1 -1
- package/dist/esm/{contest-aDQIqOJe.js → contest--aeYKKxf.js} +1 -1
- package/dist/esm/{cose-bilkent-S5V4N54A-Byki9rDQ.js → cose-bilkent-S5V4N54A-BU_DfNnH.js} +1 -1
- package/dist/esm/{dagre-BM42HDAG-DGcCaZtB.js → dagre-BM42HDAG-B0jhlami.js} +1 -1
- package/dist/esm/{diagram-2AECGRRQ-DxkVrRtM.js → diagram-2AECGRRQ-BoG6bCz0.js} +1 -1
- package/dist/esm/{diagram-5GNKFQAL-CI68cFUB.js → diagram-5GNKFQAL-CmPEF4Gb.js} +1 -1
- package/dist/esm/{diagram-KO2AKTUF-DeOvpWNz.js → diagram-KO2AKTUF-otFu6fY1.js} +1 -1
- package/dist/esm/{diagram-LMA3HP47-B3k-krze.js → diagram-LMA3HP47-BNvQPERF.js} +1 -1
- package/dist/esm/{diagram-OG6HWLK6-DF1a3R9r.js → diagram-OG6HWLK6-GT5ck18c.js} +1 -1
- package/dist/esm/{erDiagram-TEJ5UH35-D8tsDNJs.js → erDiagram-TEJ5UH35-DOTojUvv.js} +1 -1
- package/dist/esm/{flowDiagram-I6XJVG4X-BI4wwmRU.js → flowDiagram-I6XJVG4X-DMNWQIoP.js} +1 -1
- package/dist/esm/{ganttDiagram-6RSMTGT7-mtZrSAvl.js → ganttDiagram-6RSMTGT7-UueSCT2P.js} +1 -1
- package/dist/esm/{gitGraphDiagram-PVQCEYII-DjcI8VAu.js → gitGraphDiagram-PVQCEYII-BMejzE3B.js} +1 -1
- package/dist/esm/helpers.js +1 -1
- package/dist/esm/{index-8lCMBwuC.js → index-2vw3cISu.js} +1 -1
- package/dist/esm/{index-CYbDO0-3.js → index-CCC14puG.js} +1 -1
- package/dist/esm/{index-CMnRWttz.js → index-CWWVtFL-.js} +1 -1
- package/dist/esm/{index-DMMK2jqZ.js → index-C_iDYl6D.js} +1 -1
- package/dist/esm/{index-DRfZVlOJ.js → index-CroDROK5.js} +1 -1
- package/dist/esm/{index-BGlnGvON.js → index-MXDpbG5L.js} +1 -1
- package/dist/esm/index-P3Cb0cjc.js +1 -0
- package/dist/esm/index-mPuca8dy.js +1 -0
- package/dist/esm/{infoDiagram-5YYISTIA-Bh8b-n4b.js → infoDiagram-5YYISTIA-BSxjrZJf.js} +1 -1
- package/dist/esm/{ishikawaDiagram-YF4QCWOH-B7Ef_815.js → ishikawaDiagram-YF4QCWOH-B2-9liDF.js} +1 -1
- package/dist/esm/{journeyDiagram-JHISSGLW-BJmVcYZK.js → journeyDiagram-JHISSGLW-DBQd4ic_.js} +1 -1
- package/dist/esm/{kanban-definition-UN3LZRKU-mFRkclho.js → kanban-definition-UN3LZRKU-DFolGaRv.js} +1 -1
- package/dist/esm/main.js +1 -1
- package/dist/esm/{mermaid.core-S6eGK7_m.js → mermaid.core-EsBL2ECN.js} +1 -1
- package/dist/esm/{mindmap-definition-RKZ34NQL-CKmS7PO4.js → mindmap-definition-RKZ34NQL-BIQZzlCy.js} +1 -1
- package/dist/esm/{pieDiagram-4H26LBE5-DRY8BTZd.js → pieDiagram-4H26LBE5-DZBAcvRC.js} +1 -1
- package/dist/esm/{quadrantDiagram-W4KKPZXB-BZghqn__.js → quadrantDiagram-W4KKPZXB-b5MVV3Rk.js} +1 -1
- package/dist/esm/{requirementDiagram-4Y6WPE33-BU3Hxtyb.js → requirementDiagram-4Y6WPE33-CLn9X-PZ.js} +1 -1
- package/dist/esm/{sankeyDiagram-5OEKKPKP-Cxm2hiMr.js → sankeyDiagram-5OEKKPKP-D4-b_g7U.js} +1 -1
- package/dist/esm/{sequenceDiagram-3UESZ5HK-BZMNpJbY.js → sequenceDiagram-3UESZ5HK-CCdY9Q3W.js} +1 -1
- package/dist/esm/server.js +1 -1
- package/dist/esm/settings.js +1 -1
- package/dist/esm/{stateDiagram-AJRCARHV-BgX0EzoX.js → stateDiagram-AJRCARHV-BSMAHoem.js} +1 -1
- package/dist/esm/{stateDiagram-v2-BHNVJYJU-StaZwSoO.js → stateDiagram-v2-BHNVJYJU-BeJ_O1Tl.js} +1 -1
- package/dist/esm/{timeline-definition-PNZ67QCA-gdRLr8en.js → timeline-definition-PNZ67QCA-o-UlOwfU.js} +1 -1
- package/dist/esm/{types-D3os_Tiq.js → types-TNt9NcVE.js} +1 -1
- package/dist/esm/{vennDiagram-CIIHVFJN-DOAjj0rn.js → vennDiagram-CIIHVFJN-CySj1ueN.js} +1 -1
- package/dist/esm/{wardleyDiagram-YWT4CUSO-IZo-xpbz.js → wardleyDiagram-YWT4CUSO-B7YSHlE3.js} +1 -1
- package/dist/esm/{xychartDiagram-2RQKCTM6-DQUY0LiW.js → xychartDiagram-2RQKCTM6-D6EqpoC5.js} +1 -1
- package/dist/module-types/src/components/atoms/server/icons/specials/types.d.ts +5 -6
- package/dist/module-types/src/settings/ApiManager.d.ts +164 -41
- package/package.json +2 -2
- package/src/vendor/fumadocs-ui/css/generated/docs.css +2 -0
- package/src/vendor/fumadocs-ui/css/generated/flux.css +1 -0
- package/src/vendor/fumadocs-ui/css/generated/notebook.css +2 -0
- package/src/vendor/fumadocs-ui/css/preset.css +0 -1
- package/dist/esm/channel-Bz5Urkbc.js +0 -1
- package/dist/esm/index-CZeOFoty.js +0 -1
- package/dist/esm/index-CcKNCy1-.js +0 -1
- package/dist/module-types/src/components/mockup/index.d.ts +0 -4
- package/dist/module-types/src/components/molecules/TabsInline/TabsInline.deprecated.d.ts +0 -2
- package/dist/module-types/src/components/molecules/TabsInlineBody/TabsInlineBody.deprecated.d.ts +0 -2
- package/dist/module-types/src/components/organisms/PresentationToolButtons/buttons/Pencil.deprecated.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/MdMathEditor.tiptap.deprecated.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/TiptapEditorContent.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/BlockImage.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/ClearMarksOnEnter.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/CurrentNodeHighlighter.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/CustomCodeBlockLowlight.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/CustomLink.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/SmartHeadingBackspace.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/SmartPasteMarkdown.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/index.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/CodeEditorSheetSection/CodeEditorSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/GraphSheetSection/GraphSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/JkmdSheetSection/JkmdSheetSection.old.d.ts +0 -6
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/JkmdSheetSection/JkmdSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/ListSheetSection/ListSheetRecursiveSection.d.ts +0 -9
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/ListSheetSection/ListSheetSection.d.ts +0 -7
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/ListSheetSection/index.d.ts +0 -1
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizOptionsSheetSection/QuizOptionsSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizProblemSheetSection/QuizProblemSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizProblemSheetSection/QuizProblemSheetSectionEditorModal.old.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizProblemSheetSection/QuizProblemSheetSectionView.old.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/UpRemoveDownButtons.d.ts +0 -7
- package/dist/module-types/src/components/providers/JukiPageInitializer/useMouseInsidePage.d.ts +0 -1
- package/dist/module-types/src/components/templates/MainMenu/DrawerViewMenuMobile/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bS as e}from"./index-BGlnGvON.js";import{c as n,D as t,g as l,E as o,o as r,S as a}from"./types-D3os_Tiq.js";function i(e){const n=[],t=String(e||"");let l=t.indexOf(","),o=0,r=!1;for(;!r;){-1===l&&(l=t.length,r=!0);const e=t.slice(o,l).trim();!e&&r||n.push(e),o=l+1,l=t.indexOf(",",o)}return n}function u(e,n){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}const s=/[$_\p{ID_Start}]/u,c=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,p=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,f=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h={};function g(e){return!!e&&s.test(String.fromCodePoint(e))}function m(e,n){const t=(n||h).jsx?p:c;return!!e&&t.test(String.fromCodePoint(e))}function y(e,n){return((n||h).jsx?d:f).test(e)}const v=/[ \t\n\f\r]/g;function b(e){return"object"==typeof e?"text"===e.type&&w(e.value):w(e)}function w(e){return""===e.replace(v,"")}class x{constructor(e,n,t){this.normal=n,this.property=e,t&&(this.space=t)}}function k(e,n){const t={},l={};for(const n of e)Object.assign(t,n.property),Object.assign(l,n.normal);return new x(t,l,n)}function C(e){return e.toLowerCase()}x.prototype.normal={},x.prototype.property={},x.prototype.space=void 0;class S{constructor(e,n){this.attribute=n,this.property=e}}S.prototype.attribute="",S.prototype.booleanish=!1,S.prototype.boolean=!1,S.prototype.commaOrSpaceSeparated=!1,S.prototype.commaSeparated=!1,S.prototype.defined=!1,S.prototype.mustUseProperty=!1,S.prototype.number=!1,S.prototype.overloadedBoolean=!1,S.prototype.property="",S.prototype.spaceSeparated=!1,S.prototype.space=void 0;let D=0;const A=T(),N=T(),L=T(),O=T(),P=T(),M=T(),R=T();function T(){return 2**++D}var E=Object.freeze({__proto__:null,boolean:A,booleanish:N,commaOrSpaceSeparated:R,commaSeparated:M,number:O,overloadedBoolean:L,spaceSeparated:P});const I=Object.keys(E);class B extends S{constructor(e,n,t,l){let o=-1;if(super(e,n),U(this,"space",l),"number"==typeof t)for(;++o<I.length;){const e=I[o];U(this,I[o],(t&E[e])===E[e])}}}function U(e,n,t){t&&(e[n]=t)}function j(e){const n={},t={};for(const[l,o]of Object.entries(e.properties)){const r=new B(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(r.mustUseProperty=!0),n[l]=r,t[C(l)]=l,t[C(r.attribute)]=l}return new x(n,t,e.space)}B.prototype.defined=!0;const z=j({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:O,ariaColIndex:O,ariaColSpan:O,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:N,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:P,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:O,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:O,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:P,ariaRowCount:O,ariaRowIndex:O,ariaRowSpan:O,ariaSelected:N,ariaSetSize:O,ariaSort:null,ariaValueMax:O,ariaValueMin:O,ariaValueNow:O,ariaValueText:null,role:null},transform:(e,n)=>"role"===n?n:"aria-"+n.slice(4).toLowerCase()});function F(e,n){return n in e?e[n]:n}function _(e,n){return F(e,n.toLowerCase())}const H=j({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:M,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:A,allowPaymentRequest:A,allowUserMedia:A,alt:null,as:null,async:A,autoCapitalize:null,autoComplete:P,autoFocus:A,autoPlay:A,blocking:P,capture:null,charSet:null,checked:A,cite:null,className:P,cols:O,colSpan:null,content:null,contentEditable:N,controls:A,controlsList:P,coords:O|M,crossOrigin:null,data:null,dateTime:null,decoding:null,default:A,defer:A,dir:null,dirName:null,disabled:A,download:L,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:A,formTarget:null,headers:P,height:O,hidden:L,high:O,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:A,inputMode:null,integrity:null,is:null,isMap:A,itemId:null,itemProp:P,itemRef:P,itemScope:A,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:A,low:O,manifest:null,max:null,maxLength:O,media:null,method:null,min:null,minLength:O,multiple:A,muted:A,name:null,nonce:null,noModule:A,noValidate:A,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:A,optimum:O,pattern:null,ping:P,placeholder:null,playsInline:A,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:A,referrerPolicy:null,rel:P,required:A,reversed:A,rows:O,rowSpan:O,sandbox:P,scope:null,scoped:A,seamless:A,selected:A,shadowRootClonable:A,shadowRootDelegatesFocus:A,shadowRootMode:null,shape:null,size:O,sizes:null,slot:null,span:O,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:O,step:null,style:null,tabIndex:O,target:null,title:null,translate:null,type:null,typeMustMatch:A,useMap:null,value:N,width:O,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:O,borderColor:null,bottomMargin:O,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:A,declare:A,event:null,face:null,frame:null,frameBorder:null,hSpace:O,leftMargin:O,link:null,longDesc:null,lowSrc:null,marginHeight:O,marginWidth:O,noResize:A,noHref:A,noShade:A,noWrap:A,object:null,profile:null,prompt:null,rev:null,rightMargin:O,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:O,valueType:null,version:null,vAlign:null,vLink:null,vSpace:O,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:A,disableRemotePlayback:A,prefix:null,property:null,results:O,security:null,unselectable:null},space:"html",transform:_}),V=j({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:R,accentHeight:O,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:O,amplitude:O,arabicForm:null,ascent:O,attributeName:null,attributeType:null,azimuth:O,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:O,by:null,calcMode:null,capHeight:O,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:O,diffuseConstant:O,direction:null,display:null,dur:null,divisor:O,dominantBaseline:null,download:A,dx:null,dy:null,edgeMode:null,editable:null,elevation:O,enableBackground:null,end:null,event:null,exponent:O,externalResourcesRequired:null,fill:null,fillOpacity:O,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:M,g2:M,glyphName:M,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:O,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:O,horizOriginX:O,horizOriginY:O,id:null,ideographic:O,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:O,k:O,k1:O,k2:O,k3:O,k4:O,kernelMatrix:R,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:O,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:O,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:O,overlineThickness:O,paintOrder:null,panose1:null,path:null,pathLength:O,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:O,pointsAtY:O,pointsAtZ:O,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:R,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:R,rev:R,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:R,requiredFeatures:R,requiredFonts:R,requiredFormats:R,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:O,specularExponent:O,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:O,strikethroughThickness:O,string:null,stroke:null,strokeDashArray:R,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:O,strokeOpacity:O,strokeWidth:null,style:null,surfaceScale:O,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:R,tabIndex:O,tableValues:null,target:null,targetX:O,targetY:O,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:R,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:O,underlineThickness:O,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:O,values:null,vAlphabetic:O,vMathematical:O,vectorEffect:null,vHanging:O,vIdeographic:O,version:null,vertAdvY:O,vertOriginX:O,vertOriginY:O,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:O,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F}),q=j({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,n)=>"xlink:"+n.slice(5).toLowerCase()}),W=j({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_}),X=j({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,n)=>"xml:"+n.slice(3).toLowerCase()}),$={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},K=/[A-Z]/g,Y=/-[a-z]/g,G=/^data[-\w.:]+$/i;function Z(e,n){const t=C(n);let l=n,o=S;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&"data"===t.slice(0,4)&&G.test(n)){if("-"===n.charAt(4)){const e=n.slice(5).replace(Y,Q);l="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=n.slice(4);if(!Y.test(e)){let t=e.replace(K,J);"-"!==t.charAt(0)&&(t="-"+t),n="data"+t}}o=B}return new o(l,n)}function J(e){return"-"+e.toLowerCase()}function Q(e){return e.charAt(1).toUpperCase()}const ee=k([z,H,q,W,X],"html"),ne=k([z,V,q,W,X],"svg");function te(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function le(e){return e.join(" ").trim()}var oe,re,ae,ie={};function ue(){if(ae)return ie;ae=1;var e=ie&&ie.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=function(e,t){let l=null;if(!e||"string"!=typeof e)return l;const o=(0,n.default)(e),r="function"==typeof t;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:n,value:o}=e;r?t(n,o,e):o&&(l=l||{},l[n]=o)}),l};const n=e(function(){if(re)return oe;re=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,i=/^\s+|\s+$/g,u="";function s(e){return e?e.replace(i,u):u}return oe=function(i,c){if("string"!=typeof i)throw new TypeError("First argument must be a string");if(!i)return[];c=c||{};var p=1,f=1;function d(e){var t=e.match(n);t&&(p+=t.length);var l=e.lastIndexOf("\n");f=~l?e.length-l:f+e.length}function h(){var e={line:p,column:f};return function(n){return n.position=new g(e),v(),n}}function g(e){this.start=e,this.end={line:p,column:f},this.source=c.source}function m(e){var n=new Error(c.source+":"+p+":"+f+": "+e);if(n.reason=e,n.filename=c.source,n.line=p,n.column=f,n.source=i,!c.silent)throw n}function y(e){var n=e.exec(i);if(n){var t=n[0];return d(t),i=i.slice(t.length),n}}function v(){y(t)}function b(e){var n;for(e=e||[];n=w();)!1!==n&&e.push(n);return e}function w(){var e=h();if("/"==i.charAt(0)&&"*"==i.charAt(1)){for(var n=2;u!=i.charAt(n)&&("*"!=i.charAt(n)||"/"!=i.charAt(n+1));)++n;if(n+=2,u===i.charAt(n-1))return m("End of comment missing");var t=i.slice(2,n-2);return f+=2,d(t),i=i.slice(n),f+=2,e({type:"comment",comment:t})}}function x(){var n=h(),t=y(l);if(t){if(w(),!y(o))return m("property missing ':'");var i=y(r),c=n({type:"declaration",property:s(t[0].replace(e,u)),value:i?s(i[0].replace(e,u)):u});return y(a),c}}return g.prototype.content=i,v(),function(){var e,n=[];for(b(n);e=x();)!1!==e&&(n.push(e),b(n));return n}()},oe}());return ie}var se,ce,pe,fe={};function de(){if(se)return fe;se=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,r=function(e,n){return n.toUpperCase()},a=function(e,n){return"".concat(n,"-")};return fe.camelCase=function(i,u){return void 0===u&&(u={}),function(n){return!n||t.test(n)||e.test(n)}(i)?i:(i=i.toLowerCase(),(i=u.reactCompat?i.replace(o,a):i.replace(l,a)).replace(n,r))},fe}var he=function(){if(pe)return ce;pe=1;var e=(ce&&ce.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ue()),n=de();function t(t,l){var o={};return t&&"string"==typeof t?((0,e.default)(t,function(e,t){e&&t&&(o[(0,n.camelCase)(e,l)]=t)}),o):o}return t.default=t,ce=t}(),ge=e(he);const me=ve("end"),ye=ve("start");function ve(e){return function(n){const t=n&&n.position&&n.position[e]||{};if("number"==typeof t.line&&t.line>0&&"number"==typeof t.column&&t.column>0)return{line:t.line,column:t.column,offset:"number"==typeof t.offset&&t.offset>-1?t.offset:void 0}}}function be(e){const n=ye(e),t=me(e);if(n&&t)return{start:n,end:t}}function we(e){const t=[];let l=-1,o=0,r=0;for(;++l<e.length;){const a=e.charCodeAt(l);let i="";if(37===a&&n(e.charCodeAt(l+1))&&n(e.charCodeAt(l+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const n=e.charCodeAt(l+1);a<56320&&n>56319&&n<57344?(i=String.fromCharCode(a,n),r=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(o,l),encodeURIComponent(i)),o=l+r+1,i=""),r&&(l+=r,r=0)}return t.join("")+e.slice(o)}function xe(e,n){const t=n.referenceType;let l="]";if("collapsed"===t?l+="[]":"full"===t&&(l+="["+(n.label||n.identifier)+"]"),"imageReference"===n.type)return[{type:"text",value:"!["+n.alt+l}];const o=e.all(n),r=o[0];r&&"text"===r.type?r.value="["+r.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=l:o.push({type:"text",value:l}),o}function ke(e){const n=e.spread;return null==n?e.children.length>1:n}function Ce(e){const n=String(e),t=/\r?\n|\r/g;let l=t.exec(n),o=0;const r=[];for(;l;)r.push(Se(n.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=t.exec(n);return r.push(Se(n.slice(o),o>0,!1)),r.join("")}function Se(e,n,t){let l=0,o=e.length;if(n){let n=e.codePointAt(l);for(;9===n||32===n;)l++,n=e.codePointAt(l)}if(t){let n=e.codePointAt(o-1);for(;9===n||32===n;)o--,n=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}const De={blockquote:function(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)},break:function(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:"\n"}]},code:function(e,n){const t=n.value?n.value+"\n":"",l={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let r={type:"element",tagName:"code",properties:l,children:[{type:"text",value:t}]};return n.meta&&(r.data={meta:n.meta}),e.patch(n,r),r=e.applyData(n,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(n,r),r},delete:function(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},emphasis:function(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},footnoteReference:function(e,n){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),o=we(l.toLowerCase()),r=e.footnoteOrder.indexOf(l);let a,i=e.footnoteCounts.get(l);void 0===i?(i=0,e.footnoteOrder.push(l),a=e.footnoteOrder.length):a=r+1,i+=1,e.footnoteCounts.set(l,i);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+o,id:t+"fnref-"+o+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,u);const s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,s),e.applyData(n,s)},heading:function(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},html:function(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}},imageReference:function(e,n){const t=String(n.identifier).toUpperCase(),l=e.definitionById.get(t);if(!l)return xe(e,n);const o={src:we(l.url||""),alt:n.alt};null!==l.title&&void 0!==l.title&&(o.title=l.title);const r={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,r),e.applyData(n,r)},image:function(e,n){const t={src:we(n.url)};null!==n.alt&&void 0!==n.alt&&(t.alt=n.alt),null!==n.title&&void 0!==n.title&&(t.title=n.title);const l={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,l),e.applyData(n,l)},inlineCode:function(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const l={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,l),e.applyData(n,l)},linkReference:function(e,n){const t=String(n.identifier).toUpperCase(),l=e.definitionById.get(t);if(!l)return xe(e,n);const o={href:we(l.url||"")};null!==l.title&&void 0!==l.title&&(o.title=l.title);const r={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)},link:function(e,n){const t={href:we(n.url)};null!==n.title&&void 0!==n.title&&(t.title=n.title);const l={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)},listItem:function(e,n,t){const l=e.all(n),o=t?function(e){let n=!1;if("list"===e.type){n=e.spread||!1;const t=e.children;let l=-1;for(;!n&&++l<t.length;)n=ke(t[l])}return n}(t):ke(n),r={},a=[];if("boolean"==typeof n.checked){const e=l[0];let t;e&&"element"===e.type&&"p"===e.tagName?t=e:(t={type:"element",tagName:"p",properties:{},children:[]},l.unshift(t)),t.children.length>0&&t.children.unshift({type:"text",value:" "}),t.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let i=-1;for(;++i<l.length;){const e=l[i];(o||0!==i||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const u=l[l.length-1];u&&(o||"element"!==u.type||"p"!==u.tagName)&&a.push({type:"text",value:"\n"});const s={type:"element",tagName:"li",properties:r,children:a};return e.patch(n,s),e.applyData(n,s)},list:function(e,n){const t={},l=e.all(n);let o=-1;for("number"==typeof n.start&&1!==n.start&&(t.start=n.start);++o<l.length;){const e=l[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const r={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(l,!0)};return e.patch(n,r),e.applyData(n,r)},paragraph:function(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},root:function(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)},strong:function(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},table:function(e,n){const t=e.all(n),l=t.shift(),o=[];if(l){const t={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],t),o.push(t)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},r=ye(n.children[1]),a=me(n.children[n.children.length-1]);r&&a&&(l.position={start:r,end:a}),o.push(l)}const r={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,r),e.applyData(n,r)},tableCell:function(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},tableRow:function(e,n,t){const l=t?t.children:void 0,o=0===(l?l.indexOf(n):1)?"th":"td",r=t&&"table"===t.type?t.align:void 0,a=r?r.length:n.children.length;let i=-1;const u=[];for(;++i<a;){const t=n.children[i],l={},a=r?r[i]:void 0;a&&(l.align=a);let s={type:"element",tagName:o,properties:l,children:[]};t&&(s.children=e.all(t),e.patch(t,s),s=e.applyData(t,s)),u.push(s)}const s={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,s),e.applyData(n,s)},text:function(e,n){const t={type:"text",value:Ce(String(n.value))};return e.patch(n,t),e.applyData(n,t)},thematicBreak:function(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)},toml:Ae,yaml:Ae,definition:Ae,footnoteDefinition:Ae};function Ae(){}const Ne="object"==typeof self?self:globalThis,Le=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ne[e](n)},Oe=e=>((e,n)=>{const t=(n,t)=>(e.set(t,n),n),l=o=>{if(e.has(o))return e.get(o);const[r,a]=n[o];switch(r){case 0:case-1:return t(a,o);case 1:{const e=t([],o);for(const n of a)e.push(l(n));return e}case 2:{const e=t({},o);for(const[n,t]of a)e[l(n)]=l(t);return e}case 3:return t(new Date(a),o);case 4:{const{source:e,flags:n}=a;return t(new RegExp(e,n),o)}case 5:{const e=t(new Map,o);for(const[n,t]of a)e.set(l(n),l(t));return e}case 6:{const e=t(new Set,o);for(const n of a)e.add(l(n));return e}case 7:{const{name:e,message:n}=a;return t(Le(e,n),o)}case 8:return t(BigInt(a),o);case"BigInt":return t(Object(BigInt(a)),o);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return t(new DataView(e),a)}}return t(Le(r,a),o)};return l})(new Map,e)(0),Pe="",{toString:Me}={},{keys:Re}=Object,Te=e=>{const n=typeof e;if("object"!==n||!e)return[0,n];const t=Me.call(e).slice(8,-1);switch(t){case"Array":return[1,Pe];case"Object":return[2,Pe];case"Date":return[3,Pe];case"RegExp":return[4,Pe];case"Map":return[5,Pe];case"Set":return[6,Pe];case"DataView":return[1,t]}return t.includes("Array")?[1,t]:t.includes("Error")?[7,t]:[2,t]},Ee=([e,n])=>0===e&&("function"===n||"symbol"===n),Ie=(e,{json:n,lossy:t}={})=>{const l=[];return((e,n,t,l)=>{const o=(e,n)=>{const o=l.push(e)-1;return t.set(n,o),o},r=l=>{if(t.has(l))return t.get(l);let[a,i]=Te(l);switch(a){case 0:{let n=l;switch(i){case"bigint":a=8,n=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+i);n=null;break;case"undefined":return o([-1],l)}return o([a,n],l)}case 1:{if(i){let e=l;return"DataView"===i?e=new Uint8Array(l.buffer):"ArrayBuffer"===i&&(e=new Uint8Array(l)),o([i,[...e]],l)}const e=[],n=o([a,e],l);for(const n of l)e.push(r(n));return n}case 2:{if(i)switch(i){case"BigInt":return o([i,l.toString()],l);case"Boolean":case"Number":case"String":return o([i,l.valueOf()],l)}if(n&&"toJSON"in l)return r(l.toJSON());const t=[],u=o([a,t],l);for(const n of Re(l))!e&&Ee(Te(l[n]))||t.push([r(n),r(l[n])]);return u}case 3:return o([a,l.toISOString()],l);case 4:{const{source:e,flags:n}=l;return o([a,{source:e,flags:n}],l)}case 5:{const n=[],t=o([a,n],l);for(const[t,o]of l)(e||!Ee(Te(t))&&!Ee(Te(o)))&&n.push([r(t),r(o)]);return t}case 6:{const n=[],t=o([a,n],l);for(const t of l)!e&&Ee(Te(t))||n.push(r(t));return t}}const{message:u}=l;return o([a,{name:i,message:u}],l)};return r})(!(n||t),!!n,new Map,l)(e),l};var Be="function"==typeof structuredClone?(e,n)=>n&&("json"in n||"lossy"in n)?Oe(Ie(e,n)):structuredClone(e):(e,n)=>Oe(Ie(e,n));function Ue(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function je(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}const ze={}.hasOwnProperty,Fe={};function _e(e,n){e.position&&(n.position=be(e))}function He(e,n){let t=n;if(e&&e.data){const n=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if("string"==typeof n)if("element"===t.type)t.tagName=n;else{t={type:"element",tagName:n,properties:{},children:"children"in t?t.children:[t]}}"element"===t.type&&o&&Object.assign(t.properties,Be(o)),"children"in t&&t.children&&null!=l&&(t.children=l)}return t}function Ve(e,n){const t=n.data||{},l=!("value"in n)||ze.call(t,"hProperties")||ze.call(t,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(n)}:{type:"text",value:n.value};return e.patch(n,l),e.applyData(n,l)}function qe(e,n){const t=[];let l=-1;for(n&&t.push({type:"text",value:"\n"});++l<e.length;)l&&t.push({type:"text",value:"\n"}),t.push(e[l]);return n&&e.length>0&&t.push({type:"text",value:"\n"}),t}function We(e){let n=0,t=e.charCodeAt(n);for(;9===t||32===t;)n++,t=e.charCodeAt(n);return e.slice(n)}function Xe(e,n){const l=function(e,n){const l=n||Fe,o=new Map,r=new Map,a=new Map,i={...De,...l.handlers},u={all:function(e){const n=[];if("children"in e){const t=e.children;let l=-1;for(;++l<t.length;){const o=u.one(t[l],e);if(o){if(l&&"break"===t[l-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=We(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=We(e.value))}Array.isArray(o)?n.push(...o):n.push(o)}}}return n},applyData:He,definitionById:o,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:i,one:function(e,n){const t=e.type,l=u.handlers[t];if(ze.call(u.handlers,t)&&l)return l(u,e,n);if(u.options.passThrough&&u.options.passThrough.includes(t)){if("children"in e){const{children:n,...t}=e,l=Be(t);return l.children=u.all(e),l}return Be(e)}return(u.options.unknownHandler||Ve)(u,e,n)},options:l,patch:_e,wrap:qe};return t(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const n="definition"===e.type?o:r,t=String(e.identifier).toUpperCase();n.has(t)||n.set(t,e)}}),u}(e,n),o=l.one(e,void 0),r=function(e){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Ue,l=e.options.footnoteBackLabel||je,o=e.options.footnoteLabel||"Footnotes",r=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[];let u=-1;for(;++u<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[u]);if(!o)continue;const r=e.all(o),a=String(o.identifier).toUpperCase(),s=we(a.toLowerCase());let c=0;const p=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++c<=f;){p.length>0&&p.push({type:"text",value:" "});let e="string"==typeof t?t:t(u,c);"string"==typeof e&&(e={type:"text",value:e}),p.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof l?l:l(u,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const d=r[r.length-1];if(d&&"element"===d.type&&"p"===d.tagName){const e=d.children[d.children.length-1];e&&"text"===e.type?e.value+=" ":d.children.push({type:"text",value:" "}),d.children.push(...p)}else r.push(...p);const h={type:"element",tagName:"li",properties:{id:n+"fn-"+s},children:e.wrap(r,!0)};e.patch(o,h),i.push(h)}if(0!==i.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...Be(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:"\n"}]}}(l),a=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return r&&a.children.push({type:"text",value:"\n"},r),a}function $e(e,n){return e&&"run"in e?async function(t,l){const o=Xe(t,{file:l,...n});await e.run(o,l)}:function(t,l){return Xe(t,{file:l,...e||n})}}const Ke=/[#.]/g;function Ye(e,n,t){const l=t?function(e){const n=new Map;for(const t of e)n.set(t.toLowerCase(),t);return n}(t):void 0;return function(t,o,...r){let a;if(null==t){a={type:"root",children:[]};const e=o;r.unshift(e)}else{a=function(e,n){const t=e||"",l={};let o,r,a=0;for(;a<t.length;){Ke.lastIndex=a;const e=Ke.exec(t),n=t.slice(a,e?e.index:t.length);n&&(o?"#"===o?l.id=n:Array.isArray(l.className)?l.className.push(n):l.className=[n]:r=n,a+=n.length),e&&(o=e[0],a++)}return{type:"element",tagName:r||n||"div",properties:l,children:[]}}(t,n);const i=a.tagName.toLowerCase(),u=l?l.get(i):void 0;if(a.tagName=u||i,function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!0;if("string"!=typeof e.type)return!1;const n=e,t=Object.keys(e);for(const e of t){const t=n[e];if(t&&"object"==typeof t){if(!Array.isArray(t))return!0;const e=t;for(const n of e)if("number"!=typeof n&&"string"!=typeof n)return!0}}if("children"in e&&Array.isArray(e.children))return!0;return!1}(o))r.unshift(o);else for(const[n,t]of Object.entries(o))Ge(e,a.properties,n,t)}for(const e of r)Ze(a.children,e);return"element"===a.type&&"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]),a}}function Ge(e,n,t,l){const o=Z(e,t);let r;if(null!=l){if("number"==typeof l){if(Number.isNaN(l))return;r=l}else r="boolean"==typeof l?l:"string"==typeof l?o.spaceSeparated?te(l):o.commaSeparated?i(l):o.commaOrSpaceSeparated?te(i(l).join(" ")):Je(o,o.property,l):Array.isArray(l)?[...l]:"style"===o.property?function(e){const n=[];for(const[t,l]of Object.entries(e))n.push([t,l].join(": "));return n.join("; ")}(l):String(l);if(Array.isArray(r)){const e=[];for(const n of r)e.push(Je(o,o.property,n));r=e}"className"===o.property&&Array.isArray(n.className)&&(r=n.className.concat(r)),n[o.property]=r}}function Ze(e,n){if(null==n);else if("number"==typeof n||"string"==typeof n)e.push({type:"text",value:String(n)});else if(Array.isArray(n))for(const t of n)Ze(e,t);else{if("object"!=typeof n||!("type"in n))throw new Error("Expected node, nodes, or string, got `"+n+"`");"root"===n.type?Ze(e,n.children):e.push(n)}}function Je(e,n,t){if("string"==typeof t){if(e.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((e.boolean||e.overloadedBoolean)&&(""===t||C(t)===C(n)))return!0}return t}const Qe=Ye(ee,"div"),en=Ye(ne,"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"]),nn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tn(e,n){const t=function(e,n){switch(e.nodeType){case 1:return function(e,n){const t=e.namespaceURI,l=t===nn.svg?en:Qe,o=t===nn.html?e.tagName.toLowerCase():e.tagName,r=t===nn.html&&"template"===o?e.content:e,a=e.getAttributeNames(),i={};let u=-1;for(;++u<a.length;)i[a[u]]=e.getAttribute(a[u])||"";return l(o,i,on(r,n))}(e,n);case 3:return function(e){return{type:"text",value:e.nodeValue||""}}(e);case 8:return function(e){return{type:"comment",value:e.nodeValue||""}}(e);case 9:return ln(e,n);case 10:return{type:"doctype"};case 11:return ln(e,n);default:return}}(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function ln(e,n){return{type:"root",children:on(e,n)}}function on(e,n){const t=e.childNodes,l=[];let o=-1;for(;++o<t.length;){const e=tn(t[o],n);void 0!==e&&l.push(e)}return l}function rn(e,n){const t=function(e){const n=document.createElement("template");return n.innerHTML=e,n.content}(e);return tn(t,{})||{type:"root",children:[]}}new DOMParser;const an=function(e,n,t){const o=l(t);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if("number"==typeof n){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if((n=e.children.indexOf(n))<0)throw new Error("Expected child node or index");for(;++n<e.children.length;)if(o(e.children[n],n,e))return e.children[n]},un=function(e){if(null==e)return cn;if("string"==typeof e)return function(e){return sn(n);function n(n){return n.tagName===e}}(e);if("object"==typeof e)return function(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=un(e[t]);return sn(l);function l(...e){let t=-1;for(;++t<n.length;)if(n[t].apply(this,e))return!0;return!1}}(e);if("function"==typeof e)return sn(e);throw new Error("Expected function, string, or array as `test`")};function sn(e){return function(n,t,l){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e&&"tagName"in e}(n)&&e.call(this,n,"number"==typeof t?t:void 0,l||void 0))}}function cn(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}const pn=/\n/g,fn=/[\t ]+/g,dn=un("br"),hn=un(function(e){return"td"===e.tagName||"th"===e.tagName}),gn=un("p"),mn=un("tr"),yn=un(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return Boolean((e.properties||{}).hidden)},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),vn=un(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function bn(e,n,t){return"element"===e.type?function(e,n,t){const l=kn(e,t),o=e.children||[];let r,a,i=-1,u=[];if(yn(e))return u;dn(e)||mn(e)&&an(n,e,mn)?a="\n":gn(e)?(r=2,a=2):vn(e)&&(r=1,a=1);for(;++i<o.length;)u=u.concat(bn(o[i],e,{whitespace:l,breakBefore:i?void 0:r,breakAfter:i<o.length-1?dn(o[i+1]):a}));hn(e)&&an(n,e,hn)&&u.push("\t");r&&u.unshift(r);a&&u.push(a);return u}(e,n,t):"text"===e.type?"normal"===t.whitespace?wn(e,t):function(e){return[String(e.value)]}(e):[]}function wn(e,n){const t=String(e.value),l=[],o=[];let r=0;for(;r<=t.length;){pn.lastIndex=r;const e=pn.exec(t),o=e&&"index"in e?e.index:t.length;l.push(xn(t.slice(r,o).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==r||n.breakBefore,o!==t.length||n.breakAfter)),r=o+1}let a,i=-1;for(;++i<l.length;)8203===l[i].charCodeAt(l[i].length-1)||i<l.length-1&&8203===l[i+1].charCodeAt(0)?(o.push(l[i]),a=void 0):l[i]?("number"==typeof a&&o.push(a),o.push(l[i]),a=0):0!==i&&i!==l.length-1||o.push(0);return o}function xn(e,n,t){const l=[];let o,r=0;for(;r<e.length;){fn.lastIndex=r;const t=fn.exec(e);o=t?t.index:e.length,r||o||!t||n||l.push(""),r!==o&&l.push(e.slice(r,o)),r=t?o+t[0].length:o}return r===o||t||l.push(""),l.join(" ")}function kn(e,n){if("element"===e.type){const t=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}}return n.whitespace}const Cn={},Sn=[];function Dn(e){const n=e||Cn;return function(e,t){o(e,"element",function(e,l){const o=Array.isArray(e.properties.className)?e.properties.className:Sn,i=o.includes("language-math"),u=o.includes("math-display"),s=o.includes("math-inline");let c=u;if(!i&&!u&&!s)return;let p=l[l.length-1],f=e;if("code"===e.tagName&&i&&p&&"element"===p.type&&"pre"===p.tagName&&(f=p,p=l[l.length-2],c=!0),!p)return;const d=function(e,n){const t=n||{},l="children"in e?e.children:[],o=vn(e),r=kn(e,{whitespace:t.whitespace||"normal"}),a=[];"text"!==e.type&&"comment"!==e.type||a.push(...wn(e,{breakBefore:!0,breakAfter:!0}));let i=-1;for(;++i<l.length;)a.push(...bn(l[i],e,{whitespace:r,breakBefore:i?void 0:o,breakAfter:i<l.length-1?dn(l[i+1]):o}));const u=[];let s;for(i=-1;++i<a.length;){const e=a[i];"number"==typeof e?void 0!==s&&e>s&&(s=e):e&&(void 0!==s&&s>-1&&u.push("\n".repeat(s)||" "),s=-1,u.push(e))}return u.join("")}(f,{whitespace:"pre"});let h;try{h=r.renderToString(d,{...n,displayMode:c,throwOnError:!0})}catch(o){const a=o,i=a.name.toLowerCase();t.message("Could not render math with KaTeX",{ancestors:[...l,e],cause:a,place:e.position,ruleId:i,source:"rehype-katex"});try{h=r.renderToString(d,{...n,displayMode:c,strict:"ignore",throwOnError:!1})}catch{h=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(n.errorColor||"#cc0000"),title:String(o)},children:[{type:"text",value:d}]}]}}if("string"==typeof h){h=rn(h).children}const g=p.children.indexOf(f);return p.children.splice(g,1,...h),a})}}export{$ as a,ee as b,m as c,ye as d,be as e,Z as f,$e as g,Qe as h,g as i,u as j,le as k,Be as l,ge as m,y as n,ne as o,me as p,b as q,Dn as r,en as s,nn as w};
|
|
1
|
+
import{bS as e}from"./index-MXDpbG5L.js";import{c as n,D as t,g as l,E as o,o as r,S as a}from"./types-TNt9NcVE.js";function i(e){const n=[],t=String(e||"");let l=t.indexOf(","),o=0,r=!1;for(;!r;){-1===l&&(l=t.length,r=!0);const e=t.slice(o,l).trim();!e&&r||n.push(e),o=l+1,l=t.indexOf(",",o)}return n}function u(e,n){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}const s=/[$_\p{ID_Start}]/u,c=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,p=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,f=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h={};function g(e){return!!e&&s.test(String.fromCodePoint(e))}function m(e,n){const t=(n||h).jsx?p:c;return!!e&&t.test(String.fromCodePoint(e))}function y(e,n){return((n||h).jsx?d:f).test(e)}const v=/[ \t\n\f\r]/g;function b(e){return"object"==typeof e?"text"===e.type&&w(e.value):w(e)}function w(e){return""===e.replace(v,"")}class x{constructor(e,n,t){this.normal=n,this.property=e,t&&(this.space=t)}}function k(e,n){const t={},l={};for(const n of e)Object.assign(t,n.property),Object.assign(l,n.normal);return new x(t,l,n)}function C(e){return e.toLowerCase()}x.prototype.normal={},x.prototype.property={},x.prototype.space=void 0;class S{constructor(e,n){this.attribute=n,this.property=e}}S.prototype.attribute="",S.prototype.booleanish=!1,S.prototype.boolean=!1,S.prototype.commaOrSpaceSeparated=!1,S.prototype.commaSeparated=!1,S.prototype.defined=!1,S.prototype.mustUseProperty=!1,S.prototype.number=!1,S.prototype.overloadedBoolean=!1,S.prototype.property="",S.prototype.spaceSeparated=!1,S.prototype.space=void 0;let D=0;const A=T(),N=T(),L=T(),O=T(),P=T(),M=T(),R=T();function T(){return 2**++D}var E=Object.freeze({__proto__:null,boolean:A,booleanish:N,commaOrSpaceSeparated:R,commaSeparated:M,number:O,overloadedBoolean:L,spaceSeparated:P});const I=Object.keys(E);class B extends S{constructor(e,n,t,l){let o=-1;if(super(e,n),U(this,"space",l),"number"==typeof t)for(;++o<I.length;){const e=I[o];U(this,I[o],(t&E[e])===E[e])}}}function U(e,n,t){t&&(e[n]=t)}function j(e){const n={},t={};for(const[l,o]of Object.entries(e.properties)){const r=new B(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(r.mustUseProperty=!0),n[l]=r,t[C(l)]=l,t[C(r.attribute)]=l}return new x(n,t,e.space)}B.prototype.defined=!0;const z=j({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:O,ariaColIndex:O,ariaColSpan:O,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:N,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:P,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:O,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:O,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:P,ariaRowCount:O,ariaRowIndex:O,ariaRowSpan:O,ariaSelected:N,ariaSetSize:O,ariaSort:null,ariaValueMax:O,ariaValueMin:O,ariaValueNow:O,ariaValueText:null,role:null},transform:(e,n)=>"role"===n?n:"aria-"+n.slice(4).toLowerCase()});function F(e,n){return n in e?e[n]:n}function _(e,n){return F(e,n.toLowerCase())}const H=j({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:M,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:A,allowPaymentRequest:A,allowUserMedia:A,alt:null,as:null,async:A,autoCapitalize:null,autoComplete:P,autoFocus:A,autoPlay:A,blocking:P,capture:null,charSet:null,checked:A,cite:null,className:P,cols:O,colSpan:null,content:null,contentEditable:N,controls:A,controlsList:P,coords:O|M,crossOrigin:null,data:null,dateTime:null,decoding:null,default:A,defer:A,dir:null,dirName:null,disabled:A,download:L,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:A,formTarget:null,headers:P,height:O,hidden:L,high:O,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:A,inputMode:null,integrity:null,is:null,isMap:A,itemId:null,itemProp:P,itemRef:P,itemScope:A,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:A,low:O,manifest:null,max:null,maxLength:O,media:null,method:null,min:null,minLength:O,multiple:A,muted:A,name:null,nonce:null,noModule:A,noValidate:A,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:A,optimum:O,pattern:null,ping:P,placeholder:null,playsInline:A,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:A,referrerPolicy:null,rel:P,required:A,reversed:A,rows:O,rowSpan:O,sandbox:P,scope:null,scoped:A,seamless:A,selected:A,shadowRootClonable:A,shadowRootDelegatesFocus:A,shadowRootMode:null,shape:null,size:O,sizes:null,slot:null,span:O,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:O,step:null,style:null,tabIndex:O,target:null,title:null,translate:null,type:null,typeMustMatch:A,useMap:null,value:N,width:O,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:O,borderColor:null,bottomMargin:O,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:A,declare:A,event:null,face:null,frame:null,frameBorder:null,hSpace:O,leftMargin:O,link:null,longDesc:null,lowSrc:null,marginHeight:O,marginWidth:O,noResize:A,noHref:A,noShade:A,noWrap:A,object:null,profile:null,prompt:null,rev:null,rightMargin:O,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:O,valueType:null,version:null,vAlign:null,vLink:null,vSpace:O,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:A,disableRemotePlayback:A,prefix:null,property:null,results:O,security:null,unselectable:null},space:"html",transform:_}),V=j({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:R,accentHeight:O,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:O,amplitude:O,arabicForm:null,ascent:O,attributeName:null,attributeType:null,azimuth:O,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:O,by:null,calcMode:null,capHeight:O,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:O,diffuseConstant:O,direction:null,display:null,dur:null,divisor:O,dominantBaseline:null,download:A,dx:null,dy:null,edgeMode:null,editable:null,elevation:O,enableBackground:null,end:null,event:null,exponent:O,externalResourcesRequired:null,fill:null,fillOpacity:O,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:M,g2:M,glyphName:M,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:O,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:O,horizOriginX:O,horizOriginY:O,id:null,ideographic:O,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:O,k:O,k1:O,k2:O,k3:O,k4:O,kernelMatrix:R,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:O,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:O,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:O,overlineThickness:O,paintOrder:null,panose1:null,path:null,pathLength:O,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:O,pointsAtY:O,pointsAtZ:O,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:R,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:R,rev:R,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:R,requiredFeatures:R,requiredFonts:R,requiredFormats:R,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:O,specularExponent:O,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:O,strikethroughThickness:O,string:null,stroke:null,strokeDashArray:R,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:O,strokeOpacity:O,strokeWidth:null,style:null,surfaceScale:O,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:R,tabIndex:O,tableValues:null,target:null,targetX:O,targetY:O,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:R,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:O,underlineThickness:O,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:O,values:null,vAlphabetic:O,vMathematical:O,vectorEffect:null,vHanging:O,vIdeographic:O,version:null,vertAdvY:O,vertOriginX:O,vertOriginY:O,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:O,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F}),q=j({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,n)=>"xlink:"+n.slice(5).toLowerCase()}),W=j({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_}),X=j({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,n)=>"xml:"+n.slice(3).toLowerCase()}),$={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},K=/[A-Z]/g,Y=/-[a-z]/g,G=/^data[-\w.:]+$/i;function Z(e,n){const t=C(n);let l=n,o=S;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&"data"===t.slice(0,4)&&G.test(n)){if("-"===n.charAt(4)){const e=n.slice(5).replace(Y,Q);l="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=n.slice(4);if(!Y.test(e)){let t=e.replace(K,J);"-"!==t.charAt(0)&&(t="-"+t),n="data"+t}}o=B}return new o(l,n)}function J(e){return"-"+e.toLowerCase()}function Q(e){return e.charAt(1).toUpperCase()}const ee=k([z,H,q,W,X],"html"),ne=k([z,V,q,W,X],"svg");function te(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function le(e){return e.join(" ").trim()}var oe,re,ae,ie={};function ue(){if(ae)return ie;ae=1;var e=ie&&ie.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=function(e,t){let l=null;if(!e||"string"!=typeof e)return l;const o=(0,n.default)(e),r="function"==typeof t;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:n,value:o}=e;r?t(n,o,e):o&&(l=l||{},l[n]=o)}),l};const n=e(function(){if(re)return oe;re=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,i=/^\s+|\s+$/g,u="";function s(e){return e?e.replace(i,u):u}return oe=function(i,c){if("string"!=typeof i)throw new TypeError("First argument must be a string");if(!i)return[];c=c||{};var p=1,f=1;function d(e){var t=e.match(n);t&&(p+=t.length);var l=e.lastIndexOf("\n");f=~l?e.length-l:f+e.length}function h(){var e={line:p,column:f};return function(n){return n.position=new g(e),v(),n}}function g(e){this.start=e,this.end={line:p,column:f},this.source=c.source}function m(e){var n=new Error(c.source+":"+p+":"+f+": "+e);if(n.reason=e,n.filename=c.source,n.line=p,n.column=f,n.source=i,!c.silent)throw n}function y(e){var n=e.exec(i);if(n){var t=n[0];return d(t),i=i.slice(t.length),n}}function v(){y(t)}function b(e){var n;for(e=e||[];n=w();)!1!==n&&e.push(n);return e}function w(){var e=h();if("/"==i.charAt(0)&&"*"==i.charAt(1)){for(var n=2;u!=i.charAt(n)&&("*"!=i.charAt(n)||"/"!=i.charAt(n+1));)++n;if(n+=2,u===i.charAt(n-1))return m("End of comment missing");var t=i.slice(2,n-2);return f+=2,d(t),i=i.slice(n),f+=2,e({type:"comment",comment:t})}}function x(){var n=h(),t=y(l);if(t){if(w(),!y(o))return m("property missing ':'");var i=y(r),c=n({type:"declaration",property:s(t[0].replace(e,u)),value:i?s(i[0].replace(e,u)):u});return y(a),c}}return g.prototype.content=i,v(),function(){var e,n=[];for(b(n);e=x();)!1!==e&&(n.push(e),b(n));return n}()},oe}());return ie}var se,ce,pe,fe={};function de(){if(se)return fe;se=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,r=function(e,n){return n.toUpperCase()},a=function(e,n){return"".concat(n,"-")};return fe.camelCase=function(i,u){return void 0===u&&(u={}),function(n){return!n||t.test(n)||e.test(n)}(i)?i:(i=i.toLowerCase(),(i=u.reactCompat?i.replace(o,a):i.replace(l,a)).replace(n,r))},fe}var he=function(){if(pe)return ce;pe=1;var e=(ce&&ce.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ue()),n=de();function t(t,l){var o={};return t&&"string"==typeof t?((0,e.default)(t,function(e,t){e&&t&&(o[(0,n.camelCase)(e,l)]=t)}),o):o}return t.default=t,ce=t}(),ge=e(he);const me=ve("end"),ye=ve("start");function ve(e){return function(n){const t=n&&n.position&&n.position[e]||{};if("number"==typeof t.line&&t.line>0&&"number"==typeof t.column&&t.column>0)return{line:t.line,column:t.column,offset:"number"==typeof t.offset&&t.offset>-1?t.offset:void 0}}}function be(e){const n=ye(e),t=me(e);if(n&&t)return{start:n,end:t}}function we(e){const t=[];let l=-1,o=0,r=0;for(;++l<e.length;){const a=e.charCodeAt(l);let i="";if(37===a&&n(e.charCodeAt(l+1))&&n(e.charCodeAt(l+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const n=e.charCodeAt(l+1);a<56320&&n>56319&&n<57344?(i=String.fromCharCode(a,n),r=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(o,l),encodeURIComponent(i)),o=l+r+1,i=""),r&&(l+=r,r=0)}return t.join("")+e.slice(o)}function xe(e,n){const t=n.referenceType;let l="]";if("collapsed"===t?l+="[]":"full"===t&&(l+="["+(n.label||n.identifier)+"]"),"imageReference"===n.type)return[{type:"text",value:"!["+n.alt+l}];const o=e.all(n),r=o[0];r&&"text"===r.type?r.value="["+r.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=l:o.push({type:"text",value:l}),o}function ke(e){const n=e.spread;return null==n?e.children.length>1:n}function Ce(e){const n=String(e),t=/\r?\n|\r/g;let l=t.exec(n),o=0;const r=[];for(;l;)r.push(Se(n.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=t.exec(n);return r.push(Se(n.slice(o),o>0,!1)),r.join("")}function Se(e,n,t){let l=0,o=e.length;if(n){let n=e.codePointAt(l);for(;9===n||32===n;)l++,n=e.codePointAt(l)}if(t){let n=e.codePointAt(o-1);for(;9===n||32===n;)o--,n=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}const De={blockquote:function(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)},break:function(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:"\n"}]},code:function(e,n){const t=n.value?n.value+"\n":"",l={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let r={type:"element",tagName:"code",properties:l,children:[{type:"text",value:t}]};return n.meta&&(r.data={meta:n.meta}),e.patch(n,r),r=e.applyData(n,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(n,r),r},delete:function(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},emphasis:function(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},footnoteReference:function(e,n){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),o=we(l.toLowerCase()),r=e.footnoteOrder.indexOf(l);let a,i=e.footnoteCounts.get(l);void 0===i?(i=0,e.footnoteOrder.push(l),a=e.footnoteOrder.length):a=r+1,i+=1,e.footnoteCounts.set(l,i);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+o,id:t+"fnref-"+o+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,u);const s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,s),e.applyData(n,s)},heading:function(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},html:function(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}},imageReference:function(e,n){const t=String(n.identifier).toUpperCase(),l=e.definitionById.get(t);if(!l)return xe(e,n);const o={src:we(l.url||""),alt:n.alt};null!==l.title&&void 0!==l.title&&(o.title=l.title);const r={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,r),e.applyData(n,r)},image:function(e,n){const t={src:we(n.url)};null!==n.alt&&void 0!==n.alt&&(t.alt=n.alt),null!==n.title&&void 0!==n.title&&(t.title=n.title);const l={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,l),e.applyData(n,l)},inlineCode:function(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const l={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,l),e.applyData(n,l)},linkReference:function(e,n){const t=String(n.identifier).toUpperCase(),l=e.definitionById.get(t);if(!l)return xe(e,n);const o={href:we(l.url||"")};null!==l.title&&void 0!==l.title&&(o.title=l.title);const r={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)},link:function(e,n){const t={href:we(n.url)};null!==n.title&&void 0!==n.title&&(t.title=n.title);const l={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)},listItem:function(e,n,t){const l=e.all(n),o=t?function(e){let n=!1;if("list"===e.type){n=e.spread||!1;const t=e.children;let l=-1;for(;!n&&++l<t.length;)n=ke(t[l])}return n}(t):ke(n),r={},a=[];if("boolean"==typeof n.checked){const e=l[0];let t;e&&"element"===e.type&&"p"===e.tagName?t=e:(t={type:"element",tagName:"p",properties:{},children:[]},l.unshift(t)),t.children.length>0&&t.children.unshift({type:"text",value:" "}),t.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let i=-1;for(;++i<l.length;){const e=l[i];(o||0!==i||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const u=l[l.length-1];u&&(o||"element"!==u.type||"p"!==u.tagName)&&a.push({type:"text",value:"\n"});const s={type:"element",tagName:"li",properties:r,children:a};return e.patch(n,s),e.applyData(n,s)},list:function(e,n){const t={},l=e.all(n);let o=-1;for("number"==typeof n.start&&1!==n.start&&(t.start=n.start);++o<l.length;){const e=l[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const r={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(l,!0)};return e.patch(n,r),e.applyData(n,r)},paragraph:function(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},root:function(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)},strong:function(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},table:function(e,n){const t=e.all(n),l=t.shift(),o=[];if(l){const t={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],t),o.push(t)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},r=ye(n.children[1]),a=me(n.children[n.children.length-1]);r&&a&&(l.position={start:r,end:a}),o.push(l)}const r={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,r),e.applyData(n,r)},tableCell:function(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)},tableRow:function(e,n,t){const l=t?t.children:void 0,o=0===(l?l.indexOf(n):1)?"th":"td",r=t&&"table"===t.type?t.align:void 0,a=r?r.length:n.children.length;let i=-1;const u=[];for(;++i<a;){const t=n.children[i],l={},a=r?r[i]:void 0;a&&(l.align=a);let s={type:"element",tagName:o,properties:l,children:[]};t&&(s.children=e.all(t),e.patch(t,s),s=e.applyData(t,s)),u.push(s)}const s={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,s),e.applyData(n,s)},text:function(e,n){const t={type:"text",value:Ce(String(n.value))};return e.patch(n,t),e.applyData(n,t)},thematicBreak:function(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)},toml:Ae,yaml:Ae,definition:Ae,footnoteDefinition:Ae};function Ae(){}const Ne="object"==typeof self?self:globalThis,Le=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ne[e](n)},Oe=e=>((e,n)=>{const t=(n,t)=>(e.set(t,n),n),l=o=>{if(e.has(o))return e.get(o);const[r,a]=n[o];switch(r){case 0:case-1:return t(a,o);case 1:{const e=t([],o);for(const n of a)e.push(l(n));return e}case 2:{const e=t({},o);for(const[n,t]of a)e[l(n)]=l(t);return e}case 3:return t(new Date(a),o);case 4:{const{source:e,flags:n}=a;return t(new RegExp(e,n),o)}case 5:{const e=t(new Map,o);for(const[n,t]of a)e.set(l(n),l(t));return e}case 6:{const e=t(new Set,o);for(const n of a)e.add(l(n));return e}case 7:{const{name:e,message:n}=a;return t(Le(e,n),o)}case 8:return t(BigInt(a),o);case"BigInt":return t(Object(BigInt(a)),o);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return t(new DataView(e),a)}}return t(Le(r,a),o)};return l})(new Map,e)(0),Pe="",{toString:Me}={},{keys:Re}=Object,Te=e=>{const n=typeof e;if("object"!==n||!e)return[0,n];const t=Me.call(e).slice(8,-1);switch(t){case"Array":return[1,Pe];case"Object":return[2,Pe];case"Date":return[3,Pe];case"RegExp":return[4,Pe];case"Map":return[5,Pe];case"Set":return[6,Pe];case"DataView":return[1,t]}return t.includes("Array")?[1,t]:t.includes("Error")?[7,t]:[2,t]},Ee=([e,n])=>0===e&&("function"===n||"symbol"===n),Ie=(e,{json:n,lossy:t}={})=>{const l=[];return((e,n,t,l)=>{const o=(e,n)=>{const o=l.push(e)-1;return t.set(n,o),o},r=l=>{if(t.has(l))return t.get(l);let[a,i]=Te(l);switch(a){case 0:{let n=l;switch(i){case"bigint":a=8,n=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+i);n=null;break;case"undefined":return o([-1],l)}return o([a,n],l)}case 1:{if(i){let e=l;return"DataView"===i?e=new Uint8Array(l.buffer):"ArrayBuffer"===i&&(e=new Uint8Array(l)),o([i,[...e]],l)}const e=[],n=o([a,e],l);for(const n of l)e.push(r(n));return n}case 2:{if(i)switch(i){case"BigInt":return o([i,l.toString()],l);case"Boolean":case"Number":case"String":return o([i,l.valueOf()],l)}if(n&&"toJSON"in l)return r(l.toJSON());const t=[],u=o([a,t],l);for(const n of Re(l))!e&&Ee(Te(l[n]))||t.push([r(n),r(l[n])]);return u}case 3:return o([a,l.toISOString()],l);case 4:{const{source:e,flags:n}=l;return o([a,{source:e,flags:n}],l)}case 5:{const n=[],t=o([a,n],l);for(const[t,o]of l)(e||!Ee(Te(t))&&!Ee(Te(o)))&&n.push([r(t),r(o)]);return t}case 6:{const n=[],t=o([a,n],l);for(const t of l)!e&&Ee(Te(t))||n.push(r(t));return t}}const{message:u}=l;return o([a,{name:i,message:u}],l)};return r})(!(n||t),!!n,new Map,l)(e),l};var Be="function"==typeof structuredClone?(e,n)=>n&&("json"in n||"lossy"in n)?Oe(Ie(e,n)):structuredClone(e):(e,n)=>Oe(Ie(e,n));function Ue(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function je(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}const ze={}.hasOwnProperty,Fe={};function _e(e,n){e.position&&(n.position=be(e))}function He(e,n){let t=n;if(e&&e.data){const n=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if("string"==typeof n)if("element"===t.type)t.tagName=n;else{t={type:"element",tagName:n,properties:{},children:"children"in t?t.children:[t]}}"element"===t.type&&o&&Object.assign(t.properties,Be(o)),"children"in t&&t.children&&null!=l&&(t.children=l)}return t}function Ve(e,n){const t=n.data||{},l=!("value"in n)||ze.call(t,"hProperties")||ze.call(t,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(n)}:{type:"text",value:n.value};return e.patch(n,l),e.applyData(n,l)}function qe(e,n){const t=[];let l=-1;for(n&&t.push({type:"text",value:"\n"});++l<e.length;)l&&t.push({type:"text",value:"\n"}),t.push(e[l]);return n&&e.length>0&&t.push({type:"text",value:"\n"}),t}function We(e){let n=0,t=e.charCodeAt(n);for(;9===t||32===t;)n++,t=e.charCodeAt(n);return e.slice(n)}function Xe(e,n){const l=function(e,n){const l=n||Fe,o=new Map,r=new Map,a=new Map,i={...De,...l.handlers},u={all:function(e){const n=[];if("children"in e){const t=e.children;let l=-1;for(;++l<t.length;){const o=u.one(t[l],e);if(o){if(l&&"break"===t[l-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=We(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=We(e.value))}Array.isArray(o)?n.push(...o):n.push(o)}}}return n},applyData:He,definitionById:o,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:i,one:function(e,n){const t=e.type,l=u.handlers[t];if(ze.call(u.handlers,t)&&l)return l(u,e,n);if(u.options.passThrough&&u.options.passThrough.includes(t)){if("children"in e){const{children:n,...t}=e,l=Be(t);return l.children=u.all(e),l}return Be(e)}return(u.options.unknownHandler||Ve)(u,e,n)},options:l,patch:_e,wrap:qe};return t(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const n="definition"===e.type?o:r,t=String(e.identifier).toUpperCase();n.has(t)||n.set(t,e)}}),u}(e,n),o=l.one(e,void 0),r=function(e){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Ue,l=e.options.footnoteBackLabel||je,o=e.options.footnoteLabel||"Footnotes",r=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[];let u=-1;for(;++u<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[u]);if(!o)continue;const r=e.all(o),a=String(o.identifier).toUpperCase(),s=we(a.toLowerCase());let c=0;const p=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++c<=f;){p.length>0&&p.push({type:"text",value:" "});let e="string"==typeof t?t:t(u,c);"string"==typeof e&&(e={type:"text",value:e}),p.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof l?l:l(u,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const d=r[r.length-1];if(d&&"element"===d.type&&"p"===d.tagName){const e=d.children[d.children.length-1];e&&"text"===e.type?e.value+=" ":d.children.push({type:"text",value:" "}),d.children.push(...p)}else r.push(...p);const h={type:"element",tagName:"li",properties:{id:n+"fn-"+s},children:e.wrap(r,!0)};e.patch(o,h),i.push(h)}if(0!==i.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...Be(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:"\n"}]}}(l),a=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return r&&a.children.push({type:"text",value:"\n"},r),a}function $e(e,n){return e&&"run"in e?async function(t,l){const o=Xe(t,{file:l,...n});await e.run(o,l)}:function(t,l){return Xe(t,{file:l,...e||n})}}const Ke=/[#.]/g;function Ye(e,n,t){const l=t?function(e){const n=new Map;for(const t of e)n.set(t.toLowerCase(),t);return n}(t):void 0;return function(t,o,...r){let a;if(null==t){a={type:"root",children:[]};const e=o;r.unshift(e)}else{a=function(e,n){const t=e||"",l={};let o,r,a=0;for(;a<t.length;){Ke.lastIndex=a;const e=Ke.exec(t),n=t.slice(a,e?e.index:t.length);n&&(o?"#"===o?l.id=n:Array.isArray(l.className)?l.className.push(n):l.className=[n]:r=n,a+=n.length),e&&(o=e[0],a++)}return{type:"element",tagName:r||n||"div",properties:l,children:[]}}(t,n);const i=a.tagName.toLowerCase(),u=l?l.get(i):void 0;if(a.tagName=u||i,function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!0;if("string"!=typeof e.type)return!1;const n=e,t=Object.keys(e);for(const e of t){const t=n[e];if(t&&"object"==typeof t){if(!Array.isArray(t))return!0;const e=t;for(const n of e)if("number"!=typeof n&&"string"!=typeof n)return!0}}if("children"in e&&Array.isArray(e.children))return!0;return!1}(o))r.unshift(o);else for(const[n,t]of Object.entries(o))Ge(e,a.properties,n,t)}for(const e of r)Ze(a.children,e);return"element"===a.type&&"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]),a}}function Ge(e,n,t,l){const o=Z(e,t);let r;if(null!=l){if("number"==typeof l){if(Number.isNaN(l))return;r=l}else r="boolean"==typeof l?l:"string"==typeof l?o.spaceSeparated?te(l):o.commaSeparated?i(l):o.commaOrSpaceSeparated?te(i(l).join(" ")):Je(o,o.property,l):Array.isArray(l)?[...l]:"style"===o.property?function(e){const n=[];for(const[t,l]of Object.entries(e))n.push([t,l].join(": "));return n.join("; ")}(l):String(l);if(Array.isArray(r)){const e=[];for(const n of r)e.push(Je(o,o.property,n));r=e}"className"===o.property&&Array.isArray(n.className)&&(r=n.className.concat(r)),n[o.property]=r}}function Ze(e,n){if(null==n);else if("number"==typeof n||"string"==typeof n)e.push({type:"text",value:String(n)});else if(Array.isArray(n))for(const t of n)Ze(e,t);else{if("object"!=typeof n||!("type"in n))throw new Error("Expected node, nodes, or string, got `"+n+"`");"root"===n.type?Ze(e,n.children):e.push(n)}}function Je(e,n,t){if("string"==typeof t){if(e.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((e.boolean||e.overloadedBoolean)&&(""===t||C(t)===C(n)))return!0}return t}const Qe=Ye(ee,"div"),en=Ye(ne,"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"]),nn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tn(e,n){const t=function(e,n){switch(e.nodeType){case 1:return function(e,n){const t=e.namespaceURI,l=t===nn.svg?en:Qe,o=t===nn.html?e.tagName.toLowerCase():e.tagName,r=t===nn.html&&"template"===o?e.content:e,a=e.getAttributeNames(),i={};let u=-1;for(;++u<a.length;)i[a[u]]=e.getAttribute(a[u])||"";return l(o,i,on(r,n))}(e,n);case 3:return function(e){return{type:"text",value:e.nodeValue||""}}(e);case 8:return function(e){return{type:"comment",value:e.nodeValue||""}}(e);case 9:return ln(e,n);case 10:return{type:"doctype"};case 11:return ln(e,n);default:return}}(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function ln(e,n){return{type:"root",children:on(e,n)}}function on(e,n){const t=e.childNodes,l=[];let o=-1;for(;++o<t.length;){const e=tn(t[o],n);void 0!==e&&l.push(e)}return l}function rn(e,n){const t=function(e){const n=document.createElement("template");return n.innerHTML=e,n.content}(e);return tn(t,{})||{type:"root",children:[]}}new DOMParser;const an=function(e,n,t){const o=l(t);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if("number"==typeof n){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if((n=e.children.indexOf(n))<0)throw new Error("Expected child node or index");for(;++n<e.children.length;)if(o(e.children[n],n,e))return e.children[n]},un=function(e){if(null==e)return cn;if("string"==typeof e)return function(e){return sn(n);function n(n){return n.tagName===e}}(e);if("object"==typeof e)return function(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=un(e[t]);return sn(l);function l(...e){let t=-1;for(;++t<n.length;)if(n[t].apply(this,e))return!0;return!1}}(e);if("function"==typeof e)return sn(e);throw new Error("Expected function, string, or array as `test`")};function sn(e){return function(n,t,l){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e&&"tagName"in e}(n)&&e.call(this,n,"number"==typeof t?t:void 0,l||void 0))}}function cn(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}const pn=/\n/g,fn=/[\t ]+/g,dn=un("br"),hn=un(function(e){return"td"===e.tagName||"th"===e.tagName}),gn=un("p"),mn=un("tr"),yn=un(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return Boolean((e.properties||{}).hidden)},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),vn=un(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function bn(e,n,t){return"element"===e.type?function(e,n,t){const l=kn(e,t),o=e.children||[];let r,a,i=-1,u=[];if(yn(e))return u;dn(e)||mn(e)&&an(n,e,mn)?a="\n":gn(e)?(r=2,a=2):vn(e)&&(r=1,a=1);for(;++i<o.length;)u=u.concat(bn(o[i],e,{whitespace:l,breakBefore:i?void 0:r,breakAfter:i<o.length-1?dn(o[i+1]):a}));hn(e)&&an(n,e,hn)&&u.push("\t");r&&u.unshift(r);a&&u.push(a);return u}(e,n,t):"text"===e.type?"normal"===t.whitespace?wn(e,t):function(e){return[String(e.value)]}(e):[]}function wn(e,n){const t=String(e.value),l=[],o=[];let r=0;for(;r<=t.length;){pn.lastIndex=r;const e=pn.exec(t),o=e&&"index"in e?e.index:t.length;l.push(xn(t.slice(r,o).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==r||n.breakBefore,o!==t.length||n.breakAfter)),r=o+1}let a,i=-1;for(;++i<l.length;)8203===l[i].charCodeAt(l[i].length-1)||i<l.length-1&&8203===l[i+1].charCodeAt(0)?(o.push(l[i]),a=void 0):l[i]?("number"==typeof a&&o.push(a),o.push(l[i]),a=0):0!==i&&i!==l.length-1||o.push(0);return o}function xn(e,n,t){const l=[];let o,r=0;for(;r<e.length;){fn.lastIndex=r;const t=fn.exec(e);o=t?t.index:e.length,r||o||!t||n||l.push(""),r!==o&&l.push(e.slice(r,o)),r=t?o+t[0].length:o}return r===o||t||l.push(""),l.join(" ")}function kn(e,n){if("element"===e.type){const t=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}}return n.whitespace}const Cn={},Sn=[];function Dn(e){const n=e||Cn;return function(e,t){o(e,"element",function(e,l){const o=Array.isArray(e.properties.className)?e.properties.className:Sn,i=o.includes("language-math"),u=o.includes("math-display"),s=o.includes("math-inline");let c=u;if(!i&&!u&&!s)return;let p=l[l.length-1],f=e;if("code"===e.tagName&&i&&p&&"element"===p.type&&"pre"===p.tagName&&(f=p,p=l[l.length-2],c=!0),!p)return;const d=function(e,n){const t=n||{},l="children"in e?e.children:[],o=vn(e),r=kn(e,{whitespace:t.whitespace||"normal"}),a=[];"text"!==e.type&&"comment"!==e.type||a.push(...wn(e,{breakBefore:!0,breakAfter:!0}));let i=-1;for(;++i<l.length;)a.push(...bn(l[i],e,{whitespace:r,breakBefore:i?void 0:o,breakAfter:i<l.length-1?dn(l[i+1]):o}));const u=[];let s;for(i=-1;++i<a.length;){const e=a[i];"number"==typeof e?void 0!==s&&e>s&&(s=e):e&&(void 0!==s&&s>-1&&u.push("\n".repeat(s)||" "),s=-1,u.push(e))}return u.join("")}(f,{whitespace:"pre"});let h;try{h=r.renderToString(d,{...n,displayMode:c,throwOnError:!0})}catch(o){const a=o,i=a.name.toLowerCase();t.message("Could not render math with KaTeX",{ancestors:[...l,e],cause:a,place:e.position,ruleId:i,source:"rehype-katex"});try{h=r.renderToString(d,{...n,displayMode:c,strict:"ignore",throwOnError:!1})}catch{h=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(n.errorColor||"#cc0000"),title:String(o)},children:[{type:"text",value:d}]}]}}if("string"==typeof h){h=rn(h).children}const g=p.children.indexOf(f);return p.children.splice(g,1,...h),a})}}export{$ as a,ee as b,m as c,ye as d,be as e,Z as f,$e as g,Qe as h,g as i,u as j,le as k,Be as l,ge as m,y as n,ne as o,me as p,b as q,Dn as r,en as s,nn as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{aM as o,ai as r,aN as a}from"./ViewModuleIcon-
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{aM as o,ai as r,aN as a}from"./ViewModuleIcon-CBJGd2NB.js";import{memo as t}from"react";const i=({color:o})=>l("path",{d:"M6 22q-.825 0-1.412-.587Q4 20.825 4 20V4q0-.825.588-1.413Q5.175 2 6 2h8l6 6v12q0 .825-.587 1.413Q18.825 22 18 22Zm7-13V4H6v16h12V9ZM6 4v5-5 16V4Z",fill:o}),e=l=>o(l,i,"draft"),h=({color:o})=>l("path",{d:"M4 20q-.825 0-1.412-.587Q2 18.825 2 18V6q0-.825.588-1.412Q3.175 4 4 4h6l2 2h8q.825 0 1.413.588Q22 7.175 22 8v10q0 .825-.587 1.413Q20.825 20 20 20ZM4 6v12h16V8h-8.825l-2-2H4Zm0 0v12Z",fill:o}),d=l=>o(l,h,"folder"),s=({color:o})=>l("path",{d:"M4 20q-.825 0-1.412-.587Q2 18.825 2 18V6q0-.825.588-1.412Q3.175 4 4 4h6l2 2h8q.825 0 1.413.588Q22 7.175 22 8H11.175l-2-2H4v12l2.4-8h17.1l-2.575 8.575q-.2.65-.737 1.038Q19.65 20 19 20Zm2.1-2H19l1.8-6H7.9Zm0 0 1.8-6-1.8 6ZM4 8V6v2Z",fill:o}),f=l=>o(l,s,"folder-open"),c=({color:o})=>l("path",{d:"M8 19V5l11 7Zm2-7Zm0 3.35L15.25 12 10 8.65Z",fill:o}),m=l=>o(l,c,"play-arrow"),q=t(({color:o,width:a})=>l(r,{start:{x:4,y:12},end:{x:20,y:12},options:{width:a},fill:o})),Z=t(({color:o,width:a})=>l(r,{start:{x:6,y:12},end:{x:18,y:12},options:{width:a},fill:o})),p=l=>a(l,l.circle||l.square||l.filledCircle||l.filledSquare?Z:q);export{e as D,d as F,p as M,m as P,f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,h as t,N as n,T as r,g as s,ah as i,m as o,ab as a,al as l,f as h,k as f,a6 as c,V as u,ak as d,E as p,x as m,d as g,a3 as k,G as x,a as L,b,U as S,a1 as C,a7 as w,c as y,e as A,P as I}from"./light-CK5396YO.js";import{html as T,htmlCompletionSource as B}from"./index-Ci0TIrsP.js";import"./index-CncjGRa9.js";import"./index-CQTsT8Zj.js";import"./index-DklIqAi8.js";class E{static create(e,t,n,r,s){return new E(e,t,n,r+(r<<8)+e+(t<<4)|0,s,[],[])}constructor(e,t,r,s,i,o,a){this.type=e,this.value=t,this.from=r,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[n.contextHash,s]]}addChild(e,t){e.prop(n.contextHash)!=this.hash&&(e=new o(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new o(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(e,n,r)=>new o(t.none,e,n,r,this.hashProp)})}}var v;!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"}(v||(v={}));class H{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class M{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return R(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=9==this.text.charCodeAt(r)?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=9==this.text.charCodeAt(t)?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function P(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==v.OrderedList?q:F)(n,t,!1);return r>0&&(e.type!=v.BulletList||D(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}const N={[v.Blockquote]:(e,t,n)=>62==n.next&&(n.markers.push(ke(v.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(O(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0),[v.ListItem]:(e,t,n)=>!(n.indent<n.baseIndent+e.value&&n.next>-1)&&(n.moveBaseColumn(n.baseIndent+e.value),!0),[v.OrderedList]:P,[v.BulletList]:P,[v.Document]:()=>!0};function O(e){return 32==e||9==e||10==e||13==e}function R(e,t=0){for(;t<e.length&&O(e.charCodeAt(t));)t++;return t}function X(e,t,n){for(;t>n&&O(e.charCodeAt(t-1));)t--;return t}function z(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(96==e.next)for(let n=t;n<e.text.length;n++)if(96==e.text.charCodeAt(n))return-1;return t}function $(e){return 62!=e.next?-1:32==e.text.charCodeAt(e.pos+1)?2:1}function D(e,t,n){if(42!=e.next&&45!=e.next&&95!=e.next)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!O(n))return-1}return n&&45==e.next&&_(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(re.SetextHeading)>-1||r<3?-1:1}function j(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function F(e,t,n){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!O(e.text.charCodeAt(e.pos+1))||!(!n||j(t,v.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?-1:1}function q(e,t,n){let r=e.pos,s=e.next;for(;s>=48&&s<=57;){if(r++,r==e.text.length)return-1;s=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||46!=s&&41!=s||r<e.text.length-1&&!O(e.text.charCodeAt(r+1))||n&&!j(t,v.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||49!=e.next)?-1:r+1-e.pos}function U(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&35==e.text.charCodeAt(t);)t++;if(t<e.text.length&&32!=e.text.charCodeAt(t))return-1;let n=t-e.pos;return n>6?-1:n}function _(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&O(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}const Q=/^[ \t]*$/,Z=/-->/,V=/\?>/,G=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Z],[/^\s*<\?/,V],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Q],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Q]];function K(e,t,n){if(60!=e.next)return-1;let r=e.text.slice(e.pos);for(let e=0,t=G.length-(n?1:0);e<t;e++)if(G[e][0].test(r))return e;return-1}function J(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function W(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==v.CodeText?e[r].to=n:e.push(ke(v.CodeText,t,n))}const Y={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),s=e.lineStart+r,i=e.lineStart+t.text.length,o=[],a=[];for(W(o,s,i);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){W(a,e.lineStart-1,e.lineStart);for(let e of t.markers)a.push(e)}else{if(t.indent<n)break;{if(a.length){for(let e of a)e.type==v.CodeText?W(o,e.from,e.to):o.push(e);a=[]}W(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);i=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<i&&W(o,n,i)}}return a.length&&(a=a.filter(e=>e.type!=v.CodeText),a.length&&(t.markers=a.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-s).finish(v.CodeBlock,i-s),s),!0},FencedCode(e,t){let n=z(t);if(n<0)return!1;let r=e.lineStart+t.pos,s=t.next,i=n-t.pos,o=t.skipSpace(n),a=X(t.text,t.text.length,o),l=[ke(v.CodeMark,r,r+i)];o<a&&l.push(ke(v.CodeInfo,e.lineStart+o,e.lineStart+a));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let a=t.pos;if(t.indent-t.baseIndent<4)for(;a<t.text.length&&t.text.charCodeAt(a)==s;)a++;if(a-t.pos>=i&&t.skipSpace(a)==t.text.length){for(let e of t.markers)l.push(e);r&&o&&W(l,e.lineStart-1,e.lineStart),l.push(ke(v.CodeMark,e.lineStart+t.pos,e.lineStart+a)),e.nextLine();break}{o=!0,n||(W(l,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)l.push(e);let s=e.lineStart+t.basePos,i=e.lineStart+t.text.length;s<i&&(W(l,s,i),r=!1)}}return e.addNode(e.buffer.writeElements(l,-r).finish(v.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=$(t);return!(n<0)&&(e.startContext(v.Blockquote,t.pos),e.addNode(v.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(D(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(v.HorizontalRule,n),!0},BulletList(e,t){let n=F(t,e,!1);if(n<0)return!1;e.block.type!=v.BulletList&&e.startContext(v.BulletList,t.basePos,t.next);let r=J(t,t.pos+1);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=q(t,e,!1);if(n<0)return!1;e.block.type!=v.OrderedList&&e.startContext(v.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=J(t,t.pos+n);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=U(t);if(n<0)return!1;let r=t.pos,s=e.lineStart+r,i=X(t.text,t.text.length,r),o=i;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;o!=i&&o!=r&&O(t.text.charCodeAt(o-1))||(o=t.text.length);let a=e.buffer.write(v.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),s+n+1),-s);o<t.text.length&&a.write(v.HeaderMark,o-r,i-r);let l=a.finish(v.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(l,s),!0},HTMLBlock(e,t){let n=K(t,0,!1);if(n<0)return!1;let r=e.lineStart+t.pos,s=G[n][1],i=[],o=s!=Q;for(;!s.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)i.push(e)}o&&e.nextLine();let a=s==Z?v.CommentBlock:s==V?v.ProcessingInstructionBlock:v.HTMLBlock,l=e.prevLineEnd();return e.addNode(e.buffer.writeElements(i,-r).finish(a,l-r),r),!0},SetextHeading:void 0};class ee{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(-1==this.stage)return!1;let r=n.content+"\n"+t.scrub(),s=this.advance(r);return s>-1&&s<r.length&&this.complete(e,n,s)}finish(e,t){return(2==this.stage||3==this.stage)&&R(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,ke(v.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(!1===e&&(this.stage=-1),!1)}advance(e){for(;;){if(-1==this.stage)return-1;if(0==this.stage){if(!this.nextStage(Ee(e,this.pos,this.start,!0)))return-1;if(58!=e.charCodeAt(this.pos))return this.stage=-1;this.elts.push(ke(v.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else{if(1!=this.stage){if(2==this.stage){let t=R(e,this.pos),n=0;if(t>this.pos){let r=Be(e,t,this.start);if(r){let t=te(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||(n=te(e,this.pos)),n>0&&n<e.length?n:-1}return te(e,this.pos)}if(!this.nextStage(Te(e,R(e,this.pos),this.start)))return-1}}}}function te(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(10==n)break;if(!O(n))return-1}return t}class ne{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:_(t),s=t.next;if(r<0)return!1;let i=ke(v.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,ke(61==s?v.SetextHeading1:v.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),i])),!0}finish(){return!1}}const re={LinkReference:(e,t)=>91==t.content.charCodeAt(0)?new ee(t):null,SetextHeading:()=>new ne},se=[(e,t)=>U(t)>=0,(e,t)=>z(t)>=0,(e,t)=>$(t)>=0,(e,t)=>F(t,e,!0)>=0,(e,t)=>q(t,e,!0)>=0,(e,t)=>D(t,e,!0)>=0,(e,t)=>K(t,0,!0)>=0],ie={text:"",end:0};class oe{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new M,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=E.create(v.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Pe(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(null!=this.stoppedAt&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(0!=n){if(1==n)return null;e.forward();continue e}}break}let t=new H(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4)for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e;for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+="\n"+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return!!t&&(this.absoluteLineStart+=t,this.lineStart=Ne(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0)}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=ie;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,s=this.lineChunkAt(r);t.end=r+s.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+s,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw new Error("Unhandled block context "+v[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t,n=this.input.chunk(e);if(this.input.lineChunks)t="\n"==n?"":n;else{let e=n.indexOf("\n");t=e<0?n:n.slice(0,e)}return e+t.length>this.to?t.slice(0,this.to-e):t}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=E.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){"number"==typeof e&&(e=new o(this.parser.nodeSet.types[e],de,de,(null!=n?n:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(He(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?ae(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=He(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(v.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return"string"==typeof e?ke(this.parser.getNodeType(e),t,n,r):new ge(e,t)}get buffer(){return new pe(this.parser.nodeSet)}}function ae(e,t,n,r,s){let i=e[t].to,a=[],l=[],h=n.from+r;function f(n,s){for(;s?n>=i:n>i;){let s=e[t+1].from-i;r+=s,n+=s,t++,i=e[t].to}}for(let o=n.firstChild;o;o=o.nextSibling){f(o.from+r,!0);let n,c=o.from+r,u=s.get(o.tree);u?n=u:o.to+r>i?(n=ae(e,t,o,r,s),f(o.to+r,!1)):n=o.toTree(),a.push(n),l.push(c-h)}return f(n.to+r,!1),new o(n.type,a,l,n.to+r-h,n.tree?n.tree.propValues:void 0)}class le extends e{constructor(e,t,n,r,s,i,o,a,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=i,this.inlineParsers=o,this.inlineNames=a,this.wrappers=l,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new oe(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let o=fe(e);if(!o)return this;let{nodeSet:a,skipContextMarkup:l}=this,h=this.blockParsers.slice(),f=this.leafBlockParsers.slice(),c=this.blockNames.slice(),u=this.inlineParsers.slice(),d=this.inlineNames.slice(),p=this.endLeafBlock.slice(),m=this.wrappers;if(he(o.defineNodes)){l=Object.assign({},l);let e,h=a.types.slice();for(let s of o.defineNodes){let{name:i,block:o,composite:a,style:f}="string"==typeof s?{name:s}:s;if(h.some(e=>e.name==i))continue;a&&(l[h.length]=(e,t,n)=>a(t,n,e.value));let c=h.length,u=a?["Block","BlockContext"]:o?c>=v.ATXHeading1&&c<=v.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(t.define({id:c,name:i,props:u&&[[n.group,u]]})),f&&(e||(e={}),Array.isArray(f)||f instanceof r?e[i]=f:Object.assign(e,f))}a=new s(h),e&&(a=a.extend(i(e)))}if(he(o.props)&&(a=a.extend(...o.props)),he(o.remove))for(let e of o.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(h[t]=f[t]=void 0),n>-1&&(u[n]=void 0)}if(he(o.parseBlock))for(let e of o.parseBlock){let t=c.indexOf(e.name);if(t>-1)h[t]=e.parse,f[t]=e.leaf;else{let t=e.before?ce(c,e.before):e.after?ce(c,e.after)+1:c.length-1;h.splice(t,0,e.parse),f.splice(t,0,e.leaf),c.splice(t,0,e.name)}e.endLeaf&&p.push(e.endLeaf)}if(he(o.parseInline))for(let e of o.parseInline){let t=d.indexOf(e.name);if(t>-1)u[t]=e.parse;else{let t=e.before?ce(d,e.before):e.after?ce(d,e.after)+1:d.length-1;u.splice(t,0,e.parse),d.splice(t,0,e.name)}}return o.wrap&&(m=m.concat(o.wrap)),new le(a,h,f,c,p,l,u,d,m)}getNodeType(e){let t=this.nodeTypes[e];if(null==t)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new ve(this,e,t);e:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let s=r(n,t,e);if(s>=0){e=s;continue e}}e++}return n.resolveMarkers(0)}}function he(e){return null!=e&&e.length>0}function fe(e){if(!Array.isArray(e))return e;if(0==e.length)return null;let t=fe(e[0]);if(1==e.length)return t;let n=fe(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||de).concat(t||de),s=t.wrap,i=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:s?i?(e,t,n,r)=>s(i(e,t,n,r),t,n,r):s:i}}function ce(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let ue=[t.none];for(let e,r=1;e=v[r];r++)ue[r]=t.define({id:r,name:e,props:r>=v.Escape?[]:[[n.group,r in N?["Block","BlockContext"]:["Block","LeafBlock"]]],top:"Document"==e});const de=[];class pe{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+4*r),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return o.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}class me{constructor(e,t,n,r=de){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new pe(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}}class ge{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return de}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function ke(e,t,n,r){return new me(e,t,n,r)}const xe={resolve:"Emphasis",mark:"EmphasisMark"},Le={resolve:"Emphasis",mark:"EmphasisMark"},be={},Se={};class Ce{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}}const we="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let ye=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{ye=new RegExp("[\\p{S}|\\p{P}]","u")}catch(e){}const Ae={Escape(e,t,n){if(92!=t||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(we.charCodeAt(t)==r)return e.append(ke(v.Escape,n,n+2));return-1},Entity(e,t,n){if(38!=t)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(ke(v.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(96!=t||n&&96==e.char(n-1))return-1;let r=n+1;for(;r<e.end&&96==e.char(r);)r++;let s=r-n,i=0;for(;r<e.end;r++)if(96==e.char(r)){if(i++,i==s&&96!=e.char(r+1))return e.append(ke(v.InlineCode,n,r+1,[ke(v.CodeMark,n,n+s),ke(v.CodeMark,r+1-s,r+1)]))}else i=0;return-1},HTMLTag(e,t,n){if(60!=t||n==e.end-1)return-1;let r=e.slice(n+1,e.end),s=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(s)return e.append(ke(v.Autolink,n,n+1+s[0].length,[ke(v.LinkMark,n,n+1),ke(v.URL,n+1,n+s[0].length),ke(v.LinkMark,n+s[0].length,n+1+s[0].length)]));let i=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(i)return e.append(ke(v.Comment,n,n+1+i[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(ke(v.ProcessingInstruction,n,n+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return a?e.append(ke(v.HTMLTag,n,n+1+a[0].length)):-1},Emphasis(e,t,n){if(95!=t&&42!=t)return-1;let r=n+1;for(;e.char(r)==t;)r++;let s=e.slice(n-1,n),i=e.slice(r,r+1),o=ye.test(s),a=ye.test(i),l=/\s|^$/.test(s),h=/\s|^$/.test(i),f=!h&&(!a||l||o),c=!l&&(!o||h||a),u=f&&(42==t||!c||o),d=c&&(42==t||!f||a);return e.append(new Ce(95==t?xe:Le,n,r,(u?1:0)|(d?2:0)))},HardBreak(e,t,n){if(92==t&&10==e.char(n+1))return e.append(ke(v.HardBreak,n,n+2));if(32==t){let t=n+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=n+2)return e.append(ke(v.HardBreak,n,t+1))}return-1},Link:(e,t,n)=>91==t?e.append(new Ce(be,n,n+1,1)):-1,Image:(e,t,n)=>33==t&&91==e.char(n+1)?e.append(new Ce(Se,n,n+2,1)):-1,LinkEnd(e,t,n){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof Ce&&(r.type==be||r.type==Se)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let s=e.takeContent(t),i=e.parts[t]=Ie(e,s,r.type==be?v.Link:v.Image,r.from,n+1);if(r.type==be)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof Ce&&t.type==be&&(t.side=0)}return i.to}}return-1}};function Ie(e,t,n,r,s){let{text:i}=e,o=e.char(s),a=s;if(t.unshift(ke(v.LinkMark,r,r+(n==v.Image?2:1))),t.push(ke(v.LinkMark,s-1,s)),40==o){let n,r=e.skipSpace(s+1),o=Te(i,r-e.offset,e.offset);o&&(r=e.skipSpace(o.to),r!=o.to&&(n=Be(i,r-e.offset,e.offset),n&&(r=e.skipSpace(n.to)))),41==e.char(r)&&(t.push(ke(v.LinkMark,s,s+1)),a=r+1,o&&t.push(o),n&&t.push(n),t.push(ke(v.LinkMark,r,a)))}else if(91==o){let n=Ee(i,s-e.offset,e.offset,!1);n&&(t.push(n),a=n.to)}return ke(n,r,a,t)}function Te(e,t,n){if(60==e.charCodeAt(t)){for(let r=t+1;r<e.length;r++){let s=e.charCodeAt(r);if(62==s)return ke(v.URL,t+n,r+1+n);if(60==s||10==s)return!1}return null}{let r=0,s=t;for(let t=!1;s<e.length;s++){let n=e.charCodeAt(s);if(O(n))break;if(t)t=!1;else if(40==n)r++;else if(41==n){if(!r)break;r--}else 92==n&&(t=!0)}return s>t?ke(v.URL,t+n,s+n):s==e.length&&null}}function Be(e,t,n){let r=e.charCodeAt(t);if(39!=r&&34!=r&&40!=r)return!1;let s=40==r?41:r;for(let r=t+1,i=!1;r<e.length;r++){let o=e.charCodeAt(r);if(i)i=!1;else{if(o==s)return ke(v.LinkTitle,t+n,r+1+n);92==o&&(i=!0)}}return null}function Ee(e,t,n,r){for(let s=!1,i=t+1,o=Math.min(e.length,i+999);i<o;i++){let o=e.charCodeAt(i);if(s)s=!1;else{if(93==o)return!r&&ke(v.LinkLabel,t+n,i+1+n);if(r&&!O(o)&&(r=!1),91==o)return!1;92==o&&(s=!0)}}return null}class ve{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new Ce(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Ce&&(t.type==be||t.type==Se))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof Ce&&n.type.resolve&&2&n.side))continue;let r,s=n.type==xe||n.type==Le,i=n.to-n.from,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof Ce&&1&e.side&&e.type==n.type&&!(s&&(1&n.side||2&e.side)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){r=e;break}}if(!r)continue;let a=n.type.resolve,l=[],h=r.from,f=n.to;if(s){let e=Math.min(2,r.to-r.from,i);h=r.to-e,f=n.from+e,a=1==e?"Emphasis":"StrongEmphasis"}r.type.mark&&l.push(this.elt(r.type.mark,h,r.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof me&&l.push(this.parts[e]),this.parts[e]=null;n.type.mark&&l.push(this.elt(n.type.mark,n.from,f));let c=this.elt(a,h,f,l);this.parts[o]=s&&r.from!=h?new Ce(r.type,r.from,h,r.side):null,(this.parts[t]=s&&n.to!=f?new Ce(n.type,f,n.to,n.side):null)?this.parts.splice(t,0,c):this.parts[t]=c}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof me&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof Ce&&n.type==e&&1&n.side)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Ce?t:null}skipSpace(e){return R(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return"string"==typeof e?ke(this.parser.getNodeType(e),t,n,r):new ge(e,t)}}function He(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof me&&(n[r]=new me(t.type,t.from,t.to,He(t.children,[e])))}else n.splice(r++,0,e)}return n}ve.linkStart=be,ve.imageStart=Se;const Me=[v.CodeBlock,v.ListItem,v.OrderedList,v.BulletList];class Pe{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(n.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,i=s,a=e.block.children.length,l=i,h=a;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let s=Ne(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,s);else{let n=new o(e.parser.nodeSet.types[v.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,s)}if(t.type.is("Block")&&(Me.indexOf(t.type.id)<0?(i=t.to-n,a=e.block.children.length):(i=l,a=h),l=t.to-n,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return i-s}}function Ne(e,t){let n=e;for(let r=1;r<t.length;r++){let s=t[r-1].to,i=t[r].from;s<e&&(n-=i-s)}return n}const Oe=i({"Blockquote/...":l.quote,HorizontalRule:l.contentSeparator,"ATXHeading1/... SetextHeading1/...":l.heading1,"ATXHeading2/... SetextHeading2/...":l.heading2,"ATXHeading3/...":l.heading3,"ATXHeading4/...":l.heading4,"ATXHeading5/...":l.heading5,"ATXHeading6/...":l.heading6,"Comment CommentBlock":l.comment,Escape:l.escape,Entity:l.character,"Emphasis/...":l.emphasis,"StrongEmphasis/...":l.strong,"Link/... Image/...":l.link,"OrderedList/... BulletList/...":l.list,"BlockQuote/...":l.quote,"InlineCode CodeText":l.monospace,"URL Autolink":l.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":l.processingInstruction,"CodeInfo LinkLabel":l.labelName,LinkTitle:l.string,Paragraph:l.content}),Re=new le(new s(ue).extend(Oe),Object.keys(Y).map(e=>Y[e]),Object.keys(Y).map(e=>re[e]),Object.keys(Y),se,N,Object.keys(Ae).map(e=>Ae[e]),Object.keys(Ae),[]);function Xe(e,t,n){let r=[];for(let s=e.firstChild,i=t;;s=s.nextSibling){let e=s?s.from:n;if(e>i&&r.push({from:i,to:e}),!s)break;i=s.to}return r}const ze={resolve:"Strikethrough",mark:"StrikethroughMark"},$e={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":l.strikethrough}},{name:"StrikethroughMark",style:l.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(126!=t||126!=e.char(n+1)||126==e.char(n+2))return-1;let r=e.slice(n-1,n),s=e.slice(n+2,n+3),i=/\s|^$/.test(r),o=/\s|^$/.test(s),a=ye.test(r),l=ye.test(s);return e.addDelimiter(ze,n,n+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function De(e,t,n=0,r,s=0){let i=0,o=!0,a=-1,l=-1,h=!1,f=()=>{r.push(e.elt("TableCell",s+a,s+l,e.parser.parseInline(t.slice(a,l),s+a)))};for(let c=n;c<t.length;c++){let n=t.charCodeAt(c);124!=n||h?(h||32!=n&&9!=n)&&(a<0&&(a=c),l=c+1):((!o||a>-1)&&i++,o=!1,r&&(a>-1&&f(),r.push(e.elt("TableDelimiter",c+s,c+s+1))),a=l=-1),h=!h&&92==n}return a>-1&&(i++,r&&f()),i}function je(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(124==t)return!0;92==t&&n++}return!1}const Fe=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class qe{constructor(){this.rows=null}nextLine(e,t,n){if(null==this.rows){let r;if(this.rows=!1,(45==t.next||58==t.next||124==t.next)&&Fe.test(r=t.text.slice(t.pos))){let s=[];De(e,n.content,0,s,n.start)==De(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];De(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return!!this.rows&&(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0)}}const Ue={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":l.heading}},"TableRow",{name:"TableCell",style:l.content},{name:"TableDelimiter",style:l.processingInstruction}],parseBlock:[{name:"Table",leaf:(e,t)=>je(t.content,0)?new qe:null,endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof qe)||!je(t.text,t.basePos))return!1;let r=e.peekLine();return Fe.test(r)&&De(e,t.text,t.basePos)==De(e,r,t.basePos)},before:"SetextHeading"}]};class _e{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Qe={defineNodes:[{name:"Task",block:!0,style:l.list},{name:"TaskMarker",style:l.atom}],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\][ \t]/.test(t.content)&&"ListItem"==e.parentType().name?new _e:null,after:"SetextHeading"}]},Ze=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Ve=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Ge=/[\w-]+\.[\w-]+($|\/)/,Ke=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Je=/\/[a-zA-Z\d@.]+/gy;function We(e,t,n,r){let s=0;for(let i=t;i<n;i++)e[i]==r&&s++;return s}function Ye(e,t){Ke.lastIndex=t;let n=Ke.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return"_"==r||"-"==r?-1:t+n[0].length-("."==r?1:0)}const et=[Ue,Qe,$e,{parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;Ze.lastIndex=r;let s=Ze.exec(e.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=function(e,t){Ve.lastIndex=t;let n=Ve.exec(e);if(!n||Ge.exec(n[0])[0].indexOf("_")>-1)return-1;let r=t+n[0].length;for(;;){let n,s=e[r-1];if(/[?!.,:*_~]/.test(s)||")"==s&&We(e,t,r,")")>We(e,t,r,"("))r--;else{if(";"!=s||!(n=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))break;r=t+n.index}}return r}(e.text,r+s[0].length),i>-1&&e.hasOpenLink){i=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,i))[0].length}}else s[3]?i=Ye(e.text,r):(i=Ye(e.text,r+s[0].length),i>-1&&"xmpp:"==s[0]&&(Je.lastIndex=i,s=Je.exec(e.text),s&&(i=s.index+s[0].length)));return i<0?-1:(e.addElement(e.elt("URL",n,i+e.offset)),i+e.offset)}}]}];function tt(e,t,n){return(r,s,i)=>{if(s!=e||r.char(i+1)==e)return-1;let o=[r.elt(n,i,i+1)];for(let s=i+1;s<r.end;s++){let a=r.char(s);if(a==e)return r.addElement(r.elt(t,i,s+1,o.concat(r.elt(n,s,s+1))));if(92==a&&o.push(r.elt("Escape",s,2+s++)),O(a))break}return-1}}const nt={defineNodes:[{name:"Superscript",style:l.special(l.content)},{name:"SuperscriptMark",style:l.processingInstruction}],parseInline:[{name:"Superscript",parse:tt(94,"Superscript","SuperscriptMark")}]},rt={defineNodes:[{name:"Subscript",style:l.special(l.content)},{name:"SubscriptMark",style:l.processingInstruction}],parseInline:[{name:"Subscript",parse:tt(126,"Subscript","SubscriptMark")}]},st={defineNodes:[{name:"Emoji",style:l.character}],parseInline:[{name:"Emoji",parse(e,t,n){let r;return 58==t&&(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?e.addElement(e.elt("Emoji",n,n+1+r[0].length)):-1}}]},it=x({commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}}}),ot=new n,at=Re.configure({props:[S.add(e=>!e.is("Block")||e.is("Document")||null!=lt(e)||function(e){return"OrderedList"==e.name||"BulletList"==e.name}(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),ot.add(lt),C.add({Document:()=>null}),w.add({Document:it})]});function lt(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function ht(e,t){let n=e;for(;;){let e,r=n.nextSibling;if(!r||null!=(e=lt(r.type))&&e<=t)break;n=r}return n.to}const ft=u.of((e,t,n)=>{for(let r=d(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(ot);if(null==e)continue;let t=ht(r,e);if(t>n)return{from:n,to:t}}return null});function ct(e){return new g(it,e,[],"markdown")}const ut=ct(at),dt=ct(at.configure([et,rt,nt,st,{props:[S.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));class pt{constructor(e,t,n,r,s,i,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=i,this.item=o}blank(e,t=!0){let n=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=e){for(;n.length<e;)n+=" ";return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=" ";return n+(t?this.spaceAfter:"")}marker(e,t){let n="OrderedList"==this.node.name?String(+gt(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function mt(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if("FencedCode"==t.name)return r;"ListItem"!=t.name&&"Blockquote"!=t.name||n.push(t)}for(let e=n.length-1;e>=0;e--){let s,i=n[e],o=t.lineAt(i.from),a=i.from-o.from;if("Blockquote"==i.name&&(s=/^ *>( ?)/.exec(o.text.slice(a))))r.push(new pt(i,a,a+s[0].length,"",s[1],">",null));else if("ListItem"==i.name&&"OrderedList"==i.parent.name&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(a)))){let e=s[3],t=s[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new pt(i.parent,a,a+t,s[1],e,s[2],i))}else if("ListItem"==i.name&&"BulletList"==i.parent.name&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(a)))){let e=s[4],t=s[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=s[2];s[3]&&(n+=s[3].replace(/[xX]/," ")),r.push(new pt(i.parent,a,a+t,s[1],e,n,i))}}return r}function gt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kt(e,t,n,r=0){for(let s=-1,i=e;;){if("ListItem"==i.name){let e=gt(i,t),o=+e[2];if(s>=0){if(o!=s+1)return;n.push({from:i.from+e[1].length,to:i.from+e[0].length,insert:String(s+2+r)})}s=o}let e=i.nextSibling;if(!e)break;i=e}}function xt(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||"\t"!=t.facet(k))return e;let r="";for(let t=m(e,4,n);t>0;)t>=4?(r+="\t",t-=4):(r+=" ",t--);return r+e.slice(n)}const Lt=(e={})=>({state:t,dispatch:n})=>{let r=d(t),{doc:s}=t,i=null,o=t.changeByRange(n=>{if(!n.empty||!dt.isActiveAt(t,n.from,-1)&&!dt.isActiveAt(t,n.from,1))return i={range:n};let o=n.from,a=s.lineAt(o),l=mt(r.resolveInner(o,-1),s);for(;l.length&&l[l.length-1].from>o-a.from;)l.pop();if(!l.length)return i={range:n};let h=l[l.length-1];if(h.to-h.spaceAfter.length>o-a.from)return i={range:n};let f=o>=h.to-h.spaceAfter.length&&!/\S/.test(a.text.slice(h.to));if(h.item&&f){let n=h.node.firstChild,r=h.node.getChild("ListItem","ListItem");if(n.to>=o||r&&r.to<o||a.from>0&&!/[^\s>]/.test(s.lineAt(a.from-1).text)||!1===e.nonTightLists){let e,t=l.length>1?l[l.length-2]:null,n="";t&&t.item?(e=a.from+t.from,n=t.marker(s,1)):e=a.from+(t?t.to:0);let r=[{from:e,to:o,insert:n}];return"OrderedList"==h.node.name&&kt(h.item,s,r,-2),t&&"OrderedList"==t.node.name&&kt(t.item,s,r),{range:p.cursor(e+n.length),changes:r}}{let e=Ct(l,t,a);return{range:p.cursor(o+e.length+1),changes:{from:a.from,insert:e+t.lineBreak}}}}if("Blockquote"==h.node.name&&f&&a.from){let e=s.lineAt(a.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==h.from){let s=t.changes([{from:e.from+r.index,to:e.to},{from:a.from+h.from,to:a.to}]);return{range:n.map(s),changes:s}}}let c=[];"OrderedList"==h.node.name&&kt(h.item,s,c);let u=h.item&&h.item.from<a.from,d="";if(!u||/^[\s\d.)\-+*>]*/.exec(a.text)[0].length>=h.to)for(let e=0,t=l.length-1;e<=t;e++)d+=e!=t||u?l[e].blank(e<t?m(a.text,4,l[e+1].from)-d.length:null):l[e].marker(s,1);let g=o;for(;g>a.from&&/\s/.test(a.text.charAt(g-a.from-1));)g--;return d=xt(d,t),function(e,t){if("OrderedList"!=e.name&&"BulletList"!=e.name)return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),i=t.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<i.number}(h.node,t.doc)&&(d=Ct(l,t,a)+t.lineBreak+d),c.push({from:g,to:o,insert:t.lineBreak+d}),{range:p.cursor(g+d.length+1),changes:c}});return!i&&(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},bt=Lt();function St(e){return"QuoteMark"==e.name||"ListMark"==e.name}function Ct(e,t,n){let r="";for(let t=0,s=e.length-2;t<=s;t++)r+=e[t].blank(t<s?m(n.text,4,e[t+1].from)-r.length:null,t<s);return xt(r,t)}const wt=({state:e,dispatch:t})=>{let n=d(e),r=null,s=e.changeByRange(t=>{let s=t.from,{doc:i}=e;if(t.empty&&dt.isActiveAt(e,t.from)){let t=i.lineAt(s),r=mt(function(e,t){let n=e.resolveInner(t,-1),r=t;St(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(St(e))r=e.from;else{if("OrderedList"!=e.name&&"BulletList"!=e.name)break;n=e.lastChild,r=n.to}return n}(n,s),i);if(r.length){let n=r[r.length-1],i=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(s-t.from>i&&!/\S/.test(t.text.slice(i,s-t.from)))return{range:p.cursor(t.from+i),changes:{from:t.from+i,to:s}};if(s-t.from==i&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let s=n.blank(m(t.text,4,n.to)-m(t.text,4,n.from));return r==t.from&&(s=xt(s,e)),{range:p.cursor(r+s.length),changes:{from:r,to:t.from+n.to,insert:s}}}if(r<s)return{range:p.cursor(r),changes:{from:r,to:s}}}}}return r={range:t}});return!r&&(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},yt=[{key:"Enter",run:bt},{key:"Backspace",run:wt}],At=T({matchClosingTags:!1});function It(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=ut,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=At}=e;if(!(s instanceof le))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u,d=e.extensions?[e.extensions]:[],p=[l.support,ft];o&&p.push(Ht),n instanceof h?(p.push(n.support),u=n.language):n&&(u=n);let m=t||u?(g=t,k=u,e=>{if(e&&g){let t=null;if(e=/\S*/.exec(e)[0],t="function"==typeof g?g(e):A.matchLanguageName(g,e,!0),t instanceof A)return t.support?t.support.language.parser:I.getSkippingParser(t.load());if(t)return t.parser}return k?k.parser:null}):void 0;var g,k;d.push(function(e){let{codeParser:t,htmlParser:n}=e,r=a((e,r)=>{let s=e.type.id;if(!t||s!=v.CodeBlock&&s!=v.FencedCode){if(n&&(s==v.HTMLBlock||s==v.HTMLTag||s==v.CommentBlock))return{parser:n,overlay:Xe(e.node,e.from,e.to)}}else{let n="";if(s==v.FencedCode){let t=e.node.getChild(v.CodeInfo);t&&(n=r.read(t.from,t.to))}let i=t(n);if(i)return{parser:i,overlay:e=>e.type.id==v.CodeText,bracketed:s==v.FencedCode}}return null});return{wrap:r}}({codeParser:m,htmlParser:l.language.parser})),r&&p.push(f.high(c.of(yt)));let x=ct(s.configure(d));return i&&p.push(x.data.of({autocomplete:Tt})),new h(x,p)}function Tt(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=d(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if("CodeBlock"==s.name||"FencedCode"==s.name||"ProcessingInstructionBlock"==s.name||"CommentBlock"==s.name||"Link"==s.name||"Image"==s.name)return null;s=s.parent}return{from:n-r[0].length,to:n,options:Et(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Bt=null;function Et(){if(Bt)return Bt;let e=B(new L(b.create({extensions:At}),0,!0));return Bt=e?e.options:[]}const vt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Ht=y.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s))return!1;if(/^www\./.test(s)&&(s="https://"+s),!dt.isActiveAt(t.state,r.from,1))return!1;let i=d(t.state),o=!1;return i.iterate({from:r.from,to:r.to,enter:e=>{(e.from>r.from||vt.test(e.name))&&(o=!0)},leave:e=>{e.to<r.to&&(o=!0)}}),!o&&(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});export{ut as commonmarkLanguage,wt as deleteMarkupBackward,bt as insertNewlineContinueMarkup,Lt as insertNewlineContinueMarkupCommand,It as markdown,yt as markdownKeymap,dt as markdownLanguage,Ht as pasteURLAsLink};
|
|
1
|
+
import{j as e,h as t,N as n,T as r,g as s,ah as i,m as o,ab as a,al as l,f as h,k as f,a6 as c,V as u,ak as d,E as p,x as m,d as g,a3 as k,G as x,a as L,b,U as S,a1 as C,a7 as w,c as y,e as A,P as I}from"./light-CK5396YO.js";import{html as T,htmlCompletionSource as B}from"./index-Ci0TIrsP.js";import"./index-CncjGRa9.js";import"./index-CQTsT8Zj.js";import"./index-DklIqAi8.js";class E{static create(e,t,n,r,s){return new E(e,t,n,r+(r<<8)+e+(t<<4)|0,s,[],[])}constructor(e,t,r,s,i,o,a){this.type=e,this.value=t,this.from=r,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[n.contextHash,s]]}addChild(e,t){e.prop(n.contextHash)!=this.hash&&(e=new o(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new o(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(e,n,r)=>new o(t.none,e,n,r,this.hashProp)})}}var v;!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"}(v||(v={}));class H{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class M{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return R(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=9==this.text.charCodeAt(r)?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=9==this.text.charCodeAt(t)?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function P(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==v.OrderedList?q:F)(n,t,!1);return r>0&&(e.type!=v.BulletList||D(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}const N={[v.Blockquote]:(e,t,n)=>62==n.next&&(n.markers.push(ke(v.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(O(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0),[v.ListItem]:(e,t,n)=>!(n.indent<n.baseIndent+e.value&&n.next>-1)&&(n.moveBaseColumn(n.baseIndent+e.value),!0),[v.OrderedList]:P,[v.BulletList]:P,[v.Document]:()=>!0};function O(e){return 32==e||9==e||10==e||13==e}function R(e,t=0){for(;t<e.length&&O(e.charCodeAt(t));)t++;return t}function X(e,t,n){for(;t>n&&O(e.charCodeAt(t-1));)t--;return t}function z(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(96==e.next)for(let n=t;n<e.text.length;n++)if(96==e.text.charCodeAt(n))return-1;return t}function $(e){return 62!=e.next?-1:32==e.text.charCodeAt(e.pos+1)?2:1}function D(e,t,n){if(42!=e.next&&45!=e.next&&95!=e.next)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!O(n))return-1}return n&&45==e.next&&_(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(re.SetextHeading)>-1||r<3?-1:1}function j(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function F(e,t,n){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!O(e.text.charCodeAt(e.pos+1))||!(!n||j(t,v.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?-1:1}function q(e,t,n){let r=e.pos,s=e.next;for(;s>=48&&s<=57;){if(r++,r==e.text.length)return-1;s=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||46!=s&&41!=s||r<e.text.length-1&&!O(e.text.charCodeAt(r+1))||n&&!j(t,v.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||49!=e.next)?-1:r+1-e.pos}function U(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&35==e.text.charCodeAt(t);)t++;if(t<e.text.length&&32!=e.text.charCodeAt(t))return-1;let n=t-e.pos;return n>6?-1:n}function _(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&O(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}const Q=/^[ \t]*$/,Z=/-->/,V=/\?>/,G=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Z],[/^\s*<\?/,V],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Q],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Q]];function K(e,t,n){if(60!=e.next)return-1;let r=e.text.slice(e.pos);for(let e=0,t=G.length-(n?1:0);e<t;e++)if(G[e][0].test(r))return e;return-1}function J(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function W(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==v.CodeText?e[r].to=n:e.push(ke(v.CodeText,t,n))}const Y={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),s=e.lineStart+r,i=e.lineStart+t.text.length,o=[],a=[];for(W(o,s,i);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){W(a,e.lineStart-1,e.lineStart);for(let e of t.markers)a.push(e)}else{if(t.indent<n)break;{if(a.length){for(let e of a)e.type==v.CodeText?W(o,e.from,e.to):o.push(e);a=[]}W(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);i=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<i&&W(o,n,i)}}return a.length&&(a=a.filter(e=>e.type!=v.CodeText),a.length&&(t.markers=a.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-s).finish(v.CodeBlock,i-s),s),!0},FencedCode(e,t){let n=z(t);if(n<0)return!1;let r=e.lineStart+t.pos,s=t.next,i=n-t.pos,o=t.skipSpace(n),a=X(t.text,t.text.length,o),l=[ke(v.CodeMark,r,r+i)];o<a&&l.push(ke(v.CodeInfo,e.lineStart+o,e.lineStart+a));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let a=t.pos;if(t.indent-t.baseIndent<4)for(;a<t.text.length&&t.text.charCodeAt(a)==s;)a++;if(a-t.pos>=i&&t.skipSpace(a)==t.text.length){for(let e of t.markers)l.push(e);r&&o&&W(l,e.lineStart-1,e.lineStart),l.push(ke(v.CodeMark,e.lineStart+t.pos,e.lineStart+a)),e.nextLine();break}{o=!0,n||(W(l,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)l.push(e);let s=e.lineStart+t.basePos,i=e.lineStart+t.text.length;s<i&&(W(l,s,i),r=!1)}}return e.addNode(e.buffer.writeElements(l,-r).finish(v.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=$(t);return!(n<0)&&(e.startContext(v.Blockquote,t.pos),e.addNode(v.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(D(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(v.HorizontalRule,n),!0},BulletList(e,t){let n=F(t,e,!1);if(n<0)return!1;e.block.type!=v.BulletList&&e.startContext(v.BulletList,t.basePos,t.next);let r=J(t,t.pos+1);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=q(t,e,!1);if(n<0)return!1;e.block.type!=v.OrderedList&&e.startContext(v.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=J(t,t.pos+n);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=U(t);if(n<0)return!1;let r=t.pos,s=e.lineStart+r,i=X(t.text,t.text.length,r),o=i;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;o!=i&&o!=r&&O(t.text.charCodeAt(o-1))||(o=t.text.length);let a=e.buffer.write(v.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),s+n+1),-s);o<t.text.length&&a.write(v.HeaderMark,o-r,i-r);let l=a.finish(v.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(l,s),!0},HTMLBlock(e,t){let n=K(t,0,!1);if(n<0)return!1;let r=e.lineStart+t.pos,s=G[n][1],i=[],o=s!=Q;for(;!s.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)i.push(e)}o&&e.nextLine();let a=s==Z?v.CommentBlock:s==V?v.ProcessingInstructionBlock:v.HTMLBlock,l=e.prevLineEnd();return e.addNode(e.buffer.writeElements(i,-r).finish(a,l-r),r),!0},SetextHeading:void 0};class ee{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(-1==this.stage)return!1;let r=n.content+"\n"+t.scrub(),s=this.advance(r);return s>-1&&s<r.length&&this.complete(e,n,s)}finish(e,t){return(2==this.stage||3==this.stage)&&R(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,ke(v.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(!1===e&&(this.stage=-1),!1)}advance(e){for(;;){if(-1==this.stage)return-1;if(0==this.stage){if(!this.nextStage(Ee(e,this.pos,this.start,!0)))return-1;if(58!=e.charCodeAt(this.pos))return this.stage=-1;this.elts.push(ke(v.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else{if(1!=this.stage){if(2==this.stage){let t=R(e,this.pos),n=0;if(t>this.pos){let r=Be(e,t,this.start);if(r){let t=te(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||(n=te(e,this.pos)),n>0&&n<e.length?n:-1}return te(e,this.pos)}if(!this.nextStage(Te(e,R(e,this.pos),this.start)))return-1}}}}function te(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(10==n)break;if(!O(n))return-1}return t}class ne{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:_(t),s=t.next;if(r<0)return!1;let i=ke(v.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,ke(61==s?v.SetextHeading1:v.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),i])),!0}finish(){return!1}}const re={LinkReference:(e,t)=>91==t.content.charCodeAt(0)?new ee(t):null,SetextHeading:()=>new ne},se=[(e,t)=>U(t)>=0,(e,t)=>z(t)>=0,(e,t)=>$(t)>=0,(e,t)=>F(t,e,!0)>=0,(e,t)=>q(t,e,!0)>=0,(e,t)=>D(t,e,!0)>=0,(e,t)=>K(t,0,!0)>=0],ie={text:"",end:0};class oe{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new M,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=E.create(v.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Pe(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(null!=this.stoppedAt&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(0!=n){if(1==n)return null;e.forward();continue e}}break}let t=new H(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4)for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e;for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+="\n"+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return!!t&&(this.absoluteLineStart+=t,this.lineStart=Ne(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0)}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=ie;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,s=this.lineChunkAt(r);t.end=r+s.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+s,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw new Error("Unhandled block context "+v[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t,n=this.input.chunk(e);if(this.input.lineChunks)t="\n"==n?"":n;else{let e=n.indexOf("\n");t=e<0?n:n.slice(0,e)}return e+t.length>this.to?t.slice(0,this.to-e):t}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=E.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){"number"==typeof e&&(e=new o(this.parser.nodeSet.types[e],de,de,(null!=n?n:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(He(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?ae(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=He(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(v.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return"string"==typeof e?ke(this.parser.getNodeType(e),t,n,r):new ge(e,t)}get buffer(){return new pe(this.parser.nodeSet)}}function ae(e,t,n,r,s){let i=e[t].to,a=[],l=[],h=n.from+r;function f(n,s){for(;s?n>=i:n>i;){let s=e[t+1].from-i;r+=s,n+=s,t++,i=e[t].to}}for(let o=n.firstChild;o;o=o.nextSibling){f(o.from+r,!0);let n,c=o.from+r,u=s.get(o.tree);u?n=u:o.to+r>i?(n=ae(e,t,o,r,s),f(o.to+r,!1)):n=o.toTree(),a.push(n),l.push(c-h)}return f(n.to+r,!1),new o(n.type,a,l,n.to+r-h,n.tree?n.tree.propValues:void 0)}class le extends e{constructor(e,t,n,r,s,i,o,a,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=i,this.inlineParsers=o,this.inlineNames=a,this.wrappers=l,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new oe(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let o=fe(e);if(!o)return this;let{nodeSet:a,skipContextMarkup:l}=this,h=this.blockParsers.slice(),f=this.leafBlockParsers.slice(),c=this.blockNames.slice(),u=this.inlineParsers.slice(),d=this.inlineNames.slice(),p=this.endLeafBlock.slice(),m=this.wrappers;if(he(o.defineNodes)){l=Object.assign({},l);let e,h=a.types.slice();for(let s of o.defineNodes){let{name:i,block:o,composite:a,style:f}="string"==typeof s?{name:s}:s;if(h.some(e=>e.name==i))continue;a&&(l[h.length]=(e,t,n)=>a(t,n,e.value));let c=h.length,u=a?["Block","BlockContext"]:o?c>=v.ATXHeading1&&c<=v.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(t.define({id:c,name:i,props:u&&[[n.group,u]]})),f&&(e||(e={}),Array.isArray(f)||f instanceof r?e[i]=f:Object.assign(e,f))}a=new s(h),e&&(a=a.extend(i(e)))}if(he(o.props)&&(a=a.extend(...o.props)),he(o.remove))for(let e of o.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(h[t]=f[t]=void 0),n>-1&&(u[n]=void 0)}if(he(o.parseBlock))for(let e of o.parseBlock){let t=c.indexOf(e.name);if(t>-1)h[t]=e.parse,f[t]=e.leaf;else{let t=e.before?ce(c,e.before):e.after?ce(c,e.after)+1:c.length-1;h.splice(t,0,e.parse),f.splice(t,0,e.leaf),c.splice(t,0,e.name)}e.endLeaf&&p.push(e.endLeaf)}if(he(o.parseInline))for(let e of o.parseInline){let t=d.indexOf(e.name);if(t>-1)u[t]=e.parse;else{let t=e.before?ce(d,e.before):e.after?ce(d,e.after)+1:d.length-1;u.splice(t,0,e.parse),d.splice(t,0,e.name)}}return o.wrap&&(m=m.concat(o.wrap)),new le(a,h,f,c,p,l,u,d,m)}getNodeType(e){let t=this.nodeTypes[e];if(null==t)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new ve(this,e,t);e:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let s=r(n,t,e);if(s>=0){e=s;continue e}}e++}return n.resolveMarkers(0)}}function he(e){return null!=e&&e.length>0}function fe(e){if(!Array.isArray(e))return e;if(0==e.length)return null;let t=fe(e[0]);if(1==e.length)return t;let n=fe(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||de).concat(t||de),s=t.wrap,i=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:s?i?(e,t,n,r)=>s(i(e,t,n,r),t,n,r):s:i}}function ce(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let ue=[t.none];for(let e,r=1;e=v[r];r++)ue[r]=t.define({id:r,name:e,props:r>=v.Escape?[]:[[n.group,r in N?["Block","BlockContext"]:["Block","LeafBlock"]]],top:"Document"==e});const de=[];class pe{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+4*r),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return o.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}class me{constructor(e,t,n,r=de){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new pe(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}}class ge{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return de}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function ke(e,t,n,r){return new me(e,t,n,r)}const xe={resolve:"Emphasis",mark:"EmphasisMark"},Le={resolve:"Emphasis",mark:"EmphasisMark"},be={},Se={};class Ce{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}}const we="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let ye=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{ye=new RegExp("[\\p{S}|\\p{P}]","u")}catch(e){}const Ae={Escape(e,t,n){if(92!=t||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(we.charCodeAt(t)==r)return e.append(ke(v.Escape,n,n+2));return-1},Entity(e,t,n){if(38!=t)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(ke(v.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(96!=t||n&&96==e.char(n-1))return-1;let r=n+1;for(;r<e.end&&96==e.char(r);)r++;let s=r-n,i=0;for(;r<e.end;r++)if(96==e.char(r)){if(i++,i==s&&96!=e.char(r+1))return e.append(ke(v.InlineCode,n,r+1,[ke(v.CodeMark,n,n+s),ke(v.CodeMark,r+1-s,r+1)]))}else i=0;return-1},HTMLTag(e,t,n){if(60!=t||n==e.end-1)return-1;let r=e.slice(n+1,e.end),s=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(s)return e.append(ke(v.Autolink,n,n+1+s[0].length,[ke(v.LinkMark,n,n+1),ke(v.URL,n+1,n+s[0].length),ke(v.LinkMark,n+s[0].length,n+1+s[0].length)]));let i=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(i)return e.append(ke(v.Comment,n,n+1+i[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(ke(v.ProcessingInstruction,n,n+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return a?e.append(ke(v.HTMLTag,n,n+1+a[0].length)):-1},Emphasis(e,t,n){if(95!=t&&42!=t)return-1;let r=n+1;for(;e.char(r)==t;)r++;let s=e.slice(n-1,n),i=e.slice(r,r+1),o=ye.test(s),a=ye.test(i),l=/\s|^$/.test(s),h=/\s|^$/.test(i),f=!h&&(!a||l||o),c=!l&&(!o||h||a),u=f&&(42==t||!c||o),d=c&&(42==t||!f||a);return e.append(new Ce(95==t?xe:Le,n,r,(u?1:0)|(d?2:0)))},HardBreak(e,t,n){if(92==t&&10==e.char(n+1))return e.append(ke(v.HardBreak,n,n+2));if(32==t){let t=n+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=n+2)return e.append(ke(v.HardBreak,n,t+1))}return-1},Link:(e,t,n)=>91==t?e.append(new Ce(be,n,n+1,1)):-1,Image:(e,t,n)=>33==t&&91==e.char(n+1)?e.append(new Ce(Se,n,n+2,1)):-1,LinkEnd(e,t,n){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof Ce&&(r.type==be||r.type==Se)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let s=e.takeContent(t),i=e.parts[t]=Ie(e,s,r.type==be?v.Link:v.Image,r.from,n+1);if(r.type==be)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof Ce&&t.type==be&&(t.side=0)}return i.to}}return-1}};function Ie(e,t,n,r,s){let{text:i}=e,o=e.char(s),a=s;if(t.unshift(ke(v.LinkMark,r,r+(n==v.Image?2:1))),t.push(ke(v.LinkMark,s-1,s)),40==o){let n,r=e.skipSpace(s+1),o=Te(i,r-e.offset,e.offset);o&&(r=e.skipSpace(o.to),r!=o.to&&(n=Be(i,r-e.offset,e.offset),n&&(r=e.skipSpace(n.to)))),41==e.char(r)&&(t.push(ke(v.LinkMark,s,s+1)),a=r+1,o&&t.push(o),n&&t.push(n),t.push(ke(v.LinkMark,r,a)))}else if(91==o){let n=Ee(i,s-e.offset,e.offset,!1);n&&(t.push(n),a=n.to)}return ke(n,r,a,t)}function Te(e,t,n){if(60==e.charCodeAt(t)){for(let r=t+1;r<e.length;r++){let s=e.charCodeAt(r);if(62==s)return ke(v.URL,t+n,r+1+n);if(60==s||10==s)return!1}return null}{let r=0,s=t;for(let t=!1;s<e.length;s++){let n=e.charCodeAt(s);if(O(n))break;if(t)t=!1;else if(40==n)r++;else if(41==n){if(!r)break;r--}else 92==n&&(t=!0)}return s>t?ke(v.URL,t+n,s+n):s==e.length&&null}}function Be(e,t,n){let r=e.charCodeAt(t);if(39!=r&&34!=r&&40!=r)return!1;let s=40==r?41:r;for(let r=t+1,i=!1;r<e.length;r++){let o=e.charCodeAt(r);if(i)i=!1;else{if(o==s)return ke(v.LinkTitle,t+n,r+1+n);92==o&&(i=!0)}}return null}function Ee(e,t,n,r){for(let s=!1,i=t+1,o=Math.min(e.length,i+999);i<o;i++){let o=e.charCodeAt(i);if(s)s=!1;else{if(93==o)return!r&&ke(v.LinkLabel,t+n,i+1+n);if(r&&!O(o)&&(r=!1),91==o)return!1;92==o&&(s=!0)}}return null}class ve{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new Ce(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Ce&&(t.type==be||t.type==Se))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof Ce&&n.type.resolve&&2&n.side))continue;let r,s=n.type==xe||n.type==Le,i=n.to-n.from,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof Ce&&1&e.side&&e.type==n.type&&!(s&&(1&n.side||2&e.side)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){r=e;break}}if(!r)continue;let a=n.type.resolve,l=[],h=r.from,f=n.to;if(s){let e=Math.min(2,r.to-r.from,i);h=r.to-e,f=n.from+e,a=1==e?"Emphasis":"StrongEmphasis"}r.type.mark&&l.push(this.elt(r.type.mark,h,r.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof me&&l.push(this.parts[e]),this.parts[e]=null;n.type.mark&&l.push(this.elt(n.type.mark,n.from,f));let c=this.elt(a,h,f,l);this.parts[o]=s&&r.from!=h?new Ce(r.type,r.from,h,r.side):null,(this.parts[t]=s&&n.to!=f?new Ce(n.type,f,n.to,n.side):null)?this.parts.splice(t,0,c):this.parts[t]=c}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof me&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof Ce&&n.type==e&&1&n.side)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Ce?t:null}skipSpace(e){return R(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return"string"==typeof e?ke(this.parser.getNodeType(e),t,n,r):new ge(e,t)}}function He(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof me&&(n[r]=new me(t.type,t.from,t.to,He(t.children,[e])))}else n.splice(r++,0,e)}return n}ve.linkStart=be,ve.imageStart=Se;const Me=[v.CodeBlock,v.ListItem,v.OrderedList,v.BulletList];class Pe{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(n.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,i=s,a=e.block.children.length,l=i,h=a;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let s=Ne(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,s);else{let n=new o(e.parser.nodeSet.types[v.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,s)}if(t.type.is("Block")&&(Me.indexOf(t.type.id)<0?(i=t.to-n,a=e.block.children.length):(i=l,a=h),l=t.to-n,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return i-s}}function Ne(e,t){let n=e;for(let r=1;r<t.length;r++){let s=t[r-1].to,i=t[r].from;s<e&&(n-=i-s)}return n}const Oe=i({"Blockquote/...":l.quote,HorizontalRule:l.contentSeparator,"ATXHeading1/... SetextHeading1/...":l.heading1,"ATXHeading2/... SetextHeading2/...":l.heading2,"ATXHeading3/...":l.heading3,"ATXHeading4/...":l.heading4,"ATXHeading5/...":l.heading5,"ATXHeading6/...":l.heading6,"Comment CommentBlock":l.comment,Escape:l.escape,Entity:l.character,"Emphasis/...":l.emphasis,"StrongEmphasis/...":l.strong,"Link/... Image/...":l.link,"OrderedList/... BulletList/...":l.list,"BlockQuote/...":l.quote,"InlineCode CodeText":l.monospace,"URL Autolink":l.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":l.processingInstruction,"CodeInfo LinkLabel":l.labelName,LinkTitle:l.string,Paragraph:l.content}),Re=new le(new s(ue).extend(Oe),Object.keys(Y).map(e=>Y[e]),Object.keys(Y).map(e=>re[e]),Object.keys(Y),se,N,Object.keys(Ae).map(e=>Ae[e]),Object.keys(Ae),[]);function Xe(e,t,n){let r=[];for(let s=e.firstChild,i=t;;s=s.nextSibling){let e=s?s.from:n;if(e>i&&r.push({from:i,to:e}),!s)break;i=s.to}return r}const ze={resolve:"Strikethrough",mark:"StrikethroughMark"},$e={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":l.strikethrough}},{name:"StrikethroughMark",style:l.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(126!=t||126!=e.char(n+1)||126==e.char(n+2))return-1;let r=e.slice(n-1,n),s=e.slice(n+2,n+3),i=/\s|^$/.test(r),o=/\s|^$/.test(s),a=ye.test(r),l=ye.test(s);return e.addDelimiter(ze,n,n+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function De(e,t,n=0,r,s=0){let i=0,o=!0,a=-1,l=-1,h=!1,f=()=>{r.push(e.elt("TableCell",s+a,s+l,e.parser.parseInline(t.slice(a,l),s+a)))};for(let c=n;c<t.length;c++){let n=t.charCodeAt(c);124!=n||h?(h||32!=n&&9!=n)&&(a<0&&(a=c),l=c+1):((!o||a>-1)&&i++,o=!1,r&&(a>-1&&f(),r.push(e.elt("TableDelimiter",c+s,c+s+1))),a=l=-1),h=!h&&92==n}return a>-1&&(i++,r&&f()),i}function je(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(124==t)return!0;92==t&&n++}return!1}const Fe=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class qe{constructor(){this.rows=null}nextLine(e,t,n){if(null==this.rows){let r;if(this.rows=!1,(45==t.next||58==t.next||124==t.next)&&Fe.test(r=t.text.slice(t.pos))){let s=[];De(e,n.content,0,s,n.start)==De(e,r,0)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];De(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return!!this.rows&&(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0)}}const Ue={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":l.heading}},"TableRow",{name:"TableCell",style:l.content},{name:"TableDelimiter",style:l.processingInstruction}],parseBlock:[{name:"Table",leaf:(e,t)=>je(t.content,0)?new qe:null,endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof qe)||!je(t.text,t.basePos))return!1;let r=e.peekLine();return Fe.test(r)&&De(e,t.text,t.basePos)==De(e,r,t.basePos)},before:"SetextHeading"}]};class _e{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Qe={defineNodes:[{name:"Task",block:!0,style:l.list},{name:"TaskMarker",style:l.atom}],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\][ \t]/.test(t.content)&&"ListItem"==e.parentType().name?new _e:null,after:"SetextHeading"}]},Ze=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Ve=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,Ge=/[\w-]+\.[\w-]+($|[/:])/,Ke=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Je=/\/[a-zA-Z\d@.]+/gy;function We(e,t,n,r){let s=0;for(let i=t;i<n;i++)e[i]==r&&s++;return s}function Ye(e,t){Ke.lastIndex=t;let n=Ke.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return"_"==r||"-"==r?-1:t+n[0].length-("."==r?1:0)}const et=[Ue,Qe,$e,{parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;Ze.lastIndex=r;let s=Ze.exec(e.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=function(e,t){Ve.lastIndex=t;let n=Ve.exec(e);if(!n||Ge.exec(n[0])[0].indexOf("_")>-1)return-1;let r=t+n[0].length;for(;;){let n,s=e[r-1];if(/[?!.,:*_~]/.test(s)||")"==s&&We(e,t,r,")")>We(e,t,r,"("))r--;else{if(";"!=s||!(n=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))break;r=t+n.index}}return r}(e.text,r+s[0].length),i>-1&&e.hasOpenLink){i=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,i))[0].length}}else s[3]?i=Ye(e.text,r):(i=Ye(e.text,r+s[0].length),i>-1&&"xmpp:"==s[0]&&(Je.lastIndex=i,s=Je.exec(e.text),s&&(i=s.index+s[0].length)));return i<0?-1:(e.addElement(e.elt("URL",n,i+e.offset)),i+e.offset)}}]}];function tt(e,t,n){return(r,s,i)=>{if(s!=e||r.char(i+1)==e)return-1;let o=[r.elt(n,i,i+1)];for(let s=i+1;s<r.end;s++){let a=r.char(s);if(a==e)return r.addElement(r.elt(t,i,s+1,o.concat(r.elt(n,s,s+1))));if(92==a&&o.push(r.elt("Escape",s,2+s++)),O(a))break}return-1}}const nt={defineNodes:[{name:"Superscript",style:l.special(l.content)},{name:"SuperscriptMark",style:l.processingInstruction}],parseInline:[{name:"Superscript",parse:tt(94,"Superscript","SuperscriptMark")}]},rt={defineNodes:[{name:"Subscript",style:l.special(l.content)},{name:"SubscriptMark",style:l.processingInstruction}],parseInline:[{name:"Subscript",parse:tt(126,"Subscript","SubscriptMark")}]},st={defineNodes:[{name:"Emoji",style:l.character}],parseInline:[{name:"Emoji",parse(e,t,n){let r;return 58==t&&(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?e.addElement(e.elt("Emoji",n,n+1+r[0].length)):-1}}]},it=x({commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}}}),ot=new n,at=Re.configure({props:[S.add(e=>!e.is("Block")||e.is("Document")||null!=lt(e)||function(e){return"OrderedList"==e.name||"BulletList"==e.name}(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),ot.add(lt),C.add({Document:()=>null}),w.add({Document:it})]});function lt(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function ht(e,t){let n=e;for(;;){let e,r=n.nextSibling;if(!r||null!=(e=lt(r.type))&&e<=t)break;n=r}return n.to}const ft=u.of((e,t,n)=>{for(let r=d(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(ot);if(null==e)continue;let t=ht(r,e);if(t>n)return{from:n,to:t}}return null});function ct(e){return new g(it,e,[],"markdown")}const ut=ct(at),dt=ct(at.configure([et,rt,nt,st,{props:[S.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));class pt{constructor(e,t,n,r,s,i,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=i,this.item=o}blank(e,t=!0){let n=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=e){for(;n.length<e;)n+=" ";return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=" ";return n+(t?this.spaceAfter:"")}marker(e,t){let n="OrderedList"==this.node.name?String(+gt(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function mt(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if("FencedCode"==t.name)return r;"ListItem"!=t.name&&"Blockquote"!=t.name||n.push(t)}for(let e=n.length-1;e>=0;e--){let s,i=n[e],o=t.lineAt(i.from),a=i.from-o.from;if("Blockquote"==i.name&&(s=/^ *>( ?)/.exec(o.text.slice(a))))r.push(new pt(i,a,a+s[0].length,"",s[1],">",null));else if("ListItem"==i.name&&"OrderedList"==i.parent.name&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(a)))){let e=s[3],t=s[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new pt(i.parent,a,a+t,s[1],e,s[2],i))}else if("ListItem"==i.name&&"BulletList"==i.parent.name&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(a)))){let e=s[4],t=s[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=s[2];s[3]&&(n+=s[3].replace(/[xX]/," ")),r.push(new pt(i.parent,a,a+t,s[1],e,n,i))}}return r}function gt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kt(e,t,n,r=0){for(let s=-1,i=e;;){if("ListItem"==i.name){let e=gt(i,t),o=+e[2];if(s>=0){if(o!=s+1)return;n.push({from:i.from+e[1].length,to:i.from+e[0].length,insert:String(s+2+r)})}s=o}let e=i.nextSibling;if(!e)break;i=e}}function xt(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||"\t"!=t.facet(k))return e;let r="";for(let t=m(e,4,n);t>0;)t>=4?(r+="\t",t-=4):(r+=" ",t--);return r+e.slice(n)}const Lt=(e={})=>({state:t,dispatch:n})=>{let r=d(t),{doc:s}=t,i=null,o=t.changeByRange(n=>{if(!n.empty||!dt.isActiveAt(t,n.from,-1)&&!dt.isActiveAt(t,n.from,1))return i={range:n};let o=n.from,a=s.lineAt(o),l=mt(r.resolveInner(o,-1),s);for(;l.length&&l[l.length-1].from>o-a.from;)l.pop();if(!l.length)return i={range:n};let h=l[l.length-1];if(h.to-h.spaceAfter.length>o-a.from)return i={range:n};let f=o>=h.to-h.spaceAfter.length&&!/\S/.test(a.text.slice(h.to));if(h.item&&f){let n=h.node.firstChild,r=h.node.getChild("ListItem","ListItem");if(n.to>=o||r&&r.to<o||a.from>0&&!/[^\s>]/.test(s.lineAt(a.from-1).text)||!1===e.nonTightLists){let e,t=l.length>1?l[l.length-2]:null,n="";t&&t.item?(e=a.from+t.from,n=t.marker(s,1)):e=a.from+(t?t.to:0);let r=[{from:e,to:o,insert:n}];return"OrderedList"==h.node.name&&kt(h.item,s,r,-2),t&&"OrderedList"==t.node.name&&kt(t.item,s,r),{range:p.cursor(e+n.length),changes:r}}{let e=Ct(l,t,a);return{range:p.cursor(o+e.length+1),changes:{from:a.from,insert:e+t.lineBreak}}}}if("Blockquote"==h.node.name&&f&&a.from){let e=s.lineAt(a.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==h.from){let s=t.changes([{from:e.from+r.index,to:e.to},{from:a.from+h.from,to:a.to}]);return{range:n.map(s),changes:s}}}let c=[];"OrderedList"==h.node.name&&kt(h.item,s,c);let u=h.item&&h.item.from<a.from,d="";if(!u||/^[\s\d.)\-+*>]*/.exec(a.text)[0].length>=h.to)for(let e=0,t=l.length-1;e<=t;e++)d+=e!=t||u?l[e].blank(e<t?m(a.text,4,l[e+1].from)-d.length:null):l[e].marker(s,1);let g=o;for(;g>a.from&&/\s/.test(a.text.charAt(g-a.from-1));)g--;return d=xt(d,t),function(e,t){if("OrderedList"!=e.name&&"BulletList"!=e.name)return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),i=t.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<i.number}(h.node,t.doc)&&(d=Ct(l,t,a)+t.lineBreak+d),c.push({from:g,to:o,insert:t.lineBreak+d}),{range:p.cursor(g+d.length+1),changes:c}});return!i&&(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},bt=Lt();function St(e){return"QuoteMark"==e.name||"ListMark"==e.name}function Ct(e,t,n){let r="";for(let t=0,s=e.length-2;t<=s;t++)r+=e[t].blank(t<s?m(n.text,4,e[t+1].from)-r.length:null,t<s);return xt(r,t)}const wt=({state:e,dispatch:t})=>{let n=d(e),r=null,s=e.changeByRange(t=>{let s=t.from,{doc:i}=e;if(t.empty&&dt.isActiveAt(e,t.from)){let t=i.lineAt(s),r=mt(function(e,t){let n=e.resolveInner(t,-1),r=t;St(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(St(e))r=e.from;else{if("OrderedList"!=e.name&&"BulletList"!=e.name)break;n=e.lastChild,r=n.to}return n}(n,s),i);if(r.length){let n=r[r.length-1],i=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(s-t.from>i&&!/\S/.test(t.text.slice(i,s-t.from)))return{range:p.cursor(t.from+i),changes:{from:t.from+i,to:s}};if(s-t.from==i&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let s=n.blank(m(t.text,4,n.to)-m(t.text,4,n.from));return r==t.from&&(s=xt(s,e)),{range:p.cursor(r+s.length),changes:{from:r,to:t.from+n.to,insert:s}}}if(r<s)return{range:p.cursor(r),changes:{from:r,to:s}}}}}return r={range:t}});return!r&&(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},yt=[{key:"Enter",run:bt},{key:"Backspace",run:wt}],At=T({matchClosingTags:!1});function It(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=ut,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=At}=e;if(!(s instanceof le))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u,d=e.extensions?[e.extensions]:[],p=[l.support,ft];o&&p.push(Ht),n instanceof h?(p.push(n.support),u=n.language):n&&(u=n);let m=t||u?(g=t,k=u,e=>{if(e&&g){let t=null;if(e=/\S*/.exec(e)[0],t="function"==typeof g?g(e):A.matchLanguageName(g,e,!0),t instanceof A)return t.support?t.support.language.parser:I.getSkippingParser(t.load());if(t)return t.parser}return k?k.parser:null}):void 0;var g,k;d.push(function(e){let{codeParser:t,htmlParser:n}=e,r=a((e,r)=>{let s=e.type.id;if(!t||s!=v.CodeBlock&&s!=v.FencedCode){if(n&&(s==v.HTMLBlock||s==v.HTMLTag||s==v.CommentBlock))return{parser:n,overlay:Xe(e.node,e.from,e.to)}}else{let n="";if(s==v.FencedCode){let t=e.node.getChild(v.CodeInfo);t&&(n=r.read(t.from,t.to))}let i=t(n);if(i)return{parser:i,overlay:e=>e.type.id==v.CodeText,bracketed:s==v.FencedCode}}return null});return{wrap:r}}({codeParser:m,htmlParser:l.language.parser})),r&&p.push(f.high(c.of(yt)));let x=ct(s.configure(d));return i&&p.push(x.data.of({autocomplete:Tt})),new h(x,p)}function Tt(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=d(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if("CodeBlock"==s.name||"FencedCode"==s.name||"ProcessingInstructionBlock"==s.name||"CommentBlock"==s.name||"Link"==s.name||"Image"==s.name)return null;s=s.parent}return{from:n-r[0].length,to:n,options:Et(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Bt=null;function Et(){if(Bt)return Bt;let e=B(new L(b.create({extensions:At}),0,!0));return Bt=e?e.options:[]}const vt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Ht=y.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s))return!1;if(/^www\./.test(s)&&(s="https://"+s),!dt.isActiveAt(t.state,r.from,1))return!1;let i=d(t.state),o=!1;return i.iterate({from:r.from,to:r.to,enter:e=>{(e.from>r.from||vt.test(e.name))&&(o=!0)},leave:e=>{e.to<r.to&&(o=!0)}}),!o&&(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});export{ut as commonmarkLanguage,wt as deleteMarkupBackward,bt as insertNewlineContinueMarkup,Lt as insertNewlineContinueMarkupCommand,It as markdown,yt as markdownKeymap,dt as markdownLanguage,Ht as pasteURLAsLink};
|