botnote 0.1.33 → 0.1.35

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.
@@ -433,9 +433,9 @@ Error generating stack: `+v.message+`
433
433
  * This source code is licensed under the ISC license.
434
434
  * See the LICENSE file in the root directory of this source tree.
435
435
  */const $6=ve("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function T6(n,e){const t={};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const j6=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E6=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M6={};function HS(n,e){return(M6.jsx?E6:j6).test(n)}const A6=/[ \t\n\f\r]/g;function R6(n){return typeof n=="object"?n.type==="text"?KS(n.value):!1:KS(n)}function KS(n){return n.replace(A6,"")===""}class _c{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}}_c.prototype.normal={};_c.prototype.property={};_c.prototype.space=void 0;function hj(n,e){const t={},r={};for(const i of n)Object.assign(t,i.property),Object.assign(r,i.normal);return new _c(t,r,e)}function Ky(n){return n.toLowerCase()}class Vn{constructor(e,t){this.attribute=t,this.property=e}}Vn.prototype.attribute="";Vn.prototype.booleanish=!1;Vn.prototype.boolean=!1;Vn.prototype.commaOrSpaceSeparated=!1;Vn.prototype.commaSeparated=!1;Vn.prototype.defined=!1;Vn.prototype.mustUseProperty=!1;Vn.prototype.number=!1;Vn.prototype.overloadedBoolean=!1;Vn.prototype.property="";Vn.prototype.spaceSeparated=!1;Vn.prototype.space=void 0;let N6=0;const Le=Wl(),At=Wl(),Jy=Wl(),se=Wl(),ut=Wl(),Rl=Wl(),nr=Wl();function Wl(){return 2**++N6}const ex=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:At,commaOrSpaceSeparated:nr,commaSeparated:Rl,number:se,overloadedBoolean:Jy,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),rO=Object.keys(ex);class T0 extends Vn{constructor(e,t,r,i){let s=-1;if(super(e,t),JS(this,"space",i),typeof r=="number")for(;++s<rO.length;){const l=rO[s];JS(this,rO[s],(r&ex[l])===ex[l])}}}T0.prototype.defined=!0;function JS(n,e,t){t&&(n[e]=t)}function Pa(n){const e={},t={};for(const[r,i]of Object.entries(n.properties)){const s=new T0(r,n.transform(n.attributes||{},r),i,n.space);n.mustUseProperty&&n.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,t[Ky(r)]=r,t[Ky(s.attribute)]=r}return new _c(e,t,n.space)}const fj=Pa({properties:{ariaActiveDescendant:null,ariaAtomic:At,ariaAutoComplete:null,ariaBusy:At,ariaChecked:At,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:At,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:At,ariaFlowTo:ut,ariaGrabbed:At,ariaHasPopup:null,ariaHidden:At,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:se,ariaLive:null,ariaModal:At,ariaMultiLine:At,ariaMultiSelectable:At,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:At,ariaReadOnly:At,ariaRelevant:null,ariaRequired:At,ariaRoleDescription:ut,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:At,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function dj(n,e){return e in n?n[e]:e}function pj(n,e){return dj(n,e.toLowerCase())}const L6=Pa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Rl,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alpha:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:ut,autoFocus:Le,autoPlay:Le,blocking:ut,capture:null,charSet:null,checked:Le,cite:null,className:ut,closedBy:null,colorSpace:null,cols:se,colSpan:se,command:null,commandFor:null,content:null,contentEditable:At,controls:Le,controlsList:ut,coords:se|Rl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:Jy,draggable:At,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:ut,height:se,hidden:Jy,high:se,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:ut,itemRef:ut,itemScope:Le,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:se,pattern:null,ping:ut,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:ut,required:Le,reversed:Le,rows:se,rowSpan:se,sandbox:ut,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootCustomElementRegistry:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shadowRootSerializable:Le,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:At,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:At,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:At,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Le,disablePictureInPicture:Le,disableRemotePlayback:Le,exportParts:Rl,part:ut,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:pj}),_6=Pa({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:nr,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:ut,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:Rl,g2:Rl,glyphName:Rl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:nr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nr,rev:nr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nr,requiredFeatures:nr,requiredFonts:nr,requiredFormats:nr,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:nr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nr,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dj}),mj=Pa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()}}),gj=Pa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pj}),Oj=Pa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()}}),D6={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"},I6=/[A-Z]/g,eP=/-[a-z]/g,z6=/^data[-\w.:]+$/i;function Z6(n,e){const t=Ky(e);let r=e,i=Vn;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&z6.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(eP,B6);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!eP.test(s)){let l=s.replace(I6,X6);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}i=T0}return new i(r,e)}function X6(n){return"-"+n.toLowerCase()}function B6(n){return n.charAt(1).toUpperCase()}const W6=hj([fj,L6,mj,gj,Oj],"html"),j0=hj([fj,_6,mj,gj,Oj],"svg");function q6(n){return n.join(" ").trim()}var xo={},iO,tP;function V6(){if(tP)return iO;tP=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
436
- `,h="/",f="*",p="",m="comment",y="declaration";function k(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var Q=1,$=1;function A(J){var Y=J.match(e);Y&&(Q+=Y.length);var pe=J.lastIndexOf(u);$=~pe?J.length-pe:$+J.length}function I(){var J={line:Q,column:$};return function(Y){return Y.position=new T(J),K(),Y}}function T(J){this.start=J,this.end={line:Q,column:$},this.source=S.source}T.prototype.content=w;function X(J){var Y=new Error(S.source+":"+Q+":"+$+": "+J);if(Y.reason=J,Y.filename=S.source,Y.line=Q,Y.column=$,Y.source=w,!S.silent)throw Y}function z(J){var Y=J.exec(w);if(Y){var pe=Y[0];return A(pe),w=w.slice(pe.length),Y}}function K(){z(t)}function _(J){var Y;for(J=J||[];Y=G();)Y!==!1&&J.push(Y);return J}function G(){var J=I();if(!(h!=w.charAt(0)||f!=w.charAt(1))){for(var Y=2;p!=w.charAt(Y)&&(f!=w.charAt(Y)||h!=w.charAt(Y+1));)++Y;if(Y+=2,p===w.charAt(Y-1))return X("End of comment missing");var pe=w.slice(2,Y-2);return $+=2,A(pe),w=w.slice(Y),$+=2,J({type:m,comment:pe})}}function F(){var J=I(),Y=z(r);if(Y){if(G(),!z(i))return X("property missing ':'");var pe=z(s),ye=J({type:y,property:b(Y[0].replace(n,p)),value:pe?b(pe[0].replace(n,p)):p});return z(l),ye}}function le(){var J=[];_(J);for(var Y;Y=F();)Y!==!1&&(J.push(Y),_(J));return J}return K(),le()}function b(w){return w?w.replace(o,p):p}return iO=k,iO}var nP;function F6(){if(nP)return xo;nP=1;var n=xo&&xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xo,"__esModule",{value:!0}),xo.default=t;const e=n(V6());function t(r,i){let s=null;if(!r||typeof r!="string")return s;const l=(0,e.default)(r),o=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:f}=u;o?i(h,f,u):f&&(s=s||{},s[h]=f)}),s}return xo}var vu={},rP;function Y6(){if(rP)return vu;rP=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(h){return!h||t.test(h)||n.test(h)},l=function(h,f){return f.toUpperCase()},o=function(h,f){return"".concat(f,"-")},u=function(h,f){return f===void 0&&(f={}),s(h)?h:(h=h.toLowerCase(),f.reactCompat?h=h.replace(i,o):h=h.replace(r,o),h.replace(e,l))};return vu.camelCase=u,vu}var bu,iP;function U6(){if(iP)return bu;iP=1;var n=bu&&bu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=n(F6()),t=Y6();function r(i,s){var l={};return!i||typeof i!="string"||(0,e.default)(i,function(o,u){o&&u&&(l[(0,t.camelCase)(o,s)]=u)}),l}return r.default=r,bu=r,bu}var G6=U6();const H6=zd(G6),yj=xj("end"),E0=xj("start");function xj(n){return e;function e(t){const r=t&&t.position&&t.position[n]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function K6(n){const e=E0(n),t=yj(n);if(e&&t)return{start:e,end:t}}function Xu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?sP(n.position):"start"in n||"end"in n?sP(n):"line"in n||"column"in n?tx(n):""}function tx(n){return lP(n&&n.line)+":"+lP(n&&n.column)}function sP(n){return tx(n&&n.start)+"-"+tx(n&&n.end)}function lP(n){return n&&typeof n=="number"?n:1}class yn extends Error{constructor(e,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",s={},l=!1;if(t&&("line"in t&&"column"in t?s={place:t}:"start"in t&&"end"in t?s={place:t}:"type"in t?s={ancestors:[t],place:t.position}:s={...t}),typeof e=="string"?i=e:!s.cause&&e&&(l=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Xu(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}yn.prototype.file="";yn.prototype.name="";yn.prototype.reason="";yn.prototype.message="";yn.prototype.stack="";yn.prototype.column=void 0;yn.prototype.line=void 0;yn.prototype.ancestors=void 0;yn.prototype.cause=void 0;yn.prototype.fatal=void 0;yn.prototype.place=void 0;yn.prototype.ruleId=void 0;yn.prototype.source=void 0;const M0={}.hasOwnProperty,J6=new Map,eW=/[A-Z]/g,tW=new Set(["table","tbody","thead","tfoot","tr"]),nW=new Set(["td","th"]),kj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rW(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=hW(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=cW(t,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?j0:W6,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=vj(i,n,void 0);return s&&typeof s!="string"?s:i.create(n,i.Fragment,{children:s||void 0},void 0)}function vj(n,e,t){if(e.type==="element")return iW(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return sW(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return oW(n,e,t);if(e.type==="mdxjsEsm")return lW(n,e);if(e.type==="root")return aW(n,e,t);if(e.type==="text")return uW(n,e)}function iW(n,e,t){const r=n.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=j0,n.schema=i),n.ancestors.push(e);const s=wj(n,e.tagName,!1),l=fW(n,e);let o=R0(n,e);return tW.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!R6(u):!0})),bj(n,l,s,e),A0(l,o),n.ancestors.pop(),n.schema=r,n.create(e,s,l,t)}function sW(n,e){if(e.data&&e.data.estree&&n.evaluater){const r=e.data.estree.body[0];return r.type,n.evaluater.evaluateExpression(r.expression)}yc(n,e.position)}function lW(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);yc(n,e.position)}function oW(n,e,t){const r=n.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=j0,n.schema=i),n.ancestors.push(e);const s=e.name===null?n.Fragment:wj(n,e.name,!0),l=dW(n,e),o=R0(n,e);return bj(n,l,s,e),A0(l,o),n.ancestors.pop(),n.schema=r,n.create(e,s,l,t)}function aW(n,e,t){const r={};return A0(r,R0(n,e)),n.create(e,n.Fragment,r,t)}function uW(n,e){return e.value}function bj(n,e,t,r){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=r)}function A0(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function cW(n,e,t){return r;function r(i,s,l,o){const h=Array.isArray(l.children)?t:e;return o?h(s,l,o):h(s,l)}}function hW(n,e){return t;function t(r,i,s,l){const o=Array.isArray(s.children),u=E0(r);return e(i,s,l,o,{columnNumber:u?u.column-1:void 0,fileName:n,lineNumber:u?u.line:void 0},void 0)}}function fW(n,e){const t={};let r,i;for(i in e.properties)if(i!=="children"&&M0.call(e.properties,i)){const s=pW(n,i,e.properties[i]);if(s){const[l,o]=s;n.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&nW.has(e.tagName)?r=o:t[l]=o}}if(r){const s=t.style||(t.style={});s[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function dW(n,e){const t={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&n.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,n.evaluater.evaluateExpression(o.argument))}else yc(n,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&n.evaluater){const o=r.value.data.estree.body[0];o.type,s=n.evaluater.evaluateExpression(o.expression)}else yc(n,e.position);else s=r.value===null?!0:r.value;t[i]=s}return t}function R0(n,e){const t=[];let r=-1;const i=n.passKeys?new Map:J6;for(;++r<e.children.length;){const s=e.children[r];let l;if(n.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const h=i.get(u)||0;l=u+"-"+h,i.set(u,h+1)}}const o=vj(n,s,l);o!==void 0&&t.push(o)}return t}function pW(n,e,t){const r=Z6(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?T6(t):q6(t)),r.property==="style"){let i=typeof t=="object"?t:mW(n,String(t));return n.stylePropertyNameCase==="css"&&(i=gW(i)),["style",i]}return[n.elementAttributeNameCase==="react"&&r.space?D6[r.property]||r.property:r.attribute,t]}}function mW(n,e){try{return H6(e,{reactCompat:!0})}catch(t){if(n.ignoreInvalidStyle)return{};const r=t,i=new yn("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=n.filePath||void 0,i.url=kj+"#cannot-parse-style-attribute",i}}function wj(n,e,t){let r;if(!t)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,l;for(;++s<i.length;){const o=HS(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=l}else r=HS(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return M0.call(n.components,i)?n.components[i]:i}if(n.evaluater)return n.evaluater.evaluateExpression(r);yc(n)}function yc(n,e){const t=new yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=n.filePath||void 0,t.url=kj+"#cannot-handle-mdx-estrees-without-createevaluater",t}function gW(n){const e={};let t;for(t in n)M0.call(n,t)&&(e[OW(t)]=n[t]);return e}function OW(n){let e=n.replace(eW,yW);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function yW(n){return"-"+n.toLowerCase()}const sO={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"]},xW={};function N0(n,e){const t=xW,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Sj(n,r,i)}function Sj(n,e,t){if(kW(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return oP(n.children,e,t)}return Array.isArray(n)?oP(n,e,t):""}function oP(n,e,t){const r=[];let i=-1;for(;++i<n.length;)r[i]=Sj(n[i],e,t);return r.join("")}function kW(n){return!!(n&&typeof n=="object")}const aP=document.createElement("i");function L0(n){const e="&"+n+";";aP.innerHTML=e;const t=aP.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function ur(n,e,t,r){const i=n.length;let s=0,l;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(e,t),n.splice(...l);else for(t&&n.splice(e,t);s<r.length;)l=r.slice(s,s+1e4),l.unshift(e,0),n.splice(...l),s+=1e4,e+=1e4}function vr(n,e){return n.length>0?(ur(n,n.length,0,e),n):e}const uP={}.hasOwnProperty;function Pj(n){const e={};let t=-1;for(;++t<n.length;)vW(e,n[t]);return e}function vW(n,e){let t;for(t in e){const i=(uP.call(n,t)?n[t]:void 0)||(n[t]={}),s=e[t];let l;if(s)for(l in s){uP.call(i,l)||(i[l]=[]);const o=s[l];bW(i[l],Array.isArray(o)?o:o?[o]:[])}}}function bW(n,e){let t=-1;const r=[];for(;++t<e.length;)(e[t].add==="after"?n:r).push(e[t]);ur(n,0,0,r)}function Cj(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function zr(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=Ys(/[A-Za-z]/),mn=Ys(/[\dA-Za-z]/),wW=Ys(/[#-'*+\--9=?A-Z^-~]/);function Md(n){return n!==null&&(n<32||n===127)}const nx=Ys(/\d/),SW=Ys(/[\dA-Fa-f]/),PW=Ys(/[!-/:-@[-`{-~]/);function Ee(n){return n!==null&&n<-2}function ft(n){return n!==null&&(n<0||n===32)}function We(n){return n===-2||n===-1||n===32}const ap=Ys(new RegExp("\\p{P}|\\p{S}","u")),zl=Ys(/\s/);function Ys(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function Ca(n){const e=[];let t=-1,r=0,i=0;for(;++t<n.length;){const s=n.charCodeAt(t);let l="";if(s===37&&mn(n.charCodeAt(t+1))&&mn(n.charCodeAt(t+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const o=n.charCodeAt(t+1);s<56320&&o>56319&&o<57344?(l=String.fromCharCode(s,o),i=1):l="�"}else l=String.fromCharCode(s);l&&(e.push(n.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return e.join("")+n.slice(r)}function Ge(n,e,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(u){return We(u)?(n.enter(t),o(u)):e(u)}function o(u){return We(u)&&s++<i?(n.consume(u),o):(n.exit(t),e(u))}}const CW={tokenize:QW};function QW(n){const e=n.attempt(this.parser.constructs.contentInitial,r,i);let t;return e;function r(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Ge(n,e,"linePrefix")}function i(o){return n.enter("paragraph"),s(o)}function s(o){const u=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(o)}function l(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return Ee(o)?(n.consume(o),n.exit("chunkText"),s):(n.consume(o),l)}}const $W={tokenize:TW},cP={tokenize:jW};function TW(n){const e=this,t=[];let r=0,i,s,l;return o;function o($){if(r<t.length){const A=t[r];return e.containerState=A[1],n.attempt(A[0].continuation,u,h)($)}return h($)}function u($){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&Q();const A=e.events.length;let I=A,T;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){T=e.events[I][1].end;break}S(r);let X=A;for(;X<e.events.length;)e.events[X][1].end={...T},X++;return ur(e.events,I+1,0,e.events.slice(A)),e.events.length=X,h($)}return o($)}function h($){if(r===t.length){if(!i)return m($);if(i.currentConstruct&&i.currentConstruct.concrete)return k($);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(cP,f,p)($)}function f($){return i&&Q(),S(r),m($)}function p($){return e.parser.lazy[e.now().line]=r!==t.length,l=e.now().offset,k($)}function m($){return e.containerState={},n.attempt(cP,y,k)($)}function y($){return r++,t.push([e.currentConstruct,e.containerState]),m($)}function k($){if($===null){i&&Q(),S(0),n.consume($);return}return i=i||e.parser.flow(e.now()),n.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b($)}function b($){if($===null){w(n.exit("chunkFlow"),!0),S(0),n.consume($);return}return Ee($)?(n.consume($),w(n.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(n.consume($),b)}function w($,A){const I=e.sliceStream($);if(A&&I.push(null),$.previous=s,s&&(s.next=$),s=$,i.defineSkip($.start),i.write(I),e.parser.lazy[$.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<l&&(!i.events[T][1].end||i.events[T][1].end.offset>l))return;const X=e.events.length;let z=X,K,_;for(;z--;)if(e.events[z][0]==="exit"&&e.events[z][1].type==="chunkFlow"){if(K){_=e.events[z][1].end;break}K=!0}for(S(r),T=X;T<e.events.length;)e.events[T][1].end={..._},T++;ur(e.events,z+1,0,e.events.slice(X)),e.events.length=T}}function S($){let A=t.length;for(;A-- >$;){const I=t[A];e.containerState=I[1],I[0].exit.call(e,n)}t.length=$}function Q(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function jW(n,e,t){return Ge(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ca(n){if(n===null||ft(n)||zl(n))return 1;if(ap(n))return 2}function up(n,e,t){const r=[];let i=-1;for(;++i<n.length;){const s=n[i].resolveAll;s&&!r.includes(s)&&(e=s(e,t),r.push(s))}return e}const rx={name:"attention",resolveAll:EW,tokenize:MW};function EW(n,e){let t=-1,r,i,s,l,o,u,h,f;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(r=t;r--;)if(n[r][0]==="exit"&&n[r][1].type==="attentionSequence"&&n[r][1]._open&&e.sliceSerialize(n[r][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[r][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[r][1].end.offset-n[r][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;u=n[r][1].end.offset-n[r][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const p={...n[r][1].end},m={...n[t][1].start};hP(p,-u),hP(m,u),l={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...n[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...n[t][1].start},end:m},s={type:u>1?"strongText":"emphasisText",start:{...n[r][1].end},end:{...n[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},n[r][1].end={...l.start},n[t][1].start={...o.end},h=[],n[r][1].end.offset-n[r][1].start.offset&&(h=vr(h,[["enter",n[r][1],e],["exit",n[r][1],e]])),h=vr(h,[["enter",i,e],["enter",l,e],["exit",l,e],["enter",s,e]]),h=vr(h,up(e.parser.constructs.insideSpan.null,n.slice(r+1,t),e)),h=vr(h,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),n[t][1].end.offset-n[t][1].start.offset?(f=2,h=vr(h,[["enter",n[t][1],e],["exit",n[t][1],e]])):f=0,ur(n,r-1,t-r+3,h),t=r+h.length-f-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function MW(n,e){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ca(r);let s;return l;function l(u){return s=u,n.enter("attentionSequence"),o(u)}function o(u){if(u===s)return n.consume(u),o;const h=n.exit("attentionSequence"),f=ca(u),p=!f||f===2&&i||t.includes(u),m=!i||i===2&&f||t.includes(r);return h._open=!!(s===42?p:p&&(i||!m)),h._close=!!(s===42?m:m&&(f||!p)),e(u)}}function hP(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const AW={name:"autolink",tokenize:RW};function RW(n,e,t){let r=0;return i;function i(y){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(y),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),s}function s(y){return Sn(y)?(n.consume(y),l):y===64?t(y):h(y)}function l(y){return y===43||y===45||y===46||mn(y)?(r=1,o(y)):h(y)}function o(y){return y===58?(n.consume(y),r=0,u):(y===43||y===45||y===46||mn(y))&&r++<32?(n.consume(y),o):(r=0,h(y))}function u(y){return y===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(y),n.exit("autolinkMarker"),n.exit("autolink"),e):y===null||y===32||y===60||Md(y)?t(y):(n.consume(y),u)}function h(y){return y===64?(n.consume(y),f):wW(y)?(n.consume(y),h):t(y)}function f(y){return mn(y)?p(y):t(y)}function p(y){return y===46?(n.consume(y),r=0,f):y===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(y),n.exit("autolinkMarker"),n.exit("autolink"),e):m(y)}function m(y){if((y===45||mn(y))&&r++<63){const k=y===45?m:p;return n.consume(y),k}return t(y)}}const Dc={partial:!0,tokenize:NW};function NW(n,e,t){return r;function r(s){return We(s)?Ge(n,i,"linePrefix")(s):i(s)}function i(s){return s===null||Ee(s)?e(s):t(s)}}const Qj={continuation:{tokenize:_W},exit:DW,name:"blockQuote",tokenize:LW};function LW(n,e,t){const r=this;return i;function i(l){if(l===62){const o=r.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(l),n.exit("blockQuoteMarker"),s}return t(l)}function s(l){return We(l)?(n.enter("blockQuotePrefixWhitespace"),n.consume(l),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(l))}}function _W(n,e,t){const r=this;return i;function i(l){return We(l)?Ge(n,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return n.attempt(Qj,e,t)(l)}}function DW(n){n.exit("blockQuote")}const $j={name:"characterEscape",tokenize:IW};function IW(n,e,t){return r;function r(s){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(s),n.exit("escapeMarker"),i}function i(s){return PW(s)?(n.enter("characterEscapeValue"),n.consume(s),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(s)}}const Tj={name:"characterReference",tokenize:zW};function zW(n,e,t){const r=this;let i=0,s,l;return o;function o(p){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),u}function u(p){return p===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(p),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),s=31,l=mn,f(p))}function h(p){return p===88||p===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(p),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),s=6,l=SW,f):(n.enter("characterReferenceValue"),s=7,l=nx,f(p))}function f(p){if(p===59&&i){const m=n.exit("characterReferenceValue");return l===mn&&!L0(r.sliceSerialize(m))?t(p):(n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return l(p)&&i++<s?(n.consume(p),f):t(p)}}const fP={partial:!0,tokenize:XW},dP={concrete:!0,name:"codeFenced",tokenize:ZW};function ZW(n,e,t){const r=this,i={partial:!0,tokenize:I};let s=0,l=0,o;return u;function u(T){return h(T)}function h(T){const X=r.events[r.events.length-1];return s=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,o=T,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),f(T)}function f(T){return T===o?(l++,n.consume(T),f):l<3?t(T):(n.exit("codeFencedFenceSequence"),We(T)?Ge(n,p,"whitespace")(T):p(T))}function p(T){return T===null||Ee(T)?(n.exit("codeFencedFence"),r.interrupt?e(T):n.check(fP,b,A)(T)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||Ee(T)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),p(T)):We(T)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Ge(n,y,"whitespace")(T)):T===96&&T===o?t(T):(n.consume(T),m)}function y(T){return T===null||Ee(T)?p(T):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),k(T))}function k(T){return T===null||Ee(T)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),p(T)):T===96&&T===o?t(T):(n.consume(T),k)}function b(T){return n.attempt(i,A,w)(T)}function w(T){return n.enter("lineEnding"),n.consume(T),n.exit("lineEnding"),S}function S(T){return s>0&&We(T)?Ge(n,Q,"linePrefix",s+1)(T):Q(T)}function Q(T){return T===null||Ee(T)?n.check(fP,b,A)(T):(n.enter("codeFlowValue"),$(T))}function $(T){return T===null||Ee(T)?(n.exit("codeFlowValue"),Q(T)):(n.consume(T),$)}function A(T){return n.exit("codeFenced"),e(T)}function I(T,X,z){let K=0;return _;function _(Y){return T.enter("lineEnding"),T.consume(Y),T.exit("lineEnding"),G}function G(Y){return T.enter("codeFencedFence"),We(Y)?Ge(T,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):F(Y)}function F(Y){return Y===o?(T.enter("codeFencedFenceSequence"),le(Y)):z(Y)}function le(Y){return Y===o?(K++,T.consume(Y),le):K>=l?(T.exit("codeFencedFenceSequence"),We(Y)?Ge(T,J,"whitespace")(Y):J(Y)):z(Y)}function J(Y){return Y===null||Ee(Y)?(T.exit("codeFencedFence"),X(Y)):z(Y)}}}function XW(n,e,t){const r=this;return i;function i(l){return l===null?t(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}const lO={name:"codeIndented",tokenize:WW},BW={partial:!0,tokenize:qW};function WW(n,e,t){const r=this;return i;function i(h){return n.enter("codeIndented"),Ge(n,s,"linePrefix",5)(h)}function s(h){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(h):t(h)}function l(h){return h===null?u(h):Ee(h)?n.attempt(BW,l,u)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||Ee(h)?(n.exit("codeFlowValue"),l(h)):(n.consume(h),o)}function u(h){return n.exit("codeIndented"),e(h)}}function qW(n,e,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):Ee(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i):Ge(n,s,"linePrefix",5)(l)}function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(l):Ee(l)?i(l):t(l)}}const VW={name:"codeText",previous:YW,resolve:FW,tokenize:UW};function FW(n){let e=n.length-4,t=3,r,i;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r<e;)if(n[r][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(r=t-1,e++;++r<=e;)i===void 0?r!==e&&n[r][1].type!=="lineEnding"&&(i=r):(r===e||n[r][1].type==="lineEnding")&&(n[i][1].type="codeTextData",r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return n}function YW(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function UW(n,e,t){let r=0,i,s;return l;function l(p){return n.enter("codeText"),n.enter("codeTextSequence"),o(p)}function o(p){return p===96?(n.consume(p),r++,o):(n.exit("codeTextSequence"),u(p))}function u(p){return p===null?t(p):p===32?(n.enter("space"),n.consume(p),n.exit("space"),u):p===96?(s=n.enter("codeTextSequence"),i=0,f(p)):Ee(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),u):(n.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Ee(p)?(n.exit("codeTextData"),u(p)):(n.consume(p),h)}function f(p){return p===96?(n.consume(p),i++,f):i===r?(n.exit("codeTextSequence"),n.exit("codeText"),e(p)):(s.type="codeTextData",h(p))}}class GW{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){const i=t||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&wu(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),wu(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wu(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){const t=this.left.splice(e,Number.POSITIVE_INFINITY);wu(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);wu(this.left,t.reverse())}}}function wu(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function jj(n){const e={};let t=-1,r,i,s,l,o,u,h;const f=new GW(n);for(;++t<f.length;){for(;t in e;)t=e[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,HW(f,t)),t=e[t],h=!0);else if(r[1]._container){for(s=t,i=void 0;s--;)if(l=f.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},o=f.slice(i,t),o.unshift(r),f.splice(i,t-i+1,o))}}return ur(n,0,Number.POSITIVE_INFINITY,f.slice(0)),!h}function HW(n,e){const t=n.get(e)[1],r=n.get(e)[2];let i=e-1;const s=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,u=[],h={};let f,p,m=-1,y=t,k=0,b=0;const w=[b];for(;y;){for(;n.get(++i)[1]!==y;);s.push(i),y._tokenizer||(f=r.sliceStream(y),y.next||f.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=t;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(b=m+1,w.push(b),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):w.pop(),m=w.length;m--;){const S=o.slice(w[m],w[m+1]),Q=s.pop();u.push([Q,Q+S.length-1]),n.splice(Q,2,S)}for(u.reverse(),m=-1;++m<u.length;)h[k+u[m][0]]=k+u[m][1],k+=u[m][1]-u[m][0]-1;return h}const KW={resolve:e7,tokenize:t7},JW={partial:!0,tokenize:n7};function e7(n){return jj(n),n}function t7(n,e){let t;return r;function r(o){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):Ee(o)?n.check(JW,l,s)(o):(n.consume(o),i)}function s(o){return n.exit("chunkContent"),n.exit("content"),e(o)}function l(o){return n.consume(o),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function n7(n,e,t){const r=this;return i;function i(l){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Ge(n,s,"linePrefix")}function s(l){if(l===null||Ee(l))return t(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(l):n.interrupt(r.parser.constructs.flow,t,e)(l)}}function Ej(n,e,t,r,i,s,l,o,u){const h=u||Number.POSITIVE_INFINITY;let f=0;return p;function p(S){return S===60?(n.enter(r),n.enter(i),n.enter(s),n.consume(S),n.exit(s),m):S===null||S===32||S===41||Md(S)?t(S):(n.enter(r),n.enter(l),n.enter(o),n.enter("chunkString",{contentType:"string"}),b(S))}function m(S){return S===62?(n.enter(s),n.consume(S),n.exit(s),n.exit(i),n.exit(r),e):(n.enter(o),n.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(n.exit("chunkString"),n.exit(o),m(S)):S===null||S===60||Ee(S)?t(S):(n.consume(S),S===92?k:y)}function k(S){return S===60||S===62||S===92?(n.consume(S),y):y(S)}function b(S){return!f&&(S===null||S===41||ft(S))?(n.exit("chunkString"),n.exit(o),n.exit(l),n.exit(r),e(S)):f<h&&S===40?(n.consume(S),f++,b):S===41?(n.consume(S),f--,b):S===null||S===32||S===40||Md(S)?t(S):(n.consume(S),S===92?w:b)}function w(S){return S===40||S===41||S===92?(n.consume(S),b):b(S)}}function Mj(n,e,t,r,i,s){const l=this;let o=0,u;return h;function h(y){return n.enter(r),n.enter(i),n.consume(y),n.exit(i),n.enter(s),f}function f(y){return o>999||y===null||y===91||y===93&&!u||y===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?t(y):y===93?(n.exit(s),n.enter(i),n.consume(y),n.exit(i),n.exit(r),e):Ee(y)?(n.enter("lineEnding"),n.consume(y),n.exit("lineEnding"),f):(n.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Ee(y)||o++>999?(n.exit("chunkString"),f(y)):(n.consume(y),u||(u=!We(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(n.consume(y),o++,p):p(y)}}function Aj(n,e,t,r,i,s){let l;return o;function o(m){return m===34||m===39||m===40?(n.enter(r),n.enter(i),n.consume(m),n.exit(i),l=m===40?41:m,u):t(m)}function u(m){return m===l?(n.enter(i),n.consume(m),n.exit(i),n.exit(r),e):(n.enter(s),h(m))}function h(m){return m===l?(n.exit(s),u(l)):m===null?t(m):Ee(m)?(n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),Ge(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===l||m===null||Ee(m)?(n.exit("chunkString"),h(m)):(n.consume(m),m===92?p:f)}function p(m){return m===l||m===92?(n.consume(m),f):f(m)}}function Bu(n,e){let t;return r;function r(i){return Ee(i)?(n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),t=!0,r):We(i)?Ge(n,r,t?"linePrefix":"lineSuffix")(i):e(i)}}const r7={name:"definition",tokenize:s7},i7={partial:!0,tokenize:l7};function s7(n,e,t){const r=this;let i;return s;function s(y){return n.enter("definition"),l(y)}function l(y){return Mj.call(r,n,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return i=zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(n.enter("definitionMarker"),n.consume(y),n.exit("definitionMarker"),u):t(y)}function u(y){return ft(y)?Bu(n,h)(y):h(y)}function h(y){return Ej(n,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function f(y){return n.attempt(i7,p,p)(y)}function p(y){return We(y)?Ge(n,m,"whitespace")(y):m(y)}function m(y){return y===null||Ee(y)?(n.exit("definition"),r.parser.defined.push(i),e(y)):t(y)}}function l7(n,e,t){return r;function r(o){return ft(o)?Bu(n,i)(o):t(o)}function i(o){return Aj(n,s,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return We(o)?Ge(n,l,"whitespace")(o):l(o)}function l(o){return o===null||Ee(o)?e(o):t(o)}}const o7={name:"hardBreakEscape",tokenize:a7};function a7(n,e,t){return r;function r(s){return n.enter("hardBreakEscape"),n.consume(s),i}function i(s){return Ee(s)?(n.exit("hardBreakEscape"),e(s)):t(s)}}const u7={name:"headingAtx",resolve:c7,tokenize:h7};function c7(n,e){let t=n.length-2,r=3,i,s;return n[r][1].type==="whitespace"&&(r+=2),t-2>r&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&n[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:n[r][1].start,end:n[t][1].end},s={type:"chunkText",start:n[r][1].start,end:n[t][1].end,contentType:"text"},ur(n,r,t-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),n}function h7(n,e,t){let r=0;return i;function i(f){return n.enter("atxHeading"),s(f)}function s(f){return n.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(n.consume(f),l):f===null||ft(f)?(n.exit("atxHeadingSequence"),o(f)):t(f)}function o(f){return f===35?(n.enter("atxHeadingSequence"),u(f)):f===null||Ee(f)?(n.exit("atxHeading"),e(f)):We(f)?Ge(n,o,"whitespace")(f):(n.enter("atxHeadingText"),h(f))}function u(f){return f===35?(n.consume(f),u):(n.exit("atxHeadingSequence"),o(f))}function h(f){return f===null||f===35||ft(f)?(n.exit("atxHeadingText"),o(f)):(n.consume(f),h)}}const f7=["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"],pP=["pre","script","style","textarea"],d7={concrete:!0,name:"htmlFlow",resolveTo:g7,tokenize:O7},p7={partial:!0,tokenize:x7},m7={partial:!0,tokenize:y7};function g7(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function O7(n,e,t){const r=this;let i,s,l,o,u;return h;function h(E){return f(E)}function f(E){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(E),p}function p(E){return E===33?(n.consume(E),m):E===47?(n.consume(E),s=!0,b):E===63?(n.consume(E),i=3,r.interrupt?e:C):Sn(E)?(n.consume(E),l=String.fromCharCode(E),w):t(E)}function m(E){return E===45?(n.consume(E),i=2,y):E===91?(n.consume(E),i=5,o=0,k):Sn(E)?(n.consume(E),i=4,r.interrupt?e:C):t(E)}function y(E){return E===45?(n.consume(E),r.interrupt?e:C):t(E)}function k(E){const ce="CDATA[";return E===ce.charCodeAt(o++)?(n.consume(E),o===ce.length?r.interrupt?e:F:k):t(E)}function b(E){return Sn(E)?(n.consume(E),l=String.fromCharCode(E),w):t(E)}function w(E){if(E===null||E===47||E===62||ft(E)){const ce=E===47,$e=l.toLowerCase();return!ce&&!s&&pP.includes($e)?(i=1,r.interrupt?e(E):F(E)):f7.includes(l.toLowerCase())?(i=6,ce?(n.consume(E),S):r.interrupt?e(E):F(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(E):s?Q(E):$(E))}return E===45||mn(E)?(n.consume(E),l+=String.fromCharCode(E),w):t(E)}function S(E){return E===62?(n.consume(E),r.interrupt?e:F):t(E)}function Q(E){return We(E)?(n.consume(E),Q):_(E)}function $(E){return E===47?(n.consume(E),_):E===58||E===95||Sn(E)?(n.consume(E),A):We(E)?(n.consume(E),$):_(E)}function A(E){return E===45||E===46||E===58||E===95||mn(E)?(n.consume(E),A):I(E)}function I(E){return E===61?(n.consume(E),T):We(E)?(n.consume(E),I):$(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?t(E):E===34||E===39?(n.consume(E),u=E,X):We(E)?(n.consume(E),T):z(E)}function X(E){return E===u?(n.consume(E),u=null,K):E===null||Ee(E)?t(E):(n.consume(E),X)}function z(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ft(E)?I(E):(n.consume(E),z)}function K(E){return E===47||E===62||We(E)?$(E):t(E)}function _(E){return E===62?(n.consume(E),G):t(E)}function G(E){return E===null||Ee(E)?F(E):We(E)?(n.consume(E),G):t(E)}function F(E){return E===45&&i===2?(n.consume(E),pe):E===60&&i===1?(n.consume(E),ye):E===62&&i===4?(n.consume(E),D):E===63&&i===3?(n.consume(E),C):E===93&&i===5?(n.consume(E),ie):Ee(E)&&(i===6||i===7)?(n.exit("htmlFlowData"),n.check(p7,q,le)(E)):E===null||Ee(E)?(n.exit("htmlFlowData"),le(E)):(n.consume(E),F)}function le(E){return n.check(m7,J,q)(E)}function J(E){return n.enter("lineEnding"),n.consume(E),n.exit("lineEnding"),Y}function Y(E){return E===null||Ee(E)?le(E):(n.enter("htmlFlowData"),F(E))}function pe(E){return E===45?(n.consume(E),C):F(E)}function ye(E){return E===47?(n.consume(E),l="",ee):F(E)}function ee(E){if(E===62){const ce=l.toLowerCase();return pP.includes(ce)?(n.consume(E),D):F(E)}return Sn(E)&&l.length<8?(n.consume(E),l+=String.fromCharCode(E),ee):F(E)}function ie(E){return E===93?(n.consume(E),C):F(E)}function C(E){return E===62?(n.consume(E),D):E===45&&i===2?(n.consume(E),C):F(E)}function D(E){return E===null||Ee(E)?(n.exit("htmlFlowData"),q(E)):(n.consume(E),D)}function q(E){return n.exit("htmlFlow"),e(E)}}function y7(n,e,t){const r=this;return i;function i(l){return Ee(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),s):t(l)}function s(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}function x7(n,e,t){return r;function r(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),n.attempt(Dc,e,t)}}const k7={name:"htmlText",tokenize:v7};function v7(n,e,t){const r=this;let i,s,l;return o;function o(C){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(C),u}function u(C){return C===33?(n.consume(C),h):C===47?(n.consume(C),I):C===63?(n.consume(C),$):Sn(C)?(n.consume(C),z):t(C)}function h(C){return C===45?(n.consume(C),f):C===91?(n.consume(C),s=0,k):Sn(C)?(n.consume(C),Q):t(C)}function f(C){return C===45?(n.consume(C),y):t(C)}function p(C){return C===null?t(C):C===45?(n.consume(C),m):Ee(C)?(l=p,ye(C)):(n.consume(C),p)}function m(C){return C===45?(n.consume(C),y):p(C)}function y(C){return C===62?pe(C):C===45?m(C):p(C)}function k(C){const D="CDATA[";return C===D.charCodeAt(s++)?(n.consume(C),s===D.length?b:k):t(C)}function b(C){return C===null?t(C):C===93?(n.consume(C),w):Ee(C)?(l=b,ye(C)):(n.consume(C),b)}function w(C){return C===93?(n.consume(C),S):b(C)}function S(C){return C===62?pe(C):C===93?(n.consume(C),S):b(C)}function Q(C){return C===null||C===62?pe(C):Ee(C)?(l=Q,ye(C)):(n.consume(C),Q)}function $(C){return C===null?t(C):C===63?(n.consume(C),A):Ee(C)?(l=$,ye(C)):(n.consume(C),$)}function A(C){return C===62?pe(C):$(C)}function I(C){return Sn(C)?(n.consume(C),T):t(C)}function T(C){return C===45||mn(C)?(n.consume(C),T):X(C)}function X(C){return Ee(C)?(l=X,ye(C)):We(C)?(n.consume(C),X):pe(C)}function z(C){return C===45||mn(C)?(n.consume(C),z):C===47||C===62||ft(C)?K(C):t(C)}function K(C){return C===47?(n.consume(C),pe):C===58||C===95||Sn(C)?(n.consume(C),_):Ee(C)?(l=K,ye(C)):We(C)?(n.consume(C),K):pe(C)}function _(C){return C===45||C===46||C===58||C===95||mn(C)?(n.consume(C),_):G(C)}function G(C){return C===61?(n.consume(C),F):Ee(C)?(l=G,ye(C)):We(C)?(n.consume(C),G):K(C)}function F(C){return C===null||C===60||C===61||C===62||C===96?t(C):C===34||C===39?(n.consume(C),i=C,le):Ee(C)?(l=F,ye(C)):We(C)?(n.consume(C),F):(n.consume(C),J)}function le(C){return C===i?(n.consume(C),i=void 0,Y):C===null?t(C):Ee(C)?(l=le,ye(C)):(n.consume(C),le)}function J(C){return C===null||C===34||C===39||C===60||C===61||C===96?t(C):C===47||C===62||ft(C)?K(C):(n.consume(C),J)}function Y(C){return C===47||C===62||ft(C)?K(C):t(C)}function pe(C){return C===62?(n.consume(C),n.exit("htmlTextData"),n.exit("htmlText"),e):t(C)}function ye(C){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),ee}function ee(C){return We(C)?Ge(n,ie,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ie(C)}function ie(C){return n.enter("htmlTextData"),l(C)}}const _0={name:"labelEnd",resolveAll:P7,resolveTo:C7,tokenize:Q7},b7={tokenize:$7},w7={tokenize:T7},S7={tokenize:j7};function P7(n){let e=-1;const t=[];for(;++e<n.length;){const r=n[e][1];if(t.push(n[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return n.length!==t.length&&ur(n,0,n.length,t),n}function C7(n,e){let t=n.length,r=0,i,s,l,o;for(;t--;)if(i=n[t][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;n[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(n[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const u={type:n[s][1].type==="labelLink"?"link":"image",start:{...n[s][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[s][1].start},end:{...n[l][1].end}},f={type:"labelText",start:{...n[s+r+2][1].end},end:{...n[l-2][1].start}};return o=[["enter",u,e],["enter",h,e]],o=vr(o,n.slice(s+1,s+r+3)),o=vr(o,[["enter",f,e]]),o=vr(o,up(e.parser.constructs.insideSpan.null,n.slice(s+r+4,l-3),e)),o=vr(o,[["exit",f,e],n[l-2],n[l-1],["exit",h,e]]),o=vr(o,n.slice(l+1)),o=vr(o,[["exit",u,e]]),ur(n,s,n.length,o),n}function Q7(n,e,t){const r=this;let i=r.events.length,s,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(m){return s?s._inactive?p(m):(l=r.parser.defined.includes(zr(r.sliceSerialize({start:s.end,end:r.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),n.exit("labelEnd"),u):t(m)}function u(m){return m===40?n.attempt(b7,f,l?f:p)(m):m===91?n.attempt(w7,f,l?h:p)(m):l?f(m):p(m)}function h(m){return n.attempt(S7,f,p)(m)}function f(m){return e(m)}function p(m){return s._balanced=!0,t(m)}}function $7(n,e,t){return r;function r(p){return n.enter("resource"),n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),i}function i(p){return ft(p)?Bu(n,s)(p):s(p)}function s(p){return p===41?f(p):Ej(n,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return ft(p)?Bu(n,u)(p):f(p)}function o(p){return t(p)}function u(p){return p===34||p===39||p===40?Aj(n,h,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):f(p)}function h(p){return ft(p)?Bu(n,f)(p):f(p)}function f(p){return p===41?(n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),n.exit("resource"),e):t(p)}}function T7(n,e,t){const r=this;return i;function i(o){return Mj.call(r,n,s,l,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):t(o)}function l(o){return t(o)}}function j7(n,e,t){return r;function r(s){return n.enter("reference"),n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),i}function i(s){return s===93?(n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),n.exit("reference"),e):t(s)}}const E7={name:"labelStartImage",resolveAll:_0.resolveAll,tokenize:M7};function M7(n,e,t){const r=this;return i;function i(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),s}function s(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),l):t(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):e(o)}}const A7={name:"labelStartLink",resolveAll:_0.resolveAll,tokenize:R7};function R7(n,e,t){const r=this;return i;function i(l){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):e(l)}}const oO={name:"lineEnding",tokenize:N7};function N7(n,e){return t;function t(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),Ge(n,e,"linePrefix")}}const qf={name:"thematicBreak",tokenize:L7};function L7(n,e,t){let r=0,i;return s;function s(h){return n.enter("thematicBreak"),l(h)}function l(h){return i=h,o(h)}function o(h){return h===i?(n.enter("thematicBreakSequence"),u(h)):r>=3&&(h===null||Ee(h))?(n.exit("thematicBreak"),e(h)):t(h)}function u(h){return h===i?(n.consume(h),r++,u):(n.exit("thematicBreakSequence"),We(h)?Ge(n,o,"whitespace")(h):o(h))}}const Nn={continuation:{tokenize:z7},exit:X7,name:"list",tokenize:I7},_7={partial:!0,tokenize:B7},D7={partial:!0,tokenize:Z7};function I7(n,e,t){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return o;function o(y){const k=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:nx(y)){if(r.containerState.type||(r.containerState.type=k,n.enter(k,{_container:!0})),k==="listUnordered")return n.enter("listItemPrefix"),y===42||y===45?n.check(qf,t,h)(y):h(y);if(!r.interrupt||y===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),u(y)}return t(y)}function u(y){return nx(y)&&++l<10?(n.consume(y),u):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(n.exit("listItemValue"),h(y)):t(y)}function h(y){return n.enter("listItemMarker"),n.consume(y),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,n.check(Dc,r.interrupt?t:f,n.attempt(_7,m,p))}function f(y){return r.containerState.initialBlankLine=!0,s++,m(y)}function p(y){return We(y)?(n.enter("listItemPrefixWhitespace"),n.consume(y),n.exit("listItemPrefixWhitespace"),m):t(y)}function m(y){return r.containerState.size=s+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(y)}}function z7(n,e,t){const r=this;return r.containerState._closeFlow=void 0,n.check(Dc,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ge(n,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!We(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(D7,e,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ge(n,n.attempt(Nn,e,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Z7(n,e,t){const r=this;return Ge(n,i,"listItemIndent",r.containerState.size+1);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(s):t(s)}}function X7(n){n.exit(this.containerState.type)}function B7(n,e,t){const r=this;return Ge(n,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const l=r.events[r.events.length-1];return!We(s)&&l&&l[1].type==="listItemPrefixWhitespace"?e(s):t(s)}}const mP={name:"setextUnderline",resolveTo:W7,tokenize:q7};function W7(n,e){let t=n.length,r,i,s;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){r=t;break}n[t][1].type==="paragraph"&&(i=t)}else n[t][1].type==="content"&&n.splice(t,1),!s&&n[t][1].type==="definition"&&(s=t);const l={type:"setextHeading",start:{...n[r][1].start},end:{...n[n.length-1][1].end}};return n[i][1].type="setextHeadingText",s?(n.splice(i,0,["enter",l,e]),n.splice(s+1,0,["exit",n[r][1],e]),n[r][1].end={...n[s][1].end}):n[r][1]=l,n.push(["exit",l,e]),n}function q7(n,e,t){const r=this;let i;return s;function s(h){let f=r.events.length,p;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){p=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(n.enter("setextHeadingLine"),i=h,l(h)):t(h)}function l(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===i?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),We(h)?Ge(n,u,"lineSuffix")(h):u(h))}function u(h){return h===null||Ee(h)?(n.exit("setextHeadingLine"),e(h)):t(h)}}const V7={tokenize:F7};function F7(n){const e=this,t=n.attempt(Dc,r,n.attempt(this.parser.constructs.flowInitial,i,Ge(n,n.attempt(this.parser.constructs.flow,i,n.attempt(KW,i)),"linePrefix")));return t;function r(s){if(s===null){n.consume(s);return}return n.enter("lineEndingBlank"),n.consume(s),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(s){if(s===null){n.consume(s);return}return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const Y7={resolveAll:Nj()},U7=Rj("string"),G7=Rj("text");function Rj(n){return{resolveAll:Nj(n==="text"?H7:void 0),tokenize:e};function e(t){const r=this,i=this.parser.constructs[n],s=t.attempt(i,l,o);return l;function l(f){return h(f)?s(f):o(f)}function o(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return h(f)?(t.exit("data"),s(f)):(t.consume(f),u)}function h(f){if(f===null)return!0;const p=i[f];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Nj(n){return e;function e(t,r){let i=-1,s;for(;++i<=t.length;)s===void 0?t[i]&&t[i][1].type==="data"&&(s=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==s+2&&(t[s][1].end=t[i-1][1].end,t.splice(s+2,i-s-2),i=s+2),s=void 0);return n?n(t,r):t}}function H7(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const r=n[t-1][1],i=e.sliceStream(r);let s=i.length,l=-1,o=0,u;for(;s--;){const h=i[s];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(h===-2)u=!0,o++;else if(h!==-1){s++;break}}if(e._contentTypeTextTrailing&&t===n.length&&(o=0),o){const h={type:t===n.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:r.start._bufferIndex+l,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(n.splice(t,0,["enter",h,e],["exit",h,e]),t+=2)}t++}return n}const K7={42:Nn,43:Nn,45:Nn,48:Nn,49:Nn,50:Nn,51:Nn,52:Nn,53:Nn,54:Nn,55:Nn,56:Nn,57:Nn,62:Qj},J7={91:r7},e9={[-2]:lO,[-1]:lO,32:lO},t9={35:u7,42:qf,45:[mP,qf],60:d7,61:mP,95:qf,96:dP,126:dP},n9={38:Tj,92:$j},r9={[-5]:oO,[-4]:oO,[-3]:oO,33:E7,38:Tj,42:rx,60:[AW,k7],91:A7,92:[o7,$j],93:_0,95:rx,96:VW},i9={null:[rx,Y7]},s9={null:[42,95]},l9={null:[]},o9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:s9,contentInitial:J7,disable:l9,document:K7,flow:t9,flowInitial:e9,insideSpan:i9,string:n9,text:r9},Symbol.toStringTag,{value:"Module"}));function a9(n,e,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},s=[];let l=[],o=[];const u={attempt:X(I),check:X(T),consume:Q,enter:$,exit:A,interrupt:X(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:b,events:[],now:k,parser:n,previous:null,sliceSerialize:m,sliceStream:y,write:p};let f=e.tokenize.call(h,u);return e.resolveAll&&s.push(e),h;function p(G){return l=vr(l,G),w(),l[l.length-1]!==null?[]:(z(e,0),h.events=up(s,h.events,h),h.events)}function m(G,F){return c9(y(G),F)}function y(G){return u9(l,G)}function k(){const{_bufferIndex:G,_index:F,line:le,column:J,offset:Y}=r;return{_bufferIndex:G,_index:F,line:le,column:J,offset:Y}}function b(G){i[G.line]=G.column,_()}function w(){let G;for(;r._index<l.length;){const F=l[r._index];if(typeof F=="string")for(G=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<F.length;)S(F.charCodeAt(r._bufferIndex));else S(F)}}function S(G){f=f(G)}function Q(G){Ee(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,_()):G!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=G}function $(G,F){const le=F||{};return le.type=G,le.start=k(),h.events.push(["enter",le,h]),o.push(le),le}function A(G){const F=o.pop();return F.end=k(),h.events.push(["exit",F,h]),F}function I(G,F){z(G,F.from)}function T(G,F){F.restore()}function X(G,F){return le;function le(J,Y,pe){let ye,ee,ie,C;return Array.isArray(J)?q(J):"tokenize"in J?q([J]):D(J);function D(we){return Ie;function Ie(_e){const De=_e!==null&&we[_e],at=_e!==null&&we.null,Fn=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(at)?at:at?[at]:[]];return q(Fn)(_e)}}function q(we){return ye=we,ee=0,we.length===0?pe:E(we[ee])}function E(we){return Ie;function Ie(_e){return C=K(),ie=we,we.partial||(h.currentConstruct=we),we.name&&h.parser.constructs.disable.null.includes(we.name)?$e():we.tokenize.call(F?Object.assign(Object.create(h),F):h,u,ce,$e)(_e)}}function ce(we){return G(ie,C),Y}function $e(we){return C.restore(),++ee<ye.length?E(ye[ee]):pe}}}function z(G,F){G.resolveAll&&!s.includes(G)&&s.push(G),G.resolve&&ur(h.events,F,h.events.length-F,G.resolve(h.events.slice(F),h)),G.resolveTo&&(h.events=G.resolveTo(h.events,h))}function K(){const G=k(),F=h.previous,le=h.currentConstruct,J=h.events.length,Y=Array.from(o);return{from:J,restore:pe};function pe(){r=G,h.previous=F,h.currentConstruct=le,h.events.length=J,o=Y,_()}}function _(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function u9(n,e){const t=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let l;if(t===i)l=[n[t].slice(r,s)];else{if(l=n.slice(t,i),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}s>0&&l.push(n[i].slice(0,s))}return l}function c9(n,e){let t=-1;const r=[];let i;for(;++t<n.length;){const s=n[t];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
436
+ `,h="/",f="*",p="",m="comment",y="declaration";function k(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var Q=1,$=1;function A(J){var Y=J.match(e);Y&&(Q+=Y.length);var pe=J.lastIndexOf(u);$=~pe?J.length-pe:$+J.length}function I(){var J={line:Q,column:$};return function(Y){return Y.position=new T(J),K(),Y}}function T(J){this.start=J,this.end={line:Q,column:$},this.source=S.source}T.prototype.content=w;function X(J){var Y=new Error(S.source+":"+Q+":"+$+": "+J);if(Y.reason=J,Y.filename=S.source,Y.line=Q,Y.column=$,Y.source=w,!S.silent)throw Y}function z(J){var Y=J.exec(w);if(Y){var pe=Y[0];return A(pe),w=w.slice(pe.length),Y}}function K(){z(t)}function _(J){var Y;for(J=J||[];Y=G();)Y!==!1&&J.push(Y);return J}function G(){var J=I();if(!(h!=w.charAt(0)||f!=w.charAt(1))){for(var Y=2;p!=w.charAt(Y)&&(f!=w.charAt(Y)||h!=w.charAt(Y+1));)++Y;if(Y+=2,p===w.charAt(Y-1))return X("End of comment missing");var pe=w.slice(2,Y-2);return $+=2,A(pe),w=w.slice(Y),$+=2,J({type:m,comment:pe})}}function F(){var J=I(),Y=z(r);if(Y){if(G(),!z(i))return X("property missing ':'");var pe=z(s),ye=J({type:y,property:b(Y[0].replace(n,p)),value:pe?b(pe[0].replace(n,p)):p});return z(l),ye}}function le(){var J=[];_(J);for(var Y;Y=F();)Y!==!1&&(J.push(Y),_(J));return J}return K(),le()}function b(w){return w?w.replace(o,p):p}return iO=k,iO}var nP;function F6(){if(nP)return xo;nP=1;var n=xo&&xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xo,"__esModule",{value:!0}),xo.default=t;const e=n(V6());function t(r,i){let s=null;if(!r||typeof r!="string")return s;const l=(0,e.default)(r),o=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:f}=u;o?i(h,f,u):f&&(s=s||{},s[h]=f)}),s}return xo}var vu={},rP;function Y6(){if(rP)return vu;rP=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(h){return!h||t.test(h)||n.test(h)},l=function(h,f){return f.toUpperCase()},o=function(h,f){return"".concat(f,"-")},u=function(h,f){return f===void 0&&(f={}),s(h)?h:(h=h.toLowerCase(),f.reactCompat?h=h.replace(i,o):h=h.replace(r,o),h.replace(e,l))};return vu.camelCase=u,vu}var bu,iP;function U6(){if(iP)return bu;iP=1;var n=bu&&bu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=n(F6()),t=Y6();function r(i,s){var l={};return!i||typeof i!="string"||(0,e.default)(i,function(o,u){o&&u&&(l[(0,t.camelCase)(o,s)]=u)}),l}return r.default=r,bu=r,bu}var G6=U6();const H6=zd(G6),yj=xj("end"),E0=xj("start");function xj(n){return e;function e(t){const r=t&&t.position&&t.position[n]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function K6(n){const e=E0(n),t=yj(n);if(e&&t)return{start:e,end:t}}function Xu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?sP(n.position):"start"in n||"end"in n?sP(n):"line"in n||"column"in n?tx(n):""}function tx(n){return lP(n&&n.line)+":"+lP(n&&n.column)}function sP(n){return tx(n&&n.start)+"-"+tx(n&&n.end)}function lP(n){return n&&typeof n=="number"?n:1}class yn extends Error{constructor(e,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",s={},l=!1;if(t&&("line"in t&&"column"in t?s={place:t}:"start"in t&&"end"in t?s={place:t}:"type"in t?s={ancestors:[t],place:t.position}:s={...t}),typeof e=="string"?i=e:!s.cause&&e&&(l=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Xu(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}yn.prototype.file="";yn.prototype.name="";yn.prototype.reason="";yn.prototype.message="";yn.prototype.stack="";yn.prototype.column=void 0;yn.prototype.line=void 0;yn.prototype.ancestors=void 0;yn.prototype.cause=void 0;yn.prototype.fatal=void 0;yn.prototype.place=void 0;yn.prototype.ruleId=void 0;yn.prototype.source=void 0;const M0={}.hasOwnProperty,J6=new Map,e7=/[A-Z]/g,t7=new Set(["table","tbody","thead","tfoot","tr"]),n7=new Set(["td","th"]),kj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function r7(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=h7(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=c7(t,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?j0:W6,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=vj(i,n,void 0);return s&&typeof s!="string"?s:i.create(n,i.Fragment,{children:s||void 0},void 0)}function vj(n,e,t){if(e.type==="element")return i7(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return s7(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return o7(n,e,t);if(e.type==="mdxjsEsm")return l7(n,e);if(e.type==="root")return a7(n,e,t);if(e.type==="text")return u7(n,e)}function i7(n,e,t){const r=n.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=j0,n.schema=i),n.ancestors.push(e);const s=wj(n,e.tagName,!1),l=f7(n,e);let o=R0(n,e);return t7.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!R6(u):!0})),bj(n,l,s,e),A0(l,o),n.ancestors.pop(),n.schema=r,n.create(e,s,l,t)}function s7(n,e){if(e.data&&e.data.estree&&n.evaluater){const r=e.data.estree.body[0];return r.type,n.evaluater.evaluateExpression(r.expression)}yc(n,e.position)}function l7(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);yc(n,e.position)}function o7(n,e,t){const r=n.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=j0,n.schema=i),n.ancestors.push(e);const s=e.name===null?n.Fragment:wj(n,e.name,!0),l=d7(n,e),o=R0(n,e);return bj(n,l,s,e),A0(l,o),n.ancestors.pop(),n.schema=r,n.create(e,s,l,t)}function a7(n,e,t){const r={};return A0(r,R0(n,e)),n.create(e,n.Fragment,r,t)}function u7(n,e){return e.value}function bj(n,e,t,r){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=r)}function A0(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function c7(n,e,t){return r;function r(i,s,l,o){const h=Array.isArray(l.children)?t:e;return o?h(s,l,o):h(s,l)}}function h7(n,e){return t;function t(r,i,s,l){const o=Array.isArray(s.children),u=E0(r);return e(i,s,l,o,{columnNumber:u?u.column-1:void 0,fileName:n,lineNumber:u?u.line:void 0},void 0)}}function f7(n,e){const t={};let r,i;for(i in e.properties)if(i!=="children"&&M0.call(e.properties,i)){const s=p7(n,i,e.properties[i]);if(s){const[l,o]=s;n.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&n7.has(e.tagName)?r=o:t[l]=o}}if(r){const s=t.style||(t.style={});s[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function d7(n,e){const t={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&n.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,n.evaluater.evaluateExpression(o.argument))}else yc(n,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&n.evaluater){const o=r.value.data.estree.body[0];o.type,s=n.evaluater.evaluateExpression(o.expression)}else yc(n,e.position);else s=r.value===null?!0:r.value;t[i]=s}return t}function R0(n,e){const t=[];let r=-1;const i=n.passKeys?new Map:J6;for(;++r<e.children.length;){const s=e.children[r];let l;if(n.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const h=i.get(u)||0;l=u+"-"+h,i.set(u,h+1)}}const o=vj(n,s,l);o!==void 0&&t.push(o)}return t}function p7(n,e,t){const r=Z6(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?T6(t):q6(t)),r.property==="style"){let i=typeof t=="object"?t:m7(n,String(t));return n.stylePropertyNameCase==="css"&&(i=g7(i)),["style",i]}return[n.elementAttributeNameCase==="react"&&r.space?D6[r.property]||r.property:r.attribute,t]}}function m7(n,e){try{return H6(e,{reactCompat:!0})}catch(t){if(n.ignoreInvalidStyle)return{};const r=t,i=new yn("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=n.filePath||void 0,i.url=kj+"#cannot-parse-style-attribute",i}}function wj(n,e,t){let r;if(!t)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,l;for(;++s<i.length;){const o=HS(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=l}else r=HS(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return M0.call(n.components,i)?n.components[i]:i}if(n.evaluater)return n.evaluater.evaluateExpression(r);yc(n)}function yc(n,e){const t=new yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=n.filePath||void 0,t.url=kj+"#cannot-handle-mdx-estrees-without-createevaluater",t}function g7(n){const e={};let t;for(t in n)M0.call(n,t)&&(e[O7(t)]=n[t]);return e}function O7(n){let e=n.replace(e7,y7);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function y7(n){return"-"+n.toLowerCase()}const sO={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"]},x7={};function N0(n,e){const t=x7,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Sj(n,r,i)}function Sj(n,e,t){if(k7(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return oP(n.children,e,t)}return Array.isArray(n)?oP(n,e,t):""}function oP(n,e,t){const r=[];let i=-1;for(;++i<n.length;)r[i]=Sj(n[i],e,t);return r.join("")}function k7(n){return!!(n&&typeof n=="object")}const aP=document.createElement("i");function L0(n){const e="&"+n+";";aP.innerHTML=e;const t=aP.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function ur(n,e,t,r){const i=n.length;let s=0,l;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(e,t),n.splice(...l);else for(t&&n.splice(e,t);s<r.length;)l=r.slice(s,s+1e4),l.unshift(e,0),n.splice(...l),s+=1e4,e+=1e4}function vr(n,e){return n.length>0?(ur(n,n.length,0,e),n):e}const uP={}.hasOwnProperty;function Pj(n){const e={};let t=-1;for(;++t<n.length;)v7(e,n[t]);return e}function v7(n,e){let t;for(t in e){const i=(uP.call(n,t)?n[t]:void 0)||(n[t]={}),s=e[t];let l;if(s)for(l in s){uP.call(i,l)||(i[l]=[]);const o=s[l];b7(i[l],Array.isArray(o)?o:o?[o]:[])}}}function b7(n,e){let t=-1;const r=[];for(;++t<e.length;)(e[t].add==="after"?n:r).push(e[t]);ur(n,0,0,r)}function Cj(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function zr(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=Ys(/[A-Za-z]/),mn=Ys(/[\dA-Za-z]/),w7=Ys(/[#-'*+\--9=?A-Z^-~]/);function Md(n){return n!==null&&(n<32||n===127)}const nx=Ys(/\d/),S7=Ys(/[\dA-Fa-f]/),P7=Ys(/[!-/:-@[-`{-~]/);function Ee(n){return n!==null&&n<-2}function ft(n){return n!==null&&(n<0||n===32)}function We(n){return n===-2||n===-1||n===32}const ap=Ys(new RegExp("\\p{P}|\\p{S}","u")),zl=Ys(/\s/);function Ys(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function Ca(n){const e=[];let t=-1,r=0,i=0;for(;++t<n.length;){const s=n.charCodeAt(t);let l="";if(s===37&&mn(n.charCodeAt(t+1))&&mn(n.charCodeAt(t+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const o=n.charCodeAt(t+1);s<56320&&o>56319&&o<57344?(l=String.fromCharCode(s,o),i=1):l="�"}else l=String.fromCharCode(s);l&&(e.push(n.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return e.join("")+n.slice(r)}function Ge(n,e,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(u){return We(u)?(n.enter(t),o(u)):e(u)}function o(u){return We(u)&&s++<i?(n.consume(u),o):(n.exit(t),e(u))}}const C7={tokenize:Q7};function Q7(n){const e=n.attempt(this.parser.constructs.contentInitial,r,i);let t;return e;function r(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Ge(n,e,"linePrefix")}function i(o){return n.enter("paragraph"),s(o)}function s(o){const u=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(o)}function l(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return Ee(o)?(n.consume(o),n.exit("chunkText"),s):(n.consume(o),l)}}const $7={tokenize:T7},cP={tokenize:j7};function T7(n){const e=this,t=[];let r=0,i,s,l;return o;function o($){if(r<t.length){const A=t[r];return e.containerState=A[1],n.attempt(A[0].continuation,u,h)($)}return h($)}function u($){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&Q();const A=e.events.length;let I=A,T;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){T=e.events[I][1].end;break}S(r);let X=A;for(;X<e.events.length;)e.events[X][1].end={...T},X++;return ur(e.events,I+1,0,e.events.slice(A)),e.events.length=X,h($)}return o($)}function h($){if(r===t.length){if(!i)return m($);if(i.currentConstruct&&i.currentConstruct.concrete)return k($);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(cP,f,p)($)}function f($){return i&&Q(),S(r),m($)}function p($){return e.parser.lazy[e.now().line]=r!==t.length,l=e.now().offset,k($)}function m($){return e.containerState={},n.attempt(cP,y,k)($)}function y($){return r++,t.push([e.currentConstruct,e.containerState]),m($)}function k($){if($===null){i&&Q(),S(0),n.consume($);return}return i=i||e.parser.flow(e.now()),n.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b($)}function b($){if($===null){w(n.exit("chunkFlow"),!0),S(0),n.consume($);return}return Ee($)?(n.consume($),w(n.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(n.consume($),b)}function w($,A){const I=e.sliceStream($);if(A&&I.push(null),$.previous=s,s&&(s.next=$),s=$,i.defineSkip($.start),i.write(I),e.parser.lazy[$.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<l&&(!i.events[T][1].end||i.events[T][1].end.offset>l))return;const X=e.events.length;let z=X,K,_;for(;z--;)if(e.events[z][0]==="exit"&&e.events[z][1].type==="chunkFlow"){if(K){_=e.events[z][1].end;break}K=!0}for(S(r),T=X;T<e.events.length;)e.events[T][1].end={..._},T++;ur(e.events,z+1,0,e.events.slice(X)),e.events.length=T}}function S($){let A=t.length;for(;A-- >$;){const I=t[A];e.containerState=I[1],I[0].exit.call(e,n)}t.length=$}function Q(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function j7(n,e,t){return Ge(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ca(n){if(n===null||ft(n)||zl(n))return 1;if(ap(n))return 2}function up(n,e,t){const r=[];let i=-1;for(;++i<n.length;){const s=n[i].resolveAll;s&&!r.includes(s)&&(e=s(e,t),r.push(s))}return e}const rx={name:"attention",resolveAll:E7,tokenize:M7};function E7(n,e){let t=-1,r,i,s,l,o,u,h,f;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(r=t;r--;)if(n[r][0]==="exit"&&n[r][1].type==="attentionSequence"&&n[r][1]._open&&e.sliceSerialize(n[r][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[r][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[r][1].end.offset-n[r][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;u=n[r][1].end.offset-n[r][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const p={...n[r][1].end},m={...n[t][1].start};hP(p,-u),hP(m,u),l={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...n[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...n[t][1].start},end:m},s={type:u>1?"strongText":"emphasisText",start:{...n[r][1].end},end:{...n[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},n[r][1].end={...l.start},n[t][1].start={...o.end},h=[],n[r][1].end.offset-n[r][1].start.offset&&(h=vr(h,[["enter",n[r][1],e],["exit",n[r][1],e]])),h=vr(h,[["enter",i,e],["enter",l,e],["exit",l,e],["enter",s,e]]),h=vr(h,up(e.parser.constructs.insideSpan.null,n.slice(r+1,t),e)),h=vr(h,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),n[t][1].end.offset-n[t][1].start.offset?(f=2,h=vr(h,[["enter",n[t][1],e],["exit",n[t][1],e]])):f=0,ur(n,r-1,t-r+3,h),t=r+h.length-f-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function M7(n,e){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ca(r);let s;return l;function l(u){return s=u,n.enter("attentionSequence"),o(u)}function o(u){if(u===s)return n.consume(u),o;const h=n.exit("attentionSequence"),f=ca(u),p=!f||f===2&&i||t.includes(u),m=!i||i===2&&f||t.includes(r);return h._open=!!(s===42?p:p&&(i||!m)),h._close=!!(s===42?m:m&&(f||!p)),e(u)}}function hP(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const A7={name:"autolink",tokenize:R7};function R7(n,e,t){let r=0;return i;function i(y){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(y),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),s}function s(y){return Sn(y)?(n.consume(y),l):y===64?t(y):h(y)}function l(y){return y===43||y===45||y===46||mn(y)?(r=1,o(y)):h(y)}function o(y){return y===58?(n.consume(y),r=0,u):(y===43||y===45||y===46||mn(y))&&r++<32?(n.consume(y),o):(r=0,h(y))}function u(y){return y===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(y),n.exit("autolinkMarker"),n.exit("autolink"),e):y===null||y===32||y===60||Md(y)?t(y):(n.consume(y),u)}function h(y){return y===64?(n.consume(y),f):w7(y)?(n.consume(y),h):t(y)}function f(y){return mn(y)?p(y):t(y)}function p(y){return y===46?(n.consume(y),r=0,f):y===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(y),n.exit("autolinkMarker"),n.exit("autolink"),e):m(y)}function m(y){if((y===45||mn(y))&&r++<63){const k=y===45?m:p;return n.consume(y),k}return t(y)}}const Dc={partial:!0,tokenize:N7};function N7(n,e,t){return r;function r(s){return We(s)?Ge(n,i,"linePrefix")(s):i(s)}function i(s){return s===null||Ee(s)?e(s):t(s)}}const Qj={continuation:{tokenize:_7},exit:D7,name:"blockQuote",tokenize:L7};function L7(n,e,t){const r=this;return i;function i(l){if(l===62){const o=r.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(l),n.exit("blockQuoteMarker"),s}return t(l)}function s(l){return We(l)?(n.enter("blockQuotePrefixWhitespace"),n.consume(l),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(l))}}function _7(n,e,t){const r=this;return i;function i(l){return We(l)?Ge(n,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return n.attempt(Qj,e,t)(l)}}function D7(n){n.exit("blockQuote")}const $j={name:"characterEscape",tokenize:I7};function I7(n,e,t){return r;function r(s){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(s),n.exit("escapeMarker"),i}function i(s){return P7(s)?(n.enter("characterEscapeValue"),n.consume(s),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(s)}}const Tj={name:"characterReference",tokenize:z7};function z7(n,e,t){const r=this;let i=0,s,l;return o;function o(p){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),u}function u(p){return p===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(p),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),s=31,l=mn,f(p))}function h(p){return p===88||p===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(p),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),s=6,l=S7,f):(n.enter("characterReferenceValue"),s=7,l=nx,f(p))}function f(p){if(p===59&&i){const m=n.exit("characterReferenceValue");return l===mn&&!L0(r.sliceSerialize(m))?t(p):(n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return l(p)&&i++<s?(n.consume(p),f):t(p)}}const fP={partial:!0,tokenize:X7},dP={concrete:!0,name:"codeFenced",tokenize:Z7};function Z7(n,e,t){const r=this,i={partial:!0,tokenize:I};let s=0,l=0,o;return u;function u(T){return h(T)}function h(T){const X=r.events[r.events.length-1];return s=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,o=T,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),f(T)}function f(T){return T===o?(l++,n.consume(T),f):l<3?t(T):(n.exit("codeFencedFenceSequence"),We(T)?Ge(n,p,"whitespace")(T):p(T))}function p(T){return T===null||Ee(T)?(n.exit("codeFencedFence"),r.interrupt?e(T):n.check(fP,b,A)(T)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||Ee(T)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),p(T)):We(T)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Ge(n,y,"whitespace")(T)):T===96&&T===o?t(T):(n.consume(T),m)}function y(T){return T===null||Ee(T)?p(T):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),k(T))}function k(T){return T===null||Ee(T)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),p(T)):T===96&&T===o?t(T):(n.consume(T),k)}function b(T){return n.attempt(i,A,w)(T)}function w(T){return n.enter("lineEnding"),n.consume(T),n.exit("lineEnding"),S}function S(T){return s>0&&We(T)?Ge(n,Q,"linePrefix",s+1)(T):Q(T)}function Q(T){return T===null||Ee(T)?n.check(fP,b,A)(T):(n.enter("codeFlowValue"),$(T))}function $(T){return T===null||Ee(T)?(n.exit("codeFlowValue"),Q(T)):(n.consume(T),$)}function A(T){return n.exit("codeFenced"),e(T)}function I(T,X,z){let K=0;return _;function _(Y){return T.enter("lineEnding"),T.consume(Y),T.exit("lineEnding"),G}function G(Y){return T.enter("codeFencedFence"),We(Y)?Ge(T,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):F(Y)}function F(Y){return Y===o?(T.enter("codeFencedFenceSequence"),le(Y)):z(Y)}function le(Y){return Y===o?(K++,T.consume(Y),le):K>=l?(T.exit("codeFencedFenceSequence"),We(Y)?Ge(T,J,"whitespace")(Y):J(Y)):z(Y)}function J(Y){return Y===null||Ee(Y)?(T.exit("codeFencedFence"),X(Y)):z(Y)}}}function X7(n,e,t){const r=this;return i;function i(l){return l===null?t(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}const lO={name:"codeIndented",tokenize:W7},B7={partial:!0,tokenize:q7};function W7(n,e,t){const r=this;return i;function i(h){return n.enter("codeIndented"),Ge(n,s,"linePrefix",5)(h)}function s(h){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(h):t(h)}function l(h){return h===null?u(h):Ee(h)?n.attempt(B7,l,u)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||Ee(h)?(n.exit("codeFlowValue"),l(h)):(n.consume(h),o)}function u(h){return n.exit("codeIndented"),e(h)}}function q7(n,e,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):Ee(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i):Ge(n,s,"linePrefix",5)(l)}function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(l):Ee(l)?i(l):t(l)}}const V7={name:"codeText",previous:Y7,resolve:F7,tokenize:U7};function F7(n){let e=n.length-4,t=3,r,i;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r<e;)if(n[r][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(r=t-1,e++;++r<=e;)i===void 0?r!==e&&n[r][1].type!=="lineEnding"&&(i=r):(r===e||n[r][1].type==="lineEnding")&&(n[i][1].type="codeTextData",r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return n}function Y7(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function U7(n,e,t){let r=0,i,s;return l;function l(p){return n.enter("codeText"),n.enter("codeTextSequence"),o(p)}function o(p){return p===96?(n.consume(p),r++,o):(n.exit("codeTextSequence"),u(p))}function u(p){return p===null?t(p):p===32?(n.enter("space"),n.consume(p),n.exit("space"),u):p===96?(s=n.enter("codeTextSequence"),i=0,f(p)):Ee(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),u):(n.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Ee(p)?(n.exit("codeTextData"),u(p)):(n.consume(p),h)}function f(p){return p===96?(n.consume(p),i++,f):i===r?(n.exit("codeTextSequence"),n.exit("codeText"),e(p)):(s.type="codeTextData",h(p))}}class G7{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){const i=t||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&wu(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),wu(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wu(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){const t=this.left.splice(e,Number.POSITIVE_INFINITY);wu(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);wu(this.left,t.reverse())}}}function wu(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function jj(n){const e={};let t=-1,r,i,s,l,o,u,h;const f=new G7(n);for(;++t<f.length;){for(;t in e;)t=e[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,H7(f,t)),t=e[t],h=!0);else if(r[1]._container){for(s=t,i=void 0;s--;)if(l=f.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},o=f.slice(i,t),o.unshift(r),f.splice(i,t-i+1,o))}}return ur(n,0,Number.POSITIVE_INFINITY,f.slice(0)),!h}function H7(n,e){const t=n.get(e)[1],r=n.get(e)[2];let i=e-1;const s=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,u=[],h={};let f,p,m=-1,y=t,k=0,b=0;const w=[b];for(;y;){for(;n.get(++i)[1]!==y;);s.push(i),y._tokenizer||(f=r.sliceStream(y),y.next||f.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=t;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(b=m+1,w.push(b),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):w.pop(),m=w.length;m--;){const S=o.slice(w[m],w[m+1]),Q=s.pop();u.push([Q,Q+S.length-1]),n.splice(Q,2,S)}for(u.reverse(),m=-1;++m<u.length;)h[k+u[m][0]]=k+u[m][1],k+=u[m][1]-u[m][0]-1;return h}const K7={resolve:eW,tokenize:tW},J7={partial:!0,tokenize:nW};function eW(n){return jj(n),n}function tW(n,e){let t;return r;function r(o){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):Ee(o)?n.check(J7,l,s)(o):(n.consume(o),i)}function s(o){return n.exit("chunkContent"),n.exit("content"),e(o)}function l(o){return n.consume(o),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function nW(n,e,t){const r=this;return i;function i(l){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Ge(n,s,"linePrefix")}function s(l){if(l===null||Ee(l))return t(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(l):n.interrupt(r.parser.constructs.flow,t,e)(l)}}function Ej(n,e,t,r,i,s,l,o,u){const h=u||Number.POSITIVE_INFINITY;let f=0;return p;function p(S){return S===60?(n.enter(r),n.enter(i),n.enter(s),n.consume(S),n.exit(s),m):S===null||S===32||S===41||Md(S)?t(S):(n.enter(r),n.enter(l),n.enter(o),n.enter("chunkString",{contentType:"string"}),b(S))}function m(S){return S===62?(n.enter(s),n.consume(S),n.exit(s),n.exit(i),n.exit(r),e):(n.enter(o),n.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(n.exit("chunkString"),n.exit(o),m(S)):S===null||S===60||Ee(S)?t(S):(n.consume(S),S===92?k:y)}function k(S){return S===60||S===62||S===92?(n.consume(S),y):y(S)}function b(S){return!f&&(S===null||S===41||ft(S))?(n.exit("chunkString"),n.exit(o),n.exit(l),n.exit(r),e(S)):f<h&&S===40?(n.consume(S),f++,b):S===41?(n.consume(S),f--,b):S===null||S===32||S===40||Md(S)?t(S):(n.consume(S),S===92?w:b)}function w(S){return S===40||S===41||S===92?(n.consume(S),b):b(S)}}function Mj(n,e,t,r,i,s){const l=this;let o=0,u;return h;function h(y){return n.enter(r),n.enter(i),n.consume(y),n.exit(i),n.enter(s),f}function f(y){return o>999||y===null||y===91||y===93&&!u||y===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?t(y):y===93?(n.exit(s),n.enter(i),n.consume(y),n.exit(i),n.exit(r),e):Ee(y)?(n.enter("lineEnding"),n.consume(y),n.exit("lineEnding"),f):(n.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Ee(y)||o++>999?(n.exit("chunkString"),f(y)):(n.consume(y),u||(u=!We(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(n.consume(y),o++,p):p(y)}}function Aj(n,e,t,r,i,s){let l;return o;function o(m){return m===34||m===39||m===40?(n.enter(r),n.enter(i),n.consume(m),n.exit(i),l=m===40?41:m,u):t(m)}function u(m){return m===l?(n.enter(i),n.consume(m),n.exit(i),n.exit(r),e):(n.enter(s),h(m))}function h(m){return m===l?(n.exit(s),u(l)):m===null?t(m):Ee(m)?(n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),Ge(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===l||m===null||Ee(m)?(n.exit("chunkString"),h(m)):(n.consume(m),m===92?p:f)}function p(m){return m===l||m===92?(n.consume(m),f):f(m)}}function Bu(n,e){let t;return r;function r(i){return Ee(i)?(n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),t=!0,r):We(i)?Ge(n,r,t?"linePrefix":"lineSuffix")(i):e(i)}}const rW={name:"definition",tokenize:sW},iW={partial:!0,tokenize:lW};function sW(n,e,t){const r=this;let i;return s;function s(y){return n.enter("definition"),l(y)}function l(y){return Mj.call(r,n,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return i=zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(n.enter("definitionMarker"),n.consume(y),n.exit("definitionMarker"),u):t(y)}function u(y){return ft(y)?Bu(n,h)(y):h(y)}function h(y){return Ej(n,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function f(y){return n.attempt(iW,p,p)(y)}function p(y){return We(y)?Ge(n,m,"whitespace")(y):m(y)}function m(y){return y===null||Ee(y)?(n.exit("definition"),r.parser.defined.push(i),e(y)):t(y)}}function lW(n,e,t){return r;function r(o){return ft(o)?Bu(n,i)(o):t(o)}function i(o){return Aj(n,s,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return We(o)?Ge(n,l,"whitespace")(o):l(o)}function l(o){return o===null||Ee(o)?e(o):t(o)}}const oW={name:"hardBreakEscape",tokenize:aW};function aW(n,e,t){return r;function r(s){return n.enter("hardBreakEscape"),n.consume(s),i}function i(s){return Ee(s)?(n.exit("hardBreakEscape"),e(s)):t(s)}}const uW={name:"headingAtx",resolve:cW,tokenize:hW};function cW(n,e){let t=n.length-2,r=3,i,s;return n[r][1].type==="whitespace"&&(r+=2),t-2>r&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&n[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:n[r][1].start,end:n[t][1].end},s={type:"chunkText",start:n[r][1].start,end:n[t][1].end,contentType:"text"},ur(n,r,t-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),n}function hW(n,e,t){let r=0;return i;function i(f){return n.enter("atxHeading"),s(f)}function s(f){return n.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(n.consume(f),l):f===null||ft(f)?(n.exit("atxHeadingSequence"),o(f)):t(f)}function o(f){return f===35?(n.enter("atxHeadingSequence"),u(f)):f===null||Ee(f)?(n.exit("atxHeading"),e(f)):We(f)?Ge(n,o,"whitespace")(f):(n.enter("atxHeadingText"),h(f))}function u(f){return f===35?(n.consume(f),u):(n.exit("atxHeadingSequence"),o(f))}function h(f){return f===null||f===35||ft(f)?(n.exit("atxHeadingText"),o(f)):(n.consume(f),h)}}const fW=["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"],pP=["pre","script","style","textarea"],dW={concrete:!0,name:"htmlFlow",resolveTo:gW,tokenize:OW},pW={partial:!0,tokenize:xW},mW={partial:!0,tokenize:yW};function gW(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function OW(n,e,t){const r=this;let i,s,l,o,u;return h;function h(E){return f(E)}function f(E){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(E),p}function p(E){return E===33?(n.consume(E),m):E===47?(n.consume(E),s=!0,b):E===63?(n.consume(E),i=3,r.interrupt?e:C):Sn(E)?(n.consume(E),l=String.fromCharCode(E),w):t(E)}function m(E){return E===45?(n.consume(E),i=2,y):E===91?(n.consume(E),i=5,o=0,k):Sn(E)?(n.consume(E),i=4,r.interrupt?e:C):t(E)}function y(E){return E===45?(n.consume(E),r.interrupt?e:C):t(E)}function k(E){const ce="CDATA[";return E===ce.charCodeAt(o++)?(n.consume(E),o===ce.length?r.interrupt?e:F:k):t(E)}function b(E){return Sn(E)?(n.consume(E),l=String.fromCharCode(E),w):t(E)}function w(E){if(E===null||E===47||E===62||ft(E)){const ce=E===47,$e=l.toLowerCase();return!ce&&!s&&pP.includes($e)?(i=1,r.interrupt?e(E):F(E)):fW.includes(l.toLowerCase())?(i=6,ce?(n.consume(E),S):r.interrupt?e(E):F(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(E):s?Q(E):$(E))}return E===45||mn(E)?(n.consume(E),l+=String.fromCharCode(E),w):t(E)}function S(E){return E===62?(n.consume(E),r.interrupt?e:F):t(E)}function Q(E){return We(E)?(n.consume(E),Q):_(E)}function $(E){return E===47?(n.consume(E),_):E===58||E===95||Sn(E)?(n.consume(E),A):We(E)?(n.consume(E),$):_(E)}function A(E){return E===45||E===46||E===58||E===95||mn(E)?(n.consume(E),A):I(E)}function I(E){return E===61?(n.consume(E),T):We(E)?(n.consume(E),I):$(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?t(E):E===34||E===39?(n.consume(E),u=E,X):We(E)?(n.consume(E),T):z(E)}function X(E){return E===u?(n.consume(E),u=null,K):E===null||Ee(E)?t(E):(n.consume(E),X)}function z(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ft(E)?I(E):(n.consume(E),z)}function K(E){return E===47||E===62||We(E)?$(E):t(E)}function _(E){return E===62?(n.consume(E),G):t(E)}function G(E){return E===null||Ee(E)?F(E):We(E)?(n.consume(E),G):t(E)}function F(E){return E===45&&i===2?(n.consume(E),pe):E===60&&i===1?(n.consume(E),ye):E===62&&i===4?(n.consume(E),D):E===63&&i===3?(n.consume(E),C):E===93&&i===5?(n.consume(E),ie):Ee(E)&&(i===6||i===7)?(n.exit("htmlFlowData"),n.check(pW,q,le)(E)):E===null||Ee(E)?(n.exit("htmlFlowData"),le(E)):(n.consume(E),F)}function le(E){return n.check(mW,J,q)(E)}function J(E){return n.enter("lineEnding"),n.consume(E),n.exit("lineEnding"),Y}function Y(E){return E===null||Ee(E)?le(E):(n.enter("htmlFlowData"),F(E))}function pe(E){return E===45?(n.consume(E),C):F(E)}function ye(E){return E===47?(n.consume(E),l="",ee):F(E)}function ee(E){if(E===62){const ce=l.toLowerCase();return pP.includes(ce)?(n.consume(E),D):F(E)}return Sn(E)&&l.length<8?(n.consume(E),l+=String.fromCharCode(E),ee):F(E)}function ie(E){return E===93?(n.consume(E),C):F(E)}function C(E){return E===62?(n.consume(E),D):E===45&&i===2?(n.consume(E),C):F(E)}function D(E){return E===null||Ee(E)?(n.exit("htmlFlowData"),q(E)):(n.consume(E),D)}function q(E){return n.exit("htmlFlow"),e(E)}}function yW(n,e,t){const r=this;return i;function i(l){return Ee(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),s):t(l)}function s(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}function xW(n,e,t){return r;function r(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),n.attempt(Dc,e,t)}}const kW={name:"htmlText",tokenize:vW};function vW(n,e,t){const r=this;let i,s,l;return o;function o(C){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(C),u}function u(C){return C===33?(n.consume(C),h):C===47?(n.consume(C),I):C===63?(n.consume(C),$):Sn(C)?(n.consume(C),z):t(C)}function h(C){return C===45?(n.consume(C),f):C===91?(n.consume(C),s=0,k):Sn(C)?(n.consume(C),Q):t(C)}function f(C){return C===45?(n.consume(C),y):t(C)}function p(C){return C===null?t(C):C===45?(n.consume(C),m):Ee(C)?(l=p,ye(C)):(n.consume(C),p)}function m(C){return C===45?(n.consume(C),y):p(C)}function y(C){return C===62?pe(C):C===45?m(C):p(C)}function k(C){const D="CDATA[";return C===D.charCodeAt(s++)?(n.consume(C),s===D.length?b:k):t(C)}function b(C){return C===null?t(C):C===93?(n.consume(C),w):Ee(C)?(l=b,ye(C)):(n.consume(C),b)}function w(C){return C===93?(n.consume(C),S):b(C)}function S(C){return C===62?pe(C):C===93?(n.consume(C),S):b(C)}function Q(C){return C===null||C===62?pe(C):Ee(C)?(l=Q,ye(C)):(n.consume(C),Q)}function $(C){return C===null?t(C):C===63?(n.consume(C),A):Ee(C)?(l=$,ye(C)):(n.consume(C),$)}function A(C){return C===62?pe(C):$(C)}function I(C){return Sn(C)?(n.consume(C),T):t(C)}function T(C){return C===45||mn(C)?(n.consume(C),T):X(C)}function X(C){return Ee(C)?(l=X,ye(C)):We(C)?(n.consume(C),X):pe(C)}function z(C){return C===45||mn(C)?(n.consume(C),z):C===47||C===62||ft(C)?K(C):t(C)}function K(C){return C===47?(n.consume(C),pe):C===58||C===95||Sn(C)?(n.consume(C),_):Ee(C)?(l=K,ye(C)):We(C)?(n.consume(C),K):pe(C)}function _(C){return C===45||C===46||C===58||C===95||mn(C)?(n.consume(C),_):G(C)}function G(C){return C===61?(n.consume(C),F):Ee(C)?(l=G,ye(C)):We(C)?(n.consume(C),G):K(C)}function F(C){return C===null||C===60||C===61||C===62||C===96?t(C):C===34||C===39?(n.consume(C),i=C,le):Ee(C)?(l=F,ye(C)):We(C)?(n.consume(C),F):(n.consume(C),J)}function le(C){return C===i?(n.consume(C),i=void 0,Y):C===null?t(C):Ee(C)?(l=le,ye(C)):(n.consume(C),le)}function J(C){return C===null||C===34||C===39||C===60||C===61||C===96?t(C):C===47||C===62||ft(C)?K(C):(n.consume(C),J)}function Y(C){return C===47||C===62||ft(C)?K(C):t(C)}function pe(C){return C===62?(n.consume(C),n.exit("htmlTextData"),n.exit("htmlText"),e):t(C)}function ye(C){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),ee}function ee(C){return We(C)?Ge(n,ie,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ie(C)}function ie(C){return n.enter("htmlTextData"),l(C)}}const _0={name:"labelEnd",resolveAll:PW,resolveTo:CW,tokenize:QW},bW={tokenize:$W},wW={tokenize:TW},SW={tokenize:jW};function PW(n){let e=-1;const t=[];for(;++e<n.length;){const r=n[e][1];if(t.push(n[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return n.length!==t.length&&ur(n,0,n.length,t),n}function CW(n,e){let t=n.length,r=0,i,s,l,o;for(;t--;)if(i=n[t][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;n[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(n[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const u={type:n[s][1].type==="labelLink"?"link":"image",start:{...n[s][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[s][1].start},end:{...n[l][1].end}},f={type:"labelText",start:{...n[s+r+2][1].end},end:{...n[l-2][1].start}};return o=[["enter",u,e],["enter",h,e]],o=vr(o,n.slice(s+1,s+r+3)),o=vr(o,[["enter",f,e]]),o=vr(o,up(e.parser.constructs.insideSpan.null,n.slice(s+r+4,l-3),e)),o=vr(o,[["exit",f,e],n[l-2],n[l-1],["exit",h,e]]),o=vr(o,n.slice(l+1)),o=vr(o,[["exit",u,e]]),ur(n,s,n.length,o),n}function QW(n,e,t){const r=this;let i=r.events.length,s,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(m){return s?s._inactive?p(m):(l=r.parser.defined.includes(zr(r.sliceSerialize({start:s.end,end:r.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),n.exit("labelEnd"),u):t(m)}function u(m){return m===40?n.attempt(bW,f,l?f:p)(m):m===91?n.attempt(wW,f,l?h:p)(m):l?f(m):p(m)}function h(m){return n.attempt(SW,f,p)(m)}function f(m){return e(m)}function p(m){return s._balanced=!0,t(m)}}function $W(n,e,t){return r;function r(p){return n.enter("resource"),n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),i}function i(p){return ft(p)?Bu(n,s)(p):s(p)}function s(p){return p===41?f(p):Ej(n,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return ft(p)?Bu(n,u)(p):f(p)}function o(p){return t(p)}function u(p){return p===34||p===39||p===40?Aj(n,h,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):f(p)}function h(p){return ft(p)?Bu(n,f)(p):f(p)}function f(p){return p===41?(n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),n.exit("resource"),e):t(p)}}function TW(n,e,t){const r=this;return i;function i(o){return Mj.call(r,n,s,l,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):t(o)}function l(o){return t(o)}}function jW(n,e,t){return r;function r(s){return n.enter("reference"),n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),i}function i(s){return s===93?(n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),n.exit("reference"),e):t(s)}}const EW={name:"labelStartImage",resolveAll:_0.resolveAll,tokenize:MW};function MW(n,e,t){const r=this;return i;function i(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),s}function s(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),l):t(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):e(o)}}const AW={name:"labelStartLink",resolveAll:_0.resolveAll,tokenize:RW};function RW(n,e,t){const r=this;return i;function i(l){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):e(l)}}const oO={name:"lineEnding",tokenize:NW};function NW(n,e){return t;function t(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),Ge(n,e,"linePrefix")}}const qf={name:"thematicBreak",tokenize:LW};function LW(n,e,t){let r=0,i;return s;function s(h){return n.enter("thematicBreak"),l(h)}function l(h){return i=h,o(h)}function o(h){return h===i?(n.enter("thematicBreakSequence"),u(h)):r>=3&&(h===null||Ee(h))?(n.exit("thematicBreak"),e(h)):t(h)}function u(h){return h===i?(n.consume(h),r++,u):(n.exit("thematicBreakSequence"),We(h)?Ge(n,o,"whitespace")(h):o(h))}}const Nn={continuation:{tokenize:zW},exit:XW,name:"list",tokenize:IW},_W={partial:!0,tokenize:BW},DW={partial:!0,tokenize:ZW};function IW(n,e,t){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return o;function o(y){const k=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:nx(y)){if(r.containerState.type||(r.containerState.type=k,n.enter(k,{_container:!0})),k==="listUnordered")return n.enter("listItemPrefix"),y===42||y===45?n.check(qf,t,h)(y):h(y);if(!r.interrupt||y===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),u(y)}return t(y)}function u(y){return nx(y)&&++l<10?(n.consume(y),u):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(n.exit("listItemValue"),h(y)):t(y)}function h(y){return n.enter("listItemMarker"),n.consume(y),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,n.check(Dc,r.interrupt?t:f,n.attempt(_W,m,p))}function f(y){return r.containerState.initialBlankLine=!0,s++,m(y)}function p(y){return We(y)?(n.enter("listItemPrefixWhitespace"),n.consume(y),n.exit("listItemPrefixWhitespace"),m):t(y)}function m(y){return r.containerState.size=s+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(y)}}function zW(n,e,t){const r=this;return r.containerState._closeFlow=void 0,n.check(Dc,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ge(n,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!We(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(DW,e,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ge(n,n.attempt(Nn,e,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function ZW(n,e,t){const r=this;return Ge(n,i,"listItemIndent",r.containerState.size+1);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(s):t(s)}}function XW(n){n.exit(this.containerState.type)}function BW(n,e,t){const r=this;return Ge(n,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const l=r.events[r.events.length-1];return!We(s)&&l&&l[1].type==="listItemPrefixWhitespace"?e(s):t(s)}}const mP={name:"setextUnderline",resolveTo:WW,tokenize:qW};function WW(n,e){let t=n.length,r,i,s;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){r=t;break}n[t][1].type==="paragraph"&&(i=t)}else n[t][1].type==="content"&&n.splice(t,1),!s&&n[t][1].type==="definition"&&(s=t);const l={type:"setextHeading",start:{...n[r][1].start},end:{...n[n.length-1][1].end}};return n[i][1].type="setextHeadingText",s?(n.splice(i,0,["enter",l,e]),n.splice(s+1,0,["exit",n[r][1],e]),n[r][1].end={...n[s][1].end}):n[r][1]=l,n.push(["exit",l,e]),n}function qW(n,e,t){const r=this;let i;return s;function s(h){let f=r.events.length,p;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){p=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(n.enter("setextHeadingLine"),i=h,l(h)):t(h)}function l(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===i?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),We(h)?Ge(n,u,"lineSuffix")(h):u(h))}function u(h){return h===null||Ee(h)?(n.exit("setextHeadingLine"),e(h)):t(h)}}const VW={tokenize:FW};function FW(n){const e=this,t=n.attempt(Dc,r,n.attempt(this.parser.constructs.flowInitial,i,Ge(n,n.attempt(this.parser.constructs.flow,i,n.attempt(K7,i)),"linePrefix")));return t;function r(s){if(s===null){n.consume(s);return}return n.enter("lineEndingBlank"),n.consume(s),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(s){if(s===null){n.consume(s);return}return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const YW={resolveAll:Nj()},UW=Rj("string"),GW=Rj("text");function Rj(n){return{resolveAll:Nj(n==="text"?HW:void 0),tokenize:e};function e(t){const r=this,i=this.parser.constructs[n],s=t.attempt(i,l,o);return l;function l(f){return h(f)?s(f):o(f)}function o(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return h(f)?(t.exit("data"),s(f)):(t.consume(f),u)}function h(f){if(f===null)return!0;const p=i[f];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Nj(n){return e;function e(t,r){let i=-1,s;for(;++i<=t.length;)s===void 0?t[i]&&t[i][1].type==="data"&&(s=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==s+2&&(t[s][1].end=t[i-1][1].end,t.splice(s+2,i-s-2),i=s+2),s=void 0);return n?n(t,r):t}}function HW(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const r=n[t-1][1],i=e.sliceStream(r);let s=i.length,l=-1,o=0,u;for(;s--;){const h=i[s];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(h===-2)u=!0,o++;else if(h!==-1){s++;break}}if(e._contentTypeTextTrailing&&t===n.length&&(o=0),o){const h={type:t===n.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:r.start._bufferIndex+l,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(n.splice(t,0,["enter",h,e],["exit",h,e]),t+=2)}t++}return n}const KW={42:Nn,43:Nn,45:Nn,48:Nn,49:Nn,50:Nn,51:Nn,52:Nn,53:Nn,54:Nn,55:Nn,56:Nn,57:Nn,62:Qj},JW={91:rW},e9={[-2]:lO,[-1]:lO,32:lO},t9={35:uW,42:qf,45:[mP,qf],60:dW,61:mP,95:qf,96:dP,126:dP},n9={38:Tj,92:$j},r9={[-5]:oO,[-4]:oO,[-3]:oO,33:EW,38:Tj,42:rx,60:[A7,kW],91:AW,92:[oW,$j],93:_0,95:rx,96:V7},i9={null:[rx,YW]},s9={null:[42,95]},l9={null:[]},o9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:s9,contentInitial:JW,disable:l9,document:KW,flow:t9,flowInitial:e9,insideSpan:i9,string:n9,text:r9},Symbol.toStringTag,{value:"Module"}));function a9(n,e,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},s=[];let l=[],o=[];const u={attempt:X(I),check:X(T),consume:Q,enter:$,exit:A,interrupt:X(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:b,events:[],now:k,parser:n,previous:null,sliceSerialize:m,sliceStream:y,write:p};let f=e.tokenize.call(h,u);return e.resolveAll&&s.push(e),h;function p(G){return l=vr(l,G),w(),l[l.length-1]!==null?[]:(z(e,0),h.events=up(s,h.events,h),h.events)}function m(G,F){return c9(y(G),F)}function y(G){return u9(l,G)}function k(){const{_bufferIndex:G,_index:F,line:le,column:J,offset:Y}=r;return{_bufferIndex:G,_index:F,line:le,column:J,offset:Y}}function b(G){i[G.line]=G.column,_()}function w(){let G;for(;r._index<l.length;){const F=l[r._index];if(typeof F=="string")for(G=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<F.length;)S(F.charCodeAt(r._bufferIndex));else S(F)}}function S(G){f=f(G)}function Q(G){Ee(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,_()):G!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=G}function $(G,F){const le=F||{};return le.type=G,le.start=k(),h.events.push(["enter",le,h]),o.push(le),le}function A(G){const F=o.pop();return F.end=k(),h.events.push(["exit",F,h]),F}function I(G,F){z(G,F.from)}function T(G,F){F.restore()}function X(G,F){return le;function le(J,Y,pe){let ye,ee,ie,C;return Array.isArray(J)?q(J):"tokenize"in J?q([J]):D(J);function D(we){return Ie;function Ie(_e){const De=_e!==null&&we[_e],at=_e!==null&&we.null,Fn=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(at)?at:at?[at]:[]];return q(Fn)(_e)}}function q(we){return ye=we,ee=0,we.length===0?pe:E(we[ee])}function E(we){return Ie;function Ie(_e){return C=K(),ie=we,we.partial||(h.currentConstruct=we),we.name&&h.parser.constructs.disable.null.includes(we.name)?$e():we.tokenize.call(F?Object.assign(Object.create(h),F):h,u,ce,$e)(_e)}}function ce(we){return G(ie,C),Y}function $e(we){return C.restore(),++ee<ye.length?E(ye[ee]):pe}}}function z(G,F){G.resolveAll&&!s.includes(G)&&s.push(G),G.resolve&&ur(h.events,F,h.events.length-F,G.resolve(h.events.slice(F),h)),G.resolveTo&&(h.events=G.resolveTo(h.events,h))}function K(){const G=k(),F=h.previous,le=h.currentConstruct,J=h.events.length,Y=Array.from(o);return{from:J,restore:pe};function pe(){r=G,h.previous=F,h.currentConstruct=le,h.events.length=J,o=Y,_()}}function _(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function u9(n,e){const t=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let l;if(t===i)l=[n[t].slice(r,s)];else{if(l=n.slice(t,i),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}s>0&&l.push(n[i].slice(0,s))}return l}function c9(n,e){let t=-1;const r=[];let i;for(;++t<n.length;){const s=n[t];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
437
437
  `;break}case-3:{l=`\r
438
- `;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&i)continue;l=" ";break}default:l=String.fromCharCode(s)}i=s===-2,r.push(l)}return r.join("")}function h9(n){const r={constructs:Pj([o9,...(n||{}).extensions||[]]),content:i(CW),defined:[],document:i($W),flow:i(V7),lazy:{},string:i(U7),text:i(G7)};return r;function i(s){return l;function l(o){return a9(r,s,o)}}}function f9(n){for(;!jj(n););return n}const gP=/[\0\t\n\r]/g;function d9(){let n=1,e="",t=!0,r;return i;function i(s,l,o){const u=[];let h,f,p,m,y;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),p=0,e="",t&&(s.charCodeAt(0)===65279&&p++,t=void 0);p<s.length;){if(gP.lastIndex=p,h=gP.exec(s),m=h&&h.index!==void 0?h.index:s.length,y=s.charCodeAt(m),!h){e=s.slice(p);break}if(y===10&&p===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<m&&(u.push(s.slice(p,m)),n+=m-p),y){case 0:{u.push(65533),n++;break}case 9:{for(f=Math.ceil(n/4)*4,u.push(-2);n++<f;)u.push(-1);break}case 10:{u.push(-4),n=1;break}default:r=!0,n=1}p=m+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const p9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function m9(n){return n.replace(p9,g9)}function g9(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),s=i===120||i===88;return Cj(t.slice(s?2:1),s?16:10)}return L0(t)||n}const Lj={}.hasOwnProperty;function O9(n,e,t){return e&&typeof e=="object"&&(t=e,e=void 0),y9(t)(f9(h9(t).document().write(d9()(n,e,!0))))}function y9(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(wi),autolinkProtocol:K,autolinkEmail:K,atxHeading:s(Nt),blockQuote:s(at),characterEscape:K,characterReference:K,codeFenced:s(Fn),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Fn,l),codeText:s(Hi,l),codeTextData:K,data:K,codeFlowValue:K,definition:s(Vr),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s($n),hardBreakEscape:s(Je),hardBreakTrailing:s(Je),htmlFlow:s(kt,l),htmlFlowData:K,htmlText:s(kt,l),htmlTextData:K,image:s(Xt),label:l,link:s(wi),listItem:s(Fr),listItemValue:m,listOrdered:s(on,p),listUnordered:s(on),paragraph:s(Gs),reference:E,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(Nt),strong:s(Zc),thematicBreak:s(Bc)},exit:{atxHeading:u(),atxHeadingSequence:I,autolink:u(),autolinkEmail:De,autolinkProtocol:_e,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:$e,characterReferenceMarkerNumeric:$e,characterReferenceValue:we,characterReference:Ie,codeFenced:u(w),codeFencedFence:b,codeFencedFenceInfo:y,codeFencedFenceMeta:k,codeFlowValue:_,codeIndented:u(S),codeText:u(Y),codeTextData:_,data:_,definition:u(),definitionDestinationString:A,definitionLabelString:Q,definitionTitleString:$,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(le),htmlFlowData:_,htmlText:u(J),htmlTextData:_,image:u(ye),label:ie,labelText:ee,lineEnding:G,link:u(pe),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ce,resourceDestinationString:C,resourceTitleString:D,resource:q,setextHeading:u(z),setextHeadingLineSequence:X,setextHeadingText:T,strong:u(),thematicBreak:u()}};_j(e,(n||{}).mdastExtensions||[]);const t={};return r;function r(H){let ue={type:"root",children:[]};const Me={stack:[ue],tokenStack:[],config:e,enter:o,exit:h,buffer:l,resume:f,data:t},Ze=[];let He=-1;for(;++He<H.length;)if(H[He][1].type==="listOrdered"||H[He][1].type==="listUnordered")if(H[He][0]==="enter")Ze.push(He);else{const Ut=Ze.pop();He=i(H,Ut,He)}for(He=-1;++He<H.length;){const Ut=e[H[He][0]];Lj.call(Ut,H[He][1].type)&&Ut[H[He][1].type].call(Object.assign({sliceSerialize:H[He][2].sliceSerialize},Me),H[He][1])}if(Me.tokenStack.length>0){const Ut=Me.tokenStack[Me.tokenStack.length-1];(Ut[1]||OP).call(Me,void 0,Ut[0])}for(ue.position={start:xs(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:xs(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<e.transforms.length;)ue=e.transforms[He](ue)||ue;return ue}function i(H,ue,Me){let Ze=ue-1,He=-1,Ut=!1,Si,fr,Ki,Hs;for(;++Ze<=Me;){const Gt=H[Ze];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?He++:He--,Hs=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(Si&&!Hs&&!He&&!Ki&&(Ki=Ze),Hs=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Hs=void 0}if(!He&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||He===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(Si){let Yr=Ze;for(fr=void 0;Yr--;){const Yn=H[Yr];if(Yn[1].type==="lineEnding"||Yn[1].type==="lineEndingBlank"){if(Yn[0]==="exit")continue;fr&&(H[fr][1].type="lineEndingBlank",Ut=!0),Yn[1].type="lineEnding",fr=Yr}else if(!(Yn[1].type==="linePrefix"||Yn[1].type==="blockQuotePrefix"||Yn[1].type==="blockQuotePrefixWhitespace"||Yn[1].type==="blockQuoteMarker"||Yn[1].type==="listItemIndent"))break}Ki&&(!fr||Ki<fr)&&(Si._spread=!0),Si.end=Object.assign({},fr?H[fr][1].start:Gt[1].end),H.splice(fr||Ze,0,["exit",Si,Gt[2]]),Ze++,Me++}if(Gt[1].type==="listItemPrefix"){const Yr={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};Si=Yr,H.splice(Ze,0,["enter",Yr,Gt[2]]),Ze++,Me++,Ki=void 0,Hs=!0}}}return H[ue][1]._spread=Ut,Me}function s(H,ue){return Me;function Me(Ze){o.call(this,H(Ze),Ze),ue&&ue.call(this,Ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(H,ue,Me){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([ue,Me||void 0]),H.position={start:xs(ue.start),end:void 0}}function u(H){return ue;function ue(Me){H&&H.call(this,Me),h.call(this,Me)}}function h(H,ue){const Me=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==H.type&&(ue?ue.call(this,H,Ze[0]):(Ze[1]||OP).call(this,H,Ze[0]));else throw new Error("Cannot close `"+H.type+"` ("+Xu({start:H.start,end:H.end})+"): it’s not open");Me.position.end=xs(H.end)}function f(){return N0(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(H){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function y(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=H}function k(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=H}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H.replace(/(\r?\n|\r)$/g,"")}function Q(H){const ue=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ue,Me.identifier=zr(this.sliceSerialize(H)).toLowerCase()}function $(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.title=H}function A(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.url=H}function I(H){const ue=this.stack[this.stack.length-1];if(!ue.depth){const Me=this.sliceSerialize(H).length;ue.depth=Me}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function X(H){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function K(H){const Me=this.stack[this.stack.length-1].children;let Ze=Me[Me.length-1];(!Ze||Ze.type!=="text")&&(Ze=Xc(),Ze.position={start:xs(H.start),end:void 0},Me.push(Ze)),this.stack.push(Ze)}function _(H){const ue=this.stack.pop();ue.value+=this.sliceSerialize(H),ue.position.end=xs(H.end)}function G(H){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=ue.children[ue.children.length-1];Me.position.end=xs(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ue.type)&&(K.call(this,H),_.call(this,H))}function F(){this.data.atHardBreak=!0}function le(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H}function J(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H}function Y(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H}function pe(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=ue,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ye(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=ue,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ee(H){const ue=this.sliceSerialize(H),Me=this.stack[this.stack.length-2];Me.label=m9(ue),Me.identifier=zr(ue).toLowerCase()}function ie(){const H=this.stack[this.stack.length-1],ue=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ze=H.children;Me.children=Ze}else Me.alt=ue}function C(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.url=H}function D(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.title=H}function q(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function ce(H){const ue=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ue,Me.identifier=zr(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function $e(H){this.data.characterReferenceType=H.type}function we(H){const ue=this.sliceSerialize(H),Me=this.data.characterReferenceType;let Ze;Me?(Ze=Cj(ue,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=L0(ue);const He=this.stack[this.stack.length-1];He.value+=Ze}function Ie(H){const ue=this.stack.pop();ue.position.end=xs(H.end)}function _e(H){_.call(this,H);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(H)}function De(H){_.call(this,H);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(H)}function at(){return{type:"blockquote",children:[]}}function Fn(){return{type:"code",lang:null,meta:null,value:""}}function Hi(){return{type:"inlineCode",value:""}}function Vr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $n(){return{type:"emphasis",children:[]}}function Nt(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function kt(){return{type:"html",value:""}}function Xt(){return{type:"image",title:null,url:"",alt:null}}function wi(){return{type:"link",title:null,url:"",children:[]}}function on(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Fr(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Gs(){return{type:"paragraph",children:[]}}function Zc(){return{type:"strong",children:[]}}function Xc(){return{type:"text",value:""}}function Bc(){return{type:"thematicBreak"}}}function xs(n){return{line:n.line,column:n.column,offset:n.offset}}function _j(n,e){let t=-1;for(;++t<e.length;){const r=e[t];Array.isArray(r)?_j(n,r):x9(n,r)}}function x9(n,e){let t;for(t in e)if(Lj.call(e,t))switch(t){case"canContainEols":{const r=e[t];r&&n[t].push(...r);break}case"transforms":{const r=e[t];r&&n[t].push(...r);break}case"enter":case"exit":{const r=e[t];r&&Object.assign(n[t],r);break}}}function OP(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+Xu({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+Xu({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Xu({start:e.start,end:e.end})+") is still open")}function k9(n){const e=this;e.parser=t;function t(r){return O9(r,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function v9(n,e){const t={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(e),!0)};return n.patch(e,t),n.applyData(e,t)}function b9(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:`
438
+ `;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&i)continue;l=" ";break}default:l=String.fromCharCode(s)}i=s===-2,r.push(l)}return r.join("")}function h9(n){const r={constructs:Pj([o9,...(n||{}).extensions||[]]),content:i(C7),defined:[],document:i($7),flow:i(VW),lazy:{},string:i(UW),text:i(GW)};return r;function i(s){return l;function l(o){return a9(r,s,o)}}}function f9(n){for(;!jj(n););return n}const gP=/[\0\t\n\r]/g;function d9(){let n=1,e="",t=!0,r;return i;function i(s,l,o){const u=[];let h,f,p,m,y;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),p=0,e="",t&&(s.charCodeAt(0)===65279&&p++,t=void 0);p<s.length;){if(gP.lastIndex=p,h=gP.exec(s),m=h&&h.index!==void 0?h.index:s.length,y=s.charCodeAt(m),!h){e=s.slice(p);break}if(y===10&&p===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<m&&(u.push(s.slice(p,m)),n+=m-p),y){case 0:{u.push(65533),n++;break}case 9:{for(f=Math.ceil(n/4)*4,u.push(-2);n++<f;)u.push(-1);break}case 10:{u.push(-4),n=1;break}default:r=!0,n=1}p=m+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const p9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function m9(n){return n.replace(p9,g9)}function g9(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),s=i===120||i===88;return Cj(t.slice(s?2:1),s?16:10)}return L0(t)||n}const Lj={}.hasOwnProperty;function O9(n,e,t){return e&&typeof e=="object"&&(t=e,e=void 0),y9(t)(f9(h9(t).document().write(d9()(n,e,!0))))}function y9(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(wi),autolinkProtocol:K,autolinkEmail:K,atxHeading:s(Nt),blockQuote:s(at),characterEscape:K,characterReference:K,codeFenced:s(Fn),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Fn,l),codeText:s(Hi,l),codeTextData:K,data:K,codeFlowValue:K,definition:s(Vr),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s($n),hardBreakEscape:s(Je),hardBreakTrailing:s(Je),htmlFlow:s(kt,l),htmlFlowData:K,htmlText:s(kt,l),htmlTextData:K,image:s(Xt),label:l,link:s(wi),listItem:s(Fr),listItemValue:m,listOrdered:s(on,p),listUnordered:s(on),paragraph:s(Gs),reference:E,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(Nt),strong:s(Zc),thematicBreak:s(Bc)},exit:{atxHeading:u(),atxHeadingSequence:I,autolink:u(),autolinkEmail:De,autolinkProtocol:_e,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:$e,characterReferenceMarkerNumeric:$e,characterReferenceValue:we,characterReference:Ie,codeFenced:u(w),codeFencedFence:b,codeFencedFenceInfo:y,codeFencedFenceMeta:k,codeFlowValue:_,codeIndented:u(S),codeText:u(Y),codeTextData:_,data:_,definition:u(),definitionDestinationString:A,definitionLabelString:Q,definitionTitleString:$,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(le),htmlFlowData:_,htmlText:u(J),htmlTextData:_,image:u(ye),label:ie,labelText:ee,lineEnding:G,link:u(pe),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ce,resourceDestinationString:C,resourceTitleString:D,resource:q,setextHeading:u(z),setextHeadingLineSequence:X,setextHeadingText:T,strong:u(),thematicBreak:u()}};_j(e,(n||{}).mdastExtensions||[]);const t={};return r;function r(H){let ue={type:"root",children:[]};const Me={stack:[ue],tokenStack:[],config:e,enter:o,exit:h,buffer:l,resume:f,data:t},Ze=[];let He=-1;for(;++He<H.length;)if(H[He][1].type==="listOrdered"||H[He][1].type==="listUnordered")if(H[He][0]==="enter")Ze.push(He);else{const Ut=Ze.pop();He=i(H,Ut,He)}for(He=-1;++He<H.length;){const Ut=e[H[He][0]];Lj.call(Ut,H[He][1].type)&&Ut[H[He][1].type].call(Object.assign({sliceSerialize:H[He][2].sliceSerialize},Me),H[He][1])}if(Me.tokenStack.length>0){const Ut=Me.tokenStack[Me.tokenStack.length-1];(Ut[1]||OP).call(Me,void 0,Ut[0])}for(ue.position={start:xs(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:xs(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<e.transforms.length;)ue=e.transforms[He](ue)||ue;return ue}function i(H,ue,Me){let Ze=ue-1,He=-1,Ut=!1,Si,fr,Ki,Hs;for(;++Ze<=Me;){const Gt=H[Ze];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?He++:He--,Hs=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(Si&&!Hs&&!He&&!Ki&&(Ki=Ze),Hs=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Hs=void 0}if(!He&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||He===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(Si){let Yr=Ze;for(fr=void 0;Yr--;){const Yn=H[Yr];if(Yn[1].type==="lineEnding"||Yn[1].type==="lineEndingBlank"){if(Yn[0]==="exit")continue;fr&&(H[fr][1].type="lineEndingBlank",Ut=!0),Yn[1].type="lineEnding",fr=Yr}else if(!(Yn[1].type==="linePrefix"||Yn[1].type==="blockQuotePrefix"||Yn[1].type==="blockQuotePrefixWhitespace"||Yn[1].type==="blockQuoteMarker"||Yn[1].type==="listItemIndent"))break}Ki&&(!fr||Ki<fr)&&(Si._spread=!0),Si.end=Object.assign({},fr?H[fr][1].start:Gt[1].end),H.splice(fr||Ze,0,["exit",Si,Gt[2]]),Ze++,Me++}if(Gt[1].type==="listItemPrefix"){const Yr={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};Si=Yr,H.splice(Ze,0,["enter",Yr,Gt[2]]),Ze++,Me++,Ki=void 0,Hs=!0}}}return H[ue][1]._spread=Ut,Me}function s(H,ue){return Me;function Me(Ze){o.call(this,H(Ze),Ze),ue&&ue.call(this,Ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(H,ue,Me){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([ue,Me||void 0]),H.position={start:xs(ue.start),end:void 0}}function u(H){return ue;function ue(Me){H&&H.call(this,Me),h.call(this,Me)}}function h(H,ue){const Me=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==H.type&&(ue?ue.call(this,H,Ze[0]):(Ze[1]||OP).call(this,H,Ze[0]));else throw new Error("Cannot close `"+H.type+"` ("+Xu({start:H.start,end:H.end})+"): it’s not open");Me.position.end=xs(H.end)}function f(){return N0(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(H){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function y(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=H}function k(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=H}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H.replace(/(\r?\n|\r)$/g,"")}function Q(H){const ue=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ue,Me.identifier=zr(this.sliceSerialize(H)).toLowerCase()}function $(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.title=H}function A(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.url=H}function I(H){const ue=this.stack[this.stack.length-1];if(!ue.depth){const Me=this.sliceSerialize(H).length;ue.depth=Me}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function X(H){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function K(H){const Me=this.stack[this.stack.length-1].children;let Ze=Me[Me.length-1];(!Ze||Ze.type!=="text")&&(Ze=Xc(),Ze.position={start:xs(H.start),end:void 0},Me.push(Ze)),this.stack.push(Ze)}function _(H){const ue=this.stack.pop();ue.value+=this.sliceSerialize(H),ue.position.end=xs(H.end)}function G(H){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=ue.children[ue.children.length-1];Me.position.end=xs(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ue.type)&&(K.call(this,H),_.call(this,H))}function F(){this.data.atHardBreak=!0}function le(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H}function J(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H}function Y(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.value=H}function pe(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=ue,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ye(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=ue,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ee(H){const ue=this.sliceSerialize(H),Me=this.stack[this.stack.length-2];Me.label=m9(ue),Me.identifier=zr(ue).toLowerCase()}function ie(){const H=this.stack[this.stack.length-1],ue=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ze=H.children;Me.children=Ze}else Me.alt=ue}function C(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.url=H}function D(){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.title=H}function q(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function ce(H){const ue=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ue,Me.identifier=zr(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function $e(H){this.data.characterReferenceType=H.type}function we(H){const ue=this.sliceSerialize(H),Me=this.data.characterReferenceType;let Ze;Me?(Ze=Cj(ue,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=L0(ue);const He=this.stack[this.stack.length-1];He.value+=Ze}function Ie(H){const ue=this.stack.pop();ue.position.end=xs(H.end)}function _e(H){_.call(this,H);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(H)}function De(H){_.call(this,H);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(H)}function at(){return{type:"blockquote",children:[]}}function Fn(){return{type:"code",lang:null,meta:null,value:""}}function Hi(){return{type:"inlineCode",value:""}}function Vr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $n(){return{type:"emphasis",children:[]}}function Nt(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function kt(){return{type:"html",value:""}}function Xt(){return{type:"image",title:null,url:"",alt:null}}function wi(){return{type:"link",title:null,url:"",children:[]}}function on(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Fr(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Gs(){return{type:"paragraph",children:[]}}function Zc(){return{type:"strong",children:[]}}function Xc(){return{type:"text",value:""}}function Bc(){return{type:"thematicBreak"}}}function xs(n){return{line:n.line,column:n.column,offset:n.offset}}function _j(n,e){let t=-1;for(;++t<e.length;){const r=e[t];Array.isArray(r)?_j(n,r):x9(n,r)}}function x9(n,e){let t;for(t in e)if(Lj.call(e,t))switch(t){case"canContainEols":{const r=e[t];r&&n[t].push(...r);break}case"transforms":{const r=e[t];r&&n[t].push(...r);break}case"enter":case"exit":{const r=e[t];r&&Object.assign(n[t],r);break}}}function OP(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+Xu({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+Xu({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Xu({start:e.start,end:e.end})+") is still open")}function k9(n){const e=this;e.parser=t;function t(r){return O9(r,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function v9(n,e){const t={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(e),!0)};return n.patch(e,t),n.applyData(e,t)}function b9(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:`
439
439
  `}]}function w9(n,e){const t=e.value?e.value+`
440
440
  `:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return e.meta&&(s.data={meta:e.meta}),n.patch(e,s),s=n.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},n.patch(e,s),s}function S9(n,e){const t={type:"element",tagName:"del",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function P9(n,e){const t={type:"element",tagName:"em",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function C9(n,e){const t=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Ca(r.toLowerCase()),s=n.footnoteOrder.indexOf(r);let l,o=n.footnoteCounts.get(r);o===void 0?(o=0,n.footnoteOrder.push(r),l=n.footnoteOrder.length):l=s+1,o+=1,n.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};n.patch(e,u);const h={type:"element",tagName:"sup",properties:{},children:[u]};return n.patch(e,h),n.applyData(e,h)}function Q9(n,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function $9(n,e){if(n.options.allowDangerousHtml){const t={type:"raw",value:e.value};return n.patch(e,t),n.applyData(e,t)}}function Dj(n,e){const t=e.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=n.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function T9(n,e){const t=String(e.identifier).toUpperCase(),r=n.definitionById.get(t);if(!r)return Dj(n,e);const i={src:Ca(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return n.patch(e,s),n.applyData(e,s)}function j9(n,e){const t={src:Ca(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const r={type:"element",tagName:"img",properties:t,children:[]};return n.patch(e,r),n.applyData(e,r)}function E9(n,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};n.patch(e,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return n.patch(e,r),n.applyData(e,r)}function M9(n,e){const t=String(e.identifier).toUpperCase(),r=n.definitionById.get(t);if(!r)return Dj(n,e);const i={href:Ca(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:n.all(e)};return n.patch(e,s),n.applyData(e,s)}function A9(n,e){const t={href:Ca(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const r={type:"element",tagName:"a",properties:t,children:n.all(e)};return n.patch(e,r),n.applyData(e,r)}function R9(n,e,t){const r=n.all(e),i=t?N9(t):Ij(e),s={},l=[];if(typeof e.checked=="boolean"){const f=r[0];let p;f&&f.type==="element"&&f.tagName==="p"?p=f:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const f=r[o];(i||o!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
441
441
  `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
@@ -445,7 +445,7 @@ Error generating stack: `+v.message+`
445
445
  `});++r<n.length;)r&&t.push({type:"text",value:`
446
446
  `}),t.push(n[r]);return e&&n.length>0&&t.push({type:"text",value:`
447
447
  `}),t}function SP(n){let e=0,t=n.charCodeAt(e);for(;t===9||t===32;)e++,t=n.charCodeAt(e);return n.slice(e)}function PP(n,e){const t=cq(n,e),r=t.one(n,void 0),i=eq(t),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
448
- `},i),s}function mq(n,e){return n&&"run"in n?async function(t,r){const i=PP(t,{file:r,...e});await n.run(i,r)}:function(t,r){return PP(t,{file:r,...n||e})}}function CP(n){if(n)throw n}var aO,QP;function gq(){if(QP)return aO;QP=1;var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},s=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var f=n.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!f&&!p)return!1;var m;for(m in h);return typeof m>"u"||n.call(h,m)},l=function(h,f){t&&f.name==="__proto__"?t(h,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):h[f.name]=f.newValue},o=function(h,f){if(f==="__proto__")if(n.call(h,f)){if(r)return r(h,f).value}else return;return h[f]};return aO=function u(){var h,f,p,m,y,k,b=arguments[0],w=1,S=arguments.length,Q=!1;for(typeof b=="boolean"&&(Q=b,b=arguments[1]||{},w=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});w<S;++w)if(h=arguments[w],h!=null)for(f in h)p=o(b,f),m=o(h,f),b!==m&&(Q&&m&&(s(m)||(y=i(m)))?(y?(y=!1,k=p&&i(p)?p:[]):k=p&&s(p)?p:{},l(b,{name:f,newValue:u(Q,k,m)})):typeof m<"u"&&l(b,{name:f,newValue:m}));return b},aO}var Oq=gq();const uO=zd(Oq);function lx(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function yq(){const n=[],e={run:t,use:r};return e;function t(...i){let s=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...i);function o(u,...h){const f=n[++s];let p=-1;if(u){l(u);return}for(;++p<i.length;)(h[p]===null||h[p]===void 0)&&(h[p]=i[p]);i=h,f?xq(f,o)(...h):l(null,...h)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return n.push(i),e}}function xq(n,e){let t;return r;function r(...l){const o=n.length>l.length;let u;o&&l.push(i);try{u=n.apply(this,l)}catch(h){const f=h;if(o&&t)throw f;return i(f)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(l,...o){t||(t=!0,e(l,...o))}function s(l){i(null,l)}}const ii={basename:kq,dirname:vq,extname:bq,join:wq,sep:"/"};function kq(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ic(n);let t=0,r=-1,i=n.length,s;if(e===void 0||e.length===0||e.length>n.length){for(;i--;)if(n.codePointAt(i)===47){if(s){t=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":n.slice(t,r)}if(e===n)return"";let l=-1,o=e.length-1;for(;i--;)if(n.codePointAt(i)===47){if(s){t=i+1;break}}else l<0&&(s=!0,l=i+1),o>-1&&(n.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=l));return t===r?r=l:r<0&&(r=n.length),n.slice(t,r)}function vq(n){if(Ic(n),n.length===0)return".";let e=-1,t=n.length,r;for(;--t;)if(n.codePointAt(t)===47){if(r){e=t;break}}else r||(r=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function bq(n){Ic(n);let e=n.length,t=-1,r=0,i=-1,s=0,l;for(;e--;){const o=n.codePointAt(e);if(o===47){if(l){r=e+1;break}continue}t<0&&(l=!0,t=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||t<0||s===0||s===1&&i===t-1&&i===r+1?"":n.slice(i,t)}function wq(...n){let e=-1,t;for(;++e<n.length;)Ic(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":Sq(t)}function Sq(n){Ic(n);const e=n.codePointAt(0)===47;let t=Pq(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function Pq(n,e){let t="",r=0,i=-1,s=0,l=-1,o,u;for(;++l<=n.length;){if(l<n.length)o=n.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||s===1))if(i!==l-1&&s===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=l,s=0;continue}}else if(t.length>0){t="",r=0,i=l,s=0;continue}}e&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+n.slice(i+1,l):t=n.slice(i+1,l),r=l-i-1;i=l,s=0}else o===46&&s>-1?s++:s=-1}return t}function Ic(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Cq={cwd:Qq};function Qq(){return"/"}function ox(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function $q(n){if(typeof n=="string")n=new URL(n);else if(!ox(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Tq(n)}function Tq(n){if(n.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const r=e.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const cO=["history","path","basename","stem","extname","dirname"];class qj{constructor(e){let t;e?ox(e)?t={path:e}:typeof e=="string"||jq(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":Cq.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cO.length;){const s=cO[r];s in t&&t[s]!==void 0&&t[s]!==null&&(this[s]=s==="history"?[...t[s]]:t[s])}let i;for(i in t)cO.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ii.basename(this.path):void 0}set basename(e){fO(e,"basename"),hO(e,"basename"),this.path=ii.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ii.dirname(this.path):void 0}set dirname(e){$P(this.basename,"dirname"),this.path=ii.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ii.extname(this.path):void 0}set extname(e){if(hO(e,"extname"),$P(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ii.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ox(e)&&(e=$q(e)),fO(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ii.basename(this.path,this.extname):void 0}set stem(e){fO(e,"stem"),hO(e,"stem"),this.path=ii.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){const i=this.message(e,t,r);throw i.fatal=!0,i}info(e,t,r){const i=this.message(e,t,r);return i.fatal=void 0,i}message(e,t,r){const i=new yn(e,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function hO(n,e){if(n&&n.includes(ii.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ii.sep+"`")}function fO(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function $P(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function jq(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Eq=(function(n){const r=this.constructor.prototype,i=r[n],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Mq={}.hasOwnProperty;class B0 extends Eq{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=yq()}copy(){const e=new B0;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];e.use(...r)}return e.data(uO(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(mO("data",this.frozen),this.namespace[e]=t,this):Mq.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mO("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=$f(e),r=this.parser||this.Parser;return dO("parse",r),r(String(t),t)}process(e,t){const r=this;return this.freeze(),dO("process",this.parser||this.Parser),pO("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(s,l){const o=$f(e),u=r.parse(o);r.run(u,o,function(f,p,m){if(f||!p||!m)return h(f);const y=p,k=r.stringify(y,m);Nq(k)?m.value=k:m.result=k,h(f,m)});function h(f,p){f||!p?l(f):s?s(p):t(void 0,p)}}}processSync(e){let t=!1,r;return this.freeze(),dO("processSync",this.parser||this.Parser),pO("processSync",this.compiler||this.Compiler),this.process(e,i),jP("processSync","process",t),r;function i(s,l){t=!0,CP(s),r=l}}run(e,t,r){TP(e),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?s(void 0,r):new Promise(s);function s(l,o){const u=$f(t);i.run(e,u,h);function h(f,p,m){const y=p||e;f?o(f):l?l(y):r(void 0,y,m)}}}runSync(e,t){let r=!1,i;return this.run(e,t,s),jP("runSync","run",r),i;function s(l,o){CP(l),i=o,r=!0}}stringify(e,t){this.freeze();const r=$f(t),i=this.compiler||this.Compiler;return pO("stringify",i),TP(e),i(e,r)}use(e,...t){const r=this.attachers,i=this.namespace;if(mO("use",this.frozen),e!=null)if(typeof e=="function")u(e,t);else if(typeof e=="object")Array.isArray(e)?o(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(h){if(typeof h=="function")u(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[f,...p]=h;u(f,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new 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(h.plugins),h.settings&&(i.settings=uO(!0,i.settings,h.settings))}function o(h){let f=-1;if(h!=null)if(Array.isArray(h))for(;++f<h.length;){const p=h[f];s(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function u(h,f){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===h){m=p;break}if(m===-1)r.push([h,...f]);else if(f.length>0){let[y,...k]=f;const b=r[m][1];lx(b)&&lx(y)&&(y=uO(!0,b,y)),r[m]=[h,y,...k]}}}}const Aq=new B0().freeze();function dO(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function pO(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function mO(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function TP(n){if(!lx(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function jP(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function $f(n){return Rq(n)?n:new qj(n)}function Rq(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Nq(n){return typeof n=="string"||Lq(n)}function Lq(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const _q="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",EP=[],MP={allowDangerousHtml:!0},Dq=/^(https?|ircs?|mailto|xmpp)$/i,Iq=[{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:"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 Vj(n){const e=zq(n),t=Zq(n);return Xq(e.runSync(e.parse(t),t),n)}function zq(n){const e=n.rehypePlugins||EP,t=n.remarkPlugins||EP,r=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...MP}:MP;return Aq().use(k9).use(t).use(mq,r).use(e)}function Zq(n){const e=n.children||"",t=new qj;return typeof e=="string"&&(t.value=e),t}function Xq(n,e){const t=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,l=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||Bq;for(const f of Iq)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+_q+f.id,void 0);return e.className&&(n={type:"element",tagName:"div",properties:{className:e.className},children:n.type==="root"?n.children:[n]}),X0(n,h),rW(n,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function h(f,p,m){if(f.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:f.value},p;if(f.type==="element"){let y;for(y in sO)if(Object.hasOwn(sO,y)&&Object.hasOwn(f.properties,y)){const k=f.properties[y],b=sO[y];(b===null||b.includes(f.tagName))&&(f.properties[y]=u(String(k||""),y,f))}}if(f.type==="element"){let y=t?!t.includes(f.tagName):s?s.includes(f.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(f,p,m)),y&&m&&typeof p=="number")return o&&f.children?m.children.splice(p,1,...f.children):m.children.splice(p,1),p}}}function Bq(n){const e=n.indexOf(":"),t=n.indexOf("?"),r=n.indexOf("#"),i=n.indexOf("/");return e===-1||i!==-1&&e>i||t!==-1&&e>t||r!==-1&&e>r||Dq.test(n.slice(0,e))?n:""}function AP(n,e){const t=String(n);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(e);for(;i!==-1;)r++,i=t.indexOf(e,i+e.length);return r}function Wq(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qq(n,e,t){const i=hp((t||{}).ignore||[]),s=Vq(e);let l=-1;for(;++l<s.length;)Wj(n,"text",o);function o(h,f){let p=-1,m;for(;++p<f.length;){const y=f[p],k=m?m.children:void 0;if(i(y,k?k.indexOf(y):void 0,m))return;m=y}if(m)return u(h,f)}function u(h,f){const p=f[f.length-1],m=s[l][0],y=s[l][1];let k=0;const w=p.children.indexOf(h);let S=!1,Q=[];m.lastIndex=0;let $=m.exec(h.value);for(;$;){const A=$.index,I={index:$.index,input:$.input,stack:[...f,h]};let T=y(...$,I);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?m.lastIndex=A+1:(k!==A&&Q.push({type:"text",value:h.value.slice(k,A)}),Array.isArray(T)?Q.push(...T):T&&Q.push(T),k=A+$[0].length,S=!0),!m.global)break;$=m.exec(h.value)}return S?(k<h.value.length&&Q.push({type:"text",value:h.value.slice(k)}),p.children.splice(w,1,...Q)):Q=[h],w+Q.length}}function Vq(n){const e=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!n[0]||Array.isArray(n[0])?n:[n];let r=-1;for(;++r<t.length;){const i=t[r];e.push([Fq(i[0]),Yq(i[1])])}return e}function Fq(n){return typeof n=="string"?new RegExp(Wq(n),"g"):n}function Yq(n){return typeof n=="function"?n:function(){return n}}const gO="phrasing",OO=["autolink","link","image","label"];function Uq(){return{transforms:[nV],enter:{literalAutolink:Hq,literalAutolinkEmail:yO,literalAutolinkHttp:yO,literalAutolinkWww:yO},exit:{literalAutolink:tV,literalAutolinkEmail:eV,literalAutolinkHttp:Kq,literalAutolinkWww:Jq}}}function Gq(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gO,notInConstruct:OO},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gO,notInConstruct:OO},{character:":",before:"[ps]",after:"\\/",inConstruct:gO,notInConstruct:OO}]}}function Hq(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function yO(n){this.config.enter.autolinkProtocol.call(this,n)}function Kq(n){this.config.exit.autolinkProtocol.call(this,n)}function Jq(n){this.config.exit.data.call(this,n);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(n)}function eV(n){this.config.exit.autolinkEmail.call(this,n)}function tV(n){this.exit(n)}function nV(n){qq(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rV],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),iV]],{ignore:["link","linkReference"]})}function rV(n,e,t,r,i){let s="";if(!Fj(i)||(/^w/i.test(e)&&(t=e+t,e="",s="http://"),!sV(t)))return!1;const l=lV(t+r);if(!l[0])return!1;const o={type:"link",title:null,url:s+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function iV(n,e,t,r){return!Fj(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+t,children:[{type:"text",value:e+"@"+t}]}}function sV(n){const e=n.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function lV(n){const e=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!e)return[n,void 0];n=n.slice(0,e.index);let t=e[0],r=t.indexOf(")");const i=AP(n,"(");let s=AP(n,")");for(;r!==-1&&i>s;)n+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),s++;return[n,t]}function Fj(n,e){const t=n.input.charCodeAt(n.index-1);return(n.index===0||zl(t)||ap(t))&&(!e||t!==47)}Yj.peek=mV;function oV(){this.buffer()}function aV(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function uV(){this.buffer()}function cV(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function hV(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=zr(this.sliceSerialize(n)).toLowerCase(),t.label=e}function fV(n){this.exit(n)}function dV(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=zr(this.sliceSerialize(n)).toLowerCase(),t.label=e}function pV(n){this.exit(n)}function mV(){return"["}function Yj(n,e,t,r){const i=t.createTracker(r);let s=i.move("[^");const l=t.enter("footnoteReference"),o=t.enter("reference");return s+=i.move(t.safe(t.associationId(n),{after:"]",before:s})),o(),l(),s+=i.move("]"),s}function gV(){return{enter:{gfmFootnoteCallString:oV,gfmFootnoteCall:aV,gfmFootnoteDefinitionLabelString:uV,gfmFootnoteDefinition:cV},exit:{gfmFootnoteCallString:hV,gfmFootnoteCall:fV,gfmFootnoteDefinitionLabelString:dV,gfmFootnoteDefinition:pV}}}function OV(n){let e=!1;return n&&n.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:t,footnoteReference:Yj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,s,l){const o=s.createTracker(l);let u=o.move("[^");const h=s.enter("footnoteDefinition"),f=s.enter("label");return u+=o.move(s.safe(s.associationId(r),{before:u,after:"]"})),f(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((e?`
448
+ `},i),s}function mq(n,e){return n&&"run"in n?async function(t,r){const i=PP(t,{file:r,...e});await n.run(i,r)}:function(t,r){return PP(t,{file:r,...n||e})}}function CP(n){if(n)throw n}var aO,QP;function gq(){if(QP)return aO;QP=1;var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},s=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var f=n.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!f&&!p)return!1;var m;for(m in h);return typeof m>"u"||n.call(h,m)},l=function(h,f){t&&f.name==="__proto__"?t(h,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):h[f.name]=f.newValue},o=function(h,f){if(f==="__proto__")if(n.call(h,f)){if(r)return r(h,f).value}else return;return h[f]};return aO=function u(){var h,f,p,m,y,k,b=arguments[0],w=1,S=arguments.length,Q=!1;for(typeof b=="boolean"&&(Q=b,b=arguments[1]||{},w=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});w<S;++w)if(h=arguments[w],h!=null)for(f in h)p=o(b,f),m=o(h,f),b!==m&&(Q&&m&&(s(m)||(y=i(m)))?(y?(y=!1,k=p&&i(p)?p:[]):k=p&&s(p)?p:{},l(b,{name:f,newValue:u(Q,k,m)})):typeof m<"u"&&l(b,{name:f,newValue:m}));return b},aO}var Oq=gq();const uO=zd(Oq);function lx(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function yq(){const n=[],e={run:t,use:r};return e;function t(...i){let s=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...i);function o(u,...h){const f=n[++s];let p=-1;if(u){l(u);return}for(;++p<i.length;)(h[p]===null||h[p]===void 0)&&(h[p]=i[p]);i=h,f?xq(f,o)(...h):l(null,...h)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return n.push(i),e}}function xq(n,e){let t;return r;function r(...l){const o=n.length>l.length;let u;o&&l.push(i);try{u=n.apply(this,l)}catch(h){const f=h;if(o&&t)throw f;return i(f)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(l,...o){t||(t=!0,e(l,...o))}function s(l){i(null,l)}}const ii={basename:kq,dirname:vq,extname:bq,join:wq,sep:"/"};function kq(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ic(n);let t=0,r=-1,i=n.length,s;if(e===void 0||e.length===0||e.length>n.length){for(;i--;)if(n.codePointAt(i)===47){if(s){t=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":n.slice(t,r)}if(e===n)return"";let l=-1,o=e.length-1;for(;i--;)if(n.codePointAt(i)===47){if(s){t=i+1;break}}else l<0&&(s=!0,l=i+1),o>-1&&(n.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=l));return t===r?r=l:r<0&&(r=n.length),n.slice(t,r)}function vq(n){if(Ic(n),n.length===0)return".";let e=-1,t=n.length,r;for(;--t;)if(n.codePointAt(t)===47){if(r){e=t;break}}else r||(r=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function bq(n){Ic(n);let e=n.length,t=-1,r=0,i=-1,s=0,l;for(;e--;){const o=n.codePointAt(e);if(o===47){if(l){r=e+1;break}continue}t<0&&(l=!0,t=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||t<0||s===0||s===1&&i===t-1&&i===r+1?"":n.slice(i,t)}function wq(...n){let e=-1,t;for(;++e<n.length;)Ic(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":Sq(t)}function Sq(n){Ic(n);const e=n.codePointAt(0)===47;let t=Pq(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function Pq(n,e){let t="",r=0,i=-1,s=0,l=-1,o,u;for(;++l<=n.length;){if(l<n.length)o=n.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||s===1))if(i!==l-1&&s===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=l,s=0;continue}}else if(t.length>0){t="",r=0,i=l,s=0;continue}}e&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+n.slice(i+1,l):t=n.slice(i+1,l),r=l-i-1;i=l,s=0}else o===46&&s>-1?s++:s=-1}return t}function Ic(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Cq={cwd:Qq};function Qq(){return"/"}function ox(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function $q(n){if(typeof n=="string")n=new URL(n);else if(!ox(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Tq(n)}function Tq(n){if(n.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const r=e.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const cO=["history","path","basename","stem","extname","dirname"];class qj{constructor(e){let t;e?ox(e)?t={path:e}:typeof e=="string"||jq(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":Cq.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cO.length;){const s=cO[r];s in t&&t[s]!==void 0&&t[s]!==null&&(this[s]=s==="history"?[...t[s]]:t[s])}let i;for(i in t)cO.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ii.basename(this.path):void 0}set basename(e){fO(e,"basename"),hO(e,"basename"),this.path=ii.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ii.dirname(this.path):void 0}set dirname(e){$P(this.basename,"dirname"),this.path=ii.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ii.extname(this.path):void 0}set extname(e){if(hO(e,"extname"),$P(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ii.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ox(e)&&(e=$q(e)),fO(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ii.basename(this.path,this.extname):void 0}set stem(e){fO(e,"stem"),hO(e,"stem"),this.path=ii.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){const i=this.message(e,t,r);throw i.fatal=!0,i}info(e,t,r){const i=this.message(e,t,r);return i.fatal=void 0,i}message(e,t,r){const i=new yn(e,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function hO(n,e){if(n&&n.includes(ii.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ii.sep+"`")}function fO(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function $P(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function jq(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Eq=(function(n){const r=this.constructor.prototype,i=r[n],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Mq={}.hasOwnProperty;class B0 extends Eq{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=yq()}copy(){const e=new B0;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];e.use(...r)}return e.data(uO(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(mO("data",this.frozen),this.namespace[e]=t,this):Mq.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mO("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=$f(e),r=this.parser||this.Parser;return dO("parse",r),r(String(t),t)}process(e,t){const r=this;return this.freeze(),dO("process",this.parser||this.Parser),pO("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(s,l){const o=$f(e),u=r.parse(o);r.run(u,o,function(f,p,m){if(f||!p||!m)return h(f);const y=p,k=r.stringify(y,m);Nq(k)?m.value=k:m.result=k,h(f,m)});function h(f,p){f||!p?l(f):s?s(p):t(void 0,p)}}}processSync(e){let t=!1,r;return this.freeze(),dO("processSync",this.parser||this.Parser),pO("processSync",this.compiler||this.Compiler),this.process(e,i),jP("processSync","process",t),r;function i(s,l){t=!0,CP(s),r=l}}run(e,t,r){TP(e),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?s(void 0,r):new Promise(s);function s(l,o){const u=$f(t);i.run(e,u,h);function h(f,p,m){const y=p||e;f?o(f):l?l(y):r(void 0,y,m)}}}runSync(e,t){let r=!1,i;return this.run(e,t,s),jP("runSync","run",r),i;function s(l,o){CP(l),i=o,r=!0}}stringify(e,t){this.freeze();const r=$f(t),i=this.compiler||this.Compiler;return pO("stringify",i),TP(e),i(e,r)}use(e,...t){const r=this.attachers,i=this.namespace;if(mO("use",this.frozen),e!=null)if(typeof e=="function")u(e,t);else if(typeof e=="object")Array.isArray(e)?o(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(h){if(typeof h=="function")u(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[f,...p]=h;u(f,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new 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(h.plugins),h.settings&&(i.settings=uO(!0,i.settings,h.settings))}function o(h){let f=-1;if(h!=null)if(Array.isArray(h))for(;++f<h.length;){const p=h[f];s(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function u(h,f){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===h){m=p;break}if(m===-1)r.push([h,...f]);else if(f.length>0){let[y,...k]=f;const b=r[m][1];lx(b)&&lx(y)&&(y=uO(!0,b,y)),r[m]=[h,y,...k]}}}}const Aq=new B0().freeze();function dO(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function pO(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function mO(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function TP(n){if(!lx(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function jP(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function $f(n){return Rq(n)?n:new qj(n)}function Rq(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Nq(n){return typeof n=="string"||Lq(n)}function Lq(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const _q="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",EP=[],MP={allowDangerousHtml:!0},Dq=/^(https?|ircs?|mailto|xmpp)$/i,Iq=[{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:"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 Vj(n){const e=zq(n),t=Zq(n);return Xq(e.runSync(e.parse(t),t),n)}function zq(n){const e=n.rehypePlugins||EP,t=n.remarkPlugins||EP,r=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...MP}:MP;return Aq().use(k9).use(t).use(mq,r).use(e)}function Zq(n){const e=n.children||"",t=new qj;return typeof e=="string"&&(t.value=e),t}function Xq(n,e){const t=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,l=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||Bq;for(const f of Iq)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+_q+f.id,void 0);return e.className&&(n={type:"element",tagName:"div",properties:{className:e.className},children:n.type==="root"?n.children:[n]}),X0(n,h),r7(n,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function h(f,p,m){if(f.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:f.value},p;if(f.type==="element"){let y;for(y in sO)if(Object.hasOwn(sO,y)&&Object.hasOwn(f.properties,y)){const k=f.properties[y],b=sO[y];(b===null||b.includes(f.tagName))&&(f.properties[y]=u(String(k||""),y,f))}}if(f.type==="element"){let y=t?!t.includes(f.tagName):s?s.includes(f.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(f,p,m)),y&&m&&typeof p=="number")return o&&f.children?m.children.splice(p,1,...f.children):m.children.splice(p,1),p}}}function Bq(n){const e=n.indexOf(":"),t=n.indexOf("?"),r=n.indexOf("#"),i=n.indexOf("/");return e===-1||i!==-1&&e>i||t!==-1&&e>t||r!==-1&&e>r||Dq.test(n.slice(0,e))?n:""}function AP(n,e){const t=String(n);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(e);for(;i!==-1;)r++,i=t.indexOf(e,i+e.length);return r}function Wq(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qq(n,e,t){const i=hp((t||{}).ignore||[]),s=Vq(e);let l=-1;for(;++l<s.length;)Wj(n,"text",o);function o(h,f){let p=-1,m;for(;++p<f.length;){const y=f[p],k=m?m.children:void 0;if(i(y,k?k.indexOf(y):void 0,m))return;m=y}if(m)return u(h,f)}function u(h,f){const p=f[f.length-1],m=s[l][0],y=s[l][1];let k=0;const w=p.children.indexOf(h);let S=!1,Q=[];m.lastIndex=0;let $=m.exec(h.value);for(;$;){const A=$.index,I={index:$.index,input:$.input,stack:[...f,h]};let T=y(...$,I);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?m.lastIndex=A+1:(k!==A&&Q.push({type:"text",value:h.value.slice(k,A)}),Array.isArray(T)?Q.push(...T):T&&Q.push(T),k=A+$[0].length,S=!0),!m.global)break;$=m.exec(h.value)}return S?(k<h.value.length&&Q.push({type:"text",value:h.value.slice(k)}),p.children.splice(w,1,...Q)):Q=[h],w+Q.length}}function Vq(n){const e=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!n[0]||Array.isArray(n[0])?n:[n];let r=-1;for(;++r<t.length;){const i=t[r];e.push([Fq(i[0]),Yq(i[1])])}return e}function Fq(n){return typeof n=="string"?new RegExp(Wq(n),"g"):n}function Yq(n){return typeof n=="function"?n:function(){return n}}const gO="phrasing",OO=["autolink","link","image","label"];function Uq(){return{transforms:[nV],enter:{literalAutolink:Hq,literalAutolinkEmail:yO,literalAutolinkHttp:yO,literalAutolinkWww:yO},exit:{literalAutolink:tV,literalAutolinkEmail:eV,literalAutolinkHttp:Kq,literalAutolinkWww:Jq}}}function Gq(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gO,notInConstruct:OO},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gO,notInConstruct:OO},{character:":",before:"[ps]",after:"\\/",inConstruct:gO,notInConstruct:OO}]}}function Hq(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function yO(n){this.config.enter.autolinkProtocol.call(this,n)}function Kq(n){this.config.exit.autolinkProtocol.call(this,n)}function Jq(n){this.config.exit.data.call(this,n);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(n)}function eV(n){this.config.exit.autolinkEmail.call(this,n)}function tV(n){this.exit(n)}function nV(n){qq(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rV],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),iV]],{ignore:["link","linkReference"]})}function rV(n,e,t,r,i){let s="";if(!Fj(i)||(/^w/i.test(e)&&(t=e+t,e="",s="http://"),!sV(t)))return!1;const l=lV(t+r);if(!l[0])return!1;const o={type:"link",title:null,url:s+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function iV(n,e,t,r){return!Fj(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+t,children:[{type:"text",value:e+"@"+t}]}}function sV(n){const e=n.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function lV(n){const e=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!e)return[n,void 0];n=n.slice(0,e.index);let t=e[0],r=t.indexOf(")");const i=AP(n,"(");let s=AP(n,")");for(;r!==-1&&i>s;)n+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),s++;return[n,t]}function Fj(n,e){const t=n.input.charCodeAt(n.index-1);return(n.index===0||zl(t)||ap(t))&&(!e||t!==47)}Yj.peek=mV;function oV(){this.buffer()}function aV(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function uV(){this.buffer()}function cV(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function hV(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=zr(this.sliceSerialize(n)).toLowerCase(),t.label=e}function fV(n){this.exit(n)}function dV(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=zr(this.sliceSerialize(n)).toLowerCase(),t.label=e}function pV(n){this.exit(n)}function mV(){return"["}function Yj(n,e,t,r){const i=t.createTracker(r);let s=i.move("[^");const l=t.enter("footnoteReference"),o=t.enter("reference");return s+=i.move(t.safe(t.associationId(n),{after:"]",before:s})),o(),l(),s+=i.move("]"),s}function gV(){return{enter:{gfmFootnoteCallString:oV,gfmFootnoteCall:aV,gfmFootnoteDefinitionLabelString:uV,gfmFootnoteDefinition:cV},exit:{gfmFootnoteCallString:hV,gfmFootnoteCall:fV,gfmFootnoteDefinitionLabelString:dV,gfmFootnoteDefinition:pV}}}function OV(n){let e=!1;return n&&n.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:t,footnoteReference:Yj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,s,l){const o=s.createTracker(l);let u=o.move("[^");const h=s.enter("footnoteDefinition"),f=s.enter("label");return u+=o.move(s.safe(s.associationId(r),{before:u,after:"]"})),f(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((e?`
449
449
  `:" ")+s.indentLines(s.containerFlow(r,o.current()),e?Uj:yV))),h(),u}}function yV(n,e,t){return e===0?n:Uj(n,e,t)}function Uj(n,e,t){return(t?"":" ")+n}const xV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Gj.peek=SV;function kV(){return{canContainEols:["delete"],enter:{strikethrough:bV},exit:{strikethrough:wV}}}function vV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xV}],handlers:{delete:Gj}}}function bV(n){this.enter({type:"delete",children:[]},n)}function wV(n){this.exit(n)}function Gj(n,e,t,r){const i=t.createTracker(r),s=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(n,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),s(),l}function SV(){return"~"}function PV(n){return n.length}function CV(n,e){const t=e||{},r=(t.align||[]).concat(),i=t.stringLength||PV,s=[],l=[],o=[],u=[];let h=0,f=-1;for(;++f<n.length;){const b=[],w=[];let S=-1;for(n[f].length>h&&(h=n[f].length);++S<n[f].length;){const Q=QV(n[f][S]);if(t.alignDelimiters!==!1){const $=i(Q);w[S]=$,(u[S]===void 0||$>u[S])&&(u[S]=$)}b.push(Q)}l[f]=b,o[f]=w}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)s[p]=RP(r[p]);else{const b=RP(r);for(;++p<h;)s[p]=b}p=-1;const m=[],y=[];for(;++p<h;){const b=s[p];let w="",S="";b===99?(w=":",S=":"):b===108?w=":":b===114&&(S=":");let Q=t.alignDelimiters===!1?1:Math.max(1,u[p]-w.length-S.length);const $=w+"-".repeat(Q)+S;t.alignDelimiters!==!1&&(Q=w.length+Q+S.length,Q>u[p]&&(u[p]=Q),y[p]=Q),m[p]=$}l.splice(1,0,m),o.splice(1,0,y),f=-1;const k=[];for(;++f<l.length;){const b=l[f],w=o[f];p=-1;const S=[];for(;++p<h;){const Q=b[p]||"";let $="",A="";if(t.alignDelimiters!==!1){const I=u[p]-(w[p]||0),T=s[p];T===114?$=" ".repeat(I):T===99?I%2?($=" ".repeat(I/2+.5),A=" ".repeat(I/2-.5)):($=" ".repeat(I/2),A=$):A=" ".repeat(I)}t.delimiterStart!==!1&&!p&&S.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&Q==="")&&(t.delimiterStart!==!1||p)&&S.push(" "),t.alignDelimiters!==!1&&S.push($),S.push(Q),t.alignDelimiters!==!1&&S.push(A),t.padding!==!1&&S.push(" "),(t.delimiterEnd!==!1||p!==h-1)&&S.push("|")}k.push(t.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return k.join(`
450
450
  `)}function QV(n){return n==null?"":String(n)}function RP(n){const e=typeof n=="string"?n.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function $V(n,e,t,r){const i=t.enter("blockquote"),s=t.createTracker(r);s.move("> "),s.shift(2);const l=t.indentLines(t.containerFlow(n,s.current()),TV);return i(),l}function TV(n,e,t){return">"+(t?"":" ")+n}function jV(n,e){return NP(n,e.inConstruct,!0)&&!NP(n,e.notInConstruct,!1)}function NP(n,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let r=-1;for(;++r<e.length;)if(n.includes(e[r]))return!0;return!1}function LP(n,e,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
451
451
  `&&jV(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
@@ -461,8 +461,8 @@ Error generating stack: `+v.message+`
461
461
  `,...s.current()});return/^[\t ]/.test(h)&&(h=xc(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,t.options.closeAtx&&(h+=" "+l),u(),o(),h}Kj.peek=ZV;function Kj(n){return n.value||""}function ZV(){return"<"}Jj.peek=XV;function Jj(n,e,t,r){const i=W0(t),s=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let o=t.enter("label");const u=t.createTracker(r);let h=u.move("![");return h+=u.move(t.safe(n.alt,{before:h,after:"]",...u.current()})),h+=u.move("]("),o(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(o=t.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(t.safe(n.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(o=t.enter("destinationRaw"),h+=u.move(t.safe(n.url,{before:h,after:n.title?" ":")",...u.current()}))),o(),n.title&&(o=t.enter(`title${s}`),h+=u.move(" "+i),h+=u.move(t.safe(n.title,{before:h,after:i,...u.current()})),h+=u.move(i),o()),h+=u.move(")"),l(),h}function XV(){return"!"}eE.peek=BV;function eE(n,e,t,r){const i=n.referenceType,s=t.enter("imageReference");let l=t.enter("label");const o=t.createTracker(r);let u=o.move("![");const h=t.safe(n.alt,{before:u,after:"]",...o.current()});u+=o.move(h+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const p=t.safe(t.associationId(n),{before:u,after:"]",...o.current()});return l(),t.stack=f,s(),i==="full"||!h||h!==p?u+=o.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function BV(){return"!"}tE.peek=WV;function tE(n,e,t){let r=n.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<t.unsafe.length;){const l=t.unsafe[s],o=t.compilePattern(l);let u;if(l.atBreak)for(;u=o.exec(r);){let h=u.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(u.index+1)}}return i+r+i}function WV(){return"`"}function nE(n,e){const t=N0(n);return!!(!e.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(t===n.url||"mailto:"+t===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}rE.peek=qV;function rE(n,e,t,r){const i=W0(t),s=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let o,u;if(nE(n,t)){const f=t.stack;t.stack=[],o=t.enter("autolink");let p=l.move("<");return p+=l.move(t.containerPhrasing(n,{before:p,after:">",...l.current()})),p+=l.move(">"),o(),t.stack=f,p}o=t.enter("link"),u=t.enter("label");let h=l.move("[");return h+=l.move(t.containerPhrasing(n,{before:h,after:"](",...l.current()})),h+=l.move("]("),u(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(u=t.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(t.safe(n.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(u=t.enter("destinationRaw"),h+=l.move(t.safe(n.url,{before:h,after:n.title?" ":")",...l.current()}))),u(),n.title&&(u=t.enter(`title${s}`),h+=l.move(" "+i),h+=l.move(t.safe(n.title,{before:h,after:i,...l.current()})),h+=l.move(i),u()),h+=l.move(")"),o(),h}function qV(n,e,t){return nE(n,t)?"<":"["}iE.peek=VV;function iE(n,e,t,r){const i=n.referenceType,s=t.enter("linkReference");let l=t.enter("label");const o=t.createTracker(r);let u=o.move("[");const h=t.containerPhrasing(n,{before:u,after:"]",...o.current()});u+=o.move(h+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const p=t.safe(t.associationId(n),{before:u,after:"]",...o.current()});return l(),t.stack=f,s(),i==="full"||!h||h!==p?u+=o.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function VV(){return"["}function q0(n){const e=n.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function FV(n){const e=q0(n),t=n.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function YV(n){const e=n.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function sE(n){const e=n.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function UV(n,e,t,r){const i=t.enter("list"),s=t.bulletCurrent;let l=n.ordered?YV(t):q0(t);const o=n.ordered?l==="."?")":".":FV(t);let u=e&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!n.ordered){const f=n.children?n.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),sE(t)===l&&f){let p=-1;for(;++p<n.children.length;){const m=n.children[p];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=o),t.bulletCurrent=l;const h=t.containerFlow(n,r);return t.bulletLastUsed=l,t.bulletCurrent=s,i(),h}function GV(n){const e=n.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function HV(n,e,t,r){const i=GV(t);let s=t.bulletCurrent||q0(t);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(n))+s);let l=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||n.spread))&&(l=Math.ceil(l/4)*4);const o=t.createTracker(r);o.move(s+" ".repeat(l-s.length)),o.shift(l);const u=t.enter("listItem"),h=t.indentLines(t.containerFlow(n,o.current()),f);return u(),h;function f(p,m,y){return m?(y?"":" ".repeat(l))+p:(y?s:s+" ".repeat(l-s.length))+p}}function KV(n,e,t,r){const i=t.enter("paragraph"),s=t.enter("phrasing"),l=t.containerPhrasing(n,r);return s(),i(),l}const JV=hp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function e8(n,e,t,r){return(n.children.some(function(l){return JV(l)})?t.containerPhrasing:t.containerFlow).call(t,n,r)}function t8(n){const e=n.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}lE.peek=n8;function lE(n,e,t,r){const i=t8(t),s=t.enter("strong"),l=t.createTracker(r),o=l.move(i+i);let u=l.move(t.containerPhrasing(n,{after:i,before:o,...l.current()}));const h=u.charCodeAt(0),f=Nd(r.before.charCodeAt(r.before.length-1),h,i);f.inside&&(u=xc(h)+u.slice(1));const p=u.charCodeAt(u.length-1),m=Nd(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+xc(p));const y=l.move(i+i);return s(),t.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},o+u+y}function n8(n,e,t){return t.options.strong||"*"}function r8(n,e,t,r){return t.safe(n.value,r)}function i8(n){const e=n.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function s8(n,e,t){const r=(sE(t)+(t.options.ruleSpaces?" ":"")).repeat(i8(t));return t.options.ruleSpaces?r.slice(0,-1):r}const oE={blockquote:$V,break:LP,code:RV,definition:LV,emphasis:Hj,hardBreak:LP,heading:zV,html:Kj,image:Jj,imageReference:eE,inlineCode:tE,link:rE,linkReference:iE,list:UV,listItem:HV,paragraph:KV,root:e8,strong:lE,text:r8,thematicBreak:s8};function l8(){return{enter:{table:o8,tableData:_P,tableHeader:_P,tableRow:u8},exit:{codeText:c8,table:a8,tableData:xO,tableHeader:xO,tableRow:xO}}}function o8(n){const e=n._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},n),this.data.inTable=!0}function a8(n){this.exit(n),this.data.inTable=void 0}function u8(n){this.enter({type:"tableRow",children:[]},n)}function xO(n){this.exit(n)}function _P(n){this.enter({type:"tableCell",children:[]},n)}function c8(n){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,h8));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(n)}function h8(n,e){return e==="|"?e:n}function f8(n){const e=n||{},t=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
462
462
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:l,tableCell:u,tableRow:o}};function l(y,k,b,w){return h(f(y,b,w),y.align)}function o(y,k,b,w){const S=p(y,b,w),Q=h([S]);return Q.slice(0,Q.indexOf(`
463
463
  `))}function u(y,k,b,w){const S=b.enter("tableCell"),Q=b.enter("phrasing"),$=b.containerPhrasing(y,{...w,before:s,after:s});return Q(),S(),$}function h(y,k){return CV(y,{align:k,alignDelimiters:r,padding:t,stringLength:i})}function f(y,k,b){const w=y.children;let S=-1;const Q=[],$=k.enter("table");for(;++S<w.length;)Q[S]=p(w[S],k,b);return $(),Q}function p(y,k,b){const w=y.children;let S=-1;const Q=[],$=k.enter("tableRow");for(;++S<w.length;)Q[S]=u(w[S],y,k,b);return $(),Q}function m(y,k,b){let w=oE.inlineCode(y,k,b);return b.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function d8(){return{exit:{taskListCheckValueChecked:DP,taskListCheckValueUnchecked:DP,paragraph:m8}}}function p8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:g8}}}function DP(n){const e=this.stack[this.stack.length-2];e.type,e.checked=n.type==="taskListCheckValueChecked"}function m8(n){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,l;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){l=o;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(n)}function g8(n,e,t,r){const i=n.children[0],s=typeof n.checked=="boolean"&&i&&i.type==="paragraph",l="["+(n.checked?"x":" ")+"] ",o=t.createTracker(r);s&&o.move(l);let u=oE.listItem(n,e,t,{...r,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),u;function h(f){return f+l}}function O8(){return[Uq(),gV(),kV(),l8(),d8()]}function y8(n){return{extensions:[Gq(),OV(n),vV(),f8(n),p8()]}}const x8={tokenize:P8,partial:!0},aE={tokenize:C8,partial:!0},uE={tokenize:Q8,partial:!0},cE={tokenize:$8,partial:!0},k8={tokenize:T8,partial:!0},hE={name:"wwwAutolink",tokenize:w8,previous:dE},fE={name:"protocolAutolink",tokenize:S8,previous:pE},Ui={name:"emailAutolink",tokenize:b8,previous:mE},bi={};function v8(){return{text:bi}}let fl=48;for(;fl<123;)bi[fl]=Ui,fl++,fl===58?fl=65:fl===91&&(fl=97);bi[43]=Ui;bi[45]=Ui;bi[46]=Ui;bi[95]=Ui;bi[72]=[Ui,fE];bi[104]=[Ui,fE];bi[87]=[Ui,hE];bi[119]=[Ui,hE];function b8(n,e,t){const r=this;let i,s;return l;function l(p){return!ax(p)||!mE.call(r,r.previous)||V0(r.events)?t(p):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(p))}function o(p){return ax(p)?(n.consume(p),o):p===64?(n.consume(p),u):t(p)}function u(p){return p===46?n.check(k8,f,h)(p):p===45||p===95||mn(p)?(s=!0,n.consume(p),u):f(p)}function h(p){return n.consume(p),i=!0,u}function f(p){return s&&i&&Sn(r.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),e(p)):t(p)}}function w8(n,e,t){const r=this;return i;function i(l){return l!==87&&l!==119||!dE.call(r,r.previous)||V0(r.events)?t(l):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(x8,n.attempt(aE,n.attempt(uE,s),t),t)(l))}function s(l){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),e(l)}}function S8(n,e,t){const r=this;let i="",s=!1;return l;function l(p){return(p===72||p===104)&&pE.call(r,r.previous)&&!V0(r.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),n.consume(p),o):t(p)}function o(p){if(Sn(p)&&i.length<5)return i+=String.fromCodePoint(p),n.consume(p),o;if(p===58){const m=i.toLowerCase();if(m==="http"||m==="https")return n.consume(p),u}return t(p)}function u(p){return p===47?(n.consume(p),s?h:(s=!0,u)):t(p)}function h(p){return p===null||Md(p)||ft(p)||zl(p)||ap(p)?t(p):n.attempt(aE,n.attempt(uE,f),t)(p)}function f(p){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),e(p)}}function P8(n,e,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,n.consume(l),i):l===46&&r===3?(n.consume(l),s):t(l)}function s(l){return l===null?t(l):e(l)}}function C8(n,e,t){let r,i,s;return l;function l(h){return h===46||h===95?n.check(cE,u,o)(h):h===null||ft(h)||zl(h)||h!==45&&ap(h)?u(h):(s=!0,n.consume(h),l)}function o(h){return h===95?r=!0:(i=r,r=void 0),n.consume(h),l}function u(h){return i||r||!s?t(h):e(h)}}function Q8(n,e){let t=0,r=0;return i;function i(l){return l===40?(t++,n.consume(l),i):l===41&&r<t?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?n.check(cE,e,s)(l):l===null||ft(l)||zl(l)?e(l):(n.consume(l),i)}function s(l){return l===41&&r++,n.consume(l),i}}function $8(n,e,t){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?(n.consume(o),r):o===38?(n.consume(o),s):o===93?(n.consume(o),i):o===60||o===null||ft(o)||zl(o)?e(o):t(o)}function i(o){return o===null||o===40||o===91||ft(o)||zl(o)?e(o):r(o)}function s(o){return Sn(o)?l(o):t(o)}function l(o){return o===59?(n.consume(o),r):Sn(o)?(n.consume(o),l):t(o)}}function T8(n,e,t){return r;function r(s){return n.consume(s),i}function i(s){return mn(s)?t(s):e(s)}}function dE(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ft(n)}function pE(n){return!Sn(n)}function mE(n){return!(n===47||ax(n))}function ax(n){return n===43||n===45||n===46||n===95||mn(n)}function V0(n){let e=n.length,t=!1;for(;e--;){const r=n[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return n.length>0&&!t&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const j8={tokenize:D8,partial:!0};function E8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:N8,continuation:{tokenize:L8},exit:_8}},text:{91:{name:"gfmFootnoteCall",tokenize:R8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:M8,resolveTo:A8}}}}function M8(n,e,t){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!l||!l._balanced)return t(u);const h=zr(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!s.includes(h.slice(1))?t(u):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),e(u))}}function A8(n,e){let t=n.length;for(;t--;)if(n[t][1].type==="labelImage"&&n[t][0]==="enter"){n[t][1];break}n[t+1][1].type="data",n[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},n[t+3][1].start),end:Object.assign({},n[n.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},n[t+3][1].end),end:Object.assign({},n[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},n[n.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[n[t+1],n[t+2],["enter",r,e],n[t+3],n[t+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",l,e],["exit",l,e],["exit",s,e],n[n.length-2],n[n.length-1],["exit",r,e]];return n.splice(t,n.length-t+1,...o),n}function R8(n,e,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return o;function o(p){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?t(p):(n.enter("gfmFootnoteCallMarker"),n.consume(p),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(p){if(s>999||p===93&&!l||p===null||p===91||ft(p))return t(p);if(p===93){n.exit("chunkString");const m=n.exit("gfmFootnoteCallString");return i.includes(zr(r.sliceSerialize(m)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),e):t(p)}return ft(p)||(l=!0),s++,n.consume(p),p===92?f:h}function f(p){return p===91||p===92||p===93?(n.consume(p),s++,h):h(p)}}function N8(n,e,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,o;return u;function u(k){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",f):t(k)}function f(k){if(l>999||k===93&&!o||k===null||k===91||ft(k))return t(k);if(k===93){n.exit("chunkString");const b=n.exit("gfmFootnoteDefinitionLabelString");return s=zr(r.sliceSerialize(b)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),m}return ft(k)||(o=!0),l++,n.consume(k),k===92?p:f}function p(k){return k===91||k===92||k===93?(n.consume(k),l++,f):f(k)}function m(k){return k===58?(n.enter("definitionMarker"),n.consume(k),n.exit("definitionMarker"),i.includes(s)||i.push(s),Ge(n,y,"gfmFootnoteDefinitionWhitespace")):t(k)}function y(k){return e(k)}}function L8(n,e,t){return n.check(Dc,e,n.attempt(j8,e,t))}function _8(n){n.exit("gfmFootnoteDefinition")}function D8(n,e,t){const r=this;return Ge(n,i,"gfmFootnoteDefinitionIndent",5);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(s):t(s)}}function I8(n){let t=(n||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,o){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let h=u;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[u][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[u][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[u][1].start)},m=[["enter",f,o],["enter",l[h][1],o],["exit",l[h][1],o],["enter",p,o]],y=o.parser.constructs.insideSpan.null;y&&ur(m,m.length,0,up(y,l.slice(h+1,u),o)),ur(m,m.length,0,[["exit",p,o],["enter",l[u][1],o],["exit",l[u][1],o],["exit",f,o]]),ur(l,h-1,u-h+3,m),u=h+m.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function s(l,o,u){const h=this.previous,f=this.events;let p=0;return m;function m(k){return h===126&&f[f.length-1][1].type!=="characterEscape"?u(k):(l.enter("strikethroughSequenceTemporary"),y(k))}function y(k){const b=ca(h);if(k===126)return p>1?u(k):(l.consume(k),p++,y);if(p<2&&!t)return u(k);const w=l.exit("strikethroughSequenceTemporary"),S=ca(k);return w._open=!S||S===2&&!!b,w._close=!b||b===2&&!!S,o(k)}}}class z8{constructor(){this.map=[]}add(e,t,r){Z8(this,e,t,r)}consume(e){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function Z8(n,e,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i<n.map.length;){if(n.map[i][0]===e){n.map[i][1]+=t,n.map[i][2].push(...r);return}i+=1}n.map.push([e,t,r])}}function X8(n,e){let t=!1;const r=[];for(;e<n.length;){const i=n[e];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(n[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(n[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);e+=1}return r}function B8(){return{flow:{null:{name:"table",tokenize:W8,resolveAll:q8}}}}function W8(n,e,t){const r=this;let i=0,s=0,l;return o;function o(_){let G=r.events.length-1;for(;G>-1;){const J=r.events[G][1].type;if(J==="lineEnding"||J==="linePrefix")G--;else break}const F=G>-1?r.events[G][1].type:null,le=F==="tableHead"||F==="tableRow"?T:u;return le===T&&r.parser.lazy[r.now().line]?t(_):le(_)}function u(_){return n.enter("tableHead"),n.enter("tableRow"),h(_)}function h(_){return _===124||(l=!0,s+=1),f(_)}function f(_){return _===null?t(_):Ee(_)?s>1?(s=0,r.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),y):t(_):We(_)?Ge(n,f,"whitespace")(_):(s+=1,l&&(l=!1,i+=1),_===124?(n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),l=!0,f):(n.enter("data"),p(_)))}function p(_){return _===null||_===124||ft(_)?(n.exit("data"),f(_)):(n.consume(_),_===92?m:p)}function m(_){return _===92||_===124?(n.consume(_),p):p(_)}function y(_){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(_):(n.enter("tableDelimiterRow"),l=!1,We(_)?Ge(n,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):k(_))}function k(_){return _===45||_===58?w(_):_===124?(l=!0,n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),b):I(_)}function b(_){return We(_)?Ge(n,w,"whitespace")(_):w(_)}function w(_){return _===58?(s+=1,l=!0,n.enter("tableDelimiterMarker"),n.consume(_),n.exit("tableDelimiterMarker"),S):_===45?(s+=1,S(_)):_===null||Ee(_)?A(_):I(_)}function S(_){return _===45?(n.enter("tableDelimiterFiller"),Q(_)):I(_)}function Q(_){return _===45?(n.consume(_),Q):_===58?(l=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(_),n.exit("tableDelimiterMarker"),$):(n.exit("tableDelimiterFiller"),$(_))}function $(_){return We(_)?Ge(n,A,"whitespace")(_):A(_)}function A(_){return _===124?k(_):_===null||Ee(_)?!l||i!==s?I(_):(n.exit("tableDelimiterRow"),n.exit("tableHead"),e(_)):I(_)}function I(_){return t(_)}function T(_){return n.enter("tableRow"),X(_)}function X(_){return _===124?(n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),X):_===null||Ee(_)?(n.exit("tableRow"),e(_)):We(_)?Ge(n,X,"whitespace")(_):(n.enter("data"),z(_))}function z(_){return _===null||_===124||ft(_)?(n.exit("data"),X(_)):(n.consume(_),_===92?K:z)}function K(_){return _===92||_===124?(n.consume(_),z):z(_)}}function q8(n,e){let t=-1,r=!0,i=0,s=[0,0,0,0],l=[0,0,0,0],o=!1,u=0,h,f,p;const m=new z8;for(;++t<n.length;){const y=n[t],k=y[1];y[0]==="enter"?k.type==="tableHead"?(o=!1,u!==0&&(IP(m,e,u,h,f),f=void 0,u=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},m.add(t,0,[["enter",h,e]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,p=void 0,s=[0,0,0,0],l=[0,t+1,0,0],o&&(o=!1,f={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},m.add(t,0,[["enter",f,e]])),i=k.type==="tableDelimiterRow"?2:f?3:1):i&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],p=Tf(m,e,s,i,void 0,p),s=[0,0,0,0]),l[2]=t)):k.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(l[0]=l[1],p=Tf(m,e,s,i,void 0,p)),s=l,l=[s[1],t,0,0])):k.type==="tableHead"?(o=!0,u=t):k.type==="tableRow"||k.type==="tableDelimiterRow"?(u=t,s[1]!==0?(l[0]=l[1],p=Tf(m,e,s,i,t,p)):l[1]!==0&&(p=Tf(m,e,l,i,t,p)),i=0):i&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(l[3]=t)}for(u!==0&&IP(m,e,u,h,f),m.consume(e.events),t=-1;++t<e.events.length;){const y=e.events[t];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=X8(e.events,t))}return n}function Tf(n,e,t,r,i,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";t[0]!==0&&(s.end=Object.assign({},Co(e.events,t[0])),n.add(t[0],0,[["exit",s,e]]));const u=Co(e.events,t[1]);if(s={type:l,start:Object.assign({},u),end:Object.assign({},u)},n.add(t[1],0,[["enter",s,e]]),t[2]!==0){const h=Co(e.events,t[2]),f=Co(e.events,t[3]),p={type:o,start:Object.assign({},h),end:Object.assign({},f)};if(n.add(t[2],0,[["enter",p,e]]),r!==2){const m=e.events[t[2]],y=e.events[t[3]];if(m[1].end=Object.assign({},y[1].end),m[1].type="chunkText",m[1].contentType="text",t[3]>t[2]+1){const k=t[2]+1,b=t[3]-t[2]-1;n.add(k,b,[])}}n.add(t[3]+1,0,[["exit",p,e]])}return i!==void 0&&(s.end=Object.assign({},Co(e.events,i)),n.add(i,0,[["exit",s,e]]),s=void 0),s}function IP(n,e,t,r,i){const s=[],l=Co(e.events,t);i&&(i.end=Object.assign({},l),s.push(["exit",i,e])),r.end=Object.assign({},l),s.push(["exit",r,e]),n.add(t+1,0,s)}function Co(n,e){const t=n[e],r=t[0]==="enter"?"start":"end";return t[1][r]}const V8={name:"tasklistCheck",tokenize:Y8};function F8(){return{text:{91:V8}}}function Y8(n,e,t){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(u):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),s)}function s(u){return ft(u)?(n.enter("taskListCheckValueUnchecked"),n.consume(u),n.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(n.enter("taskListCheckValueChecked"),n.consume(u),n.exit("taskListCheckValueChecked"),l):t(u)}function l(u){return u===93?(n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),o):t(u)}function o(u){return Ee(u)?e(u):We(u)?n.check({tokenize:U8},e,t)(u):t(u)}}function U8(n,e,t){return Ge(n,r,"whitespace");function r(i){return i===null?t(i):e(i)}}function G8(n){return Pj([v8(),E8(),I8(n),B8(),F8()])}const H8={};function gE(n){const e=this,t=n||H8,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(G8(t)),s.push(O8()),l.push(y8(t))}const K8="",OE="/login",J8=new Set(["/v1/auth/login","/v1/auth/logout","/v1/auth/whoami","/health"]);function eF(n){if(typeof window>"u"||window.location.pathname===OE)return!1;for(const e of J8)if(n.startsWith(e))return!1;return!0}async function Ve(n,e){const t=new Headers(e==null?void 0:e.headers);(e==null?void 0:e.body)!==void 0&&(e==null?void 0:e.body)!==null&&!t.has("content-type")&&t.set("content-type","application/json");const r=await fetch(`${K8}${n}`,{...e,credentials:"include",headers:t});if(r.status===401&&eF(n)){const i=window.location.pathname+window.location.search;throw window.location.href=`${OE}?next=${encodeURIComponent(i)}`,new Error("unauthenticated")}if(!r.ok){let i="";try{i=await r.text()}catch{}throw new Error(`${(e==null?void 0:e.method)??"GET"} ${n} -> ${r.status} ${i}`)}if(r.status!==204)return await r.json()}const tt={health:()=>Ve("/health"),listProjects:(n={})=>{const e=new URLSearchParams;n.includeArchived&&e.set("includeArchived","true");const t=e.size?`?${e.toString()}`:"";return Ve(`/v1/projects${t}`)},getProject:n=>Ve(`/v1/projects/${n}`),getProjectByKey:n=>Ve(`/v1/projects/by-key/${encodeURIComponent(n)}`),createProject:n=>Ve("/v1/projects",{method:"POST",body:JSON.stringify(n)}),updateProject:(n,e)=>Ve(`/v1/projects/${n}`,{method:"PATCH",body:JSON.stringify(e)}),openingBrief:(n,e=10)=>Ve(`/v1/projects/${n}/opening-brief`,{method:"POST",body:JSON.stringify({recentLimit:e})}),getEntity:n=>Ve(`/v1/entities/${n}`),getEntityByKey:(n,e)=>Ve(`/v1/projects/by-key/${encodeURIComponent(n)}/entities/by-seq/${e}`),createTask:n=>Ve("/v1/tasks",{method:"POST",body:JSON.stringify(n)}),createNote:n=>Ve("/v1/notes",{method:"POST",body:JSON.stringify(n)}),writeEntity:n=>{if(n.kind==="task"){const{kind:r,...i}=n;return Ve("/v1/tasks",{method:"POST",body:JSON.stringify(i)})}const{kind:e,...t}=n;return Ve("/v1/notes",{method:"POST",body:JSON.stringify(t)})},updateEntity:(n,e)=>Ve(`/v1/entities/${n}`,{method:"PATCH",body:JSON.stringify(e)}),deleteEntity:n=>Ve(`/v1/entities/${n}`,{method:"DELETE"}),relatedEntities:n=>Ve(`/v1/entities/${n}/related`),recent:(n={})=>Ve("/v1/recent",{method:"POST",body:JSON.stringify(n)}),search:n=>Ve("/v1/search",{method:"POST",body:JSON.stringify(n)}),getEmbeddingSettings:()=>Ve("/v1/settings/embedding"),updateEmbeddingSettings:n=>Ve("/v1/settings/embedding",{method:"PATCH",body:JSON.stringify(n)}),backfillEmbeddings:n=>Ve("/v1/settings/embedding/backfill",{method:"POST",body:JSON.stringify(n==null?{}:{limit:n})}),getWorkspaceSettings:()=>Ve("/v1/settings/workspace"),updateWorkspaceSettings:n=>Ve("/v1/settings/workspace",{method:"PATCH",body:JSON.stringify(n)}),tasksRange:n=>Ve("/v1/tasks/range",{method:"POST",body:JSON.stringify(n)}),configureRecurrence:(n,e)=>Ve(`/v1/tasks/${n}/recurrence`,{method:"POST",body:JSON.stringify(e)}),getRecurrence:n=>Ve(`/v1/tasks/${n}/recurrence`),skipOccurrence:(n,e)=>Ve(`/v1/tasks/${n}/skip-occurrence`,{method:"POST",body:JSON.stringify(e?{reason:e,actorKind:"human"}:{actorKind:"human"})}),stopRecurrence:(n,e)=>Ve(`/v1/recurrences/${n}/stop`,{method:"POST",body:JSON.stringify(e?{reason:e}:{})}),splitRecurrence:(n,e)=>Ve(`/v1/recurrences/${n}/split`,{method:"POST",body:JSON.stringify(e)}),listTokens:()=>Ve("/v1/tokens"),createToken:n=>Ve("/v1/tokens",{method:"POST",body:JSON.stringify({name:n})}),revokeToken:n=>Ve(`/v1/tokens/${n}`,{method:"DELETE"}),login:n=>Ve("/v1/auth/login",{method:"POST",body:JSON.stringify({password:n})}),logout:()=>Ve("/v1/auth/logout",{method:"POST"}),whoami:()=>Ve("/v1/auth/whoami")},dp=3e4;function tF(){return qn({queryKey:["health"],queryFn:tt.health,staleTime:5*6e4})}function Tr(n={}){const e=!!n.includeArchived;return qn({queryKey:["projects",e],queryFn:()=>tt.listProjects({includeArchived:e})})}function nF(n){return qn({queryKey:["project",n],queryFn:()=>tt.getProject(n),enabled:!!n})}function yE(n){return qn({queryKey:["project","by-key",n],queryFn:()=>tt.getProjectByKey(n),enabled:!!n})}function zP(n){return qn({queryKey:["entity",n],queryFn:()=>tt.getEntity(n),enabled:!!n})}function rF(n){return qn({queryKey:["related",n],queryFn:()=>tt.relatedEntities(n),enabled:!!n})}function iF(n,e={}){return qn({queryKey:["recent",n],queryFn:()=>tt.recent(n),refetchInterval:e.poll===!1?!1:dp})}function F0(n,e,t={}){return qn({queryKey:["entity-list",n,e],queryFn:()=>tt.recent({projectId:n??null,kinds:e??null,limit:100}),enabled:!!n,refetchInterval:t.poll===!1?!1:dp})}function xE(n){return qn({queryKey:["search",n],queryFn:()=>tt.search(n),enabled:!!(n&&n.query.length>0)})}function sF(){return qn({queryKey:["settings","embedding"],queryFn:tt.getEmbeddingSettings,refetchInterval:dp})}function lF(){const n=sn();return Qn({mutationFn:e=>tt.updateEmbeddingSettings(e),onSuccess:e=>{n.setQueryData(["settings","embedding"],e),n.invalidateQueries({queryKey:["health"]})}})}function oF(){const n=sn();return Qn({mutationFn:e=>tt.backfillEmbeddings(e),onSuccess:e=>{n.setQueryData(["settings","embedding"],e.settings)}})}function aF(){return qn({queryKey:["settings","workspace"],queryFn:tt.getWorkspaceSettings})}function uF(){const n=sn();return Qn({mutationFn:e=>tt.updateWorkspaceSettings(e),onSuccess:e=>{n.setQueryData(["settings","workspace"],e)}})}function Qa(n,e={}){return qn({queryKey:["tasks-range",n],queryFn:()=>tt.tasksRange(n),refetchInterval:e.poll===!1?!1:dp})}function cF(n){return qn({queryKey:["recurrence",n],queryFn:()=>tt.getRecurrence(n),enabled:!!n,retry:!1})}function kE(){const n=sn();return Qn({mutationFn:({taskId:e,input:t})=>tt.configureRecurrence(e,t),onSuccess:e=>{n.invalidateQueries({queryKey:["entity",e.currentOccurrenceId??void 0]}),n.invalidateQueries({queryKey:["recurrence"]}),n.invalidateQueries({queryKey:["tasks-range"]}),n.invalidateQueries({queryKey:["recent"]}),n.invalidateQueries({queryKey:["entity-list"]})}})}function hF(){const n=sn();return Qn({mutationFn:({taskId:e,reason:t})=>tt.skipOccurrence(e,t),onSuccess:e=>{n.invalidateQueries({queryKey:["entity",e.skipped.id]}),e.next&&n.invalidateQueries({queryKey:["entity",e.next.id]}),n.invalidateQueries({queryKey:["recurrence"]}),n.invalidateQueries({queryKey:["tasks-range"]}),n.invalidateQueries({queryKey:["recent"]}),n.invalidateQueries({queryKey:["entity-list"]})}})}function fF(){const n=sn();return Qn({mutationFn:({ruleId:e,reason:t})=>tt.stopRecurrence(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:["recurrence"]}),n.invalidateQueries({queryKey:["tasks-range"]}),n.invalidateQueries({queryKey:["recent"]}),n.invalidateQueries({queryKey:["entity-list"]})}})}function dF(){const n=sn();return Qn({mutationFn:({ruleId:e,input:t})=>tt.splitRecurrence(e,t),onSuccess:e=>{n.invalidateQueries({queryKey:["entity",e.currentOccurrenceId??void 0]}),n.invalidateQueries({queryKey:["recurrence"]}),n.invalidateQueries({queryKey:["tasks-range"]}),n.invalidateQueries({queryKey:["recent"]}),n.invalidateQueries({queryKey:["entity-list"]})}})}function pF(){const n=sn();return Qn({mutationFn:e=>tt.createProject(e),onSuccess:()=>{n.invalidateQueries({queryKey:["projects"]})}})}function mF(){const n=sn();return Qn({mutationFn:({id:e,fields:t})=>tt.updateProject(e,t),onSuccess:e=>{n.invalidateQueries({queryKey:["projects"]}),n.setQueryData(["project",e.id],e),n.invalidateQueries({queryKey:["project","by-key",e.key]}),n.invalidateQueries({queryKey:["opening-brief",e.id]})}})}function gF(){const n=sn();return Qn({mutationFn:e=>tt.writeEntity(e),onSuccess:e=>{n.invalidateQueries({queryKey:["entity-list",e.projectId??void 0]}),n.invalidateQueries({queryKey:["opening-brief",e.projectId??void 0]}),n.invalidateQueries({queryKey:["recent"]}),n.invalidateQueries({queryKey:["tasks-range"]}),e.parentId&&n.invalidateQueries({queryKey:["related",e.parentId]})}})}function ql(){const n=sn();return Qn({mutationFn:({id:e,fields:t})=>tt.updateEntity(e,t),onSuccess:e=>{n.invalidateQueries({queryKey:["entity",e.id]}),n.invalidateQueries({queryKey:["entity-list",e.projectId??void 0]}),n.invalidateQueries({queryKey:["opening-brief",e.projectId??void 0]}),n.invalidateQueries({queryKey:["tasks-range"]}),n.invalidateQueries({queryKey:["related"]})}})}function vE(){const n=sn();return Qn({mutationFn:e=>tt.deleteEntity(e),onSuccess:()=>{n.invalidateQueries({queryKey:["tasks-range"]}),n.invalidateQueries({queryKey:["recent"]}),n.invalidateQueries({queryKey:["entity-list"]}),n.invalidateQueries({queryKey:["opening-brief"]}),n.invalidateQueries({queryKey:["related"]})}})}function OF(){const n=sn();return Qn({mutationFn:({id:e,agentsMd:t})=>tt.updateProject(e,{agentsMd:t}),onSuccess:e=>{n.invalidateQueries({queryKey:["project","by-key",e.key]}),n.invalidateQueries({queryKey:["opening-brief",e.id]}),n.invalidateQueries({queryKey:["projects"]})}})}function yF(){return qn({queryKey:["tokens"],queryFn:tt.listTokens})}function xF(){const n=sn();return Qn({mutationFn:e=>tt.createToken(e),onSuccess:()=>{n.invalidateQueries({queryKey:["tokens"]})}})}function kF(){const n=sn();return Qn({mutationFn:e=>tt.revokeToken(e),onSuccess:(e,t)=>{n.setQueryData(["tokens"],r=>(r==null?void 0:r.filter(i=>i.id!==t))??r),n.invalidateQueries({queryKey:["tokens"],refetchType:"active"})}})}const vF=["task","note"],bE=["planned","active","watching","paused","archived"],wE=["urgent","high","medium","low","none"];function Gi(){const[n,e]=Cc(),t=n.get("d"),r=R.useCallback(s=>{e(l=>{const o=new URLSearchParams(l);return o.set("d",s),o})},[e]),i=R.useCallback(()=>{e(s=>{const l=new URLSearchParams(s);return l.delete("d"),l})},[e]);return{openId:t,open:r,close:i}}function Cn(n){var t;if(n.title&&n.title.trim())return n.title;const e=((t=n.body.split(`
464
- `).find(r=>r.trim()))==null?void 0:t.trim())??"";return e?e.length>60?`${e.slice(0,60)}…`:e:"Untitled"}function Oi(n){return!n.title||!n.title.trim()}const SE=["hourly","daily","weekly","monthly","yearly"],ux=["MO","TU","WE","TH","FR","SA","SU"];function bF(n){if(!n)return;const e=n.match(/^(\d{4})(\d{2})(\d{2})/);if(e)return`${e[1]}-${e[2]}-${e[3]}`;const t=new Date(n);return Number.isNaN(t.getTime())?void 0:t.toISOString().slice(0,10)}function PE(n){var o;const e=new Map(n.replace(/^RRULE:/i,"").split(";").map(u=>u.split("=")).filter(u=>u.length===2).map(([u,h])=>[u.toUpperCase(),h])),t=(o=e.get("FREQ"))==null?void 0:o.toLowerCase(),r=SE.includes(t)?t:void 0,i=Number(e.get("INTERVAL")??1),s=Number(e.get("COUNT")),l=(e.get("BYDAY")??"").split(",").filter(u=>ux.includes(u));return{preset:r,interval:Number.isFinite(i)&&i>0?i:1,byWeekday:l,count:Number.isFinite(s)&&s>0?s:void 0,until:bF(e.get("UNTIL"))}}const wF=["title","body","tags","priority"];function SF(n,e,t){return!e||!wF.some(i=>i in n)?n:{...n,recurrenceScope:t}}const PF={task:{glyph:"☑",color:"text-blue-600 bg-blue-50 border-blue-100"},note:{glyph:"✎",color:"text-slate-700 bg-slate-50 border-slate-200"}};function Y0({kind:n,compact:e=!1}){const t=PF[n];return O.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 h-5 text-xxs rounded border ${t.color}`,title:n,children:[O.jsx("span",{children:t.glyph}),!e&&O.jsx("span",{className:"uppercase tracking-wider",children:n})]})}const CE=[{name:"circle",Icon:Uy},{name:"square",Icon:w6},{name:"triangle",Icon:Q6},{name:"hexagon",Icon:c6},{name:"folder",Icon:o6},{name:"briefcase",Icon:YB},{name:"rocket",Icon:y6},{name:"sparkles",Icon:v6},{name:"target",Icon:P6},{name:"layers",Icon:f6},{name:"code",Icon:KB},{name:"book",Icon:qB},{name:"flame",Icon:s6},{name:"zap",Icon:$6},{name:"star",Icon:S6},{name:"heart",Icon:u6},{name:"box",Icon:VB},{name:"lightbulb",Icon:p6},{name:"pencil",Icon:nj},{name:"hash",Icon:a6}],CF=new Map(CE.map(n=>[n.name,n.Icon]));function QF(n){return n?CF.get(n)??Uy:Uy}const $F=[{name:"gray",value:"#6f6f76"},{name:"red",value:"#ef4444"},{name:"orange",value:"#f59e0b"},{name:"yellow",value:"#eab308"},{name:"green",value:"#10b981"},{name:"teal",value:"#14b8a6"},{name:"cyan",value:"#06b6d4"},{name:"blue",value:"#3b82f6"},{name:"indigo",value:"#5e6ad2"},{name:"purple",value:"#8b5cf6"},{name:"pink",value:"#ec4899"}],QE="#5e6ad2",$E="circle";function TF(n){return n==="circle"||n==="square"||n==="triangle"}function Us({color:n,icon:e,size:t=12,className:r=""}){const i=QF(e),s=TF(e);return O.jsx(i,{size:t,className:`shrink-0 ${r}`,color:n,fill:s?n:"none",strokeWidth:s?1.2:1.8})}function cx({status:n,size:e=14}){const t="currentColor";return n==="done"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusDone shrink-0",children:[O.jsx("circle",{cx:"7",cy:"7",r:"6",fill:"currentColor"}),O.jsx("path",{d:"M4 7.4L6.2 9.5L10 5.5",stroke:"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}):n==="in_progress"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusInProgress shrink-0",children:[O.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:t,strokeWidth:"1.4",fill:"none"}),O.jsx("path",{d:"M7 1 a6 6 0 0 1 0 12 z",fill:"currentColor"})]}):n==="rejected"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusRejected shrink-0",children:[O.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:t,strokeWidth:"1.4",fill:"none"}),O.jsx("path",{d:"M4 4l6 6M10 4l-6 6",stroke:t,strokeWidth:"1.4",strokeLinecap:"round"})]}):O.jsx("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusOpen shrink-0",children:O.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:t,strokeWidth:"1.4",fill:"none"})})}function ha({priority:n,size:e=14}){return n==="urgent"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioUrgent shrink-0",children:[O.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2",fill:"currentColor"}),O.jsx("path",{d:"M7 4v3.5M7 9.5h.01",stroke:"white",strokeWidth:"1.6",strokeLinecap:"round"})]}):n==="high"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioHigh shrink-0",children:[O.jsx("rect",{x:"2",y:"8",width:"2.5",height:"4",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"5.75",y:"5",width:"2.5",height:"7",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"9.5",y:"2",width:"2.5",height:"10",rx:"0.5",fill:"currentColor"})]}):n==="medium"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioMedium shrink-0",children:[O.jsx("rect",{x:"2",y:"8",width:"2.5",height:"4",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"5.75",y:"5",width:"2.5",height:"7",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"9.5",y:"2",width:"2.5",height:"10",rx:"0.5",opacity:"0.3",fill:"currentColor"})]}):n==="low"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioLow shrink-0",children:[O.jsx("rect",{x:"2",y:"8",width:"2.5",height:"4",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"5.75",y:"5",width:"2.5",height:"7",rx:"0.5",opacity:"0.3",fill:"currentColor"}),O.jsx("rect",{x:"9.5",y:"2",width:"2.5",height:"10",rx:"0.5",opacity:"0.3",fill:"currentColor"})]}):O.jsx("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-faint shrink-0",children:O.jsx("line",{x1:"3",y1:"7",x2:"11",y2:"7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeDasharray:"1.5 1.5"})})}function pp({size:n=12,className:e=""}){return O.jsxs("svg",{width:n,height:n,viewBox:"0 0 14 14",fill:"none",className:`shrink-0 ${e}`,"aria-hidden":"true",children:[O.jsx("path",{d:"M2.5 7a4.5 4.5 0 0 1 7.7-3.2L11.5 5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),O.jsx("path",{d:"M11.5 2v3h-3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),O.jsx("path",{d:"M11.5 7a4.5 4.5 0 0 1-7.7 3.2L2.5 9",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),O.jsx("path",{d:"M2.5 12V9h3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]})}const fa={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"No priority"},Ld={open:"Todo",in_progress:"In progress",done:"Done",rejected:"Cancelled"},TE=["open","in_progress","done","rejected"];function U0({trigger:n,children:e,align:t="start"}){const[r,i]=R.useState(!1),[s,l]=R.useState(null),o=R.useRef(null),u=R.useRef(null),h=R.useCallback(()=>{const f=o.current,p=u.current;if(!f||!p)return;const m=8,y=4,k=f.getBoundingClientRect(),b=p.offsetWidth,w=p.offsetHeight,S=window.innerWidth-b-m,Q=k.bottom+y,$=k.top-w-y,A=Q+w<=window.innerHeight-m,I=$>=m,T=t==="end"?k.right-b:k.left,X=A||!I?Q:$,z=window.innerHeight-w-m;l({top:Math.min(Math.max(m,X),Math.max(m,z)),left:Math.min(Math.max(m,T),Math.max(m,S))})},[t]);return R.useEffect(()=>{if(!r)return;const f=m=>{var k,b;const y=m.target;!((k=o.current)!=null&&k.contains(y))&&!((b=u.current)!=null&&b.contains(y))&&i(!1)},p=m=>{m.key==="Escape"&&i(!1)};return window.addEventListener("mousedown",f),window.addEventListener("keydown",p),()=>{window.removeEventListener("mousedown",f),window.removeEventListener("keydown",p)}},[r]),R.useLayoutEffect(()=>{if(!r){l(null);return}h();const f=window.requestAnimationFrame(h);return window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),()=>{window.cancelAnimationFrame(f),window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[r,h]),O.jsxs(O.Fragment,{children:[O.jsx("span",{ref:o,onClick:f=>{f.stopPropagation(),i(p=>!p)},children:n}),r&&RR.createPortal(O.jsx("div",{ref:u,className:"popover",style:{position:"fixed",top:(s==null?void 0:s.top)??-9999,left:(s==null?void 0:s.left)??-9999,visibility:s?"visible":"hidden"},onClick:f=>f.stopPropagation(),children:e(()=>i(!1))}),document.body)]})}function mp({task:n,size:e=14,className:t="",align:r="start",onStatusChange:i}){const s=ql();return O.jsx(U0,{align:r,trigger:O.jsx("button",{type:"button",draggable:!1,className:`inline-flex shrink-0 items-center justify-center rounded p-0.5 -m-0.5 hover:bg-line/40 disabled:opacity-60 ${t}`,onPointerDown:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),onKeyDown:l=>l.stopPropagation(),onKeyUp:l=>l.stopPropagation(),onDragStart:l=>{l.preventDefault(),l.stopPropagation()},disabled:s.isPending,title:`Change status (${Ld[n.status]??n.status})`,"aria-label":"Change status","aria-haspopup":"menu",children:O.jsx(cx,{status:n.status,size:e})}),children:l=>O.jsx(O.Fragment,{children:TE.map(o=>O.jsxs("button",{className:"popover-item",role:"menuitemradio","aria-checked":n.status===o,onClick:u=>{if(u.stopPropagation(),l(),n.status===o)return;const h=n.status;i==null||i(o),s.mutate({id:n.id,fields:{status:o}},{onError:()=>i==null?void 0:i(h)})},children:[O.jsx(cx,{status:o,size:12}),O.jsx("span",{children:Ld[o]??o}),n.status===o&&O.jsx("span",{className:"ml-auto text-faint",children:"✓"})]},o))})})}const jF=600,jE={hourly:"Hourly",daily:"Daily",weekly:"Weekly",monthly:"Monthly",yearly:"Yearly"},EF={hourly:"hour",daily:"day",weekly:"week",monthly:"month",yearly:"year"};function MF(){const{openId:n,close:e}=Gi();return R.useEffect(()=>{if(!n)return;const t=r=>{if(r.key!=="Escape")return;const i=r.target;if(i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.closest(".cm-editor"))){i.blur();return}e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[n,e]),n?O.jsxs("div",{className:"fixed inset-0 z-30 flex",children:[O.jsx("div",{className:"flex-1 bg-ink/10 backdrop-blur-[1px] cursor-pointer",onClick:e}),O.jsx("aside",{className:"w-[min(680px,92vw)] bg-surface border-l border-line shadow-modal flex flex-col",children:O.jsx(AF,{id:n,onClose:e})})]}):null}function AF({id:n,onClose:e}){var $n,Nt;const{data:t,isLoading:r}=zP(n),{data:i}=Tr(),{data:s}=rF(n),{data:l}=zP((t==null?void 0:t.parentId)??void 0),{data:o}=cF((t==null?void 0:t.kind)==="task"?n:void 0),u=ql(),h=vE(),f=kE(),p=hF(),m=fF(),y=dF(),{open:k}=Zt(),{open:b}=Gi(),[w,S]=R.useState(""),[Q,$]=R.useState(""),[A,I]=R.useState(""),[T,X]=R.useState("open"),[z,K]=R.useState(""),[_,G]=R.useState("none"),[F,le]=R.useState(!1),[J,Y]=R.useState("idle"),[pe,ye]=R.useState("future"),ee=R.useRef(null);R.useEffect(()=>{t&&ee.current!==t.id&&(S(t.title??""),$(t.body),I(t.tags.join(", ")),X(t.status),K(t.dueAt?t.dueAt.slice(0,10):""),G(t.priority),le(!1),Y("idle"),ee.current=t.id)},[t==null?void 0:t.id,t]);const ie=R.useMemo(()=>{if(!F||!t||ee.current!==t.id)return null;const Je=t.kind==="note",kt=w.trim(),Xt=kt||(Je?null:kt),wi=A.split(",").map(Gs=>Gs.trim()).filter(Boolean),on={};Xt!==(t.title??"")&&!(Xt===null&&t.title===null)&&Xt!==t.title&&(on.title=Xt===""?null:Xt),Q!==t.body&&(on.body=Q),JSON.stringify(wi)!==JSON.stringify(t.tags)&&(on.tags=wi),T!==t.status&&(on.status=T),_!==t.priority&&(on.priority=_);const Fr=t.dueAt?t.dueAt.slice(0,10):"";return z!==Fr&&(on.dueAt=z?new Date(z).toISOString():null),on},[F,t,w,Q,A,T,_,z]),C=t!=null&&((Nt=($n=t.metadata)==null?void 0:$n.recurrence)==null?void 0:Nt.role)==="occurrence";function D(Je){return SF(Je,C,pe)}if(R.useEffect(()=>{if(!F||!t||!ie||Object.keys(ie).length===0)return;Y("idle");const Je=setTimeout(async()=>{Y("saving");try{await u.mutateAsync({id:t.id,fields:D(ie)}),Y("saved")}catch{Y("error")}},jF);return()=>clearTimeout(Je)},[F,ie]),r||!t)return O.jsxs("div",{className:"p-6 text-sm text-muted flex items-center justify-between",children:[O.jsx("span",{children:"Loading…"}),O.jsx("button",{onClick:e,className:"text-faint hover:text-ink",children:O.jsx(Hy,{size:14})})]});const q=t,E=i==null?void 0:i.find(Je=>Je.id===q.projectId),ce=E?`/p/${E.key}`:"",$e=q.kind==="note",we=ie?Object.keys(ie).length>0:!1;function Ie(){S(q.title??""),$(q.body),I(q.tags.join(", ")),X(q.status),K(q.dueAt?q.dueAt.slice(0,10):""),G(q.priority),Y("idle"),ye("future"),le(!0)}async function _e(){if(!we||!ie){le(!1);return}Y("saving");try{await u.mutateAsync({id:q.id,fields:D(ie)}),Y("saved"),le(!1)}catch{Y("error")}}async function De(){confirm(`Delete "${Cn(t)}"? This cannot be undone.`)&&(await h.mutateAsync(t.id),e())}async function at(){if(!o||!confirm("Skip this recurring occurrence?"))return;const Je=await p.mutateAsync({taskId:q.id});Je.next&&b(Je.next.id)}async function Fn(){!o||!confirm("Stop this recurrence series?")||await m.mutateAsync({ruleId:o.rule.id})}async function Hi(Je,kt){if(!kt)throw new Error("First due date is required");const Xt=q.dueAt?q.dueAt.slice(0,10):"";kt!==Xt&&await u.mutateAsync({id:q.id,fields:{dueAt:new Date(`${kt}T12:00:00Z`).toISOString()}}),await f.mutateAsync({taskId:q.id,input:Je})}async function Vr(Je){if(!o)return;const{dtstart:kt,...Xt}=Je;await y.mutateAsync({ruleId:o.rule.id,input:Xt})}return O.jsxs(O.Fragment,{children:[O.jsxs("header",{className:"h-12 px-3 border-b border-line flex items-center gap-2 shrink-0",children:[O.jsx("button",{onClick:e,className:"p-1 -m-1 text-faint hover:text-ink rounded hover:bg-sidebar",title:"Close (Esc)",children:O.jsx(Hy,{size:16})}),O.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted min-w-0",children:[E&&O.jsxs(O.Fragment,{children:[O.jsxs(ga,{to:ce,className:"flex items-center gap-1 hover:opacity-80",children:[O.jsx(Us,{color:E.color,icon:E.icon,size:12}),O.jsx("span",{className:"font-mono tabular-nums",style:{color:E.color},children:E.key})]}),O.jsx(lp,{size:11,className:"text-faint shrink-0"})]}),O.jsx(Y0,{kind:t.kind,compact:!0}),t.sequenceId&&E&&O.jsxs("span",{className:"font-mono text-faint tabular-nums",children:[E.key,"-",t.sequenceId]})]}),O.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[F&&O.jsx(_F,{state:J,dirty:we}),$e&&O.jsx("button",{className:`p-1 -m-1 rounded hover:bg-sidebar ${t.pinned?"text-accent":"text-faint hover:text-ink"}`,onClick:()=>u.mutate({id:t.id,fields:{pinned:!t.pinned}}),title:t.pinned?"Unpin from opening brief":"Pin to opening brief",children:O.jsx($0,{size:13,fill:t.pinned?"currentColor":"none"})}),F?O.jsx("button",{className:"p-1 -m-1 text-faint hover:text-ink rounded hover:bg-sidebar",onClick:_e,title:"Finish editing",children:O.jsx(Sa,{size:13})}):O.jsx("button",{className:"p-1 -m-1 text-faint hover:text-ink rounded hover:bg-sidebar",onClick:Ie,title:"Edit",children:O.jsx(nj,{size:13})}),O.jsx("button",{className:"p-1 -m-1 text-faint hover:text-danger rounded hover:bg-danger/10",onClick:De,title:"Delete",children:O.jsx(cj,{size:13})})]})]}),O.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin",children:O.jsxs("div",{className:"px-6 py-5 space-y-4",children:[F?O.jsx("input",{className:`w-full text-lg font-semibold bg-transparent border-none outline-none focus:outline-none px-0 py-1 ${w?"":"placeholder:text-muted/60 placeholder:italic"}`,value:w,placeholder:$e?"Untitled":"Title",onChange:Je=>S(Je.target.value),autoFocus:!0}):O.jsx("h2",{className:`text-lg font-semibold py-1 ${Oi(t)?"italic text-muted":"text-ink"}`,children:Cn(t)}),O.jsx(LF,{isEditing:F,isTask:t.kind==="task",status:T,setStatus:X,dueDate:z,setDueDate:K,priority:_,setPriority:G,tagsStr:A,setTagsStr:I,completedAt:t.completedAt,createdAt:t.createdAt,actorKind:t.actorKind,task:q.kind==="task"?{...q,status:T}:void 0,onStatusChange:X,recurrence:o,recurrenceBusy:u.isPending||f.isPending||p.isPending||m.isPending||y.isPending,onSaveRecurrence:Hi,onSkipOccurrence:at,onStopRecurrence:Fn,onSplitRecurrence:Vr,isRecurringOccurrence:C,occurrenceScope:pe,setOccurrenceScope:ye}),$e&&l&&O.jsxs("button",{className:"w-full text-left flex items-center gap-2 text-xs px-3 py-2 rounded border border-line bg-sidebar/50 hover:border-accent hover:bg-accentSoft/40 transition-colors",onClick:()=>b(l.id),title:"Open linked task",children:[O.jsx(m6,{size:12,className:"text-faint"}),O.jsx("span",{className:"text-faint",children:"Linked to task:"}),l.sequenceId&&E&&O.jsxs("span",{className:"font-mono text-faint tabular-nums",children:[E.key,"-",l.sequenceId]}),O.jsx("span",{className:"text-ink truncate",children:Cn(l)})]}),O.jsx("div",{className:"border border-line rounded-md overflow-hidden bg-surface",children:F?O.jsx(C0,{value:Q,onChange:Je=>$(Je),extensions:[iT()],basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1},theme:"light",minHeight:"220px",placeholder:"Write in Markdown…"}):Q?O.jsx("div",{className:"min-h-[120px] p-3",children:O.jsx(XP,{body:Q})}):O.jsx("div",{className:"min-h-[120px] p-3 text-xs text-faint",children:"No description."})}),F&&Q&&O.jsxs("details",{className:"text-xxs text-muted",children:[O.jsx("summary",{className:"cursor-pointer hover:text-ink",children:"Preview rendered Markdown"}),O.jsx("div",{className:"mt-2 p-3 border border-line rounded bg-sidebar/30",children:O.jsx(XP,{body:Q})})]}),t.kind==="task"&&O.jsx(DF,{related:s??[],onOpen:b,onAdd:()=>{E&&k({kind:"quick-create",projectId:E.id,initialKind:"note",parentId:t.id})},project:E})]})})]})}function RF(n){const e=n.rule,t=PE(e.rrule),r=t.preset??"daily",i=t.interval??1,s=i>1?`Every ${i} ${EF[r]}s`:jE[r],l=t.byWeekday.length?` · ${t.byWeekday.join(", ")}`:"",o=e.anchor==="completion"?"after completion":"scheduled",u=e.enabled?"":" · stopped",h=e.nextOccurrenceAt?` · next ${new Date(e.nextOccurrenceAt).toLocaleDateString()}`:"";return`${s}${l} · ${o}${h}${u}`}function ZP(n){const e=n?PE(n.rule.rrule):void 0;return{preset:n?(e==null?void 0:e.preset)??"weekly":"none",interval:(e==null?void 0:e.interval)??1,anchor:(n==null?void 0:n.rule.anchor)??"scheduled",byWeekday:(e==null?void 0:e.byWeekday)??[],count:e!=null&&e.count?String(e.count):"",until:(e==null?void 0:e.until)??""}}function NF({isEditing:n,task:e,dueDate:t,recurrence:r,onSave:i,onSkip:s,onStop:l,onSplit:o,busy:u}){const[h,f]=R.useState(()=>ZP(r)),[p,m]=R.useState(null);if(R.useEffect(()=>{f(ZP(r)),m(null)},[n,e==null?void 0:e.id,e==null?void 0:e.dueAt,r==null?void 0:r.rule.id,r==null?void 0:r.rule.rrule,r==null?void 0:r.rule.anchor]),!e)return null;const y=["done","rejected"].includes(e.status),k=!!(r!=null&&r.rule.enabled)&&(r==null?void 0:r.rule.currentOccurrenceId)===e.id,b=!!(r!=null&&r.rule.enabled),w=h.preset!=="none",S=!!i&&t.length>0&&w&&h.interval>=1,Q=!!o&&!!(r!=null&&r.rule.enabled)&&w&&h.interval>=1;function $(z){f(K=>({...K,...z})),m(null)}function A(z){const K=new Set(h.byWeekday);K.has(z)?K.delete(z):K.add(z),$({byWeekday:ux.filter(_=>K.has(_))})}function I(){const z={preset:h.preset,interval:h.interval,anchor:h.anchor,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,allDay:!0};return h.preset==="weekly"&&h.byWeekday.length>0&&(z.byWeekday=h.byWeekday),h.count&&(z.count=Number(h.count)),h.until&&(z.until=new Date(`${h.until}T23:59:59Z`).toISOString()),z}async function T(){if(h.preset==="none"){m(null);return}if(!t){m("Set due date first");return}if(h.count&&h.until){m("Use count or until");return}try{await(i==null?void 0:i(I(),t)),m(null)}catch(z){m(z instanceof Error?z.message:"Could not save repeat")}}async function X(){if(h.preset!=="none"){if(h.count&&h.until){m("Use count or until");return}try{await(o==null?void 0:o(I())),m(null)}catch(z){m(z instanceof Error?z.message:"Could not split series")}}}return!n||y?O.jsxs("span",{className:"min-w-0 flex items-center gap-2",children:[O.jsx("span",{className:r?"text-muted truncate":"text-faint",children:r?RF(r):"None"}),k&&s&&O.jsx("button",{className:"text-faint hover:text-ink disabled:opacity-40 shrink-0",onClick:s,disabled:u,title:"Skip occurrence",children:"Skip"})]}):O.jsxs("span",{className:"min-w-0 flex flex-col gap-1",children:[O.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[O.jsxs("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.preset,onChange:z=>$({preset:z.target.value}),title:"Repeat",children:[O.jsx("option",{value:"none",children:"None"}),SE.map(z=>O.jsx("option",{value:z,children:jE[z]},z))]}),w&&O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"number",min:1,max:999,className:"w-14 bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.interval,onChange:z=>$({interval:Math.max(1,Number(z.target.value)||1)}),title:"Interval"}),O.jsxs("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.anchor,onChange:z=>$({anchor:z.target.value}),title:"Anchor",children:[O.jsx("option",{value:"scheduled",children:"Scheduled"}),O.jsx("option",{value:"completion",children:"Completion"})]}),O.jsx("button",{className:"text-accent hover:underline disabled:opacity-40",onClick:T,disabled:u||!S,children:"Save"}),Q&&O.jsx("button",{className:"text-faint hover:text-ink disabled:opacity-40",onClick:X,disabled:u,title:"Keep past occurrences on the old cadence; apply this cadence going forward",children:"Split"})]}),b&&l&&O.jsx("button",{className:"text-faint hover:text-danger disabled:opacity-40",onClick:l,disabled:u,title:"Stop series",children:"Stop"})]}),w&&h.preset==="weekly"&&O.jsx("span",{className:"flex flex-wrap gap-1",children:ux.map(z=>O.jsx("button",{type:"button",className:`px-1.5 py-0.5 rounded border text-[10px] ${h.byWeekday.includes(z)?"border-accent bg-accentSoft text-accent":"border-line bg-surface text-muted hover:text-ink"}`,onClick:()=>A(z),children:z},z))}),w&&O.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[O.jsx("input",{type:"number",min:1,max:1e4,className:"w-20 bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.count,onChange:z=>$({count:z.target.value,until:z.target.value?"":h.until}),placeholder:"Count",title:"Count"}),O.jsx("input",{type:"date",className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.until,onChange:z=>$({until:z.target.value,count:z.target.value?"":h.count}),title:"Until"}),!t&&O.jsx("span",{className:"text-faint text-xxs",children:"Set due date first"}),p&&O.jsx("span",{className:"text-danger text-xxs truncate",children:p})]})]})}function LF({isEditing:n,isTask:e,status:t,setStatus:r,dueDate:i,setDueDate:s,priority:l,setPriority:o,tagsStr:u,setTagsStr:h,completedAt:f,createdAt:p,actorKind:m,task:y,onStatusChange:k,recurrence:b,recurrenceBusy:w,onSaveRecurrence:S,onSkipOccurrence:Q,onStopRecurrence:$,onSplitRecurrence:A,isRecurringOccurrence:I,occurrenceScope:T,setOccurrenceScope:X}){return O.jsxs("div",{className:"grid grid-cols-[80px_1fr] gap-x-3 gap-y-1.5 items-center text-xs",children:[e&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Status"}),O.jsxs("span",{className:"flex items-center gap-1.5",children:[n||!y?O.jsx(cx,{status:t,size:12}):O.jsx(mp,{task:y,size:12,onStatusChange:k}),n?O.jsx("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:t,onChange:z=>r(z.target.value),children:TE.map(z=>O.jsx("option",{value:z,children:Ld[z]??z},z))}):O.jsx("span",{className:"text-ink",children:Ld[t]??t})]}),O.jsx("span",{className:"text-faint",children:"Due"}),O.jsx("span",{className:"flex items-center gap-1.5",children:n?O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"date",className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:i,onChange:z=>s(z.target.value)}),!i&&O.jsx("span",{className:"text-faint text-xxs",children:"inbox"}),i&&O.jsx("button",{className:"text-faint hover:text-danger text-xxs",onClick:()=>s(""),title:"Clear",children:"✕"})]}):O.jsx("span",{className:i?"text-ink":"text-faint text-xxs",children:i||"inbox"})}),(b||n&&y&&!["done","rejected"].includes(t))&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Repeat"}),O.jsx(NF,{isEditing:n,task:y,dueDate:i,recurrence:b,busy:!!w,onSave:S,onSkip:Q,onStop:$,onSplit:A})]}),n&&I&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Apply to"}),O.jsx("span",{className:"flex items-center gap-1.5",children:O.jsxs("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:T??"future",onChange:z=>X==null?void 0:X(z.target.value),title:"Recurrence edit scope",children:[O.jsx("option",{value:"future",children:"This and future"}),O.jsx("option",{value:"this",children:"This occurrence only"})]})})]}),O.jsx("span",{className:"text-faint",children:"Priority"}),O.jsxs("span",{className:"flex items-center gap-1.5",children:[O.jsx(ha,{priority:l,size:12}),n?O.jsx("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:l,onChange:z=>o(z.target.value),children:wE.map(z=>O.jsx("option",{value:z,children:fa[z]},z))}):O.jsx("span",{className:"text-ink",children:fa[l]})]}),t==="done"&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Completed"}),O.jsx("span",{className:"text-muted",children:f?new Date(f).toLocaleString():"Not recorded"})]})]}),O.jsx("span",{className:"text-faint",children:"Tags"}),n?O.jsx("input",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:u,onChange:z=>h(z.target.value),placeholder:"comma, separated"}):O.jsx("span",{className:u?"text-muted":"text-faint",children:u||"none"}),O.jsx("span",{className:"text-faint",children:"Created"}),O.jsxs("span",{className:"text-muted",children:[new Date(p).toLocaleString()," · ",O.jsx("span",{className:"text-ink",children:m})]})]})}function _F({state:n,dirty:e}){return n==="saving"?O.jsxs("span",{className:"flex items-center gap-1 text-xxs text-muted",children:[O.jsx(ej,{size:11,className:"animate-spin"}),"Saving…"]}):n==="saved"&&!e?O.jsxs("span",{className:"flex items-center gap-1 text-xxs text-faint",children:[O.jsx(HB,{size:11}),"Saved"]}):n==="error"?O.jsx("span",{className:"text-xxs text-danger",children:"Save failed"}):e?O.jsxs("span",{className:"flex items-center gap-1 text-xxs text-faint",children:[O.jsx(GB,{size:11}),"Unsaved"]}):null}function DF({related:n,onOpen:e,onAdd:t,project:r}){const i=n.filter(s=>s.kind==="note");return O.jsxs("div",{children:[O.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[O.jsxs("h3",{className:"text-xxs uppercase tracking-wider text-muted font-semibold",children:["Related notes ",O.jsx("span",{className:"text-faint",children:i.length})]}),O.jsx("button",{onClick:t,className:"text-xs text-accent hover:underline",children:"+ Add note"})]}),i.length===0?O.jsx("div",{className:"text-xs text-faint border border-dashed border-line rounded p-3 text-center",children:"No linked notes yet."}):O.jsx("div",{className:"border border-line rounded-md divide-y divide-lineSoft overflow-hidden",children:i.map(s=>O.jsxs("button",{className:"w-full text-left px-3 py-2 hover:bg-sidebar flex items-start gap-2",onClick:()=>e(s.id),children:[O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:`text-sm truncate ${Oi(s)?"italic text-muted":"text-ink"}`,children:Cn(s)}),!Oi(s)&&s.body&&O.jsx("div",{className:"text-xxs text-muted truncate mt-0.5",children:s.body.replace(/\n/g," ").slice(0,140)})]}),s.pinned&&O.jsx($0,{size:11,className:"text-accent shrink-0 mt-1",fill:"currentColor"})]},s.id))}),!r&&O.jsx("div",{className:"text-xxs text-faint mt-1",children:"No project context — link picker unavailable."})]})}function XP({body:n}){return O.jsx("div",{className:"text-sm leading-relaxed text-ink space-y-2 [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mb-1.5 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1 [&_h3]:font-semibold [&_h3]:mt-2 [&_p]:my-1 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-0.5 [&_code]:bg-sidebar [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs [&_pre]:bg-sidebar [&_pre]:p-2 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_a]:text-accent [&_a]:underline [&_blockquote]:border-l-2 [&_blockquote]:border-line [&_blockquote]:pl-3 [&_blockquote]:text-muted [&_table]:border-collapse [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1 [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1",children:O.jsx(Vj,{remarkPlugins:[gE],children:n})})}function hx(n,e){const[t,r]=R.useState(()=>{if(typeof window>"u")return e;try{const s=window.localStorage.getItem(n);return s===null?e:JSON.parse(s)}catch{return e}});R.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n,JSON.stringify(t))}catch{}},[n,t]);const i=R.useCallback(s=>r(s),[]);return[t,i]}const Zl={planned:"Planned",active:"Active",watching:"Watching",paused:"Paused",archived:"Archived"},EE={planned:"Committed, not started",active:"Currently being built",watching:"Built, in maintenance",paused:"Intentionally on hold",archived:"Hidden from active work"},fx=["planned","active","watching","paused","archived"],kO={key:"Key (A→Z)",name:"Name (A→Z)",recent:"Recently active"},BP={archived:!0};function IF(n,e){const t=[...n];return e==="key"?t.sort((r,i)=>r.key.localeCompare(i.key)):e==="name"?t.sort((r,i)=>r.name.localeCompare(i.name)):t.sort((r,i)=>+new Date(i.updatedAt)-+new Date(r.updatedAt))}function zF(){const{open:n}=Zt(),{key:e}=Bd(),[t,r]=hx("botnote.projectSort","key"),[i,s]=hx("botnote.sidebar.projectGroups.collapsed",BP),{data:l,isLoading:o}=Tr({includeArchived:!0}),u=R.useMemo(()=>{const m=l??[];return new Map(fx.map(y=>[y,IF(m.filter(k=>k.status===y),t)]))},[l,t]),h=(l==null?void 0:l.length)??0,f=m=>i[m]??BP[m]??!1,p=m=>{const y=f(m);s({...i,[m]:!y})};return O.jsxs("aside",{className:"w-52 shrink-0 border-r border-line bg-sidebar flex flex-col scrollbar-thin overflow-y-auto text-sm",children:[O.jsxs("nav",{className:"px-1.5 pt-2 space-y-px",children:[O.jsx(Pu,{to:"/",end:!0,icon:O.jsx(UB,{size:12,className:"opacity-70"}),label:"Tasks"}),O.jsx(Pu,{to:"/today",icon:O.jsx(aj,{size:12,className:"opacity-70"}),label:"Today"}),O.jsx(Pu,{to:"/inbox",icon:O.jsx(Ed,{size:12,className:"opacity-70"}),label:"Inbox"}),O.jsx(Pu,{to:"/dashboard",icon:O.jsx(d6,{size:12,className:"opacity-70"}),label:"Workspace"})]}),O.jsxs("div",{className:"mt-3 px-3 py-1.5 flex items-center justify-between",children:[O.jsx("div",{className:"text-xxs uppercase tracking-wider text-muted font-medium",children:"Projects"}),O.jsxs("div",{className:"flex items-center gap-0.5",children:[O.jsx(U0,{trigger:O.jsx("button",{className:"text-muted hover:text-ink p-0.5 rounded hover:bg-sidebarHover flex items-center gap-0.5",title:`Sort: ${kO[t]}`,children:O.jsx(Yy,{size:11})}),align:"end",children:m=>O.jsx(O.Fragment,{children:Object.keys(kO).map(y=>O.jsxs("button",{className:"popover-item",onClick:()=>{r(y),m()},children:[O.jsx("span",{children:kO[y]}),t===y&&O.jsx("span",{className:"ml-auto text-faint",children:"✓"})]},y))})}),O.jsx("button",{className:"text-muted hover:text-ink p-0.5 rounded hover:bg-sidebarHover",title:"New project (n)",onClick:()=>n({kind:"new-project"}),children:O.jsx(op,{size:11})})]})]}),O.jsxs("nav",{className:"px-1.5 space-y-px flex-1",children:[o&&O.jsx("div",{className:"px-2 py-1 text-xs text-faint",children:"Loading…"}),!o&&h===0&&O.jsxs("button",{className:"w-full text-left px-2 py-1 text-xs text-muted hover:bg-sidebarHover rounded",onClick:()=>n({kind:"new-project"}),children:["No projects yet. ",O.jsx("span",{className:"text-accent",children:"Create →"})]}),fx.map(m=>{const y=u.get(m)??[];if(o||y.length===0)return null;const k=f(m);return O.jsxs("div",{className:"pt-2 first:pt-0",children:[O.jsxs("button",{type:"button",className:"w-full px-1.5 pb-1 flex items-center gap-1 text-xxs uppercase tracking-wider text-muted font-medium hover:text-ink",onClick:()=>p(m),title:`${k?"Expand":"Collapse"} ${Zl[m]}`,children:[k?O.jsx(lp,{size:10}):O.jsx(Yy,{size:10}),O.jsx("span",{children:Zl[m]}),O.jsx("span",{className:"ml-auto text-faint tabular-nums",children:y.length})]}),!k&&y.map(b=>O.jsx(ZF,{project:b,activeKey:e},b.id))]},m)})]}),O.jsx("div",{className:"border-t border-line/60 px-1.5 py-1.5",children:O.jsx(Pu,{to:"/settings",icon:O.jsx(Q0,{size:12,className:"opacity-70"}),label:"Settings"})})]})}function ZF({project:n,activeKey:e}){return O.jsxs(I2,{to:`/p/${n.key}`,title:n.status==="archived"?`${n.name} (archived)`:n.name,className:({isActive:t})=>`flex items-center gap-2 px-2 py-1 text-xs rounded ${t||e===n.key?"bg-accentSoft text-accentText":"text-ink2 hover:bg-sidebarHover"} ${n.status==="archived"?"opacity-60":""}`,children:[O.jsx(Us,{color:n.color,icon:n.icon,size:11}),O.jsx("span",{className:"font-mono text-xxs tabular-nums opacity-90 shrink-0",style:{color:n.color},children:n.key}),O.jsx("span",{className:"truncate text-muted",children:n.name})]})}function Pu({to:n,end:e,icon:t,label:r}){return O.jsxs(I2,{to:n,end:e,className:({isActive:i})=>`flex items-center gap-2 px-2 py-1 rounded text-xs ${i?"bg-accentSoft text-accentText":"text-ink2 hover:bg-sidebarHover"}`,children:[t,O.jsx("span",{children:r})]})}function XF(){const{open:n}=Zt(),e=Vs(),t=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘":"Ctrl";async function r(){try{await tt.logout()}catch{}e("/login",{replace:!0})}return O.jsxs("header",{className:"h-11 flex items-center justify-between px-3 border-b border-line bg-surface",children:[O.jsxs(ga,{to:"/",className:"flex items-center gap-1.5 text-ink hover:opacity-90",children:[O.jsx("img",{src:"/favicon.svg",alt:"","aria-hidden":"true",className:"w-[18px] h-[18px]"}),O.jsx("span",{className:"text-xs font-semibold tracking-tight",children:"botnote"})]}),O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsxs("button",{className:"btn !pl-2 !pr-1.5 gap-2 min-w-[220px] !justify-between text-muted",onClick:()=>n({kind:"search"}),title:"Search (⌘K)",children:[O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx(lj,{size:12}),O.jsx("span",{className:"text-xs",children:"Search…"})]}),O.jsxs("kbd",{children:[t,"K"]})]}),O.jsxs("button",{className:"btn btn-primary",onClick:()=>n({kind:"quick-create"}),title:"Quick create (c)",children:[O.jsx(op,{size:12}),O.jsx("span",{className:"text-xs",children:"New"}),O.jsx("kbd",{className:"!bg-white/15 !border-white/25 !text-white",children:"c"})]}),O.jsx("button",{className:"btn !px-1.5 !py-1 text-muted hover:!text-red-500",onClick:r,title:"Log out","aria-label":"Log out",children:O.jsx(tj,{size:12})})]})]})}function BF(){return W5(),O.jsxs("div",{className:"h-full w-full flex flex-col",children:[O.jsx(XF,{}),O.jsxs("div",{className:"flex-1 min-h-0 flex",children:[O.jsx(zF,{}),O.jsx("main",{className:"flex-1 min-w-0 min-h-0 overflow-hidden bg-bg",children:O.jsx(P5,{})})]}),O.jsx(MF,{})]})}function ME({icon:n,color:e,onIconChange:t,onColorChange:r}){return O.jsxs("div",{className:"space-y-2",children:[O.jsxs("div",{children:[O.jsx("div",{className:"text-xxs text-muted uppercase tracking-wider mb-1",children:"Color"}),O.jsx("div",{className:"flex flex-wrap gap-1.5",children:$F.map(i=>O.jsx("button",{type:"button",onClick:()=>r(i.value),className:"relative w-6 h-6 rounded-full border border-line/80 hover:scale-110 transition-transform",style:{backgroundColor:i.value},title:i.name,children:e===i.value&&O.jsx(Sa,{size:12,className:"absolute inset-0 m-auto text-white",strokeWidth:3})},i.value))})]}),O.jsxs("div",{children:[O.jsx("div",{className:"text-xxs text-muted uppercase tracking-wider mb-1",children:"Icon"}),O.jsx("div",{className:"flex flex-wrap gap-1",children:CE.map(i=>O.jsx("button",{type:"button",onClick:()=>t(i.name),className:`w-7 h-7 rounded flex items-center justify-center border transition-colors ${n===i.name?"border-accent bg-accentSoft":"border-line bg-surface hover:bg-sidebar"}`,title:i.name,children:O.jsx(Us,{color:e,icon:i.name,size:14})},i.name))})]})]})}function kc({title:n,children:e,width:t="max-w-2xl"}){const{close:r}=Zt();return R.useEffect(()=>{const i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i}},[]),O.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-20 px-4 bg-ink/20",onClick:r,children:O.jsxs("div",{className:`w-full ${t} bg-surface border border-line rounded-lg shadow-2xl overflow-hidden`,onClick:i=>i.stopPropagation(),children:[O.jsxs("div",{className:"h-9 px-3 flex items-center justify-between border-b border-line",children:[O.jsx("div",{className:"text-xs font-semibold text-ink",children:n}),O.jsx("button",{onClick:r,className:"text-muted hover:text-ink p-0.5 rounded hover:bg-line/60",title:"Close (Esc)",children:O.jsx(Hy,{size:14})})]}),e]})})}function WF({projectId:n}){const{data:e}=nF(n),t=mF(),{close:r}=Zt(),[i,s]=R.useState(""),[l,o]=R.useState("active"),[u,h]=R.useState(QE),[f,p]=R.useState($E);if(R.useEffect(()=>{e&&(s(e.name),o(e.status),h(e.color),p(e.icon))},[e==null?void 0:e.id,e==null?void 0:e.name,e==null?void 0:e.status,e==null?void 0:e.color,e==null?void 0:e.icon]),!e)return O.jsx(kc,{title:"Project settings",width:"max-w-md",children:O.jsx("div",{className:"p-4 text-sm text-muted",children:"Loading…"})});const m=e,y=i!==m.name||l!==m.status||u!==m.color||f!==m.icon,k=i.trim().length>0;return O.jsx(kc,{title:`Settings · ${m.key}`,width:"max-w-md",children:O.jsxs("form",{onSubmit:async b=>{b.preventDefault(),!(!y||!k)&&(await t.mutateAsync({id:m.id,fields:{name:i.trim(),status:l,color:u,icon:f}}),r())},className:"p-3 space-y-3",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Name"}),O.jsx("input",{autoFocus:!0,className:"input",value:i,onChange:b=>s(b.target.value)})]}),O.jsx(ME,{icon:f,color:u,onIconChange:p,onColorChange:h}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Status"}),O.jsx("select",{className:"input",value:l,onChange:b=>o(b.target.value),children:bE.map(b=>O.jsxs("option",{value:b,children:[Zl[b]," · ",EE[b]]},b))})]}),O.jsx("div",{className:"flex justify-end items-center pt-1",children:O.jsxs("div",{className:"flex gap-2",children:[O.jsx("button",{type:"button",className:"btn",onClick:r,children:"Cancel"}),O.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!y||!k||t.isPending,children:t.isPending?"Saving…":"Save"})]})}),t.error&&O.jsx("div",{className:"text-xs text-danger",children:t.error.message})]})})}function qF(){const[n,e]=R.useState(""),[t,r]=R.useState(""),[i,s]=R.useState("active"),[l,o]=R.useState(""),[u,h]=R.useState(QE),[f,p]=R.useState($E),m=pF(),{close:y}=Zt(),k=Vs(),b=/^[A-Z][A-Z0-9_]{0,19}$/.test(n)&&t.trim().length>0;return O.jsx(kc,{title:"New project",width:"max-w-md",children:O.jsxs("form",{onSubmit:async w=>{if(w.preventDefault(),!b)return;const S=await m.mutateAsync({key:n.trim(),name:t.trim(),status:i,color:u,icon:f,agentsMd:l.trim()});y(),k(`/p/${S.key}`)},className:"p-3 space-y-3",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Key (uppercase, e.g. BOT)"}),O.jsx("input",{autoFocus:!0,className:"input font-mono uppercase",value:n,onChange:w=>e(w.target.value.toUpperCase()),placeholder:"BOT",maxLength:20})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Name"}),O.jsx("input",{className:"input",value:t,onChange:w=>r(w.target.value),placeholder:"botnote"})]}),O.jsx(ME,{icon:f,color:u,onIconChange:p,onColorChange:h}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Status"}),O.jsx("select",{className:"input",value:i,onChange:w=>s(w.target.value),children:bE.map(w=>O.jsxs("option",{value:w,children:[Zl[w]," · ",EE[w]]},w))})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"AGENTS.md (optional)"}),O.jsx("textarea",{className:"input !h-24 py-1.5 font-mono text-xs leading-snug resize-y",value:l,onChange:w=>o(w.target.value),placeholder:`## Critical
465
- - ALWAYS run pnpm typecheck before commit.`})]}),O.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[O.jsx("button",{type:"button",className:"btn",onClick:y,children:"Cancel"}),O.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!b||m.isPending,children:m.isPending?"Creating…":"Create project"})]}),m.error&&O.jsx("div",{className:"text-xs text-danger",children:m.error.message})]})})}function VF({initialProjectId:n,initialKind:e,initialParentId:t}){const{data:r}=Tr(),[i,s]=R.useState(e??"task"),[l,o]=R.useState(n??""),[u,h]=R.useState(""),[f,p]=R.useState(""),[m,y]=R.useState(""),[k,b]=R.useState(""),[w,S]=R.useState("none"),[Q,$]=R.useState("none"),[A,I]=R.useState(1),[T,X]=R.useState("scheduled"),[z,K]=R.useState(!1),[_,G]=R.useState(t??""),F=gF(),le=kE(),{close:J}=Zt(),{open:Y}=Gi(),pe=r==null?void 0:r.find(C=>C.id===l),ye=i==="note",{data:ee}=F0(ye&&l?l:void 0,["task"]),ie=l.length>0&&(ye?u.trim().length>0||f.trim().length>0:u.trim().length>0&&(Q==="none"||k.length>0));return O.jsx(kc,{title:"Quick create",width:"max-w-xl",children:O.jsxs("form",{onSubmit:async C=>{if(C.preventDefault(),!ie)return;const D=u.trim(),q=m.split(",").map(ce=>ce.trim()).filter(Boolean),E=i==="task"?await F.mutateAsync({kind:"task",projectId:l,title:D,body:f.trim(),tags:q,actorKind:"human",dueAt:k?new Date(k).toISOString():null,priority:w}):await F.mutateAsync({kind:"note",projectId:l,title:D||null,body:f.trim(),tags:q,actorKind:"human",pinned:z,parentId:_||null});i==="task"&&Q!=="none"&&await le.mutateAsync({taskId:E.id,input:{preset:Q,interval:A,anchor:T,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,allDay:!0}}),J(),Y(E.id)},className:"p-3 space-y-3",children:[O.jsxs("div",{className:"flex gap-2",children:[O.jsx("div",{className:"seg w-32",children:vF.map(C=>O.jsx("button",{type:"button","data-active":i===C,onClick:()=>s(C),className:"flex-1 justify-center capitalize",children:C},C))}),O.jsxs("select",{className:"input flex-1",value:l,onChange:C=>o(C.target.value),children:[O.jsx("option",{value:"",children:"— pick a project —"}),r==null?void 0:r.map(C=>O.jsxs("option",{value:C.id,children:[C.key," · ",C.name]},C.id))]})]}),O.jsx("input",{autoFocus:!0,className:"input",placeholder:ye?"Title (optional)":"Title",value:u,onChange:C=>h(C.target.value)}),O.jsx("textarea",{className:"input !h-32 py-1.5 font-mono text-xs leading-snug resize-y",placeholder:"Body (Markdown, optional)",value:f,onChange:C=>p(C.target.value)}),O.jsxs("div",{className:"flex gap-2",children:[O.jsx("input",{className:"input flex-1",placeholder:"Tags (comma-separated, optional)",value:m,onChange:C=>y(C.target.value)}),i==="task"&&O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"date",className:"input w-36",value:k,onChange:C=>b(C.target.value),title:"Due date"}),O.jsx("select",{className:"input w-36",value:w,onChange:C=>S(C.target.value),title:"Priority",children:wE.map(C=>O.jsx("option",{value:C,children:fa[C]},C))})]})]}),i==="task"&&O.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_84px_132px] gap-2",children:[O.jsxs("select",{className:"input",value:Q,onChange:C=>$(C.target.value),title:"Repeat",children:[O.jsx("option",{value:"none",children:"Repeat: none"}),O.jsx("option",{value:"hourly",children:"Hourly"}),O.jsx("option",{value:"daily",children:"Daily"}),O.jsx("option",{value:"weekly",children:"Weekly"}),O.jsx("option",{value:"monthly",children:"Monthly"}),O.jsx("option",{value:"yearly",children:"Yearly"})]}),O.jsx("input",{type:"number",min:1,max:999,className:"input",value:A,disabled:Q==="none",onChange:C=>I(Math.max(1,Number(C.target.value)||1)),title:"Repeat interval"}),O.jsxs("select",{className:"input",value:T,disabled:Q==="none",onChange:C=>X(C.target.value),title:"Repeat anchor",children:[O.jsx("option",{value:"scheduled",children:"Scheduled"}),O.jsx("option",{value:"completion",children:"Completion"})]})]}),i==="task"&&w!=="none"&&O.jsxs("div",{className:"flex items-center gap-1.5 text-xxs text-muted",children:[O.jsx(ha,{priority:w,size:11}),O.jsxs("span",{children:[fa[w]," priority"]})]}),ye&&O.jsxs(O.Fragment,{children:[O.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted cursor-pointer",children:[O.jsx("input",{type:"checkbox",checked:z,onChange:C=>K(C.target.checked)}),O.jsx("span",{children:"📌 Pin to project — auto-include in agent opening brief"})]}),ee&&ee.length>0&&O.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[O.jsx("span",{className:"shrink-0",children:"Link to task:"}),O.jsxs("select",{className:"input flex-1 !h-7 text-xs",value:_,onChange:C=>G(C.target.value),children:[O.jsx("option",{value:"",children:"— none —"}),ee.map(C=>O.jsxs("option",{value:C.id,children:[pe!=null&&pe.key&&C.sequenceId?`${pe.key}-${C.sequenceId} · `:"",Cn(C)]},C.id))]})]})]}),O.jsxs("div",{className:"flex justify-between items-center pt-1",children:[O.jsxs("div",{className:"text-xxs text-muted",children:[O.jsx("kbd",{children:"⌘"}),"+",O.jsx("kbd",{children:"Enter"})," to submit · ",O.jsx("kbd",{children:"Esc"})," to close"]}),O.jsxs("div",{className:"flex gap-2",children:[O.jsx("button",{type:"button",className:"btn",onClick:J,children:"Cancel"}),O.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!ie||F.isPending,children:F.isPending?"Creating…":`Create ${i}`})]})]}),F.error&&O.jsx("div",{className:"text-xs text-danger",children:F.error.message})]})})}const FF={task:"task",note:"note"};function YF(){const[n,e]=R.useState(""),[t,r]=R.useState(""),{close:i}=Zt(),{open:s}=Gi(),{data:l}=Tr();R.useEffect(()=>{const f=setTimeout(()=>r(n.trim()),200);return()=>clearTimeout(f)},[n]);const{data:o,isFetching:u}=xE(t?{query:t,limit:20}:null),h=R.useMemo(()=>{const f=new Map;return l==null||l.forEach(p=>f.set(p.id,p.key)),f},[l]);return O.jsxs(kc,{title:"Search",children:[O.jsx("div",{className:"p-3 pb-1",children:O.jsxs("div",{className:"flex items-center gap-2 px-2 h-9 border border-line rounded bg-surface focus-within:border-accent focus-within:ring-1 focus-within:ring-accentSoft",children:[O.jsx(lj,{size:14,className:"text-muted"}),O.jsx("input",{autoFocus:!0,placeholder:"Hybrid search (BM25 + vector + time decay)",className:"flex-1 bg-transparent border-none outline-none text-sm",value:n,onChange:f=>e(f.target.value)}),u&&O.jsx("span",{className:"text-xxs text-muted",children:"searching…"})]})}),O.jsxs("div",{className:"max-h-[60vh] overflow-y-auto scrollbar-thin",children:[t&&!u&&(!o||o.hits.length===0)&&O.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted",children:"No matches."}),o==null?void 0:o.hits.map(f=>{const p=f.entity.projectId?h.get(f.entity.projectId):null;return O.jsxs("button",{onClick:()=>{i(),s(f.entity.id)},className:"w-full px-3 py-2 row-hover text-left flex items-start gap-3 border-t border-line/60",children:[O.jsx("span",{className:"chip mt-0.5",children:FF[f.entity.kind]}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:"text-sm text-ink truncate",children:Cn(f.entity)}),O.jsx("div",{className:"text-xs text-muted truncate mt-0.5",children:f.entity.body.replace(/\n/g," ").slice(0,140)||"—"}),O.jsxs("div",{className:"text-xxs text-faint mt-0.5 flex gap-2",children:[p&&O.jsxs("span",{children:["· ",p]}),O.jsxs("span",{children:["· score ",f.score.toFixed(3)]}),f.components.bm25&&O.jsx("span",{children:"· bm25"}),f.components.cosine&&O.jsx("span",{children:"· vec"})]})]}),O.jsx(WB,{size:13,className:"text-faint mt-1"})]},f.entity.id)}),o&&O.jsxs("div",{className:"px-3 py-2 text-xxs text-muted border-t border-line/60",children:[o.hits.length," result(s) · embedding ",o.embeddingUsed?"ON":"OFF (BM25-only)"]})]})]})}function UF(){const{active:n}=Zt();if(!n)return null;switch(n.kind){case"search":return O.jsx(YF,{});case"quick-create":return O.jsx(VF,{initialProjectId:n.projectId,initialKind:n.initialKind,initialParentId:n.parentId});case"new-project":return O.jsx(qF,{});case"edit-project":return O.jsx(WF,{projectId:n.projectId})}}const GF=`## Critical
464
+ `).find(r=>r.trim()))==null?void 0:t.trim())??"";return e?e.length>60?`${e.slice(0,60)}…`:e:"Untitled"}function Oi(n){return!n.title||!n.title.trim()}const SE=["hourly","daily","weekly","monthly","yearly"],ux=["MO","TU","WE","TH","FR","SA","SU"];function bF(n){if(!n)return;const e=n.match(/^(\d{4})(\d{2})(\d{2})/);if(e)return`${e[1]}-${e[2]}-${e[3]}`;const t=new Date(n);return Number.isNaN(t.getTime())?void 0:t.toISOString().slice(0,10)}function PE(n){var o;const e=new Map(n.replace(/^RRULE:/i,"").split(";").map(u=>u.split("=")).filter(u=>u.length===2).map(([u,h])=>[u.toUpperCase(),h])),t=(o=e.get("FREQ"))==null?void 0:o.toLowerCase(),r=SE.includes(t)?t:void 0,i=Number(e.get("INTERVAL")??1),s=Number(e.get("COUNT")),l=(e.get("BYDAY")??"").split(",").filter(u=>ux.includes(u));return{preset:r,interval:Number.isFinite(i)&&i>0?i:1,byWeekday:l,count:Number.isFinite(s)&&s>0?s:void 0,until:bF(e.get("UNTIL"))}}const wF=["title","body","tags","priority"];function SF(n,e,t){return!e||!wF.some(i=>i in n)?n:{...n,recurrenceScope:t}}const PF={task:{glyph:"☑",color:"text-blue-600 bg-blue-50 border-blue-100"},note:{glyph:"✎",color:"text-slate-700 bg-slate-50 border-slate-200"},comment:{glyph:"💬",color:"text-amber-700 bg-amber-50 border-amber-100"}};function Y0({kind:n,compact:e=!1}){const t=PF[n];return O.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 h-5 text-xxs rounded border ${t.color}`,title:n,children:[O.jsx("span",{children:t.glyph}),!e&&O.jsx("span",{className:"uppercase tracking-wider",children:n})]})}const CE=[{name:"circle",Icon:Uy},{name:"square",Icon:w6},{name:"triangle",Icon:Q6},{name:"hexagon",Icon:c6},{name:"folder",Icon:o6},{name:"briefcase",Icon:YB},{name:"rocket",Icon:y6},{name:"sparkles",Icon:v6},{name:"target",Icon:P6},{name:"layers",Icon:f6},{name:"code",Icon:KB},{name:"book",Icon:qB},{name:"flame",Icon:s6},{name:"zap",Icon:$6},{name:"star",Icon:S6},{name:"heart",Icon:u6},{name:"box",Icon:VB},{name:"lightbulb",Icon:p6},{name:"pencil",Icon:nj},{name:"hash",Icon:a6}],CF=new Map(CE.map(n=>[n.name,n.Icon]));function QF(n){return n?CF.get(n)??Uy:Uy}const $F=[{name:"gray",value:"#6f6f76"},{name:"red",value:"#ef4444"},{name:"orange",value:"#f59e0b"},{name:"yellow",value:"#eab308"},{name:"green",value:"#10b981"},{name:"teal",value:"#14b8a6"},{name:"cyan",value:"#06b6d4"},{name:"blue",value:"#3b82f6"},{name:"indigo",value:"#5e6ad2"},{name:"purple",value:"#8b5cf6"},{name:"pink",value:"#ec4899"}],QE="#5e6ad2",$E="circle";function TF(n){return n==="circle"||n==="square"||n==="triangle"}function Us({color:n,icon:e,size:t=12,className:r=""}){const i=QF(e),s=TF(e);return O.jsx(i,{size:t,className:`shrink-0 ${r}`,color:n,fill:s?n:"none",strokeWidth:s?1.2:1.8})}function cx({status:n,size:e=14}){const t="currentColor";return n==="done"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusDone shrink-0",children:[O.jsx("circle",{cx:"7",cy:"7",r:"6",fill:"currentColor"}),O.jsx("path",{d:"M4 7.4L6.2 9.5L10 5.5",stroke:"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}):n==="in_progress"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusInProgress shrink-0",children:[O.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:t,strokeWidth:"1.4",fill:"none"}),O.jsx("path",{d:"M7 1 a6 6 0 0 1 0 12 z",fill:"currentColor"})]}):n==="rejected"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusRejected shrink-0",children:[O.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:t,strokeWidth:"1.4",fill:"none"}),O.jsx("path",{d:"M4 4l6 6M10 4l-6 6",stroke:t,strokeWidth:"1.4",strokeLinecap:"round"})]}):O.jsx("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-statusOpen shrink-0",children:O.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:t,strokeWidth:"1.4",fill:"none"})})}function ha({priority:n,size:e=14}){return n==="urgent"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioUrgent shrink-0",children:[O.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2",fill:"currentColor"}),O.jsx("path",{d:"M7 4v3.5M7 9.5h.01",stroke:"white",strokeWidth:"1.6",strokeLinecap:"round"})]}):n==="high"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioHigh shrink-0",children:[O.jsx("rect",{x:"2",y:"8",width:"2.5",height:"4",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"5.75",y:"5",width:"2.5",height:"7",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"9.5",y:"2",width:"2.5",height:"10",rx:"0.5",fill:"currentColor"})]}):n==="medium"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioMedium shrink-0",children:[O.jsx("rect",{x:"2",y:"8",width:"2.5",height:"4",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"5.75",y:"5",width:"2.5",height:"7",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"9.5",y:"2",width:"2.5",height:"10",rx:"0.5",opacity:"0.3",fill:"currentColor"})]}):n==="low"?O.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-prioLow shrink-0",children:[O.jsx("rect",{x:"2",y:"8",width:"2.5",height:"4",rx:"0.5",fill:"currentColor"}),O.jsx("rect",{x:"5.75",y:"5",width:"2.5",height:"7",rx:"0.5",opacity:"0.3",fill:"currentColor"}),O.jsx("rect",{x:"9.5",y:"2",width:"2.5",height:"10",rx:"0.5",opacity:"0.3",fill:"currentColor"})]}):O.jsx("svg",{width:e,height:e,viewBox:"0 0 14 14",className:"text-faint shrink-0",children:O.jsx("line",{x1:"3",y1:"7",x2:"11",y2:"7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeDasharray:"1.5 1.5"})})}function pp({size:n=12,className:e=""}){return O.jsxs("svg",{width:n,height:n,viewBox:"0 0 14 14",fill:"none",className:`shrink-0 ${e}`,"aria-hidden":"true",children:[O.jsx("path",{d:"M2.5 7a4.5 4.5 0 0 1 7.7-3.2L11.5 5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),O.jsx("path",{d:"M11.5 2v3h-3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),O.jsx("path",{d:"M11.5 7a4.5 4.5 0 0 1-7.7 3.2L2.5 9",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),O.jsx("path",{d:"M2.5 12V9h3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]})}const fa={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"No priority"},Ld={open:"Todo",in_progress:"In progress",done:"Done",rejected:"Cancelled"},TE=["open","in_progress","done","rejected"];function U0({trigger:n,children:e,align:t="start"}){const[r,i]=R.useState(!1),[s,l]=R.useState(null),o=R.useRef(null),u=R.useRef(null),h=R.useCallback(()=>{const f=o.current,p=u.current;if(!f||!p)return;const m=8,y=4,k=f.getBoundingClientRect(),b=p.offsetWidth,w=p.offsetHeight,S=window.innerWidth-b-m,Q=k.bottom+y,$=k.top-w-y,A=Q+w<=window.innerHeight-m,I=$>=m,T=t==="end"?k.right-b:k.left,X=A||!I?Q:$,z=window.innerHeight-w-m;l({top:Math.min(Math.max(m,X),Math.max(m,z)),left:Math.min(Math.max(m,T),Math.max(m,S))})},[t]);return R.useEffect(()=>{if(!r)return;const f=m=>{var k,b;const y=m.target;!((k=o.current)!=null&&k.contains(y))&&!((b=u.current)!=null&&b.contains(y))&&i(!1)},p=m=>{m.key==="Escape"&&i(!1)};return window.addEventListener("mousedown",f),window.addEventListener("keydown",p),()=>{window.removeEventListener("mousedown",f),window.removeEventListener("keydown",p)}},[r]),R.useLayoutEffect(()=>{if(!r){l(null);return}h();const f=window.requestAnimationFrame(h);return window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),()=>{window.cancelAnimationFrame(f),window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[r,h]),O.jsxs(O.Fragment,{children:[O.jsx("span",{ref:o,onClick:f=>{f.stopPropagation(),i(p=>!p)},children:n}),r&&RR.createPortal(O.jsx("div",{ref:u,className:"popover",style:{position:"fixed",top:(s==null?void 0:s.top)??-9999,left:(s==null?void 0:s.left)??-9999,visibility:s?"visible":"hidden"},onClick:f=>f.stopPropagation(),children:e(()=>i(!1))}),document.body)]})}function mp({task:n,size:e=14,className:t="",align:r="start",onStatusChange:i}){const s=ql();return O.jsx(U0,{align:r,trigger:O.jsx("button",{type:"button",draggable:!1,className:`inline-flex shrink-0 items-center justify-center rounded p-0.5 -m-0.5 hover:bg-line/40 disabled:opacity-60 ${t}`,onPointerDown:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),onKeyDown:l=>l.stopPropagation(),onKeyUp:l=>l.stopPropagation(),onDragStart:l=>{l.preventDefault(),l.stopPropagation()},disabled:s.isPending,title:`Change status (${Ld[n.status]??n.status})`,"aria-label":"Change status","aria-haspopup":"menu",children:O.jsx(cx,{status:n.status,size:e})}),children:l=>O.jsx(O.Fragment,{children:TE.map(o=>O.jsxs("button",{className:"popover-item",role:"menuitemradio","aria-checked":n.status===o,onClick:u=>{if(u.stopPropagation(),l(),n.status===o)return;const h=n.status;i==null||i(o),s.mutate({id:n.id,fields:{status:o}},{onError:()=>i==null?void 0:i(h)})},children:[O.jsx(cx,{status:o,size:12}),O.jsx("span",{children:Ld[o]??o}),n.status===o&&O.jsx("span",{className:"ml-auto text-faint",children:"✓"})]},o))})})}const jF=600,jE={hourly:"Hourly",daily:"Daily",weekly:"Weekly",monthly:"Monthly",yearly:"Yearly"},EF={hourly:"hour",daily:"day",weekly:"week",monthly:"month",yearly:"year"};function MF(){const{openId:n,close:e}=Gi();return R.useEffect(()=>{if(!n)return;const t=r=>{if(r.key!=="Escape")return;const i=r.target;if(i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.closest(".cm-editor"))){i.blur();return}e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[n,e]),n?O.jsxs("div",{className:"fixed inset-0 z-30 flex",children:[O.jsx("div",{className:"flex-1 bg-ink/10 backdrop-blur-[1px] cursor-pointer",onClick:e}),O.jsx("aside",{className:"w-[min(680px,92vw)] bg-surface border-l border-line shadow-modal flex flex-col",children:O.jsx(AF,{id:n,onClose:e})})]}):null}function AF({id:n,onClose:e}){var $n,Nt;const{data:t,isLoading:r}=zP(n),{data:i}=Tr(),{data:s}=rF(n),{data:l}=zP((t==null?void 0:t.parentId)??void 0),{data:o}=cF((t==null?void 0:t.kind)==="task"?n:void 0),u=ql(),h=vE(),f=kE(),p=hF(),m=fF(),y=dF(),{open:k}=Zt(),{open:b}=Gi(),[w,S]=R.useState(""),[Q,$]=R.useState(""),[A,I]=R.useState(""),[T,X]=R.useState("open"),[z,K]=R.useState(""),[_,G]=R.useState("none"),[F,le]=R.useState(!1),[J,Y]=R.useState("idle"),[pe,ye]=R.useState("future"),ee=R.useRef(null);R.useEffect(()=>{t&&ee.current!==t.id&&(S(t.title??""),$(t.body),I(t.tags.join(", ")),X(t.status),K(t.dueAt?t.dueAt.slice(0,10):""),G(t.priority),le(!1),Y("idle"),ee.current=t.id)},[t==null?void 0:t.id,t]);const ie=R.useMemo(()=>{if(!F||!t||ee.current!==t.id)return null;const Je=t.kind==="note",kt=w.trim(),Xt=kt||(Je?null:kt),wi=A.split(",").map(Gs=>Gs.trim()).filter(Boolean),on={};Xt!==(t.title??"")&&!(Xt===null&&t.title===null)&&Xt!==t.title&&(on.title=Xt===""?null:Xt),Q!==t.body&&(on.body=Q),JSON.stringify(wi)!==JSON.stringify(t.tags)&&(on.tags=wi),T!==t.status&&(on.status=T),_!==t.priority&&(on.priority=_);const Fr=t.dueAt?t.dueAt.slice(0,10):"";return z!==Fr&&(on.dueAt=z?new Date(z).toISOString():null),on},[F,t,w,Q,A,T,_,z]),C=t!=null&&((Nt=($n=t.metadata)==null?void 0:$n.recurrence)==null?void 0:Nt.role)==="occurrence";function D(Je){return SF(Je,C,pe)}if(R.useEffect(()=>{if(!F||!t||!ie||Object.keys(ie).length===0)return;Y("idle");const Je=setTimeout(async()=>{Y("saving");try{await u.mutateAsync({id:t.id,fields:D(ie)}),Y("saved")}catch{Y("error")}},jF);return()=>clearTimeout(Je)},[F,ie]),r||!t)return O.jsxs("div",{className:"p-6 text-sm text-muted flex items-center justify-between",children:[O.jsx("span",{children:"Loading…"}),O.jsx("button",{onClick:e,className:"text-faint hover:text-ink",children:O.jsx(Hy,{size:14})})]});const q=t,E=i==null?void 0:i.find(Je=>Je.id===q.projectId),ce=E?`/p/${E.key}`:"",$e=q.kind==="note",we=ie?Object.keys(ie).length>0:!1;function Ie(){S(q.title??""),$(q.body),I(q.tags.join(", ")),X(q.status),K(q.dueAt?q.dueAt.slice(0,10):""),G(q.priority),Y("idle"),ye("future"),le(!0)}async function _e(){if(!we||!ie){le(!1);return}Y("saving");try{await u.mutateAsync({id:q.id,fields:D(ie)}),Y("saved"),le(!1)}catch{Y("error")}}async function De(){confirm(`Delete "${Cn(t)}"? This cannot be undone.`)&&(await h.mutateAsync(t.id),e())}async function at(){if(!o||!confirm("Skip this recurring occurrence?"))return;const Je=await p.mutateAsync({taskId:q.id});Je.next&&b(Je.next.id)}async function Fn(){!o||!confirm("Stop this recurrence series?")||await m.mutateAsync({ruleId:o.rule.id})}async function Hi(Je,kt){if(!kt)throw new Error("First due date is required");const Xt=q.dueAt?q.dueAt.slice(0,10):"";kt!==Xt&&await u.mutateAsync({id:q.id,fields:{dueAt:new Date(`${kt}T12:00:00Z`).toISOString()}}),await f.mutateAsync({taskId:q.id,input:Je})}async function Vr(Je){if(!o)return;const{dtstart:kt,...Xt}=Je;await y.mutateAsync({ruleId:o.rule.id,input:Xt})}return O.jsxs(O.Fragment,{children:[O.jsxs("header",{className:"h-12 px-3 border-b border-line flex items-center gap-2 shrink-0",children:[O.jsx("button",{onClick:e,className:"p-1 -m-1 text-faint hover:text-ink rounded hover:bg-sidebar",title:"Close (Esc)",children:O.jsx(Hy,{size:16})}),O.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted min-w-0",children:[E&&O.jsxs(O.Fragment,{children:[O.jsxs(ga,{to:ce,className:"flex items-center gap-1 hover:opacity-80",children:[O.jsx(Us,{color:E.color,icon:E.icon,size:12}),O.jsx("span",{className:"font-mono tabular-nums",style:{color:E.color},children:E.key})]}),O.jsx(lp,{size:11,className:"text-faint shrink-0"})]}),O.jsx(Y0,{kind:t.kind,compact:!0}),t.sequenceId&&E&&O.jsxs("span",{className:"font-mono text-faint tabular-nums",children:[E.key,"-",t.sequenceId]})]}),O.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[F&&O.jsx(_F,{state:J,dirty:we}),$e&&O.jsx("button",{className:`p-1 -m-1 rounded hover:bg-sidebar ${t.pinned?"text-accent":"text-faint hover:text-ink"}`,onClick:()=>u.mutate({id:t.id,fields:{pinned:!t.pinned}}),title:t.pinned?"Unpin from opening brief":"Pin to opening brief",children:O.jsx($0,{size:13,fill:t.pinned?"currentColor":"none"})}),F?O.jsx("button",{className:"p-1 -m-1 text-faint hover:text-ink rounded hover:bg-sidebar",onClick:_e,title:"Finish editing",children:O.jsx(Sa,{size:13})}):O.jsx("button",{className:"p-1 -m-1 text-faint hover:text-ink rounded hover:bg-sidebar",onClick:Ie,title:"Edit",children:O.jsx(nj,{size:13})}),O.jsx("button",{className:"p-1 -m-1 text-faint hover:text-danger rounded hover:bg-danger/10",onClick:De,title:"Delete",children:O.jsx(cj,{size:13})})]})]}),O.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin",children:O.jsxs("div",{className:"px-6 py-5 space-y-4",children:[F?O.jsx("input",{className:`w-full text-lg font-semibold bg-transparent border-none outline-none focus:outline-none px-0 py-1 ${w?"":"placeholder:text-muted/60 placeholder:italic"}`,value:w,placeholder:$e?"Untitled":"Title",onChange:Je=>S(Je.target.value),autoFocus:!0}):O.jsx("h2",{className:`text-lg font-semibold py-1 ${Oi(t)?"italic text-muted":"text-ink"}`,children:Cn(t)}),O.jsx(LF,{isEditing:F,isTask:t.kind==="task",status:T,setStatus:X,dueDate:z,setDueDate:K,priority:_,setPriority:G,tagsStr:A,setTagsStr:I,completedAt:t.completedAt,createdAt:t.createdAt,actorKind:t.actorKind,task:q.kind==="task"?{...q,status:T}:void 0,onStatusChange:X,recurrence:o,recurrenceBusy:u.isPending||f.isPending||p.isPending||m.isPending||y.isPending,onSaveRecurrence:Hi,onSkipOccurrence:at,onStopRecurrence:Fn,onSplitRecurrence:Vr,isRecurringOccurrence:C,occurrenceScope:pe,setOccurrenceScope:ye}),$e&&l&&O.jsxs("button",{className:"w-full text-left flex items-center gap-2 text-xs px-3 py-2 rounded border border-line bg-sidebar/50 hover:border-accent hover:bg-accentSoft/40 transition-colors",onClick:()=>b(l.id),title:"Open linked task",children:[O.jsx(m6,{size:12,className:"text-faint"}),O.jsx("span",{className:"text-faint",children:"Linked to task:"}),l.sequenceId&&E&&O.jsxs("span",{className:"font-mono text-faint tabular-nums",children:[E.key,"-",l.sequenceId]}),O.jsx("span",{className:"text-ink truncate",children:Cn(l)})]}),O.jsx("div",{className:"border border-line rounded-md overflow-hidden bg-surface",children:F?O.jsx(C0,{value:Q,onChange:Je=>$(Je),extensions:[iT()],basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1},theme:"light",minHeight:"220px",placeholder:"Write in Markdown…"}):Q?O.jsx("div",{className:"min-h-[120px] p-3",children:O.jsx(XP,{body:Q})}):O.jsx("div",{className:"min-h-[120px] p-3 text-xs text-faint",children:"No description."})}),F&&Q&&O.jsxs("details",{className:"text-xxs text-muted",children:[O.jsx("summary",{className:"cursor-pointer hover:text-ink",children:"Preview rendered Markdown"}),O.jsx("div",{className:"mt-2 p-3 border border-line rounded bg-sidebar/30",children:O.jsx(XP,{body:Q})})]}),t.kind==="task"&&O.jsx(DF,{related:s??[],onOpen:b,onAdd:()=>{E&&k({kind:"quick-create",projectId:E.id,initialKind:"note",parentId:t.id})},project:E})]})})]})}function RF(n){const e=n.rule,t=PE(e.rrule),r=t.preset??"daily",i=t.interval??1,s=i>1?`Every ${i} ${EF[r]}s`:jE[r],l=t.byWeekday.length?` · ${t.byWeekday.join(", ")}`:"",o=e.anchor==="completion"?"after completion":"scheduled",u=e.enabled?"":" · stopped",h=e.nextOccurrenceAt?` · next ${new Date(e.nextOccurrenceAt).toLocaleDateString()}`:"";return`${s}${l} · ${o}${h}${u}`}function ZP(n){const e=n?PE(n.rule.rrule):void 0;return{preset:n?(e==null?void 0:e.preset)??"weekly":"none",interval:(e==null?void 0:e.interval)??1,anchor:(n==null?void 0:n.rule.anchor)??"scheduled",byWeekday:(e==null?void 0:e.byWeekday)??[],count:e!=null&&e.count?String(e.count):"",until:(e==null?void 0:e.until)??""}}function NF({isEditing:n,task:e,dueDate:t,recurrence:r,onSave:i,onSkip:s,onStop:l,onSplit:o,busy:u}){const[h,f]=R.useState(()=>ZP(r)),[p,m]=R.useState(null);if(R.useEffect(()=>{f(ZP(r)),m(null)},[n,e==null?void 0:e.id,e==null?void 0:e.dueAt,r==null?void 0:r.rule.id,r==null?void 0:r.rule.rrule,r==null?void 0:r.rule.anchor]),!e)return null;const y=["done","rejected"].includes(e.status),k=!!(r!=null&&r.rule.enabled)&&(r==null?void 0:r.rule.currentOccurrenceId)===e.id,b=!!(r!=null&&r.rule.enabled),w=h.preset!=="none",S=!!i&&t.length>0&&w&&h.interval>=1,Q=!!o&&!!(r!=null&&r.rule.enabled)&&w&&h.interval>=1;function $(z){f(K=>({...K,...z})),m(null)}function A(z){const K=new Set(h.byWeekday);K.has(z)?K.delete(z):K.add(z),$({byWeekday:ux.filter(_=>K.has(_))})}function I(){const z={preset:h.preset,interval:h.interval,anchor:h.anchor,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,allDay:!0};return h.preset==="weekly"&&h.byWeekday.length>0&&(z.byWeekday=h.byWeekday),h.count&&(z.count=Number(h.count)),h.until&&(z.until=new Date(`${h.until}T23:59:59Z`).toISOString()),z}async function T(){if(h.preset==="none"){m(null);return}if(!t){m("Set due date first");return}if(h.count&&h.until){m("Use count or until");return}try{await(i==null?void 0:i(I(),t)),m(null)}catch(z){m(z instanceof Error?z.message:"Could not save repeat")}}async function X(){if(h.preset!=="none"){if(h.count&&h.until){m("Use count or until");return}try{await(o==null?void 0:o(I())),m(null)}catch(z){m(z instanceof Error?z.message:"Could not split series")}}}return!n||y?O.jsxs("span",{className:"min-w-0 flex items-center gap-2",children:[O.jsx("span",{className:r?"text-muted truncate":"text-faint",children:r?RF(r):"None"}),k&&s&&O.jsx("button",{className:"text-faint hover:text-ink disabled:opacity-40 shrink-0",onClick:s,disabled:u,title:"Skip occurrence",children:"Skip"})]}):O.jsxs("span",{className:"min-w-0 flex flex-col gap-1",children:[O.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[O.jsxs("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.preset,onChange:z=>$({preset:z.target.value}),title:"Repeat",children:[O.jsx("option",{value:"none",children:"None"}),SE.map(z=>O.jsx("option",{value:z,children:jE[z]},z))]}),w&&O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"number",min:1,max:999,className:"w-14 bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.interval,onChange:z=>$({interval:Math.max(1,Number(z.target.value)||1)}),title:"Interval"}),O.jsxs("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.anchor,onChange:z=>$({anchor:z.target.value}),title:"Anchor",children:[O.jsx("option",{value:"scheduled",children:"Scheduled"}),O.jsx("option",{value:"completion",children:"Completion"})]}),O.jsx("button",{className:"text-accent hover:underline disabled:opacity-40",onClick:T,disabled:u||!S,children:"Save"}),Q&&O.jsx("button",{className:"text-faint hover:text-ink disabled:opacity-40",onClick:X,disabled:u,title:"Keep past occurrences on the old cadence; apply this cadence going forward",children:"Split"})]}),b&&l&&O.jsx("button",{className:"text-faint hover:text-danger disabled:opacity-40",onClick:l,disabled:u,title:"Stop series",children:"Stop"})]}),w&&h.preset==="weekly"&&O.jsx("span",{className:"flex flex-wrap gap-1",children:ux.map(z=>O.jsx("button",{type:"button",className:`px-1.5 py-0.5 rounded border text-[10px] ${h.byWeekday.includes(z)?"border-accent bg-accentSoft text-accent":"border-line bg-surface text-muted hover:text-ink"}`,onClick:()=>A(z),children:z},z))}),w&&O.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[O.jsx("input",{type:"number",min:1,max:1e4,className:"w-20 bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.count,onChange:z=>$({count:z.target.value,until:z.target.value?"":h.until}),placeholder:"Count",title:"Count"}),O.jsx("input",{type:"date",className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:h.until,onChange:z=>$({until:z.target.value,count:z.target.value?"":h.count}),title:"Until"}),!t&&O.jsx("span",{className:"text-faint text-xxs",children:"Set due date first"}),p&&O.jsx("span",{className:"text-danger text-xxs truncate",children:p})]})]})}function LF({isEditing:n,isTask:e,status:t,setStatus:r,dueDate:i,setDueDate:s,priority:l,setPriority:o,tagsStr:u,setTagsStr:h,completedAt:f,createdAt:p,actorKind:m,task:y,onStatusChange:k,recurrence:b,recurrenceBusy:w,onSaveRecurrence:S,onSkipOccurrence:Q,onStopRecurrence:$,onSplitRecurrence:A,isRecurringOccurrence:I,occurrenceScope:T,setOccurrenceScope:X}){return O.jsxs("div",{className:"grid grid-cols-[80px_1fr] gap-x-3 gap-y-1.5 items-center text-xs",children:[e&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Status"}),O.jsxs("span",{className:"flex items-center gap-1.5",children:[n||!y?O.jsx(cx,{status:t,size:12}):O.jsx(mp,{task:y,size:12,onStatusChange:k}),n?O.jsx("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:t,onChange:z=>r(z.target.value),children:TE.map(z=>O.jsx("option",{value:z,children:Ld[z]??z},z))}):O.jsx("span",{className:"text-ink",children:Ld[t]??t})]}),O.jsx("span",{className:"text-faint",children:"Due"}),O.jsx("span",{className:"flex items-center gap-1.5",children:n?O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"date",className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:i,onChange:z=>s(z.target.value)}),!i&&O.jsx("span",{className:"text-faint text-xxs",children:"inbox"}),i&&O.jsx("button",{className:"text-faint hover:text-danger text-xxs",onClick:()=>s(""),title:"Clear",children:"✕"})]}):O.jsx("span",{className:i?"text-ink":"text-faint text-xxs",children:i||"inbox"})}),(b||n&&y&&!["done","rejected"].includes(t))&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Repeat"}),O.jsx(NF,{isEditing:n,task:y,dueDate:i,recurrence:b,busy:!!w,onSave:S,onSkip:Q,onStop:$,onSplit:A})]}),n&&I&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Apply to"}),O.jsx("span",{className:"flex items-center gap-1.5",children:O.jsxs("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:T??"future",onChange:z=>X==null?void 0:X(z.target.value),title:"Recurrence edit scope",children:[O.jsx("option",{value:"future",children:"This and future"}),O.jsx("option",{value:"this",children:"This occurrence only"})]})})]}),O.jsx("span",{className:"text-faint",children:"Priority"}),O.jsxs("span",{className:"flex items-center gap-1.5",children:[O.jsx(ha,{priority:l,size:12}),n?O.jsx("select",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:l,onChange:z=>o(z.target.value),children:wE.map(z=>O.jsx("option",{value:z,children:fa[z]},z))}):O.jsx("span",{className:"text-ink",children:fa[l]})]}),t==="done"&&O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"text-faint",children:"Completed"}),O.jsx("span",{className:"text-muted",children:f?new Date(f).toLocaleString():"Not recorded"})]})]}),O.jsx("span",{className:"text-faint",children:"Tags"}),n?O.jsx("input",{className:"bg-transparent border-none text-xs text-ink hover:bg-sidebar rounded px-1 -mx-1 focus:outline-none focus:ring-1 focus:ring-accent",value:u,onChange:z=>h(z.target.value),placeholder:"comma, separated"}):O.jsx("span",{className:u?"text-muted":"text-faint",children:u||"none"}),O.jsx("span",{className:"text-faint",children:"Created"}),O.jsxs("span",{className:"text-muted",children:[new Date(p).toLocaleString()," · ",O.jsx("span",{className:"text-ink",children:m})]})]})}function _F({state:n,dirty:e}){return n==="saving"?O.jsxs("span",{className:"flex items-center gap-1 text-xxs text-muted",children:[O.jsx(ej,{size:11,className:"animate-spin"}),"Saving…"]}):n==="saved"&&!e?O.jsxs("span",{className:"flex items-center gap-1 text-xxs text-faint",children:[O.jsx(HB,{size:11}),"Saved"]}):n==="error"?O.jsx("span",{className:"text-xxs text-danger",children:"Save failed"}):e?O.jsxs("span",{className:"flex items-center gap-1 text-xxs text-faint",children:[O.jsx(GB,{size:11}),"Unsaved"]}):null}function DF({related:n,onOpen:e,onAdd:t,project:r}){const i=n.filter(s=>s.kind==="note");return O.jsxs("div",{children:[O.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[O.jsxs("h3",{className:"text-xxs uppercase tracking-wider text-muted font-semibold",children:["Related notes ",O.jsx("span",{className:"text-faint",children:i.length})]}),O.jsx("button",{onClick:t,className:"text-xs text-accent hover:underline",children:"+ Add note"})]}),i.length===0?O.jsx("div",{className:"text-xs text-faint border border-dashed border-line rounded p-3 text-center",children:"No linked notes yet."}):O.jsx("div",{className:"border border-line rounded-md divide-y divide-lineSoft overflow-hidden",children:i.map(s=>O.jsxs("button",{className:"w-full text-left px-3 py-2 hover:bg-sidebar flex items-start gap-2",onClick:()=>e(s.id),children:[O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:`text-sm truncate ${Oi(s)?"italic text-muted":"text-ink"}`,children:Cn(s)}),!Oi(s)&&s.body&&O.jsx("div",{className:"text-xxs text-muted truncate mt-0.5",children:s.body.replace(/\n/g," ").slice(0,140)})]}),s.pinned&&O.jsx($0,{size:11,className:"text-accent shrink-0 mt-1",fill:"currentColor"})]},s.id))}),!r&&O.jsx("div",{className:"text-xxs text-faint mt-1",children:"No project context — link picker unavailable."})]})}function XP({body:n}){return O.jsx("div",{className:"text-sm leading-relaxed text-ink space-y-2 [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mb-1.5 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1 [&_h3]:font-semibold [&_h3]:mt-2 [&_p]:my-1 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-0.5 [&_code]:bg-sidebar [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs [&_pre]:bg-sidebar [&_pre]:p-2 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_a]:text-accent [&_a]:underline [&_blockquote]:border-l-2 [&_blockquote]:border-line [&_blockquote]:pl-3 [&_blockquote]:text-muted [&_table]:border-collapse [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1 [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1",children:O.jsx(Vj,{remarkPlugins:[gE],children:n})})}function hx(n,e){const[t,r]=R.useState(()=>{if(typeof window>"u")return e;try{const s=window.localStorage.getItem(n);return s===null?e:JSON.parse(s)}catch{return e}});R.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n,JSON.stringify(t))}catch{}},[n,t]);const i=R.useCallback(s=>r(s),[]);return[t,i]}const Zl={planned:"Planned",active:"Active",watching:"Watching",paused:"Paused",archived:"Archived"},EE={planned:"Committed, not started",active:"Currently being built",watching:"Built, in maintenance",paused:"Intentionally on hold",archived:"Hidden from active work"},fx=["planned","active","watching","paused","archived"],kO={key:"Key (A→Z)",name:"Name (A→Z)",recent:"Recently active"},BP={archived:!0};function IF(n,e){const t=[...n];return e==="key"?t.sort((r,i)=>r.key.localeCompare(i.key)):e==="name"?t.sort((r,i)=>r.name.localeCompare(i.name)):t.sort((r,i)=>+new Date(i.updatedAt)-+new Date(r.updatedAt))}function zF(){const{open:n}=Zt(),{key:e}=Bd(),[t,r]=hx("botnote.projectSort","key"),[i,s]=hx("botnote.sidebar.projectGroups.collapsed",BP),{data:l,isLoading:o}=Tr({includeArchived:!0}),u=R.useMemo(()=>{const m=l??[];return new Map(fx.map(y=>[y,IF(m.filter(k=>k.status===y),t)]))},[l,t]),h=(l==null?void 0:l.length)??0,f=m=>i[m]??BP[m]??!1,p=m=>{const y=f(m);s({...i,[m]:!y})};return O.jsxs("aside",{className:"w-52 shrink-0 border-r border-line bg-sidebar flex flex-col scrollbar-thin overflow-y-auto text-sm",children:[O.jsxs("nav",{className:"px-1.5 pt-2 space-y-px",children:[O.jsx(Pu,{to:"/",end:!0,icon:O.jsx(UB,{size:12,className:"opacity-70"}),label:"Tasks"}),O.jsx(Pu,{to:"/today",icon:O.jsx(aj,{size:12,className:"opacity-70"}),label:"Today"}),O.jsx(Pu,{to:"/inbox",icon:O.jsx(Ed,{size:12,className:"opacity-70"}),label:"Inbox"}),O.jsx(Pu,{to:"/dashboard",icon:O.jsx(d6,{size:12,className:"opacity-70"}),label:"Workspace"})]}),O.jsxs("div",{className:"mt-3 px-3 py-1.5 flex items-center justify-between",children:[O.jsx("div",{className:"text-xxs uppercase tracking-wider text-muted font-medium",children:"Projects"}),O.jsxs("div",{className:"flex items-center gap-0.5",children:[O.jsx(U0,{trigger:O.jsx("button",{className:"text-muted hover:text-ink p-0.5 rounded hover:bg-sidebarHover flex items-center gap-0.5",title:`Sort: ${kO[t]}`,children:O.jsx(Yy,{size:11})}),align:"end",children:m=>O.jsx(O.Fragment,{children:Object.keys(kO).map(y=>O.jsxs("button",{className:"popover-item",onClick:()=>{r(y),m()},children:[O.jsx("span",{children:kO[y]}),t===y&&O.jsx("span",{className:"ml-auto text-faint",children:"✓"})]},y))})}),O.jsx("button",{className:"text-muted hover:text-ink p-0.5 rounded hover:bg-sidebarHover",title:"New project (n)",onClick:()=>n({kind:"new-project"}),children:O.jsx(op,{size:11})})]})]}),O.jsxs("nav",{className:"px-1.5 space-y-px flex-1",children:[o&&O.jsx("div",{className:"px-2 py-1 text-xs text-faint",children:"Loading…"}),!o&&h===0&&O.jsxs("button",{className:"w-full text-left px-2 py-1 text-xs text-muted hover:bg-sidebarHover rounded",onClick:()=>n({kind:"new-project"}),children:["No projects yet. ",O.jsx("span",{className:"text-accent",children:"Create →"})]}),fx.map(m=>{const y=u.get(m)??[];if(o||y.length===0)return null;const k=f(m);return O.jsxs("div",{className:"pt-2 first:pt-0",children:[O.jsxs("button",{type:"button",className:"w-full px-1.5 pb-1 flex items-center gap-1 text-xxs uppercase tracking-wider text-muted font-medium hover:text-ink",onClick:()=>p(m),title:`${k?"Expand":"Collapse"} ${Zl[m]}`,children:[k?O.jsx(lp,{size:10}):O.jsx(Yy,{size:10}),O.jsx("span",{children:Zl[m]}),O.jsx("span",{className:"ml-auto text-faint tabular-nums",children:y.length})]}),!k&&y.map(b=>O.jsx(ZF,{project:b,activeKey:e},b.id))]},m)})]}),O.jsx("div",{className:"border-t border-line/60 px-1.5 py-1.5",children:O.jsx(Pu,{to:"/settings",icon:O.jsx(Q0,{size:12,className:"opacity-70"}),label:"Settings"})})]})}function ZF({project:n,activeKey:e}){return O.jsxs(I2,{to:`/p/${n.key}`,title:n.status==="archived"?`${n.name} (archived)`:n.name,className:({isActive:t})=>`flex items-center gap-2 px-2 py-1 text-xs rounded ${t||e===n.key?"bg-accentSoft text-accentText":"text-ink2 hover:bg-sidebarHover"} ${n.status==="archived"?"opacity-60":""}`,children:[O.jsx(Us,{color:n.color,icon:n.icon,size:11}),O.jsx("span",{className:"font-mono text-xxs tabular-nums opacity-90 shrink-0",style:{color:n.color},children:n.key}),O.jsx("span",{className:"truncate text-muted",children:n.name})]})}function Pu({to:n,end:e,icon:t,label:r}){return O.jsxs(I2,{to:n,end:e,className:({isActive:i})=>`flex items-center gap-2 px-2 py-1 rounded text-xs ${i?"bg-accentSoft text-accentText":"text-ink2 hover:bg-sidebarHover"}`,children:[t,O.jsx("span",{children:r})]})}function XF(){const{open:n}=Zt(),e=Vs(),t=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘":"Ctrl";async function r(){try{await tt.logout()}catch{}e("/login",{replace:!0})}return O.jsxs("header",{className:"h-11 flex items-center justify-between px-3 border-b border-line bg-surface",children:[O.jsxs(ga,{to:"/",className:"flex items-center gap-1.5 text-ink hover:opacity-90",children:[O.jsx("img",{src:"/favicon.svg",alt:"","aria-hidden":"true",className:"w-[18px] h-[18px]"}),O.jsx("span",{className:"text-xs font-semibold tracking-tight",children:"botnote"})]}),O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsxs("button",{className:"btn !pl-2 !pr-1.5 gap-2 min-w-[220px] !justify-between text-muted",onClick:()=>n({kind:"search"}),title:"Search (⌘K)",children:[O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx(lj,{size:12}),O.jsx("span",{className:"text-xs",children:"Search…"})]}),O.jsxs("kbd",{children:[t,"K"]})]}),O.jsxs("button",{className:"btn btn-primary",onClick:()=>n({kind:"quick-create"}),title:"Quick create (c)",children:[O.jsx(op,{size:12}),O.jsx("span",{className:"text-xs",children:"New"}),O.jsx("kbd",{className:"!bg-white/15 !border-white/25 !text-white",children:"c"})]}),O.jsx("button",{className:"btn !px-1.5 !py-1 text-muted hover:!text-red-500",onClick:r,title:"Log out","aria-label":"Log out",children:O.jsx(tj,{size:12})})]})]})}function BF(){return W5(),O.jsxs("div",{className:"h-full w-full flex flex-col",children:[O.jsx(XF,{}),O.jsxs("div",{className:"flex-1 min-h-0 flex",children:[O.jsx(zF,{}),O.jsx("main",{className:"flex-1 min-w-0 min-h-0 overflow-hidden bg-bg",children:O.jsx(P5,{})})]}),O.jsx(MF,{})]})}function ME({icon:n,color:e,onIconChange:t,onColorChange:r}){return O.jsxs("div",{className:"space-y-2",children:[O.jsxs("div",{children:[O.jsx("div",{className:"text-xxs text-muted uppercase tracking-wider mb-1",children:"Color"}),O.jsx("div",{className:"flex flex-wrap gap-1.5",children:$F.map(i=>O.jsx("button",{type:"button",onClick:()=>r(i.value),className:"relative w-6 h-6 rounded-full border border-line/80 hover:scale-110 transition-transform",style:{backgroundColor:i.value},title:i.name,children:e===i.value&&O.jsx(Sa,{size:12,className:"absolute inset-0 m-auto text-white",strokeWidth:3})},i.value))})]}),O.jsxs("div",{children:[O.jsx("div",{className:"text-xxs text-muted uppercase tracking-wider mb-1",children:"Icon"}),O.jsx("div",{className:"flex flex-wrap gap-1",children:CE.map(i=>O.jsx("button",{type:"button",onClick:()=>t(i.name),className:`w-7 h-7 rounded flex items-center justify-center border transition-colors ${n===i.name?"border-accent bg-accentSoft":"border-line bg-surface hover:bg-sidebar"}`,title:i.name,children:O.jsx(Us,{color:e,icon:i.name,size:14})},i.name))})]})]})}function kc({title:n,children:e,width:t="max-w-2xl"}){const{close:r}=Zt();return R.useEffect(()=>{const i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i}},[]),O.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-20 px-4 bg-ink/20",onClick:r,children:O.jsxs("div",{className:`w-full ${t} bg-surface border border-line rounded-lg shadow-2xl overflow-hidden`,onClick:i=>i.stopPropagation(),children:[O.jsxs("div",{className:"h-9 px-3 flex items-center justify-between border-b border-line",children:[O.jsx("div",{className:"text-xs font-semibold text-ink",children:n}),O.jsx("button",{onClick:r,className:"text-muted hover:text-ink p-0.5 rounded hover:bg-line/60",title:"Close (Esc)",children:O.jsx(Hy,{size:14})})]}),e]})})}function WF({projectId:n}){const{data:e}=nF(n),t=mF(),{close:r}=Zt(),[i,s]=R.useState(""),[l,o]=R.useState("active"),[u,h]=R.useState(QE),[f,p]=R.useState($E);if(R.useEffect(()=>{e&&(s(e.name),o(e.status),h(e.color),p(e.icon))},[e==null?void 0:e.id,e==null?void 0:e.name,e==null?void 0:e.status,e==null?void 0:e.color,e==null?void 0:e.icon]),!e)return O.jsx(kc,{title:"Project settings",width:"max-w-md",children:O.jsx("div",{className:"p-4 text-sm text-muted",children:"Loading…"})});const m=e,y=i!==m.name||l!==m.status||u!==m.color||f!==m.icon,k=i.trim().length>0;return O.jsx(kc,{title:`Settings · ${m.key}`,width:"max-w-md",children:O.jsxs("form",{onSubmit:async b=>{b.preventDefault(),!(!y||!k)&&(await t.mutateAsync({id:m.id,fields:{name:i.trim(),status:l,color:u,icon:f}}),r())},className:"p-3 space-y-3",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Name"}),O.jsx("input",{autoFocus:!0,className:"input",value:i,onChange:b=>s(b.target.value)})]}),O.jsx(ME,{icon:f,color:u,onIconChange:p,onColorChange:h}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Status"}),O.jsx("select",{className:"input",value:l,onChange:b=>o(b.target.value),children:bE.map(b=>O.jsxs("option",{value:b,children:[Zl[b]," · ",EE[b]]},b))})]}),O.jsx("div",{className:"flex justify-end items-center pt-1",children:O.jsxs("div",{className:"flex gap-2",children:[O.jsx("button",{type:"button",className:"btn",onClick:r,children:"Cancel"}),O.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!y||!k||t.isPending,children:t.isPending?"Saving…":"Save"})]})}),t.error&&O.jsx("div",{className:"text-xs text-danger",children:t.error.message})]})})}function qF(){const[n,e]=R.useState(""),[t,r]=R.useState(""),[i,s]=R.useState("active"),[l,o]=R.useState(""),[u,h]=R.useState(QE),[f,p]=R.useState($E),m=pF(),{close:y}=Zt(),k=Vs(),b=/^[A-Z][A-Z0-9_]{0,19}$/.test(n)&&t.trim().length>0;return O.jsx(kc,{title:"New project",width:"max-w-md",children:O.jsxs("form",{onSubmit:async w=>{if(w.preventDefault(),!b)return;const S=await m.mutateAsync({key:n.trim(),name:t.trim(),status:i,color:u,icon:f,agentsMd:l.trim()});y(),k(`/p/${S.key}`)},className:"p-3 space-y-3",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Key (uppercase, e.g. BOT)"}),O.jsx("input",{autoFocus:!0,className:"input font-mono uppercase",value:n,onChange:w=>e(w.target.value.toUpperCase()),placeholder:"BOT",maxLength:20})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Name"}),O.jsx("input",{className:"input",value:t,onChange:w=>r(w.target.value),placeholder:"botnote"})]}),O.jsx(ME,{icon:f,color:u,onIconChange:p,onColorChange:h}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"Status"}),O.jsx("select",{className:"input",value:i,onChange:w=>s(w.target.value),children:bE.map(w=>O.jsxs("option",{value:w,children:[Zl[w]," · ",EE[w]]},w))})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xxs text-muted uppercase tracking-wider mb-1",children:"AGENTS.md (optional)"}),O.jsx("textarea",{className:"input !h-24 py-1.5 font-mono text-xs leading-snug resize-y",value:l,onChange:w=>o(w.target.value),placeholder:`## Critical
465
+ - ALWAYS run pnpm typecheck before commit.`})]}),O.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[O.jsx("button",{type:"button",className:"btn",onClick:y,children:"Cancel"}),O.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!b||m.isPending,children:m.isPending?"Creating…":"Create project"})]}),m.error&&O.jsx("div",{className:"text-xs text-danger",children:m.error.message})]})})}function VF({initialProjectId:n,initialKind:e,initialParentId:t}){const{data:r}=Tr(),[i,s]=R.useState(e??"task"),[l,o]=R.useState(n??""),[u,h]=R.useState(""),[f,p]=R.useState(""),[m,y]=R.useState(""),[k,b]=R.useState(""),[w,S]=R.useState("none"),[Q,$]=R.useState("none"),[A,I]=R.useState(1),[T,X]=R.useState("scheduled"),[z,K]=R.useState(!1),[_,G]=R.useState(t??""),F=gF(),le=kE(),{close:J}=Zt(),{open:Y}=Gi(),pe=r==null?void 0:r.find(C=>C.id===l),ye=i==="note",{data:ee}=F0(ye&&l?l:void 0,["task"]),ie=l.length>0&&(ye?u.trim().length>0||f.trim().length>0:u.trim().length>0&&(Q==="none"||k.length>0));return O.jsx(kc,{title:"Quick create",width:"max-w-xl",children:O.jsxs("form",{onSubmit:async C=>{if(C.preventDefault(),!ie)return;const D=u.trim(),q=m.split(",").map(ce=>ce.trim()).filter(Boolean),E=i==="task"?await F.mutateAsync({kind:"task",projectId:l,title:D,body:f.trim(),tags:q,actorKind:"human",dueAt:k?new Date(k).toISOString():null,priority:w}):await F.mutateAsync({kind:"note",projectId:l,title:D||null,body:f.trim(),tags:q,actorKind:"human",pinned:z,parentId:_||null});i==="task"&&Q!=="none"&&await le.mutateAsync({taskId:E.id,input:{preset:Q,interval:A,anchor:T,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,allDay:!0}}),J(),Y(E.id)},className:"p-3 space-y-3",children:[O.jsxs("div",{className:"flex gap-2",children:[O.jsx("div",{className:"seg w-32",children:vF.map(C=>O.jsx("button",{type:"button","data-active":i===C,onClick:()=>s(C),className:"flex-1 justify-center capitalize",children:C},C))}),O.jsxs("select",{className:"input flex-1",value:l,onChange:C=>o(C.target.value),children:[O.jsx("option",{value:"",children:"— pick a project —"}),r==null?void 0:r.map(C=>O.jsxs("option",{value:C.id,children:[C.key," · ",C.name]},C.id))]})]}),O.jsx("input",{autoFocus:!0,className:"input",placeholder:ye?"Title (optional)":"Title",value:u,onChange:C=>h(C.target.value)}),O.jsx("textarea",{className:"input !h-32 py-1.5 font-mono text-xs leading-snug resize-y",placeholder:"Body (Markdown, optional)",value:f,onChange:C=>p(C.target.value)}),O.jsxs("div",{className:"flex gap-2",children:[O.jsx("input",{className:"input flex-1",placeholder:"Tags (comma-separated, optional)",value:m,onChange:C=>y(C.target.value)}),i==="task"&&O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"date",className:"input w-36",value:k,onChange:C=>b(C.target.value),title:"Due date"}),O.jsx("select",{className:"input w-36",value:w,onChange:C=>S(C.target.value),title:"Priority",children:wE.map(C=>O.jsx("option",{value:C,children:fa[C]},C))})]})]}),i==="task"&&O.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_84px_132px] gap-2",children:[O.jsxs("select",{className:"input",value:Q,onChange:C=>$(C.target.value),title:"Repeat",children:[O.jsx("option",{value:"none",children:"Repeat: none"}),O.jsx("option",{value:"hourly",children:"Hourly"}),O.jsx("option",{value:"daily",children:"Daily"}),O.jsx("option",{value:"weekly",children:"Weekly"}),O.jsx("option",{value:"monthly",children:"Monthly"}),O.jsx("option",{value:"yearly",children:"Yearly"})]}),O.jsx("input",{type:"number",min:1,max:999,className:"input",value:A,disabled:Q==="none",onChange:C=>I(Math.max(1,Number(C.target.value)||1)),title:"Repeat interval"}),O.jsxs("select",{className:"input",value:T,disabled:Q==="none",onChange:C=>X(C.target.value),title:"Repeat anchor",children:[O.jsx("option",{value:"scheduled",children:"Scheduled"}),O.jsx("option",{value:"completion",children:"Completion"})]})]}),i==="task"&&w!=="none"&&O.jsxs("div",{className:"flex items-center gap-1.5 text-xxs text-muted",children:[O.jsx(ha,{priority:w,size:11}),O.jsxs("span",{children:[fa[w]," priority"]})]}),ye&&O.jsxs(O.Fragment,{children:[O.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted cursor-pointer",children:[O.jsx("input",{type:"checkbox",checked:z,onChange:C=>K(C.target.checked)}),O.jsx("span",{children:"📌 Pin to project — auto-include in agent opening brief"})]}),ee&&ee.length>0&&O.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[O.jsx("span",{className:"shrink-0",children:"Link to task:"}),O.jsxs("select",{className:"input flex-1 !h-7 text-xs",value:_,onChange:C=>G(C.target.value),children:[O.jsx("option",{value:"",children:"— none —"}),ee.map(C=>O.jsxs("option",{value:C.id,children:[pe!=null&&pe.key&&C.sequenceId?`${pe.key}-${C.sequenceId} · `:"",Cn(C)]},C.id))]})]})]}),O.jsxs("div",{className:"flex justify-between items-center pt-1",children:[O.jsxs("div",{className:"text-xxs text-muted",children:[O.jsx("kbd",{children:"⌘"}),"+",O.jsx("kbd",{children:"Enter"})," to submit · ",O.jsx("kbd",{children:"Esc"})," to close"]}),O.jsxs("div",{className:"flex gap-2",children:[O.jsx("button",{type:"button",className:"btn",onClick:J,children:"Cancel"}),O.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!ie||F.isPending,children:F.isPending?"Creating…":`Create ${i}`})]})]}),F.error&&O.jsx("div",{className:"text-xs text-danger",children:F.error.message})]})})}const FF={task:"task",note:"note",comment:"comment"};function YF(){const[n,e]=R.useState(""),[t,r]=R.useState(""),{close:i}=Zt(),{open:s}=Gi(),{data:l}=Tr();R.useEffect(()=>{const f=setTimeout(()=>r(n.trim()),200);return()=>clearTimeout(f)},[n]);const{data:o,isFetching:u}=xE(t?{query:t,limit:20}:null),h=R.useMemo(()=>{const f=new Map;return l==null||l.forEach(p=>f.set(p.id,p.key)),f},[l]);return O.jsxs(kc,{title:"Search",children:[O.jsx("div",{className:"p-3 pb-1",children:O.jsxs("div",{className:"flex items-center gap-2 px-2 h-9 border border-line rounded bg-surface focus-within:border-accent focus-within:ring-1 focus-within:ring-accentSoft",children:[O.jsx(lj,{size:14,className:"text-muted"}),O.jsx("input",{autoFocus:!0,placeholder:"Hybrid search (BM25 + vector + time decay)",className:"flex-1 bg-transparent border-none outline-none text-sm",value:n,onChange:f=>e(f.target.value)}),u&&O.jsx("span",{className:"text-xxs text-muted",children:"searching…"})]})}),O.jsxs("div",{className:"max-h-[60vh] overflow-y-auto scrollbar-thin",children:[t&&!u&&(!o||o.hits.length===0)&&O.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted",children:"No matches."}),o==null?void 0:o.hits.map(f=>{const p=f.entity.projectId?h.get(f.entity.projectId):null;return O.jsxs("button",{onClick:()=>{i(),s(f.entity.id)},className:"w-full px-3 py-2 row-hover text-left flex items-start gap-3 border-t border-line/60",children:[O.jsx("span",{className:"chip mt-0.5",children:FF[f.entity.kind]}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:"text-sm text-ink truncate",children:Cn(f.entity)}),O.jsx("div",{className:"text-xs text-muted truncate mt-0.5",children:f.entity.body.replace(/\n/g," ").slice(0,140)||"—"}),O.jsxs("div",{className:"text-xxs text-faint mt-0.5 flex gap-2",children:[p&&O.jsxs("span",{children:["· ",p]}),O.jsxs("span",{children:["· score ",f.score.toFixed(3)]}),f.components.bm25&&O.jsx("span",{children:"· bm25"}),f.components.cosine&&O.jsx("span",{children:"· vec"})]})]}),O.jsx(WB,{size:13,className:"text-faint mt-1"})]},f.entity.id)}),o&&O.jsxs("div",{className:"px-3 py-2 text-xxs text-muted border-t border-line/60",children:[o.hits.length," result(s) · embedding ",o.embeddingUsed?"ON":"OFF (BM25-only)"]})]})]})}function UF(){const{active:n}=Zt();if(!n)return null;switch(n.kind){case"search":return O.jsx(YF,{});case"quick-create":return O.jsx(VF,{initialProjectId:n.projectId,initialKind:n.initialKind,initialParentId:n.parentId});case"new-project":return O.jsx(qF,{});case"edit-project":return O.jsx(WF,{projectId:n.projectId})}}const GF=`## Critical
466
466
  - NEVER commit credentials.
467
467
  - ALWAYS run tests before commit.
468
468