import{s as e}from"./rolldown-runtime-Bjp52BOI.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{Lr as t,dr as n,ur as r}from"./initial-vendor-CbfHqnih.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as i}from"./conditional-requirements-CFM0id0Q.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as a}from"./icon-Dt4VFpdV.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{pi as o,xi as s}from"./index-DiVFqI9q.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";var c=e(r(),1),l=e(t(),1),u={"api.example":`Example`,"api.examples":`Examples`,"aria.navigateToHeader":`Navigate to header`,"api.default":`default:`,"api.required":`required`,"api.deprecated":`deprecated`,"api.if":`if`,"api.unless":`unless`,"api.conditionallyRequired":`conditionally required`,"api.isSet":`is set`,"api.and":`and`,"api.or":`or`,"aria.selectSchemaType":`Select schema type`,availableOptions:`Available options`,"api.title":`Title`,"api.const":`Const`,requiredRange:`Required range`,"api.mustBeMultipleOf":`Must be a multiple of`,tryIt:`Try it`,"aria.sendingRequest":`Sending request...`,"aria.selectBaseUrl":`Select base URL`,"tooltip.copy":`Copy`,copied:`Copied`,"api.body":`Body`,"api.headers":`Headers`,"api.pathParameters":`Path Parameters`,"api.queryParameters":`Query Parameters`,"api.queryString":`Query String`,"api.cookies":`Cookies`,"api.response":`Response`,"api.streamItem":`Each item in the stream`,"api.callbacks":`Callbacks`,"api.authorizations":`Authorizations`,"api.scopes":`Scopes`,"api.oauth.flow":`Flow`,"api.oauth.authorizationCode":`Authorization Code`,"api.oauth.authorizationUrl":`Authorization URL`,"api.oauth.tokenUrl":`Token URL`,"api.oauth.callbackUrl":`Callback URL`,"api.oauth.clientId":`Client ID`,"api.oauth.clientSecret":`Client Secret`,"api.oauth.optional":`optional`,"api.oauth.connectPreview":`Connection is available after secure callback support is enabled.`},d=(0,l.createContext)({localeStrings:u}),f=({localeStrings:e,children:t})=>(0,c.jsx)(d.Provider,{value:{localeStrings:e},children:t}),p=()=>{let{localeStrings:e}=(0,l.useContext)(d);return e},m=(0,l.createContext)(void 0),h=({markdownComponents:e,children:t})=>(0,c.jsx)(m.Provider,{value:e,children:t}),g=()=>(0,l.useContext)(m),_=(0,l.createContext)(!1),v=_.Provider;function y(){return(0,l.useContext)(_)}var b=({markdown:e,className:t})=>{let r=g();if(!e||!r)return null;let{Markdown:i}=r;return(0,c.jsx)(i,{mode:`static`,className:n(`prose prose-sm prose-gray dark:prose-invert overflow-wrap-anywhere [&_*]:overflow-wrap-anywhere [&_ul]:list-none [&_ul>li]:before:top-[0.75em]`,`[&_li_p.whitespace-pre-line]:!my-0 [&_li.py-1]:!py-0 [&_li.py-1]:!my-2`,t),children:e})},x=(0,l.forwardRef)(({paramId:e,children:t,noBorder:r=!1,className:i},a)=>(0,c.jsx)(`div`,{ref:a,className:n(i,r?``:`border-gray-100 dark:border-gray-800 border-b last:border-b-0`),children:t},e)),S=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function C(e){return S(this,void 0,void 0,function*(){e||console.warn(`Called copyToClipboard() with empty text`);try{return yield navigator.clipboard.writeText(e),`success`}catch(e){return console.error(`Failed to copy: `,e),`error`}})}function w(){let e=getComputedStyle(document.documentElement).getPropertyValue(`--scroll-mt`),t=e.match(/[\d.]+/);if(!t)return 0;let n=parseFloat(t[0]);return e.includes(`rem`)?n*16:n}function T(e){let t=e.getBoundingClientRect(),n=w(),r=window.scrollY+t.top-n;window.scrollTo({top:r,behavior:`instant`})}function E({id:e,shouldReturnEarly:t,element:n,getElement:r,checkIfShouldScroll:i,preScrollCallback:a,postScrollCallback:o,isLivePreview:s}={}){if(typeof window>`u`||t)return;let c=window.location.hash.substring(1);if(!c&&!e)return;let l=n??r?.(e??c)??document.getElementById(e??c);l&&(i?.(l,c)??!0)&&(a?.(l),requestAnimationFrame(()=>{s?T(l):l.scrollIntoView(),o?.()}))}var D=({options:e,selectedIndex:t,onSelectOption:r,noBackground:i})=>{let o=p(),s=`opt-dd-${(0,l.useId)().replace(/:/g,``)}`,u=e.map((e,t)=>`#${s}:has(option[value="${t}"]:checked) ~ [data-idx="${t}"] { display: flex; }`).join(` `);return(0,c.jsx)(`div`,{className:n(`option-dropdown`,`inline-flex relative !mr-0`),children:(0,c.jsxs)(`div`,{className:n(`font-mono text-xs font-medium !inline-block !leading-4 items-center rounded-md [&>div]:ml-1.5 text-gray-600 dark:text-gray-200 py-0.5`,!i&&`bg-gray-100/50 dark:bg-white/5`),children:[(0,c.jsx)(`style`,{dangerouslySetInnerHTML:{__html:u}}),(0,c.jsxs)(`div`,{className:`group relative !inline-flex`,children:[(0,c.jsx)(`select`,{id:s,"aria-label":o[`aria.selectSchemaType`],className:`absolute inset-0 w-full h-full flex opacity-0 cursor-pointer focus:outline-0`,onChange:e=>r?.(e.target.selectedIndex),value:t,children:e.map((e,t)=>(0,c.jsx)(`option`,{value:t,children:e},t))}),e.map((e,t)=>(0,c.jsx)(`span`,{"data-idx":t,"aria-hidden":`true`,className:`hidden bg-transparent text-right pl-0.5 pr-8 group-hover:text-gray-950 dark:group-hover:text-white overflow-wrap-anywhere max-w-96`,children:e},t))]}),(0,c.jsx)(a,{icon:`angle-down`,iconType:`solid`,className:`absolute top-1/2 -translate-y-1/2 right-4 h-2.5 w-2.5 shrink-0 bg-gray-500 dark:bg-gray-400 pointer-events-none`,overrideColor:!0,overrideSize:!0})]})})};function O({name:e,typeLabel:t,location:r,required:a,conditionalRequirements:u,deprecated:d,fieldType:f,defaultValue:m,defaultValueDisplay:h,typeOptions:g,selectedTypeOptionIndex:_,onSelectTypeOption:v,parentName:b,id:x,pre:S,post:w,style:T,explode:O,isLivePreview:j}){let P=y(),{hasScrolledToAnchorRef:F}=(0,l.useContext)(o),I=p(),L=(0,l.useRef)(null),[R,z]=(0,l.useState)(!1),B=x??s(f,e,b),V=T===`deepObject`&&O,H=`${b??``}${e}${b&&V?`]`:``}`,U=(0,l.useCallback)(()=>{B&&(C(window.location.href.split(`#`)[0]+`#`+B),window.location.hash=B)},[B]);(0,l.useEffect)(()=>{let e=L.current;if(!e)return;function t(){let t=e?.offsetHeight??0;z(t>28)}t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.unobserve(e)}},[]),(0,l.useEffect)(()=>{E({id:B,shouldReturnEarly:!!F?.current||!B||!!b,isLivePreview:j,checkIfShouldScroll(e,t){return t===B},postScrollCallback(){F&&(F.current=!0)}})},[F,B,b,j]);let W=!a&&u?.length?i(u,{required:I[`api.required`],if:I[`api.if`],unless:I[`api.unless`],conditionallyRequired:I[`api.conditionallyRequired`],isSet:I[`api.isSet`],and:I[`api.and`],or:I[`api.or`]}):[],G=b?V?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`span`,{className:`text-gray-500 dark:text-gray-400`,children:b}),e,(0,c.jsx)(`span`,{className:`text-gray-500 dark:text-gray-400`,children:`]`})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`span`,{className:`text-gray-500 dark:text-gray-400`,children:b}),e]}):e;return e==null?null:(0,c.jsxs)(`div`,{className:`flex font-mono text-sm group/param-head param-head break-all`,id:B,children:[B&&!P&&(0,c.jsx)(`a`,{href:`#${B}`,className:n(`anchor-link`,b&&`-ml-[2.1rem] pr-[0.6rem]`),"aria-label":`${I[`aria.navigateToHeader`]}: ${H}`,onClick:U}),(0,c.jsx)(`div`,{className:`flex-1 flex flex-col content-start py-0.5 mr-5`,children:(0,c.jsxs)(`div`,{className:`flex items-center flex-wrap gap-2`,children:[S?.map((e,t)=>(0,c.jsx)(`div`,{className:`px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200`,"data-component-part":`field-meta-pre`,children:e},t)),(b||e)&&(0,c.jsx)(`div`,{className:n(`font-semibold text-primary dark:text-primary-light overflow-wrap-anywhere`,!P&&`cursor-pointer`),"data-component-part":`field-name`,onClick:P?void 0:U,children:G}),(0,c.jsxs)(`div`,{ref:L,className:n(`inline items-center gap-2 text-xs font-medium [&_div]:inline [&_div]:mr-2`,R?`[&_div]:leading-6`:`[&_div]:leading-5`),"data-component-part":`field-meta`,children:[g&&g.length>1&&v?(0,c.jsx)(D,{options:g,selectedIndex:_,onSelectOption:v}):t&&(0,c.jsx)(k,{children:t}),r&&(0,c.jsx)(k,{children:r}),(h!==void 0||m!=null)&&(0,c.jsx)(k,{prefix:I[`api.default`],children:h??(typeof m==`string`?m===``?`""`:m:JSON.stringify(m))}),a&&(0,c.jsx)(A,{label:I[`api.required`]}),W.map(e=>(0,c.jsx)(M,Object.assign({requiredLabel:I[`api.required`]},e),e.full)),d&&(0,c.jsx)(N,{label:I[`api.deprecated`]}),w?.map((e,t)=>(0,c.jsx)(`div`,{className:`px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200`,"data-component-part":`field-meta-post`,children:e},t))]})]})})]},B)}var k=({children:e,prefix:t,className:r})=>(0,c.jsxs)(`div`,{className:n(`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`,r),"data-component-part":`field-info-pill`,children:[t&&(0,c.jsx)(`span`,{className:`text-stone-400 dark:text-stone-500`,children:t}),(0,c.jsx)(`span`,{children:e})]}),A=({label:e})=>e?(0,c.jsx)(`div`,{className:`whitespace-nowrap rounded-md bg-red-100/50 px-2 py-0.5 font-medium text-red-600 dark:bg-red-400/10 dark:text-red-300`,"data-component-part":`field-required-pill`,children:e}):null,j=`whitespace-nowrap rounded-md bg-red-100/50 px-2 py-0.5 font-medium text-red-600 dark:bg-red-400/10 dark:text-red-300`,M=({requiredLabel:e,kind:t,segments:n,label:r,full:i})=>t===`generic`?(0,c.jsx)(`div`,{className:j,"data-component-part":`field-conditional-required-pill`,children:r}):(0,c.jsxs)(`div`,{className:`break-normal leading-6 text-gray-500 dark:text-gray-400`,"data-component-part":`field-conditional-required`,title:r===i?void 0:i,children:[(0,c.jsx)(`span`,{className:j,"data-component-part":`field-conditional-required-pill`,children:e}),n.map((e,t)=>(0,c.jsxs)(l.Fragment,{children:[!e.code&&e.text===`,`?``:` `,e.code?(0,c.jsx)(`span`,{className:`whitespace-nowrap rounded-md bg-gray-100/50 px-1.5 py-0.5 text-gray-600 dark:bg-white/5 dark:text-gray-200`,children:e.text}):(0,c.jsx)(`span`,{className:`whitespace-nowrap`,children:e.text})]},t))]}),N=({label:e})=>e?(0,c.jsx)(`div`,{className:`whitespace-nowrap rounded-md bg-amber-100/50 px-2 py-0.5 font-medium text-amber-600 dark:bg-amber-400/10 dark:text-amber-300`,"data-component-part":`field-deprecated-pill`,children:e}):null,P=({title:e,subtitle:t,rightElement:r,options:i,selectedIndex:a,onSelectOption:o,withPadding:s=!1,children:l})=>(0,c.jsxs)(`div`,{className:n(`api-section-heading`,`flex flex-col gap-y-4 w-full`),children:[(0,c.jsxs)(`div`,{className:`flex items-baseline border-b pb-2.5 border-gray-100 dark:border-gray-800 w-full`,children:[(0,c.jsx)(`h4`,{className:n(`api-section-heading-title`,`flex-1 mb-0`),children:e}),i&&i.length>1&&(0,c.jsx)(D,{options:i,selectedIndex:a,onSelectOption:o,noBackground:!0}),(0,c.jsx)(`div`,{className:`flex items-center`,children:r&&(typeof r==`string`?(0,c.jsx)(`div`,{className:`font-mono px-2 py-0.5 text-xs font-medium text-gray-600 dark:text-gray-300`,children:r}):r)})]}),l,t?(0,c.jsx)(`div`,{className:n(`api-section-heading-subtitle`,`text-sm prose prose-gray dark:prose-invert mb-2`),children:(0,c.jsx)(b,{markdown:t})}):s?(0,c.jsx)(`div`,{}):null]});export{C as a,v as c,f as d,p as f,E as i,h as l,N as n,x as o,O as r,b as s,P as t,u};