genassist-chat-react 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChatBubble.d.ts +1 -0
- package/dist/components/ChatBubble.js +4 -4
- package/dist/components/ChatMessage.js +6 -2
- package/dist/components/GenAgentChat.js +153 -28
- package/dist/components/LiveCallControl.d.ts +25 -0
- package/dist/components/LiveCallControl.js +83 -0
- package/dist/components/MarkdownMessage.js +23 -1
- package/dist/genassist-chat.es.js +16915 -0
- package/dist/genassist-chat.umd.js +91 -0
- package/dist/hooks/useAudioRecorder.js +74 -2
- package/dist/hooks/useChat.d.ts +3 -0
- package/dist/hooks/useChat.js +16 -5
- package/dist/hooks/useLiveVoice.d.ts +32 -0
- package/dist/hooks/useLiveVoice.js +292 -0
- package/dist/services/chatService.js +10 -6
- package/dist/styles/genAgentChatStyles.d.ts +2 -0
- package/dist/styles/genAgentChatStyles.js +15 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +1 -1
- package/package.json +2 -2
- package/dist/components/AttachmentPreview.d.ts +0 -8
- package/dist/components/AttachmentPreview.js +0 -77
- package/dist/utils/urlUtil.d.ts +0 -2
- package/dist/utils/urlUtil.js +0 -7
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
(function(ke,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(ke=typeof globalThis<"u"?globalThis:ke||self,b(ke.GenAssistChat={},ke.React))})(this,(function(ke,b){"use strict";function no(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dn={exports:{}},en={};var ro;function Zl(){if(ro)return en;ro=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:s}}return en.Fragment=t,en.jsx=n,en.jsxs=n,en}var tn={};var io;function eu(){return io||(io=1,process.env.NODE_ENV!=="production"&&(function(){function e(C){if(C==null)return null;if(typeof C=="function")return C.$$typeof===O?null:C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case y:return"Fragment";case T:return"Profiler";case w:return"StrictMode";case v:return"Suspense";case N:return"SuspenseList";case S:return"Activity"}if(typeof C=="object")switch(typeof C.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),C.$$typeof){case x:return"Portal";case F:return C.displayName||"Context";case E:return(C._context.displayName||"Context")+".Consumer";case z:var q=C.render;return C=C.displayName,C||(C=q.displayName||q.name||"",C=C!==""?"ForwardRef("+C+")":"ForwardRef"),C;case L:return q=C.displayName||null,q!==null?q:e(C.type)||"Memo";case j:q=C._payload,C=C._init;try{return e(C(q))}catch{}}return null}function t(C){return""+C}function n(C){try{t(C);var q=!1}catch{q=!0}if(q){q=console;var g=q.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&C[Symbol.toStringTag]||C.constructor.name||"Object";return g.call(q,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),t(C)}}function r(C){if(C===y)return"<>";if(typeof C=="object"&&C!==null&&C.$$typeof===j)return"<...>";try{var q=e(C);return q?"<"+q+">":"<...>"}catch{return"<...>"}}function i(){var C=D.A;return C===null?null:C.getOwner()}function s(){return Error("react-stack-top-frame")}function o(C){if(H.call(C,"key")){var q=Object.getOwnPropertyDescriptor(C,"key").get;if(q&&q.isReactWarning)return!1}return C.key!==void 0}function a(C,q){function g(){Q||(Q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",q))}g.isReactWarning=!0,Object.defineProperty(C,"key",{get:g,configurable:!0})}function l(){var C=e(this.type);return Z[C]||(Z[C]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),C=this.props.ref,C!==void 0?C:null}function u(C,q,g,W,pe,ae){var ee=g.ref;return C={$$typeof:m,type:C,key:q,props:g,_owner:W},(ee!==void 0?ee:null)!==null?Object.defineProperty(C,"ref",{enumerable:!1,get:l}):Object.defineProperty(C,"ref",{enumerable:!1,value:null}),C._store={},Object.defineProperty(C._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(C,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(C,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(C,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ae}),Object.freeze&&(Object.freeze(C.props),Object.freeze(C)),C}function c(C,q,g,W,pe,ae){var ee=q.children;if(ee!==void 0)if(W)if(U(ee)){for(W=0;W<ee.length;W++)f(ee[W]);Object.freeze&&Object.freeze(ee)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(ee);if(H.call(q,"key")){ee=e(C);var Ae=Object.keys(q).filter(function(Le){return Le!=="key"});W=0<Ae.length?"{key: someKey, "+Ae.join(": ..., ")+": ...}":"{key: someKey}",k[ee+W]||(Ae=0<Ae.length?"{"+Ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,W,ee,Ae,ee),k[ee+W]=!0)}if(ee=null,g!==void 0&&(n(g),ee=""+g),o(q)&&(n(q.key),ee=""+q.key),"key"in q){g={};for(var be in q)be!=="key"&&(g[be]=q[be])}else g=q;return ee&&a(g,typeof C=="function"?C.displayName||C.name||"Unknown":C),u(C,ee,g,i(),pe,ae)}function f(C){p(C)?C._store&&(C._store.validated=1):typeof C=="object"&&C!==null&&C.$$typeof===j&&(C._payload.status==="fulfilled"?p(C._payload.value)&&C._payload.value._store&&(C._payload.value._store.validated=1):C._store&&(C._store.validated=1))}function p(C){return typeof C=="object"&&C!==null&&C.$$typeof===m}var h=b,m=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),F=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),D=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=Object.prototype.hasOwnProperty,U=Array.isArray,M=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(C){return C()}};var Q,Z={},se=h.react_stack_bottom_frame.bind(h,s)(),te=M(r(s)),k={};tn.Fragment=y,tn.jsx=function(C,q,g){var W=1e4>D.recentlyCreatedOwnerStacks++;return c(C,q,g,!1,W?Error("react-stack-top-frame"):se,W?M(r(C)):te)},tn.jsxs=function(C,q,g){var W=1e4>D.recentlyCreatedOwnerStacks++;return c(C,q,g,!0,W?Error("react-stack-top-frame"):se,W?M(r(C)):te)}})()),tn}var oo;function tu(){return oo||(oo=1,process.env.NODE_ENV==="production"?Dn.exports=Zl():Dn.exports=eu()),Dn.exports}var d=tu();function Nb(){}function Bb(){}function nu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ru=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ou={};function so(e,t){return(ou.jsx?iu:ru).test(e)}const su=/[ \t\n\f\r]/g;function au(e){return typeof e=="object"?e.type==="text"?ao(e.value):!1:ao(e)}function ao(e){return e.replace(su,"")===""}class nn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}nn.prototype.normal={},nn.prototype.property={},nn.prototype.space=void 0;function lo(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new nn(n,r,t)}function Sr(e){return e.toLowerCase()}class et{constructor(t,n){this.attribute=n,this.property=t}}et.prototype.attribute="",et.prototype.booleanish=!1,et.prototype.boolean=!1,et.prototype.commaOrSpaceSeparated=!1,et.prototype.commaSeparated=!1,et.prototype.defined=!1,et.prototype.mustUseProperty=!1,et.prototype.number=!1,et.prototype.overloadedBoolean=!1,et.prototype.property="",et.prototype.spaceSeparated=!1,et.prototype.space=void 0;let lu=0;const ie=Rt(),Me=Rt(),Cr=Rt(),B=Rt(),Te=Rt(),$t=Rt(),it=Rt();function Rt(){return 2**++lu}const vr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ie,booleanish:Me,commaOrSpaceSeparated:it,commaSeparated:$t,number:B,overloadedBoolean:Cr,spaceSeparated:Te},Symbol.toStringTag,{value:"Module"})),Er=Object.keys(vr);class Tr extends et{constructor(t,n,r,i){let s=-1;if(super(t,n),uo(this,"space",i),typeof r=="number")for(;++s<Er.length;){const o=Er[s];uo(this,Er[s],(r&vr[o])===vr[o])}}}Tr.prototype.defined=!0;function uo(e,t,n){n&&(e[t]=n)}function Ut(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Tr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Sr(r)]=r,n[Sr(s.attribute)]=r}return new nn(t,n,e.space)}const co=Ut({properties:{ariaActiveDescendant:null,ariaAtomic:Me,ariaAutoComplete:null,ariaBusy:Me,ariaChecked:Me,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:Te,ariaCurrent:null,ariaDescribedBy:Te,ariaDetails:null,ariaDisabled:Me,ariaDropEffect:Te,ariaErrorMessage:null,ariaExpanded:Me,ariaFlowTo:Te,ariaGrabbed:Me,ariaHasPopup:null,ariaHidden:Me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Te,ariaLevel:B,ariaLive:null,ariaModal:Me,ariaMultiLine:Me,ariaMultiSelectable:Me,ariaOrientation:null,ariaOwns:Te,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:Me,ariaReadOnly:Me,ariaRelevant:null,ariaRequired:Me,ariaRoleDescription:Te,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:Me,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function fo(e,t){return t in e?e[t]:t}function ho(e,t){return fo(e,t.toLowerCase())}const uu=Ut({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$t,acceptCharset:Te,accessKey:Te,action:null,allow:null,allowFullScreen:ie,allowPaymentRequest:ie,allowUserMedia:ie,alt:null,as:null,async:ie,autoCapitalize:null,autoComplete:Te,autoFocus:ie,autoPlay:ie,blocking:Te,capture:null,charSet:null,checked:ie,cite:null,className:Te,cols:B,colSpan:null,content:null,contentEditable:Me,controls:ie,controlsList:Te,coords:B|$t,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ie,defer:ie,dir:null,dirName:null,disabled:ie,download:Cr,draggable:Me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ie,formTarget:null,headers:Te,height:B,hidden:Cr,high:B,href:null,hrefLang:null,htmlFor:Te,httpEquiv:Te,id:null,imageSizes:null,imageSrcSet:null,inert:ie,inputMode:null,integrity:null,is:null,isMap:ie,itemId:null,itemProp:Te,itemRef:Te,itemScope:ie,itemType:Te,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ie,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:ie,muted:ie,name:null,nonce:null,noModule:ie,noValidate:ie,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:ie,optimum:B,pattern:null,ping:Te,placeholder:null,playsInline:ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ie,referrerPolicy:null,rel:Te,required:ie,reversed:ie,rows:B,rowSpan:B,sandbox:Te,scope:null,scoped:ie,seamless:ie,selected:ie,shadowRootClonable:ie,shadowRootDelegatesFocus:ie,shadowRootMode:null,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:Me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:ie,useMap:null,value:Me,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Te,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ie,declare:ie,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:ie,noHref:ie,noShade:ie,noWrap:ie,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:Me,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ie,disableRemotePlayback:ie,prefix:null,property:null,results:B,security:null,unselectable:null},space:"html",transform:ho}),cu=Ut({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:it,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:Te,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:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,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:$t,g2:$t,glyphName:$t,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:it,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,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:B,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:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Te,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:it,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:it,rev:it,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:it,requiredFeatures:it,requiredFonts:it,requiredFormats:it,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:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:it,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:it,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:it,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fo}),po=Ut({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),mo=Ut({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ho}),go=Ut({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),fu={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"},du=/[A-Z]/g,yo=/-[a-z]/g,hu=/^data[-\w.:]+$/i;function pu(e,t){const n=Sr(t);let r=t,i=et;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hu.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yo,gu);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yo.test(s)){let o=s.replace(du,mu);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Tr}return new i(r,t)}function mu(e){return"-"+e.toLowerCase()}function gu(e){return e.charAt(1).toUpperCase()}const yu=lo([co,uu,po,mo,go],"html"),Ar=lo([co,cu,po,mo,go],"svg");function xu(e){return e.join(" ").trim()}var Ht={},_r,xo;function bu(){if(xo)return _r;xo=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
7
|
+
`,u="/",c="*",f="",p="comment",h="declaration";function m(y,w){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];w=w||{};var T=1,E=1;function F(U){var M=U.match(t);M&&(T+=M.length);var Q=U.lastIndexOf(l);E=~Q?U.length-Q:E+U.length}function z(){var U={line:T,column:E};return function(M){return M.position=new v(U),j(),M}}function v(U){this.start=U,this.end={line:T,column:E},this.source=w.source}v.prototype.content=y;function N(U){var M=new Error(w.source+":"+T+":"+E+": "+U);if(M.reason=U,M.filename=w.source,M.line=T,M.column=E,M.source=y,!w.silent)throw M}function L(U){var M=U.exec(y);if(M){var Q=M[0];return F(Q),y=y.slice(Q.length),M}}function j(){L(n)}function S(U){var M;for(U=U||[];M=O();)M!==!1&&U.push(M);return U}function O(){var U=z();if(!(u!=y.charAt(0)||c!=y.charAt(1))){for(var M=2;f!=y.charAt(M)&&(c!=y.charAt(M)||u!=y.charAt(M+1));)++M;if(M+=2,f===y.charAt(M-1))return N("End of comment missing");var Q=y.slice(2,M-2);return E+=2,F(Q),y=y.slice(M),E+=2,U({type:p,comment:Q})}}function D(){var U=z(),M=L(r);if(M){if(O(),!L(i))return N("property missing ':'");var Q=L(s),Z=U({type:h,property:x(M[0].replace(e,f)),value:Q?x(Q[0].replace(e,f)):f});return L(o),Z}}function H(){var U=[];S(U);for(var M;M=D();)M!==!1&&(U.push(M),S(U));return U}return j(),H()}function x(y){return y?y.replace(a,f):f}return _r=m,_r}var bo;function ku(){if(bo)return Ht;bo=1;var e=Ht&&Ht.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=n;const t=e(bu());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),a=typeof i=="function";return o.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:c}=l;a?i(u,c,l):c&&(s=s||{},s[u]=c)}),s}return Ht}var rn={},ko;function wu(){if(ko)return rn;ko=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(u){return!u||n.test(u)||e.test(u)},o=function(u,c){return c.toUpperCase()},a=function(u,c){return"".concat(c,"-")},l=function(u,c){return c===void 0&&(c={}),s(u)?u:(u=u.toLowerCase(),c.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,o))};return rn.camelCase=l,rn}var on,wo;function Su(){if(wo)return on;wo=1;var e=on&&on.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ku()),n=wu();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,on=r,on}var Cu=Su();const vu=no(Cu),So=Co("end"),jr=Co("start");function Co(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function vo(e){const t=jr(e),n=So(e);if(t&&n)return{start:t,end:n}}function sn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Eo(e.position):"start"in e||"end"in e?Eo(e):"line"in e||"column"in e?Ir(e):""}function Ir(e){return To(e&&e.line)+":"+To(e&&e.column)}function Eo(e){return Ir(e&&e.start)+"-"+Ir(e&&e.end)}function To(e){return e&&typeof e=="number"?e:1}class Ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=sn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="",Ge.prototype.name="",Ge.prototype.reason="",Ge.prototype.message="",Ge.prototype.stack="",Ge.prototype.column=void 0,Ge.prototype.line=void 0,Ge.prototype.ancestors=void 0,Ge.prototype.cause=void 0,Ge.prototype.fatal=void 0,Ge.prototype.place=void 0,Ge.prototype.ruleId=void 0,Ge.prototype.source=void 0;const Dr={}.hasOwnProperty,Eu=new Map,Tu=/[A-Z]/g,Au=new Set(["table","tbody","thead","tfoot","tr"]),_u=new Set(["td","th"]),Ao="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ju(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Lu(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=zu(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ar:yu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=_o(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function _o(e,t,n){if(t.type==="element")return Iu(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Du(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ru(e,t,n);if(t.type==="mdxjsEsm")return Pu(e,t);if(t.type==="root")return Fu(e,t,n);if(t.type==="text")return Mu(e,t)}function Iu(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ar,e.schema=i),e.ancestors.push(t);const s=Io(e,t.tagName,!1),o=Ou(e,t);let a=Rr(e,t);return Au.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!au(l):!0})),jo(e,o,s,t),Pr(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Du(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}an(e,t.position)}function Pu(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);an(e,t.position)}function Ru(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ar,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Io(e,t.name,!0),o=Nu(e,t),a=Rr(e,t);return jo(e,o,s,t),Pr(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Fu(e,t,n){const r={};return Pr(r,Rr(e,t)),e.create(t,e.Fragment,r,n)}function Mu(e,t){return t.value}function jo(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Pr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function zu(e,t,n){return r;function r(i,s,o,a){const u=Array.isArray(o.children)?n:t;return a?u(s,o,a):u(s,o)}}function Lu(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=jr(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Ou(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Dr.call(t.properties,i)){const s=Bu(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&_u.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Nu(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else an(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else an(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Rr(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Eu;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;o=l+"-"+u,i.set(l,u+1)}}const a=_o(e,s,o);a!==void 0&&n.push(a)}return n}function Bu(e,t,n){const r=pu(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nu(n):xu(n)),r.property==="style"){let i=typeof n=="object"?n:$u(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Uu(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?fu[r.property]||r.property:r.attribute,n]}}function $u(e,t){try{return vu(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ge("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ao+"#cannot-parse-style-attribute",i}}function Io(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=so(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=so(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Dr.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);an(e)}function an(e,t){const n=new Ge("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=Ao+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Uu(e){const t={};let n;for(n in e)Dr.call(e,n)&&(t[Hu(n)]=e[n]);return t}function Hu(e){let t=e.replace(Tu,qu);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qu(e){return"-"+e.toLowerCase()}const Fr={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"]},Wu={};function Mr(e,t){const n=Wu,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Do(e,r,i)}function Do(e,t,n){if(Vu(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Po(e.children,t,n)}return Array.isArray(e)?Po(e,t,n):""}function Po(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Do(e[i],t,n);return r.join("")}function Vu(e){return!!(e&&typeof e=="object")}const Ro=document.createElement("i");function zr(e){const t="&"+e+";";Ro.innerHTML=t;const n=Ro.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ot(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function dt(e,t){return e.length>0?(ot(e,e.length,0,t),e):t}const Fo={}.hasOwnProperty;function Mo(e){const t={};let n=-1;for(;++n<e.length;)Qu(t,e[n]);return t}function Qu(e,t){let n;for(n in t){const i=(Fo.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Fo.call(i,o)||(i[o]=[]);const a=s[o];Gu(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Gu(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ot(e,0,0,r)}function zo(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ze=jt(/[A-Za-z]/),Ye=jt(/[\dA-Za-z]/),Yu=jt(/[#-'*+\--9=?A-Z^-~]/);function Pn(e){return e!==null&&(e<32||e===127)}const Lr=jt(/\d/),Ju=jt(/[\dA-Fa-f]/),Ku=jt(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function Ce(e){return e!==null&&(e<0||e===32)}function ue(e){return e===-2||e===-1||e===32}const Rn=jt(new RegExp("\\p{P}|\\p{S}","u")),Ft=jt(/\s/);function jt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qt(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Ye(e.charCodeAt(n+1))&&Ye(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function de(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return ue(l)?(e.enter(n),a(l)):t(l)}function a(l){return ue(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const Xu={tokenize:Zu};function Zu(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),de(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return J(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const ec={tokenize:tc},Lo={tokenize:nc};function tc(e){const t=this,n=[];let r=0,i,s,o;return a;function a(E){if(r<n.length){const F=n[r];return t.containerState=F[1],e.attempt(F[0].continuation,l,u)(E)}return u(E)}function l(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&T();const F=t.events.length;let z=F,v;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){v=t.events[z][1].end;break}w(r);let N=F;for(;N<t.events.length;)t.events[N][1].end={...v},N++;return ot(t.events,z+1,0,t.events.slice(F)),t.events.length=N,u(E)}return a(E)}function u(E){if(r===n.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return m(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Lo,c,f)(E)}function c(E){return i&&T(),w(r),p(E)}function f(E){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(E)}function p(E){return t.containerState={},e.attempt(Lo,h,m)(E)}function h(E){return r++,n.push([t.currentConstruct,t.containerState]),p(E)}function m(E){if(E===null){i&&T(),w(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(E)}function x(E){if(E===null){y(e.exit("chunkFlow"),!0),w(0),e.consume(E);return}return J(E)?(e.consume(E),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(E),x)}function y(E,F){const z=t.sliceStream(E);if(F&&z.push(null),E.previous=s,s&&(s.next=E),s=E,i.defineSkip(E.start),i.write(z),t.parser.lazy[E.start.line]){let v=i.events.length;for(;v--;)if(i.events[v][1].start.offset<o&&(!i.events[v][1].end||i.events[v][1].end.offset>o))return;const N=t.events.length;let L=N,j,S;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(j){S=t.events[L][1].end;break}j=!0}for(w(r),v=N;v<t.events.length;)t.events[v][1].end={...S},v++;ot(t.events,L+1,0,t.events.slice(N)),t.events.length=v}}function w(E){let F=n.length;for(;F-- >E;){const z=n[F];t.containerState=z[1],z[0].exit.call(t,e)}n.length=E}function T(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function nc(e,t,n){return de(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Wt(e){if(e===null||Ce(e)||Ft(e))return 1;if(Rn(e))return 2}function Fn(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Or={name:"attention",resolveAll:rc,tokenize:ic};function rc(e,t){let n=-1,r,i,s,o,a,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};Oo(f,-l),Oo(p,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=dt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=dt(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=dt(u,Fn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=dt(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=dt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,ot(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ic(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Wt(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const u=e.exit("attentionSequence"),c=Wt(l),f=!c||c===2&&i||n.includes(l),p=!i||i===2&&c||n.includes(r);return u._open=!!(s===42?f:f&&(i||!p)),u._close=!!(s===42?p:p&&(c||!f)),t(l)}}function Oo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oc={name:"autolink",tokenize:sc};function sc(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(h){return Ze(h)?(e.consume(h),o):h===64?n(h):u(h)}function o(h){return h===43||h===45||h===46||Ye(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Ye(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Pn(h)?n(h):(e.consume(h),l)}function u(h){return h===64?(e.consume(h),c):Yu(h)?(e.consume(h),u):n(h)}function c(h){return Ye(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Ye(h))&&r++<63){const m=h===45?p:f;return e.consume(h),m}return n(h)}}const ln={partial:!0,tokenize:ac};function ac(e,t,n){return r;function r(s){return ue(s)?de(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||J(s)?t(s):n(s)}}const No={continuation:{tokenize:uc},exit:cc,name:"blockQuote",tokenize:lc};function lc(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ue(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function uc(e,t,n){const r=this;return i;function i(o){return ue(o)?de(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(No,t,n)(o)}}function cc(e){e.exit("blockQuote")}const Bo={name:"characterEscape",tokenize:fc};function fc(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Ku(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const $o={name:"characterReference",tokenize:dc};function dc(e,t,n){const r=this;let i=0,s,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,o=Ye,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=Ju,c):(e.enter("characterReferenceValue"),s=7,o=Lr,c(f))}function c(f){if(f===59&&i){const p=e.exit("characterReferenceValue");return o===Ye&&!zr(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<s?(e.consume(f),c):n(f)}}const Uo={partial:!0,tokenize:pc},Ho={concrete:!0,name:"codeFenced",tokenize:hc};function hc(e,t,n){const r=this,i={partial:!0,tokenize:z};let s=0,o=0,a;return l;function l(v){return u(v)}function u(v){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,a=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(v)}function c(v){return v===a?(o++,e.consume(v),c):o<3?n(v):(e.exit("codeFencedFenceSequence"),ue(v)?de(e,f,"whitespace")(v):f(v))}function f(v){return v===null||J(v)?(e.exit("codeFencedFence"),r.interrupt?t(v):e.check(Uo,x,F)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||J(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(v)):ue(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),de(e,h,"whitespace")(v)):v===96&&v===a?n(v):(e.consume(v),p)}function h(v){return v===null||J(v)?f(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||J(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(v)):v===96&&v===a?n(v):(e.consume(v),m)}function x(v){return e.attempt(i,F,y)(v)}function y(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),w}function w(v){return s>0&&ue(v)?de(e,T,"linePrefix",s+1)(v):T(v)}function T(v){return v===null||J(v)?e.check(Uo,x,F)(v):(e.enter("codeFlowValue"),E(v))}function E(v){return v===null||J(v)?(e.exit("codeFlowValue"),T(v)):(e.consume(v),E)}function F(v){return e.exit("codeFenced"),t(v)}function z(v,N,L){let j=0;return S;function S(M){return v.enter("lineEnding"),v.consume(M),v.exit("lineEnding"),O}function O(M){return v.enter("codeFencedFence"),ue(M)?de(v,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):D(M)}function D(M){return M===a?(v.enter("codeFencedFenceSequence"),H(M)):L(M)}function H(M){return M===a?(j++,v.consume(M),H):j>=o?(v.exit("codeFencedFenceSequence"),ue(M)?de(v,U,"whitespace")(M):U(M)):L(M)}function U(M){return M===null||J(M)?(v.exit("codeFencedFence"),N(M)):L(M)}}}function pc(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Nr={name:"codeIndented",tokenize:gc},mc={partial:!0,tokenize:yc};function gc(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),de(e,s,"linePrefix",5)(u)}function s(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):J(u)?e.attempt(mc,o,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||J(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function yc(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):de(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):J(o)?i(o):n(o)}}const xc={name:"codeText",previous:kc,resolve:bc,tokenize:wc};function bc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function kc(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wc(e,t,n){let r=0,i,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,c(f)):J(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||J(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class Sc{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&un(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),un(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),un(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);un(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);un(this.left,n.reverse())}}}function un(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 qo(e){const t={};let n=-1,r,i,s,o,a,l,u;const c=new Sc(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Cc(c,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=c.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return ot(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Cc(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let c,f,p=-1,h=n,m=0,x=0;const y=[x];for(;h;){for(;e.get(++i)[1]!==h;);s.push(i),h._tokenizer||(c=r.sliceStream(h),h.next||c.push(null),f&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(x=p+1,y.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):y.pop(),p=y.length;p--;){const w=a.slice(y[p],y[p+1]),T=s.pop();l.push([T,T+w.length-1]),e.splice(T,2,w)}for(l.reverse(),p=-1;++p<l.length;)u[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return u}const vc={resolve:Tc,tokenize:Ac},Ec={partial:!0,tokenize:_c};function Tc(e){return qo(e),e}function Ac(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):J(a)?e.check(Ec,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function _c(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),de(e,s,"linePrefix")}function s(o){if(o===null||J(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Wo(e,t,n,r,i,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(w),e.exit(s),p):w===null||w===32||w===41||Pn(w)?n(w):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(w))}function p(w){return w===62?(e.enter(s),e.consume(w),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===62?(e.exit("chunkString"),e.exit(a),p(w)):w===null||w===60||J(w)?n(w):(e.consume(w),w===92?m:h)}function m(w){return w===60||w===62||w===92?(e.consume(w),h):h(w)}function x(w){return!c&&(w===null||w===41||Ce(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(w)):c<u&&w===40?(e.consume(w),c++,x):w===41?(e.consume(w),c--,x):w===null||w===32||w===40||Pn(w)?n(w):(e.consume(w),w===92?y:x)}function y(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}function Vo(e,t,n,r,i,s){const o=this;let a=0,l;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(s),c}function c(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(s),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):J(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||J(h)||a++>999?(e.exit("chunkString"),c(h)):(e.consume(h),l||(l=!ue(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function Qo(e,t,n,r,i,s){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,l):n(p)}function l(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(s),u(p))}function u(p){return p===o?(e.exit(s),l(o)):p===null?n(p):J(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),de(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===o||p===null||J(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:c)}function f(p){return p===o||p===92?(e.consume(p),c):c(p)}}function cn(e,t){let n;return r;function r(i){return J(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ue(i)?de(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const jc={name:"definition",tokenize:Dc},Ic={partial:!0,tokenize:Pc};function Dc(e,t,n){const r=this;let i;return s;function s(h){return e.enter("definition"),o(h)}function o(h){return Vo.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Ce(h)?cn(e,u)(h):u(h)}function u(h){return Wo(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(Ic,f,f)(h)}function f(h){return ue(h)?de(e,p,"whitespace")(h):p(h)}function p(h){return h===null||J(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Pc(e,t,n){return r;function r(a){return Ce(a)?cn(e,i)(a):n(a)}function i(a){return Qo(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ue(a)?de(e,o,"whitespace")(a):o(a)}function o(a){return a===null||J(a)?t(a):n(a)}}const Rc={name:"hardBreakEscape",tokenize:Fc};function Fc(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return J(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Mc={name:"headingAtx",resolve:zc,tokenize:Lc};function zc(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ot(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Lc(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||Ce(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||J(c)?(e.exit("atxHeading"),t(c)):ue(c)?de(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Ce(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const Oc=["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"],Go=["pre","script","style","textarea"],Nc={concrete:!0,name:"htmlFlow",resolveTo:Uc,tokenize:Hc},Bc={partial:!0,tokenize:Wc},$c={partial:!0,tokenize:qc};function Uc(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hc(e,t,n){const r=this;let i,s,o,a,l;return u;function u(g){return c(g)}function c(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),f}function f(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),s=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:k):Ze(g)?(e.consume(g),o=String.fromCharCode(g),y):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,m):Ze(g)?(e.consume(g),i=4,r.interrupt?t:k):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:k):n(g)}function m(g){const W="CDATA[";return g===W.charCodeAt(a++)?(e.consume(g),a===W.length?r.interrupt?t:D:m):n(g)}function x(g){return Ze(g)?(e.consume(g),o=String.fromCharCode(g),y):n(g)}function y(g){if(g===null||g===47||g===62||Ce(g)){const W=g===47,pe=o.toLowerCase();return!W&&!s&&Go.includes(pe)?(i=1,r.interrupt?t(g):D(g)):Oc.includes(o.toLowerCase())?(i=6,W?(e.consume(g),w):r.interrupt?t(g):D(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):s?T(g):E(g))}return g===45||Ye(g)?(e.consume(g),o+=String.fromCharCode(g),y):n(g)}function w(g){return g===62?(e.consume(g),r.interrupt?t:D):n(g)}function T(g){return ue(g)?(e.consume(g),T):S(g)}function E(g){return g===47?(e.consume(g),S):g===58||g===95||Ze(g)?(e.consume(g),F):ue(g)?(e.consume(g),E):S(g)}function F(g){return g===45||g===46||g===58||g===95||Ye(g)?(e.consume(g),F):z(g)}function z(g){return g===61?(e.consume(g),v):ue(g)?(e.consume(g),z):E(g)}function v(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),l=g,N):ue(g)?(e.consume(g),v):L(g)}function N(g){return g===l?(e.consume(g),l=null,j):g===null||J(g)?n(g):(e.consume(g),N)}function L(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||Ce(g)?z(g):(e.consume(g),L)}function j(g){return g===47||g===62||ue(g)?E(g):n(g)}function S(g){return g===62?(e.consume(g),O):n(g)}function O(g){return g===null||J(g)?D(g):ue(g)?(e.consume(g),O):n(g)}function D(g){return g===45&&i===2?(e.consume(g),Q):g===60&&i===1?(e.consume(g),Z):g===62&&i===4?(e.consume(g),C):g===63&&i===3?(e.consume(g),k):g===93&&i===5?(e.consume(g),te):J(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Bc,q,H)(g)):g===null||J(g)?(e.exit("htmlFlowData"),H(g)):(e.consume(g),D)}function H(g){return e.check($c,U,q)(g)}function U(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),M}function M(g){return g===null||J(g)?H(g):(e.enter("htmlFlowData"),D(g))}function Q(g){return g===45?(e.consume(g),k):D(g)}function Z(g){return g===47?(e.consume(g),o="",se):D(g)}function se(g){if(g===62){const W=o.toLowerCase();return Go.includes(W)?(e.consume(g),C):D(g)}return Ze(g)&&o.length<8?(e.consume(g),o+=String.fromCharCode(g),se):D(g)}function te(g){return g===93?(e.consume(g),k):D(g)}function k(g){return g===62?(e.consume(g),C):g===45&&i===2?(e.consume(g),k):D(g)}function C(g){return g===null||J(g)?(e.exit("htmlFlowData"),q(g)):(e.consume(g),C)}function q(g){return e.exit("htmlFlow"),t(g)}}function qc(e,t,n){const r=this;return i;function i(o){return J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Wc(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ln,t,n)}}const Vc={name:"htmlText",tokenize:Qc};function Qc(e,t,n){const r=this;let i,s,o;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),z):k===63?(e.consume(k),E):Ze(k)?(e.consume(k),L):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),s=0,m):Ze(k)?(e.consume(k),T):n(k)}function c(k){return k===45?(e.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),p):J(k)?(o=f,Z(k)):(e.consume(k),f)}function p(k){return k===45?(e.consume(k),h):f(k)}function h(k){return k===62?Q(k):k===45?p(k):f(k)}function m(k){const C="CDATA[";return k===C.charCodeAt(s++)?(e.consume(k),s===C.length?x:m):n(k)}function x(k){return k===null?n(k):k===93?(e.consume(k),y):J(k)?(o=x,Z(k)):(e.consume(k),x)}function y(k){return k===93?(e.consume(k),w):x(k)}function w(k){return k===62?Q(k):k===93?(e.consume(k),w):x(k)}function T(k){return k===null||k===62?Q(k):J(k)?(o=T,Z(k)):(e.consume(k),T)}function E(k){return k===null?n(k):k===63?(e.consume(k),F):J(k)?(o=E,Z(k)):(e.consume(k),E)}function F(k){return k===62?Q(k):E(k)}function z(k){return Ze(k)?(e.consume(k),v):n(k)}function v(k){return k===45||Ye(k)?(e.consume(k),v):N(k)}function N(k){return J(k)?(o=N,Z(k)):ue(k)?(e.consume(k),N):Q(k)}function L(k){return k===45||Ye(k)?(e.consume(k),L):k===47||k===62||Ce(k)?j(k):n(k)}function j(k){return k===47?(e.consume(k),Q):k===58||k===95||Ze(k)?(e.consume(k),S):J(k)?(o=j,Z(k)):ue(k)?(e.consume(k),j):Q(k)}function S(k){return k===45||k===46||k===58||k===95||Ye(k)?(e.consume(k),S):O(k)}function O(k){return k===61?(e.consume(k),D):J(k)?(o=O,Z(k)):ue(k)?(e.consume(k),O):j(k)}function D(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,H):J(k)?(o=D,Z(k)):ue(k)?(e.consume(k),D):(e.consume(k),U)}function H(k){return k===i?(e.consume(k),i=void 0,M):k===null?n(k):J(k)?(o=H,Z(k)):(e.consume(k),H)}function U(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Ce(k)?j(k):(e.consume(k),U)}function M(k){return k===47||k===62||Ce(k)?j(k):n(k)}function Q(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Z(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),se}function se(k){return ue(k)?de(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):te(k)}function te(k){return e.enter("htmlTextData"),o(k)}}const Br={name:"labelEnd",resolveAll:Kc,resolveTo:Xc,tokenize:Zc},Gc={tokenize:ef},Yc={tokenize:tf},Jc={tokenize:nf};function Kc(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ot(e,0,e.length,n),e}function Xc(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=dt(a,e.slice(s+1,s+r+3)),a=dt(a,[["enter",c,t]]),a=dt(a,Fn(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=dt(a,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),a=dt(a,e.slice(o+1)),a=dt(a,[["exit",l,t]]),ot(e,s,e.length,a),e}function Zc(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(p){return s?s._inactive?f(p):(o=r.parser.defined.includes(yt(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(Gc,c,o?c:f)(p):p===91?e.attempt(Yc,c,o?u:f)(p):o?c(p):f(p)}function u(p){return e.attempt(Jc,c,f)(p)}function c(p){return t(p)}function f(p){return s._balanced=!0,n(p)}}function ef(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Ce(f)?cn(e,s)(f):s(f)}function s(f){return f===41?c(f):Wo(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return Ce(f)?cn(e,l)(f):c(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?Qo(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return Ce(f)?cn(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function tf(e,t,n){const r=this;return i;function i(a){return Vo.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function nf(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const rf={name:"labelStartImage",resolveAll:Br.resolveAll,tokenize:of};function of(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const sf={name:"labelStartLink",resolveAll:Br.resolveAll,tokenize:af};function af(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const $r={name:"lineEnding",tokenize:lf};function lf(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),de(e,t,"linePrefix")}}const Mn={name:"thematicBreak",tokenize:uf};function uf(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||J(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ue(u)?de(e,a,"whitespace")(u):a(u))}}const tt={continuation:{tokenize:hf},exit:mf,name:"list",tokenize:df},cf={partial:!0,tokenize:gf},ff={partial:!0,tokenize:pf};function df(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Lr(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Mn,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return Lr(h)&&++o<10?(e.consume(h),l):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(ln,r.interrupt?n:c,e.attempt(cf,p,f))}function c(h){return r.containerState.initialBlankLine=!0,s++,p(h)}function f(h){return ue(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function hf(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ln,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,de(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ue(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ff,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,de(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function pf(e,t,n){const r=this;return de(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function mf(e){e.exit(this.containerState.type)}function gf(e,t,n){const r=this;return de(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ue(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Yo={name:"setextUnderline",resolveTo:yf,tokenize:xf};function yf(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function xf(e,t,n){const r=this;let i;return s;function s(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ue(u)?de(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||J(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const bf={tokenize:kf};function kf(e){const t=this,n=e.attempt(ln,r,e.attempt(this.parser.constructs.flowInitial,i,de(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vc,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const wf={resolveAll:Ko()},Sf=Jo("string"),Cf=Jo("text");function Jo(e){return{resolveAll:Ko(e==="text"?vf:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(c){return u(c)?s(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Ko(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function vf(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Ef=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:jc},disable:{null:[]},document:{42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:No},flow:{35:Mc,42:Mn,45:[Yo,Mn],60:Nc,61:Yo,95:Mn,96:Ho,126:Ho},flowInitial:{[-2]:Nr,[-1]:Nr,32:Nr},insideSpan:{null:[Or,wf]},string:{38:$o,92:Bo},text:{[-5]:$r,[-4]:$r,[-3]:$r,33:rf,38:$o,42:Or,60:[oc,Vc],91:sf,92:[Rc,Bo],93:Br,95:Or,96:xc}},Symbol.toStringTag,{value:"Module"}));function Tf(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 i={},s=[];let o=[],a=[];const l={attempt:N(z),check:N(v),consume:T,enter:E,exit:F,interrupt:N(v,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let c=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function f(O){return o=dt(o,O),y(),o[o.length-1]!==null?[]:(L(t,0),u.events=Fn(s,u.events,u),u.events)}function p(O,D){return _f(h(O),D)}function h(O){return Af(o,O)}function m(){const{_bufferIndex:O,_index:D,line:H,column:U,offset:M}=r;return{_bufferIndex:O,_index:D,line:H,column:U,offset:M}}function x(O){i[O.line]=O.column,S()}function y(){let O;for(;r._index<o.length;){const D=o[r._index];if(typeof D=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<D.length;)w(D.charCodeAt(r._bufferIndex));else w(D)}}function w(O){c=c(O)}function T(O){J(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,S()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function E(O,D){const H=D||{};return H.type=O,H.start=m(),u.events.push(["enter",H,u]),a.push(H),H}function F(O){const D=a.pop();return D.end=m(),u.events.push(["exit",D,u]),D}function z(O,D){L(O,D.from)}function v(O,D){D.restore()}function N(O,D){return H;function H(U,M,Q){let Z,se,te,k;return Array.isArray(U)?q(U):"tokenize"in U?q([U]):C(U);function C(ae){return ee;function ee(Ae){const be=Ae!==null&&ae[Ae],Le=Ae!==null&&ae.null,ze=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return q(ze)(Ae)}}function q(ae){return Z=ae,se=0,ae.length===0?Q:g(ae[se])}function g(ae){return ee;function ee(Ae){return k=j(),te=ae,ae.partial||(u.currentConstruct=ae),ae.name&&u.parser.constructs.disable.null.includes(ae.name)?pe():ae.tokenize.call(D?Object.assign(Object.create(u),D):u,l,W,pe)(Ae)}}function W(ae){return O(te,k),M}function pe(ae){return k.restore(),++se<Z.length?g(Z[se]):Q}}}function L(O,D){O.resolveAll&&!s.includes(O)&&s.push(O),O.resolve&&ot(u.events,D,u.events.length-D,O.resolve(u.events.slice(D),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function j(){const O=m(),D=u.previous,H=u.currentConstruct,U=u.events.length,M=Array.from(a);return{from:U,restore:Q};function Q(){r=O,u.previous=D,u.currentConstruct=H,u.events.length=U,a=M,S()}}function S(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Af(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function _f(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
8
|
+
`;break}case-3:{o=`\r
|
|
9
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function jf(e){const r={constructs:Mo([Ef,...(e||{}).extensions||[]]),content:i(Xu),defined:[],document:i(ec),flow:i(bf),lazy:{},string:i(Sf),text:i(Cf)};return r;function i(s){return o;function o(a){return Tf(r,s,a)}}}function If(e){for(;!qo(e););return e}const Xo=/[\0\t\n\r]/g;function Df(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let u,c,f,p,h;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(Xo.lastIndex=f,u=Xo.exec(s),p=u&&u.index!==void 0?u.index:s.length,h=s.charCodeAt(p),!u){t=s.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(s.slice(f,p)),e+=p-f),h){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Pf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Rf(e){return e.replace(Pf,Ff)}function Ff(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return zo(n.slice(s?2:1),s?16:10)}return zr(n)||e}const Zo={}.hasOwnProperty;function Mf(e,t,n){return typeof t!="string"&&(n=t,t=void 0),zf(n)(If(jf(n).document().write(Df()(e,t,!0))))}function zf(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Oe),autolinkProtocol:j,autolinkEmail:j,atxHeading:s(fe),blockQuote:s(Le),characterEscape:j,characterReference:j,codeFenced:s(ze),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(ze,o),codeText:s(We,o),codeTextData:j,data:j,codeFlowValue:j,definition:s(Ie),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Pe),hardBreakEscape:s(De),hardBreakTrailing:s(De),htmlFlow:s(_e,o),htmlFlowData:j,htmlText:s(_e,o),htmlTextData:j,image:s(ne),label:o,link:s(Oe),listItem:s(Re),listItemValue:p,listOrdered:s(je,f),listUnordered:s(je),paragraph:s(bt),reference:g,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(fe),strong:s(at),thematicBreak:s(Ct)},exit:{atxHeading:l(),atxHeadingSequence:z,autolink:l(),autolinkEmail:be,autolinkProtocol:Ae,blockQuote:l(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ae,characterReference:ee,codeFenced:l(y),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:S,codeIndented:l(w),codeText:l(M),codeTextData:S,data:S,definition:l(),definitionDestinationString:F,definitionLabelString:T,definitionTitleString:E,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(H),htmlFlowData:S,htmlText:l(U),htmlTextData:S,image:l(Z),label:te,labelText:se,lineEnding:O,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:k,resourceTitleString:C,resource:q,setextHeading:l(L),setextHeadingLineSequence:N,setextHeadingText:v,strong:l(),thematicBreak:l()}};es(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(I){let $={type:"root",children:[]};const _={stack:[$],tokenStack:[],config:t,enter:a,exit:u,buffer:o,resume:c,data:n},R=[];let V=-1;for(;++V<I.length;)if(I[V][1].type==="listOrdered"||I[V][1].type==="listUnordered")if(I[V][0]==="enter")R.push(V);else{const he=R.pop();V=i(I,he,V)}for(V=-1;++V<I.length;){const he=t[I[V][0]];Zo.call(he,I[V][1].type)&&he[I[V][1].type].call(Object.assign({sliceSerialize:I[V][2].sliceSerialize},_),I[V][1])}if(_.tokenStack.length>0){const he=_.tokenStack[_.tokenStack.length-1];(he[1]||ts).call(_,void 0,he[0])}for($.position={start:It(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:It(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<t.transforms.length;)$=t.transforms[V]($)||$;return $}function i(I,$,_){let R=$-1,V=-1,he=!1,Ve,Ne,Fe,ut;for(;++R<=_;){const ve=I[R];switch(ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ve[0]==="enter"?V++:V--,ut=void 0;break}case"lineEndingBlank":{ve[0]==="enter"&&(Ve&&!ut&&!V&&!Fe&&(Fe=R),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!V&&ve[0]==="enter"&&ve[1].type==="listItemPrefix"||V===-1&&ve[0]==="exit"&&(ve[1].type==="listUnordered"||ve[1].type==="listOrdered")){if(Ve){let $e=R;for(Ne=void 0;$e--;){const Qe=I[$e];if(Qe[1].type==="lineEnding"||Qe[1].type==="lineEndingBlank"){if(Qe[0]==="exit")continue;Ne&&(I[Ne][1].type="lineEndingBlank",he=!0),Qe[1].type="lineEnding",Ne=$e}else if(!(Qe[1].type==="linePrefix"||Qe[1].type==="blockQuotePrefix"||Qe[1].type==="blockQuotePrefixWhitespace"||Qe[1].type==="blockQuoteMarker"||Qe[1].type==="listItemIndent"))break}Fe&&(!Ne||Fe<Ne)&&(Ve._spread=!0),Ve.end=Object.assign({},Ne?I[Ne][1].start:ve[1].end),I.splice(Ne||R,0,["exit",Ve,ve[2]]),R++,_++}if(ve[1].type==="listItemPrefix"){const $e={type:"listItem",_spread:!1,start:Object.assign({},ve[1].start),end:void 0};Ve=$e,I.splice(R,0,["enter",$e,ve[2]]),R++,_++,Fe=void 0,ut=!0}}}return I[$][1]._spread=he,_}function s(I,$){return _;function _(R){a.call(this,I(R),R),$&&$.call(this,R)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(I,$,_){this.stack[this.stack.length-1].children.push(I),this.stack.push(I),this.tokenStack.push([$,_||void 0]),I.position={start:It($.start),end:void 0}}function l(I){return $;function $(_){I&&I.call(this,_),u.call(this,_)}}function u(I,$){const _=this.stack.pop(),R=this.tokenStack.pop();if(R)R[0].type!==I.type&&($?$.call(this,I,R[0]):(R[1]||ts).call(this,I,R[0]));else throw new Error("Cannot close `"+I.type+"` ("+sn({start:I.start,end:I.end})+"): it’s not open");_.position.end=It(I.end)}function c(){return Mr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(I){if(this.data.expectingFirstListItemValue){const $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(I),10),this.data.expectingFirstListItemValue=void 0}}function h(){const I=this.resume(),$=this.stack[this.stack.length-1];$.lang=I}function m(){const I=this.resume(),$=this.stack[this.stack.length-1];$.meta=I}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I.replace(/(\r?\n|\r)$/g,"")}function T(I){const $=this.resume(),_=this.stack[this.stack.length-1];_.label=$,_.identifier=yt(this.sliceSerialize(I)).toLowerCase()}function E(){const I=this.resume(),$=this.stack[this.stack.length-1];$.title=I}function F(){const I=this.resume(),$=this.stack[this.stack.length-1];$.url=I}function z(I){const $=this.stack[this.stack.length-1];if(!$.depth){const _=this.sliceSerialize(I).length;$.depth=_}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function N(I){const $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(I).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function j(I){const _=this.stack[this.stack.length-1].children;let R=_[_.length-1];(!R||R.type!=="text")&&(R=lt(),R.position={start:It(I.start),end:void 0},_.push(R)),this.stack.push(R)}function S(I){const $=this.stack.pop();$.value+=this.sliceSerialize(I),$.position.end=It(I.end)}function O(I){const $=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _=$.children[$.children.length-1];_.position.end=It(I.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes($.type)&&(j.call(this,I),S.call(this,I))}function D(){this.data.atHardBreak=!0}function H(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I}function U(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I}function M(){const I=this.resume(),$=this.stack[this.stack.length-1];$.value=I}function Q(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=$,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function Z(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=$,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function se(I){const $=this.sliceSerialize(I),_=this.stack[this.stack.length-2];_.label=Rf($),_.identifier=yt($).toLowerCase()}function te(){const I=this.stack[this.stack.length-1],$=this.resume(),_=this.stack[this.stack.length-1];if(this.data.inReference=!0,_.type==="link"){const R=I.children;_.children=R}else _.alt=$}function k(){const I=this.resume(),$=this.stack[this.stack.length-1];$.url=I}function C(){const I=this.resume(),$=this.stack[this.stack.length-1];$.title=I}function q(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function W(I){const $=this.resume(),_=this.stack[this.stack.length-1];_.label=$,_.identifier=yt(this.sliceSerialize(I)).toLowerCase(),this.data.referenceType="full"}function pe(I){this.data.characterReferenceType=I.type}function ae(I){const $=this.sliceSerialize(I),_=this.data.characterReferenceType;let R;_?(R=zo($,_==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):R=zr($);const V=this.stack[this.stack.length-1];V.value+=R}function ee(I){const $=this.stack.pop();$.position.end=It(I.end)}function Ae(I){S.call(this,I);const $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(I)}function be(I){S.call(this,I);const $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(I)}function Le(){return{type:"blockquote",children:[]}}function ze(){return{type:"code",lang:null,meta:null,value:""}}function We(){return{type:"inlineCode",value:""}}function Ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function fe(){return{type:"heading",depth:0,children:[]}}function De(){return{type:"break"}}function _e(){return{type:"html",value:""}}function ne(){return{type:"image",title:null,url:"",alt:null}}function Oe(){return{type:"link",title:null,url:"",children:[]}}function je(I){return{type:"list",ordered:I.type==="listOrdered",start:null,spread:I._spread,children:[]}}function Re(I){return{type:"listItem",spread:I._spread,checked:null,children:[]}}function bt(){return{type:"paragraph",children:[]}}function at(){return{type:"strong",children:[]}}function lt(){return{type:"text",value:""}}function Ct(){return{type:"thematicBreak"}}}function It(e){return{line:e.line,column:e.column,offset:e.offset}}function es(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?es(e,r):Lf(e,r)}}function Lf(e,t){let n;for(n in t)if(Zo.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 ts(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sn({start:t.start,end:t.end})+") is still open")}function Of(e){const t=this;t.parser=n;function n(r){return Mf(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Nf(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)}function Bf(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
10
|
+
`}]}function $f(e,t){const n=t.value?t.value+`
|
|
11
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Uf(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hf(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qf(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=qt(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Wf(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vf(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ns(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Qf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ns(e,t);const i={src:qt(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Gf(e,t){const n={src:qt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Yf(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)}function Jf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ns(e,t);const i={href:qt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Kf(e,t){const n={href:qt(t.url)};t.title!==null&&t.title!==void 0&&(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)}function Xf(e,t,n){const r=e.all(t),i=n?Zf(n):rs(t),s={},o=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
12
|
+
`}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
13
|
+
`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function Zf(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=rs(n[r])}return t}function rs(e){const t=e.spread;return t??e.children.length>1}function ed(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function td(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nd(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rd(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function id(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=jr(t.children[1]),l=So(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function od(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const f=t.children[l],p={},h=o?o[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:s,properties:p,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),u.push(m)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function sd(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const is=9,os=32;function ad(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(ss(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(ss(t.slice(i),i>0,!1)),s.join("")}function ss(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===is||s===os;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===is||s===os;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ld(e,t){const n={type:"text",value:ad(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ud(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cd={blockquote:Nf,break:Bf,code:$f,delete:Uf,emphasis:Hf,footnoteReference:qf,heading:Wf,html:Vf,imageReference:Qf,image:Gf,inlineCode:Yf,linkReference:Jf,link:Kf,listItem:Xf,list:ed,paragraph:td,root:nd,strong:rd,table:id,tableCell:sd,tableRow:od,text:ld,thematicBreak:ud,toml:zn,yaml:zn,definition:zn,footnoteDefinition:zn};function zn(){}const as=-1,Ln=0,fn=1,On=2,Ur=3,Hr=4,qr=5,Wr=6,ls=7,us=8,cs=typeof self=="object"?self:globalThis,fd=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Ln:case as:return n(o,i);case fn:{const a=n([],i);for(const l of o)a.push(r(l));return a}case On:{const a=n({},i);for(const[l,u]of o)a[r(l)]=r(u);return a}case Ur:return n(new Date(o),i);case Hr:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case qr:{const a=n(new Map,i);for(const[l,u]of o)a.set(r(l),r(u));return a}case Wr:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case ls:{const{name:a,message:l}=o;return n(new cs[a](l),i)}case us:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new cs[s](o),i)};return r},fs=e=>fd(new Map,e)(0),Vt="",{toString:dd}={},{keys:hd}=Object,dn=e=>{const t=typeof e;if(t!=="object"||!e)return[Ln,t];const n=dd.call(e).slice(8,-1);switch(n){case"Array":return[fn,Vt];case"Object":return[On,Vt];case"Date":return[Ur,Vt];case"RegExp":return[Hr,Vt];case"Map":return[qr,Vt];case"Set":return[Wr,Vt];case"DataView":return[fn,n]}return n.includes("Array")?[fn,n]:n.includes("Error")?[ls,n]:[On,n]},Nn=([e,t])=>e===Ln&&(t==="function"||t==="symbol"),pd=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=dn(o);switch(a){case Ln:{let c=o;switch(l){case"bigint":a=us,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([as],o)}return i([a,c],o)}case fn:{if(l){let p=o;return l==="DataView"?p=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(o)),i([l,[...p]],o)}const c=[],f=i([a,c],o);for(const p of o)c.push(s(p));return f}case On:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const c=[],f=i([a,c],o);for(const p of hd(o))(e||!Nn(dn(o[p])))&&c.push([s(p),s(o[p])]);return f}case Ur:return i([a,o.toISOString()],o);case Hr:{const{source:c,flags:f}=o;return i([a,{source:c,flags:f}],o)}case qr:{const c=[],f=i([a,c],o);for(const[p,h]of o)(e||!(Nn(dn(p))||Nn(dn(h))))&&c.push([s(p),s(h)]);return f}case Wr:{const c=[],f=i([a,c],o);for(const p of o)(e||!Nn(dn(p)))&&c.push(s(p));return f}}const{message:u}=o;return i([a,{name:l,message:u}],o)};return s},ds=(e,{json:t,lossy:n}={})=>{const r=[];return pd(!(t||n),!!t,new Map,r)(e),r},hn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fs(ds(e,t)):structuredClone(e):(e,t)=>fs(ds(e,t));function md(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 gd(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yd(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||md,r=e.options.footnoteBackLabel||gd,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),f=String(u.identifier).toUpperCase(),p=qt(f.toLowerCase());let h=0;const m=[],x=e.footnoteCounts.get(f);for(;x!==void 0&&++h<=x;){m.length>0&&m.push({type:"text",value:" "});let T=typeof n=="string"?n:n(l,h);typeof T=="string"&&(T={type:"text",value:T}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const y=c[c.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const T=y.children[y.children.length-1];T&&T.type==="text"?T.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else c.push(...m);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(c,!0)};e.patch(u,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...hn(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
14
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
15
|
+
`}]}}const Bn=(function(e){if(e==null)return wd;if(typeof e=="function")return $n(e);if(typeof e=="object")return Array.isArray(e)?xd(e):bd(e);if(typeof e=="string")return kd(e);throw new Error("Expected function, string, or object as test")});function xd(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Bn(e[n]);return $n(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function bd(e){const t=e;return $n(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function kd(e){return $n(t);function t(n){return n&&n.type===e}}function $n(e){return t;function t(n,r,i){return!!(Sd(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function wd(){return!0}function Sd(e){return e!==null&&typeof e=="object"&&"type"in e}function Jb(e){return e}const hs=[],Cd=!0,Vr=!1,vd="skip";function ps(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Bn(i),o=r?-1:1;a(e,void 0,[])();function a(l,u,c){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=hs,m,x,y;if((!t||s(l,u,c[c.length-1]||void 0))&&(h=Ed(n(l,c)),h[0]===Vr))return h;if("children"in l&&l.children){const w=l;if(w.children&&h[0]!==vd)for(x=(r?w.children.length:-1)+o,y=c.concat(w);x>-1&&x<w.children.length;){const T=w.children[x];if(m=a(T,x,y)(),m[0]===Vr)return m;x=typeof m[1]=="number"?m[1]:x+o}}return h}}}function Ed(e){return Array.isArray(e)?e:typeof e=="number"?[Cd,e]:e==null?hs:[e]}function Qr(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),ps(e,s,a,i);function a(l,u){const c=u[u.length-1],f=c?c.children.indexOf(l):void 0;return o(l,f,c)}}const Gr={}.hasOwnProperty,Td={};function Ad(e,t){const n=t||Td,r=new Map,i=new Map,s=new Map,o={...cd,...n.handlers},a={all:u,applyData:jd,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:_d,wrap:Dd};return Qr(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,p=String(c.identifier).toUpperCase();f.has(p)||f.set(p,c)}}),a;function l(c,f){const p=c.type,h=a.handlers[p];if(Gr.call(a.handlers,p)&&h)return h(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in c){const{children:x,...y}=c,w=hn(y);return w.children=a.all(c),w}return hn(c)}return(a.options.unknownHandler||Id)(a,c,f)}function u(c){const f=[];if("children"in c){const p=c.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],c);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ms(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=ms(x.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function _d(e,t){e.position&&(t.position=vo(e))}function jd(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,hn(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Id(e,t){const n=t.data||{},r="value"in t&&!(Gr.call(n,"hProperties")||Gr.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Dd(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
16
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
17
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
18
|
+
`}),n}function ms(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gs(e,t){const n=Ad(e,t),r=n.one(e,void 0),i=yd(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
19
|
+
`},i),s}function Pd(e,t){return e&&"run"in e?async function(n,r){const i=gs(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gs(n,{file:r,...e||t})}}function ys(e){if(e)throw e}var Yr,xs;function Rd(){if(xs)return Yr;xs=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var c=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},o=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(e.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return Yr=function l(){var u,c,f,p,h,m,x=arguments[0],y=1,w=arguments.length,T=!1;for(typeof x=="boolean"&&(T=x,x=arguments[1]||{},y=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});y<w;++y)if(u=arguments[y],u!=null)for(c in u)f=a(x,c),p=a(u,c),x!==p&&(T&&p&&(s(p)||(h=i(p)))?(h?(h=!1,m=f&&i(f)?f:[]):m=f&&s(f)?f:{},o(x,{name:c,newValue:l(T,m,p)})):typeof p<"u"&&o(x,{name:c,newValue:p}));return x},Yr}var Fd=Rd();const Jr=no(Fd);function Kr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Md(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...u){const c=e[++s];let f=-1;if(l){o(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?zd(c,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function zd(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const wt={basename:Ld,dirname:Od,extname:Nd,join:Bd,sep:"/"};function Ld(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pn(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Od(e){if(pn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Nd(e){pn(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Bd(...e){let t=-1,n;for(;++t<e.length;)pn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":$d(n)}function $d(e){pn(e);const t=e.codePointAt(0)===47;let n=Ud(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ud(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function pn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Hd={cwd:qd};function qd(){return"/"}function Xr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Wd(e){if(typeof e=="string")e=new URL(e);else if(!Xr(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(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Vd(e)}function Vd(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Zr=["history","path","basename","stem","extname","dirname"];class bs{constructor(t){let n;t?Xr(t)?n={path:t}:typeof t=="string"||Qd(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Hd.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zr.length;){const s=Zr[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Zr.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?wt.basename(this.path):void 0}set basename(t){ti(t,"basename"),ei(t,"basename"),this.path=wt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wt.dirname(this.path):void 0}set dirname(t){ks(this.basename,"dirname"),this.path=wt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wt.extname(this.path):void 0}set extname(t){if(ei(t,"extname"),ks(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Xr(t)&&(t=Wd(t)),ti(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wt.basename(this.path,this.extname):void 0}set stem(t){ti(t,"stem"),ei(t,"stem"),this.path=wt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ge(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ei(e,t){if(e&&e.includes(wt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wt.sep+"`")}function ti(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ks(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Qd(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Gd=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Yd={}.hasOwnProperty;class ni extends Gd{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=Md()}copy(){const t=new ni;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Jr(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(oi("data",this.frozen),this.namespace[t]=n,this):Yd.call(this.namespace,t)&&this.namespace[t]||void 0:t?(oi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Un(t),r=this.parser||this.Parser;return ri("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ri("process",this.parser||this.Parser),ii("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Un(t),l=r.parse(a);r.run(l,a,function(c,f,p){if(c||!f||!p)return u(c);const h=f,m=r.stringify(h,p);Xd(m)?p.value=m:p.result=m,u(c,p)});function u(c,f){c||!f?o(c):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),ri("processSync",this.parser||this.Parser),ii("processSync",this.compiler||this.Compiler),this.process(t,i),Ss("processSync","process",n),r;function i(s,o){n=!0,ys(s),r=o}}run(t,n,r){ws(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=Un(n);i.run(t,l,u);function u(c,f,p){const h=f||t;c?a(c):o?o(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Ss("runSync","run",r),i;function s(o,a){ys(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Un(n),i=this.compiler||this.Compiler;return ii("stringify",i),ws(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(oi("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=Jr(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...c]);else if(c.length>0){let[h,...m]=c;const x=r[p][1];Kr(x)&&Kr(h)&&(h=Jr(!0,x,h)),r[p]=[u,h,...m]}}}}const Jd=new ni().freeze();function ri(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ii(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function oi(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 ws(e){if(!Kr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ss(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Un(e){return Kd(e)?e:new bs(e)}function Kd(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Xd(e){return typeof e=="string"||Zd(e)}function Zd(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eh="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cs=[],vs={allowDangerousHtml:!0},th=/^(https?|ircs?|mailto|xmpp)$/i,nh=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rh(e){const t=ih(e),n=oh(e);return sh(t.runSync(t.parse(n),n),e)}function ih(e){const t=e.rehypePlugins||Cs,n=e.remarkPlugins||Cs,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vs}:vs;return Jd().use(Of).use(n).use(Pd,r).use(t)}function oh(e){const t=e.children||"",n=new bs;return typeof t=="string"&&(n.value=t),n}function sh(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||ah;for(const c of nh)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+eh+c.id,void 0);return Qr(e,u),ju(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function u(c,f,p){if(c.type==="raw"&&p&&typeof f=="number")return o?p.children.splice(f,1):p.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let h;for(h in Fr)if(Object.hasOwn(Fr,h)&&Object.hasOwn(c.properties,h)){const m=c.properties[h],x=Fr[h];(x===null||x.includes(c.tagName))&&(c.properties[h]=l(String(m||""),h,c))}}if(c.type==="element"){let h=n?!n.includes(c.tagName):s?s.includes(c.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(c,f,p)),h&&p&&typeof f=="number")return a&&c.children?p.children.splice(f,1,...c.children):p.children.splice(f,1),f}}}function ah(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||th.test(e.slice(0,t))?e:""}function Es(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function lh(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uh(e,t,n){const i=Bn((n||{}).ignore||[]),s=ch(t);let o=-1;for(;++o<s.length;)ps(e,"text",a);function a(u,c){let f=-1,p;for(;++f<c.length;){const h=c[f],m=p?p.children:void 0;if(i(h,m?m.indexOf(h):void 0,p))return;p=h}if(p)return l(u,c)}function l(u,c){const f=c[c.length-1],p=s[o][0],h=s[o][1];let m=0;const y=f.children.indexOf(u);let w=!1,T=[];p.lastIndex=0;let E=p.exec(u.value);for(;E;){const F=E.index,z={index:E.index,input:E.input,stack:[...c,u]};let v=h(...E,z);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?p.lastIndex=F+1:(m!==F&&T.push({type:"text",value:u.value.slice(m,F)}),Array.isArray(v)?T.push(...v):v&&T.push(v),m=F+E[0].length,w=!0),!p.global)break;E=p.exec(u.value)}return w?(m<u.value.length&&T.push({type:"text",value:u.value.slice(m)}),f.children.splice(y,1,...T)):T=[u],y+T.length}}function ch(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([fh(i[0]),dh(i[1])])}return t}function fh(e){return typeof e=="string"?new RegExp(lh(e),"g"):e}function dh(e){return typeof e=="function"?e:function(){return e}}const si="phrasing",ai=["autolink","link","image","label"];function hh(){return{transforms:[kh],enter:{literalAutolink:mh,literalAutolinkEmail:li,literalAutolinkHttp:li,literalAutolinkWww:li},exit:{literalAutolink:bh,literalAutolinkEmail:xh,literalAutolinkHttp:gh,literalAutolinkWww:yh}}}function ph(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:si,notInConstruct:ai},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:si,notInConstruct:ai},{character:":",before:"[ps]",after:"\\/",inConstruct:si,notInConstruct:ai}]}}function mh(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function li(e){this.config.enter.autolinkProtocol.call(this,e)}function gh(e){this.config.exit.autolinkProtocol.call(this,e)}function yh(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function xh(e){this.config.exit.autolinkEmail.call(this,e)}function bh(e){this.exit(e)}function kh(e){uh(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wh],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Sh]],{ignore:["link","linkReference"]})}function wh(e,t,n,r,i){let s="";if(!Ts(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Ch(n)))return!1;const o=vh(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Sh(e,t,n,r){return!Ts(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Ch(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function vh(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Es(e,"(");let s=Es(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Ts(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ft(n)||Rn(n))&&(!t||n!==47)}As.peek=Rh;function Eh(){this.buffer()}function Th(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ah(){this.buffer()}function _h(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function jh(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ih(e){this.exit(e)}function Dh(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ph(e){this.exit(e)}function Rh(){return"["}function As(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function Fh(){return{enter:{gfmFootnoteCallString:Eh,gfmFootnoteCall:Th,gfmFootnoteDefinitionLabelString:Ah,gfmFootnoteDefinition:_h},exit:{gfmFootnoteCallString:jh,gfmFootnoteCall:Ih,gfmFootnoteDefinitionLabelString:Dh,gfmFootnoteDefinition:Ph}}}function Mh(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:As},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const u=s.enter("footnoteDefinition"),c=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),c(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
20
|
+
`:" ")+s.indentLines(s.containerFlow(r,a.current()),t?_s:zh))),u(),l}}function zh(e,t,n){return t===0?e:_s(e,t,n)}function _s(e,t,n){return(n?"":" ")+e}const Lh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];js.peek=Uh;function Oh(){return{canContainEols:["delete"],enter:{strikethrough:Bh},exit:{strikethrough:$h}}}function Nh(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Lh}],handlers:{delete:js}}}function Bh(e){this.enter({type:"delete",children:[]},e)}function $h(e){this.exit(e)}function js(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function Uh(){return"~"}function Hh(e){return e.length}function qh(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Hh,s=[],o=[],a=[],l=[];let u=0,c=-1;for(;++c<e.length;){const x=[],y=[];let w=-1;for(e[c].length>u&&(u=e[c].length);++w<e[c].length;){const T=Wh(e[c][w]);if(n.alignDelimiters!==!1){const E=i(T);y[w]=E,(l[w]===void 0||E>l[w])&&(l[w]=E)}x.push(T)}o[c]=x,a[c]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=Is(r[f]);else{const x=Is(r);for(;++f<u;)s[f]=x}f=-1;const p=[],h=[];for(;++f<u;){const x=s[f];let y="",w="";x===99?(y=":",w=":"):x===108?y=":":x===114&&(w=":");let T=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-w.length);const E=y+"-".repeat(T)+w;n.alignDelimiters!==!1&&(T=y.length+T+w.length,T>l[f]&&(l[f]=T),h[f]=T),p[f]=E}o.splice(1,0,p),a.splice(1,0,h),c=-1;const m=[];for(;++c<o.length;){const x=o[c],y=a[c];f=-1;const w=[];for(;++f<u;){const T=x[f]||"";let E="",F="";if(n.alignDelimiters!==!1){const z=l[f]-(y[f]||0),v=s[f];v===114?E=" ".repeat(z):v===99?z%2?(E=" ".repeat(z/2+.5),F=" ".repeat(z/2-.5)):(E=" ".repeat(z/2),F=E):F=" ".repeat(z)}n.delimiterStart!==!1&&!f&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||f)&&w.push(" "),n.alignDelimiters!==!1&&w.push(E),w.push(T),n.alignDelimiters!==!1&&w.push(F),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&w.push("|")}m.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return m.join(`
|
|
21
|
+
`)}function Wh(e){return e==null?"":String(e)}function Is(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Vh(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),Qh);return i(),o}function Qh(e,t,n){return">"+(n?"":" ")+e}function Gh(e,t){return Ds(e,t.inConstruct,!0)&&!Ds(e,t.notInConstruct,!1)}function Ds(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Ps(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
22
|
+
`&&Gh(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
23
|
+
`}function Yh(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function Jh(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Kh(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Xh(e,t,n,r){const i=Kh(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Jh(e,n)){const f=n.enter("codeIndented"),p=n.indentLines(s,Zh);return f(),p}const a=n.createTracker(r),l=i.repeat(Math.max(Yh(s,i)+1,3)),u=n.enter("codeFenced");let c=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${o}`);c+=a.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);c+=a.move(" "),c+=a.move(n.safe(e.meta,{before:c,after:`
|
|
24
|
+
`,encode:["`"],...a.current()})),f()}return c+=a.move(`
|
|
25
|
+
`),s&&(c+=a.move(s+`
|
|
26
|
+
`)),c+=a.move(l),u(),c}function Zh(e,t,n){return(n?"":" ")+e}function ui(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ep(e,t,n,r){const i=ui(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
27
|
+
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),o(),u}function tp(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hn(e,t,n){const r=Wt(e),i=Wt(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Rs.peek=np;function Rs(e,t,n,r){const i=tp(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),c=Hn(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=mn(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=Hn(r.after.charCodeAt(0),f,i);p.inside&&(l=l.slice(0,-1)+mn(f));const h=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+l+h}function np(e,t,n){return n.options.emphasis||"*"}function rp(e,t){let n=!1;return Qr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Vr}),!!((!e.depth||e.depth<3)&&Mr(e)&&(t.options.setext||n))}function ip(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(rp(e,n)){const c=n.enter("headingSetext"),f=n.enter("phrasing"),p=n.containerPhrasing(e,{...s.current(),before:`
|
|
28
|
+
`,after:`
|
|
29
|
+
`});return f(),c(),p+`
|
|
30
|
+
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
31
|
+
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
32
|
+
`,...s.current()});return/^[\t ]/.test(u)&&(u=mn(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),l(),a(),u}Fs.peek=op;function Fs(e){return e.value||""}function op(){return"<"}Ms.peek=sp;function Ms(e,t,n,r){const i=ui(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),o(),u}function sp(){return"!"}zs.peek=ap;function zs(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function ap(){return"!"}Ls.peek=lp;function Ls(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function lp(){return"`"}function Os(e,t){const n=Mr(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ns.peek=up;function Ns(e,t,n,r){const i=ui(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Os(e,n)){const c=n.stack;n.stack=[],a=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),a(),n.stack=c,f}a=n.enter("link"),l=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=o.move(" "+i),u+=o.move(n.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),l()),u+=o.move(")"),a(),u}function up(e,t,n){return Os(e,n)?"<":"["}Bs.peek=cp;function Bs(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function cp(){return"["}function ci(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fp(e){const t=ci(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function dp(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function $s(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hp(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?dp(n):ci(n);const a=e.ordered?o==="."?")":".":fp(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),$s(n)===o&&c){let f=-1;for(;++f<e.children.length;){const p=e.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),u}function pp(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function mp(e,t,n,r){const i=pp(n);let s=n.bulletCurrent||ci(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),c);return l(),u;function c(f,p,h){return p?(h?"":" ".repeat(o))+f:(h?s:s+" ".repeat(o-s.length))+f}}function gp(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const yp=Bn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function xp(e,t,n,r){return(e.children.some(function(o){return yp(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function bp(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Us.peek=kp;function Us(e,t,n,r){const i=bp(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),c=Hn(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=mn(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=Hn(r.after.charCodeAt(0),f,i);p.inside&&(l=l.slice(0,-1)+mn(f));const h=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+l+h}function kp(e,t,n){return n.options.strong||"*"}function wp(e,t,n,r){return n.safe(e.value,r)}function Sp(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Cp(e,t,n){const r=($s(n)+(n.options.ruleSpaces?" ":"")).repeat(Sp(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Hs={blockquote:Vh,break:Ps,code:Xh,definition:ep,emphasis:Rs,hardBreak:Ps,heading:ip,html:Fs,image:Ms,imageReference:zs,inlineCode:Ls,link:Ns,linkReference:Bs,list:hp,listItem:mp,paragraph:gp,root:xp,strong:Us,text:wp,thematicBreak:Cp};function vp(){return{enter:{table:Ep,tableData:qs,tableHeader:qs,tableRow:Ap},exit:{codeText:_p,table:Tp,tableData:fi,tableHeader:fi,tableRow:fi}}}function Ep(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Tp(e){this.exit(e),this.data.inTable=void 0}function Ap(e){this.enter({type:"tableRow",children:[]},e)}function fi(e){this.exit(e)}function qs(e){this.enter({type:"tableCell",children:[]},e)}function _p(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,jp));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function jp(e,t){return t==="|"?t:e}function Ip(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
33
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:l,tableRow:a}};function o(h,m,x,y){return u(c(h,x,y),h.align)}function a(h,m,x,y){const w=f(h,x,y),T=u([w]);return T.slice(0,T.indexOf(`
|
|
34
|
+
`))}function l(h,m,x,y){const w=x.enter("tableCell"),T=x.enter("phrasing"),E=x.containerPhrasing(h,{...y,before:s,after:s});return T(),w(),E}function u(h,m){return qh(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function c(h,m,x){const y=h.children;let w=-1;const T=[],E=m.enter("table");for(;++w<y.length;)T[w]=f(y[w],m,x);return E(),T}function f(h,m,x){const y=h.children;let w=-1;const T=[],E=m.enter("tableRow");for(;++w<y.length;)T[w]=l(y[w],h,m,x);return E(),T}function p(h,m,x){let y=Hs.inlineCode(h,m,x);return x.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Dp(){return{exit:{taskListCheckValueChecked:Ws,taskListCheckValueUnchecked:Ws,paragraph:Rp}}}function Pp(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Fp}}}function Ws(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Rp(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Fp(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Hs.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+o}}function Mp(){return[hh(),Fh(),Oh(),vp(),Dp()]}function zp(e){return{extensions:[ph(),Mh(e),Nh(),Ip(e),Pp()]}}const Lp={tokenize:Hp,partial:!0},Vs={tokenize:qp,partial:!0},Qs={tokenize:Wp,partial:!0},Gs={tokenize:Vp,partial:!0},Op={tokenize:Qp,partial:!0},Ys={name:"wwwAutolink",tokenize:$p,previous:Ks},Js={name:"protocolAutolink",tokenize:Up,previous:Xs},Et={name:"emailAutolink",tokenize:Bp,previous:Zs},St={};function Np(){return{text:St}}let Mt=48;for(;Mt<123;)St[Mt]=Et,Mt++,Mt===58?Mt=65:Mt===91&&(Mt=97);St[43]=Et,St[45]=Et,St[46]=Et,St[95]=Et,St[72]=[Et,Js],St[104]=[Et,Js],St[87]=[Et,Ys],St[119]=[Et,Ys];function Bp(e,t,n){const r=this;let i,s;return o;function o(f){return!di(f)||!Zs.call(r,r.previous)||hi(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return di(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(Op,c,u)(f):f===45||f===95||Ye(f)?(s=!0,e.consume(f),l):c(f)}function u(f){return e.consume(f),i=!0,l}function c(f){return s&&i&&Ze(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function $p(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Ks.call(r,r.previous)||hi(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Lp,e.attempt(Vs,e.attempt(Qs,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Up(e,t,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&Xs.call(r,r.previous)&&!hi(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(Ze(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?u:(s=!0,l)):n(f)}function u(f){return f===null||Pn(f)||Ce(f)||Ft(f)||Rn(f)?n(f):e.attempt(Vs,e.attempt(Qs,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Hp(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function qp(e,t,n){let r,i,s;return o;function o(u){return u===46||u===95?e.check(Gs,l,a)(u):u===null||Ce(u)||Ft(u)||u!==45&&Rn(u)?l(u):(s=!0,e.consume(u),o)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function l(u){return i||r||!s?n(u):t(u)}}function Wp(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Gs,t,s)(o):o===null||Ce(o)||Ft(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function Vp(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||Ce(a)||Ft(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Ce(a)||Ft(a)?t(a):r(a)}function s(a){return Ze(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):Ze(a)?(e.consume(a),o):n(a)}}function Qp(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Ye(s)?n(s):t(s)}}function Ks(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ce(e)}function Xs(e){return!Ze(e)}function Zs(e){return!(e===47||di(e))}function di(e){return e===43||e===45||e===46||e===95||Ye(e)}function hi(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Gp={tokenize:nm,partial:!0};function Yp(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Zp,continuation:{tokenize:em},exit:tm}},text:{91:{name:"gfmFootnoteCall",tokenize:Xp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Jp,resolveTo:Kp}}}}function Jp(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const u=yt(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Kp(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Xp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||Ce(f))return n(f);if(f===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(yt(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ce(f)||(o=!0),s++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function Zp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(m)}function c(m){if(o>999||m===93&&!a||m===null||m===91||Ce(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return s=yt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ce(m)||(a=!0),o++,e.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,c):c(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),de(e,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return t(m)}}function em(e,t,n){return e.check(ln,t,e.attempt(Gp,t,n))}function tm(e){e.exit("gfmFootnoteDefinition")}function nm(e,t,n){const r=this;return de(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function rm(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let u=l;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[l][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[l][1].end)},f={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[l][1].start)},p=[["enter",c,a],["enter",o[u][1],a],["exit",o[u][1],a],["enter",f,a]],h=a.parser.constructs.insideSpan.null;h&&ot(p,p.length,0,Fn(h,o.slice(u+1,l),a)),ot(p,p.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",c,a]]),ot(o,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const u=this.previous,c=this.events;let f=0;return p;function p(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const x=Wt(u);if(m===126)return f>1?l(m):(o.consume(m),f++,h);if(f<2&&!n)return l(m);const y=o.exit("strikethroughSequenceTemporary"),w=Wt(m);return y._open=!w||w===2&&!!x,y._close=!x||x===2&&!!w,a(m)}}}class im{constructor(){this.map=[]}add(t,n,r){om(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function om(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function sm(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function am(){return{flow:{null:{name:"table",tokenize:lm,resolveAll:um}}}}function lm(e,t,n){const r=this;let i=0,s=0,o;return a;function a(S){let O=r.events.length-1;for(;O>-1;){const U=r.events[O][1].type;if(U==="lineEnding"||U==="linePrefix")O--;else break}const D=O>-1?r.events[O][1].type:null,H=D==="tableHead"||D==="tableRow"?v:l;return H===v&&r.parser.lazy[r.now().line]?n(S):H(S)}function l(S){return e.enter("tableHead"),e.enter("tableRow"),u(S)}function u(S){return S===124||(o=!0,s+=1),c(S)}function c(S){return S===null?n(S):J(S)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),h):n(S):ue(S)?de(e,c,"whitespace")(S):(s+=1,o&&(o=!1,i+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),o=!0,c):(e.enter("data"),f(S)))}function f(S){return S===null||S===124||Ce(S)?(e.exit("data"),c(S)):(e.consume(S),S===92?p:f)}function p(S){return S===92||S===124?(e.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(e.enter("tableDelimiterRow"),o=!1,ue(S)?de(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):m(S))}function m(S){return S===45||S===58?y(S):S===124?(o=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),x):z(S)}function x(S){return ue(S)?de(e,y,"whitespace")(S):y(S)}function y(S){return S===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),w):S===45?(s+=1,w(S)):S===null||J(S)?F(S):z(S)}function w(S){return S===45?(e.enter("tableDelimiterFiller"),T(S)):z(S)}function T(S){return S===45?(e.consume(S),T):S===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(S))}function E(S){return ue(S)?de(e,F,"whitespace")(S):F(S)}function F(S){return S===124?m(S):S===null||J(S)?!o||i!==s?z(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(S)):z(S)}function z(S){return n(S)}function v(S){return e.enter("tableRow"),N(S)}function N(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),N):S===null||J(S)?(e.exit("tableRow"),t(S)):ue(S)?de(e,N,"whitespace")(S):(e.enter("data"),L(S))}function L(S){return S===null||S===124||Ce(S)?(e.exit("data"),N(S)):(e.consume(S),S===92?j:L)}function j(S){return S===92||S===124?(e.consume(S),L):L(S)}}function um(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,u,c,f;const p=new im;for(;++n<e.length;){const h=e[n],m=h[1];h[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(ea(p,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",c,t]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=qn(p,t,s,i,void 0,f),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=qn(p,t,s,i,void 0,f)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],f=qn(p,t,s,i,n,f)):o[1]!==0&&(f=qn(p,t,o,i,n,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&ea(p,t,l,u,c),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=sm(t.events,n))}return e}function qn(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Qt(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Qt(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Qt(t.events,n[2]),c=Qt(t.events,n[3]),f={type:a,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,x=n[3]-n[2]-1;e.add(m,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},Qt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function ea(e,t,n,r,i){const s=[],o=Qt(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Qt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const cm={name:"tasklistCheck",tokenize:dm};function fm(){return{text:{91:cm}}}function dm(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Ce(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return J(l)?t(l):ue(l)?e.check({tokenize:hm},t,n)(l):n(l)}}function hm(e,t,n){return de(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function pm(e){return Mo([Np(),Yp(),rm(e),am(),fm()])}const mm={};function gm(e){const t=this,n=e||mm,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(pm(n)),s.push(Mp()),o.push(zp(n))}const zt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Gt={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...zt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...zt],h2:[["className","sr-only"]],img:[...zt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...zt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...zt],table:[...zt],ul:[...zt,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Dt={}.hasOwnProperty;function ym(e,t){let n={type:"root",children:[]};const r={schema:t?{...Gt,...t}:Gt,stack:[]},i=ta(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function ta(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return xm(e,n);case"doctype":return bm(e,n);case"element":return km(e,n);case"root":return wm(e,n);case"text":return Sm(e,n)}}}function xm(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),s={type:"comment",value:r<0?n:n.slice(0,r)};return gn(s,t),s}}function bm(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return gn(n,t),n}}function km(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=na(e,t.children),i=Cm(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&Dt.call(e.schema.ancestors,n))){const a=e.schema.ancestors[n];let l=-1;for(s=!1;++l<a.length;)e.stack.includes(a[l])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return gn(o,t),o}function wm(e,t){const r={type:"root",children:na(e,t.children)};return gn(r,t),r}function Sm(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return gn(r,t),r}function na(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=ta(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function Cm(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&Dt.call(r,n)?r[n]:void 0,o=r&&Dt.call(r,"*")?r["*"]:void 0,a=t&&typeof t=="object"?t:{},l={};let u;for(u in a)if(Dt.call(a,u)){const c=a[u];let f=ra(e,oa(s,u),u,c);f==null&&(f=ra(e,oa(o,u),u,c)),f!=null&&(l[u]=f)}if(i&&Dt.call(i,n)){const c=i[n];for(u in c)Dt.call(c,u)&&!Dt.call(l,u)&&(l[u]=c[u])}return l}function ra(e,t,n,r){return t?Array.isArray(r)?vm(e,t,n,r):ia(e,t,n,r):void 0}function vm(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const o=ia(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&s.push(o)}return s}function ia(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Em(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const o=t[s];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){i=!0;break}}else if(o===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Em(e,t,n){const r=e.schema.protocols&&Dt.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),o=i.indexOf("?"),a=i.indexOf("#"),l=i.indexOf("/");if(s<0||l>-1&&s>l||o>-1&&s>o||a>-1&&s>a)return!0;let u=-1;for(;++u<r.length;){const c=r[u];if(s===c.length&&i.slice(0,c.length)===c)return!0}return!1}function gn(e,t){const n=vo(t);t.data&&(e.data=hn(t.data)),n&&(e.position=n)}function oa(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Tm(e){return function(t){return ym(t,e)}}const Am={...Gt,attributes:{...Gt.attributes,a:[...Array.isArray(Gt.attributes?.a)?Gt.attributes.a:["href"],"target","rel"]}},sa=({text:e,style:t})=>{const n={whiteSpace:"pre-wrap",lineHeight:1.5,margin:0,...t};return d.jsx("div",{style:n,children:d.jsx(rh,{remarkPlugins:[gm],rehypePlugins:[Tm(Am)],components:{a:({href:r,children:i,...s})=>d.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",...s,style:{color:"inherit",textDecoration:"underline",cursor:"pointer"},children:i})},children:e})})},_m=({theme:e,imageUrl:t,title:n,content:r,possibleQueries:i,onQuickQuery:s,isAgentTyping:o=!1})=>{const a="#000000",l=e?.fontFamily||"Roboto, Arial, sans-serif",u=s&&!o,c={display:"inline-block",backgroundColor:e?.primaryColor||"#5B3DF5",color:"#fff",padding:"8px 12px",borderRadius:12,fontSize:"14px",marginRight:8,marginBottom:8,cursor:u?"pointer":"default",userSelect:"none",opacity:o?.6:1},f={display:"flex",flexWrap:"wrap",marginTop:8},p={fontSize:"22px",fontWeight:700,margin:"8px 0 4px 0",color:a,fontFamily:l},h={fontSize:"14px",color:"#6b7280",margin:0,fontFamily:l};return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",textAlign:"left"},children:[t&&d.jsx("div",{style:{display:"flex",gap:16},children:d.jsx("img",{src:t,style:{width:160,height:160,objectFit:"contain",borderRadius:12,display:"block"}})}),n&&d.jsx("div",{style:p,children:n}),r&&d.jsx("div",{style:h,children:d.jsx(sa,{text:r})}),i&&i.length>0&&d.jsx("div",{style:f,children:i.map((m,x)=>d.jsx("span",{style:c,onClick:()=>{o||s&&s(m)},children:m},x))})]})};const jm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Im=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),aa=e=>{const t=Im(e);return t.charAt(0).toUpperCase()+t.slice(1)},la=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Dm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Pm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Rm=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>b.createElement("svg",{ref:l,...Pm,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:la("lucide",i),...!s&&!Dm(a)&&{"aria-hidden":"true"},...a},[...o.map(([u,c])=>b.createElement(u,c)),...Array.isArray(s)?s:[s]]));const we=(e,t)=>{const n=b.forwardRef(({className:r,...i},s)=>b.createElement(Rm,{ref:s,iconNode:t,className:la(`lucide-${jm(aa(e))}`,`lucide-${e}`,r),...i}));return n.displayName=aa(e),n};const Fm=we("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const pi=we("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const mi=we("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const ua=we("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Mm=we("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);const zm=we("file-image",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);const Lm=we("file-json",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);const ca=we("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const fa=we("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const Om=we("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Nm=we("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);const gi=we("mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Bm=we("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);const $m=we("paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);const Um=we("pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);const Hm=we("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const qm=we("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Wm=we("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Vm=we("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Qm=we("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Gm=we("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const Ym=we("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const da=we("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);const ha=we("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);const yi=we("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Jm=we("user-x",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);const Km=we("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const xi=we("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function pa(e){const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}const Wn=({audioUrl:e,headers:t,blobUrl:n,primaryColor:r="#4f46e5",autoPlay:i=!1,compact:s=!1})=>{const o=b.useRef(null),a=b.useRef(null),l=b.useRef(null),[u,c]=b.useState(!1),[f,p]=b.useState(0),[h,m]=b.useState(0),[x,y]=b.useState(!1),[w,T]=b.useState(!1),E=b.useCallback((L,j)=>{const S=new Audio(L);return o.current=S,j&&(a.current=L),S.addEventListener("loadedmetadata",()=>{p(S.duration),y(!0),T(!1)}),S.addEventListener("timeupdate",()=>m(S.currentTime)),S.addEventListener("ended",()=>{c(!1),m(0)}),S},[]),F=b.useCallback(async()=>{if(x||w)return o.current;if(n)return T(!0),E(n,!1);if(!e)return null;T(!0);try{const L=await fetch(e,{headers:t||{}});if(!L.ok)throw new Error(`${L.status}`);const j=await L.blob(),S=URL.createObjectURL(j);return E(S,!0)}catch{return T(!1),null}},[e,t,n,x,w,E]);b.useEffect(()=>(i&&F().then(L=>{L&&L.play().then(()=>c(!0)).catch(()=>{})}),()=>{o.current&&(o.current.pause(),o.current=null),a.current&&(URL.revokeObjectURL(a.current),a.current=null)}),[]);const z=async()=>{let L=o.current;!L&&(L=await F(),!L)||(u?(L.pause(),c(!1)):(await L.play(),c(!0)))},v=L=>{if(!o.current||!l.current||!f)return;const j=l.current.getBoundingClientRect(),S=Math.max(0,Math.min(1,(L.clientX-j.left)/j.width));o.current.currentTime=S*f,m(o.current.currentTime)},N=f>0?h/f*100:0;return d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:s?8:10,padding:s?"4px 0":"8px 12px",borderRadius:s?0:20,backgroundColor:s?"transparent":"#f3f4f6",minWidth:s?0:200,maxWidth:s?"none":280},children:[d.jsx("button",{type:"button",onClick:z,disabled:w,style:{background:r,border:"none",borderRadius:"50%",width:s?28:32,height:s?28:32,display:"flex",alignItems:"center",justifyContent:"center",cursor:w?"wait":"pointer",flexShrink:0,opacity:w?.6:1},children:u?d.jsx(Um,{size:14,color:"#fff"}):d.jsx(qm,{size:14,color:"#fff",style:{marginLeft:2}})}),d.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4},children:[d.jsx("div",{ref:l,onClick:v,style:{height:4,borderRadius:2,backgroundColor:"#d1d5db",cursor:"pointer",position:"relative"},children:d.jsx("div",{style:{height:"100%",borderRadius:2,backgroundColor:r,width:`${N}%`,transition:"width 0.1s linear"}})}),d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"#6b7280"},children:[d.jsx("span",{children:pa(h)}),d.jsx("span",{children:f>0?pa(f):"--:--"})]})]})]})},Xm=(e,t,n)=>{try{if(!e||isNaN(e))return n?.justNow||"Just now";const r=e<1e12?e*1e3:e,i=new Date(r);if(isNaN(i.getTime()))return n?.justNow||"Just now";const s=new Date,o=new Date(s);o.setDate(o.getDate()-1);const l=t?{en:"en-US",es:"es-ES",fr:"fr-FR",de:"de-DE",it:"it-IT",pt:"pt-PT"}[t]||t:void 0,u={hour:"numeric",minute:"2-digit",hour12:!0},c=i.toLocaleTimeString(l,u);if(i.toDateString()===s.toDateString())return`${n?.today||"Today"}, ${c}`;if(i.toDateString()===o.toDateString())return`${n?.yesterday||"Yesterday"}, ${c}`;{const f={month:"short",day:"numeric",year:"numeric"};return`${i.toLocaleDateString(l,f)}, ${c}`}}catch{return n?.justNow||"Just now"}},bi=e=>e.startsWith("image/")?d.jsx(zm,{size:24,color:"#6D28D9"}):e==="application/pdf"?d.jsx(ca,{size:24,color:"#B91C1C"}):e==="application/json"?d.jsx(Lm,{size:24,color:"#1D4ED8"}):d.jsx(ca,{size:24,color:"#4B5563"}),Zm=({blocks:e,primaryColor:t,textColor:n,isActionable:r,onQuickAction:i,onScheduleConfirm:s})=>e.length?d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:e.map((o,a)=>{switch(o.kind){case"file":const l=o.data;return l&&l.type&&l.type.startsWith("image")?d.jsx(ig,{imageData:l},a):d.jsx(og,{fileData:l},a);case"text":return d.jsx(eg,{text:o.text},a);case"options":return d.jsx(tg,{options:o.options,primaryColor:t,isActionable:r,onQuickAction:i},a);case"items":return d.jsx(ng,{items:o.items,primaryColor:t,textColor:n,isActionable:r,onSelect:i},a);case"schedule":return d.jsx(rg,{schedule:o.schedule,primaryColor:t,textColor:n,isActionable:r,onQuickAction:i,onConfirm:s},a);default:return null}})}):null,eg=({text:e})=>d.jsx(sa,{text:e}),tg=({options:e,primaryColor:t,isActionable:n,onQuickAction:r})=>{const[i,s]=b.useState(e);return b.useEffect(()=>{s(e)},[e]),i.length?d.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:i.map((o,a)=>d.jsx("button",{type:"button",disabled:!n,onClick:()=>{n&&(s([]),r?.(o))},style:{borderRadius:99,border:"none",backgroundColor:t,padding:"12px 12px",cursor:n?"pointer":"not-allowed",fontWeight:500,fontSize:14,color:"#ffffff",whiteSpace:"nowrap",transition:"transform 0.12s ease, opacity 0.12s ease",opacity:n?1:.6,boxShadow:"0 2px 6px rgba(0,0,0,0.12)"},children:o},`${o}-${a}`))}):null},ng=({items:e,primaryColor:t,textColor:n,isActionable:r,onSelect:i})=>d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:e.map(s=>d.jsx(ma,{item:s,primaryColor:t,textColor:n,isActionable:r,onSelect:()=>r&&i?.(s.name)},s.id))}),ma=({item:e,primaryColor:t,textColor:n,isActionable:r,onSelect:i,onSlotSelect:s,onRemove:o})=>{const[a,l]=b.useState(!1),u=Array.isArray(e.slots)&&e.slots.length>0,c=()=>{l(f=>!f),i?.()};return d.jsxs("div",{onClick:c,style:{display:"flex",gap:12,padding:12,borderRadius:12,border:"1px solid #e5e7eb",backgroundColor:"#f8fafc",cursor:r?"pointer":"default",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},children:[e.image&&d.jsx("img",{src:e.image,alt:e.name,style:{width:64,height:64,borderRadius:8,objectFit:"cover"}}),d.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},children:[d.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[d.jsx("div",{style:{fontWeight:700,color:n,fontSize:15,flex:1},children:e.name}),o&&d.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),o()},style:{background:"#f1f5f9",borderRadius:9999,border:"1px solid #e2e8f0",width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:d.jsx(xi,{size:16})})]}),e.category&&d.jsx("div",{style:{color:"#6b7280",fontSize:13,fontWeight:500},children:e.category}),e.description&&d.jsx("div",{style:{color:"#374151",fontSize:13,lineHeight:1.5,display:"-webkit-box",WebkitLineClamp:a?"unset":3,WebkitBoxOrient:"vertical",overflow:a?"visible":"hidden"},children:e.description}),u&&d.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:4},children:e.slots.map(f=>{const p=e.selectedSlot===f;return d.jsx("button",{type:"button",disabled:!r,onClick:h=>{h.stopPropagation(),r&&s?.(f)},style:{borderRadius:9999,border:`1px solid ${p?t:"#e5e7eb"}`,backgroundColor:p?t:"#ffffff",color:p?"#ffffff":"#111827",padding:"6px 12px",cursor:r?"pointer":"not-allowed",fontSize:13,fontWeight:600},children:f},f)})})]})]})},rg=({schedule:e,primaryColor:t,textColor:n,isActionable:r,onQuickAction:i,onConfirm:s})=>{const[o,a]=b.useState(e);b.useEffect(()=>{a(e)},[e]);const l=(c,f)=>{a(p=>({...p,restaurants:p.restaurants.map(h=>h.id===c?f(h):h)}))},u=c=>{a(f=>({...f,restaurants:f.restaurants.filter(p=>p.id!==c)}))};return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[d.jsx("div",{style:{padding:12,borderRadius:12,backgroundColor:"#f8fafc",border:"1px solid #e5e7eb",fontWeight:700,color:n},children:o.title||"Schedule"}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.restaurants.map(c=>d.jsx(ma,{item:c,primaryColor:t,textColor:n,isActionable:r,onSelect:()=>r&&i?.(c.name),onSlotSelect:f=>l(c.id,p=>({...p,selectedSlot:f})),onRemove:r?()=>u(c.id):void 0},c.id))}),r&&o.restaurants.length>0&&d.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:d.jsx("button",{type:"button",onClick:()=>s?.(o),style:{backgroundColor:t,color:"#ffffff",border:"none",borderRadius:10,padding:"10px 16px",fontWeight:700,cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,0.12)"},children:"Confirm"})})]})},ig=({imageData:e})=>d.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},onClick:()=>window.open(e.url,"_blank"),children:d.jsx("img",{src:e.url,alt:"Image",style:{width:80,height:64,borderRadius:8,objectFit:"cover"}})}),og=({fileData:e})=>d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},onClick:()=>window.open(e.url,"_blank"),children:[bi(e.type),d.jsx("span",{className:"text-xs text-muted-foreground",children:e.name})]}),ga=/```json\s*([\s\S]*?)\s*```/g,ya=/\*\*\*(.*?)\*\*\*/g,sg=e=>!!(e&&typeof e=="object"&&typeof e.id=="string"&&typeof e.name=="string"),ag=e=>!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.restaurants)),lg=e=>!!(e&&typeof e=="object"&&typeof e.url=="string"&&typeof e.type=="string"&&typeof e.name=="string"&&typeof e.id=="string"),ug=e=>{try{const t=JSON.parse(e);if(ag(t))return{kind:"schedule",schedule:t};if(Array.isArray(t)&&t.every(sg))return{kind:"items",items:t}}catch{}return null},xa=(e,t)=>{const n=[];if(lg(e)||t&&t==="file"){const a=e.replace(/\\/g,"");return[{kind:"file",data:JSON.parse(a)}]}ga.lastIndex=0;let r;for(;(r=ga.exec(e))!==null;){const a=r[0],l=r[1];typeof r.index!="number"||!l||n.push({start:r.index,end:r.index+a.length,type:"json",content:l})}ya.lastIndex=0;let i;for(;(i=ya.exec(e))!==null;){const a=i[0],l=i[1];typeof i.index!="number"||!l||n.push({start:i.index,end:i.index+a.length,type:"options",content:l})}if(n.length===0){const a=e.trim();return a?[{kind:"text",text:a}]:[]}n.sort((a,l)=>a.start-l.start);const s=[];let o=0;if(n.forEach(a=>{if(o<a.start){const l=e.slice(o,a.start).trim();l&&s.push({kind:"text",text:l})}if(a.type==="json"){const l=ug(a.content);l&&s.push(l)}else{const l=a.content.split(";").map(u=>u.trim()).filter(Boolean);l.length&&s.push({kind:"options",options:l})}o=a.end}),o<e.length){const a=e.slice(o).trim();a&&s.push({kind:"text",text:a})}return s},cg=e=>{let t="";return e.forEach(n=>{switch(n.kind){case"text":t+=n.text;break;case"items":t+=`\`\`\`json
|
|
35
|
+
${JSON.stringify(n.items)}
|
|
36
|
+
\`\`\``;break;case"schedule":t+=`\`\`\`json
|
|
37
|
+
${JSON.stringify(n.schedule)}
|
|
38
|
+
\`\`\``;break;case"options":t+=`***${n.options.join("; ")}***`;break}}),t},fg={header:{subtitle:"Support"},menu:{title:"Menu",resetConversation:"Reset conversation",fullscreen:"Fullscreen",language:"Language"},buttons:{startConversation:"Start Conversation",cancel:"Cancel",reset:"Reset",save:"Save",saveChanges:"Save Changes",add:"Add"},input:{placeholder:"Ask a question"},fileUpload:{fileTypeNotSupported:"This file type is not supported."},labels:{agent:"Agent",you:"You"},dialog:{resetConversation:{title:"Reset Conversation",message:"This will clear the current conversation history and start a new conversation. Are you sure?"}},feedback:{thumbsUp:"Thumbs up",thumbsDown:"Thumbs down"},thinking:{messages:["Thinking…","Analyzing your question…","Searching knowledge…","Pulling relevant info…","Drafting the answer…","Double‑checking details…","Tying it together…","Almost there…"]},time:{justNow:"Just now",today:"Today",yesterday:"Yesterday"},settings:{defaultDescription:"Support"},metadata:{addParameter:"Add Parameter",editParameter:"Edit Parameter",defineKeyValue:"Define key/value parameters sent as chat metadata."},configPanel:{appearance:"APPEARANCE",settings:"SETTINGS",metadata:"METADATA",primaryColor:"Primary Color",secondaryColor:"Secondary Color",backgroundColor:"Background Color",textColor:"Text Color",fontSize:"Font Size",fontFamily:"Font Family",name:"Name",description:"Description",small:"Small (12px)",medium:"Medium (15px)",large:"Large (18px)",parameterName:"Parameter Name",type:"Type",required:"Required",defaultValue:"Default / Value",value:"Value",yes:"Yes",no:"No",true:"True",false:"False",string:"String",number:"Number",boolean:"Boolean",edit:"Edit",remove:"Remove"}},dg={header:{subtitle:"Soporte"},menu:{title:"Menú",resetConversation:"Reiniciar conversación",fullscreen:"Pantalla completa",language:"Idioma"},buttons:{startConversation:"Iniciar Conversación",cancel:"Cancelar",reset:"Reiniciar",save:"Guardar",saveChanges:"Guardar Cambios",add:"Agregar"},input:{placeholder:"Haz una pregunta"},labels:{agent:"Agente",you:"Tú"},dialog:{resetConversation:{title:"Reiniciar Conversación",message:"Esto borrará el historial de conversación actual y comenzará una nueva conversación. ¿Estás seguro?"}},feedback:{thumbsUp:"Pulgar arriba",thumbsDown:"Pulgar abajo"},thinking:{messages:["Pensando…","Analizando tu pregunta…","Buscando información…","Obteniendo información relevante…","Redactando la respuesta…","Verificando detalles…","Uniendo todo…","Casi listo…"]},time:{justNow:"Ahora",today:"Hoy",yesterday:"Ayer"},settings:{defaultDescription:"Soporte"},metadata:{addParameter:"Agregar Parámetro",editParameter:"Editar Parámetro",defineKeyValue:"Define parámetros clave/valor enviados como metadatos del chat."},configPanel:{appearance:"APARIENCIA",settings:"CONFIGURACIÓN",metadata:"METADATOS",primaryColor:"Color Principal",secondaryColor:"Color Secundario",backgroundColor:"Color de Fondo",textColor:"Color de Texto",fontSize:"Tamaño de Fuente",fontFamily:"Familia de Fuente",name:"Nombre",description:"Descripción",small:"Pequeño (12px)",medium:"Mediano (15px)",large:"Grande (18px)",parameterName:"Nombre del Parámetro",type:"Tipo",required:"Requerido",defaultValue:"Valor por Defecto",value:"Valor",yes:"Sí",no:"No",true:"Verdadero",false:"Falso",string:"Cadena",number:"Número",boolean:"Booleano",edit:"Editar",remove:"Eliminar"}},hg={header:{subtitle:"Support"},menu:{title:"Menu",resetConversation:"Réinitialiser la conversation",fullscreen:"Plein écran",language:"Langue"},buttons:{startConversation:"Démarrer la conversation",cancel:"Annuler",reset:"Réinitialiser",save:"Enregistrer",saveChanges:"Enregistrer les modifications",add:"Ajouter"},input:{placeholder:"Posez une question"},labels:{agent:"Agent",you:"Vous"},dialog:{resetConversation:{title:"Réinitialiser la conversation",message:"Cela effacera l'historique de conversation actuel et démarrera une nouvelle conversation. Êtes-vous sûr ?"}},feedback:{thumbsUp:"Pouce vers le haut",thumbsDown:"Pouce vers le bas"},thinking:{messages:["Réflexion…","Analyse de votre question…","Recherche d'informations…","Récupération d'informations pertinentes…","Rédaction de la réponse…","Vérification des détails…","Assemblage de tout…","Presque terminé…"]},time:{justNow:"À l'instant",today:"Aujourd'hui",yesterday:"Hier"},settings:{defaultDescription:"Support"},metadata:{addParameter:"Ajouter un paramètre",editParameter:"Modifier le paramètre",defineKeyValue:"Définir des paramètres clé/valeur envoyés comme métadonnées du chat."},configPanel:{appearance:"APPARENCE",settings:"PARAMÈTRES",metadata:"MÉTADONNÉES",primaryColor:"Couleur principale",secondaryColor:"Couleur secondaire",backgroundColor:"Couleur de fond",textColor:"Couleur du texte",fontSize:"Taille de police",fontFamily:"Famille de police",name:"Nom",description:"Description",small:"Petit (12px)",medium:"Moyen (15px)",large:"Grand (18px)",parameterName:"Nom du paramètre",type:"Type",required:"Requis",defaultValue:"Valeur par défaut",value:"Valeur",yes:"Oui",no:"Non",true:"Vrai",false:"Faux",string:"Chaîne",number:"Nombre",boolean:"Booléen",edit:"Modifier",remove:"Supprimer"}},pg={header:{subtitle:"Support"},menu:{title:"Menü",resetConversation:"Konversation zurücksetzen",fullscreen:"Vollbild",language:"Sprache"},buttons:{startConversation:"Konversation starten",cancel:"Abbrechen",reset:"Zurücksetzen",save:"Speichern",saveChanges:"Änderungen speichern",add:"Hinzufügen"},input:{placeholder:"Stellen Sie eine Frage"},labels:{agent:"Agent",you:"Sie"},dialog:{resetConversation:{title:"Konversation zurücksetzen",message:"Dies löscht den aktuellen Konversationsverlauf und startet eine neue Konversation. Sind Sie sicher?"}},feedback:{thumbsUp:"Daumen hoch",thumbsDown:"Daumen runter"},thinking:{messages:["Denken…","Ihre Frage wird analysiert…","Wissen wird durchsucht…","Relevante Informationen werden abgerufen…","Antwort wird verfasst…","Details werden überprüft…","Alles wird zusammengefügt…","Fast fertig…"]},time:{justNow:"Gerade eben",today:"Heute",yesterday:"Gestern"},settings:{defaultDescription:"Support"},metadata:{addParameter:"Parameter hinzufügen",editParameter:"Parameter bearbeiten",defineKeyValue:"Definieren Sie Schlüssel/Wert-Parameter, die als Chat-Metadaten gesendet werden."},configPanel:{appearance:"AUSSEHEN",settings:"EINSTELLUNGEN",metadata:"METADATEN",primaryColor:"Primärfarbe",secondaryColor:"Sekundärfarbe",backgroundColor:"Hintergrundfarbe",textColor:"Textfarbe",fontSize:"Schriftgröße",fontFamily:"Schriftfamilie",name:"Name",description:"Beschreibung",small:"Klein (12px)",medium:"Mittel (15px)",large:"Groß (18px)",parameterName:"Parametername",type:"Typ",required:"Erforderlich",defaultValue:"Standardwert",value:"Wert",yes:"Ja",no:"Nein",true:"Wahr",false:"Falsch",string:"Zeichenkette",number:"Zahl",boolean:"Boolesch",edit:"Bearbeiten",remove:"Entfernen"}},mg={header:{subtitle:"Supporto"},menu:{title:"Menu",resetConversation:"Reimposta conversazione",fullscreen:"Schermo intero",language:"Lingua"},buttons:{startConversation:"Avvia conversazione",cancel:"Annulla",reset:"Reimposta",save:"Salva",saveChanges:"Salva modifiche",add:"Aggiungi"},input:{placeholder:"Fai una domanda"},labels:{agent:"Agente",you:"Tu"},dialog:{resetConversation:{title:"Reimposta conversazione",message:"Questo cancellerà la cronologia della conversazione corrente e inizierà una nuova conversazione. Sei sicuro?"}},feedback:{thumbsUp:"Pollice su",thumbsDown:"Pollice giù"},thinking:{messages:["Pensando…","Analizzando la tua domanda…","Cercando informazioni…","Recuperando informazioni rilevanti…","Redigendo la risposta…","Verificando i dettagli…","Mettendo tutto insieme…","Quasi fatto…"]},time:{justNow:"Proprio ora",today:"Oggi",yesterday:"Ieri"},settings:{defaultDescription:"Supporto"},metadata:{addParameter:"Aggiungi parametro",editParameter:"Modifica parametro",defineKeyValue:"Definisci parametri chiave/valore inviati come metadati della chat."},configPanel:{appearance:"ASPETTO",settings:"IMPOSTAZIONI",metadata:"METADATI",primaryColor:"Colore primario",secondaryColor:"Colore secondario",backgroundColor:"Colore di sfondo",textColor:"Colore del testo",fontSize:"Dimensione carattere",fontFamily:"Famiglia carattere",name:"Nome",description:"Descrizione",small:"Piccolo (12px)",medium:"Medio (15px)",large:"Grande (18px)",parameterName:"Nome parametro",type:"Tipo",required:"Obbligatorio",defaultValue:"Valore predefinito",value:"Valore",yes:"Sì",no:"No",true:"Vero",false:"Falso",string:"Stringa",number:"Numero",boolean:"Booleano",edit:"Modifica",remove:"Rimuovi"}},gg={header:{subtitle:"Suporte"},menu:{title:"Menu",resetConversation:"Reiniciar conversa",fullscreen:"Tela cheia",language:"Idioma"},buttons:{startConversation:"Iniciar conversa",cancel:"Cancelar",reset:"Reiniciar",save:"Salvar",saveChanges:"Salvar alterações",add:"Adicionar"},input:{placeholder:"Faça uma pergunta"},labels:{agent:"Agente",you:"Você"},dialog:{resetConversation:{title:"Reiniciar conversa",message:"Isso limpará o histórico de conversa atual e iniciará uma nova conversa. Tem certeza?"}},feedback:{thumbsUp:"Polegar para cima",thumbsDown:"Polegar para baixo"},thinking:{messages:["Pensando…","Analisando sua pergunta…","Buscando informações…","Obtendo informações relevantes…","Redigindo a resposta…","Verificando detalhes…","Juntando tudo…","Quase lá…"]},time:{justNow:"Agora mesmo",today:"Hoje",yesterday:"Ontem"},settings:{defaultDescription:"Suporte"},metadata:{addParameter:"Adicionar parâmetro",editParameter:"Editar parâmetro",defineKeyValue:"Defina parâmetros chave/valor enviados como metadados do chat."},configPanel:{appearance:"APARÊNCIA",settings:"CONFIGURAÇÕES",metadata:"METADADOS",primaryColor:"Cor primária",secondaryColor:"Cor secundária",backgroundColor:"Cor de fundo",textColor:"Cor do texto",fontSize:"Tamanho da fonte",fontFamily:"Família da fonte",name:"Nome",description:"Descrição",small:"Pequeno (12px)",medium:"Médio (15px)",large:"Grande (18px)",parameterName:"Nome do parâmetro",type:"Tipo",required:"Obrigatório",defaultValue:"Valor padrão",value:"Valor",yes:"Sim",no:"Não",true:"Verdadeiro",false:"Falso",string:"String",number:"Número",boolean:"Booleano",edit:"Editar",remove:"Remover"}},yg={header:{subtitle:"支持"},menu:{title:"菜单",resetConversation:"重置对话",fullscreen:"全屏",language:"语言"},buttons:{startConversation:"开始对话",cancel:"取消",reset:"重置",save:"保存",saveChanges:"保存更改",add:"添加"},input:{placeholder:"请输入您的问题"},labels:{agent:"助手",you:"您"},dialog:{resetConversation:{title:"重置对话",message:"这将清除当前对话记录并开始新对话。确定要继续吗?"}},feedback:{thumbsUp:"赞",thumbsDown:"踩"},thinking:{messages:["思考中…","正在分析您的问题…","正在检索知识…","正在获取相关信息…","正在撰写回答…","正在核对细节…","正在汇总…","即将完成…"]},time:{justNow:"刚刚",today:"今天",yesterday:"昨天"},settings:{defaultDescription:"支持"},metadata:{addParameter:"添加参数",editParameter:"编辑参数",defineKeyValue:"定义将作为聊天元数据发送的键/值参数。"},configPanel:{appearance:"外观",settings:"设置",metadata:"元数据",primaryColor:"主色",secondaryColor:"辅色",backgroundColor:"背景色",textColor:"文字颜色",fontSize:"字号",fontFamily:"字体",name:"名称",description:"描述",small:"小(12px)",medium:"中(15px)",large:"大(18px)",parameterName:"参数名",type:"类型",required:"必填",defaultValue:"默认值",value:"值",yes:"是",no:"否",true:"真",false:"假",string:"字符串",number:"数字",boolean:"布尔",edit:"编辑",remove:"移除"}},Yt=fg;function ba(){return typeof window>"u"||!navigator.language?"en":navigator.language.split("-")[0].toLowerCase()}function ki(e,t,n){const r=e.split(".");let i=t;for(const s of r)if(i&&typeof i=="object"&&s in i)i=i[s];else return n||e;return i}function Vn(e,t,n){const r=ki(e,t,n);return Array.isArray(r)?n||e:r}function ka(e,t,n){const r=ki(e,t);return Array.isArray(r)?r:n||[]}function wi(e){return e?e.toLowerCase():ba()}function Qn(e,t=Yt){if(!e)return t;const n=(r,i)=>{const s={...r};return Si(r)&&Si(i)&&Object.keys(i).forEach(o=>{Si(i[o])?o in r?s[o]=n(r[o],i[o]):Object.assign(s,{[o]:i[o]}):Object.assign(s,{[o]:i[o]})}),s};return n(t,e)}function Si(e){return e&&typeof e=="object"&&!Array.isArray(e)}const wa=dg,Sa=hg,Ca=pg,va=mg,Ea=gg,Ta={en:Yt,es:wa,fr:Sa,de:Ca,it:va,pt:Ea,zh:yg};function Aa(e){const t=Ta[e.toLowerCase()];return t?Qn(t,Yt):Yt}const xg=({file:e,index:t})=>{let n=e?.type;e?.type?.startsWith("application/vnd.openxmlformats-officedocument.wordprocessingml.document")&&(n="application/msword");const r={cursor:"pointer"},i={display:"flex",alignItems:"center",padding:"8px",backgroundColor:"#f0f0f0",borderRadius:"8px",position:"relative",maxWidth:"250px"},s={width:"40px",height:"40px",borderRadius:"4px",objectFit:"cover",marginRight:"10px"},o={width:"90%",maxWidth:"150px",fontWeight:"bold",fontSize:"14px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},a={fontSize:"12px",color:"#666"},l={width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"},u=()=>{window.open(e?.url,"_blank")},c=()=>d.jsxs("div",{style:i,children:[n?.startsWith("image/")?d.jsx("img",{src:e?.url,alt:e?.name,style:s}):d.jsx("div",{style:l,children:bi(n||"")}),d.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[d.jsx("div",{style:o,title:e?.name,children:e?.name}),d.jsxs("div",{style:a,children:[n?.includes("/")?n?.split("/")[1].toUpperCase():n,e?.size?` · ${(e?.size/1024).toFixed(1)} KB`:""]})]})]},t||Math.random());return d.jsx("div",{style:r,onClick:u,children:c()})},_a=({message:e,theme:t,onPlayAudio:n,isFirstMessage:r=!1,isPrevSameSpeaker:i=!1,onFeedback:s,welcomeImageUrl:o,welcomeTitle:a,possibleQueries:l,onQuickQuery:u,isLastMessage:c=!1,onQuickAction:f,onScheduleConfirm:p,translations:h,language:m,agentName:x,isAgentTyping:y=!1,audioUrlBuilder:w,audioHeaders:T,autoPlayAudioMessageId:E})=>{const F=b.useMemo(()=>Qn(h,Yt),[h]),z=(ne,Oe)=>Vn(ne,F,Oe),v=e.speaker==="customer",N=e.speaker==="special",L=!v&&!N&&r,[j,S]=b.useState(!1),[O]=b.useState(!1),[D]=b.useState(e.text),H=b.useMemo(()=>xa(D,e?.type),[D]),U=b.useMemo(()=>{const ne=F?.time?{justNow:F.time.justNow,today:F.time.today,yesterday:F.time.yesterday}:void 0;return Xm(e.create_time,m,ne)},[e.create_time,m,F]),M="#E4E4E7",Q="#000000",Z=t?.textColor||"#000000",se=t?.primaryColor||"#4f46e5",te=t?.fontFamily||"Roboto, Arial, sans-serif",k=t?.fontSize||"15px",C=v?Q:Z,q={display:"flex",flexDirection:"column",width:"100%",marginBottom:"8px",marginTop:i?"0px":"16px",position:"relative",alignItems:v?"flex-end":"flex-start"},g={display:i?"none":"flex",width:"80%",justifyContent:v?"flex-end":"flex-start",alignItems:"baseline",gap:"8px",marginBottom:"6px"},W={fontSize:"14px",color:"#000000",lineHeight:1,fontWeight:600},pe={fontSize:"13px",color:"#6b7280",lineHeight:1},ae={display:"flex",flexDirection:"column",maxWidth:"80%"},ee=v?{backgroundColor:M,color:Q,padding:"12px 16px",borderRadius:"12px 0 12px 12px",fontSize:k,fontFamily:te,wordBreak:"break-word",lineHeight:1.4,maxWidth:"100%",border:"none",boxShadow:"0 1px 2px rgba(0,0,0,0.08)"}:{backgroundColor:"transparent",color:Z,padding:0,borderRadius:0,fontSize:k,fontFamily:te,wordBreak:"break-word",lineHeight:1.4,maxWidth:"100%",border:"none",boxShadow:"none"},Ae={marginTop:"8px",display:"flex",flexDirection:"column",gap:"8px"},be=e.feedback&&e.feedback.length>0?e.feedback[e.feedback.length-1].feedback:void 0,Le=!v&&!N&&j&&!be,ze=!v&&!N,We={display:ze?"flex":"none",marginTop:8,alignSelf:"flex-start",alignItems:"center",height:20,gap:8,visibility:Le||be?"visible":"hidden"},Ie={background:"transparent",border:"none",padding:0,cursor:"pointer",color:"#9ca3af",display:Le?"flex":"none",alignItems:"center"},Pe={width:1,height:14,backgroundColor:"#e5e7eb",display:Le?"block":"none"},fe={color:"#000000",display:be?"flex":"none",alignItems:"center"};let De=a||"",_e="";if(L){const ne=e.text;if(a)_e=ne;else{const Oe=ne.split(/[\n\.!?]/);Oe.length>0&&(De=(Oe[0]||"").trim()),_e=ne.substring(De.length).trim(),_e=_e.replace(/^[,.!?\s]+/,"")}}if(N){const ne={display:"flex",justifyContent:"center",alignItems:"center",margin:"16px 0",width:"100%"},Oe=e.text.toLowerCase().includes("offline")||e.text.toLowerCase().includes("inactive")||e.text.toLowerCase().includes("unavailable")||e.linkUrl&&e.linkLabel;let je,Re="#E3F2FD",bt="#1976D2";Oe?(je=d.jsx(ua,{size:18}),Re="#FFF3E0",bt="#F57C00"):e.text.toLowerCase().includes("took over")||e.text.toLowerCase().includes("takeover")?je=d.jsx(Jm,{size:18}):je=d.jsx(Km,{size:18});const at={backgroundColor:Re,color:bt,padding:"8px 16px",borderRadius:"16px",fontSize:"14px",fontFamily:te,fontWeight:"500",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px"},lt={color:bt,textDecoration:"underline",cursor:"pointer",fontSize:"14px",fontFamily:te,fontWeight:"500"};return d.jsx("div",{style:ne,children:d.jsxs("div",{style:{...at,flexDirection:"row",alignItems:"center"},children:[je,d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[d.jsx("span",{children:e.text}),e.linkUrl&&e.linkLabel&&d.jsx("a",{href:e.linkUrl,target:"_blank",rel:"noopener noreferrer",style:lt,onClick:Ct=>Ct.stopPropagation(),children:e.linkLabel})]})]})})}return L?d.jsx("div",{style:q,children:d.jsx("div",{style:{...ae},children:d.jsx(_m,{theme:t,imageUrl:o,title:De,content:_e,possibleQueries:l,onQuickQuery:u,isAgentTyping:y})})}):d.jsxs("div",{style:q,onMouseEnter:()=>S(!0),onMouseLeave:()=>{O||S(!1)},children:[d.jsx("div",{style:g,children:v?d.jsxs(d.Fragment,{children:[d.jsx("div",{style:pe,children:U}),d.jsx("div",{style:W,children:z("labels.you")})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{style:W,children:x||z("labels.agent")}),d.jsx("div",{style:pe,children:U})]})}),e.attachments&&e.attachments.length>0&&d.jsx("div",{style:{...Ae,alignItems:v?"flex-end":"flex-start"},children:e.attachments.map((ne,Oe)=>d.jsx(xg,{file:ne},Oe))}),e.type==="audio"&&v&&d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,alignSelf:"flex-end"},children:e.audioObjectUrl?d.jsx(Wn,{blobUrl:e.audioObjectUrl,primaryColor:se}):w&&e.message_id&&T?d.jsx(Wn,{audioUrl:w(e.message_id),headers:T,primaryColor:se}):d.jsxs("div",{style:{...ee,display:"flex",alignItems:"center",gap:"8px"},children:[d.jsx(gi,{size:16}),d.jsx("span",{children:e.text||"[Voice message]"})]})}),e.type==="audio"&&!v&&d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,alignSelf:"flex-start"},children:w&&e.message_id&&T?d.jsx(Wn,{audioUrl:w(e.message_id),headers:T,primaryColor:se,autoPlay:E===e.message_id}):d.jsxs("div",{style:{...ee,display:"flex",alignItems:"center",gap:"8px"},children:[d.jsx(gi,{size:16}),d.jsx("span",{children:e.text||"[Audio response]"})]})}),e.type!=="audio"&&e.text&&d.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",alignSelf:v?"flex-end":"flex-start"},children:d.jsx("div",{style:{...ee,position:"relative"},children:d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:d.jsx(Zm,{blocks:H,primaryColor:se,textColor:C,isActionable:!v&&c&&!y,onQuickAction:f,onScheduleConfirm:p})})})}),ze&&d.jsx("div",{style:We,children:be?d.jsx("div",{style:fe,children:be==="good"?d.jsx(ha,{size:18}):d.jsx(da,{size:18})}):d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",style:Ie,title:z("feedback.thumbsUp"),onClick:()=>{const ne=e.message_id||e.id;ne&&s&&s(ne,"good")},children:d.jsx(ha,{size:18})}),d.jsx("div",{style:Pe}),d.jsx("button",{type:"button",style:Ie,title:z("feedback.thumbsDown"),onClick:()=>{const ne=e.message_id||e.id;ne&&s&&s(ne,"bad")},children:d.jsx(da,{size:18})})]})})]})},bg=({size:e=18,color:t="#000",style:n})=>d.jsxs(d.Fragment,{children:[d.jsx("style",{children:`
|
|
39
|
+
@keyframes ga_spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
40
|
+
`}),d.jsx(Om,{size:e,color:t,style:{animation:"ga_spin 1s linear infinite",...n}})]}),kg=({file:e,onRemove:t,uploading:n=!1})=>{const r=e.type,i=r.startsWith("image/"),[s,o]=b.useState(null);b.useEffect(()=>{if(i){const m=new FileReader;m.onloadend=()=>{o(m.result)},m.readAsDataURL(e)}},[e,i]);const a={display:"flex",alignItems:"center",padding:"8px",backgroundColor:"#f0f0f0",borderRadius:"8px",position:"relative",maxWidth:"250px"},l={width:"40px",height:"40px",borderRadius:"4px",objectFit:"cover",marginRight:"10px"},u={flex:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"},c={width:"90%",fontWeight:"bold",fontSize:"14px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},f={fontSize:"12px",color:"#666"},p={background:"none",border:"none",cursor:"pointer",padding:"4px",position:"absolute",top:"4px",right:"4px"},h={position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"};return d.jsxs("div",{style:a,children:[i&&s?d.jsx("img",{src:s,alt:e.name,style:l}):d.jsx("div",{style:{marginRight:"10px"},children:bi(r)}),d.jsxs("div",{style:u,children:[d.jsx("div",{style:c,title:e.name,children:e.name}),d.jsxs("div",{style:f,children:[(e.size?e.size/1024:0).toFixed(2)," KB"]})]}),!n&&d.jsx("button",{onClick:t,style:p,title:"Remove file",children:"✕"}),n&&d.jsx("div",{style:h,children:d.jsx(bg,{size:24,color:"#000"})})]})};function ja(e,t){return function(){return e.apply(t,arguments)}}const{toString:wg}=Object.prototype,{getPrototypeOf:Ci}=Object,{iterator:Gn,toStringTag:Ia}=Symbol,Yn=(e=>t=>{const n=wg.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),xt=e=>(e=e.toLowerCase(),t=>Yn(t)===e),Jn=e=>t=>typeof t===e,{isArray:Jt}=Array,Kt=Jn("undefined");function yn(e){return e!==null&&!Kt(e)&&e.constructor!==null&&!Kt(e.constructor)&&nt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Da=xt("ArrayBuffer");function Sg(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Da(e.buffer),t}const Cg=Jn("string"),nt=Jn("function"),Pa=Jn("number"),xn=e=>e!==null&&typeof e=="object",vg=e=>e===!0||e===!1,Kn=e=>{if(Yn(e)!=="object")return!1;const t=Ci(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ia in e)&&!(Gn in e)},Eg=e=>{if(!xn(e)||yn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Tg=xt("Date"),Ag=xt("File"),_g=e=>!!(e&&typeof e.uri<"u"),jg=e=>e&&typeof e.getParts<"u",Ig=xt("Blob"),Dg=xt("FileList"),Pg=e=>xn(e)&&nt(e.pipe);function Rg(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ra=Rg(),Fa=typeof Ra.FormData<"u"?Ra.FormData:void 0,Fg=e=>{let t;return e&&(Fa&&e instanceof Fa||nt(e.append)&&((t=Yn(e))==="formdata"||t==="object"&&nt(e.toString)&&e.toString()==="[object FormData]"))},Mg=xt("URLSearchParams"),[zg,Lg,Og,Ng]=["ReadableStream","Request","Response","Headers"].map(xt),Bg=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Jt(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(yn(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function Ma(e,t){if(yn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Lt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,za=e=>!Kt(e)&&e!==Lt;function vi(){const{caseless:e,skipUndefined:t}=za(this)&&this||{},n={},r=(i,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const o=e&&Ma(n,s)||s;Kn(n[o])&&Kn(i)?n[o]=vi(n[o],i):Kn(i)?n[o]=vi({},i):Jt(i)?n[o]=i.slice():(!t||!Kt(i))&&(n[o]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&bn(arguments[i],r);return n}const $g=(e,t,n,{allOwnKeys:r}={})=>(bn(t,(i,s)=>{n&&nt(i)?Object.defineProperty(e,s,{value:ja(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Ug=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Hg=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},qg=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Ci(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Wg=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Vg=e=>{if(!e)return null;if(Jt(e))return e;let t=e.length;if(!Pa(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Qg=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ci(Uint8Array)),Gg=(e,t)=>{const r=(e&&e[Gn]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},Yg=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Jg=xt("HTMLFormElement"),Kg=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),La=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Xg=xt("RegExp"),Oa=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bn(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},Zg=e=>{Oa(e,(t,n)=>{if(nt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(nt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ey=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Jt(e)?r(e):r(String(e).split(t)),n},ty=()=>{},ny=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ry(e){return!!(e&&nt(e.append)&&e[Ia]==="FormData"&&e[Gn])}const iy=e=>{const t=new Array(10),n=(r,i)=>{if(xn(r)){if(t.indexOf(r)>=0)return;if(yn(r))return r;if(!("toJSON"in r)){t[i]=r;const s=Jt(r)?[]:{};return bn(r,(o,a)=>{const l=n(o,i+1);!Kt(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},oy=xt("AsyncFunction"),sy=e=>e&&(xn(e)||nt(e))&&nt(e.then)&&nt(e.catch),Na=((e,t)=>e?setImmediate:t?((n,r)=>(Lt.addEventListener("message",({source:i,data:s})=>{i===Lt&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Lt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",nt(Lt.postMessage)),ay=typeof queueMicrotask<"u"?queueMicrotask.bind(Lt):typeof process<"u"&&process.nextTick||Na,A={isArray:Jt,isArrayBuffer:Da,isBuffer:yn,isFormData:Fg,isArrayBufferView:Sg,isString:Cg,isNumber:Pa,isBoolean:vg,isObject:xn,isPlainObject:Kn,isEmptyObject:Eg,isReadableStream:zg,isRequest:Lg,isResponse:Og,isHeaders:Ng,isUndefined:Kt,isDate:Tg,isFile:Ag,isReactNativeBlob:_g,isReactNative:jg,isBlob:Ig,isRegExp:Xg,isFunction:nt,isStream:Pg,isURLSearchParams:Mg,isTypedArray:Qg,isFileList:Dg,forEach:bn,merge:vi,extend:$g,trim:Bg,stripBOM:Ug,inherits:Hg,toFlatObject:qg,kindOf:Yn,kindOfTest:xt,endsWith:Wg,toArray:Vg,forEachEntry:Gg,matchAll:Yg,isHTMLForm:Jg,hasOwnProperty:La,hasOwnProp:La,reduceDescriptors:Oa,freezeMethods:Zg,toObjectSet:ey,toCamelCase:Kg,noop:ty,toFiniteNumber:ny,findKey:Ma,global:Lt,isContextDefined:za,isSpecCompliantForm:ry,toJSONObject:iy,isAsyncFn:oy,isThenable:sy,setImmediate:Na,asap:ay,isIterable:e=>e!=null&&nt(e[Gn])};let X=class Kl extends Error{static from(t,n,r,i,s,o){const a=new Kl(t.message,n||t.code,r,i,s);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),o&&Object.assign(a,o),a}constructor(t,n,r,i,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}};X.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",X.ERR_BAD_OPTION="ERR_BAD_OPTION",X.ECONNABORTED="ECONNABORTED",X.ETIMEDOUT="ETIMEDOUT",X.ERR_NETWORK="ERR_NETWORK",X.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",X.ERR_DEPRECATED="ERR_DEPRECATED",X.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",X.ERR_BAD_REQUEST="ERR_BAD_REQUEST",X.ERR_CANCELED="ERR_CANCELED",X.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",X.ERR_INVALID_URL="ERR_INVALID_URL";const ly=null;function Ei(e){return A.isPlainObject(e)||A.isArray(e)}function Ba(e){return A.endsWith(e,"[]")?e.slice(0,-2):e}function Ti(e,t,n){return e?e.concat(t).map(function(i,s){return i=Ba(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function uy(e){return A.isArray(e)&&!e.some(Ei)}const cy=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function Xn(e,t,n){if(!A.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=A.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,y){return!A.isUndefined(y[x])});const r=n.metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(A.isDate(m))return m.toISOString();if(A.isBoolean(m))return m.toString();if(!l&&A.isBlob(m))throw new X("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(m)||A.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,x,y){let w=m;if(A.isReactNative(t)&&A.isReactNativeBlob(m))return t.append(Ti(y,x,s),u(m)),!1;if(m&&!y&&typeof m=="object"){if(A.endsWith(x,"{}"))x=r?x:x.slice(0,-2),m=JSON.stringify(m);else if(A.isArray(m)&&uy(m)||(A.isFileList(m)||A.endsWith(x,"[]"))&&(w=A.toArray(m)))return x=Ba(x),w.forEach(function(E,F){!(A.isUndefined(E)||E===null)&&t.append(o===!0?Ti([x],F,s):o===null?x:x+"[]",u(E))}),!1}return Ei(m)?!0:(t.append(Ti(y,x,s),u(m)),!1)}const f=[],p=Object.assign(cy,{defaultVisitor:c,convertValue:u,isVisitable:Ei});function h(m,x){if(!A.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));f.push(m),A.forEach(m,function(w,T){(!(A.isUndefined(w)||w===null)&&i.call(t,w,A.isString(T)?T.trim():T,x,p))===!0&&h(w,x?x.concat(T):[T])}),f.pop()}}if(!A.isObject(e))throw new TypeError("data must be an object");return h(e),t}function $a(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ai(e,t){this._pairs=[],e&&Xn(e,this,t)}const Ua=Ai.prototype;Ua.append=function(t,n){this._pairs.push([t,n])},Ua.toString=function(t){const n=t?function(r){return t.call(this,r,$a)}:$a;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function fy(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ha(e,t,n){if(!t)return e;const r=n&&n.encode||fy,i=A.isFunction(n)?{serialize:n}:n,s=i&&i.serialize;let o;if(s?o=s(t,i):o=A.isURLSearchParams(t)?t.toString():new Ai(t,i).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class qa{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(r){r!==null&&t(r)})}}const _i={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},dy={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ai,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ji=typeof window<"u"&&typeof document<"u",Ii=typeof navigator=="object"&&navigator||void 0,hy=ji&&(!Ii||["ReactNative","NativeScript","NS"].indexOf(Ii.product)<0),py=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",my=ji&&window.location.href||"http://localhost",Je={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ji,hasStandardBrowserEnv:hy,hasStandardBrowserWebWorkerEnv:py,navigator:Ii,origin:my},Symbol.toStringTag,{value:"Module"})),...dy};function gy(e,t){return Xn(e,new Je.classes.URLSearchParams,{visitor:function(n,r,i,s){return Je.isNode&&A.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function yy(e){return A.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function xy(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Wa(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&A.isArray(i)?i.length:o,l?(A.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&A.isArray(i[o])&&(i[o]=xy(i[o])),!a)}if(A.isFormData(e)&&A.isFunction(e.entries)){const n={};return A.forEachEntry(e,(r,i)=>{t(yy(r),i,n,0)}),n}return null}function by(e,t,n){if(A.isString(e))try{return(t||JSON.parse)(e),A.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const kn={transitional:_i,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=A.isObject(t);if(s&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return i?JSON.stringify(Wa(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return gy(t,this.formSerializer).toString();if((a=A.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Xn(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),by(t)):t}],transformResponse:[function(t){const n=this.transitional||kn.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?X.from(a,X.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],e=>{kn.headers[e]={}});const ky=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wy=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
41
|
+
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&ky[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Va=Symbol("internals"),Sy=e=>!/[\r\n]/.test(e);function Qa(e,t){if(!(e===!1||e==null)){if(A.isArray(e)){e.forEach(n=>Qa(n,t));return}if(!Sy(String(e)))throw new Error(`Invalid character in header content ["${t}"]`)}}function wn(e){return e&&String(e).trim().toLowerCase()}function Cy(e){let t=e.length;for(;t>0;){const n=e.charCodeAt(t-1);if(n!==10&&n!==13)break;t-=1}return t===e.length?e:e.slice(0,t)}function Zn(e){return e===!1||e==null?e:A.isArray(e)?e.map(Zn):Cy(String(e))}function vy(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Ey=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Di(e,t,n,r,i){if(A.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!A.isString(t)){if(A.isString(r))return t.indexOf(r)!==-1;if(A.isRegExp(r))return r.test(t)}}function Ty(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ay(e,t){const n=A.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let rt=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,u){const c=wn(l);if(!c)throw new Error("header name must be a non-empty string");const f=A.findKey(i,c);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(Qa(a,l),i[f||l]=Zn(a))}const o=(a,l)=>A.forEach(a,(u,c)=>s(u,c,l));if(A.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(A.isString(t)&&(t=t.trim())&&!Ey(t))o(wy(t),n);else if(A.isObject(t)&&A.isIterable(t)){let a={},l,u;for(const c of t){if(!A.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?A.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}o(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=wn(t),t){const r=A.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return vy(i);if(A.isFunction(n))return n.call(this,i,r);if(A.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wn(t),t){const r=A.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Di(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=wn(o),o){const a=A.findKey(r,o);a&&(!n||Di(r,r[a],a,n))&&(delete r[a],i=!0)}}return A.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||Di(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return A.forEach(this,(i,s)=>{const o=A.findKey(r,s);if(o){n[o]=Zn(i),delete n[s];return}const a=t?Ty(s):String(s).trim();a!==s&&delete n[s],n[a]=Zn(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return A.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&A.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
42
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Va]=this[Va]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=wn(o);r[a]||(Ay(i,o),r[a]=!0)}return A.isArray(t)?t.forEach(s):s(t),this}};rt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(rt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),A.freezeMethods(rt);function Pi(e,t){const n=this||kn,r=t||n,i=rt.from(r.headers);let s=r.data;return A.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Ga(e){return!!(e&&e.__CANCEL__)}let Sn=class extends X{constructor(t,n,r){super(t??"canceled",X.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Ya(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new X("Request failed with status code "+n.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function _y(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function jy(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=r[s];o||(o=u),n[i]=l,r[i]=u;let f=s,p=0;for(;f!==i;)p+=n[f++],f=f%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o<t)return;const h=c&&u-c;return h?Math.round(p*1e3/h):void 0}}function Iy(e,t){let n=0,r=1e3/t,i,s;const o=(u,c=Date.now())=>{n=c,i=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?o(u,c):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-f)))},()=>i&&o(i)]}const er=(e,t,n=3)=>{let r=0;const i=jy(50,250);return Iy(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,u=i(l),c=o<=a;r=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},n)},Ja=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ka=e=>(...t)=>A.asap(()=>e(...t)),Dy=Je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,Py=Je.hasStandardBrowserEnv?{write(e,t,n,r,i,s,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];A.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),A.isString(r)&&a.push(`path=${r}`),A.isString(i)&&a.push(`domain=${i}`),s===!0&&a.push("secure"),A.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ry(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fy(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Xa(e,t,n){let r=!Ry(t);return e&&(r||n==!1)?Fy(e,t):t}const Za=e=>e instanceof rt?{...e}:e;function Ot(e,t){t=t||{};const n={};function r(u,c,f,p){return A.isPlainObject(u)&&A.isPlainObject(c)?A.merge.call({caseless:p},u,c):A.isPlainObject(c)?A.merge({},c):A.isArray(c)?c.slice():c}function i(u,c,f,p){if(A.isUndefined(c)){if(!A.isUndefined(u))return r(void 0,u,f,p)}else return r(u,c,f,p)}function s(u,c){if(!A.isUndefined(c))return r(void 0,c)}function o(u,c){if(A.isUndefined(c)){if(!A.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,c,f)=>i(Za(u),Za(c),f,!0)};return A.forEach(Object.keys({...e,...t}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const f=A.hasOwnProp(l,c)?l[c]:i,p=f(e[c],t[c],c);A.isUndefined(p)&&f!==a||(n[c]=p)}),n}const el=e=>{const t=Ot({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=rt.from(o),t.url=Ha(Xa(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),A.isFormData(n)){if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(A.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,f])=>{u.includes(c.toLowerCase())&&o.set(c,f)})}}if(Je.hasStandardBrowserEnv&&(r&&A.isFunction(r)&&(r=r(t)),r||r!==!1&&Dy(t.url))){const l=i&&s&&Py.read(s);l&&o.set(i,l)}return t},My=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=el(e);let s=i.data;const o=rt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=i,c,f,p,h,m;function x(){h&&h(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function w(){if(!y)return;const E=rt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),z={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:E,config:e,request:y};Ya(function(N){n(N),x()},function(N){r(N),x()},z),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new X("Request aborted",X.ECONNABORTED,e,y)),y=null)},y.onerror=function(F){const z=F&&F.message?F.message:"Network Error",v=new X(z,X.ERR_NETWORK,e,y);v.event=F||null,r(v),y=null},y.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const z=i.transitional||_i;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),r(new X(F,z.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,y)),y=null},s===void 0&&o.setContentType(null),"setRequestHeader"in y&&A.forEach(o.toJSON(),function(F,z){y.setRequestHeader(z,F)}),A.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),a&&a!=="json"&&(y.responseType=i.responseType),u&&([p,m]=er(u,!0),y.addEventListener("progress",p)),l&&y.upload&&([f,h]=er(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=E=>{y&&(r(!E||E.type?new Sn(null,e,y):E),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const T=_y(i.url);if(T&&Je.protocols.indexOf(T)===-1){r(new X("Unsupported protocol "+T+":",X.ERR_BAD_REQUEST,e));return}y.send(s||null)})},zy=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,a();const c=u instanceof Error?u:this.reason;r.abort(c instanceof X?c:new Sn(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,s(new X(`timeout of ${t}ms exceeded`,X.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>A.asap(a),l}},Ly=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Oy=async function*(e,t){for await(const n of Ny(e))yield*Ly(n,t)},Ny=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},tl=(e,t,n,r)=>{const i=Oy(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){a(),l.close();return}let f=c.byteLength;if(n){let p=s+=f;n(p)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},nl=64*1024,{isFunction:tr}=A,By=(({Request:e,Response:t})=>({Request:e,Response:t}))(A.global),{ReadableStream:rl,TextEncoder:il}=A.global,ol=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$y=e=>{e=A.merge.call({skipUndefined:!0},By,e);const{fetch:t,Request:n,Response:r}=e,i=t?tr(t):typeof fetch=="function",s=tr(n),o=tr(r);if(!i)return!1;const a=i&&tr(rl),l=i&&(typeof il=="function"?(m=>x=>m.encode(x))(new il):async m=>new Uint8Array(await new n(m).arrayBuffer())),u=s&&a&&ol(()=>{let m=!1;const x=new rl,y=new n(Je.origin,{body:x,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return x.cancel(),m&&!y}),c=o&&a&&ol(()=>A.isReadableStream(new r("").body)),f={stream:c&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(x,y)=>{let w=x&&x[m];if(w)return w.call(x);throw new X(`Response type '${m}' is not supported`,X.ERR_NOT_SUPPORT,y)})});const p=async m=>{if(m==null)return 0;if(A.isBlob(m))return m.size;if(A.isSpecCompliantForm(m))return(await new n(Je.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(A.isArrayBufferView(m)||A.isArrayBuffer(m))return m.byteLength;if(A.isURLSearchParams(m)&&(m=m+""),A.isString(m))return(await l(m)).byteLength},h=async(m,x)=>{const y=A.toFiniteNumber(m.getContentLength());return y??p(x)};return async m=>{let{url:x,method:y,data:w,signal:T,cancelToken:E,timeout:F,onDownloadProgress:z,onUploadProgress:v,responseType:N,headers:L,withCredentials:j="same-origin",fetchOptions:S}=el(m),O=t||fetch;N=N?(N+"").toLowerCase():"text";let D=zy([T,E&&E.toAbortSignal()],F),H=null;const U=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let M;try{if(v&&u&&y!=="get"&&y!=="head"&&(M=await h(L,w))!==0){let C=new n(x,{method:"POST",body:w,duplex:"half"}),q;if(A.isFormData(w)&&(q=C.headers.get("content-type"))&&L.setContentType(q),C.body){const[g,W]=Ja(M,er(Ka(v)));w=tl(C.body,nl,g,W)}}A.isString(j)||(j=j?"include":"omit");const Q=s&&"credentials"in n.prototype,Z={...S,signal:D,method:y.toUpperCase(),headers:L.normalize().toJSON(),body:w,duplex:"half",credentials:Q?j:void 0};H=s&&new n(x,Z);let se=await(s?O(H,S):O(x,Z));const te=c&&(N==="stream"||N==="response");if(c&&(z||te&&U)){const C={};["status","statusText","headers"].forEach(pe=>{C[pe]=se[pe]});const q=A.toFiniteNumber(se.headers.get("content-length")),[g,W]=z&&Ja(q,er(Ka(z),!0))||[];se=new r(tl(se.body,nl,g,()=>{W&&W(),U&&U()}),C)}N=N||"text";let k=await f[A.findKey(f,N)||"text"](se,m);return!te&&U&&U(),await new Promise((C,q)=>{Ya(C,q,{data:k,headers:rt.from(se.headers),status:se.status,statusText:se.statusText,config:m,request:H})})}catch(Q){throw U&&U(),Q&&Q.name==="TypeError"&&/Load failed|fetch/i.test(Q.message)?Object.assign(new X("Network Error",X.ERR_NETWORK,m,H,Q&&Q.response),{cause:Q.cause||Q}):X.from(Q,Q&&Q.code,m,H,Q&&Q.response)}}},Uy=new Map,sl=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,s=[r,i,n];let o=s.length,a=o,l,u,c=Uy;for(;a--;)l=s[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:$y(t)),c=u;return u};sl();const Ri={http:ly,xhr:My,fetch:{get:sl}};A.forEach(Ri,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const al=e=>`- ${e}`,Hy=e=>A.isFunction(e)||e===null||e===!1;function qy(e,t){e=A.isArray(e)?e:[e];const{length:n}=e;let r,i;const s={};for(let o=0;o<n;o++){r=e[o];let a;if(i=r,!Hy(r)&&(i=Ri[(a=String(r)).toLowerCase()],i===void 0))throw new X(`Unknown adapter '${a}'`);if(i&&(A.isFunction(i)||(i=i.get(t))))break;s[a||"#"+o]=i}if(!i){const o=Object.entries(s).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since :
|
|
43
|
+
`+o.map(al).join(`
|
|
44
|
+
`):" "+al(o[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const ll={getAdapter:qy,adapters:Ri};function Fi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Sn(null,e)}function ul(e){return Fi(e),e.headers=rt.from(e.headers),e.data=Pi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ll.getAdapter(e.adapter||kn.adapter,e)(e).then(function(r){return Fi(e),r.data=Pi.call(e,e.transformResponse,r),r.headers=rt.from(r.headers),r},function(r){return Ga(r)||(Fi(e),r&&r.response&&(r.response.data=Pi.call(e,e.transformResponse,r.response),r.response.headers=rt.from(r.response.headers))),Promise.reject(r)})}const cl="1.15.0",nr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{nr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const fl={};nr.transitional=function(t,n,r){function i(s,o){return"[Axios v"+cl+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new X(i(o," has been removed"+(n?" in "+n:"")),X.ERR_DEPRECATED);return n&&!fl[o]&&(fl[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}},nr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Wy(e,t,n){if(typeof e!="object")throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new X("option "+s+" must be "+l,X.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new X("Unknown option "+s,X.ERR_BAD_OPTION)}}const rr={assertOptions:Wy,validators:nr},ht=rr.validators;let Nt=class{constructor(t){this.defaults=t||{},this.interceptors={request:new qa,response:new qa}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=(()=>{if(!i.stack)return"";const o=i.stack.indexOf(`
|
|
45
|
+
`);return o===-1?"":i.stack.slice(o+1)})();try{if(!r.stack)r.stack=s;else if(s){const o=s.indexOf(`
|
|
46
|
+
`),a=o===-1?-1:s.indexOf(`
|
|
47
|
+
`,o+1),l=a===-1?"":s.slice(a+1);String(r.stack).endsWith(l)||(r.stack+=`
|
|
48
|
+
`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ot(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&rr.assertOptions(r,{silentJSONParsing:ht.transitional(ht.boolean),forcedJSONParsing:ht.transitional(ht.boolean),clarifyTimeoutError:ht.transitional(ht.boolean),legacyInterceptorReqResOrdering:ht.transitional(ht.boolean)},!1),i!=null&&(A.isFunction(i)?n.paramsSerializer={serialize:i}:rr.assertOptions(i,{encode:ht.function,serialize:ht.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),rr.assertOptions(n,{baseUrl:ht.spelling("baseURL"),withXsrfToken:ht.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&A.merge(s.common,s[n.method]);s&&A.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=rt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;l=l&&x.synchronous;const y=n.transitional||_i;y&&y.legacyInterceptorReqResOrdering?a.unshift(x.fulfilled,x.rejected):a.push(x.fulfilled,x.rejected)});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let c,f=0,p;if(!l){const m=[ul.bind(this),void 0];for(m.unshift(...a),m.push(...u),p=m.length,c=Promise.resolve(n);f<p;)c=c.then(m[f++],m[f++]);return c}p=a.length;let h=n;for(;f<p;){const m=a[f++],x=a[f++];try{h=m(h)}catch(y){x.call(this,y);break}}try{c=ul.call(this,h)}catch(m){return Promise.reject(m)}for(f=0,p=u.length;f<p;)c=c.then(u[f++],u[f++]);return c}getUri(t){t=Ot(this.defaults,t);const n=Xa(t.baseURL,t.url,t.allowAbsoluteUrls);return Ha(n,t.params,t.paramsSerializer)}};A.forEach(["delete","get","head","options"],function(t){Nt.prototype[t]=function(n,r){return this.request(Ot(r||{},{method:t,url:n,data:(r||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Ot(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Nt.prototype[t]=n(),Nt.prototype[t+"Form"]=n(!0)});let Vy=class Xl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Sn(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Xl(function(i){t=i}),cancel:t}}};function Qy(e){return function(n){return e.apply(null,n)}}function Gy(e){return A.isObject(e)&&e.isAxiosError===!0}const Mi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Mi).forEach(([e,t])=>{Mi[t]=e});function dl(e){const t=new Nt(e),n=ja(Nt.prototype.request,t);return A.extend(n,Nt.prototype,t,{allOwnKeys:!0}),A.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return dl(Ot(e,i))},n}const ye=dl(kn);ye.Axios=Nt,ye.CanceledError=Sn,ye.CancelToken=Vy,ye.isCancel=Ga,ye.VERSION=cl,ye.toFormData=Xn,ye.AxiosError=X,ye.Cancel=ye.CanceledError,ye.all=function(t){return Promise.all(t)},ye.spread=Qy,ye.isAxiosError=Gy,ye.mergeConfig=Ot,ye.AxiosHeaders=rt,ye.formToJSON=e=>Wa(A.isHTMLForm(e)?new FormData(e):e),ye.getAdapter=ll.getAdapter,ye.HttpStatusCode=Mi,ye.default=ye;const{Axios:u0,AxiosError:c0,CanceledError:f0,isCancel:d0,CancelToken:h0,VERSION:p0,all:m0,Cancel:g0,isAxiosError:y0,spread:x0,toFormData:b0,AxiosHeaders:k0,HttpStatusCode:w0,formToJSON:S0,getAdapter:C0,mergeConfig:v0}=ye;function zi(e,t){if(typeof globalThis<"u"&&globalThis.WebSocket)return new globalThis.WebSocket(e,t);if(typeof window<"u"&&window.WebSocket)return new window.WebSocket(e,t);if(typeof WebSocket<"u")return new WebSocket(e,t);throw new Error("WebSocket is not available in this environment. This library requires a browser environment with native WebSocket support.")}function Yy(e){try{const t=new URL(e);return t.searchParams.has("api_key")&&t.searchParams.set("api_key","[REDACTED]"),t.searchParams.has("access_token")&&t.searchParams.set("access_token","[REDACTED]"),t.searchParams.has("guest_token")&&t.searchParams.set("guest_token","[REDACTED]"),t.toString()}catch{return e.replace(/[?&](api_key|access_token|guest_token)=[^&]*/g,t=>`${t.split("=")[0]}=[REDACTED]`)}}function ir(e,t){const n=Yy(t),r=[];if(r.push("WebSocket connection issue"),r.push(`URL: ${n}`),e instanceof CloseEvent&&(r.push(`Close code: ${e.code}`),e.reason&&r.push(`Reason: ${e.reason}`),r.push(`Was clean: ${e.wasClean}`)),"readyState"in e&&typeof e.readyState=="number"){const s=["CONNECTING","OPEN","CLOSING","CLOSED"][e.readyState]||"UNKNOWN";r.push(`Ready state: ${s} (${e.readyState})`)}return r.join(" | ")}function hl(e,t,n,r,i,s,o=["message","takeover","finalize"]){const a=o.map(h=>`topics=${h}`).join("&"),l=i?`&x-tenant-id=${encodeURIComponent(i)}`:"",u=s?`&lang=${s}`:"&lang=en",c=t?2:1,f=c===1?`conversations/ws/${n}`:`ws/conversations/${n}`;let p=c===1?`${e.replace("http","ws")}/api`:t;return p=p?.replace(/\/\//g,"/"),`${p}/${f}?${r}&${a}${l}${u}`?.replace(/\/\//g,"/")}const pl="genassist_agent_metadata_updated";class ml{constructor(t,n,r,i,s,o,a=!0,l=!1){this.conversationId=null,this.conversationCreateTime=null,this.guestToken=null,this.isFinalized=!1,this.webSocket=null,this.messageHandler=null,this.takeoverHandler=null,this.finalizedHandler=null,this.connectionStateHandler=null,this.welcomeDataHandler=null,this.storageKeyBase="genassist_conversation",this.possibleQueries=[],this.welcomeData={},this.thinkingConfig={phrases:[],delayMs:1e3},this.chatInputMetadata={},this.welcomeObjectUrl=null,this.availableLanguages=null,this.agentChatLocales=null,this.usePoll=!1,this.baseUrl=t.endsWith("/")?t.slice(0,-1):t,this.websocketUrl=n,this.apiKey=r,this.metadata=i,this.tenant=s,this.language=o,this.useWs=a,this.usePoll=l,this.loadSavedConversation()}getStorageKey(){return`${this.storageKeyBase}:${this.apiKey}`}handleConversationFinalized(){if(this.messageHandler){const t=Date.now()/1e3,n={create_time:t,start_time:this.conversationCreateTime?t-this.conversationCreateTime:0,end_time:this.conversationCreateTime?t-this.conversationCreateTime+.01:.01,speaker:"special",text:"Conversation Finalized",type:"finalized"};this.messageHandler(n)}this.finalizedHandler&&this.finalizedHandler(),this.isFinalized=!0,this.saveConversation()}persistAndEmitAgentMetadata(t){try{const n=`genassist_agent_chat_input_metadata:${this.apiKey}`;localStorage.setItem(n,JSON.stringify(t)),typeof window<"u"&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent(pl,{detail:{apiKey:this.apiKey,metadata:{...t}}}))}catch{}}setLanguage(t){this.language=t}setMetadata(t){this.metadata=t}formatAcceptLanguage(t){if(!t)return"";const n=t.toLowerCase().trim(),r={en:"en-US",es:"es-ES",fr:"fr-FR",de:"de-DE",it:"it-IT",pt:"pt-PT",ar:"ar-SA",sq:"sq-AL",zh:"zh-CN"},s=n.includes("-")?n:r[n]||n,o=s.split("-")[0].toLowerCase(),a=[s];return a.push(`${o};q=0.9`),o!=="en"&&a.push("en;q=0.8"),a.join(", ")}getHeaders(t="application/json"){const n={"x-api-key":this.apiKey,"Content-Type":t};if(this.tenant&&(n["x-tenant-id"]=this.tenant),this.guestToken&&(n.Authorization=`Bearer ${this.guestToken}`),this.language){const r=this.formatAcceptLanguage(this.language);r&&(n["Accept-Language"]=r)}return n}setMessageHandler(t){this.messageHandler=t}setTakeoverHandler(t){this.takeoverHandler=t}setFinalizedHandler(t){this.finalizedHandler=t}setConnectionStateHandler(t){this.connectionStateHandler=t}setWelcomeDataHandler(t){this.welcomeDataHandler=t}setServerUnavailableConfig(t,n,r){this.serverUnavailableMessage=t,this.serverUnavailableContactUrl=n,this.serverUnavailableContactLabel=r}getPossibleQueries(){return this.possibleQueries}getWelcomeData(){return this.welcomeData}getThinkingConfig(){return this.thinkingConfig}getChatInputMetadata(){return{...this.chatInputMetadata}}getAvailableLanguages(){return this.availableLanguages?[...this.availableLanguages]:null}async fetchAgentInfo(){try{const n=(await ye.get(`${this.baseUrl}/api/conversations/in-progress/agent-info`,{headers:this.getHeaders()})).data||{},r=typeof n.agent_id=="string"?n.agent_id:void 0,i=Array.isArray(n.agent_available_languages)?n.agent_available_languages:void 0,s=i?i.filter(o=>typeof o=="string"&&o.trim().length>0).map(o=>o.toLowerCase()):void 0;return r&&(this.agentId=r),s&&(this.availableLanguages=s),{agent_id:r,agent_available_languages:s}}catch{return null}}async fetchAgentChatLocales(){try{const n=(await ye.get(`${this.baseUrl}/api/conversations/in-progress/agent-chat-locales`,{headers:this.getHeaders()})).data;return n?.locales&&typeof n.locales=="object"&&(this.agentChatLocales=n.locales),Array.isArray(n.agent_available_languages)&&(this.availableLanguages=n.agent_available_languages.filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.toLowerCase())),typeof n.agent_id=="string"&&(this.agentId=n.agent_id),typeof n.agent_thinking_phrase_delay=="number"&&n.agent_thinking_phrase_delay>=0&&(this.thinkingConfig.delayMs=Math.max(250,Math.round(n.agent_thinking_phrase_delay*1e3))),n.agent_chat_input_metadata!=null&&typeof n.agent_chat_input_metadata=="object"&&!Array.isArray(n.agent_chat_input_metadata)&&Object.keys(this.chatInputMetadata).length===0&&(this.chatInputMetadata={...n.agent_chat_input_metadata},this.persistAndEmitAgentMetadata(this.chatInputMetadata)),n}catch{return null}}applyLanguageFromLocales(t){if(!this.agentChatLocales||!t)return null;const n=t.toLowerCase().split("-")[0],r=this.agentChatLocales,i=r[n]||r.en||Object.values(r)[0];if(!i)return null;if(Array.isArray(i.possible_queries)&&(this.possibleQueries=i.possible_queries.filter(s=>typeof s=="string"&&s.trim().length>0)),this.welcomeData={...this.welcomeData,title:i.welcome_title??this.welcomeData.title??null,message:i.welcome_message??this.welcomeData.message??null,inputDisclaimerHtml:i.input_disclaimer_html??this.welcomeData.inputDisclaimerHtml??null,possibleQueries:this.possibleQueries.length>0?this.possibleQueries:this.welcomeData.possibleQueries},Array.isArray(i.thinking_phrases)){const s=i.thinking_phrases.filter(o=>typeof o=="string"&&o.trim().length>0);s.length>0&&(this.thinkingConfig={...this.thinkingConfig,phrases:s})}return this.welcomeDataHandler&&this.welcomeDataHandler({title:this.welcomeData.title??null,message:this.welcomeData.message??null,imageUrl:this.welcomeData.imageUrl??null,possibleQueries:this.possibleQueries,inputDisclaimerHtml:this.welcomeData.inputDisclaimerHtml??null}),this.saveConversation(),{thinkingPhrases:[...this.thinkingConfig.phrases],thinkingDelayMs:this.thinkingConfig.delayMs}}loadSavedConversation(){try{let t=localStorage.getItem(this.getStorageKey());if(t||(t=localStorage.getItem(this.storageKeyBase)),t){const{conversationId:n,createTime:r,isFinalized:i,possibleQueries:s,welcomeData:o,thinkingConfig:a,agentId:l,guestToken:u,availableLanguages:c}=JSON.parse(t);this.conversationId=n,this.conversationCreateTime=r,this.isFinalized=i||!1,this.guestToken=u||null,this.possibleQueries=Array.isArray(s)?s:[],this.welcomeData=o||{},this.welcomeData.possibleQueries||(this.welcomeData.possibleQueries=this.possibleQueries),this.thinkingConfig={phrases:a&&a.phrases||[],delayMs:a&&typeof a.delayMs=="number"?a.delayMs:1e3},this.agentId=l,Array.isArray(c)&&(this.availableLanguages=c),!this.welcomeData.imageUrl&&this.agentId&&this.fetchWelcomeImage(this.agentId),this.welcomeDataHandler&&this.welcomeDataHandler(this.welcomeData)}}catch{}}saveConversation(){try{if(this.conversationId&&this.conversationCreateTime){const t={conversationId:this.conversationId,createTime:this.conversationCreateTime,isFinalized:this.isFinalized,possibleQueries:this.possibleQueries,welcomeData:{...this.welcomeData,imageUrl:this.welcomeObjectUrl&&this.welcomeData.imageUrl&&this.welcomeData.imageUrl.startsWith("blob:")?null:this.welcomeData.imageUrl||null},thinkingConfig:this.thinkingConfig,agentId:this.agentId,guestToken:this.guestToken,availableLanguages:this.availableLanguages};localStorage.setItem(this.getStorageKey(),JSON.stringify(t))}}catch{}}isTokenExpiredError(t){return t.response&&t.response.status===401&&t.response.data&&(t.response.data.error==="Token has expired."||t.response.data.message==="Token has expired."||typeof t.response.data=="string"&&t.response.data.includes("Token has expired"))}handleTakeover(t){const n=t??Date.now()/1e3;if(this.messageHandler){const r={create_time:n,start_time:this.conversationCreateTime?n-this.conversationCreateTime:0,end_time:this.conversationCreateTime?n-this.conversationCreateTime+.01:.01,speaker:"special",text:"Supervisor took over",type:"takeover"};this.messageHandler(r)}this.takeoverHandler&&this.takeoverHandler()}resetChatConversation(){if(this.conversationId=null,this.conversationCreateTime=null,this.guestToken=null,this.isFinalized=!1,this.possibleQueries=[],this.welcomeData={},this.thinkingConfig={phrases:[],delayMs:1e3},this.chatInputMetadata={},this.welcomeObjectUrl){try{URL.revokeObjectURL(this.welcomeObjectUrl)}catch{}this.welcomeObjectUrl=null}this.agentId=void 0;try{localStorage.removeItem(this.getStorageKey())}catch{}}hasActiveConversation(){return!!this.conversationId}getConversationId(){return this.conversationId}getConversationCreateTime(){return this.conversationCreateTime}isConversationFinalized(){return this.isFinalized}async startConversation(t){try{const n={messages:[],recorded_at:new Date().toISOString(),data_source_id:"00000000-0000-0000-0000-000000000000"};t&&(n.recaptcha_token=t),this.metadata&&(n.metadata=this.metadata);const r=await ye.post(`${this.baseUrl}/api/conversations/in-progress/start`,n,{headers:this.getHeaders()});this.conversationId=r.data.conversation_id,this.conversationCreateTime=r.data.create_time?r.data.create_time/1e3:Date.now()/1e3,this.guestToken=r.data.guest_token||null,this.isFinalized=!1,r.data.agent_possible_queries&&r.data.agent_possible_queries.length>0&&(this.possibleQueries=r.data.agent_possible_queries.filter(h=>typeof h=="string"&&h.trim().length>0));const i=r.data,s=i.agent_id;this.agentId=s;const o=Array.isArray(i.agent_available_languages)?i.agent_available_languages:void 0;o&&(this.availableLanguages=o.filter(h=>typeof h=="string"&&h.trim().length>0).map(h=>h.toLowerCase()));const a=i.agent_chat_input_metadata;a!=null&&typeof a=="object"&&!Array.isArray(a)?this.chatInputMetadata={...a}:this.chatInputMetadata={},this.persistAndEmitAgentMetadata(this.chatInputMetadata);const l=i.agent_welcome_title,u=i.agent_welcome_image_url,c=i.agent_thinking_phrases,f=i.agent_thinking_phrase_delay,p=i.agent_input_disclaimer_html;if(this.welcomeData={title:l||null,message:null,imageUrl:u||null,possibleQueries:this.possibleQueries,inputDisclaimerHtml:p??null},Array.isArray(c)&&c.length>0&&(this.thinkingConfig.phrases=c),typeof f=="number"&&f>=0&&(this.thinkingConfig.delayMs=Math.max(250,Math.round(f*1e3))),!this.welcomeData.imageUrl&&s&&await this.fetchWelcomeImage(s),r.data.agent_welcome_message&&this.messageHandler){const h=Date.now()/1e3,m={create_time:h,start_time:h-this.conversationCreateTime,end_time:h-this.conversationCreateTime+.01,speaker:"agent",text:r.data.agent_welcome_message};this.welcomeData.message=r.data.agent_welcome_message,this.messageHandler(m)}return this.welcomeDataHandler&&this.welcomeDataHandler(this.welcomeData),this.saveConversation(),r.data.conversation_id}catch(n){throw this.isTokenExpiredError(n)&&this.resetChatConversation(),n}}async sendMessage(t,n,r,i){if(!this.conversationId||!this.conversationCreateTime)throw new Error("Conversation not started");const s=Date.now()/1e3,o={create_time:s,start_time:s-this.conversationCreateTime,end_time:s-this.conversationCreateTime+.01,speaker:"customer",text:t,attachments:n};this.messageHandler&&this.messageHandler(o);try{const a={messages:[o],recorded_at:new Date().toISOString()};i&&(a.recaptcha_token=i);const l={...this.metadata||{},...r||{}};Object.keys(l).length>0&&(a.metadata=l);const u=await ye.patch(`${this.baseUrl}/api/conversations/in-progress/update/${this.conversationId}`,a,{headers:this.getHeaders()}).catch(c=>{const f=c?.response?.data;if(f?.error_key==="CONVERSATION_FINALIZED"||f?.error_key==="AGENT_NOT_FOUND")this.handleConversationFinalized();else throw c});if(!this.useWs&&this.messageHandler&&(!this.useWs||!this.usePoll))try{const c=u?.data||{};if(c.messages&&Array.isArray(c.messages))for(let f=c.messages.length-1;f>=0;f--){const p=c.messages[f];if(p.speaker==="agent"&&p.text&&p.create_time!==void 0&&p.start_time!==void 0&&p.end_time!==void 0){const h={create_time:p.create_time,start_time:this.conversationCreateTime?p.start_time-this.conversationCreateTime:p.start_time,end_time:this.conversationCreateTime?p.end_time-this.conversationCreateTime:p.end_time,speaker:"agent",text:p.text,message_id:p.message_id||p.id,type:p.type};this.messageHandler(h);break}}}catch(c){console.error("Failed to parse update conversation response:",c)}}catch(a){if(this.isTokenExpiredError(a))throw this.resetChatConversation(),a;if(a.response&&a.response.data&&a.response.data.error_key==="AGENT_INACTIVE"){if(this.messageHandler){const l={create_time:s,start_time:s-this.conversationCreateTime,end_time:s-this.conversationCreateTime+.01,speaker:"special",text:this.serverUnavailableMessage??"The agent is currently offline, please check back later. Thank you!",...this.serverUnavailableContactUrl&&{linkUrl:this.serverUnavailableContactUrl,linkLabel:this.serverUnavailableContactLabel??"Contact support"}};this.messageHandler(l)}return}throw a}}async sendAudioMessage(t,n,r){if(!this.conversationId)throw new Error("Conversation not started");const i=Date.now()/1e3,s={create_time:i,start_time:this.conversationCreateTime?i-this.conversationCreateTime:0,end_time:this.conversationCreateTime?i-this.conversationCreateTime+.01:.01,speaker:"customer",text:"[Voice message]",type:"audio",audioObjectUrl:URL.createObjectURL(t)};this.messageHandler&&this.messageHandler(s);const o={...this.metadata||{},...r||{}},a={messages:[s],metadata:Object.keys(o).length>0?o:{}},l=new FormData;l.append("model",JSON.stringify(a)),l.append("audio_file",t,`recording.${n}`),l.append("audio_format",n);try{await ye.patch(`${this.baseUrl}/api/conversations/in-progress/update/${this.conversationId}`,l,{headers:this.getHeaders("multipart/form-data")})}catch(u){throw this.isTokenExpiredError(u)&&this.resetChatConversation(),u}}async uploadFile(t,n){if(!this.conversationId)throw new Error("Conversation not started");const r=new FormData;r.append("chat_id",t),r.append("file",n);try{return(await ye.post(`${this.baseUrl}/api/genagent/knowledge/upload-chat-file`,r,{headers:this.getHeaders("multipart/form-data")})).data}catch(i){throw this.isTokenExpiredError(i)&&this.resetChatConversation(),i}}processWebSocketMessage(t){if(t.type!=="ping")if(t.type==="message"&&this.messageHandler){const n=t.payload;if(Array.isArray(n))n.map(s=>{const o=this.adjustMessageTimestamps(s);return!o.message_id&&s.id&&(o.message_id=s.id),o}).filter(s=>s.speaker!=="customer").forEach(s=>this.messageHandler(s));else if(n&&typeof n=="object"){const r=this.adjustMessageTimestamps(n);!r.message_id&&n.id&&(r.message_id=n.id),n.audio_format&&(r.audio_format=n.audio_format),r.speaker!=="customer"&&this.messageHandler(r)}}else t.type==="takeover"?this.handleTakeover():t.type==="finalize"&&this.handleConversationFinalized()}getGuestToken(){return this.guestToken}connectWebSocket(){if(!this.useWs&&!this.websocketUrl){console.warn("WebSocket is disabled or URL is not set");return}if(this.webSocket&&this.webSocket instanceof WebSocket&&this.webSocket?.close(),!this.conversationId)throw new Error("Conversation ID is required for WebSocket connection");this.connectionStateHandler&&this.connectionStateHandler("connecting");const t=this.guestToken?`access_token=${encodeURIComponent(this.guestToken)}`:`api_key=${encodeURIComponent(this.apiKey)}`,n=hl(this.baseUrl,this.websocketUrl,this.conversationId,t,this.tenant,this.language||"en");this.webSocket=zi(n),this.webSocket.onopen=()=>{this.connectionStateHandler&&this.connectionStateHandler("connected")},this.webSocket.onmessage=r=>{try{const i=JSON.parse(r.data);if(i.type==="ping"&&this.webSocket){this.webSocket.send(JSON.stringify({type:"pong"}));return}if(i.type==="message"&&this.messageHandler)if(Array.isArray(i.payload))i.payload.map(a=>{const l=this.adjustMessageTimestamps(a);return!l.message_id&&a.id&&(l.message_id=a.id),l}).filter(a=>a.speaker!=="customer").forEach(this.messageHandler);else{const s=this.adjustMessageTimestamps(i.payload);!s.message_id&&i.payload.id&&(s.message_id=i.payload.id),s.speaker!=="customer"&&this.messageHandler(s)}else i.type==="takeover"?this.handleTakeover():i.type==="finalize"&&this.handleConversationFinalized()}catch{}},this.webSocket.onerror=r=>{this.connectionStateHandler&&this.connectionStateHandler("disconnected");const i=ir(r,n);console.error(`[GenAssist Chat] ${i}`)},this.webSocket.onclose=r=>{if(this.connectionStateHandler&&this.connectionStateHandler("disconnected"),!r.wasClean){const i=ir(r,n);console.warn(`[GenAssist Chat] ${i}`)}}}disconnect(){this.webSocket&&(this.webSocket.close(),this.webSocket=null)}async fetchWelcomeImage(t){try{const n=await ye.get(`${this.baseUrl}/api/genagent/agents/configs/${t}/welcome-image`,{headers:this.getHeaders(),responseType:"blob"}),r=URL.createObjectURL(n.data);this.welcomeObjectUrl=r,this.welcomeData.imageUrl=r,this.welcomeDataHandler&&this.welcomeDataHandler(this.welcomeData)}catch(n){this.isTokenExpiredError(n)&&this.resetChatConversation()}}async addFeedback(t,n,r){if(!t)throw new Error("Message ID is required for feedback");try{const i=`${this.baseUrl}/api/conversations/message/add-feedback/${t}`,s={feedback:n};r&&(s.feedback_message=r),await ye.patch(i,s,{headers:this.getHeaders()})}catch(i){throw this.isTokenExpiredError(i)&&this.resetChatConversation(),console.error("Feedback API call failed:",{message:i.message,response:i.response?.data,status:i.response?.status}),i}}adjustMessageTimestamps(t){return this.conversationCreateTime?{...t,start_time:t.start_time-this.conversationCreateTime,end_time:t.end_time-this.conversationCreateTime}:t}async pollInProgressConversation(){if(!this.conversationId||!this.conversationCreateTime)throw new Error("Conversation not started");const t=await ye.get(`${this.baseUrl}/api/conversations/in-progress/poll/${this.conversationId}`,{headers:this.getHeaders()}),n=(t.data.messages||[]).map(r=>this.normalizePollMessageToChatMessage(r));return{status:t.data.status,pollMessages:n}}normalizePollMessageToChatMessage(t){let n=typeof t.create_time=="number"?t.create_time:t.create_time?+new Date(t.create_time):Math.floor(Date.now()/1e3);n>=1e12&&(n=Math.round(n/1e3));const r=this.conversationCreateTime!=null?n-this.conversationCreateTime:t.start_time,i=this.conversationCreateTime!=null?r+(t.end_time-t.start_time)||.01:t.end_time;return{id:t.id,create_time:n,start_time:r,end_time:i,speaker:t.speaker,text:t.text,type:t.type,feedback:t.feedback}}async notifyTakeoverFromPoll(){this.takeoverHandler&&this.takeoverHandler()}async notifyFinalizedFromPoll(){this.finalizedHandler&&this.finalizedHandler(),this.isFinalized=!0,this.saveConversation()}}const Jy=5,Ky=1e3;function Xy({baseUrl:e,websocketUrl:t,apiKey:n,tenant:r,conversationId:i,guestToken:s,useWs:o,language:a="en",onMessage:l,onConnectionState:u,reconnect:c=!0,maxReconnectAttempts:f=Jy,reconnectBaseDelayMs:p=Ky}){const[h,m]=b.useState("disconnected"),x=b.useRef(null),y=b.useRef(0),w=b.useRef(null),T=b.useRef(l),E=b.useRef(u);T.current=l,E.current=u;const F=b.useCallback(N=>{m(N),E.current?.(N)},[]),z=b.useCallback(()=>{w.current&&(clearTimeout(w.current),w.current=null),y.current=0,x.current&&(x.current.close(),x.current=null),F("disconnected")},[F]),v=b.useCallback(()=>{if(!o||!i)return;x.current&&(x.current.close(),x.current=null);const N=s?`access_token=${encodeURIComponent(s)}`:`api_key=${encodeURIComponent(n)}`,L=hl(e,t,i,N,r,a)?.replace(/\/\//g,"/");F("connecting");const j=zi(L);x.current=j,j.onopen=()=>{y.current=0,F("connected")},j.onmessage=S=>{try{const O=JSON.parse(S.data);if(O.type==="ping"){x.current?.readyState===WebSocket.OPEN&&x.current.send(JSON.stringify({type:"pong"}));return}T.current(O)}catch{}},j.onerror=S=>{F("disconnected");const O=ir(S,L);console.error(`[GenAssist Chat] ${O}`)},j.onclose=S=>{if(x.current=null,F("disconnected"),!S.wasClean){const D=ir(S,L);console.warn(`[GenAssist Chat] ${D}`)}if(c&&!S.wasClean&&y.current<f){y.current+=1;const D=Math.min(p*Math.pow(2,y.current-1),3e4);w.current=setTimeout(()=>{w.current=null,v()},D)}}},[e,t,n,r,i,s,o,a,c,f,p,F]);return b.useEffect(()=>(o&&i?v():z(),z),[o,i,v,z]),{connectionState:h,connect:v,disconnect:z}}const Zy="The service is temporarily unavailable. Please try again later.",ex="Contact support";function tx(e){if(!e.response){const n=e?.code;return!0}const t=e.response?.status;return typeof t=="number"&&t>=500}const gl=({baseUrl:e,websocketUrl:t,apiKey:n,tenant:r,metadata:i,useWs:s=!0,usePoll:o=!1,language:a,onError:l,onTakeover:u,onFinalize:c,serverUnavailableMessage:f,serverUnavailableContactUrl:p,serverUnavailableContactLabel:h,onConfigLoaded:m})=>{const[x,y]=b.useState([]),[w,T]=b.useState(!1),[E,F]=b.useState([]),[z,v]=b.useState("disconnected"),[N,L]=b.useState(!1),j=b.useRef(null),[S,O]=b.useState(null),[D,H]=b.useState(null),[U,M]=b.useState([]),[Q,Z]=b.useState(null),[se,te]=b.useState(null),[k,C]=b.useState(null),[q,g]=b.useState(null),[W,pe]=b.useState([]),[ae,ee]=b.useState(1e3),[Ae,be]=b.useState(null),[Le,ze]=b.useState({}),[We,Ie]=b.useState(!1),[Pe,fe]=b.useState(!1),De=b.useRef(a);De.current=a;const _e=b.useCallback(Y=>{j.current?.processWebSocketMessage(Y)},[]);Xy({baseUrl:e,websocketUrl:t,apiKey:n,tenant:r,conversationId:S,guestToken:D,useWs:s??!0,language:a,onMessage:_e,onConnectionState:v,reconnect:!0});const ne=b.useCallback((Y,re)=>re?`genassist_conversation_messages:${Y}:${re}`:null,[]),Oe=b.useCallback(Y=>{const re=Y.some(ce=>ce?.type==="takeover"),oe=Y.some(ce=>ce?.type==="finalized");Ie(re),fe(oe)},[Ie,fe]),je=b.useCallback(Y=>!!(Y?.response?.status===401&&Y?.response?.data&&(Y.response.data.error==="Token has expired."||Y.response.data.message==="Token has expired."||typeof Y.response.data=="string"&&Y.response.data.includes("Token has expired"))),[]),Re=b.useCallback(()=>{O(null),H(null),fe(!1),Ie(!1),v("disconnected"),Z(null),te(null),C(null),g(null),M([]),pe([]),ee(1e3),ze({}),y([]),he.current=0;const Y=ne(n,S);if(Y)try{localStorage.removeItem(Y)}catch{}},[n,S,ne]),bt=b.useMemo(()=>JSON.stringify(i||{}),[i]),at=b.useRef(e),lt=b.useRef(t),Ct=b.useRef(n),I=b.useRef(r),$=b.useRef(s),_=b.useRef(o),R=b.useRef(0),V=b.useRef(0),he=b.useRef(0),Ve=b.useRef(!1),Ne=b.useRef(!1),Fe=b.useRef(l),ut=b.useRef(u),ve=b.useRef(c),$e=b.useRef(m);b.useEffect(()=>{Fe.current=l},[l]),b.useEffect(()=>{ut.current=u},[u]),b.useEffect(()=>{ve.current=c},[c]),b.useEffect(()=>{$e.current=m},[m]),b.useEffect(()=>{j.current?.setMetadata(i)},[bt,i]),b.useEffect(()=>{let Y=!1;const re=at.current!==e,oe=lt.current!==t,ce=Ct.current!==n,K=I.current!==r,Ee=$.current!==s,pt=_.current!==o;if(!j.current||re||oe||ce||K||Ee){re&&(at.current=e),oe&&(lt.current=t),ce&&(Ct.current=n),K&&(I.current=r),Ee&&($.current=s),pt&&(_.current=o),j.current&&(j.current.setConnectionStateHandler(()=>{}),j.current.disconnect(),j.current.setWelcomeDataHandler(null)),j.current=new ml(e,t,n,i,r,a,s,o),be(null),j.current.setMessageHandler(me=>{const ge={...me,create_time:!me.create_time||isNaN(me.create_time)?Math.floor(Date.now()/1e3):me.create_time};ge.create_time&&ge.create_time>0&&(he.current=Math.round(ge.create_time)*1e3/1e3),y(He=>ge.message_id&&He.some(At=>At.message_id===ge.message_id)?He:[...He,ge]),(ge.speaker==="agent"||ge.speaker==="special")&&L(!1)}),j.current.setTakeoverHandler(()=>{Ie(!0),L(!1),ut.current&&ut.current()}),j.current.setFinalizedHandler(()=>{fe(!0),L(!1),ve.current&&ve.current()}),j.current.setConnectionStateHandler(me=>{v(me),me!=="connected"&&L(!1)}),j.current.setWelcomeDataHandler(me=>{Z(me.title??null),te(me.imageUrl??null),C(me.message??null),g(me.inputDisclaimerHtml??null),me.possibleQueries&&me.possibleQueries.length>0&&M(me.possibleQueries)}),j.current.setServerUnavailableConfig(f,p,h);const kt=j.current;(async()=>{const[me]=await Promise.all([kt.fetchAgentInfo?.()??Promise.resolve(null),kt.fetchAgentChatLocales?.()??Promise.resolve(null)]);if(me&&Array.isArray(me.agent_available_languages)&&be(me.agent_available_languages),Y)return;me&&Array.isArray(me.agent_available_languages)&&be(me.agent_available_languages);const ge=De.current||"en",He=kt.applyLanguageFromLocales(ge);!Y&&He&&(pe(He.thinkingPhrases),ee(He.thinkingDelayMs));const Xe=kt.getChatInputMetadata?.();!Y&&Xe&&typeof Xe=="object"&&Object.keys(Xe).length>0&&(ze(Xe),$e.current?.({chatInputMetadata:Xe}))})();const mt=j.current.getConversationId();if(mt&&(O(mt),H(j.current.getGuestToken()),j.current.isConversationFinalized()?fe(!0):s||v("connected")),j.current){const me=j.current.getPossibleQueries?.()||[];me.length&&M(me);const ge=j.current.getWelcomeData?.();ge&&(Z(ge.title||null),te(ge.imageUrl||null),C(ge.message||null),g(ge.inputDisclaimerHtml??null));const He=j.current.getThinkingConfig?.();He&&(pe(He.phrases||[]),ee(He.delayMs||1e3));const Xe=j.current.getChatInputMetadata?.();Xe&&typeof Xe=="object"&&Object.keys(Xe).length>0&&ze(Xe);const At=j.current.getAvailableLanguages?.();Array.isArray(At)&&be(At),$e.current?.({chatInputMetadata:Xe??{}})}}return j.current&&(j.current.setTakeoverHandler(()=>{Ie(!0),L(!1),ut.current&&ut.current()}),j.current.setFinalizedHandler(()=>{fe(!0),L(!1),ve.current&&ve.current()}),j.current.setServerUnavailableConfig(f,p,h)),()=>{Y=!0}},[e,t,n,r,s,o,f,p,h]),b.useEffect(()=>{const Y=j.current;if(!Y)return;Y.setLanguage(a);const re=a||"en",oe=Y.applyLanguageFromLocales(re);oe&&(pe(oe.thinkingPhrases),ee(oe.thinkingDelayMs))},[a]),b.useEffect(()=>{const Y=ne(n,S);if(!Y){y([]),he.current=0;return}try{const re=localStorage.getItem(Y),oe=re?JSON.parse(re):[];if(y(oe),oe.length){const ce=Math.max(...oe.map(K=>K.create_time?K.create_time:0));he.current=Math.round(ce)*1e3/1e3}}catch{y([]),he.current=0}},[n,S,ne]),b.useEffect(()=>{Oe(x)},[x]),b.useEffect(()=>{const Y=ne(n,S);if(Y)try{localStorage.setItem(Y,JSON.stringify(x))}catch{}},[x,n,S,ne]);const Qe=2e3,vn=5e3;b.useEffect(()=>{if(s||!S||Pe)return;const Y=j.current;if(!Y)return;Ve.current=!1,Ne.current=!1;let re=!1,oe=null;const ce=Ee=>{re||(oe=window.setTimeout(K,Ee))},K=async()=>{if(!re)try{const{status:Ee,pollMessages:pt}=await Y.pollInProgressConversation();if(re)return;R.current=0;const Ke=Math.floor(Number(he.current)||0),kt=(pt||[]).filter(me=>{const ge=Number(me.create_time);return ge===0||!Number.isFinite(ge)?!1:ge>Ke});if(kt.length>0){const me=Se=>Se==="customer"?"customer":Se==="agent"?"agent":"special",ge=Se=>Se.type==="takeover"?"Supervisor took over":Se.type==="finalized"?"Conversation Finalized":Se.text,He=kt.map(Se=>({message_id:Se.id,create_time:Number(Se.create_time),start_time:Number(Se.start_time??0),end_time:Number(Se.end_time??0),speaker:me(Se.speaker),text:ge(Se),type:Se.type,feedback:Se.feedback}));He.length>0&&y(Se=>{const Vi=new Set(Se.map(ct=>ct.message_id).filter(Boolean)),En=He.filter(ct=>ct.message_id==null||!Vi.has(ct.message_id));if(En.length===0)return Se;const gr=En.reduce((ct,gt)=>Number.isFinite(gt.create_time)?Math.max(ct,gt.create_time):ct,Ke);return he.current=gr,[...Se,...En]});const Xe=He.some(Se=>Se.type==="takeover"),At=He.some(Se=>Se.type==="finalized");(Ee==="finalized"||At)&&!Ne.current?(Ne.current=!0,fe(!0)):(Ee==="takeover"||Xe)&&!Ve.current&&(Ve.current=!0,Ie(!0))}else Ee==="finalized"&&!Ne.current?(Ne.current=!0,Y.handleConversationFinalized(),fe(!0)):Ee==="takeover"&&!Ve.current&&(Ve.current=!0,Y.notifyTakeoverFromPoll(),Ie(!0));if(Ee==="finalized")return;const mt=vn;V.current=mt,ce(mt)}catch{if(re||(R.current+=1,R.current>=5))return;const Ee=V.current||Qe;ce(Ee)}};return R.current=0,V.current=Qe,o&&!s&&K(),()=>{re=!0,oe!==null&&clearTimeout(oe)}},[s,S,Pe,o]);const Ue=b.useCallback(async Y=>{if(!j.current)return;v("connecting"),T(!0),y([]),M([]),Z(null),te(null),C(null),g(null),pe([]),ee(1e3),he.current=0;const re=ne(n,S);re&&localStorage.removeItem(re),fe(!1),Ie(!1),L(!1);try{j.current.resetChatConversation(),O(null),H(null);const oe=await j.current.startConversation(Y);if(O(oe),H(j.current.getGuestToken()),v("connected"),j.current.getPossibleQueries){const K=j.current.getPossibleQueries();K&&K.length>0&&M(K)}if(j.current.getWelcomeData){const K=j.current.getWelcomeData();Z(K.title||null),te(K.imageUrl||null),C(K.message||null),g(K.inputDisclaimerHtml??null)}if(j.current.getThinkingConfig){const K=j.current.getThinkingConfig();pe(K.phrases||[]),ee(K.delayMs||1e3)}if(j.current.getAvailableLanguages){const K=j.current.getAvailableLanguages();Array.isArray(K)&&be(K)}const ce=j.current.getChatInputMetadata?.();ce&&typeof ce=="object"&&Object.keys(ce).length>0&&ze(ce),$e.current?.({chatInputMetadata:j.current.getChatInputMetadata?.()??{}})}catch(oe){v("disconnected"),L(!1),Fe.current&&oe instanceof Error&&Fe.current(oe)}finally{T(!1)}},[]),Wi=b.useCallback(async Y=>{const re=j.current?.getConversationId();if(!re)return null;try{const oe=await j.current?.uploadFile(re,Y),ce=new URL(oe.file_url,e).href,K={name:Y.name,type:Y.type,size:Y.size,url:ce,file_id:oe?.file_id};return F(Ee=>[...Ee,K]),K}catch(oe){return je(oe)&&Re(),Fe.current&&Fe.current(oe),null}},[n,S,ne,je,Re]),Tt=b.useCallback(async(Y,re=[],oe,ce)=>{if(!j.current)throw new Error("Chat service not initialized");try{T(!0);const K=[];if(re.length>0){const Ee=re.map(pt=>E.find(Ke=>Ke.name===pt.name&&Ke.size===pt.size)).filter(Boolean);K.push(...Ee)}We||L(!0),await j.current.sendMessage(Y,K,oe,ce),F([])}catch(K){if(L(!1),je(K))Re();else if(tx(K)){const Ee=Date.now()/1e3,pt=j.current?.getConversationCreateTime(),Ke=pt!=null?Ee-pt:0,kt=Ke+.01,mt={create_time:Ee,start_time:Ke,end_time:kt,speaker:"special",text:f??Zy,...p&&{linkUrl:p,linkLabel:h??ex}};y(me=>[...me,mt])}else Fe.current&&K instanceof Error&&Fe.current(K)}finally{T(!1)}},[E,We,je,Re,f,p,h]),Xt=b.useCallback(async(Y,re)=>{if(!j.current)throw new Error("Chat service not initialized");try{T(!0),We||L(!0),await j.current.sendAudioMessage(Y,re)}catch(oe){L(!1),je(oe)?Re():Fe.current&&oe instanceof Error&&Fe.current(oe)}finally{T(!1)}},[We,je,Re]),Zt=b.useCallback(async Y=>{if(j.current)try{v("connecting"),T(!0),y([]),M([]);const re=ne(n,S);re&&localStorage.removeItem(re),fe(!1),Ie(!1),L(!1),j.current.resetChatConversation(),O(null),H(null);const oe=await j.current.startConversation(Y);if(O(oe),H(j.current.getGuestToken()),v("connected"),j.current.getPossibleQueries){const K=j.current.getPossibleQueries();K&&K.length>0&&M(K)}if(j.current.getWelcomeData){const K=j.current.getWelcomeData();Z(K.title||null),te(K.imageUrl||null),C(K.message||null),g(K.inputDisclaimerHtml??null)}if(j.current.getThinkingConfig){const K=j.current.getThinkingConfig();pe(K.phrases||[]),ee(K.delayMs||1e3)}const ce=j.current.getChatInputMetadata?.();ce&&typeof ce=="object"&&Object.keys(ce).length>0&&ze(ce),$e.current?.({chatInputMetadata:j.current.getChatInputMetadata?.()??{}})}catch(re){v("disconnected"),L(!1),Fe.current&&re instanceof Error&&Fe.current(re)}finally{T(!1)}},[]),Bt=b.useCallback(async(Y,re,oe)=>{if(!j.current){console.error("Cannot send feedback: ChatService not initialized");return}if(!Y){console.error("Cannot send feedback: messageId is required");return}try{await j.current.addFeedback(Y,re,oe);const ce={feedback:re,feedback_message:oe,feedback_timestamp:new Date().toISOString()};y(K=>K.map(Ee=>(Ee.message_id||Ee.id)===Y?{...Ee,feedback:[...Ee.feedback||[],ce]}:Ee))}catch(ce){Fe.current&&Fe.current(ce)}},[]);return{messages:x,isLoading:w,sendMessage:Tt,sendAudioMessage:Xt,uploadFile:Wi,resetConversation:Ue,startConversation:Zt,connectionState:z,conversationId:S,guestToken:D,possibleQueries:U,isTakenOver:We,isFinalized:Pe,isAgentTyping:N,addFeedback:Bt,welcomeTitle:Q,welcomeImageUrl:se,welcomeMessage:k,inputDisclaimerHtml:q,thinkingPhrases:W,thinkingDelayMs:ae,availableLanguages:Ae,chatInputMetadata:Le}};function nx({messages:e,isAgentTyping:t,currentThinkingPartIndex:n,currentThinkingPartsLength:r,conversationId:i,isFloatingOpen:s,mode:o}){const a=b.useRef(null),l=b.useRef(null),u=b.useRef(!1),c=b.useRef(!0),f=b.useRef(s),p=()=>{const m=l.current;!m||!e.length||u.current||m.clientHeight!==0&&(m.scrollTop=m.scrollHeight,u.current=!0,c.current=!0)},h=(m="smooth",x=!1)=>{const y=l.current,w=a.current;if(!y||!w||!x&&!c.current)return;const T=()=>{y.scrollTo({top:y.scrollHeight,behavior:m}),c.current=!0};m==="auto"?T():requestAnimationFrame(T)};return b.useLayoutEffect(()=>{e.length&&(u.current?h("smooth",!1):p())},[e]),b.useLayoutEffect(()=>{t&&h("auto",!0)},[t,n,r]),b.useEffect(()=>{u.current=!1},[i]),b.useEffect(()=>{if((o==="floating"||o==="fullscreen")&&s&&!f.current&&e.length>0){u.current=!1,c.current=!0;const m=()=>{const x=l.current;if(!x){requestAnimationFrame(m);return}if(x.clientHeight===0){requestAnimationFrame(m);return}x.scrollTop=x.scrollHeight,u.current=!0,c.current=!0};requestAnimationFrame(()=>{requestAnimationFrame(m)})}f.current=s},[s,o]),b.useEffect(()=>{if(!e.length)return;const m=l.current;if(!m)return;const x=new ResizeObserver(()=>{c.current&&p()});return x.observe(m),p(),()=>{x.disconnect()}},[e]),b.useEffect(()=>{const m=l.current;if(!m)return;const x=(w=100)=>{if(!m)return!0;const{scrollTop:T,scrollHeight:E,clientHeight:F}=m;return E-T-F<=w},y=()=>{c.current=x()};return m.addEventListener("scroll",y,{passive:!0}),y(),()=>{m.removeEventListener("scroll",y)}},[]),{messagesEndRef:a,chatContainerRef:l}}function rx({isAgentTyping:e,thinkingPhrases:t,thinkingDelayMs:n,translations:r}){const i=b.useMemo(()=>ka("thinking.messages",r,["Thinking…","Analyzing your question…","Searching knowledge…","Pulling relevant info…","Drafting the answer…","Double‑checking details…","Tying it together…","Almost there…"]),[r]),[s,o]=b.useState([]),[a,l]=b.useState(0);return b.useEffect(()=>{if(!e){o([]),l(0);return}const u=t&&t.length>0?t:i,c=Math.floor(Math.random()*u.length),f=u[c],p=f.includes("|")?f.split("|").map(x=>x.trim()).filter(x=>x.length>0):[f.trim()];if(o(p),l(0),p.length<=1)return;const h=Math.max(250,n||1e3),m=[];for(let x=1;x<p.length;x++){const y=setTimeout(()=>{l(x)},h*x);m.push(y)}return()=>{m.forEach(x=>clearTimeout(x))}},[e,t,n]),{currentThinkingParts:s,currentThinkingPartIndex:a}}function ix({mode:e,widget:t,isFloatingOpen:n,showResetConfirm:r,showLanguageDropdown:i,showMenu:s,onExitFullscreen:o,setShowResetConfirm:a,setShowLanguageDropdown:l,setShowMenu:u}){const[c,f]=b.useState(typeof window<"u"?window.innerWidth:1024),[p,h]=b.useState(typeof window<"u"?window.innerHeight:700),[m,x]=b.useState(!1),y=b.useMemo(()=>e==="fullscreen"||t||m?!0:c<=768,[c,t,m,e]),w=()=>{x(T=>!T),u(!1)};return b.useEffect(()=>{if(typeof window>"u"||e==="floating"&&!n)return;const T=E=>{if(E.key==="Escape"){if(r){E.preventDefault(),a(!1);return}if(i){E.preventDefault(),l(!1);return}if(s){E.preventDefault(),u(!1);return}if(y){if(m){E.preventDefault(),x(!1);return}e==="fullscreen"&&o&&(E.preventDefault(),o())}}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n,y,m,e,o,i,s,r]),b.useEffect(()=>{const T=()=>{f(window.innerWidth),h(window.innerHeight)};T(),window.addEventListener("resize",T);const E=typeof window<"u"?window.visualViewport:null;return E?.addEventListener("resize",T),E?.addEventListener("scroll",T),()=>{window.removeEventListener("resize",T),E?.removeEventListener("resize",T),E?.removeEventListener("scroll",T)}},[]),b.useEffect(()=>{if(y&&typeof document<"u"){const T=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=T}}},[y]),{windowWidth:c,windowHeight:p,isFullscreen:y,isFullscreenToggled:m,handleFullscreenToggle:w}}function ox({uploadFile:e,t}){const[n,r]=b.useState([]),[i,s]=b.useState(new Set),[o,a]=b.useState(null),l=b.useRef(null),u=b.useRef(null);return b.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),{attachments:n,setAttachments:r,uploadingFiles:i,fileErrorToast:o,fileInputRef:u,handleFileChange:async h=>{if(h.target.files&&h.target.files.length>0){const m=Array.from(h.target.files),x=m.map(w=>({file:w,attachment:null}));r(w=>[...w,...x]);const y=new Set(i);m.forEach(w=>y.add(w.name)),s(y);try{const w=await Promise.allSettled(m.map(async z=>({file:z,attachment:await e(z)}))),T=new Map,E=new Set;w.forEach((z,v)=>{const N=m[v];if(!N)return;const L=`${N.name}:${N.size}:${N.lastModified}`;if(z.status==="rejected"){T.set(L,null),E.add(L);return}const{attachment:j}=z.value;T.set(L,j),j===null&&E.add(L)});const F=E.size>0;r(z=>z.filter(v=>{const N=`${v.file.name}:${v.file.size}:${v.file.lastModified}`;return!E.has(N)}).map(v=>{const N=`${v.file.name}:${v.file.size}:${v.file.lastModified}`,L=T.get(N);return L!==void 0?{...v,attachment:L}:v})),F&&(l.current&&clearTimeout(l.current),a(t("fileUpload.fileTypeNotSupported","This file type is not supported.")),l.current=setTimeout(()=>{a(null),l.current=null},4e3))}catch(w){console.error("Error uploading file",w)}finally{const w=new Set(i);m.forEach(T=>w.delete(T.name)),s(w),u.current&&(u.current.value="")}}},handleRemoveAttachment:h=>{r(m=>m.filter(x=>x.file.name!==h))},clearAttachments:()=>{r([]),u.current&&(u.current.value="")}}}function sx(){return typeof MediaRecorder>"u"?"":MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":""}function ax(e){return e.includes("webm")?"webm":e.includes("mp4")?"mp4":"webm"}function lx(e,t){const[n,r]=b.useState(!1),i=b.useRef(null),s=b.useRef([]),o=b.useRef(null),a=b.useRef(!1),l=b.useCallback(async()=>{try{const f=sx();if(!f)throw new Error("Audio recording is not supported in this browser");a.current=!1;const p=await navigator.mediaDevices.getUserMedia({audio:!0});o.current=p,s.current=[];const h=new MediaRecorder(p,{mimeType:f});i.current=h,h.ondataavailable=m=>{m.data.size>0&&s.current.push(m.data)},h.onstop=()=>{const m=a.current,x=new Blob(s.current,{type:f}),y=ax(f);s.current=[],o.current?.getTracks().forEach(w=>w.stop()),o.current=null,m||e(x,y)},h.start(),r(!0)}catch(f){t?.(f instanceof Error?f:new Error(String(f)))}},[e,t]),u=b.useCallback(()=>{i.current&&i.current.state!=="inactive"&&i.current.stop(),r(!1)},[]),c=b.useCallback(()=>{a.current=!0,i.current&&i.current.state!=="inactive"&&i.current.stop(),r(!1)},[]);return{isRecording:n,startRecording:l,stopRecording:u,cancelRecording:c}}const yl=32,ux=Array.from({length:yl},(e,t)=>{const n=yl/2,r=Math.abs(t-n)/n;return .3+.7*(1-r*r)}),cx=({onAudioReady:e,onError:t,theme:n,disabled:r=!1})=>{const[i,s]=b.useState("idle"),[o,a]=b.useState(null),[l,u]=b.useState("webm"),[c,f]=b.useState(null),[p,h]=b.useState(0),m=b.useRef(null),x=b.useCallback((S,O)=>{a(S),u(O);const D=URL.createObjectURL(S);f(D),s("preview"),m.current&&(clearInterval(m.current),m.current=null)},[]),{startRecording:y,stopRecording:w,cancelRecording:T}=lx(x,t),E=b.useCallback(async()=>{r||(h(0),await y(),s("recording"),m.current=window.setInterval(()=>h(S=>S+1),1e3))},[r,y]),F=b.useCallback(()=>{w()},[w]),z=b.useCallback(()=>{o&&e(o,l),N()},[o,l,e]),v=b.useCallback(()=>{N()},[]),N=()=>{c&&URL.revokeObjectURL(c),f(null),a(null),s("idle"),h(0),m.current&&(clearInterval(m.current),m.current=null)};b.useEffect(()=>()=>{m.current&&clearInterval(m.current),c&&URL.revokeObjectURL(c)},[]);const L=n?.primaryColor||"#4f46e5",j=S=>{const O=Math.floor(S/60),D=S%60;return`${O}:${D.toString().padStart(2,"0")}`};return i==="idle"?d.jsx("button",{type:"button",onClick:E,disabled:r,style:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)",backgroundColor:L,color:"#ffffff",border:"none",borderRadius:"50%",width:36,height:36,display:"flex",alignItems:"center",justifyContent:"center",cursor:r?"not-allowed":"pointer",flexShrink:0,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.12)",opacity:r?.5:1,zIndex:5,transition:"opacity 0.15s ease"},title:"Start Recording",children:d.jsx(gi,{size:18,color:"#ffffff"})}):i==="recording"?d.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",gap:0,padding:"0 6px",backgroundColor:"#fff",borderRadius:24,zIndex:10,overflow:"hidden"},children:[d.jsx("button",{type:"button",onClick:()=>{T(),N()},style:{background:"none",border:"none",cursor:"pointer",padding:6,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af",borderRadius:"50%",flexShrink:0,transition:"color 0.15s ease"},title:"Cancel",onMouseEnter:S=>S.currentTarget.style.color="#6b7280",onMouseLeave:S=>S.currentTarget.style.color="#9ca3af",children:d.jsx(yi,{size:18})}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"0 8px 0 4px",flexShrink:0},children:[d.jsx("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:"#ef4444",animation:"ga-rec-pulse 1.5s ease-in-out infinite",flexShrink:0}}),d.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#374151",fontVariantNumeric:"tabular-nums",minWidth:32,fontFamily:"inherit"},children:j(p)})]}),d.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:2,height:"100%",padding:"0 4px",overflow:"hidden"},children:ux.map((S,O)=>d.jsx("div",{style:{width:2.5,borderRadius:3,backgroundColor:L,opacity:.55+.45*S,animation:`ga-wave ${.6+O%5*.15}s ease-in-out ${O*.04}s infinite alternate`,minHeight:3,maxHeight:Math.round(S*26),flexShrink:0}},O))}),d.jsx("button",{type:"button",onClick:F,style:{backgroundColor:"#ef4444",color:"#fff",border:"none",borderRadius:"50%",width:36,height:36,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,boxShadow:"0 1px 4px rgba(239, 68, 68, 0.3)",transition:"box-shadow 0.15s ease"},title:"Stop Recording",onMouseEnter:S=>S.currentTarget.style.boxShadow="0 2px 8px rgba(239, 68, 68, 0.4)",onMouseLeave:S=>S.currentTarget.style.boxShadow="0 1px 4px rgba(239, 68, 68, 0.3)",children:d.jsx(Ym,{size:12,fill:"#fff"})}),d.jsx("style",{children:`
|
|
49
|
+
@keyframes ga-wave {
|
|
50
|
+
0% { height: 3px; }
|
|
51
|
+
100% { height: var(--ga-wave-h, 22px); }
|
|
52
|
+
}
|
|
53
|
+
@keyframes ga-rec-pulse {
|
|
54
|
+
0%, 100% { opacity: 1; }
|
|
55
|
+
50% { opacity: 0.3; }
|
|
56
|
+
}
|
|
57
|
+
`})]}):d.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",gap:0,padding:"0 6px",backgroundColor:"#fff",borderRadius:24,zIndex:10,overflow:"hidden"},children:[d.jsx("button",{type:"button",onClick:v,style:{background:"none",border:"none",cursor:"pointer",padding:6,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af",borderRadius:"50%",flexShrink:0,transition:"color 0.15s ease"},title:"Discard",onMouseEnter:S=>S.currentTarget.style.color="#ef4444",onMouseLeave:S=>S.currentTarget.style.color="#9ca3af",children:d.jsx(yi,{size:18})}),d.jsx("div",{style:{flex:1,minWidth:0,padding:"0 4px"},children:c&&d.jsx(Wn,{blobUrl:c,primaryColor:L,compact:!0})}),d.jsx("button",{type:"button",onClick:z,style:{backgroundColor:L,color:"#fff",border:"none",borderRadius:"50%",width:36,height:36,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,boxShadow:`0 1px 4px ${L}44`,transition:"box-shadow 0.15s ease"},title:"Send",onMouseEnter:S=>S.currentTarget.style.boxShadow=`0 2px 8px ${L}55`,onMouseLeave:S=>S.currentTarget.style.boxShadow=`0 1px 4px ${L}44`,children:d.jsx(Qm,{size:16})})]})};class fx{constructor(t){this.guestToken=null,this.ws=null,this.audioChunks=[],this.resolvePromise=null,this.rejectPromise=null,this.wsVersion=1,this.baseUrl=t.baseUrl,t.websocketUrl?(this.wsVersion=2,this.websocketUrl=t.websocketUrl?.replace(/\/\//g,"/")):(this.wsVersion=1,this.websocketUrl=`${this.baseUrl.replace("http","ws")}`?.replace(/\/\//g,"/")),this.apiKey=t.apiKey,this.guestToken=t.guestToken||null}setGuestToken(t){this.guestToken=t}async textToSpeech(t,n="alloy"){return new Promise((r,i)=>{this.resolvePromise=r,this.rejectPromise=i,this.audioChunks=[];const s=this.guestToken?`access_token=${encodeURIComponent(this.guestToken)}`:`api_key=${encodeURIComponent(this.apiKey)}`,o=this.wsVersion===1?"voice/audio/tts":"ws/voice/audio/tts",a=`${this.websocketUrl}/${o}?${s}`;this.ws=zi(a),this.ws.onopen=()=>{this.ws?.send(JSON.stringify({text:t}))},this.ws.onmessage=l=>{l.data instanceof Blob&&this.audioChunks.push(l.data)},this.ws.onclose=()=>{if(this.audioChunks.length>0){const l=new Blob(this.audioChunks,{type:"audio/mp3"});this.resolvePromise?.(l)}else this.rejectPromise?.(new Error("No audio data received"));this.cleanup()},this.ws.onerror=l=>{this.rejectPromise?.(l),this.cleanup()}})}cleanup(){this.ws&&(this.ws.close(),this.ws=null),this.resolvePromise=null,this.rejectPromise=null}async playAudio(t){const n=URL.createObjectURL(t),r=new Audio(n);return new Promise((i,s)=>{r.onended=()=>{URL.revokeObjectURL(n),i()},r.onerror=o=>{URL.revokeObjectURL(n),s(o)},r.play().catch(s)})}}const xl=({showChat:e,onClick:t,primaryColor:n,style:r})=>{const s={...{position:"fixed",bottom:"20px",right:"20px",width:"60px",height:"60px",borderRadius:"50%",backgroundColor:n,color:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:40},...r};return d.jsx("div",{style:s,onClick:t,children:e?d.jsx(xi,{size:24}):d.jsx(Gm,{size:24})})},bl=({schema:e,onSubmit:t,onCancel:n,isSubmitting:r,isSubmitted:i,primaryColor:s="#2563eb",fontFamily:o="inherit",variant:a="card"})=>{const[l,u]=b.useState({}),[c,f]=b.useState({}),p=a==="footer",h=e.fields.every(D=>!D.required),m=!!n&&h&&!i,x=(D,H)=>{u(U=>({...U,[D]:H})),c[D]&&f(U=>{const M={...U};return delete M[D],M})},y=D=>{if(D.preventDefault(),i||r)return;const H={};if(e.fields.forEach(U=>{U.required&&!l[U.name]&&l[U.name]!==0&&l[U.name]!==!1&&(H[U.name]="This field is required")}),Object.keys(H).length>0){f(H);return}t(l)},w=p?{width:"100%"}:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"16px",maxWidth:"100%"},T={fontSize:p?"13px":"14px",color:"#374151",marginBottom:p?"8px":"12px",fontWeight:500,fontFamily:o},E=p?{maxHeight:"200px",overflowY:"auto",paddingRight:"4px"}:{},F={marginBottom:p?"8px":"12px"},z={display:"block",fontSize:p?"12px":"13px",fontWeight:600,color:"#374151",marginBottom:"2px",fontFamily:o},v={fontSize:"11px",color:"#6b7280",marginBottom:"3px",fontFamily:o},N={width:"100%",padding:p?"6px 10px":"8px 12px",fontSize:p?"13px":"14px",border:"1px solid #d1d5db",borderRadius:"8px",outline:"none",boxSizing:"border-box",backgroundColor:i?"#f3f4f6":"#ffffff",fontFamily:o},L={...N,appearance:"auto"},j={fontSize:"12px",color:"#ef4444",marginTop:"2px"},S={width:"100%",padding:p?"9px 16px":"10px 16px",fontSize:p?"13px":"14px",fontWeight:600,color:"#ffffff",backgroundColor:i?"#9ca3af":s,border:"none",borderRadius:p?"10px":"8px",cursor:i||r?"not-allowed":"pointer",opacity:r?.7:1,marginTop:p?"2px":"4px",fontFamily:o},O={display:"flex",alignItems:"center",gap:"8px"};return d.jsxs("form",{onSubmit:y,style:w,children:[d.jsx("div",{style:T,children:e.message}),d.jsx("div",{style:E,children:e.fields.map(D=>d.jsxs("div",{style:F,children:[d.jsxs("label",{style:z,children:[D.label,D.required&&d.jsx("span",{style:{color:"#ef4444",marginLeft:"2px"},children:"*"})]}),D.description&&d.jsx("div",{style:v,children:D.description}),D.type==="text"&&d.jsx("input",{type:"text",style:N,placeholder:D.placeholder||"",value:l[D.name]||"",onChange:H=>x(D.name,H.target.value),disabled:i||r}),D.type==="number"&&d.jsx("input",{type:"number",style:N,placeholder:D.placeholder||"",value:l[D.name]!==void 0?String(l[D.name]):"",onChange:H=>x(D.name,H.target.value?Number(H.target.value):""),disabled:i||r}),D.type==="date"&&d.jsx("input",{type:"date",style:N,value:l[D.name]||"",onChange:H=>x(D.name,H.target.value),disabled:i||r}),D.type==="select"&&d.jsxs("select",{style:L,value:l[D.name]||"",onChange:H=>x(D.name,H.target.value),disabled:i||r,children:[d.jsx("option",{value:"",children:D.placeholder||"Select..."}),D.options?.map(H=>d.jsx("option",{value:H.value,children:H.label},H.value))]}),D.type==="boolean"&&d.jsxs("div",{style:O,children:[d.jsx("input",{type:"checkbox",checked:l[D.name]||!1,onChange:H=>x(D.name,H.target.checked),disabled:i||r,style:{width:"16px",height:"16px"}}),d.jsx("span",{style:{fontSize:"14px",color:"#374151"},children:D.placeholder||"Yes"})]}),c[D.name]&&d.jsx("div",{style:j,children:c[D.name]})]},D.name))}),d.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:p?"2px":"4px"},children:[m&&d.jsx("button",{type:"button",style:{...S,marginTop:0,backgroundColor:"transparent",color:"#6b7280",border:"1px solid #d1d5db",cursor:r?"not-allowed":"pointer"},disabled:r,onClick:n,children:"Skip"}),d.jsx("button",{type:"submit",style:{...S,marginTop:0},disabled:i||r,children:i?"Submitted":r?"Submitting...":"Submit"})]})]})},dx=({availableLanguages:e,selectedLanguage:t,onLanguageChange:n,translations:r,theme:i})=>{const s=(m,x)=>Vn(m,r,x),o=i?.primaryColor||"#2962FF",a=i?.backgroundColor||"#ffffff",l=i?.textColor||"#000000",u=i?.fontFamily||"Roboto, Arial, sans-serif",c={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 20px",gap:"16px"},f={fontSize:"14px",fontWeight:600,color:l,margin:0,fontFamily:u,display:"flex",alignItems:"center",gap:"8px"},p={display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"8px",width:"100%",maxWidth:"320px"},h=m=>({padding:"10px 16px",backgroundColor:m?o:a,color:m?"#ffffff":l,border:m?`1px solid ${o}`:"1px solid #e5e7eb",borderRadius:"8px",fontSize:"13px",fontFamily:u,cursor:"pointer",transition:"all 0.2s ease",fontWeight:m?600:400,boxShadow:m?"0 2px 4px rgba(0, 0, 0, 0.1)":"none"});return d.jsxs("div",{style:c,children:[d.jsxs("div",{style:f,children:[d.jsx(fa,{size:18,color:l}),s("menu.language")]}),d.jsx("div",{style:p,children:e.map(m=>d.jsx("button",{style:h(t===m.code),onClick:()=>n(m.code),children:m.name},m.code))})]})},hx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACCCAYAAACHHWC6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABEQSURBVHgB7Z15dJTlvce/SSYRgnqtWiCQDDtBZQ9bwqa2vbd3q9UiAioCgoDIctXS272nx7/a09paFERRrC0ioqLIsVowOyEJELYimxCSTAKukIUls/X3zPv8kjFlyTLPM+8y33PwSE4OM/O8n/n8fu8z7/ubBDg7LvoT6IfNhS4kHzuHsgr6exxicWQSxX/6Iye7D97zD8LBYHf84g4YQMTDoUmAMyNg8A5Abk4AFybT/8KPz3zXYvIcF27OrUduOQwognBYnAhECIb+yM0N4PykIC6Kg04HPz6BoPAKKBLQNa8BOSfgQCicBgSbQcAwsRkGDkMxaXY8bixoQN5xOAwKJwHBMOT5LwkDx4DiOtw+KwE35zcg11GmcAoQEoa8fIJhwuVh4DSVj9lJ6FpQhxzHmMIJQEgY8skMDQSDV/ysFWcRBhRdMGlWElIIimxHQGF3IMLMwDAE27DPEILC1wUTHQOFnYGQZxN5hQE0ZAXReJUycbnExzdD0a3Q7uXDrkAwDAUB1BMMPvGzDmw2MRSTHuqMbkW1yDkGm0JhRyBamEHAEIzAdrQBRWdMmklQ7LArFHYDghvIIjLDuMjBwGEoJs5MRM8d9fjIdlDYCQhphnwyQ50CGDgCis+pfIyf2QlpxbXYdhQ2gsIuQEgzFGwnGDLVwcAxoEhGFkGRQlBk2wYKOwAhYSgs8qN2nHoYOAzFBAFFKUFxBDaAwupAsBkEDGP1wcBhKMY/SOWDoNhmeSisDES4GaIAA4ehyCQoeljeFFYFIgTDQBSUEAxjogcDp9kU1yBtVx22HYZFobAiEGyGYoJhdPRh4BhQdEbmA50sDIXVgAiD4ayJYOA0Q3ENeu2uw1bLQWElIGSZKCwlGEaZDwaOgOILKh/j7qfyUUamOAQLQWEVIJpg8OFshnlh4MRJKDIJit4ExVbLQGEFICwGA4ehGEtQ9NxTh48sAYXZgQjBkI7tuwiGkdaBgdNkihlkir1kio9hcijMDISEoWinF18RDH5YCwaOgOJLYQqCoh9B8aGpoTArEGwGDTAEfQm4Pj6IxgCU3bXFphgzIwnuffXYZloozAiE7Bm27/bhy+FBBOJUwpCIVBepfGon3DIgiAvdoB6K6UnodYCgOAgTQmE2BYfDMEwHDI3Ys6Acc58XP0nH3oONKE+H0lv5Ar4k9HPV4m9TarD8TflYAZgkZrqHUZaJHbv0wbB/oYRBrEPiYQy7ld694rMIhQconh73E9/1+O7GFPzmB/KxTHMczGIIaYaiPT58MUQHDBdQNr8C81bj6+9QCeVuMkWlBlP0ddXjg6keLH8DJjGFGYCQMOwgGD7XAEOa6yLK5p3E3Bdx6YMgn0/ZAS8qboEWKLYSFE+YAopoq4phKNMDgzDD7vlXgEFE3LyReAQjBifCfcj4nThFjZ8oH8d91+LbG7rjN/fCBOUjmoZgGPYSDIN1mOEcds6rwvwrwfAvzy8dZfupfNyK0Fqpen6GKc5h67RKPPE6omiKaAHBPcM+6hlu0wHDeZQ9XIm5L6Fti90CiqDy8lGH7GnVWBY1KKKhJ4Zhry4YLpIZ2gGDSKh8HMaIIVRuaDMpTnn5uA53rO+B392HKJUP3YaQ1zMU7adNmlv1mGEXmeGR9sAQHj772NeIqtugpXx8NKMS//caNJtCJ4FyUYs1wlAyOwIwiEhTjByahNQDULq7aJgiGXeuS8PT06HZFLoMwZtO+7z4nMqEX+ELjKgZWka+jl3UU3g0NJp9yBTZWk2hgzwx+o/KRMkBA4aAQgiDtIhuOrUsnqUABhFpiowhSegpTaGypzgRMkUqnr4fmkyh2hB8annQh8/Sg6F3k8oy4XY1oOghDxb9GWrfUfJ17d7jRdUQaDBFA3IerMKyv0CxKVQSFzJDOkr2GzAE4lXCYJihdJYGGETk5tXI4TpM4SVTdMHkV1Pxuweg2BSqDCFg8A1EMZnhdHpQ6TvIgKEexTM9WPgq9Hbl0hQ7yRTVSk0RR6ZIRG96nXn0Opcqe50qnryEYcfHPnw6MKh0M0fA0EuUCdLpo8p1eplIKHbt9sIzDMrLR29qmPMfqsASJSaM9BOXi8NmUA1D1MzQMtxTlBEUQ6G0V/L7qadIOI9cgmJZxKGI5AGTi1L6sS4YGlD8gAlgEOGeYkQSeuwx+glVPUVCghflvs6Y/IobKx5ChHuKSP1DoQaSzHDYhxrFZSIQKhPnUDSjCgv/CvNcccSnpBkupBAU6hrNYKjRLPd1wvi1afjTbEQQikhoLcwMpwbQ2YTC6zTZDKX306eW62AeGMLDjSb1FDXDjU1NZT2FnxpNKh/5tCO7ZC0isB4dpUru3JUeUg8Dm6F4uolhEJHlY9TIJKTsNt5zyk5JRfnwd8bEl9PwzBxEwBQdIVfCUHKkEaf7QjkMvemj4QL6aHhxVK8XaEP47KOUTkkzdJjiHLbPrcKiNejA+rSXJgnDzkN6YBB7+oXTLQSDiDRFxmhdpkhG1osdNUV7iGUYyAw1MTNcPdIUJWSKTzOMp6/aFIXzqvBYa68M+1ra+sS4YTpKDVMfHTDUo2CqB4tNc1VyO8PrVuzFqdF6oNj+CJWPF9DGdWvLk9Jshj4Chvs8eGwDrA0Dh3uKEnozjVIPRS+CoqjNULS2zvCLOaoPhvypNoJBhHuKMS503Wm8LJU9xUnqKTJXp+LZeWhDT9GaX2IzfELdsoYy0ddVi21TbFAmLpUQFEcxhqDoXqwLip5YtQCthOJqyuLad4w011uPGfLu9WDJRtgPhvDIa0tLd9A2/xgd5YO2+RfQNj/ftnjZdb3Sk2gyA5WJXjpgaEDOlCosM90NsIrCHwQW0lZ/FkIjD1QlSA/mxnls/+0JTFt+pd+8HBB87eCJRnjS6B/UUSbuqcHjb8MZMHBC63wzFtwexBfnoDA+eOlT0oF9PsOG94DyC5f7vUsBwdvRx8kMbvUw9CEYcgmGpU6DgSOOgWlmRLQ82Hz/AcFQ7dZhhjrk312DJZvgTBhMl/Cuk8tEeSOqNMGw7fu0AxmDwURhINgMomdI1QfD4+8gBoOpIupXGAyV1EBCAwzZd1Vj2buIwWC6hD6Co1PLKjKDGLildAiZCzfgLLK/8yl+tU0+tllgCO0QwUTNneYEu2Fo8mnsuygufROL4TU2RtTetyNW24UEnrxmlnFGuAmZKd3xFr0pyh1oqwCS0DP+DDY/DSx+XBwUedn8zgovqnqK8XlQlqb+4XvUP2yGSUpGF4ztloqVp6hkwlkx7oO9gJ1LKzD/GYjJ7UBoXrDrCEa5aTergn5J8QQ2MQPhW+/2wO/vQgcu5Iilo+HZGSWLGQb6E+CDIaEY2YegOAnlY/lCUGxKw5++jxgUUQjfIV/82EksXIEwU4cfCIaibyJSK6ABimRMfLsHno5BoTVNU3UWV+LRZ9GibLc8CBKKDDJFj5PGCB1VMW53vw53vp2KFXcjBoWGGHfIn8eORScx/2tm4FzqAEgoRpMpepSrh+K4rwsmvJWKZ+5BDAqFaYJhYSUWPYfLNPSXW3wBhbi3oF8iUpSbwrjdfdKbKfhjzBRKwjCUPkplYhWucHZ3pYWXl3wJU6SUq4QiKKG4HpPJFH8w3fxna4fvdhNmmL8SVznVv9qiMxTCFCdUQ9FoDMbY2BPPTkEMigjEGJdQj4IFnquYgdOaBWco+rsUmwLyJtZrkfVGzBQdDY9L2E4wLLnqpXOc1i62vDh0dD+C4rj68lEeMoUbz5li/rP1wmWi6BEPFrUaBqBtC81QDKDycUwHFJ2RucGNlVMRg6IN4ak6+fPac6NOWxeZy0e6Cz2O64Fi3OturIhB0aqwGcRdW0vbdStfexZYmmIUmaK7JlOMfz0Nz0Zt/rM1wjAUzm2PGTjtXVxpijHpBMVRPVBkrScotI/6tUaMMlGHgoersDgq4wBEGIpBOkzhM6BYl4YV0xCDIiyGGeqQO7caS15CBy8p6OiiajWFDydF+XitN1bFTBEKmyF/TjWWdcgMnEgsaJgpuh6hf1IhFHEhKJIwdl0vrNQ2/9mc4U2nvFnVWPoyIgADELnFlFCMuyUR3RSbwoDiGoz9Sy88NwOOhCIoZ2fkz/Zg6SuIEAxAZBfyEqZQNZZPQFFBUIz7qxurlM9/NlcC0gy5szwRmjwXnkgvYpgpvnlY3a3uzVB0wphX3Vj9IBwBBd8hv21mpM3AUbGADMWtBIWGnkJAMerP9jcFw/ARmeFJZdN7VS1euCkOAQnKy4dhilUzYUsomr8zw4PHlZiBo3LhGIrbXOh6kB5KR/l4xY0XIz7/ObrhcQlbH7D6F6iI8AidIS7cLE2hJs1QjFjrxvM2gYLNsPXBGjypZa63jgWTUAhT3Pix+vJRKXqKtdY3RbgZntD2XSC6FktCkTU4ETf9wygfqqEYsTYNq+fAklDwHW5/n6HLDBydCyV7isyhLtx0UDUUXlT4OyNjTRpeiOjXB6gPw/Dh/dV40tZf5CoiTZE5JBE3KjWFMZZPQDHyJeuYotkM1fhhVCb+R2OBpCmyyBQ3HqCeQikUonwQFGtS8dJcmBoKA4Yz+GBaNMzAidbicE8xLFExFEb5qPQnY+gLqVjzMEwJBZvh/emnsTyqQ96juTDcUxAU31BuCgOKYS+azxQB+kymn9iOvq8a/78eUYQBiP6icPkY5sI39uqBYugLbqx9BKaAQsAgysSWqbQDaYq53mZ4l3D5GEk9xX4dUHTC4OfdeLlNQ8EjH8MM1DNMPYUfm2aut1lqKZ99DHfhhv1xcGmAYshqN9aETJGs9AvqLxUDBuoZ7j2F5aYa8m6m5kpCMX54PG7YoweKYc/3xssLvPBe0LcUBgxn8f4PPPiR6Ya8m+0ULATFMWRlxOPf9uqAIgmDV3bBtDl+fAX1YRi2TKnBj96CyWAQMc0kuBYJzc7sj+27AjgzIhiaTqDu6wPikUwfsJynB4lzQVn8BMMAguFv99Tgh6ad621WIEQkFIWlAZzNUAuF6hgw1GLz3dX4ialHOZt9gRkKMsXZEdaEgs3wDpnhZ6af+G+FxZVQFOwMoHaktaCwjhk4Vnm3SSjyqXzUWaR8NMFwF8FgmbneVrlOQJ59TBwdj+t2xYWG76q7orvjYRg2WQoGEas1aRYwBcOw5Xv02YRpxje3Nla7vKzJFAm4vsR8pjBgqMOm/7UiDCIWPY3jrznML/ajbrQ5TNEMgwc/fw8WhEHEqkCISCjyCIr6KEMhYBhIMLzzPx78dAssCoOIlYEQkT1FblEADWOjA4VhhjPY9N+n8PP3Ya4vhmlzrA6EiDRFQZEftZqhsBcMIha/kSUU+SnphMwEdCnW12gaZeIM3v0vu8AgYgdDcGT5yCuk8pEZDHGiyhQGDLQd/d0a/PRD2AQGETsYgiNPSSeNj0eXHXEhPlSYgmFY/592g0HETkCIMBRZ9JG2AigEDOkEw5tkhqc+gM1gELFTyQgPn30UBHA+K4hGdLx8sBk2EAy/tp0ZOHYzBEeaYvKEeHQq6rgpDDPUYuN/2BkGEbsagsOmoEbzXKZhira+ZgOGL7Hx3z/FL7fCxjCI2NUQHDbF+DgkF8ThGvGzNpjCKBO1eOM7ToBBxO6G4IRM0Q85+UFcGN+6nsLvJTMkfonXCIanzPbV1Mpid0NwQqb4BLdPTEBnMkWS+NkVTCFgGJT4FTZ+20kwiDjFEBzZU+TkBnBhYhAXxc9arIEzzcBxGhAiV4CCzbDuW6fxVDYcBoOIE4EQuQQUooEclHgG6+88hV/nwIEwOD0CCvRHdnZfbPEPwj+C3fGLO2CA4JTeKpYWCUHRF5sLv4lFk2DA4FRrhvJPNydAFI+VstUAAAAASUVORK5CYII=";var Li=function(){return Li=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Li.apply(this,arguments)};function px(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(u){try{l(r.next(u))}catch(c){s(c)}}function a(u){try{l(r.throw(u))}catch(c){s(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof n?c:new n((function(f){f(c)}))).then(o,a)}l((r=r.apply(e,[])).next())}))}function mx(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return(function(c){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(f){c=[6,f],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}})([l,u])}}}var Oi,gx=function(e){var t;e?(function(n){if(n)for(;n.lastChild;)n.lastChild.remove()})(typeof e=="string"?document.getElementById(e):e):(t=document.querySelector(".grecaptcha-badge"))&&t.parentNode&&document.body.removeChild(t.parentNode)},yx=function(e,t){gx(t),window.___grecaptcha_cfg=void 0;var n=document.querySelector("#"+e);n&&n.remove(),(function(){var r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]');r&&r.remove()})()},xx=function(e){var t=e.render,n=e.onLoadCallbackName,r=e.language,i=e.onLoad,s=e.useRecaptchaNet,o=e.useEnterprise,a=e.scriptProps,l=a===void 0?{}:a,u=l.nonce,c=u===void 0?"":u,f=l.defer,p=f!==void 0&&f,h=l.async,m=h!==void 0&&h,x=l.id,y=x===void 0?"":x,w=l.appendTo,T=y||"google-recaptcha-v3";if((function(z){return!!document.querySelector("#"+z)})(T))i();else{var E=(function(z){return"https://www."+(z.useRecaptchaNet?"recaptcha.net":"google.com")+"/recaptcha/"+(z.useEnterprise?"enterprise.js":"api.js")})({useEnterprise:o,useRecaptchaNet:s}),F=document.createElement("script");F.id=T,F.src=E+"?render="+t+(t==="explicit"?"&onload="+n:"")+(r?"&hl="+r:""),c&&(F.nonce=c),F.defer=!!p,F.async=!!m,F.onload=i,(w==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(F)}},Ni=function(e){typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"||console.warn(e)};(function(e){e.SCRIPT_NOT_AVAILABLE="Recaptcha script is not available"})(Oi||(Oi={}));var Bi=b.createContext({executeRecaptcha:function(){throw Error("GoogleReCaptcha Context has not yet been implemented, if you are using useGoogleReCaptcha hook, make sure the hook is called inside component wrapped by GoogleRecaptchaProvider")}});Bi.Consumer;function bx(e){var t=e.reCaptchaKey,n=e.useEnterprise,r=n!==void 0&&n,i=e.useRecaptchaNet,s=i!==void 0&&i,o=e.scriptProps,a=e.language,l=e.container,u=e.children,c=b.useState(null),f=c[0],p=c[1],h=b.useRef(t),m=JSON.stringify(o),x=JSON.stringify(l?.parameters);b.useEffect((function(){if(t){var T=o?.id||"google-recaptcha-v3",E=o?.onLoadCallbackName||"onRecaptchaLoadCallback";return window[E]=function(){var F=r?window.grecaptcha.enterprise:window.grecaptcha,z=Li({badge:"inline",size:"invisible",sitekey:t},l?.parameters||{});h.current=F.render(l?.element,z)},xx({render:l?.element?"explicit":t,onLoadCallbackName:E,useEnterprise:r,useRecaptchaNet:s,scriptProps:o,language:a,onLoad:function(){if(window&&window.grecaptcha){var F=r?window.grecaptcha.enterprise:window.grecaptcha;F.ready((function(){p(F)}))}else Ni("<GoogleRecaptchaProvider /> "+Oi.SCRIPT_NOT_AVAILABLE)}}),function(){yx(T,l?.element)}}Ni("<GoogleReCaptchaProvider /> recaptcha key not provided")}),[r,s,m,x,a,t,l?.element]);var y=b.useCallback((function(T){if(!f||!f.execute)throw new Error("<GoogleReCaptchaProvider /> Google Recaptcha has not been loaded");return f.execute(h.current,{action:T})}),[f,h]),w=b.useMemo((function(){return{executeRecaptcha:f?y:void 0,container:l?.element}}),[y,f,l?.element]);return b.createElement(Bi.Provider,{value:w},u)}var kx=function(){return b.useContext(Bi)};function wx(e){var t=this,n=e.action,r=e.onVerify,i=e.refreshReCaptcha,s=kx();b.useEffect((function(){var a=s.executeRecaptcha;a&&px(t,void 0,void 0,(function(){var l;return mx(this,(function(u){switch(u.label){case 0:return[4,a(n)];case 1:return l=u.sent(),r?(r(l),[2]):(Ni("Please define an onVerify function"),[2])}}))}))}),[n,r,i,s]);var o=s.container;return typeof o=="string"?b.createElement("div",{id:o}):null}function kl(e,t){return e(t={exports:{}},t.exports),t.exports;}var Be=typeof Symbol=="function"&&Symbol.for,$i=Be?Symbol.for("react.element"):60103,Ui=Be?Symbol.for("react.portal"):60106,or=Be?Symbol.for("react.fragment"):60107,sr=Be?Symbol.for("react.strict_mode"):60108,ar=Be?Symbol.for("react.profiler"):60114,lr=Be?Symbol.for("react.provider"):60109,ur=Be?Symbol.for("react.context"):60110,Hi=Be?Symbol.for("react.async_mode"):60111,cr=Be?Symbol.for("react.concurrent_mode"):60111,fr=Be?Symbol.for("react.forward_ref"):60112,dr=Be?Symbol.for("react.suspense"):60113,Sx=Be?Symbol.for("react.suspense_list"):60120,hr=Be?Symbol.for("react.memo"):60115,pr=Be?Symbol.for("react.lazy"):60116,Cx=Be?Symbol.for("react.block"):60121,vx=Be?Symbol.for("react.fundamental"):60117,Ex=Be?Symbol.for("react.responder"):60118,Tx=Be?Symbol.for("react.scope"):60119;function st(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $i:switch(e=e.type){case Hi:case cr:case or:case ar:case sr:case dr:return e;default:switch(e=e&&e.$$typeof){case ur:case fr:case pr:case hr:case lr:return e;default:return t}}case Ui:return t}}}function wl(e){return st(e)===cr}var Ax={AsyncMode:Hi,ConcurrentMode:cr,ContextConsumer:ur,ContextProvider:lr,Element:$i,ForwardRef:fr,Fragment:or,Lazy:pr,Memo:hr,Portal:Ui,Profiler:ar,StrictMode:sr,Suspense:dr,isAsyncMode:function(e){return wl(e)||st(e)===Hi},isConcurrentMode:wl,isContextConsumer:function(e){return st(e)===ur},isContextProvider:function(e){return st(e)===lr},isElement:function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$i},isForwardRef:function(e){return st(e)===fr},isFragment:function(e){return st(e)===or},isLazy:function(e){return st(e)===pr},isMemo:function(e){return st(e)===hr},isPortal:function(e){return st(e)===Ui},isProfiler:function(e){return st(e)===ar},isStrictMode:function(e){return st(e)===sr},isSuspense:function(e){return st(e)===dr},isValidElementType:function(e){return typeof e=="string"||typeof e=="function"||e===or||e===cr||e===ar||e===sr||e===dr||e===Sx||typeof e=="object"&&e!==null&&(e.$$typeof===pr||e.$$typeof===hr||e.$$typeof===lr||e.$$typeof===ur||e.$$typeof===fr||e.$$typeof===vx||e.$$typeof===Ex||e.$$typeof===Tx||e.$$typeof===Cx)},typeOf:st},xe=kl((function(e,t){process.env.NODE_ENV!=="production"&&(function(){var n=typeof Symbol=="function"&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,x=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,w=n?Symbol.for("react.block"):60121,T=n?Symbol.for("react.fundamental"):60117,E=n?Symbol.for("react.responder"):60118,F=n?Symbol.for("react.scope"):60119;function z(C){if(typeof C=="object"&&C!==null){var q=C.$$typeof;switch(q){case r:var g=C.type;switch(g){case c:case f:case s:case a:case o:case h:return g;default:var W=g&&g.$$typeof;switch(W){case u:case p:case y:case x:case l:return W;default:return q}}case i:return q}}}var v=c,N=f,L=u,j=l,S=r,O=p,D=s,H=y,U=x,M=i,Q=a,Z=o,se=h,te=!1;function k(C){return z(C)===f}t.AsyncMode=v,t.ConcurrentMode=N,t.ContextConsumer=L,t.ContextProvider=j,t.Element=S,t.ForwardRef=O,t.Fragment=D,t.Lazy=H,t.Memo=U,t.Portal=M,t.Profiler=Q,t.StrictMode=Z,t.Suspense=se,t.isAsyncMode=function(C){return te||(te=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),k(C)||z(C)===c},t.isConcurrentMode=k,t.isContextConsumer=function(C){return z(C)===u},t.isContextProvider=function(C){return z(C)===l},t.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===r},t.isForwardRef=function(C){return z(C)===p},t.isFragment=function(C){return z(C)===s},t.isLazy=function(C){return z(C)===y},t.isMemo=function(C){return z(C)===x},t.isPortal=function(C){return z(C)===i},t.isProfiler=function(C){return z(C)===a},t.isStrictMode=function(C){return z(C)===o},t.isSuspense=function(C){return z(C)===h},t.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===s||C===f||C===a||C===o||C===h||C===m||typeof C=="object"&&C!==null&&(C.$$typeof===y||C.$$typeof===x||C.$$typeof===l||C.$$typeof===u||C.$$typeof===p||C.$$typeof===T||C.$$typeof===E||C.$$typeof===F||C.$$typeof===w)},t.typeOf=z})()})),Sl=(xe.AsyncMode,xe.ConcurrentMode,xe.ContextConsumer,xe.ContextProvider,xe.Element,xe.ForwardRef,xe.Fragment,xe.Lazy,xe.Memo,xe.Portal,xe.Profiler,xe.StrictMode,xe.Suspense,xe.isAsyncMode,xe.isConcurrentMode,xe.isContextConsumer,xe.isContextProvider,xe.isElement,xe.isForwardRef,xe.isFragment,xe.isLazy,xe.isMemo,xe.isPortal,xe.isProfiler,xe.isStrictMode,xe.isSuspense,xe.isValidElementType,xe.typeOf,kl((function(e){process.env.NODE_ENV==="production"?e.exports=Ax:e.exports=xe}))),_x={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Cl={};Cl[Sl.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Cl[Sl.Memo]=_x;function jx(e){return{primaryColor:e?.primaryColor||"#2962FF",backgroundColor:e?.backgroundColor||"#ffffff",textColor:e?.textColor||"#000000",fontFamily:e?.fontFamily||"Roboto, Arial, sans-serif",fontSize:e?.fontSize||"14px",secondaryColor:e?.secondaryColor||"#f5f5f5"}}function Cn(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${i}, ${t})`}function Ix({isFullscreen:e,isFloatingDocked:t,windowWidth:n,t:r}){return{display:"flex",flexDirection:"column",height:e?void 0:"100%",maxHeight:e?void 0:t?"100%":n>768?"700px":"600px",minHeight:t?0:void 0,width:e?"100vw":"380px",maxWidth:e?"100vw":"400px",border:e?"none":"1px solid #e0e0e0",borderRadius:e?"0":"32px",overflow:"hidden",backgroundColor:r.secondaryColor,fontFamily:r.fontFamily,boxShadow:e?"none":"0 4px 20px rgba(0, 0, 0, 0.2)",position:e?"fixed":"relative",top:e?0:void 0,left:e?0:void 0,right:e?0:void 0,bottom:e?"env(safe-area-inset-bottom, 0px)":void 0,zIndex:e?9999:void 0}}function Dx(e){return{padding:"15px",backgroundColor:e.secondaryColor,color:"#111111",fontWeight:"bold",display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative"}}const Px={display:"flex",alignItems:"center",gap:"10px",position:"relative",zIndex:1},Rx={width:"28px",height:"28px"},Fx={display:"flex",flexDirection:"column"};function Mx(e){return{fontSize:"16px",fontWeight:"bold",margin:0,fontFamily:e}}function zx(e){return{fontSize:"14px",fontWeight:"normal",margin:0,fontFamily:e}}const vl={backgroundColor:"transparent",color:"#111111",border:"none",borderRadius:"50%",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",outline:"none",position:"relative",zIndex:1};function Lx(e){return{position:"absolute",top:"50px",right:"15px",backgroundColor:e,borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.1)",zIndex:1e3,minWidth:"150px",overflow:"visible"}}function Ox(e){return{display:"flex",alignItems:"center",gap:"8px",padding:"10px 15px",color:e.textColor,cursor:"pointer",fontSize:e.fontSize,fontFamily:e.fontFamily,borderBottom:"1px solid #f0f0f0"}}const Nx={flex:1,minHeight:0,overflowY:"auto",padding:"15px",backgroundColor:"transparent",display:"flex",flexDirection:"column"},qi={display:"flex",padding:"12px 15px",backgroundColor:"#ffffff",alignItems:"center",gap:"8px",flexShrink:0,overflowX:"hidden",minWidth:0},Bx={display:"flex",flex:1,alignItems:"center",backgroundColor:"#ffffff",borderRadius:"24px",border:"1px solid #e5e7eb",padding:"0 12px",minHeight:"50px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.06)",position:"relative",overflowX:"hidden",minWidth:0};function $x(e){return{flex:1,border:"none",outline:"none",background:"transparent",fontSize:e.textAreaFontSize,fontFamily:e.fontFamily,padding:"10px",paddingRight:"46px",color:e.textColor,resize:"none",lineHeight:`${e.textAreaLineHeight}px`,maxHeight:`${e.textAreaMaxHeightCalculated}px`,overflowY:"hidden",overflowX:"hidden",minWidth:0,width:"100%",boxSizing:"border-box"}}const Ux={backgroundColor:"transparent",border:"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",outline:"none",color:"#757575",padding:0};function Hx(e){return{backgroundColor:e,color:"#ffffff",border:"none",borderRadius:"50%",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",outline:"none",flexShrink:0,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.08)"}}const qx={backgroundColor:"#d1d5db",cursor:"not-allowed",opacity:.8},Wx={position:"absolute",right:"4px",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",justifyContent:"center"};function Vx(e){return{display:"flex",flexDirection:"column",gap:"8px",padding:"0",paddingLeft:"28px",paddingRight:"28px",marginTop:"5px",marginBottom:"15px",width:"100%",fontFamily:e}}function Qx(e){return{padding:"12px 15px",backgroundColor:e.secondaryColor,color:e.textColor,border:"none",borderRadius:"6px",fontSize:e.fontSize,cursor:"pointer",textAlign:"left",fontWeight:"normal",boxShadow:"none",width:"100%",maxWidth:"240px",fontFamily:e.fontFamily}}function Gx(e){return{display:e?"flex":"none",position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:10,justifyContent:"center",alignItems:"center"}}function Yx(e){return{backgroundColor:e.backgroundColor,padding:"20px",borderRadius:"8px",maxWidth:"300px",textAlign:"center",fontFamily:e.fontFamily,color:e.textColor}}const Jx={display:"flex",justifyContent:"center",marginTop:"15px",gap:"10px"};function El(e,t){return{padding:"8px 16px",backgroundColor:e?"#F44336":"#e0e0e0",color:e?"#ffffff":t.textColor,border:"none",borderRadius:"4px",cursor:"pointer",fontFamily:t.fontFamily,fontSize:t.fontSize}}function Kx(e){return{flex:1,display:"flex",flexDirection:"column",backgroundColor:e,borderTopLeftRadius:24,borderTopRightRadius:24,boxShadow:"0 -2px 6px rgba(0,0,0,0.03)",position:"relative",zIndex:2,overflow:"hidden",minHeight:0}}function Xx(e){return{textAlign:"left",fontSize:"12px",color:"#9ca3af",margin:"12px 4px 2px 4px",fontFamily:e}}function Zx({position:e,offsetX:t,offsetY:n}){const r={position:"fixed",zIndex:1e3};switch(e){case"bottom-right":return{...r,bottom:n,right:t};case"bottom-left":return{...r,bottom:n,left:t};case"top-right":return{...r,top:n,right:t};case"top-left":return{...r,top:n,left:t};default:return{...r,bottom:n,right:t}}}function eb({position:e,offsetX:t,offsetY:n}){const r={position:"fixed",borderRadius:"32px",zIndex:1004};switch(e){case"bottom-right":return{...r,bottom:n,right:t};case"bottom-left":return{...r,bottom:n,left:t};case"top-right":return{...r,top:n,right:t};case"top-left":return{...r,top:n,left:t};default:return{...r,bottom:n,right:t}}}function tb({isFullscreen:e,mode:t}){const n=typeof window<"u"?window.innerWidth:1024,r=e?"100vh":"60vh";return e?{width:"100vw",height:r,borderRadius:"0"}:t==="floating"?n<=480?{width:"calc(100vw - 40px)"}:n<=768?{width:"350px"}:{width:"380px"}:n<=480?{width:"calc(100vw - 40px)",height:r}:n<=768?{width:"350px",height:r}:{width:"380px",height:r}}function nb({windowHeight:e,offsetY:t,position:n}){const r=typeof window<"u"?window.innerWidth:1024,i=typeof window<"u"?window.innerHeight:1080,o=Math.max(280,e-t-10*10);let a=o;return r>=765&&i>=1070&&(a="60vh"),{display:"flex",flexDirection:"column",maxHeight:a,height:o,...n==="top-right"||n==="top-left"?{top:t,bottom:"auto"}:{top:"auto",bottom:t}}}function rb(e){return{...e.mode==="fullscreen"||e.isFullscreen&&e.windowWidth<=768?{position:"fixed",top:0,left:0,right:0,bottom:"env(safe-area-inset-bottom, 0px)",borderRadius:"0",zIndex:9999}:{...eb({position:e.position,offsetX:e.offsetX,offsetY:e.offsetY}),...tb({isFullscreen:e.isFullscreen,mode:e.mode}),...e.mode==="floating"&&!e.isFullscreen?nb({windowHeight:e.windowHeight,offsetY:e.offsetY,position:e.position}):{}}}}const ib=`
|
|
58
|
+
@keyframes blink { 0% { opacity: 0.2; } 20% { opacity: 1; } 100% { opacity: 0.2; } }
|
|
59
|
+
.ga-textarea-nosb {
|
|
60
|
+
scrollbar-width: none;
|
|
61
|
+
-ms-overflow-style: none;
|
|
62
|
+
max-width: 100%;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
}
|
|
65
|
+
.ga-textarea-nosb::-webkit-scrollbar { width: 0; height: 0; }
|
|
66
|
+
.ga-input-disclaimer a {
|
|
67
|
+
color: #9ca3af !important;
|
|
68
|
+
text-decoration: underline;
|
|
69
|
+
}
|
|
70
|
+
.ga-input-disclaimer a:hover {
|
|
71
|
+
color: #6b7280 !important;
|
|
72
|
+
}
|
|
73
|
+
@media (max-width: 768px) {
|
|
74
|
+
.ga-textarea-nosb {
|
|
75
|
+
font-size: 16px !important;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
@keyframes ga-backlight-sweep2 { 0% { transform: translateX(-35%); } 100% { transform: translateX(105%); } }
|
|
79
|
+
@keyframes ga-backlight-pulse { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }
|
|
80
|
+
@keyframes ga-think-change { 0% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: translateY(0); } }
|
|
81
|
+
.grecaptcha-badge {
|
|
82
|
+
display: none !important;
|
|
83
|
+
visibility: hidden !important;
|
|
84
|
+
position: absolute !important;
|
|
85
|
+
width: 0 !important;
|
|
86
|
+
height: 0 !important;
|
|
87
|
+
overflow: hidden !important;
|
|
88
|
+
opacity: 0 !important;
|
|
89
|
+
pointer-events: none !important;
|
|
90
|
+
}
|
|
91
|
+
`,ob=({baseUrl:e,websocketUrl:t,apiKey:n,tenant:r,metadata:i,useWs:s=!0,usePoll:o=!1,onError:a,onTakeover:l,onFinalize:u,theme:c,headerTitle:f="Genassist",description:p,placeholder:h,agentName:m,logoUrl:x,mode:y="embedded",onExitFullscreen:w,floatingConfig:T={},language:E,translations:F,reCaptchaKey:z,widget:v=!1,useAudio:N=!1,useFile:L=!1,noColorAnimation:j=!1,showWelcomeBeforeStart:S=!0,allowedExtensions:O=[],serverUnavailableMessage:D,serverUnavailableContactUrl:H,serverUnavailableContactLabel:U,formDisplay:M="footer",onConfigLoaded:Q})=>{const[Z,se]=b.useState(()=>{if(E)return E;const P=typeof window<"u"?localStorage.getItem("genassist_language"):null;return P||wi()});b.useEffect(()=>{typeof window<"u"&&!E&&localStorage.setItem("genassist_language",Z)},[Z,E]);const[te,k]=b.useState(null),C=b.useMemo(()=>E||Z||wi()||"en",[E,Z]),q=b.useMemo(()=>({...i||{},language:C,...te?{faq_query:te}:{}}),[i,C,te]),g=b.useMemo(()=>{const P=Aa(C);return Qn(F,P)},[C,F]),W=(P,G)=>Vn(P,g,G),pe=b.useMemo(()=>h||W("input.placeholder","Ask a question"),[h,g]),[ae,ee]=b.useState(""),[Ae,be]=b.useState(!1),[Le,ze]=b.useState(!1),[We,Ie]=b.useState(!1),[Pe,fe]=b.useState(!1),[De,_e]=b.useState(!1),[ne,Oe]=b.useState(new Set),[je,Re]=b.useState(null),bt=b.useRef(null),at=b.useRef(null),lt=b.useRef(null),[Ct,I]=b.useState(56),[$,_]=b.useState(!1),{messages:R,isLoading:V,sendMessage:he,sendAudioMessage:Ve,uploadFile:Ne,resetConversation:Fe,startConversation:ut,conversationId:ve,guestToken:$e,possibleQueries:Qe,isFinalized:vn,isAgentTyping:Ue,addFeedback:Wi,availableLanguages:Tt,welcomeTitle:Xt,welcomeImageUrl:Zt,welcomeMessage:Bt,inputDisclaimerHtml:Y,thinkingPhrases:re,thinkingDelayMs:oe}=gl({baseUrl:e,websocketUrl:t,apiKey:n,tenant:r,metadata:q,useWs:s,usePoll:o,language:C,onError:a,onTakeover:l,onFinalize:u,serverUnavailableMessage:D,serverUnavailableContactUrl:H,serverUnavailableContactLabel:U,onConfigLoaded:Q}),{currentThinkingParts:ce,currentThinkingPartIndex:K}=rx({isAgentTyping:Ue,thinkingPhrases:re,thinkingDelayMs:oe,translations:g}),{messagesEndRef:Ee,chatContainerRef:pt}=nx({messages:R,isAgentTyping:Ue,currentThinkingPartIndex:K,currentThinkingPartsLength:ce.length,conversationId:ve,isFloatingOpen:De,mode:y}),{windowWidth:Ke,windowHeight:kt,isFullscreen:mt,handleFullscreenToggle:me}=ix({mode:y,widget:v,isFloatingOpen:De,showResetConfirm:Ae,showLanguageDropdown:We,showMenu:Le,onExitFullscreen:w,setShowResetConfirm:be,setShowLanguageDropdown:Ie,setShowMenu:ze}),{attachments:ge,setAttachments:He,uploadingFiles:Xe,fileErrorToast:At,fileInputRef:Se,handleFileChange:Vi,handleRemoveAttachment:En,clearAttachments:gr}=ox({uploadFile:Ne,t:W});b.useEffect(()=>{if(E||!Array.isArray(Tt)||Tt.length===0)return;const P=Tt.map(G=>G.toLowerCase());P.includes(Z.toLowerCase())||se(P[0])},[Tt,E,Z]);const ct=b.useRef(null),gt=b.useRef(void 0),Tn=R.some(P=>P.speaker==="customer");b.useEffect(()=>{ct.current=new fx({baseUrl:e,websocketUrl:t,apiKey:n})},[e,t,n]),b.useEffect(()=>{ct.current?.setGuestToken($e??null)},[$e]),b.useEffect(()=>{y==="fullscreen"&&!De&&_e(!0)},[y,De]),b.useLayoutEffect(()=>{const P=()=>{I(lt.current?.offsetHeight||56)};P();const G=new ResizeObserver(()=>P());return lt.current&&G.observe(lt.current),window.addEventListener("resize",P),()=>{G.disconnect(),window.removeEventListener("resize",P)}},[]),b.useEffect(()=>{if(Ue){_(!0);return}const P=setTimeout(()=>_(!1),420);return()=>clearTimeout(P)},[Ue]);const Pl=async()=>{if(ae.trim()===""&&ge.length===0||Ue)return;const P=ae,G=ge.map(le=>le.file);ee(""),He([]),Se.current&&(Se.current.value="");try{const le={};te&&(le.faq_query=te),G.length>0&&(le.attachments=ge.map(qe=>qe.attachment)),await he(P,G,le,gt.current)}catch{}finally{setTimeout(()=>at.current?.focus(),0)}},cb=async P=>{P.preventDefault(),await Pl()},Rl=P=>{const G=R[P];if(G?.type==="form_request"&&G.text)try{return JSON.parse(G.text).node_id}catch{}},Fl=async(P,G)=>{if(!(je!==null||Ue)){Re(G);try{const le=Object.entries(P).map(([jn,to])=>`${jn}: ${to}`).join(", "),qe=Rl(G);await he(le,[],{human_in_the_loop_from_form:P,...qe&&{human_in_the_loop_node_id:qe}},gt.current),Oe(jn=>new Set(jn).add(G))}catch{}finally{Re(null)}}},Ml=async P=>{if(!(je!==null||Ue)){Re(P);try{const G=Rl(P);await he("Skipped",[],{human_in_the_loop_from_form:{},human_in_the_loop_cancelled:!0,...G&&{human_in_the_loop_node_id:G}},gt.current),Oe(le=>new Set(le).add(P))}catch{}finally{Re(null)}}},zl=async P=>{if(P.trim()&&!Ue)try{await he(P,[],te?{faq_query:te}:void 0,gt.current)}catch{}},fb=async P=>{const G=`Schedule confirmed with ${P.restaurants.length} restaurants`;try{await he(G,[],{confirmSchedule:JSON.stringify(P)},gt.current)}catch{}},db=P=>{a&&a(P)},hb=async P=>{if(!(!ct.current||Pe))try{fe(!0);const G=await ct.current.textToSpeech(P);await ct.current.playAudio(G)}catch(G){a&&a(G)}finally{fe(!1)}},pb=b.useCallback(P=>`${e}/api/conversations/${ve}/messages/${P}/audio`,[e,ve]),mb=b.useMemo(()=>{const P={"x-api-key":n};return r&&(P["x-tenant-id"]=r),$e&&(P.Authorization=`Bearer ${$e}`),P},[n,r,$e]),[gb,yb]=b.useState(null),Ll=b.useRef(0),Ol=b.useRef(!1);b.useEffect(()=>{if(!N||!R.length)return;const P=Ll.current;if(Ll.current=R.length,!Ol.current){Ol.current=!0;return}if(R.length<=P)return;const G=R[R.length-1];G.speaker==="agent"&&G.type==="audio"&&G.message_id&&yb(G.message_id)},[R,N]);const Qi=async P=>{if(!(Ue||V)){k(P);try{await he(P,[],{faq_query:P},gt.current)}catch{}}},xb=async()=>{if(!V){ee(""),gr();try{await ut(gt.current)}catch(P){console.error("Error starting conversation",P)}}},bb=()=>{ze(P=>!P)},kb=()=>{ze(!1),be(!0)},wb=async()=>{ee(""),gr(),await Fe(gt.current),k(null),Oe(new Set),Re(null),be(!1)},Sb=()=>{be(!1)},Nl=P=>{se(P)},Bl=b.useCallback(P=>{gt.current=P},[]),$l=[{code:"en",name:"English"},{code:"es",name:"Español"},{code:"fr",name:"Français"},{code:"de",name:"Deutsch"},{code:"it",name:"Italiano"},{code:"pt",name:"Português"},{code:"zh",name:"中文"}],yr=b.useMemo(()=>{if(Array.isArray(Tt)){const P=new Set(Tt.map(G=>G.toLowerCase()));return $l.filter(G=>P.has(G.code))}return $l},[Tt]),Ul=yr.length>0,Pt=jx(c),{primaryColor:_t,backgroundColor:Gi,textColor:Yi,fontFamily:ft,fontSize:vt}=Pt,An=typeof vt=="string"?parseInt(vt,10):typeof vt=="number"?vt:14,Hl=T.position||"bottom-right",ql=T.offset||{x:20,y:20},Wl=ql.x||20,Vl=ql.y||20,Cb=Ix({isFullscreen:mt,isFloatingDocked:y==="floating"&&!mt,windowWidth:Ke,t:Pt}),vb=Dx(Pt),Eb=Mx(ft),Tb=zx(ft),Ab=Lx(Gi),Ji=Ox(Pt),_b=Kx(Gi),Ql=Hx(_t),jb=Vx(ft),Ib=Qx(Pt),Db=Gx(Ae),Pb=Yx(Pt),Gl=Xx(ft),Rb=b.useMemo(()=>Ke<=768?Math.max(16,An)+"px":vt,[Ke,vt,An]),Ki=b.useMemo(()=>{const P=Ke<=768?Math.max(16,An):An;return Math.round(P*1.5)},[Ke,An]),xr=b.useMemo(()=>Ki*3,[Ki]),Fb=$x({textAreaFontSize:Rb,fontFamily:ft,textAreaLineHeight:Ki,textAreaMaxHeightCalculated:xr,textColor:Yi}),Xi=R.some((P,G)=>P.type!=="form_request"||P.speaker!=="agent"?!1:!ne.has(G)),_n=b.useMemo(()=>{for(let P=R.length-1;P>=0;P--){const G=R[P];if(G.type==="form_request"&&G.speaker==="agent"&&!ne.has(P))try{return{schema:JSON.parse(G.text),index:P}}catch{}}return null},[R,ne]),Yl=ae.trim()===""&&ge.length===0||Ue||Xi,Mb=()=>{const P=at.current;if(!P)return;P.style.height="auto";const G=Math.min(P.scrollHeight,xr);P.style.height=`${G}px`,P.style.overflowY=P.scrollHeight>xr?"auto":"hidden"};b.useEffect(()=>{Mb()},[ae,xr]);const br=!!Y&&d.jsx("span",{dangerouslySetInnerHTML:{__html:Y}}),Jl=rb({mode:y,isFullscreen:mt,windowWidth:Ke,windowHeight:kt,position:Hl,offsetX:Wl,offsetY:Vl}),zb=()=>!Ul||ve&&!vn||R.length>0||Tn?null:d.jsx(dx,{availableLanguages:yr,selectedLanguage:C,onLanguageChange:Nl,translations:g,theme:c}),Zi=b.useMemo(()=>z?P=>d.jsxs(bx,{reCaptchaKey:z||"",children:[d.jsx(wx,{action:"genassist_chat",onVerify:Bl,refreshReCaptcha:!1}),d.jsx(d.Fragment,{children:P})]}):P=>d.jsx(d.Fragment,{children:P}),[z,Bl]),eo=()=>d.jsxs("div",{style:Cb,"data-genassist-root":"true",children:[d.jsx("style",{children:ib}),d.jsxs("div",{style:vb,ref:lt,children:[d.jsxs("div",{style:Px,children:[d.jsx("img",{src:x?.trim()||hx,alt:"Logo",style:Rx}),d.jsxs("div",{style:Fx,children:[d.jsx("div",{style:Eb,children:f}),d.jsx("div",{style:Tb,children:p??W("header.subtitle")})]})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[d.jsx("button",{style:vl,onClick:bb,title:W("menu.title"),children:d.jsx(Mm,{size:24,color:"#111111"})}),y==="floating"&&d.jsx("button",{style:vl,onClick:()=>_e(!1),title:"Close chat",children:d.jsx(xi,{size:24,color:"#111111"})})]})]}),!j&&$&&d.jsx("div",{style:{position:"absolute",left:0,right:0,top:Math.max(0,Ct-14),height:42,pointerEvents:"none",zIndex:1,opacity:Ue?1:0,transition:"opacity 420ms ease-in-out"},children:d.jsx("div",{style:{position:"absolute",left:0,top:6,height:32,width:"78%",filter:"blur(22px)",background:`linear-gradient(90deg, ${Cn(_t,0)} 0%, ${Cn(_t,.35)} 15%, ${Cn(_t,.55)} 50%, ${Cn(_t,.35)} 85%, ${Cn(_t,0)} 100%)`,willChange:"transform, opacity",animation:"ga-backlight-sweep2 1.2s cubic-bezier(0.4,0.0,0.2,1) infinite alternate, ga-backlight-pulse 2.4s ease-in-out infinite",borderRadius:18}})}),Le&&d.jsxs("div",{ref:bt,style:Ab,children:[d.jsxs("div",{style:Ji,onClick:kb,children:[d.jsx(Vm,{size:16}),W("menu.resetConversation")]}),y!=="fullscreen"&&d.jsxs("div",{style:Ji,onClick:me,children:[mt?d.jsx(Bm,{size:16}):d.jsx(Nm,{size:16}),W("menu.fullscreen")]}),Ul&&d.jsxs("div",{style:{...Ji,position:"relative",borderBottom:"none"},onClick:P=>{P.stopPropagation(),Ie(!We)},children:[d.jsx(fa,{size:16}),d.jsx("span",{style:{flex:1},children:W("menu.language")}),We&&d.jsx("div",{style:{position:"absolute",right:0,top:"100%",marginTop:"4px",backgroundColor:Gi,borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.1)",minWidth:"180px",maxWidth:"200px",overflow:"hidden",zIndex:1001},onClick:P=>P.stopPropagation(),children:yr.map((P,G)=>d.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 15px",color:Yi,backgroundColor:C===P.code?c?.secondaryColor||"#f5f5f5":"transparent",borderBottom:G<yr.length-1?"1px solid #f0f0f0":"none",cursor:"pointer",fontSize:vt,fontFamily:ft,transition:"background-color 0.2s ease"},onMouseEnter:le=>{C!==P.code&&(le.currentTarget.style.backgroundColor=c?.secondaryColor||"#f5f5f5")},onMouseLeave:le=>{C!==P.code&&(le.currentTarget.style.backgroundColor="transparent")},onClick:le=>{le.stopPropagation(),Nl(P.code),Ie(!1),ze(!1)},children:P.name},P.code))})]})]}),d.jsxs("div",{style:_b,children:[d.jsxs("div",{style:Nx,ref:pt,children:[zb(),(()=>{if(!(S&&!Tn&&(R.length===0||R[0].speaker!=="agent")&&(!!Xt||!!Zt||!!Bt)&&ve))return null;const le={create_time:Math.floor(Date.now()/1e3),start_time:0,end_time:.01,speaker:"agent",text:Bt||""};return d.jsx(_a,{message:le,theme:c,isFirstMessage:!0,isNextSameSpeaker:!1,isPrevSameSpeaker:!1,enableTypewriter:!1,welcomeImageUrl:Zt||void 0,welcomeTitle:Xt||void 0,possibleQueries:Qe,onQuickQuery:Qi,onQuickAction:zl,translations:g,language:C,agentName:m,isAgentTyping:Ue},"__synthetic_welcome__")})(),(()=>{const P=R.findIndex(le=>le.speaker==="agent"),G=le=>le.type!=="file";return R.filter(G).map((le,qe)=>{if(le.type==="form_request"&&le.speaker==="agent")try{const kr=JSON.parse(le.text),wr=!ne.has(qe);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",maxWidth:"85%",marginBottom:"8px"},children:[d.jsx("div",{style:{fontSize:"14px",color:"#000000",fontWeight:600,marginBottom:4},children:m||"Agent"}),M==="inline"&&wr?d.jsx(bl,{schema:kr,onSubmit:Ob=>Fl(Ob,qe),onCancel:()=>Ml(qe),isSubmitting:je===qe,isSubmitted:!1,primaryColor:_t,fontFamily:ft,variant:"card"}):d.jsxs("div",{style:{backgroundColor:"#f3f4f6",borderRadius:"12px",padding:"10px 14px",fontSize:"14px",color:"#374151",fontFamily:ft},children:[kr.message||"Please fill the form below.",wr&&d.jsx("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"4px"},children:"Fill the form below to continue."})]})]},qe)}catch{}const jn=qe<R.length-1&&R[qe+1].speaker===le.speaker,to=qe>0&&R[qe-1].speaker===le.speaker,In=qe===P&&le.speaker==="agent"&&!Tn,Lb=In&&Bt?{...le,text:Bt}:le;return d.jsx(_a,{message:Lb,theme:c,onPlayAudio:le.speaker==="agent"?hb:void 0,isPlayingAudio:Pe,isFirstMessage:In,isNextSameSpeaker:jn,isPrevSameSpeaker:to,onFeedback:(kr,wr)=>Wi(kr,wr),enableTypewriter:qe===R.length-1&&le.speaker==="agent",welcomeImageUrl:In&&Zt||void 0,welcomeTitle:In&&Xt||void 0,possibleQueries:In?Qe:void 0,onQuickQuery:Qi,onQuickAction:zl,onScheduleConfirm:fb,isLastMessage:qe===R.length-1&&le.speaker==="agent",translations:g,language:C,agentName:m,isAgentTyping:Ue,audioUrlBuilder:le.type==="audio"&&N?pb:void 0,audioHeaders:le.type==="audio"&&N?mb:void 0,autoPlayAudioMessageId:gb},qe)})})(),Ue&&ce.length>0&&d.jsxs("div",{style:{display:"flex",flexDirection:"column",maxWidth:"80%"},children:[d.jsx("div",{style:{fontSize:"14px",color:"#000000",fontWeight:600,marginBottom:4},children:m||W("labels.agent")}),d.jsx("div",{style:{backgroundColor:"transparent",padding:0,borderRadius:0,maxWidth:"100%"},children:d.jsx("div",{style:{animation:"ga-think-change 220ms ease",willChange:"transform, opacity",color:"#6b7280",fontSize:"13px"},children:ce[K]||ce[ce.length-1]},`${K}-${ce.join("|")}`)})]}),d.jsx("div",{ref:Ee})]}),S&&(()=>{const P=!Tn&&(R.length===0||R[0].speaker!=="agent")&&(!!Xt||!!Zt||!!Bt);return Qe.length>0&&!Tn&&(R.length===0||R[0].speaker!=="agent")&&!P})()&&d.jsx("div",{style:jb,children:Qe.map((P,G)=>d.jsx("button",{style:Ib,onClick:()=>Qi(P),disabled:V||Ue,children:P},G))}),At&&d.jsxs("div",{style:{margin:"0 16px 8px",padding:"10px 14px",backgroundColor:"#FFF3E0",color:"#E65100",borderRadius:"12px",fontSize:vt,fontFamily:ft,display:"flex",alignItems:"center",gap:"8px",flexShrink:0},role:"alert",children:[d.jsx(ua,{size:18,style:{flexShrink:0}}),d.jsx("span",{children:At})]}),L&&ge.length>0&&d.jsx("div",{style:{padding:"0 16px",marginBottom:"8px",display:"flex",gap:"8px",flexWrap:"wrap"},children:ge.map((P,G)=>d.jsx(kg,{file:P.file,onRemove:()=>En(P.file.name),uploading:Xe.has(P.file.name)},G))}),!ve||vn?d.jsx("div",{style:qi,children:d.jsx("button",{type:"button",style:{...Ql,width:"100%",height:"48px",borderRadius:"16px",cursor:"pointer",fontFamily:ft,fontSize:vt},onClick:xb,disabled:V,children:W("buttons.startConversation")})}):_n&&M==="footer"?d.jsxs("div",{style:{...qi,flexDirection:"column",borderTop:"1px solid #e5e7eb"},children:[d.jsx(bl,{schema:_n.schema,onSubmit:P=>Fl(P,_n.index),onCancel:()=>Ml(_n.index),isSubmitting:je===_n.index,isSubmitted:!1,primaryColor:_t,fontFamily:ft,variant:"footer"}),br&&d.jsx("div",{className:"ga-input-disclaimer",style:Gl,children:br})]}):d.jsx("form",{onSubmit:cb,style:qi,children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",minWidth:0},children:[d.jsxs("div",{style:Bx,children:[L&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",style:Ux,title:"Attach",onClick:()=>Se.current?.click(),children:d.jsx($m,{size:22,color:"#757575"})}),d.jsx("input",{type:"file",multiple:!0,ref:Se,style:{display:"none"},onChange:Vi,accept:O.join(",")||"*/*"})]}),d.jsx("textarea",{ref:at,style:Fb,className:"ga-textarea-nosb",value:ae,onChange:P=>ee(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),(ae.trim()!==""||ge.length>0)&&!Ue&&!Xi&&Pl())},placeholder:pe,disabled:!ve||vn||Xi,rows:1}),d.jsx("div",{style:Wx,children:!(N&&ae.trim()===""&&ge.length===0)&&d.jsx("button",{type:"submit",style:{...Ql,...Yl?qx:{}},disabled:Yl,children:d.jsx(Fm,{size:18,strokeWidth:3,color:"#ffffff"})})}),N&&ae.trim()===""&&ge.length===0&&d.jsx(cx,{onAudioReady:async(P,G)=>{try{fe(!0),await Ve(P,G)}catch{}finally{fe(!1)}},onError:db,theme:c})]}),br&&d.jsx("div",{className:"ga-input-disclaimer",style:Gl,children:br})]})})]}),d.jsx("div",{style:Db,children:d.jsxs("div",{style:Pb,children:[d.jsx("h3",{style:{fontFamily:ft,marginTop:0},children:W("dialog.resetConversation.title")}),d.jsx("p",{style:{fontFamily:ft,fontSize:vt},children:W("dialog.resetConversation.message")}),d.jsxs("div",{style:Jx,children:[d.jsx("button",{style:{...El(!1,Pt),color:Yi},onClick:Sb,children:W("buttons.cancel")}),d.jsx("button",{style:El(!0,Pt),onClick:wb,children:W("buttons.reset")})]})]})})]});return y==="floating"?d.jsxs(d.Fragment,{children:[!De&&d.jsx(xl,{showChat:De,onClick:()=>_e(P=>!P),primaryColor:_t,style:Zx({position:Hl,offsetX:Wl,offsetY:Vl})}),De&&d.jsx("div",{style:Jl,"data-genassist-container":"floating",children:Zi(eo())})]}):y==="fullscreen"?d.jsx("div",{style:Jl,"data-genassist-container":"fullscreen",children:Zi(eo())}):Zi(eo())},sb={primaryColor:"#4F46E5",secondaryColor:"#f5f5f5",backgroundColor:"#ffffff",textColor:"#000000",fontFamily:"Inter, sans-serif",fontSize:"15px"},ab={name:"Genassist",description:"Support",agentName:"Agent",logoUrl:""},lb={useAudio:!1,useFile:!1,useWs:!1,usePoll:!1};function Tl(e){return e?Object.keys(e).map(t=>{const n=e[t];let r="string";return typeof n=="number"?r="number":typeof n=="boolean"&&(r="boolean"),{name:t,type:r,required:!1,value:n}}):[]}function mr(e){const t={};return e.forEach(n=>{typeof n.value<"u"&&(t[n.name]=n.value)}),t}const ub=({theme:e,onThemeChange:t,chatSettings:n,onChatSettingsChange:r,metadata:i,onMetadataChange:s,agentChatInputMetadata:o,featureFlags:a,onFeatureFlagsChange:l,defaultOpen:u,onSave:c,onCancel:f,style:p})=>{const h=b.useMemo(()=>({...o||{},...i||{}}),[o,i]),[m,x]=b.useState(e||sb),[y,w]=b.useState(n||ab),[T,E]=b.useState(()=>Tl(h)),[F,z]=b.useState(a||lb);b.useEffect(()=>{e&&x(e)},[e]),b.useEffect(()=>{n&&w(n)},[n]),b.useEffect(()=>{E(Tl(h))},[o,i]),b.useEffect(()=>{a&&z(a)},[a]);const[v,N]=b.useState(typeof u?.appearance=="boolean"?!!u?.appearance:!0),[L,j]=b.useState(typeof u?.settings=="boolean"?!!u?.settings:!1),[S,O]=b.useState(typeof u?.metadata=="boolean"?!!u?.metadata:!1),D=b.useRef(0);b.useEffect(()=>{const _=o?Object.keys(o).length:0;_>0&&D.current===0&&O(!0),D.current=_},[o]);const[H,U]=b.useState(!1),[M,Q]=b.useState({name:"param_1",type:"string",required:!1,value:""}),[Z,se]=b.useState(!1),[te,k]=b.useState(null),[C,q]=b.useState({name:"",type:"string",required:!1,value:""}),g=b.useMemo(()=>mr(T),[T]),W=(_,R)=>{const V={...m,[_]:R};e||x(V),t?.(V)},pe=(_,R)=>{const V={...y,[_]:R};n||w(V),r?.(V)},ae=(_,R)=>{const V={...F,[_]:R};a||z(V),l?.(V)},ee=()=>{const _=M.name.trim();if(!_||T.some(he=>he.name===_))return;const R={...M,name:_,value:typeof M.value<"u"?M.value:M.type==="number"?0:M.type==="boolean"?!1:""},V=[...T,R];E(V),s?.(mr(V)),Q({name:"param_1",type:"string",required:!1,value:""}),U(!1)},Ae=(_,R)=>{if(R==="number"){const V=Number(_);return isNaN(V)?0:V}if(R==="boolean"){if(typeof _=="boolean")return _;const V=String(_).toLowerCase();return V==="true"||V==="1"||V==="yes"}return String(_??"")},be=()=>{if(te===null)return;const _=C.name.trim();if(!_||T.some((Ve,Ne)=>Ne!==te&&Ve.name===_))return;const R=[...T],V=R[te],he={...V,...C};he.value=Ae(V.value,C.type),R[te]=he,E(R),s?.(mr(R)),se(!1),k(null)},Le=_=>{const R=T.filter((V,he)=>he!==_);E(R),s?.(mr(R))},ze={flex:"1",maxWidth:300,backgroundColor:"#ffffff",borderRadius:8,boxShadow:"0 2px 10px rgba(0,0,0,0.1)",overflow:"hidden",display:"flex",flexDirection:"column",...p},We={padding:16,borderBottom:"1px solid #e0e0e0",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",backgroundColor:"#f9f9f9"},Ie={margin:0,fontSize:12,fontWeight:"bold",color:"#666",letterSpacing:1},Pe={padding:"16px 16px 12px",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"none"},fe={fontSize:14,color:"#333"},De={appearance:"none",width:120,height:32,padding:0,border:"1px solid #e0e0e0",borderRadius:4,cursor:"pointer"},_e={width:140,height:32,padding:"0 8px",border:"1px solid #e0e0e0",borderRadius:4,backgroundColor:"#fff",fontSize:14},ne={width:"100%",height:32,padding:"0 8px",border:"1px solid #e0e0e0",borderRadius:4,fontSize:14},Oe={padding:12,display:"flex",justifyContent:"flex-end",gap:8,borderTop:"1px solid #e0e0e0",backgroundColor:"#fafafa"},je={padding:"8px 12px",backgroundColor:"#fff",border:"1px solid #e0e0e0",borderRadius:6,cursor:"pointer"},Re={padding:"8px 12px",backgroundColor:"#111827",color:"#fff",border:"1px solid #0b1220",borderRadius:6,cursor:"pointer"},bt={display:"flex",alignItems:"center",gap:8,width:"100%",padding:"10px 12px",border:"1px solid #e0e0e0",borderRadius:8,backgroundColor:"#fff",cursor:"pointer",fontSize:14,color:"#111"},at={border:"1px solid #e0e0e0",borderRadius:8,width:28,height:28,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"#fff",cursor:"pointer"},lt={display:"grid",gridTemplateColumns:"1fr minmax(90px, 150px) 28px 28px",alignItems:"center",gap:8,padding:"6px 0"},Ct={fontSize:13,color:"#222",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},I={maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:13,color:"#111",border:"1px solid #e6e6e6",borderRadius:12,padding:"6px 10px",backgroundColor:"#fafafa"},$=()=>{c?.({theme:m,chatSettings:y,metadata:g,featureFlags:F})};return d.jsxs("div",{style:ze,children:[d.jsxs("div",{style:{borderBottom:"1px solid #e0e0e0"},children:[d.jsxs("div",{style:We,onClick:()=>N(!v),children:[d.jsx("h3",{style:Ie,children:"APPEARANCE"}),v?d.jsx(mi,{size:16}):d.jsx(pi,{size:16})]}),v&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Primary Color"}),d.jsx("input",{type:"color",value:m.primaryColor,onChange:_=>W("primaryColor",_.target.value),style:De})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Secondary Color"}),d.jsx("input",{type:"color",value:m.secondaryColor,onChange:_=>W("secondaryColor",_.target.value),style:De})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Background Color"}),d.jsx("input",{type:"color",value:m.backgroundColor,onChange:_=>W("backgroundColor",_.target.value),style:De})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Text Color"}),d.jsx("input",{type:"color",value:m.textColor,onChange:_=>W("textColor",_.target.value),style:De})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Font Size"}),d.jsxs("select",{style:_e,value:m.fontSize,onChange:_=>W("fontSize",_.target.value),children:[d.jsx("option",{value:"12px",children:"Small (12px)"}),d.jsx("option",{value:"15px",children:"Medium (15px)"}),d.jsx("option",{value:"18px",children:"Large (18px)"})]})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Font Family"}),d.jsxs("select",{style:_e,value:m.fontFamily.split(",")[0].trim(),onChange:_=>{const R=_.target.value;W("fontFamily",R==="Inter"?"Inter, sans-serif":R==="Arial"?"Arial, sans-serif":R==="Times New Roman"?"'Times New Roman', serif":"monospace")},children:[d.jsx("option",{value:"Inter",children:"Inter"}),d.jsx("option",{value:"Arial",children:"Arial"}),d.jsx("option",{value:"Times New Roman",children:"Times New Roman"}),d.jsx("option",{value:"monospace",children:"Monospace"})]})]})]})]}),d.jsxs("div",{children:[d.jsxs("div",{style:We,onClick:()=>j(!L),children:[d.jsx("h3",{style:Ie,children:"SETTINGS"}),L?d.jsx(mi,{size:16}):d.jsx(pi,{size:16})]}),L&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:{padding:"16px 16px 12px"},children:[d.jsx("label",{style:{...fe,display:"block",marginBottom:8},children:"Name"}),d.jsx("input",{type:"text",style:{...ne,height:40,padding:"0 12px",boxSizing:"border-box"},value:y.name,onChange:_=>pe("name",_.target.value)})]}),d.jsxs("div",{style:{padding:"0 16px 12px"},children:[d.jsx("label",{style:{...fe,display:"block",marginBottom:8},children:"Description"}),d.jsx("input",{type:"text",style:{...ne,height:40,padding:"0 12px",boxSizing:"border-box"},value:y.description,onChange:_=>pe("description",_.target.value)})]}),d.jsxs("div",{style:{padding:"0 16px 12px"},children:[d.jsx("label",{style:{...fe,display:"block",marginBottom:8},children:"Agent Name"}),d.jsx("input",{type:"text",style:{...ne,height:40,padding:"0 12px",boxSizing:"border-box"},value:y.agentName,onChange:_=>pe("agentName",_.target.value)})]}),d.jsxs("div",{style:{padding:"0 16px 16px"},children:[d.jsx("label",{style:{...fe,display:"block",marginBottom:8},children:"Logo URL"}),d.jsx("input",{type:"text",style:{...ne,height:40,padding:"0 12px",boxSizing:"border-box"},value:y.logoUrl||"",onChange:_=>pe("logoUrl",_.target.value),placeholder:"https://example.com/logo.png"})]}),d.jsxs("div",{style:{padding:"16px",borderTop:"1px solid #e0e0e0",marginTop:8},children:[d.jsx("div",{style:{fontSize:13,color:"#555",marginBottom:12,fontWeight:500},children:"Features"}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Use Audio"}),d.jsx("input",{type:"checkbox",checked:!!F.useAudio,onChange:_=>ae("useAudio",_.target.checked),style:{width:20,height:20,cursor:"pointer"}})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Use File"}),d.jsx("input",{type:"checkbox",checked:!!F.useFile,onChange:_=>ae("useFile",_.target.checked),style:{width:20,height:20,cursor:"pointer"}})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Use WebSocket"}),d.jsx("input",{type:"checkbox",checked:!!F.useWs,onChange:_=>ae("useWs",_.target.checked),style:{width:20,height:20,cursor:"pointer"}})]}),d.jsxs("div",{style:Pe,children:[d.jsx("label",{style:fe,children:"Use Heartbeat Polling"}),d.jsx("input",{type:"checkbox",checked:!!F.usePoll,onChange:_=>ae("usePoll",_.target.checked),style:{width:20,height:20,cursor:"pointer"}})]})]})]})]}),d.jsxs("div",{children:[d.jsxs("div",{style:We,onClick:()=>O(!S),children:[d.jsx("h3",{style:Ie,children:"METADATA"}),S?d.jsx(mi,{size:16}):d.jsx(pi,{size:16})]}),S&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:{padding:"12px 16px"},children:[d.jsxs("div",{style:{fontSize:13,color:"#555",marginBottom:10},children:["Define key/value parameters sent as chat metadata.",Object.keys(o||{}).length>0&&d.jsx("span",{style:{display:"block",marginTop:4,color:"#666"},children:"Parameters from the workflow's Chat Input node are shown below."})]}),d.jsxs("button",{style:bt,onClick:()=>U(!0),children:[d.jsx(Wm,{size:18}),d.jsx("span",{children:"Add Parameter"})]})]}),T.length>0&&d.jsx("div",{style:{padding:"2px 16px 12px",display:"flex",flexDirection:"column",gap:6},children:T.map((_,R)=>{const V=_.type==="boolean"?_.value?"True":"False":String(_.value??"");return d.jsxs("div",{style:lt,children:[d.jsx("div",{style:Ct,children:_.name}),d.jsx("div",{style:I,title:V,children:V}),d.jsx("button",{title:"Edit",style:at,onClick:()=>{k(R),q({..._}),se(!0)},"aria-label":`Edit ${_.name}`,children:d.jsx(Hm,{size:16})}),d.jsx("button",{title:"Remove",style:at,onClick:()=>Le(R),"aria-label":`Remove ${_.name}`,children:d.jsx(yi,{size:16})})]},_.name)})})]})]}),d.jsxs("div",{style:Oe,children:[d.jsx("button",{style:je,onClick:()=>f?.(),children:"Cancel"}),d.jsx("button",{style:Re,onClick:$,children:"Save Changes"})]}),H&&d.jsx("div",{style:Al,children:d.jsxs("div",{style:_l,children:[d.jsx("div",{style:jl,children:"Add Parameter"}),d.jsxs("div",{style:Il,children:[d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Parameter Name"}),d.jsx("input",{type:"text",style:ne,value:M.name,onChange:_=>Q(R=>({...R,name:_.target.value})),placeholder:"param_1"})]}),d.jsxs("div",{style:{display:"flex",gap:12},children:[d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Type"}),d.jsxs("select",{style:_e,value:M.type,onChange:_=>Q(R=>({...R,type:_.target.value,value:_.target.value==="boolean"?!1:_.target.value==="number"?0:""})),children:[d.jsx("option",{value:"string",children:"String"}),d.jsx("option",{value:"number",children:"Number"}),d.jsx("option",{value:"boolean",children:"Boolean"})]})]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Required"}),d.jsxs("select",{style:_e,value:M.required?"yes":"no",onChange:_=>Q(R=>({...R,required:_.target.value==="yes"})),children:[d.jsx("option",{value:"no",children:"No"}),d.jsx("option",{value:"yes",children:"Yes"})]})]})]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Default / Value"}),M.type==="boolean"?d.jsxs("select",{style:_e,value:M.value?"true":"false",onChange:_=>Q(R=>({...R,value:_.target.value==="true"})),children:[d.jsx("option",{value:"false",children:"False"}),d.jsx("option",{value:"true",children:"True"})]}):d.jsx("input",{type:M.type==="number"?"number":"text",style:ne,value:String(M.value??""),onChange:_=>Q(R=>({...R,value:M.type==="number"?Number(_.target.value):_.target.value}))})]})]}),d.jsxs("div",{style:Dl,children:[d.jsx("button",{style:je,onClick:()=>U(!1),children:"Cancel"}),d.jsx("button",{style:Re,onClick:ee,children:"Add"})]})]})}),Z&&d.jsx("div",{style:Al,children:d.jsxs("div",{style:_l,children:[d.jsx("div",{style:jl,children:"Edit Parameter"}),d.jsxs("div",{style:Il,children:[d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Parameter Name"}),d.jsx("input",{type:"text",style:ne,value:C.name,onChange:_=>q(R=>({...R,name:_.target.value}))})]}),d.jsxs("div",{style:{display:"flex",gap:12},children:[d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Type"}),d.jsxs("select",{style:_e,value:C.type,onChange:_=>q(R=>({...R,type:_.target.value,value:_.target.value==="boolean"?!1:_.target.value==="number"?0:typeof R.value=="string"?R.value:""})),children:[d.jsx("option",{value:"string",children:"String"}),d.jsx("option",{value:"number",children:"Number"}),d.jsx("option",{value:"boolean",children:"Boolean"})]})]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Required"}),d.jsxs("select",{style:_e,value:C.required?"yes":"no",onChange:_=>q(R=>({...R,required:_.target.value==="yes"})),children:[d.jsx("option",{value:"no",children:"No"}),d.jsx("option",{value:"yes",children:"Yes"})]})]})]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[d.jsx("label",{style:{fontSize:12,color:"#777"},children:"Value"}),C.type==="boolean"?d.jsxs("select",{style:_e,value:C.value?"true":"false",onChange:_=>q(R=>({...R,value:_.target.value==="true"})),children:[d.jsx("option",{value:"false",children:"False"}),d.jsx("option",{value:"true",children:"True"})]}):d.jsx("input",{type:C.type==="number"?"number":"text",style:ne,value:String(C.value??""),onChange:_=>q(R=>({...R,value:C.type==="number"?Number(_.target.value):_.target.value}))})]})]}),d.jsxs("div",{style:Dl,children:[d.jsx("button",{style:je,onClick:()=>se(!1),children:"Cancel"}),d.jsx("button",{style:Re,onClick:be,children:"Save"})]})]})})]})},Al={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.25)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1005},_l={width:420,maxWidth:"92vw",backgroundColor:"#fff",borderRadius:12,boxShadow:"0 8px 24px rgba(0,0,0,0.18)",overflow:"hidden"},jl={padding:"12px 16px",fontWeight:600,borderBottom:"1px solid #eee"},Il={padding:16,display:"flex",flexDirection:"column",gap:12},Dl={padding:12,display:"flex",justifyContent:"flex-end",gap:8,borderTop:"1px solid #eee",backgroundColor:"#fafafa"};ke.ChatBubble=xl,ke.ChatService=ml,ke.GENASSIST_AGENT_METADATA_UPDATED=pl,ke.GenAgentChat=ob,ke.GenAgentConfigPanel=ub,ke.defaultTranslations=Yt,ke.frenchTranslations=Sa,ke.generateMessageContent=cg,ke.germanTranslations=Ca,ke.getBrowserLanguage=ba,ke.getTranslation=ki,ke.getTranslationArray=ka,ke.getTranslationString=Vn,ke.getTranslationsForLanguage=Aa,ke.italianTranslations=va,ke.mergeTranslations=Qn,ke.parseInteractiveContentBlocks=xa,ke.portugueseTranslations=Ea,ke.resolveLanguage=wi,ke.spanishTranslations=wa,ke.translationsByLanguage=Ta,ke.useChat=gl,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})}));
|