@liminalcash/nim-chat 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -0
- package/dist/NimChat.d.ts +4 -0
- package/dist/NimChat.d.ts.map +1 -0
- package/dist/components/ChatInput.d.ts +8 -0
- package/dist/components/ChatInput.d.ts.map +1 -0
- package/dist/components/ChatMessage.d.ts +8 -0
- package/dist/components/ChatMessage.d.ts.map +1 -0
- package/dist/components/ChatPanel.d.ts +17 -0
- package/dist/components/ChatPanel.d.ts.map +1 -0
- package/dist/components/ConfirmationCard.d.ts +10 -0
- package/dist/components/ConfirmationCard.d.ts.map +1 -0
- package/dist/components/LoginPanel.d.ts +7 -0
- package/dist/components/LoginPanel.d.ts.map +1 -0
- package/dist/components/ThinkingIndicator.d.ts +2 -0
- package/dist/components/ThinkingIndicator.d.ts.map +1 -0
- package/dist/fonts/abc-marist/ABCMarist-Black.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-BlackItalic.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-Bold.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-BoldItalic.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-Book.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-BookItalic.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-Medium.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-MediumItalic.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-Regular.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-RegularItalic.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-SemiBold.otf +0 -0
- package/dist/fonts/abc-marist/ABCMarist-SemiBoldItalic.otf +0 -0
- package/dist/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-Bd.otf +0 -0
- package/dist/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-BdIt.otf +0 -0
- package/dist/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-It.otf +0 -0
- package/dist/fonts/helvetica-monospaced-pro/HelveticaMonospacedPro-Rg.otf +0 -0
- package/dist/hooks/useNimWebSocket.d.ts +20 -0
- package/dist/hooks/useNimWebSocket.d.ts.map +1 -0
- package/dist/index.cjs +53 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7515 -0
- package/dist/styles/theme.d.ts +90 -0
- package/dist/styles/theme.d.ts.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/auth.d.ts +12 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/package.json +60 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),j=require("react");function Vr(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Ur=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$r={};function Yn(e,n){return($r.jsx?qr:Ur).test(e)}const Wr=/[ \t\n\f\r]/g;function Yr(e){return typeof e=="object"?e.type==="text"?Xn(e.value):!1:Xn(e)}function Xn(e){return e.replace(Wr,"")===""}class Be{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Be.prototype.normal={};Be.prototype.property={};Be.prototype.space=void 0;function Mt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Be(t,r,n)}function mn(e){return e.toLowerCase()}class ee{constructor(n,t){this.attribute=t,this.property=n}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Xr=0;const D=Se(),X=Se(),dn=Se(),w=Se(),q=Se(),ve=Se(),te=Se();function Se(){return 2**++Xr}const gn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:X,commaOrSpaceSeparated:te,commaSeparated:ve,number:w,overloadedBoolean:dn,spaceSeparated:q},Symbol.toStringTag,{value:"Module"})),tn=Object.keys(gn);class vn extends ee{constructor(n,t,r,i){let l=-1;if(super(n,t),Jn(this,"space",i),typeof r=="number")for(;++l<tn.length;){const o=tn[l];Jn(this,tn[l],(r&gn[o])===gn[o])}}}vn.prototype.defined=!0;function Jn(e,n,t){t&&(e[n]=t)}function Ne(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new vn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[mn(r)]=r,t[mn(l.attribute)]=r}return new Be(n,t,e.space)}const Bt=Ne({properties:{ariaActiveDescendant:null,ariaAtomic:X,ariaAutoComplete:null,ariaBusy:X,ariaChecked:X,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:X,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:X,ariaFlowTo:q,ariaGrabbed:X,ariaHasPopup:null,ariaHidden:X,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:w,ariaLive:null,ariaModal:X,ariaMultiLine:X,ariaMultiSelectable:X,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:X,ariaReadOnly:X,ariaRelevant:null,ariaRequired:X,ariaRoleDescription:q,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:X,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ht(e,n){return n in e?e[n]:n}function Vt(e,n){return Ht(e,n.toLowerCase())}const Jr=Ne({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ve,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:D,allowPaymentRequest:D,allowUserMedia:D,alt:null,as:null,async:D,autoCapitalize:null,autoComplete:q,autoFocus:D,autoPlay:D,blocking:q,capture:null,charSet:null,checked:D,cite:null,className:q,cols:w,colSpan:null,content:null,contentEditable:X,controls:D,controlsList:q,coords:w|ve,crossOrigin:null,data:null,dateTime:null,decoding:null,default:D,defer:D,dir:null,dirName:null,disabled:D,download:dn,draggable:X,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:D,formTarget:null,headers:q,height:w,hidden:dn,high:w,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:D,inputMode:null,integrity:null,is:null,isMap:D,itemId:null,itemProp:q,itemRef:q,itemScope:D,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:D,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:D,muted:D,name:null,nonce:null,noModule:D,noValidate:D,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:D,optimum:w,pattern:null,ping:q,placeholder:null,playsInline:D,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:D,referrerPolicy:null,rel:q,required:D,reversed:D,rows:w,rowSpan:w,sandbox:q,scope:null,scoped:D,seamless:D,selected:D,shadowRootClonable:D,shadowRootDelegatesFocus:D,shadowRootMode:null,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:X,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:D,useMap:null,value:X,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:D,declare:D,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:D,noHref:D,noShade:D,noWrap:D,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:X,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:D,disableRemotePlayback:D,prefix:null,property:null,results:w,security:null,unselectable:null},space:"html",transform:Vt}),Qr=Ne({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:te,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:q,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:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:D,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,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:ve,g2:ve,glyphName:ve,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,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:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,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:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ht}),Ut=Ne({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),qt=Ne({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Vt}),$t=Ne({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Kr={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"},Gr=/[A-Z]/g,Qn=/-[a-z]/g,Zr=/^data[-\w.:]+$/i;function ei(e,n){const t=mn(n);let r=n,i=ee;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Zr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Qn,ti);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Qn.test(l)){let o=l.replace(Gr,ni);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=vn}return new i(r,n)}function ni(e){return"-"+e.toLowerCase()}function ti(e){return e.charAt(1).toUpperCase()}const ri=Mt([Bt,Jr,Ut,qt,$t],"html"),An=Mt([Bt,Qr,Ut,qt,$t],"svg");function ii(e){return e.join(" ").trim()}var Je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nn={},Kn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,li=/\n/g,oi=/^\s*/,ai=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,si=/^:\s*/,ui=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ci=/^[;\s]*/,fi=/^\s+|\s+$/g,pi=`
|
|
2
|
+
`,Gn="/",Zn="*",we="",hi="comment",mi="declaration";function di(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,r=1;function i(g){var x=g.match(li);x&&(t+=x.length);var v=g.lastIndexOf(pi);r=~v?g.length-v:r+g.length}function l(){var g={line:t,column:r};return function(x){return x.position=new o(g),c(),x}}function o(g){this.start=g,this.end={line:t,column:r},this.source=n.source}o.prototype.content=e;function a(g){var x=new Error(n.source+":"+t+":"+r+": "+g);if(x.reason=g,x.filename=n.source,x.line=t,x.column=r,x.source=e,!n.silent)throw x}function s(g){var x=g.exec(e);if(x){var v=x[0];return i(v),e=e.slice(v.length),x}}function c(){s(oi)}function u(g){var x;for(g=g||[];x=p();)x!==!1&&g.push(x);return g}function p(){var g=l();if(!(Gn!=e.charAt(0)||Zn!=e.charAt(1))){for(var x=2;we!=e.charAt(x)&&(Zn!=e.charAt(x)||Gn!=e.charAt(x+1));)++x;if(x+=2,we===e.charAt(x-1))return a("End of comment missing");var v=e.slice(2,x-2);return r+=2,i(v),e=e.slice(x),r+=2,g({type:hi,comment:v})}}function d(){var g=l(),x=s(ai);if(x){if(p(),!s(si))return a("property missing ':'");var v=s(ui),S=g({type:mi,property:et(x[0].replace(Kn,we)),value:v?et(v[0].replace(Kn,we)):we});return s(ci),S}}function f(){var g=[];u(g);for(var x;x=d();)x!==!1&&(g.push(x),u(g));return g}return c(),f()}function et(e){return e?e.replace(fi,we):we}var gi=di,yi=Je&&Je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.default=ki;const xi=yi(gi);function ki(e,n){let t=null;if(!e||typeof e!="string")return t;const r=(0,xi.default)(e),i=typeof n=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:a}=l;i?n(o,a,l):a&&(t=t||{},t[o]=a)}),t}var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.camelCase=void 0;var bi=/^--[a-zA-Z0-9_-]+$/,wi=/-([a-z])/g,Si=/^[^-]+$/,Ci=/^-(webkit|moz|ms|o|khtml)-/,Ii=/^-(ms)-/,Ei=function(e){return!e||Si.test(e)||bi.test(e)},Ti=function(e,n){return n.toUpperCase()},nt=function(e,n){return"".concat(n,"-")},vi=function(e,n){return n===void 0&&(n={}),Ei(e)?e:(e=e.toLowerCase(),n.reactCompat?e=e.replace(Ii,nt):e=e.replace(Ci,nt),e.replace(wi,Ti))};Ge.camelCase=vi;var Ai=Je&&Je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ni=Ai(Nn),Pi=Ge;function yn(e,n){var t={};return!e||typeof e!="string"||(0,Ni.default)(e,function(r,i){r&&i&&(t[(0,Pi.camelCase)(r,n)]=i)}),t}yn.default=yn;var Li=yn;const _i=Wt(Li),Yt=Xt("end"),Pn=Xt("start");function Xt(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};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 zi(e){const n=Pn(e),t=Yt(e);if(n&&t)return{start:n,end:t}}function je(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tt(e.position):"start"in e||"end"in e?tt(e):"line"in e||"column"in e?xn(e):""}function xn(e){return rt(e&&e.line)+":"+rt(e&&e.column)}function tt(e){return xn(e&&e.start)+"-"+xn(e&&e.end)}function rt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?l.ruleId=r:(l.source=r.slice(0,s),l.ruleId=r.slice(s+1))}if(!l.place&&l.ancestors&&l.ancestors){const s=l.ancestors[l.ancestors.length-1];s&&(l.place=s.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=je(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const Ln={}.hasOwnProperty,Di=new Map,Oi=/[A-Z]/g,ji=new Set(["table","tbody","thead","tfoot","tr"]),Fi=new Set(["td","th"]),Jt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ri(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Wi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$i(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?An:ri,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Qt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Qt(e,n,t){if(n.type==="element")return Mi(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Bi(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Vi(e,n,t);if(n.type==="mdxjsEsm")return Hi(e,n);if(n.type==="root")return Ui(e,n,t);if(n.type==="text")return qi(e,n)}function Mi(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(n);const l=Gt(e,n.tagName,!1),o=Yi(e,n);let a=zn(e,n);return ji.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Yr(s):!0})),Kt(e,o,l,n),_n(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Bi(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Me(e,n.position)}function Hi(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Me(e,n.position)}function Vi(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Gt(e,n.name,!0),o=Xi(e,n),a=zn(e,n);return Kt(e,o,l,n),_n(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ui(e,n,t){const r={};return _n(r,zn(e,n)),e.create(n,e.Fragment,r,t)}function qi(e,n){return n.value}function Kt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function _n(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function $i(e,n,t){return r;function r(i,l,o,a){const c=Array.isArray(o.children)?t:n;return a?c(l,o,a):c(l,o)}}function Wi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),s=Pn(r);return n(i,l,o,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Yi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Ln.call(n.properties,i)){const l=Ji(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Fi.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Xi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Me(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Me(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function zn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Di;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const s=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(s){const c=i.get(s)||0;o=s+"-"+c,i.set(s,c+1)}}const a=Qt(e,l,o);a!==void 0&&t.push(a)}return t}function Ji(e,n,t){const r=ei(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Vr(t):ii(t)),r.property==="style"){let i=typeof t=="object"?t:Qi(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Ki(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Kr[r.property]||r.property:r.attribute,t]}}function Qi(e,n){try{return _i(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new K("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Jt+"#cannot-parse-style-attribute",i}}function Gt(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,o;for(;++l<i.length;){const a=Yn(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}else r=Yn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Ln.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Me(e)}function Me(e,n){const t=new K("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Jt+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Ki(e){const n={};let t;for(t in e)Ln.call(e,t)&&(n[Gi(t)]=e[t]);return n}function Gi(e){let n=e.replace(Oi,Zi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Zi(e){return"-"+e.toLowerCase()}const rn={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"]},el={};function nl(e,n){const t=el,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Zt(e,r,i)}function Zt(e,n,t){if(tl(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return it(e.children,n,t)}return Array.isArray(e)?it(e,n,t):""}function it(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Zt(e[i],n,t);return r.join("")}function tl(e){return!!(e&&typeof e=="object")}const lt=document.createElement("i");function Dn(e){const n="&"+e+";";lt.innerHTML=n;const t=lt.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function fe(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function ie(e,n){return e.length>0?(fe(e,e.length,0,n),e):n}const ot={}.hasOwnProperty;function rl(e){const n={};let t=-1;for(;++t<e.length;)il(n,e[t]);return n}function il(e,n){let t;for(t in n){const i=(ot.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){ot.call(i,o)||(i[o]=[]);const a=l[o];ll(i[o],Array.isArray(a)?a:a?[a]:[])}}}function ll(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);fe(e,0,0,r)}function er(e,n){const t=Number.parseInt(e,n);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 Ae(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ce=xe(/[A-Za-z]/),re=xe(/[\dA-Za-z]/),ol=xe(/[#-'*+\--9=?A-Z^-~]/);function kn(e){return e!==null&&(e<32||e===127)}const bn=xe(/\d/),al=xe(/[\dA-Fa-f]/),sl=xe(/[!-/:-@[-`{-~]/);function N(e){return e!==null&&e<-2}function Z(e){return e!==null&&(e<0||e===32)}function B(e){return e===-2||e===-1||e===32}const ul=xe(new RegExp("\\p{P}|\\p{S}","u")),cl=xe(/\s/);function xe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pe(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&re(e.charCodeAt(t+1))&&re(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function $(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(s){return B(s)?(e.enter(t),a(s)):n(s)}function a(s){return B(s)&&l++<i?(e.consume(s),a):(e.exit(t),n(s))}}const fl={tokenize:pl};function pl(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),$(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return N(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const hl={tokenize:ml},at={tokenize:dl};function ml(e){const n=this,t=[];let r=0,i,l,o;return a;function a(T){if(r<t.length){const H=t[r];return n.containerState=H[1],e.attempt(H[0].continuation,s,c)(T)}return c(T)}function s(T){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&A();const H=n.events.length;let F=H,k;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){k=n.events[F][1].end;break}S(r);let V=H;for(;V<n.events.length;)n.events[V][1].end={...k},V++;return fe(n.events,F+1,0,n.events.slice(H)),n.events.length=V,c(T)}return a(T)}function c(T){if(r===t.length){if(!i)return d(T);if(i.currentConstruct&&i.currentConstruct.concrete)return g(T);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(at,u,p)(T)}function u(T){return i&&A(),S(r),d(T)}function p(T){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,g(T)}function d(T){return n.containerState={},e.attempt(at,f,g)(T)}function f(T){return r++,t.push([n.currentConstruct,n.containerState]),d(T)}function g(T){if(T===null){i&&A(),S(0),e.consume(T);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),x(T)}function x(T){if(T===null){v(e.exit("chunkFlow"),!0),S(0),e.consume(T);return}return N(T)?(e.consume(T),v(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(T),x)}function v(T,H){const F=n.sliceStream(T);if(H&&F.push(null),T.previous=l,l&&(l.next=T),l=T,i.defineSkip(T.start),i.write(F),n.parser.lazy[T.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const V=n.events.length;let W=V,L,O;for(;W--;)if(n.events[W][0]==="exit"&&n.events[W][1].type==="chunkFlow"){if(L){O=n.events[W][1].end;break}L=!0}for(S(r),k=V;k<n.events.length;)n.events[k][1].end={...O},k++;fe(n.events,W+1,0,n.events.slice(V)),n.events.length=k}}function S(T){let H=t.length;for(;H-- >T;){const F=t[H];n.containerState=F[1],F[0].exit.call(n,e)}t.length=T}function A(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function dl(e,n,t){return $(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function st(e){if(e===null||Z(e)||cl(e))return 1;if(ul(e))return 2}function On(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const wn={name:"attention",resolveAll:gl,tokenize:yl};function gl(e,n){let t=-1,r,i,l,o,a,s,c,u;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const p={...e[r][1].end},d={...e[t][1].start};ut(p,-s),ut(d,s),o={type:s>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ie(c,[["enter",e[r][1],n],["exit",e[r][1],n]])),c=ie(c,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),c=ie(c,On(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),c=ie(c,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(u=2,c=ie(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):u=0,fe(e,r-1,t-r+3,c),t=r+c.length-u-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function yl(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=st(r);let l;return o;function o(s){return l=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===l)return e.consume(s),a;const c=e.exit("attentionSequence"),u=st(s),p=!u||u===2&&i||t.includes(s),d=!i||i===2&&u||t.includes(r);return c._open=!!(l===42?p:p&&(i||!d)),c._close=!!(l===42?d:d&&(u||!p)),n(s)}}function ut(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const xl={name:"autolink",tokenize:kl};function kl(e,n,t){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(f){return ce(f)?(e.consume(f),o):f===64?t(f):c(f)}function o(f){return f===43||f===45||f===46||re(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,s):(f===43||f===45||f===46||re(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function s(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):f===null||f===32||f===60||kn(f)?t(f):(e.consume(f),s)}function c(f){return f===64?(e.consume(f),u):ol(f)?(e.consume(f),c):t(f)}function u(f){return re(f)?p(f):t(f)}function p(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):d(f)}function d(f){if((f===45||re(f))&&r++<63){const g=f===45?d:p;return e.consume(f),g}return t(f)}}const Ze={partial:!0,tokenize:bl};function bl(e,n,t){return r;function r(l){return B(l)?$(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||N(l)?n(l):t(l)}}const nr={continuation:{tokenize:Sl},exit:Cl,name:"blockQuote",tokenize:wl};function wl(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return B(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function Sl(e,n,t){const r=this;return i;function i(o){return B(o)?$(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(nr,n,t)(o)}}function Cl(e){e.exit("blockQuote")}const tr={name:"characterEscape",tokenize:Il};function Il(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return sl(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const rr={name:"characterReference",tokenize:El};function El(e,n,t){const r=this;let i=0,l,o;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),s}function s(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),l=31,o=re,u(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=al,u):(e.enter("characterReferenceValue"),l=7,o=bn,u(p))}function u(p){if(p===59&&i){const d=e.exit("characterReferenceValue");return o===re&&!Dn(r.sliceSerialize(d))?t(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(p)&&i++<l?(e.consume(p),u):t(p)}}const ct={partial:!0,tokenize:vl},ft={concrete:!0,name:"codeFenced",tokenize:Tl};function Tl(e,n,t){const r=this,i={partial:!0,tokenize:F};let l=0,o=0,a;return s;function s(k){return c(k)}function c(k){const V=r.events[r.events.length-1];return l=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,e.consume(k),u):o<3?t(k):(e.exit("codeFencedFenceSequence"),B(k)?$(e,p,"whitespace")(k):p(k))}function p(k){return k===null||N(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(ct,x,H)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||N(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(k)):B(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$(e,f,"whitespace")(k)):k===96&&k===a?t(k):(e.consume(k),d)}function f(k){return k===null||N(k)?p(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||N(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(k)):k===96&&k===a?t(k):(e.consume(k),g)}function x(k){return e.attempt(i,H,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),S}function S(k){return l>0&&B(k)?$(e,A,"linePrefix",l+1)(k):A(k)}function A(k){return k===null||N(k)?e.check(ct,x,H)(k):(e.enter("codeFlowValue"),T(k))}function T(k){return k===null||N(k)?(e.exit("codeFlowValue"),A(k)):(e.consume(k),T)}function H(k){return e.exit("codeFenced"),n(k)}function F(k,V,W){let L=0;return O;function O(P){return k.enter("lineEnding"),k.consume(P),k.exit("lineEnding"),E}function E(P){return k.enter("codeFencedFence"),B(P)?$(k,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):I(P)}function I(P){return P===a?(k.enter("codeFencedFenceSequence"),z(P)):W(P)}function z(P){return P===a?(L++,k.consume(P),z):L>=o?(k.exit("codeFencedFenceSequence"),B(P)?$(k,Y,"whitespace")(P):Y(P)):W(P)}function Y(P){return P===null||N(P)?(k.exit("codeFencedFence"),V(P)):W(P)}}}function vl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const ln={name:"codeIndented",tokenize:Nl},Al={partial:!0,tokenize:Pl};function Nl(e,n,t){const r=this;return i;function i(c){return e.enter("codeIndented"),$(e,l,"linePrefix",5)(c)}function l(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):t(c)}function o(c){return c===null?s(c):N(c)?e.attempt(Al,o,s)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||N(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function s(c){return e.exit("codeIndented"),n(c)}}function Pl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):N(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):$(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):N(o)?i(o):t(o)}}const Ll={name:"codeText",previous:zl,resolve:_l,tokenize:Dl};function _l(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function zl(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Dl(e,n,t){let r=0,i,l;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),a(p)}function a(p){return p===96?(e.consume(p),r++,a):(e.exit("codeTextSequence"),s(p))}function s(p){return p===null?t(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),s):p===96?(l=e.enter("codeTextSequence"),i=0,u(p)):N(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),s):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||N(p)?(e.exit("codeTextData"),s(p)):(e.consume(p),c)}function u(p){return p===96?(e.consume(p),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(p)):(l.type="codeTextData",c(p))}}class Ol{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&De(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),De(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),De(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);De(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);De(this.left,t.reverse())}}}function De(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ir(e){const n={};let t=-1,r,i,l,o,a,s,c;const u=new Ol(e);for(;++t<u.length;){for(;t in n;)t=n[t];if(r=u.get(t),t&&r[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,l=0,l<s.length&&s[l][1].type==="lineEndingBlank"&&(l+=2),l<s.length&&s[l][1].type==="content"))for(;++l<s.length&&s[l][1].type!=="content";)s[l][1].type==="chunkText"&&(s[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,jl(u,t)),t=n[t],c=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=u.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,t),a.unshift(r),u.splice(i,t-i+1,a))}}return fe(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function jl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,s=[],c={};let u,p,d=-1,f=t,g=0,x=0;const v=[x];for(;f;){for(;e.get(++i)[1]!==f;);l.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),p&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=f,f=f.next}for(f=t;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(x=d+1,v.push(x),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),d=v.length;d--;){const S=a.slice(v[d],v[d+1]),A=l.pop();s.push([A,A+S.length-1]),e.splice(A,2,S)}for(s.reverse(),d=-1;++d<s.length;)c[g+s[d][0]]=g+s[d][1],g+=s[d][1]-s[d][0]-1;return c}const Fl={resolve:Ml,tokenize:Bl},Rl={partial:!0,tokenize:Hl};function Ml(e){return ir(e),e}function Bl(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):N(a)?e.check(Rl,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Hl(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),$(e,l,"linePrefix")}function l(o){if(o===null||N(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function lr(e,n,t,r,i,l,o,a,s){const c=s||Number.POSITIVE_INFINITY;let u=0;return p;function p(S){return S===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(S),e.exit(l),d):S===null||S===32||S===41||kn(S)?t(S):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(S))}function d(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===62?(e.exit("chunkString"),e.exit(a),d(S)):S===null||S===60||N(S)?t(S):(e.consume(S),S===92?g:f)}function g(S){return S===60||S===62||S===92?(e.consume(S),f):f(S)}function x(S){return!u&&(S===null||S===41||Z(S))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(S)):u<c&&S===40?(e.consume(S),u++,x):S===41?(e.consume(S),u--,x):S===null||S===32||S===40||kn(S)?t(S):(e.consume(S),S===92?v:x)}function v(S){return S===40||S===41||S===92?(e.consume(S),x):x(S)}}function or(e,n,t,r,i,l){const o=this;let a=0,s;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(l),u}function u(f){return a>999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(f):f===93?(e.exit(l),e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):N(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||N(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),s||(s=!B(f)),f===92?d:p)}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,p):p(f)}}function ar(e,n,t,r,i,l){let o;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,s):t(d)}function s(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(l),c(d))}function c(d){return d===o?(e.exit(l),s(o)):d===null?t(d):N(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),$(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===o||d===null||N(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?p:u)}function p(d){return d===o||d===92?(e.consume(d),u):u(d)}}function Fe(e,n){let t;return r;function r(i){return N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):B(i)?$(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Vl={name:"definition",tokenize:ql},Ul={partial:!0,tokenize:$l};function ql(e,n,t){const r=this;let i;return l;function l(f){return e.enter("definition"),o(f)}function o(f){return or.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Ae(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):t(f)}function s(f){return Z(f)?Fe(e,c)(f):c(f)}function c(f){return lr(e,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(Ul,p,p)(f)}function p(f){return B(f)?$(e,d,"whitespace")(f):d(f)}function d(f){return f===null||N(f)?(e.exit("definition"),r.parser.defined.push(i),n(f)):t(f)}}function $l(e,n,t){return r;function r(a){return Z(a)?Fe(e,i)(a):t(a)}function i(a){return ar(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return B(a)?$(e,o,"whitespace")(a):o(a)}function o(a){return a===null||N(a)?n(a):t(a)}}const Wl={name:"hardBreakEscape",tokenize:Yl};function Yl(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return N(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const Xl={name:"headingAtx",resolve:Jl,tokenize:Ql};function Jl(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},fe(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Ql(e,n,t){let r=0;return i;function i(u){return e.enter("atxHeading"),l(u)}function l(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Z(u)?(e.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),s(u)):u===null||N(u)?(e.exit("atxHeading"),n(u)):B(u)?$(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function s(u){return u===35?(e.consume(u),s):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Z(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const Kl=["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"],pt=["pre","script","style","textarea"],Gl={concrete:!0,name:"htmlFlow",resolveTo:no,tokenize:to},Zl={partial:!0,tokenize:io},eo={partial:!0,tokenize:ro};function no(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function to(e,n,t){const r=this;let i,l,o,a,s;return c;function c(m){return u(m)}function u(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),p}function p(m){return m===33?(e.consume(m),d):m===47?(e.consume(m),l=!0,x):m===63?(e.consume(m),i=3,r.interrupt?n:h):ce(m)?(e.consume(m),o=String.fromCharCode(m),v):t(m)}function d(m){return m===45?(e.consume(m),i=2,f):m===91?(e.consume(m),i=5,a=0,g):ce(m)?(e.consume(m),i=4,r.interrupt?n:h):t(m)}function f(m){return m===45?(e.consume(m),r.interrupt?n:h):t(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(a++)?(e.consume(m),a===ae.length?r.interrupt?n:I:g):t(m)}function x(m){return ce(m)?(e.consume(m),o=String.fromCharCode(m),v):t(m)}function v(m){if(m===null||m===47||m===62||Z(m)){const ae=m===47,ke=o.toLowerCase();return!ae&&!l&&pt.includes(ke)?(i=1,r.interrupt?n(m):I(m)):Kl.includes(o.toLowerCase())?(i=6,ae?(e.consume(m),S):r.interrupt?n(m):I(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?A(m):T(m))}return m===45||re(m)?(e.consume(m),o+=String.fromCharCode(m),v):t(m)}function S(m){return m===62?(e.consume(m),r.interrupt?n:I):t(m)}function A(m){return B(m)?(e.consume(m),A):O(m)}function T(m){return m===47?(e.consume(m),O):m===58||m===95||ce(m)?(e.consume(m),H):B(m)?(e.consume(m),T):O(m)}function H(m){return m===45||m===46||m===58||m===95||re(m)?(e.consume(m),H):F(m)}function F(m){return m===61?(e.consume(m),k):B(m)?(e.consume(m),F):T(m)}function k(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),s=m,V):B(m)?(e.consume(m),k):W(m)}function V(m){return m===s?(e.consume(m),s=null,L):m===null||N(m)?t(m):(e.consume(m),V)}function W(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||Z(m)?F(m):(e.consume(m),W)}function L(m){return m===47||m===62||B(m)?T(m):t(m)}function O(m){return m===62?(e.consume(m),E):t(m)}function E(m){return m===null||N(m)?I(m):B(m)?(e.consume(m),E):t(m)}function I(m){return m===45&&i===2?(e.consume(m),M):m===60&&i===1?(e.consume(m),J):m===62&&i===4?(e.consume(m),oe):m===63&&i===3?(e.consume(m),h):m===93&&i===5?(e.consume(m),pe):N(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Zl,he,z)(m)):m===null||N(m)?(e.exit("htmlFlowData"),z(m)):(e.consume(m),I)}function z(m){return e.check(eo,Y,he)(m)}function Y(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),P}function P(m){return m===null||N(m)?z(m):(e.enter("htmlFlowData"),I(m))}function M(m){return m===45?(e.consume(m),h):I(m)}function J(m){return m===47?(e.consume(m),o="",le):I(m)}function le(m){if(m===62){const ae=o.toLowerCase();return pt.includes(ae)?(e.consume(m),oe):I(m)}return ce(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),le):I(m)}function pe(m){return m===93?(e.consume(m),h):I(m)}function h(m){return m===62?(e.consume(m),oe):m===45&&i===2?(e.consume(m),h):I(m)}function oe(m){return m===null||N(m)?(e.exit("htmlFlowData"),he(m)):(e.consume(m),oe)}function he(m){return e.exit("htmlFlow"),n(m)}}function ro(e,n,t){const r=this;return i;function i(o){return N(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function io(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const lo={name:"htmlText",tokenize:oo};function oo(e,n,t){const r=this;let i,l,o;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),s}function s(h){return h===33?(e.consume(h),c):h===47?(e.consume(h),F):h===63?(e.consume(h),T):ce(h)?(e.consume(h),W):t(h)}function c(h){return h===45?(e.consume(h),u):h===91?(e.consume(h),l=0,g):ce(h)?(e.consume(h),A):t(h)}function u(h){return h===45?(e.consume(h),f):t(h)}function p(h){return h===null?t(h):h===45?(e.consume(h),d):N(h)?(o=p,J(h)):(e.consume(h),p)}function d(h){return h===45?(e.consume(h),f):p(h)}function f(h){return h===62?M(h):h===45?d(h):p(h)}function g(h){const oe="CDATA[";return h===oe.charCodeAt(l++)?(e.consume(h),l===oe.length?x:g):t(h)}function x(h){return h===null?t(h):h===93?(e.consume(h),v):N(h)?(o=x,J(h)):(e.consume(h),x)}function v(h){return h===93?(e.consume(h),S):x(h)}function S(h){return h===62?M(h):h===93?(e.consume(h),S):x(h)}function A(h){return h===null||h===62?M(h):N(h)?(o=A,J(h)):(e.consume(h),A)}function T(h){return h===null?t(h):h===63?(e.consume(h),H):N(h)?(o=T,J(h)):(e.consume(h),T)}function H(h){return h===62?M(h):T(h)}function F(h){return ce(h)?(e.consume(h),k):t(h)}function k(h){return h===45||re(h)?(e.consume(h),k):V(h)}function V(h){return N(h)?(o=V,J(h)):B(h)?(e.consume(h),V):M(h)}function W(h){return h===45||re(h)?(e.consume(h),W):h===47||h===62||Z(h)?L(h):t(h)}function L(h){return h===47?(e.consume(h),M):h===58||h===95||ce(h)?(e.consume(h),O):N(h)?(o=L,J(h)):B(h)?(e.consume(h),L):M(h)}function O(h){return h===45||h===46||h===58||h===95||re(h)?(e.consume(h),O):E(h)}function E(h){return h===61?(e.consume(h),I):N(h)?(o=E,J(h)):B(h)?(e.consume(h),E):L(h)}function I(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,z):N(h)?(o=I,J(h)):B(h)?(e.consume(h),I):(e.consume(h),Y)}function z(h){return h===i?(e.consume(h),i=void 0,P):h===null?t(h):N(h)?(o=z,J(h)):(e.consume(h),z)}function Y(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||Z(h)?L(h):(e.consume(h),Y)}function P(h){return h===47||h===62||Z(h)?L(h):t(h)}function M(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function J(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),le}function le(h){return B(h)?$(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):pe(h)}function pe(h){return e.enter("htmlTextData"),o(h)}}const jn={name:"labelEnd",resolveAll:co,resolveTo:fo,tokenize:po},ao={tokenize:ho},so={tokenize:mo},uo={tokenize:go};function co(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&fe(e,0,e.length,t),e}function fo(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const s={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",s,n],["enter",c,n]],a=ie(a,e.slice(l+1,l+r+3)),a=ie(a,[["enter",u,n]]),a=ie(a,On(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=ie(a,[["exit",u,n],e[o-2],e[o-1],["exit",c,n]]),a=ie(a,e.slice(o+1)),a=ie(a,[["exit",s,n]]),fe(e,l,e.length,a),e}function po(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(d){return l?l._inactive?p(d):(o=r.parser.defined.includes(Ae(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),s):t(d)}function s(d){return d===40?e.attempt(ao,u,o?u:p)(d):d===91?e.attempt(so,u,o?c:p)(d):o?u(d):p(d)}function c(d){return e.attempt(uo,u,p)(d)}function u(d){return n(d)}function p(d){return l._balanced=!0,t(d)}}function ho(e,n,t){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return Z(p)?Fe(e,l)(p):l(p)}function l(p){return p===41?u(p):lr(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Z(p)?Fe(e,s)(p):u(p)}function a(p){return t(p)}function s(p){return p===34||p===39||p===40?ar(e,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):u(p)}function c(p){return Z(p)?Fe(e,u)(p):u(p)}function u(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),n):t(p)}}function mo(e,n,t){const r=this;return i;function i(a){return or.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Ae(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function go(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const yo={name:"labelStartImage",resolveAll:jn.resolveAll,tokenize:xo};function xo(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const ko={name:"labelStartLink",resolveAll:jn.resolveAll,tokenize:bo};function bo(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const on={name:"lineEnding",tokenize:wo};function wo(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),$(e,n,"linePrefix")}}const Ye={name:"thematicBreak",tokenize:So};function So(e,n,t){let r=0,i;return l;function l(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),s(c)):r>=3&&(c===null||N(c))?(e.exit("thematicBreak"),n(c)):t(c)}function s(c){return c===i?(e.consume(c),r++,s):(e.exit("thematicBreakSequence"),B(c)?$(e,a,"whitespace")(c):a(c))}}const G={continuation:{tokenize:To},exit:Ao,name:"list",tokenize:Eo},Co={partial:!0,tokenize:No},Io={partial:!0,tokenize:vo};function Eo(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:bn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Ye,t,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return t(f)}function s(f){return bn(f)&&++o<10?(e.consume(f),s):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):t(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Ze,r.interrupt?t:u,e.attempt(Co,d,p))}function u(f){return r.containerState.initialBlankLine=!0,l++,d(f)}function p(f){return B(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),d):t(f)}function d(f){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(f)}}function To(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!B(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Io,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function vo(e,n,t){const r=this;return $(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function Ao(e){e.exit(this.containerState.type)}function No(e,n,t){const r=this;return $(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!B(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const ht={name:"setextUnderline",resolveTo:Po,tokenize:Lo};function Po(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function Lo(e,n,t){const r=this;let i;return l;function l(c){let u=r.events.length,p;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){p=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,o(c)):t(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),B(c)?$(e,s,"lineSuffix")(c):s(c))}function s(c){return c===null||N(c)?(e.exit("setextHeadingLine"),n(c)):t(c)}}const _o={tokenize:zo};function zo(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Fl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Do={resolveAll:ur()},Oo=sr("string"),jo=sr("text");function sr(e){return{resolveAll:ur(e==="text"?Fo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(u){return c(u)?l(u):a(u)}function a(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),s}function s(u){return c(u)?(t.exit("data"),l(u)):(t.consume(u),s)}function c(u){if(u===null)return!0;const p=i[u];let d=-1;if(p)for(;++d<p.length;){const f=p[d];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function ur(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function Fo(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,s;for(;l--;){const c=i[l];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)s=!0,a++;else if(c!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const c={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(t,0,["enter",c,n],["exit",c,n]),t+=2)}t++}return e}const Ro={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:nr},Mo={91:Vl},Bo={[-2]:ln,[-1]:ln,32:ln},Ho={35:Xl,42:Ye,45:[ht,Ye],60:Gl,61:ht,95:Ye,96:ft,126:ft},Vo={38:rr,92:tr},Uo={[-5]:on,[-4]:on,[-3]:on,33:yo,38:rr,42:wn,60:[xl,lo],91:ko,92:[Wl,tr],93:jn,95:wn,96:Ll},qo={null:[wn,Do]},$o={null:[42,95]},Wo={null:[]},Yo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$o,contentInitial:Mo,disable:Wo,document:Ro,flow:Ho,flowInitial:Bo,insideSpan:qo,string:Vo,text:Uo},Symbol.toStringTag,{value:"Module"}));function Xo(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const s={attempt:V(F),check:V(k),consume:A,enter:T,exit:H,interrupt:V(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:x,events:[],now:g,parser:e,previous:null,sliceSerialize:d,sliceStream:f,write:p};let u=n.tokenize.call(c,s);return n.resolveAll&&l.push(n),c;function p(E){return o=ie(o,E),v(),o[o.length-1]!==null?[]:(W(n,0),c.events=On(l,c.events,c),c.events)}function d(E,I){return Qo(f(E),I)}function f(E){return Jo(o,E)}function g(){const{_bufferIndex:E,_index:I,line:z,column:Y,offset:P}=r;return{_bufferIndex:E,_index:I,line:z,column:Y,offset:P}}function x(E){i[E.line]=E.column,O()}function v(){let E;for(;r._index<o.length;){const I=o[r._index];if(typeof I=="string")for(E=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===E&&r._bufferIndex<I.length;)S(I.charCodeAt(r._bufferIndex));else S(I)}}function S(E){u=u(E)}function A(E){N(E)?(r.line++,r.column=1,r.offset+=E===-3?2:1,O()):E!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=E}function T(E,I){const z=I||{};return z.type=E,z.start=g(),c.events.push(["enter",z,c]),a.push(z),z}function H(E){const I=a.pop();return I.end=g(),c.events.push(["exit",I,c]),I}function F(E,I){W(E,I.from)}function k(E,I){I.restore()}function V(E,I){return z;function z(Y,P,M){let J,le,pe,h;return Array.isArray(Y)?he(Y):"tokenize"in Y?he([Y]):oe(Y);function oe(Q){return Le;function Le(ge){const Ce=ge!==null&&Q[ge],Ie=ge!==null&&Q.null,Ve=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return he(Ve)(ge)}}function he(Q){return J=Q,le=0,Q.length===0?M:m(Q[le])}function m(Q){return Le;function Le(ge){return h=L(),pe=Q,Q.partial||(c.currentConstruct=Q),Q.name&&c.parser.constructs.disable.null.includes(Q.name)?ke():Q.tokenize.call(I?Object.assign(Object.create(c),I):c,s,ae,ke)(ge)}}function ae(Q){return E(pe,h),P}function ke(Q){return h.restore(),++le<J.length?m(J[le]):M}}}function W(E,I){E.resolveAll&&!l.includes(E)&&l.push(E),E.resolve&&fe(c.events,I,c.events.length-I,E.resolve(c.events.slice(I),c)),E.resolveTo&&(c.events=E.resolveTo(c.events,c))}function L(){const E=g(),I=c.previous,z=c.currentConstruct,Y=c.events.length,P=Array.from(a);return{from:Y,restore:M};function M(){r=E,c.previous=I,c.currentConstruct=z,c.events.length=Y,a=P,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Jo(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Qo(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
3
|
+
`;break}case-3:{o=`\r
|
|
4
|
+
`;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Ko(e){const r={constructs:rl([Yo,...(e||{}).extensions||[]]),content:i(fl),defined:[],document:i(hl),flow:i(_o),lazy:{},string:i(Oo),text:i(jo)};return r;function i(l){return o;function o(a){return Xo(r,l,a)}}}function Go(e){for(;!ir(e););return e}const mt=/[\0\t\n\r]/g;function Zo(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const s=[];let c,u,p,d,f;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),p=0,n="",t&&(l.charCodeAt(0)===65279&&p++,t=void 0);p<l.length;){if(mt.lastIndex=p,c=mt.exec(l),d=c&&c.index!==void 0?c.index:l.length,f=l.charCodeAt(d),!c){n=l.slice(p);break}if(f===10&&p===d&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),p<d&&(s.push(l.slice(p,d)),e+=d-p),f){case 0:{s.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,s.push(-2);e++<u;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}p=d+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const ea=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function na(e){return e.replace(ea,ta)}function ta(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return er(t.slice(l?2:1),l?16:10)}return Dn(t)||e}const cr={}.hasOwnProperty;function ra(e,n,t){return typeof n!="string"&&(t=n,n=void 0),ia(t)(Go(Ko(t).document().write(Zo()(e,n,!0))))}function ia(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l($n),autolinkProtocol:L,autolinkEmail:L,atxHeading:l(Vn),blockQuote:l(Ie),characterEscape:L,characterReference:L,codeFenced:l(Ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Ve,o),codeText:l(zr,o),codeTextData:L,data:L,codeFlowValue:L,definition:l(Dr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Or),hardBreakEscape:l(Un),hardBreakTrailing:l(Un),htmlFlow:l(qn,o),htmlFlowData:L,htmlText:l(qn,o),htmlTextData:L,image:l(jr),label:o,link:l($n),listItem:l(Fr),listItemValue:d,listOrdered:l(Wn,p),listUnordered:l(Wn),paragraph:l(Rr),reference:m,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Vn),strong:l(Mr),thematicBreak:l(Hr)},exit:{atxHeading:s(),atxHeadingSequence:F,autolink:s(),autolinkEmail:Ce,autolinkProtocol:ge,blockQuote:s(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:Q,characterReference:Le,codeFenced:s(v),codeFencedFence:x,codeFencedFenceInfo:f,codeFencedFenceMeta:g,codeFlowValue:O,codeIndented:s(S),codeText:s(P),codeTextData:O,data:O,definition:s(),definitionDestinationString:H,definitionLabelString:A,definitionTitleString:T,emphasis:s(),hardBreakEscape:s(I),hardBreakTrailing:s(I),htmlFlow:s(z),htmlFlowData:O,htmlText:s(Y),htmlTextData:O,image:s(J),label:pe,labelText:le,lineEnding:E,link:s(M),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:ae,resourceDestinationString:h,resourceTitleString:oe,resource:he,setextHeading:s(W),setextHeadingLineSequence:V,setextHeadingText:k,strong:s(),thematicBreak:s()}};fr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(y){let C={type:"root",children:[]};const _={stack:[C],tokenStack:[],config:n,enter:a,exit:c,buffer:o,resume:u,data:t},R=[];let U=-1;for(;++U<y.length;)if(y[U][1].type==="listOrdered"||y[U][1].type==="listUnordered")if(y[U][0]==="enter")R.push(U);else{const se=R.pop();U=i(y,se,U)}for(U=-1;++U<y.length;){const se=n[y[U][0]];cr.call(se,y[U][1].type)&&se[y[U][1].type].call(Object.assign({sliceSerialize:y[U][2].sliceSerialize},_),y[U][1])}if(_.tokenStack.length>0){const se=_.tokenStack[_.tokenStack.length-1];(se[1]||dt).call(_,void 0,se[0])}for(C.position={start:ye(y.length>0?y[0][1].start:{line:1,column:1,offset:0}),end:ye(y.length>0?y[y.length-2][1].end:{line:1,column:1,offset:0})},U=-1;++U<n.transforms.length;)C=n.transforms[U](C)||C;return C}function i(y,C,_){let R=C-1,U=-1,se=!1,be,me,_e,ze;for(;++R<=_;){const ne=y[R];switch(ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ne[0]==="enter"?U++:U--,ze=void 0;break}case"lineEndingBlank":{ne[0]==="enter"&&(be&&!ze&&!U&&!_e&&(_e=R),ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ze=void 0}if(!U&&ne[0]==="enter"&&ne[1].type==="listItemPrefix"||U===-1&&ne[0]==="exit"&&(ne[1].type==="listUnordered"||ne[1].type==="listOrdered")){if(be){let Ee=R;for(me=void 0;Ee--;){const de=y[Ee];if(de[1].type==="lineEnding"||de[1].type==="lineEndingBlank"){if(de[0]==="exit")continue;me&&(y[me][1].type="lineEndingBlank",se=!0),de[1].type="lineEnding",me=Ee}else if(!(de[1].type==="linePrefix"||de[1].type==="blockQuotePrefix"||de[1].type==="blockQuotePrefixWhitespace"||de[1].type==="blockQuoteMarker"||de[1].type==="listItemIndent"))break}_e&&(!me||_e<me)&&(be._spread=!0),be.end=Object.assign({},me?y[me][1].start:ne[1].end),y.splice(me||R,0,["exit",be,ne[2]]),R++,_++}if(ne[1].type==="listItemPrefix"){const Ee={type:"listItem",_spread:!1,start:Object.assign({},ne[1].start),end:void 0};be=Ee,y.splice(R,0,["enter",Ee,ne[2]]),R++,_++,_e=void 0,ze=!0}}}return y[C][1]._spread=se,_}function l(y,C){return _;function _(R){a.call(this,y(R),R),C&&C.call(this,R)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(y,C,_){this.stack[this.stack.length-1].children.push(y),this.stack.push(y),this.tokenStack.push([C,_||void 0]),y.position={start:ye(C.start),end:void 0}}function s(y){return C;function C(_){y&&y.call(this,_),c.call(this,_)}}function c(y,C){const _=this.stack.pop(),R=this.tokenStack.pop();if(R)R[0].type!==y.type&&(C?C.call(this,y,R[0]):(R[1]||dt).call(this,y,R[0]));else throw new Error("Cannot close `"+y.type+"` ("+je({start:y.start,end:y.end})+"): it’s not open");_.position.end=ye(y.end)}function u(){return nl(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function d(y){if(this.data.expectingFirstListItemValue){const C=this.stack[this.stack.length-2];C.start=Number.parseInt(this.sliceSerialize(y),10),this.data.expectingFirstListItemValue=void 0}}function f(){const y=this.resume(),C=this.stack[this.stack.length-1];C.lang=y}function g(){const y=this.resume(),C=this.stack[this.stack.length-1];C.meta=y}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const y=this.resume(),C=this.stack[this.stack.length-1];C.value=y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const y=this.resume(),C=this.stack[this.stack.length-1];C.value=y.replace(/(\r?\n|\r)$/g,"")}function A(y){const C=this.resume(),_=this.stack[this.stack.length-1];_.label=C,_.identifier=Ae(this.sliceSerialize(y)).toLowerCase()}function T(){const y=this.resume(),C=this.stack[this.stack.length-1];C.title=y}function H(){const y=this.resume(),C=this.stack[this.stack.length-1];C.url=y}function F(y){const C=this.stack[this.stack.length-1];if(!C.depth){const _=this.sliceSerialize(y).length;C.depth=_}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function V(y){const C=this.stack[this.stack.length-1];C.depth=this.sliceSerialize(y).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function L(y){const _=this.stack[this.stack.length-1].children;let R=_[_.length-1];(!R||R.type!=="text")&&(R=Br(),R.position={start:ye(y.start),end:void 0},_.push(R)),this.stack.push(R)}function O(y){const C=this.stack.pop();C.value+=this.sliceSerialize(y),C.position.end=ye(y.end)}function E(y){const C=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _=C.children[C.children.length-1];_.position.end=ye(y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(C.type)&&(L.call(this,y),O.call(this,y))}function I(){this.data.atHardBreak=!0}function z(){const y=this.resume(),C=this.stack[this.stack.length-1];C.value=y}function Y(){const y=this.resume(),C=this.stack[this.stack.length-1];C.value=y}function P(){const y=this.resume(),C=this.stack[this.stack.length-1];C.value=y}function M(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const C=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=C,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function J(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const C=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=C,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function le(y){const C=this.sliceSerialize(y),_=this.stack[this.stack.length-2];_.label=na(C),_.identifier=Ae(C).toLowerCase()}function pe(){const y=this.stack[this.stack.length-1],C=this.resume(),_=this.stack[this.stack.length-1];if(this.data.inReference=!0,_.type==="link"){const R=y.children;_.children=R}else _.alt=C}function h(){const y=this.resume(),C=this.stack[this.stack.length-1];C.url=y}function oe(){const y=this.resume(),C=this.stack[this.stack.length-1];C.title=y}function he(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function ae(y){const C=this.resume(),_=this.stack[this.stack.length-1];_.label=C,_.identifier=Ae(this.sliceSerialize(y)).toLowerCase(),this.data.referenceType="full"}function ke(y){this.data.characterReferenceType=y.type}function Q(y){const C=this.sliceSerialize(y),_=this.data.characterReferenceType;let R;_?(R=er(C,_==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):R=Dn(C);const U=this.stack[this.stack.length-1];U.value+=R}function Le(y){const C=this.stack.pop();C.position.end=ye(y.end)}function ge(y){O.call(this,y);const C=this.stack[this.stack.length-1];C.url=this.sliceSerialize(y)}function Ce(y){O.call(this,y);const C=this.stack[this.stack.length-1];C.url="mailto:"+this.sliceSerialize(y)}function Ie(){return{type:"blockquote",children:[]}}function Ve(){return{type:"code",lang:null,meta:null,value:""}}function zr(){return{type:"inlineCode",value:""}}function Dr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Or(){return{type:"emphasis",children:[]}}function Vn(){return{type:"heading",depth:0,children:[]}}function Un(){return{type:"break"}}function qn(){return{type:"html",value:""}}function jr(){return{type:"image",title:null,url:"",alt:null}}function $n(){return{type:"link",title:null,url:"",children:[]}}function Wn(y){return{type:"list",ordered:y.type==="listOrdered",start:null,spread:y._spread,children:[]}}function Fr(y){return{type:"listItem",spread:y._spread,checked:null,children:[]}}function Rr(){return{type:"paragraph",children:[]}}function Mr(){return{type:"strong",children:[]}}function Br(){return{type:"text",value:""}}function Hr(){return{type:"thematicBreak"}}}function ye(e){return{line:e.line,column:e.column,offset:e.offset}}function fr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?fr(e,r):la(e,r)}}function la(e,n){let t;for(t in n)if(cr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function dt(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+je({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+je({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+je({start:n.start,end:n.end})+") is still open")}function oa(e){const n=this;n.parser=t;function t(r){return ra(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function aa(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function sa(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
|
5
|
+
`}]}function ua(e,n){const t=n.value?n.value+`
|
|
6
|
+
`:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function ca(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function fa(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function pa(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Pe(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,s);const c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(n,c),e.applyData(n,c)}function ha(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ma(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function pr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function da(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return pr(e,n);const i={src:Pe(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function ga(e,n){const t={src:Pe(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function ya(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function xa(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return pr(e,n);const i={href:Pe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function ka(e,n){const t={href:Pe(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function ba(e,n,t){const r=e.all(n),i=t?wa(t):hr(n),l={},o=[];if(typeof n.checked=="boolean"){const u=r[0];let p;u&&u.type==="element"&&u.tagName==="p"?p=u:(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:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
7
|
+
`}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const s=r[r.length-1];s&&(i||s.type!=="element"||s.tagName!=="p")&&o.push({type:"text",value:`
|
|
8
|
+
`});const c={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,c),e.applyData(n,c)}function wa(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=hr(t[r])}return n}function hr(e){const n=e.spread;return n??e.children.length>1}function Sa(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,l),e.applyData(n,l)}function Ca(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ia(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function Ea(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ta(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],o),i.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Pn(n.children[1]),s=Yt(n.children[n.children.length-1]);a&&s&&(o.position={start:a,end:s}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function va(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let s=-1;const c=[];for(;++s<a;){const p=n.children[s],d={},f=o?o[s]:void 0;f&&(d.align=f);let g={type:"element",tagName:l,properties:d,children:[]};p&&(g.children=e.all(p),e.patch(p,g),g=e.applyData(p,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(n,u),e.applyData(n,u)}function Aa(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const gt=9,yt=32;function Na(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(xt(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(xt(n.slice(i),i>0,!1)),l.join("")}function xt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===gt||l===yt;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===gt||l===yt;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Pa(e,n){const t={type:"text",value:Na(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function La(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const _a={blockquote:aa,break:sa,code:ua,delete:ca,emphasis:fa,footnoteReference:pa,heading:ha,html:ma,imageReference:da,image:ga,inlineCode:ya,linkReference:xa,link:ka,listItem:ba,list:Sa,paragraph:Ca,root:Ia,strong:Ea,table:Ta,tableCell:Aa,tableRow:va,text:Pa,thematicBreak:La,toml:Ue,yaml:Ue,definition:Ue,footnoteDefinition:Ue};function Ue(){}const mr=-1,en=0,Re=1,Qe=2,Fn=3,Rn=4,Mn=5,Bn=6,dr=7,gr=8,kt=typeof self=="object"?self:globalThis,za=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case en:case mr:return t(o,i);case Re:{const a=t([],i);for(const s of o)a.push(r(s));return a}case Qe:{const a=t({},i);for(const[s,c]of o)a[r(s)]=r(c);return a}case Fn:return t(new Date(o),i);case Rn:{const{source:a,flags:s}=o;return t(new RegExp(a,s),i)}case Mn:{const a=t(new Map,i);for(const[s,c]of o)a.set(r(s),r(c));return a}case Bn:{const a=t(new Set,i);for(const s of o)a.add(r(s));return a}case dr:{const{name:a,message:s}=o;return t(new kt[a](s),i)}case gr:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(new kt[l](o),i)};return r},bt=e=>za(new Map,e)(0),Te="",{toString:Da}={},{keys:Oa}=Object,Oe=e=>{const n=typeof e;if(n!=="object"||!e)return[en,n];const t=Da.call(e).slice(8,-1);switch(t){case"Array":return[Re,Te];case"Object":return[Qe,Te];case"Date":return[Fn,Te];case"RegExp":return[Rn,Te];case"Map":return[Mn,Te];case"Set":return[Bn,Te];case"DataView":return[Re,t]}return t.includes("Array")?[Re,t]:t.includes("Error")?[dr,t]:[Qe,t]},qe=([e,n])=>e===en&&(n==="function"||n==="symbol"),ja=(e,n,t,r)=>{const i=(o,a)=>{const s=r.push(o)-1;return t.set(a,s),s},l=o=>{if(t.has(o))return t.get(o);let[a,s]=Oe(o);switch(a){case en:{let u=o;switch(s){case"bigint":a=gr,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);u=null;break;case"undefined":return i([mr],o)}return i([a,u],o)}case Re:{if(s){let d=o;return s==="DataView"?d=new Uint8Array(o.buffer):s==="ArrayBuffer"&&(d=new Uint8Array(o)),i([s,[...d]],o)}const u=[],p=i([a,u],o);for(const d of o)u.push(l(d));return p}case Qe:{if(s)switch(s){case"BigInt":return i([s,o.toString()],o);case"Boolean":case"Number":case"String":return i([s,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const u=[],p=i([a,u],o);for(const d of Oa(o))(e||!qe(Oe(o[d])))&&u.push([l(d),l(o[d])]);return p}case Fn:return i([a,o.toISOString()],o);case Rn:{const{source:u,flags:p}=o;return i([a,{source:u,flags:p}],o)}case Mn:{const u=[],p=i([a,u],o);for(const[d,f]of o)(e||!(qe(Oe(d))||qe(Oe(f))))&&u.push([l(d),l(f)]);return p}case Bn:{const u=[],p=i([a,u],o);for(const d of o)(e||!qe(Oe(d)))&&u.push(l(d));return p}}const{message:c}=o;return i([a,{name:s,message:c}],o)};return l},wt=(e,{json:n,lossy:t}={})=>{const r=[];return ja(!(n||t),!!n,new Map,r)(e),r},Ke=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?bt(wt(e,n)):structuredClone(e):(e,n)=>bt(wt(e,n));function Fa(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Ra(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Ma(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Fa,r=e.options.footnoteBackLabel||Ra,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let s=-1;for(;++s<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[s]);if(!c)continue;const u=e.all(c),p=String(c.identifier).toUpperCase(),d=Pe(p.toLowerCase());let f=0;const g=[],x=e.footnoteCounts.get(p);for(;x!==void 0&&++f<=x;){g.length>0&&g.push({type:"text",value:" "});let A=typeof t=="string"?t:t(s,f);typeof A=="string"&&(A={type:"text",value:A}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+d+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(s,f),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const A=v.children[v.children.length-1];A&&A.type==="text"?A.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else u.push(...g);const S={type:"element",tagName:"li",properties:{id:n+"fn-"+d},children:e.wrap(u,!0)};e.patch(c,S),a.push(S)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Ke(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
9
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
10
|
+
`}]}}const yr=function(e){if(e==null)return Ua;if(typeof e=="function")return nn(e);if(typeof e=="object")return Array.isArray(e)?Ba(e):Ha(e);if(typeof e=="string")return Va(e);throw new Error("Expected function, string, or object as test")};function Ba(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=yr(e[t]);return nn(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function Ha(e){const n=e;return nn(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function Va(e){return nn(n);function n(t){return t&&t.type===e}}function nn(e){return n;function n(t,r,i){return!!(qa(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Ua(){return!0}function qa(e){return e!==null&&typeof e=="object"&&"type"in e}const xr=[],$a=!0,St=!1,Wa="skip";function Ya(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=yr(i),o=r?-1:1;a(e,void 0,[])();function a(s,c,u){const p=s&&typeof s=="object"?s:{};if(typeof p.type=="string"){const f=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(s.type+(f?"<"+f+">":""))+")"})}return d;function d(){let f=xr,g,x,v;if((!n||l(s,c,u[u.length-1]||void 0))&&(f=Xa(t(s,u)),f[0]===St))return f;if("children"in s&&s.children){const S=s;if(S.children&&f[0]!==Wa)for(x=(r?S.children.length:-1)+o,v=u.concat(S);x>-1&&x<S.children.length;){const A=S.children[x];if(g=a(A,x,v)(),g[0]===St)return g;x=typeof g[1]=="number"?g[1]:x+o}}return f}}}function Xa(e){return Array.isArray(e)?e:typeof e=="number"?[$a,e]:e==null?xr:[e]}function kr(e,n,t,r){let i,l,o;typeof n=="function"&&typeof t!="function"?(l=void 0,o=n,i=t):(l=n,o=t,i=r),Ya(e,l,a,i);function a(s,c){const u=c[c.length-1],p=u?u.children.indexOf(s):void 0;return o(s,p,u)}}const Sn={}.hasOwnProperty,Ja={};function Qa(e,n){const t=n||Ja,r=new Map,i=new Map,l=new Map,o={..._a,...t.handlers},a={all:c,applyData:Ga,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:s,options:t,patch:Ka,wrap:es};return kr(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const p=u.type==="definition"?r:i,d=String(u.identifier).toUpperCase();p.has(d)||p.set(d,u)}}),a;function s(u,p){const d=u.type,f=a.handlers[d];if(Sn.call(a.handlers,d)&&f)return f(a,u,p);if(a.options.passThrough&&a.options.passThrough.includes(d)){if("children"in u){const{children:x,...v}=u,S=Ke(v);return S.children=a.all(u),S}return Ke(u)}return(a.options.unknownHandler||Za)(a,u,p)}function c(u){const p=[];if("children"in u){const d=u.children;let f=-1;for(;++f<d.length;){const g=a.one(d[f],u);if(g){if(f&&d[f-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Ct(g.value)),!Array.isArray(g)&&g.type==="element")){const x=g.children[0];x&&x.type==="text"&&(x.value=Ct(x.value))}Array.isArray(g)?p.push(...g):p.push(g)}}}return p}}function Ka(e,n){e.position&&(n.position=zi(e))}function Ga(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const o="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:o}}t.type==="element"&&l&&Object.assign(t.properties,Ke(l)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Za(e,n){const t=n.data||{},r="value"in n&&!(Sn.call(t,"hProperties")||Sn.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function es(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
|
|
11
|
+
`});++r<e.length;)r&&t.push({type:"text",value:`
|
|
12
|
+
`}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
|
|
13
|
+
`}),t}function Ct(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function It(e,n){const t=Qa(e,n),r=t.one(e,void 0),i=Ma(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
14
|
+
`},i),l}function ns(e,n){return e&&"run"in e?async function(t,r){const i=It(t,{file:r,...n});await e.run(i,r)}:function(t,r){return It(t,{file:r,...e||n})}}function Et(e){if(e)throw e}var Xe=Object.prototype.hasOwnProperty,br=Object.prototype.toString,Tt=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,At=function(n){return typeof Array.isArray=="function"?Array.isArray(n):br.call(n)==="[object Array]"},Nt=function(n){if(!n||br.call(n)!=="[object Object]")return!1;var t=Xe.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&Xe.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!t&&!r)return!1;var i;for(i in n);return typeof i>"u"||Xe.call(n,i)},Pt=function(n,t){Tt&&t.name==="__proto__"?Tt(n,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):n[t.name]=t.newValue},Lt=function(n,t){if(t==="__proto__")if(Xe.call(n,t)){if(vt)return vt(n,t).value}else return;return n[t]},ts=function e(){var n,t,r,i,l,o,a=arguments[0],s=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},s=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});s<c;++s)if(n=arguments[s],n!=null)for(t in n)r=Lt(a,t),i=Lt(n,t),a!==i&&(u&&i&&(Nt(i)||(l=At(i)))?(l?(l=!1,o=r&&At(r)?r:[]):o=r&&Nt(r)?r:{},Pt(a,{name:t,newValue:e(u,o,i)})):typeof i<"u"&&Pt(a,{name:t,newValue:i}));return a};const an=Wt(ts);function Cn(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rs(){const e=[],n={run:t,use:r};return n;function t(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(s,...c){const u=e[++l];let p=-1;if(s){o(s);return}for(;++p<i.length;)(c[p]===null||c[p]===void 0)&&(c[p]=i[p]);i=c,u?is(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function is(e,n){let t;return r;function r(...o){const a=e.length>o.length;let s;a&&o.push(i);try{s=e.apply(this,o)}catch(c){const u=c;if(a&&t)throw u;return i(u)}a||(s&&s.then&&typeof s.then=="function"?s.then(l,i):s instanceof Error?i(s):l(s))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const ue={basename:ls,dirname:os,extname:as,join:ss,sep:"/"};function ls(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');He(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function os(e){if(He(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function as(e){He(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function ss(...e){let n=-1,t;for(;++n<e.length;)He(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":us(t)}function us(e){He(e);const n=e.codePointAt(0)===47;let t=cs(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function cs(e,n){let t="",r=0,i=-1,l=0,o=-1,a,s;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",r=0):(t=t.slice(0,s),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function He(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fs={cwd:ps};function ps(){return"/"}function In(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hs(e){if(typeof e=="string")e=new URL(e);else if(!In(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return ms(e)}function ms(e){if(e.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 n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.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(n)}const sn=["history","path","basename","stem","extname","dirname"];class wr{constructor(n){let t;n?In(n)?t={path:n}:typeof n=="string"||ds(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":fs.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sn.length;){const l=sn[r];l in t&&t[l]!==void 0&&t[l]!==null&&(this[l]=l==="history"?[...t[l]]:t[l])}let i;for(i in t)sn.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ue.basename(this.path):void 0}set basename(n){cn(n,"basename"),un(n,"basename"),this.path=ue.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ue.dirname(this.path):void 0}set dirname(n){_t(this.basename,"dirname"),this.path=ue.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ue.extname(this.path):void 0}set extname(n){if(un(n,"extname"),_t(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ue.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){In(n)&&(n=hs(n)),cn(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ue.basename(this.path,this.extname):void 0}set stem(n){cn(n,"stem"),un(n,"stem"),this.path=ue.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new K(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function un(e,n){if(e&&e.includes(ue.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ue.sep+"`")}function cn(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function _t(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function ds(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gs=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},ys={}.hasOwnProperty;class Hn extends gs{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=rs()}copy(){const n=new Hn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(an(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(hn("data",this.frozen),this.namespace[n]=t,this):ys.call(this.namespace,n)&&this.namespace[n]||void 0:n?(hn("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=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(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=$e(n),r=this.parser||this.Parser;return fn("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),fn("process",this.parser||this.Parser),pn("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(l,o){const a=$e(n),s=r.parse(a);r.run(s,a,function(u,p,d){if(u||!p||!d)return c(u);const f=p,g=r.stringify(f,d);bs(g)?d.value=g:d.result=g,c(u,d)});function c(u,p){u||!p?o(u):l?l(p):t(void 0,p)}}}processSync(n){let t=!1,r;return this.freeze(),fn("processSync",this.parser||this.Parser),pn("processSync",this.compiler||this.Compiler),this.process(n,i),Dt("processSync","process",t),r;function i(l,o){t=!0,Et(l),r=o}}run(n,t,r){zt(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?l(void 0,r):new Promise(l);function l(o,a){const s=$e(t);i.run(n,s,c);function c(u,p,d){const f=p||n;u?a(u):o?o(f):r(void 0,f,d)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),Dt("runSync","run",r),i;function l(o,a){Et(o),i=a,r=!0}}stringify(n,t){this.freeze();const r=$e(t),i=this.compiler||this.Compiler;return pn("stringify",i),zt(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(hn("use",this.frozen),n!=null)if(typeof n=="function")s(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):o(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(c){if(typeof c=="function")s(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...p]=c;s(u,p)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(i.settings=an(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const p=c[u];l(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function s(c,u){let p=-1,d=-1;for(;++p<r.length;)if(r[p][0]===c){d=p;break}if(d===-1)r.push([c,...u]);else if(u.length>0){let[f,...g]=u;const x=r[d][1];Cn(x)&&Cn(f)&&(f=an(!0,x,f)),r[d]=[c,f,...g]}}}}const xs=new Hn().freeze();function fn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hn(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zt(e){if(!Cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dt(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function $e(e){return ks(e)?e:new wr(e)}function ks(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bs(e){return typeof e=="string"||ws(e)}function ws(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ss="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ot=[],jt={allowDangerousHtml:!0},Cs=/^(https?|ircs?|mailto|xmpp)$/i,Is=[{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 Es(e){const n=Ts(e),t=vs(e);return As(n.runSync(n.parse(t),t),e)}function Ts(e){const n=e.rehypePlugins||Ot,t=e.remarkPlugins||Ot,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...jt}:jt;return xs().use(oa).use(t).use(ns,r).use(n)}function vs(e){const n=e.children||"",t=new wr;return typeof n=="string"&&(t.value=n),t}function As(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,s=n.urlTransform||Ns;for(const u of Is)Object.hasOwn(n,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Ss+u.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),kr(e,c),Ri(e,{Fragment:b.Fragment,components:i,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function c(u,p,d){if(u.type==="raw"&&d&&typeof p=="number")return o?d.children.splice(p,1):d.children[p]={type:"text",value:u.value},p;if(u.type==="element"){let f;for(f in rn)if(Object.hasOwn(rn,f)&&Object.hasOwn(u.properties,f)){const g=u.properties[f],x=rn[f];(x===null||x.includes(u.tagName))&&(u.properties[f]=s(String(g||""),f,u))}}if(u.type==="element"){let f=t?!t.includes(u.tagName):l?l.includes(u.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(u,p,d)),f&&d&&typeof p=="number")return a&&u.children?d.children.splice(p,1,...u.children):d.children.splice(p,1),p}}}function Ns(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||Cs.test(e.slice(0,n))?e:""}function Sr({message:e}){const n=e.role==="user";return b.jsx("div",{className:`flex ${n?"justify-end":"justify-start"}`,children:b.jsx("div",{className:`
|
|
15
|
+
max-w-bubble px-4 py-3 rounded-lg nim-message-content font-body text-sm
|
|
16
|
+
${n?"bg-nim-orange text-white":"bg-nim-cream text-nim-black"}
|
|
17
|
+
`,children:n?b.jsx("p",{className:"whitespace-pre-wrap",children:e.content}):b.jsx(Es,{components:{p:({children:t})=>b.jsx("p",{className:"whitespace-pre-wrap",children:t}),a:({href:t,children:r})=>b.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"underline",children:r})},children:e.content})})})}function Cr({onSend:e,disabled:n=!1,placeholder:t="Type a message..."}){const[r,i]=j.useState(""),l=j.useRef(null),o=s=>{s.preventDefault(),r.trim()&&!n&&(e(r),i(""))},a=s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),o(s))};return j.useEffect(()=>{var s;(s=l.current)==null||s.focus()},[]),b.jsxs("form",{onSubmit:o,className:"flex gap-2",children:[b.jsx("input",{ref:l,type:"text",value:r,onChange:s=>i(s.target.value),onKeyDown:a,disabled:n,placeholder:t,className:`
|
|
18
|
+
flex-1 h-11 px-4
|
|
19
|
+
bg-white border-2 border-nim-cream
|
|
20
|
+
rounded-lg
|
|
21
|
+
text-nim-black placeholder-nim-brown/40
|
|
22
|
+
font-body text-sm
|
|
23
|
+
outline-none
|
|
24
|
+
transition-colors duration-200
|
|
25
|
+
focus:border-nim-orange
|
|
26
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
27
|
+
`}),b.jsx("button",{type:"submit",disabled:n||!r.trim(),className:`
|
|
28
|
+
h-11 w-11
|
|
29
|
+
bg-nim-orange text-white
|
|
30
|
+
rounded-lg
|
|
31
|
+
flex items-center justify-center
|
|
32
|
+
transition-all duration-200
|
|
33
|
+
hover:opacity-90 hover:scale-105
|
|
34
|
+
active:scale-95
|
|
35
|
+
disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:scale-100
|
|
36
|
+
`,"aria-label":"Send message",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),b.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})}function Ir(){return b.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-3 bg-nim-white border border-nim-grey-100 rounded-lg max-w-bubble",children:[b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"}),b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"}),b.jsx("div",{className:"nim-thinking-dot w-2 h-2 bg-nim-black rounded-full"})]})}function Er({request:e,onConfirm:n,onCancel:t}){const[r,i]=j.useState(0);j.useEffect(()=>{const s=()=>{const u=Math.max(0,e.expiresAt.getTime()-Date.now());i(u),u<=0&&t(e.actionId)};s();const c=setInterval(s,100);return()=>clearInterval(c)},[e.expiresAt,e.actionId,t]);const l=e.expiresAt.getTime()-Date.now()+r,o=l>0?r/l*100:0,a=Math.ceil(r/1e3);return b.jsxs("div",{className:"bg-nim-white border-2 border-nim-black rounded-lg p-5 shadow-lg",children:[b.jsxs("div",{className:"flex items-start gap-3",children:[b.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-nim-beige rounded-lg flex items-center justify-center",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-nim-black",children:[b.jsx("path",{d:"M12 9v4"}),b.jsx("path",{d:"M12 17h.01"}),b.jsx("path",{d:"M3.6 15.8l4.8-9.6a2 2 0 0 1 3.6 0l4.8 9.6a2 2 0 0 1-1.8 2.8H5.4a2 2 0 0 1-1.8-2.8z"})]})}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("h4",{className:"font-display font-medium text-nim-black text-base",children:"Confirm Action"}),b.jsx("p",{className:"text-nim-grey-400 text-xs mt-0.5 font-mono",children:e.tool}),b.jsx("p",{className:"text-nim-black font-body text-sm mt-2",children:e.summary})]}),b.jsxs("div",{className:"flex-shrink-0 relative w-10 h-10",children:[b.jsxs("svg",{className:"w-10 h-10 -rotate-90",viewBox:"0 0 36 36",children:[b.jsx("circle",{cx:"18",cy:"18",r:"16",fill:"none",stroke:"#ddd",strokeWidth:"3"}),b.jsx("circle",{cx:"18",cy:"18",r:"16",fill:"none",stroke:"#231f18",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"100",strokeDashoffset:100-o,className:"transition-all duration-100"})]}),b.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-nim-black font-mono",children:a})]})]}),b.jsxs("div",{className:"flex gap-3 mt-4",children:[b.jsx("button",{onClick:()=>t(e.actionId),className:"flex-1 h-10 px-4 bg-nim-beige text-nim-black rounded-lg text-sm font-display font-medium hover:bg-nim-grey-100 transition-colors border border-nim-grey-100",children:"Cancel"}),b.jsx("button",{onClick:()=>n(e.actionId),className:"flex-1 h-10 px-4 bg-nim-black text-nim-white rounded-lg text-sm font-display font-medium hover:opacity-90 transition-opacity",children:"Confirm"})]})]})}function Tr({title:e,messages:n,isStreaming:t,connectionState:r,confirmationRequest:i,onSendMessage:l,onConfirm:o,onCancel:a,onClose:s,onLogout:c}){var x;const u=j.useRef(null);j.useEffect(()=>{var v;(v=u.current)==null||v.scrollIntoView({behavior:"smooth"})},[n,t,i]);const p=r==="connecting",d=r==="reconnecting",f=r==="disconnected",g=r==="error";return b.jsxs("div",{className:"nim-panel-enter flex flex-col h-full bg-white rounded-xl shadow-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-5 py-4 bg-white border-b border-nim-cream",children:[b.jsx("h2",{className:"font-display text-xl font-medium text-nim-black",children:e}),b.jsxs("div",{className:"flex items-center gap-2",children:[c&&b.jsx("button",{onClick:c,className:"px-3 py-1.5 text-xs rounded-lg bg-nim-cream hover:bg-nim-cream/80 text-nim-black font-body transition-colors","aria-label":"Logout",children:"Logout"}),b.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-nim-cream transition-colors","aria-label":"Close chat",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-nim-black",children:[b.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),d&&b.jsx("div",{className:"px-4 py-2 bg-yellow-100 border-b border-yellow-200 text-nim-black font-body text-sm",children:"Reconnecting..."}),f&&!d&&b.jsx("div",{className:"px-4 py-2 bg-orange-100 border-b border-orange-200 text-nim-black font-body text-sm",children:"Connection lost. Reconnecting..."}),g&&b.jsx("div",{className:"px-4 py-2 bg-red-100 border-b border-red-200 text-nim-black font-body text-sm",children:"Connection failed. Please refresh the page."}),b.jsxs("div",{className:"nim-chat-messages flex-1 overflow-y-auto p-4 space-y-3",children:[n.length===0&&!p&&b.jsxs("div",{className:"text-center py-8 px-4",children:[b.jsx("p",{className:"font-display text-lg font-medium text-nim-black mb-3",children:"Chat with Nim"}),b.jsx("p",{className:"font-body text-sm text-nim-brown/60 mb-4",children:"Ask me anything about your finances"}),b.jsxs("div",{className:"space-y-2 text-sm text-left bg-nim-cream rounded-lg p-4",children:[b.jsx("p",{className:"font-display font-medium text-nim-black mb-2",children:"Try asking:"}),b.jsxs("ul",{className:"space-y-1.5 font-body text-nim-brown/60",children:[b.jsx("li",{children:`• "What's my balance?"`}),b.jsx("li",{children:'• "Show me recent transactions"'}),b.jsx("li",{children:'• "Analyze my spending for last 30 days"'})]})]})]}),n.map(v=>b.jsx(Sr,{message:v},v.id)),t&&((x=n[n.length-1])==null?void 0:x.role)!=="assistant"&&b.jsx(Ir,{}),i&&b.jsx("div",{className:"py-2",children:b.jsx(Er,{request:i,onConfirm:o,onCancel:a})}),b.jsx("div",{ref:u})]}),b.jsx("div",{className:"p-4 border-t border-nim-cream bg-white",children:b.jsx(Cr,{onSend:l,disabled:p||d||f||g||t||!!i,placeholder:p?"Connecting...":d?"Reconnecting...":f||g?"Disconnected":t?"Nim is responding...":i?"Waiting for confirmation...":"Type a message..."})})]})}function Ps({onLoginSuccess:e,apiUrl:n="https://api.liminal.cash"}){const[t,r]=j.useState(""),[i,l]=j.useState(""),[o,a]=j.useState("email"),[s,c]=j.useState(""),[u,p]=j.useState(!1),d=async()=>{p(!0),c("");try{if(!(await fetch(`${n}/auth/v1/otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.trim().toLowerCase(),type:1})})).ok)throw new Error("Failed to send OTP");a("otp")}catch(g){c(g instanceof Error?g.message:"Failed to send OTP")}finally{p(!1)}},f=async()=>{p(!0),c("");try{const g=await fetch(`${n}/auth/v1/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.trim().toLowerCase(),code:i.trim(),type:1})});if(!g.ok)throw new Error("Invalid OTP code");const x=await g.json();if(!x.success)throw new Error(x.error||"Login failed");localStorage.setItem("nim_access_token",x.accessToken),localStorage.setItem("nim_refresh_token",x.refreshToken),localStorage.setItem("nim_expires_at",x.expiresAt),localStorage.setItem("nim_user_id",x.user.id),localStorage.setItem("nim_user_email",x.user.email),e(x.accessToken,x.user.id)}catch(g){c(g instanceof Error?g.message:"Verification failed")}finally{p(!1)}};return o==="otp"?b.jsxs("div",{className:"flex flex-col gap-4 p-6 bg-white rounded-2xl shadow-xl max-w-md",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"font-display text-2xl font-bold text-nim-black",children:"Enter Code"}),b.jsxs("p",{className:"text-sm text-nim-brown/60 mt-1",children:["We sent a 6-digit code to ",t]})]}),b.jsx("input",{type:"text",value:i,onChange:g=>l(g.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",maxLength:6,className:"px-4 py-3 border border-nim-cream rounded-lg focus:outline-none focus:ring-2 focus:ring-nim-orange font-mono text-center text-2xl tracking-widest text-nim-black",autoFocus:!0}),s&&b.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-lg",children:s}),b.jsx("button",{onClick:f,disabled:u||i.length!==6,className:"px-4 py-3 bg-nim-orange text-white rounded-lg font-semibold hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Verifying...":"Verify & Sign In"}),b.jsx("button",{onClick:()=>{a("email"),l(""),c("")},className:"text-sm text-nim-brown/60 hover:text-nim-brown transition-colors",children:"← Use different email"})]}):b.jsxs("div",{className:"flex flex-col gap-4 p-6 bg-white rounded-2xl shadow-xl max-w-md",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"font-display text-2xl font-bold text-nim-black",children:"Sign In to Nim"}),b.jsx("p",{className:"text-sm text-nim-brown/60 mt-1",children:"Enter your Liminal email to receive a login code"})]}),b.jsx("input",{type:"email",value:t,onChange:g=>r(g.target.value),placeholder:"your@email.com",className:"px-4 py-3 border border-nim-cream rounded-lg focus:outline-none focus:ring-2 focus:ring-nim-orange text-nim-black",autoFocus:!0}),s&&b.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-lg",children:s}),b.jsx("button",{onClick:d,disabled:u||!t.includes("@"),className:"px-4 py-3 bg-nim-orange text-white rounded-lg font-semibold hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?"Sending code...":"Send Login Code"}),b.jsx("p",{className:"text-xs text-nim-brown/40 text-center",children:"Don't have an account? Download the Liminal app to sign up."})]})}function En(){const e=localStorage.getItem("nim_access_token"),n=localStorage.getItem("nim_refresh_token"),t=localStorage.getItem("nim_expires_at"),r=localStorage.getItem("nim_user_id"),i=localStorage.getItem("nim_user_email");return!e||!n||!t||!r?null:{accessToken:e,refreshToken:n,expiresAt:parseInt(t,10),userId:r,email:i||void 0}}function Tn(){localStorage.removeItem("nim_access_token"),localStorage.removeItem("nim_refresh_token"),localStorage.removeItem("nim_expires_at"),localStorage.removeItem("nim_user_id"),localStorage.removeItem("nim_user_email")}function Ft(e,n=60){return Math.floor(Date.now()/1e3)>=e-n}async function Rt(e,n="https://api.liminal.cash"){const t=await fetch(`${n}/auth/v1/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e})});if(!t.ok)throw new Error("Failed to refresh token");const r=await t.json(),i={accessToken:r.access_token,refreshToken:r.refresh_token,expiresAt:r.expires_at,userId:r.user.id,email:r.user.email};return localStorage.setItem("nim_access_token",i.accessToken),localStorage.setItem("nim_refresh_token",i.refreshToken),localStorage.setItem("nim_expires_at",i.expiresAt.toString()),localStorage.setItem("nim_user_id",i.userId),i.email&&localStorage.setItem("nim_user_email",i.email),i}const We="nim-chat-conversation-id";function vr({wsUrl:e,jwt:n,onError:t}){const[r,i]=j.useState([]),[l,o]=j.useState(!1),[a,s]=j.useState("disconnected"),[c,u]=j.useState(null),p=j.useRef(null),d=j.useRef(""),f=j.useRef(null),g=j.useRef(!0),x=j.useRef(0),v=j.useRef(null),S=j.useRef(!1),A=j.useCallback(L=>{var O;((O=p.current)==null?void 0:O.readyState)===WebSocket.OPEN&&p.current.send(JSON.stringify(L))},[]),T=j.useCallback(()=>{var E;if(((E=p.current)==null?void 0:E.readyState)===WebSocket.OPEN)return;s("connecting");const L=n?`${e}${e.includes("?")?"&":"?"}token=${encodeURIComponent(n)}`:e,O=new WebSocket(L);p.current=O,O.onopen=()=>{s("connected"),x.current=0;const I=localStorage.getItem(We);I&&!S.current?(f.current=I,A({type:"resume_conversation",conversationId:I})):(S.current=!1,A({type:"new_conversation"}))},O.onmessage=I=>{const z=JSON.parse(I.data);switch(z.type){case"conversation_started":f.current=z.conversationId,localStorage.setItem(We,z.conversationId);break;case"conversation_resumed":f.current=z.conversationId,localStorage.setItem(We,z.conversationId),i(z.messages||[]);break;case"text_chunk":o(!0),d.current+=z.content,i(P=>{const M=P[P.length-1];return(M==null?void 0:M.role)==="assistant"&&!M.content.endsWith("█")?[...P.slice(0,-1),{...M,content:d.current}]:(M==null?void 0:M.role)==="assistant"?[...P.slice(0,-1),{...M,content:d.current}]:[...P,{id:`msg-${Date.now()}`,role:"assistant",content:d.current,timestamp:Date.now()}]});break;case"text":o(!1),d.current="",i(P=>{const M=P[P.length-1];return(M==null?void 0:M.role)==="assistant"?[...P.slice(0,-1),{...M,content:z.content}]:[...P,{id:`msg-${Date.now()}`,role:"assistant",content:z.content,timestamp:Date.now()}]});break;case"confirm_request":u({actionId:z.actionId,tool:z.tool,summary:z.summary,expiresAt:new Date(z.expiresAt)});break;case"complete":o(!1),d.current="",u(null);break;case"error":o(!1),d.current="",z.content.toLowerCase().includes("conversation not found")||z.content.toLowerCase().includes("conversation does not exist")?(localStorage.removeItem(We),f.current=null,S.current=!0,F()):(t==null||t(z.content),i(P=>[...P,{id:`msg-${Date.now()}`,role:"assistant",content:`Error: ${z.content}`,timestamp:Date.now()}]));break}},O.onerror=()=>{s("error"),t==null||t("WebSocket connection error")},O.onclose=()=>{if(s("disconnected"),o(!1),!!g.current)if(x.current<5){s("reconnecting");const I=Math.min(1e3*Math.pow(2,x.current),1e4);x.current++,v.current=setTimeout(()=>{g.current&&T()},I)}else s("error"),t==null||t("Failed to reconnect after multiple attempts")}},[e,n,A,t]),H=j.useCallback(()=>{var L;v.current&&(clearTimeout(v.current),v.current=null),(L=p.current)==null||L.close(),p.current=null},[]),F=j.useCallback(()=>{x.current=0,H(),T()},[T,H]),k=j.useCallback(L=>{if(!L.trim())return;const O={id:`msg-${Date.now()}`,role:"user",content:L.trim(),timestamp:Date.now()};i(E=>[...E,O]),A({type:"message",content:L.trim()})},[A]),V=j.useCallback(L=>{A({type:"confirm",actionId:L}),u(null)},[A]),W=j.useCallback(L=>{A({type:"cancel",actionId:L}),u(null)},[A]);return j.useEffect(()=>(g.current=!0,n&&T(),()=>{g.current=!1,H()}),[n]),j.useEffect(()=>{const L=setInterval(async()=>{const E=En();if(E&&Ft(E.expiresAt,60))try{await Rt(E.refreshToken),p.current&&F()}catch(I){console.error("[NimChat] Token refresh failed:",I),t==null||t("Session expired. Please log in again."),Tn()}},3e5);return(async()=>{const E=En();if(E&&Ft(E.expiresAt,60))try{await Rt(E.refreshToken)}catch(I){console.error("[NimChat] Token refresh failed:",I),t==null||t("Session expired. Please log in again."),Tn()}})(),()=>{clearInterval(L)}},[n,t,F]),{messages:r,isStreaming:l,connectionState:a,confirmationRequest:c,sendMessage:k,confirmAction:V,cancelAction:W,reconnect:F}}function Ls({wsUrl:e,apiUrl:n="https://api.liminal.cash",title:t="Nim",position:r="bottom-right",defaultOpen:i=!1}){const[l,o]=j.useState(i),[a,s]=j.useState(!1),[c,u]=j.useState(null);j.useEffect(()=>{const F=En();F&&(u(F.accessToken),s(!0))},[]);const p=(F,k)=>{u(F),s(!0)},d=()=>{Tn(),u(null),s(!1)},{messages:f,isStreaming:g,connectionState:x,confirmationRequest:v,sendMessage:S,confirmAction:A,cancelAction:T}=vr({wsUrl:e,jwt:a?c:null,onError:F=>console.error("[NimChat]",F)}),H=r==="bottom-right"?"right-4 sm:right-6":"left-4 sm:left-6";return b.jsxs("div",{className:"nim-chat-widget fixed bottom-4 sm:bottom-6 z-50",style:{[r==="bottom-right"?"right":"left"]:"1rem"},children:[l&&!a&&b.jsx("div",{className:`
|
|
37
|
+
absolute bottom-16
|
|
38
|
+
w-[calc(100vw-2rem)] sm:w-96
|
|
39
|
+
`,style:{[r==="bottom-right"?"right":"left"]:0},children:b.jsx(Ps,{onLoginSuccess:p,apiUrl:n})}),l&&a&&b.jsx("div",{className:`
|
|
40
|
+
absolute bottom-16 ${H}
|
|
41
|
+
w-[calc(100vw-2rem)] sm:w-96
|
|
42
|
+
h-[min(600px,calc(100vh-8rem))]
|
|
43
|
+
`,style:{[r==="bottom-right"?"right":"left"]:0},children:b.jsx(Tr,{title:t,messages:f,isStreaming:g,connectionState:x,confirmationRequest:v,onSendMessage:S,onConfirm:A,onCancel:T,onClose:()=>o(!1),onLogout:d})}),b.jsx("button",{onClick:()=>o(!l),className:`
|
|
44
|
+
w-14 h-14
|
|
45
|
+
bg-nim-orange text-white
|
|
46
|
+
rounded-full
|
|
47
|
+
shadow-lg
|
|
48
|
+
flex items-center justify-center
|
|
49
|
+
transition-all duration-200
|
|
50
|
+
hover:scale-110 hover:shadow-xl
|
|
51
|
+
active:scale-95
|
|
52
|
+
rotate-0
|
|
53
|
+
`,"aria-label":l?"Close chat":"Open chat",children:l?b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):b.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:b.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})]})}const Ar={orange:"#FF6D00",cream:"#F1EDE7",blue:"#9BC1F3",black:"#231F18",brown:"#492610",green:"#188A31",white:"#FFFFFF"},Nr={fontFamily:{display:"Marist, Georgia, serif",body:"Helvetica, Arial, sans-serif"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"}},Pr={xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem"},Lr={sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem",full:"9999px",bubble:"16px"},_r={sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1)"},_s={colors:Ar,typography:Nr,spacing:Pr,borderRadius:Lr,shadows:_r};exports.ChatInput=Cr;exports.ChatMessage=Sr;exports.ChatPanel=Tr;exports.ConfirmationCard=Er;exports.NimChat=Ls;exports.ThinkingIndicator=Ir;exports.borderRadius=Lr;exports.colors=Ar;exports.shadows=_r;exports.spacing=Pr;exports.theme=_s;exports.typography=Nr;exports.useNimWebSocket=vr;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { NimChat } from './NimChat';
|
|
2
|
+
export { ChatPanel } from './components/ChatPanel';
|
|
3
|
+
export { ChatMessage } from './components/ChatMessage';
|
|
4
|
+
export { ChatInput } from './components/ChatInput';
|
|
5
|
+
export { ConfirmationCard } from './components/ConfirmationCard';
|
|
6
|
+
export { ThinkingIndicator } from './components/ThinkingIndicator';
|
|
7
|
+
export { useNimWebSocket } from './hooks/useNimWebSocket';
|
|
8
|
+
export type { Message, ClientMessage, ServerMessage, ConfirmationRequest, ConnectionState, WidgetPosition, NimChatProps, TokenUsage, } from './types';
|
|
9
|
+
export { theme, colors, typography, spacing, borderRadius, shadows } from './styles/theme';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,YAAY,EACV,OAAO,EACP,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,GACX,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
|