@teammy/server 0.2.20 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/main.js +8784 -7601
  2. package/dist/web/assets/Assistant-Dm68Y4gs.js +1 -0
  3. package/dist/web/assets/Computers-BtcIsnDD.css +1 -0
  4. package/dist/web/assets/Computers-mf4P8Wjw.js +13 -0
  5. package/dist/web/assets/{Conversation-BjRCD81A.js → Conversation-ClLZZ3fG.js} +1 -1
  6. package/dist/web/assets/{Dashboard-DmtWx-WI.js → Dashboard-pokwbwJV.js} +1 -1
  7. package/dist/web/assets/{Dropdown-DXEtBxVr.js → Dropdown-DGFI68Vd.js} +1 -1
  8. package/dist/web/assets/Files-CtxaCO6n.js +1 -0
  9. package/dist/web/assets/{Help-BeJ09zt7.js → Help-B_1p7Xir.js} +87 -25
  10. package/dist/web/assets/Markdown-gPLWRWEJ.js +29 -0
  11. package/dist/web/assets/{MessageComposer-0eprbRl2.js → MessageComposer-BoOgfyPA.js} +1 -1
  12. package/dist/web/assets/ResourceLibrary-Cr_Emgq2.js +6 -0
  13. package/dist/web/assets/{TerminalPane-CEaXud0k.js → TerminalPane-5Gw9ZNxq.js} +2 -2
  14. package/dist/web/assets/WorkspaceTree-DZ6DN_OX.js +1 -0
  15. package/dist/web/assets/{file-links-Bo7XBz3i.js → file-links-CoVqmrXg.js} +1 -1
  16. package/dist/web/assets/index-BZEKT27U.js +10 -0
  17. package/dist/web/assets/task-links-DTqf18C2.js +1 -0
  18. package/dist/web/downloads/teammy-inbox-skill.zip +0 -0
  19. package/dist/web/downloads/teammy-skill.zip +0 -0
  20. package/dist/web/index.html +2 -2
  21. package/dist/web/notification-worker.js +126 -0
  22. package/node_modules/cron-parser/LICENSE +21 -0
  23. package/node_modules/cron-parser/README.md +437 -0
  24. package/node_modules/cron-parser/dist/CronDate.js +558 -0
  25. package/node_modules/cron-parser/dist/CronExpression.js +531 -0
  26. package/node_modules/cron-parser/dist/CronExpressionParser.js +482 -0
  27. package/node_modules/cron-parser/dist/CronFieldCollection.js +380 -0
  28. package/node_modules/cron-parser/dist/CronFileParser.js +92 -0
  29. package/node_modules/cron-parser/dist/fields/CronDayOfMonth.js +60 -0
  30. package/node_modules/cron-parser/dist/fields/CronDayOfWeek.js +57 -0
  31. package/node_modules/cron-parser/dist/fields/CronField.js +222 -0
  32. package/node_modules/cron-parser/dist/fields/CronHour.js +40 -0
  33. package/node_modules/cron-parser/dist/fields/CronMinute.js +40 -0
  34. package/node_modules/cron-parser/dist/fields/CronMonth.js +44 -0
  35. package/node_modules/cron-parser/dist/fields/CronSecond.js +40 -0
  36. package/node_modules/cron-parser/dist/fields/index.js +24 -0
  37. package/node_modules/cron-parser/dist/fields/types.js +2 -0
  38. package/node_modules/cron-parser/dist/index.js +31 -0
  39. package/node_modules/cron-parser/dist/types/CronDate.d.ts +293 -0
  40. package/node_modules/cron-parser/dist/types/CronExpression.d.ts +118 -0
  41. package/node_modules/cron-parser/dist/types/CronExpressionParser.d.ts +65 -0
  42. package/node_modules/cron-parser/dist/types/CronFieldCollection.d.ts +153 -0
  43. package/node_modules/cron-parser/dist/types/CronFileParser.d.ts +30 -0
  44. package/node_modules/cron-parser/dist/types/fields/CronDayOfMonth.d.ts +33 -0
  45. package/node_modules/cron-parser/dist/types/fields/CronDayOfWeek.d.ts +31 -0
  46. package/node_modules/cron-parser/dist/types/fields/CronField.d.ts +136 -0
  47. package/node_modules/cron-parser/dist/types/fields/CronHour.d.ts +23 -0
  48. package/node_modules/cron-parser/dist/types/fields/CronMinute.d.ts +23 -0
  49. package/node_modules/cron-parser/dist/types/fields/CronMonth.d.ts +24 -0
  50. package/node_modules/cron-parser/dist/types/fields/CronSecond.d.ts +23 -0
  51. package/node_modules/cron-parser/dist/types/fields/index.d.ts +8 -0
  52. package/node_modules/cron-parser/dist/types/fields/types.d.ts +18 -0
  53. package/node_modules/cron-parser/dist/types/index.d.ts +8 -0
  54. package/node_modules/cron-parser/dist/types/utils/random.d.ts +10 -0
  55. package/node_modules/cron-parser/dist/utils/random.js +38 -0
  56. package/node_modules/cron-parser/package.json +117 -0
  57. package/node_modules/luxon/LICENSE.md +7 -0
  58. package/node_modules/luxon/README.md +55 -0
  59. package/node_modules/luxon/build/amd/luxon.js +8741 -0
  60. package/node_modules/luxon/build/amd/luxon.js.map +1 -0
  61. package/node_modules/luxon/build/cjs-browser/luxon.js +8739 -0
  62. package/node_modules/luxon/build/cjs-browser/luxon.js.map +1 -0
  63. package/node_modules/luxon/build/es6/luxon.mjs +8133 -0
  64. package/node_modules/luxon/build/es6/luxon.mjs.map +1 -0
  65. package/node_modules/luxon/build/global/luxon.js +8744 -0
  66. package/node_modules/luxon/build/global/luxon.js.map +1 -0
  67. package/node_modules/luxon/build/global/luxon.min.js +1 -0
  68. package/node_modules/luxon/build/global/luxon.min.js.map +1 -0
  69. package/node_modules/luxon/build/node/luxon.js +7792 -0
  70. package/node_modules/luxon/build/node/luxon.js.map +1 -0
  71. package/node_modules/luxon/package.json +87 -0
  72. package/node_modules/luxon/src/datetime.js +2603 -0
  73. package/node_modules/luxon/src/duration.js +1009 -0
  74. package/node_modules/luxon/src/errors.js +61 -0
  75. package/node_modules/luxon/src/impl/conversions.js +206 -0
  76. package/node_modules/luxon/src/impl/diff.js +95 -0
  77. package/node_modules/luxon/src/impl/digits.js +94 -0
  78. package/node_modules/luxon/src/impl/english.js +233 -0
  79. package/node_modules/luxon/src/impl/formats.js +176 -0
  80. package/node_modules/luxon/src/impl/formatter.js +434 -0
  81. package/node_modules/luxon/src/impl/invalid.js +14 -0
  82. package/node_modules/luxon/src/impl/locale.js +569 -0
  83. package/node_modules/luxon/src/impl/regexParser.js +335 -0
  84. package/node_modules/luxon/src/impl/tokenParser.js +505 -0
  85. package/node_modules/luxon/src/impl/util.js +330 -0
  86. package/node_modules/luxon/src/impl/zoneUtil.js +34 -0
  87. package/node_modules/luxon/src/info.js +205 -0
  88. package/node_modules/luxon/src/interval.js +669 -0
  89. package/node_modules/luxon/src/luxon.js +26 -0
  90. package/node_modules/luxon/src/package.json +4 -0
  91. package/node_modules/luxon/src/settings.js +180 -0
  92. package/node_modules/luxon/src/zone.js +97 -0
  93. package/node_modules/luxon/src/zones/IANAZone.js +235 -0
  94. package/node_modules/luxon/src/zones/fixedOffsetZone.js +150 -0
  95. package/node_modules/luxon/src/zones/invalidZone.js +53 -0
  96. package/node_modules/luxon/src/zones/systemZone.js +61 -0
  97. package/package.json +3 -1
  98. package/dist/web/assets/Assistant-By7rPMl2.js +0 -1
  99. package/dist/web/assets/Computers-B4ZMJ8tu.js +0 -13
  100. package/dist/web/assets/Computers-CBnQX-2p.css +0 -1
  101. package/dist/web/assets/Files-4IxSFpqk.js +0 -1
  102. package/dist/web/assets/Markdown-DGF8VSqv.js +0 -29
  103. package/dist/web/assets/ResourceLibrary-rlrdDWGo.js +0 -6
  104. package/dist/web/assets/WorkspaceTree-CwGvdfr0.js +0 -1
  105. package/dist/web/assets/index-Cr9kdjwc.js +0 -10
  106. package/dist/web/assets/task-links-B7fExlHK.js +0 -1
