spec-snake 0.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +333 -0
- package/README.md +335 -0
- package/dist/cli.js +783 -0
- package/dist/cli.js.map +7 -0
- package/dist/client/assets/ChevronRightIcon-BcBiiChF.js +1 -0
- package/dist/client/assets/DocumentIcon-jB6zASay.js +1 -0
- package/dist/client/assets/Header-DN39nNWE.js +1 -0
- package/dist/client/assets/PlusIcon-DqYOBije.js +1 -0
- package/dist/client/assets/index-CSjjObwb.css +1 -0
- package/dist/client/assets/index-CT_VQ59w.js +1 -0
- package/dist/client/assets/index-D6usLrOW.js +26 -0
- package/dist/client/assets/index-DQxQHK-0.js +1 -0
- package/dist/client/assets/index-DYnzYTb1.js +1 -0
- package/dist/client/assets/index-Q_AobJB0.js +1 -0
- package/dist/client/assets/index-pyqED_5G.js +1 -0
- package/dist/client/assets/useStepFormStore-CBcs2c-9.js +41 -0
- package/dist/client/index.html +13 -0
- package/dist/types.d.ts +848 -0
- package/dist/types.js +99 -0
- package/package.json +85 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{S as ih,g as oh,h as Wl,i as sh,n as Mu,k as lh,r as m,j as R,l as Fu,m as Lu,u as Yn,c as Du,A as mr,o as Qt,p as Zi,t as Kl,v as ve,w as vr,x as Wr,y as eo,z as Vu,B as ah,C as uh,D as Bn,E as ch,F as ur,G as In,H as fh,I as dh,J as Zs,L as Oi,K as Nu,M as hh,N as ph,O as mh}from"./index-D6usLrOW.js";import{n as gh,s as yh,E as xh,C as _u}from"./Header-DN39nNWE.js";import{P as bh}from"./PlusIcon-DqYOBije.js";var wh=class extends ih{#n;#r=void 0;#e;#t;constructor(t,n){super(),this.#n=t,this.setOptions(n),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#n.defaultMutationOptions(t),oh(this.options,n)||this.#n.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),n?.mutationKey&&this.options.mutationKey&&Wl(n.mutationKey)!==Wl(this.options.mutationKey)?this.reset():this.#e?.state.status==="pending"&&this.#e.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#o(t)}getCurrentResult(){return this.#r}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#i(),this.#o()}mutate(t,n){return this.#t=n,this.#e?.removeObserver(this),this.#e=this.#n.getMutationCache().build(this.#n,this.options),this.#e.addObserver(this),this.#e.execute(t)}#i(){const t=this.#e?.state??sh();this.#r={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Mu.batch(()=>{if(this.#t&&this.hasListeners()){const n=this.#r.variables,r=this.#r.context;t?.type==="success"?(this.#t.onSuccess?.(t.data,n,r),this.#t.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#t.onError?.(t.error,n,r),this.#t.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#r)})})}};function vh(e,t){const n=lh(),[r]=m.useState(()=>new wh(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const i=m.useSyncExternalStore(m.useCallback(s=>r.subscribe(Mu.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=m.useCallback((s,l)=>{r.mutate(s,l).catch(gh)},[r]);if(i.error&&yh(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}const kh=()=>R.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M2 4H14M5.333 4V2.667C5.333 2.298 5.632 2 6 2H10C10.368 2 10.667 2.298 10.667 2.667V4M12.667 4V13.333C12.667 13.702 12.368 14 12 14H4C3.632 14 3.333 13.702 3.333 13.333V4H12.667Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ch=()=>R.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Sh=()=>R.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M6 12L10 8L6 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Eh=()=>R.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ih=()=>R.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Rh=()=>R.jsx("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ah=()=>R.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:R.jsx("path",{d:"M11.333 2.00004C11.5081 1.82494 11.7169 1.68605 11.9471 1.59129C12.1773 1.49653 12.4241 1.44775 12.6733 1.44775C12.9226 1.44775 13.1694 1.49653 13.3996 1.59129C13.6297 1.68605 13.8386 1.82494 14.0137 2.00004C14.1888 2.17513 14.3277 2.384 14.4224 2.61419C14.5172 2.84438 14.566 3.09117 14.566 3.34037C14.566 3.58957 14.5172 3.83637 14.4224 4.06656C14.3277 4.29675 14.1888 4.50561 14.0137 4.68071L5.00033 13.6941L1.33366 14.6667L2.30633 11.0001L11.333 2.00004Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Th=()=>R.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R.jsx("path",{d:"M13.6667 2.66667V6.00001H10.3333",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),R.jsx("path",{d:"M2.33333 13.3333V10H5.66667",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),R.jsx("path",{d:"M3.66 6.00001C3.9534 5.04453 4.50594 4.18898 5.25559 3.52857C6.00523 2.86816 6.92264 2.42818 7.9073 2.25685C8.89196 2.08552 9.90501 2.18951 10.8355 2.55756C11.766 2.92561 12.5775 3.54348 13.18 4.34001L13.6667 6.00001M2.33333 10L2.82 11.66C3.42248 12.4565 4.23396 13.0744 5.16449 13.4425C6.09502 13.8105 7.10807 13.9145 8.09273 13.7432C9.07739 13.5718 9.99481 13.1319 10.7444 12.4714C11.4941 11.811 12.0466 10.9555 12.34 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ph=()=>R.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R.jsx("path",{d:"M12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H10.6667L14 5.33333V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),R.jsx("path",{d:"M11.3333 14V9.33333H4.66667V14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),R.jsx("path",{d:"M4.66667 2V5.33333H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Oh=()=>R.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R.jsx("rect",{x:"5.33333",y:"5.33333",width:"8.66667",height:"8.66667",rx:"1.33333",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),R.jsx("path",{d:"M10.6667 5.33333V3.33333C10.6667 2.97971 10.5262 2.64057 10.2761 2.39052C10.0261 2.14048 9.68696 2 9.33333 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333V9.33333C2 9.68696 2.14048 10.0261 2.39052 10.2761C2.64057 10.5262 2.97971 10.6667 3.33333 10.6667H5.33333",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Mh=()=>R.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R.jsx("path",{d:"M2.66667 8V12.6667C2.66667 13.0203 2.80714 13.3594 3.05719 13.6095C3.30724 13.8595 3.64638 14 4 14H12C12.3536 14 12.6928 13.8595 12.9428 13.6095C13.1929 13.3594 13.3333 13.0203 13.3333 12.6667V8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),R.jsx("path",{d:"M10.6667 4L8 1.33333L5.33333 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),R.jsx("path",{d:"M8 1.33333V10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});function Fh(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Lh=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dh=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vh={};function Gl(e,t){return(Vh.jsx?Dh:Lh).test(e)}const Nh=/[ \t\n\f\r]/g;function _h(e){return typeof e=="object"?e.type==="text"?Yl(e.value):!1:Yl(e)}function Yl(e){return e.replace(Nh,"")===""}class Qr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Qr.prototype.normal={};Qr.prototype.property={};Qr.prototype.space=void 0;function ju(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Qr(n,r,t)}function bs(e){return e.toLowerCase()}class Tt{constructor(t,n){this.attribute=n,this.property=t}}Tt.prototype.attribute="";Tt.prototype.booleanish=!1;Tt.prototype.boolean=!1;Tt.prototype.commaOrSpaceSeparated=!1;Tt.prototype.commaSeparated=!1;Tt.prototype.defined=!1;Tt.prototype.mustUseProperty=!1;Tt.prototype.number=!1;Tt.prototype.overloadedBoolean=!1;Tt.prototype.property="";Tt.prototype.spaceSeparated=!1;Tt.prototype.space=void 0;let jh=0;const Le=Xn(),lt=Xn(),ws=Xn(),re=Xn(),Ge=Xn(),cr=Xn(),Ft=Xn();function Xn(){return 2**++jh}const vs=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:lt,commaOrSpaceSeparated:Ft,commaSeparated:cr,number:re,overloadedBoolean:ws,spaceSeparated:Ge},Symbol.toStringTag,{value:"Module"})),_o=Object.keys(vs);class el extends Tt{constructor(t,n,r,i){let o=-1;if(super(t,n),Xl(this,"space",i),typeof r=="number")for(;++o<_o.length;){const s=_o[o];Xl(this,_o[o],(r&vs[s])===vs[s])}}}el.prototype.defined=!0;function Xl(e,t,n){n&&(e[t]=n)}function kr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new el(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[bs(r)]=r,n[bs(o.attribute)]=r}return new Qr(t,n,e.space)}const zu=kr({properties:{ariaActiveDescendant:null,ariaAtomic:lt,ariaAutoComplete:null,ariaBusy:lt,ariaChecked:lt,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:Ge,ariaCurrent:null,ariaDescribedBy:Ge,ariaDetails:null,ariaDisabled:lt,ariaDropEffect:Ge,ariaErrorMessage:null,ariaExpanded:lt,ariaFlowTo:Ge,ariaGrabbed:lt,ariaHasPopup:null,ariaHidden:lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ge,ariaLevel:re,ariaLive:null,ariaModal:lt,ariaMultiLine:lt,ariaMultiSelectable:lt,ariaOrientation:null,ariaOwns:Ge,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:lt,ariaReadOnly:lt,ariaRelevant:null,ariaRequired:lt,ariaRoleDescription:Ge,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:lt,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Bu(e,t){return t in e?e[t]:t}function Hu(e,t){return Bu(e,t.toLowerCase())}const zh=kr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:cr,acceptCharset:Ge,accessKey:Ge,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:Ge,autoFocus:Le,autoPlay:Le,blocking:Ge,capture:null,charSet:null,checked:Le,cite:null,className:Ge,cols:re,colSpan:null,content:null,contentEditable:lt,controls:Le,controlsList:Ge,coords:re|cr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:ws,draggable:lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:Ge,height:re,hidden:ws,high:re,href:null,hrefLang:null,htmlFor:Ge,httpEquiv:Ge,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:Ge,itemRef:Ge,itemScope:Le,itemType:Ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Le,optimum:re,pattern:null,ping:Ge,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:Ge,required:Le,reversed:Le,rows:re,rowSpan:re,sandbox:Ge,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:lt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:lt,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ge,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:lt,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:Hu}),Bh=kr({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:Ft,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:Ge,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:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,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:cr,g2:cr,glyphName:cr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:Ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,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:re,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:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ft,rev:Ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ft,requiredFeatures:Ft,requiredFonts:Ft,requiredFormats:Ft,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:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:Ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ft,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Bu}),Uu=kr({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()}}),$u=kr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hu}),qu=kr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Hh={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"},Uh=/[A-Z]/g,Ql=/-[a-z]/g,$h=/^data[-\w.:]+$/i;function qh(e,t){const n=bs(t);let r=t,i=Tt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$h.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Ql,Kh);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Ql.test(o)){let s=o.replace(Uh,Wh);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=el}return new i(r,t)}function Wh(e){return"-"+e.toLowerCase()}function Kh(e){return e.charAt(1).toUpperCase()}const Gh=ju([zu,zh,Uu,$u,qu],"html"),tl=ju([zu,Bh,Uu,$u,qu],"svg");function Yh(e){return e.join(" ").trim()}var tr={},jo,Jl;function Xh(){if(Jl)return jo;Jl=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
2
|
+
`,a="/",f="*",c="",h="comment",d="declaration";function p(w,g){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];g=g||{};var y=1,v=1;function k(D){var A=D.match(t);A&&(y+=A.length);var N=D.lastIndexOf(u);v=~N?D.length-N:v+D.length}function E(){var D={line:y,column:v};return function(A){return A.position=new C(D),q(),A}}function C(D){this.start=D,this.end={line:y,column:v},this.source=g.source}C.prototype.content=w;function P(D){var A=new Error(g.source+":"+y+":"+v+": "+D);if(A.reason=D,A.filename=g.source,A.line=y,A.column=v,A.source=w,!g.silent)throw A}function L(D){var A=D.exec(w);if(A){var N=A[0];return k(N),w=w.slice(N.length),A}}function q(){L(n)}function O(D){var A;for(D=D||[];A=z();)A!==!1&&D.push(A);return D}function z(){var D=E();if(!(a!=w.charAt(0)||f!=w.charAt(1))){for(var A=2;c!=w.charAt(A)&&(f!=w.charAt(A)||a!=w.charAt(A+1));)++A;if(A+=2,c===w.charAt(A-1))return P("End of comment missing");var N=w.slice(2,A-2);return v+=2,k(N),w=w.slice(A),v+=2,D({type:h,comment:N})}}function _(){var D=E(),A=L(r);if(A){if(z(),!L(i))return P("property missing ':'");var N=L(o),Y=D({type:d,property:x(A[0].replace(e,c)),value:N?x(N[0].replace(e,c)):c});return L(s),Y}}function B(){var D=[];O(D);for(var A;A=_();)A!==!1&&(D.push(A),O(D));return D}return q(),B()}function x(w){return w?w.replace(l,c):c}return jo=p,jo}var Zl;function Qh(){if(Zl)return tr;Zl=1;var e=tr&&tr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tr,"__esModule",{value:!0}),tr.default=n;const t=e(Xh());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const s=(0,t.default)(r),l=typeof i=="function";return s.forEach(u=>{if(u.type!=="declaration")return;const{property:a,value:f}=u;l?i(a,f,u):f&&(o=o||{},o[a]=f)}),o}return tr}var Pr={},ea;function Jh(){if(ea)return Pr;ea=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(a){return!a||n.test(a)||e.test(a)},s=function(a,f){return f.toUpperCase()},l=function(a,f){return"".concat(f,"-")},u=function(a,f){return f===void 0&&(f={}),o(a)?a:(a=a.toLowerCase(),f.reactCompat?a=a.replace(i,l):a=a.replace(r,l),a.replace(t,s))};return Pr.camelCase=u,Pr}var Or,ta;function Zh(){if(ta)return Or;ta=1;var e=Or&&Or.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Qh()),n=Jh();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(s[(0,n.camelCase)(l,o)]=u)}),s}return r.default=r,Or=r,Or}var ep=Zh();const tp=Fu(ep),Wu=Ku("end"),nl=Ku("start");function Ku(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 np(e){const t=nl(e),n=Wu(e);if(t&&n)return{start:t,end:n}}function _r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?na(e.position):"start"in e||"end"in e?na(e):"line"in e||"column"in e?ks(e):""}function ks(e){return ra(e&&e.line)+":"+ra(e&&e.column)}function na(e){return ks(e&&e.start)+"-"+ks(e&&e.end)}function ra(e){return e&&typeof e=="number"?e:1}class bt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=_r(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}bt.prototype.file="";bt.prototype.name="";bt.prototype.reason="";bt.prototype.message="";bt.prototype.stack="";bt.prototype.column=void 0;bt.prototype.line=void 0;bt.prototype.ancestors=void 0;bt.prototype.cause=void 0;bt.prototype.fatal=void 0;bt.prototype.place=void 0;bt.prototype.ruleId=void 0;bt.prototype.source=void 0;const rl={}.hasOwnProperty,rp=new Map,ip=/[A-Z]/g,op=new Set(["table","tbody","thead","tfoot","tr"]),sp=new Set(["td","th"]),Gu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lp(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=mp(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=pp(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"?tl:Gh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Yu(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Yu(e,t,n){if(t.type==="element")return ap(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return up(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fp(e,t,n);if(t.type==="mdxjsEsm")return cp(e,t);if(t.type==="root")return dp(e,t,n);if(t.type==="text")return hp(e,t)}function ap(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=tl,e.schema=i),e.ancestors.push(t);const o=Qu(e,t.tagName,!1),s=gp(e,t);let l=ol(e,t);return op.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!_h(u):!0})),Xu(e,s,o,t),il(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function up(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)}Kr(e,t.position)}function cp(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Kr(e,t.position)}function fp(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=tl,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Qu(e,t.name,!0),s=yp(e,t),l=ol(e,t);return Xu(e,s,o,t),il(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function dp(e,t,n){const r={};return il(r,ol(e,t)),e.create(t,e.Fragment,r,n)}function hp(e,t){return t.value}function Xu(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function il(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function pp(e,t,n){return r;function r(i,o,s,l){const a=Array.isArray(s.children)?n:t;return l?a(o,s,l):a(o,s)}}function mp(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),u=nl(r);return t(i,o,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function gp(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&rl.call(t.properties,i)){const o=xp(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&sp.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function yp(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Kr(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Kr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function ol(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:rp;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const a=i.get(u)||0;s=u+"-"+a,i.set(u,a+1)}}const l=Yu(e,o,s);l!==void 0&&n.push(l)}return n}function xp(e,t,n){const r=qh(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Fh(n):Yh(n)),r.property==="style"){let i=typeof n=="object"?n:bp(e,String(n));return e.stylePropertyNameCase==="css"&&(i=wp(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Hh[r.property]||r.property:r.attribute,n]}}function bp(e,t){try{return tp(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new bt("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=Gu+"#cannot-parse-style-attribute",i}}function Qu(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const l=Gl(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=s}else r=Gl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return rl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Kr(e)}function Kr(e,t){const n=new bt("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=Gu+"#cannot-handle-mdx-estrees-without-createevaluater",n}function wp(e){const t={};let n;for(n in e)rl.call(e,n)&&(t[vp(n)]=e[n]);return t}function vp(e){let t=e.replace(ip,kp);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function kp(e){return"-"+e.toLowerCase()}const zo={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"]},Cp={};function sl(e,t){const n=Cp,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ju(e,r,i)}function Ju(e,t,n){if(Sp(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 ia(e.children,t,n)}return Array.isArray(e)?ia(e,t,n):""}function ia(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ju(e[i],t,n);return r.join("")}function Sp(e){return!!(e&&typeof e=="object")}const oa=document.createElement("i");function ll(e){const t="&"+e+";";oa.innerHTML=t;const n=oa.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _t(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Ut(e,t){return e.length>0?(_t(e,e.length,0,t),e):t}const sa={}.hasOwnProperty;function Zu(e){const t={};let n=-1;for(;++n<e.length;)Ep(t,e[n]);return t}function Ep(e,t){let n;for(n in t){const i=(sa.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){sa.call(i,s)||(i[s]=[]);const l=o[s];Ip(i[s],Array.isArray(l)?l:l?[l]:[])}}}function Ip(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_t(e,0,0,r)}function ec(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 Jt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const St=On(/[A-Za-z]/),xt=On(/[\dA-Za-z]/),Rp=On(/[#-'*+\--9=?A-Z^-~]/);function Mi(e){return e!==null&&(e<32||e===127)}const Cs=On(/\d/),Ap=On(/[\dA-Fa-f]/),Tp=On(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function Ke(e){return e!==null&&(e<0||e===32)}function _e(e){return e===-2||e===-1||e===32}const to=On(new RegExp("\\p{P}|\\p{S}","u")),Kn=On(/\s/);function On(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Cr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&xt(e.charCodeAt(n+1))&&xt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ze(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return _e(u)?(e.enter(n),l(u)):t(u)}function l(u){return _e(u)&&o++<i?(e.consume(u),l):(e.exit(n),t(u))}}const Pp={tokenize:Op};function Op(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ze(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ie(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),s)}}const Mp={tokenize:Fp},la={tokenize:Lp};function Fp(e){const t=this,n=[];let r=0,i,o,s;return l;function l(v){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,u,a)(v)}return a(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const k=t.events.length;let E=k,C;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){C=t.events[E][1].end;break}g(r);let P=k;for(;P<t.events.length;)t.events[P][1].end={...C},P++;return _t(t.events,E+1,0,t.events.slice(k)),t.events.length=P,a(v)}return l(v)}function a(v){if(r===n.length){if(!i)return h(v);if(i.currentConstruct&&i.currentConstruct.concrete)return p(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(la,f,c)(v)}function f(v){return i&&y(),g(r),h(v)}function c(v){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(v)}function h(v){return t.containerState={},e.attempt(la,d,p)(v)}function d(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function p(v){if(v===null){i&&y(),g(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(v)}function x(v){if(v===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(v);return}return Ie(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(v),x)}function w(v,k){const E=t.sliceStream(v);if(k&&E.push(null),v.previous=o,o&&(o.next=v),o=v,i.defineSkip(v.start),i.write(E),t.parser.lazy[v.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<s&&(!i.events[C][1].end||i.events[C][1].end.offset>s))return;const P=t.events.length;let L=P,q,O;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(q){O=t.events[L][1].end;break}q=!0}for(g(r),C=P;C<t.events.length;)t.events[C][1].end={...O},C++;_t(t.events,L+1,0,t.events.slice(P)),t.events.length=C}}function g(v){let k=n.length;for(;k-- >v;){const E=n[k];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Lp(e,t,n){return ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gr(e){if(e===null||Ke(e)||Kn(e))return 1;if(to(e))return 2}function no(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Ss={name:"attention",resolveAll:Dp,tokenize:Vp};function Dp(e,t){let n=-1,r,i,o,s,l,u,a,f;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;u=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 c={...e[r][1].end},h={...e[n][1].start};aa(c,-u),aa(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},a=[],e[r][1].end.offset-e[r][1].start.offset&&(a=Ut(a,[["enter",e[r][1],t],["exit",e[r][1],t]])),a=Ut(a,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),a=Ut(a,no(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),a=Ut(a,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,a=Ut(a,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,_t(e,r-1,n-r+3,a),n=r+a.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Vp(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=gr(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===o)return e.consume(u),l;const a=e.exit("attentionSequence"),f=gr(u),c=!f||f===2&&i||n.includes(u),h=!i||i===2&&f||n.includes(r);return a._open=!!(o===42?c:c&&(i||!h)),a._close=!!(o===42?h:h&&(f||!c)),t(u)}}function aa(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Np={name:"autolink",tokenize:_p};function _p(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return St(d)?(e.consume(d),s):d===64?n(d):a(d)}function s(d){return d===43||d===45||d===46||xt(d)?(r=1,l(d)):a(d)}function l(d){return d===58?(e.consume(d),r=0,u):(d===43||d===45||d===46||xt(d))&&r++<32?(e.consume(d),l):(r=0,a(d))}function u(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Mi(d)?n(d):(e.consume(d),u)}function a(d){return d===64?(e.consume(d),f):Rp(d)?(e.consume(d),a):n(d)}function f(d){return xt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||xt(d))&&r++<63){const p=d===45?h:c;return e.consume(d),p}return n(d)}}const Jr={partial:!0,tokenize:jp};function jp(e,t,n){return r;function r(o){return _e(o)?ze(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ie(o)?t(o):n(o)}}const tc={continuation:{tokenize:Bp},exit:Hp,name:"blockQuote",tokenize:zp};function zp(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return _e(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Bp(e,t,n){const r=this;return i;function i(s){return _e(s)?ze(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(tc,t,n)(s)}}function Hp(e){e.exit("blockQuote")}const nc={name:"characterEscape",tokenize:Up};function Up(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Tp(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const rc={name:"characterReference",tokenize:$p};function $p(e,t,n){const r=this;let i=0,o,s;return l;function l(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),o=31,s=xt,f(c))}function a(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Ap,f):(e.enter("characterReferenceValue"),o=7,s=Cs,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===xt&&!ll(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const ua={partial:!0,tokenize:Wp},ca={concrete:!0,name:"codeFenced",tokenize:qp};function qp(e,t,n){const r=this,i={partial:!0,tokenize:E};let o=0,s=0,l;return u;function u(C){return a(C)}function a(C){const P=r.events[r.events.length-1];return o=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===l?(s++,e.consume(C),f):s<3?n(C):(e.exit("codeFencedFenceSequence"),_e(C)?ze(e,c,"whitespace")(C):c(C))}function c(C){return C===null||Ie(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(ua,x,k)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||Ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):_e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ze(e,d,"whitespace")(C)):C===96&&C===l?n(C):(e.consume(C),h)}function d(C){return C===null||Ie(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||Ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===l?n(C):(e.consume(C),p)}function x(C){return e.attempt(i,k,w)(C)}function w(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),g}function g(C){return o>0&&_e(C)?ze(e,y,"linePrefix",o+1)(C):y(C)}function y(C){return C===null||Ie(C)?e.check(ua,x,k)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||Ie(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),v)}function k(C){return e.exit("codeFenced"),t(C)}function E(C,P,L){let q=0;return O;function O(A){return C.enter("lineEnding"),C.consume(A),C.exit("lineEnding"),z}function z(A){return C.enter("codeFencedFence"),_e(A)?ze(C,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):_(A)}function _(A){return A===l?(C.enter("codeFencedFenceSequence"),B(A)):L(A)}function B(A){return A===l?(q++,C.consume(A),B):q>=s?(C.exit("codeFencedFenceSequence"),_e(A)?ze(C,D,"whitespace")(A):D(A)):L(A)}function D(A){return A===null||Ie(A)?(C.exit("codeFencedFence"),P(A)):L(A)}}}function Wp(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Bo={name:"codeIndented",tokenize:Gp},Kp={partial:!0,tokenize:Yp};function Gp(e,t,n){const r=this;return i;function i(a){return e.enter("codeIndented"),ze(e,o,"linePrefix",5)(a)}function o(a){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(a):n(a)}function s(a){return a===null?u(a):Ie(a)?e.attempt(Kp,s,u)(a):(e.enter("codeFlowValue"),l(a))}function l(a){return a===null||Ie(a)?(e.exit("codeFlowValue"),s(a)):(e.consume(a),l)}function u(a){return e.exit("codeIndented"),t(a)}}function Yp(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ze(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Ie(s)?i(s):n(s)}}const Xp={name:"codeText",previous:Jp,resolve:Qp,tokenize:Zp};function Qp(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 Jp(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Zp(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),l(c)}function l(c){return c===96?(e.consume(c),r++,l):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):Ie(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),a(c))}function a(c){return c===null||c===32||c===96||Ie(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),a)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",a(c))}}class em{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 o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Mr(this.left,r),o.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),Mr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Mr(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);Mr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Mr(this.left,n.reverse())}}}function Mr(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 ic(e){const t={};let n=-1,r,i,o,s,l,u,a;const f=new em(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,tm(f,n)),n=t[n],a=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},l=f.slice(i,n),l.unshift(r),f.splice(i,n-i+1,l))}}return _t(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!a}function tm(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,u=[],a={};let f,c,h=-1,d=n,p=0,x=0;const w=[x];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(x=h+1,w.push(x),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):w.pop(),h=w.length;h--;){const g=l.slice(w[h],w[h+1]),y=o.pop();u.push([y,y+g.length-1]),e.splice(y,2,g)}for(u.reverse(),h=-1;++h<u.length;)a[p+u[h][0]]=p+u[h][1],p+=u[h][1]-u[h][0]-1;return a}const nm={resolve:im,tokenize:om},rm={partial:!0,tokenize:sm};function im(e){return ic(e),e}function om(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):Ie(l)?e.check(rm,s,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function sm(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ze(e,o,"linePrefix")}function o(s){if(s===null||Ie(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function oc(e,t,n,r,i,o,s,l,u){const a=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),h):g===null||g===32||g===41||Mi(g)?n(g):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(g))}function h(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===62?(e.exit("chunkString"),e.exit(l),h(g)):g===null||g===60||Ie(g)?n(g):(e.consume(g),g===92?p:d)}function p(g){return g===60||g===62||g===92?(e.consume(g),d):d(g)}function x(g){return!f&&(g===null||g===41||Ke(g))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(g)):f<a&&g===40?(e.consume(g),f++,x):g===41?(e.consume(g),f--,x):g===null||g===32||g===40||Mi(g)?n(g):(e.consume(g),g===92?w:x)}function w(g){return g===40||g===41||g===92?(e.consume(g),x):x(g)}}function sc(e,t,n,r,i,o){const s=this;let l=0,u;return a;function a(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return l>999||d===null||d===91||d===93&&!u||d===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):Ie(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||Ie(d)||l++>999?(e.exit("chunkString"),f(d)):(e.consume(d),u||(u=!_e(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),l++,c):c(d)}}function lc(e,t,n,r,i,o){let s;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),a(h))}function a(h){return h===s?(e.exit(o),u(s)):h===null?n(h):Ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ze(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||Ie(h)?(e.exit("chunkString"),a(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function jr(e,t){let n;return r;function r(i){return Ie(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_e(i)?ze(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const lm={name:"definition",tokenize:um},am={partial:!0,tokenize:cm};function um(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return sc.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function l(d){return i=Jt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),u):n(d)}function u(d){return Ke(d)?jr(e,a)(d):a(d)}function a(d){return oc(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(am,c,c)(d)}function c(d){return _e(d)?ze(e,h,"whitespace")(d):h(d)}function h(d){return d===null||Ie(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function cm(e,t,n){return r;function r(l){return Ke(l)?jr(e,i)(l):n(l)}function i(l){return lc(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return _e(l)?ze(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Ie(l)?t(l):n(l)}}const fm={name:"hardBreakEscape",tokenize:dm};function dm(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ie(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const hm={name:"headingAtx",resolve:pm,tokenize:mm};function pm(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_t(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function mm(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Ke(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||Ie(f)?(e.exit("atxHeading"),t(f)):_e(f)?ze(e,l,"whitespace")(f):(e.enter("atxHeadingText"),a(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),l(f))}function a(f){return f===null||f===35||Ke(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),a)}}const gm=["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"],fa=["pre","script","style","textarea"],ym={concrete:!0,name:"htmlFlow",resolveTo:wm,tokenize:vm},xm={partial:!0,tokenize:Cm},bm={partial:!0,tokenize:km};function wm(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 vm(e,t,n){const r=this;let i,o,s,l,u;return a;function a(I){return f(I)}function f(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),o=!0,x):I===63?(e.consume(I),i=3,r.interrupt?t:S):St(I)?(e.consume(I),s=String.fromCharCode(I),w):n(I)}function h(I){return I===45?(e.consume(I),i=2,d):I===91?(e.consume(I),i=5,l=0,p):St(I)?(e.consume(I),i=4,r.interrupt?t:S):n(I)}function d(I){return I===45?(e.consume(I),r.interrupt?t:S):n(I)}function p(I){const fe="CDATA[";return I===fe.charCodeAt(l++)?(e.consume(I),l===fe.length?r.interrupt?t:_:p):n(I)}function x(I){return St(I)?(e.consume(I),s=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||Ke(I)){const fe=I===47,le=s.toLowerCase();return!fe&&!o&&fa.includes(le)?(i=1,r.interrupt?t(I):_(I)):gm.includes(s.toLowerCase())?(i=6,fe?(e.consume(I),g):r.interrupt?t(I):_(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?y(I):v(I))}return I===45||xt(I)?(e.consume(I),s+=String.fromCharCode(I),w):n(I)}function g(I){return I===62?(e.consume(I),r.interrupt?t:_):n(I)}function y(I){return _e(I)?(e.consume(I),y):O(I)}function v(I){return I===47?(e.consume(I),O):I===58||I===95||St(I)?(e.consume(I),k):_e(I)?(e.consume(I),v):O(I)}function k(I){return I===45||I===46||I===58||I===95||xt(I)?(e.consume(I),k):E(I)}function E(I){return I===61?(e.consume(I),C):_e(I)?(e.consume(I),E):v(I)}function C(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),u=I,P):_e(I)?(e.consume(I),C):L(I)}function P(I){return I===u?(e.consume(I),u=null,q):I===null||Ie(I)?n(I):(e.consume(I),P)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Ke(I)?E(I):(e.consume(I),L)}function q(I){return I===47||I===62||_e(I)?v(I):n(I)}function O(I){return I===62?(e.consume(I),z):n(I)}function z(I){return I===null||Ie(I)?_(I):_e(I)?(e.consume(I),z):n(I)}function _(I){return I===45&&i===2?(e.consume(I),N):I===60&&i===1?(e.consume(I),Y):I===62&&i===4?(e.consume(I),Z):I===63&&i===3?(e.consume(I),S):I===93&&i===5?(e.consume(I),K):Ie(I)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xm,be,B)(I)):I===null||Ie(I)?(e.exit("htmlFlowData"),B(I)):(e.consume(I),_)}function B(I){return e.check(bm,D,be)(I)}function D(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),A}function A(I){return I===null||Ie(I)?B(I):(e.enter("htmlFlowData"),_(I))}function N(I){return I===45?(e.consume(I),S):_(I)}function Y(I){return I===47?(e.consume(I),s="",$):_(I)}function $(I){if(I===62){const fe=s.toLowerCase();return fa.includes(fe)?(e.consume(I),Z):_(I)}return St(I)&&s.length<8?(e.consume(I),s+=String.fromCharCode(I),$):_(I)}function K(I){return I===93?(e.consume(I),S):_(I)}function S(I){return I===62?(e.consume(I),Z):I===45&&i===2?(e.consume(I),S):_(I)}function Z(I){return I===null||Ie(I)?(e.exit("htmlFlowData"),be(I)):(e.consume(I),Z)}function be(I){return e.exit("htmlFlow"),t(I)}}function km(e,t,n){const r=this;return i;function i(s){return Ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Cm(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Jr,t,n)}}const Sm={name:"htmlText",tokenize:Em};function Em(e,t,n){const r=this;let i,o,s;return l;function l(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),u}function u(S){return S===33?(e.consume(S),a):S===47?(e.consume(S),E):S===63?(e.consume(S),v):St(S)?(e.consume(S),L):n(S)}function a(S){return S===45?(e.consume(S),f):S===91?(e.consume(S),o=0,p):St(S)?(e.consume(S),y):n(S)}function f(S){return S===45?(e.consume(S),d):n(S)}function c(S){return S===null?n(S):S===45?(e.consume(S),h):Ie(S)?(s=c,Y(S)):(e.consume(S),c)}function h(S){return S===45?(e.consume(S),d):c(S)}function d(S){return S===62?N(S):S===45?h(S):c(S)}function p(S){const Z="CDATA[";return S===Z.charCodeAt(o++)?(e.consume(S),o===Z.length?x:p):n(S)}function x(S){return S===null?n(S):S===93?(e.consume(S),w):Ie(S)?(s=x,Y(S)):(e.consume(S),x)}function w(S){return S===93?(e.consume(S),g):x(S)}function g(S){return S===62?N(S):S===93?(e.consume(S),g):x(S)}function y(S){return S===null||S===62?N(S):Ie(S)?(s=y,Y(S)):(e.consume(S),y)}function v(S){return S===null?n(S):S===63?(e.consume(S),k):Ie(S)?(s=v,Y(S)):(e.consume(S),v)}function k(S){return S===62?N(S):v(S)}function E(S){return St(S)?(e.consume(S),C):n(S)}function C(S){return S===45||xt(S)?(e.consume(S),C):P(S)}function P(S){return Ie(S)?(s=P,Y(S)):_e(S)?(e.consume(S),P):N(S)}function L(S){return S===45||xt(S)?(e.consume(S),L):S===47||S===62||Ke(S)?q(S):n(S)}function q(S){return S===47?(e.consume(S),N):S===58||S===95||St(S)?(e.consume(S),O):Ie(S)?(s=q,Y(S)):_e(S)?(e.consume(S),q):N(S)}function O(S){return S===45||S===46||S===58||S===95||xt(S)?(e.consume(S),O):z(S)}function z(S){return S===61?(e.consume(S),_):Ie(S)?(s=z,Y(S)):_e(S)?(e.consume(S),z):q(S)}function _(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,B):Ie(S)?(s=_,Y(S)):_e(S)?(e.consume(S),_):(e.consume(S),D)}function B(S){return S===i?(e.consume(S),i=void 0,A):S===null?n(S):Ie(S)?(s=B,Y(S)):(e.consume(S),B)}function D(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Ke(S)?q(S):(e.consume(S),D)}function A(S){return S===47||S===62||Ke(S)?q(S):n(S)}function N(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function Y(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),$}function $(S){return _e(S)?ze(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):K(S)}function K(S){return e.enter("htmlTextData"),s(S)}}const al={name:"labelEnd",resolveAll:Tm,resolveTo:Pm,tokenize:Om},Im={tokenize:Mm},Rm={tokenize:Fm},Am={tokenize:Lm};function Tm(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&&_t(e,0,e.length,n),e}function Pm(e,t){let n=e.length,r=0,i,o,s,l;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},a={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",u,t],["enter",a,t]],l=Ut(l,e.slice(o+1,o+r+3)),l=Ut(l,[["enter",f,t]]),l=Ut(l,no(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),l=Ut(l,[["exit",f,t],e[s-2],e[s-1],["exit",a,t]]),l=Ut(l,e.slice(s+1)),l=Ut(l,[["exit",u,t]]),_t(e,o,e.length,l),e}function Om(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Jt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(Im,f,s?f:c)(h):h===91?e.attempt(Rm,f,s?a:c)(h):s?f(h):c(h)}function a(h){return e.attempt(Am,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function Mm(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return Ke(c)?jr(e,o)(c):o(c)}function o(c){return c===41?f(c):oc(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return Ke(c)?jr(e,u)(c):f(c)}function l(c){return n(c)}function u(c){return c===34||c===39||c===40?lc(e,a,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function a(c){return Ke(c)?jr(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Fm(e,t,n){const r=this;return i;function i(l){return sc.call(r,e,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Jt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function Lm(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Dm={name:"labelStartImage",resolveAll:al.resolveAll,tokenize:Vm};function Vm(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Nm={name:"labelStartLink",resolveAll:al.resolveAll,tokenize:_m};function _m(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Ho={name:"lineEnding",tokenize:jm};function jm(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ze(e,t,"linePrefix")}}const Ii={name:"thematicBreak",tokenize:zm};function zm(e,t,n){let r=0,i;return o;function o(a){return e.enter("thematicBreak"),s(a)}function s(a){return i=a,l(a)}function l(a){return a===i?(e.enter("thematicBreakSequence"),u(a)):r>=3&&(a===null||Ie(a))?(e.exit("thematicBreak"),t(a)):n(a)}function u(a){return a===i?(e.consume(a),r++,u):(e.exit("thematicBreakSequence"),_e(a)?ze(e,l,"whitespace")(a):l(a))}}const It={continuation:{tokenize:$m},exit:Wm,name:"list",tokenize:Um},Bm={partial:!0,tokenize:Km},Hm={partial:!0,tokenize:qm};function Um(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(d){const p=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Cs(d)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Ii,n,a)(d):a(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(d)}return n(d)}function u(d){return Cs(d)&&++s<10?(e.consume(d),u):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),a(d)):n(d)}function a(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Jr,r.interrupt?n:f,e.attempt(Bm,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return _e(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function $m(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Jr,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ze(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!_e(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Hm,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ze(e,e.attempt(It,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function qm(e,t,n){const r=this;return ze(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Wm(e){e.exit(this.containerState.type)}function Km(e,t,n){const r=this;return ze(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!_e(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const da={name:"setextUnderline",resolveTo:Gm,tokenize:Ym};function Gm(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Ym(e,t,n){const r=this;let i;return o;function o(a){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=a,s(a)):n(a)}function s(a){return e.enter("setextHeadingLineSequence"),l(a)}function l(a){return a===i?(e.consume(a),l):(e.exit("setextHeadingLineSequence"),_e(a)?ze(e,u,"lineSuffix")(a):u(a))}function u(a){return a===null||Ie(a)?(e.exit("setextHeadingLine"),t(a)):n(a)}}const Xm={tokenize:Qm};function Qm(e){const t=this,n=e.attempt(Jr,r,e.attempt(this.parser.constructs.flowInitial,i,ze(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nm,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Jm={resolveAll:uc()},Zm=ac("string"),eg=ac("text");function ac(e){return{resolveAll:uc(e==="text"?tg:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(f){return a(f)?o(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return a(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function a(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function uc(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function tg(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 o=i.length,s=-1,l=0,u;for(;o--;){const a=i[o];if(typeof a=="string"){for(s=a.length;a.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(a===-2)u=!0,l++;else if(a!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const a={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...a.start},r.start.offset===r.end.offset?Object.assign(r,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}const ng={42:It,43:It,45:It,48:It,49:It,50:It,51:It,52:It,53:It,54:It,55:It,56:It,57:It,62:tc},rg={91:lm},ig={[-2]:Bo,[-1]:Bo,32:Bo},og={35:hm,42:Ii,45:[da,Ii],60:ym,61:da,95:Ii,96:ca,126:ca},sg={38:rc,92:nc},lg={[-5]:Ho,[-4]:Ho,[-3]:Ho,33:Dm,38:rc,42:Ss,60:[Np,Sm],91:Nm,92:[fm,nc],93:al,95:Ss,96:Xp},ag={null:[Ss,Jm]},ug={null:[42,95]},cg={null:[]},fg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ug,contentInitial:rg,disable:cg,document:ng,flow:og,flowInitial:ig,insideSpan:ag,string:sg,text:lg},Symbol.toStringTag,{value:"Module"}));function dg(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={},o=[];let s=[],l=[];const u={attempt:P(E),check:P(C),consume:y,enter:v,exit:k,interrupt:P(C,{interrupt:!0})},a={code:null,containerState:{},defineSkip:x,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(a,u);return t.resolveAll&&o.push(t),a;function c(z){return s=Ut(s,z),w(),s[s.length-1]!==null?[]:(L(t,0),a.events=no(o,a.events,a),a.events)}function h(z,_){return pg(d(z),_)}function d(z){return hg(s,z)}function p(){const{_bufferIndex:z,_index:_,line:B,column:D,offset:A}=r;return{_bufferIndex:z,_index:_,line:B,column:D,offset:A}}function x(z){i[z.line]=z.column,O()}function w(){let z;for(;r._index<s.length;){const _=s[r._index];if(typeof _=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<_.length;)g(_.charCodeAt(r._bufferIndex));else g(_)}}function g(z){f=f(z)}function y(z){Ie(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,O()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),a.previous=z}function v(z,_){const B=_||{};return B.type=z,B.start=p(),a.events.push(["enter",B,a]),l.push(B),B}function k(z){const _=l.pop();return _.end=p(),a.events.push(["exit",_,a]),_}function E(z,_){L(z,_.from)}function C(z,_){_.restore()}function P(z,_){return B;function B(D,A,N){let Y,$,K,S;return Array.isArray(D)?be(D):"tokenize"in D?be([D]):Z(D);function Z(X){return ue;function ue(ie){const we=ie!==null&&X[ie],Q=ie!==null&&X.null,H=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Q)?Q:Q?[Q]:[]];return be(H)(ie)}}function be(X){return Y=X,$=0,X.length===0?N:I(X[$])}function I(X){return ue;function ue(ie){return S=q(),K=X,X.partial||(a.currentConstruct=X),X.name&&a.parser.constructs.disable.null.includes(X.name)?le():X.tokenize.call(_?Object.assign(Object.create(a),_):a,u,fe,le)(ie)}}function fe(X){return z(K,S),A}function le(X){return S.restore(),++$<Y.length?I(Y[$]):N}}}function L(z,_){z.resolveAll&&!o.includes(z)&&o.push(z),z.resolve&&_t(a.events,_,a.events.length-_,z.resolve(a.events.slice(_),a)),z.resolveTo&&(a.events=z.resolveTo(a.events,a))}function q(){const z=p(),_=a.previous,B=a.currentConstruct,D=a.events.length,A=Array.from(l);return{from:D,restore:N};function N(){r=z,a.previous=_,a.currentConstruct=B,a.events.length=D,l=A,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hg(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function pg(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
3
|
+
`;break}case-3:{s=`\r
|
|
4
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function mg(e){const r={constructs:Zu([fg,...(e||{}).extensions||[]]),content:i(Pp),defined:[],document:i(Mp),flow:i(Xm),lazy:{},string:i(Zm),text:i(eg)};return r;function i(o){return s;function s(l){return dg(r,o,l)}}}function gg(e){for(;!ic(e););return e}const ha=/[\0\t\n\r]/g;function yg(){let e=1,t="",n=!0,r;return i;function i(o,s,l){const u=[];let a,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(ha.lastIndex=c,a=ha.exec(o),h=a&&a.index!==void 0?a.index:o.length,d=o.charCodeAt(h),!a){t=o.slice(c);break}if(d===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(o.slice(c,h)),e+=h-c),d){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const xg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bg(e){return e.replace(xg,wg)}function wg(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return ec(n.slice(o?2:1),o?16:10)}return ll(n)||e}const cc={}.hasOwnProperty;function vg(e,t,n){return typeof t!="string"&&(n=t,t=void 0),kg(n)(gg(mg(n).document().write(yg()(e,t,!0))))}function kg(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ye),autolinkProtocol:q,autolinkEmail:q,atxHeading:o(ee),blockQuote:o(Q),characterEscape:q,characterReference:q,codeFenced:o(H),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(H,s),codeText:o(se,s),codeTextData:q,data:q,codeFlowValue:q,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ae),hardBreakEscape:o(G),hardBreakTrailing:o(G),htmlFlow:o(oe,s),htmlFlowData:q,htmlText:o(oe,s),htmlTextData:q,image:o(Ee),label:s,link:o(ye),listItem:o(b),listItemValue:h,listOrdered:o(xe,c),listUnordered:o(xe),paragraph:o(M),reference:I,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ee),strong:o(F),thematicBreak:o(j)},exit:{atxHeading:u(),atxHeadingSequence:E,autolink:u(),autolinkEmail:we,autolinkProtocol:ie,blockQuote:u(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:X,characterReference:ue,codeFenced:u(w),codeFencedFence:x,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:O,codeIndented:u(g),codeText:u(A),codeTextData:O,data:O,definition:u(),definitionDestinationString:k,definitionLabelString:y,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(_),hardBreakTrailing:u(_),htmlFlow:u(B),htmlFlowData:O,htmlText:u(D),htmlTextData:O,image:u(Y),label:K,labelText:$,lineEnding:z,link:u(N),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:fe,resourceDestinationString:S,resourceTitleString:Z,resource:be,setextHeading:u(L),setextHeadingLineSequence:P,setextHeadingText:C,strong:u(),thematicBreak:u()}};fc(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(T){let V={type:"root",children:[]};const W={stack:[V],tokenStack:[],config:t,enter:l,exit:a,buffer:s,resume:f,data:n},J=[];let he=-1;for(;++he<T.length;)if(T[he][1].type==="listOrdered"||T[he][1].type==="listUnordered")if(T[he][0]==="enter")J.push(he);else{const Pe=J.pop();he=i(T,Pe,he)}for(he=-1;++he<T.length;){const Pe=t[T[he][0]];cc.call(Pe,T[he][1].type)&&Pe[T[he][1].type].call(Object.assign({sliceSerialize:T[he][2].sliceSerialize},W),T[he][1])}if(W.tokenStack.length>0){const Pe=W.tokenStack[W.tokenStack.length-1];(Pe[1]||pa).call(W,void 0,Pe[0])}for(V.position={start:yn(T.length>0?T[0][1].start:{line:1,column:1,offset:0}),end:yn(T.length>0?T[T.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)V=t.transforms[he](V)||V;return V}function i(T,V,W){let J=V-1,he=-1,Pe=!1,Oe,ke,de,He;for(;++J<=W;){const Be=T[J];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?he++:he--,He=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(Oe&&!He&&!he&&!de&&(de=J),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!he&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||he===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(Oe){let De=J;for(ke=void 0;De--;){const Me=T[De];if(Me[1].type==="lineEnding"||Me[1].type==="lineEndingBlank"){if(Me[0]==="exit")continue;ke&&(T[ke][1].type="lineEndingBlank",Pe=!0),Me[1].type="lineEnding",ke=De}else if(!(Me[1].type==="linePrefix"||Me[1].type==="blockQuotePrefix"||Me[1].type==="blockQuotePrefixWhitespace"||Me[1].type==="blockQuoteMarker"||Me[1].type==="listItemIndent"))break}de&&(!ke||de<ke)&&(Oe._spread=!0),Oe.end=Object.assign({},ke?T[ke][1].start:Be[1].end),T.splice(ke||J,0,["exit",Oe,Be[2]]),J++,W++}if(Be[1].type==="listItemPrefix"){const De={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};Oe=De,T.splice(J,0,["enter",De,Be[2]]),J++,W++,de=void 0,He=!0}}}return T[V][1]._spread=Pe,W}function o(T,V){return W;function W(J){l.call(this,T(J),J),V&&V.call(this,J)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(T,V,W){this.stack[this.stack.length-1].children.push(T),this.stack.push(T),this.tokenStack.push([V,W||void 0]),T.position={start:yn(V.start),end:void 0}}function u(T){return V;function V(W){T&&T.call(this,W),a.call(this,W)}}function a(T,V){const W=this.stack.pop(),J=this.tokenStack.pop();if(J)J[0].type!==T.type&&(V?V.call(this,T,J[0]):(J[1]||pa).call(this,T,J[0]));else throw new Error("Cannot close `"+T.type+"` ("+_r({start:T.start,end:T.end})+"): it’s not open");W.position.end=yn(T.end)}function f(){return sl(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(T){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(T),10),this.data.expectingFirstListItemValue=void 0}}function d(){const T=this.resume(),V=this.stack[this.stack.length-1];V.lang=T}function p(){const T=this.resume(),V=this.stack[this.stack.length-1];V.meta=T}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const T=this.resume(),V=this.stack[this.stack.length-1];V.value=T.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const T=this.resume(),V=this.stack[this.stack.length-1];V.value=T.replace(/(\r?\n|\r)$/g,"")}function y(T){const V=this.resume(),W=this.stack[this.stack.length-1];W.label=V,W.identifier=Jt(this.sliceSerialize(T)).toLowerCase()}function v(){const T=this.resume(),V=this.stack[this.stack.length-1];V.title=T}function k(){const T=this.resume(),V=this.stack[this.stack.length-1];V.url=T}function E(T){const V=this.stack[this.stack.length-1];if(!V.depth){const W=this.sliceSerialize(T).length;V.depth=W}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function P(T){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(T).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function q(T){const W=this.stack[this.stack.length-1].children;let J=W[W.length-1];(!J||J.type!=="text")&&(J=U(),J.position={start:yn(T.start),end:void 0},W.push(J)),this.stack.push(J)}function O(T){const V=this.stack.pop();V.value+=this.sliceSerialize(T),V.position.end=yn(T.end)}function z(T){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const W=V.children[V.children.length-1];W.position.end=yn(T.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(q.call(this,T),O.call(this,T))}function _(){this.data.atHardBreak=!0}function B(){const T=this.resume(),V=this.stack[this.stack.length-1];V.value=T}function D(){const T=this.resume(),V=this.stack[this.stack.length-1];V.value=T}function A(){const T=this.resume(),V=this.stack[this.stack.length-1];V.value=T}function N(){const T=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=V,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function Y(){const T=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=V,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function $(T){const V=this.sliceSerialize(T),W=this.stack[this.stack.length-2];W.label=bg(V),W.identifier=Jt(V).toLowerCase()}function K(){const T=this.stack[this.stack.length-1],V=this.resume(),W=this.stack[this.stack.length-1];if(this.data.inReference=!0,W.type==="link"){const J=T.children;W.children=J}else W.alt=V}function S(){const T=this.resume(),V=this.stack[this.stack.length-1];V.url=T}function Z(){const T=this.resume(),V=this.stack[this.stack.length-1];V.title=T}function be(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function fe(T){const V=this.resume(),W=this.stack[this.stack.length-1];W.label=V,W.identifier=Jt(this.sliceSerialize(T)).toLowerCase(),this.data.referenceType="full"}function le(T){this.data.characterReferenceType=T.type}function X(T){const V=this.sliceSerialize(T),W=this.data.characterReferenceType;let J;W?(J=ec(V,W==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):J=ll(V);const he=this.stack[this.stack.length-1];he.value+=J}function ue(T){const V=this.stack.pop();V.position.end=yn(T.end)}function ie(T){O.call(this,T);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(T)}function we(T){O.call(this,T);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(T)}function Q(){return{type:"blockquote",children:[]}}function H(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function ee(){return{type:"heading",depth:0,children:[]}}function G(){return{type:"break"}}function oe(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function ye(){return{type:"link",title:null,url:"",children:[]}}function xe(T){return{type:"list",ordered:T.type==="listOrdered",start:null,spread:T._spread,children:[]}}function b(T){return{type:"listItem",spread:T._spread,checked:null,children:[]}}function M(){return{type:"paragraph",children:[]}}function F(){return{type:"strong",children:[]}}function U(){return{type:"text",value:""}}function j(){return{type:"thematicBreak"}}}function yn(e){return{line:e.line,column:e.column,offset:e.offset}}function fc(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?fc(e,r):Cg(e,r)}}function Cg(e,t){let n;for(n in t)if(cc.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 pa(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+") is still open")}function Sg(e){const t=this;t.parser=n;function n(r){return vg(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Eg(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 Ig(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
5
|
+
`}]}function Rg(e,t){const n=t.value?t.value+`
|
|
6
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Ag(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tg(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pg(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Cr(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const a={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,a),e.applyData(t,a)}function Og(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 Mg(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function dc(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Fg(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dc(e,t);const i={src:Cr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Lg(e,t){const n={src:Cr(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 Dg(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 Vg(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dc(e,t);const i={href:Cr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Ng(e,t){const n={href:Cr(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 _g(e,t,n){const r=e.all(t),i=n?jg(n):hc(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(i||l!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
7
|
+
`}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
8
|
+
`});const a={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,a),e.applyData(t,a)}function jg(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=hc(n[r])}return t}function hc(e){const t=e.spread;return t??e.children.length>1}function zg(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function Bg(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hg(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ug(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $g(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=nl(t.children[1]),u=Wu(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function qg(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let u=-1;const a=[];for(;++u<l;){const c=t.children[u],h={},d=s?s[u]:void 0;d&&(h.align=d);let p={type:"element",tagName:o,properties:h,children:[]};c&&(p.children=e.all(c),e.patch(c,p),p=e.applyData(c,p)),a.push(p)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(a,!0)};return e.patch(t,f),e.applyData(t,f)}function Wg(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ma=9,ga=32;function Kg(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(ya(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(ya(t.slice(i),i>0,!1)),o.join("")}function ya(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===ma||o===ga;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===ma||o===ga;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Gg(e,t){const n={type:"text",value:Kg(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yg(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Xg={blockquote:Eg,break:Ig,code:Rg,delete:Ag,emphasis:Tg,footnoteReference:Pg,heading:Og,html:Mg,imageReference:Fg,image:Lg,inlineCode:Dg,linkReference:Vg,link:Ng,listItem:_g,list:zg,paragraph:Bg,root:Hg,strong:Ug,table:$g,tableCell:Wg,tableRow:qg,text:Gg,thematicBreak:Yg,toml:di,yaml:di,definition:di,footnoteDefinition:di};function di(){}const pc=-1,ro=0,zr=1,Fi=2,ul=3,cl=4,fl=5,dl=6,mc=7,gc=8,xa=typeof self=="object"?self:globalThis,Qg=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case ro:case pc:return n(s,i);case zr:{const l=n([],i);for(const u of s)l.push(r(u));return l}case Fi:{const l=n({},i);for(const[u,a]of s)l[r(u)]=r(a);return l}case ul:return n(new Date(s),i);case cl:{const{source:l,flags:u}=s;return n(new RegExp(l,u),i)}case fl:{const l=n(new Map,i);for(const[u,a]of s)l.set(r(u),r(a));return l}case dl:{const l=n(new Set,i);for(const u of s)l.add(r(u));return l}case mc:{const{name:l,message:u}=s;return n(new xa[l](u),i)}case gc:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(new xa[o](s),i)};return r},ba=e=>Qg(new Map,e)(0),nr="",{toString:Jg}={},{keys:Zg}=Object,Fr=e=>{const t=typeof e;if(t!=="object"||!e)return[ro,t];const n=Jg.call(e).slice(8,-1);switch(n){case"Array":return[zr,nr];case"Object":return[Fi,nr];case"Date":return[ul,nr];case"RegExp":return[cl,nr];case"Map":return[fl,nr];case"Set":return[dl,nr];case"DataView":return[zr,n]}return n.includes("Array")?[zr,n]:n.includes("Error")?[mc,n]:[Fi,n]},hi=([e,t])=>e===ro&&(t==="function"||t==="symbol"),ey=(e,t,n,r)=>{const i=(s,l)=>{const u=r.push(s)-1;return n.set(l,u),u},o=s=>{if(n.has(s))return n.get(s);let[l,u]=Fr(s);switch(l){case ro:{let f=s;switch(u){case"bigint":l=gc,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([pc],s)}return i([l,f],s)}case zr:{if(u){let h=s;return u==="DataView"?h=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(s)),i([u,[...h]],s)}const f=[],c=i([l,f],s);for(const h of s)f.push(o(h));return c}case Fi:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([l,f],s);for(const h of Zg(s))(e||!hi(Fr(s[h])))&&f.push([o(h),o(s[h])]);return c}case ul:return i([l,s.toISOString()],s);case cl:{const{source:f,flags:c}=s;return i([l,{source:f,flags:c}],s)}case fl:{const f=[],c=i([l,f],s);for(const[h,d]of s)(e||!(hi(Fr(h))||hi(Fr(d))))&&f.push([o(h),o(d)]);return c}case dl:{const f=[],c=i([l,f],s);for(const h of s)(e||!hi(Fr(h)))&&f.push(o(h));return c}}const{message:a}=s;return i([l,{name:u,message:a}],s)};return o},wa=(e,{json:t,lossy:n}={})=>{const r=[];return ey(!(t||n),!!t,new Map,r)(e),r},Li=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ba(wa(e,t)):structuredClone(e):(e,t)=>ba(wa(e,t));function ty(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 ny(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ry(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ty,r=e.options.footnoteBackLabel||ny,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const a=e.footnoteById.get(e.footnoteOrder[u]);if(!a)continue;const f=e.all(a),c=String(a.identifier).toUpperCase(),h=Cr(c.toLowerCase());let d=0;const p=[],x=e.footnoteCounts.get(c);for(;x!==void 0&&++d<=x;){p.length>0&&p.push({type:"text",value:" "});let y=typeof n=="string"?n:n(u,d);typeof y=="string"&&(y={type:"text",value:y}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,d),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const w=f[f.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const y=w.children[w.children.length-1];y&&y.type==="text"?y.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...p)}else f.push(...p);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(a,g),l.push(g)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Li(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
9
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
10
|
+
`}]}}const io=(function(e){if(e==null)return ly;if(typeof e=="function")return oo(e);if(typeof e=="object")return Array.isArray(e)?iy(e):oy(e);if(typeof e=="string")return sy(e);throw new Error("Expected function, string, or object as test")});function iy(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=io(e[n]);return oo(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function oy(e){const t=e;return oo(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function sy(e){return oo(t);function t(n){return n&&n.type===e}}function oo(e){return t;function t(n,r,i){return!!(ay(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ly(){return!0}function ay(e){return e!==null&&typeof e=="object"&&"type"in e}const yc=[],uy=!0,Es=!1,cy="skip";function xc(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=io(i),s=r?-1:1;l(e,void 0,[])();function l(u,a,f){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=yc,p,x,w;if((!t||o(u,a,f[f.length-1]||void 0))&&(d=fy(n(u,f)),d[0]===Es))return d;if("children"in u&&u.children){const g=u;if(g.children&&d[0]!==cy)for(x=(r?g.children.length:-1)+s,w=f.concat(g);x>-1&&x<g.children.length;){const y=g.children[x];if(p=l(y,x,w)(),p[0]===Es)return p;x=typeof p[1]=="number"?p[1]:x+s}}return d}}}function fy(e){return Array.isArray(e)?e:typeof e=="number"?[uy,e]:e==null?yc:[e]}function hl(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),xc(e,o,l,i);function l(u,a){const f=a[a.length-1],c=f?f.children.indexOf(u):void 0;return s(u,c,f)}}const Is={}.hasOwnProperty,dy={};function hy(e,t){const n=t||dy,r=new Map,i=new Map,o=new Map,s={...Xg,...n.handlers},l={all:a,applyData:my,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:py,wrap:yy};return hl(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),l;function u(f,c){const h=f.type,d=l.handlers[h];if(Is.call(l.handlers,h)&&d)return d(l,f,c);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in f){const{children:x,...w}=f,g=Li(w);return g.children=l.all(f),g}return Li(f)}return(l.options.unknownHandler||gy)(l,f,c)}function a(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const p=l.one(h[d],f);if(p){if(d&&h[d-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=va(p.value)),!Array.isArray(p)&&p.type==="element")){const x=p.children[0];x&&x.type==="text"&&(x.value=va(x.value))}Array.isArray(p)?c.push(...p):c.push(p)}}}return c}}function py(e,t){e.position&&(t.position=np(e))}function my(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Li(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function gy(e,t){const n=t.data||{},r="value"in t&&!(Is.call(n,"hProperties")||Is.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 yy(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
11
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
12
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
13
|
+
`}),n}function va(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ka(e,t){const n=hy(e,t),r=n.one(e,void 0),i=ry(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
14
|
+
`},i),o}function xy(e,t){return e&&"run"in e?async function(n,r){const i=ka(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ka(n,{file:r,...e||t})}}function Ca(e){if(e)throw e}var Uo,Sa;function by(){if(Sa)return Uo;Sa=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(a){return typeof Array.isArray=="function"?Array.isArray(a):t.call(a)==="[object Array]"},o=function(a){if(!a||t.call(a)!=="[object Object]")return!1;var f=e.call(a,"constructor"),c=a.constructor&&a.constructor.prototype&&e.call(a.constructor.prototype,"isPrototypeOf");if(a.constructor&&!f&&!c)return!1;var h;for(h in a);return typeof h>"u"||e.call(a,h)},s=function(a,f){n&&f.name==="__proto__"?n(a,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):a[f.name]=f.newValue},l=function(a,f){if(f==="__proto__")if(e.call(a,f)){if(r)return r(a,f).value}else return;return a[f]};return Uo=function u(){var a,f,c,h,d,p,x=arguments[0],w=1,g=arguments.length,y=!1;for(typeof x=="boolean"&&(y=x,x=arguments[1]||{},w=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});w<g;++w)if(a=arguments[w],a!=null)for(f in a)c=l(x,f),h=l(a,f),x!==h&&(y&&h&&(o(h)||(d=i(h)))?(d?(d=!1,p=c&&i(c)?c:[]):p=c&&o(c)?c:{},s(x,{name:f,newValue:u(y,p,h)})):typeof h<"u"&&s(x,{name:f,newValue:h}));return x},Uo}var wy=by();const $o=Fu(wy);function Rs(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 vy(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(u,...a){const f=e[++o];let c=-1;if(u){s(u);return}for(;++c<i.length;)(a[c]===null||a[c]===void 0)&&(a[c]=i[c]);i=a,f?ky(f,l)(...a):s(null,...a)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function ky(e,t){let n;return r;function r(...s){const l=e.length>s.length;let u;l&&s.push(i);try{u=e.apply(this,s)}catch(a){const f=a;if(l&&n)throw f;return i(f)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const tn={basename:Cy,dirname:Sy,extname:Ey,join:Iy,sep:"/"};function Cy(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Sy(e){if(Zr(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 Ey(e){Zr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Iy(...e){let t=-1,n;for(;++t<e.length;)Zr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ry(n)}function Ry(e){Zr(e);const t=e.codePointAt(0)===47;let n=Ay(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ay(e,t){let n="",r=0,i=-1,o=0,s=-1,l,u;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return n}function Zr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ty={cwd:Py};function Py(){return"/"}function As(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Oy(e){if(typeof e=="string")e=new URL(e);else if(!As(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 My(e)}function My(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 qo=["history","path","basename","stem","extname","dirname"];class bc{constructor(t){let n;t?As(t)?n={path:t}:typeof t=="string"||Fy(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ty.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qo.length;){const o=qo[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)qo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?tn.basename(this.path):void 0}set basename(t){Ko(t,"basename"),Wo(t,"basename"),this.path=tn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?tn.dirname(this.path):void 0}set dirname(t){Ea(this.basename,"dirname"),this.path=tn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?tn.extname(this.path):void 0}set extname(t){if(Wo(t,"extname"),Ea(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=tn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){As(t)&&(t=Oy(t)),Ko(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?tn.basename(this.path,this.extname):void 0}set stem(t){Ko(t,"stem"),Wo(t,"stem"),this.path=tn.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 bt(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 Wo(e,t){if(e&&e.includes(tn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+tn.sep+"`")}function Ko(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ea(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Fy(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ly=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),Dy={}.hasOwnProperty;class pl extends Ly{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=vy()}copy(){const t=new pl;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($o(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xo("data",this.frozen),this.namespace[t]=n,this):Dy.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xo("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=pi(t),r=this.parser||this.Parser;return Go("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Go("process",this.parser||this.Parser),Yo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const l=pi(t),u=r.parse(l);r.run(u,l,function(f,c,h){if(f||!c||!h)return a(f);const d=c,p=r.stringify(d,h);_y(p)?h.value=p:h.result=p,a(f,h)});function a(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),Go("processSync",this.parser||this.Parser),Yo("processSync",this.compiler||this.Compiler),this.process(t,i),Ra("processSync","process",n),r;function i(o,s){n=!0,Ca(o),r=s}}run(t,n,r){Ia(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,l){const u=pi(n);i.run(t,u,a);function a(f,c,h){const d=c||t;f?l(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Ra("runSync","run",r),i;function o(s,l){Ca(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=pi(n),i=this.compiler||this.Compiler;return Yo("stringify",i),Ia(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Xo("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(a){if(typeof a=="function")u(a,[]);else if(typeof a=="object")if(Array.isArray(a)){const[f,...c]=a;u(f,c)}else s(a);else throw new TypeError("Expected usable value, not `"+a+"`")}function s(a){if(!("plugins"in a)&&!("settings"in a))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");l(a.plugins),a.settings&&(i.settings=$o(!0,i.settings,a.settings))}function l(a){let f=-1;if(a!=null)if(Array.isArray(a))for(;++f<a.length;){const c=a[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+a+"`")}function u(a,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===a){h=c;break}if(h===-1)r.push([a,...f]);else if(f.length>0){let[d,...p]=f;const x=r[h][1];Rs(x)&&Rs(d)&&(d=$o(!0,x,d)),r[h]=[a,d,...p]}}}}const Vy=new pl().freeze();function Go(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Yo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xo(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 Ia(e){if(!Rs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ra(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function pi(e){return Ny(e)?e:new bc(e)}function Ny(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _y(e){return typeof e=="string"||jy(e)}function jy(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zy="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Aa=[],Ta={allowDangerousHtml:!0},By=/^(https?|ircs?|mailto|xmpp)$/i,Hy=[{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 Uy(e){const t=$y(e),n=qy(e);return Wy(t.runSync(t.parse(n),n),e)}function $y(e){const t=e.rehypePlugins||Aa,n=e.remarkPlugins||Aa,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ta}:Ta;return Vy().use(Sg).use(n).use(xy,r).use(t)}function qy(e){const t=e.children||"",n=new bc;return typeof t=="string"&&(n.value=t),n}function Wy(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Ky;for(const f of Hy)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+zy+f.id,void 0);return hl(e,a),lp(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function a(f,c,h){if(f.type==="raw"&&h&&typeof c=="number")return s?h.children.splice(c,1):h.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let d;for(d in zo)if(Object.hasOwn(zo,d)&&Object.hasOwn(f.properties,d)){const p=f.properties[d],x=zo[d];(x===null||x.includes(f.tagName))&&(f.properties[d]=u(String(p||""),d,f))}}if(f.type==="element"){let d=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!d&&r&&typeof c=="number"&&(d=!r(f,c,h)),d&&h&&typeof c=="number")return l&&f.children?h.children.splice(c,1,...f.children):h.children.splice(c,1),c}}}function Ky(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||By.test(e.slice(0,t))?e:""}function Pa(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 Gy(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yy(e,t,n){const i=io((n||{}).ignore||[]),o=Xy(t);let s=-1;for(;++s<o.length;)xc(e,"text",l);function l(a,f){let c=-1,h;for(;++c<f.length;){const d=f[c],p=h?h.children:void 0;if(i(d,p?p.indexOf(d):void 0,h))return;h=d}if(h)return u(a,f)}function u(a,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let p=0;const w=c.children.indexOf(a);let g=!1,y=[];h.lastIndex=0;let v=h.exec(a.value);for(;v;){const k=v.index,E={index:v.index,input:v.input,stack:[...f,a]};let C=d(...v,E);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=k+1:(p!==k&&y.push({type:"text",value:a.value.slice(p,k)}),Array.isArray(C)?y.push(...C):C&&y.push(C),p=k+v[0].length,g=!0),!h.global)break;v=h.exec(a.value)}return g?(p<a.value.length&&y.push({type:"text",value:a.value.slice(p)}),c.children.splice(w,1,...y)):y=[a],w+y.length}}function Xy(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([Qy(i[0]),Jy(i[1])])}return t}function Qy(e){return typeof e=="string"?new RegExp(Gy(e),"g"):e}function Jy(e){return typeof e=="function"?e:function(){return e}}const Qo="phrasing",Jo=["autolink","link","image","label"];function Zy(){return{transforms:[sx],enter:{literalAutolink:tx,literalAutolinkEmail:Zo,literalAutolinkHttp:Zo,literalAutolinkWww:Zo},exit:{literalAutolink:ox,literalAutolinkEmail:ix,literalAutolinkHttp:nx,literalAutolinkWww:rx}}}function ex(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qo,notInConstruct:Jo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qo,notInConstruct:Jo},{character:":",before:"[ps]",after:"\\/",inConstruct:Qo,notInConstruct:Jo}]}}function tx(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Zo(e){this.config.enter.autolinkProtocol.call(this,e)}function nx(e){this.config.exit.autolinkProtocol.call(this,e)}function rx(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 ix(e){this.config.exit.autolinkEmail.call(this,e)}function ox(e){this.exit(e)}function sx(e){Yy(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ax]],{ignore:["link","linkReference"]})}function lx(e,t,n,r,i){let o="";if(!wc(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!ux(n)))return!1;const s=cx(n+r);if(!s[0])return!1;const l={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function ax(e,t,n,r){return!wc(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ux(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 cx(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=Pa(e,"(");let o=Pa(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function wc(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Kn(n)||to(n))&&(!t||n!==47)}vc.peek=bx;function fx(){this.buffer()}function dx(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hx(){this.buffer()}function px(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mx(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gx(e){this.exit(e)}function yx(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xx(e){this.exit(e)}function bx(){return"["}function vc(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),l=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),l(),s(),o+=i.move("]"),o}function wx(){return{enter:{gfmFootnoteCallString:fx,gfmFootnoteCall:dx,gfmFootnoteDefinitionLabelString:hx,gfmFootnoteDefinition:px},exit:{gfmFootnoteCallString:mx,gfmFootnoteCall:gx,gfmFootnoteDefinitionLabelString:yx,gfmFootnoteDefinition:xx}}}function vx(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:vc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const l=o.createTracker(s);let u=l.move("[^");const a=o.enter("footnoteDefinition"),f=o.enter("label");return u+=l.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?`
|
|
15
|
+
`:" ")+o.indentLines(o.containerFlow(r,l.current()),t?kc:kx))),a(),u}}function kx(e,t,n){return t===0?e:kc(e,t,n)}function kc(e,t,n){return(n?"":" ")+e}const Cx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Cc.peek=Ax;function Sx(){return{canContainEols:["delete"],enter:{strikethrough:Ix},exit:{strikethrough:Rx}}}function Ex(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Cx}],handlers:{delete:Cc}}}function Ix(e){this.enter({type:"delete",children:[]},e)}function Rx(e){this.exit(e)}function Cc(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function Ax(){return"~"}function Tx(e){return e.length}function Px(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Tx,o=[],s=[],l=[],u=[];let a=0,f=-1;for(;++f<e.length;){const x=[],w=[];let g=-1;for(e[f].length>a&&(a=e[f].length);++g<e[f].length;){const y=Ox(e[f][g]);if(n.alignDelimiters!==!1){const v=i(y);w[g]=v,(u[g]===void 0||v>u[g])&&(u[g]=v)}x.push(y)}s[f]=x,l[f]=w}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<a;)o[c]=Oa(r[c]);else{const x=Oa(r);for(;++c<a;)o[c]=x}c=-1;const h=[],d=[];for(;++c<a;){const x=o[c];let w="",g="";x===99?(w=":",g=":"):x===108?w=":":x===114&&(g=":");let y=n.alignDelimiters===!1?1:Math.max(1,u[c]-w.length-g.length);const v=w+"-".repeat(y)+g;n.alignDelimiters!==!1&&(y=w.length+y+g.length,y>u[c]&&(u[c]=y),d[c]=y),h[c]=v}s.splice(1,0,h),l.splice(1,0,d),f=-1;const p=[];for(;++f<s.length;){const x=s[f],w=l[f];c=-1;const g=[];for(;++c<a;){const y=x[c]||"";let v="",k="";if(n.alignDelimiters!==!1){const E=u[c]-(w[c]||0),C=o[c];C===114?v=" ".repeat(E):C===99?E%2?(v=" ".repeat(E/2+.5),k=" ".repeat(E/2-.5)):(v=" ".repeat(E/2),k=v):k=" ".repeat(E)}n.delimiterStart!==!1&&!c&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||c)&&g.push(" "),n.alignDelimiters!==!1&&g.push(v),g.push(y),n.alignDelimiters!==!1&&g.push(k),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||c!==a-1)&&g.push("|")}p.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return p.join(`
|
|
16
|
+
`)}function Ox(e){return e==null?"":String(e)}function Oa(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 Mx(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),Fx);return i(),s}function Fx(e,t,n){return">"+(n?"":" ")+e}function Lx(e,t){return Ma(e,t.inConstruct,!0)&&!Ma(e,t.notInConstruct,!1)}function Ma(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 Fa(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
17
|
+
`&&Lx(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
18
|
+
`}function Dx(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function Vx(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 Nx(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 _x(e,t,n,r){const i=Nx(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(Vx(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,jx);return c(),h}const l=n.createTracker(r),u=i.repeat(Math.max(Dx(o,i)+1,3)),a=n.enter("codeFenced");let f=l.move(u);if(e.lang){const c=n.enter(`codeFencedLang${s}`);f+=l.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...l.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);f+=l.move(" "),f+=l.move(n.safe(e.meta,{before:f,after:`
|
|
19
|
+
`,encode:["`"],...l.current()})),c()}return f+=l.move(`
|
|
20
|
+
`),o&&(f+=l.move(o+`
|
|
21
|
+
`)),f+=l.move(u),a(),f}function jx(e,t,n){return(n?"":" ")+e}function ml(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 zx(e,t,n,r){const i=ml(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let a=u.move("[");return a+=u.move(n.safe(n.associationId(e),{before:a,after:"]",...u.current()})),a+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),a+=u.move("<"),a+=u.move(n.safe(e.url,{before:a,after:">",...u.current()})),a+=u.move(">")):(l=n.enter("destinationRaw"),a+=u.move(n.safe(e.url,{before:a,after:e.title?" ":`
|
|
22
|
+
`,...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),a+=u.move(" "+i),a+=u.move(n.safe(e.title,{before:a,after:i,...u.current()})),a+=u.move(i),l()),s(),a}function Bx(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 Gr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Di(e,t,n){const r=gr(e),i=gr(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}}Sc.peek=Hx;function Sc(e,t,n,r){const i=Bx(n),o=n.enter("emphasis"),s=n.createTracker(r),l=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const a=u.charCodeAt(0),f=Di(r.before.charCodeAt(r.before.length-1),a,i);f.inside&&(u=Gr(a)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Di(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Gr(c));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+u+d}function Hx(e,t,n){return n.options.emphasis||"*"}function Ux(e,t){let n=!1;return hl(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Es}),!!((!e.depth||e.depth<3)&&sl(e)&&(t.options.setext||n))}function $x(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Ux(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
23
|
+
`,after:`
|
|
24
|
+
`});return c(),f(),h+`
|
|
25
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
26
|
+
`))+1))}const s="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let a=n.containerPhrasing(e,{before:"# ",after:`
|
|
27
|
+
`,...o.current()});return/^[\t ]/.test(a)&&(a=Gr(a.charCodeAt(0))+a.slice(1)),a=a?s+" "+a:s,n.options.closeAtx&&(a+=" "+s),u(),l(),a}Ec.peek=qx;function Ec(e){return e.value||""}function qx(){return"<"}Ic.peek=Wx;function Ic(e,t,n,r){const i=ml(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let a=u.move("![");return a+=u.move(n.safe(e.alt,{before:a,after:"]",...u.current()})),a+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),a+=u.move("<"),a+=u.move(n.safe(e.url,{before:a,after:">",...u.current()})),a+=u.move(">")):(l=n.enter("destinationRaw"),a+=u.move(n.safe(e.url,{before:a,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),a+=u.move(" "+i),a+=u.move(n.safe(e.title,{before:a,after:i,...u.current()})),a+=u.move(i),l()),a+=u.move(")"),s(),a}function Wx(){return"!"}Rc.peek=Kx;function Rc(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const a=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(a+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!a||a!==c?u+=l.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Kx(){return"!"}Ac.peek=Gx;function Ac(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const s=n.unsafe[o],l=n.compilePattern(s);let u;if(s.atBreak)for(;u=l.exec(r);){let a=u.index;r.charCodeAt(a)===10&&r.charCodeAt(a-1)===13&&a--,r=r.slice(0,a)+" "+r.slice(u.index+1)}}return i+r+i}function Gx(){return"`"}function Tc(e,t){const n=sl(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))}Pc.peek=Yx;function Pc(e,t,n,r){const i=ml(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let l,u;if(Tc(e,n)){const f=n.stack;n.stack=[],l=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),l(),n.stack=f,c}l=n.enter("link"),u=n.enter("label");let a=s.move("[");return a+=s.move(n.containerPhrasing(e,{before:a,after:"](",...s.current()})),a+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),a+=s.move("<"),a+=s.move(n.safe(e.url,{before:a,after:">",...s.current()})),a+=s.move(">")):(u=n.enter("destinationRaw"),a+=s.move(n.safe(e.url,{before:a,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),a+=s.move(" "+i),a+=s.move(n.safe(e.title,{before:a,after:i,...s.current()})),a+=s.move(i),u()),a+=s.move(")"),l(),a}function Yx(e,t,n){return Tc(e,n)?"<":"["}Oc.peek=Xx;function Oc(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const a=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(a+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!a||a!==c?u+=l.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Xx(){return"["}function gl(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 Qx(e){const t=gl(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 Jx(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 Mc(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 Zx(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?Jx(n):gl(n);const l=e.ordered?s==="."?")":".":Qx(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.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&&(u=!0),Mc(n)===s&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=l),n.bulletCurrent=s;const a=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),a}function eb(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 tb(e,t,n,r){const i=eb(n);let o=n.bulletCurrent||gl(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const l=n.createTracker(r);l.move(o+" ".repeat(s-o.length)),l.shift(s);const u=n.enter("listItem"),a=n.indentLines(n.containerFlow(e,l.current()),f);return u(),a;function f(c,h,d){return h?(d?"":" ".repeat(s))+c:(d?o:o+" ".repeat(s-o.length))+c}}function nb(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const rb=io(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ib(e,t,n,r){return(e.children.some(function(s){return rb(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ob(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Fc.peek=sb;function Fc(e,t,n,r){const i=ob(n),o=n.enter("strong"),s=n.createTracker(r),l=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const a=u.charCodeAt(0),f=Di(r.before.charCodeAt(r.before.length-1),a,i);f.inside&&(u=Gr(a)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Di(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Gr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+u+d}function sb(e,t,n){return n.options.strong||"*"}function lb(e,t,n,r){return n.safe(e.value,r)}function ab(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 ub(e,t,n){const r=(Mc(n)+(n.options.ruleSpaces?" ":"")).repeat(ab(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Lc={blockquote:Mx,break:Fa,code:_x,definition:zx,emphasis:Sc,hardBreak:Fa,heading:$x,html:Ec,image:Ic,imageReference:Rc,inlineCode:Ac,link:Pc,linkReference:Oc,list:Zx,listItem:tb,paragraph:nb,root:ib,strong:Fc,text:lb,thematicBreak:ub};function cb(){return{enter:{table:fb,tableData:La,tableHeader:La,tableRow:hb},exit:{codeText:pb,table:db,tableData:es,tableHeader:es,tableRow:es}}}function fb(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 db(e){this.exit(e),this.data.inTable=void 0}function hb(e){this.enter({type:"tableRow",children:[]},e)}function es(e){this.exit(e)}function La(e){this.enter({type:"tableCell",children:[]},e)}function pb(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,mb));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function mb(e,t){return t==="|"?t:e}function gb(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
28
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:u,tableRow:l}};function s(d,p,x,w){return a(f(d,x,w),d.align)}function l(d,p,x,w){const g=c(d,x,w),y=a([g]);return y.slice(0,y.indexOf(`
|
|
29
|
+
`))}function u(d,p,x,w){const g=x.enter("tableCell"),y=x.enter("phrasing"),v=x.containerPhrasing(d,{...w,before:o,after:o});return y(),g(),v}function a(d,p){return Px(d,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function f(d,p,x){const w=d.children;let g=-1;const y=[],v=p.enter("table");for(;++g<w.length;)y[g]=c(w[g],p,x);return v(),y}function c(d,p,x){const w=d.children;let g=-1;const y=[],v=p.enter("tableRow");for(;++g<w.length;)y[g]=u(w[g],d,p,x);return v(),y}function h(d,p,x){let w=Lc.inlineCode(d,p,x);return x.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function yb(){return{exit:{taskListCheckValueChecked:Da,taskListCheckValueUnchecked:Da,paragraph:bb}}}function xb(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wb}}}function Da(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function bb(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 o=-1,s;for(;++o<i.length;){const l=i[o];if(l.type==="paragraph"){s=l;break}}s===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 wb(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);o&&l.move(s);let u=Lc.listItem(e,t,n,{...r,...l.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,a)),u;function a(f){return f+s}}function vb(){return[Zy(),wx(),Sx(),cb(),yb()]}function kb(e){return{extensions:[ex(),vx(e),Ex(),gb(e),xb()]}}const Cb={tokenize:Tb,partial:!0},Dc={tokenize:Pb,partial:!0},Vc={tokenize:Ob,partial:!0},Nc={tokenize:Mb,partial:!0},Sb={tokenize:Fb,partial:!0},_c={name:"wwwAutolink",tokenize:Rb,previous:zc},jc={name:"protocolAutolink",tokenize:Ab,previous:Bc},mn={name:"emailAutolink",tokenize:Ib,previous:Hc},on={};function Eb(){return{text:on}}let _n=48;for(;_n<123;)on[_n]=mn,_n++,_n===58?_n=65:_n===91&&(_n=97);on[43]=mn;on[45]=mn;on[46]=mn;on[95]=mn;on[72]=[mn,jc];on[104]=[mn,jc];on[87]=[mn,_c];on[119]=[mn,_c];function Ib(e,t,n){const r=this;let i,o;return s;function s(c){return!Ts(c)||!Hc.call(r,r.previous)||yl(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(c))}function l(c){return Ts(c)?(e.consume(c),l):c===64?(e.consume(c),u):n(c)}function u(c){return c===46?e.check(Sb,f,a)(c):c===45||c===95||xt(c)?(o=!0,e.consume(c),u):f(c)}function a(c){return e.consume(c),i=!0,u}function f(c){return o&&i&&St(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Rb(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!zc.call(r,r.previous)||yl(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Cb,e.attempt(Dc,e.attempt(Vc,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Ab(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&Bc.call(r,r.previous)&&!yl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),l):n(c)}function l(c){if(St(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),l;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),u}return n(c)}function u(c){return c===47?(e.consume(c),o?a:(o=!0,u)):n(c)}function a(c){return c===null||Mi(c)||Ke(c)||Kn(c)||to(c)?n(c):e.attempt(Dc,e.attempt(Vc,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Tb(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function Pb(e,t,n){let r,i,o;return s;function s(a){return a===46||a===95?e.check(Nc,u,l)(a):a===null||Ke(a)||Kn(a)||a!==45&&to(a)?u(a):(o=!0,e.consume(a),s)}function l(a){return a===95?r=!0:(i=r,r=void 0),e.consume(a),s}function u(a){return i||r||!o?n(a):t(a)}}function Ob(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Nc,t,o)(s):s===null||Ke(s)||Kn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function Mb(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),o):l===93?(e.consume(l),i):l===60||l===null||Ke(l)||Kn(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||Ke(l)||Kn(l)?t(l):r(l)}function o(l){return St(l)?s(l):n(l)}function s(l){return l===59?(e.consume(l),r):St(l)?(e.consume(l),s):n(l)}}function Fb(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return xt(o)?n(o):t(o)}}function zc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ke(e)}function Bc(e){return!St(e)}function Hc(e){return!(e===47||Ts(e))}function Ts(e){return e===43||e===45||e===46||e===95||xt(e)}function yl(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 Lb={tokenize:Hb,partial:!0};function Db(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jb,continuation:{tokenize:zb},exit:Bb}},text:{91:{name:"gfmFootnoteCall",tokenize:_b},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Vb,resolveTo:Nb}}}}function Vb(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!s||!s._balanced)return n(u);const a=Jt(r.sliceSerialize({start:s.end,end:r.now()}));return a.codePointAt(0)!==94||!o.includes(a.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Nb(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function _b(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return l;function l(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(c){if(o>999||c===93&&!s||c===null||c===91||Ke(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Jt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return Ke(c)||(s=!0),o++,e.consume(c),c===92?f:a}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,a):a(c)}}function jb(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,l;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),a}function a(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(p)}function f(p){if(s>999||p===93&&!l||p===null||p===91||Ke(p))return n(p);if(p===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Jt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ke(p)||(l=!0),s++,e.consume(p),p===92?c:f}function c(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),ze(e,d,"gfmFootnoteDefinitionWhitespace")):n(p)}function d(p){return t(p)}}function zb(e,t,n){return e.check(Jr,t,e.attempt(Lb,t,n))}function Bb(e){e.exit("gfmFootnoteDefinition")}function Hb(e,t,n){const r=this;return ze(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function Ub(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,l){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let a=u;for(;a--;)if(s[a][0]==="exit"&&s[a][1].type==="strikethroughSequenceTemporary"&&s[a][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[a][1].end.offset-s[a][1].start.offset){s[u][1].type="strikethroughSequence",s[a][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[a][1].start),end:Object.assign({},s[u][1].end)},c={type:"strikethroughText",start:Object.assign({},s[a][1].end),end:Object.assign({},s[u][1].start)},h=[["enter",f,l],["enter",s[a][1],l],["exit",s[a][1],l],["enter",c,l]],d=l.parser.constructs.insideSpan.null;d&&_t(h,h.length,0,no(d,s.slice(a+1,u),l)),_t(h,h.length,0,[["exit",c,l],["enter",s[u][1],l],["exit",s[u][1],l],["exit",f,l]]),_t(s,a-1,u-a+3,h),u=a+h.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,l,u){const a=this.previous,f=this.events;let c=0;return h;function h(p){return a===126&&f[f.length-1][1].type!=="characterEscape"?u(p):(s.enter("strikethroughSequenceTemporary"),d(p))}function d(p){const x=gr(a);if(p===126)return c>1?u(p):(s.consume(p),c++,d);if(c<2&&!n)return u(p);const w=s.exit("strikethroughSequenceTemporary"),g=gr(p);return w._open=!g||g===2&&!!x,w._close=!x||x===2&&!!g,l(p)}}}class $b{constructor(){this.map=[]}add(t,n,r){qb(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[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 o of i)t.push(o);i=r.pop()}this.map.length=0}}function qb(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 Wb(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 o=r.length-1;r[o]=r[o]==="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 Kb(){return{flow:{null:{name:"table",tokenize:Gb,resolveAll:Yb}}}}function Gb(e,t,n){const r=this;let i=0,o=0,s;return l;function l(O){let z=r.events.length-1;for(;z>-1;){const D=r.events[z][1].type;if(D==="lineEnding"||D==="linePrefix")z--;else break}const _=z>-1?r.events[z][1].type:null,B=_==="tableHead"||_==="tableRow"?C:u;return B===C&&r.parser.lazy[r.now().line]?n(O):B(O)}function u(O){return e.enter("tableHead"),e.enter("tableRow"),a(O)}function a(O){return O===124||(s=!0,o+=1),f(O)}function f(O){return O===null?n(O):Ie(O)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),d):n(O):_e(O)?ze(e,f,"whitespace")(O):(o+=1,s&&(s=!1,i+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(O)))}function c(O){return O===null||O===124||Ke(O)?(e.exit("data"),f(O)):(e.consume(O),O===92?h:c)}function h(O){return O===92||O===124?(e.consume(O),c):c(O)}function d(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),s=!1,_e(O)?ze(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):p(O))}function p(O){return O===45||O===58?w(O):O===124?(s=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),x):E(O)}function x(O){return _e(O)?ze(e,w,"whitespace")(O):w(O)}function w(O){return O===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),g):O===45?(o+=1,g(O)):O===null||Ie(O)?k(O):E(O)}function g(O){return O===45?(e.enter("tableDelimiterFiller"),y(O)):E(O)}function y(O){return O===45?(e.consume(O),y):O===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(O))}function v(O){return _e(O)?ze(e,k,"whitespace")(O):k(O)}function k(O){return O===124?p(O):O===null||Ie(O)?!s||i!==o?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):E(O)}function E(O){return n(O)}function C(O){return e.enter("tableRow"),P(O)}function P(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),P):O===null||Ie(O)?(e.exit("tableRow"),t(O)):_e(O)?ze(e,P,"whitespace")(O):(e.enter("data"),L(O))}function L(O){return O===null||O===124||Ke(O)?(e.exit("data"),P(O)):(e.consume(O),O===92?q:L)}function q(O){return O===92||O===124?(e.consume(O),L):L(O)}}function Yb(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,u=0,a,f,c;const h=new $b;for(;++n<e.length;){const d=e[n],p=d[1];d[0]==="enter"?p.type==="tableHead"?(l=!1,u!==0&&(Va(h,t,u,a,f),f=void 0,u=0),a={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",a,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",f,t]])),i=p.type==="tableDelimiterRow"?2:f?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=mi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=mi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):p.type==="tableHead"?(l=!0,u=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],c=mi(h,t,o,i,n,c)):s[1]!==0&&(c=mi(h,t,s,i,n,c)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&Va(h,t,u,a,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=Wb(t.events,n))}return e}function mi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(o.end=Object.assign({},ir(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=ir(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const a=ir(t.events,n[2]),f=ir(t.events,n[3]),c={type:l,start:Object.assign({},a),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,x=n[3]-n[2]-1;e.add(p,x,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},ir(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Va(e,t,n,r,i){const o=[],s=ir(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function ir(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Xb={name:"tasklistCheck",tokenize:Jb};function Qb(){return{text:{91:Xb}}}function Jb(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Ke(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return Ie(u)?t(u):_e(u)?e.check({tokenize:Zb},t,n)(u):n(u)}}function Zb(e,t,n){return ze(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ew(e){return Zu([Eb(),Db(),Ub(e),Kb(),Qb()])}const tw={};function nw(e){const t=this,n=e||tw,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ew(n)),o.push(vb()),s.push(kb(n))}function so(){return typeof window<"u"}function Mn(e){return xl(e)?(e.nodeName||"").toLowerCase():"#document"}function ft(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sn(e){var t;return(t=(xl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xl(e){return so()?e instanceof Node||e instanceof ft(e).Node:!1}function Je(e){return so()?e instanceof Element||e instanceof ft(e).Element:!1}function ut(e){return so()?e instanceof HTMLElement||e instanceof ft(e).HTMLElement:!1}function Ps(e){return!so()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ft(e).ShadowRoot}const rw=new Set(["inline","contents"]);function Qn(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rw.has(i)}const iw=new Set(["table","td","th"]);function ow(e){return iw.has(Mn(e))}const sw=[":popover-open",":modal"];function lo(e){return sw.some(t=>{try{return e.matches(t)}catch{return!1}})}const lw=["transform","translate","scale","rotate","perspective"],aw=["transform","translate","scale","rotate","perspective","filter"],uw=["paint","layout","strict","content"];function bl(e){const t=ao(),n=Je(e)?zt(e):e;return lw.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||aw.some(r=>(n.willChange||"").includes(r))||uw.some(r=>(n.contain||"").includes(r))}function cw(e){let t=dn(e);for(;ut(t)&&!fn(t);){if(bl(t))return t;if(lo(t))return null;t=dn(t)}return null}function ao(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const fw=new Set(["html","body","#document"]);function fn(e){return fw.has(Mn(e))}function zt(e){return ft(e).getComputedStyle(e)}function uo(e){return Je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function dn(e){if(Mn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ps(e)&&e.host||sn(e);return Ps(t)?t.host:t}function Uc(e){const t=dn(e);return fn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ut(t)&&Qn(t)?t:Uc(t)}function Cn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Uc(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=ft(i);if(o){const l=Os(s);return t.concat(s,s.visualViewport||[],Qn(i)?i:[],l&&n?Cn(l):[])}return t.concat(i,Cn(i,[],n))}function Os(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Na={};function Wt(e,t){const n=m.useRef(Na);return n.current===Na&&(n.current=e(t)),n}const ts=Lu[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],dw=ts&&ts!==m.useLayoutEffect?ts:e=>e();function me(e){const t=Wt(hw).current;return t.next=e,dw(t.effect),t.trampoline}function hw(){const e={next:void 0,callback:pw,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function pw(){}const mw=()=>{},ge=typeof document<"u"?m.useLayoutEffect:mw;function Ms(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Br={};function Rn(e,t,n,r,i){let o={...Fs(e,Br)};return t&&(o=Nr(o,t)),n&&(o=Nr(o,n)),r&&(o=Nr(o,r)),i&&(o=Nr(o,i)),o}function gw(e){if(e.length===0)return Br;if(e.length===1)return Fs(e[0],Br);let t={...Fs(e[0],Br)};for(let n=1;n<e.length;n+=1)t=Nr(t,e[n]);return t}function Nr(e,t){return $c(t)?t(e):yw(e,t)}function yw(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Ms(e.style,r);break}case"className":{e[n]=qc(e.className,r);break}default:xw(n,r)?e[n]=bw(e[n],r):e[n]=r}}return e}function xw(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function $c(e){return typeof e=="function"}function Fs(e,t){return $c(e)?e(t):e??Br}function bw(e,t){return t?e?n=>{if(ww(n)){const i=n;Ls(i);const o=t(i);return i.baseUIHandlerPrevented||e?.(i),o}const r=t(n);return e?.(n),r}:t:e}function Ls(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function qc(e,t){return t?e?t+" "+e:t:e}function ww(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function wt(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const vw=m.createContext(void 0);function kw(e=!1){const t=m.useContext(vw);if(t===void 0&&!e)throw new Error(wt(16));return t}function Cw(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:o}=e,s=r&&t!==!1,l=r&&t===!1;return{props:m.useMemo(()=>{const a={onKeyDown(f){n&&t&&f.key!=="Tab"&&f.preventDefault()}};return r||(a.tabIndex=i,!o&&n&&(a.tabIndex=t?i:-1)),(o&&(t||s)||!o&&n)&&(a["aria-disabled"]=n),o&&(!t||l)&&(a.disabled=n),a},[r,n,t,s,l,o,i])}}function ei(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,o=m.useRef(null),s=kw(!0)!==void 0,l=me(()=>{const h=o.current;return!!(h?.tagName==="A"&&h?.href)}),{props:u}=Cw({focusableWhenDisabled:n,disabled:t,composite:s,tabIndex:r,isNativeButton:i}),a=m.useCallback(()=>{const h=o.current;Sw(h)&&s&&t&&u.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,u.disabled,s]);ge(a,[a]);const f=m.useCallback((h={})=>{const{onClick:d,onMouseDown:p,onKeyUp:x,onKeyDown:w,onPointerDown:g,...y}=h;return Rn({type:i?"button":void 0,onClick(k){if(t){k.preventDefault();return}d?.(k)},onMouseDown(k){t||p?.(k)},onKeyDown(k){if(t||(Ls(k),w?.(k)),k.baseUIHandlerPrevented)return;const E=k.target===k.currentTarget&&!i&&!l()&&!t,C=k.key==="Enter",P=k.key===" ";E&&((P||C)&&k.preventDefault(),C&&d?.(k))},onKeyUp(k){t||(Ls(k),x?.(k)),!k.baseUIHandlerPrevented&&k.target===k.currentTarget&&!i&&!t&&k.key===" "&&d?.(k)},onPointerDown(k){if(t){k.preventDefault();return}g?.(k)}},i?void 0:{role:"button"},u,y)},[t,u,i,l]),c=me(h=>{o.current=h,a()});return{getButtonProps:f,buttonRef:c}}function Sw(e){return ut(e)&&e.tagName==="BUTTON"}function An(e,t,n,r){const i=Wt(Wc).current;return Iw(i,e,t,n,r)&&Kc(i,[e,t,n,r]),i.callback}function Ew(e){const t=Wt(Wc).current;return Rw(t,e)&&Kc(t,e),t.callback}function Wc(){return{callback:null,cleanup:null,refs:[]}}function Iw(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Rw(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Kc(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const s=o(n);typeof s=="function"&&(r[i]=s);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const s=r[i];typeof s=="function"?s():o(null);break}case"object":{o.current=null;break}}}}}}}const Aw=parseInt(m.version,10);function wl(e){return Aw>=e}function _a(e){if(!m.isValidElement(e))return null;const t=e,n=t.props;return(wl(19)?n?.ref:t.ref)??null}function Tw(e,t){const n={};for(const r in e){const i=e[r];if(t?.hasOwnProperty(r)){const o=t[r](i);o!=null&&Object.assign(n,o);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Pw(e,t){return typeof e=="function"?e(t):e}function Ow(e,t){return typeof e=="function"?e(t):e}function et(){}const wn=Object.freeze([]),yt=Object.freeze({}),Mw={style:{transition:"none"}},Fw="data-base-ui-click-trigger",Gc={fallbackAxisSide:"none"},Lw={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function nt(e,t,n={}){const r=t.render,i=Dw(t,n);if(n.enabled===!1)return null;const o=n.state??yt;return Vw(e,r,i,o)}function Dw(e,t={}){const{className:n,style:r,render:i}=e,{state:o=yt,ref:s,props:l,stateAttributesMapping:u,enabled:a=!0}=t,f=a?Pw(n,o):void 0,c=a?Ow(r,o):void 0,h=a?Tw(o,u):yt,d=a?Ms(h,Array.isArray(l)?gw(l):l)??yt:yt;return typeof document<"u"&&(a?Array.isArray(s)?d.ref=Ew([d.ref,_a(i),...s]):d.ref=An(d.ref,_a(i),s):An(null,null)),a?(f!==void 0&&(d.className=qc(d.className,f)),c!==void 0&&(d.style=Ms(d.style,c)),d):yt}function Vw(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=Rn(n,t.props);return i.ref=n.ref,m.cloneElement(t,i)}if(e&&typeof e=="string")return Nw(e,n);throw new Error(wt(8))}function Nw(e,t){return e==="button"?m.createElement("button",{type:"button",...t,key:t.key}):e==="img"?m.createElement("img",{alt:"",...t,key:t.key}):m.createElement(e,t)}const _w=m.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,focusableWhenDisabled:s=!1,nativeButton:l=!0,...u}=t,a=!!o,{getButtonProps:f,buttonRef:c}=ei({disabled:a,focusableWhenDisabled:s,native:l}),h=m.useMemo(()=>({disabled:a}),[a]);return nt("button",t,{state:h,ref:[n,c],props:[u,f]})}),jw={primary:"bg-indigo-500 text-white hover:bg-indigo-600 active:bg-indigo-700",secondary:"bg-gray-100 text-gray-700 hover:bg-gray-200 active:bg-gray-300",outline:"border border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 active:bg-gray-200",ghost:"text-gray-700 hover:bg-gray-100 active:bg-gray-200"},zw={sm:"px-3 py-1.5 text-sm gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-6 py-2.5 text-base gap-2",icon:"size-8 p-0"},co=({variant:e="primary",size:t="md",children:n,...r})=>R.jsx(_w,{className:`inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer ${jw[e]} ${zw[t]}`,...r,children:n}),Bw=({previewContent:e,previewMode:t,isGenerating:n,isSubmitting:r,allowSave:i,onToggleMode:o,onPreview:s,onCreate:l,onContentChange:u})=>{const{_:a}=Yn(),{showSnackbar:f}=Du(),c=n||r,h=a(n?{id:"NOdFZR"}:{id:"XvjC4F"}),d=m.useCallback(async()=>{e!=null&&(await navigator.clipboard.writeText(e),f(a({id:"FxVG/l"}),"success"))},[e,f,a]),p=m.useCallback(async()=>{e!=null&&navigator.share!=null&&await navigator.share({text:e})},[e]);return R.jsxs("div",{className:"flex-1 overflow-y-auto p-6 relative",children:[R.jsx(mr,{children:c&&R.jsxs(Qt.div,{className:"absolute inset-0 bg-white/80 flex flex-col items-center justify-center gap-4 z-20",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[R.jsx(Qt.div,{className:"w-8 h-8 border-3 border-gray-200 border-t-indigo-500 rounded-full",animate:{rotate:360},transition:{duration:1,repeat:Number.POSITIVE_INFINITY,ease:"linear"}}),R.jsx("p",{className:"text-sm text-gray-500",children:h})]})}),e!=null&&R.jsxs("div",{className:"sticky top-0 right-0 flex gap-1 bg-white rounded-lg shadow-sm border border-gray-200 p-1 mb-4 w-fit ml-auto z-10",children:[R.jsx("button",{"aria-label":a(t==="edit"?{id:"9PuK3/"}:{id:"wR3B2j"}),className:"p-2.5 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer *:size-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",type:"button",onClick:o,children:t==="edit"?R.jsx(xh,{}):R.jsx(Ah,{})}),R.jsx("button",{"aria-label":a({id:"6exX+8"}),className:"p-2.5 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed *:size-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",disabled:c,type:"button",onClick:s,children:R.jsx(Th,{})}),R.jsx("button",{"aria-label":a({id:"he3ygx"}),className:"p-2.5 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer *:size-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",type:"button",onClick:d,children:R.jsx(Oh,{})}),navigator.share!=null&&R.jsx("button",{"aria-label":a({id:"Z8lGw6"}),className:"p-2.5 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer *:size-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",type:"button",onClick:p,children:R.jsx(Mh,{})}),i&&R.jsx("button",{"aria-label":a({id:"tfDRzk"}),className:"p-2.5 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed *:size-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",disabled:c,type:"button",onClick:l,children:R.jsx(Ph,{})})]}),e!=null&&t==="edit"&&R.jsx("textarea",{className:"w-full h-full min-h-screen p-4 font-mono text-sm text-gray-800 bg-gray-50 border border-gray-200 rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-transparent",value:e,onChange:u}),e!=null&&t==="preview"&&R.jsx("div",{className:"prose prose-sm prose-gray max-w-none",children:R.jsx(Uy,{remarkPlugins:[nw],children:e})}),e==null&&!c&&R.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center gap-4",children:[R.jsx("p",{className:"text-gray-400 text-sm whitespace-pre-line",children:a({id:"TC9TYf"})}),R.jsx(co,{variant:"primary",onClick:s,children:a({id:"W9q5nG"})})]})]})},_C=({isOpen:e,onClose:t,previewContent:n,previewMode:r,isGenerating:i,isSubmitting:o,allowSave:s,onToggleMode:l,onPreview:u,onCreate:a,onContentChange:f})=>{const{_:c}=Yn();return R.jsx(mr,{children:e&&R.jsxs(Qt.div,{className:"fixed inset-0 z-50 flex flex-col bg-white",initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},transition:{duration:.3,ease:"easeInOut"},children:[R.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[R.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:c({id:"rdUucN"})}),R.jsx("button",{"aria-label":c({id:"yz7wBu"}),className:"p-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",type:"button",onClick:t,children:R.jsx(_u,{})})]}),R.jsx(Bw,{allowSave:s,isGenerating:i,isSubmitting:o,previewContent:n,previewMode:r,onContentChange:f,onCreate:a,onPreview:u,onToggleMode:l})]})})},Hw=(e={})=>{const t=m.useMemo(()=>Zi(e.formKey),[e.formKey]),n=Kl(o=>o.previews[t]??null),r=Kl(o=>o.setPreviewContent),i=m.useCallback(o=>r(t,o),[t,r]);return{previewContent:n,setPreviewContent:i}},Uw=async e=>{const t=await fetch(`/api/scenarios/${e.scenarioId}/docs/preview`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e.formData)});if(!t.ok)throw new Error("Failed to preview");return(await t.json()).content},jC=(e={})=>{const{_:t}=Yn(),n=Du(i=>i.showSnackbar),{setPreviewContent:r}=Hw({formKey:e.formKey});return vh({mutationFn:Uw,onSuccess:i=>{r(i)},onError:()=>{n(t({id:"7BGeH2"}),"error")}})};var ti=e=>e.type==="checkbox",Hn=e=>e instanceof Date,Rt=e=>e==null;const Yc=e=>typeof e=="object";var ct=e=>!Rt(e)&&!Array.isArray(e)&&Yc(e)&&!Hn(e),Xc=e=>ct(e)&&e.target?ti(e.target)?e.target.checked:e.target.value:e,$w=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Qc=(e,t)=>e.has($w(t)),qw=e=>{const t=e.constructor&&e.constructor.prototype;return ct(t)&&t.hasOwnProperty("isPrototypeOf")},vl=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xe(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(vl&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(ct(e)&&qw(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=Xe(e[i]));return r}var fo=e=>/^\w*$/.test(e),Ye=e=>e===void 0,ho=e=>Array.isArray(e)?e.filter(Boolean):[],kl=e=>ho(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ce=(e,t,n)=>{if(!t||!ct(e))return n;const r=(fo(t)?[t]:kl(t)).reduce((i,o)=>Rt(i)?i:i[o],e);return Ye(r)||r===e?Ye(e[t])?n:e[t]:r},Lt=e=>typeof e=="boolean",Et=e=>typeof e=="function",$e=(e,t,n)=>{let r=-1;const i=fo(t)?[t]:kl(t),o=i.length,s=o-1;for(;++r<o;){const l=i[r];let u=n;if(r!==s){const a=e[l];u=ct(a)||Array.isArray(a)?a:isNaN(+i[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=u,e=e[l]}};const Vi={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},$t={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},cn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Cl=ve.createContext(null);Cl.displayName="HookFormContext";const ni=()=>ve.useContext(Cl),Jc=e=>{const{children:t,...n}=e;return ve.createElement(Cl.Provider,{value:n},t)};var Zc=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const s=o;return t._proxyFormState[s]!==$t.all&&(t._proxyFormState[s]=!r||$t.all),n&&(n[s]=!0),e[s]}});return i};const po=typeof window<"u"?ve.useLayoutEffect:ve.useEffect;function Ww(e){const t=ni(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[s,l]=ve.useState(n._formState),u=ve.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return po(()=>n._subscribe({name:i,formState:u.current,exact:o,callback:a=>{!r&&l({...n._formState,...a})}}),[i,r,o]),ve.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),ve.useMemo(()=>Zc(s,n,u.current,!1),[s,n])}var Vt=e=>typeof e=="string",Ds=(e,t,n,r,i)=>Vt(e)?(r&&t.watch.add(e),ce(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),ce(n,o))):(r&&(t.watchAll=!0),n),Vs=e=>Rt(e)||!Yc(e);function Yt(e,t,n=new WeakSet){if(Vs(e)||Vs(t))return Object.is(e,t);if(Hn(e)&&Hn(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const s=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const l=t[o];if(Hn(s)&&Hn(l)||ct(s)&&ct(l)||Array.isArray(s)&&Array.isArray(l)?!Yt(s,l,n):!Object.is(s,l))return!1}}return!0}function Sl(e){const t=ni(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:s,compute:l}=e||{},u=ve.useRef(i),a=ve.useRef(l),f=ve.useRef(void 0),c=ve.useRef(n),h=ve.useRef(r);a.current=l;const[d,p]=ve.useState(()=>{const k=n._getWatch(r,u.current);return a.current?a.current(k):k}),x=ve.useCallback(k=>{const E=Ds(r,n._names,k||n._formValues,!1,u.current);return a.current?a.current(E):E},[n._formValues,n._names,r]),w=ve.useCallback(k=>{if(!o){const E=Ds(r,n._names,k||n._formValues,!1,u.current);if(a.current){const C=a.current(E);Yt(C,f.current)||(p(C),f.current=C)}else p(E)}},[n._formValues,n._names,o,r]);po(()=>((c.current!==n||!Yt(h.current,r))&&(c.current=n,h.current=r,w()),n._subscribe({name:r,formState:{values:!0},exact:s,callback:k=>{w(k.values)}})),[n,s,r,w]),ve.useEffect(()=>n._removeUnmounted());const g=c.current!==n,y=h.current,v=ve.useMemo(()=>{if(o)return null;const k=!g&&!Yt(y,r);return g||k?x():null},[o,g,r,y,x]);return v!==null?v:d}function Kw(e){const t=ni(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:s,exact:l=!0}=e,u=Qc(i._names.array,n),a=ve.useMemo(()=>ce(i._formValues,n,ce(i._defaultValues,n,s)),[i,n,s]),f=Sl({control:i,name:n,defaultValue:a,exact:l}),c=Ww({control:i,name:n,exact:l}),h=ve.useRef(e),d=ve.useRef(void 0),p=ve.useRef(i.register(n,{...e.rules,value:f,...Lt(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const x=ve.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ce(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!ce(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ce(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ce(c.validatingFields,n)},error:{enumerable:!0,get:()=>ce(c.errors,n)}}),[c,n]),w=ve.useCallback(k=>p.current.onChange({target:{value:Xc(k),name:n},type:Vi.CHANGE}),[n]),g=ve.useCallback(()=>p.current.onBlur({target:{value:ce(i._formValues,n),name:n},type:Vi.BLUR}),[n,i._formValues]),y=ve.useCallback(k=>{const E=ce(i._fields,n);E&&E._f&&k&&(E._f.ref={focus:()=>Et(k.focus)&&k.focus(),select:()=>Et(k.select)&&k.select(),setCustomValidity:C=>Et(k.setCustomValidity)&&k.setCustomValidity(C),reportValidity:()=>Et(k.reportValidity)&&k.reportValidity()})},[i._fields,n]),v=ve.useMemo(()=>({name:n,value:f,...Lt(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:w,onBlur:g,ref:y}),[n,r,c.disabled,w,g,y,f]);return ve.useEffect(()=>{const k=i._options.shouldUnregister||o,E=d.current;E&&E!==n&&!u&&i.unregister(E),i.register(n,{...h.current.rules,...Lt(h.current.disabled)?{disabled:h.current.disabled}:{}});const C=(P,L)=>{const q=ce(i._fields,P);q&&q._f&&(q._f.mount=L)};if(C(n,!0),k){const P=Xe(ce(i._options.defaultValues,n,h.current.defaultValue));$e(i._defaultValues,n,P),Ye(ce(i._formValues,n))&&$e(i._formValues,n,P)}return!u&&i.register(n),d.current=n,()=>{(u?k&&!i._state.action:k)?i.unregister(n):C(n,!1)}},[n,i,u,o]),ve.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),ve.useMemo(()=>({field:v,formState:c,fieldState:x}),[v,c,x])}const ja=e=>e.render(Kw(e));var Gw=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},At=e=>Array.isArray(e)?e:[e],za=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}};function ef(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&ct(i)&&o){const s=ef(i,o);ct(s)&&(n[r]=s)}else e[r]&&(n[r]=o)}return n}var mt=e=>ct(e)&&!Object.keys(e).length,El=e=>e.type==="file",Ni=e=>{if(!vl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},tf=e=>e.type==="select-multiple",Il=e=>e.type==="radio",Yw=e=>Il(e)||ti(e),ns=e=>Ni(e)&&e.isConnected;function Xw(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Ye(e)?r++:e[t[r++]];return e}function Qw(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ye(e[t]))return!1;return!0}function it(e,t){const n=Array.isArray(t)?t:fo(t)?[t]:kl(t),r=n.length===1?e:Xw(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(ct(r)&&mt(r)||Array.isArray(r)&&Qw(r))&&it(e,n.slice(0,-1)),e}var Jw=e=>{for(const t in e)if(Et(e[t]))return!0;return!1};function nf(e){return Array.isArray(e)||ct(e)&&!Jw(e)}function Ns(e,t={}){for(const n in e){const r=e[n];nf(r)?(t[n]=Array.isArray(r)?[]:{},Ns(r,t[n])):Ye(r)||(t[n]=!0)}return t}function or(e,t,n){n||(n=Ns(t));for(const r in e){const i=e[r];if(nf(i))Ye(t)||Vs(n[r])?n[r]=Ns(i,Array.isArray(i)?[]:{}):or(i,Rt(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!Yt(i,o)}}return n}const Ba={value:!1,isValid:!1},Ha={value:!0,isValid:!0};var rf=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ye(e[0].attributes.value)?Ye(e[0].value)||e[0].value===""?Ha:{value:e[0].value,isValid:!0}:Ha:Ba}return Ba},of=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Ye(e)?e:t?e===""?NaN:e&&+e:n&&Vt(e)?new Date(e):r?r(e):e;const Ua={isValid:!1,value:null};var sf=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Ua):Ua;function $a(e){const t=e.ref;return El(t)?t.files:Il(t)?sf(e.refs).value:tf(t)?[...t.selectedOptions].map(({value:n})=>n):ti(t)?rf(e.refs).value:of(Ye(t.value)?e.ref.value:t.value,e)}var Zw=(e,t,n,r)=>{const i={};for(const o of e){const s=ce(t,o);s&&$e(i,o,s._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},_i=e=>e instanceof RegExp,Lr=e=>Ye(e)?e:_i(e)?e.source:ct(e)?_i(e.value)?e.value.source:e.value:e,sr=e=>({isOnSubmit:!e||e===$t.onSubmit,isOnBlur:e===$t.onBlur,isOnChange:e===$t.onChange,isOnAll:e===$t.all,isOnTouch:e===$t.onTouched});const qa="AsyncFunction";var e0=e=>!!e&&!!e.validate&&!!(Et(e.validate)&&e.validate.constructor.name===qa||ct(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===qa)),t0=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),_s=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const fr=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=ce(e,i);if(o){const{_f:s,...l}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(fr(l,t))break}else if(ct(l)&&fr(l,t))break}}};function Wa(e,t,n){const r=ce(e,n);if(r||fo(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=ce(t,o),l=ce(e,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(l&&l.type)return{name:o,error:l};if(l&&l.root&&l.root.type)return{name:`${o}.root`,error:l.root};i.pop()}return{name:n}}var n0=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return mt(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(s=>t[s]===(!r||$t.all))},r0=(e,t,n)=>!e||!t||e===t||At(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),i0=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,o0=(e,t)=>!ho(ce(e,t)).length&&it(e,t),lf=(e,t,n)=>{const r=At(ce(e,n));return $e(r,"root",t[n]),$e(e,n,r),e};function Ka(e,t,n="validate"){if(Vt(e)||Array.isArray(e)&&e.every(Vt)||Lt(e)&&!e)return{type:n,message:Vt(e)?e:"",ref:t}}var rr=e=>ct(e)&&!_i(e)?e:{value:e,message:""},js=async(e,t,n,r,i,o)=>{const{ref:s,refs:l,required:u,maxLength:a,minLength:f,min:c,max:h,pattern:d,validate:p,name:x,valueAsNumber:w,mount:g}=e._f,y=ce(n,x);if(!g||t.has(x))return{};const v=l?l[0]:s,k=_=>{i&&v.reportValidity&&(v.setCustomValidity(Lt(_)?"":_||""),v.reportValidity())},E={},C=Il(s),P=ti(s),L=C||P,q=(w||El(s))&&Ye(s.value)&&Ye(y)||Ni(s)&&s.value===""||y===""||Array.isArray(y)&&!y.length,O=Gw.bind(null,x,r,E),z=(_,B,D,A=cn.maxLength,N=cn.minLength)=>{const Y=_?B:D;E[x]={type:_?A:N,message:Y,ref:s,...O(_?A:N,Y)}};if(o?!Array.isArray(y)||!y.length:u&&(!L&&(q||Rt(y))||Lt(y)&&!y||P&&!rf(l).isValid||C&&!sf(l).isValid)){const{value:_,message:B}=Vt(u)?{value:!!u,message:u}:rr(u);if(_&&(E[x]={type:cn.required,message:B,ref:v,...O(cn.required,B)},!r))return k(B),E}if(!q&&(!Rt(c)||!Rt(h))){let _,B;const D=rr(h),A=rr(c);if(!Rt(y)&&!isNaN(y)){const N=s.valueAsNumber||y&&+y;Rt(D.value)||(_=N>D.value),Rt(A.value)||(B=N<A.value)}else{const N=s.valueAsDate||new Date(y),Y=S=>new Date(new Date().toDateString()+" "+S),$=s.type=="time",K=s.type=="week";Vt(D.value)&&y&&(_=$?Y(y)>Y(D.value):K?y>D.value:N>new Date(D.value)),Vt(A.value)&&y&&(B=$?Y(y)<Y(A.value):K?y<A.value:N<new Date(A.value))}if((_||B)&&(z(!!_,D.message,A.message,cn.max,cn.min),!r))return k(E[x].message),E}if((a||f)&&!q&&(Vt(y)||o&&Array.isArray(y))){const _=rr(a),B=rr(f),D=!Rt(_.value)&&y.length>+_.value,A=!Rt(B.value)&&y.length<+B.value;if((D||A)&&(z(D,_.message,B.message),!r))return k(E[x].message),E}if(d&&!q&&Vt(y)){const{value:_,message:B}=rr(d);if(_i(_)&&!y.match(_)&&(E[x]={type:cn.pattern,message:B,ref:s,...O(cn.pattern,B)},!r))return k(B),E}if(p){if(Et(p)){const _=await p(y,n),B=Ka(_,v);if(B&&(E[x]={...B,...O(cn.validate,B.message)},!r))return k(B.message),E}else if(ct(p)){let _={};for(const B in p){if(!mt(_)&&!r)break;const D=Ka(await p[B](y,n),v,B);D&&(_={...D,...O(B,D.message)},k(D.message),r&&(E[x]=_))}if(!mt(_)&&(E[x]={ref:v,..._},!r))return E}}return k(!0),E};const s0={mode:$t.onSubmit,reValidateMode:$t.onChange,shouldFocusError:!0};function l0(e={}){let t={...s0,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Et(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=ct(t.defaultValues)||ct(t.values)?Xe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Xe(i),s={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,a=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},c={...f};let h={...c};const d={array:za(),state:za()},p=t.criteriaMode===$t.all,x=b=>M=>{clearTimeout(a),a=setTimeout(b,M)},w=async b=>{if(!s.keepIsValid&&!t.disabled&&(c.isValid||h.isValid||b)){let M;t.resolver?(M=mt((await L()).errors),g()):M=await O(r,!0),M!==n.isValid&&d.state.next({isValid:M})}},g=(b,M)=>{!t.disabled&&(c.isValidating||c.validatingFields||h.isValidating||h.validatingFields)&&((b||Array.from(l.mount)).forEach(F=>{F&&(M?$e(n.validatingFields,F,M):it(n.validatingFields,F))}),d.state.next({validatingFields:n.validatingFields,isValidating:!mt(n.validatingFields)}))},y=(b,M=[],F,U,j=!0,T=!0)=>{if(U&&F&&!t.disabled){if(s.action=!0,T&&Array.isArray(ce(r,b))){const V=F(ce(r,b),U.argA,U.argB);j&&$e(r,b,V)}if(T&&Array.isArray(ce(n.errors,b))){const V=F(ce(n.errors,b),U.argA,U.argB);j&&$e(n.errors,b,V),o0(n.errors,b)}if((c.touchedFields||h.touchedFields)&&T&&Array.isArray(ce(n.touchedFields,b))){const V=F(ce(n.touchedFields,b),U.argA,U.argB);j&&$e(n.touchedFields,b,V)}(c.dirtyFields||h.dirtyFields)&&(n.dirtyFields=or(i,o)),d.state.next({name:b,isDirty:_(b,M),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else $e(o,b,M)},v=(b,M)=>{$e(n.errors,b,M),d.state.next({errors:n.errors})},k=b=>{n.errors=b,d.state.next({errors:n.errors,isValid:!1})},E=(b,M,F,U)=>{const j=ce(r,b);if(j){const T=ce(o,b,Ye(F)?ce(i,b):F);Ye(T)||U&&U.defaultChecked||M?$e(o,b,M?T:$a(j._f)):A(b,T),s.mount&&!s.action&&w()}},C=(b,M,F,U,j)=>{let T=!1,V=!1;const W={name:b};if(!t.disabled){if(!F||U){(c.isDirty||h.isDirty)&&(V=n.isDirty,n.isDirty=W.isDirty=_(),T=V!==W.isDirty);const J=Yt(ce(i,b),M);V=!!ce(n.dirtyFields,b),J?it(n.dirtyFields,b):$e(n.dirtyFields,b,!0),W.dirtyFields=n.dirtyFields,T=T||(c.dirtyFields||h.dirtyFields)&&V!==!J}if(F){const J=ce(n.touchedFields,b);J||($e(n.touchedFields,b,F),W.touchedFields=n.touchedFields,T=T||(c.touchedFields||h.touchedFields)&&J!==F)}T&&j&&d.state.next(W)}return T?W:{}},P=(b,M,F,U)=>{const j=ce(n.errors,b),T=(c.isValid||h.isValid)&&Lt(M)&&n.isValid!==M;if(t.delayError&&F?(u=x(()=>v(b,F)),u(t.delayError)):(clearTimeout(a),u=null,F?$e(n.errors,b,F):it(n.errors,b)),(F?!Yt(j,F):j)||!mt(U)||T){const V={...U,...T&&Lt(M)?{isValid:M}:{},errors:n.errors,name:b};n={...n,...V},d.state.next(V)}},L=async b=>(g(b,!0),await t.resolver(o,t.context,Zw(b||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),q=async b=>{const{errors:M}=await L(b);if(g(b),b)for(const F of b){const U=ce(M,F);U?$e(n.errors,F,U):it(n.errors,F)}else n.errors=M;return M},O=async(b,M,F={valid:!0})=>{for(const U in b){const j=b[U];if(j){const{_f:T,...V}=j;if(T){const W=l.array.has(T.name),J=j._f&&e0(j._f);J&&c.validatingFields&&g([T.name],!0);const he=await js(j,l.disabled,o,p,t.shouldUseNativeValidation&&!M,W);if(J&&c.validatingFields&&g([T.name]),he[T.name]&&(F.valid=!1,M))break;!M&&(ce(he,T.name)?W?lf(n.errors,he,T.name):$e(n.errors,T.name,he[T.name]):it(n.errors,T.name))}!mt(V)&&await O(V,M,F)}}return F.valid},z=()=>{for(const b of l.unMount){const M=ce(r,b);M&&(M._f.refs?M._f.refs.every(F=>!ns(F)):!ns(M._f.ref))&&ie(b)}l.unMount=new Set},_=(b,M)=>!t.disabled&&(b&&M&&$e(o,b,M),!Yt(Z(),i)),B=(b,M,F)=>Ds(b,l,{...s.mount?o:Ye(M)?i:Vt(b)?{[b]:M}:M},F,M),D=b=>ho(ce(s.mount?o:i,b,t.shouldUnregister?ce(i,b,[]):[])),A=(b,M,F={})=>{const U=ce(r,b);let j=M;if(U){const T=U._f;T&&(!T.disabled&&$e(o,b,of(M,T)),j=Ni(T.ref)&&Rt(M)?"":M,tf(T.ref)?[...T.ref.options].forEach(V=>V.selected=j.includes(V.value)):T.refs?ti(T.ref)?T.refs.forEach(V=>{(!V.defaultChecked||!V.disabled)&&(Array.isArray(j)?V.checked=!!j.find(W=>W===V.value):V.checked=j===V.value||!!j)}):T.refs.forEach(V=>V.checked=V.value===j):El(T.ref)?T.ref.value="":(T.ref.value=j,T.ref.type||d.state.next({name:b,values:Xe(o)})))}(F.shouldDirty||F.shouldTouch)&&C(b,j,F.shouldTouch,F.shouldDirty,!0),F.shouldValidate&&S(b)},N=(b,M,F)=>{for(const U in M){if(!M.hasOwnProperty(U))return;const j=M[U],T=b+"."+U,V=ce(r,T);(l.array.has(b)||ct(j)||V&&!V._f)&&!Hn(j)?N(T,j,F):A(T,j,F)}},Y=(b,M,F={})=>{const U=ce(r,b),j=l.array.has(b),T=Xe(M);$e(o,b,T),j?(d.array.next({name:b,values:Xe(o)}),(c.isDirty||c.dirtyFields||h.isDirty||h.dirtyFields)&&F.shouldDirty&&d.state.next({name:b,dirtyFields:or(i,o),isDirty:_(b,T)})):U&&!U._f&&!Rt(T)?N(b,T,F):A(b,T,F),_s(b,l)&&d.state.next({...n,name:b}),d.state.next({name:s.mount?b:void 0,values:Xe(o)})},$=async b=>{s.mount=!0;const M=b.target;let F=M.name,U=!0;const j=ce(r,F),T=J=>{U=Number.isNaN(J)||Hn(J)&&isNaN(J.getTime())||Yt(J,ce(o,F,J))},V=sr(t.mode),W=sr(t.reValidateMode);if(j){let J,he;const Pe=M.type?$a(j._f):Xc(b),Oe=b.type===Vi.BLUR||b.type===Vi.FOCUS_OUT,ke=!t0(j._f)&&!t.resolver&&!ce(n.errors,F)&&!j._f.deps||i0(Oe,ce(n.touchedFields,F),n.isSubmitted,W,V),de=_s(F,l,Oe);$e(o,F,Pe),Oe?(!M||!M.readOnly)&&(j._f.onBlur&&j._f.onBlur(b),u&&u(0)):j._f.onChange&&j._f.onChange(b);const He=C(F,Pe,Oe),Be=!mt(He)||de;if(!Oe&&d.state.next({name:F,type:b.type,values:Xe(o)}),ke)return(c.isValid||h.isValid)&&(t.mode==="onBlur"?Oe&&w():Oe||w()),Be&&d.state.next({name:F,...de?{}:He});if(!Oe&&de&&d.state.next({...n}),t.resolver){const{errors:De}=await L([F]);if(g([F]),T(Pe),U){const Me=Wa(n.errors,r,F),rt=Wa(De,r,Me.name||F);J=rt.error,F=rt.name,he=mt(De)}}else g([F],!0),J=(await js(j,l.disabled,o,p,t.shouldUseNativeValidation))[F],g([F]),T(Pe),U&&(J?he=!1:(c.isValid||h.isValid)&&(he=await O(r,!0)));U&&(j._f.deps&&(!Array.isArray(j._f.deps)||j._f.deps.length>0)&&S(j._f.deps),P(F,he,J,He))}},K=(b,M)=>{if(ce(n.errors,M)&&b.focus)return b.focus(),1},S=async(b,M={})=>{let F,U;const j=At(b);if(t.resolver){const T=await q(Ye(b)?b:j);F=mt(T),U=b?!j.some(V=>ce(T,V)):F}else b?(U=(await Promise.all(j.map(async T=>{const V=ce(r,T);return await O(V&&V._f?{[T]:V}:V)}))).every(Boolean),!(!U&&!n.isValid)&&w()):U=F=await O(r);return d.state.next({...!Vt(b)||(c.isValid||h.isValid)&&F!==n.isValid?{}:{name:b},...t.resolver||!b?{isValid:F}:{},errors:n.errors}),M.shouldFocus&&!U&&fr(r,K,b?j:l.mount),U},Z=(b,M)=>{let F={...s.mount?o:i};return M&&(F=ef(M.dirtyFields?n.dirtyFields:n.touchedFields,F)),Ye(b)?F:Vt(b)?ce(F,b):b.map(U=>ce(F,U))},be=(b,M)=>({invalid:!!ce((M||n).errors,b),isDirty:!!ce((M||n).dirtyFields,b),error:ce((M||n).errors,b),isValidating:!!ce(n.validatingFields,b),isTouched:!!ce((M||n).touchedFields,b)}),I=b=>{b&&At(b).forEach(M=>it(n.errors,M)),d.state.next({errors:b?n.errors:{}})},fe=(b,M,F)=>{const U=(ce(r,b,{_f:{}})._f||{}).ref,j=ce(n.errors,b)||{},{ref:T,message:V,type:W,...J}=j;$e(n.errors,b,{...J,...M,ref:U}),d.state.next({name:b,errors:n.errors,isValid:!1}),F&&F.shouldFocus&&U&&U.focus&&U.focus()},le=(b,M)=>Et(b)?d.state.subscribe({next:F=>"values"in F&&b(B(void 0,M),F)}):B(b,M,!0),X=b=>d.state.subscribe({next:M=>{r0(b.name,M.name,b.exact)&&n0(M,b.formState||c,Ee,b.reRenderRoot)&&b.callback({values:{...o},...n,...M,defaultValues:i})}}).unsubscribe,ue=b=>(s.mount=!0,h={...h,...b.formState},X({...b,formState:{...f,...b.formState}})),ie=(b,M={})=>{for(const F of b?At(b):l.mount)l.mount.delete(F),l.array.delete(F),M.keepValue||(it(r,F),it(o,F)),!M.keepError&&it(n.errors,F),!M.keepDirty&&it(n.dirtyFields,F),!M.keepTouched&&it(n.touchedFields,F),!M.keepIsValidating&&it(n.validatingFields,F),!t.shouldUnregister&&!M.keepDefaultValue&&it(i,F);d.state.next({values:Xe(o)}),d.state.next({...n,...M.keepDirty?{isDirty:_()}:{}}),!M.keepIsValid&&w()},we=({disabled:b,name:M})=>{(Lt(b)&&s.mount||b||l.disabled.has(M))&&(b?l.disabled.add(M):l.disabled.delete(M))},Q=(b,M={})=>{let F=ce(r,b);const U=Lt(M.disabled)||Lt(t.disabled);return $e(r,b,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:b}},name:b,mount:!0,...M}}),l.mount.add(b),F?we({disabled:Lt(M.disabled)?M.disabled:t.disabled,name:b}):E(b,!0,M.value),{...U?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:Lr(M.min),max:Lr(M.max),minLength:Lr(M.minLength),maxLength:Lr(M.maxLength),pattern:Lr(M.pattern)}:{},name:b,onChange:$,onBlur:$,ref:j=>{if(j){Q(b,M),F=ce(r,b);const T=Ye(j.value)&&j.querySelectorAll&&j.querySelectorAll("input,select,textarea")[0]||j,V=Yw(T),W=F._f.refs||[];if(V?W.find(J=>J===T):T===F._f.ref)return;$e(r,b,{_f:{...F._f,...V?{refs:[...W.filter(ns),T,...Array.isArray(ce(i,b))?[{}]:[]],ref:{type:T.type,name:b}}:{ref:T}}}),E(b,!1,void 0,T)}else F=ce(r,b,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(Qc(l.array,b)&&s.action)&&l.unMount.add(b)}}},H=()=>t.shouldFocusError&&fr(r,K,l.mount),se=b=>{Lt(b)&&(d.state.next({disabled:b}),fr(r,(M,F)=>{const U=ce(r,F);U&&(M.disabled=U._f.disabled||b,Array.isArray(U._f.refs)&&U._f.refs.forEach(j=>{j.disabled=U._f.disabled||b}))},0,!1))},ne=(b,M)=>async F=>{let U;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let j=Xe(o);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:T,values:V}=await L();g(),n.errors=T,j=Xe(V)}else await O(r);if(l.disabled.size)for(const T of l.disabled)it(j,T);if(it(n.errors,"root"),mt(n.errors)){d.state.next({errors:{}});try{await b(j,F)}catch(T){U=T}}else M&&await M({...n.errors},F),H(),setTimeout(H);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:mt(n.errors)&&!U,submitCount:n.submitCount+1,errors:n.errors}),U)throw U},Ae=(b,M={})=>{ce(r,b)&&(Ye(M.defaultValue)?Y(b,Xe(ce(i,b))):(Y(b,M.defaultValue),$e(i,b,Xe(M.defaultValue))),M.keepTouched||it(n.touchedFields,b),M.keepDirty||(it(n.dirtyFields,b),n.isDirty=M.defaultValue?_(b,Xe(ce(i,b))):_()),M.keepError||(it(n.errors,b),c.isValid&&w()),d.state.next({...n}))},ee=(b,M={})=>{const F=b?Xe(b):i,U=Xe(F),j=mt(b),T=j?i:U;if(M.keepDefaultValues||(i=F),!M.keepValues){if(M.keepDirtyValues){const V=new Set([...l.mount,...Object.keys(or(i,o))]);for(const W of Array.from(V))ce(n.dirtyFields,W)?$e(T,W,ce(o,W)):Y(W,ce(T,W))}else{if(vl&&Ye(b))for(const V of l.mount){const W=ce(r,V);if(W&&W._f){const J=Array.isArray(W._f.refs)?W._f.refs[0]:W._f.ref;if(Ni(J)){const he=J.closest("form");if(he){he.reset();break}}}}if(M.keepFieldsRef)for(const V of l.mount)Y(V,ce(T,V));else r={}}o=t.shouldUnregister?M.keepDefaultValues?Xe(i):{}:Xe(T),d.array.next({values:{...T}}),d.state.next({values:{...T}})}l={mount:M.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!c.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!mt(T),s.watch=!!t.shouldUnregister,s.keepIsValid=!!M.keepIsValid,s.action=!1,M.keepErrors||(n.errors={}),d.state.next({submitCount:M.keepSubmitCount?n.submitCount:0,isDirty:j?!1:M.keepDirty?n.isDirty:!!(M.keepDefaultValues&&!Yt(b,i)),isSubmitted:M.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:j?{}:M.keepDirtyValues?M.keepDefaultValues&&o?or(i,o):n.dirtyFields:M.keepDefaultValues&&b?or(i,b):M.keepDirty?n.dirtyFields:{},touchedFields:M.keepTouched?n.touchedFields:{},errors:M.keepErrors?n.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},G=(b,M)=>ee(Et(b)?b(o):b,{...t.resetOptions,...M}),oe=(b,M={})=>{const F=ce(r,b),U=F&&F._f;if(U){const j=U.refs?U.refs[0]:U.ref;j.focus&&setTimeout(()=>{j.focus(),M.shouldSelect&&Et(j.select)&&j.select()})}},Ee=b=>{n={...n,...b}},xe={control:{register:Q,unregister:ie,getFieldState:be,handleSubmit:ne,setError:fe,_subscribe:X,_runSchema:L,_updateIsValidating:g,_focusError:H,_getWatch:B,_getDirty:_,_setValid:w,_setFieldArray:y,_setDisabledField:we,_setErrors:k,_getFieldArray:D,_reset:ee,_resetDefaultValues:()=>Et(t.defaultValues)&&t.defaultValues().then(b=>{G(b,t.resetOptions),d.state.next({isLoading:!1})}),_removeUnmounted:z,_disableForm:se,_subjects:d,_proxyFormState:c,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state(b){s=b},get _defaultValues(){return i},get _names(){return l},set _names(b){l=b},get _formState(){return n},get _options(){return t},set _options(b){t={...t,...b}}},subscribe:ue,trigger:S,register:Q,handleSubmit:ne,watch:le,setValue:Y,getValues:Z,reset:G,resetField:Ae,clearErrors:I,unregister:ie,setError:fe,setFocus:oe,getFieldState:be};return{...xe,formControl:xe}}var xn=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},rs=(e,t,n={})=>n.shouldFocus||Ye(n.shouldFocus)?n.focusName||`${e}.${Ye(n.focusIndex)?t:n.focusIndex}.`:"",is=(e,t)=>[...e,...At(t)],os=e=>Array.isArray(e)?e.map(()=>{}):void 0;function ss(e,t,n){return[...e.slice(0,t),...At(n),...e.slice(t)]}var ls=(e,t,n)=>Array.isArray(e)?(Ye(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],as=(e,t)=>[...At(t),...At(e)];function a0(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return ho(r).length?r:[]}var us=(e,t)=>Ye(t)?[]:a0(e,At(t).sort((n,r)=>n-r)),cs=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},Ga=(e,t,n)=>(e[t]=n,e);function u0(e){const t=ni(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:s}=e,[l,u]=ve.useState(n._getFieldArray(r)),a=ve.useRef(n._getFieldArray(r).map(xn)),f=ve.useRef(!1);n._names.array.add(r),ve.useMemo(()=>s&&l.length>=0&&n.register(r,s),[n,r,l.length,s]),po(()=>n._subjects.array.subscribe({next:({values:k,name:E})=>{if(E===r||!E){const C=ce(k,r);Array.isArray(C)&&(u(C),a.current=C.map(xn))}}}).unsubscribe,[n,r]);const c=ve.useCallback(k=>{f.current=!0,n._setFieldArray(r,k)},[n,r]),h=(k,E)=>{const C=At(Xe(k)),P=is(n._getFieldArray(r),C);n._names.focus=rs(r,P.length-1,E),a.current=is(a.current,C.map(xn)),c(P),u(P),n._setFieldArray(r,P,is,{argA:os(k)})},d=(k,E)=>{const C=At(Xe(k)),P=as(n._getFieldArray(r),C);n._names.focus=rs(r,0,E),a.current=as(a.current,C.map(xn)),c(P),u(P),n._setFieldArray(r,P,as,{argA:os(k)})},p=k=>{const E=us(n._getFieldArray(r),k);a.current=us(a.current,k),c(E),u(E),!Array.isArray(ce(n._fields,r))&&$e(n._fields,r,void 0),n._setFieldArray(r,E,us,{argA:k})},x=(k,E,C)=>{const P=At(Xe(E)),L=ss(n._getFieldArray(r),k,P);n._names.focus=rs(r,k,C),a.current=ss(a.current,k,P.map(xn)),c(L),u(L),n._setFieldArray(r,L,ss,{argA:k,argB:os(E)})},w=(k,E)=>{const C=n._getFieldArray(r);cs(C,k,E),cs(a.current,k,E),c(C),u(C),n._setFieldArray(r,C,cs,{argA:k,argB:E},!1)},g=(k,E)=>{const C=n._getFieldArray(r);ls(C,k,E),ls(a.current,k,E),c(C),u(C),n._setFieldArray(r,C,ls,{argA:k,argB:E},!1)},y=(k,E)=>{const C=Xe(E),P=Ga(n._getFieldArray(r),k,C);a.current=[...P].map((L,q)=>!L||q===k?xn():a.current[q]),c(P),u([...P]),n._setFieldArray(r,P,Ga,{argA:k,argB:C},!0,!1)},v=k=>{const E=At(Xe(k));a.current=E.map(xn),c([...E]),u([...E]),n._setFieldArray(r,[...E],C=>C,{},!0,!1)};return ve.useEffect(()=>{if(n._state.action=!1,_s(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!sr(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!sr(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(k=>{n._updateIsValidating([r]);const E=ce(k.errors,r),C=ce(n._formState.errors,r);(C?!E&&C.type||E&&(C.type!==E.type||C.message!==E.message):E&&E.type)&&(E?$e(n._formState.errors,r,E):it(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const k=ce(n._fields,r);k&&k._f&&!(sr(n._options.reValidateMode).isOnSubmit&&sr(n._options.mode).isOnSubmit)&&js(k,n._names.disabled,n._formValues,n._options.criteriaMode===$t.all,n._options.shouldUseNativeValidation,!0).then(E=>!mt(E)&&n._subjects.state.next({errors:lf(n._formState.errors,E,r)}))}n._subjects.state.next({name:r,values:Xe(n._formValues)}),n._names.focus&&fr(n._fields,(k,E)=>{if(n._names.focus&&E.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._setValid(),f.current=!1},[l,r,n]),ve.useEffect(()=>(!ce(n._formValues,r)&&n._setFieldArray(r),()=>{const k=(E,C)=>{const P=ce(n._fields,E);P&&P._f&&(P._f.mount=C)};n._options.shouldUnregister||o?n.unregister(r):k(r,!1)}),[r,n,i,o]),{swap:ve.useCallback(w,[c,r,n]),move:ve.useCallback(g,[c,r,n]),prepend:ve.useCallback(d,[c,r,n]),append:ve.useCallback(h,[c,r,n]),remove:ve.useCallback(p,[c,r,n]),insert:ve.useCallback(x,[c,r,n]),update:ve.useCallback(y,[c,r,n]),replace:ve.useCallback(v,[c,r,n]),fields:ve.useMemo(()=>l.map((k,E)=>({...k,[i]:a.current[E]||xn()})),[l,i])}}function af(e={}){const t=ve.useRef(void 0),n=ve.useRef(void 0),[r,i]=ve.useState({isDirty:!1,isValidating:!1,isLoading:Et(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Et(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Et(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=l0(e);t.current={...l,formState:r}}const o=t.current.control;return o._options=e,po(()=>{const s=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(l=>({...l,isReady:!0})),o._formState.isReady=!0,s},[o]),ve.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ve.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ve.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ve.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ve.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),ve.useEffect(()=>{var s;e.values&&!Yt(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((s=o._options.resetOptions)===null||s===void 0)&&s.keepIsValid||o._setValid(),n.current=e.values,i(l=>({...l}))):o._resetDefaultValues()},[o,e.values]),ve.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Zc(r,o),t.current}const c0=e=>e.type==="grid",mo=vr({id:Bn(),label:Bn(),description:Bn(),placeholder:Wr(Bn()),required:Wr(ch())}),f0=vr({value:Bn(),label:Bn()});vr({...mo.entries,type:eo("input"),inputType:Wr(ah(["text","date","url"])),suggestions:Wr(Vu(Bn()))});vr({...mo.entries,type:eo("textarea"),rows:Wr(uh())});vr({...mo.entries,type:eo("select"),options:Vu(f0)});vr({...mo.entries,type:eo("checkbox")});const uf=e=>{const t=[];for(const n of e)c0(n)?t.push(...uf(n.fields)):n.required===!0&&t.push(n.id);return t},Ya=e=>e!==void 0&&e!=null&&e!=="",d0=(e,t)=>{const n=uf(e.fields);if(e.type==="single"){const r=t;return r==null?"error":n.every(i=>Ya(r[i]))?"success":"error"}if(e.type==="array"){const r=t,i=e.minFieldCount??0;return r==null||r.length<i?"error":r.every(o=>n.every(s=>Ya(o[s])))?"success":"error"}throw new Error("Invalid section type")},cf=({formKey:e,section:t})=>{const n=m.useMemo(()=>Zi(e),[e]),r=ur(l=>l.forms[n]?.values[t.name]),i=ur(l=>l.setSectionValue),o=ur(l=>l.setError),s=m.useCallback(l=>{i(n,t.name,l);const u=d0(t,l)==="error";o(n,t.name,u)},[n,t,i,o]);return{sectionValue:r,updateSectionValue:s}};function qn({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=m.useRef(e!==void 0),[o,s]=m.useState(t),l=i?e:o,u=m.useCallback(a=>{i||s(a)},[]);return[l,u]}const ri={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};let Xa=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({}),Qa=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const go={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},gn={valid(e){return e===null?null:e?{[Qa.valid]:""}:{[Qa.invalid]:""}}};function ff(e){return m.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[Xa.checked]:""}:{[Xa.unchecked]:""}},...gn}),[e.indeterminate])}const h0={...Lu};let Ja=0;function p0(e,t="mui"){const[n,r]=m.useState(e),i=e||n;return m.useEffect(()=>{n==null&&(Ja+=1,r(`${t}-${Ja}`))},[n,t]),i}const Za=h0.useId;function Rl(e,t){if(Za!==void 0){const n=Za();return e??(t?`${t}-${n}`:n)}return p0(e,t)}function Tn(e){return Rl(e,"base-ui")}const df=m.createContext({invalid:void 0,name:void 0,validityData:{state:go,errors:[],error:"",value:"",initialValue:null},setValidityData:et,disabled:void 0,touched:!1,setTouched:et,dirty:!1,setDirty:et,filled:!1,setFilled:et,focused:!1,setFocused:et,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=yt)=>e,getInputValidationProps:(e=yt)=>e,inputRef:{current:null},commit:async()=>{}}});function Zt(e=!0){const t=m.useContext(df);if(t.setValidityData===et&&!e)throw new Error(wt(28));return t}const m0=m.createContext({disabled:!1});function g0(){return m.useContext(m0)}function zs(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const y0=m.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:et,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Jn(){return m.useContext(y0)}function yo(e){const{enabled:t=!0,value:n,id:r,name:i,controlRef:o,commit:s}=e,{formRef:l}=Jn(),{invalid:u,markedDirtyRef:a,validityData:f,setValidityData:c}=Zt(),h=me(e.getValue);ge(()=>{if(!t)return;let d=n;d===void 0&&(d=h()),f.initialValue===null&&d!==null&&c(p=>({...p,initialValue:d}))},[t,c,n,f.initialValue,h]),ge(()=>{!t||!r||l.current.fields.set(r,{getValue:h,name:i,controlRef:o,validityData:zs(f,u),validate(){let d=n;d===void 0&&(d=h()),a.current=!0,In.flushSync(()=>s(d))}})},[s,o,t,l,h,r,u,a,i,f,n]),ge(()=>{const d=l.current.fields;return()=>{r&&d.delete(r)}},[l,r])}const hf=m.createContext({controlId:void 0,setControlId:et,labelId:void 0,setLabelId:et,messageIds:[],setMessageIds:et,getDescriptionProps:e=>e});function en(){return m.useContext(hf)}const x0=m.createContext(void 0);function b0(e=!0){const t=m.useContext(x0);if(t===void 0&&!e)throw new Error(wt(3));return t}const pf=m.createContext(void 0);function w0(){const e=m.useContext(pf);if(e===void 0)throw new Error(wt(14));return e}const kt="none",Hr="trigger-press",v0="trigger-hover",mf="outside-press",Ri="item-press",Un="input-change",bn="input-clear",xo="focus-out",gf="escape-key",fs="list-navigation",k0="pointer",C0="cancel-open",S0="window-resize";function Te(e,t,n,r){let i=!1,o=!1;const s=yt;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...s}}function Dr(e,t,n){const r=n??yt;return{reason:e,event:t??new Event("base-ui"),...r}}function lr(e,t){const n=m.useRef(e),r=me(t);ge(()=>{n.current!==e&&r(n.current)},[e,r]),ge(()=>{n.current=e},[e])}const E0="data-parent",I0=m.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:o=!1,disabled:s=!1,id:l,indeterminate:u=!1,inputRef:a,name:f,onCheckedChange:c,parent:h=!1,readOnly:d=!1,render:p,required:x=!1,uncheckedValue:w,value:g,nativeButton:y=!1,...v}=t,{clearErrors:k}=Jn(),{disabled:E,name:C,setDirty:P,setFilled:L,setFocused:q,setTouched:O,state:z,validationMode:_,validityData:B,shouldValidateOnChange:D,validation:A}=Zt(),N=g0(),{labelId:Y,controlId:$,setControlId:K,getDescriptionProps:S}=en(),Z=b0(),be=Z?.parent,I=be&&Z.allValues,fe=E||N.disabled||Z?.disabled||s,le=C??f,X=g??le,ue=Tn(),ie=Tn();let we=$;I?we=h?ie:`${be.id}-${X}`:l&&(we=l);let Q={};I&&(h?Q=Z.parent.getParentProps():X&&(Q=Z.parent.getChildProps(X)));const H=me(c),{checked:se=r,indeterminate:ne=u,onCheckedChange:Ae,...ee}=Q,G=Z?.value,oe=Z?.setValue,Ee=Z?.defaultValue,ye=m.useRef(null),{getButtonProps:xe,buttonRef:b}=ei({disabled:fe,native:y}),M=Z?.validation??A,[F,U]=qn({controlled:X&&G&&!h?G.includes(X):se,default:X&&Ee&&!h?Ee.includes(X):o,name:"Checkbox",state:"checked"});ge(()=>{if(K!==et)return K(we),()=>{K(void 0)}},[we,Z,K,h]),yo({enabled:!Z,id:ue,commit:M.commit,value:F,controlRef:ye,name:le,getValue:()=>F});const j=m.useRef(null),T=An(a,j,M.inputRef);ge(()=>{j.current&&(j.current.indeterminate=ne,F&&L(!0))},[F,ne,L]),lr(F,()=>{Z&&!h||(k(le),L(F),P(F!==B.initialValue),D()?M.commit(F):M.commit(F,!0))});const V=Rn({checked:F,disabled:fe,name:h?void 0:le,id:we??void 0,required:x,ref:T,style:ri,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ke){if(ke.nativeEvent.defaultPrevented)return;const de=ke.target.checked,He=Te(kt,ke.nativeEvent);if(Ae?.(de,He),H(de,He),!He.isCanceled&&(U(de),X&&G&&oe&&!h)){const Be=de?[...G,X]:G.filter(De=>De!==X);oe(Be,He)}},onFocus(){ye.current?.focus()}},g!==void 0?{value:(Z?F&&g:g)||""}:yt,S,Z?M.getValidationProps:M.getInputValidationProps),W=I?!!se:F,J=I&&ne||u;m.useEffect(()=>{be&&X&&be.disabledStatesRef.current.set(X,fe)},[be,fe,X]);const he=m.useMemo(()=>({...z,checked:W,disabled:fe,readOnly:d,required:x,indeterminate:J}),[z,W,fe,d,x,J]),Pe=ff(he),Oe=nt("span",t,{state:he,ref:[b,ye,n,Z?.registerControlRef],props:[{id:ue,role:"checkbox","aria-checked":ne?"mixed":F,"aria-readonly":d||void 0,"aria-required":x||void 0,"aria-labelledby":Y,[E0]:h?"":void 0,onFocus(){q(!0)},onBlur(){const ke=j.current;ke&&(O(!0),q(!1),_==="onBlur"&&M.commit(Z?G:ke.checked))},onClick(ke){d||fe||(ke.preventDefault(),j.current?.click())}},S,M.getValidationProps,v,ee,xe],stateAttributesMapping:Pe});return R.jsxs(pf.Provider,{value:he,children:[Oe,!F&&!Z&&le&&!h&&w!==void 0&&R.jsx("input",{type:"hidden",name:le,value:w}),R.jsx("input",{...V})]})});function dt(e){const t=Wt(R0,e).current;return t.next=e,ge(t.effect),t}function R0(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const A0=[];function yf(e){m.useEffect(e,A0)}const gi=null;class T0{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const yi=new T0;class nn{static create(){return new nn}static request(t){return yi.request(t)}static cancel(t){return yi.cancel(t)}currentId=gi;request(t){this.cancel(),this.currentId=yi.request(()=>{this.currentId=gi,t()})}cancel=()=>{this.currentId!==gi&&(yi.cancel(this.currentId),this.currentId=gi)};disposeEffect=()=>this.cancel}function bo(){const e=Wt(nn.create).current;return yf(e.disposeEffect),e}function zn(e){return e==null?e:"current"in e?e.current:e}function P0(e,t=!1,n=!0){const r=bo();return me((i,o=null)=>{r.cancel();const s=zn(e);s!=null&&(typeof s.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function l(){s&&Promise.all(s.getAnimations().map(u=>u.finished)).then(()=>{o!=null&&o.aborted||In.flushSync(i)}).catch(()=>{if(n){if(o!=null&&o.aborted)return;In.flushSync(i)}else s.getAnimations().length>0&&s.getAnimations().some(u=>u.pending||u.playState!=="finished")&&l()})}t?r.request(l):l()}))})}function Sr(e){const{enabled:t=!0,open:n,ref:r,onComplete:i}=e,o=dt(n),s=me(i),l=P0(r,n);m.useEffect(()=>{t&&l(()=>{n===o.current&&s()})},[t,n,s,l,o])}function wo(e,t=!1,n=!1){const[r,i]=m.useState(e&&t?"idle":void 0),[o,s]=m.useState(e);return e&&!o&&(s(!0),i("starting")),!e&&o&&r!=="ending"&&!n&&i("ending"),!e&&!o&&r==="ending"&&i(void 0),ge(()=>{if(!e&&o&&r!=="ending"&&n){const l=nn.request(()=>{i("ending")});return()=>{nn.cancel(l)}}},[e,o,r,n]),ge(()=>{if(!e||t)return;const l=nn.request(()=>{i(void 0)});return()=>{nn.cancel(l)}},[t,e]),ge(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&i("starting");const l=nn.request(()=>{i("idle")});return()=>{nn.cancel(l)}},[t,e,o,i,r]),m.useMemo(()=>({mounted:o,setMounted:s,transitionStatus:r}),[o,r])}let ji=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const O0={[ji.startingStyle]:""},M0={[ji.endingStyle]:""},vo={transitionStatus(e){return e==="starting"?O0:e==="ending"?M0:null}},F0=m.forwardRef(function(t,n){const{render:r,className:i,keepMounted:o=!1,...s}=t,l=w0(),u=l.checked||l.indeterminate,{transitionStatus:a,setMounted:f}=wo(u),c=m.useRef(null),h=m.useMemo(()=>({...l,transitionStatus:a}),[l,a]);Sr({open:u,ref:c,onComplete(){u||f(!1)}});const d=ff(l),p=m.useMemo(()=>({...d,...vo,...gn}),[d]),x=o||u,w=nt("span",t,{enabled:x,ref:[n,c],state:h,stateAttributesMapping:p,props:s});return x?w:null}),L0=({label:e,checked:t,onCheckedChange:n,required:r})=>{const i=m.useId();return R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(I0,{id:i,checked:t,className:"flex items-center justify-center size-4 rounded border border-gray-200 bg-gray-50 data-[checked]:bg-indigo-500 data-[checked]:border-indigo-500 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",onCheckedChange:n,children:R.jsx(F0,{className:"text-white",children:R.jsx(Rh,{})})}),e!=null&&R.jsxs("label",{htmlFor:i,className:"text-sm font-medium text-gray-900 cursor-pointer",children:[e,r===!0&&R.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]})]})};function xf(e){const t=m.useRef(!0);t.current&&(t.current=!1,e())}var zi=Symbol("NOT_FOUND");function D0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function V0(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function N0(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var eu=e=>Array.isArray(e)?e:[e];function _0(e){const t=Array.isArray(e[0])?e[0]:e;return N0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function j0(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function z0(e){let t;return{get(n){return t&&e(t.key,n)?t.value:zi},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function B0(e,t){let n=[];function r(l){const u=n.findIndex(a=>t(l,a.key));if(u>-1){const a=n[u];return u>0&&(n.splice(u,1),n.unshift(a)),a.value}return zi}function i(l,u){r(l)===zi&&(n.unshift({key:l,value:u}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var H0=(e,t)=>e===t;function U0(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function $0(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=H0,maxSize:i=1,resultEqualityCheck:o}=n,s=U0(r);let l=0;const u=i<=1?z0(s):B0(i,s);function a(){let f=u.get(arguments);if(f===zi){if(f=e.apply(null,arguments),l++,o){const h=u.getEntries().find(d=>o(d.value,f));h&&(f=h.value,l!==0&&l--)}u.put(arguments,f)}return f}return a.clearCache=()=>{u.clear(),a.resetResultsCount()},a.resultsCount=()=>l,a.resetResultsCount=()=>{l=0},a}var q0=class{constructor(e){this.value=e}deref(){return this.value}},W0=typeof WeakRef<"u"?WeakRef:q0,K0=0,tu=1;function xi(){return{s:K0,v:void 0,o:null,p:null}}function bf(e,t={}){let n=xi();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let l=n;const{length:u}=arguments;for(let c=0,h=u;c<h;c++){const d=arguments[c];if(typeof d=="function"||typeof d=="object"&&d!==null){let p=l.o;p===null&&(l.o=p=new WeakMap);const x=p.get(d);x===void 0?(l=xi(),p.set(d,l)):l=x}else{let p=l.p;p===null&&(l.p=p=new Map);const x=p.get(d);x===void 0?(l=xi(),p.set(d,l)):l=x}}const a=l;let f;if(l.s===tu)f=l.v;else if(f=e.apply(null,arguments),o++,r){const c=i?.deref?.()??i;c!=null&&r(c,f)&&(f=c,o!==0&&o--),i=typeof f=="object"&&f!==null||typeof f=="function"?new W0(f):f}return a.s=tu,a.v=f,f}return s.clearCache=()=>{n=xi(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function wf(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,s=0,l,u={},a=i.pop();typeof a=="object"&&(u=a,a=i.pop()),D0(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const f={...n,...u},{memoize:c,memoizeOptions:h=[],argsMemoize:d=bf,argsMemoizeOptions:p=[]}=f,x=eu(h),w=eu(p),g=_0(i),y=c(function(){return o++,a.apply(null,arguments)},...x),v=d(function(){s++;const E=j0(g,arguments);return l=y.apply(null,E),l},...w);return Object.assign(v,{resultFunc:a,memoizedResultFunc:y,dependencies:g,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>l,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:c,argsMemoize:d})};return Object.assign(r,{withTypes:()=>r}),r}var G0=wf(bf),Y0=Object.assign((e,t=G0)=>{V0(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((s,l,u)=>(s[n[u]]=l,s),{}))},{withTypes:()=>Y0});wf({memoize:$0,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ae=(e,t,n,r,i,o,...s)=>{if(s.length>0)throw new Error(wt(1));let l;if(e)l=e;else throw new Error("Missing arguments");return l};var X0=fh();const Q0=wl(19),J0=Q0?Z0:ev;function te(e,t,n,r,i){return J0(e,t,n,r,i)}function Z0(e,t,n,r,i){const o=m.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return X0.useSyncExternalStore(e.subscribe,o,o)}function ev(e,t,n,r,i){return dh.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,i))}class Wn{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Wn.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Wn.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Wn.prototype.setState.call(this,t)}}class tv extends Wn{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}controlledValues=new Map;useSyncedValue(t,n){m.useDebugValue(t),ge(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){ge(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){const n=Object.values(t);ge(()=>{this.update(t)},n)}useControlledProp(t,n,r){m.useDebugValue(t);const i=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,i),!i&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})),ge(()=>{i&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r,i])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.update(n)}setState(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.setState({...this.state,...n})}select=(t,n,r,i)=>{const o=this.selectors[t];return o(this.state,n,r,i)};useState=(t,n,r,i)=>{m.useDebugValue(t);const o=this.selectors[t];return te(this,o,n,r,i)};useContextCallback(t,n){m.useDebugValue(t);const r=me(n??et);this.context[t]=r}useStateSetter(t){const n=m.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(o=>{const s=r(o);if(!Object.is(i,s)){const l=i;i=s,n(s,l,this)}})}}const Vr=0;class yr{static create(){return new yr}currentId=Vr;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Vr,n()},t)}isStarted(){return this.currentId!==Vr}clear=()=>{this.currentId!==Vr&&(clearTimeout(this.currentId),this.currentId=Vr)};disposeEffect=()=>this.clear}function Nt(){const e=Wt(yr.create).current;return yf(e.disposeEffect),e}const Zn=typeof navigator<"u",ds=ov(),vf=lv(),Al=sv(),kf=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),nv=ds.platform==="MacIntel"&&ds.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ds.platform),nu=Zn&&/firefox/i.test(Al),rv=Zn&&/apple/i.test(navigator.vendor),Bi=Zn&&/android/i.test(vf)||/android/i.test(Al);Zn&&vf.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const iv=Al.includes("jsdom/");function ov(){if(!Zn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function sv(){if(!Zn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function lv(){if(!Zn)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Bs="data-base-ui-focusable",Cf="active",Sf="selected",av="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Sn="ArrowLeft",En="ArrowRight",Tl="ArrowUp",ii="ArrowDown";function vn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function We(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ps(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ct(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Gt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function uv(e){return e.matches("html,body")}function vt(e){return e?.ownerDocument||document}function Ef(e){return ut(e)&&e.matches(av)}function Hs(e){return e?e.getAttribute("role")==="combobox"&&Ef(e):!1}function Hi(e){return e?e.hasAttribute(Bs)?e:e.querySelector(`[${Bs}]`)||e:null}function dr(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...dr(e,i.id,n)])}function ru(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(o=>o.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function at(e){e.preventDefault(),e.stopPropagation()}function cv(e){return"nativeEvent"in e}function If(e){return e.mozInputSource===0&&e.isTrusted?!0:Bi&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rf(e){return iv?!1:!Bi&&e.width===0&&e.height===0||Bi&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function iu(e,t){return["mouse","pen"].includes(e)}function Af(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const fv=["top","right","bottom","left"],xr=Math.min,Dt=Math.max,Ui=Math.round,ar=Math.floor,rn=e=>({x:e,y:e}),dv={left:"right",right:"left",bottom:"top",top:"bottom"},hv={start:"end",end:"start"};function Us(e,t,n){return Dt(e,xr(t,n))}function hn(e,t){return typeof e=="function"?e(t):e}function jt(e){return e.split("-")[0]}function Fn(e){return e.split("-")[1]}function Pl(e){return e==="x"?"y":"x"}function Ol(e){return e==="y"?"height":"width"}const pv=new Set(["top","bottom"]);function qt(e){return pv.has(jt(e))?"y":"x"}function Ml(e){return Pl(qt(e))}function mv(e,t,n){n===void 0&&(n=!1);const r=Fn(e),i=Ml(e),o=Ol(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=$i(s)),[s,$i(s)]}function gv(e){const t=$i(e);return[$s(e),t,$s(t)]}function $s(e){return e.replace(/start|end/g,t=>hv[t])}const ou=["left","right"],su=["right","left"],yv=["top","bottom"],xv=["bottom","top"];function bv(e,t,n){switch(e){case"top":case"bottom":return n?t?su:ou:t?ou:su;case"left":case"right":return t?yv:xv;default:return[]}}function wv(e,t,n,r){const i=Fn(e);let o=bv(jt(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map($s)))),o}function $i(e){return e.replace(/left|right|bottom|top/g,t=>dv[t])}function vv(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tf(e){return typeof e!="number"?vv(e):{top:e,right:e,bottom:e,left:e}}function qi(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bi(e,t,n){return Math.floor(e/t)!==n}function Ur(e,t){return t<0||t>=e.current.length}function hs(e,t){return gt(e,{disabledIndices:t})}function lu(e,t){return gt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function gt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let o=t;do o+=n?-i:i;while(o>=0&&o<=e.current.length-1&&$r(e,o,r));return o}function kv(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:o,disabledIndices:s,minIndex:l,maxIndex:u,prevIndex:a,stopEvent:f=!1}){let c=a;const h=[],d={};let p=!1;{let g=null,y=-1;e.current.forEach((v,k)=>{if(v==null)return;const E=v.closest('[role="row"]');E&&(p=!0),(E!==g||y===-1)&&(g=E,y+=1,h[y]=[]),h[y].push(k),d[k]=y})}const x=p&&h.length>0&&h.some(g=>g.length!==o);function w(g){if(!x||a===-1)return;const y=d[a];if(y==null)return;const v=h[y].indexOf(a);let k=g==="up"?y-1:y+1;r&&(k<0?k=h.length-1:k>=h.length&&(k=0));const E=new Set;for(;k>=0&&k<h.length&&!E.has(k);){E.add(k);const C=h[k];if(C.length===0){k=g==="up"?k-1:k+1;continue}const P=Math.min(v,C.length-1);for(let L=P;L>=0;L-=1){const q=C[L];if(!$r(e,q,s))return q}k=g==="up"?k-1:k+1,r&&(k<0?k=h.length-1:k>=h.length&&(k=0))}}if(t.key===Tl){const g=w("up");if(g!==void 0)f&&at(t),c=g;else{if(f&&at(t),a===-1)c=u;else if(c=gt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),r&&(a-o<l||c<0)){const y=a%o,v=u%o,k=u-(v-y);v===y?c=u:c=v>y?k:k-o}Ur(e,c)&&(c=a)}}if(t.key===ii){const g=w("down");g!==void 0?(f&&at(t),c=g):(f&&at(t),a===-1?c=l:(c=gt(e,{startingIndex:a,amount:o,disabledIndices:s}),r&&a+o>u&&(c=gt(e,{startingIndex:a%o-o,amount:o,disabledIndices:s}))),Ur(e,c)&&(c=a))}if(n==="both"){const g=ar(a/o);t.key===(i?Sn:En)&&(f&&at(t),a%o!==o-1?(c=gt(e,{startingIndex:a,disabledIndices:s}),r&&bi(c,o,g)&&(c=gt(e,{startingIndex:a-a%o-1,disabledIndices:s}))):r&&(c=gt(e,{startingIndex:a-a%o-1,disabledIndices:s})),bi(c,o,g)&&(c=a)),t.key===(i?En:Sn)&&(f&&at(t),a%o!==0?(c=gt(e,{startingIndex:a,decrement:!0,disabledIndices:s}),r&&bi(c,o,g)&&(c=gt(e,{startingIndex:a+(o-a%o),decrement:!0,disabledIndices:s}))):r&&(c=gt(e,{startingIndex:a+(o-a%o),decrement:!0,disabledIndices:s})),bi(c,o,g)&&(c=a));const y=ar(u/o)===g;Ur(e,c)&&(r&&y?c=t.key===(i?En:Sn)?u:gt(e,{startingIndex:a-a%o-1,disabledIndices:s}):c=a)}return c}function Cv(e,t,n){const r=[];let i=0;return e.forEach(({width:o,height:s},l)=>{let u=!1;for(n&&(i=0);!u;){const a=[];for(let f=0;f<o;f+=1)for(let c=0;c<s;c+=1)a.push(i+f+c*t);i%t+o<=t&&a.every(f=>r[f]==null)?(a.forEach(f=>{r[f]=l}),u=!0):i+=1}}),[...r]}function Sv(e,t,n,r,i){if(e===-1)return-1;const o=n.indexOf(e),s=t[e];switch(i){case"tl":return o;case"tr":return s?o+s.width-1:o;case"bl":return s?o+(s.height-1)*r:o;case"br":return n.lastIndexOf(e);default:return-1}}function Ev(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function $r(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}var Iv=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Wi=Iv.join(","),Pf=typeof Element>"u",br=Pf?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ki=!Pf&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Yr=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&Yr(t.parentNode);return s},Rv=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Of=function(t,n,r){if(Yr(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Wi));return n&&br.call(t,Wi)&&i.unshift(t),i=i.filter(r),i},Gi=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!Yr(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),u=l.length?l:s.children,a=Gi(u,!0,r);r.flatten?i.push.apply(i,a):i.push({scopeParent:s,candidates:a})}else{var f=br.call(s,Wi);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!Yr(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=Gi(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},Mf=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ff=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Rv(t))&&!Mf(t)?0:t.tabIndex},Av=function(t,n){var r=Ff(t);return r<0&&n&&!Mf(t)?0:r},Tv=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Lf=function(t){return t.tagName==="INPUT"},Pv=function(t){return Lf(t)&&t.type==="hidden"},Ov=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Mv=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Fv=function(t){if(!t.name)return!0;var n=t.form||Ki(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=Mv(i,t.form);return!o||o===t},Lv=function(t){return Lf(t)&&t.type==="radio"},Dv=function(t){return Lv(t)&&!Fv(t)},Vv=function(t){var n,r=t&&Ki(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,l,u;for(o=!!((s=i)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(i)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!o&&i;){var a,f,c;r=Ki(i),i=(a=r)===null||a===void 0?void 0:a.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},au=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},Nv=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=br.call(t,"details>summary:first-of-type"),l=s?t.parentElement:t;if(br.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var u=t;t;){var a=t.parentElement,f=Ki(t);if(a&&!a.shadowRoot&&i(a)===!0)return au(t);t.assignedSlot?t=t.assignedSlot:!a&&f!==t.ownerDocument?t=f.host:t=a}t=u}if(Vv(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return au(t);return!1},_v=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return br.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},qs=function(t,n){return!(n.disabled||Yr(n)||Pv(n)||Nv(n,t)||Ov(n)||_v(n))},Ws=function(t,n){return!(Dv(n)||Ff(n)<0||!qs(t,n))},jv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Df=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,l=s?i.scopeParent:i,u=Av(l,s),a=s?Df(i.candidates):l;u===0?s?n.push.apply(n,a):n.push(l):r.push({documentOrder:o,tabIndex:u,item:i,isScope:s,content:a})}),r.sort(Tv).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ko=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Gi([t],n.includeContainer,{filter:Ws.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:jv}):r=Of(t,n.includeContainer,Ws.bind(null,n)),Df(r)},zv=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Gi([t],n.includeContainer,{filter:qs.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Of(t,n.includeContainer,qs.bind(null,n)),r},Vf=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return br.call(t,Wi)===!1?!1:Ws(n,t)};const oi=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Nf(e,t){const n=ko(e,oi()),r=n.length;if(r===0)return;const i=vn(vt(e)),o=n.indexOf(i),s=o===-1?t===1?0:r-1:o+t;return n[s]}function _f(e){return Nf(vt(e).body,1)||e}function jf(e){return Nf(vt(e).body,-1)||e}function qr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!We(n,r)}function Bv(e){ko(e,oi()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function uu(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Hv(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const Uv=m.createContext(null),$v=m.createContext(null),zf=()=>m.useContext(Uv)?.id||null,Co=e=>{const t=m.useContext($v);return e??t};function Yi(e){return`data-base-ui-${e}`}function Pn(e){return e?.ownerDocument||document}const Xi=m.forwardRef(function(t,n){const[r,i]=m.useState();ge(()=>{rv&&i("button")},[]);const o={tabIndex:0,role:r};return R.jsx("span",{...t,ref:n,style:ri,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});let cu=0;function Ai(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(cu);const o=()=>e?.focus({preventScroll:n});i?o():cu=requestAnimationFrame(o)}const hr={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function fu(e){return e==="inert"?hr.inert:e==="aria-hidden"?hr["aria-hidden"]:hr.none}let wi=new WeakSet,vi={},ps=0;const Bf=e=>e&&(e.host||Bf(e.parentNode)),qv=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Bf(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Wv(e,t,n,r){const i="data-base-ui-inert",o=r?"inert":n?"aria-hidden":null,s=qv(t,e),l=new Set,u=new Set(s),a=[];vi[i]||(vi[i]=new WeakMap);const f=vi[i];s.forEach(c),h(t),l.clear();function c(d){!d||l.has(d)||(l.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||u.has(d)||[].forEach.call(d.children,p=>{if(Mn(p)!=="script")if(l.has(p))h(p);else{const x=o?p.getAttribute(o):null,w=x!==null&&x!=="false",g=fu(o),y=(g.get(p)||0)+1,v=(f.get(p)||0)+1;g.set(p,y),f.set(p,v),a.push(p),y===1&&w&&wi.add(p),v===1&&p.setAttribute(i,""),!w&&o&&p.setAttribute(o,o==="inert"?"":"true")}})}return ps+=1,()=>{a.forEach(d=>{const p=fu(o),w=(p.get(d)||0)-1,g=(f.get(d)||0)-1;p.set(d,w),f.set(d,g),w||(!wi.has(d)&&o&&d.removeAttribute(o),wi.delete(d)),g||d.removeAttribute(i)}),ps-=1,ps||(hr.inert=new WeakMap,hr["aria-hidden"]=new WeakMap,hr.none=new WeakMap,wi=new WeakSet,vi={})}}function Kv(e,t=!1,n=!1){const r=vt(e[0]).body;return Wv(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Hf=m.createContext(null),Uf=()=>m.useContext(Hf),Gv=Yi("portal");function Yv(e={}){const{ref:t,container:n,componentProps:r=yt,elementProps:i,elementState:o}=e,s=Rl(),u=Uf()?.portalNode,[a,f]=m.useState(null),[c,h]=m.useState(null),d=m.useRef(null);ge(()=>{if(n===null){d.current&&(d.current=null,h(null),f(null));return}if(s==null)return;const w=(n&&(xl(n)?n:n.current))??u??document.body;if(w==null){d.current&&(d.current=null,h(null),f(null));return}d.current!==w&&(d.current=w,h(null),f(w))},[n,u,s]);const p=nt("div",r,{ref:[t,h],state:o,props:[{id:s,[Gv]:""},i]});return{portalNode:c,portalSubtree:a&&p?In.createPortal(p,a):null}}const $f=m.forwardRef(function(t,n){const{children:r,container:i,className:o,render:s,renderGuards:l,...u}=t,{portalNode:a,portalSubtree:f}=Yv({container:i,ref:n,componentProps:t,elementProps:u}),c=m.useRef(null),h=m.useRef(null),d=m.useRef(null),p=m.useRef(null),[x,w]=m.useState(null),g=x?.modal,y=x?.open,v=typeof l=="boolean"?l:!!x&&!x.modal&&x.open&&!!a;m.useEffect(()=>{if(!a||g)return;function E(C){a&&qr(C)&&(C.type==="focusin"?uu:Bv)(a)}return a.addEventListener("focusin",E,!0),a.addEventListener("focusout",E,!0),()=>{a.removeEventListener("focusin",E,!0),a.removeEventListener("focusout",E,!0)}},[a,g]),m.useEffect(()=>{!a||y||uu(a)},[y,a]);const k=m.useMemo(()=>({beforeOutsideRef:c,afterOutsideRef:h,beforeInsideRef:d,afterInsideRef:p,portalNode:a,setFocusManagerState:w}),[a]);return R.jsxs(m.Fragment,{children:[f,R.jsxs(Hf.Provider,{value:k,children:[v&&a&&R.jsx(Xi,{"data-type":"outside",ref:c,onFocus:E=>{if(qr(E,a))d.current?.focus();else{const C=x?x.domReference:null;jf(C)?.focus()}}}),v&&a&&R.jsx("span",{"aria-owns":a.id,style:Lw}),a&&In.createPortal(r,a),v&&a&&R.jsx(Xi,{"data-type":"outside",ref:h,onFocus:E=>{if(qr(E,a))p.current?.focus();else{const C=x?x.domReference:null;_f(C)?.focus(),x?.closeOnFocusOut&&x?.onOpenChange(!1,Te(xo,E.nativeEvent))}}})]})]})});function Xv(e,t){const n=ft(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const du=20;let kn=[];function Fl(){kn=kn.filter(e=>e.isConnected)}function Qv(e){Fl(),e&&Mn(e)!=="body"&&(kn.push(e),kn.length>du&&(kn=kn.slice(-du)))}function ms(){return Fl(),kn[kn.length-1]}function Jv(e){if(!e)return null;const t=oi();return Vf(e,t)?e:ko(e,t)[0]||e}function Zv(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():zt(e).display!=="none"}function hu(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=oi(),i=zv(e,n).filter(s=>{const l=s.getAttribute("data-tabindex")||"";return Vf(s,n)||s.hasAttribute("data-tabindex")&&!l.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function qf(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],initialFocus:o=!0,returnFocus:s=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:a=!0,openInteractionType:f="",getInsideElements:c=()=>[],nextFocusableElement:h,previousFocusableElement:d,beforeContentFocusGuardRef:p,externalTree:x}=e,w="rootStore"in t?t.rootStore:t,g=w.useState("open"),y=w.useState("domReferenceElement"),v=w.useState("floatingElement"),{events:k,dataRef:E}=w.context,C=me(()=>E.current.floatingContext?.nodeId),P=me(c),L=o===!1,q=Hs(y)&&L,O=dt(i),z=dt(o),_=dt(s),B=dt(f),D=Co(x),A=Uf(),N=m.useRef(null),Y=m.useRef(null),$=m.useRef(!1),K=m.useRef(!1),S=m.useRef(!1),Z=m.useRef(-1),be=m.useRef(""),I=m.useRef(""),fe=Nt(),le=Nt(),X=bo(),ue=A!=null,ie=Hi(v),we=me((G=ie)=>G?ko(G,oi()):[]),Q=me(G=>{const oe=we(G);return O.current.map(()=>oe).filter(Boolean).flat()});m.useEffect(()=>{if(r||!u)return;function G(Ee){Ee.key==="Tab"&&We(ie,vn(vt(ie)))&&we().length===0&&!q&&at(Ee)}const oe=vt(ie);return oe.addEventListener("keydown",G),()=>{oe.removeEventListener("keydown",G)}},[r,y,ie,u,O,q,we,Q]),m.useEffect(()=>{if(r||!v)return;function G(oe){const Ee=Ct(oe),xe=we().indexOf(Ee);xe!==-1&&(Z.current=xe)}return v.addEventListener("focusin",G),()=>{v.removeEventListener("focusin",G)}},[r,v,we]),m.useEffect(()=>{if(r||!g)return;const G=vt(ie);function oe(){S.current=!1}function Ee(xe){const b=Ct(xe),M=We(v,b)||We(y,b)||We(A?.portalNode,b);S.current=!M,I.current=xe.pointerType||"keyboard"}function ye(){I.current="keyboard"}return G.addEventListener("pointerdown",Ee,!0),G.addEventListener("pointerup",oe,!0),G.addEventListener("pointercancel",oe,!0),G.addEventListener("keydown",ye,!0),()=>{G.removeEventListener("pointerdown",Ee,!0),G.removeEventListener("pointerup",oe,!0),G.removeEventListener("pointercancel",oe,!0),G.removeEventListener("keydown",ye,!0)}},[r,v,y,ie,g,A]),m.useEffect(()=>{if(r||!a)return;function G(){K.current=!0,le.start(0,()=>{K.current=!1})}function oe(b){const M=b.relatedTarget,F=b.currentTarget,U=Ct(b);queueMicrotask(()=>{const j=C(),T=w.context.triggerElements,V=!(We(y,M)||We(v,M)||We(M,v)||We(A?.portalNode,M)||M!=null&&T.hasElement(M)||T.hasMatchingElement(W=>We(W,M))||M?.hasAttribute(Yi("focus-guard"))||D&&(dr(D.nodesRef.current,j).find(W=>We(W.context?.elements.floating,M)||We(W.context?.elements.domReference,M))||ru(D.nodesRef.current,j).find(W=>[W.context?.elements.floating,Hi(W.context?.elements.floating)].includes(M)||W.context?.elements.domReference===M)));if(F===y&&ie&&hu(ie,O),l&&F!==y&&!Zv(U)&&vn(vt(ie))===vt(ie).body){if(ut(ie)&&(ie.focus(),l==="popup")){X.request(()=>{ie.focus()});return}const W=Z.current,J=we(),he=J[W]||J[J.length-1]||ie;ut(he)&&he.focus()}if(E.current.insideReactTree){E.current.insideReactTree=!1;return}(q||!u)&&M&&V&&!K.current&&(q||M!==ms())&&($.current=!0,w.setOpen(!1,Te(xo,b)))})}function Ee(){S.current||(E.current.insideReactTree=!0,fe.start(0,()=>{E.current.insideReactTree=!1}))}const ye=ut(y)?y:null,xe=[];if(!(!v&&!ye))return ye&&(ye.addEventListener("focusout",oe),ye.addEventListener("pointerdown",G),xe.push(()=>{ye.removeEventListener("focusout",oe),ye.removeEventListener("pointerdown",G)})),v&&(v.addEventListener("focusout",oe),A&&(v.addEventListener("focusout",Ee,!0),xe.push(()=>{v.removeEventListener("focusout",Ee,!0)})),xe.push(()=>{v.removeEventListener("focusout",oe)})),()=>{xe.forEach(b=>{b()})}},[r,y,v,ie,u,D,A,w,a,l,we,q,C,O,E,fe,le,X]);const H=m.useRef(null),se=m.useRef(null),ne=An(H,p,A?.beforeInsideRef),Ae=An(se,A?.afterInsideRef);m.useEffect(()=>{if(r||!v||!g)return;const G=Array.from(A?.portalNode?.querySelectorAll(`[${Yi("portal")}]`)||[]),Ee=(D?ru(D.nodesRef.current,C()):[]).find(b=>Hs(b.context?.elements.domReference||null))?.context?.elements.domReference,ye=[v,Ee,...G,...P(),N.current,Y.current,H.current,se.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,zn(d),zn(h),q?y:null].filter(b=>b!=null),xe=Kv(ye,u||q);return()=>{xe()}},[g,r,y,v,u,O,A,q,D,C,P,h,d]),ge(()=>{if(!g||r||!ut(ie))return;const G=vt(ie),oe=vn(G);queueMicrotask(()=>{const Ee=Q(ie),ye=z.current,xe=typeof ye=="function"?ye(B.current||""):ye;if(xe===void 0||xe===!1)return;let b;xe===!0||xe===null?b=Ee[0]||ie:b=zn(xe),b=b||Ee[0]||ie,!We(ie,oe)&&Ai(b,{preventScroll:b===ie})})},[r,g,ie,L,Q,z,B]),ge(()=>{if(r||!ie)return;const G=vt(ie),oe=vn(G);Qv(oe);function Ee(b){if(b.open||(be.current=Xv(b.nativeEvent,I.current)),b.reason===v0&&b.nativeEvent.type==="mouseleave"&&($.current=!0),b.reason===mf)if(b.nested)$.current=!1;else if(If(b.nativeEvent)||Rf(b.nativeEvent))$.current=!1;else{let M=!1;document.createElement("div").focus({get preventScroll(){return M=!0,!1}}),M?$.current=!1:$.current=!0}}k.on("openchange",Ee);const ye=G.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,ri),ue&&y&&y.insertAdjacentElement("afterend",ye);function xe(){const b=_.current;let M=typeof b=="function"?b(be.current):b;if(M===void 0||M===!1)return null;if(M===null&&(M=!0),typeof M=="boolean"){const U=y||ms();return U&&U.isConnected?U:ye}const F=y||ms()||ye;return zn(M)||F}return()=>{k.off("openchange",Ee);const b=vn(G),M=We(v,b)||D&&dr(D.nodesRef.current,C(),!1).some(U=>We(U.context?.elements.floating,b)),F=xe();queueMicrotask(()=>{const U=Jv(F),j=typeof _.current!="boolean";_.current&&!$.current&&ut(U)&&(!(!j&&U!==b&&b!==G.body)||M)&&U.focus({preventScroll:!0}),ye.remove()})}},[r,v,ie,_,E,k,D,ue,y,C]),m.useEffect(()=>{queueMicrotask(()=>{$.current=!1})},[r]),m.useEffect(()=>{if(r||!g)return;function G(Ee){Ct(Ee)?.closest(`[${Fw}]`)&&(K.current=!0)}const oe=vt(ie);return oe.addEventListener("pointerdown",G,!0),()=>{oe.removeEventListener("pointerdown",G,!0)}},[r,g,ie]),ge(()=>{if(!r&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:a,open:g,onOpenChange:w.setOpen,domReference:y}),()=>{A.setFocusManagerState(null)}},[r,A,u,g,w,a,y]),ge(()=>{if(!(r||!ie))return hu(ie,O),()=>{queueMicrotask(Fl)}},[r,ie,O]);const ee=!r&&(u?!q:!0)&&(ue||u);return R.jsxs(m.Fragment,{children:[ee&&R.jsx(Xi,{"data-type":"inside",ref:ne,onFocus:G=>{if(u){const oe=Q();Ai(oe[oe.length-1])}else A?.portalNode&&($.current=!1,qr(G,A.portalNode)?_f(y)?.focus():zn(d??A.beforeOutsideRef)?.focus())}}),n,ee&&R.jsx(Xi,{"data-type":"inside",ref:Ae,onFocus:G=>{u?Ai(Q()[0]):A?.portalNode&&(a&&($.current=!0),qr(G,A.portalNode)?jf(y)?.focus():zn(h??A.afterOutsideRef)?.focus())}})]})}function Wf(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:o="click",toggle:s=!0,ignoreMouse:l=!1,stickIfOpen:u=!0,touchOpenDelay:a=0}=t,f=m.useRef(void 0),c=bo(),h=Nt(),d=m.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const x=f.current,w=p.nativeEvent,g=n.select("open");if(p.button!==0||o==="click"||iu(x)&&l)return;const y=r.current.openEvent,v=y?.type,k=n.select("domReferenceElement")!==p.currentTarget,E=g&&k||!(g&&s&&(!(y&&u)||v==="click"||v==="mousedown"));if(Ef(w.target)){const P=Te(Hr,w,w.target);E&&x==="touch"&&a>0?h.start(a,()=>{n.setOpen(!0,P)}):n.setOpen(E,P);return}const C=p.currentTarget;c.request(()=>{const P=Te(Hr,w,C);E&&x==="touch"&&a>0?h.start(a,()=>{n.setOpen(!0,P)}):n.setOpen(E,P)})},onClick(p){if(o==="mousedown-only")return;const x=f.current;if(o==="mousedown"&&x){f.current=void 0;return}if(iu(x)&&l)return;const w=n.select("open"),g=r.current.openEvent,y=n.select("domReferenceElement")!==p.currentTarget,v=w&&y||!(w&&s&&(!(g&&u)||Af(g))),k=Te(Hr,p.nativeEvent,p.currentTarget);v&&x==="touch"&&a>0?h.start(a,()=>{n.setOpen(!0,k)}):n.setOpen(v,k)},onKeyDown(){f.current=void 0}}),[r,o,l,n,u,s,c,h,a]);return m.useMemo(()=>i?{reference:d}:yt,[i,d])}function pu(e,t,n){let{reference:r,floating:i}=e;const o=qt(t),s=Ml(t),l=Ol(s),u=jt(t),a=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let d;switch(u){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(Fn(t)){case"start":d[s]-=h*(n&&a?-1:1);break;case"end":d[s]+=h*(n&&a?-1:1);break}return d}const ek=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=pu(a,r,u),h=r,d={},p=0;for(let x=0;x<l.length;x++){const{name:w,fn:g}=l[x],{x:y,y:v,data:k,reset:E}=await g({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:a,platform:s,elements:{reference:e,floating:t}});f=y??f,c=v??c,d={...d,[w]:{...d[w],...k}},E&&p<=50&&(p++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(a=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:f,y:c}=pu(a,h,u)),x=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function Xr(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=hn(t,e),p=Tf(d),w=l[h?c==="floating"?"reference":"floating":c],g=qi(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:a,rootBoundary:f,strategy:u})),y=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},E=qi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:u}):y);return{top:(g.top-E.top+p.top)/k.y,bottom:(E.bottom-g.bottom+p.bottom)/k.y,left:(g.left-E.left+p.left)/k.x,right:(E.right-g.right+p.right)/k.x}}const tk=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:u,elements:a}=t,{mainAxis:f=!0,crossAxis:c=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:x=!0,...w}=hn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=jt(i),y=qt(l),v=jt(l)===l,k=await(u.isRTL==null?void 0:u.isRTL(a.floating)),E=h||(v||!x?[$i(l)]:gv(l)),C=p!=="none";!h&&C&&E.push(...wv(l,x,p,k));const P=[l,...E],L=await Xr(t,w),q=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&q.push(L[g]),c){const D=mv(i,s,k);q.push(L[D[0]],L[D[1]])}if(O=[...O,{placement:i,overflows:q}],!q.every(D=>D<=0)){var z,_;const D=(((z=o.flip)==null?void 0:z.index)||0)+1,A=P[D];if(A&&(!(c==="alignment"?y!==qt(A):!1)||O.every($=>qt($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:D,overflows:O},reset:{placement:A}};let N=(_=O.filter(Y=>Y.overflows[0]<=0).sort((Y,$)=>Y.overflows[1]-$.overflows[1])[0])==null?void 0:_.placement;if(!N)switch(d){case"bestFit":{var B;const Y=(B=O.filter($=>{if(C){const K=qt($.placement);return K===y||K==="y"}return!0}).map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,S)=>K+S,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:B[0];Y&&(N=Y);break}case"initialPlacement":N=l;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function mu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gu(e){return fv.some(t=>e[t]>=0)}const nk=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=hn(e,t);switch(r){case"referenceHidden":{const o=await Xr(t,{...i,elementContext:"reference"}),s=mu(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:gu(s)}}}case"escaped":{const o=await Xr(t,{...i,altBoundary:!0}),s=mu(o,n.floating);return{data:{escapedOffsets:s,escaped:gu(s)}}}default:return{}}}}},Kf=new Set(["left","top"]);async function rk(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=jt(n),l=Fn(n),u=qt(n)==="y",a=Kf.has(s)?-1:1,f=o&&u?-1:1,c=hn(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:p}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return l&&typeof p=="number"&&(d=l==="end"?p*-1:p),u?{x:d*f,y:h*a}:{x:h*a,y:d*f}}const ik=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=t,u=await rk(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},ok=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x:g,y}=w;return{x:g,y}}},...u}=hn(e,t),a={x:n,y:r},f=await Xr(t,u),c=qt(jt(i)),h=Pl(c);let d=a[h],p=a[c];if(o){const w=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=d+f[w],v=d-f[g];d=Us(y,d,v)}if(s){const w=c==="y"?"top":"left",g=c==="y"?"bottom":"right",y=p+f[w],v=p-f[g];p=Us(y,p,v)}const x=l.fn({...t,[h]:d,[c]:p});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:o,[c]:s}}}}}},sk=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:a=!0}=hn(e,t),f={x:n,y:r},c=qt(i),h=Pl(c);let d=f[h],p=f[c];const x=hn(l,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const v=h==="y"?"height":"width",k=o.reference[h]-o.floating[v]+w.mainAxis,E=o.reference[h]+o.reference[v]-w.mainAxis;d<k?d=k:d>E&&(d=E)}if(a){var g,y;const v=h==="y"?"width":"height",k=Kf.has(jt(i)),E=o.reference[c]-o.floating[v]+(k&&((g=s.offset)==null?void 0:g[c])||0)+(k?0:w.crossAxis),C=o.reference[c]+o.reference[v]+(k?0:((y=s.offset)==null?void 0:y[c])||0)-(k?w.crossAxis:0);p<E?p=E:p>C&&(p=C)}return{[h]:d,[c]:p}}}},lk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:l}=t,{apply:u=()=>{},...a}=hn(e,t),f=await Xr(t,a),c=jt(i),h=Fn(i),d=qt(i)==="y",{width:p,height:x}=o.floating;let w,g;c==="top"||c==="bottom"?(w=c,g=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(g=c,w=h==="end"?"top":"bottom");const y=x-f.top-f.bottom,v=p-f.left-f.right,k=xr(x-f[w],y),E=xr(p-f[g],v),C=!t.middlewareData.shift;let P=k,L=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=y),C&&!h){const O=Dt(f.left,0),z=Dt(f.right,0),_=Dt(f.top,0),B=Dt(f.bottom,0);d?L=p-2*(O!==0||z!==0?O+z:Dt(f.left,f.right)):P=x-2*(_!==0||B!==0?_+B:Dt(f.top,f.bottom))}await u({...t,availableWidth:L,availableHeight:P});const q=await s.getDimensions(l.floating);return p!==q.width||x!==q.height?{reset:{rects:!0}}:{}}}};function Gf(e){const t=zt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ut(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,l=Ui(n)!==o||Ui(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ll(e){return Je(e)?e:e.contextElement}function pr(e){const t=Ll(e);if(!ut(t))return rn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Gf(t);let s=(o?Ui(n.width):n.width)/r,l=(o?Ui(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const ak=rn(0);function Yf(e){const t=ft(e);return!ao()||!t.visualViewport?ak:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ft(e)?!1:t}function Gn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ll(e);let s=rn(1);t&&(r?Je(r)&&(s=pr(r)):s=pr(e));const l=uk(o,n,r)?Yf(o):rn(0);let u=(i.left+l.x)/s.x,a=(i.top+l.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=ft(o),d=r&&Je(r)?ft(r):r;let p=h,x=Os(p);for(;x&&r&&d!==p;){const w=pr(x),g=x.getBoundingClientRect(),y=zt(x),v=g.left+(x.clientLeft+parseFloat(y.paddingLeft))*w.x,k=g.top+(x.clientTop+parseFloat(y.paddingTop))*w.y;u*=w.x,a*=w.y,f*=w.x,c*=w.y,u+=v,a+=k,p=ft(x),x=Os(p)}}return qi({width:f,height:c,x:u,y:a})}function So(e,t){const n=uo(e).scrollLeft;return t?t.left+n:Gn(sn(e)).left+n}function Xf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-So(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function ck(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=sn(r),l=t?lo(t.floating):!1;if(r===s||l&&o)return n;let u={scrollLeft:0,scrollTop:0},a=rn(1);const f=rn(0),c=ut(r);if((c||!c&&!o)&&((Mn(r)!=="body"||Qn(s))&&(u=uo(r)),ut(r))){const d=Gn(r);a=pr(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?Xf(s,u):rn(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+f.x+h.x,y:n.y*a.y-u.scrollTop*a.y+f.y+h.y}}function fk(e){return Array.from(e.getClientRects())}function dk(e){const t=sn(e),n=uo(e),r=e.ownerDocument.body,i=Dt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Dt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+So(e);const l=-n.scrollTop;return zt(r).direction==="rtl"&&(s+=Dt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}const yu=25;function hk(e,t){const n=ft(e),r=sn(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;const f=ao();(!f||f&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const a=So(r);if(a<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(r.clientWidth-c.clientWidth-d);p<=yu&&(o-=p)}else a<=yu&&(o+=a);return{width:o,height:s,x:l,y:u}}const pk=new Set(["absolute","fixed"]);function mk(e,t){const n=Gn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ut(e)?pr(e):rn(1),s=e.clientWidth*o.x,l=e.clientHeight*o.y,u=i*o.x,a=r*o.y;return{width:s,height:l,x:u,y:a}}function xu(e,t,n){let r;if(t==="viewport")r=hk(e,n);else if(t==="document")r=dk(sn(e));else if(Je(t))r=mk(t,n);else{const i=Yf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qi(r)}function Qf(e,t){const n=dn(e);return n===t||!Je(n)||fn(n)?!1:zt(n).position==="fixed"||Qf(n,t)}function gk(e,t){const n=t.get(e);if(n)return n;let r=Cn(e,[],!1).filter(l=>Je(l)&&Mn(l)!=="body"),i=null;const o=zt(e).position==="fixed";let s=o?dn(e):e;for(;Je(s)&&!fn(s);){const l=zt(s),u=bl(s);!u&&l.position==="fixed"&&(i=null),(o?!u&&!i:!u&&l.position==="static"&&!!i&&pk.has(i.position)||Qn(s)&&!u&&Qf(e,s))?r=r.filter(f=>f!==s):i=l,s=dn(s)}return t.set(e,r),r}function yk(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?lo(t)?[]:gk(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((a,f)=>{const c=xu(t,f,i);return a.top=Dt(c.top,a.top),a.right=xr(c.right,a.right),a.bottom=xr(c.bottom,a.bottom),a.left=Dt(c.left,a.left),a},xu(t,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function xk(e){const{width:t,height:n}=Gf(e);return{width:t,height:n}}function bk(e,t,n){const r=ut(t),i=sn(t),o=n==="fixed",s=Gn(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const u=rn(0);function a(){u.x=So(i)}if(r||!r&&!o)if((Mn(t)!=="body"||Qn(i))&&(l=uo(t)),r){const d=Gn(t,!0,o,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else i&&a();o&&!r&&i&&a();const f=i&&!r&&!o?Xf(i,l):rn(0),c=s.left+l.scrollLeft-u.x-f.x,h=s.top+l.scrollTop-u.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function gs(e){return zt(e).position==="static"}function bu(e,t){if(!ut(e)||zt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return sn(e)===n&&(n=n.ownerDocument.body),n}function Jf(e,t){const n=ft(e);if(lo(e))return n;if(!ut(e)){let i=dn(e);for(;i&&!fn(i);){if(Je(i)&&!gs(i))return i;i=dn(i)}return n}let r=bu(e,t);for(;r&&ow(r)&&gs(r);)r=bu(r,t);return r&&fn(r)&&gs(r)&&!bl(r)?n:r||cw(e)||n}const wk=async function(e){const t=this.getOffsetParent||Jf,n=this.getDimensions,r=await n(e.floating);return{reference:bk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vk(e){return zt(e).direction==="rtl"}const kk={convertOffsetParentRelativeRectToViewportRelativeRect:ck,getDocumentElement:sn,getClippingRect:yk,getOffsetParent:Jf,getElementRects:wk,getClientRects:fk,getDimensions:xk,getScale:pr,isElement:Je,isRTL:vk};function Zf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ck(e,t){let n=null,r;const i=sn(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),o();const a=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=a;if(l||t(),!h||!d)return;const p=ar(c),x=ar(i.clientWidth-(f+h)),w=ar(i.clientHeight-(c+d)),g=ar(f),v={rootMargin:-p+"px "+-x+"px "+-w+"px "+-g+"px",threshold:Dt(0,xr(1,u))||1};let k=!0;function E(C){const P=C[0].intersectionRatio;if(P!==u){if(!k)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!Zf(a,e.getBoundingClientRect())&&s(),k=!1}try{n=new IntersectionObserver(E,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,v)}n.observe(e)}return s(!0),o}function wu(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,a=Ll(e),f=i||o?[...a?Cn(a):[],...Cn(t)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const c=a&&l?Ck(a,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(g=>{let[y]=g;y&&y.target===a&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=d)==null||v.observe(t)})),n()}),a&&!u&&d.observe(a),d.observe(t));let p,x=u?Gn(e):null;u&&w();function w(){const g=Gn(e);x&&!Zf(x,g)&&n(),x=g,p=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),c?.(),(g=d)==null||g.disconnect(),d=null,u&&cancelAnimationFrame(p)}}const Sk=ik,Ek=ok,Ik=tk,Rk=lk,Ak=nk,Tk=sk,Pk=(e,t,n)=>{const r=new Map,i={platform:kk,...n},o={...i.platform,_c:r};return ek(e,t,{...i,platform:o})};var Ok=typeof document<"u",Mk=function(){},Ti=Ok?m.useLayoutEffect:Mk;function Qi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qi(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Qi(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ed(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vu(e,t){const n=ed(e);return Math.round(t*n)/n}function ys(e){const t=m.useRef(e);return Ti(()=>{t.current=e}),t}function Fk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:u,open:a}=e,[f,c]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=m.useState(r);Qi(h,r)||d(r);const[p,x]=m.useState(null),[w,g]=m.useState(null),y=m.useCallback($=>{$!==C.current&&(C.current=$,x($))},[]),v=m.useCallback($=>{$!==P.current&&(P.current=$,g($))},[]),k=o||p,E=s||w,C=m.useRef(null),P=m.useRef(null),L=m.useRef(f),q=u!=null,O=ys(u),z=ys(i),_=ys(a),B=m.useCallback(()=>{if(!C.current||!P.current)return;const $={placement:t,strategy:n,middleware:h};z.current&&($.platform=z.current),Pk(C.current,P.current,$).then(K=>{const S={...K,isPositioned:_.current!==!1};D.current&&!Qi(L.current,S)&&(L.current=S,In.flushSync(()=>{c(S)}))})},[h,t,n,z,_]);Ti(()=>{a===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[a]);const D=m.useRef(!1);Ti(()=>(D.current=!0,()=>{D.current=!1}),[]),Ti(()=>{if(k&&(C.current=k),E&&(P.current=E),k&&E){if(O.current)return O.current(k,E,B);B()}},[k,E,B,O,q]);const A=m.useMemo(()=>({reference:C,floating:P,setReference:y,setFloating:v}),[y,v]),N=m.useMemo(()=>({reference:k,floating:E}),[k,E]),Y=m.useMemo(()=>{const $={position:n,left:0,top:0};if(!N.floating)return $;const K=vu(N.floating,f.x),S=vu(N.floating,f.y);return l?{...$,transform:"translate("+K+"px, "+S+"px)",...ed(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:S}},[n,l,N.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:B,refs:A,elements:N,floatingStyles:Y}),[f,B,A,N,Y])}const Lk=(e,t)=>({...Sk(e),options:[e,t]}),Dk=(e,t)=>({...Ek(e),options:[e,t]}),Vk=(e,t)=>({...Tk(e),options:[e,t]}),Nk=(e,t)=>({...Ik(e),options:[e,t]}),_k=(e,t)=>({...Rk(e),options:[e,t]}),jk=(e,t)=>({...Ak(e),options:[e,t]}),zk={intentional:"onClick",sloppy:"onPointerDown"};function Bk(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function td(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("referenceElement"),s=n.useState("domReferenceElement"),{onOpenChange:l,dataRef:u}=n.context,{enabled:a=!0,escapeKey:f=!0,outsidePress:c=!0,outsidePressEvent:h="sloppy",referencePress:d=!1,referencePressEvent:p="sloppy",ancestorScroll:x=!1,bubbles:w,externalTree:g}=t,y=Co(g),v=me(typeof c=="function"?c:()=>!1),k=typeof c=="function"?v:c,E=m.useRef(!1),{escapeKey:C,outsidePress:P}=Bk(w),L=m.useRef(null),q=Nt(),O=Nt(),z=me(()=>{O.clear(),u.current.insideReactTree=!1}),_=m.useRef(!1),B=m.useRef(""),D=me(H=>{B.current=H.pointerType}),A=me(()=>{const H=B.current,se=H==="pen"||!H?"mouse":H,ne=typeof h=="function"?h():h;return typeof ne=="string"?ne:ne[se]}),N=me(H=>{if(!r||!a||!f||H.key!=="Escape"||_.current)return;const se=u.current.floatingContext?.nodeId,ne=y?dr(y.nodesRef.current,se):[];if(!C&&ne.length>0){let G=!0;if(ne.forEach(oe=>{oe.context?.open&&!oe.context.dataRef.current.__escapeKeyBubbles&&(G=!1)}),!G)return}const Ae=cv(H)?H.nativeEvent:H,ee=Te(gf,Ae);n.setOpen(!1,ee),!C&&!ee.isPropagationAllowed&&H.stopPropagation()}),Y=me(H=>{const se=A();return se==="intentional"&&H.type!=="click"||se==="sloppy"&&H.type==="click"}),$=me(()=>{u.current.insideReactTree=!0,O.start(0,z)}),K=me((H,se=!1)=>{if(Y(H)){z();return}if(u.current.insideReactTree){z();return}if(A()==="intentional"&&se||typeof k=="function"&&!k(H))return;const ne=Ct(H),Ae=`[${Yi("inert")}]`,ee=vt(n.select("floatingElement")).querySelectorAll(Ae),G=n.context.triggerElements;if(ne&&(G.hasElement(ne)||G.hasMatchingElement(b=>We(b,ne))))return;let oe=Je(ne)?ne:null;for(;oe&&!fn(oe);){const b=dn(oe);if(fn(b)||!Je(b))break;oe=b}if(ee.length&&Je(ne)&&!uv(ne)&&!We(ne,n.select("floatingElement"))&&Array.from(ee).every(b=>!We(oe,b)))return;if(ut(ne)&&!("touches"in H)){const b=fn(ne),M=zt(ne),F=/auto|scroll/,U=b||F.test(M.overflowX),j=b||F.test(M.overflowY),T=U&&ne.clientWidth>0&&ne.scrollWidth>ne.clientWidth,V=j&&ne.clientHeight>0&&ne.scrollHeight>ne.clientHeight,W=M.direction==="rtl",J=V&&(W?H.offsetX<=ne.offsetWidth-ne.clientWidth:H.offsetX>ne.clientWidth),he=T&&H.offsetY>ne.clientHeight;if(J||he)return}const Ee=u.current.floatingContext?.nodeId,ye=y&&dr(y.nodesRef.current,Ee).some(b=>Gt(H,b.context?.elements.floating));if(Gt(H,n.select("floatingElement"))||Gt(H,n.select("domReferenceElement"))||ye)return;const xe=y?dr(y.nodesRef.current,Ee):[];if(xe.length>0){let b=!0;if(xe.forEach(M=>{M.context?.open&&!M.context.dataRef.current.__outsidePressBubbles&&(b=!1)}),!b)return}n.setOpen(!1,Te(mf,H)),z()}),S=me(H=>{A()!=="sloppy"||H.pointerType==="touch"||!n.select("open")||!a||Gt(H,n.select("floatingElement"))||Gt(H,n.select("domReferenceElement"))||K(H)}),Z=me(H=>{if(A()!=="sloppy"||!n.select("open")||!a||Gt(H,n.select("floatingElement"))||Gt(H,n.select("domReferenceElement")))return;const se=H.touches[0];se&&(L.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),be=me(H=>{const se=Ct(H);function ne(){Z(H),se?.removeEventListener(H.type,ne)}se?.addEventListener(H.type,ne)}),I=me(H=>{const se=E.current;if(E.current=!1,q.clear(),H.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ne=Ct(H);function Ae(){H.type==="pointerdown"?S(H):K(H,se),ne?.removeEventListener(H.type,Ae)}ne?.addEventListener(H.type,Ae)}),fe=me(H=>{if(A()!=="sloppy"||!L.current||Gt(H,n.select("floatingElement"))||Gt(H,n.select("domReferenceElement")))return;const se=H.touches[0];if(!se)return;const ne=Math.abs(se.clientX-L.current.startX),Ae=Math.abs(se.clientY-L.current.startY),ee=Math.sqrt(ne*ne+Ae*Ae);ee>5&&(L.current.dismissOnTouchEnd=!0),ee>10&&(K(H),q.clear(),L.current=null)}),le=me(H=>{const se=Ct(H);function ne(){fe(H),se?.removeEventListener(H.type,ne)}se?.addEventListener(H.type,ne)}),X=me(H=>{A()!=="sloppy"||!L.current||Gt(H,n.select("floatingElement"))||Gt(H,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&K(H),q.clear(),L.current=null)}),ue=me(H=>{const se=Ct(H);function ne(){X(H),se?.removeEventListener(H.type,ne)}se?.addEventListener(H.type,ne)});m.useEffect(()=>{if(!r||!a)return;u.current.__escapeKeyBubbles=C,u.current.__outsidePressBubbles=P;const H=new yr;function se(oe){n.setOpen(!1,Te(kt,oe))}function ne(){H.clear(),_.current=!0}function Ae(){H.start(ao()?5:0,()=>{_.current=!1})}const ee=vt(i);ee.addEventListener("pointerdown",D,!0),f&&(ee.addEventListener("keydown",N),ee.addEventListener("compositionstart",ne),ee.addEventListener("compositionend",Ae)),k&&(ee.addEventListener("click",I,!0),ee.addEventListener("pointerdown",I,!0),ee.addEventListener("touchstart",be,!0),ee.addEventListener("touchmove",le,!0),ee.addEventListener("touchend",ue,!0),ee.addEventListener("mousedown",I,!0));let G=[];return x&&(Je(s)&&(G=Cn(s)),Je(i)&&(G=G.concat(Cn(i))),!Je(o)&&o&&o.contextElement&&(G=G.concat(Cn(o.contextElement)))),G=G.filter(oe=>oe!==ee.defaultView?.visualViewport),G.forEach(oe=>{oe.addEventListener("scroll",se,{passive:!0})}),()=>{ee.removeEventListener("pointerdown",D,!0),f&&(ee.removeEventListener("keydown",N),ee.removeEventListener("compositionstart",ne),ee.removeEventListener("compositionend",Ae)),k&&(ee.removeEventListener("click",I,!0),ee.removeEventListener("pointerdown",I,!0),ee.removeEventListener("touchstart",be,!0),ee.removeEventListener("touchmove",le,!0),ee.removeEventListener("touchend",ue,!0),ee.removeEventListener("mousedown",I,!0)),G.forEach(oe=>{oe.removeEventListener("scroll",se)}),H.clear()}},[u,i,o,s,f,k,r,l,x,a,C,P,N,K,I,S,be,le,ue,D,n]),m.useEffect(z,[k,z]);const ie=m.useMemo(()=>({onKeyDown:N,...d&&{[zk[p]]:H=>{n.setOpen(!1,Te(Hr,H.nativeEvent))},...p!=="intentional"&&{onClick(H){n.setOpen(!1,Te(Hr,H.nativeEvent))}}}}),[N,n,d,p]),we=me(H=>{const se=Ct(H.nativeEvent);!We(n.select("floatingElement"),se)||H.button!==0||(E.current=!0)}),Q=m.useMemo(()=>({onKeyDown:N,onPointerDown:we,onMouseDown:we,onMouseUp:we,onClickCapture:$,onMouseDownCapture:$,onPointerDownCapture:$,onMouseUpCapture:$,onTouchEndCapture:$,onTouchMoveCapture:$}),[N,we,$]);return m.useMemo(()=>a?{reference:ie,floating:Q,trigger:ie}:{},[a,ie,Q])}const Hk={open:ae(e=>e.open),domReferenceElement:ae(e=>e.domReferenceElement),referenceElement:ae(e=>e.positionReference??e.referenceElement),floatingElement:ae(e=>e.floatingElement),floatingId:ae(e=>e.floatingId)};class Uk extends tv{constructor(t){const{nested:n,noEmit:r,onOpenChange:i,triggerElements:o,...s}=t;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:Hv(),nested:n,noEmit:r,triggerElements:o},Hk)}setOpen=(t,n)=>{if((!t||!this.state.open||Af(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}class $k{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Dl(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Rl(),o=zf()!=null,s=Wt(()=>new Uk({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new $k,floatingId:i,nested:o,noEmit:e.noEmit||!1})).current;return ge(()=>{const l={open:t,floatingId:i};r.reference!==void 0&&(l.referenceElement=r.reference,l.domReferenceElement=Je(r.reference)?r.reference:null),r.floating!==void 0&&(l.floatingElement=r.floating),s.update(l)},[t,i,r.reference,r.floating,s]),s.context.onOpenChange=n,s.context.nested=o,s.context.noEmit=e.noEmit||!1,s}function qk(e={}){const{nodeId:t,externalTree:n}=e,r=Dl(e),i=e.rootContext||r,o={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[s,l]=m.useState(null),u=m.useRef(null),a=Co(n);ge(()=>{o.domReference&&(u.current=o.domReference)},[o.domReference]);const f=Fk({...e,elements:{...o,...s&&{reference:s}}}),c=m.useCallback(P=>{const L=Je(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;l(L),f.refs.setReference(L)},[f.refs]),[h,d]=m.useState(null),[p,x]=m.useState(null);i.useSyncedValue("referenceElement",h),i.useSyncedValue("domReferenceElement",Je(h)?h:null),i.useSyncedValue("floatingElement",p);const w=m.useCallback(P=>{(Je(P)||P===null)&&(u.current=P,d(P)),(Je(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!Je(P))&&f.refs.setReference(P)},[f.refs,d]),g=m.useCallback(P=>{x(P),f.refs.setFloating(P)},[f.refs]),y=m.useMemo(()=>({...f.refs,setReference:w,setFloating:g,setPositionReference:c,domReference:u}),[f.refs,w,g,c]),v=m.useMemo(()=>({...f.elements,domReference:o.domReference}),[f.elements,o.domReference]),k=i.useState("open"),E=i.useState("floatingId"),C=m.useMemo(()=>({...f,dataRef:i.context.dataRef,open:k,onOpenChange:i.setOpen,events:i.context.events,floatingId:E,refs:y,elements:v,nodeId:t,rootStore:i}),[f,y,v,t,i,k,E]);return ge(()=>{i.context.dataRef.current.floatingContext=C;const P=a?.nodesRef.current.find(L=>L.id===t);P&&(P.context=C)}),m.useMemo(()=>({...f,context:C,refs:y,elements:v,rootStore:i}),[f,y,v,C,i])}function nd(e=[]){const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),i=e.map(a=>a?.trigger),o=m.useCallback(a=>ki(a,e,"reference"),t),s=m.useCallback(a=>ki(a,e,"floating"),n),l=m.useCallback(a=>ki(a,e,"item"),r),u=m.useCallback(a=>ki(a,e,"trigger"),i);return m.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:l,getTriggerProps:u}),[o,s,l,u])}function ki(e,t,n){const r=new Map,i=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[Bs]="");for(const s in e)i&&e&&(s===Cf||s===Sf)||(o[s]=e[s]);for(let s=0;s<t.length;s+=1){let l;const u=t[s]?.[n];typeof u=="function"?l=e?u(e):null:l=u,l&&ku(o,l,i,r)}return ku(o,e,i,r),o}function ku(e,t,n,r){for(const i in t){const o=t[i];n&&(i===Cf||i===Sf)||(i.startsWith("on")?(r.has(i)||r.set(i,[]),typeof o=="function"&&(r.get(i)?.push(o),e[i]=(...s)=>r.get(i)?.map(l=>l(...s)).find(l=>l!==void 0))):e[i]=o)}}const Wk="Escape";function Eo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ci(e,t){return Eo(t,e===Tl||e===ii,e===Sn||e===En)}function xs(e,t,n){return Eo(t,e===ii,n?e===Sn:e===En)||e==="Enter"||e===" "||e===""}function Kk(e,t,n){return Eo(t,n?e===Sn:e===En,e===ii)}function Gk(e,t,n,r){const i=n?e===En:e===Sn,o=e===Tl;return t==="both"||t==="horizontal"&&r&&r>1?e===Wk:Eo(t,i,o)}function rd(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("domReferenceElement"),s=n.context.dataRef,{listRef:l,activeIndex:u,onNavigate:a=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loopFocus:d=!1,nested:p=!1,rtl:x=!1,virtual:w=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:v=!0,disabledIndices:k=void 0,orientation:E="vertical",parentOrientation:C,cols:P=1,scrollItemIntoView:L=!0,itemSizes:q,dense:O=!1,id:z,resetOnPointerLeave:_=!0,externalTree:B}=t,D=Hi(i),A=dt(D),N=zf(),Y=Co(B);ge(()=>{s.current.orientation=E},[s,E]);const $=Hs(o),K=m.useRef(g),S=m.useRef(c??-1),Z=m.useRef(null),be=m.useRef(!0),I=me(F=>{a(S.current===-1?null:S.current,F)}),fe=m.useRef(I),le=m.useRef(!!i),X=m.useRef(r),ue=m.useRef(!1),ie=m.useRef(!1),we=dt(k),Q=dt(r),H=dt(L),se=dt(c),ne=dt(_),Ae=me(()=>{function F(V){w?Y?.events.emit("virtualfocus",V):Ai(V,{sync:ue.current,preventScroll:!0})}const U=l.current[S.current],j=ie.current;U&&F(U),(ue.current?V=>V():requestAnimationFrame)(()=>{const V=l.current[S.current]||U;if(!V)return;U||F(V);const W=H.current;W&&G&&(j||!be.current)&&V.scrollIntoView?.(typeof W=="boolean"?{block:"nearest",inline:"nearest"}:W)})});ge(()=>{f&&(r&&i?(S.current=c??-1,K.current&&c!=null&&(ie.current=!0,I())):le.current&&(S.current=-1,fe.current()))},[f,r,i,c,I]),ge(()=>{if(f){if(!r){ue.current=!1;return}if(i)if(u==null){if(ue.current=!1,se.current!=null)return;if(le.current&&(S.current=-1,Ae()),(!X.current||!le.current)&&K.current&&(Z.current!=null||K.current===!0&&Z.current==null)){let F=0;const U=()=>{l.current[0]==null?(F<2&&(F?requestAnimationFrame:queueMicrotask)(U),F+=1):(S.current=Z.current==null||xs(Z.current,E,x)||p?hs(l):lu(l),Z.current=null,I())};U()}}else Ur(l,u)||(S.current=u,Ae(),ie.current=!1)}},[f,r,i,u,se,p,l,E,x,I,Ae,we]),ge(()=>{if(!f||i||!Y||w||!le.current)return;const F=Y.nodesRef.current,U=F.find(V=>V.id===N)?.context?.elements.floating,j=vn(vt(i)),T=F.some(V=>V.context&&We(V.context.elements.floating,j));U&&!T&&be.current&&U.focus({preventScroll:!0})},[f,i,Y,N,w]),ge(()=>{fe.current=I,X.current=r,le.current=!!i}),ge(()=>{r||(Z.current=null,K.current=g)},[r,g]);const ee=u!=null,G=m.useMemo(()=>{function F(j){if(!Q.current)return;const T=l.current.indexOf(j.currentTarget);T!==-1&&S.current!==T&&(S.current=T,I(j))}return{onFocus(j){ue.current=!0,F(j)},onClick:({currentTarget:j})=>j.focus({preventScroll:!0}),onMouseMove(j){ue.current=!0,ie.current=!1,y&&F(j)},onPointerLeave(j){if(!Q.current||!be.current||j.pointerType==="touch")return;ue.current=!0;const T=j.relatedTarget;!y||l.current.includes(T)||ne.current&&(S.current=-1,I(j),w||A.current?.focus({preventScroll:!0}))}}},[Q,A,y,l,I,ne,w]),oe=m.useCallback(()=>C??Y?.nodesRef.current.find(F=>F.id===N)?.context?.dataRef?.current.orientation,[N,Y,C]),Ee=me(F=>{if(be.current=!1,ue.current=!0,F.which===229||!Q.current&&F.currentTarget===A.current)return;if(p&&Gk(F.key,E,x,P)){Ci(F.key,oe())||at(F),n.setOpen(!1,Te(fs,F.nativeEvent)),ut(o)&&(w?Y?.events.emit("virtualfocus",o):o.focus());return}const U=S.current,j=hs(l,k),T=lu(l,k);if($||(F.key==="Home"&&(at(F),S.current=j,I(F)),F.key==="End"&&(at(F),S.current=T,I(F))),P>1){const V=q||Array.from({length:l.current.length},()=>({width:1,height:1})),W=Cv(V,P,O),J=W.findIndex(Oe=>Oe!=null&&!$r(l,Oe,k)),he=W.reduce((Oe,ke,de)=>ke!=null&&!$r(l,ke,k)?de:Oe,-1),Pe=W[kv({current:W.map(Oe=>Oe!=null?l.current[Oe]:null)},{event:F,orientation:E,loopFocus:d,rtl:x,cols:P,disabledIndices:Ev([...(typeof k!="function"?k:null)||l.current.map((Oe,ke)=>$r(l,ke,k)?ke:void 0),void 0],W),minIndex:J,maxIndex:he,prevIndex:Sv(S.current>T?j:S.current,V,W,P,F.key===ii?"bl":F.key===(x?Sn:En)?"tr":"tl"),stopEvent:!0})];if(Pe!=null&&(S.current=Pe,I(F)),E==="both")return}if(Ci(F.key,E)){if(at(F),r&&!w&&vn(F.currentTarget.ownerDocument)===F.currentTarget){S.current=xs(F.key,E,x)?j:T,I(F);return}xs(F.key,E,x)?d?U>=T?h&&U!==l.current.length?S.current=-1:(ue.current=!1,S.current=j):S.current=gt(l,{startingIndex:U,disabledIndices:k}):S.current=Math.min(T,gt(l,{startingIndex:U,disabledIndices:k})):d?U<=j?h&&U!==-1?S.current=l.current.length:(ue.current=!1,S.current=T):S.current=gt(l,{startingIndex:U,decrement:!0,disabledIndices:k}):S.current=Math.max(j,gt(l,{startingIndex:U,decrement:!0,disabledIndices:k})),Ur(l,S.current)&&(S.current=-1),I(F)}}),ye=m.useMemo(()=>w&&r&&ee&&{"aria-activedescendant":`${z}-${u}`},[w,r,ee,z,u]),xe=m.useMemo(()=>({"aria-orientation":E==="both"?void 0:E,...$?{}:ye,onKeyDown(F){if(F.key==="Tab"&&F.shiftKey&&r&&!w){const U=Ct(F.nativeEvent);if(U&&!We(A.current,U))return;at(F),n.setOpen(!1,Te(xo,F.nativeEvent)),ut(o)&&o.focus();return}Ee(F)},onPointerMove(){be.current=!0}}),[ye,Ee,A,E,$,n,r,w,o]),b=m.useMemo(()=>{function F(j){g==="auto"&&If(j.nativeEvent)&&(K.current=!w)}function U(j){K.current=g,g==="auto"&&Rf(j.nativeEvent)&&(K.current=!0)}return{onKeyDown(j){const T=n.select("open");be.current=!1;const V=j.key.startsWith("Arrow"),W=Kk(j.key,oe(),x),J=Ci(j.key,E),he=(p?W:J)||j.key==="Enter"||j.key.trim()==="";if(w&&T)return Ee(j);if(!(!T&&!v&&V)){if(he){const Pe=Ci(j.key,oe());Z.current=p&&Pe?null:j.key}if(p){W&&(at(j),T?(S.current=hs(l,we.current),I(j)):n.setOpen(!0,Te(fs,j.nativeEvent,j.currentTarget)));return}J&&(se.current!=null&&(S.current=se.current),at(j),!T&&v?n.setOpen(!0,Te(fs,j.nativeEvent,j.currentTarget)):Ee(j),T&&I(j))}},onFocus(j){n.select("open")&&!w&&(S.current=-1,I(j))},onPointerDown:U,onPointerEnter:U,onMouseDown:F,onClick:F}},[Ee,we,g,l,p,I,n,v,E,oe,x,se,w]),M=m.useMemo(()=>({...ye,...b}),[ye,b]);return m.useMemo(()=>f?{reference:M,floating:xe,item:G,trigger:b}:{},[f,M,xe,b,G])}function Yk(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.context.dataRef,{listRef:o,activeIndex:s,onMatch:l,onTypingChange:u,enabled:a=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=wn,selectedIndex:d=null}=t,p=Nt(),x=m.useRef(""),w=m.useRef(d??s??-1),g=m.useRef(null);ge(()=>{r&&(p.clear(),g.current=null,x.current="")},[r,p]),ge(()=>{r&&x.current===""&&(w.current=d??s??-1)},[r,d,s]);const y=me(C=>{C?i.current.typing||(i.current.typing=C,u?.(C)):i.current.typing&&(i.current.typing=C,u?.(C))}),v=me(C=>{function P(_,B,D){const A=f?f(B,D):B.find(N=>N?.toLocaleLowerCase().indexOf(D.toLocaleLowerCase())===0);return A?_.indexOf(A):-1}const L=o.current;if(x.current.length>0&&x.current[0]!==" "&&(P(L,L,x.current)===-1?y(!1):C.key===" "&&at(C)),L==null||h.includes(C.key)||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;r&&C.key!==" "&&(at(C),y(!0)),L.every(_=>_?_[0]?.toLocaleLowerCase()!==_[1]?.toLocaleLowerCase():!0)&&x.current===C.key&&(x.current="",w.current=g.current),x.current+=C.key,p.start(c,()=>{x.current="",w.current=g.current,y(!1)});const O=w.current,z=P(L,[...L.slice((O||0)+1),...L.slice(0,(O||0)+1)],x.current);z!==-1?(l?.(z),g.current=z):C.key!==" "&&(x.current="",y(!1))}),k=m.useMemo(()=>({onKeyDown:v}),[v]),E=m.useMemo(()=>({onKeyDown:v,onKeyUp(C){C.key===" "&&y(!1)}}),[v,y]);return m.useMemo(()=>a?{reference:k,floating:E}:{},[a,k,E])}const id=m.createContext(void 0),od=m.createContext(void 0),sd=m.createContext(void 0),ld=m.createContext("");function Er(){const e=m.useContext(id);if(!e)throw new Error(wt(22));return e}function Vl(){const e=m.useContext(od);if(!e)throw new Error(wt(23));return e}function Ir(){const e=m.useContext(sd);if(!e)throw new Error(wt(24));return e}function Xk(){return m.useContext(ld)}const ad=(e,t)=>Object.is(e,t);function pn(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function $n(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:pn(r,t,n))}function wr(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:pn(r,t,n))}function ud(e,t,n){return e.filter(r=>!pn(r,t,n))}const Ce={id:ae(e=>e.id),query:ae(e=>e.query),items:ae(e=>e.items),selectedValue:ae(e=>e.selectedValue),open:ae(e=>e.open),mounted:ae(e=>e.mounted),forceMounted:ae(e=>e.forceMounted),inline:ae(e=>e.inline),activeIndex:ae(e=>e.activeIndex),selectedIndex:ae(e=>e.selectedIndex),isActive:ae((e,t)=>e.activeIndex===t),isSelected:ae((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(i=>pn(i,t,n)):pn(r,t,n)}),transitionStatus:ae(e=>e.transitionStatus),popupProps:ae(e=>e.popupProps),inputProps:ae(e=>e.inputProps),triggerProps:ae(e=>e.triggerProps),getItemProps:ae(e=>e.getItemProps),positionerElement:ae(e=>e.positionerElement),listElement:ae(e=>e.listElement),triggerElement:ae(e=>e.triggerElement),inputElement:ae(e=>e.inputElement),popupSide:ae(e=>e.popupSide),openMethod:ae(e=>e.openMethod),inputInsidePopup:ae(e=>e.inputInsidePopup),selectionMode:ae(e=>e.selectionMode),listRef:ae(e=>e.listRef),labelsRef:ae(e=>e.labelsRef),popupRef:ae(e=>e.popupRef),emptyRef:ae(e=>e.emptyRef),inputRef:ae(e=>e.inputRef),keyboardActiveRef:ae(e=>e.keyboardActiveRef),chipsContainerRef:ae(e=>e.chipsContainerRef),clearRef:ae(e=>e.clearRef),valuesRef:ae(e=>e.valuesRef),allValuesRef:ae(e=>e.allValuesRef),name:ae(e=>e.name),disabled:ae(e=>e.disabled),readOnly:ae(e=>e.readOnly),required:ae(e=>e.required),grid:ae(e=>e.grid),isGrouped:ae(e=>e.isGrouped),virtualized:ae(e=>e.virtualized),onOpenChangeComplete:ae(e=>e.onOpenChangeComplete),openOnInputClick:ae(e=>e.openOnInputClick),itemToStringLabel:ae(e=>e.itemToStringLabel),isItemEqualToValue:ae(e=>e.isItemEqualToValue),modal:ae(e=>e.modal),autoHighlight:ae(e=>e.autoHighlight),submitOnItemClick:ae(e=>e.submitOnItemClick)};function Nl(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:o}=en(),s=Tn(t);return ge(()=>{if(!(!n&&!t||o===et)){if(n){const l=r?.current;Je(l)&&l.closest("label")!=null?o(t??null):o(i??s)}else t&&o(t);return()=>{t&&o(void 0)}}},[t,r,i,o,n,s]),i??s}function Ks(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function cd(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function ot(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Ks(e)}function Xt(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ks(e.value):Ks(e)}function Qk(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??ot(e,n);if(Array.isArray(t)){const r=cd(t)?t.flatMap(i=>i.items):t;if(e==null){const i=r.find(o=>o.value==null);return i&&i.label!=null?i.label:ot(e,n)}if(typeof e!="object"){const i=r.find(o=>o&&o.value===e);return i&&i.label!=null?i.label:ot(e,n)}if("value"in e){const i=r.find(o=>o&&o.value===e.value);if(i&&i.label!=null)return i.label}}return ot(e,n)}function Jk(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>ot(n,t)).join(", ")}function Zk(e,t){return(n,r)=>{if(n==null)return!1;const i=ot(n,t);return e.contains(i,r)}}function e1(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;const o=ot(r,t),s=n!=null?ot(n,t):"";return s&&e.contains(s,i)&&s.length===i.length?!0:e.contains(o,i)}}const Cu=new Map;function fd(e){return Array.isArray(e)?e.map(t=>fd(t)).join(","):e==null?"":String(e)}function t1(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${fd(e.locale)}|${JSON.stringify(t)}`,r=Cu.get(n);if(r)return r;const i=new Intl.Collator(e.locale,t),o={contains(s,l,u){if(!l)return!0;const a=ot(s,u);for(let f=0;f<=a.length-l.length;f+=1)if(i.compare(a.slice(f,f+l.length),l)===0)return!0;return!1},startsWith(s,l,u){if(!l)return!0;const a=ot(s,u);return i.compare(a.slice(0,l.length),l)===0},endsWith(s,l,u){if(!l)return!0;const a=ot(s,u),f=l.length;return a.length>=f&&i.compare(a.slice(a.length-f),l)===0}};return Cu.set(n,o),o}const dd=t1;function n1(e){const t=m.useRef(""),n=m.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:m.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i&&e(i,i.pointerType),e(i,t.current),t.current=""},[e]),onPointerDown:n}}function hd(e){const[t,n]=m.useState(null),r=me((l,u)=>{e||n(u)}),i=m.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:s}=n1(r);return m.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:o,onPointerDown:s}}),[t,i,o,s])}const pd=Symbol("none"),jn={value:pd,index:-1};function r1(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:o,defaultInputValue:s,inputValue:l,selectionMode:u="none",onItemHighlighted:a,name:f,disabled:c=!1,readOnly:h=!1,required:d=!1,inputRef:p,grid:x=!1,items:w,filteredItems:g,filter:y,openOnInputClick:v=!0,autoHighlight:k=!1,keepHighlight:E=!1,highlightItemOnHover:C=!0,itemToStringLabel:P,itemToStringValue:L,isItemEqualToValue:q=ad,virtualized:O=!1,inline:z=!1,fillInputOnItemPress:_=!0,modal:B=!1,limit:D=-1,autoComplete:A="list",locale:N,submitOnItemClick:Y=!1}=e,{clearErrors:$}=Jn(),{setDirty:K,validityData:S,shouldValidateOnChange:Z,setFilled:be,name:I,disabled:fe,validation:le}=Zt(),X=Nl({id:t}),ue=dd({locale:N}),[ie,we]=m.useState(!1),[Q,H]=m.useState(null),se=m.useRef([]),ne=m.useRef([]),Ae=m.useRef(null),ee=m.useRef(null),G=m.useRef(null),oe=m.useRef(!0),Ee=m.useRef(!1),ye=m.useRef(null),xe=m.useRef(null),b=m.useRef(null),M=m.useRef(jn),F=m.useRef(null),U=m.useRef([]),j=m.useRef([]),T=fe||c,V=I??f,W=u==="multiple",J=u==="single",he=l!==void 0||s!==void 0,Pe=w!==void 0,Oe=g!==void 0;let ke;k==="always"?ke="always":ke=k?"input-change":!1;const[de,He]=qn({controlled:i,default:W?r??wn:r,name:"Combobox",state:"selectedValue"}),Be=m.useMemo(()=>y===null?()=>!0:y!==void 0?y:J&&!ie?e1(ue,P,de):Zk(ue,P),[y,J,de,ie,ue,P]),De=Wt(()=>he?s??"":J?ot(de,P):"").current,[Me,rt]=qn({controlled:l,default:De,name:"Combobox",state:"inputValue"}),[Ve,Pt]=qn({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),tt=cd(w),qe=Q??(Me===""?"":String(Me).trim()),Ot=J?ot(de,P):"",ln=J&&!ie&&qe!==""&&Ot!==""&&Ot.length===qe.length&&ue.contains(Ot,qe),Kt=ln?"":qe,je=Pe&&Oe&&ln,Ue=m.useMemo(()=>w?tt?w.flatMap(pe=>pe.items):w:wn,[w,tt]),ht=m.useMemo(()=>{if(g&&!je)return g;if(!w)return wn;if(tt){const Re=w,Fe=[];let Ze=0;for(const st of Re){if(D>-1&&Ze>=D)break;const pt=Kt===""?st.items:st.items.filter(fi=>Be(fi,Kt,P));if(pt.length===0)continue;const Vn=D>-1?D-Ze:1/0,Nn=pt.slice(0,Vn);if(Nn.length>0){const fi={...st,items:Nn};Fe.push(fi),Ze+=Nn.length}}return Fe}if(Kt==="")return D>-1?Ue.slice(0,D):Ue;const pe=[];for(const Re of Ue){if(D>-1&&pe.length>=D)break;Be(Re,Kt,P)&&pe.push(Re)}return pe},[g,je,w,tt,Kt,D,Be,P,Ue]),Qe=m.useMemo(()=>tt?ht.flatMap(Re=>Re.items):ht,[ht,tt]),Se=Wt(()=>new Wn({id:X,selectedValue:de,open:Ve,filter:Be,query:qe,items:w,selectionMode:u,listRef:se,labelsRef:ne,popupRef:Ae,emptyRef:G,inputRef:ee,keyboardActiveRef:oe,chipsContainerRef:ye,clearRef:xe,valuesRef:U,allValuesRef:j,selectionEventRef:b,name:V,disabled:T,readOnly:h,required:d,grid:x,isGrouped:tt,virtualized:O,openOnInputClick:v,itemToStringLabel:P,isItemEqualToValue:q,modal:B,autoHighlight:ke,submitOnItemClick:Y,hasInputValue:he,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:z,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||et,setOpen:et,setInputValue:et,setSelectedValue:et,setIndices:et,onItemHighlighted:et,handleSelection:et,getItemProps:()=>yt,forceMount:et,requestSubmit:et})).current,Mt=u==="none"?Me:de,si=m.useMemo(()=>u==="none"?Mt:Array.isArray(de)?de.map(pe=>Xt(pe,L)):Xt(de,L),[Mt,L,u,de]),an=me(a),Rr=me(n),er=te(Se,Ce.activeIndex),Ro=te(Se,Ce.selectedIndex),li=te(Se,Ce.positionerElement),Ul=te(Se,Ce.listElement),Ar=te(Se,Ce.triggerElement),Ao=te(Se,Ce.inputElement),un=te(Se,Ce.inline),Dn=te(Se,Ce.inputInsidePopup),Bd=dt(Ar),{mounted:$l,setMounted:Hd,transitionStatus:To}=wo(Ve),{openMethod:ql,triggerProps:Po,reset:Ud}=hd(Ve);yo({id:X,name:V,commit:le.commit,value:Mt,controlRef:Dn?Bd:ee,getValue:()=>si});const ai=me(()=>{w?ne.current=Qe.map(pe=>ot(pe,P)):Se.set("forceMounted",!0)}),$d=m.useRef(de);ge(()=>{de!==$d.current&&ai()},[ai,de]);const Bt=me(pe=>{Se.update(pe);const Re=pe.type||"none";if(pe.activeIndex!==void 0)if(pe.activeIndex===null)M.current!==jn&&(M.current=jn,an(void 0,Dr(Re,void 0,{index:-1})));else{const Fe=U.current[pe.activeIndex];M.current={value:Fe,index:pe.activeIndex},an(Fe,Dr(Re,void 0,{index:pe.activeIndex}))}}),Ht=me((pe,Re)=>{if(Ee.current=Re.reason===bn,e.onInputValueChange?.(pe,Re),!Re.isCanceled){if(Re.reason===Un){const Fe=pe.trim()!=="";Fe&&we(!0),F.current={hasQuery:Fe},Fe&&ke&&Se.state.activeIndex==null&&Se.set("activeIndex",0)}rt(pe)}}),Tr=me((pe,Re)=>{Ve!==pe&&(Re.reason==="escape-key"&&Pe&&Qe.length===0&&!Se.state.emptyRef.current&&Re.allowPropagation(),e.onOpenChange?.(pe,Re),!Re.isCanceled&&(!pe&&ie&&(J?(H(qe),qe===""&&we(!1)):W&&(un||Dn?Bt({activeIndex:null}):H(qe),Ht("",Te(bn,Re.event)))),Pt(pe)))}),ui=me((pe,Re)=>{if(o?.(pe,Re),Re.isCanceled)return;He(pe),(u==="none"&&Ae.current&&_||J&&!Se.state.inputInsidePopup)&&Ht(ot(pe,P),Te(Re.reason,Re.event)),J&&pe!=null&&Re.reason!==Un&&ie&&H(qe)}),qd=me((pe,Re)=>{let Fe=Re;if(Fe===void 0){if(er===null)return;Fe=U.current[er]}const Ze=Ct(pe),st=b.current??pe;b.current=null;const pt=Te(Ri,st),Vn=Ze?.closest("a")?.getAttribute("href");if(Vn){Vn.startsWith("#")&&Tr(!1,pt);return}if(W){const Nn=Array.isArray(de)?de:[],rh=$n(Nn,Fe,Se.state.isItemEqualToValue)?ud(Nn,Fe,Se.state.isItemEqualToValue):[...Nn,Fe];if(ui(rh,pt),!(ee.current?ee.current.value.trim()!=="":!1))return;Se.state.inputInsidePopup?Ht("",Te(bn,pt.event)):Tr(!1,pt)}else ui(Fe,pt),Tr(!1,pt)}),Oo=me(()=>{if(!Se.state.submitOnItemClick)return;const pe=Se.state.inputElement?.form;pe&&typeof pe.requestSubmit=="function"&&pe.requestSubmit()}),Mo=me(()=>{if(Hd(!1),Rr?.(!1),we(!1),Ud(),H(null),Bt(u==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),W&&ee.current&&ee.current.value!==""&&!Ee.current&&Ht("",Te(bn)),J)if(Se.state.inputInsidePopup)ee.current&&ee.current.value!==""&&Ht("",Te(bn));else{const pe=ot(de,P);ee.current&&ee.current.value!==pe&&Ht(pe,Te(pe===""?bn:kt))}}),Wd=m.useMemo(()=>un&&li?{current:li.closest('[role="dialog"]')}:Ae,[un,li]);Sr({enabled:!e.actionsRef,open:Ve,ref:Wd,onComplete(){Ve||Mo()}}),m.useImperativeHandle(e.actionsRef,()=>({unmount:Mo}),[Mo]),ge(function(){if(Ve||u==="none")return;const Re=w?Ue:j.current;if(W){const Fe=Array.isArray(de)?de:[],Ze=Fe[Fe.length-1],st=wr(Re,Ze,q);Bt({selectedIndex:st===-1?null:st})}else{const Fe=wr(Re,de,q);Bt({selectedIndex:Fe===-1?null:Fe})}},[Ve,de,w,u,Ue,W,q,Bt]),ge(()=>{w&&(U.current=Qe,se.current.length=Qe.length)},[w,Qe]),ge(()=>{const pe=F.current;if(pe&&(pe.hasQuery?ke&&Se.set("activeIndex",0):ke==="always"&&Se.set("activeIndex",0),F.current=null),!Ve&&!un)return;const Fe=Pe||Oe?Qe:U.current,Ze=Se.state.activeIndex;if(Ze==null){if(ke==="always"&&Fe.length>0){Se.set("activeIndex",0);return}M.current!==jn&&(M.current=jn,Se.state.onItemHighlighted(void 0,Dr(kt,void 0,{index:-1})));return}if(Ze>=Fe.length){M.current!==jn&&(M.current=jn,Se.state.onItemHighlighted(void 0,Dr(kt,void 0,{index:-1}))),Se.set("activeIndex",null);return}const st=Fe[Ze],pt=M.current.value,Vn=pt!==pd&&Se.state.isItemEqualToValue(st,pt);(M.current.index!==Ze||!Vn)&&(M.current={value:st,index:Ze},Se.state.onItemHighlighted(st,Dr(kt,void 0,{index:Ze})))},[er,ke,Oe,Pe,Qe,un,Ve,Se]),ge(()=>{if(!w||u==="none")return;const pe=Ue;if(W){const Ze=Array.isArray(de)?de:wn,st=Ze.filter(pt=>$n(pe,pt,Se.state.isItemEqualToValue));st.length!==Ze.length&&He(st);return}if(de==null?!0:$n(pe,de,Se.state.isItemEqualToValue))return;let Fe=null;if(r!=null&&$n(pe,r,Se.state.isItemEqualToValue)&&(Fe=r),He(Fe),!Se.state.inputInsidePopup){const Ze=ot(Fe,P);ee.current&&ee.current.value!==Ze&&Ht(Ze,Te(kt))}},[w,Ue,W,u,de,r,He,P,Se,Ht]),ge(()=>{if(u==="none"){be(String(Me)!=="");return}be(W?Array.isArray(de)&&de.length>0:de!=null)},[be,u,Me,de,W]),m.useEffect(()=>{Pe&&ke&&Qe.length===0&&Bt({activeIndex:null})},[Pe,ke,Qe.length,Bt]),lr(qe,()=>{!Ve||qe===""||qe===String(De)||we(!0)}),lr(de,()=>{if(u!=="none"&&($(V),K(de!==S.initialValue),Z()?le.commit(de):le.commit(de,!0),W&&Se.state.selectedIndex!==null&&(!Array.isArray(de)||de.length===0)&&Bt({activeIndex:null,selectedIndex:null}),J&&!he&&!Dn)){const pe=ot(de,P);Me!==pe&&Ht(pe,Te(kt))}}),lr(Me,()=>{u==="none"&&($(V),K(Me!==S.initialValue),Z()?le.commit(Me):le.commit(Me,!0))}),lr(w,()=>{if(!J||he||Dn||ie)return;const pe=ot(de,P);Me!==pe&&Ht(pe,Te(kt))});const ci=Dl({open:un?!0:Ve,onOpenChange:Tr,elements:{reference:Dn?Ar:Ao,floating:li}});let Fo,Lo;un||(Fo=x?"grid":"listbox",Lo=Ve?"true":"false");const Kd=m.useMemo(()=>{const pe=Ao?.tagName==="INPUT",Re=pe||Ve,Fe=pe?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Re&&(Fe.role="combobox",Fe["aria-expanded"]=Lo,Fe["aria-haspopup"]=Fo,Fe["aria-controls"]=Ve?Ul?.id:void 0,Fe["aria-autocomplete"]=A),{reference:Fe,floating:{role:"presentation"}}},[Ao,Ve,Lo,Fo,Ul?.id,A]),Gd=Wf(ci,{enabled:!h&&!T&&v,event:"mousedown-only",toggle:!1,touchOpenDelay:Dn?0:50}),Yd=td(ci,{enabled:!h&&!T&&!un,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:un?!0:void 0,outsidePress(pe){const Re=Ct(pe);return!We(Ar,Re)&&!We(xe.current,Re)&&!We(ye.current,Re)}}),Xd=rd(ci,{enabled:!h&&!T,id:X,listRef:se,activeIndex:er,selectedIndex:Ro,virtual:!0,loopFocus:!0,allowEscape:!ke,focusItemOnOpen:ie||u==="none"&&!ke?!1:"auto",focusItemOnHover:C,resetOnPointerLeave:!E,cols:x?2:1,orientation:x?"horizontal":void 0,disabledIndices:wn,onNavigate(pe,Re){!Re&&!Ve||To==="ending"||Bt(Re?{activeIndex:pe,type:oe.current?"keyboard":"pointer"}:{activeIndex:pe})}}),{getReferenceProps:Do,getFloatingProps:Vo,getItemProps:No}=nd([Kd,Gd,Yd,Xd]);xf(()=>{Se.update({inline:z,popupProps:Vo(),inputProps:Do(),triggerProps:Po,getItemProps:No,setOpen:Tr,setInputValue:Ht,setSelectedValue:ui,setIndices:Bt,onItemHighlighted:an,handleSelection:qd,forceMount:ai,requestSubmit:Oo})}),ge(()=>{Se.update({id:X,selectedValue:de,open:Ve,mounted:$l,transitionStatus:To,items:w,inline:z,popupProps:Vo(),inputProps:Do(),triggerProps:Po,openMethod:ql,getItemProps:No,selectionMode:u,name:V,disabled:T,readOnly:h,required:d,grid:x,isGrouped:tt,virtualized:O,onOpenChangeComplete:Rr,openOnInputClick:v,itemToStringLabel:P,modal:B,autoHighlight:ke,isItemEqualToValue:q,submitOnItemClick:Y,hasInputValue:he,requestSubmit:Oo})},[Se,X,de,Ve,$l,To,w,Vo,Do,No,ql,Po,u,V,T,h,d,le,x,tt,O,Rr,v,P,B,q,Y,he,z,Oo,ke]);const Qd=An(p,le.inputRef),Jd=m.useMemo(()=>({query:qe,filteredItems:ht,flatFilteredItems:Qe}),[qe,ht,Qe]),Zd=m.useMemo(()=>Array.isArray(Mt)?"":Xt(Mt,L),[Mt,L]),eh=W&&Array.isArray(de)&&de.length>0,th=m.useMemo(()=>!W||!Array.isArray(de)||!V?null:de.map(pe=>{const Re=Xt(pe,L);return R.jsx("input",{type:"hidden",name:V,value:Re},Re)}),[W,de,V,L]),nh=R.jsxs(m.Fragment,{children:[e.children,R.jsx("input",{...le.getInputValidationProps({onFocus(){if(Dn){Ar?.focus();return}(ee.current||Ar)?.focus()},onChange(pe){if(pe.nativeEvent.defaultPrevented)return;const Re=pe.target.value,Fe=Te(Un,pe.nativeEvent);function Ze(){if(W)return;if(u==="none"){K(Re!==S.initialValue),Ht(Re,Fe),Z()&&le.commit(Re);return}const st=U.current.find(pt=>Xt(pt,L).toLowerCase()===Re.toLowerCase());st!=null&&(K(st!==S.initialValue),ui?.(st,Fe),Z()&&le.commit(st))}w?Ze():(ai(),queueMicrotask(Ze))}}),id:X,name:W||u==="none"?void 0:V,disabled:T,required:d&&!eh,readOnly:h,value:Zd,ref:Qd,style:ri,tabIndex:-1,"aria-hidden":!0}),th]});return R.jsx(id.Provider,{value:Se,children:R.jsx(od.Provider,{value:ci,children:R.jsx(sd.Provider,{value:Jd,children:R.jsx(ld.Provider,{value:Me,children:nh})})})})}function i1(e){const{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:o="list",itemToStringValue:s,...l}=e,u=o==="inline"||o==="both",a=o==="inline"||o==="none",f=n!==void 0,[c,h]=m.useState(r??""),[d,p]=m.useState("");m.useEffect(()=>{f&&p("")},[n,f]);let x;u&&d!==""?x=d:f?x=n??"":x=c;const w=me((C,P)=>{p(""),f||h(C),i?.(C,P)}),g=dd(),y=m.useMemo(()=>l.filter?l.filter:(C,P,L)=>g.contains(ot(C,L),P),[l,g]),v=String(f?n:c).trim(),k=m.useMemo(()=>o!=="both"?a?null:l.filter:(C,P,L)=>y(C,v,L),[y,o,l.filter,v,a]),E=me((C,P)=>{e.onItemHighlighted?.(C,P),P.reason!==k0&&(u?C==null?p(""):p(ot(C,s)):p(""))});return R.jsx(r1,{...l,itemToStringLabel:s,openOnInputClick:t,selectionMode:"none",fillInputOnItemPress:!0,filter:k,autoComplete:o,inputValue:x,defaultInputValue:r,onInputValueChange:w,onItemHighlighted:E})}let _l=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ji.startingStyle]="startingStyle",e[e.endingStyle=ji.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Gs=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const o1={[Gs.popupOpen]:""},s1={[Gs.popupOpen]:"",[Gs.pressed]:""},l1={[_l.open]:""},a1={[_l.closed]:""},u1={[_l.anchorHidden]:""},c1={open(e){return e?o1:null}},md={open(e){return e?s1:null}},Io={open(e){return e?l1:a1},anchorHidden(e){return e?u1:null}};function f1(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const o=parseFloat(n.width)||0,s=parseFloat(n.height)||0,l=parseFloat(r.width)||0,u=parseFloat(r.height)||0,a=Math.max(t.width,o,l),f=Math.max(t.height,s,u),c=a-t.width,h=f-t.height;return{left:t.left-c/2,right:t.right+c/2,top:t.top-h/2,bottom:t.bottom+h/2}}const d1=m.createContext(void 0);function h1(){return m.useContext(d1)}const gd=m.createContext(void 0);function jl(e){const t=m.useContext(gd);if(t===void 0&&!e)throw new Error(wt(21));return t}const p1=m.createContext(void 0);function yd(){return m.useContext(p1)?.direction??"ltr"}const m1={...md,...gn,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},g1=m.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,id:s,...l}=t,{state:u,disabled:a,setTouched:f,setFocused:c,validationMode:h,validation:d}=Zt(),{labelId:p}=en(),x=h1(),g=!!jl(!0),y=Er(),{filteredItems:v}=Ir(),k=Xk(),E=Tn(s),C=yd(),P=te(y,Ce.disabled),L=te(y,Ce.readOnly),q=te(y,Ce.name),O=te(y,Ce.selectionMode),z=te(y,Ce.autoHighlight),_=te(y,Ce.inputProps),B=te(y,Ce.triggerProps),D=te(y,Ce.open),A=te(y,Ce.mounted),N=te(y,Ce.selectedValue),Y=te(y,Ce.popupSide),$=te(y,Ce.positionerElement),K=!!z,S=A&&$?Y:null,Z=a||P||o,be=v.length===0,[I,fe]=m.useState(null),le=m.useRef(!1),X=me(Q=>{const H=g||y.state.inline;H&&!y.state.hasInputValue&&y.state.setInputValue("",Te(kt)),y.update({inputElement:Q,inputInsidePopup:H})}),ue=m.useMemo(()=>({...u,open:D,disabled:Z,readOnly:L,popupSide:S,listEmpty:be}),[u,D,Z,L,S,be]);function ie(Q){if(!x)return;let H;const{highlightedChipIndex:se}=x;if(se!==void 0){if(Q.key==="ArrowLeft")Q.preventDefault(),se>0?H=se-1:H=void 0;else if(Q.key==="ArrowRight")Q.preventDefault(),se<N.length-1?H=se+1:H=void 0;else if(Q.key==="Backspace"||Q.key==="Delete"){Q.preventDefault();const ne=se>=N.length-1?N.length-2:se;H=ne>=0?ne:void 0,y.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return H}return Q.key==="ArrowLeft"&&(Q.currentTarget.selectionStart??0)===0&&N.length>0?(Q.preventDefault(),H=Math.max(N.length-1,0)):Q.key==="Backspace"&&Q.currentTarget.value===""&&N.length>0&&(y.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Q.preventDefault()),H}return nt("input",t,{state:ue,ref:[n,y.state.inputRef,X],props:[_,B,{type:"text",value:t.value??I??k,"aria-readonly":L||void 0,"aria-labelledby":p,disabled:Z,readOnly:L,...O==="none"&&q&&{name:q},id:E,onFocus(){c(!0)},onBlur(){if(f(!0),c(!1),h==="onBlur"){const Q=O==="none"?k:N;d.commit(Q)}},onCompositionStart(Q){Bi||(le.current=!0,fe(Q.currentTarget.value))},onCompositionEnd(Q){le.current=!1;const H=Q.currentTarget.value;fe(null),y.state.setInputValue(H,Te(Un,Q.nativeEvent))},onChange(Q){if(le.current){const Ae=Q.currentTarget.value;fe(Ae),Ae===""&&!y.state.openOnInputClick&&!y.state.inputInsidePopup&&y.state.setOpen(!1,Te(bn,Q.nativeEvent));const ee=Ae.trim(),G=K&&ee!=="";!L&&!Z&&ee!==""&&(y.state.setOpen(!0,Te(Un,Q.nativeEvent)),K||y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"})),D&&y.state.activeIndex!==null&&!G&&y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"});return}y.state.setInputValue(Q.currentTarget.value,Te(Un,Q.nativeEvent));const H=Q.currentTarget.value==="",se=Te(bn,Q.nativeEvent);H&&!y.state.inputInsidePopup&&(O==="single"&&y.state.setSelectedValue(null,se),y.state.openOnInputClick||y.state.setOpen(!1,se));const ne=Q.currentTarget.value.trim();!L&&!Z&&ne!==""&&(y.state.setOpen(!0,Te(Un,Q.nativeEvent)),K||y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"})),D&&y.state.activeIndex!==null&&!K&&y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Q){if(Z||L||Q.ctrlKey||Q.shiftKey||Q.altKey||Q.metaKey)return;y.state.keyboardActiveRef.current=!0;const H=Q.currentTarget,se=H.scrollWidth-H.clientWidth,ne=C==="rtl";if(Q.key==="Home"){at(Q);const ee=nu&&ne?H.value.length:0;H.setSelectionRange(ee,ee),H.scrollLeft=0;return}if(Q.key==="End"){at(Q);const ee=nu&&ne?0:H.value.length;H.setSelectionRange(ee,ee),H.scrollLeft=ne?-se:se;return}if(!A&&Q.key==="Escape"){const ee=O==="multiple"&&Array.isArray(N)?N.length===0:N===null,G=Te(gf,Q.nativeEvent),oe=O==="multiple"?[]:null;y.state.setInputValue("",G),y.state.setSelectedValue(oe,G),!ee&&!y.state.inline&&!G.isPropagationAllowed&&Q.stopPropagation();return}if(x&&Q.key==="Backspace"&&H.value===""&&x.highlightedChipIndex===void 0&&Array.isArray(N)&&N.length>0){const ee=N.slice(0,-1);y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"}),y.state.setSelectedValue(ee,Te(kt,Q.nativeEvent));return}const Ae=ie(Q);if(x?.setHighlightedChipIndex(Ae),Ae!==void 0?x?.chipsRef.current[Ae]?.focus():y.state.inputRef.current?.focus(),Q.which!==229&&Q.key==="Enter"&&D){const ee=y.state.activeIndex,G=Q.nativeEvent;if(ee===null){y.state.setOpen(!1,Te(kt,G));return}at(Q);const oe=y.state.listRef.current[ee];oe&&(y.state.selectionEventRef.current=G,oe.click(),y.state.selectionEventRef.current=null)}},onPointerMove(){y.state.keyboardActiveRef.current=!1},onPointerDown(){y.state.keyboardActiveRef.current=!1}},d?d.getValidationProps(l):l],stateAttributesMapping:m1})}),y1=m.createContext(null);function x1(){return m.useContext(y1)}function b1(e){const{children:t}=e,{filteredItems:n}=Ir(),r=x1(),i=r?r.items:n;return i?R.jsx(m.Fragment,{children:i.map(t)}):null}const xd=m.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function w1(){return m.useContext(xd)}function bd(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,o=me(i),s=m.useRef(0),l=Wt(k1).current,u=Wt(v1).current,[a,f]=m.useState(0),c=m.useRef(a),h=me((g,y)=>{u.set(g,y??null),c.current+=1,f(c.current)}),d=me(g=>{u.delete(g),c.current+=1,f(c.current)}),p=m.useMemo(()=>{const g=new Map;return Array.from(u.keys()).filter(v=>v.isConnected).sort(C1).forEach((v,k)=>{const E=u.get(v)??{};g.set(v,{...E,index:k})}),g},[u,a]);ge(()=>{if(typeof MutationObserver!="function"||p.size===0)return;const g=new MutationObserver(y=>{const v=new Set,k=E=>v.has(E)?v.delete(E):v.add(E);y.forEach(E=>{E.removedNodes.forEach(k),E.addedNodes.forEach(k)}),v.size===0&&(c.current+=1,f(c.current))});return p.forEach((y,v)=>{v.parentElement&&g.observe(v.parentElement,{childList:!0})}),()=>{g.disconnect()}},[p]),ge(()=>{c.current===a&&(n.current.length!==p.size&&(n.current.length=p.size),r&&r.current.length!==p.size&&(r.current.length=p.size),s.current=p.size),o(p)},[o,p,n,r,a]),ge(()=>()=>{n.current=[]},[n]),ge(()=>()=>{r&&(r.current=[])},[r]);const x=me(g=>(l.add(g),()=>{l.delete(g)}));ge(()=>{l.forEach(g=>g(p))},[l,p]);const w=m.useMemo(()=>({register:h,unregister:d,subscribeMapChange:x,elementsRef:n,labelsRef:r,nextIndexRef:s}),[h,d,x,n,r,s]);return R.jsx(xd.Provider,{value:w,children:t})}function v1(){return new Map}function k1(){return new Set}function C1(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const S1=m.forwardRef(function(t,n){var r;const{render:i,className:o,children:s,...l}=t,u=Er(),a=Vl(),f=!!jl(!0),{filteredItems:c}=Ir(),h=te(u,Ce.items),d=te(u,Ce.labelsRef),p=te(u,Ce.listRef),x=te(u,Ce.selectionMode),w=te(u,Ce.grid),g=te(u,Ce.popupProps),y=te(u,Ce.disabled),v=te(u,Ce.readOnly),k=te(u,Ce.virtualized),E=x==="multiple",C=c.length===0,P=me(B=>{u.set("positionerElement",B)}),L=me(B=>{u.set("listElement",B)}),q=m.useMemo(()=>typeof s=="function"?r||(r=R.jsx(b1,{children:s})):s,[s]),O=m.useMemo(()=>({empty:C}),[C]),z=a.useState("floatingId"),_=nt("div",t,{state:O,ref:[n,L,f?null:P],props:[g,{children:q,tabIndex:-1,id:z,role:w?"grid":"listbox","aria-multiselectable":E?"true":void 0,onKeyDown(B){if(!(y||v)&&B.key==="Enter"){const D=u.state.activeIndex;if(D==null)return;at(B);const A=B.nativeEvent,N=u.state.listRef.current[D];N&&(u.state.selectionEventRef.current=A,N.click(),u.state.selectionEventRef.current=null)}},onKeyDownCapture(){u.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){u.state.keyboardActiveRef.current=!1}},l]});return k?_:R.jsx(bd,{elementsRef:p,labelsRef:h?void 0:d,children:_})}),wd=m.createContext(void 0);function E1(){const e=m.useContext(wd);if(e===void 0)throw new Error(wt(20));return e}const I1=m.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,o=Er(),s=te(o,Ce.mounted),l=te(o,Ce.forceMounted);return s||r||l?R.jsx(wd.Provider,{value:r,children:R.jsx($f,{ref:n,...i})}):null});function vd(e){return wl(19)?e:e?"true":void 0}let Su={},Eu={},Iu="";function R1(e){if(typeof document>"u")return!1;const t=Pn(e);return ft(t).innerWidth-t.documentElement.clientWidth>0}function A1(e){const t=Pn(e),n=t.documentElement,r=t.body,i=Qn(n)?n:r,o=i.style.overflow;return i.style.overflow="hidden",()=>{i.style.overflow=o}}function T1(e){const t=Pn(e),n=t.documentElement,r=t.body,i=ft(n);let o=0,s=0;const l=nn.create(),u=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(kf&&(i.visualViewport?.scale??1)!==1)return()=>{};function a(){const h=i.getComputedStyle(n),d=i.getComputedStyle(r),w=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,s=n.scrollLeft,Su={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Iu=n.style.scrollBehavior,Eu={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const g=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,v=h.overflowY==="scroll"||d.overflowY==="scroll",k=h.overflowX==="scroll"||d.overflowX==="scroll",E=Math.max(0,i.innerWidth-n.clientWidth),C=Math.max(0,i.innerHeight-n.clientHeight),P=parseFloat(d.marginTop)+parseFloat(d.marginBottom),L=parseFloat(d.marginLeft)+parseFloat(d.marginRight),q=Qn(n)?n:r;if(u){n.style.scrollbarGutter=w,q.style.overflowY="hidden",q.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(g||v)&&(n.style.overflowY="scroll"),(y||k)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:P||C?`calc(100dvh - ${P+C}px)`:"100dvh",width:L||E?`calc(100vw - ${L+E}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=s,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,Su),Object.assign(r.style,Eu),u||(n.scrollTop=o,n.scrollLeft=s,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Iu)}function c(){f(),l.request(a)}return a(),i.addEventListener("resize",c),()=>{l.cancel(),f(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",c)}}class P1{lockCount=0;restore=null;timeoutLock=yr.create();timeoutUnlock=yr.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Pn(t).documentElement,i=ft(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=et;return}const o=nv||!R1(t);this.restore=o?A1(t):T1(t)}}const O1=new P1;function kd(e=!0,t=null){ge(()=>{if(e)return O1.acquire(t)},[e,t])}const M1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:u}=t,{element:a,padding:f=0,offsetParent:c="real"}=hn(e,t)||{};if(a==null)return{};const h=Tf(f),d={x:n,y:r},p=Ml(i),x=Ol(p),w=await s.getDimensions(a),g=p==="y",y=g?"top":"left",v=g?"bottom":"right",k=g?"clientHeight":"clientWidth",E=o.reference[x]+o.reference[p]-d[p]-o.floating[x],C=d[p]-o.reference[p],P=c==="real"?await s.getOffsetParent?.(a):l.floating;let L=l.floating[k]||o.floating[x];(!L||!await s.isElement?.(P))&&(L=l.floating[k]||o.floating[x]);const q=E/2-C/2,O=L/2-w[x]/2-1,z=Math.min(h[y],O),_=Math.min(h[v],O),B=z,D=L-w[x]-_,A=L/2-w[x]/2+q,N=Us(B,A,D),Y=!u.arrow&&Fn(i)!=null&&A!==N&&o.reference[x]/2-(A<B?z:_)-w[x]/2<0,$=Y?A<B?A-B:A-D:0;return{[p]:d[p]+$,data:{[p]:N,centerOffset:A-N-$,...Y&&{alignmentOffset:$}},reset:Y}}}),F1=(e,t)=>({...M1(e),options:[e,t]}),L1={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,o=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await jk().fn(e)).data?.referenceHidden||o}}}},D1={sideX:"left",sideY:"top"};function Cd(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Ru(e,t,n){const{rects:r,placement:i}=e;return{side:Cd(t,jt(i),n),align:Fn(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Sd(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,collisionBoundary:l,collisionPadding:u=5,sticky:a=!1,arrowPadding:f=5,disableAnchorTracking:c=!1,keepMounted:h=!1,floatingRootContext:d,mounted:p,collisionAvoidance:x,shiftCrossAxis:w=!1,nodeId:g,adaptiveOrigin:y,lazyFlip:v=!1,externalTree:k}=e,[E,C]=m.useState(null);!p&&E!==null&&C(null);const P=x.side||"flip",L=x.align||"flip",q=x.fallbackAxisSide||"end",O=typeof t=="function"?t:void 0,z=me(O),_=O?z:t,B=dt(t),A=yd()==="rtl",N=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":A?"left":"right","inline-start":A?"right":"left"}[r],Y=o==="center"?N:`${N}-${o}`;let $=u;const K=1,S=r==="bottom"?K:0,Z=r==="top"?K:0,be=r==="right"?K:0,I=r==="left"?K:0;typeof $=="number"?$={top:$+S,right:$+I,bottom:$+Z,left:$+be}:$&&($={top:($.top||0)+S,right:($.right||0)+I,bottom:($.bottom||0)+Z,left:($.left||0)+be});const fe={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:$},le=m.useRef(null),X=dt(i),ue=dt(s),Q=[Lk(De=>{const Me=Ru(De,r,A),rt=typeof X.current=="function"?X.current(Me):X.current,Ve=typeof ue.current=="function"?ue.current(Me):ue.current;return{mainAxis:rt,crossAxis:Ve,alignmentAxis:Ve}},[typeof i!="function"?i:0,typeof s!="function"?s:0,A,r])],H=L==="none"&&P!=="shift",se=!H&&(a||w||P==="shift"),ne=P==="none"?null:Nk({...fe,padding:{top:$.top+K,right:$.right+K,bottom:$.bottom+K,left:$.left+K},mainAxis:!w&&P==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:q}),Ae=H?null:Dk(De=>{const Me=Pn(De.elements.floating).documentElement;return{...fe,rootBoundary:w?{x:0,y:0,width:Me.clientWidth,height:Me.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:se,limiter:a||w?void 0:Vk(rt=>{if(!le.current)return{};const{width:Ve,height:Pt}=le.current.getBoundingClientRect(),tt=qt(jt(rt.placement)),qe=tt==="y"?Ve:Pt,Ot=tt==="y"?$.left+$.right:$.top+$.bottom;return{offset:qe/2+Ot/2}})}},[fe,a,w,$,L]);P==="shift"||L==="shift"||o==="center"?Q.push(Ae,ne):Q.push(ne,Ae),Q.push(_k({...fe,apply({elements:{floating:De},rects:{reference:Me},availableWidth:rt,availableHeight:Ve}){Object.entries({"--available-width":`${rt}px`,"--available-height":`${Ve}px`,"--anchor-width":`${Me.width}px`,"--anchor-height":`${Me.height}px`}).forEach(([Pt,tt])=>{De.style.setProperty(Pt,tt)})}}),F1(()=>({element:le.current||document.createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(De){const{elements:Me,middlewareData:rt,placement:Ve,rects:Pt,y:tt}=De,qe=jt(Ve),Ot=qt(qe),ln=le.current,Kt=rt.arrow?.x||0,je=rt.arrow?.y||0,Ue=ln?.clientWidth||0,ht=ln?.clientHeight||0,Qe=Kt+Ue/2,Se=je+ht/2,Mt=Math.abs(rt.shift?.y||0),si=Pt.reference.height/2,an=typeof i=="function"?i(Ru(De,r,A)):i,Rr=Mt>an,er={top:`${Qe}px calc(100% + ${an}px)`,bottom:`${Qe}px ${-an}px`,left:`calc(100% + ${an}px) ${Se}px`,right:`${-an}px ${Se}px`}[qe],Ro=`${Qe}px ${Pt.reference.y+si-tt}px`;return Me.floating.style.setProperty("--transform-origin",se&&Ot==="y"&&Rr?Ro:er),{}}},L1,y),ge(()=>{!p&&d&&d.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[p,d]);const ee=m.useMemo(()=>({elementResize:!c&&typeof ResizeObserver<"u",layoutShift:!c&&typeof IntersectionObserver<"u"}),[c]),{refs:G,elements:oe,x:Ee,y:ye,middlewareData:xe,update:b,placement:M,context:F,isPositioned:U,floatingStyles:j}=qk({rootContext:d,placement:Y,middleware:Q,strategy:n,whileElementsMounted:h?void 0:(...De)=>wu(...De,ee),nodeId:g,externalTree:k}),{sideX:T,sideY:V}=xe.adaptiveOrigin||D1,W=U?n:"fixed",J=m.useMemo(()=>y?{position:W,[T]:Ee,[V]:ye}:{position:W,...j},[y,W,T,Ee,V,ye,j]),he=m.useRef(null);ge(()=>{if(!p)return;const De=B.current,Me=typeof De=="function"?De():De,Ve=(Au(Me)?Me.current:Me)||null||null;Ve!==he.current&&(G.setPositionReference(Ve),he.current=Ve)},[p,G,_,B]),m.useEffect(()=>{if(!p)return;const De=B.current;typeof De!="function"&&Au(De)&&De.current!==he.current&&(G.setPositionReference(De.current),he.current=De.current)},[p,G,_,B]),m.useEffect(()=>{if(h&&p&&oe.domReference&&oe.floating)return wu(oe.domReference,oe.floating,b,ee)},[h,p,oe,b,ee]);const Pe=jt(M),Oe=Cd(r,Pe,A),ke=Fn(M)||"center",de=!!xe.hide?.referenceHidden;ge(()=>{v&&p&&U&&C(Pe)},[v,p,U,Pe]);const He=m.useMemo(()=>({position:"absolute",top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),Be=xe.arrow?.centerOffset!==0;return m.useMemo(()=>({positionerStyles:J,arrowStyles:He,arrowRef:le,arrowUncentered:Be,side:Oe,align:ke,physicalSide:Pe,anchorHidden:de,refs:G,context:F,isPositioned:U,update:b}),[J,He,le,Be,Oe,ke,Pe,de,G,F,U,b])}function Au(e){return e!=null&&"current"in e}const Ed=m.forwardRef(function(t,n){const{cutout:r,...i}=t;let o;if(r){const s=r?.getBoundingClientRect();o=`polygon(
|
|
30
|
+
0% 0%,
|
|
31
|
+
100% 0%,
|
|
32
|
+
100% 100%,
|
|
33
|
+
0% 100%,
|
|
34
|
+
0% 0%,
|
|
35
|
+
${s.left}px ${s.top}px,
|
|
36
|
+
${s.left}px ${s.bottom}px,
|
|
37
|
+
${s.right}px ${s.bottom}px,
|
|
38
|
+
${s.right}px ${s.top}px,
|
|
39
|
+
${s.left}px ${s.top}px
|
|
40
|
+
)`}return R.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),V1=m.forwardRef(function(t,n){const{render:r,className:i,anchor:o,positionMethod:s="absolute",side:l="bottom",align:u="center",sideOffset:a=0,alignOffset:f=0,collisionBoundary:c="clipping-ancestors",collisionPadding:h=5,arrowPadding:d=5,sticky:p=!1,disableAnchorTracking:x=!1,collisionAvoidance:w=Gc,...g}=t,y=Er(),{filteredItems:v}=Ir(),k=Vl(),E=E1(),C=te(y,Ce.modal),P=te(y,Ce.open),L=te(y,Ce.mounted),q=te(y,Ce.openMethod),O=te(y,Ce.triggerElement),z=te(y,Ce.inputElement),_=te(y,Ce.inputInsidePopup),B=v.length===0,A=Sd({anchor:o??(_?O:z),floatingRootContext:k,positionMethod:s,mounted:L,side:l,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:c,collisionPadding:h,sticky:p,disableAnchorTracking:x,keepMounted:E,collisionAvoidance:w,lazyFlip:!0});kd(P&&C&&q!=="touch",O);const N=m.useMemo(()=>{const Z={...A.positionerStyles};return P||(Z.pointerEvents="none"),{role:"presentation",hidden:!L,style:Z}},[P,L,A.positionerStyles]),Y=m.useMemo(()=>({open:P,side:A.side,align:A.align,anchorHidden:A.anchorHidden,empty:B}),[P,A.side,A.align,A.anchorHidden,B]);ge(()=>{y.set("popupSide",A.side)},[y,A.side]);const $=m.useMemo(()=>({side:A.side,align:A.align,arrowRef:A.arrowRef,arrowUncentered:A.arrowUncentered,arrowStyles:A.arrowStyles,anchorHidden:A.anchorHidden,isPositioned:A.isPositioned}),[A.side,A.align,A.arrowRef,A.arrowUncentered,A.arrowStyles,A.anchorHidden,A.isPositioned]),K=me(Z=>{y.set("positionerElement",Z)}),S=nt("div",t,{state:Y,ref:[n,K],props:[N,g],stateAttributesMapping:Io});return R.jsxs(gd.Provider,{value:$,children:[L&&C&&R.jsx(Ed,{inert:vd(!P),cutout:z??O}),S]})});function Id(e){return e==="starting"?Mw:yt}const N1={...Io,...vo},_1=m.forwardRef(function(t,n){const{render:r,className:i,initialFocus:o,finalFocus:s,...l}=t,u=Er(),a=jl(),f=Vl(),{filteredItems:c}=Ir(),h=te(u,Ce.mounted),d=te(u,Ce.open),p=te(u,Ce.openMethod),x=te(u,Ce.transitionStatus),w=te(u,Ce.inputInsidePopup),g=te(u,Ce.inputElement),y=c.length===0;Sr({open:d,ref:u.state.popupRef,onComplete(){d&&u.state.onOpenChangeComplete(!0)}});const v=m.useMemo(()=>({open:d,side:a.side,align:a.align,anchorHidden:a.anchorHidden,transitionStatus:x,empty:y}),[d,a.side,a.align,a.anchorHidden,x,y]),k=nt("div",t,{state:v,ref:[n,u.state.popupRef],props:[{role:w?"dialog":"presentation",tabIndex:-1,onFocus(L){const q=Ct(L.nativeEvent);p!=="touch"&&(We(u.state.listElement,q)||q===L.currentTarget)&&u.state.inputRef.current?.focus()}},Id(x),l],stateAttributesMapping:N1}),C=o===void 0?w?L=>L==="touch"?u.state.popupRef.current:g:!1:o;let P;return s!=null?P=s:P=w?void 0:!1,R.jsx(qf,{context:f,disabled:!h,modal:!w,openInteractionType:p,initialFocus:C,returnFocus:P,children:k})});let zl=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Rd(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:o}=e,{register:s,unregister:l,subscribeMapChange:u,elementsRef:a,labelsRef:f,nextIndexRef:c}=w1(),h=m.useRef(-1),[d,p]=m.useState(o??(i===zl.GuessFromOrder?()=>{if(h.current===-1){const g=c.current;c.current+=1,h.current=g}return h.current}:-1)),x=m.useRef(null),w=m.useCallback(g=>{if(x.current=g,d!==-1&&g!==null&&(a.current[d]=g,f)){const y=t!==void 0;f.current[d]=y?t:r?.current?.textContent??g.textContent}},[d,a,f,t,r]);return ge(()=>{if(o!=null)return;const g=x.current;if(g)return s(g,n),()=>{l(g)}},[o,s,l,n]),ge(()=>{if(o==null)return u(g=>{const y=x.current?g.get(x.current)?.index:null;y!=null&&p(y)})},[o,u,p]),m.useMemo(()=>({ref:w,index:d}),[d,w])}const j1=m.createContext(void 0),z1=m.createContext(!1);function B1(){return m.useContext(z1)}const H1=m.memo(m.forwardRef(function(t,n){const{render:r,className:i,value:o=null,index:s,disabled:l=!1,nativeButton:u=!1,...a}=t,f=m.useRef(!1),c=m.useRef(null),h=Rd({index:s,textRef:c,indexGuessBehavior:zl.GuessFromOrder}),d=Er(),p=B1(),{flatFilteredItems:x}=Ir(),w=te(d,Ce.open),g=te(d,Ce.selectionMode),y=te(d,Ce.readOnly),v=te(d,Ce.virtualized),k=te(d,Ce.isItemEqualToValue),E=g!=="none",C=s??(v?wr(x,o,k):h.index),P=h.index!==-1,L=te(d,Ce.id),q=te(d,Ce.isActive,C),O=te(d,Ce.isSelected,o),z=te(d,Ce.items),_=te(d,Ce.getItemProps),B=m.useRef(null),D=L!=null&&P?`${L}-${C}`:void 0,A=O&&E;ge(()=>{if(!(P&&(v||s!=null)))return;const le=d.state.listRef.current;return le[C]=B.current,()=>{delete le[C]}},[P,v,C,s,d]),ge(()=>{if(!P||z)return;const fe=d.state.valuesRef.current;return fe[C]=o,g!=="none"&&d.state.allValuesRef.current.push(o),()=>{delete fe[C]}},[P,z,C,o,d,g]),ge(()=>{if(!w){f.current=!1;return}if(!P||z)return;const fe=d.state.selectedValue,le=Array.isArray(fe)?fe[fe.length-1]:fe;pn(le,o,k)&&d.set("selectedIndex",C)},[P,z,w,d,C,o,k]);const N=m.useMemo(()=>({disabled:l,selected:A,highlighted:q}),[l,A,q]),Y=_({active:q,selected:A});Y.id=void 0,Y.onFocus=void 0;const{getButtonProps:$,buttonRef:K}=ei({disabled:l,focusableWhenDisabled:!0,native:u});function S(fe){function le(){d.state.handleSelection(fe,o)}d.state.submitOnItemClick?(In.flushSync(le),d.state.requestSubmit()):le()}const Z={id:D,role:p?"gridcell":"option","aria-disabled":l||void 0,"aria-selected":E?A:void 0,tabIndex:void 0,onPointerDownCapture(fe){f.current=!0,fe.preventDefault()},onClick(fe){l||y||S(fe.nativeEvent)},onMouseUp(fe){const le=f.current;f.current=!1,!(l||y||fe.button!==0||le||!q)&&S(fe.nativeEvent)}},be=nt("div",t,{ref:[K,n,h.ref,B],state:N,props:[Y,Z,a,$]}),I=m.useMemo(()=>({selected:A,textRef:c}),[A,c]);return R.jsx(j1.Provider,{value:I,children:be})})),U1=m.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function $1(e=!1){const t=m.useContext(U1);if(!t&&!e)throw new Error(wt(86));return t}const q1=function(t){const n=Tn(),[r,i]=m.useState(t.initialControlId===void 0?n:t.initialControlId),[o,s]=m.useState(void 0),[l,u]=m.useState([]),{messageIds:a}=en(),f=m.useCallback(h=>Rn({"aria-describedby":a.concat(l).join(" ")||void 0},h),[a,l]),c=m.useMemo(()=>({controlId:r,setControlId:i,labelId:o,setLabelId:s,messageIds:l,setMessageIds:u,getDescriptionProps:f}),[r,i,o,s,l,u,f]);return R.jsx(hf.Provider,{value:c,children:t.children})},Pi=Object.keys(go);function W1(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of Pi)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function K1(e){const{formRef:t,clearErrors:n}=Jn(),{setValidityData:r,validate:i,validityData:o,validationDebounceTime:s,invalid:l,markedDirtyRef:u,state:a,name:f,shouldValidateOnChange:c}=e,{controlId:h,getDescriptionProps:d}=en(),p=Nt(),x=m.useRef(null),w=me(async(v,k=!1)=>{const E=x.current;if(!E)return;if(k){if(a.valid!==!1)return;const B=E.validity;if(!B.valueMissing){const A={value:v,state:{...go,valid:!0},error:"",errors:[],initialValue:o.initialValue};if(E.setCustomValidity(""),h){const N=t.current.fields.get(h);N&&t.current.fields.set(h,{...N,...zs(A,!1)})}r(A);return}const D=Pi.reduce((A,N)=>(A[N]=B[N],A),{});if(!D.valid&&!W1(D))return}function C(B){const D=Pi.reduce((N,Y)=>(N[Y]=B.validity[Y],N),{});let A=!1;for(const N of Pi)if(N!=="valid"){if(N==="valueMissing"&&D[N])A=!0;else if(D[N])return D}return A&&!u.current&&(D.valid=!0,D.valueMissing=!1),D}p.clear();let P=null,L=[];const q=C(E);let O;const z=c();if(E.validationMessage&&!z)O=E.validationMessage,L=[E.validationMessage];else{const B=Array.from(t.current.fields.values()).reduce((A,N)=>(N.name&&(A[N.name]=N.getValue()),A),{}),D=i(v,B);typeof D=="object"&&D!==null&&"then"in D?P=await D:P=D,P!==null?(q.valid=!1,q.customError=!0,Array.isArray(P)?(L=P,E.setCustomValidity(P.join(`
|
|
41
|
+
`))):P&&(L=[P],E.setCustomValidity(P))):z&&(E.setCustomValidity(""),q.customError=!1,E.validationMessage?(O=E.validationMessage,L=[E.validationMessage]):E.validity.valid&&!q.valid&&(q.valid=!0))}const _={value:v,state:q,error:O??(Array.isArray(P)?P[0]:P??""),errors:L,initialValue:o.initialValue};if(h){const B=t.current.fields.get(h);B&&t.current.fields.set(h,{...B,...zs(_,l)})}r(_)}),g=m.useCallback((v={})=>Rn(d,a.valid===!1?{"aria-invalid":!0}:yt,v),[d,a.valid]),y=m.useCallback((v={})=>Rn({onChange(k){if(k.nativeEvent.defaultPrevented)return;if(n(f),!c()){w(k.currentTarget.value,!0);return}if(l)return;const E=k.currentTarget;if(E.value===""){w(E.value);return}p.clear(),s?p.start(s,()=>{w(E.value)}):w(E.value)}},g(v)),[g,n,f,p,w,l,s,c]);return m.useMemo(()=>({getValidationProps:g,getInputValidationProps:y,inputRef:x,commit:w}),[g,y,w])}const G1=m.forwardRef(function(t,n){const{errors:r,validationMode:i,submitAttemptedRef:o}=Jn(),{render:s,className:l,validate:u,validationDebounceTime:a=0,validationMode:f=i,name:c,disabled:h=!1,invalid:d,dirty:p,touched:x,...w}=t,{disabled:g}=$1(),y=me(u||(()=>null)),v=g||h,[k,E]=m.useState(!1),[C,P]=m.useState(!1),[L,q]=m.useState(!1),[O,z]=m.useState(!1),_=p??C,B=x??k,D=m.useRef(!1),A=me(X=>{p===void 0&&(X&&(D.current=!0),P(X))}),N=me(X=>{x===void 0&&E(X)}),Y=me(()=>f==="onChange"||f==="onSubmit"&&o.current),$=!!(d||c&&{}.hasOwnProperty.call(r,c)&&r[c]!==void 0),[K,S]=m.useState({state:go,error:"",errors:[],value:null,initialValue:null}),Z=!$&&K.state.valid,be=m.useMemo(()=>({disabled:v,touched:B,dirty:_,valid:Z,filled:L,focused:O}),[v,B,_,Z,L,O]),I=K1({setValidityData:S,validate:y,validityData:K,validationDebounceTime:a,invalid:$,markedDirtyRef:D,state:be,name:c,shouldValidateOnChange:Y}),fe=m.useMemo(()=>({invalid:$,name:c,validityData:K,setValidityData:S,disabled:v,touched:B,setTouched:N,dirty:_,setDirty:A,filled:L,setFilled:q,focused:O,setFocused:z,validate:y,validationMode:f,validationDebounceTime:a,shouldValidateOnChange:Y,state:be,markedDirtyRef:D,validation:I}),[$,c,K,v,B,N,_,A,L,q,O,z,y,f,a,Y,be,I]),le=nt("div",t,{ref:n,state:be,props:w,stateAttributesMapping:gn});return R.jsx(df.Provider,{value:fe,children:le})}),Ys=m.forwardRef(function(t,n){return R.jsx(q1,{children:R.jsx(G1,{...t,ref:n})})}),Xs=m.forwardRef(function(t,n){const{render:r,className:i,id:o,...s}=t,l=Zt(!1),{controlId:u,setLabelId:a,labelId:f}=en(),c=Tn(o),h=m.useRef(null);return ge(()=>(c&&a(c),()=>{a(void 0)}),[c,a]),nt("label",t,{ref:[n,h],state:l.state,props:[{id:f,htmlFor:u??void 0,onMouseDown(p){Ct(p.nativeEvent)?.closest("button,input,select,textarea")||!p.defaultPrevented&&p.detail>1&&p.preventDefault()}},s],stateAttributesMapping:gn})}),Qs=m.forwardRef(function(t,n){const{render:r,id:i,className:o,match:s,...l}=t,u=Tn(i),{validityData:a,state:f,name:c}=Zt(!1),{setMessageIds:h}=en(),{errors:d}=Jn(),p=c?d[c]:null;let x=!1;p||s===!0?x=!0:s?x=!!a.state[s]:x=a.state.valid===!1,ge(()=>{if(!(!x||!u))return h(g=>g.concat(u)),()=>{h(g=>g.filter(y=>y!==u))}},[x,u,h]);const w=nt("div",t,{ref:n,state:f,props:[{id:u,children:p||(a.errors.length>1?m.createElement("ul",{},a.errors.map(g=>m.createElement("li",{key:g},g))):a.error)},l],stateAttributesMapping:gn});return x?w:null}),Js=m.forwardRef(function(t,n){const{render:r,id:i,className:o,...s}=t,l=Tn(i),u=Zt(!1),{setMessageIds:a}=en();return ge(()=>{if(l)return a(c=>c.concat(l)),()=>{a(c=>c.filter(h=>h!==l))}},[l,a]),nt("p",t,{ref:n,state:u.state,props:[{id:l},s],stateAttributesMapping:gn})}),Y1=m.forwardRef(function(t,n){const{render:r,className:i,id:o,name:s,value:l,disabled:u=!1,onValueChange:a,defaultValue:f,...c}=t,{state:h,name:d,disabled:p}=Zt(),x=p||u,w=d??s,g=m.useMemo(()=>({...h,disabled:x}),[h,x]),{setTouched:y,setDirty:v,validityData:k,setFocused:E,setFilled:C,validationMode:P,validation:L}=Zt(),{labelId:q}=en(),O=Nl({id:o});ge(()=>{const N=l!=null;L.inputRef.current?.value||N&&l!==""?C(!0):N&&l===""&&C(!1)},[L.inputRef,C,l]);const[z,_]=qn({controlled:l,default:f,name:"FieldControl",state:"value"}),B=l!==void 0,D=me((N,Y)=>{a?.(N,Y),!Y.isCanceled&&_(N)});return yo({id:O,name:w,commit:L.commit,value:z,getValue:()=>L.inputRef.current?.value,controlRef:L.inputRef}),nt("input",t,{ref:n,state:g,props:[{id:O,disabled:x,name:w,ref:L.inputRef,"aria-labelledby":q,...B?{value:z}:{defaultValue:f},onChange(N){const Y=N.currentTarget.value;D(Y,Te(kt,N.nativeEvent)),v(Y!==k.initialValue),C(Y!=="")},onFocus(){E(!0)},onBlur(N){y(!0),E(!1),P==="onBlur"&&L.commit(N.currentTarget.value)},onKeyDown(N){N.currentTarget.tagName==="INPUT"&&N.key==="Enter"&&(y(!0),L.commit(N.currentTarget.value))}},L.getInputValidationProps(),c],stateAttributesMapping:gn})}),Tu="w-full rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-indigo-300 focus:outline-none focus:ring-2 focus:ring-indigo-300 disabled:text-gray-500 data-[invalid]:border-red-500 data-[invalid]:focus:border-red-500 data-[invalid]:focus:ring-red-500/20",X1=m.forwardRef(({label:e,error:t,hint:n,required:r,suggestions:i,...o},s)=>i!=null&&i.length>0?R.jsxs(Ys,{invalid:t!=null,children:[e!=null&&R.jsxs(Xs,{className:"block text-sm font-bold text-gray-700 mb-1.5",children:[e,r===!0&&R.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),R.jsxs(i1,{items:i,children:[R.jsx(g1,{ref:s,className:Tu,...o}),R.jsx(I1,{children:R.jsx(V1,{className:"z-50",sideOffset:4,style:{width:"var(--anchor-width)"},children:R.jsx(_1,{className:"rounded-lg border border-gray-200 bg-white shadow-lg overflow-hidden",children:R.jsx(S1,{className:"max-h-60 overflow-auto p-1",children:l=>R.jsx(H1,{value:l,className:"px-3 py-2 text-sm text-gray-900 rounded-md cursor-pointer data-[highlighted]:bg-indigo-50 data-[highlighted]:text-indigo-900 data-[selected]:font-medium",children:l},l)})})})})]}),n!=null&&t==null&&R.jsx(Js,{className:"mt-1.5 text-sm text-gray-500",children:n}),t!=null&&R.jsx(Qs,{className:"mt-1.5 text-sm text-red-600",children:t})]}):R.jsxs(Ys,{invalid:t!=null,children:[e!=null&&R.jsxs(Xs,{className:"block text-sm font-bold text-gray-700 mb-1.5",children:[e,r===!0&&R.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),R.jsx(Y1,{ref:s,className:Tu,...o}),n!=null&&t==null&&R.jsx(Js,{className:"mt-1.5 text-sm text-gray-500",children:n}),t!=null&&R.jsx(Qs,{className:"mt-1.5 text-sm text-red-600",children:t})]})),Ad=m.createContext(null),Td=m.createContext(null);function Ln(){const e=m.useContext(Ad);if(e===null)throw new Error(wt(60));return e}function Pd(){const e=m.useContext(Td);if(e===null)throw new Error(wt(61));return e}const Ne={id:ae(e=>e.id),modal:ae(e=>e.modal),multiple:ae(e=>e.multiple),items:ae(e=>e.items),itemToStringLabel:ae(e=>e.itemToStringLabel),itemToStringValue:ae(e=>e.itemToStringValue),isItemEqualToValue:ae(e=>e.isItemEqualToValue),value:ae(e=>e.value),open:ae(e=>e.open),mounted:ae(e=>e.mounted),forceMount:ae(e=>e.forceMount),transitionStatus:ae(e=>e.transitionStatus),openMethod:ae(e=>e.openMethod),activeIndex:ae(e=>e.activeIndex),selectedIndex:ae(e=>e.selectedIndex),isActive:ae((e,t)=>e.activeIndex===t),isSelected:ae((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(o=>pn(o,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:pn(i,n,r)}),isSelectedByFocus:ae((e,t)=>e.selectedIndex===t),popupProps:ae(e=>e.popupProps),triggerProps:ae(e=>e.triggerProps),triggerElement:ae(e=>e.triggerElement),positionerElement:ae(e=>e.positionerElement),listElement:ae(e=>e.listElement),scrollUpArrowVisible:ae(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ae(e=>e.scrollDownArrowVisible),hasScrollArrows:ae(e=>e.hasScrollArrows),serializedValue:ae(e=>{const{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?"":Xt(n,r)})};function Q1(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:s=!1,onOpenChange:l,name:u,disabled:a=!1,readOnly:f=!1,required:c=!1,modal:h=!0,actionsRef:d,inputRef:p,onOpenChangeComplete:x,items:w,multiple:g=!1,itemToStringLabel:y,itemToStringValue:v,isItemEqualToValue:k=ad,highlightItemOnHover:E=!0,children:C}=e,{clearErrors:P}=Jn(),{setDirty:L,shouldValidateOnChange:q,validityData:O,setFilled:z,name:_,disabled:B,validation:D}=Zt(),{controlId:A}=en(),N=Nl({id:t}),Y=B||a,$=_??u,[K,S]=qn({controlled:n,default:g?r??wn:r,name:"Select",state:"value"}),[Z,be]=qn({controlled:o,default:s,name:"Select",state:"open"}),I=m.useRef([]),fe=m.useRef([]),le=m.useRef(null),X=m.useRef(null),ue=m.useRef(0),ie=m.useRef(null),we=m.useRef([]),Q=m.useRef(!1),H=m.useRef(!1),se=m.useRef(null),ne=m.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ae=m.useRef(!1),{mounted:ee,setMounted:G,transitionStatus:oe}=wo(Z),{openMethod:Ee,triggerProps:ye,reset:xe}=hd(Z),b=Wt(()=>new Wn({id:N,modal:h,multiple:g,itemToStringLabel:y,itemToStringValue:v,isItemEqualToValue:k,value:K,open:Z,mounted:ee,transitionStatus:oe,items:w,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,M=te(b,Ne.activeIndex),F=te(b,Ne.selectedIndex),U=te(b,Ne.triggerElement),j=te(b,Ne.positionerElement),T=m.useMemo(()=>g&&Array.isArray(K)&&K.length===0?"":Xt(K,v),[g,K,v]),V=m.useMemo(()=>g&&Array.isArray(K)?K.map(je=>Xt(je,v)):Xt(K,v),[g,K,v]),W=dt(b.state.triggerElement);yo({id:N,commit:D.commit,value:K,controlRef:W,name:$,getValue:()=>V});const J=m.useRef(K);ge(()=>{K!==J.current&&b.set("forceMount",!0)},[b,K]),ge(()=>{z(K!==null)},[K,z]),ge(function(){if(Z)return;const Ue=we.current;if(g){const Qe=Array.isArray(K)?K:[];if(Qe.length===0){b.set("selectedIndex",null);return}const Se=Qe[Qe.length-1],Mt=wr(Ue,Se,k);b.set("selectedIndex",Mt===-1?null:Mt);return}const ht=wr(Ue,K,k);b.set("selectedIndex",ht===-1?null:ht)},[g,Z,K,we,k,b]),lr(K,()=>{P($),L(K!==O.initialValue),q()?D.commit(K):D.commit(K,!0)});const he=me((je,Ue)=>{if(l?.(je,Ue),!Ue.isCanceled&&(be(je),!je&&b.state.activeIndex!==null)){const ht=I.current[b.state.activeIndex];queueMicrotask(()=>{ht?.setAttribute("tabindex","-1")})}}),Pe=me(()=>{G(!1),b.set("activeIndex",null),xe(),x?.(!1)});Sr({enabled:!d,open:Z,ref:le,onComplete(){Z||Pe()}}),m.useImperativeHandle(d,()=>({unmount:Pe}),[Pe]);const Oe=me((je,Ue)=>{i?.(je,Ue),!Ue.isCanceled&&S(je)}),ke=me(()=>{const je=b.state.listElement||le.current;if(!je)return;const Ue=je.scrollTop,ht=je.scrollTop+je.clientHeight,Qe=Ue>1,Se=ht<je.scrollHeight-1;b.state.scrollUpArrowVisible!==Qe&&b.set("scrollUpArrowVisible",Qe),b.state.scrollDownArrowVisible!==Se&&b.set("scrollDownArrowVisible",Se)}),de=Dl({open:Z,onOpenChange:he,elements:{reference:U,floating:j}}),He=Wf(de,{enabled:!f&&!Y,event:"mousedown"}),Be=td(de,{bubbles:!1}),De=rd(de,{enabled:!f&&!Y,listRef:I,activeIndex:M,selectedIndex:F,disabledIndices:wn,onNavigate(je){je===null&&!Z||b.set("activeIndex",je)},focusItemOnHover:!1}),Me=Yk(de,{enabled:!f&&!Y&&(Z||!g),listRef:fe,activeIndex:M,selectedIndex:F,onMatch(je){Z?b.set("activeIndex",je):Oe(we.current[je],Te("none"))},onTypingChange(je){Q.current=je}}),{getReferenceProps:rt,getFloatingProps:Ve,getItemProps:Pt}=nd([He,Be,De,Me]),tt=m.useMemo(()=>Rn(rt(),ye),[rt,ye]);xf(()=>{b.update({popupProps:Ve(),triggerProps:tt})}),ge(()=>{b.update({id:N,modal:h,multiple:g,value:K,open:Z,mounted:ee,transitionStatus:oe,popupProps:Ve(),triggerProps:tt,items:w,itemToStringLabel:y,itemToStringValue:v,isItemEqualToValue:k,openMethod:Ee})},[b,N,h,g,K,Z,ee,oe,Ve,tt,w,y,v,k,Ee]);const qe=m.useMemo(()=>({store:b,name:$,required:c,disabled:Y,readOnly:f,multiple:g,itemToStringLabel:y,itemToStringValue:v,highlightItemOnHover:E,setValue:Oe,setOpen:he,listRef:I,popupRef:le,scrollHandlerRef:X,handleScrollArrowVisibility:ke,scrollArrowsMountedCountRef:ue,getItemProps:Pt,events:de.context.events,valueRef:ie,valuesRef:we,labelsRef:fe,typingRef:Q,selectionRef:ne,selectedItemTextRef:se,validation:D,onOpenChangeComplete:x,keyboardActiveRef:H,alignItemWithTriggerActiveRef:Ae,initialValueRef:J}),[b,$,c,Y,f,g,y,v,E,Oe,he,Pt,de.context.events,D,x,ke]),Ot=An(p,D.inputRef),ln=g&&Array.isArray(K)&&K.length>0,Kt=m.useMemo(()=>!g||!Array.isArray(K)||!$?null:K.map(je=>{const Ue=Xt(je,v);return R.jsx("input",{type:"hidden",name:$,value:Ue},Ue)}),[g,K,$,v]);return R.jsx(Ad.Provider,{value:qe,children:R.jsxs(Td.Provider,{value:de,children:[C,R.jsx("input",{...D.getInputValidationProps({onFocus(){b.state.triggerElement?.focus()},onChange(je){if(je.nativeEvent.defaultPrevented)return;const Ue=je.target.value,ht=Te(kt,je.nativeEvent);function Qe(){if(g)return;const Se=we.current.find(Mt=>Xt(Mt,v).toLowerCase()===Ue.toLowerCase());Se!=null&&(L(Se!==O.initialValue),Oe(Se,ht),q()&&D.commit(Se))}b.set("forceMount",!0),queueMicrotask(Qe)}}),id:t||A||void 0,name:g?void 0:$,value:T,disabled:Y,required:c&&!ln,readOnly:f,ref:Ot,style:ri,tabIndex:-1,"aria-hidden":!0}),Kt]})})}const Si=2,J1={...md,...gn,value:()=>null},Z1=m.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:s=!0,...l}=t,{setTouched:u,setFocused:a,validationMode:f,state:c,disabled:h}=Zt(),{labelId:d}=en(),{store:p,setOpen:x,selectionRef:w,validation:g,readOnly:y,alignItemWithTriggerActiveRef:v,disabled:k,keyboardActiveRef:E}=Ln(),C=h||k||o,P=te(p,Ne.open),L=te(p,Ne.value),q=te(p,Ne.triggerProps),O=te(p,Ne.positionerElement),z=te(p,Ne.listElement),_=te(p,Ne.serializedValue),B=dt(O),D=m.useRef(null),A=Nt(),N=Nt(),{getButtonProps:Y,buttonRef:$}=ei({disabled:C,native:s}),K=me(X=>{p.set("triggerElement",X)}),S=An(n,D,$,K),Z=Nt(),be=Nt();m.useEffect(()=>{if(P)return be.start(200,()=>{w.current.allowUnselectedMouseUp=!0,Z.start(200,()=>{w.current.allowSelectedMouseUp=!0})}),()=>{Z.clear(),be.clear()};w.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},N.clear()},[P,w,N,Z,be]);const I=m.useMemo(()=>z?.id??Hi(O)?.id,[z,O]),fe=Rn(q,{role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?I:void 0,"aria-labelledby":d,"aria-readonly":y||void 0,tabIndex:C?-1:0,ref:S,onFocus(X){a(!0),P&&v.current&&x(!1,Te(xo,X.nativeEvent)),A.start(0,()=>{p.set("forceMount",!0)})},onBlur(){u(!0),a(!1),f==="onBlur"&&g.commit(L)},onPointerMove(){E.current=!1},onKeyDown(){E.current=!0},onMouseDown(X){if(P)return;const ue=Pn(X.currentTarget);function ie(we){if(!D.current)return;const Q=we.target;if(We(D.current,Q)||We(B.current,Q)||Q===D.current)return;const H=f1(D.current);we.clientX>=H.left-Si&&we.clientX<=H.right+Si&&we.clientY>=H.top-Si&&we.clientY<=H.bottom+Si||x(!1,Te(C0,we))}N.start(0,()=>{ue.addEventListener("mouseup",ie,{once:!0})})}},g.getValidationProps,l,Y);fe.role="combobox";const le=m.useMemo(()=>({...c,open:P,disabled:C,value:L,readOnly:y,placeholder:!_}),[c,P,C,L,y,_]);return nt("button",t,{ref:[n,D],state:le,stateAttributesMapping:J1,props:fe})}),eC={value:()=>null},tC=m.forwardRef(function(t,n){const{className:r,render:i,children:o,...s}=t,{store:l,valueRef:u}=Ln(),a=te(l,Ne.value),f=te(l,Ne.items),c=te(l,Ne.itemToStringLabel),h=te(l,Ne.serializedValue),d=m.useMemo(()=>({value:a,placeholder:!h}),[a,h]),p=typeof o=="function"?o(a):o??(Array.isArray(a)?Jk(a,c):Qk(a,f,c));return nt("span",t,{state:d,ref:[n,u],props:[{children:p},s],stateAttributesMapping:eC})}),nC=m.forwardRef(function(t,n){const{className:r,render:i,...o}=t,{store:s}=Ln(),l=te(s,Ne.open),u=m.useMemo(()=>({open:l}),[l]);return nt("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:c1})}),rC=m.createContext(void 0),iC=m.forwardRef(function(t,n){const{store:r}=Ln(),i=te(r,Ne.mounted),o=te(r,Ne.forceMount);return i||o?R.jsx(rC.Provider,{value:!0,children:R.jsx($f,{ref:n,...t})}):null}),Od=m.createContext(void 0);function oC(){const e=m.useContext(Od);if(!e)throw new Error(wt(59));return e}function Ji(e,t){e&&Object.assign(e.style,t)}const sC={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},lC={position:"fixed"},aC=m.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:o,render:s,side:l="bottom",align:u="center",sideOffset:a=0,alignOffset:f=0,collisionBoundary:c="clipping-ancestors",collisionPadding:h,arrowPadding:d=5,sticky:p=!1,disableAnchorTracking:x,alignItemWithTrigger:w=!0,collisionAvoidance:g=Gc,...y}=t,{store:v,listRef:k,labelsRef:E,alignItemWithTriggerActiveRef:C,selectedItemTextRef:P,valuesRef:L,initialValueRef:q,popupRef:O,setValue:z}=Ln(),_=Pd(),B=te(v,Ne.open),D=te(v,Ne.mounted),A=te(v,Ne.modal),N=te(v,Ne.value),Y=te(v,Ne.openMethod),$=te(v,Ne.positionerElement),K=te(v,Ne.triggerElement),S=te(v,Ne.isItemEqualToValue),Z=m.useRef(null),be=m.useRef(null),[I,fe]=m.useState(w),le=D&&I&&Y!=="touch";!D&&I!==w&&fe(w),ge(()=>{D||(Ne.scrollUpArrowVisible(v.state)&&v.set("scrollUpArrowVisible",!1),Ne.scrollDownArrowVisible(v.state)&&v.set("scrollDownArrowVisible",!1))},[v,D]),m.useImperativeHandle(C,()=>le),kd((le||A)&&B&&Y!=="touch",K);const X=Sd({anchor:r,floatingRootContext:_,positionMethod:i,mounted:D,side:l,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:c,collisionPadding:h,sticky:p,disableAnchorTracking:x??le,collisionAvoidance:g,keepMounted:!0}),ue=le?"none":X.side,ie=le?lC:X.positionerStyles,we=m.useMemo(()=>{const G={};return B||(G.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...ie,...G}}},[B,D,ie]),Q=m.useMemo(()=>({open:B,side:ue,align:X.align,anchorHidden:X.anchorHidden}),[B,ue,X.align,X.anchorHidden]),H=me(G=>{v.set("positionerElement",G)}),se=nt("div",t,{ref:[n,H],state:Q,stateAttributesMapping:Io,props:[we,y]}),ne=m.useRef(0),Ae=me(G=>{if(G.size===0&&ne.current===0||L.current.length===0)return;const oe=ne.current;if(ne.current=G.size,G.size===oe)return;const Ee=Te(kt);if(oe!==0&&!v.state.multiple&&N!==null&&wr(L.current,N,S)===-1){const xe=q.current,M=xe!=null&&$n(L.current,xe,S)?xe:null;z(M,Ee),M===null&&(v.set("selectedIndex",null),P.current=null)}if(oe!==0&&v.state.multiple&&Array.isArray(N)){const ye=N.filter(xe=>$n(L.current,xe,S));(ye.length!==N.length||ye.some(xe=>!$n(N,xe,S)))&&(z(ye,Ee),ye.length===0&&(v.set("selectedIndex",null),P.current=null))}if(B&&le){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ye={height:""};Ji($,ye),Ji(O.current,ye)}}),ee=m.useMemo(()=>({...X,side:ue,alignItemWithTriggerActive:le,setControlledAlignItemWithTrigger:fe,scrollUpArrowRef:Z,scrollDownArrowRef:be}),[X,ue,le,fe]);return R.jsx(bd,{elementsRef:k,labelsRef:E,onMapChange:Ae,children:R.jsxs(Od.Provider,{value:ee,children:[D&&A&&R.jsx(Ed,{inert:vd(!B),cutout:K}),se]})})});function Md(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Ei="base-ui-disable-scrollbar",Pu={className:Ei,element:R.jsx("style",{href:Ei,precedence:"base-ui:low",children:`.${Ei}{scrollbar-width:none}.${Ei}::-webkit-scrollbar{display:none}`})},uC=m.createContext(void 0);function cC(e){return m.useContext(uC)}const Fd="ArrowUp",Ld="ArrowDown",Dd="ArrowLeft",Vd="ArrowRight",Nd="Home",_d="End",fC=new Set([Dd,Vd]),dC=new Set([Fd,Ld]),hC=new Set([...fC,...dC]);[...hC];const pC=new Set([Fd,Ld,Dd,Vd,Nd,_d]),mC={...Io,...vo},gC=m.forwardRef(function(t,n){const{render:r,className:i,...o}=t,{store:s,popupRef:l,onOpenChangeComplete:u,setOpen:a,valueRef:f,selectedItemTextRef:c,keyboardActiveRef:h,multiple:d,handleScrollArrowVisibility:p,scrollHandlerRef:x}=Ln(),{side:w,align:g,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:k,scrollUpArrowRef:E}=oC(),C=cC()!=null,P=Pd(),L=Nt(),q=te(s,Ne.id),O=te(s,Ne.open),z=te(s,Ne.mounted),_=te(s,Ne.popupProps),B=te(s,Ne.transitionStatus),D=te(s,Ne.triggerElement),A=te(s,Ne.positionerElement),N=te(s,Ne.listElement),Y=m.useRef(0),$=m.useRef(!1),K=m.useRef(0),S=m.useRef(!1),Z=m.useRef({}),be=bo(),I=me(ue=>{if(!A||!l.current||!S.current)return;if($.current||!y){p();return}const ie=A.style.top==="0px",we=A.style.bottom==="0px",Q=A.getBoundingClientRect().height,H=Pn(A),se=getComputedStyle(A),ne=parseFloat(se.marginTop),Ae=parseFloat(se.marginBottom),ee=H.documentElement.clientHeight-ne-Ae,G=ue.scrollTop,oe=ue.scrollHeight,Ee=ue.clientHeight,ye=oe-Ee;let xe=null,b=null,M=!1;if(ie){const F=ye-G,U=Q+F,j=Math.min(U,ee);xe=j,j!==ee?b=ye:M=!0}else if(we){const F=G-0,U=Q+F,j=Math.min(U,ee),T=U-ee;xe=j,j!==ee?b=0:(M=!0,G<ye&&(b=G-(F-T)))}xe!=null&&(A.style.height=`${xe}px`),b!=null&&(ue.scrollTop=b),M&&($.current=!0),p()});m.useImperativeHandle(x,()=>I,[I]),Sr({open:O,ref:l,onComplete(){O&&u?.(!0)}});const fe=m.useMemo(()=>({open:O,transitionStatus:B,side:w,align:g}),[O,B,w,g]);ge(()=>{!A||!l.current||Object.keys(Z.current).length||(Z.current={top:A.style.top||"0",left:A.style.left||"0",right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[l,A]),ge(()=>{z||y||(S.current=!1,$.current=!1,Y.current=0,K.current=0,Ji(A,Z.current))},[z,y,A,l]),ge(()=>{const ue=l.current;if(!(!z||!D||!A||!ue)){if(!y){S.current=!0,be.request(p);return}queueMicrotask(()=>{const ie=getComputedStyle(A),we=getComputedStyle(ue),Q=Pn(D),H=ft(A),se=D.getBoundingClientRect(),ne=A.getBoundingClientRect(),Ae=se.left,ee=se.height,G=N||ue,oe=G.scrollHeight,Ee=parseFloat(we.borderBottomWidth),ye=parseFloat(ie.marginTop)||10,xe=parseFloat(ie.marginBottom)||10,b=parseFloat(ie.minHeight)||100,M=5,F=5,U=20,j=Q.documentElement.clientHeight-ye-xe,T=Q.documentElement.clientWidth,V=j-se.bottom+ee,W=c.current,J=f.current;let he=0,Pe=0;if(W&&J){const qe=J.getBoundingClientRect(),Ot=W.getBoundingClientRect(),ln=qe.left-Ae,Kt=Ot.left-ne.left,je=qe.top-se.top+qe.height/2,Ue=Ot.top-ne.top+Ot.height/2;he=ln-Kt,Pe=Ue-je}const Oe=V+Pe+xe+Ee;let ke=Math.min(j,Oe);const de=j-ye-xe,He=Oe-ke,Be=Math.max(M,Ae+he),De=T-F,Me=Math.max(0,Be+ne.width-De);A.style.left=`${Be-Me}px`,A.style.height=`${ke}px`,A.style.maxHeight="auto",A.style.marginTop=`${ye}px`,A.style.marginBottom=`${xe}px`,ue.style.height="100%";const rt=G.scrollHeight-G.clientHeight,Ve=He>=rt;Ve&&(ke=Math.min(j,ne.height)-(He-rt));const Pt=se.top<U||se.bottom>j-U||ke<Math.min(oe,b),tt=(H.visualViewport?.scale??1)!==1&&kf;if(Pt||tt){S.current=!0,Ji(A,Z.current),In.flushSync(()=>v(!1));return}if(Ve){const qe=Math.max(0,j-Oe);A.style.top=ne.height>=de?"0":`${qe}px`,A.style.height=`${ke}px`,G.scrollTop=G.scrollHeight-G.clientHeight,Y.current=Math.max(b,ke)}else A.style.bottom="0",Y.current=Math.max(b,ke),G.scrollTop=He;Y.current===j&&($.current=!0),p(),setTimeout(()=>{S.current=!0})})}},[s,z,A,D,f,c,l,p,y,v,be,k,E,N]),m.useEffect(()=>{if(!y||!A||!z)return;const ue=ft(A);function ie(we){a(!1,Te(S0,we))}return ue.addEventListener("resize",ie),()=>{ue.removeEventListener("resize",ie)}},[a,y,A,z]);const le={...N?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":d||void 0,id:`${q}-list`},onKeyDown(ue){h.current=!0,C&&pC.has(ue.key)&&ue.stopPropagation()},onMouseMove(){h.current=!1},onPointerLeave(ue){if(Md(ue)||ue.pointerType==="touch")return;const ie=ue.currentTarget;L.start(0,()=>{s.set("activeIndex",null),ie.focus({preventScroll:!0})})},onScroll(ue){N||x.current?.(ue.currentTarget)},...y&&{style:N?{height:"100%"}:sC}},X=nt("div",t,{ref:[n,l],state:fe,stateAttributesMapping:mC,props:[_,le,Id(B),{className:!N&&y?Pu.className:void 0},o]});return R.jsxs(m.Fragment,{children:[Pu.element,R.jsx(qf,{context:P,modal:!1,disabled:!z,restoreFocus:!0,children:X})]})}),jd=m.createContext(void 0);function Bl(){const e=m.useContext(jd);if(!e)throw new Error(wt(57));return e}const yC=m.memo(m.forwardRef(function(t,n){const{render:r,className:i,value:o=null,label:s,disabled:l=!1,nativeButton:u=!1,...a}=t,f=m.useRef(null),c=Rd({label:s,textRef:f,indexGuessBehavior:zl.GuessFromOrder}),{store:h,getItemProps:d,setOpen:p,setValue:x,selectionRef:w,typingRef:g,valuesRef:y,keyboardActiveRef:v,multiple:k,highlightItemOnHover:E}=Ln(),C=Nt(),P=te(h,Ne.isActive,c.index),L=te(h,Ne.isSelected,c.index,o),q=te(h,Ne.isSelectedByFocus,c.index),O=te(h,Ne.isItemEqualToValue),z=c.index,_=z!==-1,B=m.useRef(null),D=dt(z);ge(()=>{if(!_)return;const X=y.current;return X[z]=o,()=>{delete X[z]}},[_,z,o,y]),ge(()=>{if(!_)return;const X=h.state.value;let ue=X;k&&Array.isArray(X)&&X.length>0&&(ue=X[X.length-1]),ue!==void 0&&pn(ue,o,O)&&h.set("selectedIndex",z)},[_,z,k,O,h,o]);const A=m.useMemo(()=>({disabled:l,selected:L,highlighted:P}),[l,L,P]),N=d({active:P,selected:L});N.onFocus=void 0,N.id=void 0;const Y=m.useRef(null),$=m.useRef("mouse"),K=m.useRef(!1),{getButtonProps:S,buttonRef:Z}=ei({disabled:l,focusableWhenDisabled:!0,native:u});function be(X){const ue=h.state.value;if(k){const ie=Array.isArray(ue)?ue:[],we=L?ud(ie,o,O):[...ie,o];x(we,Te(Ri,X))}else x(o,Te(Ri,X)),p(!1,Te(Ri,X))}const I={role:"option","aria-selected":L,"aria-disabled":l||void 0,tabIndex:P?0:-1,onFocus(){h.set("activeIndex",z)},onMouseEnter(){!v.current&&h.state.selectedIndex===null&&h.set("activeIndex",z)},onMouseMove(){E&&h.set("activeIndex",z)},onMouseLeave(X){!E||v.current||Md(X)||C.start(0,()=>{h.state.activeIndex===z&&h.set("activeIndex",null)})},onTouchStart(){w.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(X){Y.current=X.key,h.set("activeIndex",z)},onClick(X){K.current=!1,!(X.type==="keydown"&&Y.current===null)&&(l||Y.current===" "&&g.current||$.current!=="touch"&&!P||(Y.current=null,be(X.nativeEvent)))},onPointerEnter(X){$.current=X.pointerType},onPointerDown(X){$.current=X.pointerType,K.current=!0},onMouseUp(X){if(l)return;if(K.current){K.current=!1;return}const ue=!w.current.allowSelectedMouseUp&&L,ie=!w.current.allowUnselectedMouseUp&&!L;ue||ie||$.current!=="touch"&&!P||be(X.nativeEvent)}},fe=nt("div",t,{ref:[Z,n,c.ref,B],state:A,props:[N,I,a,S]}),le=m.useMemo(()=>({selected:L,indexRef:D,textRef:f,selectedByFocus:q,hasRegistered:_}),[L,D,f,q,_]);return R.jsx(jd.Provider,{value:le,children:fe})})),xC=m.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=Bl();return r||i?R.jsx(bC,{...t,ref:n}):null}),bC=m.memo(m.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...o}=e,{selected:s}=Bl(),l=m.useRef(null),{transitionStatus:u,setMounted:a}=wo(s),f=m.useMemo(()=>({selected:s,transitionStatus:u}),[s,u]),c=nt("span",e,{ref:[t,l],state:f,props:[{"aria-hidden":!0,children:"✔️"},o],stateAttributesMapping:vo});return Sr({open:s,ref:l,onComplete(){s||a(!1)}}),c})),wC=m.memo(m.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:o,hasRegistered:s}=Bl(),{selectedItemTextRef:l}=Ln(),{className:u,render:a,...f}=t,c=m.useCallback(d=>{if(!d||!s)return;const p=l.current===null||!l.current.isConnected;(o||p&&r.current===0)&&(l.current=d)},[l,r,o,s]);return nt("div",t,{ref:[c,n,i],props:f})})),vC=({label:e,options:t,value:n,onValueChange:r,placeholder:i="選択してください",error:o,required:s})=>R.jsxs("div",{className:"flex flex-col gap-1.5",children:[e!=null&&R.jsxs("span",{className:"text-sm font-bold text-gray-700",children:[e,s===!0&&R.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),R.jsxs(Q1,{value:n,onValueChange:r,children:[R.jsxs(Z1,{className:`flex items-center justify-between w-full rounded-lg border bg-gray-50 px-3 py-2 text-sm text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-300 cursor-pointer ${o!=null?"border-red-500":"border-gray-200 focus:border-indigo-300"}`,children:[R.jsx(tC,{children:l=>l==null?R.jsx("span",{className:"text-gray-400",children:i}):t.find(a=>a.value===l)?.label??l}),R.jsx(nC,{className:"text-gray-400",children:R.jsx(Eh,{})})]}),R.jsx(iC,{children:R.jsx(aC,{children:R.jsx(gC,{className:"z-50 min-w-[var(--anchor-width)] rounded-lg border border-gray-200 bg-white p-1",children:t.map(l=>R.jsxs(yC,{className:"flex items-center rounded-md px-3 py-2 text-sm text-gray-900 outline-none cursor-pointer hover:bg-gray-100 data-[highlighted]:bg-gray-100 data-[selected]:bg-indigo-50 data-[selected]:text-indigo-500",value:l.value,children:[R.jsx(xC,{className:"mr-2",children:R.jsx(Zs,{})}),R.jsx(wC,{children:l.label})]},l.value))})})})]}),o!=null&&R.jsx("p",{className:"text-sm text-red-600",children:o})]}),kC=m.forwardRef(({label:e,error:t,hint:n,required:r,...i},o)=>R.jsxs(Ys,{invalid:t!=null,children:[e!=null&&R.jsxs(Xs,{className:"block text-sm font-bold text-gray-700 mb-1.5",children:[e,r===!0&&R.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),R.jsx("textarea",{ref:o,className:`w-full rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-indigo-300 focus:outline-none focus:ring-2 focus:ring-indigo-300 disabled:text-gray-500 resize-y min-h-[80px] ${t!=null?"border-red-500 focus:border-red-500 focus:ring-red-500/20":""}`,...i}),n!=null&&t==null&&R.jsx(Js,{className:"mt-1.5 text-sm text-gray-500",children:n}),t!=null&&R.jsx(Qs,{className:"mt-1.5 text-sm text-red-600",children:t})]})),CC=({field:e,value:t,onValueChange:n})=>{const r=m.useCallback(i=>{n(i??"")},[n]);return R.jsx(vC,{label:e.label,options:e.options,placeholder:e.placeholder,required:e.required,value:t,onValueChange:r})},SC=({field:e,checked:t,onCheckedChange:n})=>R.jsx(L0,{checked:t,label:e.label,required:e.required,onCheckedChange:n}),Hl=({field:e,namePrefix:t=""})=>{const{register:n,control:r}=ni(),i=o=>t?`${t}.${o}`:o;switch(e.type){case"input":return R.jsx(X1,{...n(i(e.id)),label:e.label,placeholder:e.placeholder,required:e.required,suggestions:e.suggestions,type:e.inputType});case"textarea":return R.jsx(kC,{...n(i(e.id)),label:e.label,placeholder:e.placeholder,required:e.required,rows:e.rows});case"select":return R.jsx(ja,{control:r,name:i(e.id),render:({field:o})=>R.jsx(CC,{field:e,value:o.value??"",onValueChange:o.onChange})});case"checkbox":return R.jsx(ja,{control:r,name:i(e.id),render:({field:o})=>R.jsx(SC,{checked:o.value??!1,field:e,onCheckedChange:o.onChange})});case"grid":return R.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${e.columns}, 1fr)`},children:e.fields.map(o=>R.jsx(Hl,{field:o,namePrefix:t},"id"in o?o.id:o.type))});default:return null}},EC=({index:e,fields:t,canRemove:n,onRemove:r})=>{const i=`items.${e}`,o=m.useCallback(()=>{r(e)},[e,r]);return R.jsxs("div",{className:"space-y-6 pb-6 border-b border-gray-200 last:border-b-0 last:pb-0",children:[R.jsxs("div",{className:"flex items-center justify-between",children:[R.jsxs("span",{className:"text-base font-medium text-gray-900",children:["#",e+1]}),R.jsx(co,{type:"button",variant:"outline",size:"icon",disabled:!n,onClick:o,children:R.jsx(kh,{})})]}),t.map(s=>R.jsx(Hl,{field:s,namePrefix:i},"id"in s?s.id:s.type))]})},zC=({step:e,formKey:t})=>{const{_:n}=Yn(),r=e.section,{sectionValue:i,updateSectionValue:o}=cf({formKey:t,section:r}),s=r.minFieldCount??0,l=i,u=l.length>=s?l:[...l,...Array.from({length:s-l.length},()=>({}))],a=af({defaultValues:{items:u}}),{control:f}=a,{fields:c,append:h,remove:d}=u0({control:f,name:"items"}),p=Sl({control:f,name:"items"});m.useEffect(()=>{p&&o(p)},[p,o]);const x=c.length>s,w=m.useCallback(()=>{h({})},[h]),g=m.useCallback(v=>{v.preventDefault()},[]),y=m.useCallback(v=>{d(v)},[d]);return R.jsxs("div",{className:"rounded-xl bg-white border border-gray-100",children:[R.jsxs("div",{className:"px-6 pt-6",children:[R.jsxs("div",{className:"flex items-center justify-between",children:[R.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.title}),R.jsxs(co,{type:"button",variant:"outline",size:"sm",onClick:w,children:[R.jsx(bh,{}),n({id:"m16xKo"})]})]}),R.jsx("p",{className:"mt-4 text-sm text-gray-500",children:e.description})]}),R.jsx("hr",{className:"mx-6 mt-4 border-gray-200"}),R.jsx(Jc,{...a,children:R.jsx("form",{className:"p-6 space-y-6",onSubmit:g,children:c.length===0?R.jsx("p",{className:"text-sm text-gray-500 text-center py-4",children:n({id:"W/yZH3"})}):c.map((v,k)=>R.jsx(EC,{fields:r.fields,index:k,canRemove:x,onRemove:y},v.id))})})]})},IC=(e,t,n)=>e==="error"?{className:"bg-amber-500 text-white",content:R.jsx(Nu,{})}:e==="success"?{className:"bg-green-500 text-white",content:R.jsx(Zs,{})}:t?{className:"bg-indigo-500 text-white",content:R.jsx("span",{className:"text-sm font-medium",children:n})}:{className:"bg-gray-100 text-gray-600",content:R.jsx("span",{className:"text-sm font-medium",children:n})},BC=({scenarioName:e,isOpen:t,onClose:n,items:r,onItemClick:i})=>{const{_:o}=Yn(),s=m.useMemo(()=>r.map(u=>IC(u.status,u.selected,u.step)),[r]),l=m.useCallback(()=>{i(),n()},[i,n]);return R.jsx(mr,{children:t&&R.jsxs(R.Fragment,{children:[R.jsx(Qt.div,{className:"fixed inset-0 bg-black/50 z-40 xl:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:n}),R.jsxs(Qt.aside,{className:"fixed top-0 left-0 bottom-0 w-80 max-w-full bg-white z-50 flex flex-col overflow-y-auto xl:hidden",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{duration:.3,ease:"easeInOut"},children:[R.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[R.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Spec Snake Beta"}),R.jsx("button",{"aria-label":o({id:"vcpc5o"}),className:"p-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer *:size-5",type:"button",onClick:n,children:R.jsx(_u,{})})]}),R.jsxs("div",{className:"p-4 flex-1",children:[R.jsx("div",{className:"mb-4",children:R.jsx("h2",{className:"text-base font-semibold text-gray-900",children:e})}),R.jsx("nav",{"aria-label":o({id:"hUe0iX"}),className:"space-y-2",children:r.map((u,a)=>{const f=s[a];return f==null?null:R.jsxs(Oi,{"aria-current":u.selected?"step":void 0,className:`flex items-start gap-3 p-4 rounded-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2 ${u.selected?"bg-indigo-50 border border-indigo-200":"hover:bg-gray-50 border border-transparent"}`,to:u.to,onClick:l,children:[R.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${f.className}`,children:f.content}),R.jsxs("div",{className:"flex-1 min-w-0",children:[R.jsx("div",{className:`font-medium ${u.selected?"text-indigo-900":"text-gray-900"}`,children:u.title}),R.jsx("div",{className:"text-sm text-gray-500 truncate",children:u.description})]})]},u.to)})})]})]})]})})},HC=({step:e,formKey:t})=>{const n=e.section,{sectionValue:r,updateSectionValue:i}=cf({formKey:t,section:n}),o=af({defaultValues:r}),s=Sl({control:o.control});m.useEffect(()=>{i(s)},[s,i]);const l=m.useCallback(u=>{u.preventDefault()},[]);return R.jsxs("div",{className:"rounded-xl bg-white border border-gray-100",children:[R.jsxs("div",{className:"px-6 pt-6",children:[R.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.title}),R.jsx("p",{className:"mt-4 text-sm text-gray-500",children:e.description})]}),R.jsx("hr",{className:"mx-6 mt-4 border-gray-200"}),R.jsx(Jc,{...o,children:R.jsx("form",{className:"p-6 space-y-6",onSubmit:l,children:n.fields.map(u=>R.jsx(Hl,{field:u,namePrefix:""},"id"in u?u.id:u.type))})})]})},RC=(e,t,n)=>e==="error"?{bgClassName:"bg-amber-500",textClassName:"text-white",content:R.jsx(Nu,{}),shouldAnimate:!0}:e==="success"?{bgClassName:"bg-green-500",textClassName:"text-white",content:R.jsx(Zs,{}),shouldAnimate:!0}:t?{bgClassName:"bg-indigo-500",textClassName:"text-white",content:R.jsx("span",{className:"text-sm font-medium",children:n}),shouldAnimate:!1}:{bgClassName:"bg-gray-100",textClassName:"text-gray-600",content:R.jsx("span",{className:"text-sm font-medium",children:n}),shouldAnimate:!1},AC=({iconStyle:e,status:t,shrink:n})=>R.jsxs("div",{className:`relative flex items-center justify-center w-8 h-8 rounded-full ${n?"shrink-0":""} ${e.textClassName}`,children:[R.jsx(mr,{mode:"wait",children:R.jsx(Qt.div,{className:`absolute inset-0 rounded-full ${e.bgClassName}`,initial:e.shouldAnimate?{scale:0}:!1,animate:{scale:1},transition:{duration:.3,ease:[.34,1.56,.64,1]}},t)}),R.jsx(Qt.div,{className:"relative z-10",initial:e.shouldAnimate?{scale:0,opacity:0}:!1,animate:{scale:1,opacity:1},transition:{duration:.2,delay:e.shouldAnimate?.15:0},children:e.content},`content-${t}`)]}),UC=({scenarioName:e,items:t,isCollapsed:n,onItemClick:r,onToggleCollapse:i})=>{const{_:o}=Yn(),s=m.useMemo(()=>t.map(l=>RC(l.status,l.selected,l.step)),[t]);return R.jsxs(Qt.aside,{className:"hidden xl:flex shrink-0 bg-white rounded-2xl border border-gray-100 flex-col overflow-hidden sticky top-8 h-[calc(100vh-64px-56px-24px)] self-start",initial:!1,animate:{width:n?64:320},transition:{duration:.3,ease:"easeInOut"},children:[R.jsxs("div",{className:`flex-1 overflow-y-auto ${n?"p-2":"p-6"}`,children:[R.jsx(mr,{mode:"popLayout",children:!n&&R.jsx(Qt.div,{className:"mb-4 pb-4 border-b border-gray-200",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:R.jsx("h2",{className:"text-base font-semibold text-gray-900 truncate",children:e})})}),R.jsx("nav",{"aria-label":o({id:"hUe0iX"}),className:`space-y-2 ${n?"flex flex-col items-center":""}`,children:t.map((l,u)=>{const a=s[u];return a==null?null:R.jsxs(Oi,{"aria-current":l.selected?"step":void 0,"aria-label":n?l.title:void 0,className:`flex items-center rounded-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2 ${n?`justify-center w-10 h-10 ${l.selected?"bg-indigo-50 border border-indigo-200":"hover:bg-gray-50 border border-transparent"}`:`items-start gap-3 p-4 ${l.selected?"bg-indigo-50 border border-indigo-200":"hover:bg-gray-50 border border-transparent"}`}`,to:l.to,onClick:r,children:[R.jsx(AC,{shrink:!n,iconStyle:a,status:l.status}),R.jsx(mr,{mode:"popLayout",children:!n&&R.jsxs(Qt.div,{className:"flex-1 min-w-0 overflow-hidden",initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.2,delay:.2},children:[R.jsx("div",{className:`font-medium whitespace-nowrap ${l.selected?"text-indigo-900":"text-gray-900"}`,children:l.title}),R.jsx("div",{className:"text-sm text-gray-500 whitespace-nowrap",children:l.description})]})})]},l.to)})})]}),R.jsx("div",{className:n?"p-2":"p-4",children:R.jsx("div",{className:n?"flex justify-center":"flex justify-end",children:R.jsx("button",{"aria-label":o(n?{id:"tugdy6"}:{id:"mkMLq4"}),className:`rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer *:size-5 ${n?"flex items-center justify-center w-10 h-10":"p-2"}`,type:"button",onClick:i,children:R.jsx(Qt.div,{initial:!1,animate:{rotate:n?180:0},transition:{duration:.3,ease:"easeInOut"},className:"flex items-center justify-center",children:R.jsx(Ih,{})})})})})]})},zd="inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2 cursor-pointer px-4 py-2 text-sm gap-2",TC=`${zd} bg-indigo-500 text-white hover:bg-indigo-600 active:bg-indigo-700`,PC=`${zd} border border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 active:bg-gray-200`,$C=({prev:e,next:t,onSubmit:n})=>{const{_:r}=Yn(),i=m.useCallback(()=>{e?.onClick?.()},[e]),o=m.useCallback(()=>{t?.onClick?.()},[t]),s=m.useCallback(()=>{n?.()},[n]);return R.jsxs("div",{className:"flex items-center justify-between",children:[R.jsx("div",{children:e!=null&&R.jsxs(Oi,{to:e.to,className:PC,onClick:i,children:[R.jsx(Ch,{}),e.label]})}),R.jsxs("div",{children:[t!=null&&R.jsxs(Oi,{to:t.to,className:TC,onClick:o,children:[t.label,R.jsx(Sh,{})]}),n!=null&&R.jsx(co,{variant:"primary",onClick:s,children:r({id:"hYgDIe"})})]})]})},qC=({current:e,total:t,title:n,description:r})=>{const i=e/t*100,o=24,s=3,l=2*Math.PI*o,u=l-i/100*l;return R.jsx("div",{className:"bg-white rounded-xl p-4 border border-gray-100",children:R.jsxs("div",{className:"flex items-center gap-4",children:[R.jsxs("div",{className:"relative flex items-center justify-center",children:[R.jsxs("svg",{"aria-hidden":"true",className:"transform -rotate-90",width:"56",height:"56",children:[R.jsx("circle",{className:"text-gray-200",cx:"28",cy:"28",fill:"transparent",r:o,stroke:"currentColor",strokeWidth:s}),R.jsx("circle",{className:"text-indigo-500 transition-all duration-300",cx:"28",cy:"28",fill:"transparent",r:o,stroke:"currentColor",strokeDasharray:l,strokeDashoffset:u,strokeLinecap:"round",strokeWidth:s})]}),R.jsxs("span",{className:"absolute text-sm font-semibold text-gray-700",children:[e,"/",t]})]}),R.jsxs("div",{className:"flex-1 min-w-0",children:[R.jsx("h3",{className:"text-base font-semibold text-gray-900",children:n}),r!=null&&R.jsx("p",{className:"text-sm text-gray-500 truncate",children:r})]})]})})},Ou=hh()(ph(e=>({navStatuses:{},setNavStatus:(t,n,r)=>e(i=>({navStatuses:{...i.navStatuses,[t]:{...i.navStatuses[t]??{},[n]:r}}})),resetNavStatuses:t=>e(n=>({navStatuses:{...n.navStatuses,[t]:{}}}))}),{name:"design-docs-step-aside",storage:mh(()=>sessionStorage),partialize:e=>({navStatuses:e.navStatuses})})),OC={},WC=(e={})=>{const t=m.useMemo(()=>Zi(e.formKey),[e.formKey]),n=Ou(o=>o.navStatuses[t]??OC),r=Ou(o=>o.setNavStatus),i=m.useCallback(o=>{const l=(ur.getState().forms[t]?.errors??{})[o]===!0;r(t,o,l?"error":"success")},[t,r]);return{navStatuses:n,updateNavStatus:i}},MC={},KC=(e={})=>{const t=m.useMemo(()=>Zi(e.formKey),[e.formKey]),n=ur(o=>o.forms[t]?.values??MC),r=ur(o=>o.setError),i=m.useCallback((o,s)=>r(t,o,s),[t,r]);return{formValues:n,setFormError:i}};export{zC as A,BC as M,Bw as P,UC as S,KC as a,Hw as b,WC as c,jC as d,qC as e,HC as f,d0 as g,$C as h,_C as i,vh as u};
|