@snf/qa-bot-core 0.2.10 → 0.2.11-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@ import*as e from"react";import t,{forwardRef as n,createContext as r,useContext
5
5
  * Copyright(c) 2015 Andreas Lubbe
6
6
  * Copyright(c) 2015 Tiancheng "Timothy" Gu
7
7
  * MIT Licensed
8
- */var gn,mn;const vn=hn(function(){if(mn)return gn;mn=1;var e=/["'&<>]/;return gn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,A="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#39;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}a!==i&&(A+=n.substring(a,i)),a=i+1,A+=o}return a!==i?A+n.substring(a,i):A}}());function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wn=/(url|image|image-set)\(/i;class yn extends fn{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(wn)&&delete t[e]}),t}}const xn=/^<(!doctype|(html|head|body)(\s|>))/i,En=/^(aria-|data-|\w+:)/iu,Bn=/{{{(\w+)\/?}}}/;function Pn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let Dn=class{constructor(e,t={},n=[],r=[]){var o;if(bn(this,"allowed",void 0),bn(this,"banned",void 0),bn(this,"blocked",void 0),bn(this,"container",void 0),bn(this,"content",[]),bn(this,"props",void 0),bn(this,"matchers",void 0),bn(this,"filters",void 0),bn(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new yn],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:ln),this.banned=new Set(sn),this.blocked=new Set(t.blockList)}applyAttributeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.attribute?n.attribute(e,t):t,t)}applyNodeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.node?n.node(e,t):t,t)}applyMatchers(e,t){const n={},{props:r}=this;let o=e,A=0,i=null;return this.matchers.forEach(e=>{const a=e.asTag().toLowerCase(),s=this.getTagConfig(a);if(r[e.inverseName]||!this.isTagAllowed(a)||!this.canRenderChild(t,s))return;let l="";for(;o&&(i=e.match(o));){const{index:t,length:a,match:s,valid:c,void:u,...d}=i,p=e.propName+String(A);t>0&&(l+=o.slice(0,t)),c?(l+=u?`{{{${p}/}}}`:`{{{${p}}}}${s}{{{/${p}}}}`,this.keyIndex+=1,A+=1,n[p]={children:s,matcher:e,props:{...r,...d,key:this.keyIndex}}):l+=s,e.greedy?(o=l+o.slice(t+a),l=""):o=o.slice(t+(a||s.length))}e.greedy||(o=l+o)}),0===A?e:this.replaceTokens(o,n)}canRenderChild(e,t){return!(!e.tagName||!t.tagName||e.void)&&(e.children.length>0?e.children.includes(t.tagName):!(e.invalid.length>0&&e.invalid.includes(t.tagName))&&(t.parent.length>0?t.parent.includes(e.tagName):!(!e.self&&e.tagName===t.tagName)&&!!(e&&e.content&t.type)))}convertLineBreaks(e){const{noHtml:t,disableLineBreaks:n}=this.props;if(t||n||e.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return e;let r=e.replace(/\r\n/g,"\n");return r=r.replace(/\n{3,}/g,"\n\n\n"),r=r.replace(/\n/g,"<br/>"),r}createContainer(e){var t;const n=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||Pn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(xn)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?vn(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:A,value:i}=o,a=A.toLowerCase(),s=cn[a]||cn[A];if(!this.isSafe(e)||!a.match(En)&&(!t&&(!s||2===s)||a.startsWith("on")||i.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let l="style"===a?this.extractStyleAttribute(e):i;4===s?l=!0:3===s?l=Number.parseFloat(String(l)):5!==s&&(l=String(l)),n[un[a]||a]=this.applyAttributeFilters(a,l),r+=1}),0!==r)?n:null}extractStyleAttribute(e){const t={};return Array.from(e.style).forEach(n=>{const r=e.style[n];("string"==typeof r||"number"==typeof r)&&(t[n.replace(/-([a-z])/g,(e,t)=>String(t).toUpperCase())]=r)}),t}getTagConfig(e){const t={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return an[e]?{...t,...an[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(e,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:A,transform:i,transformOnlyAllowList:a}=this.props;let s=[],l="";return[...e.childNodes].forEach(e=>{if(1===e.nodeType){const u=e.nodeName.toLowerCase(),d=this.getTagConfig(u);l&&(s.push(l),l="");const p=this.applyNodeFilters(u,e);if(!p)return;let f;if(i&&(!a||this.isTagAllowed(u))){this.keyIndex+=1;const e=this.keyIndex;f=this.parseNode(p,d);const n=i(p,f,d);if(null===n)return;if(typeof n<"u")return void s.push(t.cloneElement(n,{key:e}));this.keyIndex=e-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!A&&!this.canRenderChild(n,d))s=[...s,...this.parseNode(p,d.tagName?d:n)];else{var c;this.keyIndex+=1;const e=this.extractAttributes(p),n={tagName:u};e&&(n.attributes=e),d.void&&(n.selfClose=d.void),s.push(t.createElement(pn,{...n,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(p,d)))}}else if(3===e.nodeType){const t=r&&!o?e.textContent:this.applyMatchers(e.textContent||"",n);Array.isArray(t)?s=[...s,...t]:l+=t}}),l&&s.push(l),s}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(Bn);){const[e,A]=o,i=o.index,a=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[A])throw new Error(`Token "${A}" found but no matching element to replace with.`);i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:s,matcher:l,props:c}=t[A];let u;if(a)u=e.length,n.push(l.createElement(s,c));else{const o=r.match(new RegExp(`{{{/${A}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${A}".`);u=o.index+o[0].length,n.push(l.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function kn(e){var n;const{attributes:r,className:o,containerTagName:A,content:i,emptyContent:a,parsedContent:s,tagName:l,noWrap:c}=e,u=null!==(n=A??l)&&void 0!==n?n:"span",d="fragment"===u||c;let p;if(s)p=s;else{const t=new Dn(i??"",e).parse();t.length>0&&(p=t)}return p||(p=a),d?t.createElement(t.Fragment,null,p):t.createElement(pn,{attributes:r,className:o,tagName:u},p)}function Cn(e){const{attributes:n,className:r,content:o="",disableFilters:A=!1,disableMatchers:i=!1,emptyContent:a=null,filters:s=[],matchers:l=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:p=!1,...f}=e,h=i?[]:l,g=A?[]:s,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const b=m.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new Dn(b,f,h,g),y=v.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return t.createElement(kn,{attributes:n,className:r,containerTagName:e.containerTagName,emptyContent:a,noWrap:p,parsedContent:0===y.length?void 0:y,tagName:d})}const Sn=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(Cn,{content:"string"==typeof e?e:""})}),In={autoConfig:!0},Tn=(e,t,n)=>{var r;if(!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderHtml)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)},Qn=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const A=e[o];"<"===A?r?(t.push(n),n=A):(r=!0,n=A):">"===A?(n+=A,t.push(n),n="",r=!1):r?n+=A:t.push(A)}return""!==n&&t.push(n),t},Mn=e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=rn(),i={...e,...In},a=i.htmlComponent?i.htmlComponent:Sn;s(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const l=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();"string"==typeof e.data.message.content&&Tn(e,t(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=Qn),e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,l),en(X.CHUNK_STREAM_MESSAGE,l),en(X.START_STREAM_MESSAGE,l),en(X.START_SIMULATE_STREAM_MESSAGE,l),en(X.START_SPEAK_AUDIO,async e=>{Tn(e,t(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const On=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ln=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nn={};function Hn(e,t){return(Nn.jsx?Ln:On).test(e)}const Rn=/[ \t\n\f\r]/g;function zn(e){return""===e.replace(Rn,"")}class jn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Fn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new jn(n,r,t)}function Un(e){return e.toLowerCase()}jn.prototype.property={},jn.prototype.normal={},jn.prototype.space=null;class qn{constructor(e,t){this.property=e,this.attribute=t}}qn.prototype.space=null,qn.prototype.boolean=!1,qn.prototype.booleanish=!1,qn.prototype.overloadedBoolean=!1,qn.prototype.number=!1,qn.prototype.commaSeparated=!1,qn.prototype.spaceSeparated=!1,qn.prototype.commaOrSpaceSeparated=!1,qn.prototype.mustUseProperty=!1,qn.prototype.defined=!1;let _n=0;const Yn=Zn(),Gn=Zn(),Wn=Zn(),Vn=Zn(),Xn=Zn(),Kn=Zn(),Jn=Zn();function Zn(){return 2**++_n}const $n=Object.freeze(Object.defineProperty({__proto__:null,boolean:Yn,booleanish:Gn,commaOrSpaceSeparated:Jn,commaSeparated:Kn,number:Vn,overloadedBoolean:Wn,spaceSeparated:Xn},Symbol.toStringTag,{value:"Module"})),er=Object.keys($n);class tr extends qn{constructor(e,t,n,r){let o=-1;if(super(e,t),nr(this,"space",r),"number"==typeof n)for(;++o<er.length;){const e=er[o];nr(this,er[o],(n&$n[e])===$n[e])}}}function nr(e,t,n){n&&(e[t]=n)}tr.prototype.defined=!0;const rr={}.hasOwnProperty;function or(e){const t={},n={};let r;for(r in e.properties)if(rr.call(e.properties,r)){const o=e.properties[r],A=new tr(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(A.mustUseProperty=!0),t[r]=A,n[Un(r)]=r,n[Un(A.attribute)]=r}return new jn(t,n,e.space)}const Ar=or({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),ir=or({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function ar(e,t){return t in e?e[t]:t}function sr(e,t){return ar(e,t.toLowerCase())}const lr=or({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:sr,properties:{xmlns:null,xmlnsXLink:null}}),cr=or({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Vn,ariaColIndex:Vn,ariaColSpan:Vn,ariaControls:Xn,ariaCurrent:null,ariaDescribedBy:Xn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:Xn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:Xn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Xn,ariaLevel:Vn,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:Xn,ariaPlaceholder:null,ariaPosInSet:Vn,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:Xn,ariaRowCount:Vn,ariaRowIndex:Vn,ariaRowSpan:Vn,ariaSelected:Gn,ariaSetSize:Vn,ariaSort:null,ariaValueMax:Vn,ariaValueMin:Vn,ariaValueNow:Vn,ariaValueText:null,role:null}}),ur=or({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:sr,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Kn,acceptCharset:Xn,accessKey:Xn,action:null,allow:null,allowFullScreen:Yn,allowPaymentRequest:Yn,allowUserMedia:Yn,alt:null,as:null,async:Yn,autoCapitalize:null,autoComplete:Xn,autoFocus:Yn,autoPlay:Yn,blocking:Xn,capture:null,charSet:null,checked:Yn,cite:null,className:Xn,cols:Vn,colSpan:null,content:null,contentEditable:Gn,controls:Yn,controlsList:Xn,coords:Vn|Kn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Yn,defer:Yn,dir:null,dirName:null,disabled:Yn,download:Wn,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Yn,formTarget:null,headers:Xn,height:Vn,hidden:Yn,high:Vn,href:null,hrefLang:null,htmlFor:Xn,httpEquiv:Xn,id:null,imageSizes:null,imageSrcSet:null,inert:Yn,inputMode:null,integrity:null,is:null,isMap:Yn,itemId:null,itemProp:Xn,itemRef:Xn,itemScope:Yn,itemType:Xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Yn,low:Vn,manifest:null,max:null,maxLength:Vn,media:null,method:null,min:null,minLength:Vn,multiple:Yn,muted:Yn,name:null,nonce:null,noModule:Yn,noValidate:Yn,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:Yn,optimum:Vn,pattern:null,ping:Xn,placeholder:null,playsInline:Yn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Yn,referrerPolicy:null,rel:Xn,required:Yn,reversed:Yn,rows:Vn,rowSpan:Vn,sandbox:Xn,scope:null,scoped:Yn,seamless:Yn,selected:Yn,shadowRootClonable:Yn,shadowRootDelegatesFocus:Yn,shadowRootMode:null,shape:null,size:Vn,sizes:null,slot:null,span:Vn,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Vn,step:null,style:null,tabIndex:Vn,target:null,title:null,translate:null,type:null,typeMustMatch:Yn,useMap:null,value:Gn,width:Vn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Xn,axis:null,background:null,bgColor:null,border:Vn,borderColor:null,bottomMargin:Vn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Yn,declare:Yn,event:null,face:null,frame:null,frameBorder:null,hSpace:Vn,leftMargin:Vn,link:null,longDesc:null,lowSrc:null,marginHeight:Vn,marginWidth:Vn,noResize:Yn,noHref:Yn,noShade:Yn,noWrap:Yn,object:null,profile:null,prompt:null,rev:null,rightMargin:Vn,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Vn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Vn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Yn,disableRemotePlayback:Yn,prefix:null,property:null,results:Vn,security:null,unselectable:null}}),dr=or({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:ar,properties:{about:Jn,accentHeight:Vn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Vn,amplitude:Vn,arabicForm:null,ascent:Vn,attributeName:null,attributeType:null,azimuth:Vn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Vn,by:null,calcMode:null,capHeight:Vn,className:Xn,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:Vn,diffuseConstant:Vn,direction:null,display:null,dur:null,divisor:Vn,dominantBaseline:null,download:Yn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Vn,enableBackground:null,end:null,event:null,exponent:Vn,externalResourcesRequired:null,fill:null,fillOpacity:Vn,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:Kn,g2:Kn,glyphName:Kn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Vn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Vn,horizOriginX:Vn,horizOriginY:Vn,id:null,ideographic:Vn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Vn,k:Vn,k1:Vn,k2:Vn,k3:Vn,k4:Vn,kernelMatrix:Jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Vn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Vn,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:Vn,overlineThickness:Vn,paintOrder:null,panose1:null,path:null,pathLength:Vn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Vn,pointsAtY:Vn,pointsAtZ:Vn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jn,rev:Jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jn,requiredFeatures:Jn,requiredFonts:Jn,requiredFormats:Jn,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:Vn,specularExponent:Vn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Vn,strikethroughThickness:Vn,string:null,stroke:null,strokeDashArray:Jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Vn,strokeOpacity:Vn,strokeWidth:null,style:null,surfaceScale:Vn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jn,tabIndex:Vn,tableValues:null,target:null,targetX:Vn,targetY:Vn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Vn,underlineThickness:Vn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Vn,values:null,vAlphabetic:Vn,vMathematical:Vn,vectorEffect:null,vHanging:Vn,vIdeographic:Vn,version:null,vertAdvY:Vn,vertOriginX:Vn,vertOriginY:Vn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Vn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),pr=/^data[-\w.:]+$/i,fr=/-[a-z]/g,hr=/[A-Z]/g;function gr(e){return"-"+e.toLowerCase()}function mr(e){return e.charAt(1).toUpperCase()}const vr={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"},br=Fn([ir,Ar,lr,cr,ur],"html"),wr=Fn([ir,Ar,lr,cr,dr],"svg");function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xr,Er,Br,Pr={};var Dr=function(){if(Br)return Pr;Br=1;var e=Pr&&Pr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),A="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;A?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(Er)return xr;Er=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,A=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,a=/^\s+|\s+$/g,s="";function l(e){return e?e.replace(a,s):s}return xr=function(a,c){if("string"!=typeof a)throw new TypeError("First argument must be a string");if(!a)return[];c=c||{};var u=1,d=1;function p(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=a,!c.silent)throw t}function m(e){var t=e.exec(a);if(t){var n=t[0];return p(n),a=a.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=f();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var t=2;s!=a.charAt(t)&&("*"!=a.charAt(t)||"/"!=a.charAt(t+1));)++t;if(t+=2,s===a.charAt(t-1))return g("End of comment missing");var n=a.slice(2,t-2);return d+=2,p(n),a=a.slice(t),d+=2,e({type:"comment",comment:n})}}function y(){var t=f(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var a=m(A),c=t({type:"declaration",property:l(n[0].replace(e,s)),value:a?l(a[0].replace(e,s)):s});return m(i),c}}return h.prototype.content=a,v(),function(){var e,t=[];for(b(t);e=y();)!1!==e&&(t.push(e),b(t));return t}()},xr}());return Pr}();const kr=yr(Dr),Cr=kr.default||kr,Sr=Tr("end"),Ir=Tr("start");function Tr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Qr(e){return e&&"object"==typeof e?"position"in e||"type"in e?Or(e.position):"start"in e||"end"in e?Or(e):"line"in e||"column"in e?Mr(e):"":""}function Mr(e){return Lr(e&&e.line)+":"+Lr(e&&e.column)}function Or(e){return Mr(e&&e.start)+"-"+Mr(e&&e.end)}function Lr(e){return e&&"number"==typeof e?e:1}class Nr extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},A=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(A=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const i=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=i?i.line:void 0,this.name=Qr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=A&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Nr.prototype.file="",Nr.prototype.name="",Nr.prototype.reason="",Nr.prototype.message="",Nr.prototype.stack="",Nr.prototype.column=void 0,Nr.prototype.line=void 0,Nr.prototype.ancestors=void 0,Nr.prototype.cause=void 0,Nr.prototype.fatal=void 0,Nr.prototype.place=void 0,Nr.prototype.ruleId=void 0,Nr.prototype.source=void 0;const Hr={}.hasOwnProperty,Rr=new Map,zr=/[A-Z]/g,jr=/-([a-z])/g,Fr=new Set(["table","tbody","thead","tfoot","tr"]),Ur=new Set(["td","th"]),qr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _r(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,A){const i=Array.isArray(o.children),a=Ir(n);return t(r,o,A,i,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,A){const i=Array.isArray(o.children)?n:t;return A?i(r,o,A):i(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?wr:br,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},A=Yr(o,e,void 0);return A&&"string"!=typeof A?A:o.create(e,o.Fragment,{children:A||void 0},void 0)}function Yr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=wr,e.schema=o),e.ancestors.push(t);const A=Kr(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Hr.call(t.properties,o)){const A=Xr(e,o,t.properties[o]);if(A){const[o,i]=A;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&Ur.has(t.tagName)?r=i:n[o]=i}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let a=Vr(e,t);return Fr.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&zn(e.value):zn(e)}(e)})),Gr(e,i,A,t),Wr(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Jr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=wr,e.schema=o),e.ancestors.push(t);const A=null===t.name?e.Fragment:Kr(e,t.name,!0),i=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const A=o.properties[0];A.type,Object.assign(n,e.evaluater.evaluateExpression(A.argument))}else Jr(e,t.position);else{const o=r.name;let A;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,A=e.evaluater.evaluateExpression(t.expression)}else Jr(e,t.position);else A=null===r.value||r.value;n[o]=A}return n}(e,t),a=Vr(e,t);return Gr(e,i,A,t),Wr(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Wr(r,Vr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Gr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Vr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Rr;for(;++r<t.children.length;){const A=t.children[r];let i;if(e.passKeys){const e="element"===A.type?A.tagName:"mdxJsxFlowElement"===A.type||"mdxJsxTextElement"===A.type?A.name:void 0;if(e){const t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}const a=Yr(e,A,i);void 0!==a&&n.push(a)}return n}function Xr(e,t,n){const r=function(e,t){const n=Un(t);let r=t,o=qn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&pr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(fr,mr);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!fr.test(e)){let n=e.replace(hr,gr);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=tr}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{Cr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Nr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=qr+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(jr,$r)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Hr.call(e,n)&&(t[Zr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?vr[r.property]||r.property:r.attribute,n]}}function Kr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Hn(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:!(!o||"Literal"!==t.type),optional:!1}:t}r=n}else r=Hn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Hr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Jr(e)}function Jr(e,t){const n=new Nr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=qr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Zr(e){let t=e.replace(zr,eo);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function $r(e,t){return t.toUpperCase()}function eo(e){return"-"+e.toLowerCase()}const to={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"]},no={};function ro(e,t,n){if(function(e){return!(!e||"object"!=typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return oo(e.children,t,n)}return Array.isArray(e)?oo(e,t,n):""}function oo(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ro(e[o],t,n);return r.join("")}const Ao=document.createElement("i");function io(e){const t="&"+e+";";Ao.innerHTML=t;const n=Ao.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function ao(e,t,n,r){const o=e.length;let A,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)A=Array.from(r),A.unshift(t,n),e.splice(...A);else for(n&&e.splice(t,n);i<r.length;)A=r.slice(i,i+1e4),A.unshift(t,0),e.splice(...A),i+=1e4,t+=1e4}function so(e,t){return e.length>0?(ao(e,e.length,0,t),e):t}const lo={}.hasOwnProperty;function co(e){const t={};let n=-1;for(;++n<e.length;)uo(t,e[n]);return t}function uo(e,t){let n;for(n in t){const r=(lo.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let A;if(o)for(A in o){lo.call(r,A)||(r[A]=[]);const e=o[A];po(r[A],Array.isArray(e)?e:e?[e]:[])}}}function po(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);ao(e,0,0,r)}function fo(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function ho(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const go=Co(/[A-Za-z]/),mo=Co(/[\dA-Za-z]/),vo=Co(/[#-'*+\--9=?A-Z^-~]/);function bo(e){return null!==e&&(e<32||127===e)}const wo=Co(/\d/),yo=Co(/[\dA-Fa-f]/),xo=Co(/[!-/:-@[-`{-~]/);function Eo(e){return null!==e&&e<-2}function Bo(e){return null!==e&&(e<0||32===e)}function Po(e){return-2===e||-1===e||32===e}const Do=Co(new RegExp("\\p{P}|\\p{S}","u")),ko=Co(/\s/);function Co(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function So(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const A=e.charCodeAt(n);let i="";if(37===A&&mo(e.charCodeAt(n+1))&&mo(e.charCodeAt(n+2)))o=2;else if(A<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(A))||(i=String.fromCharCode(A));else if(A>55295&&A<57344){const t=e.charCodeAt(n+1);A<56320&&t>56319&&t<57344?(i=String.fromCharCode(A,t),o=1):i="�"}else i=String.fromCharCode(A);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Io(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let A=0;return function(r){return Po(r)?(e.enter(n),i(r)):t(r)};function i(r){return Po(r)&&A++<o?(e.consume(r),i):(e.exit(n),t(r))}}const To={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Io(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):Eo(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const Qo={tokenize:function(e){const t=this,n=[];let r,o,A,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,s,l)(r)}return l(r)}function s(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,A=n;for(;A--;)if("exit"===t.events[A][0]&&"chunkFlow"===t.events[A][1].type){o=t.events[A][1].end;break}m(i);let a=n;for(;a<t.events.length;)t.events[a][1].end={...o},a++;return ao(t.events,A+1,0,t.events.slice(n)),t.events.length=a,l(e)}return a(e)}function l(o){if(i===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Mo,c,u)(o)}function c(e){return r&&v(),m(i),d(e)}function u(e){return t.parser.lazy[t.now().line]=i!==n.length,A=t.now().offset,f(e)}function d(n){return t.containerState={},e.attempt(Mo,p,f)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),d(e)}function f(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):Eo(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<A&&(!r.events[e][1].end||r.events[e][1].end.offset>A))return;const n=t.events.length;let o,a,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){if(o){a=t.events[s][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;ao(t.events,s+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Mo={tokenize:function(e,t,n){return Io(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Oo(e){return null===e||Bo(e)||ko(e)?1:Do(e)?2:void 0}function Lo(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const A=e[o].resolveAll;A&&!r.includes(A)&&(t=A(t,n),r.push(A))}return t}const No={name:"attention",resolveAll:function(e,t){let n,r,o,A,i,a,s,l,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};Ho(u,-a),Ho(d,a),A={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...A.start},end:{...i.end}},e[n][1].end={...A.start},e[c][1].start={...i.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=so(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=so(s,[["enter",r,t],["enter",A,t],["exit",A,t],["enter",o,t]]),s=so(s,Lo(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=so(s,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(l=2,s=so(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):l=0,ao(e,n-1,c-n+3,s),c=n+s.length-l-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Oo(r);let A;return function(t){return A=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===A)return e.consume(a),i;const s=e.exit("attentionSequence"),l=Oo(a),c=!l||2===l&&o||n.includes(a),u=!o||2===o&&l||n.includes(r);return s._open=!!(42===A?c:c&&(o||!u)),s._close=!!(42===A?u:u&&(l||!c)),t(a)}}};function Ho(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ro={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return go(t)?(e.consume(t),A):64===t?n(t):s(t)}function A(e){return 43===e||45===e||46===e||mo(e)?(r=1,i(e)):s(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||mo(t))&&r++<32?(e.consume(t),i):(r=0,s(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||bo(r)?n(r):(e.consume(r),a)}function s(t){return 64===t?(e.consume(t),l):vo(t)?(e.consume(t),s):n(t)}function l(e){return mo(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,l):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||mo(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const zo={partial:!0,tokenize:function(e,t,n){return function(t){return Po(t)?Io(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||Eo(e)?t(e):n(e)}}};const jo={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return Po(t)?Io(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(jo,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return Po(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Fo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return xo(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const Uo={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,A,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,A=mo,l(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,A=yo,l):(e.enter("characterReferenceValue"),o=7,A=wo,l(t))}function l(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return A!==mo||io(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return A(a)&&i++<o?(e.consume(a),l):n(a)}}};const qo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},_o={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s}function s(t){return e.enter("codeFencedFence"),Po(t)?Io(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===A?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===A?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),Po(t)?Io(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||Eo(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let A,i=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,A=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),s(t)}(t)};function s(t){return t===A?(a++,e.consume(t),s):a<3?n(t):(e.exit("codeFencedFenceSequence"),Po(t)?Io(e,l,"whitespace")(t):l(t))}function l(n){return null===n||Eo(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(qo,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||Eo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(t)):Po(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Io(e,u,"whitespace")(t)):96===t&&t===A?n(t):(e.consume(t),c)}function u(t){return null===t||Eo(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||Eo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(t)):96===t&&t===A?n(t):(e.consume(t),d)}function p(t){return e.attempt(o,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&Po(t)?Io(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||Eo(t)?e.check(qo,p,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||Eo(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Yo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),Io(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?A(e):n(e)}function A(t){return null===t?a(t):Eo(t)?e.attempt(Go,A,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||Eo(t)?(e.exit("codeFlowValue"),A(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Go={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):Io(e,A,"linePrefix",5)(t)}function A(e){const A=r.events[r.events.length-1];return A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(e):Eo(e)?o(e):n(e)}}};const Wo={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,A=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),A++,i):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,l(t)):Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),s(t))}function s(t){return null===t||32===t||96===t||Eo(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),s)}function l(n){return 96===n?(e.consume(n),r++,l):r===A?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",s(n))}}};class Vo{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Xo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Xo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Xo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Xo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Xo(this.left,t.reverse())}}}function Xo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ko(e){const t={};let n,r,o,A,i,a,s,l=-1;const c=new Vo(e);for(;++l<c.length;){for(;l in t;)l=t[l];if(n=c.get(l),l&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(l-1)[1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Jo(c,l)),l=t[l],s=!0);else if(n[1]._container){for(o=l,r=void 0;o--;)if(A=c.get(o),"lineEnding"===A[1].type||"lineEndingBlank"===A[1].type)"enter"===A[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),A[1].type="lineEnding",r=o);else if("linePrefix"!==A[1].type)break;r&&(n[1].end={...c.get(r)[1].start},i=c.slice(r,l),i.unshift(n),c.splice(r,l-r+1,i))}}return ao(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!s}function Jo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const A=[],i=n._tokenizer||r.parser[n.contentType](n.start),a=i.events,s=[],l={};let c,u,d=-1,p=n,f=0,h=0;const g=[h];for(;p;){for(;e.get(++o)[1]!==p;);A.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=n;++d<a.length;)"exit"===a[d][0]&&"enter"===a[d-1][0]&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(h=d+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),d=g.length;d--;){const t=a.slice(g[d],g[d+1]),n=A.pop();s.push([n,n+t.length-1]),e.splice(n,2,t)}for(s.reverse(),d=-1;++d<s.length;)l[f+s[d][0]]=f+s[d][1],f+=s[d][1]-s[d][0]-1;return l}const Zo={resolve:function(e){return Ko(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):Eo(t)?e.check($o,A,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function A(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},$o={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Io(e,o,"linePrefix")};function o(o){if(null===o||Eo(o))return n(o);const A=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function eA(e,t,n,r,o,A,i,a,s){const l=s||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(A),e.consume(t),e.exit(A),u):null===t||32===t||41===t||bo(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(A),e.consume(n),e.exit(A),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(a),u(t)):null===t||60===t||Eo(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(o){return c||null!==o&&41!==o&&!Bo(o)?c<l&&40===o?(e.consume(o),c++,f):41===o?(e.consume(o),c--,f):null===o||32===o||40===o||bo(o)?n(o):(e.consume(o),92===o?h:f):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function tA(e,t,n,r,o,A){const i=this;let a,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(A),l};function l(u){return s>999||null===u||91===u||93===u&&!a||94===u&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):93===u?(e.exit(A),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):Eo(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||Eo(t)||s++>999?(e.exit("chunkString"),l(t)):(e.consume(t),a||(a=!Po(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function nA(e,t,n,r,o,A){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,a):n(t)};function a(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(A),s(n))}function s(t){return t===i?(e.exit(A),a(i)):null===t?n(t):Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Io(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(t))}function l(t){return t===i||null===t||Eo(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:l)}function c(t){return t===i||92===t?(e.consume(t),l):l(t)}}function rA(e,t){let n;return function r(o){return Eo(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Po(o)?Io(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const oA={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return tA.call(r,e,A,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function A(t){return o=ho(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return Bo(t)?rA(e,a)(t):a(t)}function a(t){return eA(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(AA,l,l)(t)}function l(t){return Po(t)?Io(e,c,"whitespace")(t):c(t)}function c(A){return null===A||Eo(A)?(e.exit("definition"),r.parser.defined.push(o),t(A)):n(A)}}},AA={partial:!0,tokenize:function(e,t,n){return function(t){return Bo(t)?rA(e,r)(t):n(t)};function r(t){return nA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return Po(t)?Io(e,A,"whitespace")(t):A(t)}function A(e){return null===e||Eo(e)?t(e):n(e)}}};const iA={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return Eo(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const aA={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,A=3;return"whitespace"===e[A][1].type&&(A+=2),o-2>A&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(A===o-1||o-4>A&&"whitespace"===e[o-2][1].type)&&(o-=A+1===o?2:4),o>A&&(n={type:"atxHeadingText",start:e[A][1].start,end:e[o][1].end},r={type:"chunkText",start:e[A][1].start,end:e[o][1].end,contentType:"text"},ao(e,A,o-A+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||Bo(t)?(e.exit("atxHeadingSequence"),A(t)):n(t)}function A(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||Eo(n)?(e.exit("atxHeading"),t(n)):Po(n)?Io(e,A,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),A(t))}function a(t){return null===t||35===t||Bo(t)?(e.exit("atxHeadingText"),A(t)):(e.consume(t),a)}}};const sA=["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"],lA=["pre","script","style","textarea"],cA={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let o,A,i,a,s;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),l}(t)};function l(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),A=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:O):go(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function c(A){return 45===A?(e.consume(A),o=2,u):91===A?(e.consume(A),o=5,a=0,d):go(A)?(e.consume(A),o=4,r.interrupt?t:O):n(A)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const A="CDATA[";return o===A.charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:D:d):n(o)}function p(t){return go(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||Bo(a)){const s=47===a,l=i.toLowerCase();return s||A||!lA.includes(l)?sA.includes(i.toLowerCase())?(o=6,s?(e.consume(a),h):r.interrupt?t(a):D(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):A?g(a):m(a)):(o=1,r.interrupt?t(a):D(a))}return 45===a||mo(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:D):n(o)}function g(t){return Po(t)?(e.consume(t),g):B(t)}function m(t){return 47===t?(e.consume(t),B):58===t||95===t||go(t)?(e.consume(t),v):Po(t)?(e.consume(t),m):B(t)}function v(t){return 45===t||46===t||58===t||95===t||mo(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):Po(t)?(e.consume(t),b):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,y):Po(t)?(e.consume(t),w):x(t)}function y(t){return t===s?(e.consume(t),s=null,E):null===t||Eo(t)?n(t):(e.consume(t),y)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Bo(t)?b(t):(e.consume(t),x)}function E(e){return 47===e||62===e||Po(e)?m(e):n(e)}function B(t){return 62===t?(e.consume(t),P):n(t)}function P(t){return null===t||Eo(t)?D(t):Po(t)?(e.consume(t),P):n(t)}function D(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!Eo(t)||6!==o&&7!==o?null===t||Eo(t)?(e.exit("htmlFlowData"),k(t)):(e.consume(t),D):(e.exit("htmlFlowData"),e.check(uA,N,k)(t))}function k(t){return e.check(dA,C,N)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||Eo(t)?k(t):(e.enter("htmlFlowData"),D(t))}function I(t){return 45===t?(e.consume(t),O):D(t)}function T(t){return 47===t?(e.consume(t),i="",Q):D(t)}function Q(t){if(62===t){const n=i.toLowerCase();return lA.includes(n)?(e.consume(t),L):D(t)}return go(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):D(t)}function M(t){return 93===t?(e.consume(t),O):D(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):D(t)}function L(t){return null===t||Eo(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),L)}function N(n){return e.exit("htmlFlow"),t(n)}}},uA={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(zo,t,n)}}},dA={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const pA={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,A,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),w):63===t?(e.consume(t),v):go(t)?(e.consume(t),E):n(t)}function s(t){return 45===t?(e.consume(t),l):91===t?(e.consume(t),A=0,p):go(t)?(e.consume(t),m):n(t)}function l(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):Eo(t)?(i=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(A++)?(e.consume(t),6===A?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):Eo(t)?(i=f,Q(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):f(t)}function m(t){return null===t||62===t?T(t):Eo(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):Eo(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?T(e):v(e)}function w(t){return go(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||mo(t)?(e.consume(t),y):x(t)}function x(t){return Eo(t)?(i=x,Q(t)):Po(t)?(e.consume(t),x):T(t)}function E(t){return 45===t||mo(t)?(e.consume(t),E):47===t||62===t||Bo(t)?B(t):n(t)}function B(t){return 47===t?(e.consume(t),T):58===t||95===t||go(t)?(e.consume(t),P):Eo(t)?(i=B,Q(t)):Po(t)?(e.consume(t),B):T(t)}function P(t){return 45===t||46===t||58===t||95===t||mo(t)?(e.consume(t),P):D(t)}function D(t){return 61===t?(e.consume(t),k):Eo(t)?(i=D,Q(t)):Po(t)?(e.consume(t),D):B(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,C):Eo(t)?(i=k,Q(t)):Po(t)?(e.consume(t),k):(e.consume(t),S)}function C(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):Eo(t)?(i=C,Q(t)):(e.consume(t),C)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Bo(t)?B(t):(e.consume(t),S)}function I(e){return 47===e||62===e||Bo(e)?B(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return Po(t)?Io(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}};const fA={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&ao(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,A,i=e.length,a=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=i);const s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[o-2][1].start}};return A=[["enter",s,t],["enter",l,t]],A=so(A,e.slice(r+1,r+a+3)),A=so(A,[["enter",c,t]]),A=so(A,Lo(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),A=so(A,[["exit",c,t],e[o-2],e[o-1],["exit",l,t]]),A=so(A,e.slice(o+1)),A=so(A,[["exit",s,t]]),ao(e,r,e.length,A),e},tokenize:function(e,t,n){const r=this;let o,A,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?c(t):(A=r.parser.defined.includes(ho(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(hA,l,A?l:c)(t):91===t?e.attempt(gA,l,A?s:c)(t):A?l(t):c(t)}function s(t){return e.attempt(mA,l,c)(t)}function l(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},hA={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return Bo(t)?rA(e,o)(t):o(t)}function o(t){return 41===t?l(t):eA(e,A,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function A(t){return Bo(t)?rA(e,a)(t):l(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?nA(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):l(t)}function s(t){return Bo(t)?rA(e,l)(t):l(t)}function l(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},gA={tokenize:function(e,t,n){const r=this;return function(t){return tA.call(r,e,o,A,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(ho(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function A(e){return n(e)}}},mA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const vA={name:"labelStartImage",resolveAll:fA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),A):n(t)}function A(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const bA={name:"labelStartLink",resolveAll:fA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const wA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Io(e,t,"linePrefix")}}};const yA={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,A(e)}(t)};function A(A){return A===r?(e.enter("thematicBreakSequence"),i(A)):o>=3&&(null===A||Eo(A))?(e.exit("thematicBreak"),t(A)):n(A)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),Po(t)?Io(e,A,"whitespace")(t):A(t))}}};const xA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zo,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Io(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!Po(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(BA,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Io(e,e.attempt(xA,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let A=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:wo(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(yA,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return wo(t)&&++i<10?(e.consume(t),a):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),s(t)):n(t)}function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(zo,r.interrupt?n:l,e.attempt(EA,u,c))}function l(e){return r.containerState.initialBlankLine=!0,A++,u(e)}function c(t){return Po(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=A+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},EA={partial:!0,tokenize:function(e,t,n){const r=this;return Io(e,function(e){const o=r.events[r.events.length-1];return!Po(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},BA={partial:!0,tokenize:function(e,t,n){const r=this;return Io(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const PA={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,A=e.length;for(;A--;)if("enter"===e[A][0]){if("content"===e[A][1].type){n=A;break}"paragraph"===e[A][1].type&&(r=A)}else"content"===e[A][1].type&&e.splice(A,1),!o&&"definition"===e[A][1].type&&(o=A);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let i,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),A(t)}(t))};function A(t){return t===o?(e.consume(t),A):(e.exit("setextHeadingLineSequence"),Po(t)?Io(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||Eo(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const DA={tokenize:function(e){const t=this,n=e.attempt(zo,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,Io(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Zo,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const kA={resolveAll:TA()},CA=IA("string"),SA=IA("text");function IA(e){return{resolveAll:TA("text"===e?QA:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,A,i);return A;function A(e){return s(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function s(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function TA(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):(!t[o]||"data"!==t[o][1].type)&&(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function QA(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let A,i=o.length,a=-1,s=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)s++,a--;if(a)break;a=-1}else if(-2===e)A=!0,s++;else if(-1!==e){i++;break}}if(s){const o={type:n===e.length||A||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const MA={42:xA,43:xA,45:xA,48:xA,49:xA,50:xA,51:xA,52:xA,53:xA,54:xA,55:xA,56:xA,57:xA,62:jo},OA={91:oA},LA={[-2]:Yo,[-1]:Yo,32:Yo},NA={35:aA,42:yA,45:[PA,yA],60:cA,61:PA,95:yA,96:_o,126:_o},HA={38:Uo,92:Fo},RA={[-5]:wA,[-4]:wA,[-3]:wA,33:vA,38:Uo,42:No,60:[Ro,pA],91:bA,92:[iA,Fo],93:fA,95:No,96:Wo},zA={null:[No,kA]},jA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:OA,disable:{null:[]},document:MA,flow:NA,flowInitial:LA,insideSpan:zA,string:HA,text:RA},Symbol.toStringTag,{value:"Module"}));function FA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},A=[];let i=[],a=[];const s={attempt:h(function(e,t){g(e,t.from)}),check:h(f),consume:function(e){Eo(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),l.events.push(["enter",n,l]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=d(),l.events.push(["exit",t,l]),t},interrupt:h(f,{interrupt:!0})},l={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,m()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const A=e[n];let i;if("string"==typeof A)i=A;else switch(A){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(A)}o=-2===A,r.push(i)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){return i=so(i,e),function(){let e;for(;r._index<i.length;){const t=i[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}(),null!==i[i.length-1]?[]:(g(t,0),l.events=Lo(A,l.events,l),l.events)}};let c=t.tokenize.call(l,s);return t.resolveAll&&A.push(t),l;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,A=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,A)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}A>0&&i.push(e[o].slice(0,A))}return i}(i,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:A}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:A}}function p(e){c=c(e)}function f(e,t){t.restore()}function h(e,t){return function(n,o,A){let i,c,u,p;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return i=e,c=0,0===e.length?A:h(e[c])}function h(e){return function(n){return p=function(){const e=d(),t=l.previous,n=l.currentConstruct,o=l.events.length,A=Array.from(a);return{from:o,restore:i};function i(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=o,a=A,m()}}(),u=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(l),t):l,s,g,v)(n)}}function g(t){return e(u,p),o}function v(e){return p.restore(),++c<i.length?h(i[c]):A}}}function g(e,t){e.resolveAll&&!A.includes(e)&&A.push(e),e.resolve&&ao(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const UA=/[\0\t\n\r]/g;const qA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _A(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return fo(n.slice(t?2:1),t?16:10)}return io(n)||e}const YA={}.hasOwnProperty;function GA(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:A(te),autolinkProtocol:P,autolinkEmail:P,atxHeading:A(J),blockQuote:A(G),characterEscape:P,characterReference:P,codeFenced:A(W),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:A(W,i),codeText:A(V,i),codeTextData:P,data:P,codeFlowValue:P,definition:A(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:A(K),hardBreakEscape:A(Z),hardBreakTrailing:A(Z),htmlFlow:A($,i),htmlFlowData:P,htmlText:A($,i),htmlTextData:P,image:A(ee),label:i,link:A(te),listItem:A(re),listItemValue:d,listOrdered:A(ne,u),listUnordered:A(ne),paragraph:A(oe),reference:z,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:A(J),strong:A(Ae),thematicBreak:A(ae)},exit:{atxHeading:s(),atxHeadingSequence:y,autolink:s(),autolinkEmail:Y,autolinkProtocol:_,blockQuote:s(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:F,characterReferenceMarkerNumeric:F,characterReferenceValue:U,characterReference:q,codeFenced:s(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:D,codeIndented:s(m),codeText:s(T),codeTextData:D,data:D,definition:s(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:s(),hardBreakEscape:s(C),hardBreakTrailing:s(C),htmlFlow:s(S),htmlFlowData:D,htmlText:s(I),htmlTextData:D,image:s(M),label:L,labelText:O,lineEnding:k,link:s(Q),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:j,resourceDestinationString:N,resourceTitleString:H,resource:R,setextHeading:s(B),setextHeadingLineSequence:E,setextHeadingText:x,strong:s(),thematicBreak:s()}};VA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const A={stack:[r],tokenStack:[],config:t,enter:a,exit:l,buffer:i,resume:c,data:n},s=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])s.push(u);else{u=o(e,s.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];YA.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},A),e[u][1])}if(A.tokenStack.length>0){const e=A.tokenStack[A.tokenStack.length-1];(e[1]||KA).call(A,void 0,e[0])}for(r.position={start:WA(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:WA(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,A,i,a=t-1,s=-1,l=!1;for(;++a<=n;){const t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!i&&!s&&!A&&(A=a),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=a;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",l=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}A&&(!o||A<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(a,0,["enter",o,t[2]]),a++,n++,A=void 0,i=!0}}}return e[t][1]._spread=l,n}function A(e,t){return n;function n(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:WA(t.start),end:void 0}}function s(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Qr({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||KA).call(this,e,r[0])),n.position.end=WA(e.end)}function c(){return function(e){return ro(e,"boolean"!=typeof no.includeImageAlt||no.includeImageAlt,"boolean"!=typeof no.includeHtml||no.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ho(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function y(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=ie(),n.position={start:WA(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=WA(e.end)}function k(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=WA(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(P.call(this,e),D.call(this,e))}function C(){this.data.atHardBreak=!0}function S(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(qA,_A)}(t),n.identifier=ho(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function N(){const e=this.resume();this.stack[this.stack.length-1].url=e}function H(){const e=this.resume();this.stack[this.stack.length-1].title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function j(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ho(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function F(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=fo(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=io(t);this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=WA(e.end)}function _(e){D.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function Y(e){D.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function V(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function Ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Ko(e););return e}(function(e){const t={constructs:co([jA,...(e||{}).extensions||[]]),content:n(To),defined:[],document:n(Qo),flow:n(DA),lazy:{},string:n(CA),text:n(SA)};return t;function n(e){return function(n){return FA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,A,i){const a=[];let s,l,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(A||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(UA.lastIndex=c,s=UA.exec(o),u=s&&void 0!==s.index?s.index:o.length,d=o.charCodeAt(u),!s){n=o.slice(c);break}if(10===d&&c===u&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),c<u&&(a.push(o.slice(c,u)),t+=u-c),d){case 0:a.push(65533),t++;break;case 9:for(l=4*Math.ceil(t/4),a.push(-2);t++<l;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function WA(e){return{line:e.line,column:e.column,offset:e.offset}}function VA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?VA(e,r):XA(e,r)}}function XA(e,t){let n;for(n in t)if(YA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function KA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is still open")}function JA(e){const t=this;t.parser=function(n){return GA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZA(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),A=o[0];A&&"text"===A.type?A.value="["+A.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function $A(e){return e.spread??e.children.length>1}function ei(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const A=[];for(;r;)A.push(ti(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return A.push(ti(t.slice(o),o>0,!1)),A.join("")}function ti(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const ni={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=So(r.toLowerCase()),A=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);void 0===a?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=A+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,l),e.applyData(t,l)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZA(e,t);const o={src:So(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,A),e.applyData(t,A)},image:function(e,t){const n={src:So(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZA(e,t);const o={href:So(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,A),e.applyData(t,A)},link:function(e,t){const n={href:So(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=$A(n[r])}return t}(n):$A(t),A={},i=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),A.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const s=r[r.length-1];s&&(o||"element"!==s.type||"p"!==s.tagName)&&i.push({type:"text",value:"\n"});const l={type:"element",tagName:"li",properties:A,children:i};return e.patch(t,l),e.applyData(t,l)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const A={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,A),e.applyData(t,A)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},A=Ir(t.children[1]),i=Sr(t.children[t.children.length-1]);A&&i&&(r.position={start:A,end:i}),o.push(r)}const A={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,A),e.applyData(t,A)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",A=n&&"table"===n.type?n.align:void 0,i=A?A.length:t.children.length;let a=-1;const s=[];for(;++a<i;){const n=t.children[a],r={},i=A?A[a]:void 0;i&&(r.align=i);let l={type:"element",tagName:o,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),s.push(l)}const l={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)},text:function(e,t){const n={type:"text",value:ei(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:ri,yaml:ri,definition:ri,footnoteDefinition:ri};function ri(){}const oi="object"==typeof self?self:globalThis,Ai=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[A,i]=t[o];switch(A){case 0:case-1:return n(i,o);case 1:{const e=n([],o);for(const t of i)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),o);case 4:{const{source:e,flags:t}=i;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of i)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of i)e.add(r(t));return e}case 7:{const{name:e,message:t}=i;return n(new oi[e](t),o)}case 8:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new oi[A](i),o)};return r})(new Map,e)(0),ii="",{toString:ai}={},{keys:si}=Object,li=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=ai.call(e).slice(8,-1);switch(n){case"Array":return[1,ii];case"Object":return[2,ii];case"Date":return[3,ii];case"RegExp":return[4,ii];case"Map":return[5,ii];case"Set":return[6,ii];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},ci=([e,t])=>0===e&&("function"===t||"symbol"===t),ui=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},A=r=>{if(n.has(r))return n.get(r);let[i,a]=li(r);switch(i){case 0:{let t=r;switch(a){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),o([a,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(A(t));return t}case 2:{if(a)switch(a){case"BigInt":return o([a,r.toString()],r);case"Boolean":case"Number":case"String":return o([a,r.valueOf()],r)}if(t&&"toJSON"in r)return A(r.toJSON());const n=[],s=o([i,n],r);for(const t of si(r))(e||!ci(li(r[t])))&&n.push([A(t),A(r[t])]);return s}case 3:return o([i,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([i,{source:e,flags:t}],r)}case 5:{const t=[],n=o([i,t],r);for(const[n,o]of r)(e||!ci(li(n))&&!ci(li(o)))&&t.push([A(n),A(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!ci(li(n)))&&t.push(A(n));return n}}const{message:s}=r;return o([i,{name:a,message:s}],r)};return A})(!(t||n),!!t,new Map,r)(e),r},di="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Ai(ui(e,t)):structuredClone(e):(e,t)=>Ai(ui(e,t));function pi(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fi(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const hi=function(e){if(null==e)return mi;if("function"==typeof e)return gi(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=hi(e[n]);return gi(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return gi(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return gi(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function gi(e){return function(t,n,r){return!(!function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)||!e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function mi(){return!0}const vi=[],bi=!0,wi=!1;function yi(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const A=hi(o),i=r?-1:1;!function e(o,a,s){const l=o&&"object"==typeof o?o:{};if("string"==typeof l.type){const e="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let l,c,u,d=vi;if((!t||A(o,a,s[s.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[bi,e]:null==e?vi:[e]}(n(o,s)),d[0]===wi))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+i,u=s.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(l=e(n,c,u)(),l[0]===wi)return l;c="number"==typeof l[1]?l[1]:c+i}}return d}}(e,void 0,[])()}function xi(e,t,n,r){let o,A,i;"function"==typeof t?(A=void 0,i=t,o=n):(A=t,i=n,o=r),yi(e,A,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return i(e,r,n)},o)}const Ei={}.hasOwnProperty,Bi={};function Pi(e,t){const n=t||Bi,r=new Map,o=new Map,A=new Map,i={...ni,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=a.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=Ii(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=Ii(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:ki,definitionById:r,footnoteById:o,footnoteCounts:A,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=a.handlers[n];if(Ei.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=di(n);return r.children=a.all(e),r}return di(e)}return(a.options.unknownHandler||Ci)(a,e,t)},options:n,patch:Di,wrap:Si};return xi(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a}function Di(e,t){e.position&&(t.position=function(e){const t=Ir(e),n=Sr(e);if(t&&n)return{start:t,end:n}}(e))}function ki(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,di(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function Ci(e,t){const n=t.data||{},r=!("value"in t)||Ei.call(n,"hProperties")||Ei.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function Si(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function Ii(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ti(e,t){const n=Pi(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pi,r=e.options.footnoteBackLabel||fi,o=e.options.footnoteLabel||"Footnotes",A=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let s=-1;for(;++s<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[s]);if(!o)continue;const A=e.all(o),i=String(o.identifier).toUpperCase(),l=So(i.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+l+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=A[A.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else A.push(...u);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+l},children:e.wrap(A,!0)};e.patch(o,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:A,properties:{...di(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),A=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&A.children.push({type:"text",value:"\n"},o),A}function Qi(e,t){return e&&"run"in e?async function(n,r){const o=Ti(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ti(n,{file:r,...e||t})}}function Mi(e){if(e)throw e}var Oi,Li;var Ni=function(){if(Li)return Oi;Li=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},A=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),A=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!A)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},i=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Oi=function e(){var t,n,r,s,l,c,u=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<p;++d)if(null!=(t=arguments[d]))for(n in t)r=a(u,n),u!==(s=a(t,n))&&(f&&s&&(A(s)||(l=o(s)))?(l?(l=!1,c=r&&o(r)?r:[]):c=r&&A(r)?r:{},i(u,{name:n,newValue:e(f,c,s)})):typeof s<"u"&&i(u,{name:n,newValue:s}));return u},Oi}();const Hi=yr(Ni);function Ri(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function zi(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(A,...i){const a=e[++n];let s=-1;if(A)r(A);else{for(;++s<t.length;)(null===i[s]||void 0===i[s])&&(i[s]=t[s]);t=i,a?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let i;r&&t.push(o);try{i=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(i&&i.then&&"function"==typeof i.then?i.then(A,o):i instanceof Error?o(i):A(i))}function o(e,...r){n||(n=!0,t(e,...r))}function A(e){o(null,e)}}(a,o)(...i):r(null,...i)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const ji={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Fi(e);let n,r=0,o=-1,A=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else o<0&&(n=!0,o=A+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,a=t.length-1;for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else i<0&&(n=!0,i=A+1),a>-1&&(e.codePointAt(A)===t.codePointAt(a--)?a<0&&(o=A):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Fi(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Fi(e);let t,n=e.length,r=-1,o=0,A=-1,i=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?A<0?A=n:1!==i&&(i=1):A>-1&&(i=-1);else if(t){o=n+1;break}}return A<0||r<0||0===i||1===i&&A===r-1&&A===o+1?"":e.slice(A,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Fi(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Fi(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",A=0,i=-1,a=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else{if(47===n)break;n=47}if(47===n){if(i!==s-1&&1!==a)if(i!==s-1&&2===a){if(o.length<2||2!==A||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",A=0):(o=o.slice(0,r),A=o.length-1-o.lastIndexOf("/")),i=s,a=0;continue}}else if(o.length>0){o="",A=0,i=s,a=0;continue}t&&(o=o.length>0?o+"/..":"..",A=2)}else o.length>0?o+="/"+e.slice(i+1,s):o=e.slice(i+1,s),A=s-i-1;i=s,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0===n.length&&!t&&(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function Fi(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ui={cwd:function(){return"/"}};function qi(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function _i(e){if("string"==typeof e)e=new URL(e);else if(!qi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Yi=["history","path","basename","stem","extname","dirname"];class Gi{constructor(e){let t;var n;t=e?qi(e)?{path:e}:"string"==typeof e||(n=e)&&"object"==typeof n&&"byteLength"in n&&"byteOffset"in n?{value:e}:e:{},this.cwd="cwd"in t?"":Ui.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Yi.length;){const e=Yi[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Yi.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?ji.basename(this.path):void 0}set basename(e){Vi(e,"basename"),Wi(e,"basename"),this.path=ji.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?ji.dirname(this.path):void 0}set dirname(e){Xi(this.basename,"dirname"),this.path=ji.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?ji.extname(this.path):void 0}set extname(e){if(Wi(e,"extname"),Xi(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ji.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){qi(e)&&(e=_i(e)),Vi(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?ji.basename(this.path,this.extname):void 0}set stem(e){Vi(e,"stem"),Wi(e,"stem"),this.path=ji.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Nr(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Wi(e,t){if(e&&e.includes(ji.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ji.sep+"`")}function Vi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Xi(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Ki=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Ji={}.hasOwnProperty;class Zi extends Ki{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=zi()}copy(){const e=new Zi;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Hi(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(na("data",this.frozen),this.namespace[e]=t,this):Ji.call(this.namespace,e)&&this.namespace[e]||void 0:e?(na("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Aa(e),n=this.parser||this.Parser;return ea("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),ea("process",this.parser||this.Parser),ta("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const A=Aa(e),i=n.parse(A);function a(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(i,A,function(e,t,r){if(e||!t||!r)return a(e);const o=t,A=n.stringify(o,r);var i;"string"==typeof(i=A)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(i)?r.value=A:r.result=A,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),ea("processSync",this.parser||this.Parser),ta("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,Mi(e),t=r}),oa("processSync","process",n),t}run(e,t,n){ra(e),this.freeze();const r=this.transformers;return!n&&"function"==typeof t&&(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,A){const i=Aa(t);r.run(e,i,function(t,r,i){const a=r||e;t?A(t):o?o(a):n(void 0,a,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){Mi(e),n=t,r=!0}),oa("runSync","run",r),n}stringify(e,t){this.freeze();const n=Aa(t),r=this.compiler||this.Compiler;return ta("stringify",r),ra(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(na("use",this.frozen),null!=e)if("function"==typeof e)a(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?i(e):A(e)}return this;function o(e){if("function"==typeof e)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(t,n)}else A(e)}}function A(e){if(!("plugins"in e)&&!("settings"in e))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");i(e.plugins),e.settings&&(r.settings=Hi(!0,r.settings,e.settings))}function i(e){let t=-1;if(null!=e){if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function a(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...A]=t;const i=n[o][1];Ri(i)&&Ri(r)&&(r=Hi(!0,i,r)),n[o]=[e,r,...A]}}}}const $i=(new Zi).freeze();function ea(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function ta(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function na(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ra(e){if(!Ri(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function oa(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Aa(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Gi(e)}const ia=[],aa={allowDangerousHtml:!0},sa=/^(https?|ircs?|mailto|xmpp)$/i,la=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ca(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,A=e.components,i=e.disallowedElements,a=e.rehypePlugins||ia,s=e.remarkPlugins||ia,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...aa}:aa,c=e.skipHtml,u=e.unwrapDisallowed,d=e.urlTransform||ua,p=$i().use(JA).use(s).use(Qi,l).use(a),f=new Gi;"string"==typeof r&&(f.value=r);for(const t of la)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const v=p.parse(f);let b=p.runSync(v,f);return o&&(b={type:"element",tagName:"div",properties:{className:o},children:"root"===b.type?b.children:[b]}),xi(b,function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return c?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in to)if(Object.hasOwn(to,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=to[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let A=t?!t.includes(e.tagName):!!i&&i.includes(e.tagName);if(!A&&n&&"number"==typeof r&&(A=!n(e,r,o)),A&&o&&"number"==typeof r)return u&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}}),_r(b,{Fragment:m,components:A,ignoreInvalidStyle:!0,jsx:h,jsxs:g,passKeys:!0,passNode:!0})}function ua(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||sa.test(e.slice(0,t))?e:""}const da=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(ca,{components:{p:({...e})=>h("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>h("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>h("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>h("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?h("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):h("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:h("code",{children:t})}),blockquote:({...e})=>h("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),pa={autoConfig:!0},fa=e=>()=>(e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=rn(),i={...e,...pa},a=i.markdownComponent?i.markdownComponent:da;s(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const l=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,t(),r)&&(e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,l),en(X.CHUNK_STREAM_MESSAGE,l),en(X.START_STREAM_MESSAGE,l),en(X.START_SIMULATE_STREAM_MESSAGE,l);const c={name:"@rcb-plugins/markdown-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(e),ha={autoConfig:!0,promptBaseColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"},promptHoveredColors:{info:"#0056b3",warning:"#d39e00",error:"#c82333",success:"#218838"},textAreaHighlightColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"}},ga=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const A=o[n];return"function"==typeof A?A:void 0},ma=e=>{const{showToast:t}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=lt();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:n}=Zt(),{styles:r,updateStyles:o,replaceStyles:A}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=Ut();return{styles:e,replaceStyles:t,updateStyles:n}})(),l=(e=>({...ha,...e,promptBaseColors:{...ha.promptBaseColors},promptHoveredColors:{...ha.promptHoveredColors},textAreaHighlightColors:{...ha.textAreaHighlightColors}}))(e),[c,u]=a(0),d=i({});en(X.USER_SUBMIT_TEXT,e=>{const A=e,i=ga(A,n(),"validateTextInput");if(!i)return;const a=i(A.data.inputText);if(null!=a&&a.success||e.preventDefault(),!a.promptContent)return;0===c&&(d.current=structuredClone(r));const s=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(a,l);o(s),t(a.promptContent,a.promptDuration??3e3),u(e=>e+1)}),en(X.USER_UPLOAD_FILE,e=>{var r,o;const A=e,i=null==(o=null==(r=A.data)?void 0:r.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const a=ga(A,n(),"validateFileInput");if(!a)return void console.error("Validator not found for file input.");const s=a(i);if(!s.success)return console.error("Validation failed:",s),s.promptContent&&t(s.promptContent,s.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",s)}),en(X.DISMISS_TOAST,()=>{u(e=>e-1)}),s(()=>{0===c&&setTimeout(()=>{A(d.current)})},[c,A]);const p={name:"@rcb-plugins/input-validator"};return l.autoConfig&&(p.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),p},va=n((e,t)=>{let{embedded:n,currentOpen:r,enabled:o,onSetEnabled:A}=e;const a=$t(),l=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=ne();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),c=i(null),u=i(!1);return s(()=>{!n&&l&&l.toggleChatWindow&&(c.current===r||u.current||(setTimeout(()=>{l&&l.toggleChatWindow&&l.toggleChatWindow(r)},0),c.current=r),u.current=!1)},[r,n,l]),s(()=>{const e=()=>{u.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),p(t,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!n&&l&&l.toggleChatWindow&&l.toggleChatWindow(!0)},closeChat:()=>{!n&&l&&l.toggleChatWindow&&l.toggleChatWindow(!1)},toggleChat:()=>{!n&&l&&l.toggleChatWindow&&l.toggleChatWindow()},setBotEnabled:e=>{A&&A(e)}}),[a,l,n,A]),null});va.displayName="BotController";const ba=e=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:A=!1}=e;const i=A?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return t.createElement(t.Fragment,null,A&&t.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),t.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"qa-bot-login-button ".concat(A?"qa-bot-header-login-button":""," ").concat(r),style:Object.assign(Object.assign({},i),o)},"Log In"))},wa=()=>t.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},t.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.createElement("circle",{cx:"12",cy:"7",r:"4"}))),ya=[];for(let e=0;e<256;++e)ya.push((e+256).toString(16).slice(1));let xa;const Ea=new Uint8Array(16);var Ba={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pa(e,t,n){if(Ba.randomUUID&&!e)return Ba.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!xa){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");xa=crypto.getRandomValues.bind(crypto)}return xa(Ea)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(ya[e[t+0]]+ya[e[t+1]]+ya[e[t+2]]+ya[e[t+3]]+"-"+ya[e[t+4]]+ya[e[t+5]]+"-"+ya[e[t+6]]+ya[e[t+7]]+"-"+ya[e[t+8]]+ya[e[t+9]]+"-"+ya[e[t+10]]+ya[e[t+11]]+ya[e[t+12]]+ya[e[t+13]]+ya[e[t+14]]+ya[e[t+15]]).toLowerCase()}(r)}function Da(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const ka="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",Ca="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",Sa="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",Ia="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",Ta="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",Qa=()=>{Da()&&console.log("%c QA Bot Core %c v".concat("0.2.10"," "),Ia,Ta)},Ma=function(e){if(Da()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[Session]%c ".concat(e),ka,"",...n)}},Oa=function(e){if(Da()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[History]%c ".concat(e),Ca,"",...n)}},La=(e,t)=>{Da()&&console.log("%c[Message]%c ".concat(e),Sa,"",t)},Na=function(){console.warn(...arguments)},Ha=function(){console.error(...arguments)},Ra="qa_bot_session_messages",za=()=>"qa_bot_session_".concat(Pa()),ja=()=>{try{const e=localStorage.getItem(Ra);return e?JSON.parse(e):{}}catch(e){return{}}},Fa=(e,t,n,r,o)=>{const A=ja();!A[e]&&(A[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},Oa("NEW session created",{sessionId:e.slice(-12)}));if(A[e].messages.some(e=>e.id===t))return void Oa("DUPLICATE message skipped",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r});const i={id:t,content:n,sender:r,type:o,timestamp:Date.now()};A[e].messages.push(i),Oa("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:A[e].messages.length});const a=A[e].messages,s=a.find(e=>{var t;return"bot"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())&&e.content.length>=100});if(s){const t=s.content;A[e].preview=t.slice(0,50)+(t.length>50?"...":"")}else{const t=a.find(e=>{var t;return"user"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())});if(t&&!A[e].preview){const n=t.content;A[e].preview=n.slice(0,50)+(n.length>50?"...":"")}}(e=>{var t;const n=()=>Object.values(e).reduce((e,t)=>e+t.messages.length,0);for(;n()>100&&Object.keys(e).length>1;){const n=null===(t=Object.entries(e).sort((e,t)=>{let[,n]=e,[,r]=t;return new Date(n.startedAt).getTime()-new Date(r.startedAt).getTime()})[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(Ra,JSON.stringify(e))})(A),Oa("STORAGE state",{ourSessions:Object.keys(A).length,ourTotalMessages:Object.values(A).reduce((e,t)=>e+t.messages.length,0)})},Ua=e=>{var t,n;return null!==(n=null===(t=ja()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},qa=e=>{const t=ja()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},_a=r(void 0),Ya=e=>{let{children:n,getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}=e;return t.createElement(_a.Provider,{value:{getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}},n)},Ga=()=>{const e=o(_a);if(!e)throw new Error("useSession must be used within a SessionProvider");return e},Wa=()=>{const[e,n]=a(!1),[r,o]=a([]),A=i(null),l=i(null),{replaceMessages:c}=$t(),{toggleTextAreaDisabled:u}=nn(),{setSessionId:d,getSessionId:p}=Ga();s(()=>{const t=e=>{A.current&&!A.current.contains(e.target)&&l.current&&!l.current.contains(e.target)&&n(!1)};return e&&document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[e]);const f=e=>{const t=p();if(Oa("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==t?void 0:t.slice(-12)}),e===t)return Oa("RESTORE skipped - already on this session"),void n(!1);const r=(e=>{var t;return(null===(t=ja()[e])||void 0===t?void 0:t.messages)||[]})(e).filter(e=>{var t;return null===(t=e.content)||void 0===t?void 0:t.trim()});Oa("Stored messages from our localStorage",{count:r.length,ids:r.map(e=>e.id.slice(-8))});const o=r.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));c(o),Oa("replaceMessages called",{count:o.length}),setTimeout(()=>{const e=document.querySelector(".rcb-chat-body-container");e&&e.querySelectorAll(".rcb-bot-message").forEach(e=>{e.innerHTML.includes("](")&&(e.innerHTML=e.innerHTML.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'))})},50),d(e),Oa("Session ID updated",{newSession:e.slice(-12)}),u(!1),Oa("Chat input enabled after restore"),n(!1)};return t.createElement("div",{style:{position:"relative"}},t.createElement("button",{ref:l,className:"history-button",onClick:()=>{e||o((()=>{const e=ja();return Object.entries(e).map(e=>{let[t,n]=e;return Object.assign({sessionId:t},n)}).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime())})()),n(!e)},style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"18px",display:"flex",border:"none",cursor:"pointer",padding:0},"aria-label":"View chat history",title:"View chat history","aria-expanded":e,"aria-haspopup":"menu"},t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},t.createElement("circle",{cx:"12",cy:"12",r:"10"}),t.createElement("polyline",{points:"12 6 12 12 16 14"}))),e&&t.createElement("div",{ref:A,role:"menu",style:{position:"fixed",left:0,right:0,top:"auto",marginTop:"8px",backgroundColor:"white",borderRadius:0,borderBottom:"3px solid var(--primaryColor, #1a5b6e)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",maxHeight:"250px",overflowY:"auto",zIndex:1e3}},0===r.length?t.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):r.map(e=>t.createElement("button",{key:e.sessionId,role:"menuitem",onClick:()=>f(e.sessionId),style:{width:"100%",padding:"10px 14px",border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left",display:"flex",flexDirection:"column",gap:"2px",borderBottom:"1px solid #eee"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},t.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.preview||"New conversation"),t.createElement("span",{style:{fontSize:"12px",color:"#888"}},(e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/864e5);return 0===r?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):1===r?"Yesterday":r<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})})(e.startedAt))))))};function Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Va.apply(null,arguments)}const Xa=({width:e=24,height:n=24,color:r="currentColor",children:o,...A})=>t.createElement("svg",Va({xmlns:"http://www.w3.org/2000/svg",width:e,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},A),o),Ka=e=>t.createElement(Xa,e,t.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),Ja=r(null),Za=e=>{let{onAnalyticsEvent:n,getSessionId:r,children:o}=e;const a=i(n);a.current=n;const s=A(e=>{var t,n;a.current&&a.current(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:r())&&void 0!==n?n:void 0}))},[r]);return t.createElement(Ja.Provider,{value:{trackEvent:s}},o)},$a=()=>{const{restartFlow:e}=Zt(),{setTextAreaValue:n}=nn(),{messages:r}=$t(),{getSessionId:A,resetSession:i,clearResettingFlag:a}=Ga(),{trackEvent:s}=o(Ja)||{trackEvent:()=>{}};return t.createElement("button",{onClick:async()=>{const t=A(),r=t?Ua(t):0;s({type:"qa_new_chat_started",previousMessageCount:r}),i(),await n(""),await e(),setTimeout(()=>{a()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},t.createElement(Ka,{width:16,height:16}),"New Chat")};function es(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(es).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return es(t.children)}return""}const ts=()=>{const{getSessionId:e}=Ga(),t=A(t=>{var n;const r=null===(n=t.data)||void 0===n?void 0:n.message;if(La("PRE_INJECT",{sender:null==r?void 0:r.sender,type:null==r?void 0:r.type,content:null==r?void 0:r.content}),!(null==r?void 0:r.id))return;const o=r.sender,A=r.type||"string";let i;if(i="string"==typeof r.content?r.content:es(r.content),i.includes("rcb-options-container"))return;if(!i.trim())return;const a=e();Fa(a,r.id,i,o,A)},[e]);return s(()=>(window.addEventListener("rcb-pre-inject-message",t),()=>{window.removeEventListener("rcb-pre-inject-message",t)}),[t]),null},ns=()=>(s(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let A=[];if(o.length>0){const e=o[o.length-1],t=Array.from(e.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);if(t.length>0){const e=t[t.length-1];A=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===A.length)return;const i=A.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=i<A.length-1?i+1:0,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=i>0?i-1:A.length-1,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&A.includes(document.activeElement)){const e=document.activeElement;if(e.classList.contains("rcb-checkbox-row-container")||e.closest(".rcb-checkbox-row-container")){const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.querySelector(".rcb-checkbox-label"),o=r?r.textContent:e.textContent||"checkbox",A=e.querySelector(".rcb-checkbox-mark"),i=A&&A.style.backgroundColor?"checked":"unchecked";t(`${o} ${i}`)}else{const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.textContent||e.innerText;t(`Selected: ${r}`)}}break;case"Home":e.preventDefault(),A.length>0&&(A[0].setAttribute("tabindex","0"),A.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[0].classList.add("keyboard-focused"),A[0].focus());break;case"End":if(e.preventDefault(),A.length>0){const e=A.length-1;A[e].setAttribute("tabindex","0"),A.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),A[e].classList.add("keyboard-focused"),A[e].focus()}}},t=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&document.body.removeChild(t)},1e3)},n=(e=null)=>{let n=e;if(n||(n=document.querySelector(".rcb-chat-window"),n||(n=document.querySelector('[class*="rcb-chat"]')),n||(n=document.querySelector(".qa-bot"))),!n)return;const r=null!==n.closest(".embedded-qa-bot"),o=Array.from(n.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(0===o.length)return;const A=o[o.length-1],i=Array.from(A.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let a=[];if(i.length>0){const e=i[i.length-1];a=Array.from(e.querySelectorAll(".rcb-options"))}if(0===a.length){let e=A.querySelector(".rcb-checkbox-container");if(!e&&n&&(e=n.querySelector(".rcb-checkbox-container")),e&&null!==e.offsetParent){const t=Array.from(e.querySelectorAll(".rcb-checkbox-row-container")).filter(e=>null!==e.offsetParent&&"none"!==e.style.display);if(t.length>0){const n=e.querySelector(".rcb-checkbox-next-button"),o=[...t];if(n&&null!==n.offsetParent&&o.push(n),o.forEach((e,t)=>{e.setAttribute("tabindex",0===t?"0":"-1"),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),t.length>1){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select/deselect, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}return void setTimeout(()=>{o[0]&&null!==o[0].offsetParent&&!r&&o[0].focus()},150)}}}if(a.length>0){if(a.forEach((e,t)=>{const n=0===t?"0":"-1";e.setAttribute("tabindex",n),e.setAttribute("role","option"),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",a.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),a.length>1){const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}}else{const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{a[0]&&null!==a[0].offsetParent&&!r&&(a[0].focus(),a.length>1&&t(`${a.length} options available. Use arrow keys to navigate.`))},200)}},r=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type){const t=Array.from(e.addedNodes),r=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-options-container")||e.classList?.contains("rcb-options")||e.querySelector?.(".rcb-options-container")||e.querySelector?.(".rcb-options"))),o=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-checkbox-container")||e.querySelector?.(".rcb-checkbox-container")));if(r||o){let t=e.target;for(;t&&!t.classList?.contains("qa-bot")&&!t.classList?.contains("rcb-chat-window");)t=t.parentElement;(t||document).querySelectorAll(".rcb-options[tabindex], .rcb-checkbox-row-container[tabindex], .rcb-checkbox-next-button[tabindex]").forEach(e=>{e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused")}),setTimeout(()=>n(t),100)}}})});r.observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("keydown",e),n();const o=setInterval(()=>{document.querySelectorAll(".qa-bot").forEach(e=>{const t=e.querySelectorAll(".rcb-options-container .rcb-options").length>0,r=e.querySelectorAll(".rcb-checkbox-row-container").length>0;if(t){const t=e.querySelectorAll(".rcb-options[tabindex]").length;e.querySelectorAll(".rcb-options").length>t&&n(e)}if(r){const t=e.querySelectorAll(".rcb-checkbox-row-container[tabindex]").length;e.querySelectorAll(".rcb-checkbox-row-container").length>t&&n(e)}})},1e3);return()=>{document.removeEventListener("keydown",e),r.disconnect(),clearInterval(o)}},[]),null);const rs="#1a5b6e",os="#107180",As="Arial, sans-serif",is="Q&A Bot",as="/chat-icon.svg",ss="Type your question here...",ls="Select an option to continue",cs=!1,us="Ask me a question!",ds="/login",ps={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:1e3,showCharacterCount:!1,allowNewline:!0,blockSpam:!1},chatWindow:{defaultOpen:!1,showScrollbar:!1},botBubble:{simulateStream:!0,streamSpeed:10,showAvatar:!1},userBubble:{showAvatar:!1},notification:{disabled:!0,showCount:!1},audio:{disabled:!0},emoji:{disabled:!0},fileAttachment:{disabled:!0}},fs=n((e,n)=>{var r,o;const{apiKey:A,qaEndpoint:c,ratingEndpoint:u,welcomeMessage:d,open:p,onOpenChange:f,isLoggedIn:h,allowAnonAccess:g=!1,actingUser:m,primaryColor:v,secondaryColor:b,botName:y,logo:x,placeholder:E,errorMessage:B,embedded:P,footerText:D,footerLink:k,tooltipText:C,loginUrl:S,customFlow:I,onAnalyticsEvent:T}=e,Q=i("bot_".concat(Math.random().toString(36).substr(2,9)));s(()=>{Qa()},[]);const M=i(null);null===M.current&&(M.current=za(),Ma("CREATED",M.current));const O=i(!1),L=i({getSessionId:()=>M.current,isResetting:()=>O.current}),[N,H]=a(h);s(()=>{H(h)},[h]);const R=l(()=>{const e=Object.assign({},ps);e.general=Object.assign(Object.assign({},e.general),{primaryColor:v||rs,secondaryColor:b||os,fontFamily:As,embedded:void 0!==P?P:cs});const n=!1===N?[t.createElement(ba,{key:"login-button",loginUrl:S||ds,isHeaderButton:!0})]:[t.createElement(Wa,{key:"history-button"}),t.createElement(wa,{key:"user-icon"})];e.header={title:t.createElement("span",{style:{fontSize:14,fontWeight:500}},y||is),showAvatar:!0,avatar:x||as,buttons:[...n,w.CLOSE_CHAT_BUTTON]},e.chatInput=Object.assign(Object.assign({},e.chatInput),{disabled:!1,enabledPlaceholderText:E||ss,disabledPlaceholderText:B||ls}),e.tooltip=Object.assign(Object.assign({},e.tooltip),{text:C||us});const r=D?k?t.createElement("a",{href:k,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},D):t.createElement("span",{key:"footer-text"},D):null;return e.footer={text:r,buttons:[t.createElement($a,{key:"new-chat-button"})]},e.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},e},[v,b,y,x,E,B,P,C,N,S,D,k]),z=i(null),j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(()=>{const n=(t,n)=>{if(e.current){const n=getComputedStyle(e.current).getPropertyValue(t);if(n&&""!==n.trim())return n.trim();if(e.current.parentElement){const n=getComputedStyle(e.current.parentElement).getPropertyValue(t);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:n("--primaryColor",t.primaryColor),secondaryColor:n("--secondaryColor",t.secondaryColor),fontFamily:n("--fontFamily",t.fontFamily)}},[e,t])}(z,R.general);((e,t)=>{s(()=>{t.current&&(e?t.current.classList.add("bot-logged-in"):t.current.classList.remove("bot-logged-in"))},[e,t])})(!1!==N,z),(e=>{let{settings:n,themeColors:r}=e;s(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty("--".concat(t),n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),s(()=>{var e,r,o;(null===(e=n.header)||void 0===e?void 0:e.title)&&"string"==typeof n.header.title&&(n.header.title=t.createElement("div",{key:"header-title"},t.createElement("h1",{className:"sr-only"},n.header.title),t.createElement("span",{"aria-hidden":"true"},n.header.title))),(null===(r=n.general)||void 0===r?void 0:r.embedded)&&n.chatWindow&&(n.chatWindow.defaultOpen=!0),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!1},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(o=n.header)||void 0===o?void 0:o.avatar}),n.event={rcbToggleChatWindow:!0}},[n])})({settings:R,themeColors:j});const F=l(()=>{const e=(e=>{let{endpoint:n,ratingEndpoint:r,apiKey:o,sessionId:A,isResetting:i=()=>!1,isLoggedIn:a,allowAnonAccess:s=!1,loginUrl:l="/login",actingUser:c,onAnalyticsEvent:u}=e;const d=e=>{var t,n;u&&u(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:A())&&void 0!==n?n:void 0}))};if(!1===a&&!s)return d({type:"qa_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:t.createElement(ba,{loginUrl:l}),chatDisabled:!0,path:"qa_loop"}};let p=null,f=!1;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{const{userInput:t}=e;if(i&&i())return null;if(!t||""===t.trim())return null;if("👍 Helpful"===t||"👎 Not helpful"===t){if(r&&p)try{const e="👍 Helpful"===t,n={"Content-Type":"application/json"};o&&(n["X-API-KEY"]=o);const i=A();i&&(n["X-Session-ID"]=i,n["X-Query-ID"]=p),await fetch(r,{method:"POST",headers:n,body:JSON.stringify({sessionId:i,queryId:p,rating:e?1:0})}),d({type:"qa_response_rated",queryId:p,rating:e?"helpful":"not_helpful"})}catch(e){Ha("Error sending feedback:",e)}return"Thanks for the feedback! Feel free to ask another question."}try{const r=Pa();p=r,d({type:"qa_question_asked",queryId:r,questionLength:t.length});const i={"Content-Type":"application/json"};o&&(i["X-API-KEY"]=o);const a=A();a&&(i["X-Session-ID"]=a,i["X-Query-ID"]=r),c&&(i["X-Acting-User"]=c);const s={query:t,session_id:a,question_id:r};c&&(s.acting_user=c),Ma("SENT to API",{session_id:a,question_id:r,acting_user:c||"(not set)"});const l=Date.now(),u=await fetch(n,{method:"POST",headers:i,body:JSON.stringify(s)}),h=Date.now()-l;if(!u.ok)throw new Error("API returned ".concat(u.status));const g=await u.json(),m=g.response||g.answer||g.text||g.message;if(!m)throw new Error("Invalid response format from API");const v=(e=>{if(!e||"string"!=typeof e)return e;let t=e.replace(/\[(https?:\/\/[^\s]+?)\]/gi,"[$1]($1)");return t=t.replace(/(?<!\]\(|href=["']|\[)https?:\/\/[^\s[\]()]+/gi,e=>{let t=e,n="";const r=t.match(/([.,;:!?]+)$/);return r&&(n=r[1],t=t.slice(0,-n.length)),"[".concat(t,"](").concat(t,")").concat(n)}),t})(m),b=function(e){const{confidence:t,tools_used:n,metadata:r}=e;if(!(t||n&&0!==n.length))return"";const o=[];return t&&o.push("• Confidence: ".concat(t)),n&&n.length>0&&o.push("• Tools used: ".concat(n.join(", "))),(null==r?void 0:r.agent)&&o.push("• Agent: ".concat(r.agent)),"---\n".concat(o.join("\n"))}(g),w=b?"".concat(v,"\n\n").concat(b):v;return await e.injectMessage(w),d({type:"qa_response_received",queryId:r,responseTimeMs:h,success:!0,responseLength:m.length,hasMetadata:!!b}),f=!0,setTimeout(async()=>{await e.injectMessage("Feel free to ask another question.")},100),null}catch(e){return Ha("Error in Q&A flow:",e),d({type:"qa_response_error",queryId:null!=p?p:void 0,errorType:e instanceof Error?e.message:"unknown"}),"I apologize, but I'm having trouble processing your question. Please try again later."}},options:e=>i&&i()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput?[]:r&&f?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,path:"qa_loop"}}})({endpoint:c,ratingEndpoint:u,apiKey:A,sessionId:L.current.getSessionId,isResetting:L.current.isResetting,isLoggedIn:N,allowAnonAccess:g,loginUrl:S||ds,actingUser:m,onAnalyticsEvent:T}),n={message:d,transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},e),I||{})},[A,c,u,d,N,g,S,I,m,T]),U=l(()=>{return[()=>Mn(t),fa(),()=>ma(e)];var e,t},[]);return s(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),ns(),s(()=>{if(!P){const e=e=>{const t=e.data.newState;null==f||f(t);const n=M.current;t?null==T||T({type:"qa_bot_opened",timestamp:Date.now(),sessionId:null!=n?n:void 0}):null==T||T({type:"qa_bot_closed",timestamp:Date.now(),sessionId:null!=n?n:void 0,messageCount:n?Ua(n):0,durationMs:n?qa(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[P,f,T]),t.createElement("div",{className:"qa-bot ".concat((null===(r=R.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:z,role:"region","aria-label":y||is},t.createElement(Ya,{getSessionId:()=>M.current,setSessionId:e=>{const t=M.current;M.current=e,Ma("RESTORED","".concat(null==t?void 0:t.slice(-12)," -> ").concat(e.slice(-12)))},resetSession:()=>{const e=M.current;O.current=!0,M.current=za(),Ma("RESET","".concat(null==e?void 0:e.slice(-12)," -> ").concat(M.current.slice(-12)))},clearResettingFlag:()=>{O.current=!1}},t.createElement(Za,{onAnalyticsEvent:T,getSessionId:()=>M.current},t.createElement(Gt,null,t.createElement("div",null,t.createElement(ts,null),t.createElement(va,{ref:n,embedded:(null===(o=R.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:p||!1,enabled:!1!==N,onSetEnabled:e=>H(!!e&&void 0)}),t.createElement(Kt,{key:"chatbot-".concat(Q.current,"-").concat(N),settings:R,flow:F,plugins:U}),t.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region"}),t.createElement("div",{id:"chat-input-help",className:"sr-only"},"Type your message and press Enter to send. Use arrow keys to navigate through response options."))))))});fs.displayName="QABot";b('.rcb-chat-window{height:800px!important;max-height:80vh!important;max-width:100%;width:550px!important}.rcb-chat-window .rcb-chat-header{align-items:center;display:flex;flex-direction:row;font-weight:700}.rcb-chat-window a{color:#000;font-weight:700;text-decoration:underline}.rcb-chat-window a:hover{color:var(--primaryColor,#107180)}.rcb-chat-window .rcb-bot-message a{color:#fff;text-decoration:none}.rcb-chat-window .rcb-bot-message a:hover{text-decoration:underline}.rcb-chat-window .rcb-chat-input-textarea{overflow-y:auto}.rcb-chat-window .rcb-chat-footer-container{font-size:10px}.qa-bot .history-button,.qa-bot .user-login-icon{display:none!important}.qa-bot.bot-logged-in .history-button,.qa-bot.bot-logged-in .user-login-icon{display:flex!important;transform:scale(1.3) translateY(-2px)}.qa-bot.bot-logged-in .history-button:hover{opacity:.8}.qa-bot.bot-logged-in .history-button:focus{outline:2px solid #fff;outline-offset:2px}.embedded-qa-bot .rcb-chat-window{max-width:100%;width:100%!important}.qa-bot.hidden{display:none}.embedded-qa-bot .rcb-bot-message,.embedded-qa-bot .rcb-user-message{max-width:90%!important;word-break:break-word}.embedded-qa-bot .rcb-chat-input-textarea{width:100%!important}.qa-bot-container{max-width:100%;width:100%}@keyframes phone-ring{0%{transform:translateX(0) translateY(0) rotate(0deg)}2%{transform:translateX(0) translateY(-8px) rotate(-2deg)}4%{transform:translateX(0) translateY(-6px) rotate(2deg)}6%{transform:translateX(0) translateY(-8px) rotate(-1deg)}8%{transform:translateX(0) translateY(-6px) rotate(1deg)}10%{transform:translateX(0) translateY(-8px) rotate(-2deg)}12%{transform:translateX(0) translateY(-6px) rotate(2deg)}20%{transform:translateX(0) translateY(0) rotate(0deg)}30%{transform:translateX(0) translateY(0) rotate(0deg)}40%{transform:translateX(0) translateY(0) rotate(0deg)}49%{transform:translateX(0) translateY(0) rotate(0deg)}50%{transform:translateX(0) translateY(-8px) rotate(-2deg)}52%{transform:translateX(0) translateY(-6px) rotate(2deg)}54%{transform:translateX(0) translateY(-8px) rotate(-1deg)}56%{transform:translateX(0) translateY(-6px) rotate(1deg)}58%{transform:translateX(0) translateY(-8px) rotate(-2deg)}60%{transform:translateX(0) translateY(-6px) rotate(2deg)}70%{transform:translateX(0) translateY(0) rotate(0deg)}to{transform:translateX(0) translateY(0) rotate(0deg)}}@media (max-width:768px){.rcb-chat-window{max-height:calc(100vh - 100px)!important;max-width:calc(100vw - 40px)!important;width:550px!important}.embedded-chat-container.open{height:400px}.embedded-chat-closed{font-size:14px;height:40px}.embedded-chat-open-btn{font-size:12px;padding:3px 10px}.rcb-bot-message,.rcb-user-message{max-width:85%!important}.rcb-chat-input-textarea{font-size:16px!important;min-height:44px!important}.rcb-chat-header{padding:12px 16px!important}}@media (max-width:480px){.rcb-chat-window{bottom:10px!important;left:10px!important;max-height:calc(100vh - 80px)!important;max-width:calc(100vw - 20px)!important;right:10px!important;width:calc(100vw - 20px)!important}.embedded-chat-container.open{height:350px}.rcb-bot-message,.rcb-user-message{margin-bottom:8px!important;max-width:90%!important}.rcb-chat-header{font-size:14px!important;padding:8px 12px!important}.rcb-chat-button{bottom:20px!important;height:50px!important;right:20px!important;width:50px!important}.rcb-chat-footer-container{font-size:9px!important;padding:8px 12px!important}}@media (max-width:360px){.rcb-chat-window{left:5px!important;max-width:calc(100vw - 10px)!important;right:5px!important;width:calc(100vw - 10px)!important}.rcb-chat-header{font-size:13px!important;padding:6px 8px!important}}.rcb-checkbox-container{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-left:16px!important;max-width:100%!important;padding-top:12px!important}.rcb-checkbox-row-container{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--primaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-row-container:hover{background-color:#e8f4f8!important;border-color:var(--primaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-row-container[data-checked=true]{background-color:var(--primaryColor,#107180)!important;border-color:var(--primaryColor,#107180)!important;color:#fff!important}.rcb-checkbox-row{margin-left:0!important}.rcb-checkbox-mark{height:14px!important;margin-right:6px!important;width:14px!important}.rcb-checkbox-label{font-size:13px!important;margin:0!important;white-space:nowrap!important}.rcb-checkbox-next-button{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;justify-content:center!important;line-height:24px!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-next-button:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.sr-only{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.rcb-chat-input-send-button:focus,.rcb-chat-input-textarea:focus{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-user-message{word-wrap:break-word!important;overflow:hidden!important;word-break:break-word!important}:focus-visible{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-options-container{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:8px!important;margin:16px!important;padding:0!important}.rcb-options{background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;outline:none!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-options:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-next-button.keyboard-focused,.rcb-checkbox-next-button:focus,.rcb-checkbox-next-button:focus-visible,.rcb-checkbox-row-container.keyboard-focused,.rcb-checkbox-row-container:focus,.rcb-checkbox-row-container:focus-visible,.rcb-options.keyboard-focused,.rcb-options:focus,.rcb-options:focus-visible{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;outline:none!important}.rcb-options:active{background-color:var(--secondaryColor,#107180)!important;border-color:var(--secondaryColor,#107180)!important;color:#fff!important;transform:translateY(0)!important}.keyboard-nav-hint{color:#666!important;font-size:12px!important;font-style:italic!important;margin-bottom:8px!important}@media (prefers-reduced-motion:reduce){.keyboard-nav-hint{display:none!important}}.rcb-options-container [role=button][tabindex="0"],.rcb-options-container button[tabindex="0"]{position:relative!important}.rcb-options-container [role=button][tabindex="0"]:after,.rcb-options-container button[tabindex="0"]:after{color:var(--secondaryColor,#107180)!important;content:"←"!important;font-size:16px!important;opacity:0!important;position:absolute!important;right:12px!important;top:50%!important;transform:translateY(-50%)!important;transition:opacity .2s ease!important}.rcb-options-container [role=button][tabindex="0"]:focus:after,.rcb-options-container button[tabindex="0"]:focus:after{opacity:1!important}.rcb-chat-input-send-button{cursor:pointer!important;opacity:1!important;pointer-events:auto!important;visibility:visible!important}.rcb-chat-input-send-button:not([tabindex]){-webkit-user-select:none;-moz-user-select:none;user-select:none}.rcb-chat-input-container [onclick],.rcb-chat-input-container [role=button],.rcb-chat-input-container div[style*=cursor],.rcb-chat-input-container svg:last-child,.rcb-chat-input-container>div:last-child{tabindex:0!important;cursor:pointer!important}.rcb-chat-footer{margin-top:4px!important;padding-top:0!important}.rcb-chat-footer-container{align-items:center!important;display:flex!important;margin-top:4px!important;padding-top:4px!important}.rcb-chat-footer-container button{order:1!important}.rcb-chat-footer-container a[href*=qa-bot-core]{tab-index:0!important;order:2!important}.rcb-chat-footer-container a[href*=feedback]{tab-index:0!important;order:3!important}@media (prefers-contrast:high){.rcb-chat-window a{background-color:#fff!important;border:1px solid #000!important;color:#000!important}}@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.rcb-chat-input-textarea{user-select:text!important}.rcb-chat-body-container,.rcb-chat-input-textarea,.rcb-chat-window{touch-action:pan-y!important}.embedded-qa-bot,.rcb-chat-window{-webkit-overflow-scrolling:touch!important}.embedded-qa-bot .rcb-chat-input-textarea{touch-action:pan-y!important;user-select:text!important}.embedded-qa-bot .rcb-chat-body-container,.embedded-qa-bot .rcb-chat-window{touch-action:pan-y!important}.rcb-chat-header-container{background:var(--primaryColor,#1a5b6e)!important;background:linear-gradient(135deg,var(--primaryColor,#1a5b6e) 0,var(--secondaryColor,#107180) 100%)!important}.rcb-toggle-button{align-items:center!important;background:var(--primaryColor,#1a5b6e)!important;display:flex!important;justify-content:center!important}.rcb-toggle-button svg{stroke:#fff!important;color:#fff!important}.rcb-toggle-button *,.rcb-toggle-button img,.rcb-toggle-button svg,.rcb-toggle-button>*{box-sizing:border-box!important;height:50px!important;left:0!important;margin:0 auto!important;max-height:50px!important;max-width:50px!important;min-height:50px!important;min-width:50px!important;padding:2px!important;position:relative!important;top:0!important;width:50px!important}.rcb-send-button{background-color:var(--primaryColor,#1a5b6e)!important}',{insertAt:"top"});const hs=()=>{const[e,t]=a(!1),n=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!n())throw new Error("Screen capture is not available in this environment");try{t(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),n=document.createElement("video");n.srcObject=e,await new Promise(e=>{n.onloadedmetadata=()=>{n.play(),e()}});const r=document.createElement("canvas");r.width=n.videoWidth,r.height=n.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(n,0,0,r.width,r.height);const A=await new Promise(e=>r.toBlob(e,"image/png"));if(!A)throw new Error("Could not create image blob");const i=(new Date).toISOString().replace(/[:.]/g,"-"),a=new File([A],"screenshot-".concat(i,".png"),{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),t(!1),a}catch(e){throw Ha("Error capturing screenshot:",e),t(!1),e}},isCapturing:e,isScreenCaptureAvailable:n()}},gs=e=>t.createElement(Xa,e,t.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.createElement("polyline",{points:"17 8 12 3 7 8"}),t.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),ms=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error("Failed to read file ".concat(e.name)));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error("Failed to read file ".concat(e.name))),r.readAsDataURL(e)}),vs=e=>Promise.all(e.map(ms)),bs=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t},ws=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB"),ys=e=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:A=!1,className:s}=e;const[l,c]=a(!1),[u,d]=a([]),[p,f]=a(null),h=i(null),{captureScreenshot:g,isCapturing:m,isScreenCaptureAvailable:v}=hs(),b=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},w=e=>{if(!e||0===e.length)return void Na("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return Ha("FileUploadComponent: Error converting files to array:",e),void b("Error processing selected files. Please try again.")}const r=[...u,...t];d(r);const o=t.length,A=t.map(e=>e.name).join(", ");b("".concat(o," file").concat(o>1?"s":""," selected: ").concat(A)),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},y=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?c(!0):"dragleave"===e.type&&c(!1)},x=()=>{try{h.current&&h.current.click()}catch(e){Ha("FileUploadComponent: Error in handleButtonClick:",e),b("Error opening file selection dialog. Please try again.")}},E=()=>{f(null)},B=A&&v;return t.createElement("div",{className:"file-upload-container ".concat(s||""),style:{padding:"16px",margin:"8px 0"}},B&&t.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},t.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await g();w([e]),b("Screenshot captured successfully")}catch(e){b("Error capturing screenshot. Please try again.")}})()},disabled:m,"aria-describedby":"screenshot-help","aria-label":m?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:m?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t.createElement("circle",{cx:"12",cy:"13",r:"4"})),m?"Taking screenshot...":"Take screenshot..."),t.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),t.createElement("div",{className:"file-upload-dropzone ".concat(l?"active":""),onDragEnter:y,onDragLeave:y,onDragOver:y,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),c(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&w(e.dataTransfer.files)}catch(e){Ha("FileUploadComponent: Error in handleDrop:",e),b("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),x())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:l?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},t.createElement("input",{ref:h,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&w(e.target.files)}catch(e){Ha("FileUploadComponent: Error in handleFileSelect:",e),b("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),t.createElement("div",{className:"upload-content",onClick:x,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},t.createElement(gs,null),t.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),t.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),u.length>0&&t.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},t.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),u.map((e,r)=>t.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:t=>{t.stopPropagation(),(e=>{f(e)})(e)}},t.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=u.filter((t,n)=>n!==e);d(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":"Remove ".concat(e.name)},"×"),e.name," (",ws(e.size),")"))))),(()=>{if(!p)return null;const e=p.type.startsWith("image/"),n=p.type.startsWith("text/"),r="application/pdf"===p.type;return t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:E},t.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:E,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),t.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},p.name),e&&t.createElement("img",{src:URL.createObjectURL(p),alt:p.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&t.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(p)),r&&t.createElement("iframe",{src:URL.createObjectURL(p),style:{width:"100%",height:"70vh",border:"none"},title:p.name}),!e&&!n&&!r&&t.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())};function xs(e,t){if(!t||0===Object.keys(t).length)return e;const n={};for(const[r,o]of Object.entries(e)){let e=Object.assign({},o);if(t.disableOnOptions&&void 0===e.chatDisabled){const t=!(!e.options&&!e.checkboxes);e.chatDisabled=t}n[r]=e}return n}const Es=t.forwardRef((e,n)=>{const[r,o]=t.useState(e.defaultOpen||!1),A=t.useRef(null);return t.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;o(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;o(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;o(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),t.createElement(fs,{ref:A,apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,embedded:e.embedded,isLoggedIn:e.isLoggedIn,allowAnonAccess:e.allowAnonAccess,open:r,onOpenChange:o,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText,onAnalyticsEvent:e.onAnalyticsEvent})});function Bs(e){if(!(e.target&&e.target instanceof HTMLElement))return void Ha("QA Bot: A valid target DOM element is required");const n=f.createRoot(e.target),r={current:null};return n.render(t.createElement(t.StrictMode,null,t.createElement(Es,{ref:e=>{r.current=e},apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,defaultOpen:e.defaultOpen,embedded:e.embedded,isLoggedIn:e.isLoggedIn,allowAnonAccess:e.allowAnonAccess,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText,onAnalyticsEvent:e.onAnalyticsEvent}))),{addMessage:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{r.current=null,n.unmount()}}}Es.displayName="ProgrammaticQABot";export{ys as FileUploadComponent,fs as QABot,xs as applyFlowSettings,Bs as default,ms as fileToBase64,vs as filesToBase64,ws as formatFileSize,Bs as qaBot,hs as useScreenshotCapture,bs as validateFileSize};
8
+ */var gn,mn;const vn=hn(function(){if(mn)return gn;mn=1;var e=/["'&<>]/;return gn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,A="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#39;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}a!==i&&(A+=n.substring(a,i)),a=i+1,A+=o}return a!==i?A+n.substring(a,i):A}}());function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wn=/(url|image|image-set)\(/i;class yn extends fn{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(wn)&&delete t[e]}),t}}const xn=/^<(!doctype|(html|head|body)(\s|>))/i,En=/^(aria-|data-|\w+:)/iu,Bn=/{{{(\w+)\/?}}}/;function Pn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let Dn=class{constructor(e,t={},n=[],r=[]){var o;if(bn(this,"allowed",void 0),bn(this,"banned",void 0),bn(this,"blocked",void 0),bn(this,"container",void 0),bn(this,"content",[]),bn(this,"props",void 0),bn(this,"matchers",void 0),bn(this,"filters",void 0),bn(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new yn],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:ln),this.banned=new Set(sn),this.blocked=new Set(t.blockList)}applyAttributeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.attribute?n.attribute(e,t):t,t)}applyNodeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.node?n.node(e,t):t,t)}applyMatchers(e,t){const n={},{props:r}=this;let o=e,A=0,i=null;return this.matchers.forEach(e=>{const a=e.asTag().toLowerCase(),s=this.getTagConfig(a);if(r[e.inverseName]||!this.isTagAllowed(a)||!this.canRenderChild(t,s))return;let l="";for(;o&&(i=e.match(o));){const{index:t,length:a,match:s,valid:c,void:u,...d}=i,p=e.propName+String(A);t>0&&(l+=o.slice(0,t)),c?(l+=u?`{{{${p}/}}}`:`{{{${p}}}}${s}{{{/${p}}}}`,this.keyIndex+=1,A+=1,n[p]={children:s,matcher:e,props:{...r,...d,key:this.keyIndex}}):l+=s,e.greedy?(o=l+o.slice(t+a),l=""):o=o.slice(t+(a||s.length))}e.greedy||(o=l+o)}),0===A?e:this.replaceTokens(o,n)}canRenderChild(e,t){return!(!e.tagName||!t.tagName||e.void)&&(e.children.length>0?e.children.includes(t.tagName):!(e.invalid.length>0&&e.invalid.includes(t.tagName))&&(t.parent.length>0?t.parent.includes(e.tagName):!(!e.self&&e.tagName===t.tagName)&&!!(e&&e.content&t.type)))}convertLineBreaks(e){const{noHtml:t,disableLineBreaks:n}=this.props;if(t||n||e.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return e;let r=e.replace(/\r\n/g,"\n");return r=r.replace(/\n{3,}/g,"\n\n\n"),r=r.replace(/\n/g,"<br/>"),r}createContainer(e){var t;const n=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||Pn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(xn)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?vn(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:A,value:i}=o,a=A.toLowerCase(),s=cn[a]||cn[A];if(!this.isSafe(e)||!a.match(En)&&(!t&&(!s||2===s)||a.startsWith("on")||i.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let l="style"===a?this.extractStyleAttribute(e):i;4===s?l=!0:3===s?l=Number.parseFloat(String(l)):5!==s&&(l=String(l)),n[un[a]||a]=this.applyAttributeFilters(a,l),r+=1}),0!==r)?n:null}extractStyleAttribute(e){const t={};return Array.from(e.style).forEach(n=>{const r=e.style[n];("string"==typeof r||"number"==typeof r)&&(t[n.replace(/-([a-z])/g,(e,t)=>String(t).toUpperCase())]=r)}),t}getTagConfig(e){const t={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return an[e]?{...t,...an[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(e,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:A,transform:i,transformOnlyAllowList:a}=this.props;let s=[],l="";return[...e.childNodes].forEach(e=>{if(1===e.nodeType){const u=e.nodeName.toLowerCase(),d=this.getTagConfig(u);l&&(s.push(l),l="");const p=this.applyNodeFilters(u,e);if(!p)return;let f;if(i&&(!a||this.isTagAllowed(u))){this.keyIndex+=1;const e=this.keyIndex;f=this.parseNode(p,d);const n=i(p,f,d);if(null===n)return;if(typeof n<"u")return void s.push(t.cloneElement(n,{key:e}));this.keyIndex=e-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!A&&!this.canRenderChild(n,d))s=[...s,...this.parseNode(p,d.tagName?d:n)];else{var c;this.keyIndex+=1;const e=this.extractAttributes(p),n={tagName:u};e&&(n.attributes=e),d.void&&(n.selfClose=d.void),s.push(t.createElement(pn,{...n,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(p,d)))}}else if(3===e.nodeType){const t=r&&!o?e.textContent:this.applyMatchers(e.textContent||"",n);Array.isArray(t)?s=[...s,...t]:l+=t}}),l&&s.push(l),s}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(Bn);){const[e,A]=o,i=o.index,a=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[A])throw new Error(`Token "${A}" found but no matching element to replace with.`);i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:s,matcher:l,props:c}=t[A];let u;if(a)u=e.length,n.push(l.createElement(s,c));else{const o=r.match(new RegExp(`{{{/${A}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${A}".`);u=o.index+o[0].length,n.push(l.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function kn(e){var n;const{attributes:r,className:o,containerTagName:A,content:i,emptyContent:a,parsedContent:s,tagName:l,noWrap:c}=e,u=null!==(n=A??l)&&void 0!==n?n:"span",d="fragment"===u||c;let p;if(s)p=s;else{const t=new Dn(i??"",e).parse();t.length>0&&(p=t)}return p||(p=a),d?t.createElement(t.Fragment,null,p):t.createElement(pn,{attributes:r,className:o,tagName:u},p)}function Cn(e){const{attributes:n,className:r,content:o="",disableFilters:A=!1,disableMatchers:i=!1,emptyContent:a=null,filters:s=[],matchers:l=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:p=!1,...f}=e,h=i?[]:l,g=A?[]:s,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const b=m.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new Dn(b,f,h,g),y=v.reduce((t,n)=>{const r=n(t,e);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return t.createElement(kn,{attributes:n,className:r,containerTagName:e.containerTagName,emptyContent:a,noWrap:p,parsedContent:0===y.length?void 0:y,tagName:d})}const Sn=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(Cn,{content:"string"==typeof e?e:""})}),In={autoConfig:!0},Tn=(e,t,n)=>{var r;if(!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderHtml)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)},Qn=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const A=e[o];"<"===A?r?(t.push(n),n=A):(r=!0,n=A):">"===A?(n+=A,t.push(n),n="",r=!1):r?n+=A:t.push(A)}return""!==n&&t.push(n),t},Mn=e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=rn(),i={...e,...In},a=i.htmlComponent?i.htmlComponent:Sn;s(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const l=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();"string"==typeof e.data.message.content&&Tn(e,t(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=Qn),e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,l),en(X.CHUNK_STREAM_MESSAGE,l),en(X.START_STREAM_MESSAGE,l),en(X.START_SIMULATE_STREAM_MESSAGE,l),en(X.START_SPEAK_AUDIO,async e=>{Tn(e,t(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const On=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ln=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nn={};function Hn(e,t){return(Nn.jsx?Ln:On).test(e)}const Rn=/[ \t\n\f\r]/g;function zn(e){return""===e.replace(Rn,"")}class jn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Fn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new jn(n,r,t)}function Un(e){return e.toLowerCase()}jn.prototype.property={},jn.prototype.normal={},jn.prototype.space=null;class qn{constructor(e,t){this.property=e,this.attribute=t}}qn.prototype.space=null,qn.prototype.boolean=!1,qn.prototype.booleanish=!1,qn.prototype.overloadedBoolean=!1,qn.prototype.number=!1,qn.prototype.commaSeparated=!1,qn.prototype.spaceSeparated=!1,qn.prototype.commaOrSpaceSeparated=!1,qn.prototype.mustUseProperty=!1,qn.prototype.defined=!1;let _n=0;const Yn=Zn(),Gn=Zn(),Wn=Zn(),Vn=Zn(),Xn=Zn(),Kn=Zn(),Jn=Zn();function Zn(){return 2**++_n}const $n=Object.freeze(Object.defineProperty({__proto__:null,boolean:Yn,booleanish:Gn,commaOrSpaceSeparated:Jn,commaSeparated:Kn,number:Vn,overloadedBoolean:Wn,spaceSeparated:Xn},Symbol.toStringTag,{value:"Module"})),er=Object.keys($n);class tr extends qn{constructor(e,t,n,r){let o=-1;if(super(e,t),nr(this,"space",r),"number"==typeof n)for(;++o<er.length;){const e=er[o];nr(this,er[o],(n&$n[e])===$n[e])}}}function nr(e,t,n){n&&(e[t]=n)}tr.prototype.defined=!0;const rr={}.hasOwnProperty;function or(e){const t={},n={};let r;for(r in e.properties)if(rr.call(e.properties,r)){const o=e.properties[r],A=new tr(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(A.mustUseProperty=!0),t[r]=A,n[Un(r)]=r,n[Un(A.attribute)]=r}return new jn(t,n,e.space)}const Ar=or({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),ir=or({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function ar(e,t){return t in e?e[t]:t}function sr(e,t){return ar(e,t.toLowerCase())}const lr=or({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:sr,properties:{xmlns:null,xmlnsXLink:null}}),cr=or({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Vn,ariaColIndex:Vn,ariaColSpan:Vn,ariaControls:Xn,ariaCurrent:null,ariaDescribedBy:Xn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:Xn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:Xn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Xn,ariaLevel:Vn,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:Xn,ariaPlaceholder:null,ariaPosInSet:Vn,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:Xn,ariaRowCount:Vn,ariaRowIndex:Vn,ariaRowSpan:Vn,ariaSelected:Gn,ariaSetSize:Vn,ariaSort:null,ariaValueMax:Vn,ariaValueMin:Vn,ariaValueNow:Vn,ariaValueText:null,role:null}}),ur=or({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:sr,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Kn,acceptCharset:Xn,accessKey:Xn,action:null,allow:null,allowFullScreen:Yn,allowPaymentRequest:Yn,allowUserMedia:Yn,alt:null,as:null,async:Yn,autoCapitalize:null,autoComplete:Xn,autoFocus:Yn,autoPlay:Yn,blocking:Xn,capture:null,charSet:null,checked:Yn,cite:null,className:Xn,cols:Vn,colSpan:null,content:null,contentEditable:Gn,controls:Yn,controlsList:Xn,coords:Vn|Kn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Yn,defer:Yn,dir:null,dirName:null,disabled:Yn,download:Wn,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Yn,formTarget:null,headers:Xn,height:Vn,hidden:Yn,high:Vn,href:null,hrefLang:null,htmlFor:Xn,httpEquiv:Xn,id:null,imageSizes:null,imageSrcSet:null,inert:Yn,inputMode:null,integrity:null,is:null,isMap:Yn,itemId:null,itemProp:Xn,itemRef:Xn,itemScope:Yn,itemType:Xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Yn,low:Vn,manifest:null,max:null,maxLength:Vn,media:null,method:null,min:null,minLength:Vn,multiple:Yn,muted:Yn,name:null,nonce:null,noModule:Yn,noValidate:Yn,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:Yn,optimum:Vn,pattern:null,ping:Xn,placeholder:null,playsInline:Yn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Yn,referrerPolicy:null,rel:Xn,required:Yn,reversed:Yn,rows:Vn,rowSpan:Vn,sandbox:Xn,scope:null,scoped:Yn,seamless:Yn,selected:Yn,shadowRootClonable:Yn,shadowRootDelegatesFocus:Yn,shadowRootMode:null,shape:null,size:Vn,sizes:null,slot:null,span:Vn,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Vn,step:null,style:null,tabIndex:Vn,target:null,title:null,translate:null,type:null,typeMustMatch:Yn,useMap:null,value:Gn,width:Vn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Xn,axis:null,background:null,bgColor:null,border:Vn,borderColor:null,bottomMargin:Vn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Yn,declare:Yn,event:null,face:null,frame:null,frameBorder:null,hSpace:Vn,leftMargin:Vn,link:null,longDesc:null,lowSrc:null,marginHeight:Vn,marginWidth:Vn,noResize:Yn,noHref:Yn,noShade:Yn,noWrap:Yn,object:null,profile:null,prompt:null,rev:null,rightMargin:Vn,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Vn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Vn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Yn,disableRemotePlayback:Yn,prefix:null,property:null,results:Vn,security:null,unselectable:null}}),dr=or({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:ar,properties:{about:Jn,accentHeight:Vn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Vn,amplitude:Vn,arabicForm:null,ascent:Vn,attributeName:null,attributeType:null,azimuth:Vn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Vn,by:null,calcMode:null,capHeight:Vn,className:Xn,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:Vn,diffuseConstant:Vn,direction:null,display:null,dur:null,divisor:Vn,dominantBaseline:null,download:Yn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Vn,enableBackground:null,end:null,event:null,exponent:Vn,externalResourcesRequired:null,fill:null,fillOpacity:Vn,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:Kn,g2:Kn,glyphName:Kn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Vn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Vn,horizOriginX:Vn,horizOriginY:Vn,id:null,ideographic:Vn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Vn,k:Vn,k1:Vn,k2:Vn,k3:Vn,k4:Vn,kernelMatrix:Jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Vn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Vn,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:Vn,overlineThickness:Vn,paintOrder:null,panose1:null,path:null,pathLength:Vn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Vn,pointsAtY:Vn,pointsAtZ:Vn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jn,rev:Jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jn,requiredFeatures:Jn,requiredFonts:Jn,requiredFormats:Jn,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:Vn,specularExponent:Vn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Vn,strikethroughThickness:Vn,string:null,stroke:null,strokeDashArray:Jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Vn,strokeOpacity:Vn,strokeWidth:null,style:null,surfaceScale:Vn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jn,tabIndex:Vn,tableValues:null,target:null,targetX:Vn,targetY:Vn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Vn,underlineThickness:Vn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Vn,values:null,vAlphabetic:Vn,vMathematical:Vn,vectorEffect:null,vHanging:Vn,vIdeographic:Vn,version:null,vertAdvY:Vn,vertOriginX:Vn,vertOriginY:Vn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Vn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),pr=/^data[-\w.:]+$/i,fr=/-[a-z]/g,hr=/[A-Z]/g;function gr(e){return"-"+e.toLowerCase()}function mr(e){return e.charAt(1).toUpperCase()}const vr={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"},br=Fn([ir,Ar,lr,cr,ur],"html"),wr=Fn([ir,Ar,lr,cr,dr],"svg");function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xr,Er,Br,Pr={};var Dr=function(){if(Br)return Pr;Br=1;var e=Pr&&Pr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),A="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;A?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(Er)return xr;Er=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,A=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,a=/^\s+|\s+$/g,s="";function l(e){return e?e.replace(a,s):s}return xr=function(a,c){if("string"!=typeof a)throw new TypeError("First argument must be a string");if(!a)return[];c=c||{};var u=1,d=1;function p(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=a,!c.silent)throw t}function m(e){var t=e.exec(a);if(t){var n=t[0];return p(n),a=a.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=f();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var t=2;s!=a.charAt(t)&&("*"!=a.charAt(t)||"/"!=a.charAt(t+1));)++t;if(t+=2,s===a.charAt(t-1))return g("End of comment missing");var n=a.slice(2,t-2);return d+=2,p(n),a=a.slice(t),d+=2,e({type:"comment",comment:n})}}function y(){var t=f(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var a=m(A),c=t({type:"declaration",property:l(n[0].replace(e,s)),value:a?l(a[0].replace(e,s)):s});return m(i),c}}return h.prototype.content=a,v(),function(){var e,t=[];for(b(t);e=y();)!1!==e&&(t.push(e),b(t));return t}()},xr}());return Pr}();const kr=yr(Dr),Cr=kr.default||kr,Sr=Tr("end"),Ir=Tr("start");function Tr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Qr(e){return e&&"object"==typeof e?"position"in e||"type"in e?Or(e.position):"start"in e||"end"in e?Or(e):"line"in e||"column"in e?Mr(e):"":""}function Mr(e){return Lr(e&&e.line)+":"+Lr(e&&e.column)}function Or(e){return Mr(e&&e.start)+"-"+Mr(e&&e.end)}function Lr(e){return e&&"number"==typeof e?e:1}class Nr extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},A=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(A=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const i=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=i?i.line:void 0,this.name=Qr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=A&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Nr.prototype.file="",Nr.prototype.name="",Nr.prototype.reason="",Nr.prototype.message="",Nr.prototype.stack="",Nr.prototype.column=void 0,Nr.prototype.line=void 0,Nr.prototype.ancestors=void 0,Nr.prototype.cause=void 0,Nr.prototype.fatal=void 0,Nr.prototype.place=void 0,Nr.prototype.ruleId=void 0,Nr.prototype.source=void 0;const Hr={}.hasOwnProperty,Rr=new Map,zr=/[A-Z]/g,jr=/-([a-z])/g,Fr=new Set(["table","tbody","thead","tfoot","tr"]),Ur=new Set(["td","th"]),qr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _r(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,A){const i=Array.isArray(o.children),a=Ir(n);return t(r,o,A,i,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,A){const i=Array.isArray(o.children)?n:t;return A?i(r,o,A):i(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?wr:br,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},A=Yr(o,e,void 0);return A&&"string"!=typeof A?A:o.create(e,o.Fragment,{children:A||void 0},void 0)}function Yr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=wr,e.schema=o),e.ancestors.push(t);const A=Kr(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Hr.call(t.properties,o)){const A=Xr(e,o,t.properties[o]);if(A){const[o,i]=A;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&Ur.has(t.tagName)?r=i:n[o]=i}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let a=Vr(e,t);return Fr.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&zn(e.value):zn(e)}(e)})),Gr(e,i,A,t),Wr(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Jr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=wr,e.schema=o),e.ancestors.push(t);const A=null===t.name?e.Fragment:Kr(e,t.name,!0),i=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const A=o.properties[0];A.type,Object.assign(n,e.evaluater.evaluateExpression(A.argument))}else Jr(e,t.position);else{const o=r.name;let A;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,A=e.evaluater.evaluateExpression(t.expression)}else Jr(e,t.position);else A=null===r.value||r.value;n[o]=A}return n}(e,t),a=Vr(e,t);return Gr(e,i,A,t),Wr(i,a),e.ancestors.pop(),e.schema=r,e.create(t,A,i,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Wr(r,Vr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Gr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Vr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Rr;for(;++r<t.children.length;){const A=t.children[r];let i;if(e.passKeys){const e="element"===A.type?A.tagName:"mdxJsxFlowElement"===A.type||"mdxJsxTextElement"===A.type?A.name:void 0;if(e){const t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}const a=Yr(e,A,i);void 0!==a&&n.push(a)}return n}function Xr(e,t,n){const r=function(e,t){const n=Un(t);let r=t,o=qn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&pr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(fr,mr);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!fr.test(e)){let n=e.replace(hr,gr);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=tr}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{Cr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Nr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=qr+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(jr,$r)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Hr.call(e,n)&&(t[Zr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?vr[r.property]||r.property:r.attribute,n]}}function Kr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Hn(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:!(!o||"Literal"!==t.type),optional:!1}:t}r=n}else r=Hn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Hr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Jr(e)}function Jr(e,t){const n=new Nr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=qr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Zr(e){let t=e.replace(zr,eo);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function $r(e,t){return t.toUpperCase()}function eo(e){return"-"+e.toLowerCase()}const to={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"]},no={};function ro(e,t,n){if(function(e){return!(!e||"object"!=typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return oo(e.children,t,n)}return Array.isArray(e)?oo(e,t,n):""}function oo(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ro(e[o],t,n);return r.join("")}const Ao=document.createElement("i");function io(e){const t="&"+e+";";Ao.innerHTML=t;const n=Ao.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function ao(e,t,n,r){const o=e.length;let A,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)A=Array.from(r),A.unshift(t,n),e.splice(...A);else for(n&&e.splice(t,n);i<r.length;)A=r.slice(i,i+1e4),A.unshift(t,0),e.splice(...A),i+=1e4,t+=1e4}function so(e,t){return e.length>0?(ao(e,e.length,0,t),e):t}const lo={}.hasOwnProperty;function co(e){const t={};let n=-1;for(;++n<e.length;)uo(t,e[n]);return t}function uo(e,t){let n;for(n in t){const r=(lo.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let A;if(o)for(A in o){lo.call(r,A)||(r[A]=[]);const e=o[A];po(r[A],Array.isArray(e)?e:e?[e]:[])}}}function po(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);ao(e,0,0,r)}function fo(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function ho(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const go=Co(/[A-Za-z]/),mo=Co(/[\dA-Za-z]/),vo=Co(/[#-'*+\--9=?A-Z^-~]/);function bo(e){return null!==e&&(e<32||127===e)}const wo=Co(/\d/),yo=Co(/[\dA-Fa-f]/),xo=Co(/[!-/:-@[-`{-~]/);function Eo(e){return null!==e&&e<-2}function Bo(e){return null!==e&&(e<0||32===e)}function Po(e){return-2===e||-1===e||32===e}const Do=Co(new RegExp("\\p{P}|\\p{S}","u")),ko=Co(/\s/);function Co(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function So(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const A=e.charCodeAt(n);let i="";if(37===A&&mo(e.charCodeAt(n+1))&&mo(e.charCodeAt(n+2)))o=2;else if(A<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(A))||(i=String.fromCharCode(A));else if(A>55295&&A<57344){const t=e.charCodeAt(n+1);A<56320&&t>56319&&t<57344?(i=String.fromCharCode(A,t),o=1):i="�"}else i=String.fromCharCode(A);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Io(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let A=0;return function(r){return Po(r)?(e.enter(n),i(r)):t(r)};function i(r){return Po(r)&&A++<o?(e.consume(r),i):(e.exit(n),t(r))}}const To={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Io(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):Eo(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const Qo={tokenize:function(e){const t=this,n=[];let r,o,A,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,s,l)(r)}return l(r)}function s(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,A=n;for(;A--;)if("exit"===t.events[A][0]&&"chunkFlow"===t.events[A][1].type){o=t.events[A][1].end;break}m(i);let a=n;for(;a<t.events.length;)t.events[a][1].end={...o},a++;return ao(t.events,A+1,0,t.events.slice(n)),t.events.length=a,l(e)}return a(e)}function l(o){if(i===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Mo,c,u)(o)}function c(e){return r&&v(),m(i),d(e)}function u(e){return t.parser.lazy[t.now().line]=i!==n.length,A=t.now().offset,f(e)}function d(n){return t.containerState={},e.attempt(Mo,p,f)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),d(e)}function f(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):Eo(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<A&&(!r.events[e][1].end||r.events[e][1].end.offset>A))return;const n=t.events.length;let o,a,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){if(o){a=t.events[s][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;ao(t.events,s+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Mo={tokenize:function(e,t,n){return Io(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Oo(e){return null===e||Bo(e)||ko(e)?1:Do(e)?2:void 0}function Lo(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const A=e[o].resolveAll;A&&!r.includes(A)&&(t=A(t,n),r.push(A))}return t}const No={name:"attention",resolveAll:function(e,t){let n,r,o,A,i,a,s,l,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};Ho(u,-a),Ho(d,a),A={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...A.start},end:{...i.end}},e[n][1].end={...A.start},e[c][1].start={...i.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=so(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=so(s,[["enter",r,t],["enter",A,t],["exit",A,t],["enter",o,t]]),s=so(s,Lo(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=so(s,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(l=2,s=so(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):l=0,ao(e,n-1,c-n+3,s),c=n+s.length-l-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Oo(r);let A;return function(t){return A=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===A)return e.consume(a),i;const s=e.exit("attentionSequence"),l=Oo(a),c=!l||2===l&&o||n.includes(a),u=!o||2===o&&l||n.includes(r);return s._open=!!(42===A?c:c&&(o||!u)),s._close=!!(42===A?u:u&&(l||!c)),t(a)}}};function Ho(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ro={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return go(t)?(e.consume(t),A):64===t?n(t):s(t)}function A(e){return 43===e||45===e||46===e||mo(e)?(r=1,i(e)):s(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||mo(t))&&r++<32?(e.consume(t),i):(r=0,s(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||bo(r)?n(r):(e.consume(r),a)}function s(t){return 64===t?(e.consume(t),l):vo(t)?(e.consume(t),s):n(t)}function l(e){return mo(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,l):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||mo(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const zo={partial:!0,tokenize:function(e,t,n){return function(t){return Po(t)?Io(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||Eo(e)?t(e):n(e)}}};const jo={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return Po(t)?Io(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(jo,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return Po(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Fo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return xo(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const Uo={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,A,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,A=mo,l(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,A=yo,l):(e.enter("characterReferenceValue"),o=7,A=wo,l(t))}function l(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return A!==mo||io(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return A(a)&&i++<o?(e.consume(a),l):n(a)}}};const qo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},_o={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s}function s(t){return e.enter("codeFencedFence"),Po(t)?Io(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===A?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===A?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),Po(t)?Io(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||Eo(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let A,i=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,A=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),s(t)}(t)};function s(t){return t===A?(a++,e.consume(t),s):a<3?n(t):(e.exit("codeFencedFenceSequence"),Po(t)?Io(e,l,"whitespace")(t):l(t))}function l(n){return null===n||Eo(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(qo,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||Eo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(t)):Po(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Io(e,u,"whitespace")(t)):96===t&&t===A?n(t):(e.consume(t),c)}function u(t){return null===t||Eo(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||Eo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(t)):96===t&&t===A?n(t):(e.consume(t),d)}function p(t){return e.attempt(o,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&Po(t)?Io(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||Eo(t)?e.check(qo,p,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||Eo(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Yo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),Io(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?A(e):n(e)}function A(t){return null===t?a(t):Eo(t)?e.attempt(Go,A,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||Eo(t)?(e.exit("codeFlowValue"),A(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Go={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):Io(e,A,"linePrefix",5)(t)}function A(e){const A=r.events[r.events.length-1];return A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(e):Eo(e)?o(e):n(e)}}};const Wo={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,A=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),A++,i):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,l(t)):Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),s(t))}function s(t){return null===t||32===t||96===t||Eo(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),s)}function l(n){return 96===n?(e.consume(n),r++,l):r===A?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",s(n))}}};class Vo{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Xo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Xo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Xo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Xo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Xo(this.left,t.reverse())}}}function Xo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ko(e){const t={};let n,r,o,A,i,a,s,l=-1;const c=new Vo(e);for(;++l<c.length;){for(;l in t;)l=t[l];if(n=c.get(l),l&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(l-1)[1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Jo(c,l)),l=t[l],s=!0);else if(n[1]._container){for(o=l,r=void 0;o--;)if(A=c.get(o),"lineEnding"===A[1].type||"lineEndingBlank"===A[1].type)"enter"===A[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),A[1].type="lineEnding",r=o);else if("linePrefix"!==A[1].type)break;r&&(n[1].end={...c.get(r)[1].start},i=c.slice(r,l),i.unshift(n),c.splice(r,l-r+1,i))}}return ao(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!s}function Jo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const A=[],i=n._tokenizer||r.parser[n.contentType](n.start),a=i.events,s=[],l={};let c,u,d=-1,p=n,f=0,h=0;const g=[h];for(;p;){for(;e.get(++o)[1]!==p;);A.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=n;++d<a.length;)"exit"===a[d][0]&&"enter"===a[d-1][0]&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(h=d+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),d=g.length;d--;){const t=a.slice(g[d],g[d+1]),n=A.pop();s.push([n,n+t.length-1]),e.splice(n,2,t)}for(s.reverse(),d=-1;++d<s.length;)l[f+s[d][0]]=f+s[d][1],f+=s[d][1]-s[d][0]-1;return l}const Zo={resolve:function(e){return Ko(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):Eo(t)?e.check($o,A,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function A(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},$o={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Io(e,o,"linePrefix")};function o(o){if(null===o||Eo(o))return n(o);const A=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&A&&"linePrefix"===A[1].type&&A[2].sliceSerialize(A[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function eA(e,t,n,r,o,A,i,a,s){const l=s||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(A),e.consume(t),e.exit(A),u):null===t||32===t||41===t||bo(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(A),e.consume(n),e.exit(A),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(a),u(t)):null===t||60===t||Eo(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(o){return c||null!==o&&41!==o&&!Bo(o)?c<l&&40===o?(e.consume(o),c++,f):41===o?(e.consume(o),c--,f):null===o||32===o||40===o||bo(o)?n(o):(e.consume(o),92===o?h:f):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function tA(e,t,n,r,o,A){const i=this;let a,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(A),l};function l(u){return s>999||null===u||91===u||93===u&&!a||94===u&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):93===u?(e.exit(A),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):Eo(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||Eo(t)||s++>999?(e.exit("chunkString"),l(t)):(e.consume(t),a||(a=!Po(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function nA(e,t,n,r,o,A){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,a):n(t)};function a(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(A),s(n))}function s(t){return t===i?(e.exit(A),a(i)):null===t?n(t):Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Io(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(t))}function l(t){return t===i||null===t||Eo(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:l)}function c(t){return t===i||92===t?(e.consume(t),l):l(t)}}function rA(e,t){let n;return function r(o){return Eo(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Po(o)?Io(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const oA={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return tA.call(r,e,A,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function A(t){return o=ho(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return Bo(t)?rA(e,a)(t):a(t)}function a(t){return eA(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(AA,l,l)(t)}function l(t){return Po(t)?Io(e,c,"whitespace")(t):c(t)}function c(A){return null===A||Eo(A)?(e.exit("definition"),r.parser.defined.push(o),t(A)):n(A)}}},AA={partial:!0,tokenize:function(e,t,n){return function(t){return Bo(t)?rA(e,r)(t):n(t)};function r(t){return nA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return Po(t)?Io(e,A,"whitespace")(t):A(t)}function A(e){return null===e||Eo(e)?t(e):n(e)}}};const iA={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return Eo(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const aA={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,A=3;return"whitespace"===e[A][1].type&&(A+=2),o-2>A&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(A===o-1||o-4>A&&"whitespace"===e[o-2][1].type)&&(o-=A+1===o?2:4),o>A&&(n={type:"atxHeadingText",start:e[A][1].start,end:e[o][1].end},r={type:"chunkText",start:e[A][1].start,end:e[o][1].end,contentType:"text"},ao(e,A,o-A+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||Bo(t)?(e.exit("atxHeadingSequence"),A(t)):n(t)}function A(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||Eo(n)?(e.exit("atxHeading"),t(n)):Po(n)?Io(e,A,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),A(t))}function a(t){return null===t||35===t||Bo(t)?(e.exit("atxHeadingText"),A(t)):(e.consume(t),a)}}};const sA=["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"],lA=["pre","script","style","textarea"],cA={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let o,A,i,a,s;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),l}(t)};function l(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),A=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:O):go(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function c(A){return 45===A?(e.consume(A),o=2,u):91===A?(e.consume(A),o=5,a=0,d):go(A)?(e.consume(A),o=4,r.interrupt?t:O):n(A)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const A="CDATA[";return o===A.charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:D:d):n(o)}function p(t){return go(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||Bo(a)){const s=47===a,l=i.toLowerCase();return s||A||!lA.includes(l)?sA.includes(i.toLowerCase())?(o=6,s?(e.consume(a),h):r.interrupt?t(a):D(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):A?g(a):m(a)):(o=1,r.interrupt?t(a):D(a))}return 45===a||mo(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:D):n(o)}function g(t){return Po(t)?(e.consume(t),g):B(t)}function m(t){return 47===t?(e.consume(t),B):58===t||95===t||go(t)?(e.consume(t),v):Po(t)?(e.consume(t),m):B(t)}function v(t){return 45===t||46===t||58===t||95===t||mo(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):Po(t)?(e.consume(t),b):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,y):Po(t)?(e.consume(t),w):x(t)}function y(t){return t===s?(e.consume(t),s=null,E):null===t||Eo(t)?n(t):(e.consume(t),y)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Bo(t)?b(t):(e.consume(t),x)}function E(e){return 47===e||62===e||Po(e)?m(e):n(e)}function B(t){return 62===t?(e.consume(t),P):n(t)}function P(t){return null===t||Eo(t)?D(t):Po(t)?(e.consume(t),P):n(t)}function D(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!Eo(t)||6!==o&&7!==o?null===t||Eo(t)?(e.exit("htmlFlowData"),k(t)):(e.consume(t),D):(e.exit("htmlFlowData"),e.check(uA,N,k)(t))}function k(t){return e.check(dA,C,N)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||Eo(t)?k(t):(e.enter("htmlFlowData"),D(t))}function I(t){return 45===t?(e.consume(t),O):D(t)}function T(t){return 47===t?(e.consume(t),i="",Q):D(t)}function Q(t){if(62===t){const n=i.toLowerCase();return lA.includes(n)?(e.consume(t),L):D(t)}return go(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):D(t)}function M(t){return 93===t?(e.consume(t),O):D(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):D(t)}function L(t){return null===t||Eo(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),L)}function N(n){return e.exit("htmlFlow"),t(n)}}},uA={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(zo,t,n)}}},dA={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return Eo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const pA={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,A,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),w):63===t?(e.consume(t),v):go(t)?(e.consume(t),E):n(t)}function s(t){return 45===t?(e.consume(t),l):91===t?(e.consume(t),A=0,p):go(t)?(e.consume(t),m):n(t)}function l(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):Eo(t)?(i=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(A++)?(e.consume(t),6===A?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):Eo(t)?(i=f,Q(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):f(t)}function m(t){return null===t||62===t?T(t):Eo(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):Eo(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?T(e):v(e)}function w(t){return go(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||mo(t)?(e.consume(t),y):x(t)}function x(t){return Eo(t)?(i=x,Q(t)):Po(t)?(e.consume(t),x):T(t)}function E(t){return 45===t||mo(t)?(e.consume(t),E):47===t||62===t||Bo(t)?B(t):n(t)}function B(t){return 47===t?(e.consume(t),T):58===t||95===t||go(t)?(e.consume(t),P):Eo(t)?(i=B,Q(t)):Po(t)?(e.consume(t),B):T(t)}function P(t){return 45===t||46===t||58===t||95===t||mo(t)?(e.consume(t),P):D(t)}function D(t){return 61===t?(e.consume(t),k):Eo(t)?(i=D,Q(t)):Po(t)?(e.consume(t),D):B(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,C):Eo(t)?(i=k,Q(t)):Po(t)?(e.consume(t),k):(e.consume(t),S)}function C(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):Eo(t)?(i=C,Q(t)):(e.consume(t),C)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Bo(t)?B(t):(e.consume(t),S)}function I(e){return 47===e||62===e||Bo(e)?B(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return Po(t)?Io(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}};const fA={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&ao(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,A,i=e.length,a=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=i);const s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[o-2][1].start}};return A=[["enter",s,t],["enter",l,t]],A=so(A,e.slice(r+1,r+a+3)),A=so(A,[["enter",c,t]]),A=so(A,Lo(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),A=so(A,[["exit",c,t],e[o-2],e[o-1],["exit",l,t]]),A=so(A,e.slice(o+1)),A=so(A,[["exit",s,t]]),ao(e,r,e.length,A),e},tokenize:function(e,t,n){const r=this;let o,A,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?c(t):(A=r.parser.defined.includes(ho(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(hA,l,A?l:c)(t):91===t?e.attempt(gA,l,A?s:c)(t):A?l(t):c(t)}function s(t){return e.attempt(mA,l,c)(t)}function l(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},hA={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return Bo(t)?rA(e,o)(t):o(t)}function o(t){return 41===t?l(t):eA(e,A,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function A(t){return Bo(t)?rA(e,a)(t):l(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?nA(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):l(t)}function s(t){return Bo(t)?rA(e,l)(t):l(t)}function l(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},gA={tokenize:function(e,t,n){const r=this;return function(t){return tA.call(r,e,o,A,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(ho(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function A(e){return n(e)}}},mA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const vA={name:"labelStartImage",resolveAll:fA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),A):n(t)}function A(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const bA={name:"labelStartLink",resolveAll:fA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const wA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Io(e,t,"linePrefix")}}};const yA={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,A(e)}(t)};function A(A){return A===r?(e.enter("thematicBreakSequence"),i(A)):o>=3&&(null===A||Eo(A))?(e.exit("thematicBreak"),t(A)):n(A)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),Po(t)?Io(e,A,"whitespace")(t):A(t))}}};const xA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zo,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Io(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!Po(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(BA,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Io(e,e.attempt(xA,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let A=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:wo(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(yA,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return wo(t)&&++i<10?(e.consume(t),a):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),s(t)):n(t)}function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(zo,r.interrupt?n:l,e.attempt(EA,u,c))}function l(e){return r.containerState.initialBlankLine=!0,A++,u(e)}function c(t){return Po(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=A+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},EA={partial:!0,tokenize:function(e,t,n){const r=this;return Io(e,function(e){const o=r.events[r.events.length-1];return!Po(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},BA={partial:!0,tokenize:function(e,t,n){const r=this;return Io(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const PA={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,A=e.length;for(;A--;)if("enter"===e[A][0]){if("content"===e[A][1].type){n=A;break}"paragraph"===e[A][1].type&&(r=A)}else"content"===e[A][1].type&&e.splice(A,1),!o&&"definition"===e[A][1].type&&(o=A);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let i,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),A(t)}(t))};function A(t){return t===o?(e.consume(t),A):(e.exit("setextHeadingLineSequence"),Po(t)?Io(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||Eo(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const DA={tokenize:function(e){const t=this,n=e.attempt(zo,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,Io(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Zo,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const kA={resolveAll:TA()},CA=IA("string"),SA=IA("text");function IA(e){return{resolveAll:TA("text"===e?QA:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,A,i);return A;function A(e){return s(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function s(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function TA(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):(!t[o]||"data"!==t[o][1].type)&&(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function QA(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let A,i=o.length,a=-1,s=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)s++,a--;if(a)break;a=-1}else if(-2===e)A=!0,s++;else if(-1!==e){i++;break}}if(s){const o={type:n===e.length||A||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const MA={42:xA,43:xA,45:xA,48:xA,49:xA,50:xA,51:xA,52:xA,53:xA,54:xA,55:xA,56:xA,57:xA,62:jo},OA={91:oA},LA={[-2]:Yo,[-1]:Yo,32:Yo},NA={35:aA,42:yA,45:[PA,yA],60:cA,61:PA,95:yA,96:_o,126:_o},HA={38:Uo,92:Fo},RA={[-5]:wA,[-4]:wA,[-3]:wA,33:vA,38:Uo,42:No,60:[Ro,pA],91:bA,92:[iA,Fo],93:fA,95:No,96:Wo},zA={null:[No,kA]},jA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:OA,disable:{null:[]},document:MA,flow:NA,flowInitial:LA,insideSpan:zA,string:HA,text:RA},Symbol.toStringTag,{value:"Module"}));function FA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},A=[];let i=[],a=[];const s={attempt:h(function(e,t){g(e,t.from)}),check:h(f),consume:function(e){Eo(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),l.events.push(["enter",n,l]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=d(),l.events.push(["exit",t,l]),t},interrupt:h(f,{interrupt:!0})},l={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,m()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const A=e[n];let i;if("string"==typeof A)i=A;else switch(A){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(A)}o=-2===A,r.push(i)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){return i=so(i,e),function(){let e;for(;r._index<i.length;){const t=i[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}(),null!==i[i.length-1]?[]:(g(t,0),l.events=Lo(A,l.events,l),l.events)}};let c=t.tokenize.call(l,s);return t.resolveAll&&A.push(t),l;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,A=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,A)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}A>0&&i.push(e[o].slice(0,A))}return i}(i,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:A}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:A}}function p(e){c=c(e)}function f(e,t){t.restore()}function h(e,t){return function(n,o,A){let i,c,u,p;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return i=e,c=0,0===e.length?A:h(e[c])}function h(e){return function(n){return p=function(){const e=d(),t=l.previous,n=l.currentConstruct,o=l.events.length,A=Array.from(a);return{from:o,restore:i};function i(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=o,a=A,m()}}(),u=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(l),t):l,s,g,v)(n)}}function g(t){return e(u,p),o}function v(e){return p.restore(),++c<i.length?h(i[c]):A}}}function g(e,t){e.resolveAll&&!A.includes(e)&&A.push(e),e.resolve&&ao(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const UA=/[\0\t\n\r]/g;const qA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _A(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return fo(n.slice(t?2:1),t?16:10)}return io(n)||e}const YA={}.hasOwnProperty;function GA(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:A(te),autolinkProtocol:P,autolinkEmail:P,atxHeading:A(J),blockQuote:A(G),characterEscape:P,characterReference:P,codeFenced:A(W),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:A(W,i),codeText:A(V,i),codeTextData:P,data:P,codeFlowValue:P,definition:A(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:A(K),hardBreakEscape:A(Z),hardBreakTrailing:A(Z),htmlFlow:A($,i),htmlFlowData:P,htmlText:A($,i),htmlTextData:P,image:A(ee),label:i,link:A(te),listItem:A(re),listItemValue:d,listOrdered:A(ne,u),listUnordered:A(ne),paragraph:A(oe),reference:z,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:A(J),strong:A(Ae),thematicBreak:A(ae)},exit:{atxHeading:s(),atxHeadingSequence:y,autolink:s(),autolinkEmail:Y,autolinkProtocol:_,blockQuote:s(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:F,characterReferenceMarkerNumeric:F,characterReferenceValue:U,characterReference:q,codeFenced:s(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:D,codeIndented:s(m),codeText:s(T),codeTextData:D,data:D,definition:s(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:s(),hardBreakEscape:s(C),hardBreakTrailing:s(C),htmlFlow:s(S),htmlFlowData:D,htmlText:s(I),htmlTextData:D,image:s(M),label:L,labelText:O,lineEnding:k,link:s(Q),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:j,resourceDestinationString:N,resourceTitleString:H,resource:R,setextHeading:s(B),setextHeadingLineSequence:E,setextHeadingText:x,strong:s(),thematicBreak:s()}};VA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const A={stack:[r],tokenStack:[],config:t,enter:a,exit:l,buffer:i,resume:c,data:n},s=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])s.push(u);else{u=o(e,s.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];YA.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},A),e[u][1])}if(A.tokenStack.length>0){const e=A.tokenStack[A.tokenStack.length-1];(e[1]||KA).call(A,void 0,e[0])}for(r.position={start:WA(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:WA(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,A,i,a=t-1,s=-1,l=!1;for(;++a<=n;){const t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!i&&!s&&!A&&(A=a),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=a;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",l=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}A&&(!o||A<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(a,0,["enter",o,t[2]]),a++,n++,A=void 0,i=!0}}}return e[t][1]._spread=l,n}function A(e,t){return n;function n(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:WA(t.start),end:void 0}}function s(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Qr({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||KA).call(this,e,r[0])),n.position.end=WA(e.end)}function c(){return function(e){return ro(e,"boolean"!=typeof no.includeImageAlt||no.includeImageAlt,"boolean"!=typeof no.includeHtml||no.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ho(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function y(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=ie(),n.position={start:WA(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=WA(e.end)}function k(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=WA(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(P.call(this,e),D.call(this,e))}function C(){this.data.atHardBreak=!0}function S(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(qA,_A)}(t),n.identifier=ho(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function N(){const e=this.resume();this.stack[this.stack.length-1].url=e}function H(){const e=this.resume();this.stack[this.stack.length-1].title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function j(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ho(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function F(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=fo(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=io(t);this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=WA(e.end)}function _(e){D.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function Y(e){D.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function V(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function Ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Ko(e););return e}(function(e){const t={constructs:co([jA,...(e||{}).extensions||[]]),content:n(To),defined:[],document:n(Qo),flow:n(DA),lazy:{},string:n(CA),text:n(SA)};return t;function n(e){return function(n){return FA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,A,i){const a=[];let s,l,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(A||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(UA.lastIndex=c,s=UA.exec(o),u=s&&void 0!==s.index?s.index:o.length,d=o.charCodeAt(u),!s){n=o.slice(c);break}if(10===d&&c===u&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),c<u&&(a.push(o.slice(c,u)),t+=u-c),d){case 0:a.push(65533),t++;break;case 9:for(l=4*Math.ceil(t/4),a.push(-2);t++<l;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function WA(e){return{line:e.line,column:e.column,offset:e.offset}}function VA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?VA(e,r):XA(e,r)}}function XA(e,t){let n;for(n in t)if(YA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function KA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is still open")}function JA(e){const t=this;t.parser=function(n){return GA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZA(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),A=o[0];A&&"text"===A.type?A.value="["+A.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function $A(e){return e.spread??e.children.length>1}function ei(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const A=[];for(;r;)A.push(ti(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return A.push(ti(t.slice(o),o>0,!1)),A.join("")}function ti(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const ni={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=So(r.toLowerCase()),A=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);void 0===a?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=A+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,l),e.applyData(t,l)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZA(e,t);const o={src:So(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,A),e.applyData(t,A)},image:function(e,t){const n={src:So(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ZA(e,t);const o={href:So(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const A={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,A),e.applyData(t,A)},link:function(e,t){const n={href:So(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=$A(n[r])}return t}(n):$A(t),A={},i=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),A.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const s=r[r.length-1];s&&(o||"element"!==s.type||"p"!==s.tagName)&&i.push({type:"text",value:"\n"});const l={type:"element",tagName:"li",properties:A,children:i};return e.patch(t,l),e.applyData(t,l)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const A={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,A),e.applyData(t,A)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},A=Ir(t.children[1]),i=Sr(t.children[t.children.length-1]);A&&i&&(r.position={start:A,end:i}),o.push(r)}const A={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,A),e.applyData(t,A)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",A=n&&"table"===n.type?n.align:void 0,i=A?A.length:t.children.length;let a=-1;const s=[];for(;++a<i;){const n=t.children[a],r={},i=A?A[a]:void 0;i&&(r.align=i);let l={type:"element",tagName:o,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),s.push(l)}const l={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)},text:function(e,t){const n={type:"text",value:ei(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:ri,yaml:ri,definition:ri,footnoteDefinition:ri};function ri(){}const oi="object"==typeof self?self:globalThis,Ai=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[A,i]=t[o];switch(A){case 0:case-1:return n(i,o);case 1:{const e=n([],o);for(const t of i)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),o);case 4:{const{source:e,flags:t}=i;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of i)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of i)e.add(r(t));return e}case 7:{const{name:e,message:t}=i;return n(new oi[e](t),o)}case 8:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new oi[A](i),o)};return r})(new Map,e)(0),ii="",{toString:ai}={},{keys:si}=Object,li=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=ai.call(e).slice(8,-1);switch(n){case"Array":return[1,ii];case"Object":return[2,ii];case"Date":return[3,ii];case"RegExp":return[4,ii];case"Map":return[5,ii];case"Set":return[6,ii];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},ci=([e,t])=>0===e&&("function"===t||"symbol"===t),ui=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},A=r=>{if(n.has(r))return n.get(r);let[i,a]=li(r);switch(i){case 0:{let t=r;switch(a){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),o([a,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(A(t));return t}case 2:{if(a)switch(a){case"BigInt":return o([a,r.toString()],r);case"Boolean":case"Number":case"String":return o([a,r.valueOf()],r)}if(t&&"toJSON"in r)return A(r.toJSON());const n=[],s=o([i,n],r);for(const t of si(r))(e||!ci(li(r[t])))&&n.push([A(t),A(r[t])]);return s}case 3:return o([i,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([i,{source:e,flags:t}],r)}case 5:{const t=[],n=o([i,t],r);for(const[n,o]of r)(e||!ci(li(n))&&!ci(li(o)))&&t.push([A(n),A(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!ci(li(n)))&&t.push(A(n));return n}}const{message:s}=r;return o([i,{name:a,message:s}],r)};return A})(!(t||n),!!t,new Map,r)(e),r},di="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Ai(ui(e,t)):structuredClone(e):(e,t)=>Ai(ui(e,t));function pi(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fi(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const hi=function(e){if(null==e)return mi;if("function"==typeof e)return gi(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=hi(e[n]);return gi(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return gi(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return gi(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function gi(e){return function(t,n,r){return!(!function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)||!e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function mi(){return!0}const vi=[],bi=!0,wi=!1;function yi(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const A=hi(o),i=r?-1:1;!function e(o,a,s){const l=o&&"object"==typeof o?o:{};if("string"==typeof l.type){const e="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let l,c,u,d=vi;if((!t||A(o,a,s[s.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[bi,e]:null==e?vi:[e]}(n(o,s)),d[0]===wi))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+i,u=s.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(l=e(n,c,u)(),l[0]===wi)return l;c="number"==typeof l[1]?l[1]:c+i}}return d}}(e,void 0,[])()}function xi(e,t,n,r){let o,A,i;"function"==typeof t?(A=void 0,i=t,o=n):(A=t,i=n,o=r),yi(e,A,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return i(e,r,n)},o)}const Ei={}.hasOwnProperty,Bi={};function Pi(e,t){const n=t||Bi,r=new Map,o=new Map,A=new Map,i={...ni,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=a.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=Ii(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=Ii(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:ki,definitionById:r,footnoteById:o,footnoteCounts:A,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=a.handlers[n];if(Ei.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=di(n);return r.children=a.all(e),r}return di(e)}return(a.options.unknownHandler||Ci)(a,e,t)},options:n,patch:Di,wrap:Si};return xi(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a}function Di(e,t){e.position&&(t.position=function(e){const t=Ir(e),n=Sr(e);if(t&&n)return{start:t,end:n}}(e))}function ki(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,di(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function Ci(e,t){const n=t.data||{},r=!("value"in t)||Ei.call(n,"hProperties")||Ei.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function Si(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function Ii(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ti(e,t){const n=Pi(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pi,r=e.options.footnoteBackLabel||fi,o=e.options.footnoteLabel||"Footnotes",A=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let s=-1;for(;++s<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[s]);if(!o)continue;const A=e.all(o),i=String(o.identifier).toUpperCase(),l=So(i.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+l+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=A[A.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else A.push(...u);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+l},children:e.wrap(A,!0)};e.patch(o,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:A,properties:{...di(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),A=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&A.children.push({type:"text",value:"\n"},o),A}function Qi(e,t){return e&&"run"in e?async function(n,r){const o=Ti(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ti(n,{file:r,...e||t})}}function Mi(e){if(e)throw e}var Oi,Li;var Ni=function(){if(Li)return Oi;Li=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},A=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),A=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!A)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},i=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Oi=function e(){var t,n,r,s,l,c,u=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<p;++d)if(null!=(t=arguments[d]))for(n in t)r=a(u,n),u!==(s=a(t,n))&&(f&&s&&(A(s)||(l=o(s)))?(l?(l=!1,c=r&&o(r)?r:[]):c=r&&A(r)?r:{},i(u,{name:n,newValue:e(f,c,s)})):typeof s<"u"&&i(u,{name:n,newValue:s}));return u},Oi}();const Hi=yr(Ni);function Ri(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function zi(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(A,...i){const a=e[++n];let s=-1;if(A)r(A);else{for(;++s<t.length;)(null===i[s]||void 0===i[s])&&(i[s]=t[s]);t=i,a?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let i;r&&t.push(o);try{i=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(i&&i.then&&"function"==typeof i.then?i.then(A,o):i instanceof Error?o(i):A(i))}function o(e,...r){n||(n=!0,t(e,...r))}function A(e){o(null,e)}}(a,o)(...i):r(null,...i)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const ji={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Fi(e);let n,r=0,o=-1,A=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else o<0&&(n=!0,o=A+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,a=t.length-1;for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else i<0&&(n=!0,i=A+1),a>-1&&(e.codePointAt(A)===t.codePointAt(a--)?a<0&&(o=A):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Fi(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Fi(e);let t,n=e.length,r=-1,o=0,A=-1,i=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?A<0?A=n:1!==i&&(i=1):A>-1&&(i=-1);else if(t){o=n+1;break}}return A<0||r<0||0===i||1===i&&A===r-1&&A===o+1?"":e.slice(A,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Fi(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Fi(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",A=0,i=-1,a=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else{if(47===n)break;n=47}if(47===n){if(i!==s-1&&1!==a)if(i!==s-1&&2===a){if(o.length<2||2!==A||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",A=0):(o=o.slice(0,r),A=o.length-1-o.lastIndexOf("/")),i=s,a=0;continue}}else if(o.length>0){o="",A=0,i=s,a=0;continue}t&&(o=o.length>0?o+"/..":"..",A=2)}else o.length>0?o+="/"+e.slice(i+1,s):o=e.slice(i+1,s),A=s-i-1;i=s,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0===n.length&&!t&&(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function Fi(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ui={cwd:function(){return"/"}};function qi(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function _i(e){if("string"==typeof e)e=new URL(e);else if(!qi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Yi=["history","path","basename","stem","extname","dirname"];class Gi{constructor(e){let t;var n;t=e?qi(e)?{path:e}:"string"==typeof e||(n=e)&&"object"==typeof n&&"byteLength"in n&&"byteOffset"in n?{value:e}:e:{},this.cwd="cwd"in t?"":Ui.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Yi.length;){const e=Yi[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Yi.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?ji.basename(this.path):void 0}set basename(e){Vi(e,"basename"),Wi(e,"basename"),this.path=ji.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?ji.dirname(this.path):void 0}set dirname(e){Xi(this.basename,"dirname"),this.path=ji.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?ji.extname(this.path):void 0}set extname(e){if(Wi(e,"extname"),Xi(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ji.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){qi(e)&&(e=_i(e)),Vi(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?ji.basename(this.path,this.extname):void 0}set stem(e){Vi(e,"stem"),Wi(e,"stem"),this.path=ji.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Nr(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Wi(e,t){if(e&&e.includes(ji.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ji.sep+"`")}function Vi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Xi(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Ki=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Ji={}.hasOwnProperty;class Zi extends Ki{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=zi()}copy(){const e=new Zi;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Hi(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(na("data",this.frozen),this.namespace[e]=t,this):Ji.call(this.namespace,e)&&this.namespace[e]||void 0:e?(na("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Aa(e),n=this.parser||this.Parser;return ea("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),ea("process",this.parser||this.Parser),ta("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const A=Aa(e),i=n.parse(A);function a(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(i,A,function(e,t,r){if(e||!t||!r)return a(e);const o=t,A=n.stringify(o,r);var i;"string"==typeof(i=A)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(i)?r.value=A:r.result=A,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),ea("processSync",this.parser||this.Parser),ta("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,Mi(e),t=r}),oa("processSync","process",n),t}run(e,t,n){ra(e),this.freeze();const r=this.transformers;return!n&&"function"==typeof t&&(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,A){const i=Aa(t);r.run(e,i,function(t,r,i){const a=r||e;t?A(t):o?o(a):n(void 0,a,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){Mi(e),n=t,r=!0}),oa("runSync","run",r),n}stringify(e,t){this.freeze();const n=Aa(t),r=this.compiler||this.Compiler;return ta("stringify",r),ra(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(na("use",this.frozen),null!=e)if("function"==typeof e)a(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?i(e):A(e)}return this;function o(e){if("function"==typeof e)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(t,n)}else A(e)}}function A(e){if(!("plugins"in e)&&!("settings"in e))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");i(e.plugins),e.settings&&(r.settings=Hi(!0,r.settings,e.settings))}function i(e){let t=-1;if(null!=e){if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function a(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...A]=t;const i=n[o][1];Ri(i)&&Ri(r)&&(r=Hi(!0,i,r)),n[o]=[e,r,...A]}}}}const $i=(new Zi).freeze();function ea(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function ta(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function na(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ra(e){if(!Ri(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function oa(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Aa(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Gi(e)}const ia=[],aa={allowDangerousHtml:!0},sa=/^(https?|ircs?|mailto|xmpp)$/i,la=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ca(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,A=e.components,i=e.disallowedElements,a=e.rehypePlugins||ia,s=e.remarkPlugins||ia,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...aa}:aa,c=e.skipHtml,u=e.unwrapDisallowed,d=e.urlTransform||ua,p=$i().use(JA).use(s).use(Qi,l).use(a),f=new Gi;"string"==typeof r&&(f.value=r);for(const t of la)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const v=p.parse(f);let b=p.runSync(v,f);return o&&(b={type:"element",tagName:"div",properties:{className:o},children:"root"===b.type?b.children:[b]}),xi(b,function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return c?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in to)if(Object.hasOwn(to,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=to[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let A=t?!t.includes(e.tagName):!!i&&i.includes(e.tagName);if(!A&&n&&"number"==typeof r&&(A=!n(e,r,o)),A&&o&&"number"==typeof r)return u&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}}),_r(b,{Fragment:m,components:A,ignoreInvalidStyle:!0,jsx:h,jsxs:g,passKeys:!0,passNode:!0})}function ua(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||sa.test(e.slice(0,t))?e:""}const da=({children:e})=>h("div",{style:{whiteSpace:"normal"},children:h(ca,{components:{p:({...e})=>h("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>h("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>h("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>h("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?h("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):h("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:h("code",{children:t})}),blockquote:({...e})=>h("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),pa={autoConfig:!0},fa=e=>()=>(e=>{const{getFlow:t}=Zt(),{messages:n,replaceMessages:r}=$t(),{settings:o}=tn(),{hasChatHistoryLoaded:A}=rn(),i={...e,...pa},a=i.markdownComponent?i.markdownComponent:da;s(()=>{var e,t;if(A){const A=[...n];for(let n=0;n<A.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=A[n];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=a)}r(A)}},[A]);const l=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,t(),r)&&(e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};en(X.PRE_INJECT_MESSAGE,l),en(X.CHUNK_STREAM_MESSAGE,l),en(X.START_STREAM_MESSAGE,l),en(X.START_SIMULATE_STREAM_MESSAGE,l);const c={name:"@rcb-plugins/markdown-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(e),ha={autoConfig:!0,promptBaseColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"},promptHoveredColors:{info:"#0056b3",warning:"#d39e00",error:"#c82333",success:"#218838"},textAreaHighlightColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"}},ga=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const A=o[n];return"function"==typeof A?A:void 0},ma=e=>{const{showToast:t}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=lt();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:n}=Zt(),{styles:r,updateStyles:o,replaceStyles:A}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=Ut();return{styles:e,replaceStyles:t,updateStyles:n}})(),l=(e=>({...ha,...e,promptBaseColors:{...ha.promptBaseColors},promptHoveredColors:{...ha.promptHoveredColors},textAreaHighlightColors:{...ha.textAreaHighlightColors}}))(e),[c,u]=a(0),d=i({});en(X.USER_SUBMIT_TEXT,e=>{const A=e,i=ga(A,n(),"validateTextInput");if(!i)return;const a=i(A.data.inputText);if(null!=a&&a.success||e.preventDefault(),!a.promptContent)return;0===c&&(d.current=structuredClone(r));const s=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(a,l);o(s),t(a.promptContent,a.promptDuration??3e3),u(e=>e+1)}),en(X.USER_UPLOAD_FILE,e=>{var r,o;const A=e,i=null==(o=null==(r=A.data)?void 0:r.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const a=ga(A,n(),"validateFileInput");if(!a)return void console.error("Validator not found for file input.");const s=a(i);if(!s.success)return console.error("Validation failed:",s),s.promptContent&&t(s.promptContent,s.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",s)}),en(X.DISMISS_TOAST,()=>{u(e=>e-1)}),s(()=>{0===c&&setTimeout(()=>{A(d.current)})},[c,A]);const p={name:"@rcb-plugins/input-validator"};return l.autoConfig&&(p.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),p},va=n((e,t)=>{let{embedded:n,currentOpen:r,enabled:o,onSetEnabled:A}=e;const a=$t(),l=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=ne();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),c=i(null),u=i(!1);return s(()=>{!n&&l&&l.toggleChatWindow&&(c.current===r||u.current||(setTimeout(()=>{l&&l.toggleChatWindow&&l.toggleChatWindow(r)},0),c.current=r),u.current=!1)},[r,n,l]),s(()=>{const e=()=>{u.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),p(t,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!n&&l&&l.toggleChatWindow&&l.toggleChatWindow(!0)},closeChat:()=>{!n&&l&&l.toggleChatWindow&&l.toggleChatWindow(!1)},toggleChat:()=>{!n&&l&&l.toggleChatWindow&&l.toggleChatWindow()},setBotEnabled:e=>{A&&A(e)}}),[a,l,n,A]),null});va.displayName="BotController";const ba=e=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:A=!1}=e;const i=A?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return t.createElement(t.Fragment,null,A&&t.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),t.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"qa-bot-login-button ".concat(A?"qa-bot-header-login-button":""," ").concat(r),style:Object.assign(Object.assign({},i),o)},"Log In"))},wa=()=>t.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},t.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.createElement("circle",{cx:"12",cy:"7",r:"4"}))),ya=[];for(let e=0;e<256;++e)ya.push((e+256).toString(16).slice(1));let xa;const Ea=new Uint8Array(16);var Ba={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pa(e,t,n){if(Ba.randomUUID&&!e)return Ba.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!xa){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");xa=crypto.getRandomValues.bind(crypto)}return xa(Ea)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(ya[e[t+0]]+ya[e[t+1]]+ya[e[t+2]]+ya[e[t+3]]+"-"+ya[e[t+4]]+ya[e[t+5]]+"-"+ya[e[t+6]]+ya[e[t+7]]+"-"+ya[e[t+8]]+ya[e[t+9]]+"-"+ya[e[t+10]]+ya[e[t+11]]+ya[e[t+12]]+ya[e[t+13]]+ya[e[t+14]]+ya[e[t+15]]).toLowerCase()}(r)}function Da(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const ka="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",Ca="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",Sa="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",Ia="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",Ta="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",Qa=()=>{Da()&&console.log("%c QA Bot Core %c v".concat("0.2.11-rc.0"," "),Ia,Ta)},Ma=function(e){if(Da()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[Session]%c ".concat(e),ka,"",...n)}},Oa=function(e){if(Da()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[History]%c ".concat(e),Ca,"",...n)}},La=(e,t)=>{Da()&&console.log("%c[Message]%c ".concat(e),Sa,"",t)},Na=function(){console.warn(...arguments)},Ha=function(){console.error(...arguments)},Ra="qa_bot_session_messages",za=()=>"qa_bot_session_".concat(Pa()),ja=()=>{try{const e=localStorage.getItem(Ra);return e?JSON.parse(e):{}}catch(e){return{}}},Fa=(e,t,n,r,o)=>{const A=ja();!A[e]&&(A[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},Oa("NEW session created",{sessionId:e.slice(-12)}));if(A[e].messages.some(e=>e.id===t))return void Oa("DUPLICATE message skipped",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r});const i={id:t,content:n,sender:r,type:o,timestamp:Date.now()};A[e].messages.push(i),Oa("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:A[e].messages.length});const a=A[e].messages,s=a.find(e=>{var t;return"bot"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())&&e.content.length>=100});if(s){const t=s.content;A[e].preview=t.slice(0,50)+(t.length>50?"...":"")}else{const t=a.find(e=>{var t;return"user"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())});if(t&&!A[e].preview){const n=t.content;A[e].preview=n.slice(0,50)+(n.length>50?"...":"")}}(e=>{var t;const n=()=>Object.values(e).reduce((e,t)=>e+t.messages.length,0);for(;n()>100&&Object.keys(e).length>1;){const n=null===(t=Object.entries(e).sort((e,t)=>{let[,n]=e,[,r]=t;return new Date(n.startedAt).getTime()-new Date(r.startedAt).getTime()})[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(Ra,JSON.stringify(e))})(A),Oa("STORAGE state",{ourSessions:Object.keys(A).length,ourTotalMessages:Object.values(A).reduce((e,t)=>e+t.messages.length,0)})},Ua=e=>{var t,n;return null!==(n=null===(t=ja()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},qa=e=>{const t=ja()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},_a=r(void 0),Ya=e=>{let{children:n,getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}=e;return t.createElement(_a.Provider,{value:{getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}},n)},Ga=()=>{const e=o(_a);if(!e)throw new Error("useSession must be used within a SessionProvider");return e},Wa=()=>{const[e,n]=a(!1),[r,o]=a([]),A=i(null),l=i(null),{replaceMessages:c}=$t(),{toggleTextAreaDisabled:u}=nn(),{setSessionId:d,getSessionId:p}=Ga();s(()=>{const t=e=>{A.current&&!A.current.contains(e.target)&&l.current&&!l.current.contains(e.target)&&n(!1)};return e&&document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[e]);const f=e=>{const t=p();if(Oa("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==t?void 0:t.slice(-12)}),e===t)return Oa("RESTORE skipped - already on this session"),void n(!1);const r=(e=>{var t;return(null===(t=ja()[e])||void 0===t?void 0:t.messages)||[]})(e).filter(e=>{var t;return null===(t=e.content)||void 0===t?void 0:t.trim()});Oa("Stored messages from our localStorage",{count:r.length,ids:r.map(e=>e.id.slice(-8))});const o=r.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));c(o),Oa("replaceMessages called",{count:o.length}),setTimeout(()=>{const e=document.querySelector(".rcb-chat-body-container");e&&e.querySelectorAll(".rcb-bot-message").forEach(e=>{e.innerHTML.includes("](")&&(e.innerHTML=e.innerHTML.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'))})},50),d(e),Oa("Session ID updated",{newSession:e.slice(-12)}),u(!1),Oa("Chat input enabled after restore"),n(!1)};return t.createElement("div",{style:{position:"relative"}},t.createElement("button",{ref:l,className:"history-button",onClick:()=>{e||o((()=>{const e=ja();return Object.entries(e).map(e=>{let[t,n]=e;return Object.assign({sessionId:t},n)}).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime())})()),n(!e)},style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"18px",display:"flex",border:"none",cursor:"pointer",padding:0},"aria-label":"View chat history",title:"View chat history","aria-expanded":e,"aria-haspopup":"menu"},t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},t.createElement("circle",{cx:"12",cy:"12",r:"10"}),t.createElement("polyline",{points:"12 6 12 12 16 14"}))),e&&t.createElement("div",{ref:A,role:"menu",style:{position:"fixed",left:0,right:0,top:"auto",marginTop:"8px",backgroundColor:"white",borderRadius:0,borderBottom:"3px solid var(--primaryColor, #1a5b6e)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",maxHeight:"250px",overflowY:"auto",zIndex:1e3}},0===r.length?t.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):r.map(e=>t.createElement("button",{key:e.sessionId,role:"menuitem",onClick:()=>f(e.sessionId),style:{width:"100%",padding:"10px 14px",border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left",display:"flex",flexDirection:"column",gap:"2px",borderBottom:"1px solid #eee"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},t.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.preview||"New conversation"),t.createElement("span",{style:{fontSize:"12px",color:"#888"}},(e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/864e5);return 0===r?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):1===r?"Yesterday":r<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})})(e.startedAt))))))};function Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Va.apply(null,arguments)}const Xa=({width:e=24,height:n=24,color:r="currentColor",children:o,...A})=>t.createElement("svg",Va({xmlns:"http://www.w3.org/2000/svg",width:e,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},A),o),Ka=e=>t.createElement(Xa,e,t.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),Ja=r(null),Za=e=>{let{onAnalyticsEvent:n,getSessionId:r,children:o}=e;const a=i(n);a.current=n;const s=A(e=>{var t,n;a.current&&a.current(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:r())&&void 0!==n?n:void 0}))},[r]);return t.createElement(Ja.Provider,{value:{trackEvent:s}},o)},$a=()=>{const{restartFlow:e}=Zt(),{setTextAreaValue:n}=nn(),{messages:r}=$t(),{getSessionId:A,resetSession:i,clearResettingFlag:a}=Ga(),{trackEvent:s}=o(Ja)||{trackEvent:()=>{}};return t.createElement("button",{onClick:async()=>{const t=A(),r=t?Ua(t):0;s({type:"qa_new_chat_started",previousMessageCount:r}),i(),await n(""),await e(),setTimeout(()=>{a()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},t.createElement(Ka,{width:16,height:16}),"New Chat")};function es(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(es).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return es(t.children)}return""}const ts=()=>{const{getSessionId:e}=Ga(),t=A(t=>{var n;const r=null===(n=t.data)||void 0===n?void 0:n.message;if(La("PRE_INJECT",{sender:null==r?void 0:r.sender,type:null==r?void 0:r.type,content:null==r?void 0:r.content}),!(null==r?void 0:r.id))return;const o=r.sender,A=r.type||"string";let i;if(i="string"==typeof r.content?r.content:es(r.content),i.includes("rcb-options-container"))return;if(!i.trim())return;const a=e();Fa(a,r.id,i,o,A)},[e]);return s(()=>{const e=e=>{La(e.type.replace("rcb-","").toUpperCase(),{data:e.data})},n=["rcb-pre-inject-message","rcb-post-inject-message","rcb-change-path","rcb-user-submit-text"];return n.forEach(t=>{window.addEventListener(t,e)}),window.addEventListener("rcb-pre-inject-message",t),()=>{n.forEach(t=>{window.removeEventListener(t,e)}),window.removeEventListener("rcb-pre-inject-message",t)}},[t]),null},ns=()=>(s(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let A=[];if(o.length>0){const e=o[o.length-1],t=Array.from(e.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);if(t.length>0){const e=t[t.length-1];A=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===A.length)return;const i=A.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=i<A.length-1?i+1:0,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=i>0?i-1:A.length-1,A[t].setAttribute("tabindex","0"),A.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[t].classList.add("keyboard-focused"),A[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&A.includes(document.activeElement)){const e=document.activeElement;if(e.classList.contains("rcb-checkbox-row-container")||e.closest(".rcb-checkbox-row-container")){const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.querySelector(".rcb-checkbox-label"),o=r?r.textContent:e.textContent||"checkbox",A=e.querySelector(".rcb-checkbox-mark"),i=A&&A.style.backgroundColor?"checked":"unchecked";t(`${o} ${i}`)}else{const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.textContent||e.innerText;t(`Selected: ${r}`)}}break;case"Home":e.preventDefault(),A.length>0&&(A[0].setAttribute("tabindex","0"),A.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),A[0].classList.add("keyboard-focused"),A[0].focus());break;case"End":if(e.preventDefault(),A.length>0){const e=A.length-1;A[e].setAttribute("tabindex","0"),A.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),A[e].classList.add("keyboard-focused"),A[e].focus()}}},t=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&document.body.removeChild(t)},1e3)},n=(e=null)=>{let n=e;if(n||(n=document.querySelector(".rcb-chat-window"),n||(n=document.querySelector('[class*="rcb-chat"]')),n||(n=document.querySelector(".qa-bot"))),!n)return;const r=null!==n.closest(".embedded-qa-bot"),o=Array.from(n.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(0===o.length)return;const A=o[o.length-1],i=Array.from(A.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let a=[];if(i.length>0){const e=i[i.length-1];a=Array.from(e.querySelectorAll(".rcb-options"))}if(0===a.length){let e=A.querySelector(".rcb-checkbox-container");if(!e&&n&&(e=n.querySelector(".rcb-checkbox-container")),e&&null!==e.offsetParent){const t=Array.from(e.querySelectorAll(".rcb-checkbox-row-container")).filter(e=>null!==e.offsetParent&&"none"!==e.style.display);if(t.length>0){const n=e.querySelector(".rcb-checkbox-next-button"),o=[...t];if(n&&null!==n.offsetParent&&o.push(n),o.forEach((e,t)=>{e.setAttribute("tabindex",0===t?"0":"-1"),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),t.length>1){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select/deselect, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}return void setTimeout(()=>{o[0]&&null!==o[0].offsetParent&&!r&&o[0].focus()},150)}}}if(a.length>0){if(a.forEach((e,t)=>{const n=0===t?"0":"-1";e.setAttribute("tabindex",n),e.setAttribute("role","option"),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",a.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),a.length>1){const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}}else{const e=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{a[0]&&null!==a[0].offsetParent&&!r&&(a[0].focus(),a.length>1&&t(`${a.length} options available. Use arrow keys to navigate.`))},200)}},r=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type){const t=Array.from(e.addedNodes),r=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-options-container")||e.classList?.contains("rcb-options")||e.querySelector?.(".rcb-options-container")||e.querySelector?.(".rcb-options"))),o=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-checkbox-container")||e.querySelector?.(".rcb-checkbox-container")));if(r||o){let t=e.target;for(;t&&!t.classList?.contains("qa-bot")&&!t.classList?.contains("rcb-chat-window");)t=t.parentElement;(t||document).querySelectorAll(".rcb-options[tabindex], .rcb-checkbox-row-container[tabindex], .rcb-checkbox-next-button[tabindex]").forEach(e=>{e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused")}),setTimeout(()=>n(t),100)}}})});r.observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("keydown",e),n();const o=setInterval(()=>{document.querySelectorAll(".qa-bot").forEach(e=>{const t=e.querySelectorAll(".rcb-options-container .rcb-options").length>0,r=e.querySelectorAll(".rcb-checkbox-row-container").length>0;if(t){const t=e.querySelectorAll(".rcb-options[tabindex]").length;e.querySelectorAll(".rcb-options").length>t&&n(e)}if(r){const t=e.querySelectorAll(".rcb-checkbox-row-container[tabindex]").length;e.querySelectorAll(".rcb-checkbox-row-container").length>t&&n(e)}})},1e3);return()=>{document.removeEventListener("keydown",e),r.disconnect(),clearInterval(o)}},[]),null);const rs="#1a5b6e",os="#107180",As="Arial, sans-serif",is="Q&A Bot",as="/chat-icon.svg",ss="Type your question here...",ls="Select an option to continue",cs=!1,us="Ask me a question!",ds="/login",ps={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:1e3,showCharacterCount:!1,allowNewline:!0,blockSpam:!1},chatWindow:{defaultOpen:!1,showScrollbar:!1},botBubble:{simulateStream:!0,streamSpeed:10,showAvatar:!1},userBubble:{showAvatar:!1},notification:{disabled:!0,showCount:!1},audio:{disabled:!0},emoji:{disabled:!0},fileAttachment:{disabled:!0}},fs=n((e,n)=>{var r,o;const{apiKey:A,qaEndpoint:c,ratingEndpoint:u,welcomeMessage:d,open:p,onOpenChange:f,isLoggedIn:h,allowAnonAccess:g=!1,actingUser:m,primaryColor:v,secondaryColor:b,botName:y,logo:x,placeholder:E,errorMessage:B,embedded:P,footerText:D,footerLink:k,tooltipText:C,loginUrl:S,customFlow:I,onAnalyticsEvent:T}=e,Q=i("bot_".concat(Math.random().toString(36).substr(2,9)));s(()=>{Qa()},[]);const M=i(null);null===M.current&&(M.current=za(),Ma("CREATED",M.current));const O=i(!1),L=i({getSessionId:()=>M.current,isResetting:()=>O.current}),[N,H]=a(h);s(()=>{H(h)},[h]);const R=l(()=>{const e=Object.assign({},ps);e.general=Object.assign(Object.assign({},e.general),{primaryColor:v||rs,secondaryColor:b||os,fontFamily:As,embedded:void 0!==P?P:cs});const n=!1===N?[t.createElement(ba,{key:"login-button",loginUrl:S||ds,isHeaderButton:!0})]:[t.createElement(Wa,{key:"history-button"}),t.createElement(wa,{key:"user-icon"})];e.header={title:t.createElement("span",{style:{fontSize:14,fontWeight:500}},y||is),showAvatar:!0,avatar:x||as,buttons:[...n,w.CLOSE_CHAT_BUTTON]},e.chatInput=Object.assign(Object.assign({},e.chatInput),{disabled:!1,enabledPlaceholderText:E||ss,disabledPlaceholderText:B||ls}),e.tooltip=Object.assign(Object.assign({},e.tooltip),{text:C||us});const r=D?k?t.createElement("a",{href:k,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},D):t.createElement("span",{key:"footer-text"},D):null;return e.footer={text:r,buttons:[t.createElement($a,{key:"new-chat-button"})]},e.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},e},[v,b,y,x,E,B,P,C,N,S,D,k]),z=i(null),j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(()=>{const n=(t,n)=>{if(e.current){const n=getComputedStyle(e.current).getPropertyValue(t);if(n&&""!==n.trim())return n.trim();if(e.current.parentElement){const n=getComputedStyle(e.current.parentElement).getPropertyValue(t);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:n("--primaryColor",t.primaryColor),secondaryColor:n("--secondaryColor",t.secondaryColor),fontFamily:n("--fontFamily",t.fontFamily)}},[e,t])}(z,R.general);((e,t)=>{s(()=>{t.current&&(e?t.current.classList.add("bot-logged-in"):t.current.classList.remove("bot-logged-in"))},[e,t])})(!1!==N,z),(e=>{let{settings:n,themeColors:r}=e;s(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty("--".concat(t),n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),s(()=>{var e,r,o;(null===(e=n.header)||void 0===e?void 0:e.title)&&"string"==typeof n.header.title&&(n.header.title=t.createElement("div",{key:"header-title"},t.createElement("h1",{className:"sr-only"},n.header.title),t.createElement("span",{"aria-hidden":"true"},n.header.title))),(null===(r=n.general)||void 0===r?void 0:r.embedded)&&n.chatWindow&&(n.chatWindow.defaultOpen=!0),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!1},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(o=n.header)||void 0===o?void 0:o.avatar}),n.event={rcbToggleChatWindow:!0}},[n])})({settings:R,themeColors:j});const F=l(()=>{const e=(e=>{let{endpoint:n,ratingEndpoint:r,apiKey:o,sessionId:A,isResetting:i=()=>!1,isLoggedIn:a,allowAnonAccess:s=!1,loginUrl:l="/login",actingUser:c,onAnalyticsEvent:u}=e;const d=e=>{var t,n;u&&u(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:A())&&void 0!==n?n:void 0}))};if(!1===a&&!s)return d({type:"qa_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:t.createElement(ba,{loginUrl:l}),chatDisabled:!0,path:"qa_loop"}};let p=null,f=!1;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{const{userInput:t}=e;if(i&&i())return null;if(!t||""===t.trim())return null;if("👍 Helpful"===t||"👎 Not helpful"===t){if(r&&p)try{const e="👍 Helpful"===t,n={"Content-Type":"application/json"};o&&(n["X-API-KEY"]=o);const i=A();i&&(n["X-Session-ID"]=i,n["X-Query-ID"]=p),await fetch(r,{method:"POST",headers:n,body:JSON.stringify({sessionId:i,queryId:p,rating:e?1:0})}),d({type:"qa_response_rated",queryId:p,rating:e?"helpful":"not_helpful"})}catch(e){Ha("Error sending feedback:",e)}return"Thanks for the feedback! Feel free to ask another question."}try{const r=Pa();p=r,d({type:"qa_question_asked",queryId:r,questionLength:t.length});const i={"Content-Type":"application/json"};o&&(i["X-API-KEY"]=o);const a=A();a&&(i["X-Session-ID"]=a,i["X-Query-ID"]=r),c&&(i["X-Acting-User"]=c);const s={query:t,session_id:a,question_id:r};c&&(s.acting_user=c),Ma("SENT to API",{session_id:a,question_id:r,acting_user:c||"(not set)"});const l=Date.now(),u=await fetch(n,{method:"POST",headers:i,body:JSON.stringify(s)}),h=Date.now()-l;if(!u.ok)throw new Error("API returned ".concat(u.status));const g=await u.json(),m=g.response||g.answer||g.text||g.message;if(!m)throw new Error("Invalid response format from API");const v=(e=>{if(!e||"string"!=typeof e)return e;let t=e.replace(/\[(https?:\/\/[^\s]+?)\]/gi,"[$1]($1)");return t=t.replace(/(?<!\]\(|href=["']|\[)https?:\/\/[^\s[\]()]+/gi,e=>{let t=e,n="";const r=t.match(/([.,;:!?]+)$/);return r&&(n=r[1],t=t.slice(0,-n.length)),"[".concat(t,"](").concat(t,")").concat(n)}),t})(m),b=function(e){const{confidence:t,tools_used:n,metadata:r}=e;if(!(t||n&&0!==n.length))return"";const o=[];return t&&o.push("• Confidence: ".concat(t)),n&&n.length>0&&o.push("• Tools used: ".concat(n.join(", "))),(null==r?void 0:r.agent)&&o.push("• Agent: ".concat(r.agent)),"---\n".concat(o.join("\n"))}(g),w=b?"".concat(v,"\n\n").concat(b):v;return await e.injectMessage(w),d({type:"qa_response_received",queryId:r,responseTimeMs:h,success:!0,responseLength:m.length,hasMetadata:!!b}),f=!0,setTimeout(async()=>{await e.injectMessage("Feel free to ask another question.")},100),null}catch(e){return Ha("Error in Q&A flow:",e),d({type:"qa_response_error",queryId:null!=p?p:void 0,errorType:e instanceof Error?e.message:"unknown"}),"I apologize, but I'm having trouble processing your question. Please try again later."}},options:e=>i&&i()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput?[]:r&&f?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,path:"qa_loop"}}})({endpoint:c,ratingEndpoint:u,apiKey:A,sessionId:L.current.getSessionId,isResetting:L.current.isResetting,isLoggedIn:N,allowAnonAccess:g,loginUrl:S||ds,actingUser:m,onAnalyticsEvent:T}),n={message:d,transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},e),I||{})},[A,c,u,d,N,g,S,I,m,T]),U=l(()=>{return[()=>Mn(t),fa(),()=>ma(e)];var e,t},[]);return s(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),ns(),s(()=>{if(!P){const e=e=>{const t=e.data.newState;null==f||f(t);const n=M.current;t?null==T||T({type:"qa_bot_opened",timestamp:Date.now(),sessionId:null!=n?n:void 0}):null==T||T({type:"qa_bot_closed",timestamp:Date.now(),sessionId:null!=n?n:void 0,messageCount:n?Ua(n):0,durationMs:n?qa(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[P,f,T]),t.createElement("div",{className:"qa-bot ".concat((null===(r=R.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:z,role:"region","aria-label":y||is},t.createElement(Ya,{getSessionId:()=>M.current,setSessionId:e=>{const t=M.current;M.current=e,Ma("RESTORED","".concat(null==t?void 0:t.slice(-12)," -> ").concat(e.slice(-12)))},resetSession:()=>{const e=M.current;O.current=!0,M.current=za(),Ma("RESET","".concat(null==e?void 0:e.slice(-12)," -> ").concat(M.current.slice(-12)))},clearResettingFlag:()=>{O.current=!1}},t.createElement(Za,{onAnalyticsEvent:T,getSessionId:()=>M.current},t.createElement(Gt,null,t.createElement("div",null,t.createElement(ts,null),t.createElement(va,{ref:n,embedded:(null===(o=R.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:p||!1,enabled:!1!==N,onSetEnabled:e=>H(!!e&&void 0)}),t.createElement(Kt,{key:"chatbot-".concat(Q.current,"-").concat(N),settings:R,flow:F,plugins:U}),t.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region"}),t.createElement("div",{id:"chat-input-help",className:"sr-only"},"Type your message and press Enter to send. Use arrow keys to navigate through response options."))))))});fs.displayName="QABot";b('.rcb-chat-window{height:800px!important;max-height:80vh!important;max-width:100%;width:550px!important}.rcb-chat-window .rcb-chat-header{align-items:center;display:flex;flex-direction:row;font-weight:700}.rcb-chat-window a{color:#000;font-weight:700;text-decoration:underline}.rcb-chat-window a:hover{color:var(--primaryColor,#107180)}.rcb-chat-window .rcb-bot-message a{color:#fff;text-decoration:none}.rcb-chat-window .rcb-bot-message a:hover{text-decoration:underline}.rcb-chat-window .rcb-chat-input-textarea{overflow-y:auto}.rcb-chat-window .rcb-chat-footer-container{font-size:10px}.qa-bot .history-button,.qa-bot .user-login-icon{display:none!important}.qa-bot.bot-logged-in .history-button,.qa-bot.bot-logged-in .user-login-icon{display:flex!important;transform:scale(1.3) translateY(-2px)}.qa-bot.bot-logged-in .history-button:hover{opacity:.8}.qa-bot.bot-logged-in .history-button:focus{outline:2px solid #fff;outline-offset:2px}.embedded-qa-bot .rcb-chat-window{max-width:100%;width:100%!important}.qa-bot.hidden{display:none}.embedded-qa-bot .rcb-bot-message,.embedded-qa-bot .rcb-user-message{max-width:90%!important;word-break:break-word}.embedded-qa-bot .rcb-chat-input-textarea{width:100%!important}.qa-bot-container{max-width:100%;width:100%}@keyframes phone-ring{0%{transform:translateX(0) translateY(0) rotate(0deg)}2%{transform:translateX(0) translateY(-8px) rotate(-2deg)}4%{transform:translateX(0) translateY(-6px) rotate(2deg)}6%{transform:translateX(0) translateY(-8px) rotate(-1deg)}8%{transform:translateX(0) translateY(-6px) rotate(1deg)}10%{transform:translateX(0) translateY(-8px) rotate(-2deg)}12%{transform:translateX(0) translateY(-6px) rotate(2deg)}20%{transform:translateX(0) translateY(0) rotate(0deg)}30%{transform:translateX(0) translateY(0) rotate(0deg)}40%{transform:translateX(0) translateY(0) rotate(0deg)}49%{transform:translateX(0) translateY(0) rotate(0deg)}50%{transform:translateX(0) translateY(-8px) rotate(-2deg)}52%{transform:translateX(0) translateY(-6px) rotate(2deg)}54%{transform:translateX(0) translateY(-8px) rotate(-1deg)}56%{transform:translateX(0) translateY(-6px) rotate(1deg)}58%{transform:translateX(0) translateY(-8px) rotate(-2deg)}60%{transform:translateX(0) translateY(-6px) rotate(2deg)}70%{transform:translateX(0) translateY(0) rotate(0deg)}to{transform:translateX(0) translateY(0) rotate(0deg)}}@media (max-width:768px){.rcb-chat-window{max-height:calc(100vh - 100px)!important;max-width:calc(100vw - 40px)!important;width:550px!important}.embedded-chat-container.open{height:400px}.embedded-chat-closed{font-size:14px;height:40px}.embedded-chat-open-btn{font-size:12px;padding:3px 10px}.rcb-bot-message,.rcb-user-message{max-width:85%!important}.rcb-chat-input-textarea{font-size:16px!important;min-height:44px!important}.rcb-chat-header{padding:12px 16px!important}}@media (max-width:480px){.rcb-chat-window{bottom:10px!important;left:10px!important;max-height:calc(100vh - 80px)!important;max-width:calc(100vw - 20px)!important;right:10px!important;width:calc(100vw - 20px)!important}.embedded-chat-container.open{height:350px}.rcb-bot-message,.rcb-user-message{margin-bottom:8px!important;max-width:90%!important}.rcb-chat-header{font-size:14px!important;padding:8px 12px!important}.rcb-chat-button{bottom:20px!important;height:50px!important;right:20px!important;width:50px!important}.rcb-chat-footer-container{font-size:9px!important;padding:8px 12px!important}}@media (max-width:360px){.rcb-chat-window{left:5px!important;max-width:calc(100vw - 10px)!important;right:5px!important;width:calc(100vw - 10px)!important}.rcb-chat-header{font-size:13px!important;padding:6px 8px!important}}.rcb-checkbox-container{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-left:16px!important;max-width:100%!important;padding-top:12px!important}.rcb-checkbox-row-container{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--primaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-row-container:hover{background-color:#e8f4f8!important;border-color:var(--primaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-row-container[data-checked=true]{background-color:var(--primaryColor,#107180)!important;border-color:var(--primaryColor,#107180)!important;color:#fff!important}.rcb-checkbox-row{margin-left:0!important}.rcb-checkbox-mark{height:14px!important;margin-right:6px!important;width:14px!important}.rcb-checkbox-label{font-size:13px!important;margin:0!important;white-space:nowrap!important}.rcb-checkbox-next-button{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;justify-content:center!important;line-height:24px!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-next-button:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.sr-only{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.rcb-chat-input-send-button:focus,.rcb-chat-input-textarea:focus{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-user-message{word-wrap:break-word!important;overflow:hidden!important;word-break:break-word!important}:focus-visible{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-options-container{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:8px!important;margin:16px!important;padding:0!important}.rcb-options{background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;outline:none!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-options:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-next-button.keyboard-focused,.rcb-checkbox-next-button:focus,.rcb-checkbox-next-button:focus-visible,.rcb-checkbox-row-container.keyboard-focused,.rcb-checkbox-row-container:focus,.rcb-checkbox-row-container:focus-visible,.rcb-options.keyboard-focused,.rcb-options:focus,.rcb-options:focus-visible{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;outline:none!important}.rcb-options:active{background-color:var(--secondaryColor,#107180)!important;border-color:var(--secondaryColor,#107180)!important;color:#fff!important;transform:translateY(0)!important}.keyboard-nav-hint{color:#666!important;font-size:12px!important;font-style:italic!important;margin-bottom:8px!important}@media (prefers-reduced-motion:reduce){.keyboard-nav-hint{display:none!important}}.rcb-options-container [role=button][tabindex="0"],.rcb-options-container button[tabindex="0"]{position:relative!important}.rcb-options-container [role=button][tabindex="0"]:after,.rcb-options-container button[tabindex="0"]:after{color:var(--secondaryColor,#107180)!important;content:"←"!important;font-size:16px!important;opacity:0!important;position:absolute!important;right:12px!important;top:50%!important;transform:translateY(-50%)!important;transition:opacity .2s ease!important}.rcb-options-container [role=button][tabindex="0"]:focus:after,.rcb-options-container button[tabindex="0"]:focus:after{opacity:1!important}.rcb-chat-input-send-button{cursor:pointer!important;opacity:1!important;pointer-events:auto!important;visibility:visible!important}.rcb-chat-input-send-button:not([tabindex]){-webkit-user-select:none;-moz-user-select:none;user-select:none}.rcb-chat-input-container [onclick],.rcb-chat-input-container [role=button],.rcb-chat-input-container div[style*=cursor],.rcb-chat-input-container svg:last-child,.rcb-chat-input-container>div:last-child{tabindex:0!important;cursor:pointer!important}.rcb-chat-footer{margin-top:4px!important;padding-top:0!important}.rcb-chat-footer-container{align-items:center!important;display:flex!important;margin-top:4px!important;padding-top:4px!important}.rcb-chat-footer-container button{order:1!important}.rcb-chat-footer-container a[href*=qa-bot-core]{tab-index:0!important;order:2!important}.rcb-chat-footer-container a[href*=feedback]{tab-index:0!important;order:3!important}@media (prefers-contrast:high){.rcb-chat-window a{background-color:#fff!important;border:1px solid #000!important;color:#000!important}}@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.rcb-chat-input-textarea{user-select:text!important}.rcb-chat-body-container,.rcb-chat-input-textarea,.rcb-chat-window{touch-action:pan-y!important}.embedded-qa-bot,.rcb-chat-window{-webkit-overflow-scrolling:touch!important}.embedded-qa-bot .rcb-chat-input-textarea{touch-action:pan-y!important;user-select:text!important}.embedded-qa-bot .rcb-chat-body-container,.embedded-qa-bot .rcb-chat-window{touch-action:pan-y!important}.rcb-chat-header-container{background:var(--primaryColor,#1a5b6e)!important;background:linear-gradient(135deg,var(--primaryColor,#1a5b6e) 0,var(--secondaryColor,#107180) 100%)!important}.rcb-toggle-button{align-items:center!important;background:var(--primaryColor,#1a5b6e)!important;display:flex!important;justify-content:center!important}.rcb-toggle-button svg{stroke:#fff!important;color:#fff!important}.rcb-toggle-button *,.rcb-toggle-button img,.rcb-toggle-button svg,.rcb-toggle-button>*{box-sizing:border-box!important;height:50px!important;left:0!important;margin:0 auto!important;max-height:50px!important;max-width:50px!important;min-height:50px!important;min-width:50px!important;padding:2px!important;position:relative!important;top:0!important;width:50px!important}.rcb-send-button{background-color:var(--primaryColor,#1a5b6e)!important}',{insertAt:"top"});const hs=()=>{const[e,t]=a(!1),n=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!n())throw new Error("Screen capture is not available in this environment");try{t(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),n=document.createElement("video");n.srcObject=e,await new Promise(e=>{n.onloadedmetadata=()=>{n.play(),e()}});const r=document.createElement("canvas");r.width=n.videoWidth,r.height=n.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(n,0,0,r.width,r.height);const A=await new Promise(e=>r.toBlob(e,"image/png"));if(!A)throw new Error("Could not create image blob");const i=(new Date).toISOString().replace(/[:.]/g,"-"),a=new File([A],"screenshot-".concat(i,".png"),{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),t(!1),a}catch(e){throw Ha("Error capturing screenshot:",e),t(!1),e}},isCapturing:e,isScreenCaptureAvailable:n()}},gs=e=>t.createElement(Xa,e,t.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.createElement("polyline",{points:"17 8 12 3 7 8"}),t.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),ms=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error("Failed to read file ".concat(e.name)));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error("Failed to read file ".concat(e.name))),r.readAsDataURL(e)}),vs=e=>Promise.all(e.map(ms)),bs=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t},ws=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB"),ys=e=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:A=!1,className:s}=e;const[l,c]=a(!1),[u,d]=a([]),[p,f]=a(null),h=i(null),{captureScreenshot:g,isCapturing:m,isScreenCaptureAvailable:v}=hs(),b=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},w=e=>{if(!e||0===e.length)return void Na("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return Ha("FileUploadComponent: Error converting files to array:",e),void b("Error processing selected files. Please try again.")}const r=[...u,...t];d(r);const o=t.length,A=t.map(e=>e.name).join(", ");b("".concat(o," file").concat(o>1?"s":""," selected: ").concat(A)),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},y=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?c(!0):"dragleave"===e.type&&c(!1)},x=()=>{try{h.current&&h.current.click()}catch(e){Ha("FileUploadComponent: Error in handleButtonClick:",e),b("Error opening file selection dialog. Please try again.")}},E=()=>{f(null)},B=A&&v;return t.createElement("div",{className:"file-upload-container ".concat(s||""),style:{padding:"16px",margin:"8px 0"}},B&&t.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},t.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await g();w([e]),b("Screenshot captured successfully")}catch(e){b("Error capturing screenshot. Please try again.")}})()},disabled:m,"aria-describedby":"screenshot-help","aria-label":m?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:m?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t.createElement("circle",{cx:"12",cy:"13",r:"4"})),m?"Taking screenshot...":"Take screenshot..."),t.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),t.createElement("div",{className:"file-upload-dropzone ".concat(l?"active":""),onDragEnter:y,onDragLeave:y,onDragOver:y,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),c(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&w(e.dataTransfer.files)}catch(e){Ha("FileUploadComponent: Error in handleDrop:",e),b("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),x())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:l?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},t.createElement("input",{ref:h,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&w(e.target.files)}catch(e){Ha("FileUploadComponent: Error in handleFileSelect:",e),b("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),t.createElement("div",{className:"upload-content",onClick:x,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},t.createElement(gs,null),t.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),t.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),u.length>0&&t.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},t.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),u.map((e,r)=>t.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:t=>{t.stopPropagation(),(e=>{f(e)})(e)}},t.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=u.filter((t,n)=>n!==e);d(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":"Remove ".concat(e.name)},"×"),e.name," (",ws(e.size),")"))))),(()=>{if(!p)return null;const e=p.type.startsWith("image/"),n=p.type.startsWith("text/"),r="application/pdf"===p.type;return t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:E},t.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:E,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),t.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},p.name),e&&t.createElement("img",{src:URL.createObjectURL(p),alt:p.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&t.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(p)),r&&t.createElement("iframe",{src:URL.createObjectURL(p),style:{width:"100%",height:"70vh",border:"none"},title:p.name}),!e&&!n&&!r&&t.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())};function xs(e,t){if(!t||0===Object.keys(t).length)return e;const n={};for(const[r,o]of Object.entries(e)){let e=Object.assign({},o);if(t.disableOnOptions&&void 0===e.chatDisabled){const t=!(!e.options&&!e.checkboxes);e.chatDisabled=t}n[r]=e}return n}const Es=t.forwardRef((e,n)=>{const[r,o]=t.useState(e.defaultOpen||!1),A=t.useRef(null);return t.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;o(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;o(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;o(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),t.createElement(fs,{ref:A,apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,embedded:e.embedded,isLoggedIn:e.isLoggedIn,allowAnonAccess:e.allowAnonAccess,open:r,onOpenChange:o,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText,onAnalyticsEvent:e.onAnalyticsEvent})});function Bs(e){if(!(e.target&&e.target instanceof HTMLElement))return void Ha("QA Bot: A valid target DOM element is required");const n=f.createRoot(e.target),r={current:null};return n.render(t.createElement(t.StrictMode,null,t.createElement(Es,{ref:e=>{r.current=e},apiKey:e.apiKey,qaEndpoint:e.qaEndpoint,ratingEndpoint:e.ratingEndpoint,defaultOpen:e.defaultOpen,embedded:e.embedded,isLoggedIn:e.isLoggedIn,allowAnonAccess:e.allowAnonAccess,welcomeMessage:e.welcomeMessage,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,botName:e.botName,logo:e.logo,placeholder:e.placeholder,errorMessage:e.errorMessage,footerText:e.footerText,footerLink:e.footerLink,tooltipText:e.tooltipText,onAnalyticsEvent:e.onAnalyticsEvent}))),{addMessage:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=r.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{r.current=null,n.unmount()}}}Es.displayName="ProgrammaticQABot";export{ys as FileUploadComponent,fs as QABot,xs as applyFlowSettings,Bs as default,ms as fileToBase64,vs as filesToBase64,ws as formatFileSize,Bs as qaBot,hs as useScreenshotCapture,bs as validateFileSize};
9
9
  //# sourceMappingURL=qa-bot-core.js.map