@@ -0,0 +1,29 @@
1
+ import{At as e,H as t,It as n,Lt as r,M as i,Rt as a,jt as o}from"./Dropdown-DGFI68Vd.js";import{i as s,n as c,t as l}from"./task-links-DTqf18C2.js";var u=e(),d=i();function f(e,t){return e.startsWith(`/`)?e:t?.startsWith(`/`)?t.replace(/\/$/,``)+`/`+e:null}function p(e,t=!1){if(s(e))return null;let n=/(?::(\d+)(?::\d+)?|#L(\d+)(?:-L?\d+)?)$/.exec(e),r=n?e.slice(0,n.index):e;if(r.startsWith(`file:`))try{let e=new URL(r);if(e.hostname&&e.hostname!==`localhost`)return null;r=decodeURIComponent(e.pathname)}catch{return null}else if(t){if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(r)||/[?#]/.test(r))return null;try{r=decodeURIComponent(r)}catch{return null}}if(!/^(?:\/|\.\.?\/)/.test(r)&&!(t&&/(?:^|\/)[^/]+\.[\w-]+$/.test(r))||s(r)||r.startsWith(`//`)||r.endsWith(`/`)||/[\x00-\x1f\x7f]/.test(r))return null;let i=Number(n?.[1]??n?.[2]);return i>0?{path:r,line:i}:{path:r}}function m(e){let t=/(?:^|(?<=[\s(\[<{=::,「(、;。"'\x60]))(?:https?:\/\/[^\s<>"'\x60]+|"((?:\/|\.\.?\/)[^"\r\n]+)"|'((?:\/|\.\.?\/)[^'\r\n]+)'|\x60((?:\/|\.\.?\/)[^\x60\r\n]+)\x60|((?:(?:file:\/\/(?:localhost)?)?\/(?!\/)|\.\.?\/)[^\s<>"'\x60|,。;!?、)】」]+))/gu,n=[];for(let r of e.matchAll(t)){let e=r[1]??r[2]??r[3];if(!e&&!r[4])continue;let t=e??r[4].replace(/[.,;:!?}\]]+$/u,``);!e&&t.endsWith(`)`)&&(t.match(/\)/g)?.length??0)>(t.match(/\(/g)?.length??0)&&(t=t.slice(0,-1));let i=p(t);if(!i||!e&&/^\/[\w-]+$/.test(t))continue;let a=r.index+ +!!e;n.push({start:a,end:a+t.length,link:i})}return n}function h(e){return{type:`text`,value:e}}function g(e,t){return{type:`element`,tagName:`button`,properties:{type:`button`,dataFilePath:e.path,dataFileLine:e.line},children:t}}function _(){return e=>{function t(e){e.children=e.children.flatMap(e=>{if(e.type===`text`){let t=[],n=0;for(let{start:r,end:i,link:a}of m(e.value))t.push(h(e.value.slice(n,r)),g(a,[h(e.value.slice(r,i))])),n=i;return n?[...t,h(e.value.slice(n))]:[e]}if(e.type!==`element`||e.tagName===`pre`)return[e];if(e.tagName===`a`||e.tagName===`img`){let t=p(String(e.properties.href??e.properties.src??``),!0);return t?[g(t,e.tagName===`a`?e.children:[h(String(e.properties.alt||t.path))])]:[e]}if(e.tagName===`code`){let t=e.children[0],n=t?.type===`text`?p(t.value):null;return n?[g(n,[e])]:[e]}return t(e),[e]})}t(e)}}function v(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var y=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,b=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x={};function S(e,t){return((t||x).jsx?b:y).test(e)}var C=/[ \t\n\f\r]/g;function w(e){return typeof e==`object`?e.type===`text`&&T(e.value):T(e)}function T(e){return e.replace(C,``)===``}var E=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};E.prototype.normal={},E.prototype.property={},E.prototype.space=void 0;function D(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new E(n,r,t)}function O(e){return e.toLowerCase()}var k=class{constructor(e,t){this.attribute=t,this.property=e}};k.prototype.attribute=``,k.prototype.booleanish=!1,k.prototype.boolean=!1,k.prototype.commaOrSpaceSeparated=!1,k.prototype.commaSeparated=!1,k.prototype.defined=!1,k.prototype.mustUseProperty=!1,k.prototype.number=!1,k.prototype.overloadedBoolean=!1,k.prototype.property=``,k.prototype.spaceSeparated=!1,k.prototype.space=void 0;var ee=r({boolean:()=>A,booleanish:()=>j,commaOrSpaceSeparated:()=>I,commaSeparated:()=>F,number:()=>N,overloadedBoolean:()=>M,spaceSeparated:()=>P}),te=0,A=L(),j=L(),M=L(),N=L(),P=L(),F=L(),I=L();function L(){return 2**++te}var ne=Object.keys(ee),re=class extends k{constructor(e,t,n,r){let i=-1;if(super(e,t),ie(this,`space`,r),typeof n==`number`)for(;++i<ne.length;){let e=ne[i];ie(this,ne[i],(n&ee[e])===ee[e])}}};re.prototype.defined=!0;function ie(e,t,n){n&&(e[t]=n)}function ae(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new re(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[O(r)]=r,n[O(a.attribute)]=r}return new E(t,n,e.space)}var oe=ae({properties:{ariaActiveDescendant:null,ariaAtomic:j,ariaAutoComplete:null,ariaBusy:j,ariaChecked:j,ariaColCount:N,ariaColIndex:N,ariaColSpan:N,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:j,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:j,ariaFlowTo:P,ariaGrabbed:j,ariaHasPopup:null,ariaHidden:j,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:N,ariaLive:null,ariaModal:j,ariaMultiLine:j,ariaMultiSelectable:j,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:N,ariaPressed:j,ariaReadOnly:j,ariaRelevant:null,ariaRequired:j,ariaRoleDescription:P,ariaRowCount:N,ariaRowIndex:N,ariaRowSpan:N,ariaSelected:j,ariaSetSize:N,ariaSort:null,ariaValueMax:N,ariaValueMin:N,ariaValueNow:N,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function se(e,t){return t in e?e[t]:t}function ce(e,t){return se(e,t.toLowerCase())}var le=ae({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:F,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:A,allowPaymentRequest:A,allowUserMedia:A,alpha: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,closedBy:null,colorSpace:null,cols:N,colSpan:N,command:null,commandFor:null,content:null,contentEditable:j,controls:A,controlsList:P,coords:N|F,crossOrigin:null,data:null,dateTime:null,decoding:null,default:A,defer:A,dir:null,dirName:null,disabled:A,download:M,draggable:j,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:A,formTarget:null,headers:P,height:N,hidden:M,high:N,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:N,manifest:null,max:null,maxLength:N,media:null,method:null,min:null,minLength:N,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:N,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:N,rowSpan:N,sandbox:P,scope:null,scoped:A,seamless:A,selected:A,shadowRootClonable:A,shadowRootCustomElementRegistry:A,shadowRootDelegatesFocus:A,shadowRootMode:null,shadowRootSerializable:A,shape:null,size:N,sizes:null,slot:null,span:N,spellCheck:j,src:null,srcDoc:null,srcLang:null,srcSet:null,start:N,step:null,style:null,tabIndex:N,target:null,title:null,translate:null,type:null,typeMustMatch:A,useMap:null,value:j,width:N,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:N,borderColor:null,bottomMargin:N,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:N,leftMargin:N,link:null,longDesc:null,lowSrc:null,marginHeight:N,marginWidth:N,noResize:A,noHref:A,noShade:A,noWrap:A,object:null,profile:null,prompt:null,rev:null,rightMargin:N,rules:null,scheme:null,scrolling:j,standby:null,summary:null,text:null,topMargin:N,valueType:null,version:null,vAlign:null,vLink:null,vSpace:N,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:A,disablePictureInPicture:A,disableRemotePlayback:A,exportParts:F,part:P,prefix:null,property:null,results:N,security:null,unselectable:null},space:`html`,transform:ce}),ue=ae({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`,maskType:`mask-type`,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:I,accentHeight:N,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:N,amplitude:N,arabicForm:null,ascent:N,attributeName:null,attributeType:null,azimuth:N,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:N,by:null,calcMode:null,capHeight:N,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:N,diffuseConstant:N,direction:null,display:null,dur:null,divisor:N,dominantBaseline:null,download:A,dx:null,dy:null,edgeMode:null,editable:null,elevation:N,enableBackground:null,end:null,event:null,exponent:N,externalResourcesRequired:null,fill:null,fillOpacity:N,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:F,g2:F,glyphName:F,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:N,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:N,horizOriginX:N,horizOriginY:N,id:null,ideographic:N,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:N,k:N,k1:N,k2:N,k3:N,k4:N,kernelMatrix:I,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:N,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:N,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:N,overlineThickness:N,paintOrder:null,panose1:null,path:null,pathLength:N,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:N,pointsAtY:N,pointsAtZ:N,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:I,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:I,rev:I,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:I,requiredFeatures:I,requiredFonts:I,requiredFormats:I,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:N,specularExponent:N,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:N,strikethroughThickness:N,string:null,stroke:null,strokeDashArray:I,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:N,strokeOpacity:N,strokeWidth:null,style:null,surfaceScale:N,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:I,tabIndex:N,tableValues:null,target:null,targetX:N,targetY:N,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:I,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:N,underlineThickness:N,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:N,values:null,vAlphabetic:N,vMathematical:N,vectorEffect:null,vHanging:N,vIdeographic:N,version:null,vertAdvY:N,vertOriginX:N,vertOriginY:N,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:N,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:se}),de=ae({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),fe=ae({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ce}),pe=ae({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),me={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`},he=/[A-Z]/g,ge=/-[a-z]/g,_e=/^data[-\w.:]+$/i;function ve(e,t){let n=O(t),r=t,i=k;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&_e.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ge,be);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ge.test(e)){let n=e.replace(he,ye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=re}return new i(r,t)}function ye(e){return`-`+e.toLowerCase()}function be(e){return e.charAt(1).toUpperCase()}var xe=D([oe,le,de,fe,pe],`html`),Se=D([oe,ue,de,fe,pe],`svg`);function Ce(e){return e.join(` `).trim()}var we=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
2
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Te=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(we());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Ee=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),De=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Te()),i=Ee();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Oe=Ae(`end`),ke=Ae(`start`);function Ae(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function je(e){let t=ke(e),n=Oe(e);if(t&&n)return{start:t,end:n}}function Me(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Pe(e.position):`start`in e||`end`in e?Pe(e):`line`in e||`column`in e?Ne(e):``}function Ne(e){return Fe(e&&e.line)+`:`+Fe(e&&e.column)}function Pe(e){return Ne(e&&e.start)+`-`+Ne(e&&e.end)}function Fe(e){return e&&typeof e==`number`?e:1}var R=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Me(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};R.prototype.file=``,R.prototype.name=``,R.prototype.reason=``,R.prototype.message=``,R.prototype.stack=``,R.prototype.column=void 0,R.prototype.line=void 0,R.prototype.ancestors=void 0,R.prototype.cause=void 0,R.prototype.fatal=void 0,R.prototype.place=void 0,R.prototype.ruleId=void 0,R.prototype.source=void 0;var Ie=a(De(),1),Le={}.hasOwnProperty,Re=new Map,ze=/[A-Z]/g,Be=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ve=new Set([`td`,`th`]),He=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ue(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=et(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=$e(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Se:xe,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=We(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function We(e,t,n){if(t.type===`element`)return Ge(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ke(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Je(e,t,n);if(t.type===`mdxjsEsm`)return qe(e,t);if(t.type===`root`)return Ye(e,t,n);if(t.type===`text`)return Xe(e,t)}function Ge(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Se,e.schema=i),e.ancestors.push(t);let a=ot(e,t.tagName,!1),o=tt(e,t),s=rt(e,t);return Be.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!w(e)})),Ze(e,o,a,t),Qe(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ke(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}st(e,t.position)}function qe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);st(e,t.position)}function Je(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Se,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ot(e,t.name,!0),o=nt(e,t),s=rt(e,t);return Ze(e,o,a,t),Qe(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ye(e,t,n){let r={};return Qe(r,rt(e,t)),e.create(t,e.Fragment,r,n)}function Xe(e,t){return t.value}function Ze(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qe(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function $e(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function et(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ke(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function tt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Le.call(t.properties,i)){let a=it(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ve.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function nt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else st(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else st(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function rt(e,t){let n=[],r=-1,i=e.passKeys?new Map:Re;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=We(e,a,o);s!==void 0&&n.push(s)}return n}function it(e,t,n){let r=ve(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?v(n):Ce(n)),r.property===`style`){let t=typeof n==`object`?n:at(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ct(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?me[r.property]||r.property:r.attribute,n]}}function at(e,t){try{return(0,Ie.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new R("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=He+`#cannot-parse-style-attribute`,r}}function ot(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=S(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=S(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Le.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);st(e)}function st(e,t){let n=new R("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=He+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ct(e){let t={},n;for(n in e)Le.call(e,n)&&(t[lt(n)]=e[n]);return t}function lt(e){let t=e.replace(ze,ut);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ut(e){return`-`+e.toLowerCase()}var dt={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},ft={};function pt(e,t){let n=t||ft;return mt(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function mt(e,t,n){if(gt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return ht(e.children,t,n)}return Array.isArray(e)?ht(e,t,n):``}function ht(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=mt(e[i],t,n);return r.join(``)}function gt(e){return!!(e&&typeof e==`object`)}var _t=document.createElement(`i`);function vt(e){let t=`&`+e+`;`;_t.innerHTML=t;let n=_t.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function z(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function B(e,t){return e.length>0?(z(e,e.length,0,t),e):t}var yt={}.hasOwnProperty;function bt(e){let t={},n=-1;for(;++n<e.length;)xt(t,e[n]);return t}function xt(e,t){let n;for(n in t){let r=(yt.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){yt.call(r,a)||(r[a]=[]);let e=i[a];St(r[a],Array.isArray(e)?e:e?[e]:[])}}}function St(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);z(e,0,0,r)}function Ct(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function V(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var H=q(/[A-Za-z]/),U=q(/[\dA-Za-z]/),wt=q(/[#-'*+\--9=?A-Z^-~]/);function Tt(e){return e!==null&&(e<32||e===127)}var Et=q(/\d/),Dt=q(/[\dA-Fa-f]/),Ot=q(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}var kt=q(/\p{P}|\p{S}/u),At=q(/\s/);function q(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function jt(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&U(e.charCodeAt(n+1))&&U(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return K(r)?(e.enter(n),s(r)):t(r)}function s(r){return K(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Mt(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&K(t)?(e.enter(r),c(t)):l(t)}function c(t){return K(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Nt={tokenize:Pt};function Pt(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Ft=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){It(this,e,t,n,!1)}addBefore(e,t,n){It(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function It(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Lt={tokenize:zt},Rt={tokenize:Bt};function zt(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Ft;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rt,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Rt,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return W(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Ft;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Bt(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Vt(e){if(e===null||G(e)||At(e))return 1;if(kt(e))return 2}function Ht(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Ut={name:`attention`,resolveAll:Wt,tokenize:Gt};function Wt(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Kt(o,-a),Kt(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=B(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=B(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=B(r,Ht(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=B(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=B(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),z(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Gt(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Vt(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Vt(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Kt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var qt={name:`autolink`,tokenize:Jt};function Jt(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return H(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||U(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||U(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Tt(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):wt(t)?(e.consume(t),l):n(t)}function u(e){return U(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||U(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Yt={partial:!0,tokenize:Xt};function Xt(e,t,n){return r;function r(t){return K(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var Zt={continuation:{tokenize:$t},exit:en,name:`blockQuote`,tokenize:Qt};function Qt(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return K(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function $t(e,t,n){let r=this;return i;function i(t){return K(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Zt,t,n)(r)}}function en(e){e.exit(`blockQuote`)}var tn={name:`characterEscape`,tokenize:nn};function nn(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ot(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var rn={name:`characterReference`,tokenize:an};function an(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=U,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Dt,u):(e.enter(`characterReferenceValue`),a=7,o=Et,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===U&&!vt(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var on={partial:!0,tokenize:sn};function sn(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var cn={concrete:!0,name:`codeFenced`,tokenize:ln};function ln(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(on,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&K(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(on,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),K(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var un={name:`codeIndented`,tokenize:fn},dn={partial:!0,tokenize:pn};function fn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Mt(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):W(t)?e.attempt(dn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||W(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function pn(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):W(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Mt(e,t,a,`linePrefix`,4,4)(o)}function a(e){return W(e)?i(e):n(e)}}var mn={name:`codeText`,previous:gn,resolve:hn,tokenize:_n};function hn(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function gn(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function _n(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||W(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var vn=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&yn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),yn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),yn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);yn(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);yn(this.left,t.reverse())}}}};function yn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function bn(e){let t={},n=-1,r,i,a,o,s,c,l,u=new vn(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,xn(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return z(e,0,1/0,u.slice(0)),!l}function xn(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Sn={resolve:wn,tokenize:Tn},Cn={partial:!0,tokenize:En};function wn(e){return bn(e),e}function Tn(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):W(t)?e.check(Cn,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function En(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||W(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Dn(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Tt(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||W(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||G(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Tt(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function On(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):W(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!K(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function kn(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function An(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):K(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var jn={name:`definition`,tokenize:Nn},Mn={partial:!0,tokenize:Pn};function Nn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return On.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return G(t)?An(e,l)(t):l(t)}function l(t){return Dn(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Mn,d,d)(t)}function d(t){return K(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Pn(e,t,n){return r;function r(t){return G(t)?An(e,i)(t):n(t)}function i(t){return kn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return K(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var Fn={name:`hardBreakEscape`,tokenize:In};function In(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ln={name:`headingAtx`,resolve:Rn,tokenize:zn};function Rn(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};z(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function zn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||G(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):K(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||G(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Bn=`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.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Vn=[`pre`,`script`,`style`,`textarea`],Hn={concrete:!0,name:`htmlFlow`,resolveTo:Wn,tokenize:Gn},Un={partial:!0,tokenize:Kn};function Wn(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Gn(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):H(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):H(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return H(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||G(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Vn.includes(l)?(i=1,r.interrupt?t(s):O(s)):Bn.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||U(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return K(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||H(t)?(e.consume(t),b):K(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):K(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):K(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||G(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||K(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):K(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Un,I,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(on,ee,I)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),P):O(t)}function j(t){return t===47?(e.consume(t),o=``,M):O(t)}function M(t){if(t===62){let n=o.toLowerCase();return Vn.includes(n)?(e.consume(t),F):O(t)}return H(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||W(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function Kn(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Yt,t,n)}}var qn={name:`htmlText`,tokenize:Jn};function Jn(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):H(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):H(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):W(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):W(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return H(t)?(e.consume(t),S):n(t)}function S(t){return t===45||U(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,j(t)):K(t)?(e.consume(t),C):A(t)}function w(t){return t===45||U(t)?(e.consume(t),w):t===47||t===62||G(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||H(t)?(e.consume(t),E):W(t)?(o=T,j(t)):K(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,j(t)):K(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):W(t)?(o=O,j(t)):K(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):W(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||G(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||G(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),M}function M(t){return K(t)?J(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var Yn={name:`labelEnd`,resolveAll:$n,resolveTo:er,tokenize:tr},Xn={tokenize:nr},Zn={tokenize:rr},Qn={tokenize:ir};function $n(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&z(e,0,e.length,n),e}function er(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=B(o,e.slice(i+1,i+r+3)),o=B(o,[[`enter`,l,t]]),o=B(o,Ht(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=B(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=B(o,e.slice(a+1)),o=B(o,[[`exit`,s,t]]),z(e,i,e.length,o),e}function tr(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(V(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Xn,u,o?u:d)(t):t===91?e.attempt(Zn,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Qn,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function nr(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return G(t)?An(e,a)(t):a(t)}function a(t){return t===41?u(t):Dn(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return G(t)?An(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?kn(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return G(t)?An(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function rr(e,t,n){let r=this;return i;function i(t){return On.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ir(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var ar={name:`labelStartImage`,resolveAll:Yn.resolveAll,tokenize:or};function or(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var sr={name:`labelStartLink`,resolveAll:Yn.resolveAll,tokenize:cr};function cr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var lr={name:`lineEnding`,tokenize:ur};function ur(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var dr={name:`thematicBreak`,tokenize:fr};function fr(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),K(t)?J(e,s,`whitespace`)(t):s(t))}}var Y={continuation:{tokenize:gr},exit:vr,name:`list`,tokenize:hr},pr={partial:!0,tokenize:yr},mr={partial:!0,tokenize:_r};function hr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Et(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(dr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Et(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Yt,r.interrupt?n:u,e.attempt(pr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return K(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function gr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Yt,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!K(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(mr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Y,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function _r(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function vr(e){e.exit(this.containerState.type)}function yr(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!K(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var br={name:`setextUnderline`,resolveTo:xr,tokenize:Sr};function xr(e,t){let n=new Ft,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Sr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),K(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Cr={tokenize:wr};function wr(e){let t=this,n=e.attempt(Yt,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Sn,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Tr={resolveAll:kr()},Er=Or(`string`),Dr=Or(`text`);function Or(e){return{resolveAll:kr(e===`text`?Ar:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function kr(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Ar(e,t){let n=new Ft,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var jr=r({attentionMarkers:()=>zr,contentInitial:()=>Nr,disable:()=>Br,document:()=>Mr,flow:()=>Fr,flowInitial:()=>Pr,insideSpan:()=>Rr,string:()=>Ir,text:()=>Lr}),Mr={42:Y,43:Y,45:Y,48:Y,49:Y,50:Y,51:Y,52:Y,53:Y,54:Y,55:Y,56:Y,57:Y,62:Zt},Nr={91:jn},Pr={[-2]:un,[-1]:un,32:un},Fr={35:Ln,42:dr,45:[br,dr],60:Hn,61:br,95:dr,96:cn,126:cn},Ir={38:rn,92:tn},Lr={[-5]:lr,[-4]:lr,[-3]:lr,33:ar,38:rn,42:Ut,60:[qt,qn],91:sr,92:[Fn,tn],93:Yn,95:Ut,96:mn},Rr={null:[Ut,Tr]},zr={null:[42,95]},Br={null:[]};function Vr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=B(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ht(a,l.events,l),l.events):[]}function f(e,t){return Ur(p(e),t)}function p(e){return Hr(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){W(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&z(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Hr(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ur(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
3
+ `;break;case-3:o=`\r
4
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Wr(e){let t={constructs:bt([jr,...(e||{}).extensions||[]]),content:n(Nt),defined:[],document:n(Lt),flow:n(Cr),lazy:{},string:n(Er),text:n(Dr)};return t;function n(e){return n;function n(n){return Vr(t,e,n)}}}function Gr(e){for(;!bn(e););return e}var Kr=/[\0\t\n\r]/g;function qr(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Kr.lastIndex=c;let n=Kr.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Jr=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Yr(e){return e.replace(Jr,Xr)}function Xr(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ct(n.slice(t?2:1),t?16:10)}return vt(n)||e}var Zr={}.hasOwnProperty;function Qr(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),$r(n)(Gr(Wr(n).document().write(qr()(e,t,!0))))}function $r(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ve),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(me),blockQuote:o(le),characterEscape:E,characterReference:E,codeFenced:o(ue),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ue,s),codeText:o(de,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(fe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(pe),hardBreakEscape:o(he),hardBreakTrailing:o(he),htmlFlow:o(ge,s),htmlFlowData:E,htmlText:o(ge,s),htmlTextData:E,image:o(_e),label:s,link:o(ve),listItem:o(be),listItemValue:p,listOrdered:o(ye,f),listUnordered:o(ye),paragraph:o(xe),reference:ne,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(me),strong:o(Se),thematicBreak:o(we)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(A),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(ee),htmlFlowData:D,htmlText:l(te),htmlTextData:D,image:l(M),label:P,labelText:N,lineEnding:O,link:l(j),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:re,resourceDestinationString:F,resourceTitleString:I,resource:L,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};ei(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),Zr.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||ni).call(o,void 0,e[0])}for(r.position={start:X(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:X(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:X(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Me({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ni).call(this,e,r[0])),n.position.end=X(e.end)}function d(){return pt(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ce(),n.position={start:X(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=X(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=X(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Yr(t),n.identifier=V(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ct(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=vt(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=X(e.end)}function se(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[],position:void 0}}function ue(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function de(){return{type:`inlineCode`,value:``,position:void 0}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function pe(){return{type:`emphasis`,children:[],position:void 0}}function me(){return{type:`heading`,depth:0,children:[],position:void 0}}function he(){return{type:`break`,position:void 0}}function ge(){return{type:`html`,value:``,position:void 0}}function _e(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ve(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function xe(){return{type:`paragraph`,children:[],position:void 0}}function Se(){return{type:`strong`,children:[],position:void 0}}function Ce(){return{type:`text`,value:``,position:void 0}}function we(){return{type:`thematicBreak`,position:void 0}}}function X(e){return{line:e.line,column:e.column,offset:e.offset}}function ei(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ei(e,r):ti(e,r)}}function ti(e,t){let n;for(n in t)if(Zr.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ni(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Me({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Me({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Me({start:t.start,end:t.end})+`) is still open`)}function ri(e){let t=this;t.parser=n;function n(n){return Qr(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function ii(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ai(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
5
+ `}]}function oi(e,t){let n=t.value?t.value+`
6
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function si(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ci(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function li(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=jt(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function ui(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function di(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fi(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function pi(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fi(e,t);let i={src:jt(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function mi(e,t){let n={src:jt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function hi(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function gi(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fi(e,t);let i={href:jt(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function _i(e,t){let n={href:jt(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vi(e,t,n){let r=e.all(t),i=n?yi(n):bi(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
7
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
8
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function yi(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=bi(n[r])}return t}function bi(e){return e.spread??e.children.length>1}function xi(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Si(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ci(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wi(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ti(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ke(t.children[1]),o=Oe(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Ei(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Di(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Oi=9,ki=32;function Ai(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(ji(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(ji(t.slice(i),i>0,!1)),a.join(``)}function ji(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Oi||t===ki;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Oi||t===ki;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Mi(e,t){let n={type:`text`,value:Ai(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ni(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Pi={blockquote:ii,break:ai,code:oi,delete:si,emphasis:ci,footnoteReference:li,heading:ui,html:di,imageReference:pi,image:mi,inlineCode:hi,linkReference:gi,link:_i,listItem:vi,list:xi,paragraph:Si,root:Ci,strong:wi,table:Ti,tableCell:Di,tableRow:Ei,text:Mi,thematicBreak:Ni,toml:Fi,yaml:Fi,definition:Fi,footnoteDefinition:Fi};function Fi(){}var{defineProperty:Ii}=Object,Li=typeof self==`object`?self:globalThis,Ri=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Li[e](t)},zi=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Ii(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Li[e]==`function`?Ri(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Ri(a,o),i)};return r},Bi=e=>zi(new Map,e)(0),Vi=``,{toString:Hi}={},{keys:Ui,is:Wi}=Object,Gi=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Hi.call(e).slice(8,-1);switch(n){case`Array`:return[1,Vi];case`Object`:return[2,Vi];case`Date`:return[3,Vi];case`RegExp`:return[4,Vi];case`Map`:return[5,Vi];case`Set`:return[6,Vi];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Ki=([e,t])=>e===0&&(t===`function`||t===`symbol`),qi=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Gi(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Wi(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Ui(o))(e||!Ki(Gi(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Vi:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Ki(Gi(n))||Ki(Gi(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Ki(Gi(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Ji=(e,{json:t,lossy:n}={})=>{let r=[];return qi(!(t||n),!!t,new Map,r)(e),r},Yi=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Bi(Ji(e,t)):structuredClone(e):(e,t)=>Bi(Ji(e,t));function Xi(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Zi(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Qi(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Xi,r=e.options.footnoteBackLabel||Zi,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=jt(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Yi(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
9
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
10
+ `}]}}var $i=(function(e){if(e==null)return ia;if(typeof e==`function`)return ra(e);if(typeof e==`object`)return Array.isArray(e)?ea(e):ta(e);if(typeof e==`string`)return na(e);throw Error(`Expected function, string, or object as test`)});function ea(e){let t=[],n=-1;for(;++n<e.length;)t[n]=$i(e[n]);return ra(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function ta(e){let t=e;return ra(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function na(e){return ra(t);function t(t){return t&&t.type===e}}function ra(e){return t;function t(t,n,r){return!!(aa(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ia(){return!0}function aa(e){return typeof e==`object`&&!!e&&`type`in e}function oa(e){return e}var sa=[];function ca(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=$i(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+oa(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=sa,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=la(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function la(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?sa:[e]}function ua(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ca(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var da={}.hasOwnProperty,fa={};function pa(e,t){let n=t||fa,r=new Map,i=new Map,a={all:s,applyData:ha,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Pi,...n.handlers},one:o,options:n,patch:ma,wrap:_a};return ua(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(da.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Yi(n);return r.children=a.all(e),r}return Yi(e)}return(a.options.unknownHandler||ga)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=va(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=va(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function ma(e,t){e.position&&(t.position=je(e))}function ha(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Yi(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function ga(e,t){let n=t.data||{},r=`value`in t&&!(da.call(n,`hProperties`)||da.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _a(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
11
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
12
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
13
+ `}),n}function va(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ya(e,t){let n=pa(e,t),r=n.one(e,void 0),i=Qi(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
14
+ `},i)),a}function ba(e,t){return e&&`run`in e?async function(n,r){let i=ya(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ya(n,{file:r,...e||t})}}function xa(e){if(e)throw e}var Sa=a(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function Ca(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function wa(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ta(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ta(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Z={basename:Ea,dirname:Da,extname:Oa,join:ka,sep:`/`};function Ea(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Ma(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Da(e){if(Ma(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Oa(e){Ma(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function ka(...e){let t=-1,n;for(;++t<e.length;)Ma(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Aa(n)}function Aa(e){Ma(e);let t=e.codePointAt(0)===47,n=ja(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function ja(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Ma(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Na={cwd:Pa};function Pa(){return`/`}function Fa(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ia(e){if(typeof e==`string`)e=new URL(e);else if(!Fa(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return La(e)}function La(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Ra=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],za=class{constructor(e){let t;t=e?Fa(e)?{path:e}:typeof e==`string`||Ua(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Na.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ra.length;){let e=Ra[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Ra.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Z.basename(this.path):void 0}set basename(e){Va(e,`basename`),Ba(e,`basename`),this.path=Z.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Z.dirname(this.path):void 0}set dirname(e){Ha(this.basename,`dirname`),this.path=Z.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Z.extname(this.path):void 0}set extname(e){if(Ba(e,`extname`),Ha(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Z.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Fa(e)&&(e=Ia(e)),Va(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Z.basename(this.path,this.extname):void 0}set stem(e){Va(e,`stem`),Ba(e,`stem`),this.path=Z.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new R(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Ba(e,t){if(e&&e.includes(Z.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Z.sep+"`")}function Va(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ha(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ua(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Wa=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ga={}.hasOwnProperty,Ka=new class e extends Wa{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wa()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Sa.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Ya(`data`,this.frozen),this.namespace[e]=t,this):Ga.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ya(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Qa(e),n=this.parser||this.Parser;return qa(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),qa(`process`,this.parser||this.Parser),Ja(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Qa(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);eo(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),qa(`processSync`,this.parser||this.Parser),Ja(`processSync`,this.compiler||this.Compiler),this.process(e,r),Za(`processSync`,`process`,t),n;function r(e,r){t=!0,xa(e),n=r}}run(e,t,n){Xa(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Qa(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Za(`runSync`,`run`,n),r;function i(e,t){xa(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Qa(t),r=this.compiler||this.Compiler;return Ja(`stringify`,r),Xa(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Ya(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Sa.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ca(o)&&Ca(r)&&(r=(0,Sa.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function qa(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ja(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Ya(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Xa(e){if(!Ca(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Za(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Qa(e){return $a(e)?e:new za(e)}function $a(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function eo(e){return typeof e==`string`||to(e)}function to(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var no=[],ro={allowDangerousHtml:!0},io=/^(https?|ircs?|mailto|xmpp)$/i,ao=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function oo(e){let t=so(e),n=co(e);return lo(t.runSync(t.parse(n),n),e)}function so(e){let t=e.rehypePlugins||no,n=e.remarkPlugins||no,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ro}:ro;return Ka().use(ri).use(n).use(ba,r).use(t)}function co(e){let t=e.children||``,n=new za;return typeof t==`string`?n.value=t:``+t,n}function lo(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||uo;for(let e of ao)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return ua(e,l),Ue(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in dt)if(Object.hasOwn(dt,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=dt[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function uo(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||io.test(e.slice(0,t))?e:``}function fo(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function po(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function mo(e,t,n){let r=$i((n||{}).ignore||[]),i=ho(t),a=-1;for(;++a<i.length;)ca(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function ho(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([go(e[0]),_o(e[1])])}return t}function go(e){return typeof e==`string`?new RegExp(po(e),`g`):e}function _o(e){return typeof e==`function`?e:function(){return e}}var vo=`phrasing`,yo=[`autolink`,`link`,`image`,`label`];function bo(){return{transforms:[Oo],enter:{literalAutolink:So,literalAutolinkEmail:Co,literalAutolinkHttp:Co,literalAutolinkWww:Co},exit:{literalAutolink:Do,literalAutolinkEmail:Eo,literalAutolinkHttp:wo,literalAutolinkWww:To}}}function xo(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:vo,notInConstruct:yo},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:vo,notInConstruct:yo},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:vo,notInConstruct:yo}]}}function So(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Co(e){this.config.enter.autolinkProtocol.call(this,e)}function wo(e){this.config.exit.autolinkProtocol.call(this,e)}function To(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Eo(e){this.config.exit.autolinkEmail.call(this,e)}function Do(e){this.exit(e)}function Oo(e){mo(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ko],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Ao]],{ignore:[`link`,`linkReference`]})}function ko(e,t,n,r,i){let a=``;if(!No(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!jo(n)))return!1;let o=Mo(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Ao(e,t,n,r){return!No(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function jo(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Mo(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=fo(e,`(`),a=fo(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function No(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||At(n)||kt(n))&&(!t||n!==47)}Uo.peek=Ho;function Po(){this.buffer()}function Fo(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Io(){this.buffer()}function Lo(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Ro(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=V(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zo(e){this.exit(e)}function Bo(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=V(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vo(e){this.exit(e)}function Ho(){return`[`}function Uo(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Wo(){return{enter:{gfmFootnoteCallString:Po,gfmFootnoteCall:Fo,gfmFootnoteDefinitionLabelString:Io,gfmFootnoteDefinition:Lo},exit:{gfmFootnoteCallString:Ro,gfmFootnoteCall:zo,gfmFootnoteDefinitionLabelString:Bo,gfmFootnoteDefinition:Vo}}}function Go(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Uo},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
15
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?qo:Ko))),s(),o}}function Ko(e,t,n){return t===0?e:qo(e,t,n)}function qo(e,t,n){return(n?``:` `)+e}var Jo=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];$o.attention=es,$o.peek=ts;function Yo(){return{canContainEols:[`delete`],enter:{strikethrough:Zo},exit:{strikethrough:Qo}}}function Xo(){return{handlers:{delete:$o},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Jo}]}}function Zo(e){this.enter({type:`delete`,children:[],position:void 0},e)}function Qo(e){this.exit(e)}function $o(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function es(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function ts(){return`~`}function ns(e){return e.length}function rs(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ns,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=is(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=as(r[d]);else{let e=as(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding===!1||n.alignDelimiters===!1&&i===``||n.delimiterStart===!1&&!d||r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
16
+ `)}function is(e){return e==null?``:String(e)}function as(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var os=$i([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ss(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),cs);return i(),o}function cs(e,t,n){return`>`+(n?``:` `)+e}function ls(e,t){return us(e,t.inConstruct,!0)&&!us(e,t.notInConstruct,!1)}function us(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ds(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
17
+ `&&!e.before&&!e.after&&ls(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
18
+ `}function fs(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function ps(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function ms(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hs(e,t,n,r){let i=ms(n),a=e.value||``;if(ps(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,gs);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(fs(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
19
+ `,encode:["`"],...o.current()})),t()}return u+=o.move(`
20
+ `),a&&(u+=o.move(a+`
21
+ `)),u+=o.move(s),c(),u}function gs(e,t,n){return(n?``:` `)+e}function _s(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function vs(e,t,n,r){let i=_s(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
22
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function ys(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}bs.attention=xs,bs.peek=Ss;function bs(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function xs(e,t){return{construct:`emphasis`,markers:ys(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Ss(e,t,n){return n.options.emphasis||`*`}function Cs(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function ws(e,t){let n=!1;return ua(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&pt(e)&&(t.options.setext||n))}function Ts(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ws(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
23
+ `,after:`
24
+ `});return r(),t(),o+`
25
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
26
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
27
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Cs(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Es.peek=Ds;function Es(e){return e.value||``}function Ds(){return`<`}Os.peek=ks;function Os(e,t,n,r){let i=_s(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ks(){return`!`}As.peek=js;function As(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function js(){return`!`}Ms.peek=Ns;function Ms(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Ns(){return"`"}function Ps(e,t){let n=pt(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}Fs.peek=Is;function Fs(e,t,n,r){let i=_s(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(Ps(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Is(e,t,n){return Ps(e,n)?`<`:`[`}Ls.peek=Rs;function Ls(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Rs(){return`[`}function zs(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Bs(e){let t=zs(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Vs(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Hs(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Us(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Vs(n):zs(n),s=e.ordered?o===`.`?`)`:`.`:Bs(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),Hs(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Ws(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Gs(e,t,n,r){let i=Ws(n),a=n.bulletCurrent||zs(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Ks(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function qs(e,t,n,r){if(!e.children.some(function(e){return os(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function Js(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ys.attention=Xs,Ys.peek=Zs;function Ys(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Xs(e,t){return{construct:`strong`,markers:Js(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function Zs(e,t,n){return n.options.strong||`*`}function Qs(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function $s(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ec(e,t,n){let r=(Hs(n)+(n.options.ruleSpaces?` `:``)).repeat($s(n));return n.options.ruleSpaces?r.slice(0,-1):r}var tc={blockquote:ss,break:ds,code:hs,definition:vs,emphasis:bs,hardBreak:ds,heading:Ts,html:Es,image:Os,imageReference:As,inlineCode:Ms,link:Fs,linkReference:Ls,list:Us,listItem:Gs,paragraph:Ks,root:qs,strong:Ys,text:Qs,thematicBreak:ec};function nc(){return{enter:{table:rc,tableData:sc,tableHeader:sc,tableRow:ac},exit:{codeText:cc,table:ic,tableData:oc,tableHeader:oc,tableRow:oc}}}function rc(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function ic(e){this.exit(e),this.data.inTable=void 0}function ac(e){this.enter({type:`tableRow`,children:[]},e)}function oc(e){this.exit(e)}function sc(e){this.enter({type:`tableCell`,children:[]},e)}function cc(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lc));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lc(e,t){return t===`|`?t:e}function uc(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
28
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
29
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return rs(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=tc.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function dc(){return{exit:{taskListCheckValueChecked:pc,taskListCheckValueUnchecked:pc,paragraph:mc}}}function fc(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:hc}}}function pc(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function mc(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hc(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=tc.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function gc(){return[bo(),Wo(),Yo(),nc(),dc()]}function _c(e){return{extensions:[xo(),Go(e),Xo(),uc(e),fc()]}}var vc={tokenize:Ac,partial:!0},yc={tokenize:jc,partial:!0},bc={tokenize:Mc,partial:!0},xc={tokenize:Nc,partial:!0},Sc={tokenize:Pc,partial:!0},Cc={name:`wwwAutolink`,tokenize:Oc,previous:Fc},wc={name:`protocolAutolink`,tokenize:kc,previous:Ic},Q={name:`emailAutolink`,tokenize:Dc,previous:Lc},$={};function Tc(){return{text:$}}for(var Ec=48;Ec<123;)$[Ec]=Q,Ec++,Ec===58?Ec=65:Ec===91&&(Ec=97);$[43]=Q,$[45]=Q,$[46]=Q,$[95]=Q,$[72]=[Q,wc],$[104]=[Q,wc],$[87]=[Q,Cc],$[119]=[Q,Cc];function Dc(e,t,n){let r=this,i,a;return o;function o(t){return!Rc(t)||!Lc.call(r,r.previous)||zc(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Rc(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Sc,u,l)(t):t===45||t===95||U(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&H(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Oc(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Fc.call(r,r.previous)||zc(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(vc,e.attempt(yc,e.attempt(bc,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function kc(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Ic.call(r,r.previous)&&!zc(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(H(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Tt(t)||G(t)||At(t)||kt(t)?n(t):e.attempt(yc,e.attempt(bc,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Ac(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function jc(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(xc,c,s)(t):t===null||G(t)||At(t)||t!==45&&kt(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Mc(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(xc,t,a)(o):o===null||G(o)||At(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Nc(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||G(o)||At(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||G(e)||At(e)?t(e):r(e)}function a(e){return H(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):H(t)?(e.consume(t),o):n(t)}}function Pc(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return U(e)?n(e):t(e)}}function Fc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function Ic(e){return!H(e)}function Lc(e){return!(e===47||Rc(e))}function Rc(e){return e===43||e===45||e===46||e===95||U(e)}function zc(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Bc={tokenize:Jc,partial:!0};function Vc(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Gc,continuation:{tokenize:Kc},exit:qc}},text:{91:{name:`gfmFootnoteCall`,tokenize:Wc},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Hc,resolveTo:Uc}}}}function Hc(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=V(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Uc(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Wc(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||G(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(V(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return G(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Gc(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||G(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=V(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return G(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),J(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Kc(e,t,n){return e.check(Yt,t,e.attempt(Bc,t,n))}function qc(e){e.exit(`gfmFootnoteDefinition`)}function Jc(e,t,n){let r=this;return J(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Yc(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&z(o,o.length,0,Ht(s,e.slice(r+1,n),t)),z(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),z(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Vt(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Vt(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Xc=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Zc(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Zc(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Qc(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function $c(){return{flow:{null:{name:`table`,tokenize:el,resolveAll:tl}}}}function el(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):W(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):K(t)?J(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||G(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,K(t)?J(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return K(t)?J(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||W(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return K(t)?J(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||W(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||W(n)?(e.exit(`tableRow`),t(n)):K(n)?J(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||G(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function tl(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Xc;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(rl(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=nl(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=nl(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=nl(f,t,o,i,n,d)):(o[0]=o[1],d=nl(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&rl(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Qc(t.events,n))}return e}function nl(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},il(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=il(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=il(t.events,n[2]),a=il(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},il(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function rl(e,t,n,r,i){let a=[],o=il(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function il(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var al={name:`tasklistCheck`,tokenize:sl};function ol(){return{text:{91:al}}}function sl(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return G(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return W(r)?t(r):K(r)?e.check({tokenize:cl},t,n)(r):n(r)}}function cl(e,t,n){return J(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function ll(e){return bt([Tc(),Vc(),Yc(e),$c(),ol()])}var ul={};function dl(e){let t=this,n=e||ul,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ll(n)),a.push(gc()),o.push(_c(n))}function fl(e,t){if(!t)return[{text:e,matched:!1}];let n=RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)})`,`giu`);return e.split(n).map((e,t)=>({text:e,matched:t%2==1}))}function pl({value:e,query:t}){return fl(e,t).map((e,t)=>e.matched?(0,d.jsx)(`mark`,{className:`search-highlight`,children:e.text},t):e.text)}function ml(e,t){let n=fl(e,t),r=n.findIndex(e=>e.matched);if(r<0)return Array.from(e).slice(0,80).join(``)+(Array.from(e).length>80?`…`:``);let i=Array.from(n.slice(0,r).map(e=>e.text).join(``)),a=Array.from(n.slice(r+1).map(e=>e.text).join(``));return(i.length>36?`…`:``)+i.slice(-36).join(``)+n[r].text+a.slice(0,60).join(``)+(a.length>60?`…`:``)}function hl({query:e}){return t=>{function n(t){t.children&&=t.children.flatMap(t=>t.type===`text`&&t.value?fl(t.value,e).filter(e=>e.text).map(e=>e.matched?{type:`element`,tagName:`mark`,properties:{className:[`search-highlight`]},children:[{type:`text`,value:e.text}]}:{type:`text`,value:e.text}):(n(t),[t]))}n(t)}}function gl({project:e,id:t}){let{data:n}=c(e,t);return n?(0,d.jsxs)(d.Fragment,{children:[`#`,n.number,` `,n.task.title]}):(0,d.jsx)(d.Fragment,{children:`查看任务`})}var _l=(0,u.memo)(function({children:e,onLink:n,onFile:r,highlight:i=``,components:a}){let s=(0,u.useCallback)(({href:e,children:t})=>{let r=e&&typeof t==`string`&&t===e?l(e):void 0;return(0,d.jsx)(`a`,{href:e?.startsWith(`/projects/`)?o(e):e,target:`_blank`,rel:`noreferrer noopener`,onClick:t=>{if(e?.startsWith(`#`)){t.preventDefault();let n=``;try{n=decodeURIComponent(e.slice(1))}catch{return}[...t.currentTarget.closest(`.markdown`)?.querySelectorAll(`h1,h2,h3,h4,h5,h6`)??[]].find(e=>e.textContent?.trim().toLowerCase().replace(/\s+/g,`-`)===n.toLowerCase())?.scrollIntoView({block:`center`})}else e&&n?.(e)&&t.preventDefault()},children:r?(0,d.jsx)(gl,{...r}):t})},[n]);return(0,d.jsx)(oo,{remarkPlugins:[dl],rehypePlugins:[...r?[_]:[],...i?[[hl,{query:i}]]:[]],skipHtml:!0,components:{...r?{button:({node:e,children:t})=>(0,d.jsx)(`button`,{type:`button`,className:`computer-file-link`,title:String(e?.properties.dataFilePath),onClick:()=>r({path:String(e?.properties.dataFilePath),line:Number(e?.properties.dataFileLine)||void 0}),children:t})}:{},a:s,img:({alt:e})=>(0,d.jsxs)(`span`,{className:`muted`,children:[`[`,t.remoteImage,`: `,e,`]`]}),...a},children:e})});export{m as a,f as i,pl as n,ml as r,_l as t};
@@ -1 +1 @@
1
- import{c as e,j as t,kt as n}from"./Dropdown-DXEtBxVr.js";var r=n(),i=t();function a({value:t,onChange:n,onSubmit:a,onQueue:s,label:c,placeholder:l=`输入消息…`,disabled:u=!1,sendDisabled:d=!1,sendLabel:f=`发送`,actions:p,beforeSend:m,heading:h,inset:g=!1,plain:_=!1,attachments:v,hasAttachments:y=!1,onFiles:b}){let x=o(t),[S,C]=(0,r.useState)(!1),w=(0,r.useRef)(0),T=!u&&!d&&(!!t.trim()||y);return(0,i.jsxs)(`form`,{className:`message-composer${g?` message-composer-inset`:``}${_?` message-composer-plain`:``}${S?` message-composer-dragging`:``}`,onDragEnter:e=>{b&&!u&&e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),w.current++,C(!0))},onDragLeave:()=>{w.current=Math.max(0,w.current-1),w.current||C(!1)},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=b&&!u?`copy`:`none`)},onDrop:e=>{w.current=0,C(!1),e.dataTransfer.files.length&&(e.preventDefault(),b&&!u&&b(Array.from(e.dataTransfer.files)))},onSubmit:e=>{e.preventDefault(),T&&a(e)},children:[h&&(0,i.jsx)(`div`,{className:`message-composer-heading`,children:h}),v,(0,i.jsx)(`textarea`,{ref:x,value:t,onChange:e=>n(e.target.value),"aria-label":c,placeholder:l,disabled:u,onPaste:e=>{let r=e.clipboardData.files.length?Array.from(e.clipboardData.files):Array.from(e.clipboardData.items).flatMap(e=>{let t=e.kind===`file`?e.getAsFile():null;return t?[t]:[]});if(b&&!u&&r.length){e.preventDefault(),b(r);let i=e.clipboardData.getData(`text/plain`);if(i){let r=e.currentTarget.selectionStart;n(t.slice(0,r)+i+t.slice(e.currentTarget.selectionEnd)),requestAnimationFrame(()=>x.current?.setSelectionRange(r+i.length,r+i.length))}}},rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),T&&(s&&(e.metaKey||e.ctrlKey)?s():e.currentTarget.form?.requestSubmit()))}}),(0,i.jsxs)(`div`,{className:`message-composer-footer`,children:[p&&(0,i.jsx)(`div`,{className:`message-composer-actions`,children:p}),m,(0,i.jsx)(`button`,{type:`submit`,className:`primary message-send`,"aria-label":f,title:s?`${f}(Ctrl / ⌘ + Enter 排队)`:f,disabled:!T,children:(0,i.jsx)(e,{name:`send`,size:`small`})})]})]})}function o(e,t){let n=(0,r.useRef)(null);return(0,r.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let r=()=>{t?.(e),e.style.height=`0px`,e.style.height=`${e.scrollHeight}px`};r();let i=e.clientWidth,a=new ResizeObserver(()=>{i!==e.clientWidth&&(i=e.clientWidth,r())});return a.observe(e),()=>a.disconnect()},[e,t]),n}export{o as n,a as t};
1
+ import{At as e,M as t,c as n}from"./Dropdown-DGFI68Vd.js";var r=e(),i=t();function a({value:e,onChange:t,onSubmit:a,onQueue:s,label:c,placeholder:l=`输入消息…`,disabled:u=!1,sendDisabled:d=!1,sendLabel:f=`发送`,actions:p,beforeSend:m,heading:h,inset:g=!1,plain:_=!1,attachments:v,hasAttachments:y=!1,onFiles:b}){let x=o(e),[S,C]=(0,r.useState)(!1),w=(0,r.useRef)(0),T=!u&&!d&&(!!e.trim()||y);return(0,i.jsxs)(`form`,{className:`message-composer${g?` message-composer-inset`:``}${_?` message-composer-plain`:``}${S?` message-composer-dragging`:``}`,onDragEnter:e=>{b&&!u&&e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),w.current++,C(!0))},onDragLeave:()=>{w.current=Math.max(0,w.current-1),w.current||C(!1)},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=b&&!u?`copy`:`none`)},onDrop:e=>{w.current=0,C(!1),e.dataTransfer.files.length&&(e.preventDefault(),b&&!u&&b(Array.from(e.dataTransfer.files)))},onSubmit:e=>{e.preventDefault(),T&&a(e)},children:[h&&(0,i.jsx)(`div`,{className:`message-composer-heading`,children:h}),v,(0,i.jsx)(`textarea`,{ref:x,value:e,onChange:e=>t(e.target.value),"aria-label":c,placeholder:l,disabled:u,onPaste:n=>{let r=n.clipboardData.files.length?Array.from(n.clipboardData.files):Array.from(n.clipboardData.items).flatMap(e=>{let t=e.kind===`file`?e.getAsFile():null;return t?[t]:[]});if(b&&!u&&r.length){n.preventDefault(),b(r);let i=n.clipboardData.getData(`text/plain`);if(i){let r=n.currentTarget.selectionStart;t(e.slice(0,r)+i+e.slice(n.currentTarget.selectionEnd)),requestAnimationFrame(()=>x.current?.setSelectionRange(r+i.length,r+i.length))}}},rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),T&&(s&&(e.metaKey||e.ctrlKey)?s():e.currentTarget.form?.requestSubmit()))}}),(0,i.jsxs)(`div`,{className:`message-composer-footer`,children:[p&&(0,i.jsx)(`div`,{className:`message-composer-actions`,children:p}),m,(0,i.jsx)(`button`,{type:`submit`,className:`primary message-send`,"aria-label":f,title:s?`${f}(Ctrl / ⌘ + Enter 排队)`:f,disabled:!T,children:(0,i.jsx)(n,{name:`send`,size:`small`})})]})]})}function o(e,t){let n=(0,r.useRef)(null);return(0,r.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let r=()=>{t?.(e),e.style.height=`0px`,e.style.height=`${e.scrollHeight}px`};r();let i=e.clientWidth,a=new ResizeObserver(()=>{i!==e.clientWidth&&(i=e.clientWidth,r())});return a.observe(e),()=>a.disconnect()},[e,t]),n}export{o as n,a as t};
@@ -0,0 +1,6 @@
1
+ import{A as e,At as t,C as n,Ct as r,D as i,Dt as a,Et as o,H as s,I as c,L as l,M as u,Mt as d,N as f,O as p,Ot as m,S as h,V as g,_,a as v,bt as y,c as b,ct as x,d as S,dt as C,ft as w,ht as T,jt as E,l as D,lt as O,mt as k,o as ee,ot as A,p as j,pt as M,s as N,vt as P,w as F,wt as I,x as L,y as te,yt as R}from"./Dropdown-DGFI68Vd.js";import{F as z,I as B,L as V,U as H,i as ne,z as U}from"./index-BZEKT27U.js";import{a as W}from"./task-links-DTqf18C2.js";import{n as G,r as K,t as q}from"./Markdown-gPLWRWEJ.js";import{t as re}from"./Conversation-ClLZZ3fG.js";import{c as ie,l as ae,r as J}from"./WorkspaceTree-DZ6DN_OX.js";function oe(e){return m(w,e)}var Y=t(),se=r().regex(/^R\d{6,}$/),X=y({name:r().min(1),sha256:x,size:R().int().nonnegative()}),Z=o().refine(e=>/^https?:\/\//i.test(e),`Use an HTTP or HTTPS URL.`);y({operationId:a(),title:r().trim().default(``),text:r().optional(),url:Z.optional(),originals:k(X).default([])}).strict().refine(e=>!!e.text?.trim()||!!e.url||e.originals.length>0,`Provide text, a link or a file.`),y({expectedRevision:O,title:r().trim().min(1).optional(),url:Z.nullable().optional(),content:r().optional(),summary:r().optional(),sourceVersion:r().optional(),contentDate:r().optional(),originals:k(X).optional()}).strict();var ce=y({id:se,projectId:r(),title:r(),submittedBy:r(),createdAt:r(),revision:O,source:y({kind:M([`web`,`chat`,`group`]),url:r().nullable(),groupId:r().optional(),messageId:r().optional(),sourceVersion:r().optional(),contentDate:r().optional()}),originals:k(X),content:r().nullable(),summary:r().nullable(),state:M([`waiting`,`running`,`ready`,`failed`]),error:r().nullable(),url:r()}),le=y({materials:k(ce),nextCursor:R().nullable()});y({query:r().trim().min(1),scope:M([`all`,`workspace`,`materials`]).default(`all`),materialId:se.optional(),originalHash:x.optional(),after:r().default(``),limit:oe().int().min(1).max(200).default(30)}).strict();var ue=y({items:k(y({key:r(),kind:M([`workspace`,`materials`]),title:r(),snippet:r(),url:r(),path:r()})),nextCursor:r().nullable()}),Q=u();function de(e){let t=(e.content??``).trimStart().split(`
2
+ `);return t[0]?.replace(/^#\s+/,``).trim()===e.title.trim()&&t[0].startsWith(`# `)&&t.shift(),t.join(`
3
+ `).trimStart()}function fe(){let e=new URLSearchParams(location.search),t=e.get(`id`);return t?{id:t,...e.get(`original`)?{original:e.get(`original`)}:{},...e.get(`revision`)?{revision:e.get(`revision`)}:{}}:void 0}function pe({active:t,onActivate:n,children:r}){let{request:i,projectId:a}=H(),[o,s]=(0,Y.useState)(fe),[l,u]=(0,Y.useState)(o),[f,m]=(0,Y.useState)(()=>new Set(o?[o.id]:[])),[g,_]=(0,Y.useState)(!1),[v,y]=(0,Y.useState)(``),[x,S]=(0,Y.useState)(``),[C,w]=(0,Y.useState)(``),[T,O]=(0,Y.useState)([]),[k,A]=(0,Y.useState)(),[j,M]=(0,Y.useState)(!1),N=F(),P=(0,Y.useRef)(null),I=(0,Y.useCallback)(e=>i(`materials`,le,{signal:e}),[i]),L=p(I,5e3,e(a,`materials`)),R=(0,Y.useCallback)(e=>o?i(`materials/${encodeURIComponent(o.id)}${o.revision?`?revision=${encodeURIComponent(o.revision)}`:``}`,ce,{signal:e}):Promise.resolve(null),[i,o?.id,o?.revision]),B=p(R,5e3),V=B.data?.id===o?.id?B.data:null;ne(t?V?.originals.find(e=>e.sha256===o?.original)?.name??V?.title:void 0);let W=[...new Map([...T,...L.data?.materials??[],...V?[V]:[]].map(e=>[e.id,e])).values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)),G=k===void 0?L.data?.nextCursor:k;function K(e,t=``){n(),s(e),u(e),S(``),w(t),_(!1),m(t=>new Set([...t,e.id])),history.replaceState(null,``,E(`/projects/${a}/materials?${new URLSearchParams({...e})}`))}(0,Y.useEffect)(()=>{let e=()=>{if(!d().endsWith(`/materials`))return;let e=fe();s(e),u(e),S(``),y(``),w(``),_(!1),e&&m(t=>new Set([...t,e.id]))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);async function re(){if(G&&!j){M(!0),N(``);try{let e=await i(`materials?before=${G}`,le);O(t=>[...t,...e.materials]),A(e.nextCursor)}catch(e){N(c(e))}finally{M(!1)}}}let ae=W.find(e=>e.id===l?.id),J=ae?.originals.find(e=>e.sha256===l?.original)?.name??ae?.title??`当前资料`;function oe(){u(void 0),w(``),P.current?.focus()}let se=(0,Q.jsx)(D,{icon:`plus`,label:`新增资料`,onClick:()=>{n(),_(!0),N(``)}}),X=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{resource:L}),L.data?W.length===0?(0,Q.jsx)(`p`,{className:`tree-status`,children:`暂无资料`}):(0,Q.jsx)(Q.Fragment,{children:W.map(e=>(0,Q.jsxs)(`div`,{role:`none`,children:[(0,Q.jsxs)(U,{role:`treeitem`,"aria-level":1,"aria-expanded":f.has(e.id),"aria-selected":t&&!g&&o?.id===e.id&&!o.original,className:`tree-item tree-folder`,style:{"--tree-level":1},"data-testid":`material-folder`,title:e.title,onClick:()=>{let t=f.has(e.id);K({id:e.id}),t&&m(t=>{let n=new Set(t);return n.delete(e.id),n})},leading:(0,Q.jsx)(`span`,{className:`tree-chevron ${f.has(e.id)?`expanded`:``}`,children:(0,Q.jsx)(b,{name:`chevron`,size:`small`})}),children:[(0,Q.jsx)(b,{name:`files`}),(0,Q.jsx)(`span`,{className:`tree-name`,children:e.title})]}),f.has(e.id)&&(0,Q.jsx)(`div`,{role:`group`,children:[...e.originals].sort((e,t)=>ie(e.name,t.name)).map((n,r)=>(0,Q.jsxs)(U,{role:`treeitem`,"aria-level":2,"aria-selected":t&&!g&&o?.id===e.id&&o.original===n.sha256,className:`tree-item`,style:{"--tree-level":2},"data-testid":`material-original`,title:n.name,onClick:()=>K({id:e.id,original:n.sha256,...e.id===o?.id&&o.revision?{revision:o.revision}:{}}),leading:(0,Q.jsx)(`span`,{className:`tree-chevron`}),children:[(0,Q.jsx)(b,{name:`file`}),(0,Q.jsx)(`span`,{className:`tree-name`,children:n.name})]},`${n.sha256}:${r}`))})]},e.id))}):!L.error&&(0,Q.jsx)(`p`,{className:`tree-status`,children:`加载中…`}),G&&(0,Q.jsx)(`button`,{className:`tree-action`,disabled:j,onClick:()=>void re(),children:j?`加载中…`:`加载更多`})]}),Z=!g&&!x&&o?.original,ue=g?`新增资料`:x?`搜索结果`:V?.title||`资料预览`;return r({tree:X,reader:(0,Q.jsxs)(`section`,{className:`session-reader`,"aria-label":`资料内容与搜索`,children:[Z&&V?(0,Q.jsx)(he,{material:V,hash:Z,highlight:C,error:B.error},`${V.id}:${Z}`):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{title:ue}),(0,Q.jsx)(`div`,{className:`session-reader-content`,children:g?(0,Q.jsx)(ye,{onCancel:()=>_(!1),onSaved:e=>{K({id:e}),L.reload()}}):x?(0,Q.jsx)(me,{query:x,scope:l,onSelect:e=>K(e,x)},`${x}/${l?.id}/${l?.original}`):o?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{resource:B}),V?(0,Q.jsxs)(`article`,{className:`material-body`,children:[o.revision&&(0,Q.jsx)(`button`,{className:`material-link`,onClick:()=>K({id:o.id}),children:`查看最新内容`}),!o.revision&&(V.state===`waiting`||V.state===`running`)?(0,Q.jsx)(`p`,{className:`muted`,role:`status`,children:`正在整理…`}):null,(0,Q.jsx)(te,{children:V.error}),!o.revision&&V.state===`failed`&&(0,Q.jsx)(`button`,{onClick:()=>void i(`materials/${o.id}/retry`,ce,{method:`POST`}).then(()=>B.reload()).catch(e=>N(c(e))),children:`重试整理`}),V.content?(0,Q.jsx)(`div`,{className:`markdown`,children:(0,Q.jsx)(q,{highlight:C,children:de(V)})}):(0,Q.jsx)(`p`,{className:`muted`,children:`正文尚未整理,可以先查看左侧原件。`})]}):!B.error&&(0,Q.jsx)(`p`,{role:`status`,children:`加载中…`})]}):(0,Q.jsx)(ee,{mascot:!0,title:`选择资料开始阅读`,description:`也可以在下方搜索资料内容。`})})]}),!g&&(0,Q.jsxs)(`form`,{className:`session-search-dock`,"data-testid":`material-search-form`,onSubmit:e=>{e.preventDefault(),S(v.trim()),w(``)},children:[l&&(0,Q.jsxs)(`button`,{type:`button`,className:`search-scope-chip`,title:`清除搜索范围`,"aria-label":`清除范围:${J}`,onClick:oe,children:[(0,Q.jsxs)(`span`,{className:`scope-label`,children:[`搜索:`,J]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]}),(0,Q.jsxs)(`div`,{className:`session-search-input-row`,children:[(0,Q.jsx)(`input`,{ref:P,"aria-label":`搜索资料`,placeholder:`搜索资料内容`,value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Backspace`&&!v&&l&&(e.preventDefault(),oe())}}),(x||v||C)&&(0,Q.jsx)(D,{icon:`close`,label:`清空搜索`,onClick:()=>{y(``),S(``),w(``),P.current?.focus()}}),(0,Q.jsx)(D,{icon:`search`,type:`submit`,label:`搜索`,disabled:!v.trim()})]})]})]}),actions:se,href:`/projects/${a}/materials${o&&!g?`?${new URLSearchParams({...o})}`:``}`})}function me({query:e,scope:t,onSelect:n}){let{request:r}=H(),[i,a]=(0,Y.useState)(``),o=(0,Y.useCallback)(n=>r(`resources/search?${new URLSearchParams({query:e,scope:`materials`,after:i,...t?{materialId:t.id}:{},...t?.original?{originalHash:t.original}:{}})}`,ue,{signal:n}),[r,e,t?.id,t?.original,i]),s=p(o);return(0,Q.jsxs)(`section`,{className:`session-results stack`,"aria-label":`搜索结果`,children:[(0,Q.jsx)(h,{resource:s}),s.loading?(0,Q.jsx)(`p`,{role:`status`,children:`正在搜索…`}):s.data?.items.length===0?(0,Q.jsx)(`p`,{className:`empty`,children:`没有找到匹配的资料`}):s.data?.items.map(t=>(0,Q.jsxs)(`button`,{className:`session-item`,"data-testid":`material-match`,onClick:()=>{let e=new URL(t.url,location.origin).searchParams;n({id:e.get(`id`),...e.get(`original`)?{original:e.get(`original`)}:{},...e.get(`revision`)?{revision:e.get(`revision`)}:{}})},children:[(0,Q.jsx)(`strong`,{children:t.title.replace(/^R\d+ · /,``)}),(0,Q.jsx)(`span`,{className:`session-excerpt`,children:(0,Q.jsx)(G,{value:K(t.snippet,e),query:e})})]},t.key)),s.data?.nextCursor&&(0,Q.jsx)(`button`,{disabled:s.loading,onClick:()=>a(s.data.nextCursor),children:`下一页`})]})}function he({material:t,hash:n,highlight:r,error:i}){let{projectId:a}=H(),o=t.originals.find(e=>e.sha256===n),s=E(`/api/v1/projects/${a}/materials/${t.id}/originals/${n}?revision=${t.revision}`),[c,l]=(0,Y.useState)(!1),u=(0,Y.useCallback)(async e=>{let t=await fetch(s,{signal:e});if(!t.ok)throw new f(`HTTP_ERROR`,`原件暂时无法读取。`,t.status);let n=await t.arrayBuffer();try{let e=new TextDecoder(`utf8`,{fatal:!0}).decode(n);return e.includes(`\0`)?null:e}catch{return null}},[s]),d=p(u,!1,e(a,`material-original`,n));if(!o)return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{title:`资料原件`}),(0,Q.jsx)(`div`,{className:`session-reader-content`,children:(0,Q.jsx)(te,{announce:!0,children:`找不到此原件。`})})]});let m=/\.(md|markdown)$/i.test(o.name),g=/\.html?$/i.test(o.name);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{title:o.name,actions:(0,Q.jsxs)(`div`,{className:`toolbar-actions`,children:[(m||g)&&(0,Q.jsx)(D,{icon:c?`preview`:`code`,label:c?`切换为预览`:`切换为原文`,"aria-pressed":c,onClick:()=>l(!c)}),(0,Q.jsx)(`a`,{className:`icon-button`,"aria-label":`下载原件`,title:`下载原件`,href:s,download:o.name,children:(0,Q.jsx)(b,{name:`download`})})]})}),(0,Q.jsxs)(`div`,{className:`session-reader-content`,children:[(0,Q.jsx)(L,{message:i}),(0,Q.jsx)(h,{resource:d}),d.loading&&d.data===void 0?(0,Q.jsx)(`p`,{role:`status`,children:`加载中…`}):d.data===null?(0,Q.jsx)(`p`,{className:`muted`,children:`此格式请下载后查看。`}):d.data!==void 0&&(0,Q.jsx)(`div`,{className:`preview-body${g&&!c?` preview-body-html`:``}`,"data-testid":`material-original-content`,children:g&&!c?(0,Q.jsx)(ae,{url:s,name:o.name}):m&&!c?(0,Q.jsx)(`article`,{className:`markdown`,children:(0,Q.jsx)(q,{highlight:r,children:d.data})}):(0,Q.jsx)(`pre`,{className:`raw`,children:(0,Q.jsx)(G,{value:d.data,query:r})})})]})]})}function ge(e){if(e.kind===`text`){try{if([`http:`,`https:`].includes(new URL(e.text.trim()).protocol))return`link`}catch{}return`text`}let{name:t,type:n}=e.file;return n.startsWith(`image/`)||/\.(png|jpe?g|gif|webp|svg|heic|avif)$/i.test(t)?`imageFile`:/\.(csv|tsv|xlsx?|ods)$/i.test(t)?`spreadsheetFile`:/\.(json|ya?ml|xml|html?|css|[cm]?[jt]sx?|py|go|rs|sh|sql)$/i.test(t)?`codeFile`:n.startsWith(`text/`)||/\.(pdf|docx?|odt|rtf|md|txt)$/i.test(t)?`file`:`attachment`}function _e(e){try{return new URL(e.trim()).hostname}catch{return e.trim().split(`
4
+ `)[0]?.slice(0,80)||`文本`}}function ve(e){try{return new URL(e.trim()).href}catch{return e.trim().split(`
5
+ `).slice(1).join(`
6
+ `)}}function ye({onSaved:e,onCancel:t}){let{request:n,projectId:r}=H(),[i,a]=(0,Y.useState)([]),[o,s]=(0,Y.useState)(),[u,d]=(0,Y.useState)(!1),f=F(),p=(0,Y.useRef)(null),m=(0,Y.useRef)(l()),h=(0,Y.useRef)(new Map);function g(e){a(e),m.current=l(),f(``)}async function _(){d(!0),f(``);try{let t=[];for(let[e,n]of i.entries()){let i=h.current.get(n.id);if(!i){let t=n.kind===`file`?n.file.name:`${_e(n.text)}.txt`,a=await fetch(E(`/api/v1/projects/${r}/materials/uploads`),{method:`POST`,headers:{"content-type":`application/octet-stream`,"x-teammy-web":`1`},body:n.kind===`file`?n.file:new Blob([n.text],{type:`text/plain`})}),o=await a.json();if(!a.ok)throw Error(o.error?.message??`第 ${e+1} 项上传失败。`);i={name:t,sha256:o.sha256,size:o.size},h.current.set(n.id,i)}t.push(i)}let a=i.length===1&&i[0]?.kind===`text`?i[0].text.trim():``,o;try{let e=new URL(a);[`http:`,`https:`].includes(e.protocol)&&(o=e.href)}catch{}e((await n(`materials`,ce,{method:`POST`,body:{operationId:m.current,originals:t,...o?{url:o}:{}}})).id)}catch(e){f(c(e))}finally{d(!1)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`form`,{className:`material-form`,onSubmit:e=>{e.preventDefault(),_()},children:[(0,Q.jsx)(`p`,{className:`muted`,children:`上传附件到项目,以便于Tim进行理解`}),(0,Q.jsxs)(`fieldset`,{disabled:u,children:[(0,Q.jsxs)(`div`,{className:`attachment-grid`,children:[i.map(e=>(0,Q.jsxs)(`article`,{className:`attachment-card`,"data-testid":`attachment-card`,children:[e.kind===`text`?(0,Q.jsxs)(`button`,{type:`button`,className:`attachment-content`,"aria-label":`编辑:${_e(e.text)}`,onClick:()=>s({id:e.id,text:e.text}),children:[(0,Q.jsx)(b,{name:ge(e)}),(0,Q.jsx)(`span`,{className:`attachment-name`,children:_e(e.text)}),ve(e.text)&&(0,Q.jsx)(`span`,{className:`attachment-excerpt`,children:ve(e.text)})]}):(0,Q.jsxs)(`div`,{className:`attachment-content`,children:[(0,Q.jsx)(b,{name:ge(e)}),(0,Q.jsx)(`span`,{className:`attachment-name`,children:e.file.name})]}),(0,Q.jsx)(D,{className:`attachment-remove`,icon:`close`,label:`移除:${e.kind===`file`?e.file.name:_e(e.text)}`,onClick:()=>{h.current.delete(e.id),g(i.filter(t=>t.id!==e.id))}})]},e.id)),(0,Q.jsxs)(`button`,{type:`button`,className:`attachment-add`,onClick:()=>s({text:``}),children:[(0,Q.jsx)(b,{name:`addText`}),(0,Q.jsx)(`span`,{children:`添加文本/链接`})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`attachment-add`,onClick:()=>p.current?.click(),children:[(0,Q.jsx)(b,{name:`addFile`}),(0,Q.jsx)(`span`,{children:`添加文件`})]})]}),(0,Q.jsx)(`input`,{ref:p,type:`file`,multiple:!0,hidden:!0,"aria-label":`原始文件`,onChange:e=>{g([...i,...[...e.target.files??[]].map(e=>({id:l(),kind:`file`,file:e}))]),e.target.value=``}}),(0,Q.jsxs)(`div`,{className:`actions attachment-actions`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:t,children:`取消`}),(0,Q.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!i.length,children:u?`上传中…`:`提交资料`})]})]})]}),o&&(0,Q.jsx)(S,{id:`material-text-editor`,title:`添加文本/链接`,onClose:()=>s(void 0),children:(0,Q.jsxs)(`form`,{className:`stack`,onSubmit:e=>{if(e.preventDefault(),!o.text.trim())return;let t={id:o.id??l(),kind:`text`,text:o.text};h.current.delete(t.id),g(o.id?i.map(e=>e.id===o.id?t:e):[...i,t]),s(void 0)},children:[(0,Q.jsx)(N,{id:`material-attachment-text`,label:`文本或链接`,children:(0,Q.jsx)(`textarea`,{autoFocus:!0,rows:8,value:o.text,onChange:e=>s({...o,text:e.target.value}),placeholder:`粘贴文本或网页链接`})}),(0,Q.jsx)(`div`,{className:`actions`,children:(0,Q.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!o.text.trim(),children:o.id?`保存`:`添加`})})]})})]})}var be=M([`overview`,`handoff`]),xe=y({title:r().trim().min(1),summary:r().trim().min(1)}),Se=y({markdown:r().trim().min(1)}),Ce=xe.extend({sourceRevision:O,sourceHash:x,generatedAt:r(),stale:T()}),we=y({kind:be,status:M([`absent`,`queued`,`running`,`succeeded`,`failed`]),available:T(),currentRevision:O,sourceRevision:O.nullable(),stale:T(),result:I([xe,Se]).nullable(),generatedAt:r().nullable(),error:r().nullable()}),Te=M([`claude-code`,`codex`,`cursor`,`pi`,`dsh`]),Ee=y({formatVersion:P(1),adapterVersion:P(1),agent:Te,nativeId:r().min(1).max(512),cwd:r().min(1).max(4096),messages:k(y({id:r().min(1).max(1024),role:M([`user`,`assistant`]),text:r().min(1),source:r().min(1).max(1024)}).strict())}).strict().refine(e=>new Set(e.messages.map(e=>e.id)).size===e.messages.length,`Duplicate message IDs.`);y({operationId:a(),sessionKey:x,parentRevision:O,blob:A}).strict(),y({revision:O,hash:x.nullable(),cleared:T()});var De=y({owner:C,sessionKey:x,agent:Te,nativeId:r(),cwd:r(),title:r(),revision:O,updatedAt:r(),messageCount:R().int().nonnegative(),blob:A,overview:Ce.optional()}),Oe=y({sessions:k(De),nextCursor:O.nullable()}),ke=y({totalSessions:R().int().nonnegative(),totalMessages:R().int().nonnegative(),memberCount:R().int().nonnegative(),updatedAt:r().nullable()});y({owner:C.optional(),sessionKey:x.optional()}).strict().refine(e=>!e.sessionKey||!!e.owner,`A session scope requires an owner.`);var Ae=y({matches:k(y({owner:C,sessionKey:x,revision:O,messageId:r(),source:M([`message`,`handoff`]).default(`message`),role:M([`user`,`assistant`]),snippet:r(),title:r()})),nextCursor:O.nullable()}),je=y({owner:C,key:x,revision:O.refine(e=>e>0).optional(),messageId:r().min(1).optional(),source:M([`message`,`handoff`]).optional()});function Me(e){let t=new URLSearchParams(e);if(![`owner`,`sessionKey`,`revision`,`messageId`].some(e=>t.has(e)))return{};let n=je.safeParse({owner:t.get(`owner`),key:t.get(`sessionKey`),...t.has(`revision`)?{revision:Number(t.get(`revision`))}:{},...t.has(`messageId`)?{messageId:t.get(`messageId`)}:{},...t.has(`source`)?{source:t.get(`source`)}:{}});return n.success?{target:n.data}:{error:`对话链接不完整或已损坏。`}}function Ne({members:e,refresh:t,selected:n,onOwner:r,onSession:i,level:a=1}){let[o,s]=(0,Y.useState)(()=>new Set(n?.key?[n.owner]:[])),[c,l]=(0,Y.useState)(e[0]?.id??``);return(0,Q.jsx)(`div`,{role:a===1?`tree`:`group`,"aria-label":`成员对话`,"data-testid":`session-tree`,onKeyDown:a===1?J:void 0,children:[...e].sort((e,t)=>ie(e.id,t.id)).map(e=>(0,Q.jsxs)(`div`,{role:`none`,children:[(0,Q.jsxs)(U,{type:`button`,role:`treeitem`,"aria-level":a,"aria-expanded":o.has(e.id),"aria-selected":n?.owner===e.id&&!n.key,className:`tree-item tree-folder`,style:{"--tree-level":a},tabIndex:c===e.id?0:-1,"data-testid":`session-owner`,"data-owner-id":e.id,onFocus:()=>l(e.id),onClick:()=>{s(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),r(e.id)},leading:(0,Q.jsx)(`span`,{className:`tree-chevron ${o.has(e.id)?`expanded`:``}`,children:(0,Q.jsx)(b,{name:`chevron`,size:`small`})}),children:[(0,Q.jsx)(b,{name:`files`}),(0,Q.jsx)(`span`,{className:`tree-name`,title:e.id,children:e.id})]}),o.has(e.id)&&(0,Q.jsx)(Pe,{level:a+1,owner:e.id,selected:n,onSession:i,focused:c,onFocus:l},`${e.id}/${t}`)]},e.id))})}function Pe({level:t,owner:n,selected:r,onSession:i,focused:a,onFocus:o}){let{request:s,projectId:l}=H(),u=(0,Y.useCallback)(e=>s(`sessions?${new URLSearchParams({owner:n,limit:`50`,order:`updated`})}`,Oe,{signal:e}),[n,s]),d=p(u,15e3,e(l,`session-tree`,n)),[f,m]=(0,Y.useState)(),[_,v]=(0,Y.useState)(!1),y=F(),x=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>x.current?.abort(),[]);let S=f?f.nextCursor:d.data?.nextCursor;return(0,Q.jsxs)(`div`,{role:`group`,"aria-busy":d.loading||_,children:[(0,Q.jsx)(h,{resource:d}),d.loading&&!d.data&&(0,Q.jsx)(`span`,{className:`tree-status`,role:`status`,children:`正在加载…`}),[...new Map([...f?.sessions??[],...d.data?.sessions??[]].map(e=>[e.sessionKey,e])).values()].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)||e.sessionKey.localeCompare(t.sessionKey)).map(e=>(0,Q.jsxs)(U,{type:`button`,role:`treeitem`,"aria-level":t,"aria-selected":r?.owner===n&&r.key===e.sessionKey,className:`tree-item`,style:{"--tree-level":t},tabIndex:a===`${n}/${e.sessionKey}`?0:-1,"data-testid":`session-row`,"data-owner-id":n,"data-session-key":e.sessionKey,title:g(e.title||e.nativeId),onFocus:()=>o(`${n}/${e.sessionKey}`),onClick:()=>i({owner:n,key:e.sessionKey,title:e.title||e.nativeId}),leading:(0,Q.jsx)(`span`,{className:`tree-chevron`}),children:[(0,Q.jsx)(b,{name:`sessions`}),(0,Q.jsx)(`span`,{className:`tree-name`,children:g(e.title||e.nativeId)})]},e.sessionKey)),S!=null&&(0,Q.jsx)(`button`,{className:`tree-action`,"data-testid":`session-tree-more`,disabled:_,onClick:async()=>{v(!0),y(``);let e=new AbortController;x.current=e;try{let t=await s(`sessions?${new URLSearchParams({owner:n,after:String(S),limit:`50`,order:`updated`})}`,Oe,{signal:e.signal});m(e=>({sessions:[...e?.sessions??[],...t.sessions],nextCursor:t.nextCursor}))}catch(t){e.signal.aborted||y(c(t))}finally{e.signal.aborted||v(!1)}},children:`加载更多`})]})}function Fe({info:e,targeted:t=!1,highlight:n=``}){let[r,i]=(0,Y.useState)(t),a=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{t&&a.current?.scrollIntoView({block:`center`})},[t]),(0,Q.jsxs)(`details`,{ref:a,open:r,className:`session-handoff`,onToggle:e=>i(e.currentTarget.open),children:[(0,Q.jsx)(`summary`,{children:`交接说明`}),r&&(0,Q.jsx)(Ie,{info:e,revision:t?e.revision:void 0,highlight:n})]})}function Ie({info:e,revision:t,highlight:n}){let{request:r}=H(),a=`sessions/${encodeURIComponent(e.owner)}/${e.sessionKey}`,o=(0,Y.useCallback)(e=>r(`${a}/analysis/handoff${t===void 0?``:`?revision=${t}`}`,we,{signal:e}),[r,a,t]),s=p(o,5e3),l=i(),[u,d]=(0,Y.useState)(!1),f=F(),m=s.data,g=u||m?.status===`queued`||m?.status===`running`,v=m?.result&&`markdown`in m.result?m.result.markdown:void 0;return(0,Q.jsxs)(`div`,{className:`stack`,"data-testid":`session-handoff`,children:[(0,Q.jsx)(h,{resource:s}),s.loading&&!m&&(0,Q.jsx)(`small`,{role:`status`,children:`正在加载…`}),m&&(0,Q.jsxs)(`div`,{className:`inline-actions`,children:[m.status===`failed`&&t===void 0&&(0,Q.jsx)(`button`,{"data-testid":`session-handoff-generate`,disabled:g||!m.available,onClick:async()=>{d(!0),f(``);try{await r(`${a}/handoff`,we,{method:`POST`,signal:l}),await s.reload()}catch(e){l.aborted||f(c(e))}finally{l.aborted||d(!1)}},children:g?`正在整理…`:`重试`}),!m.available&&(0,Q.jsx)(`small`,{children:`请先配置项目模型接入点`}),m.status===`failed`&&(0,Q.jsx)(`small`,{children:`整理未完成,可重试`}),m.available&&m.status!==`failed`&&(!v||m.stale||g)&&(0,Q.jsx)(`small`,{role:`status`,children:m.status===`running`||u?`正在整理…`:v?`对话已有新内容,等待自动更新…`:`等待自动整理…`}),m.currentRevision!==e.revision&&(0,Q.jsx)(`small`,{children:`交接说明使用最新对话;当前阅读的是历史原文`})]}),v&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`small`,{children:[`基于版本 `,m.sourceRevision,` · `,(0,Q.jsx)(_,{value:m.generatedAt})]}),(0,Q.jsx)(`div`,{className:`markdown`,"data-testid":`session-handoff-body`,children:(0,Q.jsx)(q,{highlight:n,children:v})})]})]})}function Le({members:t,active:n,onActivate:r,children:i}){let{request:a,projectId:o,api:c}=H(),l=(0,Y.useCallback)(async e=>{let[t,n]=await Promise.all([a(`sessions/stats`,ke,{signal:e}),c.members(e)]);return{...t,members:n.members}},[a,c]),u=p(l,!0,e(o,`session-stats`)),[f,m]=(0,Y.useState)(``),[_,y]=(0,Y.useState)(``),[b,x]=(0,Y.useState)(0),[S]=(0,Y.useState)(()=>Me(location.search)),[C,w]=(0,Y.useState)(S.target),[T,O]=(0,Y.useState)(S.target);ne(n&&T?.title?g(T.title):void 0);let[k,A]=(0,Y.useState)(S.error??``),[j,M]=(0,Y.useState)(``),N=(0,Y.useRef)(null),P=C?.key?C.title?`搜索对话:${g(C.title)}`:`搜索当前对话`:C?`搜索:${C.owner} 的对话内容`:``,F=()=>{w(void 0),M(``),I(),N.current?.focus()};function I(){if(!T?.messageId)return;let{messageId:e,...t}=T;O(t),history.replaceState(null,``,E(W(o,t.owner,t.key,t)))}let L=(0,Y.useCallback)(e=>{O(t=>t?.owner===e.owner&&t.key===e.sessionKey&&t.title!==e.title?{...t,title:e.title}:t),w(t=>t?.owner===e.owner&&t.key===e.sessionKey&&t.title!==e.title?{...t,title:e.title}:t)},[]);(0,Y.useEffect)(()=>{let e=()=>{if(!d().endsWith(`/sessions`))return;let e=Me(location.search);O(e.target),w(e.target),A(e.error??``),y(``),m(``),M(``)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let R=(e,t=``)=>{r(),O(e),w(e),y(``),M(t),A(``),history.replaceState(null,``,E(W(o,e.owner,e.key,e)))},B=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{resource:u}),(0,Q.jsx)(Ne,{members:(u.data?.members??t).filter(e=>e.hasSessions),refresh:b,selected:n?C:void 0,level:2,onOwner:e=>{r(),w({owner:e}),O(void 0),y(``),M(``),A(``),history.replaceState(null,``,E(`/projects/${encodeURIComponent(o)}/sessions`))},onSession:R})]}),V=(0,Q.jsxs)(`section`,{className:`session-reader`,"aria-label":`对话内容与搜索`,children:[(0,Q.jsx)(z,{title:(0,Q.jsxs)(`h1`,{children:[s.sessions,(0,Q.jsx)(v,{children:(0,Q.jsx)(`span`,{"data-testid":`session-total`,children:u.data?.totalSessions??`—`})})]}),actions:(0,Q.jsx)(D,{icon:`refresh`,label:`刷新${s.sessions}`,"data-testid":`sessions-refresh`,disabled:u.loading,onClick:()=>{u.reload(),x(e=>e+1)}})}),(0,Q.jsx)(`div`,{className:`session-reader-content`,children:k?(0,Q.jsx)(te,{announce:!0,children:k}):_?(0,Q.jsx)(Re,{query:_,refresh:b,scope:{...C?{owner:C.owner}:{},...C?.key?{sessionKey:C.key}:{}},onSelect:e=>R(e,_)},`${_}/${C?.owner??``}/${C?.key??``}`):T?(0,Q.jsx)(ze,{selection:T,highlight:j,onLoaded:L,onLatest:()=>R({owner:T.owner,key:T.key})},`${T.owner}/${T.key}/${T.revision}/${T.source}/${b}`):(0,Q.jsx)(ee,{mascot:!0,title:`选择对话开始阅读`,description:`也可以在下方搜索会话库内容。`})}),(0,Q.jsxs)(`form`,{className:`session-search-dock`,"data-testid":`session-search-form`,onSubmit:e=>{e.preventDefault(),y(f.trim()),M(``),A(``),x(e=>e+1)},children:[C&&(0,Q.jsxs)(`button`,{type:`button`,className:`search-scope-chip`,"data-testid":`session-search-scope`,title:`清除搜索范围`,"aria-label":`清除范围:${P}`,onClick:F,children:[(0,Q.jsx)(`span`,{className:`scope-label`,children:P}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]}),(0,Q.jsxs)(`div`,{className:`session-search-input-row`,children:[(0,Q.jsx)(`input`,{ref:N,"aria-label":`搜索对话`,"data-testid":`session-query`,value:f,maxLength:500,placeholder:`搜索会话库内容`,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Backspace`&&!f&&C&&(e.preventDefault(),F())}}),(_||f||j)&&(0,Q.jsx)(D,{icon:`close`,label:`清空搜索`,"data-testid":`session-search-clear`,onClick:()=>{m(``),y(``),M(``),I(),N.current?.focus()}}),(0,Q.jsx)(D,{icon:`search`,type:`submit`,label:`搜索`,"data-testid":`session-search`,disabled:!f.trim()})]})]})]});return i({hasSelection:!!C,tree:B,reader:V,href:T?W(o,T.owner,T.key,T):`/projects/${o}/sessions`})}function Re({query:e,refresh:t,scope:n,onSelect:r}){let{request:i}=H(),[a,o]=(0,Y.useState)(0),s=(0,Y.useCallback)(t=>i(`sessions/search?${new URLSearchParams({q:e,after:String(a),limit:`30`,order:`updated`,...n.owner?{owner:n.owner}:{},...n.sessionKey?{sessionKey:n.sessionKey}:{}})}`,Ae,{signal:t}),[i,e,a,t,n.owner,n.sessionKey]),c=p(s);return(0,Q.jsxs)(`section`,{className:`session-results stack`,"aria-label":`搜索结果`,"aria-busy":c.loading,children:[(0,Q.jsx)(h,{resource:c}),c.loading&&(0,Q.jsx)(`p`,{role:`status`,children:`正在搜索…`}),!c.loading&&c.data?.matches.map(t=>(0,Q.jsxs)(`button`,{className:`session-item`,"data-testid":`session-match`,"data-message-id":t.messageId,onClick:()=>r({owner:t.owner,key:t.sessionKey,revision:t.revision,messageId:t.messageId||void 0,source:t.source,title:t.title}),children:[(0,Q.jsx)(`strong`,{children:g(t.title)}),(0,Q.jsxs)(`small`,{children:[t.owner,` ·`,` `,t.source===`handoff`?`交接说明`:t.role===`user`?`用户`:`助手`]}),(0,Q.jsx)(`span`,{className:`session-excerpt`,children:(0,Q.jsx)(G,{value:K(t.snippet,e),query:e})})]},`${t.owner}:${t.sessionKey}:${t.revision}:${t.source}:${t.messageId}`)),!c.loading&&c.data?.matches.length===0&&(0,Q.jsx)(`p`,{className:`empty`,children:`没有找到匹配的对话`}),c.data?.nextCursor!=null&&(0,Q.jsx)(`button`,{"data-testid":`sessions-next`,disabled:c.loading,onClick:()=>o(c.data.nextCursor),children:`下一页`}),a>0&&(0,Q.jsx)(`button`,{disabled:c.loading,onClick:()=>o(0),children:`返回第一页`})]})}function ze({selection:e,highlight:t,onLoaded:n,onLatest:r}){let{request:i}=H(),a=(0,Y.useCallback)(async t=>{try{return await i(`sessions/${encodeURIComponent(e.owner)}/${e.key}${e.revision===void 0?``:`?revision=${e.revision}`}`,De,{signal:t})}catch(e){throw e instanceof f&&e.code===`SESSION_NOT_FOUND`?Error(`找不到这条对话或引用的版本,原链接可能已失效。`):e}},[i,e.owner,e.key,e.revision]),o=p(a,5e3);return(0,Y.useEffect)(()=>{o.data&&n(o.data)},[o.data,n]),(0,Q.jsxs)(`section`,{className:`session-conversation stack`,"data-testid":`session-detail`,children:[(0,Q.jsx)(h,{resource:o}),o.loading&&!o.data&&(0,Q.jsx)(`p`,{role:`status`,children:`正在读取对话…`}),o.data&&(0,Q.jsx)(Be,{info:o.data,messageId:e.messageId,handoff:e.source===`handoff`,highlight:t,pinned:e.revision!==void 0,onLatest:r},o.data.blob.sha256)]})}function Be({info:e,messageId:t,handoff:n,highlight:r,pinned:i,onLatest:a}){let{readTextBlob:o,projectId:s}=H(),c=(0,Y.useCallback)(async t=>Ee.parse(JSON.parse(await o(e.blob,t))),[e.blob.sha256,e.blob.size]),l=p(c),u=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{l.data&&t&&u.current?.scrollIntoView({block:`center`})},[l.data,t]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`header`,{className:`conversation-header`,children:[(0,Q.jsx)(`h2`,{className:`session-title`,children:g(e.title||e.nativeId)}),(0,Q.jsxs)(`p`,{children:[e.owner,` · `,e.agent,` · `,e.messageCount,` 条消息`]}),(0,Q.jsxs)(`small`,{children:[(0,Q.jsx)(_,{value:e.updatedAt}),i&&(0,Q.jsxs)(Q.Fragment,{children:[` `,`· 引用版本 `,e.revision,` ·`,` `,(0,Q.jsx)(`a`,{href:E(W(s,e.owner,e.sessionKey)),onClick:e=>{e.preventDefault(),a()},children:`查看最新`})]})]}),e.overview&&(0,Q.jsx)(`p`,{"data-testid":`session-summary`,children:e.overview.summary}),e.overview?.stale&&(0,Q.jsx)(`small`,{children:`摘要待更新`})]}),(0,Q.jsx)(Fe,{info:e,targeted:n,highlight:n?r:``}),(0,Q.jsx)(h,{resource:l}),l.loading&&(0,Q.jsx)(`p`,{role:`status`,children:`正在读取对话…`}),l.data&&(0,Q.jsxs)(Q.Fragment,{children:[t&&!l.data.messages.some(e=>e.id===t)&&(0,Q.jsx)(j,{children:`该版本中找不到引用的消息,已打开对话原文。`}),(0,Q.jsx)(`div`,{className:`session-messages`,children:l.data.messages.map(e=>(0,Q.jsx)(re,{mine:e.role===`user`,author:e.role===`user`?`用户`:`助手`,className:`session-message ${e.role} ${e.id===t?`matched`:``}`,"data-testid":`session-message`,"data-message-id":e.id,ref:e.id===t?u:void 0,children:(0,Q.jsx)(`div`,{className:`markdown`,children:(0,Q.jsx)(q,{highlight:r,children:e.text})})},e.id))})]})]})}var $=r().trim().min(1),Ve=y({id:a(),text:$,state:M([`draft`,`kept`]),revision:R().int().positive(),createdAt:r(),updatedAt:r()}),He=y({cards:k(Ve)});y({id:a(),text:$}).strict(),y({expectedRevision:R().int().positive(),text:$.optional(),action:M([`keep`,`discard`,`delete`]).optional()}).strict().refine(e=>e.text!==void 0||e.action!==void 0,`没有需要保存的修改。`),y({text:$}).strict();function Ue(){let{request:t,projectId:n}=H(),r=(0,Y.useCallback)(e=>t(`memory`,He,{signal:e}),[t]),i=p(r,5e3,e(n,`memory`)),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)({}),u=(0,Y.useRef)(null),d=[...i.data?.cards??[]];for(let e of Object.values(s))d.some(t=>t.id===e.id)||d.push(e);if(i.data&&!u.current&&(u.current=[...d].sort((e,t)=>Number(t.state===`kept`)-Number(e.state===`kept`)).map(e=>e.id)),u.current){let e=new Map(u.current.map((e,t)=>[e,t]));for(let t of d)e.has(t.id)||(e.set(t.id,u.current.length),u.current.push(t.id));d.sort((t,n)=>e.get(t.id)-e.get(n.id))}return(0,Q.jsxs)(`section`,{className:`session-reader`,"aria-label":`项目记忆`,children:[(0,Q.jsx)(z,{title:`记忆`,actions:(0,Q.jsx)(D,{icon:`plus`,label:`新增记忆`,disabled:!!a,onClick:()=>o(l())})}),(0,Q.jsxs)(`div`,{className:`memory-page`,children:[(0,Q.jsx)(h,{resource:i}),!i.data&&i.loading&&(0,Q.jsx)(`p`,{role:`status`,children:`加载中…`}),(0,Q.jsxs)(`div`,{className:`memory-cards`,children:[a&&(0,Q.jsx)(We,{id:a,onDone:()=>o(null),reload:i.reload},a),d.map(e=>(0,Q.jsx)(We,{id:e.id,card:e,reload:i.reload,onEditing:t=>c(n=>{let r={...n};return t?r[e.id]=e:delete r[e.id],r})},e.id))]}),i.data&&d.length===0&&!a&&(0,Q.jsx)(`p`,{className:`memory-empty`,children:`暂无记忆`})]})]})}function We({id:e,card:t,reload:n,onDone:r,onEditing:i}){let{request:a}=H(),[o,s]=(0,Y.useState)(!t),[l,u]=(0,Y.useState)(t?.text??``),[d,f]=(0,Y.useState)(t?.revision),[p,m]=(0,Y.useState)(!1),[h,g]=(0,Y.useState)(!1),_=F(),v=(0,Y.useRef)(!1),x=(0,Y.useRef)(!1),S=(0,Y.useRef)(!1);function C(){S.current=!1,i?.(!0),u(t?.text??``),f(t?.revision),v.current=!1,g(!1),_(``),s(!0)}function w(){S.current=!0,s(!1),_(``),g(!1),i?.(!1),r?.()}async function E(u){if(!x.current){if(!u&&t&&l===t.text)s(!1),i?.(!1);else if((!u||u===`keep`)&&!$.safeParse(o?l:t?.text).success)g(!0);else{x.current=!0,m(!0),v.current=!1,g(!1),_(``);try{t?await a(`memory/${e}`,y({saved:T()}),{method:`PATCH`,body:{expectedRevision:o?d:t.revision,...u?{action:u}:{},...o&&u!==`discard`&&u!==`delete`?{text:l}:{}}}):await a(`memory`,Ve,{method:`POST`,body:{id:e,text:l}}),s(!1),await n(),i?.(!1),r?.()}catch(e){v.current=!0,_(c(e)),await n()}finally{x.current=!1,m(!1)}}}}return(0,Q.jsxs)(`article`,{className:`memory-card`,"data-testid":`memory-card`,"data-memory-id":e,children:[(0,Q.jsx)(`span`,{className:`memory-status ${t?.state===`kept`?`is-kept`:``}`,role:`img`,"aria-label":t?.state===`kept`?`已保留`:`待确认`,children:(0,Q.jsx)(b,{name:t?.state===`kept`?`check`:`question`})}),(0,Q.jsxs)(`div`,{className:`memory-content`,children:[o?(0,Q.jsx)(`textarea`,{autoFocus:!0,"aria-label":`记忆内容`,"aria-invalid":h||void 0,"aria-describedby":h?`memory-error-${e}`:void 0,value:l,rows:2,disabled:p,onChange:e=>{u(e.target.value),g(!1)},onBlur:e=>{S.current?S.current=!1:e.relatedTarget instanceof Element&&e.relatedTarget.closest(`.memory-actions`)||!h&&!v.current&&E()},onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),w()),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),E()))}}):(0,Q.jsx)(`button`,{type:`button`,className:`memory-text`,"aria-label":`编辑记忆:${t?.text??``}`,onClick:C,children:t?.text}),h&&(0,Q.jsx)(`small`,{id:`memory-error-${e}`,className:`error-detail`,children:`请填写记忆内容。`})]}),(0,Q.jsxs)(`div`,{className:`memory-actions`,onMouseDown:e=>{o&&e.preventDefault()},children:[(!t||t.state===`draft`)&&(0,Q.jsx)(D,{icon:`check`,label:t?`保留记忆`:`保存记忆`,disabled:p,onClick:()=>void E(t?`keep`:void 0)}),o&&t?.state===`kept`&&(0,Q.jsx)(D,{icon:`check`,label:`保存记忆`,disabled:p,onClick:()=>void E()}),(0,Q.jsx)(D,{icon:`close`,label:t?t.state===`draft`?`舍弃记忆`:`删除记忆`:`取消新增`,disabled:p,onClick:()=>{t?E(t.state===`draft`?`discard`:`delete`):w()}})]})]})}function Ge({section:e,members:t,navigate:r}){let{projectId:i}=H(),[a,o]=(0,Y.useState)(e===`sessions`);(0,Y.useEffect)(()=>{e===`sessions`&&o(!0)},[e]);let s=t=>{e!==t&&r(`/projects/${i}/${t}`)};return(0,Q.jsx)(pe,{active:e===`materials`,onActivate:()=>s(`materials`),children:i=>(0,Q.jsx)(Le,{members:t,active:e===`sessions`,onActivate:()=>s(`sessions`),children:t=>(0,Q.jsx)(B,{reading:!0,className:`resource-library`,"data-testid":`materials-page`,label:`资料目录`,navigation:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(V,{title:`资料`,children:i.actions}),(0,Q.jsxs)(`div`,{role:`tree`,"aria-label":`项目资料`,onKeyDown:J,style:{"--tree-level":1},children:[(0,Q.jsxs)(U,{role:`treeitem`,"aria-level":1,"aria-selected":e===`memory`,className:`tree-item tree-folder`,"data-testid":`library-memory`,leading:(0,Q.jsx)(`span`,{className:`tree-chevron`}),onClick:()=>s(`memory`),children:[(0,Q.jsx)(b,{name:`files`}),(0,Q.jsx)(`span`,{className:`tree-name`,children:`记忆`})]}),(0,Q.jsxs)(U,{role:`treeitem`,"aria-level":1,"aria-expanded":a,"aria-selected":e===`sessions`&&!t.hasSelection,className:`tree-item tree-folder`,"data-testid":`library-sessions`,leading:(0,Q.jsx)(`span`,{className:`tree-chevron ${a?`expanded`:``}`,children:(0,Q.jsx)(b,{name:`chevron`,size:`small`})}),onClick:()=>{o(!a),e!==`sessions`&&r(t.href)},children:[(0,Q.jsx)(b,{name:`files`}),(0,Q.jsx)(`span`,{className:`tree-name`,children:`会话库`})]}),(0,Q.jsx)(`div`,{hidden:!a,children:(0,Q.jsx)(n,{visible:a,children:t.tree})}),i.tree]})]}),children:e===`materials`?i.reader:e===`sessions`?t.reader:(0,Q.jsx)(Ue,{})})})})}export{Ge as ResourceLibrary};