@nameless26/widget 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,20 +1,29 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react");function W({color:t}){return e.jsx("div",{style:{background:"var(--nx-surface)"},className:`flex items-end gap-1 px-3 py-2.5 rounded-2xl rounded-bl-sm w-fit\r
2
- bg-[rgba(255,255,255,0.06)]`,children:[0,1,2].map(o=>e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:t,opacity:.6,animation:`nexusBounce 1.2s ease-in-out ${o*.2}s infinite`}},o))})}function z({msg:t,primaryColor:o}){const n=t.role==="user";return t.content?e.jsx("div",{className:`flex ${n?"justify-end":"justify-start"}`,children:e.jsx("div",{style:n?{background:o}:{background:"var(--nx-surface)",color:"var(--nx-text)"},className:`max-w-[82%] px-3 py-2.5 rounded-2xl text-sm leading-relaxed
3
- ${n?"text-white rounded-br-sm":"bg-[rgba(255,255,255,0.06)] text-[rgba(255,255,255,0.8)] rounded-bl-sm"}`,children:t.content})}):e.jsx(e.Fragment,{})}function L({agentName:t,messages:o,isLoading:n,error:f,primaryColor:u,welcomeMessage:l,onSend:b,onClose:c,isFullView:r,onToggleFullView:g}){const[x,d]=s.useState(""),N=s.useRef(null),p=s.useRef(null);s.useEffect(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[o,n]),s.useEffect(()=>{p.current?.focus()},[]);const j=()=>{!x.trim()||n||(b(x),d(""))},C=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),j())};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),M=require("react");function Er(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const vr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ir=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tr={};function $n(e,n){return(Tr.jsx?Ir:vr).test(e)}const Pr=/[ \t\n\f\r]/g;function Ar(e){return typeof e=="object"?e.type==="text"?Wn(e.value):!1:Wn(e)}function Wn(e){return e.replace(Pr,"")===""}class Ue{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Ue.prototype.normal={};Ue.prototype.property={};Ue.prototype.space=void 0;function Lt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Ue(t,r,n)}function mn(e){return e.toLowerCase()}class ne{constructor(n,t){this.attribute=t,this.property=n}}ne.prototype.attribute="";ne.prototype.booleanish=!1;ne.prototype.boolean=!1;ne.prototype.commaOrSpaceSeparated=!1;ne.prototype.commaSeparated=!1;ne.prototype.defined=!1;ne.prototype.mustUseProperty=!1;ne.prototype.number=!1;ne.prototype.overloadedBoolean=!1;ne.prototype.property="";ne.prototype.spaceSeparated=!1;ne.prototype.space=void 0;let zr=0;const D=Se(),K=Se(),gn=Se(),w=Se(),Y=Se(),we=Se(),ie=Se();function Se(){return 2**++zr}const xn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:K,commaOrSpaceSeparated:ie,commaSeparated:we,number:w,overloadedBoolean:gn,spaceSeparated:Y},Symbol.toStringTag,{value:"Module"})),en=Object.keys(xn);class vn extends ne{constructor(n,t,r,i){let l=-1;if(super(n,t),Yn(this,"space",i),typeof r=="number")for(;++l<en.length;){const o=en[l];Yn(this,en[l],(r&xn[o])===xn[o])}}}vn.prototype.defined=!0;function Yn(e,n,t){t&&(e[n]=t)}function Ae(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 Ue(n,t,e.space)}const Rt=Ae({properties:{ariaActiveDescendant:null,ariaAtomic:K,ariaAutoComplete:null,ariaBusy:K,ariaChecked:K,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:Y,ariaCurrent:null,ariaDescribedBy:Y,ariaDetails:null,ariaDisabled:K,ariaDropEffect:Y,ariaErrorMessage:null,ariaExpanded:K,ariaFlowTo:Y,ariaGrabbed:K,ariaHasPopup:null,ariaHidden:K,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Y,ariaLevel:w,ariaLive:null,ariaModal:K,ariaMultiLine:K,ariaMultiSelectable:K,ariaOrientation:null,ariaOwns:Y,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:K,ariaReadOnly:K,ariaRelevant:null,ariaRequired:K,ariaRoleDescription:Y,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:K,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 Dt(e,n){return n in e?e[n]:n}function Ot(e,n){return Dt(e,n.toLowerCase())}const jr=Ae({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:we,acceptCharset:Y,accessKey:Y,action:null,allow:null,allowFullScreen:D,allowPaymentRequest:D,allowUserMedia:D,alpha:D,alt:null,as:null,async:D,autoCapitalize:null,autoComplete:Y,autoFocus:D,autoPlay:D,blocking:Y,capture:null,charSet:null,checked:D,cite:null,className:Y,closedBy:null,colorSpace:null,cols:w,colSpan:w,command:null,commandFor:null,content:null,contentEditable:K,controls:D,controlsList:Y,coords:w|we,crossOrigin:null,data:null,dateTime:null,decoding:null,default:D,defer:D,dir:null,dirName:null,disabled:D,download:gn,draggable:K,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:D,formTarget:null,headers:Y,height:w,hidden:gn,high:w,href:null,hrefLang:null,htmlFor:Y,httpEquiv:Y,id:null,imageSizes:null,imageSrcSet:null,inert:D,inputMode:null,integrity:null,is:null,isMap:D,itemId:null,itemProp:Y,itemRef:Y,itemScope:D,itemType:Y,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:Y,placeholder:null,playsInline:D,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:D,referrerPolicy:null,rel:Y,required:D,reversed:D,rows:w,rowSpan:w,sandbox:Y,scope:null,scoped:D,seamless:D,selected:D,shadowRootClonable:D,shadowRootCustomElementRegistry:D,shadowRootDelegatesFocus:D,shadowRootMode:null,shadowRootSerializable:D,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:K,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:K,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Y,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:K,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:D,disablePictureInPicture:D,disableRemotePlayback:D,exportParts:we,part:Y,prefix:null,property:null,results:w,security:null,unselectable:null},space:"html",transform:Ot}),Lr=Ae({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ie,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:Y,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:we,g2:we,glyphName:we,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:ie,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,maskType: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:Y,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ie,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ie,rev:ie,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ie,requiredFeatures:ie,requiredFonts:ie,requiredFormats:ie,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:ie,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:ie,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:ie,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:Dt}),Mt=Ae({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()}}),Ft=Ae({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ot}),_t=Ae({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Rr={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"},Dr=/[A-Z]/g,Xn=/-[a-z]/g,Or=/^data[-\w.:]+$/i;function Mr(e,n){const t=mn(n);let r=n,i=ne;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Or.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Xn,_r);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Xn.test(l)){let o=l.replace(Dr,Fr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=vn}return new i(r,n)}function Fr(e){return"-"+e.toLowerCase()}function _r(e){return e.charAt(1).toUpperCase()}const Nr=Lt([Rt,jr,Mt,Ft,_t],"html"),In=Lt([Rt,Lr,Mt,Ft,_t],"svg");function Br(e){return e.join(" ").trim()}function Nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ie={},nn,Jn;function Hr(){if(Jn)return nn;Jn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
2
+ `,s="/",c="*",f="",d="comment",p="declaration";function C(T,k){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];k=k||{};var P=1,E=1;function N(A){var v=A.match(n);v&&(P+=v.length);var V=A.lastIndexOf(u);E=~V?A.length-V:E+A.length}function B(){var A={line:P,column:E};return function(v){return v.position=new x(A),H(),v}}function x(A){this.start=A,this.end={line:P,column:E},this.source=k.source}x.prototype.content=T;function F(A){var v=new Error(k.source+":"+P+":"+E+": "+A);if(v.reason=A,v.filename=k.source,v.line=P,v.column=E,v.source=T,!k.silent)throw v}function O(A){var v=A.exec(T);if(v){var V=v[0];return N(V),T=T.slice(V.length),v}}function H(){O(t)}function R(A){var v;for(A=A||[];v=z();)v!==!1&&A.push(v);return A}function z(){var A=B();if(!(s!=T.charAt(0)||c!=T.charAt(1))){for(var v=2;f!=T.charAt(v)&&(c!=T.charAt(v)||s!=T.charAt(v+1));)++v;if(v+=2,f===T.charAt(v-1))return F("End of comment missing");var V=T.slice(2,v-2);return E+=2,N(V),T=T.slice(v),E+=2,A({type:d,comment:V})}}function b(){var A=B(),v=O(r);if(v){if(z(),!O(i))return F("property missing ':'");var V=O(l),X=A({type:p,property:S(v[0].replace(e,f)),value:V?S(V[0].replace(e,f)):f});return O(o),X}}function j(){var A=[];R(A);for(var v;v=b();)v!==!1&&(A.push(v),R(A));return A}return H(),j()}function S(T){return T?T.replace(a,f):f}return nn=C,nn}var Kn;function Ur(){if(Kn)return Ie;Kn=1;var e=Ie&&Ie.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.default=t;const n=e(Hr());function t(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,n.default)(r),a=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:c}=u;a?i(s,c,u):c&&(l=l||{},l[s]=c)}),l}return Ie}var De={},Qn;function Vr(){if(Qn)return De;Qn=1,Object.defineProperty(De,"__esModule",{value:!0}),De.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(s){return!s||t.test(s)||e.test(s)},o=function(s,c){return c.toUpperCase()},a=function(s,c){return"".concat(c,"-")},u=function(s,c){return c===void 0&&(c={}),l(s)?s:(s=s.toLowerCase(),c.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(n,o))};return De.camelCase=u,De}var Oe,Gn;function qr(){if(Gn)return Oe;Gn=1;var e=Oe&&Oe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Ur()),t=Vr();function r(i,l){var o={};return!i||typeof i!="string"||(0,n.default)(i,function(a,u){a&&u&&(o[(0,t.camelCase)(a,l)]=u)}),o}return r.default=r,Oe=r,Oe}var $r=qr();const Wr=Nt($r),Bt=Ht("end"),Tn=Ht("start");function Ht(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 Yr(e){const n=Tn(e),t=Bt(e);if(n&&t)return{start:n,end:t}}function _e(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zn(e.position):"start"in e||"end"in e?Zn(e):"line"in e||"column"in e?yn(e):""}function yn(e){return et(e&&e.line)+":"+et(e&&e.column)}function Zn(e){return yn(e&&e.start)+"-"+yn(e&&e.end)}function et(e){return e&&typeof e=="number"?e:1}class G 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 u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.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=_e(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}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Pn={}.hasOwnProperty,Xr=new Map,Jr=/[A-Z]/g,Kr=new Set(["table","tbody","thead","tfoot","tr"]),Qr=new Set(["td","th"]),Ut="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gr(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=oi(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=li(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"?In:Nr,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Vt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Vt(e,n,t){if(n.type==="element")return Zr(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return ei(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return ti(e,n,t);if(n.type==="mdxjsEsm")return ni(e,n);if(n.type==="root")return ri(e,n,t);if(n.type==="text")return ii(e,n)}function Zr(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=In,e.schema=i),e.ancestors.push(n);const l=$t(e,n.tagName,!1),o=ai(e,n);let a=zn(e,n);return Kr.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Ar(u):!0})),qt(e,o,l,n),An(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function ei(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)}He(e,n.position)}function ni(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);He(e,n.position)}function ti(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=In,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:$t(e,n.name,!0),o=si(e,n),a=zn(e,n);return qt(e,o,l,n),An(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function ri(e,n,t){const r={};return An(r,zn(e,n)),e.create(n,e.Fragment,r,t)}function ii(e,n){return n.value}function qt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function An(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function li(e,n,t){return r;function r(i,l,o,a){const s=Array.isArray(o.children)?t:n;return a?s(l,o,a):s(l,o)}}function oi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),u=Tn(r);return n(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function ai(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Pn.call(n.properties,i)){const l=ui(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Qr.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 si(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 He(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 He(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:Xr;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const s=i.get(u)||0;o=u+"-"+s,i.set(u,s+1)}}const a=Vt(e,l,o);a!==void 0&&t.push(a)}return t}function ui(e,n,t){const r=Mr(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Er(t):Br(t)),r.property==="style"){let i=typeof t=="object"?t:ci(e,String(t));return e.stylePropertyNameCase==="css"&&(i=fi(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Rr[r.property]||r.property:r.attribute,t]}}function ci(e,n){try{return Wr(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new G("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=Ut+"#cannot-parse-style-attribute",i}}function $t(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=$n(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=$n(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Pn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);He(e)}function He(e,n){const t=new G("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=Ut+"#cannot-handle-mdx-estrees-without-createevaluater",t}function fi(e){const n={};let t;for(t in e)Pn.call(e,t)&&(n[pi(t)]=e[t]);return n}function pi(e){let n=e.replace(Jr,hi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function hi(e){return"-"+e.toLowerCase()}const tn={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"]},di={};function mi(e,n){const t=di,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Wt(e,r,i)}function Wt(e,n,t){if(gi(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 nt(e.children,n,t)}return Array.isArray(e)?nt(e,n,t):""}function nt(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Wt(e[i],n,t);return r.join("")}function gi(e){return!!(e&&typeof e=="object")}const tt=document.createElement("i");function jn(e){const n="&"+e+";";tt.innerHTML=n;const t=tt.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function he(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 se(e,n){return e.length>0?(he(e,e.length,0,n),e):n}const rt={}.hasOwnProperty;function xi(e){const n={};let t=-1;for(;++t<e.length;)yi(n,e[t]);return n}function yi(e,n){let t;for(t in n){const i=(rt.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){rt.call(i,o)||(i[o]=[]);const a=l[o];bi(i[o],Array.isArray(a)?a:a?[a]:[])}}}function bi(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);he(e,0,0,r)}function Yt(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 Pe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pe=ye(/[A-Za-z]/),le=ye(/[\dA-Za-z]/),ki=ye(/[#-'*+\--9=?A-Z^-~]/);function bn(e){return e!==null&&(e<32||e===127)}const kn=ye(/\d/),wi=ye(/[\dA-Fa-f]/),Si=ye(/[!-/:-@[-`{-~]/);function L(e){return e!==null&&e<-2}function ee(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}const Ci=ye(new RegExp("\\p{P}|\\p{S}","u")),Ei=ye(/\s/);function ye(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ze(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&le(e.charCodeAt(t+1))&&le(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 J(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return q(u)?(e.enter(t),a(u)):n(u)}function a(u){return q(u)&&l++<i?(e.consume(u),a):(e.exit(t),n(u))}}const vi={tokenize:Ii};function Ii(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"),J(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return L(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const Ti={tokenize:Pi},it={tokenize:Ai};function Pi(e){const n=this,t=[];let r=0,i,l,o;return a;function a(E){if(r<t.length){const N=t[r];return n.containerState=N[1],e.attempt(N[0].continuation,u,s)(E)}return s(E)}function u(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&P();const N=n.events.length;let B=N,x;for(;B--;)if(n.events[B][0]==="exit"&&n.events[B][1].type==="chunkFlow"){x=n.events[B][1].end;break}k(r);let F=N;for(;F<n.events.length;)n.events[F][1].end={...x},F++;return he(n.events,B+1,0,n.events.slice(N)),n.events.length=F,s(E)}return a(E)}function s(E){if(r===t.length){if(!i)return d(E);if(i.currentConstruct&&i.currentConstruct.concrete)return C(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(it,c,f)(E)}function c(E){return i&&P(),k(r),d(E)}function f(E){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,C(E)}function d(E){return n.containerState={},e.attempt(it,p,C)(E)}function p(E){return r++,t.push([n.currentConstruct,n.containerState]),d(E)}function C(E){if(E===null){i&&P(),k(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),S(E)}function S(E){if(E===null){T(e.exit("chunkFlow"),!0),k(0),e.consume(E);return}return L(E)?(e.consume(E),T(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),S)}function T(E,N){const B=n.sliceStream(E);if(N&&B.push(null),E.previous=l,l&&(l.next=E),l=E,i.defineSkip(E.start),i.write(B),n.parser.lazy[E.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<o&&(!i.events[x][1].end||i.events[x][1].end.offset>o))return;const F=n.events.length;let O=F,H,R;for(;O--;)if(n.events[O][0]==="exit"&&n.events[O][1].type==="chunkFlow"){if(H){R=n.events[O][1].end;break}H=!0}for(k(r),x=F;x<n.events.length;)n.events[x][1].end={...R},x++;he(n.events,O+1,0,n.events.slice(F)),n.events.length=x}}function k(E){let N=t.length;for(;N-- >E;){const B=t[N];n.containerState=B[1],B[0].exit.call(n,e)}t.length=E}function P(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Ai(e,n,t){return J(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function lt(e){if(e===null||ee(e)||Ei(e))return 1;if(Ci(e))return 2}function Ln(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:zi,tokenize:ji};function zi(e,n){let t=-1,r,i,l,o,a,u,s,c;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;u=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 f={...e[r][1].end},d={...e[t][1].start};ot(f,-u),ot(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=se(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=se(s,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),s=se(s,Ln(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=se(s,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(c=2,s=se(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):c=0,he(e,r-1,t-r+3,s),t=r+s.length-c-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function ji(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=lt(r);let l;return o;function o(u){return l=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===l)return e.consume(u),a;const s=e.exit("attentionSequence"),c=lt(u),f=!c||c===2&&i||t.includes(u),d=!i||i===2&&c||t.includes(r);return s._open=!!(l===42?f:f&&(i||!d)),s._close=!!(l===42?d:d&&(c||!f)),n(u)}}function ot(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Li={name:"autolink",tokenize:Ri};function Ri(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(p){return pe(p)?(e.consume(p),o):p===64?t(p):s(p)}function o(p){return p===43||p===45||p===46||le(p)?(r=1,a(p)):s(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||le(p))&&r++<32?(e.consume(p),a):(r=0,s(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||bn(p)?t(p):(e.consume(p),u)}function s(p){return p===64?(e.consume(p),c):ki(p)?(e.consume(p),s):t(p)}function c(p){return le(p)?f(p):t(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):d(p)}function d(p){if((p===45||le(p))&&r++<63){const C=p===45?d:f;return e.consume(p),C}return t(p)}}const Qe={partial:!0,tokenize:Di};function Di(e,n,t){return r;function r(l){return q(l)?J(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||L(l)?n(l):t(l)}}const Xt={continuation:{tokenize:Mi},exit:Fi,name:"blockQuote",tokenize:Oi};function Oi(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 q(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function Mi(e,n,t){const r=this;return i;function i(o){return q(o)?J(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(Xt,n,t)(o)}}function Fi(e){e.exit("blockQuote")}const Jt={name:"characterEscape",tokenize:_i};function _i(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 Si(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const Kt={name:"characterReference",tokenize:Ni};function Ni(e,n,t){const r=this;let i=0,l,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),l=31,o=le,c(f))}function s(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=wi,c):(e.enter("characterReferenceValue"),l=7,o=kn,c(f))}function c(f){if(f===59&&i){const d=e.exit("characterReferenceValue");return o===le&&!jn(r.sliceSerialize(d))?t(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(f)&&i++<l?(e.consume(f),c):t(f)}}const at={partial:!0,tokenize:Hi},st={concrete:!0,name:"codeFenced",tokenize:Bi};function Bi(e,n,t){const r=this,i={partial:!0,tokenize:B};let l=0,o=0,a;return u;function u(x){return s(x)}function s(x){const F=r.events[r.events.length-1];return l=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(x)}function c(x){return x===a?(o++,e.consume(x),c):o<3?t(x):(e.exit("codeFencedFenceSequence"),q(x)?J(e,f,"whitespace")(x):f(x))}function f(x){return x===null||L(x)?(e.exit("codeFencedFence"),r.interrupt?n(x):e.check(at,S,N)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(x))}function d(x){return x===null||L(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):q(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),J(e,p,"whitespace")(x)):x===96&&x===a?t(x):(e.consume(x),d)}function p(x){return x===null||L(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(x))}function C(x){return x===null||L(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===a?t(x):(e.consume(x),C)}function S(x){return e.attempt(i,N,T)(x)}function T(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),k}function k(x){return l>0&&q(x)?J(e,P,"linePrefix",l+1)(x):P(x)}function P(x){return x===null||L(x)?e.check(at,S,N)(x):(e.enter("codeFlowValue"),E(x))}function E(x){return x===null||L(x)?(e.exit("codeFlowValue"),P(x)):(e.consume(x),E)}function N(x){return e.exit("codeFenced"),n(x)}function B(x,F,O){let H=0;return R;function R(v){return x.enter("lineEnding"),x.consume(v),x.exit("lineEnding"),z}function z(v){return x.enter("codeFencedFence"),q(v)?J(x,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):b(v)}function b(v){return v===a?(x.enter("codeFencedFenceSequence"),j(v)):O(v)}function j(v){return v===a?(H++,x.consume(v),j):H>=o?(x.exit("codeFencedFenceSequence"),q(v)?J(x,A,"whitespace")(v):A(v)):O(v)}function A(v){return v===null||L(v)?(x.exit("codeFencedFence"),F(v)):O(v)}}}function Hi(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 rn={name:"codeIndented",tokenize:Vi},Ui={partial:!0,tokenize:qi};function Vi(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),J(e,l,"linePrefix",5)(s)}function l(s){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(s):t(s)}function o(s){return s===null?u(s):L(s)?e.attempt(Ui,o,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||L(s)?(e.exit("codeFlowValue"),o(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function qi(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):L(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):J(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):L(o)?i(o):t(o)}}const $i={name:"codeText",previous:Yi,resolve:Wi,tokenize:Xi};function Wi(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 Yi(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Xi(e,n,t){let r=0,i,l;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?t(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(l=e.enter("codeTextSequence"),i=0,c(f)):L(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(f))}function s(f){return f===null||f===32||f===96||L(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),s)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(l.type="codeTextData",s(f))}}class Ji{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&&Me(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),Me(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Me(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);Me(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Me(this.left,t.reverse())}}}function Me(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 Qt(e){const n={};let t=-1,r,i,l,o,a,u,s;const c=new Ji(e);for(;++t<c.length;){for(;t in n;)t=n[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Ki(c,t)),t=n[t],s=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=c.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.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={...c.get(i)[1].start},a=c.slice(i,t),a.unshift(r),c.splice(i,t-i+1,a))}}return he(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!s}function Ki(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,u=[],s={};let c,f,d=-1,p=t,C=0,S=0;const T=[S];for(;p;){for(;e.get(++i)[1]!==p;);l.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=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&&(S=d+1,T.push(S),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):T.pop(),d=T.length;d--;){const k=a.slice(T[d],T[d+1]),P=l.pop();u.push([P,P+k.length-1]),e.splice(P,2,k)}for(u.reverse(),d=-1;++d<u.length;)s[C+u[d][0]]=C+u[d][1],C+=u[d][1]-u[d][0]-1;return s}const Qi={resolve:Zi,tokenize:el},Gi={partial:!0,tokenize:nl};function Zi(e){return Qt(e),e}function el(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):L(a)?e.check(Gi,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 nl(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),J(e,l,"linePrefix")}function l(o){if(o===null||L(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 Gt(e,n,t,r,i,l,o,a,u){const s=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(k){return k===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(k),e.exit(l),d):k===null||k===32||k===41||bn(k)?t(k):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),S(k))}function d(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===62?(e.exit("chunkString"),e.exit(a),d(k)):k===null||k===60||L(k)?t(k):(e.consume(k),k===92?C:p)}function C(k){return k===60||k===62||k===92?(e.consume(k),p):p(k)}function S(k){return!c&&(k===null||k===41||ee(k))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(k)):c<s&&k===40?(e.consume(k),c++,S):k===41?(e.consume(k),c--,S):k===null||k===32||k===40||bn(k)?t(k):(e.consume(k),k===92?T:S)}function T(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function Zt(e,n,t,r,i,l){const o=this;let a=0,u;return s;function s(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(l),c}function c(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):L(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||L(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),u||(u=!q(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function er(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,u):t(d)}function u(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(l),s(d))}function s(d){return d===o?(e.exit(l),u(o)):d===null?t(d):L(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),J(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===o||d===null||L(d)?(e.exit("chunkString"),s(d)):(e.consume(d),d===92?f:c)}function f(d){return d===o||d===92?(e.consume(d),c):c(d)}}function Ne(e,n){let t;return r;function r(i){return L(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):q(i)?J(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const tl={name:"definition",tokenize:il},rl={partial:!0,tokenize:ll};function il(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return Zt.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):t(p)}function u(p){return ee(p)?Ne(e,s)(p):s(p)}function s(p){return Gt(e,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(rl,f,f)(p)}function f(p){return q(p)?J(e,d,"whitespace")(p):d(p)}function d(p){return p===null||L(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function ll(e,n,t){return r;function r(a){return ee(a)?Ne(e,i)(a):t(a)}function i(a){return er(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return q(a)?J(e,o,"whitespace")(a):o(a)}function o(a){return a===null||L(a)?n(a):t(a)}}const ol={name:"hardBreakEscape",tokenize:al};function al(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return L(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const sl={name:"headingAtx",resolve:ul,tokenize:cl};function ul(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"},he(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function cl(e,n,t){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||ee(c)?(e.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||L(c)?(e.exit("atxHeading"),n(c)):q(c)?J(e,a,"whitespace")(c):(e.enter("atxHeadingText"),s(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function s(c){return c===null||c===35||ee(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),s)}}const fl=["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"],ut=["pre","script","style","textarea"],pl={concrete:!0,name:"htmlFlow",resolveTo:ml,tokenize:gl},hl={partial:!0,tokenize:yl},dl={partial:!0,tokenize:xl};function ml(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 gl(e,n,t){const r=this;let i,l,o,a,u;return s;function s(m){return c(m)}function c(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),d):m===47?(e.consume(m),l=!0,S):m===63?(e.consume(m),i=3,r.interrupt?n:h):pe(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function d(m){return m===45?(e.consume(m),i=2,p):m===91?(e.consume(m),i=5,a=0,C):pe(m)?(e.consume(m),i=4,r.interrupt?n:h):t(m)}function p(m){return m===45?(e.consume(m),r.interrupt?n:h):t(m)}function C(m){const ue="CDATA[";return m===ue.charCodeAt(a++)?(e.consume(m),a===ue.length?r.interrupt?n:b:C):t(m)}function S(m){return pe(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function T(m){if(m===null||m===47||m===62||ee(m)){const ue=m===47,be=o.toLowerCase();return!ue&&!l&&ut.includes(be)?(i=1,r.interrupt?n(m):b(m)):fl.includes(o.toLowerCase())?(i=6,ue?(e.consume(m),k):r.interrupt?n(m):b(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?P(m):E(m))}return m===45||le(m)?(e.consume(m),o+=String.fromCharCode(m),T):t(m)}function k(m){return m===62?(e.consume(m),r.interrupt?n:b):t(m)}function P(m){return q(m)?(e.consume(m),P):R(m)}function E(m){return m===47?(e.consume(m),R):m===58||m===95||pe(m)?(e.consume(m),N):q(m)?(e.consume(m),E):R(m)}function N(m){return m===45||m===46||m===58||m===95||le(m)?(e.consume(m),N):B(m)}function B(m){return m===61?(e.consume(m),x):q(m)?(e.consume(m),B):E(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),u=m,F):q(m)?(e.consume(m),x):O(m)}function F(m){return m===u?(e.consume(m),u=null,H):m===null||L(m)?t(m):(e.consume(m),F)}function O(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||ee(m)?B(m):(e.consume(m),O)}function H(m){return m===47||m===62||q(m)?E(m):t(m)}function R(m){return m===62?(e.consume(m),z):t(m)}function z(m){return m===null||L(m)?b(m):q(m)?(e.consume(m),z):t(m)}function b(m){return m===45&&i===2?(e.consume(m),V):m===60&&i===1?(e.consume(m),X):m===62&&i===4?(e.consume(m),oe):m===63&&i===3?(e.consume(m),h):m===93&&i===5?(e.consume(m),$):L(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hl,ae,j)(m)):m===null||L(m)?(e.exit("htmlFlowData"),j(m)):(e.consume(m),b)}function j(m){return e.check(dl,A,ae)(m)}function A(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),v}function v(m){return m===null||L(m)?j(m):(e.enter("htmlFlowData"),b(m))}function V(m){return m===45?(e.consume(m),h):b(m)}function X(m){return m===47?(e.consume(m),o="",te):b(m)}function te(m){if(m===62){const ue=o.toLowerCase();return ut.includes(ue)?(e.consume(m),oe):b(m)}return pe(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),te):b(m)}function $(m){return m===93?(e.consume(m),h):b(m)}function h(m){return m===62?(e.consume(m),oe):m===45&&i===2?(e.consume(m),h):b(m)}function oe(m){return m===null||L(m)?(e.exit("htmlFlowData"),ae(m)):(e.consume(m),oe)}function ae(m){return e.exit("htmlFlow"),n(m)}}function xl(e,n,t){const r=this;return i;function i(o){return L(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 yl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,n,t)}}const bl={name:"htmlText",tokenize:kl};function kl(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),u}function u(h){return h===33?(e.consume(h),s):h===47?(e.consume(h),B):h===63?(e.consume(h),E):pe(h)?(e.consume(h),O):t(h)}function s(h){return h===45?(e.consume(h),c):h===91?(e.consume(h),l=0,C):pe(h)?(e.consume(h),P):t(h)}function c(h){return h===45?(e.consume(h),p):t(h)}function f(h){return h===null?t(h):h===45?(e.consume(h),d):L(h)?(o=f,X(h)):(e.consume(h),f)}function d(h){return h===45?(e.consume(h),p):f(h)}function p(h){return h===62?V(h):h===45?d(h):f(h)}function C(h){const oe="CDATA[";return h===oe.charCodeAt(l++)?(e.consume(h),l===oe.length?S:C):t(h)}function S(h){return h===null?t(h):h===93?(e.consume(h),T):L(h)?(o=S,X(h)):(e.consume(h),S)}function T(h){return h===93?(e.consume(h),k):S(h)}function k(h){return h===62?V(h):h===93?(e.consume(h),k):S(h)}function P(h){return h===null||h===62?V(h):L(h)?(o=P,X(h)):(e.consume(h),P)}function E(h){return h===null?t(h):h===63?(e.consume(h),N):L(h)?(o=E,X(h)):(e.consume(h),E)}function N(h){return h===62?V(h):E(h)}function B(h){return pe(h)?(e.consume(h),x):t(h)}function x(h){return h===45||le(h)?(e.consume(h),x):F(h)}function F(h){return L(h)?(o=F,X(h)):q(h)?(e.consume(h),F):V(h)}function O(h){return h===45||le(h)?(e.consume(h),O):h===47||h===62||ee(h)?H(h):t(h)}function H(h){return h===47?(e.consume(h),V):h===58||h===95||pe(h)?(e.consume(h),R):L(h)?(o=H,X(h)):q(h)?(e.consume(h),H):V(h)}function R(h){return h===45||h===46||h===58||h===95||le(h)?(e.consume(h),R):z(h)}function z(h){return h===61?(e.consume(h),b):L(h)?(o=z,X(h)):q(h)?(e.consume(h),z):H(h)}function b(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,j):L(h)?(o=b,X(h)):q(h)?(e.consume(h),b):(e.consume(h),A)}function j(h){return h===i?(e.consume(h),i=void 0,v):h===null?t(h):L(h)?(o=j,X(h)):(e.consume(h),j)}function A(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||ee(h)?H(h):(e.consume(h),A)}function v(h){return h===47||h===62||ee(h)?H(h):t(h)}function V(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function X(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),te}function te(h){return q(h)?J(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):$(h)}function $(h){return e.enter("htmlTextData"),o(h)}}const Rn={name:"labelEnd",resolveAll:El,resolveTo:vl,tokenize:Il},wl={tokenize:Tl},Sl={tokenize:Pl},Cl={tokenize:Al};function El(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&&he(e,0,e.length,t),e}function vl(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 u={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=se(a,e.slice(l+1,l+r+3)),a=se(a,[["enter",c,n]]),a=se(a,Ln(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=se(a,[["exit",c,n],e[o-2],e[o-1],["exit",s,n]]),a=se(a,e.slice(o+1)),a=se(a,[["exit",u,n]]),he(e,l,e.length,a),e}function Il(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?f(d):(o=r.parser.defined.includes(Pe(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),u):t(d)}function u(d){return d===40?e.attempt(wl,c,o?c:f)(d):d===91?e.attempt(Sl,c,o?s:f)(d):o?c(d):f(d)}function s(d){return e.attempt(Cl,c,f)(d)}function c(d){return n(d)}function f(d){return l._balanced=!0,t(d)}}function Tl(e,n,t){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return ee(f)?Ne(e,l)(f):l(f)}function l(f){return f===41?c(f):Gt(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return ee(f)?Ne(e,u)(f):c(f)}function a(f){return t(f)}function u(f){return f===34||f===39||f===40?er(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function s(f){return ee(f)?Ne(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):t(f)}}function Pl(e,n,t){const r=this;return i;function i(a){return Zt.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function Al(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 zl={name:"labelStartImage",resolveAll:Rn.resolveAll,tokenize:jl};function jl(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 Ll={name:"labelStartLink",resolveAll:Rn.resolveAll,tokenize:Rl};function Rl(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 ln={name:"lineEnding",tokenize:Dl};function Dl(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),J(e,n,"linePrefix")}}const Xe={name:"thematicBreak",tokenize:Ol};function Ol(e,n,t){let r=0,i;return l;function l(s){return e.enter("thematicBreak"),o(s)}function o(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||L(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),q(s)?J(e,a,"whitespace")(s):a(s))}}const Z={continuation:{tokenize:Nl},exit:Hl,name:"list",tokenize:_l},Ml={partial:!0,tokenize:Ul},Fl={partial:!0,tokenize:Bl};function _l(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(p){const C=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:kn(p)){if(r.containerState.type||(r.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Xe,t,s)(p):s(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return t(p)}function u(p){return kn(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),s(p)):t(p)}function s(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Qe,r.interrupt?t:c,e.attempt(Ml,d,f))}function c(p){return r.containerState.initialBlankLine=!0,l++,d(p)}function f(p){return q(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function Nl(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!q(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(Fl,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Z,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Bl(e,n,t){const r=this;return J(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 Hl(e){e.exit(this.containerState.type)}function Ul(e,n,t){const r=this;return J(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!q(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const ct={name:"setextUnderline",resolveTo:Vl,tokenize:ql};function Vl(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 ql(e,n,t){const r=this;let i;return l;function l(s){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=s,o(s)):t(s)}function o(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),q(s)?J(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||L(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const $l={tokenize:Wl};function Wl(e){const n=this,t=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Qi,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 Yl={resolveAll:tr()},Xl=nr("string"),Jl=nr("text");function nr(e){return{resolveAll:tr(e==="text"?Kl: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(c){return s(c)?l(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),u}function u(c){return s(c)?(t.exit("data"),l(c)):(t.consume(c),u)}function s(c){if(c===null)return!0;const f=i[c];let d=-1;if(f)for(;++d<f.length;){const p=f[d];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function tr(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 Kl(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,u;for(;l--;){const s=i[l];if(typeof s=="string"){for(o=s.length;s.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(s===-2)u=!0,a++;else if(s!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||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={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Ql={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:Xt},Gl={91:tl},Zl={[-2]:rn,[-1]:rn,32:rn},eo={35:sl,42:Xe,45:[ct,Xe],60:pl,61:ct,95:Xe,96:st,126:st},no={38:Kt,92:Jt},to={[-5]:ln,[-4]:ln,[-3]:ln,33:zl,38:Kt,42:wn,60:[Li,bl],91:Ll,92:[ol,Jt],93:Rn,95:wn,96:$i},ro={null:[wn,Yl]},io={null:[42,95]},lo={null:[]},oo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:io,contentInitial:Gl,disable:lo,document:Ql,flow:eo,flowInitial:Zl,insideSpan:ro,string:no,text:to},Symbol.toStringTag,{value:"Module"}));function ao(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 u={attempt:F(B),check:F(x),consume:P,enter:E,exit:N,interrupt:F(x,{interrupt:!0})},s={code:null,containerState:{},defineSkip:S,events:[],now:C,parser:e,previous:null,sliceSerialize:d,sliceStream:p,write:f};let c=n.tokenize.call(s,u);return n.resolveAll&&l.push(n),s;function f(z){return o=se(o,z),T(),o[o.length-1]!==null?[]:(O(n,0),s.events=Ln(l,s.events,s),s.events)}function d(z,b){return uo(p(z),b)}function p(z){return so(o,z)}function C(){const{_bufferIndex:z,_index:b,line:j,column:A,offset:v}=r;return{_bufferIndex:z,_index:b,line:j,column:A,offset:v}}function S(z){i[z.line]=z.column,R()}function T(){let z;for(;r._index<o.length;){const b=o[r._index];if(typeof b=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<b.length;)k(b.charCodeAt(r._bufferIndex));else k(b)}}function k(z){c=c(z)}function P(z){L(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,R()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=z}function E(z,b){const j=b||{};return j.type=z,j.start=C(),s.events.push(["enter",j,s]),a.push(j),j}function N(z){const b=a.pop();return b.end=C(),s.events.push(["exit",b,s]),b}function B(z,b){O(z,b.from)}function x(z,b){b.restore()}function F(z,b){return j;function j(A,v,V){let X,te,$,h;return Array.isArray(A)?ae(A):"tokenize"in A?ae([A]):oe(A);function oe(Q){return je;function je(ge){const Ce=ge!==null&&Q[ge],Ee=ge!==null&&Q.null,qe=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return ae(qe)(ge)}}function ae(Q){return X=Q,te=0,Q.length===0?V:m(Q[te])}function m(Q){return je;function je(ge){return h=H(),$=Q,Q.partial||(s.currentConstruct=Q),Q.name&&s.parser.constructs.disable.null.includes(Q.name)?be():Q.tokenize.call(b?Object.assign(Object.create(s),b):s,u,ue,be)(ge)}}function ue(Q){return z($,h),v}function be(Q){return h.restore(),++te<X.length?m(X[te]):V}}}function O(z,b){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&he(s.events,b,s.events.length-b,z.resolve(s.events.slice(b),s)),z.resolveTo&&(s.events=z.resolveTo(s.events,s))}function H(){const z=C(),b=s.previous,j=s.currentConstruct,A=s.events.length,v=Array.from(a);return{from:A,restore:V};function V(){r=z,s.previous=b,s.currentConstruct=j,s.events.length=A,a=v,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function so(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 uo(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 co(e){const r={constructs:xi([oo,...(e||{}).extensions||[]]),content:i(vi),defined:[],document:i(Ti),flow:i($l),lazy:{},string:i(Xl),text:i(Jl)};return r;function i(l){return o;function o(a){return ao(r,l,a)}}}function fo(e){for(;!Qt(e););return e}const ft=/[\0\t\n\r]/g;function po(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const u=[];let s,c,f,d,p;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),f=0,n="",t&&(l.charCodeAt(0)===65279&&f++,t=void 0);f<l.length;){if(ft.lastIndex=f,s=ft.exec(l),d=s&&s.index!==void 0?s.index:l.length,p=l.charCodeAt(d),!s){n=l.slice(f);break}if(p===10&&f===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<d&&(u.push(l.slice(f,d)),e+=d-f),p){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=d+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const ho=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mo(e){return e.replace(ho,go)}function go(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return Yt(t.slice(l?2:1),l?16:10)}return jn(t)||e}const rr={}.hasOwnProperty;function xo(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),yo(t)(fo(co(t).document().write(po()(e,n,!0))))}function yo(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Vn),autolinkProtocol:H,autolinkEmail:H,atxHeading:l(Bn),blockQuote:l(Ee),characterEscape:H,characterReference:H,codeFenced:l(qe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(qe,o),codeText:l(mr,o),codeTextData:H,data:H,codeFlowValue:H,definition:l(gr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(xr),hardBreakEscape:l(Hn),hardBreakTrailing:l(Hn),htmlFlow:l(Un,o),htmlFlowData:H,htmlText:l(Un,o),htmlTextData:H,image:l(yr),label:o,link:l(Vn),listItem:l(br),listItemValue:d,listOrdered:l(qn,f),listUnordered:l(qn),paragraph:l(kr),reference:m,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Bn),strong:l(wr),thematicBreak:l(Cr)},exit:{atxHeading:u(),atxHeadingSequence:B,autolink:u(),autolinkEmail:Ce,autolinkProtocol:ge,blockQuote:u(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:Q,characterReference:je,codeFenced:u(T),codeFencedFence:S,codeFencedFenceInfo:p,codeFencedFenceMeta:C,codeFlowValue:R,codeIndented:u(k),codeText:u(v),codeTextData:R,data:R,definition:u(),definitionDestinationString:N,definitionLabelString:P,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(b),hardBreakTrailing:u(b),htmlFlow:u(j),htmlFlowData:R,htmlText:u(A),htmlTextData:R,image:u(X),label:$,labelText:te,lineEnding:z,link:u(V),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ue,resourceDestinationString:h,resourceTitleString:oe,resource:ae,setextHeading:u(O),setextHeadingLineSequence:F,setextHeadingText:x,strong:u(),thematicBreak:u()}};ir(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(y){let I={type:"root",children:[]};const _={stack:[I],tokenStack:[],config:n,enter:a,exit:s,buffer:o,resume:c,data:t},U=[];let W=-1;for(;++W<y.length;)if(y[W][1].type==="listOrdered"||y[W][1].type==="listUnordered")if(y[W][0]==="enter")U.push(W);else{const ce=U.pop();W=i(y,ce,W)}for(W=-1;++W<y.length;){const ce=n[y[W][0]];rr.call(ce,y[W][1].type)&&ce[y[W][1].type].call(Object.assign({sliceSerialize:y[W][2].sliceSerialize},_),y[W][1])}if(_.tokenStack.length>0){const ce=_.tokenStack[_.tokenStack.length-1];(ce[1]||pt).call(_,void 0,ce[0])}for(I.position={start:xe(y.length>0?y[0][1].start:{line:1,column:1,offset:0}),end:xe(y.length>0?y[y.length-2][1].end:{line:1,column:1,offset:0})},W=-1;++W<n.transforms.length;)I=n.transforms[W](I)||I;return I}function i(y,I,_){let U=I-1,W=-1,ce=!1,ke,de,Le,Re;for(;++U<=_;){const re=y[U];switch(re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{re[0]==="enter"?W++:W--,Re=void 0;break}case"lineEndingBlank":{re[0]==="enter"&&(ke&&!Re&&!W&&!Le&&(Le=U),Re=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Re=void 0}if(!W&&re[0]==="enter"&&re[1].type==="listItemPrefix"||W===-1&&re[0]==="exit"&&(re[1].type==="listUnordered"||re[1].type==="listOrdered")){if(ke){let ve=U;for(de=void 0;ve--;){const me=y[ve];if(me[1].type==="lineEnding"||me[1].type==="lineEndingBlank"){if(me[0]==="exit")continue;de&&(y[de][1].type="lineEndingBlank",ce=!0),me[1].type="lineEnding",de=ve}else if(!(me[1].type==="linePrefix"||me[1].type==="blockQuotePrefix"||me[1].type==="blockQuotePrefixWhitespace"||me[1].type==="blockQuoteMarker"||me[1].type==="listItemIndent"))break}Le&&(!de||Le<de)&&(ke._spread=!0),ke.end=Object.assign({},de?y[de][1].start:re[1].end),y.splice(de||U,0,["exit",ke,re[2]]),U++,_++}if(re[1].type==="listItemPrefix"){const ve={type:"listItem",_spread:!1,start:Object.assign({},re[1].start),end:void 0};ke=ve,y.splice(U,0,["enter",ve,re[2]]),U++,_++,Le=void 0,Re=!0}}}return y[I][1]._spread=ce,_}function l(y,I){return _;function _(U){a.call(this,y(U),U),I&&I.call(this,U)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(y,I,_){this.stack[this.stack.length-1].children.push(y),this.stack.push(y),this.tokenStack.push([I,_||void 0]),y.position={start:xe(I.start),end:void 0}}function u(y){return I;function I(_){y&&y.call(this,_),s.call(this,_)}}function s(y,I){const _=this.stack.pop(),U=this.tokenStack.pop();if(U)U[0].type!==y.type&&(I?I.call(this,y,U[0]):(U[1]||pt).call(this,y,U[0]));else throw new Error("Cannot close `"+y.type+"` ("+_e({start:y.start,end:y.end})+"): it’s not open");_.position.end=xe(y.end)}function c(){return mi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function d(y){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(y),10),this.data.expectingFirstListItemValue=void 0}}function p(){const y=this.resume(),I=this.stack[this.stack.length-1];I.lang=y}function C(){const y=this.resume(),I=this.stack[this.stack.length-1];I.meta=y}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const y=this.resume(),I=this.stack[this.stack.length-1];I.value=y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const y=this.resume(),I=this.stack[this.stack.length-1];I.value=y.replace(/(\r?\n|\r)$/g,"")}function P(y){const I=this.resume(),_=this.stack[this.stack.length-1];_.label=I,_.identifier=Pe(this.sliceSerialize(y)).toLowerCase()}function E(){const y=this.resume(),I=this.stack[this.stack.length-1];I.title=y}function N(){const y=this.resume(),I=this.stack[this.stack.length-1];I.url=y}function B(y){const I=this.stack[this.stack.length-1];if(!I.depth){const _=this.sliceSerialize(y).length;I.depth=_}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function F(y){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(y).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function H(y){const _=this.stack[this.stack.length-1].children;let U=_[_.length-1];(!U||U.type!=="text")&&(U=Sr(),U.position={start:xe(y.start),end:void 0},_.push(U)),this.stack.push(U)}function R(y){const I=this.stack.pop();I.value+=this.sliceSerialize(y),I.position.end=xe(y.end)}function z(y){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _=I.children[I.children.length-1];_.position.end=xe(y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(I.type)&&(H.call(this,y),R.call(this,y))}function b(){this.data.atHardBreak=!0}function j(){const y=this.resume(),I=this.stack[this.stack.length-1];I.value=y}function A(){const y=this.resume(),I=this.stack[this.stack.length-1];I.value=y}function v(){const y=this.resume(),I=this.stack[this.stack.length-1];I.value=y}function V(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=I,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function X(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=I,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function te(y){const I=this.sliceSerialize(y),_=this.stack[this.stack.length-2];_.label=mo(I),_.identifier=Pe(I).toLowerCase()}function $(){const y=this.stack[this.stack.length-1],I=this.resume(),_=this.stack[this.stack.length-1];if(this.data.inReference=!0,_.type==="link"){const U=y.children;_.children=U}else _.alt=I}function h(){const y=this.resume(),I=this.stack[this.stack.length-1];I.url=y}function oe(){const y=this.resume(),I=this.stack[this.stack.length-1];I.title=y}function ae(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function ue(y){const I=this.resume(),_=this.stack[this.stack.length-1];_.label=I,_.identifier=Pe(this.sliceSerialize(y)).toLowerCase(),this.data.referenceType="full"}function be(y){this.data.characterReferenceType=y.type}function Q(y){const I=this.sliceSerialize(y),_=this.data.characterReferenceType;let U;_?(U=Yt(I,_==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):U=jn(I);const W=this.stack[this.stack.length-1];W.value+=U}function je(y){const I=this.stack.pop();I.position.end=xe(y.end)}function ge(y){R.call(this,y);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(y)}function Ce(y){R.call(this,y);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(y)}function Ee(){return{type:"blockquote",children:[]}}function qe(){return{type:"code",lang:null,meta:null,value:""}}function mr(){return{type:"inlineCode",value:""}}function gr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xr(){return{type:"emphasis",children:[]}}function Bn(){return{type:"heading",depth:0,children:[]}}function Hn(){return{type:"break"}}function Un(){return{type:"html",value:""}}function yr(){return{type:"image",title:null,url:"",alt:null}}function Vn(){return{type:"link",title:null,url:"",children:[]}}function qn(y){return{type:"list",ordered:y.type==="listOrdered",start:null,spread:y._spread,children:[]}}function br(y){return{type:"listItem",spread:y._spread,checked:null,children:[]}}function kr(){return{type:"paragraph",children:[]}}function wr(){return{type:"strong",children:[]}}function Sr(){return{type:"text",value:""}}function Cr(){return{type:"thematicBreak"}}}function xe(e){return{line:e.line,column:e.column,offset:e.offset}}function ir(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?ir(e,r):bo(e,r)}}function bo(e,n){let t;for(t in n)if(rr.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 pt(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+_e({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+_e({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+_e({start:n.start,end:n.end})+") is still open")}function ko(e){const n=this;n.parser=t;function t(r){return xo(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function wo(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 So(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
5
+ `}]}function Co(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 Eo(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function vo(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Io(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=ze(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 u={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,u);const s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,s),e.applyData(n,s)}function To(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 Po(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function lr(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 Ao(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return lr(e,n);const i={src:ze(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 zo(e,n){const t={src:ze(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 jo(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 Lo(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return lr(e,n);const i={href:ze(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 Ro(e,n){const t={href:ze(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 Do(e,n,t){const r=e.all(n),i=t?Oo(t):or(n),l={},o=[];if(typeof n.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.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 c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
7
+ `}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
8
+ `});const s={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,s),e.applyData(n,s)}function Oo(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=or(t[r])}return n}function or(e){const n=e.spread;return n??e.children.length>1}function Mo(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 Fo(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function _o(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function No(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Bo(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=Tn(n.children[1]),u=Bt(n.children[n.children.length-1]);a&&u&&(o.position={start:a,end:u}),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 Ho(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 u=-1;const s=[];for(;++u<a;){const f=n.children[u],d={},p=o?o[u]:void 0;p&&(d.align=p);let C={type:"element",tagName:l,properties:d,children:[]};f&&(C.children=e.all(f),e.patch(f,C),C=e.applyData(f,C)),s.push(C)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(n,c),e.applyData(n,c)}function Uo(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ht=9,dt=32;function Vo(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(mt(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(mt(n.slice(i),i>0,!1)),l.join("")}function mt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===ht||l===dt;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===ht||l===dt;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function qo(e,n){const t={type:"text",value:Vo(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function $o(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Wo={blockquote:wo,break:So,code:Co,delete:Eo,emphasis:vo,footnoteReference:Io,heading:To,html:Po,imageReference:Ao,image:zo,inlineCode:jo,linkReference:Lo,link:Ro,listItem:Do,list:Mo,paragraph:Fo,root:_o,strong:No,table:Bo,tableCell:Uo,tableRow:Ho,text:qo,thematicBreak:$o,toml:$e,yaml:$e,definition:$e,footnoteDefinition:$e};function $e(){}const ar=-1,Ge=0,Be=1,Je=2,Dn=3,On=4,Mn=5,Fn=6,sr=7,ur=8,Yo=typeof self=="object"?self:globalThis,gt=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Yo[e](n)},Xo=(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 Ge:case ar:return t(o,i);case Be:{const a=t([],i);for(const u of o)a.push(r(u));return a}case Je:{const a=t({},i);for(const[u,s]of o)a[r(u)]=r(s);return a}case Dn:return t(new Date(o),i);case On:{const{source:a,flags:u}=o;return t(new RegExp(a,u),i)}case Mn:{const a=t(new Map,i);for(const[u,s]of o)a.set(r(u),r(s));return a}case Fn:{const a=t(new Set,i);for(const u of o)a.add(r(u));return a}case sr:{const{name:a,message:u}=o;return t(gt(a,u),i)}case ur: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(gt(l,o),i)};return r},xt=e=>Xo(new Map,e)(0),Te="",{toString:Jo}={},{keys:Ko}=Object,Fe=e=>{const n=typeof e;if(n!=="object"||!e)return[Ge,n];const t=Jo.call(e).slice(8,-1);switch(t){case"Array":return[Be,Te];case"Object":return[Je,Te];case"Date":return[Dn,Te];case"RegExp":return[On,Te];case"Map":return[Mn,Te];case"Set":return[Fn,Te];case"DataView":return[Be,t]}return t.includes("Array")?[Be,t]:t.includes("Error")?[sr,t]:[Je,t]},We=([e,n])=>e===Ge&&(n==="function"||n==="symbol"),Qo=(e,n,t,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return t.set(a,u),u},l=o=>{if(t.has(o))return t.get(o);let[a,u]=Fe(o);switch(a){case Ge:{let c=o;switch(u){case"bigint":a=ur,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([ar],o)}return i([a,c],o)}case Be:{if(u){let d=o;return u==="DataView"?d=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(d=new Uint8Array(o)),i([u,[...d]],o)}const c=[],f=i([a,c],o);for(const d of o)c.push(l(d));return f}case Je:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const c=[],f=i([a,c],o);for(const d of Ko(o))(e||!We(Fe(o[d])))&&c.push([l(d),l(o[d])]);return f}case Dn:return i([a,o.toISOString()],o);case On:{const{source:c,flags:f}=o;return i([a,{source:c,flags:f}],o)}case Mn:{const c=[],f=i([a,c],o);for(const[d,p]of o)(e||!(We(Fe(d))||We(Fe(p))))&&c.push([l(d),l(p)]);return f}case Fn:{const c=[],f=i([a,c],o);for(const d of o)(e||!We(Fe(d)))&&c.push(l(d));return f}}const{message:s}=o;return i([a,{name:u,message:s}],o)};return l},yt=(e,{json:n,lossy:t}={})=>{const r=[];return Qo(!(n||t),!!n,new Map,r)(e),r},Ke=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?xt(yt(e,n)):structuredClone(e):(e,n)=>xt(yt(e,n));function Go(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 Zo(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function ea(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Go,r=e.options.footnoteBackLabel||Zo,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const s=e.footnoteById.get(e.footnoteOrder[u]);if(!s)continue;const c=e.all(s),f=String(s.identifier).toUpperCase(),d=ze(f.toLowerCase());let p=0;const C=[],S=e.footnoteCounts.get(f);for(;S!==void 0&&++p<=S;){C.length>0&&C.push({type:"text",value:" "});let P=typeof t=="string"?t:t(u,p);typeof P=="string"&&(P={type:"text",value:P}),C.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(P)?P:[P]})}const T=c[c.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const P=T.children[T.children.length-1];P&&P.type==="text"?P.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...C)}else c.push(...C);const k={type:"element",tagName:"li",properties:{id:n+"fn-"+d},children:e.wrap(c,!0)};e.patch(s,k),a.push(k)}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 cr=(function(e){if(e==null)return ia;if(typeof e=="function")return Ze(e);if(typeof e=="object")return Array.isArray(e)?na(e):ta(e);if(typeof e=="string")return ra(e);throw new Error("Expected function, string, or object as test")});function na(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=cr(e[t]);return Ze(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function ta(e){const n=e;return Ze(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function ra(e){return Ze(n);function n(t){return t&&t.type===e}}function Ze(e){return n;function n(t,r,i){return!!(la(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function ia(){return!0}function la(e){return e!==null&&typeof e=="object"&&"type"in e}const fr=[],oa=!0,bt=!1,aa="skip";function sa(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=cr(i),o=r?-1:1;a(e,void 0,[])();function a(u,s,c){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return d;function d(){let p=fr,C,S,T;if((!n||l(u,s,c[c.length-1]||void 0))&&(p=ua(t(u,c)),p[0]===bt))return p;if("children"in u&&u.children){const k=u;if(k.children&&p[0]!==aa)for(S=(r?k.children.length:-1)+o,T=c.concat(k);S>-1&&S<k.children.length;){const P=k.children[S];if(C=a(P,S,T)(),C[0]===bt)return C;S=typeof C[1]=="number"?C[1]:S+o}}return p}}}function ua(e){return Array.isArray(e)?e:typeof e=="number"?[oa,e]:e==null?fr:[e]}function pr(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),sa(e,l,a,i);function a(u,s){const c=s[s.length-1],f=c?c.children.indexOf(u):void 0;return o(u,f,c)}}const Sn={}.hasOwnProperty,ca={};function fa(e,n){const t=n||ca,r=new Map,i=new Map,l=new Map,o={...Wo,...t.handlers},a={all:s,applyData:ha,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:u,options:t,patch:pa,wrap:ma};return pr(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,d=String(c.identifier).toUpperCase();f.has(d)||f.set(d,c)}}),a;function u(c,f){const d=c.type,p=a.handlers[d];if(Sn.call(a.handlers,d)&&p)return p(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(d)){if("children"in c){const{children:S,...T}=c,k=Ke(T);return k.children=a.all(c),k}return Ke(c)}return(a.options.unknownHandler||da)(a,c,f)}function s(c){const f=[];if("children"in c){const d=c.children;let p=-1;for(;++p<d.length;){const C=a.one(d[p],c);if(C){if(p&&d[p-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=kt(C.value)),!Array.isArray(C)&&C.type==="element")){const S=C.children[0];S&&S.type==="text"&&(S.value=kt(S.value))}Array.isArray(C)?f.push(...C):f.push(C)}}}return f}}function pa(e,n){e.position&&(n.position=Yr(e))}function ha(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 da(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 ma(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 kt(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function wt(e,n){const t=fa(e,n),r=t.one(e,void 0),i=ea(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 ga(e,n){return e&&"run"in e?async function(t,r){const i=wt(t,{file:r,...n});await e.run(i,r)}:function(t,r){return wt(t,{file:r,...e||n})}}function St(e){if(e)throw e}var on,Ct;function xa(){if(Ct)return on;Ct=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):n.call(s)==="[object Array]"},l=function(s){if(!s||n.call(s)!=="[object Object]")return!1;var c=e.call(s,"constructor"),f=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!c&&!f)return!1;var d;for(d in s);return typeof d>"u"||e.call(s,d)},o=function(s,c){t&&c.name==="__proto__"?t(s,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):s[c.name]=c.newValue},a=function(s,c){if(c==="__proto__")if(e.call(s,c)){if(r)return r(s,c).value}else return;return s[c]};return on=function u(){var s,c,f,d,p,C,S=arguments[0],T=1,k=arguments.length,P=!1;for(typeof S=="boolean"&&(P=S,S=arguments[1]||{},T=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});T<k;++T)if(s=arguments[T],s!=null)for(c in s)f=a(S,c),d=a(s,c),S!==d&&(P&&d&&(l(d)||(p=i(d)))?(p?(p=!1,C=f&&i(f)?f:[]):C=f&&l(f)?f:{},o(S,{name:c,newValue:u(P,C,d)})):typeof d<"u"&&o(S,{name:c,newValue:d}));return S},on}var ya=xa();const an=Nt(ya);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 ba(){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(u,...s){const c=e[++l];let f=-1;if(u){o(u);return}for(;++f<i.length;)(s[f]===null||s[f]===void 0)&&(s[f]=i[f]);i=s,c?ka(c,a)(...s):o(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function ka(e,n){let t;return r;function r(...o){const a=e.length>o.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(s){const c=s;if(a&&t)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const fe={basename:wa,dirname:Sa,extname:Ca,join:Ea,sep:"/"};function wa(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ve(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 Sa(e){if(Ve(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 Ca(e){Ve(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 Ea(...e){let n=-1,t;for(;++n<e.length;)Ve(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":va(t)}function va(e){Ve(e);const n=e.codePointAt(0)===47;let t=Ia(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Ia(e,n){let t="",r=0,i=-1,l=0,o=-1,a,u;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(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),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 Ve(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ta={cwd:Pa};function Pa(){return"/"}function En(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Aa(e){if(typeof e=="string")e=new URL(e);else if(!En(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 za(e)}function za(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 hr{constructor(n){let t;n?En(n)?t={path:n}:typeof n=="string"||ja(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Ta.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"?fe.basename(this.path):void 0}set basename(n){cn(n,"basename"),un(n,"basename"),this.path=fe.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?fe.dirname(this.path):void 0}set dirname(n){Et(this.basename,"dirname"),this.path=fe.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?fe.extname(this.path):void 0}set extname(n){if(un(n,"extname"),Et(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=fe.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){En(n)&&(n=Aa(n)),cn(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?fe.basename(this.path,this.extname):void 0}set stem(n){cn(n,"stem"),un(n,"stem"),this.path=fe.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 G(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(fe.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+fe.sep+"`")}function cn(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Et(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function ja(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const La=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),Ra={}.hasOwnProperty;class _n extends La{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=ba()}copy(){const n=new _n;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):Ra.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=Ye(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=Ye(n),u=r.parse(a);r.run(u,a,function(c,f,d){if(c||!f||!d)return s(c);const p=f,C=r.stringify(p,d);Ma(C)?d.value=C:d.result=C,s(c,d)});function s(c,f){c||!f?o(c):l?l(f):t(void 0,f)}}}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),It("processSync","process",t),r;function i(l,o){t=!0,St(l),r=o}}run(n,t,r){vt(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 u=Ye(t);i.run(n,u,s);function s(c,f,d){const p=f||n;c?a(c):o?o(p):r(void 0,p,d)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),It("runSync","run",r),i;function l(o,a){St(o),i=a,r=!0}}stringify(n,t){this.freeze();const r=Ye(t),i=this.compiler||this.Compiler;return pn("stringify",i),vt(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")u(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(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[c,...f]=s;u(c,f)}else o(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function o(s){if(!("plugins"in s)&&!("settings"in s))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(s.plugins),s.settings&&(i.settings=an(!0,i.settings,s.settings))}function a(s){let c=-1;if(s!=null)if(Array.isArray(s))for(;++c<s.length;){const f=s[c];l(f)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,c){let f=-1,d=-1;for(;++f<r.length;)if(r[f][0]===s){d=f;break}if(d===-1)r.push([s,...c]);else if(c.length>0){let[p,...C]=c;const S=r[d][1];Cn(S)&&Cn(p)&&(p=an(!0,S,p)),r[d]=[s,p,...C]}}}}const Da=new _n().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 vt(e){if(!Cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function It(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ye(e){return Oa(e)?e:new hr(e)}function Oa(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ma(e){return typeof e=="string"||Fa(e)}function Fa(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _a="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tt=[],Pt={allowDangerousHtml:!0},Na=/^(https?|ircs?|mailto|xmpp)$/i,Ba=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ha(e){const n=Ua(e),t=Va(e);return qa(n.runSync(n.parse(t),t),e)}function Ua(e){const n=e.rehypePlugins||Tt,t=e.remarkPlugins||Tt,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Pt}:Pt;return Da().use(ko).use(t).use(ga,r).use(n)}function Va(e){const n=e.children||"",t=new hr;return typeof n=="string"&&(t.value=n),t}function qa(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||$a;for(const c of Ba)Object.hasOwn(n,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+_a+c.id,void 0);return pr(e,s),Gr(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function s(c,f,d){if(c.type==="raw"&&d&&typeof f=="number")return o?d.children.splice(f,1):d.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let p;for(p in tn)if(Object.hasOwn(tn,p)&&Object.hasOwn(c.properties,p)){const C=c.properties[p],S=tn[p];(S===null||S.includes(c.tagName))&&(c.properties[p]=u(String(C||""),p,c))}}if(c.type==="element"){let p=t?!t.includes(c.tagName):l?l.includes(c.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(c,f,d)),p&&d&&typeof f=="number")return a&&c.children?d.children.splice(f,1,...c.children):d.children.splice(f,1),f}}}function $a(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||Na.test(e.slice(0,n))?e:""}function Wa({children:e}){const[n,t]=M.useState(!1),r=M.useRef(null),i=()=>{navigator.clipboard.writeText(r.current?.innerText??"").then(()=>{t(!0),setTimeout(()=>t(!1),2e3)})};return g.jsxs("div",{style:{position:"relative",margin:"0.6em 0"},children:[g.jsx("pre",{ref:r,children:e}),g.jsx("button",{className:"hover:bg-[#ffffff] rounded-full",onClick:i,style:{position:"absolute",top:1,right:1,padding:"8px",fontSize:"0.72em",color:"var(--nx-text-muted)",cursor:"pointer",transition:"color 0.15s"},children:n?g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:g.jsx("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0"})}):g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:g.jsx("path",{fillRule:"evenodd",d:"M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z"})})})]})}function Ya({content:e}){return g.jsx(Ha,{components:{p:({children:n})=>g.jsx("p",{style:{margin:"0 0 0.5em",lineHeight:1.6},children:n}),ul:({children:n})=>g.jsx("ul",{style:{margin:"0.25em 0 0.5em",paddingLeft:"1.25em"},children:n}),ol:({children:n})=>g.jsx("ol",{style:{margin:"0.25em 0 0.5em",paddingLeft:"1.25em"},children:n}),li:({children:n})=>g.jsx("li",{style:{margin:"0.2em 0",lineHeight:1.5},children:n}),strong:({children:n})=>g.jsx("strong",{style:{fontWeight:600,color:"var(--nx-text)"},children:n}),em:({children:n})=>g.jsx("em",{style:{opacity:.85},children:n}),code:({children:n})=>g.jsx(Wa,{children:n}),pre:({children:n})=>g.jsx("pre",{style:{background:"var(--nx-surface)",border:"1px solid var(--nx-border)",borderRadius:8,padding:"0.75em 1em",overflowX:"auto",fontSize:"0.82em",fontFamily:"monospace",margin:"0.5em 0"},children:n}),hr:()=>g.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--nx-border)",margin:"0.75em 0"}}),a:({children:n})=>g.jsx("span",{style:{textDecoration:"underline",opacity:.8},children:n})},children:e})}function Xa({color:e,agentName:n}){return g.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[g.jsx("div",{style:{background:e,flexShrink:0,width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12,fontWeight:600,marginTop:2},children:n[0].toUpperCase()}),g.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:4,paddingTop:10},children:[0,1,2].map(t=>g.jsx("span",{style:{display:"block",width:6,height:6,borderRadius:"50%",background:e,opacity:.55,animation:`nexusBounce 1.2s ease-in-out ${t*.2}s infinite`}},t))})]})}function Ja({msg:e,primaryColor:n,agentName:t}){return e.content?e.role==="user"?g.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:g.jsx("div",{style:{background:n,maxWidth:"75%",padding:"10px 16px",borderRadius:"18px",borderBottomRightRadius:4,color:"#fff",fontSize:14,lineHeight:1.65,wordBreak:"break-word"},children:e.content})}):g.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[g.jsx("div",{style:{background:n,flexShrink:0,width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12,fontWeight:600,marginTop:2},children:t[0].toUpperCase()}),g.jsx("div",{style:{flex:1,minWidth:0,fontSize:14,lineHeight:1.65,paddingTop:2,color:"var(--nx-text)"},children:g.jsx(Ya,{content:e.content})})]}):null}function Ka({agentName:e,messages:n,isLoading:t,error:r,primaryColor:i,welcomeMessage:l,onSend:o,onClose:a,isFullView:u,onToggleFullView:s}){const[c,f]=M.useState(""),[d,p]=M.useState(!1),[C,S]=M.useState(null),[T,k]=M.useState(!1),P=M.useRef(null),E=M.useRef(null),N=M.useRef(null),B=n.length===0,x=!!c.trim()&&!t;M.useEffect(()=>{B||P.current?.scrollIntoView({behavior:"smooth"})},[n,t,B]),M.useEffect(()=>{E.current?.focus()},[]);const F=()=>{const b=N.current;b&&k(b.scrollHeight-b.scrollTop-b.clientHeight>120)},O=()=>{x&&(o(c),f(""),E.current&&(E.current.style.height="auto"))},H=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),O())},R=b=>({padding:8,background:C===b?"var(--nx-surface)":"transparent",border:"none",borderRadius:8,color:"var(--nx-text-muted)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background 0.15s"}),z=g.jsxs("div",{style:{position:"relative",width:"100%",maxWidth:u?720:"none",margin:"0 auto"},children:[g.jsx("textarea",{ref:E,rows:1,value:c,onChange:b=>{f(b.target.value),b.target.style.height="auto",b.target.style.height=`${Math.min(b.target.scrollHeight,100)}px`},onKeyDown:H,onFocus:()=>p(!0),onBlur:()=>p(!1),placeholder:"Type a message…",disabled:t,style:{display:"block",width:"100%",boxSizing:"border-box",resize:"none",minHeight:44,maxHeight:100,overflowY:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"10px 52px 10px 14px",border:`1px solid ${d?i:"var(--nx-border)"}`,borderRadius:12,background:"var(--nx-bg)",color:"var(--nx-text)",fontSize:14,fontFamily:"inherit",outline:"none",boxShadow:"0 1px 4px rgba(0,0,0,0.07)",transition:"border-color 0.15s",opacity:t?.4:1}}),g.jsx("button",{onClick:O,disabled:!x,"aria-label":"Send message",style:{position:"absolute",right:6,bottom:6,width:32,height:32,borderRadius:8,border:"none",background:x?i:"var(--nx-surface)",display:"flex",alignItems:"center",justifyContent:"center",cursor:x?"pointer":"not-allowed",opacity:x?1:.4,transition:"background 0.15s"},children:g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:x?"white":"var(--nx-text-muted)",viewBox:"0 0 16 16",children:g.jsx("path",{fillRule:"evenodd",d:"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5"})})})]});return g.jsxs(g.Fragment,{children:[g.jsx("style",{children:`
4
15
  @keyframes nexusBounce {
5
16
  0%, 80%, 100% { transform: translateY(0); }
6
17
  40% { transform: translateY(-5px); }
7
18
  }
8
- button {
9
- cursor: pointer;
19
+ @keyframes nexusFadeUp {
20
+ from { opacity: 0; transform: translateY(10px); }
21
+ to { opacity: 1; transform: translateY(0); }
10
22
  }
11
- `}),e.jsxs("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif",position:"relative",background:"var(--nx-bg)",borderColor:r?"none":"var(--nx-border)"},className:`flex flex-col overflow-hidden shadow-2xl h-full ${r?"":"rounded-2xl border"}`,role:"dialog","aria-label":`${t} chat`,children:[!r&&e.jsxs("div",{style:{background:"var(--nx-bg)",borderBottom:"1px solid var(--nx-border)"},className:"flex items-center justify-between px-4 py-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[var(--nx-text)]/40"}),e.jsx("span",{style:{color:u},className:"text-sm font-medium",children:t})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:g,"aria-label":"Expand to full view",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),e.jsx("button",{onClick:c,"aria-label":"Close chat",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})]}),r&&e.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-2",style:{zIndex:10},children:[e.jsx("button",{onClick:g,"aria-label":"Exit full view",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})})}),e.jsx("button",{onClick:c,"aria-label":"Close chat",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",style:{minHeight:0,background:"var(--nx-bg)"},children:e.jsxs("div",{className:"space-y-3 p-2",style:r?{maxWidth:720,margin:"0 auto"}:void 0,children:[o.length===0&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{style:{background:"var(--nx-surface)",color:"var(--nx-text)"},className:"max-w-[82%] px-3 py-2.5 rounded-2xl rounded-bl-sm text-sm leading-relaxed",children:l})}),o.map(a=>e.jsx(z,{msg:a,primaryColor:u},a.id)),n&&e.jsx("div",{className:"flex justify-start",children:e.jsx(W,{color:u})}),f&&e.jsx("div",{className:"text-center text-xs text-red-400/70 py-1",children:f}),e.jsx("div",{ref:N})]})}),e.jsx("div",{style:{background:"var(--nx-bg)",borderColor:r?"none":"var(--nx-border)"},className:`${!r&&"border-t"} shrink-0 px-2.5`,children:e.jsxs("div",{className:"relative w-full mx-auto flex items-center shadow rounded-xl",style:{maxWidth:r?720:"none",marginBottom:r?20:12,marginTop:r?0:10},children:[e.jsx("textarea",{ref:p,rows:1,value:x,onChange:a=>{d(a.target.value),a.target.style.height="auto",a.target.style.height=`${Math.min(a.target.scrollHeight,100)}px`},onKeyDown:C,placeholder:"Type a message…",disabled:n,style:{resize:"none",minHeight:44,maxHeight:100,overflowY:"auto",paddingRight:52},className:`nexus-input w-full border rounded-xl px-3 py-2.5 text-sm\r
12
- transition-colors disabled:opacity-40`}),e.jsx("button",{onClick:j,disabled:!x.trim()||n,"aria-label":"Send message",style:{position:"absolute",right:6,bottom:6,background:x.trim()&&!n?u:"var(--nx-surface)"},className:`w-8 h-8 rounded-lg flex items-center justify-center\r
13
- transition-colors disabled:opacity-40\r
14
- disabled:cursor-not-allowed`,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:x.trim()&&!n?"white":"var(--nx-text-muted)",viewBox:"0 0 16 16",children:e.jsx("path",{fillRule:"evenodd",d:"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5"})})})]})})]})]})}function H(t){return`nexus_widget_session_${t}`}function A(t){const o=sessionStorage.getItem(H(t));if(o)return o;const n=crypto.randomUUID();return sessionStorage.setItem(H(t),n),n}async function*_(t,o){const n=new TextDecoder;let f="";try{for(;;){if(o.aborted)return;const{done:u,value:l}=await t.read();if(u)return;f+=n.decode(l,{stream:!0});const b=f.split(`
23
+ `}),g.jsxs("div",{role:"dialog","aria-label":`${e} chat`,style:{position:"relative",display:"flex",flexDirection:"column",height:"100%"},children:[!u&&g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",flexShrink:0,background:"var(--nx-bg)",borderBottom:"1px solid var(--nx-border)"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[g.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:"var(--nx-text)",opacity:.4}}),g.jsx("span",{style:{color:i,fontSize:14,fontWeight:500},children:e})]}),g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[g.jsx("button",{onClick:s,"aria-label":"Expand to full view",onMouseEnter:()=>S("expand"),onMouseLeave:()=>S(null),style:R("expand"),children:g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:g.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),g.jsx("button",{onClick:a,"aria-label":"Close chat",onMouseEnter:()=>S("close"),onMouseLeave:()=>S(null),style:R("close"),children:g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:g.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})]}),u&&g.jsxs("div",{style:{position:"absolute",top:16,right:16,display:"flex",alignItems:"center",gap:8,zIndex:10},children:[g.jsx("button",{onClick:s,"aria-label":"Exit full view",onMouseEnter:()=>S("shrink"),onMouseLeave:()=>S(null),style:R("shrink"),children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:g.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})})}),g.jsx("button",{onClick:a,"aria-label":"Close",onMouseEnter:()=>S("close-full"),onMouseLeave:()=>S(null),style:R("close-full"),children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:g.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),B&&g.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:u?"60px 40px 48px":"32px 20px 24px",animation:"nexusFadeUp 0.25s ease"},children:[g.jsx("div",{style:{width:u?72:60,height:u?72:60,borderRadius:18,background:i,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:u?28:24,fontWeight:700,marginBottom:22,boxShadow:"0 8px 28px rgba(0,0,0,0.15)"},children:e[0].toUpperCase()}),g.jsxs("h2",{style:{margin:"0 0 10px",fontSize:u?32:22,fontWeight:700,color:"var(--nx-text)",textAlign:"center",letterSpacing:"-0.4px",lineHeight:1.2},children:["Hi, I'm ",e," 👋"]}),g.jsx("p",{style:{margin:"0 0 36px",fontSize:u?16:14,color:"var(--nx-text-muted)",textAlign:"center",lineHeight:1.7,maxWidth:u?500:260},children:l}),g.jsx("div",{style:{width:"100%",maxWidth:u?640:"none"},children:z}),g.jsx("p",{style:{margin:"10px 0 0",fontSize:11,color:"var(--nx-text-muted)",opacity:.5},children:"Enter to send · Shift+Enter for new line"})]}),!B&&g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:N,onScroll:F,style:{flex:1,overflowY:"auto",minHeight:0,background:"var(--nx-bg)"},children:g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:8,maxWidth:u?720:"none",margin:"0 auto"},children:[n.map((b,j)=>{const A=n[j-1],v=j>0&&A.role==="assistant"&&b.role==="user";return g.jsxs(M.Fragment,{children:[v&&g.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--nx-border)",margin:"8px 0"}}),g.jsx(Ja,{msg:b,primaryColor:i,agentName:e})]},b.id)}),t&&g.jsx(Xa,{color:i,agentName:e}),r&&g.jsx("p",{style:{textAlign:"center",fontSize:12,padding:"4px 0",color:"var(--nx-error)"},children:r}),g.jsx("div",{ref:P})]})}),T&&g.jsx("button",{onClick:()=>P.current?.scrollIntoView({behavior:"smooth"}),"aria-label":"Scroll to bottom",style:{position:"absolute",bottom:90,left:"50%",transform:"translateX(-50%)",width:30,height:30,borderRadius:"50%",background:"var(--nx-bg)",border:"1px solid var(--nx-border)",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"var(--nx-text)",opacity:.85,zIndex:5},children:g.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:g.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})})}),g.jsx("div",{style:{flexShrink:0,background:"var(--nx-bg)",borderTop:u?"none":"1px solid var(--nx-border)",padding:u?"0 10px 20px":"10px 10px 12px"},children:z})]})]})]})}function Qa({agentId:e,sessionId:n,agentName:t,primaryColor:r,apiUrl:i,onAuthenticated:l}){const[o,a]=M.useState("email"),[u,s]=M.useState(""),[c,f]=M.useState(["","","","","",""]),[d,p]=M.useState(!1),[C,S]=M.useState(""),[T,k]=M.useState(0),P=M.useRef(null),E=M.useRef([]),N=M.useRef(null);M.useEffect(()=>{P.current?.focus()},[]),M.useEffect(()=>{o==="otp"&&E.current[0]?.focus()},[o]),M.useEffect(()=>{if(!(T<=0))return N.current=setInterval(()=>{k(b=>b<=1?(clearInterval(N.current),0):b-1)},1e3),()=>clearInterval(N.current)},[T]);const B=()=>k(60),x=async()=>{if(!(!u.trim()||d)){p(!0),S("");try{const b=await fetch(`${i}/widget/auth/request-otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:e,email:u})});if(!b.ok){const j=b.status===429?"Too many attempts. Please wait a minute and try again.":"We couldn’t send the verification code. Please try again.";S(j);return}a("otp"),B()}catch{S("Network error. Please try again.")}finally{p(!1)}}},F=async()=>{const b=c.join("");if(!(b.length<6||d)){p(!0),S("");try{const j=await fetch(`${i}/widget/auth/verify-otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:e,email:u,code:b,sessionId:n})});if(!j.ok){const V=await j.json().catch(()=>({}));S(V.message??"Incorrect code. Please try again."),f(["","","","","",""]),E.current[0]?.focus();return}const{token:A,expiresAt:v}=await j.json();l(A,v)}catch{S("Network error. Please try again.")}finally{p(!1)}}},O=(b,j)=>{if(!/^\d*$/.test(j))return;const A=[...c];A[b]=j.slice(-1),f(A),j&&b<5&&E.current[b+1]?.focus(),j&&b===5&&[...A].join("").length===6&&setTimeout(F,50)},H=(b,j)=>{j.key==="Backspace"&&!c[b]&&b>0&&E.current[b-1]?.focus()},R=b=>{const j=b.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);if(!j)return;b.preventDefault();const A=["","","","","",""];j.split("").forEach((V,X)=>{A[X]=V}),f(A);const v=Math.min(j.length,5);E.current[v]?.focus(),j.length===6&&setTimeout(F,50)},z=b=>({width:"100%",padding:"11px 0",borderRadius:12,border:"none",background:b?r:"var(--nx-surface)",color:b?"#fff":"var(--nx-text-muted)",fontSize:14,fontWeight:600,cursor:b?"pointer":"not-allowed",opacity:b?1:.55,transition:"background 0.15s, opacity 0.15s",fontFamily:"inherit"});return g.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 24px",fontFamily:"system-ui, -apple-system, sans-serif"},children:[g.jsx("div",{style:{width:52,height:52,borderRadius:14,background:r,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,fontWeight:700,marginBottom:20,boxShadow:"0 6px 20px rgba(0,0,0,0.12)"},children:t[0].toUpperCase()}),o==="email"?g.jsxs(g.Fragment,{children:[g.jsx("h2",{style:{margin:"0 0 8px",fontSize:18,fontWeight:700,color:"var(--nx-text)",textAlign:"center",letterSpacing:"-0.3px"},children:"Sign in to continue"}),g.jsx("p",{style:{margin:"0 0 28px",fontSize:13,color:"var(--nx-text-muted)",textAlign:"center",lineHeight:1.6},children:"Enter your work email to receive a verification code."}),g.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:12},children:[g.jsx("input",{ref:P,type:"email",value:u,onChange:b=>s(b.target.value),onKeyDown:b=>b.key==="Enter"&&x(),placeholder:"you@company.com",style:{width:"100%",boxSizing:"border-box",padding:"11px 14px",border:"1px solid var(--nx-border)",borderRadius:12,background:"var(--nx-bg)",color:"var(--nx-text)",fontSize:14,outline:"none",fontFamily:"inherit"}}),g.jsx("button",{onClick:x,disabled:!u.trim()||d,style:z(!!u.trim()&&!d),children:d?"Sending…":"Send code"})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("h2",{style:{margin:"0 0 8px",fontSize:18,fontWeight:700,color:"var(--nx-text)",textAlign:"center",letterSpacing:"-0.3px"},children:"Check your email"}),g.jsxs("p",{style:{margin:"0 0 28px",fontSize:13,color:"var(--nx-text-muted)",textAlign:"center",lineHeight:1.6,maxWidth:220},children:["We sent a 6-digit code to ",g.jsx("span",{style:{color:"var(--nx-text)",fontWeight:500},children:u})]}),g.jsx("div",{style:{display:"flex",gap:8,marginBottom:20},children:c.map((b,j)=>g.jsx("input",{ref:A=>{E.current[j]=A},type:"text",inputMode:"numeric",maxLength:1,value:b,onChange:A=>O(j,A.target.value),onKeyDown:A=>H(j,A),onPaste:j===0?R:void 0,style:{width:44,height:52,textAlign:"center",fontSize:22,fontWeight:700,border:`1.5px solid ${b?r:"var(--nx-border)"}`,borderRadius:10,background:"var(--nx-bg)",color:"var(--nx-text)",outline:"none",transition:"border-color 0.15s",fontFamily:"inherit"}},j))}),g.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:10},children:[g.jsx("button",{onClick:F,disabled:c.join("").length<6||d,style:z(c.join("").length===6&&!d),children:d?"Verifying…":"Verify code"}),g.jsx("button",{onClick:()=>{x(),f(["","","","","",""])},disabled:T>0||d,style:{width:"100%",padding:"8px 0",border:"none",background:"transparent",color:T>0?"var(--nx-text-muted)":r,fontSize:13,fontWeight:500,cursor:T>0?"not-allowed":"pointer",fontFamily:"inherit"},children:T>0?`Resend in ${T}s`:"Resend code"})]}),g.jsx("button",{onClick:()=>{a("email"),f(["","","","","",""]),S("")},style:{marginTop:4,border:"none",background:"transparent",color:"var(--nx-text-muted)",fontSize:12,cursor:"pointer",fontFamily:"inherit"},children:"← Use a different email"})]}),C&&g.jsx("p",{style:{marginTop:14,fontSize:12,color:"var(--nx-error)",textAlign:"center"},children:C})]})}const Ga="nexus_sid_",Nn="nexus_wt_";function Za(e){const n=`${Ga}${e}`,t=localStorage.getItem(n);if(t)return t;const r=crypto.randomUUID();return localStorage.setItem(n,r),r}function es(e){const n=localStorage.getItem(`${Nn}${e}`);if(!n)return null;try{const{token:t,expiresAt:r}=JSON.parse(n);return new Date(r)<=new Date?(At(e),null):t}catch{return At(e),null}}function ns(e,n,t){localStorage.setItem(`${Nn}${e}`,JSON.stringify({token:n,expiresAt:t}))}function At(e){localStorage.removeItem(`${Nn}${e}`)}const zt={bg:"#0d0d1a",surface:"rgba(255,255,255,0.06)",border:"rgba(255,255,255,0.08)",text:"rgba(255,255,255,0.82)",textMuted:"rgba(255,255,255,0.25)",inputBg:"rgba(255,255,255,0.05)",inputBorder:"rgba(255,255,255,0.08)",inputBorderFocus:"rgba(255,255,255,0.20)",error:"rgba(248,113,113,0.75)"},jt={bg:"#f8f9fb",surface:"rgba(0,0,0,0.055)",border:"rgba(0,0,0,0.09)",text:"rgba(0,0,0,0.82)",textMuted:"rgba(0,0,0,0.38)",inputBg:"rgba(0,0,0,0.04)",inputBorder:"rgba(0,0,0,0.10)",inputBorderFocus:"rgba(0,0,0,0.22)",error:"rgba(220,38,38,0.80)"};function dn(e){return e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?zt:jt:e==="dark"?zt:jt}function ts(e){return{"--nx-bg":e.bg,"--nx-surface":e.surface,"--nx-border":e.border,"--nx-text":e.text,"--nx-text-muted":e.textMuted,"--nx-input-bg":e.inputBg,"--nx-input-border":e.inputBorder,"--nx-input-border-focus":e.inputBorderFocus,"--nx-error":e.error}}async function*rs(e,n){const t=new TextDecoder;let r="";try{for(;;){if(n.aborted)return;const{done:i,value:l}=await e.read();if(i)return;r+=t.decode(l,{stream:!0});const o=r.split(`
15
24
 
16
- `);f=b.pop()??"";for(const c of b)for(const r of c.split(`
17
- `)){if(!r.startsWith("data: "))continue;const g=r.slice(6).trim();try{yield JSON.parse(g)}catch{}}}}finally{t.releaseLock()}}function P({agentId:t,baseUrl:o,agentCoreUrl:n,endUserId:f}){const[u,l]=s.useState([]),[b,c]=s.useState(!1),[r,g]=s.useState(!0),[x,d]=s.useState(null),[N,p]=s.useState(null),[j,C]=s.useState(null),a=s.useRef(A(t)),m=s.useRef(null),S=s.useCallback(async()=>{m.current?.abort(),g(!0),d(null);const y=new AbortController;m.current=y;try{const i=await fetch(`${o}/widget/session`,{method:"POST",signal:y.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:t,sessionId:a.current})});if(!i.ok)throw new Error(`HTTP ${i.status}`);const k=await i.json();C(k.token);const v=await fetch(`${o}/chat/history`,{method:"POST",signal:y.signal,headers:{"Content-Type":"application/json",Authorization:`Bearer ${k.token}`},body:JSON.stringify({agentId:t,sessionId:a.current})});if(v.status==404){l([]),p(null);return}if(!v.ok)throw new Error(`HTTP ${v.status}`);const h=await v.json();l(h.messages??[]),p(h.conversationId??null)}catch(i){console.log(i),i.status!=404&&i?.name!=="AbortError"&&d("Error Loading History")}finally{g(!1)}},[t]);s.useEffect(()=>(S(),()=>{m.current?.abort()}),[S]);const M=s.useCallback(()=>{m.current?.abort(),c(!1)},[]),E=s.useCallback(()=>{m.current?.abort(),l([]),p(null),d(null),c(!1),a.current=crypto.randomUUID(),C(null),S()},[S]),T=s.useCallback(async y=>{if(!y.trim()||b||!j)return;m.current?.abort();const i=new AbortController;m.current=i,d(null);const k=`u_${Date.now()}`,v=`a_${Date.now()}`;l(h=>[...h,{id:k,role:"user",content:y.trim()}]),c(!0);try{const h=await fetch(`${n}/chat`,{method:"POST",signal:i.signal,headers:{"Content-Type":"application/json",Authorization:`Bearer ${j}`},body:JSON.stringify({agent_id:t,message:y.trim(),session_id:a.current})});if(!h.ok||!h.body)throw new Error(`HTTP ${h.status}`);l(w=>[...w,{id:v,role:"assistant",content:""}]);const $=h.body.getReader();for await(const w of _($,i.signal))switch(w.type){case"start":p(w.conversationId);break;case"token":l(I=>I.map(B=>B.id===v?{...B,content:B.content+w.content}:B));break;case"done":break;case"error":d(w.message),l(I=>I.filter(B=>B.id!==v));break}}catch(h){if(h?.name==="AbortError")return;d("Something went wrong. Please try again."),l($=>$.filter(w=>w.id!==k&&w.id!==v))}finally{c(!1)}},[t,f,b,j]);return{messages:u,isLoading:b,historyLoading:r,error:x,conversationId:N,send:T,reset:E,cancel:M}}const O={bg:"#0d0d1a",surface:"rgba(255,255,255,0.06)",border:"rgba(255,255,255,0.08)",text:"rgba(255,255,255,0.82)",textMuted:"rgba(255,255,255,0.25)",inputBg:"rgba(255,255,255,0.05)",inputBorder:"rgba(255,255,255,0.08)",inputBorderFocus:"rgba(255,255,255,0.20)",error:"rgba(248,113,113,0.75)"},D={bg:"#f8f9fb",surface:"rgba(0,0,0,0.055)",border:"rgba(0,0,0,0.09)",text:"rgba(0,0,0,0.82)",textMuted:"rgba(0,0,0,0.38)",inputBg:"rgba(0,0,0,0.04)",inputBorder:"rgba(0,0,0,0.10)",inputBorderFocus:"rgba(0,0,0,0.22)",error:"rgba(220,38,38,0.80)"};function R(t){return t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?O:D:t==="dark"?O:D}function U(t){return{"--nx-bg":t.bg,"--nx-surface":t.surface,"--nx-border":t.border,"--nx-text":t.text,"--nx-text-muted":t.textMuted,"--nx-input-bg":t.inputBg,"--nx-input-border":t.inputBorder,"--nx-input-border-focus":t.inputBorderFocus,"--nx-error":t.error}}function J({agentId:t,agentName:o,baseUrl:n,agentCoreUrl:f,primaryColor:u="#6366f1",welcomeMessage:l="Hi! How can I help you?",position:b="bottom-right",theme:c="dark"}){const[r,g]=s.useState(!1),[x,d]=s.useState(!1),[N,p]=s.useState(()=>R(c)),j=s.useRef(null),{messages:C,isLoading:a,error:m,send:S,reset:M,cancel:E}=P({agentId:t,baseUrl:n,agentCoreUrl:f}),T=b!=="bottom-left",y=()=>{E(),g(!1),d(!1)};return s.useEffect(()=>{if(p(R(c)),c!=="system")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),k=()=>p(R("system"));return i.addEventListener("change",k),()=>i.removeEventListener("change",k)},[c]),e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
25
+ `);r=o.pop()??"";for(const a of o)for(const u of a.split(`
26
+ `)){if(!u.startsWith("data: "))continue;const s=u.slice(6).trim();try{yield JSON.parse(s)}catch{}}}}finally{e.releaseLock()}}function dr({agentId:e,accessType:n,sessionId:t,widgetToken:r,baseUrl:i,agentCoreUrl:l}){const[o,a]=M.useState([]),[u,s]=M.useState(!1),[c,f]=M.useState(null),[d,p]=M.useState(null),C=M.useRef(null),S=M.useCallback(async()=>{f(null);try{const P=await fetch(`${i}/chat/history`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({agentId:e,sessionId:t})});if(P.status==404){a([]),p(null);return}if(!P.ok)throw new Error(`HTTP ${P.status}`);const E=await P.json();a(E.messages??[]),p(E.conversationId??null)}catch(P){console.log(P),P.status!=404&&P?.name!=="AbortError"&&f("Error Loading History")}},[e,t]);M.useEffect(()=>{t&&S()},[t,S]);const T=M.useCallback(()=>{C.current?.abort(),s(!1)},[]),k=M.useCallback(async P=>{if(!P.trim()||u||!r)return;C.current?.abort();const E=new AbortController;C.current=E,f(null);const N=`u_${Date.now()}`,B=`a_${Date.now()}`;a(x=>[...x,{id:N,role:"user",content:P.trim()}]),s(!0);try{const x=await fetch(`${l}/chat`,{method:"POST",signal:E.signal,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({agent_id:e,message:P.trim(),session_id:t,access_type:n})});if(!x.ok||!x.body)throw new Error(`HTTP ${x.status}`);a(O=>[...O,{id:B,role:"assistant",content:""}]);const F=x.body.getReader();for await(const O of rs(F,E.signal))switch(O.type){case"start":p(O.conversationId);break;case"token":a(H=>H.map(R=>R.id===B?{...R,content:R.content+O.content}:R));break;case"done":break;case"error":f(O.message),a(H=>H.filter(R=>R.id!==B));break}}catch(x){if(x?.name==="AbortError")return;f("Something went wrong. Please try again."),a(F=>F.filter(O=>O.id!==N&&O.id!==B))}finally{s(!1)}},[e,u,t,r,n]);return{messages:o,isLoading:u,error:c,conversationId:d,send:k,cancel:T}}function is({agentId:e,agentName:n,baseUrl:t,agentCoreUrl:r,primaryColor:i="#6366f1",welcomeMessage:l="How can I help you?",position:o="bottom-right",theme:a="dark"}){const[u,s]=M.useState(!1),[c,f]=M.useState(!1),[d,p]=M.useState(),[C,S]=M.useState(!1),[T,k]=M.useState(null),[P,E]=M.useState(null),N=d?.accessType==="private",B=C&&N&&!P,x=C&&(!N||!!P),F=async()=>{try{const $=await fetch(`${t}/widget/session`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({agentId:e,sessionId:T})});if(!$.ok)throw new Error(`HTTP ${$.status}`);const h=await $.json();O(h.token,h.expiresAt)}catch($){console.log($)}};M.useEffect(()=>{k(Za(e))},[e]),M.useEffect(()=>{let $=!1;async function h(){const ae=await(await fetch(`${t}/agents/${e}/widget-config`)).json();if($)return;p(ae);const m=es(e);if(m){E(m),S(!0);return}ae.accessType==="public"&&await F(),S(!0)}return T&&h(),()=>{$=!0}},[e,t,T]);function O($,h){ns(e,$,h),E($)}const[H,R]=M.useState(()=>dn(a)),z=M.useRef(null),{messages:b,isLoading:j,error:A,send:v,cancel:V}=dr({agentId:e,accessType:d?.accessType,baseUrl:t,agentCoreUrl:r,sessionId:T,widgetToken:P}),X=o!=="bottom-left",te=()=>{V(),s(!1),f(!1)};return M.useEffect(()=>{if(R(dn(a)),a!=="system")return;const $=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>R(dn("system"));return $.addEventListener("change",h),()=>$.removeEventListener("change",h)},[a]),g.jsxs(g.Fragment,{children:[g.jsx("style",{children:`
18
27
  .nexus-bubble-btn {
19
28
  transition: transform 0.2s ease, box-shadow 0.15s ease, opacity 0.18s ease;
20
29
  }
@@ -46,7 +55,7 @@
46
55
  color: var(--nx-text);
47
56
  background: var(--nx-surface);
48
57
  }
49
- `}),e.jsxs("div",{ref:j,style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:"none",fontFamily:"system-ui, -apple-system, sans-serif",...U(N)},children:[e.jsx("div",{style:x?{position:"absolute",inset:0,opacity:1,pointerEvents:"auto",transition:"all 0.25s ease"}:r?{position:"absolute",[T?"right":"left"]:0,top:0,bottom:0,width:380,opacity:1,pointerEvents:"auto",transition:"all 0.28s cubic-bezier(0.34, 1.45, 0.64, 1)"}:{position:"absolute",[T?"right":"left"]:20,bottom:88,width:420,height:"calc(100vh - 108px)",border:"1px solid var(--nx-border)",opacity:0,transform:"scale(0.82) translateY(12px)",transformOrigin:`bottom ${T?"right":"left"}`,pointerEvents:"none",transition:"all 0.2s ease-in"},children:r&&e.jsx(L,{agentName:o??"Assistant",messages:C,isLoading:a,error:m??null,primaryColor:u,welcomeMessage:l,onSend:S,onReset:M,onClose:y,onToggleFullView:()=>d(i=>!i),isFullView:x})}),e.jsx("button",{className:"nexus-bubble-btn",onClick:()=>g(i=>!i),"aria-label":r?"Close chat":"Open chat","aria-expanded":r,style:{position:"absolute",[T?"right":"left"]:20,bottom:20,width:56,height:56,borderRadius:"50%",background:u,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.28)",pointerEvents:"auto",opacity:r?0:1,transform:r?"scale(0.5)":"scale(1)"},children:e.jsx("span",{style:{position:"relative",width:40,height:40},children:e.jsx("span",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease, transform 0.2s ease",opacity:r?0:1,transform:r?"scale(0.65) rotate(-15deg)":"scale(1) rotate(0deg)"},children:e.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"256",cy:"256",r:"220",fill:"#6366f1"}),e.jsx("rect",{x:"156",y:"150",width:"200",height:"170",rx:"36",fill:"white"}),e.jsx("line",{x1:"256",y1:"120",x2:"256",y2:"150",stroke:"white","stroke-width":"10","stroke-linecap":"round"}),e.jsx("circle",{cx:"256",cy:"105",r:"14",fill:"white"}),e.jsx("circle",{cx:"210",cy:"220",r:"18",fill:"#6366f1"}),e.jsx("circle",{cx:"302",cy:"220",r:"18",fill:"#6366f1"}),e.jsx("rect",{x:"206",y:"265",width:"100",height:"16",rx:"8",fill:"#6366f1"}),e.jsx("rect",{x:"132",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),e.jsx("rect",{x:"356",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),e.jsx("path",{d:`M180 340
58
+ `}),g.jsxs("div",{ref:z,style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:"none",fontFamily:"system-ui, -apple-system, sans-serif",...ts(H)},children:[g.jsx("div",{style:c?{position:"absolute",inset:0,opacity:1,pointerEvents:"auto",transition:"all 0.25s ease"}:u?{position:"absolute",top:10,bottom:10,width:380,opacity:1,[X?"right":"left"]:10,pointerEvents:"auto",transition:"all 0.28s cubic-bezier(0.34, 1.45, 0.64, 1)"}:{position:"absolute",[X?"right":"left"]:20,bottom:88,width:420,height:"calc(100vh - 108px)",border:"1px solid var(--nx-border)",opacity:0,transform:"scale(0.82) translateY(12px)",transformOrigin:`bottom ${X?"right":"left"}`,pointerEvents:"none",transition:"all 0.2s ease-in"},children:g.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",fontFamily:"system-ui, -apple-system, sans-serif",background:"var(--nx-bg)",border:c?"none":"1px solid var(--nx-border)",borderRadius:c?0:16,boxShadow:c?"none":"0 25px 50px -12px rgba(0,0,0,0.25)"},children:[B&&t&&g.jsx(Qa,{agentId:e,sessionId:T,agentName:d.name,primaryColor:d.widgetConfig?.primaryColor??"#2563EB",apiUrl:t,onAuthenticated:O}),x&&u&&g.jsx(Ka,{agentName:n??"Assistant",messages:b,isLoading:j,error:A??null,primaryColor:i,welcomeMessage:l,onSend:v,onClose:te,onToggleFullView:()=>f($=>!$),isFullView:c})]})}),g.jsx("button",{className:"nexus-bubble-btn",onClick:()=>s($=>!$),"aria-label":u?"Close chat":"Open chat","aria-expanded":u,style:{position:"absolute",[X?"right":"left"]:20,bottom:20,width:56,height:56,borderRadius:"50%",background:i,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.28)",pointerEvents:u?"none":"auto",opacity:u?0:1,transform:u?"scale(0.5)":"scale(1)"},children:g.jsx("span",{style:{position:"relative",width:40,height:40},children:g.jsx("span",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease, transform 0.2s ease",opacity:u?0:1,transform:u?"scale(0.65) rotate(-15deg)":"scale(1) rotate(0deg)"},children:g.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("circle",{cx:"256",cy:"256",r:"220",fill:"#6366f1"}),g.jsx("rect",{x:"156",y:"150",width:"200",height:"170",rx:"36",fill:"white"}),g.jsx("line",{x1:"256",y1:"120",x2:"256",y2:"150",stroke:"white",strokeWidth:"10",strokeLinecap:"round"}),g.jsx("circle",{cx:"256",cy:"105",r:"14",fill:"white"}),g.jsx("circle",{cx:"210",cy:"220",r:"18",fill:"#6366f1"}),g.jsx("circle",{cx:"302",cy:"220",r:"18",fill:"#6366f1"}),g.jsx("rect",{x:"206",y:"265",width:"100",height:"16",rx:"8",fill:"#6366f1"}),g.jsx("rect",{x:"132",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),g.jsx("rect",{x:"356",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),g.jsx("path",{d:`M180 340
50
59
  h152
51
60
  a24 24 0 0 1 24 24
52
61
  v20
@@ -57,4 +66,4 @@
57
66
  h-52
58
67
  a24 24 0 0 1 -24 -24
59
68
  v-20
60
- a24 24 0 0 1 24 -24z`,fill:"white"}),e.jsx("circle",{cx:"220",cy:"374",r:"8",fill:"#6366f1"}),e.jsx("circle",{cx:"256",cy:"374",r:"8",fill:"#6366f1"}),e.jsx("circle",{cx:"292",cy:"374",r:"8",fill:"#6366f1"})]})})})})]})]})}exports.NexusWidget=J;exports.useChat=P;
69
+ a24 24 0 0 1 24 -24z`,fill:"white"}),g.jsx("circle",{cx:"220",cy:"374",r:"8",fill:"#6366f1"}),g.jsx("circle",{cx:"256",cy:"374",r:"8",fill:"#6366f1"}),g.jsx("circle",{cx:"292",cy:"374",r:"8",fill:"#6366f1"})]})})})})]})]})}exports.NexusWidget=is;exports.useChat=dr;