(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82270,e=>{"use strict";e.s(["OpenApiPage",()=>sj],82270);var t,n,r,o,l=e.i(843476),i=e.i(868888),a=e.i(792616),s=e.i(177986),u=e.i(91557),c=e.i(590280),d=e.i(343590),p=e.i(491066),f=e.i(16731),m=e.i(411901),h=e.i(196151),g=e.i(477222),v=e.i(810412),y=e.i(296548),x=e.i(271645),b=e.i(968701),w=e.i(986368);let j=(0,x.createContext)({}),S=({value:e,children:t})=>(0,l.jsx)(j.Provider,{value:e,children:t}),E=()=>(0,x.useContext)(j);var k=e.i(672655),O=e.i(863481),R=e.i(819701),I=e.i(939368),C=e.i(93734);function T({example:e}){return(0,l.jsx)(C.Description,{className:"overflow-wrap-anywhere text-[13px] [&_*]:text-[13px]",markdown:"object"==typeof e&&null!==e?`\`\`\`json ${function(e,t=45){return function e(t,n,r,o){return null===t?"null":void 0===t?"undefined":"string"==typeof t?JSON.stringify(t):"number"==typeof t||"boolean"==typeof t?String(t):Array.isArray(t)?function(t,n,r,o){if(0===t.length)return"[]";let l="["+t.map(t=>e(t,n,r,o)).join(", ")+"]";if(l.length<=n)return l;r++;let i="[\n"+t.map(t=>o.repeat(r)+e(t,n,r,o)).join(",\n")+"\n"+o.repeat(r-1)+"]";return r--,i}(t,n,r,o):"object"==typeof t&&null!==t?function(t,n,r,o){let l=Object.keys(t);if(0===l.length)return"{}";let i="{ "+l.map(l=>`${JSON.stringify(l)}: ${e(t[l],n,r,o)}`).join(", ")+" }";if(i.length<=n)return i;r++;let a="{\n"+l.map(l=>o.repeat(r)+`${JSON.stringify(l)}: ${e(t[l],n,r,o)}`).join(",\n")+"\n"+o.repeat(r-1)+"}";return r--,a}(t,n,r,o):String(t)}(e,t,0," ")}(e)} \`\`\``:`\`${"null"===e?null:JSON.stringify(e,void 0,2)}\``})}let P=({schema:e})=>{let t=(0,b.useLocaleStrings)(),n=e.example,r=void 0!==e.examples?Array.isArray(e.examples)?e.examples:[e.examples]:void 0,o=void 0!==n||void 0!==r&&r.length>0,i=r&&r.length>1?t["api.examples"]:t["api.example"];return o&&(0,l.jsxs)("div",{className:(0,y.cn)("flex prose prose-sm prose-gray dark:prose-invert mt-6 gap-1.5",("object"==typeof n||"object"==typeof(null==r?void 0:r[0]))&&"flex-col gap-y-3"),children:[(0,l.jsxs)("span",{children:[i,":"]}),void 0!==r?(0,l.jsx)("div",{className:(0,y.cn)("*:my-2","object"!=typeof r[0]&&"inline *:mr-2 [&_*]:inline"),children:r.map((e,t)=>(0,l.jsx)(T,{example:e},t))}):(0,l.jsx)(T,{example:n})]})},N=(e,t)=>null==t||""===t||!1===t?[]:!0===t?[e]:"string"==typeof t?[t]:"number"==typeof t?[String(t)]:Array.isArray(t)?t.flatMap(e=>"string"==typeof e?[e]:"number"==typeof e?[String(e)]:[]):[],M=(e,t=[])=>{var n;if(!e)return{pre:void 0,post:void 0};let r=e["x-mint"],o=[...null!=(n=null==r?void 0:r.pre)?n:[]],l=[];for(let n of(e.readOnly&&l.push("read-only"),e.writeOnly&&l.push("write-only"),t))l.push(...N(n,e[n]));return(null==r?void 0:r.post)&&l.push(...r.post),{pre:o.length?o:void 0,post:l.length?l:void 0}};var A=e.i(169690),L=e.i(483913);let D=({displayFlattened:e=!1,fieldType:t,schema:n,name:r,location:o,parentName:i,typeOptions:a,selectedIndex:s,onSelectTypeOption:u,paramId:c,style:d,explode:p,required:f,schemas:m,omitPadding:h,hideName:g,defaultExpanded:v,isLivePreview:x})=>{var b,w;let{post:j}=E(),{pre:S,post:k}=M((0,R.isArrayObject)(n)?n:void 0,j);if(!(0,R.isArrayObject)(n))return null;let O=null!=(b=null==a?void 0:a[null!=s?s:0])?b:"unknown",I=n.items,T=(0,R.hasPropertyChildren)(n.items),N=e&&!T?null!=(w=n.description)?w:`The ${t} is of type \`${O}\`.`:n.description,D=(0,R.isSchemaObject)(n.items)&&"object"===n.items.type;return(0,l.jsx)(A.ParamFieldWrapper,{paramId:c,className:"array-param-field",children:(0,l.jsxs)("div",{className:(0,y.cn)(!e&&!h&&"py-6"),children:[(0,l.jsx)(L.ParamHead,{id:c,name:g?void 0:r,location:o,required:null!=f&&f,deprecated:n.deprecated,typeLabel:O,fieldType:t,typeOptions:a,selectedTypeOptionIndex:s,onSelectTypeOption:u,parentName:i,pre:S,post:k,style:d,explode:p,isLivePreview:x}),(0,l.jsxs)("div",{className:(0,y.cn)({"mt-4":!h&&N}),children:[r&&N&&(0,l.jsx)(C.Description,{markdown:N}),(0,l.jsx)($,{schema:n,description:N}),(0,R.isSchemaObject)(I)&&(0,l.jsx)(ed,{omitPadding:!0,schema:I,displayFlattened:e,fieldType:t,location:o,name:r,parentName:i,style:d,explode:p,onSelectTypeOption:u,schemas:m,hideExampleDescription:!0,hideDescription:D,hideName:!0,defaultExpanded:v,isLivePreview:x}),(0,l.jsx)(P,{schema:n})]})]})})},$=({schema:e,description:t})=>(0,l.jsx)(l.Fragment,{children:(void 0!==e.minItems||void 0!==e.maxItems)&&(0,l.jsx)("div",{className:(0,y.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:(0,l.jsx)(F,{minItems:e.minItems,maxItems:e.maxItems})})}),F=({minItems:e,maxItems:t})=>e===t&&void 0!==e?(0,l.jsxs)(l.Fragment,{children:["Required array length: ",(0,l.jsx)("code",{children:e})," element",e>1?"s":""]}):e&&t?(0,l.jsxs)(l.Fragment,{children:["Required array length: ",(0,l.jsx)("code",{children:`${e} - ${t}`})," element",t>1?"s":""]}):e?(0,l.jsxs)(l.Fragment,{children:["Minimum array length: ",(0,l.jsx)("code",{children:e})]}):t?(0,l.jsxs)(l.Fragment,{children:["Maximum array length: ",(0,l.jsx)("code",{children:t})]}):"";var q=e.i(243378);let B="user_toggled_expandables",U=()=>{try{let e=sessionStorage.getItem(B);return e?JSON.parse(e):{}}catch{return{}}};var z=e.i(435772),K=e.i(596669);let W="expandable-content",H="Hide",V="Show",_="child attributes",Y=({title:e=_,defaultOpen:t=!1,onChange:n,lazy:r,className:o,children:i,uniqueParamId:a,onMount:s,onOpen:u,onClose:c,openedText:d=H,closedText:p=V,hasScrolledToAnchorRef:f,anchor:m})=>{let h=!!a,{ref:g,isExpanded:v,onManualToggle:y,isInSessionStorage:b}=((e,t=!1)=>{let n=(0,x.useRef)(null),[r,o]=(0,x.useState)(!1),[l,i]=(0,x.useState)(!1),[a,s]=(0,x.useState)(t);return(0,x.useEffect)(()=>{if(!e)return;let t=U();e in t&&(s(!!t[e]),o(!0),i(!0))},[e]),(0,x.useEffect)(()=>{let e=new IntersectionObserver(e=>{e[0]&&e[0].isIntersecting&&!r&&t&&s(e=>e||!0)},{rootMargin:"100px",threshold:0}),o=n.current;return o&&e.observe(o),()=>{o&&e.unobserve(o)}},[r,t]),{ref:n,isExpanded:a,onManualToggle:(0,x.useCallback)(t=>{s(t),o(!0),i(!0),e&&((e,t)=>{try{let n={...U(),[e]:t};sessionStorage.setItem(B,JSON.stringify(n))}catch{}})(e,t)},[e]),isInSessionStorage:l}})(a||"",t),[w,j]=(0,x.useState)(t),S=!!(a&&null!=m&&m.includes(a))&&!(null!=f&&f.current),E=h?!!S||(b?v:t):w,[k,O]=(0,x.useState)(E||!r);(0,x.useLayoutEffect)(()=>{E&&!k&&O(!0)},[E,k]),(0,x.useEffect)(()=>{null==s||s()},[]);let R=(0,x.useId)(),I=`${e}-${R}-content`.replace(/\s+/g,"-");return(0,l.jsxs)("details",{className:(0,z.cn)(q.Classes.Expandable,"mt-4 rounded-xl border-standard",o),"data-component-part":"expandable","data-testid":a?`${a}-children`:void 0,onToggle:e=>{let t=e.currentTarget.open;t!==E&&(e=>{h?y(e):j(e),(e=>{O(!0),n&&n(e),e?null==u||u():null==c||c()})(e)})(t)},open:E,ref:g,children:[(0,l.jsxs)("summary",{"aria-controls":I,"aria-expanded":E,className:(0,z.cn)("not-prose flex w-full cursor-pointer flex-row content-center items-center text-sm","rounded-t-xl px-3.5 py-3 text-stone-600 hover:bg-stone-50/50 hover:text-stone-900 dark:text-stone-300 dark:hover:bg-white/5 dark:hover:text-stone-200","list-none [&::-webkit-details-marker]:hidden",!E&&"rounded-b-xl"),"data-component-part":"expandable-button",children:[(0,l.jsx)(K.Icon,{className:(0,z.cn)("size-2.5 bg-stone-400 transition-transform",E&&"rotate-90"),"data-component-part":"expandable-icon",icon:"angle-right",overrideColor:!0,overrideSize:!0}),(0,l.jsx)("div",{className:"ml-3 text-left leading-tight",children:(0,l.jsxs)("p",{className:"m-0",contentEditable:!1,children:[E?d:p," ",e]})})]}),(0,l.jsx)("div",{className:(0,z.cn)(W,"mx-3 border-stone-100 border-t px-2 dark:border-white/10"),"data-component-part":W,id:I,children:k&&i})]},e)};var X=e.i(75048),G=e.i(819268),J=e.i(987700);let Z="Tab Title",Q=Object.assign(({children:e,defaultTabIndex:t=0,onTabChange:n,className:r,borderBottom:o,ariaLabel:i,panelsRef:a})=>{let s=(0,x.useRef)([]),u=(0,x.useId)(),c=(0,x.useMemo)(()=>x.Children.toArray(e).filter(e=>(0,x.isValidElement)(e)),[e]),d=(0,x.useMemo)(()=>c.map((e,t)=>{if(e.props.id)return e.props.id;let n=e.props.title??Z;return`${u}-${n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}-${t}`}),[c,u]),p=c.length>0?Math.max(0,Math.min(t,c.length-1)):0,[f,m]=(0,x.useState)(p);(0,x.useEffect)(()=>{c.length>0&&f>=c.length&&m(c.length-1)},[c.length,f]);let h=(0,x.useCallback)(e=>{e!==f&&(m(e),null==n||n(e))},[f,n]),g=(0,x.useCallback)((e,t)=>{let n=c.length;if(0!==n){if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();let r="ArrowLeft"===e.key?(t-1+n)%n:(t+1)%n;h(r),setTimeout(()=>{var e;null==(e=s.current[r])||e.focus()},0)}else if("Enter"===e.key||" "===e.key)e.preventDefault(),h(t);else if("Home"===e.key)e.preventDefault(),h(0),setTimeout(()=>{var e;null==(e=s.current[0])||e.focus()},0);else if("End"===e.key){e.preventDefault();let t=n-1;h(t),setTimeout(()=>{var e;null==(e=s.current[t])||e.focus()},0)}}},[c.length,h]);return(0,l.jsxs)("div",{className:(0,z.cn)(q.Classes.Tabs,"tabs tab-container",o&&"border-stone-200 border-b pb-6 dark:border-stone-700",r),children:[(0,l.jsx)("ul",{"aria-label":i??"Tabs",className:"not-prose mb-6 flex min-w-full flex-none gap-x-6 overflow-auto border-stone-200 border-b pb-px dark:border-stone-700","data-component-part":"tabs-list",role:"tablist",children:c.map((e,t)=>{let n=e.props.title??Z,r=e.props.icon,o=e.props.iconType,i=e.props.iconLibrary,a=t===f;return(0,l.jsx)("li",{"aria-controls":`panel-${d[t]}`,"aria-selected":a,className:"cursor-pointer","data-child-heading-ids":e.props[J.CHILD_HEADING_IDS_ATTRIBUTE],"data-child-tab-ids":e.props[J.CHILD_TAB_IDS_ATTRIBUTE],"data-component-part":"tab",id:d[t],onClick:e=>{e.stopPropagation(),h(t)},onKeyDown:e=>g(e,t),ref:e=>{s.current[t]=e},role:"tab",tabIndex:a?0:-1,children:(0,l.jsxs)("div",{className:(0,z.cn)("-mb-px flex max-w-max items-center gap-1.5 whitespace-nowrap border-b pt-3 pb-2.5 font-semibold text-sm leading-6",a?"border-current text-primary dark:text-primary-light":"border-transparent text-stone-900 hover:border-stone-300 dark:text-stone-200 dark:hover:border-stone-700"),"data-active":a,"data-component-part":"tab-button","data-testid":`tab-${n}`,children:[r&&(0,l.jsx)(K.Icon,{className:(0,z.cn)("size-4 shrink-0",a?"bg-primary dark:bg-primary-light":"bg-stone-900 dark:bg-stone-200",q.Classes.TabIcon),icon:r,iconLibrary:i,iconType:o,overrideColor:!0}),n]})},d[t])})}),(0,l.jsx)("div",{"data-component-part":"tabs-panels",ref:a,children:c.map((e,t)=>{let n=t===f;return(0,l.jsx)("div",{"aria-hidden":!n,"aria-labelledby":d[t],className:(0,z.cn)("prose dark:prose-invert overflow-x-auto",!n&&"hidden"),"data-component-part":"tab-content",id:`panel-${d[t]}`,role:"tabpanel",tabIndex:n?0:-1,children:e.props.children},d[t])})})]})},{Item:({children:e})=>(0,l.jsx)(l.Fragment,{children:e})}),ee=({options:e,selectedIndex:t,onSelectOption:n})=>(0,l.jsx)("div",{className:"-mt-2",children:(0,l.jsx)(Q,{defaultTabIndex:t,onTabChange:n,className:"!border-gray-100 dark:!border-white/10 [&_[data-component-part=tabs-list]]:!mb-4",children:e.map(e=>(0,l.jsx)(Q.Item,{title:e},e))})});var et=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let en=({fieldType:e,schema:t,name:n,location:r,parentName:o,typeOptions:i,selectedIndex:a,onSelectTypeOption:s,paramId:u,style:c,explode:d,required:p,displayFlattened:f=!1,schemas:m,oneOfOptions:h,lazy:g,omitPadding:v=!1,hideDescription:b,hideExampleDescription:w,hideName:j,defaultExpanded:S,isLivePreview:k})=>{var O;let{properties:I,additionalProperties:T}=function(e){return"object"!==e.type?{properties:void 0,additionalProperties:void 0}:{properties:e.properties,additionalProperties:e.additionalProperties}}(t),{anchor:N,hasScrolledToAnchorRef:D}=(0,X.useEndpointLocation)(),$=!!(u&&(null==N?void 0:N.includes(u))),F=!f,q=F&&$,B=S||$||f,U=(0,x.useRef)(null),z=(0,x.useCallback)(e=>{var t,n;let r=e.closest(".expandable-content");for(;r;){let e=r.previousElementSibling;(null==e?void 0:e.getAttribute("aria-expanded"))==="false"&&e.click(),r=null!=(n=null==(t=r.parentElement)?void 0:t.closest(".expandable-content"))?n:null}},[]);(0,x.useEffect)(()=>{if(!q)return;let e=()=>{(0,G.scrollElementIntoView)({shouldReturnEarly:!!(null==D?void 0:D.current),isLivePreview:k,checkIfShouldScroll:e=>!!U.current&&U.current.contains(e),preScrollCallback(e){z(e)},postScrollCallback(){D&&(D.current=!0)}})};return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[D,z,q,k]);let K=(0,R.hasPropertyChildren)(t),W=h||null==i?void 0:i[null!=a?a:0],H=null!=W?W:(0,R.generateSimpleSchemaLabel)(t),V=!!f,_=V&&!K?null!=(O=t.description)?O:`The ${e} is of type \`${H}\`.`:t.description,Y=!!h,J=!!_,Z=J&&V!==Y,Q=J&&!Z,{post:et}=E(),{pre:en,post:eo}=M(t,et);return(0,l.jsx)(A.ParamFieldWrapper,{noBorder:w,paramId:u,className:"object-param-field",ref:U,children:(0,l.jsxs)("div",{className:(0,y.cn)(!V&&!v&&"py-6"),children:[(0,l.jsx)(L.ParamHead,{id:u,name:j?void 0:n,location:r,required:null!=p&&p,deprecated:t.deprecated,typeLabel:H,fieldType:e,typeOptions:null!=i?i:[H],selectedTypeOptionIndex:a,onSelectTypeOption:s,parentName:o,pre:en,post:eo,style:c,explode:d,isLivePreview:k}),(0,l.jsxs)("div",{className:(0,y.cn)({"mt-4":!v&&(J||K)}),children:[Z&&!b&&(0,l.jsx)(C.Description,{markdown:_}),(0,l.jsxs)("div",{className:(0,y.cn)(Y&&"mt-4",Y&&!V&&"rounded-xl border border-gray-100 px-4 pb-4 pt-2 dark:border-white/10"),children:[Y&&(0,l.jsx)(ee,{selectedIndex:a,options:h,onSelectOption:s}),Q&&!b&&(0,l.jsx)("div",{className:(0,y.cn)(Y&&V&&"pt-6 pb-4"),children:(0,l.jsx)(C.Description,{markdown:_})}),K&&(0,l.jsx)("div",{className:(0,y.cn)(Y&&!V&&"-mt-4"),children:(0,l.jsx)(er,{expandable:F,defaultOpen:B,lazy:null!=g?g:!B,uniqueParamId:u,anchor:N,hasScrolledToAnchorRef:D,children:(0,l.jsxs)(l.Fragment,{children:[I&&Object.entries(I).map(([t,i])=>{let a="deepObject"===c&&d?(0,R.getDeepObjectParentName)(null!=n?n:void 0,o):(0,R.getRecursiveParentName)(null!=n?n:void 0,o);return(0,l.jsx)(ed,{schema:i,name:t,required:i.isRequired,fieldType:e,location:r,parentName:a,style:c,explode:d,onSelectTypeOption:s,schemas:m,defaultExpanded:S,isLivePreview:k},t)}),"object"==typeof T&&((0,R.isSchemaObject)(T)||(0,R.isCircularRef)(T))&&(0,l.jsx)(ed,{schema:T,name:"{key}",required:T.isRequired,fieldType:e,location:r,parentName:(0,R.getRecursiveParentName)(null!=n?n:void 0,o),style:c,explode:d,onSelectTypeOption:s,schemas:m,defaultExpanded:S,isLivePreview:k},"{key}")]})})}),F&&!w&&(0,l.jsx)(P,{schema:t})]})]})]})})};function er(e){var{expandable:t,children:n}=e,r=et(e,["expandable","children"]);return t?(0,l.jsx)(Y,Object.assign({},r,{children:n})):(0,l.jsx)(l.Fragment,{children:n})}let eo=({schema:e})=>{let t=(0,b.useLocaleStrings)(),n="boolean"===e.type?(0,R.getBooleanEnumOptions)(e):e.enum;return n&&0!==n.length?(0,l.jsxs)("div",{className:"whitespace-pre-wrap prose-sm mt-6",children:[t.availableOptions,":"," ",n.map((e,t)=>(0,l.jsxs)("div",{className:"inline-block",children:[(0,l.jsx)("code",{children:String(e)}),t!==n.length-1&&","," "]},`${e}-${t}`))]}):null},el=({enumTable:e})=>{let t=(0,b.useLocaleStrings)();return(0,l.jsxs)("div",{className:"whitespace-pre-wrap prose prose-sm mt-6",children:[t.availableOptions,":",(0,l.jsxs)("table",{className:"w-fit max-w-full text-sm not-prose",children:[(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"text-left",children:t["api.title"]}),(0,l.jsx)("th",{children:t["api.const"]})]}),e.map(({title:e,const:t})=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:e}),(0,l.jsx)("td",{children:(0,l.jsx)("code",{children:t})})]},e))]})]})},ei=({schema:e})=>{let t=e.exclusiveMinimum||void 0!==e.exclusiveMinimum,n=e.exclusiveMaximum||void 0!==e.exclusiveMaximum,r=(0,b.useLocaleStrings)(),o="";return(void 0!==e.maximum&&(o=`x ${n?"<":"<="} ${e.maximum}`),void 0!==e.minimum&&(o=`x ${t?">":">="} ${e.minimum}`),void 0!==e.maximum&&void 0!==e.minimum&&(o=`${e.minimum} ${t?"<":"<="} x ${n?"<":"<="} ${e.maximum}`),""===o&&void 0===e.multipleOf)?null:(0,l.jsxs)("div",{className:"prose prose-sm prose-gray dark:prose-invert mt-6",children:[o&&(0,l.jsxs)(l.Fragment,{children:[r.requiredRange,": ",(0,l.jsx)("code",{children:o})]}),e.multipleOf&&(0,l.jsxs)(l.Fragment,{children:[r["api.mustBeMultipleOf"]," ",(0,l.jsx)("code",{children:e.multipleOf})]})]})},ea=({schema:e,description:t})=>(0,l.jsxs)(l.Fragment,{children:["const"in e&&void 0!==e.const&&(0,l.jsxs)("div",{className:(0,y.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:["Allowed value: ",(0,l.jsx)("code",{children:`"${e.const}"`})]}),(void 0!==e.minLength||void 0!==e.maxLength)&&(0,l.jsx)("div",{className:(0,y.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:(0,l.jsx)(es,{minLength:e.minLength,maxLength:e.maxLength})}),"pattern"in e&&void 0!==e.pattern&&(0,l.jsxs)("div",{className:(0,y.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:["Pattern: ",(0,l.jsx)("code",{children:e.pattern})]})]}),es=({minLength:e,maxLength:t})=>e===t&&void 0!==e?(0,l.jsxs)(l.Fragment,{children:["Required string length: ",(0,l.jsx)("code",{children:e})]}):e&&t?(0,l.jsxs)(l.Fragment,{children:["Required string length: ",(0,l.jsx)("code",{children:`${e} - ${t}`})]}):e?(0,l.jsxs)(l.Fragment,{children:["Minimum string length: ",(0,l.jsx)("code",{children:e})]}):t?(0,l.jsxs)(l.Fragment,{children:["Maximum string length: ",(0,l.jsx)("code",{children:t})]}):"",eu=({fieldType:e,schema:t,name:n,location:r,typeOptions:o,selectedIndex:i,onSelectTypeOption:a,parentName:s,paramId:u,style:c,explode:d,enumTable:p,omitPadding:f,hideExampleDescription:m,isTopLevel:h,hideName:g,isLivePreview:v})=>{var x,b;let w=null!=(x=null==o?void 0:o[null!=i?i:0])?x:"unknown",j=h?null!=(b=t.description)?b:`The ${e} is of type \`${w}\`.`:t.description,S=m||(0,R.isFileExample)(t),{post:k}=E(),{pre:O,post:I}=M(t,k);return(0,l.jsx)(A.ParamFieldWrapper,{noBorder:m,paramId:u,className:"primitive-param-field",children:(0,l.jsxs)("div",{className:(0,y.cn)(!f&&"py-6"),children:[(0,l.jsx)(L.ParamHead,{id:u,name:g?void 0:n,typeLabel:w,location:r,fieldType:e,required:t.isRequired,deprecated:t.deprecated,defaultValue:t.default,typeOptions:o,selectedTypeOptionIndex:i,onSelectTypeOption:a,parentName:s,pre:O,post:I,style:c,explode:d,isLivePreview:v}),(0,l.jsxs)("div",{className:(0,y.cn)({"mt-4":!f&&(j||(0,R.isEnum)(t))}),children:[j&&(0,l.jsx)(C.Description,{className:(0,y.cn)(m&&"py-4"),markdown:j}),p&&(0,l.jsx)(el,{enumTable:p}),!p&&(0,R.isEnum)(t)&&(0,l.jsx)(eo,{schema:t}),!p&&(0,R.isStringSchema)(t)&&(0,l.jsx)(ea,{schema:t,description:j}),!p&&(0,R.isNumberSchema)(t)&&(0,l.jsx)(ei,{schema:t}),!S&&(0,l.jsx)(P,{schema:t})]})]})})};var ec=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let ed=({schema:e,omitPadding:t,name:n,displayFlattened:r=!1,typeOptions:o,fieldType:i,location:a,parentName:s,style:u,explode:c,required:d,onSelectTypeOption:p,selectedIndex:f,schemas:m,enumTable:h,hideExampleDescription:g,hideDescription:v,isTopLevel:y=!1,hideName:x=!1,defaultExpanded:b,isLivePreview:w})=>{var j;let S=(0,I.getParamIdFromSchema)(e,i,n,s);if((0,R.isCircularRef)(e)){let r=e[O.CIRCULAR_REF_KEY],p=null==m?void 0:m[r];return p?(0,l.jsx)(en,{lazy:!0,omitPadding:t,schema:Object.assign(Object.assign({},p),{description:e.description}),typeOptions:o,fieldType:i,name:n,location:a,parentName:s,style:u,explode:c,required:d,schemas:m,paramId:S,hideName:x,defaultExpanded:b,isLivePreview:w}):null}if(e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length>0){let o,h=e.oneOf.filter(e=>(0,R.isSchemaObject)(e));if(0===h.length)return null;if(h.some(e=>(0,R.isEnum)(e)&&"const"in e)&&(o=(h=(0,R.filterSchemasWithConsts)(h)).filter(e=>(0,R.isEnum)(e)&&"const"in e).map(e=>{var t,n;return{title:null!=(t=e.title)?t:"Unknown",const:null!=(n=e.const)?n:""}})),1===h.length&&(null==(j=h[0])?void 0:j.type)==="null"&&h[0])return(0,l.jsx)(eu,{omitPadding:t,fieldType:i,enumTable:o,schema:e,name:n,location:a,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,paramId:S,hideExampleDescription:g,isTopLevel:y,hideName:x,isLivePreview:w});let v=h.filter(e=>"null"!==e.type),E=h.some(e=>"null"===e.type),k=(0,R.generateSchemaOptionLabels)(v);if(1===v.length&&v[0]){let o=E&&e.typeLabel?[e.typeLabel]:k;return(0,l.jsx)(ed,{schema:v[0],omitPadding:t,displayFlattened:r,typeOptions:o,fieldType:i,name:n,location:a,parentName:s,style:u,explode:c,required:d,schemas:m,hideName:x,defaultExpanded:b,isLivePreview:w})}if(v.every(e=>"object"===e.type||(0,R.isObjectArray)(e)))return(0,l.jsx)(ef,{omitPadding:t,schema:e,schemas:v,displayFlattened:r,typeOptions:["object"],fieldType:i,name:n,location:a,style:u,explode:c,parentName:s,required:d,paramId:S,hideName:x,defaultExpanded:b,isLivePreview:w});{let e=v[null!=f?f:0];return e?(0,l.jsx)(ep,{omitPadding:t,schemas:v,schema:e,enumTable:o,displayFlattened:r,typeOptions:k,fieldType:i,name:n,location:a,style:u,explode:c,required:d,selectedIndex:f,parentName:s,onSelectTypeOption:p,hideName:x,defaultExpanded:b,isLivePreview:w}):null}}let E=(0,R.generateSchemaOptionLabels)([e]);return"array"!==e.type&&"object"!==e.type?(0,l.jsx)(eu,{omitPadding:t,fieldType:i,enumTable:h,schema:e,typeOptions:null!=o?o:E,name:n,location:a,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,paramId:S,hideExampleDescription:g,isTopLevel:y,hideName:x,isLivePreview:w}):"object"===e.type?(0,l.jsx)(en,{omitPadding:t,displayFlattened:r,fieldType:i,schema:e,typeOptions:null!=o?o:E,name:n,location:a,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,schemas:m,paramId:S,hideDescription:v,hideExampleDescription:g,hideName:x,defaultExpanded:b,isLivePreview:w}):"array"===e.type?(0,l.jsx)(D,{omitPadding:t,displayFlattened:r,fieldType:i,schema:e,typeOptions:null!=o?o:E,name:n,location:a,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,schemas:m,paramId:S,hideName:x,defaultExpanded:b,isLivePreview:w}):void 0};function ep(e){var{schemas:t}=e,n=ec(e,["schemas"]);let[r,o]=(0,x.useState)(0),i=t[r];return i?(0,l.jsx)(ed,Object.assign({},n,{selectedIndex:r,onSelectTypeOption:o,schema:i})):null}function ef(e){var{schemas:t,paramId:n}=e,r=ec(e,["schemas","paramId"]);let[o,i]=(0,x.useState)(0),a=t[o];if((0,R.isObjectArray)(a)&&(a=a.items),!a)return null;let s=(0,R.generateSchemaOptionLabels)(t),u=null!=n?n:(0,I.getParamIdFromSchema)(a,r.fieldType,r.name,r.parentName);return(0,l.jsx)(en,Object.assign({},r,{oneOfOptions:s,schema:a,selectedIndex:o,onSelectTypeOption:i,paramId:u}))}var em=e.i(507995);let eh=({apiReferenceData:e,pageMetadata:t,localeStrings:n=b.DEFAULT_LOCALE_STRINGS,markdownComponents:r,docsConfig:o,isLivePreview:i,className:a,readOnly:s,ReadOnlyWrapper:u,children:c})=>{var d,p,f,m;let h=e.schemaData,g="custom"===t.mode,v="frame"===t.mode,j=(null==(p=null==(d=null==o?void 0:o.api)?void 0:d.params)?void 0:p.expanded)==="all",E=null==(m=null==(f=null==o?void 0:o.api)?void 0:f.params)?void 0:m.post;if(!h)return null;let O=s&&u?u:x.default.Fragment;return(0,l.jsx)(k.ReadOnlyProvider,{value:null!=s&&s,children:(0,l.jsx)(b.LocalizationProvider,{localeStrings:n,children:(0,l.jsx)(S,{value:{post:E},children:(0,l.jsx)(w.MarkdownProvider,{markdownComponents:r,children:(0,l.jsx)("div",{className:(0,y.cn)("flex flex-col gap-8 isolate",a),id:"api-playground-2-schema-page",children:(0,l.jsx)(em.default,{children:(0,l.jsxs)("div",{className:(0,y.cn)("mdx-content","@container/columns-container relative",!g&&!v&&"prose prose-gray dark:prose-invert"),children:[(0,l.jsx)(em.default,{children:c}),(0,l.jsx)(O,{children:(0,l.jsx)(em.default,{children:(0,l.jsx)("div",Object.assign({className:(0,y.cn)(s&&"mx-7")},s&&{"data-block-selection-ignore":"true"},{children:(0,l.jsx)(ed,{schema:h,fieldType:"schema",displayFlattened:!0,defaultExpanded:j,isLivePreview:i})}))})})]})})})})})})})},eg=(0,x.createContext)({isSending:!1,isPlaygroundExpanded:!1});var ev=b,ey=e.i(334363),ex=e.i(547864),eb=e.i(165041),ew=e.i(41212),ej=e.i(392475);let eS=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n,fieldType:r="body"})=>{var o,i,a;let s=(0,b.useLocaleStrings)(),{selectedRequestBodyContentTypeIndex:u,setSelectedRequestBodyContentTypeIndex:c}=(0,ew.useSelectedRequestBodyContentType)(),d=null==(o=e.dependencies)?void 0:o.requestBody,p=null==d?void 0:d.description,f=Object.keys(null!=(i=null==d?void 0:d.content)?i:{}),m=Object.fromEntries(f.map(e=>{var t;return[e,null==(t=null==d?void 0:d.content[e])?void 0:t.schema]}).filter(e=>void 0!==e[1])),h=null==(a=e.dependencies)?void 0:a.schemas,g=Object.values(m)[u];return void 0===g?null:(0,l.jsxs)("div",{className:"api-section",children:[f.length>1?(0,l.jsx)(ej.SectionHeading,{title:s["api.body"],options:f,selectedIndex:u,onSelectOption:c,subtitle:p,withPadding:!p}):(0,l.jsx)(ej.SectionHeading,{title:s["api.body"],rightElement:f[0],subtitle:p,withPadding:!p}),(0,l.jsx)(ed,{schema:g,fieldType:r,displayFlattened:!0,omitPadding:!0,schemas:h,isTopLevel:!0,defaultExpanded:t,isLivePreview:n})]})};var eE=e.i(745786),ek=e.i(882890);let eO=({children:e,prefix:t,className:n})=>(0,l.jsxs)("div",{className:(0,z.cn)("flex items-center gap-1 break-all rounded-md bg-stone-100/50 px-2 py-0.5 font-medium text-stone-600 dark:bg-white/5 dark:text-stone-200",n),"data-component-part":"field-info-pill",children:[t&&(0,l.jsx)("span",{className:"text-stone-400 dark:text-stone-500",children:t}),(0,l.jsx)("span",{children:e})]});var eR=e.i(22042);let eI=(...e)=>e.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ");var eC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let eT=(0,x.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:i,...a},s)=>(0,x.createElement)("svg",{ref:s,...eC,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:eI("lucide",o),...a},[...i.map(([e,t])=>(0,x.createElement)(e,t)),...Array.isArray(l)?l:[l]])),eP=((e,t)=>{let n=(0,x.forwardRef)(({className:n,...r},o)=>(0,x.createElement)(eT,{ref:o,iconNode:t,className:eI(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r}));return n.displayName=`${e}`,n})("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.i(247167);var eN=e.i(174080);let eM={};function eA(e,t){let n=x.useRef(eM);return n.current===eM&&(n.current=e(t)),n}let eL=[];function eD(e){x.useEffect(e,eL)}var e$=Object.defineProperty,eF=(e,t,n)=>((e,t,n)=>t in e?e$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class eq{constructor(){eF(this,"currentId",0),eF(this,"clear",()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)}),eF(this,"disposeEffect",()=>this.clear)}static create(){return new eq}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}}function eB(){let e=eA(eq.create).current;return eD(e.disposeEffect),e}let eU=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ez=eU&&eU!==x.useLayoutEffect?eU:e=>e();function eK(e){let t=eA(eW).current;return t.next=e,ez(t.effect),t.trampoline}function eW(){let e={next:void 0,callback:eH,trampoline:(...t)=>{var n;return null==(n=e.callback)?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function eH(){}let eV={...x},e_=0,eY=eV.useId;function eX(e,t){if(void 0!==eY){let n=eY();return e??(t?`${t}-${n}`:n)}return function(e,t="mui"){let[n,r]=x.useState(e),o=e||n;return x.useEffect(()=>{null==n&&(e_+=1,r(`${t}-${e_}`))},[n,t]),o}(e,t)}let eG="u">typeof document?x.useLayoutEffect:()=>{};var eJ=Object.defineProperty,eZ=(e,t,n)=>((e,t,n)=>t in e?eJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);globalThis.requestAnimationFrame;let eQ=new class{constructor(){eZ(this,"callbacks",[]),eZ(this,"callbacksCount",0),eZ(this,"nextId",1),eZ(this,"startId",1),eZ(this,"isScheduled",!1),eZ(this,"tick",e=>{var t;this.isScheduled=!1;let n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let r=0;r=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class e0{constructor(){eZ(this,"currentId",null),eZ(this,"cancel",()=>{null!==this.currentId&&(eQ.cancel(this.currentId),this.currentId=null)}),eZ(this,"disposeEffect",()=>this.cancel)}static create(){return new e0}static request(e){return eQ.request(e)}static cancel(e){return eQ.cancel(e)}request(e){this.cancel(),this.currentId=eQ.request(()=>{this.currentId=null,e()})}}function e1(){let e=eA(e0.create).current;return eD(e.disposeEffect),e}function e2(){return"u">typeof window}function e5(e){return e3(e)?(e.nodeName||"").toLowerCase():"#document"}function e4(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function e6(e){var t;return null==(t=(e3(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function e3(e){return!!e2()&&(e instanceof Node||e instanceof e4(e).Node)}function e8(e){return!!e2()&&(e instanceof Element||e instanceof e4(e).Element)}function e7(e){return!!e2()&&(e instanceof HTMLElement||e instanceof e4(e).HTMLElement)}function e9(e){return!(!e2()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof e4(e).ShadowRoot)}let te=new Set(["inline","contents"]);function tt(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=tp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!te.has(o)}let tn=new Set(["table","td","th"]),tr=[":popover-open",":modal"];function to(e){return tr.some(t=>{try{return e.matches(t)}catch{return!1}})}let tl=["transform","translate","scale","rotate","perspective"],ti=["transform","translate","scale","rotate","perspective","filter"],ta=["paint","layout","strict","content"];function ts(e){let t=tu(),n=e8(e)?tp(e):e;return tl.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ti.some(e=>(n.willChange||"").includes(e))||ta.some(e=>(n.contain||"").includes(e))}function tu(){return!(typeof CSS>"u")&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let tc=new Set(["html","body","#document"]);function td(e){return tc.has(e5(e))}function tp(e){return e4(e).getComputedStyle(e)}function tf(e){return e8(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tm(e){if("html"===e5(e))return e;let t=e.assignedSlot||e.parentNode||e9(e)&&e.host||e6(e);return e9(t)?t.host:t}function th(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=tm(t);return td(n)?t.ownerDocument?t.ownerDocument.body:t.body:e7(n)&&tt(n)?n:e(n)}(e),l=o===(null==(r=e.ownerDocument)?void 0:r.body),i=e4(o);if(l){let e=tg(i);return t.concat(i,i.visualViewport||[],tt(o)?o:[],e&&n?th(e):[])}return t.concat(o,th(o,[],n))}function tg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let tv="u">typeof navigator,ty=function(){if(!tv)return{platform:"",maxTouchPoints:-1};let e=navigator.userAgentData;return null!=e&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}(),tx=function(){if(!tv)return"";let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform??""}(),tb=function(){if(!tv)return"";let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}(),tw=!(typeof CSS>"u")&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter:none"),tj="MacIntel"===ty.platform&&ty.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(ty.platform),tS=tv&&/apple/i.test(navigator.vendor),tE=tv&&/android/i.test(tx)||/android/i.test(tb),tk=tv&&tx.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,tO=tb.includes("jsdom/");function tR(e){return(null==e?void 0:e.ownerDocument)||document}function tI(){}let tC=Object.freeze([]),tT=Object.freeze({});var tP=Object.defineProperty,tN=(e,t,n)=>((e,t,n)=>t in e?tP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let tM={},tA={},tL="",tD=new class{constructor(){tN(this,"lockCount",0),tN(this,"restore",null),tN(this,"timeoutLock",eq.create()),tN(this,"timeoutUnlock",eq.create()),tN(this,"release",()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),tN(this,"unlock",()=>{var e;0===this.lockCount&&this.restore&&(null==(e=this.restore)||e.call(this),this.restore=null)})}acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(0===this.lockCount||null!==this.restore)return;let t=tR(e).documentElement,n=e4(t).getComputedStyle(t).overflowY;if("hidden"===n||"clip"===n){this.restore=tI;return}let r=tj||!function(e){if(typeof document>"u")return!1;let t=tR(e);return e4(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=r?function(e){let t=tR(e),n=t.documentElement,r=t.body,o=tt(n)?n:r,l=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=l}}(e):function(e){var t;let n=tR(e),r=n.documentElement,o=n.body,l=e4(r),i=0,a=0,s=!1,u=e0.create();if(tw&&((null==(t=l.visualViewport)?void 0:t.scale)??1)!==1)return()=>{};function c(){let t=l.getComputedStyle(r),n=l.getComputedStyle(o),u=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=r.scrollTop,a=r.scrollLeft,tM={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},tL=r.style.scrollBehavior,tA={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};let c=r.scrollHeight>r.clientHeight,d=r.scrollWidth>r.clientWidth,p="scroll"===t.overflowY||"scroll"===n.overflowY,f="scroll"===t.overflowX||"scroll"===n.overflowX,m=Math.max(0,l.innerWidth-o.clientWidth),h=Math.max(0,l.innerHeight-o.clientHeight),g=parseFloat(n.marginTop)+parseFloat(n.marginBottom),v=parseFloat(n.marginLeft)+parseFloat(n.marginRight),y=tt(r)?r:o;if(s=function(e){if(!("u">typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let t=tR(e).documentElement,n={scrollbarGutter:t.style.scrollbarGutter,overflowY:t.style.overflowY};t.style.scrollbarGutter="stable",t.style.overflowY="scroll";let r=t.offsetWidth;t.style.overflowY="hidden";let o=t.offsetWidth;return Object.assign(t.style,n),r===o}(e)){r.style.scrollbarGutter=u,y.style.overflowY="hidden",y.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:u,overflowY:"hidden",overflowX:"hidden"}),(c||p)&&(r.style.overflowY="scroll"),(d||f)&&(r.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:g||h?`calc(100dvh - ${g+h}px)`:"100dvh",width:v||m?`calc(100vw - ${v+m}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=i,o.scrollLeft=a,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function d(){Object.assign(r.style,tM),Object.assign(o.style,tA),s||(r.scrollTop=i,r.scrollLeft=a,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=tL)}function p(){d(),u.request(c)}return c(),l.addEventListener("resize",p),()=>{u.cancel(),d(),"function"==typeof l.removeEventListener&&l.removeEventListener("resize",p)}}(e)}};function t$(e,...t){let n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(e=>n.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${n} for the full message.`}let tF=x.createContext(void 0);function tq(e){let t=x.useContext(tF);if(void 0===t&&!e)throw Error(t$(36));return t}let tB=x.createContext(null);function tU(e){return x.useContext(tB)}let tz={style:{transition:"none"}},tK={fallbackAxisSide:"none"},tW={fallbackAxisSide:"end"},tH={clipPath:"inset(50%)",position:"fixed",top:0,left:0},tV=x.createContext(void 0);function t_(){let e=x.useContext(tV);return(null==e?void 0:e.direction)??"ltr"}function tY(e,t,n,r){let o=!1,l=!1,i=r??tT;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){l=!0},get isCanceled(){return o},get isPropagationAllowed(){return l},trigger:n,...i}}let tX=x.createContext(void 0);function tG(e=!0){let t=x.useContext(tX);if(void 0===t&&!e)throw Error(t$(25));return t}function tJ(){let e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}var tZ=Object.defineProperty,tQ=(e,t,n)=>((e,t,n)=>t in e?tZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class t0{constructor(){tQ(this,"nodesRef",{current:[]}),tQ(this,"events",tJ())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);-1!==t&&this.nodesRef.current.splice(t,1)}}var t1=Object.defineProperty,t2=(e,t,n)=>((e,t,n)=>t in e?t1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class t5{constructor(e){t2(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),t2(this,"getSnapshot",()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t]))return void t5.prototype.setState.call(this,{...this.state,...e})}set(e,t){Object.is(this.state[e],t)||t5.prototype.setState.call(this,{...this.state,[e]:t})}notifyAll(){let e={...this.state};t5.prototype.setState.call(this,e)}}var t4={exports:{}},t6={};function t3(){return n||(n=1,t4.exports=function(){if(t)return t6;t=1;var e=x.default,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,o=e.useEffect,l=e.useLayoutEffect,i=e.useDebugValue;function a(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch{return!0}}var s=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?function(e,t){return t()}:function(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),u=s[0].inst,c=s[1];return l(function(){u.value=n,u.getSnapshot=t,a(u)&&c({inst:u})},[e,n,t]),o(function(){return a(u)&&c({inst:u}),e(function(){a(u)&&c({inst:u})})},[e]),i(n),n};return t6.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,t6}()),t4.exports}var t8=t3(),t7={exports:{}},t9={},ne=(o||(o=1,t7.exports=function(){if(r)return t9;r=1;var e=x.default,t=t3(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,l=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;return t9.useSyncExternalStoreWithSelector=function(e,t,r,u,c){var d=l(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;var f=o(e,(d=a(function(){function e(e){if(!i){if(i=!0,o=e,e=u(e),void 0!==c&&p.hasValue){var t=p.value;if(c(t,e))return l=t}return l=e}if(t=l,n(o,e))return t;var r=u(e);return void 0!==c&&c(t,r)?(o=e,t):(o=e,l=r)}var o,l,i=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,r,u,c]))[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),s(f),f},t9}()),t7.exports);let nt=parseInt(x.version,10),nn=nt>=19?function(e,t,n,r,o){let l=x.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return t8.useSyncExternalStore(e.subscribe,l,l)}:function(e,t,n,r,o){return ne.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,o))};var nr=Object.defineProperty,no=(e,t,n)=>((e,t,n)=>t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class nl extends t5{constructor(e,t={},n){super(e),no(this,"controlledValues",new Map),no(this,"select",(e,t,n,r)=>(0,this.selectors[e])(this.state,t,n,r)),no(this,"useState",(e,t,n,r)=>(x.useDebugValue(e),nn(this,this.selectors[e],t,n,r))),this.context=t,this.selectors=n}useSyncedValue(e,t){x.useDebugValue(e),eG(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;eG(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;eG(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t,n){x.useDebugValue(e);let r=this,o=void 0!==t;this.controlledValues.has(e)||(this.controlledValues.set(e,o),o||Object.is(this.state[e],n)||super.setState({...this.state,[e]:n})),eG(()=>{o&&!Object.is(r.state[e],t)&&super.setState({...r.state,[e]:t})},[r,e,t,n,o])}set(e,t){!0!==this.controlledValues.get(e)&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&!0===this.controlledValues.get(e)){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&!0===this.controlledValues.get(e)){delete t[e];continue}super.setState({...this.state,...t})}useContextCallback(e,t){x.useDebugValue(e);let n=eK(t??tI);this.context[e]=n}useStateSetter(e){let t=x.useRef(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n,r=(n="function"==typeof e?e:this.selectors[e])(this.state);return t(r,r,this),this.subscribe(e=>{let o=n(e);if(!Object.is(r,o)){let e=r;r=o,t(o,e,this)}})}}class ni{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(void 0!==n&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function na(e){e.preventDefault(),e.stopPropagation()}function ns(e){return 0===e.mozInputSource&&!!e.isTrusted||(tE&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function nu(e){return!tO&&(!tE&&0===e.width&&0===e.height||tE&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function nc(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function nd(e){let t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}var np=Symbol("NOT_FOUND"),nf=e=>Array.isArray(e)?e:[e],nm=(e,t)=>e===t,nh="u">typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function ng(){return{s:0,v:void 0,o:null,p:null}}function nv(e,t={}){let n=ng(),{resultEqualityCheck:r}=t,o,l=0;function i(){var t;let i,a=n,{length:s}=arguments;for(let e=0;e{n=ng(),i.resetResultsCount()},i.resultsCount=()=>l,i.resetResultsCount=()=>{l=0},i}function ny(e,...t){let n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,o,l={},i=e.pop();"object"==typeof i&&(l=i,i=e.pop()),function(e,t=`expected a function, instead received ${typeof e}`){if("function"!=typeof e)throw TypeError(t)}(i,`createSelector expects an output function after the inputs, but received: [${typeof i}]`);let{memoize:a,memoizeOptions:s=[],argsMemoize:u=nv,argsMemoizeOptions:c=[],devModeChecks:d={}}={...n,...l},p=nf(s),f=nf(c),m=function(e){let t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),h=a(function(){return t++,i.apply(null,arguments)},...p);return Object.assign(u(function(){r++;let e=function(e,t){let n=[],{length:r}=e;for(let o=0;or,resetDependencyRecomputations:()=>{r=0},lastResult:()=>o,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:a,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var nx=ny(nv),nb=Object.assign((e,t=nx)=>{!function(e,t=`expected an object, instead received ${typeof e}`){if("object"!=typeof e)throw TypeError(t)}(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>nb});ny({memoize:function(e,t){let n,{equalityCheck:r=nm,maxSize:o=1,resultEqualityCheck:l}="object"==typeof t?t:{equalityCheck:t},i=function(e,t){if(null===e||null===t||e.length!==t.length)return!1;let{length:n}=e;for(let o=0;on&&i(n.key,e)?n.value:np,put(e,t){n={key:e,value:t}},getEntries:()=>n?[n]:[],clear(){n=void 0}}:function(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return np}return{get:r,put:function(t,o){r(t)===np&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(o,i);function u(){let t=s.get(arguments);if(t===np){if(t=e.apply(null,arguments),a++,l){let e=s.getEntries().find(e=>l(e.value,t));e&&(t=e.value,0!==a&&a--)}s.put(arguments,t)}return t}return u.clearCache=()=>{s.clear(),u.resetResultsCount()},u.resultsCount=()=>a,u.resetResultsCount=()=>{a=0},u},memoizeOptions:{maxSize:1,equalityCheck:Object.is}});let nw=(e,t,n,r,o,l,...i)=>{let a;if(i.length>0)throw Error(t$(1));if(e)a=e;else throw Error("Missing arguments");return a};var nj=Object.defineProperty;let nS={open:nw(e=>e.open),domReferenceElement:nw(e=>e.domReferenceElement),referenceElement:nw(e=>e.positionReference??e.referenceElement),floatingElement:nw(e=>e.floatingElement),floatingId:nw(e=>e.floatingId)};class nE extends nl{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:o,...l}=e;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:tJ(),nested:t,noEmit:n,triggerElements:o},nS),((e,t,n)=>((e,t,n)=>t in e?nj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n))(this,"setOpen",(e,t)=>{var n,r;if((!e||!this.state.open||nd(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",n)}null==(r=(n=this.context).onOpenChange)||r.call(n,e,t)})}}let nk={open:nw(e=>e.open),mounted:nw(e=>e.mounted),transitionStatus:nw(e=>e.transitionStatus),floatingRootContext:nw(e=>e.floatingRootContext),preventUnmountingOnClose:nw(e=>e.preventUnmountingOnClose),payload:nw(e=>e.payload),activeTriggerId:nw(e=>e.activeTriggerId),activeTriggerElement:nw(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:nw((e,t)=>void 0!==t&&e.activeTriggerId===t),isOpenedByTrigger:nw((e,t)=>void 0!==t&&e.activeTriggerId===t&&e.open),isMountedByTrigger:nw((e,t)=>void 0!==t&&e.activeTriggerId===t&&e.mounted),triggerProps:nw((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:nw(e=>e.popupProps),popupElement:nw(e=>e.popupElement),positionerElement:nw(e=>e.positionerElement)};var nO=Object.defineProperty;let nR={...nk,disabled:nw(e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled),modal:nw(e=>(void 0===e.parent.type||"context-menu"===e.parent.type)&&(e.modal??!0)),allowMouseEnter:nw(e=>"menu"===e.parent.type?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:nw(e=>e.stickIfOpen),parent:nw(e=>e.parent),rootId:nw(e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId),activeIndex:nw(e=>e.activeIndex),isActive:nw((e,t)=>e.activeIndex===t),hoverEnabled:nw(e=>e.hoverEnabled),instantType:nw(e=>e.instantType),lastOpenChangeReason:nw(e=>e.openChangeReason),floatingTreeRoot:nw(e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:nw(e=>e.floatingNodeId),floatingParentNodeId:nw(e=>e.floatingParentNodeId),itemProps:nw(e=>e.itemProps),closeDelay:nw(e=>e.closeDelay),keyboardEventRelay:nw(e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0)};class nI extends nl{constructor(e){super({...{...{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:new nE({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ni,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0}),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:tT,inactiveTriggerProps:tT,popupProps:tT},disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new t0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tT,keyboardEventRelay:void 0,closeDelay:0},...e},{positionerRef:x.createRef(),popupRef:x.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),onOpenChangeComplete:void 0,triggerElements:new ni},nR),((e,t,n)=>((e,t,n)=>t in e?nO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n))(this,"unsubscribeParentListener",null),this.observe(nw(e=>e.allowMouseEnter),(e,t)=>{"menu"===this.state.parent.type&&e!==t&&this.state.parent.store.set("allowMouseEnter",e)}),this.unsubscribeParentListener=this.observe("parent",e=>{var t;if(null==(t=this.unsubscribeParentListener)||t.call(this),"menu"===e.type){this.unsubscribeParentListener=e.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){let n=eA(()=>new nI(t)).current;return e??n}}let nC=x.createContext(void 0),nT=x.createContext(null),nP=x.createContext(null),nN=()=>{var e;return(null==(e=x.useContext(nT))?void 0:e.id)||null},nM=e=>{let t=x.useContext(nP);return e??t};function nA(e){let t=eX(),n=nM(e),r=nN();return eG(()=>{if(!t)return;let e={id:t,parentId:r};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,r]),t}function nL(e){let{children:t,id:n}=e,r=nN();return(0,l.jsx)(nT.Provider,{value:x.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function nD(e){let{children:t,externalTree:n}=e,r=eA(()=>n??new t0).current;return(0,l.jsx)(nP.Provider,{value:r,children:t})}function n$(e){return null==e?e:"current"in e?e.current:e}let nF=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({}),nq={[nF.startingStyle]:""},nB={[nF.endingStyle]:""};function nU(e){let{enabled:t=!0,open:n,ref:r,onComplete:o}=e,l=eK(o),i=function(e,t=!1,n=!0){let r=e1();return eK((o,l=null)=>{function i(){eN.flushSync(o)}r.cancel();let a=n$(e);if(null!=a)if("function"!=typeof a.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let e=function(){Promise.all(a.getAnimations().map(e=>e.finished)).then(()=>{null!=l&&l.aborted||i()}).catch(()=>{let t=a.getAnimations();if(n){if(null!=l&&l.aborted)return;i()}else t.length>0&&t.some(e=>e.pending||"finished"!==e.playState)&&e()})};if(t)return void function(){let t=nF.startingStyle;if(!a.hasAttribute(t))return r.request(e);let n=new MutationObserver(()=>{a.hasAttribute(t)||(n.disconnect(),e())});n.observe(a,{attributes:!0,attributeFilter:[t]}),null==l||l.addEventListener("abort",()=>n.disconnect(),{once:!0})}();r.request(e)}})}(r,n,!1);x.useEffect(()=>{if(!t)return;let e=new AbortController;return i(l,e.signal),()=>{e.abort()}},[t,n,l,i])}function nz(e){return`data-base-ui-${e}`}function nK(e,t,n=!0){return e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...nK(e,t.id,n)])}function nW(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){let t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}let nH="data-base-ui-focusable",nV="active",n_="selected",nY="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",nX="ArrowLeft",nG="ArrowRight",nJ="ArrowUp",nZ="ArrowDown";function nQ(e){var t;let n=e.activeElement;for(;(null==(t=null==n?void 0:n.shadowRoot)?void 0:t.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function n0(e,t){var n;if(!e||!t)return!1;let r=null==(n=t.getRootNode)?void 0:n.call(t);if(e.contains(t))return!0;if(r&&e9(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function n1(e){return"composedPath"in e?e.composedPath()[0]:e.target}function n2(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function n5(e){return(null==e?void 0:e.ownerDocument)||document}function n4(e){return e7(e)&&e.matches(nY)}function n6(e){return!!e&&"combobox"===e.getAttribute("role")&&n4(e)}function n3(e){return e?e.hasAttribute(nH)?e:e.querySelector(`[${nH}]`)||e:null}let n8="trigger-press",n7="trigger-hover",n9="trigger-focus",re="outside-press",rt="item-press",rn="focus-out",rr="escape-key",ro="list-navigation",rl="sibling-open",ri={intentional:"onClick",sloppy:"onPointerDown"},ra=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rs(e){let t=eA(ru,e).current;return t.next=e,eG(t.effect),t}function ru(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let rc=0;function rd(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(rc);let l=()=>null==e?void 0:e.focus({preventScroll:n});o?l():rc=requestAnimationFrame(l)}let rp=["top","right","bottom","left"],rf=Math.min,rm=Math.max,rh=Math.round,rg=Math.floor,rv=e=>({x:e,y:e}),ry={left:"right",right:"left",bottom:"top",top:"bottom"},rx={start:"end",end:"start"};function rb(e,t){return"function"==typeof e?e(t):e}function rw(e){return e.split("-")[0]}function rj(e){return e.split("-")[1]}function rS(e){return"x"===e?"y":"x"}function rE(e){return"y"===e?"height":"width"}let rk=new Set(["top","bottom"]);function rO(e){return rk.has(rw(e))?"y":"x"}function rR(e){return e.replace(/start|end/g,e=>rx[e])}let rI=["left","right"],rC=["right","left"],rT=["top","bottom"],rP=["bottom","top"];function rN(e){return e.replace(/left|right|bottom|top/g,e=>ry[e])}function rM(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rA(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function rL(e,t,n){return Math.floor(e/t)!==n}function rD(e,t){return t<0||t>=e.current.length}function r$(e,t){return rq(e,{disabledIndices:t})}function rF(e,t){return rq(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rq(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let l=t;do l+=n?-o:o;while(l>=0&&l<=e.current.length-1&&rB(e,l,r))return l}function rB(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);let r=e.current[t];return!!r&&(r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled"))}function rU(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function rz(e,t){return rU(t,e===nJ||e===nZ,e===nX||e===nG)}function rK(e,t,n){return rU(t,e===nZ,n?e===nX:e===nG)||"Enter"===e||" "===e||""===e}function rW(e=[]){let t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=e.map(e=>null==e?void 0:e.trigger),l=x.useCallback(t=>rH(t,e,"reference"),t),i=x.useCallback(t=>rH(t,e,"floating"),n),a=x.useCallback(t=>rH(t,e,"item"),r),s=x.useCallback(t=>rH(t,e,"trigger"),o);return x.useMemo(()=>({getReferenceProps:l,getFloatingProps:i,getItemProps:a,getTriggerProps:s}),[l,i,a,s])}function rH(e,t,n){var r;let o=new Map,l="item"===n,i={};for(let t in"floating"===n&&(i.tabIndex=-1,i[nH]=""),e)l&&e&&(t===nV||t===n_)||(i[t]=e[t]);for(let a=0;a{var t;return null==(t=r.get(l))?void 0:t.map(t=>t(...e)).find(e=>void 0!==e)})):e[l]=i)}}function r_(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}let rY={};function rX(e,t,n,r,o){let l={...rZ(e,rY)};return t&&(l=rG(l,t)),n&&(l=rG(l,n)),r&&(l=rG(l,r)),l}function rG(e,t){return rJ(t)?t(e):function(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case"style":e[n]=r_(e.style,r);break;case"className":e[n]=r0(e.className,r);break;default:!function(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return 111===n&&110===r&&o>=65&&o<=90&&("function"==typeof t||typeof t>"u")}(n,r)?e[n]=r:e[n]=function(e,t){return t?e?n=>{var r;if(null!=(r=n)&&"object"==typeof r&&"nativeEvent"in r){rQ(n);let r=t(n);return n.baseUIHandlerPrevented||null==e||e(n),r}let o=t(n);return null==e||e(n),o}:t:e}(e[n],r)}}return e}(e,t)}function rJ(e){return"function"==typeof e}function rZ(e,t){return rJ(e)?e(t):e??rY}function rQ(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function r0(e,t){return t?e?t+" "+e:t:e}function r1(e){let t,n,{children:r,open:o,onOpenChange:i,onOpenChangeComplete:a,defaultOpen:s=!1,disabled:u=!1,modal:c,loopFocus:d=!0,orientation:p="vertical",actionsRef:f,closeParentOnEsc:m=!1,handle:h,triggerId:g,defaultTriggerId:v=null,highlightItemOnHover:y=!0}=e,b=tG(!0),w=tq(!0),j=tU(),S=x.useContext(nC),E=x.useMemo(()=>S&&w?{type:"menu",store:w.store}:j?{type:"menubar",context:j}:b&&!w?{type:"context-menu",context:b}:{type:void 0},[b,w,j,S]),k=nI.useStore(null==h?void 0:h.store,{parent:E}),O=k.useState("floatingTreeRoot"),R=nA(O),I=nN();eG(()=>{b&&!w?k.update({parent:{type:"context-menu",context:b},floatingNodeId:R,floatingParentNodeId:I}):w&&k.update({floatingNodeId:R,floatingParentNodeId:I})},[b,w,R,I,k]),k.useControlledProp("open",o,s),k.useControlledProp("activeTriggerId",g,v),k.useContextCallback("onOpenChangeComplete",a);let C=k.useState("open"),T=k.useState("activeTriggerElement"),P=k.useState("positionerElement"),N=k.useState("hoverEnabled"),M=k.useState("modal"),A=k.useState("disabled"),L=k.useState("lastOpenChangeReason"),D=k.useState("parent"),$=k.useState("activeIndex"),F=k.useState("payload"),q=k.useState("floatingParentNodeId"),B=x.useRef(null),U=null!=q;k.useSyncedValues({disabled:u,modal:void 0===D.type?c:void 0,rootId:eX()});let{openMethod:z,triggerProps:K,reset:W}=function(e){let[t,n]=x.useState(null),r=eK((t,r)=>{e||n(r||(tj?"touch":""))}),o=x.useCallback(()=>{n(null)},[]),{onClick:l,onPointerDown:i}=function(e){let t=x.useRef(""),n=x.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:x.useCallback(n=>{if(0===n.detail)return void e(n,"keyboard");"pointerType"in n&&e(n,n.pointerType),e(n,t.current),t.current=""},[e]),onPointerDown:n}}(r);return x.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:l,onPointerDown:i}}),[t,o,l,i])}(C),H=k.useState("open");eG(()=>{if(H&&!k.select("activeTriggerId")&&1===k.context.triggerElements.size){let e=k.context.triggerElements.entries().next();if(!e.done){let[t,n]=e.value;k.update({activeTriggerId:t,activeTriggerElement:n})}}},[H,k]);let{forceUnmount:V}=function(e,t,n){let{mounted:r,setMounted:o,transitionStatus:l}=function(e,t=!1,n=!1){let[r,o]=x.useState(e&&t?"idle":void 0),[l,i]=x.useState(e);return e&&!l&&(i(!0),o("starting")),e||!l||"ending"===r||n||o("ending"),e||l||"ending"!==r||o(void 0),eG(()=>{if(!e&&l&&"ending"!==r&&n){let e=e0.request(()=>{o("ending")});return()=>{e0.cancel(e)}}},[e,l,r,n]),eG(()=>{if(!e||t)return;let n=e0.request(()=>{o(void 0)});return()=>{e0.cancel(n)}},[t,e]),eG(()=>{if(!e||!t)return;e&&l&&"idle"!==r&&o("starting");let n=e0.request(()=>{o("idle")});return()=>{e0.cancel(n)}},[t,e,l,o,r]),x.useMemo(()=>({mounted:l,setMounted:i,transitionStatus:r}),[l,r])}(e);t.useSyncedValues({mounted:r,transitionStatus:l});let i=eK(()=>{var e,r;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),null==n||n(),null==(r=(e=t.context).onOpenChangeComplete)||r.call(e,!1)});return nU({enabled:!t.useState("preventUnmountingOnClose"),open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:l}}(C,k,()=>{k.update({allowMouseEnter:!1,stickIfOpen:!0}),W()}),_=x.useRef("context-menu"!==D.type),Y=eB();x.useEffect(()=>{if(C||(B.current=null),"context-menu"===D.type){if(!C){Y.clear(),_.current=!1;return}Y.start(500,()=>{_.current=!0})}},[Y,C,D.type]),function(e=!0,t=null){eG(()=>{if(e)return tD.acquire(t)},[e,t])}(C&&M&&L!==n7&&"touch"!==z,P),eG(()=>{C||N||k.set("hoverEnabled",!0)},[C,N,k]);let X=x.useRef(!0),G=eB(),J=eK((e,n)=>{let r=n.reason;if(C===e&&n.trigger===T&&L===r||(n.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},e||null!=n.trigger||(n.trigger=T??void 0),null==i||i(e,n),n.isCanceled))return;let o={open:e,nativeEvent:n.event,reason:n.reason,nested:U};null==t||t.emit("openchange",o);let l=n.event;if(!1===e&&(null==l?void 0:l.type)==="click"&&"touch"===l.pointerType&&!X.current)return;if(!e&&null!==$){let e=k.context.itemDomElements.current[$];queueMicrotask(()=>{null==e||e.setAttribute("tabindex","-1")})}e&&r===n9?(X.current=!1,G.start(300,()=>{X.current=!0})):(X.current=!0,G.clear());let a=(r===n8||r===rt)&&0===l.detail&&(null==l?void 0:l.isTrusted),s=!e&&(r===rr||null==r);function u(){var t;let o={open:e,openChangeReason:r};B.current=n.event??null;let l=(null==(t=n.trigger)?void 0:t.id)??null;(l||e)&&(o.activeTriggerId=l,o.activeTriggerElement=n.trigger??null),k.update(o)}r===n7?eN.flushSync(u):u(),"menubar"===D.type&&(r===n9||r===rn||r===n7||r===ro||r===rl)?k.set("instantType","group"):a||s?k.set("instantType",a?"click":"dismiss"):k.set("instantType",void 0)}),Z=x.useCallback(e=>{let t=tY(e);return t.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},t},[k]),Q=x.useCallback(()=>{k.setOpen(!1,Z("imperative-action"))},[k,Z]);x.useImperativeHandle(f,()=>({unmount:V,close:Q}),[V,Q]),"context-menu"===D.type&&(n=D.context),x.useImperativeHandle(null==n?void 0:n.positionerRef,()=>P,[P]),x.useImperativeHandle(null==n?void 0:n.actionsRef,()=>({setOpen:J}),[J]);let ee=function(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,l=eX(),i=null!=nN(),a=t.useState("open"),s=t.useState("activeTriggerElement"),u=t.useState(r?"popupElement":"positionerElement"),c=t.context.triggerElements,d=eA(()=>new nE({open:a,referenceElement:s,floatingElement:u,triggerElements:c,onOpenChange:o,floatingId:l,nested:i,noEmit:n})).current;return eG(()=>{let e={open:a,floatingId:l,referenceElement:s,floatingElement:u};e8(s)&&(e.domReferenceElement=s),d.state.positionReference===d.state.referenceElement&&(e.positionReference=s),d.update(e)},[a,l,s,u,d]),d.context.onOpenChange=o,d.context.nested=i,d.context.noEmit=n,d}({popupStore:k,onOpenChange:J});t=ee.context.events,x.useEffect(()=>{let e=({open:e,eventDetails:t})=>J(e,t);return t.on("setOpen",e),()=>{null==t||t.off("setOpen",e)}},[t,J]);let et=function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),l=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:s}=n.context,{enabled:u=!0,escapeKey:c=!0,outsidePress:d=!0,outsidePressEvent:p="sloppy",referencePress:f=!1,referencePressEvent:m="sloppy",ancestorScroll:h=!1,bubbles:g,externalTree:v}=t,y=nM(v),b=eK("function"==typeof d?d:()=>!1),w="function"==typeof d?b:d,j=x.useRef(!1),{escapeKey:S,outsidePress:E}={escapeKey:"boolean"==typeof g?g:(null==g?void 0:g.escapeKey)??!1,outsidePress:"boolean"==typeof g?g:(null==g?void 0:g.outsidePress)??!0},k=x.useRef(null),O=eB(),R=eB(),I=eK(()=>{R.clear(),s.current.insideReactTree=!1}),C=x.useRef(!1),T=x.useRef(""),P=eK(e=>{T.current=e.pointerType}),N=eK(()=>{let e=T.current,t="function"==typeof p?p():p;return"string"==typeof t?t:t["pen"!==e&&e?e:"mouse"]}),M=eK(e=>{var t;if(!r||!u||!c||"Escape"!==e.key||C.current)return;let o=null==(t=s.current.floatingContext)?void 0:t.nodeId,l=y?nK(y.nodesRef.current,o):[];if(!S&&l.length>0){let e=!0;if(l.forEach(t=>{var n;null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let i=tY(rr,"nativeEvent"in e?e.nativeEvent:e);n.setOpen(!1,i),S||i.isPropagationAllowed||e.stopPropagation()}),A=eK(e=>{let t=N();return"intentional"===t&&"click"!==e.type||"sloppy"===t&&"click"===e.type}),L=eK(()=>{s.current.insideReactTree=!0,R.start(0,I)}),D=eK((e,t=!1)=>{var r;if(A(e)||s.current.insideReactTree)return void I();if("intentional"===N()&&t||"function"==typeof w&&!w(e))return;let o=n1(e),l=`[${nz("inert")}]`,i=n5(n.select("floatingElement")).querySelectorAll(l),a=n.context.triggerElements;if(o&&(a.hasElement(o)||a.hasMatchingElement(e=>n0(e,o))))return;let u=e8(o)?o:null;for(;u&&!td(u);){let e=tm(u);if(td(e)||!e8(e))break;u=e}if(i.length&&e8(o)&&!o.matches("html,body")&&!n0(o,n.select("floatingElement"))&&Array.from(i).every(e=>!n0(u,e)))return;if(e7(o)&&!("touches"in e)){let t=td(o),n=tp(o),r=/auto|scroll/,l=t||r.test(n.overflowX),i=t||r.test(n.overflowY),a=l&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,s=i&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,u="rtl"===n.direction,c=s&&(u?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=a&&e.offsetY>o.clientHeight;if(c||d)return}let c=null==(r=s.current.floatingContext)?void 0:r.nodeId,d=y&&nK(y.nodesRef.current,c).some(t=>{var n;return n2(e,null==(n=t.context)?void 0:n.elements.floating)});if(n2(e,n.select("floatingElement"))||n2(e,n.select("domReferenceElement"))||d)return;let p=y?nK(y.nodesRef.current,c):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,tY(re,e)),I()}),$=eK(e=>{"sloppy"!==N()||"touch"===e.pointerType||!n.select("open")||!u||n2(e,n.select("floatingElement"))||n2(e,n.select("domReferenceElement"))||D(e)}),F=eK(e=>{if("sloppy"!==N()||!n.select("open")||!u||n2(e,n.select("floatingElement"))||n2(e,n.select("domReferenceElement")))return;let t=e.touches[0];t&&(k.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}),q=eK(e=>{let t=n1(e);null==t||t.addEventListener(e.type,function n(){F(e),null==t||t.removeEventListener(e.type,n)})}),B=eK(e=>{let t=j.current;if(j.current=!1,O.clear(),"mousedown"===e.type&&k.current&&!k.current.dismissOnMouseDown)return;let n=n1(e);null==n||n.addEventListener(e.type,function r(){"pointerdown"===e.type?$(e):D(e,t),null==n||n.removeEventListener(e.type,r)})}),U=eK(e=>{if("sloppy"!==N()||!k.current||n2(e,n.select("floatingElement"))||n2(e,n.select("domReferenceElement")))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-k.current.startX),o=Math.abs(t.clientY-k.current.startY),l=Math.sqrt(r*r+o*o);l>5&&(k.current.dismissOnTouchEnd=!0),l>10&&(D(e),O.clear(),k.current=null)}),z=eK(e=>{let t=n1(e);null==t||t.addEventListener(e.type,function n(){U(e),null==t||t.removeEventListener(e.type,n)})}),K=eK(e=>{"sloppy"!==N()||!k.current||n2(e,n.select("floatingElement"))||n2(e,n.select("domReferenceElement"))||(k.current.dismissOnTouchEnd&&D(e),O.clear(),k.current=null)}),W=eK(e=>{let t=n1(e);null==t||t.addEventListener(e.type,function n(){K(e),null==t||t.removeEventListener(e.type,n)})});x.useEffect(()=>{if(!r||!u)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=E;let e=new eq;function t(e){n.setOpen(!1,tY("none",e))}function a(){e.clear(),C.current=!0}function d(){e.start(5*!!tu(),()=>{C.current=!1})}let p=n5(o);p.addEventListener("pointerdown",P,!0),c&&(p.addEventListener("keydown",M),p.addEventListener("compositionstart",a),p.addEventListener("compositionend",d)),w&&(p.addEventListener("click",B,!0),p.addEventListener("pointerdown",B,!0),p.addEventListener("touchstart",q,!0),p.addEventListener("touchmove",z,!0),p.addEventListener("touchend",W,!0),p.addEventListener("mousedown",B,!0));let f=[];return h&&(e8(i)&&(f=th(i)),e8(o)&&(f=f.concat(th(o))),!e8(l)&&l&&l.contextElement&&(f=f.concat(th(l.contextElement)))),(f=f.filter(e=>{var t;return e!==(null==(t=p.defaultView)?void 0:t.visualViewport)})).forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{p.removeEventListener("pointerdown",P,!0),c&&(p.removeEventListener("keydown",M),p.removeEventListener("compositionstart",a),p.removeEventListener("compositionend",d)),w&&(p.removeEventListener("click",B,!0),p.removeEventListener("pointerdown",B,!0),p.removeEventListener("touchstart",q,!0),p.removeEventListener("touchmove",z,!0),p.removeEventListener("touchend",W,!0),p.removeEventListener("mousedown",B,!0)),f.forEach(e=>{e.removeEventListener("scroll",t)}),e.clear(),j.current=!1}},[s,o,l,i,c,w,r,a,h,u,S,E,M,D,B,$,q,z,W,P,n]),x.useEffect(I,[w,I]);let H=x.useMemo(()=>({onKeyDown:M,...f&&{[ri[m]]:e=>{n.setOpen(!1,tY(n8,e.nativeEvent))},..."intentional"!==m&&{onClick(e){n.setOpen(!1,tY(n8,e.nativeEvent))}}}}),[M,n,f,m]),V=eK(e=>{let t=n1(e.nativeEvent);n0(n.select("floatingElement"),t)&&0===e.button&&(j.current=!0)}),_=eK(e=>{r&&u&&0===e.button&&(j.current=!0)}),Y=x.useMemo(()=>({onKeyDown:M,onPointerDown:V,onMouseDown:V,onMouseUp:V,onClickCapture:L,onMouseDownCapture(e){L(),_(e)},onPointerDownCapture(e){L(),_(e)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[M,V,L,_]);return x.useMemo(()=>u?{reference:H,floating:Y,trigger:H}:{},[u,H,Y])}(ee,{enabled:!A,bubbles:{escapeKey:m&&"menu"===D.type},outsidePress(){var e;return"context-menu"!==D.type||(null==(e=B.current)?void 0:e.type)==="contextmenu"||_.current},externalTree:U?O:void 0}),en=function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),l=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:s="dialog"}=t,u=eX(),c=(null==l?void 0:l.id)||u,d=x.useMemo(()=>{var e;return(null==(e=n3(i))?void 0:e.id)||o},[i,o]),p=ra.get(s)??s,f=null!=nN(),m=x.useMemo(()=>"tooltip"===p||"label"===s?tT:{"aria-haspopup":"alertdialog"===p?"dialog":p,"aria-expanded":"false",..."listbox"===p&&{role:"combobox"},..."menu"===p&&f&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[p,f,s]),h=x.useMemo(()=>"tooltip"===p||"label"===s?{[`aria-${"label"===s?"labelledby":"describedby"}`]:r?d:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?d:void 0,..."menu"===p&&{id:c}},[p,d,r,c,s,m]),g=x.useMemo(()=>{let e={id:d,...p&&{role:p}};return"tooltip"===p||"label"===s?e:{...e,..."menu"===p&&{"aria-labelledby":c}}},[p,d,c,s]),v=x.useCallback(({active:e,selected:t})=>{let n={role:"option",...e&&{id:`${d}-fui-option`}};switch(s){case"select":case"combobox":return{...n,"aria-selected":t}}return{}},[d,s]);return x.useMemo(()=>a?{reference:h,floating:g,item:v,trigger:m}:{},[a,h,g,m,v])}(ee,{role:"menu"}),er=t_(),eo=x.useCallback(e=>{k.select("activeIndex")!==e&&k.set("activeIndex",e)},[k]),el=function(e,t){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),l=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:a,activeIndex:s,onNavigate:u=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:p=!1,loopFocus:f=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w,orientation:j="vertical",parentOrientation:S,cols:E=1,scrollItemIntoView:k=!0,itemSizes:O,dense:R=!1,id:I,resetOnPointerLeave:C=!0,externalTree:T}=t,P=rs(n3(o)),N=nN(),M=nM(T);eG(()=>{i.current.orientation=j},[i,j]);let A=n6(l),L=x.useRef(v),D=x.useRef(d??-1),$=x.useRef(null),F=x.useRef(!0),q=eK(e=>{u(-1===D.current?null:D.current,e)}),B=x.useRef(q),U=x.useRef(!!o),z=x.useRef(r),K=x.useRef(!1),W=x.useRef(!1),H=rs(w),V=rs(r),_=rs(k),Y=rs(d),X=rs(C),G=eK(()=>{function e(e){g?null==M||M.events.emit("virtualfocus",e):rd(e,{sync:K.current,preventScroll:!0})}let t=a.current[D.current],n=W.current;t&&e(t),(K.current?e=>e():requestAnimationFrame)(()=>{var r;let o=a.current[D.current]||t;if(!o)return;t||e(o);let l=_.current;l&&Z&&(n||!F.current)&&(null==(r=o.scrollIntoView)||r.call(o,"boolean"==typeof l?{block:"nearest",inline:"nearest"}:l))})});eG(()=>{c&&(r&&o?(D.current=d??-1,L.current&&null!=d&&(W.current=!0,q())):U.current&&(D.current=-1,B.current()))},[c,r,o,d,q]),eG(()=>{if(c){if(!r){K.current=!1;return}if(o)if(null==s){if(K.current=!1,null!=Y.current)return;if(U.current&&(D.current=-1,G()),(!z.current||!U.current)&&L.current&&(null!=$.current||!0===L.current&&null==$.current)){let e=0,t=()=>{null==a.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(D.current=null==$.current||rK($.current,j,h)||m?r$(a):rF(a),$.current=null,q())};t()}}else rD(a,s)||(D.current=s,G(),W.current=!1)}},[c,r,o,s,Y,m,a,j,h,q,G,H]),eG(()=>{var e,t;if(!c||o||!M||g||!U.current)return;let n=M.nodesRef.current,r=null==(t=null==(e=n.find(e=>e.id===N))?void 0:e.context)?void 0:t.elements.floating,l=nQ(n5(o)),i=n.some(e=>e.context&&n0(e.context.elements.floating,l));r&&!i&&F.current&&r.focus({preventScroll:!0})},[c,o,M,N,g]),eG(()=>{B.current=q,z.current=r,U.current=!!o}),eG(()=>{r||($.current=null,L.current=v)},[r,v]);let J=null!=s,Z=x.useMemo(()=>{function e(e){if(!V.current)return;let t=a.current.indexOf(e.currentTarget);-1!==t&&D.current!==t&&(D.current=t,q(e))}return{onFocus(t){K.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){K.current=!0,W.current=!1,y&&e(t)},onPointerLeave(e){var t;if(!V.current||!F.current||"touch"===e.pointerType)return;K.current=!0;let n=e.relatedTarget;!y||a.current.includes(n)||X.current&&(D.current=-1,q(e),g||null==(t=P.current)||t.focus({preventScroll:!0}))}}},[V,P,y,a,q,X,g]),Q=x.useCallback(()=>{var e,t,n;return S??(null==(n=null==(t=null==(e=null==M?void 0:M.nodesRef.current.find(e=>e.id===N))?void 0:e.context)?void 0:t.dataRef)?void 0:n.current.orientation)},[N,M,S]),ee=eK(e=>{var t,o;if(F.current=!1,K.current=!0,229===e.which||!V.current&&e.currentTarget===P.current)return;if(m&&(t=e.key,"both"===j||"horizontal"===j&&E&&E>1?"Escape"===t:rU(j,h?t===nG:t===nX,t===nJ))){rz(e.key,Q())||na(e),n.setOpen(!1,tY(ro,e.nativeEvent)),e7(l)&&(g?null==M||M.events.emit("virtualfocus",l):l.focus());return}let i=D.current,s=r$(a,w),u=rF(a,w);if(A||("Home"===e.key&&(na(e),D.current=s,q(e)),"End"===e.key&&(na(e),D.current=u,q(e))),E>1){let t=O||Array.from({length:a.current.length},()=>({width:1,height:1})),n=function(e,t,n){let r=[],o=0;return e.forEach(({width:e,height:l},i)=>{let a=!1;for(n&&(o=0);!a;){let n=[];for(let r=0;rnull==r[e])?(n.forEach(e=>{r[e]=i}),a=!0):o+=1}}),[...r]}(t,E,R),r=n.findIndex(e=>null!=e&&!rB(a,e,w)),l=n.reduce((e,t,n)=>null==t||rB(a,t,w)?e:n,-1),i=n[function(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:l,disabledIndices:i,minIndex:a,maxIndex:s,prevIndex:u,stopEvent:c=!1}){let d=u,p=[],f={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(null==e)return;let o=e.closest('[role="row"]');o&&(m=!0),(o!==t||-1===n)&&(t=o,p[n+=1]=[]),p[n].push(r),f[r]=n})}let h=m&&p.length>0&&p.some(e=>e.length!==l);function g(t){if(!h||-1===u)return;let n=f[u];if(null==n)return;let o=p[n].indexOf(u),l="up"===t?n-1:n+1;r&&(l<0?l=p.length-1:l>=p.length&&(l=0));let a=new Set;for(;l>=0&&l=0;t-=1){let r=n[t];if(!rB(e,r,i))return r}l="up"===t?l-1:l+1,r&&(l<0?l=p.length-1:l>=p.length&&(l=0))}}if(t.key===nJ){let n=g("up");if(void 0!==n)c&&na(t),d=n;else{if(c&&na(t),-1===u)d=s;else if(d=rq(e,{startingIndex:d,amount:l,decrement:!0,disabledIndices:i}),r&&(u-le?n:n-l}rD(e,d)&&(d=u)}}if(t.key===nZ){let n=g("down");void 0!==n?(c&&na(t),d=n):(c&&na(t),-1===u?d=a:(d=rq(e,{startingIndex:u,amount:l,disabledIndices:i}),r&&u+l>s&&(d=rq(e,{startingIndex:u%l-l,amount:l,disabledIndices:i}))),rD(e,d)&&(d=u))}if("both"===n){let n=rg(u/l);t.key===(o?nX:nG)&&(c&&na(t),u%l!=l-1?(d=rq(e,{startingIndex:u,disabledIndices:i}),r&&rL(d,l,n)&&(d=rq(e,{startingIndex:u-u%l-1,disabledIndices:i}))):r&&(d=rq(e,{startingIndex:u-u%l-1,disabledIndices:i})),rL(d,l,n)&&(d=u)),t.key===(o?nG:nX)&&(c&&na(t),u%l!=0?(d=rq(e,{startingIndex:u,decrement:!0,disabledIndices:i}),r&&rL(d,l,n)&&(d=rq(e,{startingIndex:u+(l-u%l),decrement:!0,disabledIndices:i}))):r&&(d=rq(e,{startingIndex:u+(l-u%l),decrement:!0,disabledIndices:i})),rL(d,l,n)&&(d=u));let a=rg(s/l)===n;rD(e,d)&&(d=r&&a?t.key===(o?nG:nX)?s:rq(e,{startingIndex:u-u%l-1,disabledIndices:i}):u)}return d}({current:n.map(e=>null!=e?a.current[e]:null)},{event:e,orientation:j,loopFocus:f,rtl:h,cols:E,disabledIndices:(o=[...("function"!=typeof w?w:null)||a.current.map((e,t)=>rB(a,t,w)?t:void 0),void 0],n.flatMap((e,t)=>o.includes(e)?[t]:[])),minIndex:r,maxIndex:l,prevIndex:function(e,t,n,r,o){if(-1===e)return -1;let l=n.indexOf(e),i=t[e];switch(o){case"tl":return l;case"tr":return i?l+i.width-1:l;case"bl":return i?l+(i.height-1)*r:l;case"br":return n.lastIndexOf(e);default:return -1}}(D.current>u?s:D.current,t,n,E,e.key===nZ?"bl":e.key===(h?nX:nG)?"tr":"tl"),stopEvent:!0})];if(null!=i&&(D.current=i,q(e)),"both"===j)return}if(rz(e.key,j)){if(na(e),r&&!g&&nQ(e.currentTarget.ownerDocument)===e.currentTarget){D.current=rK(e.key,j,h)?s:u,q(e);return}rK(e.key,j,h)?f?i>=u?p&&i!==a.current.length?D.current=-1:(K.current=!1,D.current=s):D.current=rq(a,{startingIndex:i,disabledIndices:w}):D.current=Math.min(u,rq(a,{startingIndex:i,disabledIndices:w})):f?i<=s?p&&-1!==i?D.current=a.current.length:(K.current=!1,D.current=u):D.current=rq(a,{startingIndex:i,decrement:!0,disabledIndices:w}):D.current=Math.max(s,rq(a,{startingIndex:i,decrement:!0,disabledIndices:w})),rD(a,D.current)&&(D.current=-1),q(e)}}),et=x.useMemo(()=>g&&r&&J&&{"aria-activedescendant":`${I}-${s}`},[g,r,J,I,s]),en=x.useMemo(()=>({"aria-orientation":"both"===j?void 0:j,...A?{}:et,onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&r&&!g){let t=n1(e.nativeEvent);if(t&&!n0(P.current,t))return;na(e),n.setOpen(!1,tY(rn,e.nativeEvent)),e7(l)&&l.focus();return}ee(e)},onPointerMove(){F.current=!0}}),[et,ee,P,j,A,n,r,g,l]),er=x.useMemo(()=>{function e(e){"auto"===v&&ns(e.nativeEvent)&&(L.current=!g)}function t(e){L.current=v,"auto"===v&&nu(e.nativeEvent)&&(L.current=!0)}return{onKeyDown(e){var t;let r=n.select("open");F.current=!1;let o=e.key.startsWith("Arrow"),l=(t=e.key,rU(Q(),h?t===nX:t===nG,t===nZ)),i=rz(e.key,j),s=(m?l:i)||"Enter"===e.key||""===e.key.trim();if(g&&r)return ee(e);if(!(!r&&!b&&o)){if(s){let t=rz(e.key,Q());$.current=m&&t?null:e.key}if(m){l&&(na(e),r?(D.current=r$(a,H.current),q(e)):n.setOpen(!0,tY(ro,e.nativeEvent,e.currentTarget)));return}i&&(null!=Y.current&&(D.current=Y.current),na(e),!r&&b?n.setOpen(!0,tY(ro,e.nativeEvent,e.currentTarget)):ee(e),r&&q(e))}},onFocus(e){n.select("open")&&!g&&(D.current=-1,q(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ee,H,v,a,m,q,n,b,j,Q,h,Y,g]),eo=x.useMemo(()=>({...et,...er}),[et,er]);return x.useMemo(()=>c?{reference:eo,floating:en,item:Z,trigger:er}:{},[c,eo,en,er,Z])}(ee,{enabled:!A,listRef:k.context.itemDomElements,activeIndex:$,nested:void 0!==D.type,loopFocus:d,orientation:p,parentOrientation:"menubar"===D.type?D.context.orientation:void 0,rtl:"rtl"===er,disabledIndices:tC,onNavigate:eo,openOnArrowKeyDown:"context-menu"!==D.type,externalTree:U?O:void 0,focusItemOnHover:y}),ei=x.useCallback(e=>{k.context.typingRef.current=e},[k]),{getReferenceProps:ea,getFloatingProps:es,getItemProps:eu,getTriggerProps:ec}=rW([et,en,el,function(e,t){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.context.dataRef,{listRef:l,activeIndex:i,onMatch:a,onTypingChange:s,enabled:u=!0,findMatch:c=null,resetMs:d=750,ignoreKeys:p=tC,selectedIndex:f=null}=t,m=eB(),h=x.useRef(""),g=x.useRef(f??i??-1),v=x.useRef(null);eG(()=>{r&&(m.clear(),v.current=null,h.current="")},[r,m]),eG(()=>{r&&""===h.current&&(g.current=f??i??-1)},[r,f,i]);let y=eK(e=>{e?o.current.typing||(o.current.typing=e,null==s||s(e)):o.current.typing&&(o.current.typing=e,null==s||s(e))}),b=eK(e=>{function t(e,t,n){let r=c?c(t,n):t.find(e=>(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))===0);return r?e.indexOf(r):-1}let n=l.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(n,n,h.current)?y(!1):" "===e.key&&na(e)),null==n||p.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(na(e),y(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&h.current===e.key&&(h.current="",g.current=v.current),h.current+=e.key,m.start(d,()=>{h.current="",g.current=v.current,y(!1)});let o=g.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],h.current);-1!==i?(null==a||a(i),v.current=i):" "!==e.key&&(h.current="",y(!1))}),w=x.useMemo(()=>({onKeyDown:b}),[b]),j=x.useMemo(()=>({onKeyDown:b,onKeyUp(e){" "===e.key&&y(!1)}}),[b,y]);return x.useMemo(()=>u?{reference:w,floating:j}:{},[u,w,j])}(ee,{listRef:k.context.itemLabels,activeIndex:$,resetMs:500,onMatch:e=>{C&&e!==$&&k.set("activeIndex",e)},onTypingChange:ei})]),ed=x.useMemo(()=>{let e=rX(ea(),{onMouseEnter(){k.set("hoverEnabled",!0)},onMouseMove(){k.set("allowMouseEnter",!0)}},K);return delete e.role,e},[ea,k,K]),ep=x.useMemo(()=>{let e=ec();if(!e)return e;let t=rX(e,K);return delete t.role,delete t["aria-controls"],t},[ec,K]),ef=e1(),em=x.useMemo(()=>es({onMouseEnter(){"menu"===D.type&&ef.request(()=>k.set("hoverEnabled",!1))},onMouseMove(){k.set("allowMouseEnter",!0)},onClick(){k.select("hoverEnabled")&&k.set("hoverEnabled",!1)},onKeyDown(e){let t=k.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}}),[es,D.type,ef,k]),eh=x.useMemo(()=>eu(),[eu]);k.useSyncedValues({floatingRootContext:ee,activeTriggerProps:ed,inactiveTriggerProps:ep,popupProps:em,itemProps:eh});let eg=x.useMemo(()=>({store:k,parent:E}),[k,E]),ev=(0,l.jsx)(tF.Provider,{value:eg,children:"function"==typeof r?r({payload:F}):r});return void 0===D.type||"context-menu"===D.type?(0,l.jsx)(nD,{externalTree:O,children:ev}):ev}let r2=x.createContext(void 0),r5={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1,position:"fixed",top:0,left:0},r4=x.forwardRef(function(e,t){let[n,r]=x.useState();return eG(()=>{tS&&r("button")},[]),(0,l.jsx)("span",{...e,ref:t,style:r5,"aria-hidden":!n||void 0,tabIndex:0,role:n,"data-base-ui-focus-guard":""})});function r6(e,t,n,r){var o,l,i,a,s;let u=eA(r3).current;return o=u,l=e,i=t,a=n,s=r,(o.refs[0]!==l||o.refs[1]!==i||o.refs[2]!==a||o.refs[3]!==s)&&r8(u,[e,t,n,r]),u.callback}function r3(){return{callback:null,cleanup:null,refs:[]}}function r8(e,t){if(e.refs=t,t.every(e=>null==e)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=n){let r=Array(t.length).fill(null);for(let e=0;e{for(let e=0;e=19?null==t?void 0:t.ref:e.ref)??null}function r9(e,t,n={}){let r=t.render,o=function(e,t={}){let{className:n,style:r,render:o}=e,{state:l=tT,ref:i,props:a,stateAttributesMapping:s,enabled:u=!0}=t,c=u?"function"==typeof n?n(l):n:void 0,d=u?"function"==typeof r?r(l):r:void 0,p=u?function(e,t){let n={};for(let r in e){let o=e[r];if(null!=t&&t.hasOwnProperty(r)){let e=t[r](o);null!=e&&Object.assign(n,e);continue}!0===o?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}(l,s):tT,f=u?r_(p,Array.isArray(a)?function(e){if(0===e.length)return rY;if(1===e.length)return rZ(e[0],rY);let t={...rZ(e[0],rY)};for(let n=1;ntypeof document&&(u?Array.isArray(i)?f.ref=function(e){var t,n;let r=eA(r3).current;return t=r,n=e,(t.refs.length!==n.length||t.refs.some((e,t)=>e!==n[t]))&&r8(r,e),r.callback}([f.ref,r7(o),...i]):f.ref=r6(f.ref,r7(o),i):r6(null,null)),u?(void 0!==c&&(f.className=r0(f.className,c)),void 0!==d&&(f.style=r_(f.style,d)),f):tT}(t,n);return!1===n.enabled?null:function(e,t,n,r){if(t){if("function"==typeof t)return t(n,r);let e=rX(n,t.props);return e.ref=n.ref,x.cloneElement(t,e)}if(e&&"string"==typeof e){var o,l;return o=e,l=n,"button"===o?(0,x.createElement)("button",{type:"button",...l,key:l.key}):"img"===o?(0,x.createElement)("img",{alt:"",...l,key:l.key}):x.createElement(o,l)}throw Error(t$(8))}(e,r,o,n.state??tT)}var oe='input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)',ot=typeof Element>"u",on=ot?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,or=!ot&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},oo=function(e,t){void 0===t&&(t=!0);var n,r=null==e||null==(n=e.getAttribute)?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):oo(e.parentNode))},ol=function(e){var t,n=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===n||"true"===n},oi=function(e,t,n){if(oo(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(oe));return t&&on.call(e,oe)&&r.unshift(e),r=r.filter(n)},oa=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var l=o.shift();if(!oo(l,!1))if("SLOT"===l.tagName){var i=l.assignedElements(),a=oa(i.length?i:l.children,!0,n);n.flatten?r.push.apply(r,a):r.push({scopeParent:l,candidates:a})}else{on.call(l,oe)&&n.filter(l)&&(t||!e.includes(l))&&r.push(l);var s=l.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(l),u=!oo(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(l));if(s&&u){var c=oa(!0===s?l.children:s.children,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:l,candidates:c})}else o.unshift.apply(o,l.children)}}return r},os=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ou=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ol(e))&&!os(e)?0:e.tabIndex},oc=function(e,t){var n=ou(e);return n<0&&t&&!os(e)?0:n},od=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},op=function(e){return"INPUT"===e.tagName},of=function(e,t){for(var n=0;ntypeof window&&"u">typeof window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){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",e.message),!1}var o=of(t,e.form);return!o||o===e},oh=function(e){return op(e)&&"radio"===e.type&&!om(e)},og=function(e){var t,n,r,o,l,i,a,s=e&&or(e),u=null==(a=s)?void 0:a.host,c=!1;if(s&&s!==e)for(c=!!(null!=(t=u)&&null!=(n=t.ownerDocument)&&n.contains(u)||null!=e&&null!=(r=e.ownerDocument)&&r.contains(e));!c&&u;)c=!!(null!=(l=u=null==(o=s=or(u))?void 0:o.host)&&null!=(i=l.ownerDocument)&&i.contains(u));return c},ov=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},oy=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=on.call(e,"details>summary:first-of-type")?e.parentElement:e;if(on.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ov(e)}else{if("function"==typeof r){for(var l=e;e;){var i=e.parentElement,a=or(e);if(i&&!i.shadowRoot&&!0===r(i))return ov(e);e=e.assignedSlot?e.assignedSlot:i||a===e.ownerDocument?i:a.host}e=l}if(og(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ox=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;nou(t)||!ob(e,t))},oj=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},oS=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,l=o?e.scopeParent:e,i=oc(l,o),a=o?oS(e.candidates):l;0===i?o?t.push.apply(t,a):t.push(l):n.push({documentOrder:r,tabIndex:i,item:e,isScope:o,content:a})}),n.sort(od).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},oE=function(e,t){return oS((t=t||{}).getShadowRoot?oa([e],t.includeContainer,{filter:ow.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:oj}):oi(e,t.includeContainer,ow.bind(null,t)))},ok=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==on.call(e,oe)&&ow(t,e)};let oO=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function oR(e,t){let n=oE(e,oO()),r=n.length;if(0===r)return;let o=nQ(n5(e)),l=n.indexOf(o);return n[-1===l?1===t?0:r-1:l+t]}function oI(e){return oR(n5(e).body,1)||e}function oC(e){return oR(n5(e).body,-1)||e}function oT(e,t){if(!e)return null;let n=oE(n5(e).body,oO()),r=n.length;if(0===r)return null;let o=n.indexOf(e);return -1===o?null:n[(o+t+r)%r]}function oP(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!n0(n,r)}function oN(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}let oM=x.createContext(null),oA=()=>x.useContext(oM),oL=nz("portal"),oD=x.forwardRef(function(e,t){let{children:n,container:r,className:o,render:i,renderGuards:a,...s}=e,{portalNode:u,portalSubtree:c}=function(e={}){let{ref:t,container:n,componentProps:r=tT,elementProps:o,elementState:l}=e,i=eX(),a=oA(),s=null==a?void 0:a.portalNode,[u,c]=x.useState(null),[d,p]=x.useState(null),f=eK(e=>{null!==e&&p(e)}),m=x.useRef(null);eG(()=>{if(null===n){m.current&&(m.current=null,p(null),c(null));return}if(null==i)return;let e=(n&&(e3(n)?n:n.current))??s??document.body;if(null==e){m.current&&(m.current=null,p(null),c(null));return}m.current!==e&&(m.current=e,p(null),c(e))},[n,s,i]);let h=r9("div",r,{ref:[t,f],state:l,props:[{id:i,[oL]:""},o]});return{portalNode:d,portalSubtree:u&&h?eN.createPortal(h,u):null}}({container:r,ref:t,componentProps:e,elementProps:s}),d=x.useRef(null),p=x.useRef(null),f=x.useRef(null),m=x.useRef(null),[h,g]=x.useState(null),v=null==h?void 0:h.modal,y=null==h?void 0:h.open,b="boolean"==typeof a?a:!!h&&!h.modal&&h.open&&!!u;x.useEffect(()=>{if(u&&!v)return u.addEventListener("focusin",e,!0),u.addEventListener("focusout",e,!0),()=>{u.removeEventListener("focusin",e,!0),u.removeEventListener("focusout",e,!0)};function e(e){u&&e.relatedTarget&&oP(e)&&("focusin"===e.type?oN:function(e){oE(e,oO()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(u)}},[u,v]),x.useEffect(()=>{!u||y||oN(u)},[y,u]);let w=x.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:f,afterInsideRef:m,portalNode:u,setFocusManagerState:g}),[u]);return(0,l.jsxs)(x.Fragment,{children:[c,(0,l.jsxs)(oM.Provider,{value:w,children:[b&&u&&(0,l.jsx)(r4,{"data-type":"outside",ref:d,onFocus:e=>{var t;if(oP(e,u))null==(t=f.current)||t.focus();else{let e=oC(h?h.domReference:null);null==e||e.focus()}}}),b&&u&&(0,l.jsx)("span",{"aria-owns":u.id,style:tH}),u&&eN.createPortal(n,u),b&&u&&(0,l.jsx)(r4,{"data-type":"outside",ref:p,onFocus:e=>{var t;if(oP(e,u))null==(t=m.current)||t.focus();else{let t=oI(h?h.domReference:null);null==t||t.focus(),null!=h&&h.closeOnFocusOut&&(null==h||h.onOpenChange(!1,tY(rn,e.nativeEvent)))}}})]})]})}),o$=x.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:o}=tq();return o.useState("mounted")||n?(0,l.jsx)(r2.Provider,{value:n,children:(0,l.jsx)(oD,{ref:t,...r})}):null}),oF=x.createContext(void 0);function oq(e){let t=x.useContext(oF);if(void 0===t&&!e)throw Error(t$(33));return t}function oB(e,t,n){let r,{reference:o,floating:l}=e,i=rO(t),a=rS(rO(t)),s=rE(a),u=rw(t),c="y"===i,d=o.x+o.width/2-l.width/2,p=o.y+o.height/2-l.height/2,f=o[s]/2-l[s]/2;switch(u){case"top":r={x:d,y:o.y-l.height};break;case"bottom":r={x:d,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:p};break;case"left":r={x:o.x-l.width,y:p};break;default:r={x:o.x,y:o.y}}switch(rj(t)){case"start":r[a]-=f*(n&&c?-1:1);break;case"end":r[a]+=f*(n&&c?-1:1)}return r}let oU=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:i}=n,a=l.filter(Boolean),s=await (null==i.isRTL?void 0:i.isRTL(t)),u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=oB(u,r,s),p=r,f={},m=0;for(let n=0;ne[t]>=0)}let oH=new Set(["left","top"]);async function oV(e,t){let{placement:n,platform:r,elements:o}=e,l=await (null==r.isRTL?void 0:r.isRTL(o.floating)),i=rw(n),a=rj(n),s="y"===rO(n),u=oH.has(i)?-1:1,c=l&&s?-1:1,d=rb(t,e),{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(f="end"===a?-1*m:m),s?{x:f*c,y:p*u}:{x:p*u,y:f*c}}function o_(e){let t=tp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=e7(e),l=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=rh(n)!==l||rh(r)!==i;return a&&(n=l,r=i),{width:n,height:r,$:a}}function oY(e){return e8(e)?e:e.contextElement}function oX(e){let t=oY(e);if(!e7(t))return rv(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:l}=o_(t),i=(l?rh(n.width):n.width)/r,a=(l?rh(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}let oG=rv(0);function oJ(e){let t=e4(e);return tu()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:oG}function oZ(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let l=e.getBoundingClientRect(),i=oY(e),a=rv(1);t&&(r?e8(r)&&(a=oX(r)):a=oX(e));let s=(void 0===(o=n)&&(o=!1),r&&(!o||r===e4(i))&&o)?oJ(i):rv(0),u=(l.left+s.x)/a.x,c=(l.top+s.y)/a.y,d=l.width/a.x,p=l.height/a.y;if(i){let e=e4(i),t=r&&e8(r)?e4(r):r,n=e,o=tg(n);for(;o&&r&&t!==n;){let e=oX(o),t=o.getBoundingClientRect(),r=tp(o),l=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,p*=e.y,u+=l,c+=i,o=tg(n=e4(o))}}return rA({width:d,height:p,x:u,y:c})}function oQ(e,t){let n=tf(e).scrollLeft;return t?t.left+n:oZ(e6(e)).left+n}function o0(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-oQ(e,n),y:n.top+t.scrollTop}}let o1=new Set(["absolute","fixed"]);function o2(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=e4(e),r=e6(e),o=n.visualViewport,l=r.clientWidth,i=r.clientHeight,a=0,s=0;if(o){l=o.width,i=o.height;let e=tu();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}let u=oQ(r);if(u<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-o);i<=25&&(l-=i)}else u<=25&&(l+=u);return{width:l,height:i,x:a,y:s}}(e,n);else if("document"===t)r=function(e){let t=e6(e),n=tf(e),r=e.ownerDocument.body,o=rm(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=rm(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),i=-n.scrollLeft+oQ(e),a=-n.scrollTop;return"rtl"===tp(r).direction&&(i+=rm(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:i,y:a}}(e6(e));else if(e8(t))r=function(e,t){let n=oZ(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=e7(e)?oX(e):rv(1),i=e.clientWidth*l.x,a=e.clientHeight*l.y;return{width:i,height:a,x:o*l.x,y:r*l.y}}(t,n);else{let n=oJ(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rA(r)}function o5(e){return"static"===tp(e).position}function o4(e,t){if(!e7(e)||"fixed"===tp(e).position)return null;if(t)return t(e);let n=e.offsetParent;return e6(e)===n&&(n=n.ownerDocument.body),n}function o6(e,t){var n;let r=e4(e);if(to(e))return r;if(!e7(e)){let t=tm(e);for(;t&&!td(t);){if(e8(t)&&!o5(t))return t;t=tm(t)}return r}let o=o4(e,t);for(;o&&(n=o,tn.has(e5(n)))&&o5(o);)o=o4(o,t);return o&&td(o)&&o5(o)&&!ts(o)?r:o||function(e){let t=tm(e);for(;e7(t)&&!td(t);){if(ts(t))return t;if(to(t))break;t=tm(t)}return null}(e)||r}let o3=async function(e){let t=this.getOffsetParent||o6,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=e7(t),o=e6(t),l="fixed"===n,i=oZ(e,!0,l,t),a={scrollLeft:0,scrollTop:0},s=rv(0);if(r||!r&&!l)if(("body"!==e5(t)||tt(o))&&(a=tf(t)),r){let e=oZ(t,!0,l,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=oQ(o));l&&!r&&o&&(s.x=oQ(o));let u=!o||r||l?rv(0):o0(o,a);return{x:i.left+a.scrollLeft-s.x-u.x,y:i.top+a.scrollTop-s.y-u.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},o8={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,l="fixed"===o,i=e6(r),a=!!t&&to(t.floating);if(r===i||a&&l)return n;let s={scrollLeft:0,scrollTop:0},u=rv(1),c=rv(0),d=e7(r);if((d||!d&&!l)&&(("body"!==e5(r)||tt(i))&&(s=tf(r)),e7(r))){let e=oZ(r);u=oX(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let p=!i||d||l?rv(0):o0(i,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-s.scrollTop*u.y+c.y+p.y}},getDocumentElement:e6,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,l=[..."clippingAncestors"===n?to(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=th(e,[],!1).filter(e=>e8(e)&&"body"!==e5(e)),o=null,l="fixed"===tp(e).position,i=l?tm(e):e;for(;e8(i)&&!td(i);){let t=tp(i),n=ts(i);n||"fixed"!==t.position||(o=null),(l?!n&&!o:!n&&"static"===t.position&&!!o&&o1.has(o.position)||tt(i)&&!n&&function e(t,n){let r=tm(t);return!(r===n||!e8(r)||td(r))&&("fixed"===tp(r).position||e(r,n))}(e,i))?r=r.filter(e=>e!==i):o=t,i=tm(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=l[0],a=l.reduce((e,n)=>{let r=o2(t,n,o);return e.top=rm(r.top,e.top),e.right=rf(r.right,e.right),e.bottom=rf(r.bottom,e.bottom),e.left=rm(r.left,e.left),e},o2(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:o6,getElementRects:o3,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=o_(e);return{width:t,height:n}},getScale:oX,isElement:e8,isRTL:function(e){return"rtl"===tp(e).direction}};function o7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function o9(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,u=oY(e),c=o||l?[...u?th(u):[],...th(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});let d=u&&a?function(e,t){let n=null,r,o=e6(e);function l(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),l();let u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(a||t(),!p||!f)return;let m=rg(d),h=rg(o.clientWidth-(c+p)),g={rootMargin:-m+"px "+-h+"px "+-rg(o.clientHeight-(d+f))+"px "+-rg(c)+"px",threshold:rm(0,rf(1,s))||1},v=!0;function y(t){let n=t[0].intersectionRatio;if(n!==s){if(!v)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||o7(u,e.getBoundingClientRect())||i(),v=!1}try{n=new IntersectionObserver(y,{...g,root:o.ownerDocument})}catch{n=new IntersectionObserver(y,g)}n.observe(e)}(!0),l}(u,n):null,p=-1,f=null;i&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),u&&!s&&f.observe(u),f.observe(t));let m,h=s?oZ(e):null;return s&&function t(){let r=oZ(e);h&&!o7(h,r)&&n(),h=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(m)}}var le="u">typeof document?x.useLayoutEffect:function(){};function lt(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!lt(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(!("_owner"===n&&e.$$typeof)&&!lt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ln(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lr(e,t){let n=ln(e);return Math.round(t*n)/n}function lo(e){let t=x.useRef(e);return le(()=>{t.current=e}),t}let ll={name:"hide",async fn(e){var t,n;let r,o,{width:l,height:i,x:a,y:s}=e.rects.reference;return{data:{referenceHidden:(null==(t=(await ({...(void 0===(n=r)&&(n={}),{name:"hide",options:n,async fn(e){let{rects:t}=e,{strategy:r="referenceHidden",...o}=rb(n,e);switch(r){case"referenceHidden":{let n=oK(await oz(e,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:oW(n)}}}case"escaped":{let n=oK(await oz(e,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:n,escaped:oW(n)}}}default:return{}}}}),options:[r,o]}).fn(e)).data)?void 0:t.referenceHidden)||0===l&&0===i&&0===a&&0===s}}}},li={sideX:"left",sideY:"top"};function la(e,t,n){let r="inline-start"===e||"inline-end"===e;return({top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"})[t]}function ls(e,t,n){let{rects:r,placement:o}=e;return{side:la(t,rw(o),n),align:rj(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function lu(e){return null!=e&&"current"in e}let lc=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=nF.startingStyle]="startingStyle",e[e.endingStyle=nF.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),ld=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});ld.popupOpen;let lp={[ld.popupOpen]:"",[ld.pressed]:""},lf={[lc.open]:""},lm={[lc.closed]:""},lh={[lc.anchorHidden]:""},lg={open:e=>e?lp:null},lv={open:e=>e?lf:lm,anchorHidden:e=>e?lh:null},ly=x.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function lx(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,i=eK(o),a=x.useRef(0),s=eA(lw).current,u=eA(lb).current,[c,d]=x.useState(0),p=x.useRef(c),f=eK((e,t)=>{u.set(e,t??null),p.current+=1,d(p.current)}),m=eK(e=>{u.delete(e),p.current+=1,d(p.current)}),h=x.useMemo(()=>{let e=new Map;return Array.from(u.keys()).filter(e=>e.isConnected).sort(lj).forEach((t,n)=>{let r=u.get(t)??{};e.set(t,{...r,index:n})}),e},[u,c]);eG(()=>{if("function"!=typeof MutationObserver||0===h.size)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(p.current+=1,d(p.current))});return h.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[h]),eG(()=>{p.current===c&&(n.current.length!==h.size&&(n.current.length=h.size),r&&r.current.length!==h.size&&(r.current.length=h.size),a.current=h.size),i(h)},[i,h,n,r,c]),eG(()=>()=>{n.current=[]},[n]),eG(()=>()=>{r&&(r.current=[])},[r]);let g=eK(e=>(s.add(e),()=>{s.delete(e)}));eG(()=>{s.forEach(e=>e(h))},[s,h]);let v=x.useMemo(()=>({register:f,unregister:m,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:a}),[f,m,g,n,r,a]);return(0,l.jsx)(ly.Provider,{value:v,children:t})}function lb(){return new Map}function lw(){return new Set}function lj(e,t){let 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}let lS=x.forwardRef(function(e,t){let n,{cutout:r,...o}=e;if(r){let e=null==r?void 0:r.getBoundingClientRect();n=`polygon( 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, ${e.left}px ${e.top}px, ${e.left}px ${e.bottom}px, ${e.right}px ${e.bottom}px, ${e.right}px ${e.top}px, ${e.left}px ${e.top}px )`}return(0,l.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:n}})}),lE=x.forwardRef(function(e,t){var n,r;let{anchor:o,positionMethod:i="absolute",className:a,render:s,side:u,align:c,sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:m=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:v=!1,collisionAvoidance:y=tK,...b}=e,{store:w}=tq(),j=function(){let e=x.useContext(r2);if(void 0===e)throw Error(t$(32));return e}(),S=tG(!0),E=w.useState("parent"),k=w.useState("floatingRootContext"),O=w.useState("floatingTreeRoot"),R=w.useState("mounted"),I=w.useState("open"),C=w.useState("modal"),T=w.useState("activeTriggerElement"),P=w.useState("lastOpenChangeReason"),N=w.useState("floatingNodeId"),M=w.useState("floatingParentNodeId"),A=o,L=d,D=p,$=c,F=y;"context-menu"===E.type&&(A=o??(null==(n=E.context)?void 0:n.anchor),$=$??"start",u||"center"===$||(D=e.alignOffset??2,L=e.sideOffset??-5));let q=u,B=$;"menu"===E.type?(q=q??"inline-end",B=B??"start",F=e.collisionAvoidance??tW):"menubar"===E.type&&(q=q??"bottom",B=B??"start");let U="context-menu"===E.type,z=function(e){var t,n,r,o,l,i;let a,s,u,c,d,p,f,m,h,g,{anchor:v,positionMethod:y="absolute",side:b="bottom",sideOffset:w=0,align:j="center",alignOffset:S=0,collisionBoundary:E,collisionPadding:k=5,sticky:O=!1,arrowPadding:R=5,disableAnchorTracking:I=!1,keepMounted:C=!1,floatingRootContext:T,mounted:P,collisionAvoidance:N,shiftCrossAxis:M=!1,nodeId:A,adaptiveOrigin:L,lazyFlip:D=!1,externalTree:$}=e,[F,q]=x.useState(null);P||null===F||q(null);let B=N.side||"flip",U=N.align||"flip",z=N.fallbackAxisSide||"end",K="function"==typeof v?v:void 0,W=eK(K),H=K?W:v,V=rs(v),_="rtl"===t_(),Y=F||({top:"top",right:"right",bottom:"bottom",left:"left","inline-end":_?"left":"right","inline-start":_?"right":"left"})[b],X="center"===j?Y:`${Y}-${j}`,G=k,J=+("bottom"===b),Z=+("top"===b),Q=+("right"===b),ee=+("left"===b);"number"==typeof G?G={top:G+J,right:G+ee,bottom:G+Z,left:G+Q}:G&&(G={top:(G.top||0)+J,right:(G.right||0)+ee,bottom:(G.bottom||0)+Z,left:(G.left||0)+Q});let et={boundary:"clipping-ancestors"===E?"clippingAncestors":E,padding:G},en=x.useRef(null),er=rs(w),eo=rs(S),el=[(a=e=>{let t=ls(e,b,_),n="function"==typeof er.current?er.current(t):er.current,r="function"==typeof eo.current?eo.current(t):eo.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},s=["function"!=typeof w?w:0,"function"!=typeof S?S:0,_,b],{...(void 0===(r=a)&&(r=0),{name:"offset",options:r,async fn(e){var t,n;let{x:o,y:l,placement:i,middlewareData:a}=e,s=await oV(e,r);return i===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+s.x,y:l+s.y,data:{...s,placement:i}}}}),options:[a,s]})],ei="none"===U&&"shift"!==B,ea=!ei&&(O||M||"shift"===B),es="none"===B?null:{...{name:"flip",options:o=u={...et,padding:{top:G.top+1,right:G.right+1,bottom:G.bottom+1,left:G.left+1},mainAxis:!M&&"flip"===B,crossAxis:"flip"===U&&"alignment",fallbackAxisSideDirection:z},async fn(e){var t,n,r,l,i;let{placement:a,middlewareData:s,rects:u,initialPlacement:c,platform:d,elements:p}=e,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=rb(o,e);if(null!=(t=s.arrow)&&t.alignmentOffset)return{};let b=rw(a),w=rO(c),j=rw(c)===c,S=await (null==d.isRTL?void 0:d.isRTL(p.floating)),E=h||(j||!y?[rN(c)]:function(e){let t=rN(e);return[rR(e),t,rR(t)]}(c)),k="none"!==v;!h&&k&&E.push(...function(e,t,n,r){let o=rj(e),l=function(e,t,n){switch(e){case"top":case"bottom":return n?t?rC:rI:t?rI:rC;case"left":case"right":return t?rT:rP;default:return[]}}(rw(e),"start"===n,r);return o&&(l=l.map(e=>e+"-"+o),t&&(l=l.concat(l.map(rR)))),l}(c,y,v,S));let O=[c,...E],R=await oz(e,x),I=[],C=(null==(n=s.flip)?void 0:n.overflows)||[];if(f&&I.push(R[b]),m){let e=function(e,t,n){void 0===n&&(n=!1);let r=rj(e),o=rS(rO(e)),l=rE(o),i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=rN(i)),[i,rN(i)]}(a,u,S);I.push(R[e[0]],R[e[1]])}if(C=[...C,{placement:a,overflows:I}],!I.every(e=>e<=0)){let e=((null==(r=s.flip)?void 0:r.index)||0)+1,t=O[e];if(t&&("alignment"!==m||w===rO(t)||C.every(e=>rO(e.placement)!==w||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(l=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:l.placement;if(!n)switch(g){case"bestFit":{let e=null==(i=C.filter(e=>{if(k){let t=rO(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(n=e);break}case"initialPlacement":n=c}if(a!==n)return{reset:{placement:n}}}return{}}},options:[u,c]},eu=ei?null:(d=e=>{var t;let n,r,o=tR(e.elements.floating).documentElement;return{...et,rootBoundary:M?{x:0,y:0,width:o.clientWidth,height:o.clientHeight}:void 0,mainAxis:"none"!==U,crossAxis:ea,limiter:O||M?void 0:{...(void 0===(t=n=e=>{if(!en.current)return{};let{width:t,height:n}=en.current.getBoundingClientRect(),r=rO(rw(e.placement)),o="y"===r?G.left+G.right:G.top+G.bottom;return{offset:("y"===r?t:n)/2+o/2}})&&(t={}),{options:t,fn(e){let{x:n,y:r,placement:o,rects:l,middlewareData:i}=e,{offset:a=0,mainAxis:s=!0,crossAxis:u=!0}=rb(t,e),c={x:n,y:r},d=rO(o),p=rS(d),f=c[p],m=c[d],h=rb(a,e),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){let e="y"===p?"height":"width",t=l.reference[p]-l.floating[e]+g.mainAxis,n=l.reference[p]+l.reference[e]-g.mainAxis;fn&&(f=n)}if(u){var v,y;let e="y"===p?"width":"height",t=oH.has(rw(o)),n=l.reference[d]-l.floating[e]+(t&&(null==(v=i.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=l.reference[d]+l.reference[e]+(t?0:(null==(y=i.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[p]:f,[d]:m}}}),options:[n,r]}}},p=[et,O,M,G,U],{...(void 0===(l=d)&&(l={}),{name:"shift",options:l,async fn(e){let{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=rb(l,e),u={x:t,y:n},c=await oz(e,s),d=rO(rw(r)),p=rS(d),f=u[p],m=u[d];if(o){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=f+c[e],r=f-c[t];f=rm(n,rf(f,r))}if(i){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",n=m+c[e],r=m-c[t];m=rm(n,rf(m,r))}let h=a.fn({...e,[p]:f,[d]:m});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[p]:o,[d]:i}}}}}),options:[d,p]});"shift"===B||"shift"===U||"center"===j?el.push(eu,es):el.push(es,eu),el.push({...{name:"size",options:i=f={...et,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}},async fn(e){var t,n;let r,o,{placement:l,rects:a,platform:s,elements:u}=e,{apply:c=()=>{},...d}=rb(i,e),p=await oz(e,d),f=rw(l),m=rj(l),h="y"===rO(l),{width:g,height:v}=a.floating;"top"===f||"bottom"===f?(r=f,o=m===(await (null==s.isRTL?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(o=f,r="end"===m?"top":"bottom");let y=v-p.top-p.bottom,x=g-p.left-p.right,b=rf(v-p[r],y),w=rf(g-p[o],x),j=!e.middlewareData.shift,S=b,E=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=x),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(S=y),j&&!m){let e=rm(p.left,0),t=rm(p.right,0),n=rm(p.top,0),r=rm(p.bottom,0);h?E=g-2*(0!==e||0!==t?e+t:rm(p.left,p.right)):S=v-2*(0!==n||0!==r?n+r:rm(p.top,p.bottom))}await c({...e,availableWidth:E,availableHeight:S});let k=await s.getDimensions(u.floating);return g!==k.width||v!==k.height?{reset:{rects:!0}}:{}}},options:[f,m]},(h=()=>({element:en.current||document.createElement("div"),padding:R,offsetParent:"floating"}),g=[R],{name:"arrow",options:h,async fn(e){var t,n;let{x:r,y:o,placement:l,rects:i,platform:a,elements:s,middlewareData:u}=e,{element:c,padding:d=0,offsetParent:p="real"}=rb(h,e)||{};if(null==c)return{};let f=rM(d),m={x:r,y:o},g=rS(rO(l)),v=rE(g),y=await a.getDimensions(c),x="y"===g,b=x?"clientHeight":"clientWidth",w=i.reference[v]+i.reference[g]-m[g]-i.floating[v],j=m[g]-i.reference[g],S="real"===p?await (null==(t=a.getOffsetParent)?void 0:t.call(a,c)):s.floating,E=s.floating[b]||i.floating[v];E&&await (null==(n=a.isElement)?void 0:n.call(a,S))||(E=s.floating[b]||i.floating[v]);let k=E/2-y[v]/2-1,O=Math.min(f[x?"top":"left"],k),R=Math.min(f[x?"bottom":"right"],k),I=E-y[v]-R,C=E/2-y[v]/2+(w/2-j/2),T=rm(O,rf(C,I)),P=!u.arrow&&null!=rj(l)&&C!==T&&i.reference[v]/2-(Cj,E={top:`${g}px calc(100% + ${j}px)`,bottom:`${g}px ${-j}px`,left:`calc(100% + ${j}px) ${v}px`,right:`${-j}px ${v}px`}[u],k=`${g}px ${a.reference.y+x-s}px`;return o.floating.style.setProperty("--transform-origin",ea&&"y"===c&&S?k:E),{}}},ll,L),eG(()=>{!P&&T&&T.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[P,T]);let ec=x.useMemo(()=>({elementResize:!I&&"u">typeof ResizeObserver,layoutShift:!I&&"u">typeof IntersectionObserver}),[I]),{refs:ed,elements:ep,x:ef,y:em,middlewareData:eh,update:eg,placement:ev,context:ey,isPositioned:ex,floatingStyles:eb}=function(e={}){let{nodeId:t,externalTree:n}=e,r=function(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,o=eX(),l=null!=nN(),i=eA(()=>new nE({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new ni,floatingId:o,nested:l,noEmit:e.noEmit||!1})).current;return eG(()=>{let e={open:t,floatingId:o};void 0!==r.reference&&(e.referenceElement=r.reference,e.domReferenceElement=e8(r.reference)?r.reference:null),void 0!==r.floating&&(e.floatingElement=r.floating),i.update(e)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=l,i.context.noEmit=e.noEmit||!1,i}(e),o=e.rootContext||r,l={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,a]=x.useState(null),s=x.useRef(null),u=nM(n);eG(()=>{l.domReference&&(s.current=l.domReference)},[l.domReference]);let c=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:i}={},transform:a=!0,whileElementsMounted:s,open:u}=e,[c,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=x.useState(r);lt(p,r)||f(r);let[m,h]=x.useState(null),[g,v]=x.useState(null),y=x.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),b=x.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),w=l||m,j=i||g,S=x.useRef(null),E=x.useRef(null),k=x.useRef(c),O=null!=s,R=lo(s),I=lo(o),C=lo(u),T=x.useCallback(()=>{if(!S.current||!E.current)return;let e={placement:t,strategy:n,middleware:p};I.current&&(e.platform=I.current),((e,t,n)=>{let r=new Map,o={platform:o8,...n},l={...o.platform,_c:r};return oU(e,t,{...o,platform:l})})(S.current,E.current,e).then(e=>{let t={...e,isPositioned:!1!==C.current};P.current&&!lt(k.current,t)&&(k.current=t,eN.flushSync(()=>{d(t)}))})},[p,t,n,I,C]);le(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let P=x.useRef(!1);le(()=>(P.current=!0,()=>{P.current=!1}),[]),le(()=>{if(w&&(S.current=w),j&&(E.current=j),w&&j){if(R.current)return R.current(w,j,T);T()}},[w,j,T,R,O]);let N=x.useMemo(()=>({reference:S,floating:E,setReference:y,setFloating:b}),[y,b]),M=x.useMemo(()=>({reference:w,floating:j}),[w,j]),A=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=lr(M.floating,c.x),r=lr(M.floating,c.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...ln(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,M.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:T,refs:N,elements:M,floatingStyles:A}),[c,T,N,M,A])}({...e,elements:{...l,...i&&{reference:i}}}),d=x.useCallback(e=>{let t=e8(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;a(t),c.refs.setReference(t)},[c.refs]),[p,f]=x.useState(null),[m,h]=x.useState(null);o.useSyncedValue("referenceElement",p),o.useSyncedValue("domReferenceElement",e8(p)?p:null),o.useSyncedValue("floatingElement",m);let g=x.useCallback(e=>{(e8(e)||null===e)&&(s.current=e,f(e)),(e8(c.refs.reference.current)||null===c.refs.reference.current||null!==e&&!e8(e))&&c.refs.setReference(e)},[c.refs,f]),v=x.useCallback(e=>{h(e),c.refs.setFloating(e)},[c.refs]),y=x.useMemo(()=>({...c.refs,setReference:g,setFloating:v,setPositionReference:d,domReference:s}),[c.refs,g,v,d]),b=x.useMemo(()=>({...c.elements,domReference:l.domReference}),[c.elements,l.domReference]),w=o.useState("open"),j=o.useState("floatingId"),S=x.useMemo(()=>({...c,dataRef:o.context.dataRef,open:w,onOpenChange:o.setOpen,events:o.context.events,floatingId:j,refs:y,elements:b,nodeId:t,rootStore:o}),[c,y,b,t,o,w,j]);return eG(()=>{o.context.dataRef.current.floatingContext=S;let e=null==u?void 0:u.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),x.useMemo(()=>({...c,context:S,refs:y,elements:b,rootStore:o}),[c,y,b,S,o])}({rootContext:T,placement:X,middleware:el,strategy:y,whileElementsMounted:C?void 0:(...e)=>o9(...e,ec),nodeId:A,externalTree:$}),{sideX:ew,sideY:ej}=eh.adaptiveOrigin||li,eS=ex?y:"fixed",eE=x.useMemo(()=>L?{position:eS,[ew]:ef,[ej]:em}:{position:eS,...eb},[L,eS,ew,ef,ej,em,eb]),ek=x.useRef(null);eG(()=>{if(!P)return;let e=V.current,t="function"==typeof e?e():e,n=(lu(t)?t.current:t)||null;n!==ek.current&&(ed.setPositionReference(n),ek.current=n)},[P,ed,H,V]),x.useEffect(()=>{if(!P)return;let e=V.current;"function"!=typeof e&&lu(e)&&e.current!==ek.current&&(ed.setPositionReference(e.current),ek.current=e.current)},[P,ed,H,V]),x.useEffect(()=>{if(C&&P&&ep.domReference&&ep.floating)return o9(ep.domReference,ep.floating,eg,ec)},[C,P,ep,eg,ec]);let eO=rw(ev),eR=la(b,eO,_),eI=rj(ev)||"center",eC=!!(null!=(t=eh.hide)&&t.referenceHidden);eG(()=>{D&&P&&ex&&q(eO)},[D,P,ex,eO]);let eT=x.useMemo(()=>{var e,t;return{position:"absolute",top:null==(e=eh.arrow)?void 0:e.y,left:null==(t=eh.arrow)?void 0:t.x}},[eh.arrow]),eP=(null==(n=eh.arrow)?void 0:n.centerOffset)!==0;return x.useMemo(()=>({positionerStyles:eE,arrowStyles:eT,arrowRef:en,arrowUncentered:eP,side:eR,align:eI,physicalSide:eO,anchorHidden:eC,refs:ed,context:ey,isPositioned:ex,update:eg}),[eE,eT,en,eP,eR,eI,eO,eC,ed,ey,ex,eg])}({anchor:A,floatingRootContext:k,positionMethod:S?"fixed":i,mounted:R,side:q,sideOffset:L,align:B,alignOffset:D,arrowPadding:U?0:h,collisionBoundary:f,collisionPadding:m,sticky:g,nodeId:N,keepMounted:j,disableAnchorTracking:v,collisionAvoidance:F,shiftCrossAxis:U,externalTree:O}),K=x.useMemo(()=>{let e={};return I||(e.pointerEvents="none"),{role:"presentation",hidden:!R,style:{...z.positionerStyles,...e}}},[I,R,z.positionerStyles]);x.useEffect(()=>{function e(e){e.open?(e.parentNodeId===N&&w.set("hoverEnabled",!1),e.nodeId!==N&&e.parentNodeId===w.select("floatingParentNodeId")&&w.setOpen(!1,tY(rl))):e.parentNodeId===N&&e.reason!==rl&&w.set("hoverEnabled",!0)}return O.events.on("menuopenchange",e),()=>{O.events.off("menuopenchange",e)}},[w,O.events,N]),x.useEffect(()=>{if(null!=w.select("floatingParentNodeId"))return O.events.on("menuopenchange",e),()=>{O.events.off("menuopenchange",e)};function e(e){if(e.open||e.nodeId!==w.select("floatingParentNodeId"))return;let t=e.reason??rl;w.setOpen(!1,tY(t))}},[O.events,w]),x.useEffect(()=>{function e(e){!I||e.nodeId!==w.select("floatingParentNodeId")||e.target&&T&&T!==e.target&&w.setOpen(!1,tY(rl))}return O.events.on("itemhover",e),()=>{O.events.off("itemhover",e)}},[O.events,I,T,w]),x.useEffect(()=>{let e={open:I,nodeId:N,parentNodeId:M,reason:w.select("lastOpenChangeReason")};O.events.emit("menuopenchange",e)},[O.events,I,w,N,M]);let W=x.useMemo(()=>({open:I,side:z.side,align:z.align,anchorHidden:z.anchorHidden,nested:"menu"===E.type}),[I,z.side,z.align,z.anchorHidden,E.type]),H=x.useMemo(()=>({side:z.side,align:z.align,arrowRef:z.arrowRef,arrowUncentered:z.arrowUncentered,arrowStyles:z.arrowStyles,nodeId:z.context.nodeId}),[z.side,z.align,z.arrowRef,z.arrowUncentered,z.arrowStyles,z.context.nodeId]),V=r9("div",e,{state:W,stateAttributesMapping:lv,ref:[t,w.useStateSetter("positionerElement")],props:[K,b]}),_=R&&"menu"!==E.type&&("menubar"!==E.type&&C&&P!==n7||"menubar"===E.type&&E.context.modal),Y=null;return"menubar"===E.type?Y=E.context.contentElement:void 0===E.type&&(Y=T),(0,l.jsxs)(oF.Provider,{value:H,children:[_&&(0,l.jsx)(lS,{ref:"context-menu"===E.type||"nested-context-menu"===E.type?E.context.internalBackdropRef:null,inert:(r=!I,nt>=19?r:r?"true":void 0),cutout:Y}),(0,l.jsx)(nL,{id:N,children:(0,l.jsx)(lx,{elementsRef:w.context.itemDomElements,labelsRef:w.context.itemLabels,children:V})})]})}),lk=x.createContext(void 0),lO="ArrowUp",lR="ArrowDown",lI="ArrowLeft",lC="ArrowRight",lT=new Set([lI,lC]),lP=([...new Set([...lT,...new Set([lO,lR])])],new Set([lO,lR,lI,lC,"Home","End"])),lN=nz("safe-polygon"),lM=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${nY}`;function lA(e){let t=x.useRef(void 0),n=x.useRef(!1),r=x.useRef(void 0),o=x.useRef(!0),l=x.useRef(!1),i=x.useRef(()=>{}),a=x.useRef(!1),s=eB(),u=eB(),c=x.useRef(void 0);return x.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||(d.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:o,performedPointerEventsMutationRef:l,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:s,restTimeout:u,handleCloseOptionsRef:c}),d.hoverInteractionState},[e,t,n,r,o,l,i,a,s,u,c])}let lL=new Set(["click","mousedown"]),lD={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function l$(e){return"inert"===e?lD.inert:"aria-hidden"===e?lD["aria-hidden"]:lD.none}let lF=new WeakSet,lq={},lB=0,lU=e=>e&&(e.host||lU(e.parentNode)),lz=[];function lK(){lz=lz.filter(e=>e.isConnected)}function lW(){return lK(),lz[lz.length-1]}function lH(e,t){var n,r,o;if(!t.current.includes("floating")&&!(null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;let l=oO(),i=(r=e,(o=(o=l)||{}).getShadowRoot?oa([r],o.includeContainer,{filter:ob.bind(null,o),flatten:!0,getShadowRoot:o.getShadowRoot}):oi(r,o.includeContainer,ob.bind(null,o))).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return ok(e,l)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==a&&e.setAttribute("tabindex","0"):("-1"!==a||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function lV(e){let{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:i=!0,returnFocus:a=!0,restoreFocus:s=!1,modal:u=!0,closeOnFocusOut:c=!0,openInteractionType:d="",getInsideElements:p=()=>[],nextFocusableElement:f,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g}=e,v="rootStore"in t?t.rootStore:t,y=v.useState("open"),b=v.useState("domReferenceElement"),w=v.useState("floatingElement"),{events:j,dataRef:S}=v.context,E=eK(()=>{var e;return null==(e=S.current.floatingContext)?void 0:e.nodeId}),k=eK(p),O=!1===i,R=n6(b)&&O,I=rs(o),C=rs(i),T=rs(a),P=rs(d),N=nM(g),M=oA(),A=x.useRef(null),L=x.useRef(null),D=x.useRef(!1),$=x.useRef(!1),F=x.useRef(!1),q=x.useRef(-1),B=x.useRef(""),U=x.useRef(""),z=x.useRef(null),K=x.useRef(null),W=r6(z,h,null==M?void 0:M.beforeInsideRef),H=r6(K,null==M?void 0:M.afterInsideRef),V=eB(),_=eB(),Y=e1(),X=null!=M,G=n3(w),J=eK((e=G)=>e?oE(e,oO()):[]),Z=eK(e=>{let t=J(e);return I.current.map(()=>t).filter(Boolean).flat()});x.useEffect(()=>{if(r||!u)return;function e(e){"Tab"===e.key&&n0(G,nQ(n5(G)))&&0===J().length&&!R&&na(e)}let t=n5(G);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,b,G,u,I,R,J,Z]),x.useEffect(()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){let t=n1(e),n=J().indexOf(t);-1!==n&&(q.current=n)}},[r,w,J]),x.useEffect(()=>{if(r||!y)return;let e=n5(G);function t(){F.current=!1}function n(e){let t=n1(e);F.current=!(n0(w,t)||n0(b,t)||n0(null==M?void 0:M.portalNode,t)),U.current=e.pointerType||"keyboard"}function o(){U.current="keyboard"}return e.addEventListener("pointerdown",n,!0),e.addEventListener("pointerup",t,!0),e.addEventListener("pointercancel",t,!0),e.addEventListener("keydown",o,!0),()=>{e.removeEventListener("pointerdown",n,!0),e.removeEventListener("pointerup",t,!0),e.removeEventListener("pointercancel",t,!0),e.removeEventListener("keydown",o,!0)}},[r,w,b,G,y,M]),x.useEffect(()=>{if(r||!c)return;function e(){$.current=!0,_.start(0,()=>{$.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=n1(e);queueMicrotask(()=>{let o=E(),l=v.context.triggerElements,i=(null==t?void 0:t.hasAttribute(nz("focus-guard")))&&[z.current,K.current,null==M?void 0:M.beforeInsideRef.current,null==M?void 0:M.afterInsideRef.current,null==M?void 0:M.beforeOutsideRef.current,null==M?void 0:M.afterOutsideRef.current,n$(m),n$(f)].includes(t),a=!(n0(b,t)||n0(w,t)||n0(t,w)||n0(null==M?void 0:M.portalNode,t)||null!=t&&l.hasElement(t)||l.hasMatchingElement(e=>n0(e,t))||i||N&&(nK(N.nodesRef.current,o).find(e=>{var n,r;return n0(null==(n=e.context)?void 0:n.elements.floating,t)||n0(null==(r=e.context)?void 0:r.elements.domReference,t)})||nW(N.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,n3(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===b&&G&&lH(G,I),s&&n!==b&&!(r&&r.isConnected&&("function"==typeof r.checkVisibility?r.checkVisibility():"none"!==tp(r).display))&&nQ(n5(G))===n5(G).body){if(e7(G)&&(G.focus(),"popup"===s))return void Y.request(()=>{G.focus()});let e=q.current,t=J(),n=t[e]||t[t.length-1]||G;e7(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(R||!u)&&t&&a&&!$.current&&(R||t!==lW())&&(D.current=!0,v.setOpen(!1,tY(rn,e)))})}function n(){F.current||(S.current.insideReactTree=!0,V.start(0,()=>{S.current.insideReactTree=!1}))}let o=e7(b)?b:null,l=[];if(!(!w&&!o))return o&&(o.addEventListener("focusout",t),o.addEventListener("pointerdown",e),l.push(()=>{o.removeEventListener("focusout",t),o.removeEventListener("pointerdown",e)})),w&&(w.addEventListener("focusout",t),M&&(w.addEventListener("focusout",n,!0),l.push(()=>{w.removeEventListener("focusout",n,!0)})),l.push(()=>{w.removeEventListener("focusout",t)})),()=>{l.forEach(e=>{e()})}},[r,b,w,G,u,N,M,v,c,s,J,R,E,I,S,V,_,Y,f,m]),x.useEffect(()=>{var e,t,n;if(r||!w||!y)return;let o=Array.from((null==(e=null==M?void 0:M.portalNode)?void 0:e.querySelectorAll(`[${nz("portal")}]`))||[]),l=function(e,t=!1,n=!1){let r=n5(e[0]).body;return function(e,t,n,r){let o="data-base-ui-inert",l=r?"inert":n?"aria-hidden":null,i=e.map(e=>{if(t.contains(e))return e;let n=lU(e);return t.contains(n)?n:null}).filter(e=>null!=e),a=new Set,s=new Set(i),u=[];lq[o]||(lq[o]=new WeakMap);let c=lq[o];return i.forEach(function e(t){!t||a.has(t)||(a.add(t),t.parentNode&&e(t.parentNode))}),function e(t){!t||s.has(t)||[].forEach.call(t.children,t=>{if("script"!==e5(t))if(a.has(t))e(t);else{let e=l?t.getAttribute(l):null,n=null!==e&&"false"!==e,r=l$(l),i=(r.get(t)||0)+1,a=(c.get(t)||0)+1;r.set(t,i),c.set(t,a),u.push(t),1===i&&n&&lF.add(t),1===a&&t.setAttribute(o,""),!n&&l&&t.setAttribute(l,"inert"===l?"":"true")}})}(t),a.clear(),lB+=1,()=>{u.forEach(e=>{let t=l$(l),n=(t.get(e)||0)-1,r=(c.get(e)||0)-1;t.set(e,n),c.set(e,r),n||(!lF.has(e)&&l&&e.removeAttribute(l),lF.delete(e)),r||e.removeAttribute(o)}),(lB-=1)||(lD.inert=new WeakMap,lD["aria-hidden"]=new WeakMap,lD.none=new WeakMap,lF=new WeakSet,lq={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}([w,null==(n=null==(t=(N?nW(N.nodesRef.current,E()):[]).find(e=>{var t;return n6((null==(t=e.context)?void 0:t.elements.domReference)||null)}))?void 0:t.context)?void 0:n.elements.domReference,...o,...k(),A.current,L.current,z.current,K.current,null==M?void 0:M.beforeOutsideRef.current,null==M?void 0:M.afterOutsideRef.current,n$(m),n$(f),R?b:null].filter(e=>null!=e),u||R);return()=>{l()}},[y,r,b,w,u,I,M,R,N,E,k,f,m]),eG(()=>{if(!y||r||!e7(G))return;let e=nQ(n5(G));queueMicrotask(()=>{let t,n=Z(G),r=C.current,o="function"==typeof r?r(P.current||""):r;void 0!==o&&!1!==o&&(t=(t=!0===o||null===o?n[0]||G:n$(o))||n[0]||G,n0(G,e)||rd(t,{preventScroll:t===G}))})},[r,y,G,O,Z,C,P]),eG(()=>{var e;if(r||!G)return;let t=n5(G);function n(e){if(e.open||(B.current=function(e,t){let n=e4(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||(0===e.detail?"keyboard":"mouse"):""}(e.nativeEvent,U.current)),e.reason===n7&&"mouseleave"===e.nativeEvent.type&&(D.current=!0),e.reason===re)if(e.nested)D.current=!1;else if(ns(e.nativeEvent)||nu(e.nativeEvent))D.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?D.current=!1:D.current=!0}}e=nQ(t),lK(),e&&"body"!==e5(e)&&(lz.push(e),lz.length>20&&(lz=lz.slice(-20))),j.on("openchange",n);let o=t.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,r5),X&&b&&b.insertAdjacentElement("afterend",o),()=>{j.off("openchange",n);let e=nQ(t),r=n0(w,e)||N&&nK(N.nodesRef.current,E(),!1).some(t=>{var n;return n0(null==(n=t.context)?void 0:n.elements.floating,e)}),l=function(){let e=T.current,t="function"==typeof e?e(B.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t){let e=b||lW();return e&&e.isConnected?e:o}let n=b||lW()||o;return n$(t)||n}();queueMicrotask(()=>{let n=function(e){if(!e)return null;let t=oO();return ok(e,t)?e:oE(e,t)[0]||e}(l),i="boolean"!=typeof T.current;T.current&&!D.current&&e7(n)&&(!(!i&&n!==e&&e!==t.body)||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,w,G,T,S,j,N,X,b,E]),x.useEffect(()=>{queueMicrotask(()=>{D.current=!1})},[r]),x.useEffect(()=>{if(r||!y)return;function e(e){let t=n1(e);null!=t&&t.closest("[data-base-ui-click-trigger]")&&($.current=!0)}let t=n5(G);return t.addEventListener("pointerdown",e,!0),()=>{t.removeEventListener("pointerdown",e,!0)}},[r,y,G]),eG(()=>{if(!r&&M)return M.setFocusManagerState({modal:u,closeOnFocusOut:c,open:y,onOpenChange:v.setOpen,domReference:b}),()=>{M.setFocusManagerState(null)}},[r,M,u,y,v,c,b]),eG(()=>{if(!(r||!G))return lH(G,I),()=>{queueMicrotask(lK)}},[r,G,I]);let Q=!r&&(!u||!R)&&(X||u);return(0,l.jsxs)(x.Fragment,{children:[Q&&(0,l.jsx)(r4,{"data-type":"inside",ref:W,onFocus:e=>{var t;if(u){let e=Z();rd(e[e.length-1])}else if(null!=M&&M.portalNode)if(D.current=!1,oP(e,M.portalNode)){let e=oI(b);null==e||e.focus()}else null==(t=n$(m??M.beforeOutsideRef))||t.focus()}}),n,Q&&(0,l.jsx)(r4,{"data-type":"inside",ref:H,onFocus:e=>{var t;if(u)rd(Z()[0]);else if(null!=M&&M.portalNode)if(c&&(D.current=!0),oP(e,M.portalNode)){let e=oC(b);null==e||e.focus()}else null==(t=n$(f??M.afterOutsideRef))||t.focus()}})]})}let l_={...lv,transitionStatus:e=>"starting"===e?nq:"ending"===e?nB:null},lY=x.forwardRef(function(e,t){let{render:n,className:r,finalFocus:o,...i}=e,{store:a}=tq(),{side:s,align:u}=oq(),c=null!=x.useContext(lk),d=a.useState("open"),p=a.useState("transitionStatus"),f=a.useState("popupProps"),m=a.useState("mounted"),h=a.useState("instantType"),g=a.useState("activeTriggerElement"),v=a.useState("parent"),y=a.useState("lastOpenChangeReason"),b=a.useState("rootId"),w=a.useState("floatingRootContext"),j=a.useState("floatingTreeRoot"),S=a.useState("closeDelay"),E=a.useState("activeTriggerElement"),k="context-menu"===v.type;nU({open:d,ref:a.context.popupRef,onComplete(){var e,t;d&&(null==(t=(e=a.context).onOpenChangeComplete)||t.call(e,!0))}}),x.useEffect(()=>{function e(e){a.setOpen(!1,tY(e.reason,e.domEvent))}return j.events.on("close",e),()=>{j.events.off("close",e)}},[j.events,a]);let O=a.useState("hoverEnabled"),R=a.useState("disabled");!function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),l=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:s=0,externalTree:u}=t,{pointerTypeRef:c,interactedInsideRef:d,handlerRef:p,performedPointerEventsMutationRef:f,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:v}=lA(n),y=nM(u),b=nN(),w=eK(()=>!!d.current||!!i.current.openEvent&&lL.has(i.current.openEvent.type)),j=eK(()=>{var e;let t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),S=x.useCallback((e,t=!0)=>{var r,o;let l=(r=s,(o=c.current)&&!nc(o)?0:"function"==typeof r?r():r);l&&!p.current?g.start(l,()=>n.setOpen(!1,tY(n7,e))):t&&(g.clear(),n.setOpen(!1,tY(n7,e)))},[s,p,n,c,g]),E=eK(()=>{m.current(),p.current=void 0}),k=eK(()=>{if(f.current){let e=n5(o).body;e.style.pointerEvents="",e.removeAttribute(lN),f.current=!1}}),O=eK(e=>{var t;if(!((t=n1(e))&&t.closest(lM))){d.current=!1;return}d.current=!0});eG(()=>{r||(c.current=void 0,h.current=!1,d.current=!1,E(),k())},[r,c,h,d,E,k]),x.useEffect(()=>()=>{E()},[E]),x.useEffect(()=>k,[k]),eG(()=>{var e,t,n;if(a&&r&&null!=(e=v.current)&&e.blockPointerEvents&&j()&&e8(l)&&o){f.current=!0;let e=n5(o).body;e.setAttribute(lN,"");let r=null==(n=null==(t=null==y?void 0:y.nodesRef.current.find(e=>e.id===b))?void 0:t.context)?void 0:n.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="none",l.style.pointerEvents="auto",o.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents="",o.style.pointerEvents=""}}},[a,r,l,o,v,j,y,b,f]),x.useEffect(()=>{if(a)return o&&(o.addEventListener("mouseleave",e),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",r),o.addEventListener("pointerdown",O,!0)),()=>{o&&(o.removeEventListener("mouseleave",e),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",r),o.removeEventListener("pointerdown",O,!0))};function e(e){if(w()||!i.current.floatingContext||!n.select("open"))return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(k(),E(),w()||S(e))}function t(e){var t;g.clear(),k(),null==(t=p.current)||t.call(p,e),E()}function r(e){w()||S(e,!1)}})}(w,{enabled:O&&!R&&!k&&"menubar"!==v.type,closeDelay:S});let I=r9("div",e,{state:x.useMemo(()=>({transitionStatus:p,side:s,align:u,open:d,nested:"menu"===v.type,instant:h}),[p,s,u,d,v.type,h]),ref:[t,a.context.popupRef],stateAttributesMapping:l_,props:[f,{onKeyDown(e){c&&lP.has(e.key)&&e.stopPropagation()}},"starting"===p?tz:tT,i,{"data-rootownerid":b}]}),C=void 0===v.type||k;return(g||"menubar"===v.type&&y!==re)&&(C=!0),(0,l.jsx)(lV,{context:w,modal:k,disabled:!m,returnFocus:void 0===o?C:o,initialFocus:"menu"!==v.type,restoreFocus:!0,externalTree:"menubar"!==v.type?j:void 0,previousFocusableElement:E,nextFocusableElement:void 0===v.type?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===v.type?a.context.beforeContentFocusGuardRef:void 0,children:I})}),lX=x.createContext(void 0);function lG(e=!1){let t=x.useContext(lX);if(void 0===t&&!e)throw Error(t$(16));return t}function lJ(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,l=x.useRef(null),i=void 0!==lG(!0),a=eK(()=>{let e=l.current;return!!((null==e?void 0:e.tagName)==="A"&&null!=e&&e.href)}),{props:s}=function(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:l}=e,i=r&&!1!==t,a=r&&!1===t;return{props:x.useMemo(()=>{let e={onKeyDown(e){n&&t&&"Tab"!==e.key&&e.preventDefault()}};return r||(e.tabIndex=o,!l&&n&&(e.tabIndex=t?o:-1)),(l&&(t||i)||!l&&n)&&(e["aria-disabled"]=n),l&&(!t||a)&&(e.disabled=n),e},[r,n,t,i,a,l,o])}}({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:o}),u=x.useCallback(()=>{var e;let n=l.current;e7(e=n)&&"BUTTON"===e.tagName&&i&&t&&void 0===s.disabled&&n.disabled&&(n.disabled=!1)},[t,s.disabled,i]);return eG(u,[u]),{getButtonProps:x.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:l,onKeyDown:i,onPointerDown:u,...c}=e;return rX({type:o?"button":void 0,onClick(e){if(t)return void e.preventDefault();null==n||n(e)},onMouseDown(e){t||null==r||r(e)},onKeyDown(e){if(t||(rQ(e),null==i||i(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!o&&!a()&&!t,l="Enter"===e.key,s=" "===e.key;r&&((s||l)&&e.preventDefault(),l&&(null==n||n(e)))},onKeyUp(e){t||(rQ(e),null==l||l(e)),e.baseUIHandlerPrevented||e.target!==e.currentTarget||o||t||" "!==e.key||null==n||n(e)},onPointerDown(e){if(t)return void e.preventDefault();null==u||u(e)}},o?void 0:{role:"button"},s,c)},[t,s,o,a]),buttonRef:eK(e=>{l.current=e,u()})}}let lZ={type:"regular-item"};function lQ(e){return eX(e,"base-ui")}let l0=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function l1(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:l}=e,{register:i,unregister:a,subscribeMapChange:s,elementsRef:u,labelsRef:c,nextIndexRef:d}=x.useContext(ly),p=x.useRef(-1),[f,m]=x.useState(l??(o===l0.GuessFromOrder?()=>{if(-1===p.current){let e=d.current;d.current+=1,p.current=e}return p.current}:-1)),h=x.useRef(null),g=x.useCallback(e=>{var n;if(h.current=e,-1!==f&&null!==e&&(u.current[f]=e,c)){let o=void 0!==t;c.current[f]=o?t:(null==(n=null==r?void 0:r.current)?void 0:n.textContent)??e.textContent}},[f,u,c,t,r]);return eG(()=>{if(null!=l)return;let e=h.current;if(e)return i(e,n),()=>{a(e)}},[l,i,a,n]),eG(()=>{if(null==l)return s(e=>{var t;let n=h.current?null==(t=e.get(h.current))?void 0:t.index:null;null!=n&&m(n)})},[l,s,m]),x.useMemo(()=>({ref:g,index:f}),[f,g])}let l2=x.forwardRef(function(e,t){let{render:n,className:r,id:o,label:l,nativeButton:i=!1,disabled:a=!1,closeOnClick:s=!0,...u}=e,c=l1({label:l}),d=oq(!0),p=lQ(o),{store:f}=tq(),m=f.useState("isActive",c.index),h=f.useState("itemProps"),{getItemProps:g,itemRef:v}=function(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:o,store:l,nativeButton:i,itemMetadata:a,nodeId:s}=e,u=x.useRef(null),c=tG(!0),d=void 0!==c,{events:p}=l.useState("floatingTreeRoot"),{getButtonProps:f,buttonRef:m}=lJ({disabled:n,focusableWhenDisabled:!0,native:i}),h=x.useCallback(e=>rX({id:o,role:"menuitem",tabIndex:r?0:-1,onMouseMove(e){s&&p.emit("itemhover",{nodeId:s,target:e.currentTarget})},onMouseEnter(){"submenu-trigger"===a.type&&a.setActive()},onKeyUp(e){" "===e.key&&l.context.typingRef.current&&e.preventBaseUIHandler()},onClick(e){t&&p.emit("close",{domEvent:e,reason:rt})},onMouseUp(e){if(c){let t=c.initialCursorPointRef.current;if(c.initialCursorPointRef.current=null,d&&t&&1>=Math.abs(e.clientX-t.x)&&1>=Math.abs(e.clientY-t.y))return}u.current&&l.context.allowMouseUpTriggerRef.current&&(!d||2===e.button)&&"regular-item"===a.type&&u.current.click()}},e,f),[o,r,f,t,p,l,d,c,a,s]),g=r6(u,m);return x.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}({closeOnClick:s,disabled:a,highlighted:m,id:p,store:f,nativeButton:i,nodeId:null==d?void 0:d.nodeId,itemMetadata:lZ});return r9("div",e,{state:x.useMemo(()=>({disabled:a,highlighted:m}),[a,m]),props:[h,u,g],ref:[v,t,c.ref]})});function l5(e){let{render:t,className:n,state:r=tT,props:o=tC,refs:l=tC,metadata:i,stateAttributesMapping:a,tag:s="div",...u}=e,{compositeProps:c,compositeRef:d}=function(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=lG(),{ref:o,index:l}=l1(e),i=n===l,a=x.useRef(null),s=r6(o,a);return{compositeProps:x.useMemo(()=>({tabIndex:i?0:-1,onFocus(){r(l)},onMouseMove(){let e=a.current;if(!t||!e)return;let n=e.hasAttribute("disabled")||"true"===e.ariaDisabled;i||n||e.focus()}}),[i,r,l,t]),compositeRef:s,index:l}}({metadata:i});return r9(s,e,{state:r,ref:[...l,d],props:[c,...o,u],stateAttributesMapping:a})}function l4(e,t,n){if(n&&!nc(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){let n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function l6(e){return"function"==typeof e?e():e}let l3={current:null};function l8(e,t){let[n,r]=e,o=!1,l=t.length;for(let e=0,i=l-1;e=r!=u>=r&&n<=(s-l)*(r-a)/(u-a)+l&&(o=!o)}return o}let l7=tk&&tS,l9=x.forwardRef(function(e,t){let{render:n,className:r,disabled:o=!1,nativeButton:i=!0,id:a,openOnHover:s,delay:u=100,closeDelay:c=0,handle:d,payload:p,...f}=e,m=tq(!0),h=(null==d?void 0:d.store)??(null==m?void 0:m.store);if(!h)throw Error(t$(85));let g=lQ(a),v=h.useState("isTriggerActive",g),y=h.useState("floatingRootContext"),b=h.useState("isOpenedByTrigger",g),w=x.useRef(null),j=function(){let e=tG(!0),t=tq(!0),n=tU();return x.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}(),S=lG(!0),E=nM(),k=x.useMemo(()=>E??new t0,[E]),O=nA(k),{registerTrigger:R,isMountedByThisTrigger:I}=function(e,t,n,r){let o=n.useState("isMountedByTrigger",e),l=function(e,t){let n=x.useRef(null),r=x.useRef(null);return x.useCallback(o=>{if(void 0!==e){if(null!==n.current){let e=n.current,o=r.current,l=t.context.triggerElements.getById(e);o&&l===o&&t.context.triggerElements.delete(e),n.current=null,r.current=null}null!==o&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}(e,n),i=eK(t=>{if(l(t),!t||!n.select("open"))return;let o=n.select("activeTriggerId");if(o===e)return void n.update({activeTriggerElement:t,...r});null==o&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return eG(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}(g,w,h,{payload:p,closeDelay:c,parent:j,floatingTreeRoot:k,floatingNodeId:O,floatingParentNodeId:nN(),keyboardEventRelay:null==S?void 0:S.relayKeyboardEvent}),C="menubar"===j.type,T=h.useState("disabled"),P=o||T||C&&j.context.disabled,{getButtonProps:N,buttonRef:M}=lJ({disabled:P,native:i});x.useEffect(()=>{b||void 0!==j.type||(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,j.type]);let A=x.useRef(null),L=eB(),D=eK(e=>{if(!A.current)return;L.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(n0(A.current,t)||n0(h.select("positionerElement"),t)||t===A.current||null!=t&&function e(t){return e7(t)&&t.hasAttribute("data-rootownerid")?t.getAttribute("data-rootownerid")??void 0:td(t)?void 0:e(tm(t))}(t)===h.select("rootId"))return;let n=function(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if("none"===n.content&&"none"===r.content)return t;let o=parseFloat(n.width)||0,l=parseFloat(n.height)||0,i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,s=Math.max(t.width,o,i),u=Math.max(t.height,l,a),c=s-t.width,d=u-t.height;return{left:t.left-c/2,right:t.right+c/2,top:t.top-d/2,bottom:t.bottom+d/2}}(A.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||k.events.emit("close",{domEvent:e,reason:"cancel-open"})});x.useEffect(()=>{b&&h.select("lastOpenChangeReason")===n7&&tR(A.current).addEventListener("mouseup",D,{once:!0})},[b,D,h]);let $=C&&j.context.hasSubmenuOpen,F=function(e,t={}){var n;let r="rootStore"in e?e.rootStore:e,{dataRef:o,events:l}=r.context,{enabled:i=!0,delay:a=0,handleClose:s=null,mouseOnly:u=!1,restMs:c=0,move:d=!0,triggerElementRef:p=l3,externalTree:f,isActiveTrigger:m=!0}=t,h=nM(f),{pointerTypeRef:g,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:w,unbindMouseMoveRef:j,restTimeoutPendingRef:S,openChangeTimeout:E,restTimeout:k,handleCloseOptionsRef:O}=lA(r),R=rs(s),I=rs(a),C=rs(c);m&&(O.current=null==(n=R.current)?void 0:n.__options);let T=eK(()=>!!v.current||!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)),P=x.useCallback((e,t=!0)=>{let n=l4(I.current,"close",g.current);n&&!y.current?E.start(n,()=>r.setOpen(!1,tY(n7,e))):t&&(E.clear(),r.setOpen(!1,tY(n7,e)))},[I,y,r,g,E]),N=eK(()=>{j.current(),y.current=void 0}),M=eK(()=>{if(w.current){let e=n5(r.select("domReferenceElement")).body;e.style.pointerEvents="",e.removeAttribute(lN),w.current=!1}});x.useEffect(()=>{if(i)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){e.open||(E.clear(),k.clear(),b.current=!0,S.current=!1)}},[i,l,E,k,b,S]);let A=eK(e=>{var t;if(T()||!o.current.floatingContext)return;let n=r.context.triggerElements;if(e.relatedTarget&&n.hasElement(e.relatedTarget))return;let l=p.current;null==(t=R.current)||t.call(R,{...o.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){M(),N(),T()||l!==r.select("domReferenceElement")||P(e)}})(e)});return x.useEffect(()=>{if(!i)return;let e=p.current??(m?r.select("domReferenceElement"):null);if(e8(e))return r.select("open")&&e.addEventListener("mouseleave",l),d&&e.addEventListener("mousemove",t,{once:!0}),e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),()=>{e.removeEventListener("mouseleave",l),d&&e.removeEventListener("mousemove",t),e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",n)};function t(e){if(E.clear(),b.current=!1,u&&!nc(g.current)||l6(C.current)>0&&!l4(I.current,"open"))return;let t=l4(I.current,"open",g.current),n=r.select("domReferenceElement"),o=r.context.triggerElements,l=(o.hasElement(e.target)||o.hasMatchingElement(t=>n0(t,e.target)))&&(!n||!n0(n,e.target)),i=e.currentTarget??null,a=r.select("open"),s=!a||l;l&&a?r.setOpen(!0,tY(n7,e,i)):t?E.start(t,()=>{s&&r.setOpen(!0,tY(n7,e,i))}):s&&r.setOpen(!0,tY(n7,e,i))}function n(e){if(T())return void M();j.current();let t=n5(r.select("domReferenceElement"));k.clear(),S.current=!1;let n=r.context.triggerElements;if(!(e.relatedTarget&&n.hasElement(e.relatedTarget))){if(R.current&&o.current.floatingContext){r.select("open")||E.clear();let n=p.current;y.current=R.current({...o.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){M(),N(),T()||n!==r.select("domReferenceElement")||P(e,!0)}});let l=y.current;l(e),t.addEventListener("mousemove",l),j.current=()=>{t.removeEventListener("mousemove",l)};return}"touch"===g.current&&n0(r.select("floatingElement"),e.relatedTarget)||P(e)}}function l(e){A(e)}},[N,M,b,o,I,P,r,i,R,A,m,T,u,d,g,C,k,S,E,p,h,j,y]),x.useMemo(()=>{function e(e){g.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,o=r.select("domReferenceElement"),l=r.context.triggerElements,i=r.select("open"),a=(l.hasElement(e.target)||l.hasMatchingElement(t=>n0(t,e.target)))&&(!o||!n0(o,e.target));function s(){if(S.current=!1,T())return;let e=r.select("open");b.current||e&&!a||r.setOpen(!0,tY(n7,t,n))}(!u||nc(g.current))&&(!i||a)&&0!==l6(C.current)&&(a||!S.current||!(e.movementX**2+e.movementY**2<2))&&(k.clear(),"touch"===g.current?eN.flushSync(()=>{s()}):a&&i?s():(S.current=!0,k.start(l6(C.current),s)))}}},[b,T,u,r,g,C,k,S])}(y,{enabled:(s??$)&&!P&&"context-menu"!==j.type&&(!C||$&&!I),handleClose:function(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o=new eq,l=!1,i=null,a=null,s="u">typeof performance?performance.now():0,u=({x:e,y:n,placement:u,elements:c,onClose:d,nodeId:p,tree:f})=>function(m){var h;function g(){o.clear(),d()}if(o.clear(),!c.domReference||!c.floating||null==u||null==e||null==n)return;let{clientX:v,clientY:y}=m,x=n1(m),b="mouseleave"===m.type,w=n0(c.floating,x),j=n0(c.domReference,x),S=c.domReference.getBoundingClientRect(),E=c.floating.getBoundingClientRect(),k=u.split("-")[0],O=e>E.right-E.width/2,R=n>E.bottom-E.height/2,I=(h=[v,y])[0]>=S.x&&h[0]<=S.x+S.width&&h[1]>=S.y&&h[1]<=S.y+S.height,C=E.width>S.width,T=E.height>S.height,P=(C?S:E).left,N=(C?S:E).right,M=(T?S:E).top,A=(T?S:E).bottom;if(w&&(l=!0,!b))return;if(j&&(l=!1),j&&!b){l=!0;return}if(b&&e8(m.relatedTarget)&&n0(c.floating,m.relatedTarget)||f&&nK(f.nodesRef.current,p).some(({context:e})=>null==e?void 0:e.open))return;if("top"===k&&n>=S.bottom-1||"bottom"===k&&n<=S.top+1||"left"===k&&e>=S.right-1||"right"===k&&e<=S.left+1)return g();let L=[];switch(k){case"top":L=[[P,S.top+1],[P,E.bottom-1],[N,E.bottom-1],[N,S.top+1]];break;case"bottom":L=[[P,E.top+1],[P,S.bottom-1],[N,S.bottom-1],[N,E.top+1]];break;case"left":L=[[E.right-1,A],[E.right-1,M],[S.left+1,M],[S.left+1,A]];break;case"right":L=[[S.right-1,A],[S.right-1,M],[E.left+1,M],[E.left+1,A]]}if(!l8([v,y],L)){if(l&&!I)return g();if(!b&&r){let e=function(e,t){let n=performance.now(),r=n-s;if(null===i||null===a||0===r)return i=e,a=t,s=n,null;let o=e-i,l=t-a,u=Math.sqrt(o*o+l*l)/r;return i=e,a=t,s=n,u}(m.clientX,m.clientY);if(null!==e&&e<.1)return g()}l8([v,y],function([e,n]){switch(k){case"top":{let r=[[E.left,O||C?E.bottom-t:E.top],[E.right,O?C?E.bottom-t:E.top:E.bottom-t]];return[[C?e+t/2:O?e+4*t:e-4*t,n+t+1],[C?e-t/2:O?e+4*t:e-4*t,n+t+1],...r]}case"bottom":{let r=[[E.left,O||C?E.top+t:E.bottom],[E.right,O?C?E.top+t:E.bottom:E.top+t]];return[[C?e+t/2:O?e+4*t:e-4*t,n-t],[C?e-t/2:O?e+4*t:e-4*t,n-t],...r]}case"left":return[[R||T?E.right-t:E.left,E.top],[R?T?E.right-t:E.left:E.right-t,E.bottom],[e+t+1,T?n+t/2:R?n+4*t:n-4*t],[e+t+1,T?n-t/2:R?n+4*t:n-4*t]];case"right":{let r=[[R||T?E.left+t:E.right,E.top],[R?T?E.left+t:E.right:E.left+t,E.bottom]];return[[e-t,T?n+t/2:R?n+4*t:n-4*t],[e-t,T?n-t/2:R?n+4*t:n-4*t],...r]}default:return[]}}([e,n]))?!l&&r&&o.start(40,g):g()}};return u.__options={blockPointerEvents:n},u}({blockPointerEvents:!C}),mouseOnly:!0,move:!1,restMs:void 0===j.type?u:void 0,delay:{close:c},triggerElementRef:w,externalTree:k,isActiveTrigger:v}),q=function(e,t){let n=eB(),[r,o]=x.useState(!1);return eG(()=>{e&&"trigger-hover"===t?(o(!0),n.start(500,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}(b,h.select("lastOpenChangeReason")),B=function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:l="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:u=0}=t,c=x.useRef(void 0),d=e1(),p=eB(),f=x.useMemo(()=>({onPointerDown(e){c.current=e.pointerType},onMouseDown(e){let t=c.current,o=e.nativeEvent,f=n.select("open");if(0!==e.button||"click"===l||nc(t,!0)&&a)return;let m=r.current.openEvent,h=null==m?void 0:m.type,g=n.select("domReferenceElement")!==e.currentTarget,v=f&&g||!(f&&i&&(!(m&&s)||"click"===h||"mousedown"===h));if(n4(o.target)){let e=tY(n8,o,o.target);v&&"touch"===t&&u>0?p.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let y=e.currentTarget;d.request(()=>{let e=tY(n8,o,y);v&&"touch"===t&&u>0?p.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if("mousedown-only"===l)return;let t=c.current;if("mousedown"===l&&t){c.current=void 0;return}if(nc(t,!0)&&a)return;let o=n.select("open"),d=r.current.openEvent,f=n.select("domReferenceElement")!==e.currentTarget,m=o&&f||!(o&&i&&(!(d&&s)||nd(d))),h=tY(n8,e.nativeEvent,e.currentTarget);m&&"touch"===t&&u>0?p.start(u,()=>{n.setOpen(!0,h)}):n.setOpen(m,h)},onKeyDown(){c.current=void 0}}),[r,l,a,n,s,i,d,p,u]);return x.useMemo(()=>o?{reference:f}:tT,[o,f])}(y,{enabled:!P&&"context-menu"!==j.type,event:b&&C?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===j.type&&q}),U=function(e,t={}){let n="rootStore"in e?e.rootStore:e,{events:r,dataRef:o}=n.context,{enabled:l=!0,visibleOnly:i=!0,delay:a}=t,s=x.useRef(!1),u=x.useRef(null),c=eB(),d=x.useRef(!0);x.useEffect(()=>{let e=n.select("domReferenceElement");if(!l)return;let t=e4(e);function r(){let e=n.select("domReferenceElement");!n.select("open")&&e7(e)&&e===nQ(n5(e))&&(s.current=!0)}function o(){d.current=!0}function i(){d.current=!1}return t.addEventListener("blur",r),l7&&(t.addEventListener("keydown",o,!0),t.addEventListener("pointerdown",i,!0)),()=>{t.removeEventListener("blur",r),l7&&(t.removeEventListener("keydown",o,!0),t.removeEventListener("pointerdown",i,!0))}},[n,l]),x.useEffect(()=>{if(l)return r.on("openchange",e),()=>{r.off("openchange",e)};function e(e){if(e.reason===n8||e.reason===rr){let e=n.select("domReferenceElement");e8(e)&&(u.current=e,s.current=!0)}}},[r,l,n]);let p=x.useMemo(()=>({onMouseLeave(){s.current=!1,u.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(u.current===t)return;s.current=!1,u.current=null}let r=n1(e.nativeEvent);if(i&&e8(r)){if(l7&&!e.relatedTarget){if(!d.current&&!n4(r))return}else if(!function(e){if(!e||tO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}(r))return}let o=e.relatedTarget&&n.context.triggerElements.hasElement(e.relatedTarget),{nativeEvent:l,currentTarget:p}=e,f="function"==typeof a?a():a;if(n.select("open")&&o||0===f||void 0===f)return void n.setOpen(!0,tY(n9,l,p));c.start(f,()=>{s.current||n.setOpen(!0,tY(n9,l,p))})},onBlur(e){s.current=!1,u.current=null;let t=e.relatedTarget,r=e.nativeEvent,l=e8(t)&&t.hasAttribute(nz("focus-guard"))&&"outside"===t.getAttribute("data-type");c.start(0,()=>{var e;let i=n.select("domReferenceElement"),a=nQ(i?i.ownerDocument:document);if(!t&&a===i||n0(null==(e=o.current.floatingContext)?void 0:e.refs.floating.current,a)||n0(i,a)||l)return;let s=t??a;if(e8(s)){let e=n.context.triggerElements;if(e.hasElement(s)||e.hasMatchingElement(e=>n0(e,s)))return}n.setOpen(!1,tY(n9,r))})}}),[o,n,i,c,a]);return x.useMemo(()=>l?{reference:p,trigger:p}:{},[l,p])}(y,{enabled:!P&&$}),z=function(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,o=x.useRef(!1);return x.useMemo(()=>t?{onMouseDown:e=>{("open"===n&&!r||"close"===n&&r)&&(o.current=!0,tR(e.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:e=>{o.current&&(o.current=!1,e.preventBaseUIHandler())}}:tT,[t,n,r])}({open:b,enabled:C,mouseDownAction:"open"}),K=rW([B,U]),W=x.useMemo(()=>({disabled:P,open:b}),[P,b]),H=h.useState("triggerProps",I),V=[A,t,M,R,w],_=[K.getReferenceProps(),F??tT,H,{"aria-haspopup":"menu",id:g,onMouseDown:e=>{h.select("open")||(L.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),tR(e.currentTarget).addEventListener("mouseup",D,{once:!0}))}},C?{role:"menuitem"}:{},z,f,N],Y=x.useRef(null),X=eK(e=>{eN.flushSync(()=>{h.setOpen(!1,tY(rn,e.nativeEvent,e.currentTarget))});let t=oT(Y.current,-1);null==t||t.focus()}),G=eK(e=>{var t;let n=h.select("positionerElement");if(n&&oP(e,n))null==(t=h.context.beforeContentFocusGuardRef.current)||t.focus();else{eN.flushSync(()=>{h.setOpen(!1,tY(rn,e.nativeEvent,e.currentTarget))});let t=oT(h.context.triggerFocusTargetRef.current||w.current,1);for(;null!==t&&n0(n,t);){let e=t;if((t=oI(t))===e)break}null==t||t.focus()}}),J=r9("button",e,{enabled:!C,stateAttributesMapping:lg,state:W,ref:V,props:_});return C?(0,l.jsx)(l5,{tag:"button",render:n,className:r,state:W,refs:V,props:_,stateAttributesMapping:lg}):b?(0,l.jsxs)(x.Fragment,{children:[(0,l.jsx)(r4,{ref:Y,onFocus:X},`${g}-pre-focus-guard`),(0,l.jsx)(x.Fragment,{children:J},g),(0,l.jsx)(r4,{ref:h.context.triggerFocusTargetRef,onFocus:G},`${g}-post-focus-guard`)]}):(0,l.jsx)(x.Fragment,{children:J},g)}),ie=({children:e,open:t,onOpenChange:n})=>(0,l.jsx)(r1,{onOpenChange:n,open:t,children:e});ie.displayName="DropdownMenu";let it=({className:e,children:t,...n})=>(0,l.jsx)(l9,{className:(0,z.cn)("group group overflow-hidden rounded-lg disabled:pointer-events-none [&>span]:line-clamp-1","flex items-center gap-1 py-0.5 text-sm text-stone-950/50 group-hover:text-stone-950/70 dark:text-white/50 dark:group-hover:text-white/70",e),...n,children:t});it.displayName="DropdownMenuTrigger";let ir=({className:e,sideOffset:t=4,align:n="start",...r})=>(0,l.jsx)(o$,{children:(0,l.jsx)(lE,{align:n,className:"z-50",collisionPadding:16,sideOffset:t,children:(0,l.jsx)(lY,{className:(0,z.cn)("relative max-h-96 min-w-(--anchor-width) overflow-y-auto rounded-2xl border-standard bg-white p-1 text-stone-950/70 shadow-stone-500/5 shadow-xl dark:bg-stone-950 dark:text-white/70 dark:shadow-none dark:shadow-stone-500/5","data-[ending-style]:fade-out-0 data-[starting-style]:fade-in-0 data-[ending-style]:zoom-out-95 data-[starting-style]:zoom-in-95",e),style:{textRendering:"geometricPrecision"},...r})})});ir.displayName="DropdownMenuContent";let io=({className:e,isSelected:t,children:n,onSelect:r,onClick:o,...i})=>(0,l.jsxs)(l2,{className:(0,z.cn)("group relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-md px-2 py-1 text-sm outline-0 hover:bg-stone-950/3 focus:bg-stone-950/5 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50 dark:focus:bg-white/5 dark:hover:bg-white/3",t?"font-medium text-primary dark:text-primary-light":"text-stone-950/50 hover:text-stone-950/75 focus:text-stone-950/75 dark:text-white/50 dark:focus:text-white/75 dark:hover:text-white/75",e),onClick:e=>{null==o||o(e),null==r||r()},...i,children:[n,(0,l.jsx)(eP,{className:(0,z.cn)("size-3.5 shrink-0 text-primary dark:text-primary-light",!t&&"opacity-0"),strokeWidth:2.5})]});io.displayName="DropdownMenuItem";var il=e.i(855830);let ii=({options:e,selectedIndex:t,onSelectOption:n,className:r})=>{let o=e.length>1,i=e[t];return(0,l.jsx)("div",{className:(0,y.cn)("relative flex items-center px-2 py-0.5 text-gray-600 dark:text-gray-300 hover:text-gray-950 dark:hover:text-white font-medium",r),children:(0,l.jsxs)(ie,{children:[(0,l.jsx)(it,{disabled:!o,className:"font-mono text-xs text-gray-600 dark:text-gray-300 hover:text-gray-950 dark:hover:text-white px-2",children:(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("span",{children:null==i?void 0:i.label}),o&&(0,l.jsx)(il.ChevronDownIcon,{className:"h-2.5 w-2.5 text-gray-500 dark:text-gray-400 shrink-0"})]})}),(0,l.jsx)(ir,{className:"min-w-24",align:"end",children:e.map((e,r)=>(0,l.jsx)(io,{isSelected:r===t,onSelect:()=>n(r),className:"text-xs rounded-xl",children:e.label},r))})]})})},ia=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n,fieldType:r="response"})=>{var o,i,a,s;let u=(0,b.useLocaleStrings)(),[c,d]=(0,x.useState)(0),{selectedResponseContentTypeIndex:p,setSelectedResponseContentTypeIndex:f}=(0,eR.useSelectedResponseContentType)(),m=(0,x.useRef)(e.operation),h=(0,x.useMemo)(()=>{var t,n;return null!=(n=null==(t=e.dependencies)?void 0:t.responses)?n:{}},[null==(o=e.dependencies)?void 0:o.responses]),g=null==(i=e.dependencies)?void 0:i.schemas,v=(0,x.useMemo)(()=>{var t;let n=null==(t=e.operation)?void 0:t.responses;return n?Object.entries(n).map(([e,t])=>{var n;let r=h[t];return[e,null!=(n=null==r?void 0:r.content)?n:{}]}):[]},[h,null==(a=e.operation)?void 0:a.responses]);(0,x.useEffect)(()=>{m.current!==e.operation?(m.current=e.operation,d(0)):c>=v.length&&v.length>0&&d(0)},[e.operation,v.length,c]);let w=(0,x.useMemo)(()=>{let e=v[c];return e&&e[1]?Object.entries(e[1]):[]},[v,c]),j=(0,x.useCallback)(e=>{d(e);let t=v[e];t&&t[1]&&p>=Object.entries(t[1]).length&&f(0)},[v,p,d,f]),S=(0,x.useCallback)(e=>{f(e)},[f]),{contentType:E,schema:k,description:I}=(0,x.useMemo)(()=>{var t,n;let r=w[p];if(!r)return{contentType:void 0,schema:void 0,description:void 0};let[o,l]=r,i=l.schema,a=v[c],s=a?String(a[0]):void 0,u=s?null==(n=null==(t=e.operation)?void 0:t.responses)?void 0:n[s]:void 0,d=u?h[u]:void 0,f=null==d?void 0:d.description;return"_mintlify/placeholder"===o?{schema:i,contentType:"",description:f}:{schema:i,contentType:o,description:f}},[w,p,v,c,h,null==(s=e.operation)?void 0:s.responses]),C=k?[k]:[];C.some(e=>(0,R.isSchemaObject)(e)&&"null"===e.type)&&(C=C.filter(e=>!(0,R.isSchemaObject)(e)||"null"!==e.type));let T=(0,R.generateSchemaOptionLabels)(C),P=v.map(([e,t])=>({label:String(e),schema:t})),N=w.filter(([e])=>"_mintlify/placeholder"!==e).map(([e,t])=>({label:String(e),schema:t})),M=v[0]?`${v[0][0]}`:"",A=""===E?"":`${E}`,L=`${M}${M&&A?" - ":""}${A}`,D=v.length>1,$=w.length>1,F=D||$;return(0,l.jsxs)("div",{className:"api-section",children:[(0,l.jsx)(ej.SectionHeading,{title:u["api.response"],subtitle:I,rightElement:F?(0,l.jsxs)("div",{className:"flex items-center gap-x-3 font-mono text-xs",children:[(0,l.jsx)(ii,{onSelectOption:j,options:P,selectedIndex:c,className:(0,y.cn)("bg-transparent dark:bg-transparent",D&&"hover:text-zinc-950 dark:hover:text-white transition-all")}),(0,l.jsx)(ii,{onSelectOption:S,options:N,selectedIndex:p,className:(0,y.cn)("bg-transparent dark:bg-transparent",$&&"hover:text-zinc-950 dark:hover:text-white transition-all")})]}):L,children:T[0]&&T[0].includes(O.orNullTypeString)&&(0,l.jsx)("div",{children:(0,l.jsx)(eO,{className:"max-w-fit text-xs font-medium font-mono break-words",children:T[0]})})}),C.length>1?(0,l.jsx)(Q,{children:C.map((e,o)=>{var i;return(0,l.jsx)(Q.Item,{title:null!=(i=T[o])?i:"",children:(0,R.isSchemaObject)(e)&&(0,l.jsx)(ed,{schema:e,fieldType:r,displayFlattened:!0,schemas:g,isTopLevel:!0,defaultExpanded:t,isLivePreview:n})},o)})}):C[0]&&(0,R.isSchemaObject)(C[0])?(0,l.jsx)(ed,{schema:C[0],fieldType:r,displayFlattened:!0,omitPadding:!0,schemas:g,isTopLevel:!0,defaultExpanded:t,isLivePreview:n}):null]})},is=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{var r;let o=(0,b.useLocaleStrings)(),i=null==(r=e.dependencies)?void 0:r.callbacks;return i&&0!==i.length?(0,l.jsxs)("div",{className:"api-section pb-6",children:[(0,l.jsx)(ej.SectionHeading,{title:o["api.callbacks"],withPadding:!0}),(0,l.jsx)("div",{className:"flex flex-col gap-y-3",children:i.map((e,r)=>(0,l.jsx)(iu,{callback:e,index:r,defaultExpanded:t,isLivePreview:n},`${e.callbackName}-${e.expression}-${e.method}-${r}`))})]}):null};function iu({callback:e,index:t,defaultExpanded:n,isLivePreview:r}){var o,i;let a=`callback-${t}-`,[s,u]=(0,x.useState)(null!=n&&n),c=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=()=>{window.location.hash.substring(1).startsWith(a)&&(c.current&&(c.current.open=!0),u(!0))};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[a]);let d=(0,x.useMemo)(()=>{var t;return{operation:Object.assign(Object.assign({},e.resolved.operation),{path:e.expression,baseUrlOptions:[],title:e.callbackName,description:null!=(t=e.resolved.operation.description)?t:""}),dependencies:Object.assign(Object.assign({},e.resolved.dependencies),{schemas:e.resolved.schemas,servers:{},security:{}})}},[e]),p=!!(null==(o=d.dependencies)?void 0:o.requestBody),f=(null==(i=d.dependencies)?void 0:i.responses)&&Object.keys(d.dependencies.responses).length>0;return p||f?(0,l.jsxs)("details",{ref:c,className:"rounded-xl border-standard",open:s,onToggle:e=>u(e.currentTarget.open),children:[(0,l.jsxs)("summary",{className:(0,y.cn)("not-prose flex w-full cursor-pointer items-center gap-x-2 px-3.5 py-3","list-none [&::-webkit-details-marker]:hidden","text-sm text-stone-600 hover:bg-stone-50/50 hover:text-stone-900","dark:text-stone-300 dark:hover:bg-white/5 dark:hover:text-stone-200","rounded-t-xl",!s&&"rounded-b-xl"),children:[(0,l.jsx)("span",{className:(0,y.cn)("inline-block size-2.5 bg-stone-400 transition-transform",s&&"rotate-90"),style:{WebkitMaskImage:"url(https://d3gk2c5xim1je2.cloudfront.net/v7.1.0/regular/angle-right.svg)",WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center",WebkitMaskSize:"contain",maskImage:"url(https://d3gk2c5xim1je2.cloudfront.net/v7.1.0/regular/angle-right.svg)",maskRepeat:"no-repeat",maskPosition:"center",maskSize:"contain"}}),(0,l.jsx)(ek.MethodPill,{method:e.method}),(0,l.jsx)("span",{className:"font-mono text-sm",children:e.expression}),(0,l.jsx)("span",{className:"ml-auto text-xs text-stone-400",children:e.callbackName})]}),(0,l.jsx)("div",{className:"mx-3 border-t border-stone-100 px-2 dark:border-white/10",children:(0,l.jsx)(eE.ContentTypeOverrideProvider,{children:(0,l.jsxs)("div",{className:"flex flex-col gap-y-4 pb-4",children:[p&&(0,l.jsx)(X.EndpointLocationProvider,{location:"request",children:(0,l.jsx)(eS,{apiReferenceData:d,defaultExpanded:n,isLivePreview:r,fieldType:`callback-${t}-body`})}),f&&(0,l.jsx)(X.EndpointLocationProvider,{location:"response",children:(0,l.jsx)(ia,{apiReferenceData:d,defaultExpanded:n,isLivePreview:r,fieldType:`callback-${t}-response`})})]})})})]}):null}let ic=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{var r,o,i,a,s,u;let c=(0,b.useLocaleStrings)(),d=(0,x.useMemo)(()=>{var t,n;return null!=(n=null==(t=e.dependencies)?void 0:t.parameters)?n:{}},[null==(r=e.dependencies)?void 0:r.parameters]),p=null==(o=e.dependencies)?void 0:o.schemas,f=(0,x.useMemo)(()=>{let e={header:{},path:{},query:{},cookie:{}};return Object.entries(d).forEach(([t,n])=>{let r=n.in;r in e&&e[r]&&(e[r][n.name]=n)}),e},[d]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(id,{title:c["api.headers"],parameters:null!=(i=f.header)?i:{},schemas:p,defaultExpanded:t,isLivePreview:n}),(0,l.jsx)(id,{title:c["api.pathParameters"],parameters:null!=(a=f.path)?a:{},schemas:p,defaultExpanded:t,isLivePreview:n}),(0,l.jsx)(id,{title:c["api.queryParameters"],parameters:null!=(s=f.query)?s:{},schemas:p,defaultExpanded:t,isLivePreview:n}),(0,l.jsx)(id,{title:c["api.cookies"],parameters:null!=(u=f.cookie)?u:{},schemas:p,defaultExpanded:t,isLivePreview:n})]})},id=({parameters:e,title:t,schemas:n,defaultExpanded:r,isLivePreview:o})=>{if(0===Object.keys(e).length)return null;let i=Object.entries(e).map(([e,t])=>t.schema&&(0,R.isSchemaObject)(t.schema)?(0,l.jsx)(ed,{schema:t.schema,fieldType:"parameter",name:t.name,style:t.style,explode:t.explode,required:t.required,schemas:n,defaultExpanded:r,isLivePreview:o},t.name):null);return(0,l.jsxs)("div",{className:"api-section",children:[(0,l.jsx)(ej.SectionHeading,{title:t}),i]})};var ip=e.i(298618);let im=({apiReferenceData:e})=>{var t;let n=(0,b.useLocaleStrings)(),{selectedSecurityOptionIndex:r,setSelectedSecurityOptionIndex:o}=(0,ip.useSelectedSecurityOption)(),i=null==(t=e.dependencies)?void 0:t.processedSecurityOptions;if(!i)return null;let a=i[r];if(!a)return null;let s=[];if(a.schemes.forEach(({scheme:e,schema:t,name:n})=>{if("apiKey"===e.type&&"name"in e&&"in"in e)s.push((0,l.jsx)(eu,{fieldType:"authorization",schema:t,typeOptions:["string"],name:n,location:e.in},`${e.in}:${e.name}`));else if("http"===e.type&&"scheme"in e)if("basic"===e.scheme){let e=Object.assign(Object.assign({},t),{type:"string"});s.push((0,l.jsx)(eu,{fieldType:"authorization",schema:e,typeOptions:["string"],name:n,location:"header"},`header:${t.title}`))}else"bearer"===e.scheme&&s.push((0,l.jsx)(eu,{fieldType:"authorization",schema:t,typeOptions:["string"],name:n,location:"header"},`header:${t.title}`));else"oauth2"===e.type&&s.push((0,l.jsx)(eu,{fieldType:"authorization",schema:t,typeOptions:["string"],name:n,location:"header"},`header:${t.title}`))}),0===s.length)return null;let u=i.map(e=>e.title);return(0,l.jsxs)("div",{className:"api-section",children:[(0,l.jsx)(ej.SectionHeading,{title:n["api.authorizations"],options:u,selectedIndex:r,onSelectOption:o}),s]})},ih=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{let{dependencies:r}=e,o=(null==r?void 0:r.processedSecurityOptions)&&r.processedSecurityOptions.length>0,i=(null==r?void 0:r.parameters)&&Object.keys(r.parameters).length>0,a=null==r?void 0:r.requestBody,s=(null==r?void 0:r.responses)&&Object.keys(r.responses).length>0,u=(null==r?void 0:r.callbacks)&&r.callbacks.length>0;return(0,l.jsxs)(l.Fragment,{children:[o&&(0,l.jsx)(im,{apiReferenceData:e}),i&&(0,l.jsx)(ic,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n}),a&&(0,l.jsx)(X.EndpointLocationProvider,{location:"request",children:(0,l.jsx)(eS,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n})}),u&&(0,l.jsx)(is,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n}),s&&(0,l.jsx)(X.EndpointLocationProvider,{location:"response",children:(0,l.jsx)(ia,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n})})]})};var ig=e.i(703352),iv=e.i(864823),iy=e.i(108153),ix=e.i(505145),ib=e.i(510248),iw=e.i(541837);let ij=({baseUrlOptions:e,selectedBaseUrlIndex:t,setSelectedBaseUrlIndex:n,display:r,path:o,method:i,type:a,onBaseUrlChange:s,urlDisplay:u,isInPlaygroundModal:c})=>{var d;let[p,f]=(0,x.useState)(!1),m=(0,b.useLocaleStrings)(),h=(({path:e,baseUrl:t})=>{let n=(0,iv.usePlaygroundInputsStore)(e=>e.getApiPlaygroundInputs)(),r=(0,ig.addPathParams)(e,n.path);return(0,ig.joinWithSingleSlash)((0,ig.addServerVariables)(t,n.server),r)})({path:o,baseUrl:null!=(d=e[t])?d:""}),g=()=>(function(e,t,n,r){return new(n||(n=Promise))(function(o,l){function i(e){try{s(r.next(e))}catch(e){l(e)}}function a(e){try{s(r.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(i,a)}s((r=r.apply(e,t||[])).next())})})(void 0,void 0,void 0,function*(){let e="webhook"!==a||o.startsWith("/")?h:o;"success"===(yield(0,iy.copyToClipboard)(e))&&(f(!0),setTimeout(()=>{f(!1)},2e3))});return(0,l.jsxs)("div",{className:(0,y.cn)("group relative flex-1 flex gap-2 min-w-0 rounded-xl items-center cursor-pointer p-1.5 pr-0 overflow-hidden","simple"!=r&&"border-standard",c&&"bg-gray-50 dark:bg-white/5"),onClick:g,children:[(0,l.jsx)(ek.MethodPill,{method:"webhook"===a?"webhook":i,active:!1}),(0,l.jsxs)(ix.ScrollArea,{className:"flex-1",children:[(0,l.jsx)(ix.ScrollAreaViewport,{className:"overflow-y-hidden! [--scroll-area-fade-size:16px]",fade:["left"],children:(0,l.jsxs)(ix.ScrollAreaContent,{className:"flex items-center space-x-2 pr-8",children:[(0,l.jsx)(ib.BasePathSelector,{baseUrlOptions:e,selectedBaseUrlIndex:t,setSelectedBaseUrlIndex:n,onBaseUrlChange:s,urlDisplay:u,selectBaseUrlAriaLabel:m["aria.selectBaseUrl"]}),(0,l.jsx)(iw.PrettyPath,{path:o,method:i})]})}),(0,l.jsx)(ix.ScrollAreaScrollbar,{orientation:"horizontal",className:"-mb-[5px]",onClick:e=>e.stopPropagation()})]}),(0,l.jsx)(iw.EndpointCopyButton,{isCopiedActive:p,hasGrayBackground:c,onCopy:g,copyAriaLabel:m["tooltip.copy"],copiedStatusText:m.copied})]})};var iS=e.i(215371);let iE=({apiReferenceData:e,pageMetadata:t,docsConfig:n,isLivePreview:r,docsConfigOverrides:o,userGroups:i,localeStrings:a=ev.DEFAULT_LOCALE_STRINGS,markdownComponents:s,mdxRequestExampleData:u,mdxResponseExampleData:c,isChatSheetOpen:d,codeComponents:p,Playground:f,className:m,readOnly:h,ReadOnlyWrapper:g,children:v})=>{var b,j,E,O,R,I,C,T,P,N;let M=null==e?void 0:e.operation,A=(null==t?void 0:t.mode)==="custom",L=(null==t?void 0:t.mode)==="frame",D=(null!=(E=null==(j=null==(b=null==o?void 0:o.api)?void 0:b.params)?void 0:j.expanded)?E:null==(R=null==(O=null==n?void 0:n.api)?void 0:O.params)?void 0:R.expanded)==="all",$=null!=(T=null==(C=null==(I=null==o?void 0:o.api)?void 0:I.params)?void 0:C.post)?T:null==(N=null==(P=null==n?void 0:n.api)?void 0:P.params)?void 0:N.post,F=(0,ex.getApiPlaygroundDisplay)({pageMetadata:t,docsConfig:n,isLivePreview:r,docsConfigOverrides:o,apiReferenceData:e,userGroups:i}),[q,B]=(0,x.useState)(!1),U="none"===F,z="simple"===F,{selectedBaseUrlIndex:K,setSelectedBaseUrlIndex:W,baseUrl:H}=(0,ey.useSelectedBaseUrl)();(0,x.useEffect)(()=>{new URLSearchParams(window.location.search).has("playground")&&requestAnimationFrame(()=>{B(!0)})},[]);let V=e=>{if(B(e),e){let e=new URL(window.location.href);e.searchParams.set("playground","open"),window.history.replaceState({},"",e)}else{let e=new URL(window.location.href);e.searchParams.delete("playground"),window.history.replaceState({},"",e)}};if(!M)return null;let{path:_,method:Y,baseUrlOptions:X,type:G,urlDisplay:J}=M,Z=(null==t?void 0:t.openapi)&&M,Q=h&&g?g:x.default.Fragment;return(0,l.jsx)(k.ReadOnlyProvider,{value:null!=h&&h,children:(0,l.jsx)(ev.LocalizationProvider,{localeStrings:a,children:(0,l.jsx)(S,{value:{post:$},children:(0,l.jsx)(w.MarkdownProvider,{markdownComponents:s,children:(0,l.jsxs)(eg.Provider,{value:{isPlaygroundExpanded:q,setIsPlaygroundExpanded:V},children:[(0,l.jsxs)("div",{className:(0,y.cn)("flex flex-col gap-8 isolate",m),id:"api-playground-2-operation-page",children:[(0,l.jsx)(em.default,{children:(0,l.jsxs)("div",{className:(0,y.cn)(!U&&"mt-6","flex w-full flex-col space-y-4"),children:[U?null:(0,l.jsx)(Q,{children:(0,l.jsx)(em.default,{children:(0,l.jsx)("div",{className:(0,y.cn)("flex flex-col bg-background-light dark:bg-background-dark border-standard rounded-2xl p-1.5","simple"===F?"p-1":"p-1.5",h?"mx-7":"w-full",h&&"pointer-events-none"),children:(0,l.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,l.jsx)(ij,{baseUrlOptions:X,selectedBaseUrlIndex:K,setSelectedBaseUrlIndex:W,display:F,path:_,method:Y,type:G,onBaseUrlChange:()=>{},isInPlaygroundModal:!1,urlDisplay:J}),z?null:(0,l.jsx)(iS.SendPill,{label:a.tryIt,sendingRequestAriaLabel:a["aria.sendingRequest"],method:Y,onClick:()=>{f&&!h&&V(!0)}})]})})})}),!h&&(0,l.jsx)(em.default,{children:(0,l.jsx)("div",{className:"mt-8 lg:mt-0 flex flex-col gap-6 max-h-[30rem] print:max-h-none [html:not([data-assistant-state=open])_&]:xl:hidden",children:(0,l.jsx)(eb.ApiExamples,{codeComponents:p,openApiReferenceData:e,apiPlaygroundDisplay:F,mdxRequestExampleData:u,mdxResponseExampleData:c,isChatSheetOpen:d})})})]})}),(0,l.jsx)(em.default,{children:(0,l.jsxs)("div",{className:(0,y.cn)("mdx-content","@container/columns-container relative",!A&&!L&&"prose prose-gray dark:prose-invert"),children:[v,Z&&(0,l.jsx)(Q,{children:(0,l.jsx)("div",Object.assign({className:(0,y.cn)("mb-14",!A&&!L&&"prose prose-gray dark:prose-invert",h&&"mx-7")},h&&{"data-block-selection-ignore":"true"},{children:(0,l.jsx)(ih,{apiReferenceData:e,defaultExpanded:D,isLivePreview:r})}))})]})})]}),!U&&!z&&f&&(0,l.jsx)(em.default,{children:(0,l.jsx)(f,{isPlaygroundExpanded:q,setIsPlaygroundExpanded:V,baseUrl:H,baseUrlOptions:X,apiReferenceData:e})})]})})})})})};var ik=e.i(256349),iO=e.i(456542),iR=e.i(165592),iI=e.i(560060),iC=e.i(854472),iT=e.i(665291),iP=e.i(87390),iN=e.i(888076),iM=e.i(912710);let iA={store:iM.storeEncrypted,load:iM.loadEncrypted};var iL=e.i(768834),iD=e.i(307080);let i$="mintlify-server-variables",iF=()=>{let e=localStorage.getItem(i$);if(e)try{let t=JSON.parse(e);if((e=>"object"==typeof e&&null!=e&&Object.values(e).every(e=>"object"==typeof e&&null!==e&&Object.values(e).every(e=>"string"==typeof e)))(t))return t}catch(e){console.log(`unable to parse stored server variables: ${e}`)}return{}};var iq=function(e,t,n,r){return new(n||(n=Promise))(function(o,l){function i(e){try{s(r.next(e))}catch(e){l(e)}}function a(e){try{s(r.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(i,a)}s((r=r.apply(e,t||[])).next())})};let iB=(0,iL.create)((e,t)=>({locallyStoredCredentials:void 0,setLocallyStoredCredentials:t=>e({locallyStoredCredentials:t}),locallyStoredServerVariables:void 0,setLocallyStoredServerVariables:t=>e({locallyStoredServerVariables:t}),syncCredentialsState:()=>{let{inputs:n,apiReferenceData:r,selectedSecurityOptionIndex:o}=iv.usePlaygroundInputsStore.getState(),{locallyStoredCredentials:l}=t();r&&void 0!==l&&e({locallyStoredCredentials:iU(n,r,o,l)})},syncServerVariablesState:()=>{var n,r,o;let{inputs:l,apiReferenceData:i,selectedBaseUrlIndex:a}=iv.usePlaygroundInputsStore.getState(),{locallyStoredServerVariables:s}=t();if(!i)return;let u=(0,R.unflattenInputs)(l),c=null==(n=i.operation)?void 0:n.userInfoPlaygroundInputs,d=Object.assign(Object.assign({},null==c?void 0:c.server),u.server),p=null!=(o=null==(r=i.operation)?void 0:r.baseUrlOptions[a])?o:"";e({locallyStoredServerVariables:Object.assign(Object.assign({},null!=s?s:{}),{[p]:d})})},updateLocalStorage:e=>void iq(void 0,void 0,void 0,function*(){let{apiReferenceData:t,selectedBaseUrlIndex:n,inputs:r,selectedSecurityOptionIndex:o}=iv.usePlaygroundInputsStore.getState();yield iz({apiReferenceData:t,selectedBaseUrlIndex:n,inputs:r,selectedSecurityOptionIndex:o,storage:e})})})),iU=(e,t,n,r)=>{var o,l;let i=(0,R.unflattenInputs)(e),a=null==(l=null==(o=t.dependencies)?void 0:o.processedSecurityOptions)?void 0:l[n],s={query:Object.assign({},null==r?void 0:r.query),header:Object.assign({},null==r?void 0:r.header),cookie:Object.assign({},null==r?void 0:r.cookie)};if(a)for(let e of"schemes"in a?a.schemes:[a]){let t=e.name,n="in"in e.scheme?e.scheme.in:"header",r=i[n][t];void 0!==r&&(s[n][t]=r)}return s},iz=e=>iq(void 0,[e],void 0,function*({apiReferenceData:e,selectedBaseUrlIndex:t,inputs:n,selectedSecurityOptionIndex:r,storage:o}){var l,i,a;let s=null==(l=null==e?void 0:e.operation)?void 0:l.userInfoPlaygroundInputs,u=(0,R.unflattenInputs)(n),c=iF(),d=Object.assign(Object.assign({},null==s?void 0:s.server),u.server),p=null!=(a=null==(i=null==e?void 0:e.operation)?void 0:i.baseUrlOptions[t])?a:"",f=JSON.stringify(Object.assign(Object.assign({},c),{[p]:d}));localStorage.setItem(i$,f);let m=yield(0,iD.loadCredentialStore)(o),h=e?iU(n,e,r,m):m;yield o.store(iD.CREDENTIALS_LOCALSTORAGE_KEY,h)});var iK=e.i(407859);function iW({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r,selectedContentTypeIndex:o,locallyStoredCredentials:l,serverInputs:i}){var a;let s=null==(a=e.operation)?void 0:a.userInfoPlaygroundInputs,u=(0,iK.getExternalApiPlaygroundServerInputs)();return iH({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r,selectedContentTypeIndex:o,mergedUserInfo:{server:Object.assign(Object.assign(Object.assign({},null==s?void 0:s.server),i),u),header:Object.assign(Object.assign({},null==s?void 0:s.header),null==l?void 0:l.header),query:Object.assign(Object.assign({},null==s?void 0:s.query),null==l?void 0:l.query),cookie:Object.assign(Object.assign({},null==s?void 0:s.cookie),null==l?void 0:l.cookie),path:Object.assign({},null==s?void 0:s.path)}})}let iH=({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r=0,selectedContentTypeIndex:o=0,mergedUserInfo:l})=>{var i,a,s,u,c,d,p,f,m,h;let g={},v=null==(i=e.operation)?void 0:i.prefillPlaygroundWithExample,y=(null!=(s=null==(a=e.operation)?void 0:a.prefillPlaygroundExamples)?s:[])[r],x=null==(d=Object.values(null!=(c=null==(u=e.dependencies)?void 0:u.servers)?c:{})[t])?void 0:d.variables,b=null==(p=e.dependencies)?void 0:p.processedSecurityOptions,w=null==b?void 0:b[n],j=null==(f=e.dependencies)?void 0:f.parameters,S=null==(m=e.dependencies)?void 0:m.requestBody;if(v&&y)g=Object.assign(Object.assign(Object.assign(Object.assign({},iV(x)),i_(w)),iY({apiReferenceData:e,parameters:j})),y);else if((null==S?void 0:S.exampleType)==="examples")g=Object.assign(Object.assign(Object.assign({},iV(x)),i_(w)),iY({apiReferenceData:e,parameters:j}));else{let t=null==(h=e.operation)?void 0:h.requiredOnlyExamples;g=Object.assign(Object.assign(Object.assign(Object.assign({},iV(x)),i_(w)),iY({apiReferenceData:e,parameters:j})),t?{}:function({requestBody:e,apiReferenceData:t,selectedContentTypeIndex:n}){var r;let o={};if(!e)return o;let l=(0,R.getRequestBodyContentType)(t,n);if(l){let t=null==(r=e.content[l])?void 0:r.schema,n=(0,R.getSchemaDefault)(t);if(n)o[`${O.apiPlaygroundInputKeys.body}`]=n;else if((0,R.isSchemaObject)(t)){let e=(0,R.getBodyDefaultsFromSchema)(t);return Object.assign(Object.assign({},o),e)}}return o}({requestBody:S,apiReferenceData:e,selectedContentTypeIndex:o}))}return l&&(g=Object.assign(Object.assign({},g),function({mergedUserInfo:e,securityOption:t,serverVariables:n,apiReferenceData:r}){var o,l,i;let a={};if(t){let n={};t.schemes.forEach(({scheme:e,name:t})=>{n[t]=e}),Object.entries(null!=(o=e.header)?o:{}).forEach(([e,t])=>{let r=n[e];r&&((0,R.isBasicAuth)(r)?("object"==typeof t&&null!==t&&"username"in t&&"string"==typeof t.username&&(a[`${O.apiPlaygroundInputKeys.header}.Authorization.username`]=t.username),"object"==typeof t&&null!==t&&"password"in t&&"string"==typeof t.password&&(a[`${O.apiPlaygroundInputKeys.header}.Authorization.password`]=t.password)):"string"==typeof t&&(a[`${O.apiPlaygroundInputKeys.header}.${(0,R.escapeDots)(e)}`]=t))}),Object.entries(null!=(l=e.query)?l:{}).forEach(([e,t])=>{n[e]&&(a[`${O.apiPlaygroundInputKeys.query}.${(0,R.escapeDots)(e)}`]=t)}),Object.entries(null!=(i=e.cookie)?i:{}).forEach(([e,t])=>{n[e]&&(a[`${O.apiPlaygroundInputKeys.cookie}.${(0,R.escapeDots)(e)}`]=t)})}if(n&&Object.keys(n).length>0&&e.server&&Object.entries(e.server).forEach(([e,t])=>{n[e]&&(a[`${O.apiPlaygroundInputKeys.server}.${(0,R.escapeDots)(e)}`]=t)}),e.path&&Object.keys(e.path).length>0){let{path:t}=(0,R.getParametersPerSection)(r),n=new Set(t.map(e=>e.name));Object.entries(e.path).forEach(([e,t])=>{n.has(e)&&(a[`${O.apiPlaygroundInputKeys.path}.${(0,R.escapeDots)(e)}`]=t)})}return a}({mergedUserInfo:l,securityOption:w,serverVariables:x,apiReferenceData:e}))),g};function iV(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=`${O.apiPlaygroundInputKeys.server}.${(0,R.escapeDots)(e)}`;if("object"==typeof n&&null!==n){let e=(0,R.getSchemaDefault)(n);e&&(t[r]=e)}}),t}function i_(e){let t={};return e&&e.schemes.forEach(({scheme:e,schema:n,name:r})=>{let o=(0,R.getSecurityOptionInputKeyPrefix)({scheme:e,name:r}),l=(0,R.getSchemaDefault)(n);l&&"string"==typeof l&&(t[o]=l),l&&"object"==typeof l&&(t[o+".username"]="username"in l&&"string"==typeof l.username?l.username:"",t[o+".password"]="password"in l&&"string"==typeof l.password?l.password:"")}),t}function iY({apiReferenceData:e,parameters:t}){let n={};if(!t)return n;let{header:r,path:o,query:l,cookie:i}=(0,R.getParametersPerSection)(e);return[...r,...o,...l,...i].forEach(e=>{if(e.schema){let t=`${(0,R.mapParamInToPlaygroundInputKey)(e.in)}.${(0,R.escapeDots)(e.name)}`,r=(0,R.getSchemaDefault)(e.schema);r&&(n[t]=r)}}),n}var iX=e.i(167057),iG=e.i(979691),iJ=e.i(420078);e.i(45082);var iZ=e.i(963899),iQ=e.i(25871),i0=e.i(346944);let i1=({name:e,schema:t,clearValue:n,parentNames:r,style:o,explode:i,inputKeyPrefix:a,arrayIndices:s,isArrayChild:u,isBody:c,onChangeCallback:d,defaultExpanded:p,depth:f})=>{let m="oneOf"in t&&t.oneOf?t.oneOf.filter(R.isSchemaObject):[],h=(0,R.generateSchemaOptionLabels)(m),g=m.map((e,t)=>({label:h[t]??(0,R.generateSimpleSchemaLabel)(e),schema:e})),v=(0,iv.usePlaygroundInputsStore)(e=>e.setInput),y=(0,iv.usePlaygroundInputsStore)(e=>e.deleteInput),b=(0,I.getUniqueInputKey)(a,t,s),w=`${b}.oneOf.`,j=(0,iv.usePlaygroundInputsStore)((0,i0.useShallow)(e=>{let t={};return Object.keys(e.inputs).forEach(n=>{n.startsWith(w)&&(t[n]=e.inputs[n])}),t})),S=(0,x.useMemo)(()=>{let e=Object.keys(j).find(e=>e.startsWith(w));if(e){let t=e.slice(w.length).match(/^(\d+)(?:\.|$)/);if(t&&t[1]){let e=parseInt(t[1],10);if(e>=0&&e{k(S)},[S]);let O=m[E],C=(0,iv.usePlaygroundInputsStore)(e=>e.setInputs),T=e=>{y(b);let t=m[e];if(t&&"type"in t&&"null"===t.type)v(b,null);else if(v(b,void 0),c&&t){let e=(0,R.getBodyDefaultsFromSchema)(t);Object.keys(e).length>0&&C(e)}k(e)};if(!O)return null;let P=m.every(e=>"object"===e.type||(0,R.isObjectArray)(e));if(!u&&P&&c){let t=(0,R.generateSchemaOptionLabels)(m);return(0,l.jsx)(iZ.Tabs,{defaultTabIndex:E,onClickTab:T,className:"border-gray-100! mb-4! dark:border-white/10!",children:t.map(t=>(0,l.jsx)(iQ.Tab,{title:t,children:(0,l.jsx)(aP,{skipContainer:!0,arrayIndices:s,name:e,schema:O,clearValue:n,parentNames:r,style:o,explode:i,inputKeyPrefix:a,onChangeCallback:d,defaultExpanded:p,depth:f})},t))})}let N=(0,l.jsx)(ii,{options:g,selectedIndex:E,onSelectOption:T});return(0,l.jsx)(aP,{name:e,schema:O,typeDropdown:N,clearValue:n,parentNames:r,style:o,explode:i,inputKeyPrefix:a,arrayIndices:s,isArrayChild:u,onChangeCallback:d,defaultExpanded:p,depth:f})},i2=({schema:e,...t})=>{let n=(0,x.useMemo)(()=>{let t=(0,R.convertAnySchemaToOneOfs)(),n=e.uniqueKey??"",{type:r,typeLabel:o,oneOf:l,uniqueKey:i,...a}=e;return{...e,oneOf:(t.oneOf??[]).filter(R.isSchemaObject).map((e,t)=>({...a,...e,uniqueKey:n?`${n}.oneOf.${t}`:`oneOf.${t}`}))}},[e]);return(0,l.jsx)(i1,{...t,schema:n})};var i5=e.i(579629),i4=e.i(422233);let i6=e=>{let t=(0,R.getDifferentiatedType)(e);if("object"!==t&&"array"!==t){let t=(0,R.getSchemaDefault)(e);if(void 0!==t)return t}switch(t){case"object":return{};case"array":return[];case"string":case"enum":return"";case"number":case"integer":case"enum":case"enum":return 0;case"boolean":return!1;case"enum":return(0,R.getBooleanEnumOptions)(e)[0]??!1;case"null":return null;case"oneOf":if(e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length>0){let t=e.oneOf[0];if((0,R.isSchemaObject)(t)&&"null"!==t.type)return i6(t);if(e.oneOf.length>1&&(0,R.isSchemaObject)(e.oneOf[1]))return i6(e.oneOf[1])}return;default:return}},i3=(e,t,n)=>{let r={};if(!e.properties)return r;for(let o of Object.values(e.properties))if((0,R.isSchemaObject)(o))if("object"===o.type)Object.assign(r,i3(o,t,n));else{let e=(0,R.getSchemaDefault)(o);void 0!==e&&(r[(0,I.getUniqueInputKey)(t,o,n)]=e)}return r},i8=({schema:e,depth:t,parentNames:n,inputKeyPrefix:r,arrayIndices:o,onChangeCallback:i,defaultExpanded:a})=>{let s=(0,d.useSelectedLocale)(),u=(0,iv.usePlaygroundInputsStore)(e=>e.setInputs),c=(0,iv.usePlaygroundInputsStore)(e=>e.deleteInput),p=(0,iv.usePlaygroundInputsStore)((0,i0.useShallow)(e=>e.inputs)),f=(0,i4.v4)(),m="items"in e&&(0,R.isSchemaObject)(e.items)?e.items:void 0;if(!m)return null;let h="uniqueKey"in m?m.uniqueKey:"",g=`${r}.${h}`;o?.forEach(e=>{g=g.replace("[INDEX]",String(e))}),g=g.replaceAll("[INDEX]","");let v=[];Object.keys(p).forEach(e=>{if(e.startsWith(g)){let t=e.substring(g.length).match(/^(\d+)/);if(t){let e=parseInt(t[1]??"0",10);v.includes(e)||v.push(e)}}}),v.sort((e,t)=>e-t);let x=v.length>0?Math.max(...v)+1:0;return(0,l.jsxs)(l.Fragment,{children:[v.map(e=>{let s=[...o??[],e],u=(0,I.getUniqueInputKey)(r,m,s);return(0,l.jsx)(aP,{schema:m,arrayIndices:s,depth:(t??0)+1,parentNames:n,inputKeyPrefix:r,clearValue:()=>{c(u)},isArrayChild:!0,onChangeCallback:i,defaultExpanded:a},`item-${e}`)}),(0,l.jsx)(i5.AdditionalItemButton,{label:s["api.addItem"],className:(0,y.cn)(v.length>0&&"mt-4"),onClick:()=>{let e=[...o??[],x],t=(0,I.getUniqueInputKey)(r,m,e);u({[t]:i6(m),...i3(m,r,e)})},dataTestId:g+"add-item-button"},"add-item-button"+f)]})},i7=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r})=>{let o=(0,d.useSelectedLocale)(),i=(0,x.useRef)(null),[a,s]=(0,x.useState)(!1),u=(0,R.getSchemaPlaceholder)(t)??"Drop a file here or click to upload",c=(0,I.getUniqueInputKey)(n,t,r),{value:p,setInput:f}=(0,iv.usePlaygroundInput)(c),m=p instanceof File?p:void 0,h=m?.name??u;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{"aria-label":o["aria.fileUploadButton"],className:(0,y.cn)("text-left flex text-playground-input overflow-hidden",m||a?"text-gray-900! dark:text-gray-100!":"text-gray-400! dark:text-white/30!"),onClick:()=>i.current?.click(),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",s(!0)},onDragLeave:()=>s(!1),onDrop:e=>{e.preventDefault(),s(!1);let t=e.dataTransfer.files[0];t&&(f(c,t),i.current&&(i.current.value=""))},children:h}),(0,l.jsx)("input",{type:"file","data-testid":`${e??"file"}-input`,onChange:e=>{f(c,e.target.files?.[0])},ref:i,className:"hidden"})]})};var i9=e.i(861862),ae=e.i(239140),at=e.i(715227),an=e.i(786475),ar=e.i(321472),ao=e.i(344246),al=e.i(757808);let ai=({name:e,schema:t,defaultExpanded:n=!0,typeDropdown:r,arrayIndices:o,parentNames:i,clearValue:a,style:s,explode:u,children:c,isArrayChild:d,depth:p})=>{let f="array"===t.type,m="object"===t.type,[h,g]=(0,x.useState)(!m||0===p||n),v=(0,ar.useHiddenUntilFound)({hidden:!h,onReveal:()=>g(!0)}),b=(0,R.isEnum)(t)&&t.description&&(0,ao.containsMarkdownTable)(t.description),w=m?Object.keys(t.properties??{}).length:0,j=o&&o.length>0?o[o.length-1]:void 0,S=void 0!=j&&d;return void 0==j||!d||m||f?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:(0,y.cn)("flex space-x-3 items-start",S&&!m&&"flex items-center"),children:[S&&(0,l.jsx)(i9.ArrayCount,{className:(0,y.cn)(m&&"mt-8"),children:j+1}),(0,l.jsxs)("div",{className:(0,y.cn)("flex-1 grid lg:grid-cols-2 gap-x-12 gap-y-4 py-5 max-w-full",f&&"flex flex-col",m&&"gap-y-0 flex flex-col border border-gray-50 dark:border-white/5 rounded-xl px-4 py-0 my-5",S&&"py-1 my-2"),"data-testid":e?`api-input-${e}`:void 0,children:[(0,l.jsxs)("div",{className:(0,y.cn)("space-y-2",m&&"pt-8 py-5 border-b border-gray-50 dark:border-white/5",!h&&"border-none",S&&!m&&"flex items-center"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between font-mono font-bold",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs truncate",title:i&&i.length>0?`${i.join(".")}.${e}`:e,children:[(0,l.jsx)("div",{className:(0,y.cn)("text-sm truncate",void 0==e&&"hidden"),children:i&&i.length>0&&"deepObject"===s&&u?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:i.map((e,t)=>(0,l.jsxs)(l.Fragment,{children:[e,0===t?"[":"]["]}))}),(0,l.jsx)("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:e}),(0,l.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"]"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:i?`${i.join(".")}.`:""}),(0,l.jsx)("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:e})]})}),void 0!=r?r:(0,l.jsx)(an.InfoPill,{className:"text-wrap",children:t.typeLabel}),t.isRequired&&(0,l.jsx)(an.RequiredPill,{}),t.deprecated&&(0,l.jsx)(an.DeprecatedPill,{})]}),m&&(0,l.jsx)(at.ObjectExpandButton,{onClick:()=>g(!h),count:w,expanded:h})]}),t.description&&!b&&(0,l.jsx)(ae.Description,{markdown:t.description,className:"text-gray-500 dark:text-gray-400"})]}),(0,l.jsx)("div",{ref:v,className:(0,y.cn)("grid grid-cols-1 w-full items-start divide-y divide-gray-50 dark:divide-white/5",f&&"divide-y-0"),children:c})]}),(void 0!=o&&o.length>0||i)&&a&&(0,l.jsx)(aa,{className:(0,y.cn)(m&&"mt-8",i&&"mt-7"),onClick:()=>a()})]}),t.description&&b&&(0,l.jsx)(ae.Description,{markdown:t.description,className:"text-gray-500 dark:text-gray-400"})]}):(0,l.jsxs)("div",{className:"flex space-x-3 items-center",children:[(0,l.jsx)(i9.ArrayCount,{children:j+1}),(0,l.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2 py-1 my-2","data-testid":e?`api-input-${e}`:`api-input-array-item-${j}`,children:[r,(0,l.jsx)("div",{className:"flex-1 min-w-0",children:c})]}),a&&(0,l.jsx)(aa,{onClick:()=>a()})]})},aa=({className:e,onClick:t})=>{let n=(0,d.useSelectedLocale)();return(0,l.jsx)("button",{className:(0,y.cn)("px-1 text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400",e),onClick:t,"aria-label":n["aria.deleteItem"],children:(0,l.jsx)(al.TrashIcon,{strokeWidth:2,className:"size-4"})})},as=()=>(0,l.jsx)("input",{className:"flex-1 min-w-0 outline-0 bg-transparent text-playground-input",type:"text",placeholder:"--",contentEditable:"false",disabled:!0});var au=e.i(111048),ac=e.i(462153);let ad=({name:e,schema:t,inputKeyPrefix:n,numberType:r,arrayIndices:o,onChangeCallback:i})=>{let a=(0,d.useSelectedLocale)(),s=(0,R.getSchemaPlaceholder)(t),u=(0,I.getUniqueInputKey)(n,t,o),{value:c,setInput:p}=(0,iv.usePlaygroundInput)(u),f=s??a["api.enterValue"].replace("{name}",e??a["api.value"]),m=t.type,h=((e,t)=>"integer"===e?(0,ac.isInteger)(t)?t:void 0:(0,ac.isNumber)(t)?t:void 0)(r,c);return(0,l.jsx)("input",{id:au.Ids.APIPlaygroundInput,className:"flex-1 min-w-0 bg-transparent outline-0 text-playground-input",placeholder:f,"aria-label":s??a["aria.enterValue"].replace("{name}",e??a["api.value"]),onKeyDown:e=>{("e"===e.key||"."===e.key&&"integer"===m)&&e.preventDefault()},type:"number",value:h??"",onChange:e=>{if(0===e.target.value.length){p(u,void 0),i?.();return}if("integer"===m){let t=parseInt(e.target.value);if(isNaN(t))return;p(u,t)}else p(u,parseFloat(e.target.value));i?.()}})};var ap=e.i(275143),af=e.i(110683);let am=({count:e,hidden:t,onReveal:n,id:r,children:o,className:i})=>{let a=(0,ar.useHiddenUntilFound)({hidden:t&&e>0,onReveal:n});return 0===e?null:(0,l.jsx)("div",{ref:a,id:r,"data-testid":"optional-fields-group",className:(0,y.cn)("divide-y divide-gray-100 dark:divide-white/10",i),children:o})},ah=e=>"path"===e.in||!!e.required,ag=e=>{let t=[...e].sort((e,t)=>{let n=ah(e);return n===ah(t)?0:n?-1:1}),n=[],r=[];for(let e of t)ah(e)?n.push(e):r.push(e);return{required:n,optional:r}},av=(0,x.createContext)({expandedSections:new Set,setSectionsExpanded:()=>{}}),ay=({resetKey:e,children:t})=>{let[n,r]=(0,x.useState)(new Set),[o,i]=(0,x.useState)(e);o!==e&&(i(e),r(new Set));let a=(0,x.useCallback)((e,t)=>{r(n=>{let r=new Set(n);return e.forEach(e=>{t?r.add(e):r.delete(e)}),r})},[r]),s=(0,x.useMemo)(()=>({expandedSections:n,setSectionsExpanded:a}),[n,a]);return(0,l.jsx)(av.Provider,{value:s,children:t})},ax=()=>(0,x.useContext)(av),ab=new Map([[O.apiPlaygroundInputKeys.header,"header"],[O.apiPlaygroundInputKeys.cookie,"cookie"],[O.apiPlaygroundInputKeys.path,"path"],[O.apiPlaygroundInputKeys.query,"query"],[O.apiPlaygroundInputKeys.body,"body"]]),aw=e=>Array.isArray(e.oneOf)?Math.max(0,...e.oneOf.filter(R.isSchemaObject).map(aw)):"object"===e.type&&e.properties?Object.values(e.properties).filter(e=>(0,R.isSchemaObject)(e)&&!0!==e.isRequired).length:0,aj=[],aS=({schema:e,inputKeyPrefix:t,arrayIndices:n,name:r})=>{let o=(0,d.useSelectedLocale)(),i=(0,I.getUniqueInputKey)(t,e,n),{value:a,setInput:s}=(0,iv.usePlaygroundInput)(i),u=(0,x.useCallback)(e=>{if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e,null,2)}catch{return""}},[]),c=(0,x.useMemo)(()=>u(a),[u,a]),[p,f]=(0,x.useState)(c),m=(0,x.useRef)(!1);(0,x.useEffect)(()=>{m.current||f(c)},[c]);let h=(0,x.useCallback)(e=>{let t=e.target.value;if(f(t),!t.trim())return void s(i,void 0);try{let e=JSON.parse(t);"object"==typeof e&&null!==e&&s(i,e)}catch{}},[i,s]),g=(0,x.useCallback)(()=>{m.current=!0},[]),v=(0,x.useCallback)(()=>{m.current=!1,f(u(a))},[u,a]),y=Math.max(2,Math.min(15,p.split("\n").length));return(0,l.jsx)("textarea",{className:"-mx-3.5 px-3.5 flex-1 min-h-[2.5rem] min-w-0 bg-transparent outline-0 text-playground-input resize-y font-mono text-xs",rows:y,placeholder:o["api.enterValueCapitalized"].replace("{name}",r??o["api.value"]),"aria-label":o["aria.enterValue"].replace("{name}",r??o["api.value"]),value:p,onChange:h,onFocus:g,onBlur:v,spellCheck:!1,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})},aE=({schema:e,depth:t,parentNames:n,style:r,explode:o,inputKeyPrefix:i,name:a,arrayIndices:s,onChangeCallback:u,defaultExpanded:c})=>{let d=(0,iv.usePlaygroundInputsStore)(e=>e.deleteInput),[p,f]=(0,x.useState)([]),{expandedSections:m,setSectionsExpanded:h}=ax(),g=(0,R.isSchemaObject)(e.additionalProperties),v=(0,iv.usePlaygroundInputsStore)((0,i0.useShallow)(t=>{if(!g)return aj;let n=`${(0,I.getUniqueInputKey)(i,e,s)}.`,r=new Set(Object.keys(e.properties??{})),o=[];return Object.keys(t.inputs).forEach(e=>{if(!e.startsWith(n))return;let t=e.slice(n.length).match(/^((?:\\.|[^.\\])+)/)?.[1];if(!t)return;let l=(0,R.decodePathSegment)(t).replaceAll("\\.",".");r.has(l)||o.includes(l)||o.push(l)}),o})),y=(0,x.useMemo)(()=>[...p,...v.filter(e=>!p.includes(e))],[p,v]);if(!(Object.keys(e.properties??{}).length>0)&&!g)return(0,l.jsx)(aS,{schema:e,inputKeyPrefix:i,arrayIndices:s,name:a});let b=[],w=[];Object.entries(e.properties??{}).forEach(([e,d])=>{if((0,R.isSchemaObject)(d)){let p=a?[...n??[],a]:void 0,f=(0,l.jsx)(aP,{name:e,schema:d,depth:(t??0)+1,parentNames:p,style:r,explode:o,arrayIndices:s,inputKeyPrefix:i,onChangeCallback:u,defaultExpanded:c},e);ak(d)?b.push(f):w.push(f)}});let j=!1!==e.additionalProperties,S=(0,i4.v4)(),E=[];y.forEach(p=>{let m=a?[...n??[],a]:n;if((0,R.isSchemaObject)(e.additionalProperties)){let n=e.uniqueKey??"",a=n?`${n}.${(0,R.escapeDots)(p)}`:(0,R.escapeDots)(p),h=e.additionalProperties,g="uniqueKey"in h&&"string"==typeof h.uniqueKey?h.uniqueKey:"",v=(0,af.updateSchemaUniqueKeys)(h,g,a),y=(0,I.getUniqueInputKey)(i,v,s);E.push((0,l.jsx)(aP,{name:p,schema:v,depth:(t??0)+1,parentNames:m,style:r,explode:o,arrayIndices:s,inputKeyPrefix:i,clearValue:()=>{d(y),f(e=>e.filter(e=>e!==p))},onChangeCallback:u,defaultExpanded:c},p))}else{let n=e.uniqueKey??"",a=(0,R.convertAnySchemaToOneOfs)(),h=`${n}.${(0,R.escapeDots)(p)}.oneOf`,g={oneOf:a.oneOf?.map((e,t)=>({...e,uniqueKey:`${h}.${t}`})),uniqueKey:h};(0,R.isSchemaObject)(g)&&E.push((0,l.jsx)(aP,{name:p,schema:g,depth:(t??0)+1,parentNames:m,style:r,explode:o,arrayIndices:s,inputKeyPrefix:i,clearValue:()=>{d((0,I.getUniqueInputKey)(i,g,s)),f(e=>e.filter(e=>e!==p))},onChangeCallback:u,defaultExpanded:c},p))}});let k=0===t?(e=>{let t=e.split(".")[0];return void 0===t?void 0:ab.get(t)})(i):void 0,O=void 0!==k&&!m.has(k),C=(0,l.jsx)(am,{count:w.length,hidden:O,onReveal:()=>{void 0!==k&&h([k],!0)},children:w});if(0===t)return(0,l.jsxs)(l.Fragment,{children:[b,C,E]});let T=[...Object.keys(e.properties??{}),...y];return(0,l.jsxs)(l.Fragment,{children:[b,C,E,j?(0,l.jsx)(ap.AdditionalPropertyButton,{existingKeys:T,onAddKey:e=>{f([...p,e])},dataTestId:e.uniqueKey+".additional-property-button"},"add-property-button"+S):null]})},ak=e=>!0===e.isRequired;var aO=e.i(448205);let aR=({name:e,schema:t,inputKeyPrefix:n,enumType:r,arrayIndices:o,parentNames:i,clearValue:a,onChangeCallback:s})=>{let u=(0,d.useSelectedLocale)(),c=(0,R.getSchemaPlaceholder)(t),p=t.enum?.filter(e=>"number"==typeof e||"string"==typeof e)??[],f="boolean"===t.type?(0,R.getBooleanEnumOptions)(t):p,m=(0,I.getUniqueInputKey)(n,t,o),{value:h,setInput:g}=(0,iv.usePlaygroundInput)(m),v=(0,iv.usePlaygroundInputsStore)(e=>e.deleteInput),x=((e,t)=>{switch(e){case"integer":return(0,ac.isInteger)(t)?t:void 0;case"number":return(0,ac.isNumber)(t)?t:void 0;case"string":return(0,ac.isString)(t)?t:void 0;case"boolean":return(0,ac.isBoolean)(t)?t:void 0;default:return}})(r,h),b=void 0!==a&&((o?.length??0)>0||i);return(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsxs)("div",{className:"relative flex-1",children:[(0,l.jsxs)("select",{className:(0,y.cn)("relative text-playground-input w-full text-left flex-1 outline-0 cursor-pointer bg-transparent pr-6",void 0!==x?"text-gray-900! dark:text-gray-100!":"text-gray-400! dark:text-white/30!"),value:x?.toString()??"","aria-label":c??u["aria.selectOption"].replace("{name}",e||u["api.option"]),onChange:e=>{"boolean"===r?g(m,"true"===e.target.value):"integer"===r?g(m,parseInt(e.target.value,10)):"number"===r?g(m,parseFloat(e.target.value)):g(m,e.target.value),s?.()},children:[(0,l.jsx)("option",{value:"",disabled:!0,children:c??u["api.selectOption"].replace("{name}",e||u["api.option"])}),f.map(e=>(0,l.jsx)("option",{value:e.toString(),children:e.toString()},e.toString()))]}),(0,l.jsx)(aO.ChevronDownIcon,{strokeWidth:2,className:"absolute right-2 top-1/2 -translate-y-1/2 size-4 text-gray-400 dark:text-white/30 pointer-events-none"})]}),void 0!==x&&!b&&(0,l.jsx)("button",{type:"button",className:"p-0.5 text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400",onClick:()=>{v(m)},"aria-label":u["aria.deleteItem"],children:(0,l.jsx)(al.TrashIcon,{strokeWidth:2,className:"size-4"})})]})},aI=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r,onChangeCallback:o})=>{let i=(0,d.useSelectedLocale)(),a=(0,R.getSchemaPlaceholder)(t),{prefix:s,placeholder:u}=aC(t.format,i["api.enterBearerToken"]),c=(0,I.getUniqueInputKey)(n,t,r),{value:p,setInput:f}=(0,iv.usePlaygroundInput)(c),m=(0,ac.isString)(p)?p:void 0,h=s&&m?.startsWith(s)?m.substring(s.length):m;return(0,l.jsxs)("div",{className:"relative flex flex-1 items-center",children:[(0,l.jsx)("div",{className:"absolute left-2.5 top-0 bottom-0 flex items-center justify-center text-sm text-gray-800 dark:text-gray-100",children:s}),(0,l.jsx)("input",{id:au.Ids.APIPlaygroundInput,className:"flex-1 min-w-0 bg-transparent outline-0 text-playground-input",style:{paddingLeft:s?.52*s.length+"rem":void 0},placeholder:a??u??i["api.enterValue"].replace("{name}",e??i["api.value"]),"aria-label":a??u??i["aria.enterValue"].replace("{name}",e??i["api.value"]),type:"text",value:h??"",onChange:e=>{(e=>{let t=`${s??""}${e}`;t?f(c,t):f(c,void 0)})(e.target.value),o?.()},spellCheck:!1})]})},aC=(e,t)=>e?.toLowerCase()==="bearer"?{prefix:"Bearer ",placeholder:t}:{},aT=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r,onChangeCallback:o})=>{let i=(0,d.useSelectedLocale)(),a=(0,I.getUniqueInputKey)(n,t,r),{value:s,setInput:u}=(0,iv.usePlaygroundInput)(a),c=(0,ac.isString)(s)?s:void 0,p=(0,R.getSchemaPlaceholder)(t);return(0,l.jsx)("textarea",{className:"-mx-3.5 px-3.5 flex-1 min-h-[2.5rem] min-w-0 bg-transparent outline-0 text-playground-input resize-y",rows:2,placeholder:p??i["api.enterValueCapitalized"].replace("{name}",e??i["api.value"]),"aria-label":p??i["aria.enterValue"].replace("{name}",e??i["api.value"]),value:c,onChange:e=>{u(a,e.target.value),o?.()},spellCheck:!1,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})},aP=({...e})=>{switch((0,R.getDifferentiatedType)(e.schema)){case"oneOf":return(0,l.jsx)(i1,{...e});case"any":case void 0:return(0,l.jsx)(i2,{...e});case"string":{let t=e.isBody&&0===e.depth||e.skipContainer?aT:aI;return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(t,{...e})})}case"object":if(e.isBody&&0===e.depth||e.skipContainer)return(0,l.jsx)(aE,{...e});return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(aE,{...e})});case"number":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(ad,{...e,numberType:"number"})});case"integer":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(ad,{...e,numberType:"integer"})});case"array":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(i8,{...e})});case"boolean":case"enum":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(aR,{...e,enumType:"boolean"})});case"enum":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(aR,{...e,enumType:"string"})});case"enum":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(aR,{...e,enumType:"number"})});case"enum":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(aR,{...e,enumType:"integer"})});case"file":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(i7,{...e})});case"null":return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(as,{})});default:return(0,l.jsx)(ai,{...e,children:(0,l.jsx)(aI,{...e})})}};var aN=e.i(568258);let aM=({name:e,validationState:t,children:n,rightElement:r,footer:o,onPaste:i})=>{let[a,s]=(0,x.useState)(!0),u=(0,d.useSelectedLocale)();return(0,l.jsxs)("div",{"data-testid":`api-input-section-${e}`,children:[(0,l.jsxs)("div",{role:"button",tabIndex:0,"aria-label":u["aria.expandInputSection"],onClick:()=>s(e=>!e),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s(e=>!e))},className:(0,y.cn)("flex w-full px-4 py-2.5 items-center justify-between border-standard cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5",a?"border-b-0! border-t border-x rounded-t-2xl":"rounded-2xl"),children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-1.5",children:[(0,l.jsx)(aN.default,{icon:"angle-right",iconType:"solid",className:(0,y.cn)("h-3 w-3 bg-gray-400 dark:bg-gray-500 transition-transform",a&&"rotate-90")}),(0,l.jsxs)("div",{className:"flex-1 flex items-center space-x-2",children:[(0,l.jsx)("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 leading-6",children:e}),t?"invalid"===t?(0,l.jsx)(aA,{}):(0,l.jsx)(aL,{}):null]})]}),(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:r})]}),(0,l.jsxs)("div",{onPaste:i,className:(0,y.cn)("bg-background-light dark:bg-background-dark flex-1 px-4 rounded-b-xl border-standard border-t-0!","[&>:not([hidden])~:not([hidden])]:border-t [&>:not([hidden])~:not([hidden])]:border-gray-100 dark:[&>:not([hidden])~:not([hidden])]:border-white/10",a&&n?"":"hidden"),children:[(0,l.jsx)("div",{}),n,o?(0,l.jsx)("div",{className:"-mx-4 border-t-0!",children:o}):null]})]})},aA=()=>(0,l.jsx)(aN.default,{className:"h-4 w-4 bg-[#2AB673]",icon:"circle-check"}),aL=()=>(0,l.jsx)(aN.default,{className:"h-4 w-4 bg-[#CB3A32]",icon:"circle-exclamation"});var aD=e.i(340373),a$=e.i(129749);let aF=({count:e,expanded:t,onToggle:n,controlsId:r,className:o})=>{let i=(0,d.useSelectedLocale)();if(0===e)return null;let a=i[t?1===e?"api.collapseOptionalFields_one":"api.collapseOptionalFields_other":1===e?"api.expandOptionalFields_one":"api.expandOptionalFields_other"].replace("{count}",String(e)),s=t?aD.MinusIcon:a$.PlusIcon;return(0,l.jsxs)("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:n,"data-testid":"optional-fields-row",className:(0,y.cn)("flex h-9 w-full items-center gap-2 rounded-b-[calc(var(--radius-xl)-1px)] border-t border-gray-200 bg-gray-100 px-3.5 text-left text-sm leading-6 text-gray-600 hover:bg-gray-200/60 dark:border-white/10 dark:bg-white/5 dark:text-gray-400 dark:hover:bg-white/10",o),children:[(0,l.jsx)(s,{"aria-hidden":"true",className:"size-4 shrink-0 text-gray-400 dark:text-gray-500",strokeWidth:1.5}),(0,l.jsx)("span",{children:a})]})},aq=({apiReferenceData:e,selectedContentTypeIndex:t,setSelectedContentTypeIndex:n,defaultExpanded:r})=>{let o=(0,d.useSelectedLocale)(),i=(0,iv.usePlaygroundInputsStore)(e=>e.setInputs),a=(0,iv.usePlaygroundInputsStore)(e=>e.deleteInput),{expandedSections:s,setSectionsExpanded:u}=ax(),{dependencies:c}=e,{requestBody:p}=c??{};if(!p)return null;let f=Object.entries(p.content).map(([e,t])=>(0,R.isSchemaObject)(t.schema)?{contentType:e,schema:t.schema,label:e}:null).filter(e=>null!==e),m=f[t];if(!m)return null;let{schema:h}=m,g=`${O.apiPlaygroundInputKeys.body}`,v=aw(h),x=s.has("body");return(0,l.jsx)(aM,{name:o["api.body"],rightElement:(0,l.jsx)(()=>(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),className:(0,y.cn)("text-xs font-mono",f.length<=1&&"hidden"),children:(0,l.jsx)(ii,{options:f,selectedIndex:t,onSelectOption:e=>{n(e)}})}),{}),footer:v>0?(0,l.jsx)(aF,{count:v,expanded:x,onToggle:()=>u(["body"],!x)}):void 0,onPaste:e=>{let t=(0,iG.getPastedJson)(e);if(void 0===t||!("object"===h.type&&(Object.keys(h.properties??{}).length>0||(0,R.isSchemaObject)(h.additionalProperties))||"array"===h.type&&"items"in h&&(0,R.isSchemaObject)(h.items)||Array.isArray(h.oneOf)&&h.oneOf.length>0))return;let n=(0,iJ.getExampleBodyInputs)({schema:h,example:t});0!==Object.keys(n).length&&(e.preventDefault(),a(g),i(n))},children:(0,l.jsx)(aP,{schema:h,isBody:!0,depth:0,inputKeyPrefix:g,defaultExpanded:r})})},aB=({sectionsWithOptionalFields:e,onExpandAll:t,className:n})=>{let r=(0,d.useSelectedLocale)(),{expandedSections:o,setSectionsExpanded:i}=ax();if(0===e.length)return null;let a=e.some(e=>!o.has(e));return(0,l.jsx)("button",{type:"button","aria-expanded":!a,onClick:()=>{i(e,a),a&&t?.()},"data-testid":"optional-fields-toggle",className:(0,y.cn)("inline-flex h-8 items-center whitespace-nowrap rounded-[10px] border border-gray-200 bg-background-light px-2 text-sm font-medium leading-5 text-gray-800 hover:bg-gray-50 dark:border-white/10 dark:bg-background-dark dark:text-gray-200 dark:hover:bg-white/5",n),children:(0,l.jsxs)("span",{className:"grid justify-items-center",children:[(0,l.jsx)("span",{"aria-hidden":!a,className:(0,y.cn)("col-start-1 row-start-1",!a&&"invisible"),children:r["api.expandOptionalFields"]}),(0,l.jsx)("span",{"aria-hidden":a,className:(0,y.cn)("col-start-1 row-start-1",a&&"invisible"),children:r["api.collapseOptionalFields"]})]})})},aU=({apiReferenceData:e,defaultExpanded:t})=>{let n=(0,d.useSelectedLocale)(),{expandedSections:r,setSectionsExpanded:o}=ax(),i=(0,x.useId)(),{dependencies:a}=e,{parameters:s}=a??{};if(!s||0===Object.keys(s).length)return null;let{header:u,path:c,query:p,cookie:f}=(0,R.getParametersPerSection)(e),m=e=>{if(void 0===e)return null;if((0,R.isSchemaObject)(e.schema)){let n=`${(0,R.mapParamInToPlaygroundInputKey)(e.in)}.${(0,R.escapeDots)(e.name)}`;return(0,l.jsx)(aP,{name:e.name,schema:{...e.schema,description:e.description},style:e.style,explode:e.explode,inputKeyPrefix:n,defaultExpanded:t},e.name)}return null},h=(e,t,n)=>{let{required:a,optional:s}=ag(e),u=a.map(m).filter(e=>null!==e),c=s.map(m).filter(e=>null!==e);if(0===u.length&&0===c.length)return null;let d=r.has(n),p=`${i}-${n}`;return(0,l.jsxs)(aM,{name:t,footer:c.length>0?(0,l.jsx)(aF,{count:c.length,expanded:d,onToggle:()=>o([n],!d),controlsId:p}):void 0,children:[u,(0,l.jsx)(am,{id:p,count:c.length,hidden:!d,onReveal:()=>o([n],!0),children:c})]})};return(0,l.jsxs)(l.Fragment,{children:[h(u,n["api.header"],"header"),h(f,n["api.cookies"],"cookie"),h(c,n["api.path"],"path"),h(p,n["api.query"],"query")]})},az=({apiReferenceData:e,updateLocalStorageCallback:t,defaultExpanded:n})=>{let r=(0,d.useSelectedLocale)(),{selectedSecurityOptionIndex:o,setSelectedSecurityOptionIndex:i}=(0,ip.useSelectedSecurityOption)(),a=e.dependencies?.processedSecurityOptions;if(!a||0===a.length)return null;let s=a[o];if(!s)return null;let u=a.map(e=>({label:e.title,schema:e.schemes[0]?.schema??{type:"string"}}));return(0,l.jsx)(aM,{name:r["api.authorization"],rightElement:(0,l.jsx)(()=>(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),className:(0,y.cn)("text-xs font-mono",a.length<=1&&"hidden"),children:(0,l.jsx)(ii,{options:u,selectedIndex:o,onSelectOption:e=>{i(e)}})}),{}),children:s.schemes.map(({scheme:e,schema:r,name:o},i)=>{let a=(0,R.getSecurityOptionInputKeyPrefix)({scheme:e,name:o});return(0,l.jsxs)(x.Fragment,{children:[r.description&&"object"===r.type&&(0,l.jsx)(ae.Description,{markdown:r.description,className:"text-gray-500 dark:text-gray-400 py-2"}),(0,l.jsx)(aP,{name:o,schema:r,inputKeyPrefix:a,skipContainer:"object"===r.type,onChangeCallback:t,defaultExpanded:n},`${e.type}-${o}`)]},`${e.type}-${o}-${i}`)})})},aK=({apiReferenceData:e,selectedBaseUrlIndex:t,updateLocalStorageCallback:n})=>{let{dependencies:r}=e,{servers:o}=r??{};if(!o||0===Object.keys(o).length)return null;let i=Object.values(o),a=i[t]?.variables;return a&&0!==Object.keys(a).length?(0,l.jsx)(aM,{name:"Server",children:Object.entries(a).map(([e,t])=>{let r={...t,type:"string"},o=`${O.apiPlaygroundInputKeys.server}.${(0,R.escapeDots)(e)}`;return(0,l.jsx)(aP,{name:e,schema:r,inputKeyPrefix:o,onChangeCallback:n},e)})}):null};var aW=e.i(885401),aH=e.i(152537),aV=e.i(886235);let a_={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","audio/mpeg":"mp3","audio/mp4":"m4a","audio/ogg":"ogg","audio/wav":"wav","audio/webm":"weba","audio/aac":"aac","audio/flac":"flac","video/mp4":"mp4","video/mpeg":"mpeg","video/ogg":"ogv","video/webm":"webm","video/quicktime":"mov","application/pdf":"pdf","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/json":"json","application/xml":"xml","application/zip":"zip","application/gzip":"gz","application/octet-stream":"bin","application/javascript":"js","application/wasm":"wasm","application/yaml":"yaml","text/yaml":"yaml","text/javascript":"js","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/xml":"xml","text/markdown":"md"},aY={json:"json",xml:"xml",zip:"zip",gzip:"gz"},aX=({message:e,icon:t})=>{let n=(0,aW.useCodeBlockThemeEnum)();return(0,l.jsx)("div",{className:(0,y.cn)("system"===n?"bg-response-body-auto":"bg-response-body-dark","rounded-b-xl"),children:(0,l.jsxs)("div",{className:"pb-8 pt-10 px-6 space-y-4 flex flex-col items-center",children:[(0,l.jsx)(aN.default,{icon:t,className:"h-8 w-8 bg-gray-300 dark:bg-white/20"}),(0,l.jsx)("div",{className:"text-sm text-center",children:e})]})})},aG=({data:e})=>{let t=(0,aW.useCodeBlockThemeEnum)();return(0,l.jsx)("div",{className:(0,y.cn)("system"===t?"bg-response-body-auto":"bg-response-body-dark","flex p-12 items-center rounded-b-xl h-full"),children:(0,l.jsx)("audio",{controls:!0,className:"w-full",src:e.url})})};var aJ=e.i(876469),aZ=e.i(306864),aQ=e.i(650809);let a0=({data:e})=>{let t=(0,aW.useCodeBlockThemeObject)(),n=(0,d.useSelectedLocale)(),r=!1,o=e.content,i=e.content.length>5*aJ.MAX_PREVIEW_BYTES;try{o=JSON.parse(e.content),r=!0}catch(e){console.error(e)}let a=(0,aQ.useGetShikiHighlightedHtml)({codeString:r?JSON.stringify(o,null,2):e.content,codeBlockTheme:t,language:r?"json":"text",opts:{structure:"inline"}});return(0,l.jsxs)(aH.ScrollArea,{className:"h-full",children:[(0,l.jsx)(aH.ScrollAreaViewport,{role:"region","aria-label":n["aria.responseContent"],children:(0,l.jsx)(aH.ScrollAreaContent,{className:"h-full",children:(0,l.jsx)("div",{className:(0,y.cn)(aZ.SHIKI_CLASSNAME,"px-3 py-3.5 h-full whitespace-pre border-gray-200 dark:border-gray-700 dark:text-gray-300 font-mono text-xs leading-5",i&&"whitespace-pre-line"),children:r&&void 0!==a?(0,l.jsx)("span",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a}}):(0,l.jsx)("span",{suppressHydrationWarning:!0,children:r?JSON.stringify(o,null,2):e.content})})})}),(0,l.jsx)(aH.ScrollAreaScrollbar,{orientation:"horizontal"}),(0,l.jsx)(aH.ScrollAreaScrollbar,{orientation:"vertical"}),(0,l.jsx)(aH.ScrollAreaCorner,{})]})},a1=({data:e})=>{let t=(0,aW.useCodeBlockThemeEnum)();return(0,l.jsx)("div",{className:(0,y.cn)("system"===t?"bg-response-body-auto":"bg-response-body-dark","h-60"),children:(0,l.jsx)("img",{alt:"image response from the server",className:"p-6 w-full h-full object-scale-down",src:e.url})})},a2=({data:e})=>{let t=(0,aW.useCodeBlockThemeEnum)();return(0,l.jsx)("div",{className:(0,y.cn)("system"===t?"bg-response-body-auto":"bg-response-body-dark","flex p-2 items-center h-full rounded-xt"),children:(0,l.jsx)("video",{controls:!0,className:"w-full rounded-lg",src:e.url})})},a5=({data:e})=>{let t=(0,d.useSelectedLocale)();if(null==e)return(0,l.jsx)(aX,{message:t["api.noBodyReceived"],icon:"brackets-curly"});switch(e.type){case"video":return(0,l.jsx)(a2,{data:e});case"audio":return(0,l.jsx)(aG,{data:e});case"image":return(0,l.jsx)(a1,{data:e});case"other":return(0,l.jsx)(a0,{data:e})}},a4=({message:e})=>{let t=(0,d.useSelectedLocale)();return(0,l.jsx)(aX,{message:`${t["api.requestError"]} ${e}`,icon:"triangle-exclamation"})},a6=({children:e})=>(0,l.jsxs)(aH.ScrollArea,{className:"w-full",children:[(0,l.jsx)(aH.ScrollAreaViewport,{className:"overflow-y-hidden!",children:(0,l.jsx)(aH.ScrollAreaContent,{children:(0,l.jsx)("div",{className:"min-w-max",children:e})})}),(0,l.jsx)(aH.ScrollAreaScrollbar,{orientation:"horizontal"})]}),a3=({data:e})=>{let t=(0,aW.useCodeBlockThemeEnum)();return(0,l.jsx)("div",{className:"w-full rounded-b-xl",children:(0,l.jsx)("table",{className:"table-fixed pb-8 w-full pt-10",children:e.flatMap(([e,n])=>(0,l.jsxs)("tr",{className:(0,y.cn)("w-full flex divide-x border-b last:border-b-0 text-xs text-gray-600 dark:text-gray-400","system"===t?"divide-gray-100 dark:divide-white/10 border-gray-100 dark:border-white/10 text-gray-600 dark:text-gray-400":"divide-white/10 border-white/10 text-gray-400"),children:[(0,l.jsx)("td",{className:"flex min-w-0 items-center basis-1/2 py-2 px-4 text-gray-600",children:(0,l.jsx)(a6,{children:e})}),(0,l.jsx)("td",{className:"flex min-w-0 items-center basis-1/2 py-2 px-4",children:(0,l.jsx)(a6,{children:`${n}`})})]},e))})})},a8=({response:e})=>{let t=(0,d.useSelectedLocale)(),n=Object.entries(e.headers);return 0===n.length?(0,l.jsx)(aX,{message:t["api.noHeadersReceived"],icon:"table"}):(0,l.jsx)(a3,{data:n})};var a7=e.i(453778);let a9=({data:e})=>{let[t,n]=(0,x.useState)(!1),r=st(e,()=>{n(!0),setTimeout(()=>{n(!1)},2e3)},e=>console.error(`unable to copy response to clipboard: ${e}`));return r?(0,l.jsx)(a7.CopyIconButton,{onClick:r,isCopiedActive:t}):null},se=["image/png","text/plain"],st=(e,t,n)=>(0,x.useMemo)(()=>{if(e.contentType&&se.includes(e.contentType))try{let r=new ClipboardItem({[e.contentType]:e.blob.arrayBuffer().then(t=>new Blob([t],{type:e.contentType})).catch(e=>{throw Error(`Failed to process blob: ${e.message}`)})});return()=>navigator.clipboard.write([r]).then(t,n)}catch(e){console.error(`unable to create clipboard item: ${e}`)}if("other"===e.type)return()=>navigator.clipboard.writeText(e.content).then(t,n)},[e,t,n]),sn=({data:e})=>{let[t,n]=(0,x.useState)(!1),r=(0,d.useSelectedLocale)(),o=(0,aW.useCodeBlockThemeEnum)();return e.extension?(0,l.jsx)(a7.CodeBlockTooltip,{text:t?r["tooltip.copied"]:r["tooltip.download"],children:(0,l.jsx)("a",{"aria-label":t?r["aria.fileDownloaded"]:r["aria.downloadResponseFile"],className:"group h-7 w-7 flex items-center justify-center cursor-pointer",onClick:()=>{n(!0),setTimeout(()=>{n(!1)},2e3)},href:e.url,download:`api-response.${e.extension}`,children:t?(0,l.jsx)(aN.default,{icon:"circle-check",iconType:"solid",className:"h-4 w-4 bg-primary dark:bg-primary-light"}):(0,l.jsx)(aN.default,{icon:"arrow-down-to-line",className:(0,y.cn)("w-4 h-4","system"===o?"bg-gray-400 group-hover:bg-gray-500 dark:bg-white/40 dark:group-hover:bg-white/60":"bg-white/40 group-hover:bg-white/60")})})}):null},sr=({result:e,selectedSection:t,setSelectedSection:n,data:r})=>(0,l.jsxs)("div",{className:"flex w-full px-2 py-1 space-x-3 items-center rounded-t-2xl",children:[(0,l.jsx)("div",{className:"flex flex-1 space-x-4 items-center",children:(0,l.jsx)(so,{status:e.error?void 0:e.response.status,statusText:e.error?void 0:e.response.statusText})}),r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(si,{selectedSection:t,setSelectedSection:n}),(0,l.jsx)(sn,{data:r}),(0,l.jsx)(a9,{data:r})]}):null]}),so=({status:e,statusText:t})=>{let n=(0,aW.useCodeBlockThemeEnum)();return(0,l.jsxs)("div",{className:"flex space-x-2 items-center",children:[(0,l.jsx)(sl,{status:e}),(0,l.jsx)("div",{className:(0,y.cn)("text-xs","system"===n?"text-gray-800 dark:text-gray-200 font-medium":"text-gray-200 font-medium"),children:e?`${e} - ${t}`:"--"})]})},sl=({status:e})=>{let t="w-3.5 h-3.5";return void 0===e?(0,l.jsx)(aN.default,{icon:"triangle-exclamation",className:(0,y.cn)(t,"bg-red-600 dark:bg-red-500")}):e>=400?(0,l.jsx)(aN.default,{icon:"circle-x",className:(0,y.cn)(t,"bg-red-600 dark:bg-red-500")}):e>=200&&e<300?(0,l.jsx)(aN.default,{icon:"circle-check",className:(0,y.cn)(t,"bg-green-600 dark:bg-green-500")}):(0,l.jsx)(aN.default,{icon:"circle-exclamation",className:(0,y.cn)(t,"bg-orange-600 dark:bg-orange-500")})},si=({selectedSection:e,setSelectedSection:t})=>{let n=(0,aW.useCodeBlockThemeEnum)(),r=(0,d.useSelectedLocale)();return(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("select",{"aria-label":r["aria.selectResponseSection"],className:(0,y.cn)("pl-2.5 pr-6 py-1 rounded-lg text-xs font-medium border cursor-pointer focus:outline-0","system"===n?"text-gray-600 dark:text-gray-400 border-standard hover:bg-gray-50 dark:hover:bg-white/[0.03]":"text-gray-200 border-gray-800/50 hover:bg-gray-800/50 bg-gray-800/50"),value:e,onChange:e=>t(e.target.value),children:sa.map(e=>(0,l.jsx)("option",{value:e,children:(e[0]?.toUpperCase()??"")+e.slice(1)},e))}),(0,l.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-end pr-2.5",children:(0,l.jsx)(aN.default,{icon:"angle-down",iconType:"solid",className:(0,y.cn)("w-2.5 h-2.5","system"===n?"bg-gray-400 dark:bg-gray-500":"bg-gray-200")})})]})},sa=["body","headers"],ss=({result:e,className:t})=>{let[n,r]=(0,x.useState)("body"),o=su(e),i=(0,aW.useCodeBlockThemeEnum)();return(0,l.jsx)(h.default,{children:(0,l.jsxs)("div",{className:(0,y.cn)("w-full grow rounded-2xl border p-0.5",e.error&&"shrink-0","system"===i?"bg-gray-50 dark:bg-white/5 border-gray-950/10 dark:border-white/10":"bg-codeblock dark:bg-white/5 border-white/10",t),children:[(0,l.jsx)(sr,{selectedSection:n,setSelectedSection:r,result:e,data:o}),(0,l.jsx)(()=>(0,l.jsxs)(aH.ScrollArea,{className:(0,y.cn)("rounded-xt dark:bg-codeblock max-h-[360px]","system"===i?"bg-white":"codeblock-dark bg-codeblock"),children:[(0,l.jsx)(aH.ScrollAreaViewport,{className:"max-h-[inherit]",children:(0,l.jsx)(aH.ScrollAreaContent,{className:"min-w-0! w-full",children:e.error?(0,l.jsx)(a4,{message:e.errorMessage}):"body"===n?(0,l.jsx)(a5,{data:o}):(0,l.jsx)(a8,{response:e.response})})}),(0,l.jsx)(aH.ScrollAreaScrollbar,{orientation:"vertical"})]}),{})]})})},su=e=>(0,x.useMemo)(()=>{if(e.error||void 0==e.response.data)return;let t=(0,aV.base64ToUint8Array)(e.response.data),n=sc(e.response.headers),r=sd(n),o=new Blob([t],{type:n}),l=URL.createObjectURL(o),i=n?(e=>{let t=a_[e];if(t)return t;let n=e.lastIndexOf("+");if(-1!==n)return aY[e.slice(n+1)]})(n):void 0;return n&&"other"!==r?{type:r,contentType:n,blob:o,url:l,extension:i}:{type:"other",contentType:n,content:new TextDecoder("utf-8",{ignoreBOM:!0}).decode(t),blob:o,url:l,extension:i}},[e]),sc=e=>{for(let t in e)if("content-type"===t.toLowerCase()){let n=e[t];if("string"==typeof n)return n.split(";")[0]?.trim().toLowerCase()}},sd=e=>{let[t]=e?.split("/")??[];return"image"===t||"audio"===t||"video"===t?t:"other"};var sp=e.i(206558),sf=e.i(865420),sm=e.i(459685);let sh=async({method:t,path:n,inputs:r,headers:o})=>{let l=o["API-SECRET"],{getCoboV1CustodyGeneratedKeys:i}=await e.A(441570),a={...o,...i(t,n,l,r.body||r.query)};return delete a["API-SECRET"],a},sg=async(t,n,r,o,l)=>{let{getCoboV2CustodyGeneratedKeys:i}=await e.A(315451),a=l["BIZ-API-KEY"];return"string"==typeof a?await i(a,t,n,r,o):{}},sv=async({request:t,withCredentials:n})=>{let r=await e.A(547846).then(e=>e.default),o=Object.keys(t.header).find(e=>"content-type"===e.toLowerCase()),l=t.body,i=t.header;if(o?.includes("multipart/form-data")){let{data:e,headers:n}=sx(t);l=e,i=n}return r({url:t.url,method:t.method,params:t.query,data:l,...n?{withCredentials:n}:{},headers:i,paramsSerializer:{indexes:null},responseType:"arraybuffer",validateStatus:()=>!0,transformResponse:e=>(0,aV.bytesToBase64)(new Uint8Array(e))})},sy=async t=>{let n=await e.A(547846).then(e=>e.default),r=new FormData;r.append("requestInfo",JSON.stringify({method:t.method,url:t.url,header:t.header,query:t.query,cookie:t.cookie})),"object"==typeof t.body&&null!==t.body&&Object.entries(t.body).forEach(([e,t])=>{t instanceof File?r.append(e,t):Array.isArray(t)?t.forEach(t=>{t instanceof File?r.append(e,t):null!=t&&r.append(e,"object"==typeof t?JSON.stringify(t):t.toString())}):null!=t&&r.append(e,"object"==typeof t?JSON.stringify(t):t.toString())});let{data:o}=await n.post(`${sp.NEXT_PUBLIC.BASE_PATH}/_mintlify/api/file-request`,r);return o},sx=e=>{let t=e.body,n=e.header;if(n["content-type"]?.includes("multipart/form-data")){let e=new FormData;"object"==typeof t&&null!==t&&(Object.entries(t).forEach(([t,n])=>{n instanceof File?e.append(t,n):Array.isArray(n)?n.forEach(n=>{n instanceof File?e.append(t,n):null!=n&&e.append(t,"object"==typeof n?JSON.stringify(n):n.toString())}):null!=n&&e.append(t,"object"==typeof n?JSON.stringify(n):n.toString())}),t=e,delete n["content-type"])}return{data:t,headers:n}},sb=({apiReferenceData:t,baseUrl:n,selectedRequestBodyContentTypeIndex:r,setResult:o,label:i,method:a,className:s})=>{let[u,c]=(0,x.useState)(!1),p=(0,d.useSelectedLocale)(),f=(({apiReferenceData:t,baseUrl:n,contentType:r="application/json",setResult:o,setIsSending:l})=>{let i=(0,sf.useAnalyticsContext)("docs.api_playground.request"),a=(0,iv.usePlaygroundInputsStore)(e=>e.getApiPlaygroundInputs),s=t.operation?.isCobo,u=t.operation?.disableProxy,c=u&&t.operation?.withCredentials,d=t.operation?.path,p=t.operation?.method,f=t.dependencies?.requestBody?.content[r]?.schema,m=t.dependencies?.requestBody?.required;return(0,x.useCallback)(async()=>{let t,h=a();if(l(!0),!d||!n||!p||!r||!n){l(!1),o({error:!0,errorMessage:"Missing required fields to send a playground request"}),console.error(`Missing some required field to send a playground request: path=${d} method=${p} contentType=${r} baseUrl=${n}`);return}let g=await e.A(547846).then(e=>e.default),v=(0,ig.addPathParams)(d,h.path),y=(0,ig.joinWithSingleSlash)((0,ig.addServerVariables)(n,h.server),v),x=((e,t)=>Object.keys(e).some(e=>"content-type"===e.toLowerCase())?e:{...e,"content-type":t})(h.header,r);x=(e=>{if(!e.Authorization||"object"!=typeof e.Authorization)return e;if("object"==typeof e.Authorization){let t="username"in e.Authorization?e.Authorization.username:"",n="password"in e.Authorization?e.Authorization.password:"",r=(0,R.encodeBasicAuth)(t,n);e.Authorization=`Basic ${r}`,delete e.Authorization.username,delete e.Authorization.password}return e})(x);let b=h.body;(function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)})(b)&&f&&(0,R.isSchemaObject)(f)&&(b=(0,sm.stripOptionalObjectsWithEmptyRequiredFields)(b,f)),(0,ig.isJsonContentType)(r)||(b=(0,ig.omitNullValues)(b)),s&&(x=v.startsWith("/v1")?await sh({method:p,path:d,inputs:{...h,body:b},headers:x}):await sg(p,v,b,h.query,x)),void 0===b&&m&&(f&&"type"in f?("array"===f.type&&(b=[]),"object"===f.type&&(b={}),"string"===f.type&&(b="")):b={});let w={method:p,url:y,header:x,body:b,cookie:h.cookie,query:h.query},j=!1;try{if(u){let e=await sv({request:w,withCredentials:c});t=e.status,o({error:!1,response:{status:e.status,statusText:e.statusText,headers:e.headers,data:e.data}})}else if(r&&r.includes("multipart/form-data")){let e=await sy(w);"response"in e&&(t=e.response.status),o(e)}else{let{data:e}=await g.post(`${sp.NEXT_PUBLIC.BASE_PATH}/_mintlify/api/request`,w);"response"in e&&(t=e.response.status),o(e)}}catch(e){j=!0,o({error:!0,errorMessage:"unable to complete request"}),console.error(e)}l(!1),i({path:d,method:p,responseStatus:t,isError:j})},[p,d,l,a,n,r,s,f,m,i,u,o,c])})({apiReferenceData:t,baseUrl:n,contentType:(0,R.getRequestBodyContentType)(t,r),setResult:o,setIsSending:c});return(0,l.jsx)(iS.SendPill,{label:i,method:a,isSending:u,onClick:f,className:s,sendingRequestAriaLabel:p["aria.sendingRequest"]})},sw=({isPlaygroundExpanded:e,setIsPlaygroundExpanded:t,baseUrl:n,baseUrlOptions:r,apiReferenceData:o})=>{let{selectedBaseUrlIndex:i,setSelectedBaseUrlIndex:a}=(0,ey.useSelectedBaseUrl)(),{selectedRequestBodyContentTypeIndex:s,setSelectedRequestBodyContentTypeIndex:u}=(0,ew.useSelectedRequestBodyContentType)(),[c,p]=(0,x.useState)(),f=(0,d.useSelectedLocale)(),{selectedExampleIndex:m}=(0,iX.useSelectedExample)(),h=iB(e=>e.locallyStoredCredentials),g=iB(e=>e.setLocallyStoredCredentials),v=iB(e=>e.locallyStoredServerVariables),b=iB(e=>e.setLocallyStoredServerVariables),w=o.operation?.urlDisplay;(0,x.useEffect)(()=>{let e=!1;return b(iF()),(async()=>{let t=await (0,iD.loadCredentialStore)(iA);e||g(t)})(),()=>{e=!0}},[g,b]),function({apiReferenceData:e,selectedBaseUrlIndex:t,selectedExampleIndex:n,selectedRequestBodyContentTypeIndex:r,locallyStoredCredentials:o,serverInputs:l}){var i;let a=(0,x.useRef)(!1),s=(0,x.useRef)(!1),u=(0,x.useRef)(n);(0,x.useEffect)(()=>{if(a.current)return;let n=iv.usePlaygroundInputsStore.getState();n.reset();let i=iW({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:0,selectedExampleIndex:0,selectedContentTypeIndex:r,locallyStoredCredentials:o,serverInputs:l});n.initializeInputs(i),n.initializeApiReferenceData(e),a.current=!0,s.current=!!o,u.current=0},[]),(0,x.useEffect)(()=>{if(!a.current||s.current||!o)return;let n=iv.usePlaygroundInputsStore.getState(),i=iW({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n.selectedSecurityOptionIndex,selectedExampleIndex:n.selectedExampleIndex,selectedContentTypeIndex:r,locallyStoredCredentials:o,serverInputs:l});n.replaceInputs(i),s.current=!0},[o]),(0,x.useEffect)(()=>{var i;if(!a.current||u.current===n||!(null==(i=e.operation)?void 0:i.prefillPlaygroundWithExample))return;let s=iv.usePlaygroundInputsStore.getState();s.clear();let c=iW({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:s.selectedSecurityOptionIndex,selectedExampleIndex:n,selectedContentTypeIndex:r,locallyStoredCredentials:o,serverInputs:l});s.initializeInputs(c),u.current=n},[n,null==(i=e.operation)?void 0:i.prefillPlaygroundWithExample]);let c=(0,x.useRef)(l);c.current=l,(0,x.useEffect)(()=>{let n=(n,r)=>{!function({server:e,previousServer:t,apiReferenceData:n,selectedBaseUrlIndex:r,fallbackServerInputs:o}){var l,i,a,s,u,c,d,p;let f=null==(a=Object.values(null!=(i=null==(l=n.dependencies)?void 0:l.servers)?i:{})[r])?void 0:a.variables;if(!f||0===Object.keys(f).length)return;let m=null!=(c=null==(u=null==(s=n.operation)?void 0:s.userInfoPlaygroundInputs)?void 0:u.server)?c:{},{setInput:h,deleteInput:g}=iv.usePlaygroundInputsStore.getState();for(let[t,n]of Object.entries(e))f[t]&&h(`${O.apiPlaygroundInputKeys.server}.${(0,R.escapeDots)(t)}`,n);if(void 0!==t)for(let n of Object.keys(t)){if(n in e||!f[n])continue;let t=`${O.apiPlaygroundInputKeys.server}.${(0,R.escapeDots)(n)}`,r=f[n],l=null!==r&&"object"==typeof r?(0,R.getSchemaDefault)(r):void 0,i="string"==typeof l?l:void 0,a=null!=(p=null!=(d=null==o?void 0:o[n])?d:m[n])?p:i;void 0!==a?h(t,a):g(t)}}({server:n,previousServer:r,apiReferenceData:e,selectedBaseUrlIndex:t,fallbackServerInputs:c.current})};return n((0,iK.getExternalApiPlaygroundServerInputs)()),iK.useExternalApiPlaygroundInputsStore.subscribe((e,t)=>{n(e.server,t.server)})},[e,t])}({apiReferenceData:o,selectedBaseUrlIndex:i,selectedExampleIndex:m,selectedRequestBodyContentTypeIndex:s,locallyStoredCredentials:h,serverInputs:v?.[n]??{}}),(0,iN.useKeyboardShortcut)({key:"Escape",callback:e?()=>t(!1):void 0,isSingleKey:!0});let j=(0,x.useRef)(null),S=(0,x.useCallback)(()=>{let e=iB.getState();e.syncCredentialsState(),e.syncServerVariablesState(),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{j.current=null,iB.getState().updateLocalStorage(iA)},300)},[]);(0,x.useEffect)(()=>()=>{j.current&&(clearTimeout(j.current),iB.getState().updateLocalStorage(iA))},[]);let E=(0,x.useRef)(null),k=(0,x.useCallback)(()=>{E.current?.closest('[data-component-part="scroll-area-viewport"]')?.scrollTo({top:0})},[]),I=(({apiReferenceData:e,selectedContentTypeIndex:t})=>{let n=[],{parameters:r,requestBody:o}=e.dependencies??{};if(r&&Object.keys(r).length>0){let{header:t,path:r,query:o,cookie:l}=(0,R.getParametersPerSection)(e);[["header",t],["cookie",l],["path",r],["query",o]].forEach(([e,t])=>{let{optional:r}=ag(t);r.some(e=>(0,R.isSchemaObject)(e.schema))&&n.push(e)})}let l=Object.values(o?.content??{}).map(e=>e.schema).filter(R.isSchemaObject)[t];return l&&aw(l)>0&&n.push("body"),n})({apiReferenceData:o,selectedContentTypeIndex:s});if(!o.operation)return null;let{path:C,method:T,title:P,description:N,type:M}=o.operation,A=o.operation["x-mint"]?.playground?.expand;return(0,l.jsxs)(iT.PlaygroundModalWrapper,{isPlaygroundExpanded:e,setIsPlaygroundExpanded:t,children:[(0,l.jsx)("div",{className:"sticky top-0 z-50 bg-background-light dark:bg-background-dark px-4 pt-4 pb-2",children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-x-2",children:[(0,l.jsx)(iI.EndpointsMenu,{operation:{method:T,title:P}}),(0,l.jsx)(ij,{baseUrlOptions:r,selectedBaseUrlIndex:i,setSelectedBaseUrlIndex:a,display:"interactive",path:C,method:T,type:M,onBaseUrlChange:()=>{},isInPlaygroundModal:!0,urlDisplay:w}),(0,l.jsx)(sb,{apiReferenceData:o,baseUrl:n,selectedRequestBodyContentTypeIndex:s,setResult:p,label:f.send,method:T,className:"w-20"})]})}),(0,l.jsx)(ay,{resetKey:`${T}:${C}`,children:(0,l.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-x-8 gap-y-6 px-4 pt-3.5",children:[(0,l.jsxs)("div",{ref:E,className:"col-span-1 lg:col-span-3 pb-4",children:[(0,l.jsxs)("div",{className:"flex items-start gap-x-2",children:[(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(iC.ModalHeader,{title:P,description:N})}),(0,l.jsx)(aB,{sectionsWithOptionalFields:I,onExpandAll:k})]}),c&&(0,l.jsx)(ss,{result:c,className:"mt-6 block lg:hidden"}),(0,l.jsxs)("div",{className:"space-y-2 mt-6",children:[(0,l.jsx)(aK,{apiReferenceData:o,selectedBaseUrlIndex:i,updateLocalStorageCallback:S}),(0,l.jsx)(az,{apiReferenceData:o,updateLocalStorageCallback:S,defaultExpanded:A}),(0,l.jsx)(aU,{apiReferenceData:o,defaultExpanded:A}),(0,l.jsx)(aq,{apiReferenceData:o,selectedContentTypeIndex:s,setSelectedContentTypeIndex:u,defaultExpanded:A})]})]}),(0,l.jsxs)("div",{className:(0,y.cn)("col-span-1 lg:col-span-2 lg:space-y-6 lg:sticky lg:top-20 lg:self-start max-lg:pb-4",c&&"lg:flex lg:flex-col"),children:[c&&(0,l.jsx)(ss,{result:c,className:"hidden lg:block min-h-fit"}),(0,l.jsx)(iP.ApiExamples,{isModal:!0,"data-testid":"api-playground-request-example",className:"xl:w-full"})]})]})})]})},sj=({children:e})=>{let{openApiReferenceData:t}=(0,x.useContext)(v.OpenApiReferenceContext),{pageMetadata:n}=(0,x.useContext)(u.PageContext),{docsConfig:r}=(0,x.useContext)(u.DocsConfigContext),{isLivePreview:o,getDocsConfigOverrides:y}=(0,x.useContext)(c.LivePreviewContext),b=y(),w=(0,f.useUserGroups)(),j=(0,p.useMdxCodeExampleData)("request"),S=(0,p.useMdxCodeExampleData)("response"),{isChatSheetOpen:E}=(0,x.useContext)(g.ChatAssistantContext),k=(0,d.useSelectedLocale)(),O=(0,x.useMemo)(()=>({"api.example":k["api.example"],"api.examples":k["api.examples"],"aria.navigateToHeader":k["aria.navigateToHeader"],"api.default":k["api.default"],"api.required":k["api.required"],"api.deprecated":k["api.deprecated"],"aria.selectSchemaType":k["aria.selectSchemaType"],availableOptions:k.availableOptions,"api.title":k["api.title"],"api.const":k["api.const"],requiredRange:k.requiredRange,"api.mustBeMultipleOf":k["api.mustBeMultipleOf"],tryIt:k.tryIt,"aria.sendingRequest":k["aria.sendingRequest"],"aria.selectBaseUrl":k["aria.selectBaseUrl"],"tooltip.copy":k["tooltip.copy"],copied:k.copied,"api.body":k["api.body"],"api.headers":k["api.headers"],"api.pathParameters":k["api.pathParameters"],"api.queryParameters":k["api.queryParameters"],"api.cookies":k["api.cookies"],"api.response":k["api.response"],"api.callbacks":k["api.callbacks"],"api.authorizations":k["api.authorizations"],"api.scopes":k["api.scopes"],"api.oauth.flow":k["api.oauth.flow"],"api.oauth.authorizationCode":k["api.oauth.authorizationCode"],"api.oauth.authorizationUrl":k["api.oauth.authorizationUrl"],"api.oauth.tokenUrl":k["api.oauth.tokenUrl"],"api.oauth.callbackUrl":k["api.oauth.callbackUrl"],"api.oauth.clientId":k["api.oauth.clientId"],"api.oauth.clientSecret":k["api.oauth.clientSecret"],"api.oauth.optional":k["api.oauth.optional"],"api.oauth.connectPreview":k["api.oauth.connectPreview"]}),[k]),R=(0,x.useMemo)(()=>({Markdown:m.DynamicMarkdown,MarkdownWithoutHeaders:m.DynamicMarkdownWithoutHeaders}),[]),I=(0,x.useMemo)(()=>({CodeGroup:s.CodeGroup,CodeBlock:a.CodeBlock,CodeSnippet:i.CodeSnippet,CodeSnippets:iO.CodeSnippets,MdxCodeExample:iR.MdxCodeExample,CodeGroupSelect:ik.CodeGroupSelect}),[]);return t.operation?(0,l.jsx)(h.default,{children:(0,l.jsx)(iE,{apiReferenceData:t,pageMetadata:n,docsConfig:r,isLivePreview:o,docsConfigOverrides:b,userGroups:w,localeStrings:O,markdownComponents:R,Playground:sw,mdxRequestExampleData:j,mdxResponseExampleData:S,codeComponents:I,isChatSheetOpen:E,children:e})}):t.schemaData?(0,l.jsx)(h.default,{children:(0,l.jsx)(eh,{apiReferenceData:t,pageMetadata:n,docsConfig:r,localeStrings:O,markdownComponents:R,isLivePreview:o,children:e})}):null}},333233,e=>{e.n(e.i(82270))}]);